dangiu / PicoMemcard

Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico
GNU General Public License v3.0
528 stars 38 forks source link

Card creation fix #55

Closed realJoshByrnes closed 1 year ago

realJoshByrnes commented 1 year ago

At present, it's almost impossible to have more than 10 memory cards without a PC. This PR fixes the issue where 2 digit (eg. "10.MCR") filenames are not created correctly, and also fixes the (unreported) issue where a file could not be created if one of the previous files were corrupted (eg. wrong-size).

Basically, this patch will attempt to brute force the creation of a file, until it finds a filename which does not exist. This may take a short while if you have thousands of cards, and may cause issues if exceeding the filename limit after 9999999999999999999999999999.MCR cards - so don't create more than 10 octillion cards.

I suspect this may be significantly faster than the previous method, although I have not tested speed.

Fixes #40

realJoshByrnes commented 1 year ago

@dangiu Thoughts?

dangiu commented 1 year ago

With this many improvements it's about time to get a new release. Sorry for taking so long to get back to you.