diff --git a/demos/second/Makefile b/demos/second/Makefile index a0350317..aa3436d0 100644 --- a/demos/second/Makefile +++ b/demos/second/Makefile @@ -178,6 +178,7 @@ qload.inc: generate_common QLOAD ./generate_common -a 0x1200 -s load_file qload.lst > qload.inc ./generate_common -a 0x1200 -s detect_appleii_model qload.lst >> qload.inc ./generate_common -a 0x1200 -s clear_all qload.lst >> qload.inc + ./generate_common -a 0x1200 -s clear_all_color qload.lst >> qload.inc ./generate_common -a 0x1200 -s set_normal qload.lst >> qload.inc ./generate_common -a 0x1200 -s set_inverse qload.lst >> qload.inc ./generate_common -a 0x1200 -s wait qload.lst >> qload.inc diff --git a/demos/second/part04_chess_shapes/chess.s b/demos/second/part04_chess_shapes/chess.s index e664f836..ffc09771 100644 --- a/demos/second/part04_chess_shapes/chess.s +++ b/demos/second/part04_chess_shapes/chess.s @@ -36,15 +36,15 @@ chess_start: ;=================== ; wait until pattern1 -;pattern1_loop: -; lda #1 -; jsr wait_for_pattern -; bcc pattern2_loop +pattern2_loop: + lda #2 + jsr wait_for_pattern + bcc pattern2_loop ; technically the above, but we're not fast enough - lda #175 - jsr wait_ticks +; lda #175 +; jsr wait_ticks ; lda #$FF ; jsr hgr_page1_clearscreen @@ -282,11 +282,12 @@ tunnel_loop: lda #8 jsr wait_irq - lda KEYPRESS - bpl tunnel_loop + ; finish at music pattern #13 or keypress + lda #13 + jsr wait_for_pattern + bcc tunnel_loop main_tunnel_done: - bit KEYRESET ;================== ;================== @@ -298,6 +299,11 @@ main_tunnel_done: jsr zooming_circles + + lda #$ff + sta clear_all_color+1 + jsr clear_all + ; todo, fade to white ;================== @@ -308,13 +314,27 @@ main_tunnel_done: ;================== ;================== + ; first until pattern 18 + lda #18 + sta interference_end_smc+1 + jsr interference + + ; TODO: falling bars + jsr clear_all + lda #50 + jsr wait_ticks + + + ; again until pattern 25 + + lda #25 + sta interference_end_smc+1 jsr interference main_interference_done: - rts diff --git a/demos/second/part04_chess_shapes/circles.s b/demos/second/part04_chess_shapes/circles.s index 44547816..81762d2d 100644 --- a/demos/second/part04_chess_shapes/circles.s +++ b/demos/second/part04_chess_shapes/circles.s @@ -11,6 +11,9 @@ zooming_circles: + lda #5 + jsr setup_timeout + ;=================== ; init screen @@ -85,13 +88,17 @@ xloop: dex ; 1 bpl yloop ; 2 - lda KEYPRESS - bmi done_circles + jsr check_timeout + bcs done_circles + bcc circle_forever - bpl circle_forever ; bra +; lda KEYPRESS +; bmi done_circles + +; bpl circle_forever ; bra done_circles: - bit KEYRESET +; bit KEYRESET rts diff --git a/demos/second/part04_chess_shapes/interference.s b/demos/second/part04_chess_shapes/interference.s index 7ceebe47..fb293fef 100644 --- a/demos/second/part04_chess_shapes/interference.s +++ b/demos/second/part04_chess_shapes/interference.s @@ -184,13 +184,18 @@ done_patch1: sta patch1 ;=================================== - lda KEYPRESS - bmi done_interference +interference_end_smc: + lda #18 + jsr wait_for_pattern + bcs done_interference + +; lda KEYPRESS +; bmi done_interference jmp draw_oval_loop ; bra done_interference: - bit KEYRESET +; bit KEYRESET rts diff --git a/demos/second/part08_gorilla/gorilla.s b/demos/second/part08_gorilla/gorilla.s index deb0e22b..f8100d01 100644 --- a/demos/second/part08_gorilla/gorilla.s +++ b/demos/second/part08_gorilla/gorilla.s @@ -8,6 +8,7 @@ .include "../zp.inc" .include "../hardware.inc" .include "../qload.inc" +.include "../music.inc" mod7_table = $1c00 div7_table = $1d00 @@ -23,15 +24,21 @@ gorilla_start: ; Load graphics ;=================== - bit SET_GR - bit HIRES - bit FULLGR - bit PAGE1 +; DEBUG + lda #25 + sta current_pattern_smc+1 + jsr pt3_set_pattern lda #0 jsr hgr_page1_clearscreen jsr hgr_page2_clearscreen + ; switch to HIRES (previous screen was lores) + + bit SET_GR + bit HIRES + bit FULLGR + bit PAGE2 ; load image offscreen $6000 @@ -48,14 +55,28 @@ gorilla_start: sta COUNT sta DRAW_PAGE -ship_sprite_loop: - lda #$60 jsr hgr_copy bit PAGE1 - jsr wait_until_keypress +gorilla_wait: + lda #29 + jsr wait_for_pattern + bcc gorilla_wait + + + ; TODO: TV_shutoff effect + + lda #0 + jsr hgr_page1_clearscreen + +gorilla_wait2: + lda #30 + jsr wait_for_pattern + bcc gorilla_wait2 + + gorilla_done: rts @@ -79,6 +100,8 @@ wait_irq_loop: bne wait_irq_loop rts + .include "../irq_wait.s" + gorilla_data: .incbin "graphics/mntscrl3.hgr.zx02" diff --git a/demos/second/start.s b/demos/second/start.s index b55bc397..a8be3faa 100644 --- a/demos/second/start.s +++ b/demos/second/start.s @@ -180,7 +180,6 @@ load_program_loop: sta DONE_PLAYING lda #1 - sta LOOP ;========================