second: more timing

urgh it's a pain
This commit is contained in:
Vince Weaver 2023-11-02 21:41:51 -04:00
parent ba83a62c36
commit 1fb453807b
5 changed files with 68 additions and 6 deletions

View File

@ -5,7 +5,8 @@
; pattern # in A
wait_for_pattern:
cmp current_pattern_smc+1
beq done_check_pattern_done
bcc done_check_pattern_done ; blt
beq done_check_pattern_done ; ble
lda KEYPRESS
bpl done_check_pattern_notdone

View File

@ -343,7 +343,7 @@ main_tunnel_done:
lda #13
sta BAR_X1
lda #27
lda #26
sta BAR_X2
jsr falling_bars
@ -352,7 +352,7 @@ main_tunnel_done:
; right
lda #27
lda #26
sta BAR_X1
lda #39
sta BAR_X2

View File

@ -142,6 +142,10 @@ change_mono:
jsr scroll_off
lda #0
jsr hgr_page1_clearscreen
jsr hgr_page2_clearscreen
rts
.include "init_plasma.s"

View File

@ -91,7 +91,7 @@ spheres_start:
; "10 seconds to transmission"
; do we wait 10s?
lda #4
lda #2
jsr wait_seconds
@ -114,7 +114,7 @@ move_sword_loop:
jsr page_flip
lda #25
lda #16
jsr wait_ticks
lda KEYPRESS
@ -152,6 +152,7 @@ draw_sword:
sta CURRENT_SPRITEH ; copy start for sprite
ldx #0
stx REFCOUNT
lda #3
sta COUNT
@ -173,9 +174,44 @@ sword_inner_loop:
beq skip_pixel
sta (GBASL),Y
skip_pixel:
;====================================
dey
bpl sword_inner_loop
; handle reflections
lda REFCOUNT
lsr
bcs pixel_odd
tay
lda reflect1_h,Y
clc
adc DRAW_PAGE
sta REF1H
lda reflect1_l,Y
sta REF1L
lda reflect2_h,Y
clc
adc DRAW_PAGE
sta REF2H
lda reflect2_l,Y
sta REF2L
ldy #3
lda (CURRENT_SPRITEL),Y
beq pixel_odd ; skip if black
ldy #0
sta (REF1L),Y
sta (REF2L),Y
pixel_odd:
;============================
inc REFCOUNT
inc COUNT
clc
@ -225,6 +261,23 @@ page_flip_show_1:
sta DRAW_PAGE
rts
reflect1_h:
; 46,44,42,40,38,36,34
.byte >$7d0,>$750,>$6d0,>$650,>$5d0,>$550,>$4d0
; 39, 38, 37, 36, 36, 34, 33
reflect1_l:
.byte <$7d0+39,<$750+38,<$6d0+37,<$650+36,<$5d0+35,<$550+34,<$4d0+33
reflect2_h:
; 4,6,8,10,12,14,16
.byte >$500,>$580,>$600,>$680,>$700,>$780,>$428
reflect2_l:
.byte <$500+32,<$580+31,<$600+30,<$680+29,<$700+28,<$780+27,<$428+26
.include "../wait_keypress.s"

View File

@ -220,7 +220,11 @@ BASE_SPRITEH = $F1
CURRENT_SPRITEL = $F2
CURRENT_SPRITEH = $F3
XMISSION_COUNT = $F4
REF1L = $F5
REF1H = $F6
REF2L = $F7
REF2H = $F8
REFCOUNT = $F9
;==============================================
; $FC-$FF we use for in/out pointers