-
Notifications
You must be signed in to change notification settings - Fork 3
ROM loading issues with larger ROMs #1
Comments
Do you mean >200kb? I think the 512kb SRAM could potentially be a hard limit here. Maybe we could look at moving the cart to the flash memory on load and use it from there, but I'm not sure how that would impact performance. It also looks like there are some minor things we could tweak to hopefully allow loading of 256kb roms. For example it looks like we are using a framebuffer for the full resolution of the cardputer, but a decent chunk isn't used due to the aspect ratio. |
Oops! Yeah I meant KB, my bad Addressing a few things here:
With that said thanks for your interest! Sadly as I've already said in this reddit post I won't really be able to get to trying any of this right now as I'm pretty busy with school :( |
Also please do correct me if I'm wrong with any of what I wrote, I'm definitely not an expert here and I'd love to learn more lol |
Issue Description
Trying to load ROMs larger than ~200 KBs in size causes a crash before emulation can even start, logging an error in the
read_rom_to_ram
function before (presumably) the ESP32's crash handler resets the device.Theories on why this happens
The SD Card API functions (specifically the
File.readBytes
method) expects achar*
(akaint8_t*
) as a buffer to write the file data to, but Peanut-GB wants the ROM to be an array ofuint8_t
s.Since I'm a bad programmer this was my solution:
I think this somehow breaks when ROMs are too big, where loading the ROM into RAM exceeds the Cardputer's 512 KB of SRAM. At the same time, I only log that message when the
read_rom_to_ram
function returnsNULL
, so the function is definitely reaching its end.I don't really have the time or energy to look into or debug this much since I'm busy with school right now, but since other people seem to be interested in Game Boy emulation on the Cardputer I think this would be a good place for other people (who probably have a better understanding of C than me) to potentially fix this issue.
The text was updated successfully, but these errors were encountered: