Boot Loader

slinga

Member
How would I make a 100-in-1 or similar thing for the saturn? Basically I want multiple games on one cd. When you boot the cd, I want to get a menu. I'm sure it's possible, I just don't know have any idea how to get C or C++ to execute another file...
 

ExCyber

Staff member
Unfortunately, I'm far from being an expert on GCC/SGL. Here's what I do know:

The initial load process is not that complex. Getting a program to load with the standard Saturn bootstrap code is simply a matter of making sure that it is the first file in the CD filesystem - the better mastering programs (e.g. mkisofs) have some way to specify file order, others can usually be persuaded to put a file first by making sure that the filename starts with a sufficient number of zeroes to make it sort first alphabetically.

The menu program itself should probably be compiled to run from low work RAM, because it should be able to overwrite the default program load area in high work RAM at 6004000 (where the typical initial game program is going to want to sit). For GCC-compiled programs, this probably requires a modified linker script, and there may also be some potential SGL conflicts. The easiest way to make this work is probably to make the initial boot program a second-stage bootloader that loads the menu to low work RAM. I'm pretty sure that there's an SGL function to load/execute a new program, but I don't have the reference handy right now and I'm stuck on a rather slow dialup - check antime's site for the SGL structure/function reference if you don't have it.

If any of your programs need to load additional files, it would probably be a good idea to make them load from subdirectories, or (if possible) use relative paths when loading so that the entire program can be put into a subdirectory. If you intend to load preexisting games, avoiding filename and CDDA mixups might require some creative hex editing. :
:
 
Top