mirror of
https://github.com/deater/tb1.git
synced 2024-09-27 13:54:42 +00:00
snes: missiles die when off end of screen
This commit is contained in:
parent
131b79cabf
commit
889515f2c5
@ -1,2 +1,2 @@
|
|||||||
.word $7233 ; Complement of checksum
|
.word $60fc ; Complement of checksum
|
||||||
.word $8dcc ; Unsigned 16-bit sum of ROM
|
.word $9f03 ; Unsigned 16-bit sum of ROM
|
||||||
|
@ -1811,24 +1811,18 @@ move_missiles:
|
|||||||
|
|
||||||
ply
|
ply
|
||||||
|
|
||||||
; iny ; move to missile.y
|
cmp #200
|
||||||
; iny
|
|
||||||
; clc ; clear carry
|
|
||||||
; lda (MISSILE_PL),Y ; get missile.y
|
|
||||||
; adc #$FF ; move up (subtract 1)
|
|
||||||
; sta (MISSILE_PL),Y ; store missile.y
|
|
||||||
; bpl missile_collision_detection ; if not off screen, contine
|
|
||||||
|
|
||||||
; dey ; back up to missile.out
|
; bge
|
||||||
; dey
|
bcc missile_collision_detection ; if not off screen, contine
|
||||||
; lda #$0
|
|
||||||
; sta (MISSILE_PL),Y ; set missile.out=0
|
|
||||||
|
|
||||||
; lda #<(~PERFECT_AIM) ; shot missed!
|
jsr deactivate_sprite
|
||||||
; and BONUS_FLAGS ; clear perfect shot flag
|
|
||||||
; sta BONUS_FLAGS
|
|
||||||
|
|
||||||
; jmp loop_move_missiles ; continue
|
lda #<(~PERFECT_AIM) ; shot missed!
|
||||||
|
and BONUS_FLAGS ; clear perfect shot flag
|
||||||
|
sta BONUS_FLAGS
|
||||||
|
|
||||||
|
jmp loop_move_missiles ; continue
|
||||||
|
|
||||||
missile_collision_detection:
|
missile_collision_detection:
|
||||||
|
|
||||||
|
@ -358,3 +358,43 @@ activate_sprite:
|
|||||||
plx
|
plx
|
||||||
plp
|
plp
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
;===========================
|
||||||
|
; deactivate_sprite
|
||||||
|
;===========================
|
||||||
|
;===========================
|
||||||
|
; assumes high sprite table at $0400
|
||||||
|
; sets carry if active
|
||||||
|
; clears carry if not
|
||||||
|
; sprite number in X
|
||||||
|
deactivate_sprite:
|
||||||
|
|
||||||
|
php
|
||||||
|
phx
|
||||||
|
phy
|
||||||
|
|
||||||
|
lda #$0
|
||||||
|
xba
|
||||||
|
|
||||||
|
tyx
|
||||||
|
|
||||||
|
; address=$0400 + Y/4
|
||||||
|
txa
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
tay
|
||||||
|
|
||||||
|
txa
|
||||||
|
and #$3
|
||||||
|
tax
|
||||||
|
lda SPRITE_HIGH_LOOKUP,X
|
||||||
|
|
||||||
|
ora $0400,Y ; sprite off screen when bit is 1
|
||||||
|
sta $0400,Y
|
||||||
|
|
||||||
|
ply
|
||||||
|
plx
|
||||||
|
plp
|
||||||
|
rts
|
||||||
|
Loading…
Reference in New Issue
Block a user