mirror of
https://github.com/mgcaret/of816.git
synced 2024-11-19 13:30:48 +00:00
95 lines
1.8 KiB
ArmAsm
95 lines
1.8 KiB
ArmAsm
|
; Platform support library for Neon816
|
||
|
;
|
||
|
|
||
|
cpu_clk = 14000000
|
||
|
|
||
|
.proc _system_interface
|
||
|
;wdm 3
|
||
|
phx
|
||
|
asl
|
||
|
tax
|
||
|
jmp (table,x)
|
||
|
table: .addr _sf_pre_init
|
||
|
.addr _sf_post_init
|
||
|
.addr _sf_emit
|
||
|
.addr _sf_keyq
|
||
|
.addr _sf_key
|
||
|
.addr _sf_fcode
|
||
|
.addr _sf_reset_all
|
||
|
.endproc
|
||
|
.export _system_interface
|
||
|
|
||
|
.proc _sf_success
|
||
|
lda #$0000
|
||
|
tay
|
||
|
clc
|
||
|
rtl
|
||
|
.endproc
|
||
|
|
||
|
.proc _sf_fail
|
||
|
ldy #.loword(-21)
|
||
|
lda #.hiword(-21)
|
||
|
sec
|
||
|
rtl
|
||
|
.endproc
|
||
|
|
||
|
|
||
|
.proc _sf_pre_init
|
||
|
plx
|
||
|
jmp _sf_success ; we'll see what we need to do
|
||
|
.endproc
|
||
|
|
||
|
.proc _sf_post_init
|
||
|
plx
|
||
|
jmp _sf_success
|
||
|
.endproc
|
||
|
|
||
|
.proc _sf_emit
|
||
|
plx ; get forth SP
|
||
|
jsr _popay ; grab the top item
|
||
|
phx ; and save new SP
|
||
|
; TODO: interact with the hardware here
|
||
|
plx
|
||
|
jmp _sf_success
|
||
|
.endproc
|
||
|
|
||
|
.proc _sf_keyq
|
||
|
ldy #$0000 ; anticipate false
|
||
|
; TODO: interact with the hardware here, set y to FFFF if char available
|
||
|
tya
|
||
|
plx
|
||
|
jsr _pushay
|
||
|
jmp _sf_success
|
||
|
.endproc
|
||
|
|
||
|
.proc _sf_key
|
||
|
; TODO: interact with hardware, wait for char, get it into Y
|
||
|
lda #$0000
|
||
|
plx
|
||
|
jsr _pushay
|
||
|
jmp _sf_success
|
||
|
.endproc
|
||
|
|
||
|
.proc _sf_fcode
|
||
|
.if include_fcode
|
||
|
ldy #.loword(list)
|
||
|
lda #.hiword(list)
|
||
|
.else
|
||
|
lda #$0000
|
||
|
tay
|
||
|
.endif
|
||
|
plx
|
||
|
jsr _pushay
|
||
|
jmp _sf_success
|
||
|
.if include_fcode
|
||
|
list:
|
||
|
.dword 0
|
||
|
.endif
|
||
|
.endproc
|
||
|
|
||
|
; TODO....
|
||
|
.proc _sf_reset_all
|
||
|
plx
|
||
|
jmp _sf_fail
|
||
|
.endproc
|