Commit Graph

2 Commits

Author SHA1 Message Date
David Guillen Fandos bc0a3cf2c1 Fix big endian targets state unserialize
Converted palette was missing a byte swap after state unserialization
This should likely fix WiiU graphics when using rewind and similar
techniques that rely on states.
2021-11-20 11:00:42 +01:00
David Guillen Fandos 7068cbc95b New savestate implementation
This uses BSON as savestate format, to allow external tools to parse it
(so that we can add proper test of the states). The BSON is not 100%
correct according to spec (no ordered keys) but can be parsed by most
libraries.

This fixes also a bug in the savestate palette color recalculation that
was wrongly overwritting the original palette (which could cause some
problems on some games).

Also fixes some potential issues by serializing some more stuff and
cleans up unused stuff.

Testing shows that states look good and there's only minor differences
in audio ticks, related to buffer sizes (since buffer flushes are
de-synced from video frames due to different frequency).
2021-08-24 17:15:27 +02:00