The extra 8 bytes aren't used for anything, so it's just padding. It also expects the table to be 0x38 bytes in length instead of 0x30 bytes. In cartridge games, it's relative to the start of SDRAM, but for CD mode 2 games, it's the direct SDRAM address. The load address is also treated differently. Once that's done, what is expected is the SH-2 program info table to be stored at the top of frame buffer memory, followed immediately by the SH-2 program data. It waits for the Genesis to send "_CD_" via a communication register. Nop JMP is delayed, so it runs this before jumpingīasically, if a cartridge isn't found, it'll skip the code that runs the security check and reads the SH-2 program info table from cartridge, and instead go to that code. Mov.l r0, r11, vbr Set vector table address Mov.l #'M_OK, r0 Mark master SH-2 as ready Sub r2, r3 Decrement bytes left in frame bufferĬmp/eq r4, r3 Have we reached the end of the frame buffer?Ĭmp/eq #0, r0 Have we reached the end of the program?īf loc_2FC If not, copy more program data Sub r2, r0 Decrement bytes left in program data Mov.l r1 Read program data from frame buffer Mov.l #h'1FFE0, r3 Number of bytes left in frame buffer (shouldn't it be h'1FFC8?) Mov.l r11 Get master SH-2 vector table addressĪdd #h'20, r8 Go to program data in frame buffer Mov.l #h'24000018, r8 Go to SH-2 program load information Mov.b r0, r0 Wait for access to be granted Mov #h'FFFFFF80, r0 Get access to the 32X VDP/frame buffer Mov.l #'_CD_, r1 Wait for the Genesis to send "_CD_" Of course, because the flag has to be nonzero in order to do the subroutine thing, this means you cannot use the "SYS", "SUB", or "DAT" module names for that. Otherwise, it'll go on to checking the next module, skipping setting up a jump table altogether.įrom what I have gathered, this is used mainly by the boot process in the BIOS. If it's set, then it'll parse whatever jump table is pointed to in a1. When it returns from the subroutine, it'll check the carry flag. It's jumped to as soon as the flag is found to be nonzero, so the routine will actually run BEFORE the system program's proper initialization routine! Like the proper system program initialization routine, the Mega Drive interrupt is disabled, so do keep that in mind. If you set it to a nonzero value, the start address will actually be treated as a subroutine that the BIOS will jump to and return from. While the manual will tell you to simply ignore it, it actually does have a function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |