OK, I just looked at the loading process in Mednafen.
So the 2 IPL sectors are loaded into RAM $2800-$37FF.
Right. Keep in mind that there is a split in the ipl though; part of it is data, part of it is boot code....
The contents of $2800-$2D1F are verified as a valid IPL (the signature).
Right. That's the first half of the ipl.
Then the code jumps to $2B26 to actually run some code before loading/running the game program/data that is specified in the IPL.
Not sure about the addresses, but ok. The code that gets run has been verified as the NEC boot code. That part loads the graphics, etc. Can't change it, or the boot fails.
So you've actually got 736 bytes of space for your own code in there if you don't overwrite that area with boot code.
Again, not sure about the size, but ok.
Now, in those 736 bytes, you can do what you want, pretty much. Soooo, let's say you load another couple of sectors at $3000, and jump to it. Those sectors could be your menu program....
Or other code....
All in all, I think it shows a lot of thought. And I can see where it could do a lot of the things a HuC program does when it starts up....
I was thinking for a second that your code inside the IPL would run while loading the main program code .
Unfortunately not; I think the main program gets loaded last (maybe first), iirc. That is, assuming its not running from the ipl area, though maybe the main code gets loaded anyway. Don't quote me on that, though; it's been a long time since I did that stuff....
What I do remember is splitting the ipl into 2 parts; one part contained stuff that got verified - it had to match what was in bios for the cd to work. The other part contained the data described in the ipl doc. I then disassembled the actual startup code to see how it worked...and that's when I found a check for the execution address being in the RAM page, which allowed me to run the bouncing logo routine. Except for the size constraint, I realized I could probably use any bios calls I wanted - including loading more code into ram.
fwiw, I actually had a test ipl that would check the cd card, and boot different programs for the 2.0 and 3.0 cards. Kind of gave up on that, since I would have to keep 2 different versions of things in sync, but the idea was to run a low-quality version and a higher-quality version of the same program, depending on which card it was running on....