Now that we've got a rough disassembly of the MSX 2 Boot ROM, let's take a look at what it's trying to do
First, we know from the MSX Red Book that the first thing the machine is going to try to do is determine where it's RAM is located in the slots. We only know that the boot ROM/basic ROM exists in Slot 0 at Page 0 by requirement of the spec
0x0000
DI Disable Interrupts
JP 0x0416 Jump to 0x0416 to continue
0x0416
XOR A A = 0
OUT 0xFF, A Set Memory Mapper segement for Page 3 to 0
INC A A += 1; A = 1
OUT 0xFE, A Set Memory Mapper segment for Page 2 to 1
INC A A += 1; A = 2
OUT 0xFD, A Set Memory Mapper segment for Page 1 to 2
INC A A += 1; A = 3
OUT 0xFC, A Set Memory Mapper segment for Page 0 to 3
LD A, 0x08 A = 8
OUT 0xBB, A Write 8 to the Light Pen interface?
LD A, 0x82 A = 0x82
OUT 0xAB, A Set PPI mode for MSX standard (should not be changed once set)
A&C Mode = 0 - Normal Mode
A Dir = 0 - Output
C Dir = 0 - Output (upper 4 bits)
B&C Mode = 0 - Normal Mode
B Dir = 1 - Input
C Dir = 0 - Output (lower 4 bits)
XOR A A = 0
OUT 0xA8, A Write Slot Selectors all to 0
JP 0x7BD2 Jump to 0x7BD2 to continue
0x7BD2
LD A, 0x50 A = 0x50
OUT 0xAA, A Writes selectors into Port C
Key Click = 0 - Off
Cap LED = 1 - Off
Casette Out = 0 - Off
Casette Motor = 1 - Off
Keyboard Row Select = 0
; This next block sets up the Mode registers
; First we write the data byte to the command register
; Then we write the register ID we want to work with; 0-7
; The first bit in 0x89 tells the VDP that we're writing to a register
; and not setting an address
; We write the value 0x02 into register 1 which sets the mode
; 4kb chips, blank off, interrupts disabled, 32x24 Text Mode, 16x16 pattern, normal magnification
LD A, 0x02 A = 0x02
OUT 0x99, A Write 2 to the VDP Command Port
LD A, 0x89 A = 0x89
OUT 0x99, A W
JP 0x7BBE
0x7BBE
LD HL, A0F9 HL = 0xA0F9
That's where we'll stop for now. Interfacing with the VDP is kind of a black box currently, but something we can look into. The Documentation references I/O Ports but that may be in relationship with an MSX machine and the parallel interface ports. What we'd need to do is look at how the systems are actually wired and what that all means
For now though, this gives us a good start, and shows us where our Game Boy opcodes differ from a Z80 and what should be done differently. We also have enough of a setup now where we could start experimenting with racing the beam and doing some real NTSC experimentation with digitization of the signal with a clock, which may be the more interesting thing to look into next
Anyway, need to wrap this up and start a new one and stop just carrying this on forever
See you in the next one