dos33fsprogs/fireworks/state_machine.s

84 lines
1.5 KiB
ArmAsm
Raw Normal View History

2018-09-11 18:07:16 +00:00
;=================================
; action_stars
;=================================
; and take 4504 cycles to do it
; we take 4501, so waste 3
2018-09-11 18:07:16 +00:00
action_stars:
jsr draw_stars ; 6+4492 = 4498
ldy FRAME ;nop ; 3
2018-09-11 18:07:16 +00:00
jmp check_keyboard ; 3
2018-09-11 18:07:16 +00:00
2018-09-11 23:51:25 +00:00
;=================================
; 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
2018-09-12 01:16:49 +00:00
;=================================
; action_move_rocket
;=================================
; and take 4504 cycles to do it
2018-09-12 02:01:51 +00:00
; we take 1245 so waste 3259
2018-09-12 01:16:49 +00:00
action_move_rocket:
2018-09-12 02:01:51 +00:00
; Try X=35 Y=18 cycles=3259
2018-09-12 01:16:49 +00:00
2018-09-12 02:01:51 +00:00
ldy #18 ; 2
Yloop1: ldx #35 ; 2
2018-09-12 01:16:49 +00:00
Yloop2: dex ; 2
bne Yloop2 ; 2nt/3
dey ; 2
bne Yloop1 ; 2nt/3
2018-09-12 02:01:51 +00:00
jsr move_rocket ; 6+1236 = 1242
2018-09-12 01:16:49 +00:00
jmp check_keyboard ; 3
2018-09-12 02:29:01 +00:00
;=================================
; action_start_explosion
;=================================
; and take 4504 cycles to do it
; we take 445 so waste 4059
action_start_explosion:
; Try X=30 Y=26 cycles=4057 R2
nop
ldy #26 ; 2
Zloop1: ldx #30 ; 2
Zloop2: dex ; 2
bne Zloop2 ; 2nt/3
dey ; 2
bne Zloop1 ; 2nt/3
jsr start_explosion ; 6+436 = 442
jmp check_keyboard ; 3