diff --git a/demos/rewind2/Makefile b/demos/rewind2/Makefile index 09875cab..db419765 100644 --- a/demos/rewind2/Makefile +++ b/demos/rewind2/Makefile @@ -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 #### diff --git a/demos/rewind2/dancing/dancing.s b/demos/rewind2/dancing/dancing.s index 4e98c829..f37c6706 100644 --- a/demos/rewind2/dancing/dancing.s +++ b/demos/rewind2/dancing/dancing.s @@ -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 diff --git a/demos/rewind2/irq_wait.s b/demos/rewind2/irq_wait.s index 7a9dda03..dce89070 100644 --- a/demos/rewind2/irq_wait.s +++ b/demos/rewind2/irq_wait.s @@ -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: