Creating a MSX ROM in C with SDCC

Pagina 2/2
1 |

Van aoineko

Master (172)

afbeelding van aoineko

08-10-2021, 21:23

Hum... I didn't really answer the question in fact. ^^

For the 0x0000 - 0x3FFF addresses, yes the page 0 is pointing to the BIOS slot by default so the only solution to access RAM at this address is switch this page to RAM slot (only available for MSX with at least 64K of RAM).

Indeed, it is necessary to pay attention to the interrupts because at each of them (especially those coming from the VDP), a jump to the address 0x0038 will take place. If the data at this address are invalid, this can cause the MSX to crash.
If you want to access this memory space for a short time, it is not too problematic to disable interrupts. But if you are making a at-the-frame action game you might miss a v-blank.

Personally, I use a 48K ROM installed on pages 0 to 2 (with RAM on page 3). So I put in my ROM in 0x0038, a jump to my own interrupt handling function (ISR). The advantage is that I don't have any page switch to manage. The disadvantage is that you can't use the BIOS functions anymore (personally I don't care because I don't use the BIOS at all and I have recoded all the functions I need).

Pagina 2/2
1 |