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
.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
.globl _vdpport
.globl _infobits
+ ;
+ ; vdp - we must initialize this bit early for the vt
+ ;
+ .globl vdpinit
+
.include "kernel.def"
.include "../kernel.def"
.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
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
ramwrapped:
ld a, #3
out (c), a
- ld a, (hl)
ld (hl), #0x55
out (c), b
ld a, (hl)
; 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
.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