mirror of https://github.com/bsnes-emu/bsnes.git
Fix SGB save states
This commit is contained in:
parent
32c781c531
commit
a0671bc8a9
|
@ -3,13 +3,17 @@ auto ICD::serialize(serializer& s) -> void {
|
|||
|
||||
auto size = GB_get_save_state_size(&sameboy);
|
||||
auto data = new uint8_t[size];
|
||||
s.array(data, size);
|
||||
if(s.mode() == serializer::Load) {
|
||||
GB_load_state_from_buffer(&sameboy, data, size);
|
||||
}
|
||||
|
||||
if(s.mode() == serializer::Save) {
|
||||
GB_save_state_to_buffer(&sameboy, data);
|
||||
}
|
||||
|
||||
s.array(data, size);
|
||||
|
||||
if(s.mode() == serializer::Load) {
|
||||
GB_load_state_from_buffer(&sameboy, data, size);
|
||||
}
|
||||
|
||||
delete[] data;
|
||||
|
||||
for(auto n : range(64)) s.array(packet[n].data);
|
||||
|
|
Loading…
Reference in New Issue