ducalex / retro-go

Retro emulation for the ODROID-GO and other ESP32 devices
GNU General Public License v2.0
543 stars 125 forks source link

Fallback to internal flash storage #119

Closed tomvanbraeckel closed 3 months ago

tomvanbraeckel commented 3 months ago

If no other storage options succeeded, then always look for an internal flash partition labelled "vfs" to mount for storage, as suggested in #114.

This also changes the expected internal flash storage partition label from "storage" to "vfs" as that's what MicroPython uses (hard-coded) and on the Fri3D Camp badge, there is one storage partition used by both MicroPython and retro-go.

ducalex commented 3 months ago

The fallback to flash shouldn't be part of the main #if ... #elif block, it should be after. Check how I did in my example https://github.com/ducalex/retro-go/blob/4ed74d04edac7a09d5e8814d3b8b3e3800e6b4c6/components/retro-go/rg_storage.c#L160-L179. Your code doesn't have to be identical (I've spotted of a few bugs in mine already ;_;) but the gist is that it allows the SD Card to be tried first (if the target defines it), then falls back to flash.

Also can you revert the changes made in targets' config.h? I think we'll keep driver 4 as being reserved to mean flash is the only driver wanted!

tomvanbraeckel commented 3 months ago

Done! Indeed there was a bug in the error handling :-)

ducalex commented 3 months ago

Mm, I've merged the PR a bit prematurely... I wanted the flash block to be moved down from the main preproc block, so that it is always built on ESP_PLATFORM.

See https://github.com/ducalex/retro-go/commit/237f8d735b4ab2ab913cbbe7d9ac2aac58da1c76, let me know if I broke anything for you!

ducalex commented 3 months ago

Nevermind, fallback wasn't a good idea (at least for now), reverted https://github.com/ducalex/retro-go/commit/7a6e74728d205bb9bba56bcd7efc10b3d23cca31. I'm sorry for "stealing" the "blame" in the process for the lines you've written... It's my bad, I should have tested before.

tomvanbraeckel commented 3 months ago

No problem!

I assume you mean the total package (launcher+retro-core+prboom-go+gwenesis+fmsx) and then, indeed, 4MB is tight :-) Also, Duke Nukem 3D probably will explode the size ;-)

I have some thoughts/questions about the build size in general but that's for another topic :-D

ducalex commented 3 months ago

Yeah Duke3D will likely be around 1MB, at which point I'll have to decide what to leave out for devices with 4MB... Probably stuff that doesn't run well like snes (200KB) and genesis (960KB). There's also MSX (500KB) that very few people would miss. And finally networking in the launcher, which adds ~600KB.

All that to say that if you do get duke to run well, it will be a first class citizen :)