floooh / chips

8-bit chip and system emulators in standalone C headers
zlib License
974 stars 73 forks source link

Glitch after snapshot save and load #79

Open leiradel opened 1 year ago

leiradel commented 1 year ago

Not sure what could be the cause, but saving the state and loading it back is causing a glitch in Tiny Dungeons. This is before saving:

image

When the state is loaded back, the player character goes away:

image

I can move it around and play normally, but it's invisible now. My load and save routines are pretty straightforward: evaluate the pointer offsets, and dump the zx_t structure after the magic number when saving, do the opposite when loading. It seems to be working just fine except for this glitch.

I decided to give this a try because the .z80 quick save that I have in a branch was also presenting the glitch, and I thought it could be related to the format not being able to capture the entire state of a Speccy emulator (a known limitation of the format). I tried the .z80 snapshot both compressed and uncompressed with the same result.

I tested with Fuse and it works ok.

Thanks in advance.

leiradel commented 1 year ago

I'll try with other games tomorrow and see if something comes up.

Oh, I loved zx_display_info() returning a palletized image, now I can create a RGB565 framebuffer instead of a XRGB8888 and pass less data around.