msx2: initial bootstrap debugging
authorAlan Cox <alan@etchedpixels.co.uk>
Wed, 5 Nov 2014 00:08:32 +0000 (00:08 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Wed, 5 Nov 2014 00:08:32 +0000 (00:08 +0000)
We get as far as enabling interrupts then curl up and die. The VDP
programming also doesn't set text80 but does produce some interesting
flashing blobs

Kernel/platform-msx2/crt0.s
Kernel/platform-msx2/msx2.s
Kernel/platform-msx2/vdp.s

index dbab60f..14bd2a2 100644 (file)
                .globl s__INITIALIZER
                .globl kstack_top
 
-               ; startup code @0
+               ; Just for the benefit of the map file
+               .globl start
+
+               ; startup code @0x100
                .area _CODE
 
 ;
 ; Execution begins with us correctly mapped and at 0x0x100
 ;
 start:         di
+               ; Debug port
+               ld a, #0x23
+               out (0x2e), a
+               ld a, #'@'
+               out (0x2f), a
                ld sp, #kstack_top
                ; move the common memory where it belongs    
                ld hl, #s__INITIALIZER
index 6a94bdc..608e856 100644 (file)
            .globl _vdpport
            .globl _infobits
 
+           ;
+           ; vdp - we must initialize this bit early for the vt
+           ;
+           .globl vdpinit
+
             .include "kernel.def"
             .include "../kernel.def"
 
@@ -79,15 +84,17 @@ _trap_reboot:
             .area _CODE
 
 init_early:
-           ld a, #0x33                 ; multibyte/ascii
-           out (0x2E), a
+           ld a, #'F'
+           out (0x2F), a
             ret
 
 init_hardware:
+           ld a, #'U'
+           out (0x2F), a
            ; save the useful bits of low memory first
            ld hl, (0x2B)
            ld (_infobits), a
-           ld a, (0x06)
+           ld a, (0x07)
            ld (_vdpport), a
 
            ; Size RAM
@@ -100,8 +107,17 @@ init_hardware:
             call _program_vectors
             pop hl
 
+           ld a, #'Z'
+           out (0x2F), a
+
             im 1                       ; set CPU interrupt mode
            call _vtinit                ; init the console video
+
+           ld a, #'I'
+           out (0x2F), a
+           call  vdpinit
+           ld a, #'X'
+           out (0x2F), a
             ret
 
 
@@ -133,7 +149,6 @@ ramscan:
 ramwrapped:
            ld a, #3
            out (c), a
-           ld a, (hl)
            ld (hl), #0x55
            out (c), b
            ld a, (hl)
@@ -169,7 +184,7 @@ pageslt256:
 
            ; set system RAM size in KB
            ld (_ramsize), hl
-           ld de, #0xFFC0
+           ld de, #0xFFD0
            add hl, de          ; subtract 48K for the kernel
            ld (_procmem), hl
            ret
index 77bac44..d6aad92 100644 (file)
 
            .globl _vdpport
 
+           .globl vdpinit
+
            .area _CODE
 ;
 ;      Register write value E to register A
 ;
 vdpout:            ld bc, (_vdpport)
-           out (c), e
-           out (c), d
+           ld bc, #0x98 ; hardcode for the moment
+           inc c                       ; Write port
+           out (c), e                  ; Write the data
+           out (c), d                  ; and then the register | 0x80
            ret
 
 ;
-;      FIXME: table.. and move into init ROM
+;      FIXME: table.. and move into init RAM
 ;
 vdpinit:    ld de, #0x8004             ; M4 }
            call vdpout                 ;    }  80x25 mode