mirror of https://github.com/stid/woz64.git
132 lines
3.7 KiB
NASM
132 lines
3.7 KiB
NASM
//BasicUpstart2(start)
|
|
#import "mem_map.asm"
|
|
|
|
* = $8000 "Main"
|
|
|
|
//------------------------------------------------------------------------------------
|
|
.const MAIN_COLOR = $03
|
|
.const BORDER_COLOR = $05
|
|
.const SCREEN_MEM = $0400
|
|
.const CR = $0d
|
|
.const BS = $14
|
|
|
|
//------------------------------------------------------------------------------------
|
|
.word coldstart // coldstart vector
|
|
.word start // start vector
|
|
.byte $C3,$C2,$CD,'8','0' //..CBM80..
|
|
|
|
//------------------------------------------------------------------------------------
|
|
#import "screen.asm"
|
|
#import "keyb2.asm"
|
|
#import "shell.asm"
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Main Program
|
|
//------------------------------------------------------------------------------------
|
|
* = * "Kernel Start"
|
|
|
|
coldstart:
|
|
ldx #$FF
|
|
sei
|
|
txs
|
|
cld
|
|
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:
|
|
//sei
|
|
|
|
jsr initApp;
|
|
print(testString)
|
|
loop:
|
|
lda #$FF
|
|
Raster: cmp $D012
|
|
bne Raster
|
|
jsr Keyboard2.ReadKeyb
|
|
jsr Keyboard2.GetKey
|
|
bcs loop
|
|
|
|
cmp #CR
|
|
beq cr
|
|
|
|
cmp #BS
|
|
beq backspace
|
|
inputChar:
|
|
jsr Shell.push
|
|
cPrint()
|
|
jmp loop
|
|
backspace:
|
|
jsr Shell.backspace
|
|
cPrint()
|
|
jmp loop
|
|
cr:
|
|
jsr Shell.push
|
|
jsr Screen.screenNewLine
|
|
jsr Shell.wozExec
|
|
jsr Screen.screenNewLine
|
|
jsr Shell.clear
|
|
jmp loop
|
|
|
|
//------------------------------------------------------------------------------------
|
|
initApp: {
|
|
|
|
sei
|
|
lda #$7f
|
|
sta $dc0d // disable timer interrupts which can be generated by the two CIA chips
|
|
sta $dd0d // the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
|
|
// stop it.
|
|
|
|
lda $dc0d // by reading this two registers we negate any pending CIA irqs.
|
|
lda $dd0d // if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
|
|
// we don't want that to happen.
|
|
|
|
// Disable 0e TIMER
|
|
lda #254
|
|
and $dc0e
|
|
sta $dc0e
|
|
|
|
ClearColorRam($00)
|
|
ClearScreen(SCREEN_MEM, ' ')
|
|
SetBorderColor(BORDER_COLOR)
|
|
SetBackgroundColor(MAIN_COLOR)
|
|
jsr Screen.init
|
|
jsr Keyboard2.init
|
|
jsr Shell.init
|
|
cli
|
|
rts
|
|
}
|
|
|
|
//------------------------------------------------------------------------------------
|
|
* = * "Hoax"
|
|
hoax: {
|
|
print(hoaxString)
|
|
jmp loop
|
|
}
|
|
|
|
//------------------------------------------------------------------------------------
|
|
* = * "Kernel Data"
|
|
|
|
.encoding "screencode_mixed"
|
|
|
|
version: .byte 00
|
|
revision: .byte 01
|
|
minor: .byte 05
|
|
|
|
testString:
|
|
.text "woz64 mon - v 0.1.5"
|
|
.byte $8e
|
|
.text "----------------------------------------"
|
|
.byte $8e, 0
|
|
hoaxString:
|
|
.text "=stid= 1972"
|
|
.byte $8e, 0
|
|
|
|
* = $9FFF "EpromFiller"
|
|
.byte 0
|
|
|
|
|