ld a, #':'
out (0x2f), a
+; Select RAM subslot in all pages
+ ld a,(0xffff) ; Subslot register
+ cpl
+ and #0xc0 ; RAM subslot (RAM in page 3)
+ ld e, a
+ rrca ; Propogate into other pages
+ rrca
+ or e
+ rrca
+ rrca
+ or e
+ rrca
+ rrca
+ or e
+ ld (0xffff),a ; All pages with the same subslot
in a, (0xA8)
ld d, a
and #0x0C ; bits for 0x4000
ld b, a
- rla
- rla ; to 0x8000
+ rlca
+ rlca ; to 0x8000
or b ; and 0x4000
- rla
- rla ; to 0xC000/8000
+ rlca
+ rlca ; to 0xC000/8000
or b ; and 0x4000
ld b, a ; B is now the bits for
; putting 48K of cartridge
; in place
+; Select RAM in page 0
+ ld a,d ; Page 3 must be RAM
+ and #0xc0
+ rlca
+ rlca
+ or b ; Pages 3-1 = Cartridge, Page 0 = RAM
out (0xA8), a ; Map cartridge
+
+; Select the subslot of the cartridge in pages 3, 2, 1
+ ld a, (0xffff)
+ cpl
+ and #0x0C ; Cartridge in page 1
+ ld c, a
+ rlca
+ rlca ; to 0x8000
+ or c ; and 0x4000
+ rlca
+ rlca ; to 0xC000/8000
+ or c ; and 0x4000
+ ld (0xffff), a ; Select the subslot of the cartridge
+
ld a, #3
out (0xFC), a ; Begin mapping RAM
ld a, #'1'
out (0xA8), a ; Now go all ram
jp 0x100
- ; Hack Hack FIXME
- .ds 0x72
+ ; Put start at 0x100 so we can boot the MSXDOS .com too
+ ; Hack
+ .ds 0x49