ds: fine tune the timing a bit

This commit is contained in:
Vince Weaver 2019-11-05 16:48:44 -05:00
parent 89a29693e9
commit 69b7bc1b22
2 changed files with 80 additions and 36 deletions

View File

@ -451,12 +451,12 @@ change_state_clear_gait:
starbase_keypresses:
; in room 0
.byte 'L',180 ; start charging laser
.byte 'L',2 ; release, blasting door
.byte 'D',200 ; walk right
.byte 'D',50 ; walk right ; into door
.byte 'A',2 ; walk right ; turn
.byte 'A',50 ; walk right ; walk left
.byte 'L',180 ; start charging laser, wait 180
.byte 'L',2 ; release, blasting door, wait 2
.byte 'D',20 ; walk right
.byte 'D',180 ; run right
.byte 'A',2 ; walk left ; turn
.byte 'A',50 ; walk left ; walk left
.byte 'D',2 ; stop
.byte 'D',2 ; turn right
.byte 'S',20 ; duck
@ -464,7 +464,8 @@ starbase_keypresses:
.byte 'L',20 ; shoot ;blow up door
.byte 'D',2 ; stand
; in room 1
.byte 'D',150 ; walk right
.byte 'D',10 ; walk right
.byte 'D',64 ; run right
.byte 'S',20 ; duck
.byte 'L',50 ; start charging
.byte 'L',20 ; make shield

View File

@ -10,9 +10,9 @@ starbase_init:
lda #0
sta WHICH_ROOM
sta BG_SCROLL
sta CART_OUT
sta LASER_OUT
sta BLAST_OUT
sta CHARGER_COUNT
sta GUN_STATE
sta GUN_FIRE
sta NUM_DOORS
@ -26,6 +26,9 @@ starbase_init:
lda #100
sta GUN_CHARGE
lda #$40
sta CART_X
;====================
; reset doors
lda #DOOR_STATUS_LOCKED
@ -496,8 +499,8 @@ no_draw_alien:
lda WHICH_ROOM
beq c4_room0_cover
; cmp #4
; beq c4_room4_cover
cmp #2
beq room2_robot
jmp c4_no_fg_cover
@ -513,38 +516,72 @@ c4_room0_cover:
lda #>causeway_door_cover
sta INH
; jsr put_sprite
jsr put_sprite
jmp c4_no_fg_cover
room2_robot:
; 0 is never seen, 2 is all done
lda CART_OUT
cmp #1
bne c4_no_fg_cover
c2_draw_cart:
lda CART_X
sta XPOS
lda #42
sta YPOS
lda #<robot_sprite
sta INL
lda #>robot_sprite
sta INH
jsr put_sprite_crop
c4_no_fg_cover:
;========================
; handle cinematic action
; activate fg actions
;========================
lda WHICH_ROOM ; only on causeway1
cmp #2
bne no_action_movie
lda WHICH_ROOM
cmp #2
bne no_fg_action
lda FRAMEH
lda CART_OUT
bne no_fg_action ; if 0 activate
inc CART_OUT
no_fg_action:
;================
; move fg objects
;================
move_fg_objects:
lda CART_OUT
cmp #1
bne action_no_trigger
bne cart_not_out
lda ACTION_TRIGGERED ; already triggered
bne action_no_trigger
; move cart
action_trigger:
lda #1
sta ACTION_COUNT
sta ACTION_TRIGGERED
action_no_trigger:
lda FRAMEL
and #$3
bne cart_not_out
lda ACTION_COUNT
beq no_action_movie
dec CART_X
dec CART_X
lda CART_X
cmp #$fc
bne cart_not_out
inc CART_OUT
cart_not_out:
; jsr action_sequence
no_action_movie:
;===============
; page flip
@ -892,21 +929,27 @@ flame_sequence:
.byte 0
STAR_SPEED = 16
star_sequence:
.byte 20
.byte STAR_SPEED
.word star_wipe1_rle
.byte 20
.byte STAR_SPEED
.word star_wipe2_rle
.byte 20
.byte STAR_SPEED
.word star_wipe3_rle
.byte 20
.byte STAR_SPEED
.word star_wipe4_rle
.byte 20
.byte STAR_SPEED
.word star_wipe5_rle
.byte 20
.byte STAR_SPEED
.word empty_rle
.byte 20
.byte STAR_SPEED
.word empty_rle
.byte 0
robot_sprite:
.byte 5,3
.byte $aa,$0a,$00,$0a,$aa
.byte $0a,$90,$00,$00,$aa
.byte $00,$00,$00,$00,$00