bootrom: Some corrections from Manuel Pazos
authorAlan Cox <alan@etchedpixels.co.uk>
Mon, 10 Nov 2014 21:53:08 +0000 (21:53 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Mon, 10 Nov 2014 21:53:08 +0000 (21:53 +0000)
Plus some tidying of them to match the sdcc assembler

Still doesn't work but its hopefully closer now

Kernel/platform-msx1/bootrom.s

index f7db4fc..951b0c6 100644 (file)
@@ -15,20 +15,55 @@ wtfami:             di
                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
-               rl                    ; to 0x8000
+               rlca
+               rlca                    ; to 0x8000
                or b                    ; and 0x4000
-               rla
-               rl                    ; 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'
@@ -90,5 +125,6 @@ ramgo:               ld a, #'!'
                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