Home | Forums | What's new | Resources | |
[help]Precautions to take with SBL source code |
cafe-alpha - Nov 4, 2010 |
Amon | Nov 5, 2010 | |||
Wasn't there a custom made ip.bin? Or do all the ip.bins have sega code in them? |
ExCyber | Nov 10, 2010 | |||||||||||
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 * 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:
(the name "aipbase" should be ignored; it doesn't actually make sense) And the hex for slapping into an IP.BIN:
Code:
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. |
antime | Nov 10, 2010 | |||||
IIRC the AIP isn't run until the first read file has been loaded (at least according to the documentation). |
ExCyber | Nov 10, 2010 | ||||||||
It seems kind of contradictory on that point:
This could simply mean that the 3.5-second limit is a requirement imposed upon developers by Sega and the code itself will wait for as long as it takes, but I haven't tested it. I think it would be difficult to exceed that limit without a failing CD-ROM drive or a damaged disc, anyway. |