2019-07-20 05:45:13 +10:00
|
|
|
; 8K of onboard RAM
|
|
|
|
.equ RAMSTART 0xc000
|
|
|
|
; Memory register at the end of RAM. Must not overwrite
|
2019-07-26 04:23:13 +10:00
|
|
|
.equ RAMEND 0xddd0
|
2019-07-20 05:45:13 +10:00
|
|
|
|
|
|
|
jp init
|
|
|
|
|
|
|
|
.fill 0x66-$
|
|
|
|
retn
|
|
|
|
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "err.h"
|
2019-11-14 12:38:06 +11:00
|
|
|
.inc "ascii.h"
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "core.asm"
|
2019-11-15 01:55:31 +11:00
|
|
|
.inc "str.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "sms/kbd.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
.equ KBD_RAMSTART RAMSTART
|
2019-07-26 04:23:13 +10:00
|
|
|
.equ KBD_FETCHKC smskbdFetchKCB
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "kbd.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
|
|
|
|
.equ VDP_RAMSTART KBD_RAMEND
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "sms/vdp.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
|
|
|
|
.equ STDIO_RAMSTART VDP_RAMEND
|
2019-11-05 01:55:12 +11:00
|
|
|
.equ STDIO_GETC kbdGetC
|
|
|
|
.equ STDIO_PUTC vdpPutC
|
2019-10-07 05:32:23 +11:00
|
|
|
.inc "stdio.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
|
2019-11-16 07:37:49 +11:00
|
|
|
; *** Shell ***
|
|
|
|
.inc "lib/util.asm"
|
|
|
|
.inc "lib/parse.asm"
|
|
|
|
.inc "lib/args.asm"
|
|
|
|
.inc "lib/stdio.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
.equ SHELL_RAMSTART STDIO_RAMEND
|
|
|
|
.equ SHELL_EXTRA_CMD_COUNT 0
|
2019-11-16 07:37:49 +11:00
|
|
|
.inc "shell/main.asm"
|
2019-07-20 05:45:13 +10:00
|
|
|
|
|
|
|
init:
|
|
|
|
di
|
|
|
|
im 1
|
|
|
|
|
|
|
|
ld sp, RAMEND
|
|
|
|
|
|
|
|
; Initialize the keyboard latch by "dummy reading" once. This ensures
|
|
|
|
; that the adapter knows it can fill its '164.
|
|
|
|
; Port B TH output, high
|
|
|
|
ld a, 0b11110111
|
|
|
|
out (0x3f), a
|
|
|
|
nop
|
|
|
|
; Port A/B reset
|
|
|
|
ld a, 0xff
|
|
|
|
out (0x3f), a
|
|
|
|
|
|
|
|
call kbdInit
|
|
|
|
call vdpInit
|
|
|
|
call shellInit
|
|
|
|
jp shellLoop
|
|
|
|
|
|
|
|
.fill 0x7ff0-$
|
|
|
|
.db "TMR SEGA", 0x00, 0x00, 0xfb, 0x68, 0x00, 0x00, 0x00, 0x4c
|
|
|
|
|