Restoration of prior pgusinit functionality:
- Case insensitive command line switches
- Bail out if there are errors detecting the card
- Bail out on firmware mismatch, but allow flashing new firmware
More QoL improvements:
- Generic paging interface that detects rows on screen
- /? and /?? are paged
- /cdlist uses new paging interface
More clean up to main(). I am finding there is some overlap with the term "mode" which indicates the global card mode (ex. SB_MODE, GUS_MODE, etc) as well as register modes communicating with PicoGUS. The next commit I will probably spend some time distinguishing these two types for clarity.
Refactored the inline argument commands into functions that iterate through a command table. This should help make input commands more robust and easier to expand.
It also allows for default values when setting options. For example if the user wants a default value for the OPL port, they can use "/oplport default".
Since /sbport and /gusport always check the environment for SET BLASTER and SET ULTRASND, I added the function for pgusinit to retrieve these values from the environment directly. This could open up environment parsing for other variables in the autoexec.bat.
The commands should behave exactly as I did when they were inline to start, but can now easily be expanding.
- Fix memory leak when changing images (file handle not freed)
- Longer max file length limit (127 chars)
- Better errors when USB not present
- Fix polling of CD status register when listing images
- Add ability to load image by name
- Many weird edge cases with image loading state fixed