mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-14 13:33:48 +00:00
fireworks: stage 1 works
This commit is contained in:
parent
0b93528b36
commit
0680a83360
@ -296,7 +296,7 @@ loop_forever:
|
|||||||
|
|
||||||
|
|
||||||
jump_table:
|
jump_table:
|
||||||
.word (action_stars-1)
|
.word (action_launch_firework-1)
|
||||||
.word (action_stars-1)
|
.word (action_stars-1)
|
||||||
.word (action_stars-1)
|
.word (action_stars-1)
|
||||||
.word (action_stars-1)
|
.word (action_stars-1)
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
|
|
||||||
|
|
||||||
STATE_LAUNCH_ROCKET = 0
|
STATE_LAUNCH_ROCKET = 0
|
||||||
STATE_MOVE_ROCKET = 1
|
STATE_MOVE_ROCKET = 2
|
||||||
STATE_START_EXPLOSION = 2
|
STATE_START_EXPLOSION = 4
|
||||||
STATE_CONTINUE_EXPLOSION = 3
|
STATE_CONTINUE_EXPLOSION = 6
|
||||||
|
|
||||||
; Constants
|
; Constants
|
||||||
NUMSTARS = 16
|
NUMSTARS = 16
|
||||||
@ -87,7 +87,7 @@ done_fireworks:
|
|||||||
;===========================
|
;===========================
|
||||||
; LAUNCH_FIREWORK
|
; LAUNCH_FIREWORK
|
||||||
;===========================
|
;===========================
|
||||||
; cycles= 54+60+67+60+56+56+15+8+21+11 = 408
|
; cycles= 56+60+67+60+56+56+15+8+21+11 = 410
|
||||||
|
|
||||||
launch_firework:
|
launch_firework:
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ launch_firework:
|
|||||||
and #$4 ; 2
|
and #$4 ; 2
|
||||||
sta COLOR_GROUP ; HGR color group (0 PG or 4 BO) ; 3
|
sta COLOR_GROUP ; HGR color group (0 PG or 4 BO) ; 3
|
||||||
;============
|
;============
|
||||||
; 54
|
; 56
|
||||||
|
|
||||||
jsr random16 ; 6+42
|
jsr random16 ; 6+42
|
||||||
lda SEEDL ; 3
|
lda SEEDL ; 3
|
||||||
@ -188,7 +188,8 @@ done_hill:
|
|||||||
;===========
|
;===========
|
||||||
; 21
|
; 21
|
||||||
|
|
||||||
lda #STATE_MOVE_ROCKET ; 2
|
; lda #STATE_MOVE_ROCKET ; 2
|
||||||
|
lda #STATE_LAUNCH_ROCKET ; 2
|
||||||
sta STATE ; move to launch ; 3
|
sta STATE ; move to launch ; 3
|
||||||
|
|
||||||
rts ; 6
|
rts ; 6
|
||||||
|
@ -12,3 +12,25 @@ action_stars:
|
|||||||
|
|
||||||
jmp check_keyboard ; 3
|
jmp check_keyboard ; 3
|
||||||
|
|
||||||
|
|
||||||
|
;=================================
|
||||||
|
; action_launch_firework
|
||||||
|
;=================================
|
||||||
|
; and take 4504 cycles to do it
|
||||||
|
|
||||||
|
; we take 419 so waste 4085
|
||||||
|
action_launch_firework:
|
||||||
|
|
||||||
|
; Try X=203 Y=4 cycles=405
|
||||||
|
|
||||||
|
ldy #4 ; 2
|
||||||
|
Xloop1: ldx #203 ; 2
|
||||||
|
Xloop2: dex ; 2
|
||||||
|
bne Xloop2 ; 2nt/3
|
||||||
|
dey ; 2
|
||||||
|
bne Xloop1 ; 2nt/3
|
||||||
|
|
||||||
|
jsr launch_firework ; 6+410 = 416
|
||||||
|
|
||||||
|
jmp check_keyboard ; 3
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user