johannes-fetz / joengine

Jo Engine is an open source 2D and 3D game engine for the Sega Saturn written in C under MIT license
http://jo-engine.org/
MIT License
208 stars 32 forks source link

Backup: BUP_SelPart() Support #40

Closed slinga-homebrew closed 3 years ago

slinga-homebrew commented 4 years ago

Hi Johannes,

For my Save Game Copier a user is reporting an issue with the Saturn Floppy Disk Drive attachment. The Saturn FDD saves to two partitions (0 and 1). Currently the Jo Engine backup functions do not have a way to select the partition to use. I have created a branch of Save Game Copier which manually sets the device and partition for the floppy drive to use partition 1. See here: https://github.com/slinga-homebrew/Save-Game-Copier/tree/fdd-partition.

It looks like the device id and partition are accessible in the jo_backup_config struct. So one option would be for the jo_backup functions to loop through each of the partitions when doing any read, write, or delete operation. For example something like:

for(int i = 0; i <= backupConfig.partitions; i++) { // do bup operation ... }

What are your thoughts? It would trigger a jo_core_error() if you try to delete a file that is on the device but not correct partition.

johannes-fetz commented 3 years ago

I'll check that