hey @zep! bug report:
0x5f54 (spritesheet remapping) is not resetting properly when I press ctrl-R in a running cart.
(The value at 0x5f54 is correct after resetting, but the data in the spritesheet is wrong)
I didn't test 0x5f55 or 0x5f56
minimal example
function _init() --move first row of sprites to bank 0x80 memcpy(0x8000, 0x0000, 64*8) --clear spritesheet to blue stripes memset(0x0000, 0xcd, 0x2000) end function _draw() cls() --draw sprite 0 from bank 0x80 poke(0x5f54,0x80) spr(0,0,0) --reset sprite banks -- poke(0x5f54,0x00) --uncomment this to work around the bug end |
Run this cart and mash ctrl-R: sprite 0 will only be drawn on the very first run. On all other runs it will be blue/lavender stripes
slightly larger example
Still pretty small, but it has a bit of extra code to narrow down why the behavior isn't working right
Repro steps:
- download and run the cart locally. you should see a cat
- press ctrl-R while the cart is running, you should see no cat and "bad pixel 0" (bug!)
- repeat step 2, should see the same thing again ("bad pixel 0" etc)
- press Escape, so the command prompt starts flashing. press ctrl-R. you should see a cat
There's a bit of PRINTH output too (a hexdump of the start of the spritesheet) that you can see if you run the cart with an attached console
My system is pico8 0.2.7 / linux. The bug also exists in web and binary exports.
Thanks to @mogwaipoet for noticing this bug
[Please log in to post a comment]




