Although I know I tested the memset16()
presented earlier, one instruction miraculously disappeared when
posting it here. There should have been an `mov r12, r1'
in the initializing of the registers for the stmia. I have no idea where it
disappeared to, but with this fix the routine should run properly.
I've been having a number of this sort of errors lately, actually. I've also
recently found out that the shared-tileset in the current distribution is
broken because of a single character that handles it in
grit_prep_map. This:
if(gr->img_flags & GRIT_IMG_SHARED)
rdxDib= grit_tile_reduce(&mapRec, tileDib, flags, NULL);
else
rdxDib= grit_tile_reduce(&mapRec, tileDib, flags, gr->shared->dib);
should have been this:
if(~gr->img_flags & GRIT_IMG_SHARED)
rdxDib= grit_tile_reduce(&mapRec, tileDib, flags, NULL);
else
rdxDib= grit_tile_reduce(&mapRec, tileDib, flags, gr->shared->dib);
The missing ~ means that the the code did exactly the
wrong thing. And again, during testing I had it right (cue Twilight-zone theme).