The C source code is simple as shown below.
Code: Select all
#include <stdio.h>
#include <msx.h>
void main()
{
msx_screen(1);
printf("Test Program..");
while(1){
}
}
Code: Select all
$ zcc +msx -lmsxbios -create-app -subtype=rom -o test.rom test.c
Code: Select all
$ openmsx test.rom
The size of the ROM created is 16KB. So I expected the address map would be as follows.
0x0000 (Page0) : Slot 0
0x4000 (Page1) : Slot 1 (Created ROM)
0x8000 (Page2) : Slot 3-2 RAM
0xc000 (Page3) : Slot 3-2 RAM
However, the actual result is as follows.
0x0000 (Page0) : Slot 0
0x4000 (Page1) : Slot 1 (Created ROM)
0x8000 (Page2) : Slot 1 (Created ROM ?)
0xc000 (Page3) : Slot 3-2 RAM
The following code was included at the beginning of the INIT entry of the created ROM when viewed in the debugger.
...
Code: Select all
start:
4010 di
4011 ld sp,(#fc4a)
4015 ei
4016 in a,(#a8)
4018 and #cf
401A ld d,a
401D and #0c
401F add a,a
4020 add a,a
4021 or d
4022 out (#a8),a
This seems to me to make the slot of Page2 the same slot as Page1.
Why is this process inserted? Is it necessary?