implemented WAIT command

This commit is contained in:
FeralChild64 committed 2020-12-04 22:21:05 +01:00
1 parent 64c2def140
commit da11de3729
5 files changed
+84 -4

No files matched your search

@@ -27,8 +27,6 @@ cmd_return:
+nop
cmd_on:
+nop
cmd_wait:
+nop
cmd_def:
+nop
cmd_printhash:
-1
View File
@@ -5,7 +5,6 @@
cmd_poke:
; Fetch address, store it on the stack
jsr fetch_uint16
+62
View File
@@ -0,0 +1,62 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * BASIC_0 #TAKE
;; #LAYOUT# * * #IGNORE
cmd_wait:
; Fetch address, store it on the stack
jsr fetch_uint16
+bcs do_SYNTAX_error
lda LINNUM+0
pha
lda LINNUM+1
pha
; Fetch 1st value, store it on the stack
jsr fetch_coma_uint8
+bcs do_SYNTAX_error
pha
; Fetch 2nd value
jsr fetch_coma_uint8
bcc @1
lda #$00
@1:
; Put all the values into work area
sta INDEX+3
pla
sta INDEX+2
pla
sta INDEX+1
pla
sta INDEX+0
!ifdef CONFIG_MB_M65 {
jsr helper_eggshell
}
ldy #$00
; FALLTROUGH
cmd_wait_loop:
; Wait for the congition to be met - see https://www.c64-wiki.com/wiki/WAIT
lda (INDEX), y
eor INDEX+3
and INDEX+2
beq cmd_wait_loop
; FALLTROUGH
cmd_wait_end:
rts
@@ -0,0 +1,19 @@
;; #LAYOUT# M65 BASIC_0 #TAKE
;; #LAYOUT# M65 BASIC_1 #TAKE
;; #LAYOUT# * * #IGNORE
helper_eggshell:
!ifdef SEGMENT_M65_BASIC_0 {
jsr map_BASIC_1
jsr (VB1__helper_eggshell)
jmp map_NORMAL
} else {
; XXX implement till Easter
rts
}
@@ -26,9 +26,10 @@
!addr VB1__cmd_sysinfo = $4000 + 2 * 11
!addr VB1__prepare_direct_execution = $4000 + 2 * 12
!addr VB1__helper_ask_if_sure = $4000 + 2 * 13
!addr VB1__helper_eggshell = $4000 + 2 * 14
!ifdef CONFIG_DOS_WEDGE {
!addr VB1__wedge_dos = $4000 + 2 * 14
!addr VB1__wedge_dos = $4000 + 2 * 15
}
} else {
@@ -49,6 +50,7 @@
!word cmd_sysinfo
!word prepare_direct_execution
!word helper_ask_if_sure
!word helper_eggshell
!ifdef CONFIG_DOS_WEDGE {
!word wedge_dos