
Little file, big difference
While doing some minor tweaking on the firmware, I almost accidentally came up with a nice and straightforward way of turning the Retrode to some extent user-configurable. The root directory now contains a plain text file named
[retrodeConfig]
; Remove first line for factory reset.
; Hex keycodes for (in this order) B Y SEL STA UP DN LFT RGT A X L R
; See usb.org/developers/devclass_docs/Hut1_11.pdf (pp.53ff)
[gamepad1] 06 1B 28 2C 52 51 50 4F 09 07 04 16
[gamepad2] 10 11 05 19 33 37 36 38 0E 0D 0A 0B
[filenameChksum] 1 ; checksum in filename?
[sramReadonly] 1 ; write protect SRAM by default
[segaRomExt] bin
[snesRomExt] sfc
[snesSramExt] srm
The file resides in the nonvolatile EEPROM and can be edited using any text editor. This is particularly neat for the gamepad keycode assignments, since saving the file will effectuate the changes immediately.
Implementing this (in particular, the parsing of the config file) may take a few hours, but this is actually so simple that I don’t see how it could possibly fail was actually more of a bitch than I thought it would be. Once I figured out that the C library comes with sscanf and the likes, things obviously got a lot easier :-D
EDIT: Added configurable file extensions.


In response to this:
I think you didn’t understand what I meant. The extension “.SGD” is the official extension SEGA used internally when handling what the internet knows as generic “.BIN” files. Both are the same thing, but SGD is the “proper” extension that nobody knew about, until some old, official SEGA ROMs were recently unveiled.
In fact, some emus are starting to accomodate to this, and start supporting “.SGD” as a valid file type, since “.BIN” is too generic and can refer to any raw dump of anything.
Okay, point taken. You know what? I’ll just make it user-configurable :-)
Cool!