News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] Trying to combine PBA with super missile

Started by dewhi100, May 05, 2019, 03:45:35 PM

Previous topic - Next topic

dewhi100

I thought it would be cool to fire off a PBA instead of a super, when you have the right beam equipped. Usually the PBA will center on Samus, but I want it to center on where the super would be, or where it would have impacted.

So far, I put a hijack into the routine at 93:8000, and try to swap out the super projectile with a wave PBA. Well, it's half working. The projectiles are invisible, they don't move, and they persist without doing any damage. Enemies still collide with them, making the little explosion sprite. Sometimes it seems like they clear if samus fires again, and sometimes it seems like they persist indefinitely and Samus can't fire.

What am I missing? I attached the code.
lorom

org $938038
;LDA $83F1,y
JSR freespace

org $93FA20
freespace:
;(A = projectile type * 2 at this point)
CMP #$0004
BNE noChange
LDA $09A6
AND #$000F
CMP #$0008
BPL setSupers ; if > 8, set supers
ASL A
TAX
JMP (beamArray,x)

beamArray:
DW setSupers, useWave, setSupers, setSupers
DW setSupers, setSupers, setSupers, setSupers

useWave:
LDA #waveArray
RTS

noChange:
LDA $83F1,y
RTS

setSupers:
LDA $83F5
RTS

waveArray: ;Mimicing the super missile array to avoid overflow.
DW $012C, $A159, $A159, $A159, $A159, $A159, $A159, $A159, $A159, $A159, $A159

TAxxOUTBR3AKxx

Not that I know a whole lot, but I remember that Super missiles are actually 2 projectiles. You may need to look into how the two work together, as that may be the reason your projectile spawns but doesn't move.