rewind2: animate at 10Hz

This commit is contained in:
Vince Weaver 2025-03-24 21:00:58 -04:00
parent 1d56d92266
commit b77f5a966f
3 changed files with 17 additions and 7 deletions

View File

@ -103,6 +103,7 @@ qload.inc: generate_common QLOAD
# ./generate_common -a 0x1200 -s do_wipe_center qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_page1_clearscreen qload.lst >> qload.inc
./generate_common -a 0x1200 -s hgr_page2_clearscreen qload.lst >> qload.inc
./generate_common -a 0x1200 -s check_timeout qload.lst >> qload.inc
####

View File

@ -46,6 +46,9 @@ dancing:
; wait a bit
animate_loop:
lda #5
sta IRQ_COUNTDOWN
bit PAGE1
ldy DANCE_COUNT
@ -61,7 +64,12 @@ animate_loop:
; ldx #$70
jsr copy_to_400
jsr wait_until_keypress
; jsr wait_until_keypress
wait_10hz:
jsr check_timeout
bcc wait_10hz
inc DANCE_COUNT
lda DANCE_COUNT

View File

@ -23,10 +23,11 @@ setup_timeout:
rts
;===========================
; countodown second timeout
; countodown 50Hz timer
; also check for keypress
;===========================
; carry set = done
check_timeout:
; check keyboard first
lda KEYPRESS
@ -40,14 +41,14 @@ check_timeout:
timeout_not_keypress:
lda IRQ_COUNTDOWN
bne done_check_timeout_notdone
irq_countdown_zero:
lda SECOND_COUNTDOWN
;irq_countdown_zero:
; lda SECOND_COUNTDOWN
beq done_check_timeout_done
; otherwise we need to decrement and update
dec SECOND_COUNTDOWN
lda #50
sta IRQ_COUNTDOWN
; dec SECOND_COUNTDOWN
; lda #50
; sta IRQ_COUNTDOWN
done_check_pattern_notdone:
done_check_timeout_notdone: