Comments (5)
I debuged the sizes (total from retro_serialize_size and the independent sizes for each GB) and the sizes are correct
from sameboy.
I just realized my state code for 2 gbs has an error
bool retro_serialize(void *data, size_t size)
{
if (!initialized)
return false;
void* save_data[2];
size_t state_size[2];
for (int i = 0; i < emulated_devices; i++)
{
state_size[i] = GB_get_save_state_size(&gameboy[i]);
save_data[i] = (uint8_t*)malloc(state_size[i]);
GB_save_state_to_buffer(&gameboy[i], (uint8_t*) save_data[i]);
memcpy(data + (state_size[i] * i), save_data[i], state_size[i]);
free(save_data[i]);
}
if (data)
return true;
else
return false;
}
memcpy(data + (state_size[i] * i), save_data[i], state_size[i]);
Would offset based on the next state size, so I fixed that now like this:
bool retro_serialize(void *data, size_t size)
{
if (!initialized)
return false;
void* save_data[2];
size_t state_size[2];
size_t offset = 0;
for (int i = 0; i < emulated_devices; i++)
{
state_size[i] = GB_get_save_state_size(&gameboy[i]);
save_data[i] = (uint8_t*)malloc(state_size[i]);
GB_save_state_to_buffer(&gameboy[i], (uint8_t*) save_data[i]);
memcpy(data + offset, save_data[i], state_size[i]);
offset += state_size[i];
free(save_data[i]);
}
if (data)
return true;
else
return false;
}```
Seems better at least but the crash persists.
from sameboy.
I've noticed this before and forgot to fix it :( I'll have a look when I'm back from work.
from sameboy.
Can't reproduce this on macOS, even with libgmalloc. Can you test again with the latest code, and attach the new crashlog along side with the crashing SameBoy DLL?
from sameboy.
Nope, the latest changes fixed it!
Still crashes on rewinding but that's probably separate and related to the change you reported in RA
from sameboy.
Related Issues (20)
- Windows/Linux Version: SO MANY FEATURES MISSING
- SameBoy iOS Installation? HOT 5
- [GBS] Aladdin (Game Boy Color, 2000) - no audio
- Option to change Super Game Boy palettes HOT 1
- Hang when starting a ROM in a non-writable dir HOT 3
- Put automation results in a separate repo? HOT 3
- Library access to raw APU channel volumes HOT 4
- iOS App Feature Requests HOT 2
- IOS Rom Library HOT 3
- Custom borders feature request (libretro)
- Cannot undo load state on the auto-loaded state (RetroArch/Libretro) HOT 2
- Better SGB+GBC support (RetroArch/libretro) HOT 4
- PCM playback buzz audible in SameBoy but not on GBA SP
- android question HOT 1
- Documentation about command line arguments HOT 1
- Controller not detected if connected while SameBoy is running. HOT 2
- Add VGM logging support
- Pocket Monsters - Pikachu has graphical issues when played on CGB mode HOT 4
- VRAM Viewer tabs not present in MacOS Sonoma
- v0.15.8 Crash `EXC_BAD_ACCESS` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sameboy.