diff --git a/interlace_demo/asteroid.inc b/interlace_demo/asteroid.inc index 52172478..fb998a81 100644 --- a/interlace_demo/asteroid.inc +++ b/interlace_demo/asteroid.inc @@ -1,20 +1,23 @@ ; all hard-coded 3x2 +asteroid_lookup: + .word asteroid_p1,explode0_p1,explode1_p1,explode2_p1 + asteroid_p1: .byte $50,$85,$80 .byte $05,$88,$08 explode0_p1: -.byte $50,$85,$80 -.byte $05,$88,$08 +.byte $d0,$95,$d0 +.byte $0d,$59,$0d explode1_p1: -.byte $50,$85,$80 -.byte $05,$88,$08 +.byte $0d,$90,$0d +.byte $d0,$09,$d0 explode2_p1: -.byte $50,$85,$80 -.byte $05,$88,$08 +.byte $05,$80,$05 +.byte $50,$08,$50 void_p1: .byte $00,$00,$00 diff --git a/interlace_demo/sprites.s b/interlace_demo/sprites.s index 0b6774df..d8a73ecc 100644 --- a/interlace_demo/sprites.s +++ b/interlace_demo/sprites.s @@ -30,7 +30,7 @@ RANDOM_PTR = $E2 ASTEROID_X = $E3 ASTEROID_Y = $E4 ASTEROID_SUBX = $E5 - +ASTEROID_EXPLODE= $E6 DRAW_PAGE = $EE @@ -58,6 +58,7 @@ GREEN3 = $83 GREEN4 = $84 ZERO = $85 + ; Soft Switches KEYPRESS= $C000 KEYRESET= $C010 @@ -96,6 +97,7 @@ start_sprites: sta LEVEL_DONE sta FIRE_X sta ASTEROID_SUBX + sta ASTEROID_EXPLODE lda #$44 sta GREEN0 @@ -245,7 +247,7 @@ display_loop: ;-1821 -- draw ship (130*14)+1 ; -829 -- erase ship (100*8)+(14*2)+1 ; -167 -- erase fire - ; -337 -- erase asteroid + ; -348 -- erase asteroid ; -31 -- move ship ; -17 -- move fire ; -51 -- collide asteroid/fire @@ -256,7 +258,7 @@ display_loop: ; -33 -- handle fire press ; -8 -- loop ;======= - ; 366 + ; 355 @@ -747,13 +749,16 @@ done_draw_fire: ;===================== ; draw the asteroid - +draw_asteroid: lda #$0 ; 2 sta DRAW_PAGE ; 3 - lda #asteroid_p1 ; 2 + lda asteroid_lookup+1,X ; 4 sta INH ; 3 lda ASTEROID_X ; 3 sta SPRITE_XPOS ; 3 @@ -761,7 +766,7 @@ done_draw_fire: sta SPRITE_YPOS ; 3 jsr put_sprite ; 6+304 ;====== - ; 337 + ; 348 @@ -773,11 +778,11 @@ pad_time: ; WAIT for VBLANK to finish ;============================ - nop - nop - nop - nop - nop +; nop +; nop +; nop +; nop +; nop ; nop ; nop ; nop @@ -786,12 +791,13 @@ pad_time: wait_loop: - ; Try X=13 Y=5 cycles=356 -; nop + ; Try X=2 Y=22 cycles=353 R2 - ldy #5 ; 2 -loop1: ldx #13 ; 2 + nop + + ldy #22 ; 2 +loop1: ldx #2 ; 2 loop2: dex ; 2 bne loop2 ; 2nt/3 dey ; 2