cafe-alpha said:
In SaturnOrbit's `COMMON' folder, it is possible to recompile IP.BIN, but they use SGL's sys_*.o files, which are probably sega copyrighted, and their sources are not available.
I have never heard about an other way to build IP.BIN, so if anyone know something else about this, please let us know
It's not possible to build a working IP.BIN that contains no Sega code, unless you require something like a custom BIOS or an AR firmware with custom boot code (and then the AR firmware still must have the Sega code...). There is a certain section of code in the IP.BIN area that is compared, byte-for-byte, with a copy in the BIOS. If it does not match exactly, the disc is not booted. This is the code that displays the "Produced by or under license from Sega Enterprises" screen. Sega CD and Dreamcast use similar systems, and later models of the Genesis / Mega Drive had a version where the actual code was only in the console boot ROM and just checked the cartridge header for a "SEGA" string before running it. This is what the "SYS_SEC.O" file contains, although it is probably better to not use Sega's version of that file if you don't need to, as only the final binary contents that end up in the IP.BIN are actually required.
If you want to be as legal as possible, you might want to write your own "Application Initial Program" (the code after the area strings, basically offset 0xE00 + (0x20 * <number of regions>), e.g. 0xF00 if using "JTUBKAEL" or 0xE80 if using "JTUE"), or at least check to make sure that the one you're using is not actually Sega code.
Okay, I couldn't resist: I just wrote a tiny one. It could be a few bytes shorter, but this loads the entry point specified in the IP.BIN instead of just assuming that it's 0x06004000.
Code:
mov.l aipbase, r0
mov.l @r0, r0
jmp @r0
.align 2
aipbase:
.long 0x060020F0
(the name "aipbase" should be ignored; it doesn't actually make sense)
And the hex for slapping into an IP.BIN:
Code:
d0 01 60 02 40 2b 00 09 06 00 20 f0
I can't guarantee that this is really robust (in particular it might cause problems if the binary takes too long to load), but it does seem to work for the couple of homebrew ISOs I had handy.
And just for concreteness: I hereby disclaim all copyrights and other rights of authorship in the above code and place it in the public domain.
Actually, I don't believe that it's eligible for copyright in the first place (if I just told you the algorithm, what would you do differently?), but whatever.
edit: it seems to cause Rockin'-B All Stars to hang on the Atlas splash screen. I'm not sure why. Maybe SGL expects some runtime stuff to be set up in the AIP.
edit again: okay, it hangs on Yabause 0.9.10 but not Yabause trunk, so I have no idea what's going on.