fireworks: launching works

This commit is contained in:
Vince Weaver 2018-09-05 16:48:54 -04:00
parent d8d4ad8f38
commit c869306e87
2 changed files with 28 additions and 15 deletions

View File

@ -38,10 +38,11 @@ PTRIG = $C070
; ROM routines
HGR = $F3E2
HPLOT0 = $F457
HGLIN = $F53A
COLORTBL= $F6F6
TEXT = $FB36 ;; Set text mode
HOME = $FC58 ;; Clear the text screen
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
COLORTBL= $F6F6
MAX = 3

View File

@ -3,7 +3,7 @@
;=======================================================================
; Constants
NUMSTARS = 16
YSIZE = 150
YSIZE = 160
XSIZE = 280
MARGIN = 24
@ -92,25 +92,25 @@ launch_firework:
jsr random16
lda SEEDL
and #$1
beq left_hill
right_hill:
beq right_hill
left_hill:
lda XPOS_L
clc
adc #24
sta XPOS_L ; 24-88 (64)
lda X_VELOCITY
eor #$ff
sta X_VELOCITY
inc X_VELOCITY ; aim toward middle
jmp done_hill
left_hill:
right_hill:
lda XPOS_L
clc
adc #191
sta XPOS_L ; 191-255 (64)
lda X_VELOCITY
eor #$ff
sta X_VELOCITY
inc X_VELOCITY ; aim toward middle
done_hill:
lda #YSIZE
@ -206,14 +206,14 @@ no_peak:
sec ; if (ypos_h>ysize-(ysize-peak)/2)
lda #YSIZE
sbc PEAK
asl
lsr
eor #$FF
clc
adc #1
clc
adc #YSIZE
cmp YPOS_H
bcs done_moving
bcc done_moving
going_up:
@ -248,7 +248,12 @@ draw_rocket:
lda Y_OLD
ldy #0
jsr HPLOT0 ; hplot(x_old,y_old);
; hplot_to(xpos_l,ypos_h);
; HPLOT to X,Y X=(x,a), y=Y
lda XPOS_L
ldx #0
ldy YPOS_H
jsr HGLIN ; hplot_to(xpos_l,ypos_h);
erase_rocket:
@ -265,8 +270,11 @@ erase_rocket:
ldy #0
jsr HPLOT0 ; hplot(x_old,y_old);
; hplot_to(x_old,y_old);
; HPLOT to X,Y X=(x,a), y=Y
lda X_OLD
ldx #0
ldy Y_OLD
jsr HGLIN ; hplot_to(x_old,y_old);
done_with_loop:
@ -274,6 +282,10 @@ done_with_loop:
cmp MAX_STEPS
beq draw_explosion
lda #$c0
jsr WAIT
inc CURRENT_STEP
jmp draw_rocket_loop