woz64/main.asm

90 lines
1.9 KiB
NASM
Raw Normal View History

2019-11-18 03:28:54 +00:00
BasicUpstart2(start)
2019-11-06 04:31:17 +00:00
* = $8000 "Main"
// Constants
.namespace constants {
2019-11-10 03:10:52 +00:00
.label MAIN_COLOR = $05
.label BORDER_COLOR = $03
.label SCREEN_MEM = $0400
2019-11-06 04:31:17 +00:00
}
.word coldstart // coldstart vector
2019-11-10 03:10:52 +00:00
.word start // start vector
.byte $C3,$C2,$CD,'8','0' //..CBM80..
2019-11-06 04:31:17 +00:00
2019-11-10 03:10:52 +00:00
#import "screen.asm"
2019-11-16 22:09:22 +00:00
#import "keyb2.asm"
2019-11-10 03:10:52 +00:00
#import "hex.asm"
2019-11-17 07:41:00 +00:00
#import "shell.asm"
2019-11-10 03:10:52 +00:00
2019-11-16 22:09:22 +00:00
* = * "Kernel Start"
2019-11-06 04:31:17 +00:00
coldstart:
2019-11-10 03:10:52 +00:00
ldx #$FF
2019-11-06 04:31:17 +00:00
sei
2019-11-10 03:10:52 +00:00
txs
cld
2019-11-06 04:31:17 +00:00
stx $d016
jsr $fda3 // Prepare IRQ
jsr $fd50 // Init memory. Rewrite this routine to speed up boot process.
jsr $fd15 // Init I/O
jsr $ff5b // Init video
cli
start:
jsr initApp;
print(testString)
2019-11-10 03:10:52 +00:00
2019-11-16 22:09:22 +00:00
loop:
lda #$FF
2019-11-17 07:41:00 +00:00
Raster: cmp $D012
2019-11-16 22:09:22 +00:00
bne Raster
jsr Keyboard2.ReadKeyb
jsr Keyboard2.GetKey
bcs Skip
2019-11-17 07:41:00 +00:00
cmp #$0d
bne inputChar
2019-11-16 22:09:22 +00:00
2019-11-17 07:41:00 +00:00
// Execute Item
jsr Shell.push
jsr Shell.wozExec
2019-11-17 08:52:55 +00:00
jsr Screen.screenNewLine
jsr Screen.screenNewLine
2019-11-17 07:41:00 +00:00
jsr Shell.clear
jmp loop
2019-11-18 03:28:54 +00:00
inputChar:
2019-11-17 07:41:00 +00:00
jsr Shell.push
2019-11-10 03:10:52 +00:00
cPrint()
2019-11-16 22:09:22 +00:00
Skip: jmp loop
2019-11-06 04:31:17 +00:00
initApp: {
ClearColorRam($00)
2019-11-10 03:10:52 +00:00
ClearScreen(constants.SCREEN_MEM, ' ')
SetBorderColor(constants.MAIN_COLOR)
SetBackgroundColor(constants.BORDER_COLOR)
2019-11-06 04:31:17 +00:00
jsr Screen.init
2019-11-16 22:09:22 +00:00
jsr Keyboard2.init
2019-11-17 07:41:00 +00:00
jsr Shell.init
2019-11-06 04:31:17 +00:00
rts
}
2019-11-16 22:09:22 +00:00
* = * "Kernel Data"
2019-11-06 04:31:17 +00:00
.encoding "screencode_mixed"
testString:
2019-11-17 08:52:55 +00:00
.text "woz64 - v 0.1.5a"
2019-11-16 22:09:22 +00:00
.byte $8e
2019-11-17 08:52:55 +00:00
.text "----------------------------------------"
.byte $8e, 0
2019-11-06 04:31:17 +00:00
* = $9FFF "EpromFiller"
.byte 0