2019-07-02 10:49:30 -04:00
|
|
|
; 8K of onboard RAM
|
|
|
|
.equ RAMSTART 0xc000
|
|
|
|
; Memory register at the end of RAM. Must not overwrite
|
|
|
|
.equ RAMEND 0xfdd0
|
|
|
|
|
|
|
|
jp init
|
2019-07-01 11:05:25 -04:00
|
|
|
|
|
|
|
.fill 0x66-$
|
|
|
|
retn
|
|
|
|
|
2019-10-06 14:32:23 -04:00
|
|
|
.inc "err.h"
|
2019-11-13 20:38:06 -05:00
|
|
|
.inc "ascii.h"
|
2019-10-06 14:32:23 -04:00
|
|
|
.inc "core.asm"
|
2019-11-14 09:55:31 -05:00
|
|
|
.inc "str.asm"
|
2019-07-02 11:14:30 -04:00
|
|
|
|
2019-07-02 10:49:30 -04:00
|
|
|
.equ PAD_RAMSTART RAMSTART
|
2019-10-06 14:32:23 -04:00
|
|
|
.inc "sms/pad.asm"
|
2019-07-02 09:02:19 -04:00
|
|
|
|
2019-10-06 14:32:23 -04:00
|
|
|
.inc "sms/vdp.asm"
|
2020-02-24 20:36:08 -05:00
|
|
|
.equ GRID_RAMSTART PAD_RAMEND
|
|
|
|
.equ GRID_COLS VDP_COLS
|
|
|
|
.equ GRID_ROWS VDP_ROWS
|
|
|
|
.equ GRID_SETCELL vdpSetCell
|
2020-02-26 16:27:27 -05:00
|
|
|
.equ GRID_GETC padGetC
|
2020-02-24 20:36:08 -05:00
|
|
|
.inc "grid.asm"
|
2019-07-02 10:49:30 -04:00
|
|
|
|
2020-02-24 20:36:08 -05:00
|
|
|
.equ STDIO_RAMSTART GRID_RAMEND
|
2020-02-26 16:27:27 -05:00
|
|
|
.equ STDIO_GETC gridGetC
|
2020-02-24 20:36:08 -05:00
|
|
|
.equ STDIO_PUTC gridPutC
|
2019-10-06 14:32:23 -04:00
|
|
|
.inc "stdio.asm"
|
2019-07-02 11:14:30 -04:00
|
|
|
|
2019-12-02 20:18:41 -05:00
|
|
|
; *** BASIC ***
|
|
|
|
|
|
|
|
; RAM space used in different routines for short term processing.
|
2019-12-12 12:04:56 -05:00
|
|
|
.equ SCRATCHPAD_SIZE STDIO_BUFSIZE
|
2019-12-02 20:18:41 -05:00
|
|
|
.equ SCRATCHPAD STDIO_RAMEND
|
2019-11-15 15:37:49 -05:00
|
|
|
.inc "lib/util.asm"
|
2019-12-02 20:18:41 -05:00
|
|
|
.inc "lib/ari.asm"
|
2019-11-15 15:37:49 -05:00
|
|
|
.inc "lib/parse.asm"
|
2019-12-02 20:18:41 -05:00
|
|
|
.inc "lib/fmt.asm"
|
|
|
|
.equ EXPR_PARSE parseLiteralOrVar
|
|
|
|
.inc "lib/expr.asm"
|
|
|
|
.inc "basic/util.asm"
|
|
|
|
.inc "basic/parse.asm"
|
|
|
|
.inc "basic/tok.asm"
|
|
|
|
.equ VAR_RAMSTART SCRATCHPAD+SCRATCHPAD_SIZE
|
|
|
|
.inc "basic/var.asm"
|
|
|
|
.equ BUF_RAMSTART VAR_RAMEND
|
|
|
|
.inc "basic/buf.asm"
|
|
|
|
.equ BAS_RAMSTART BUF_RAMEND
|
|
|
|
.inc "basic/main.asm"
|
2019-07-02 11:14:30 -04:00
|
|
|
|
2019-07-02 10:49:30 -04:00
|
|
|
init:
|
2019-07-02 09:02:19 -04:00
|
|
|
di
|
|
|
|
im 1
|
|
|
|
|
2019-07-02 10:49:30 -04:00
|
|
|
ld sp, RAMEND
|
2019-07-01 11:05:25 -04:00
|
|
|
|
2020-02-24 20:36:08 -05:00
|
|
|
call gridInit
|
2019-07-02 11:14:30 -04:00
|
|
|
call padInit
|
2019-07-02 10:49:30 -04:00
|
|
|
call vdpInit
|
2019-12-02 20:18:41 -05:00
|
|
|
call basInit
|
|
|
|
jp basStart
|
2019-07-01 11:05:25 -04:00
|
|
|
|
2020-01-07 22:14:00 -05:00
|
|
|
FNT_DATA:
|
|
|
|
.bin "fnt/7x7.bin"
|
|
|
|
|
2019-07-01 11:05:25 -04:00
|
|
|
.fill 0x7ff0-$
|
|
|
|
.db "TMR SEGA", 0x00, 0x00, 0xfb, 0x68, 0x00, 0x00, 0x00, 0x4c
|