;PowerBomb Disassembly: ;88:851C ;This section runs FX instructions REP #$20 LDA $18F0,X ;Pre PLM-like code to run every frame STA $12 ;Store pointer LDA $18FC,X ;Get bank of code to run STA $14 ;Store bank pointer PHK ;Push current bank PEA $852E ;Push return address JML [$0012] ;Jump to pointer of pre PLM-like code SEP #$10 REP #$20 LDX $18B2 ;Index value for RAM location for HDMA DEC $18E4,X ;Delay until PLM-like instruction BNE SkipPLMInst ;If not 0, skip LDY $18C1,X ;Get bank pointer for PLM-like instruction PHY ;Push 16 bit address PLB ;Pull unneeded byte from stack LDA $18CC,X ;Get PLM-like pointer REP #$10 TAY ;Put pointer into Y ;8546 ;Return point LDA $0000,Y ;Load instruction BPL StorePLMDelay ;If not a pointer, set as a delay STA $12 ;Store pointer INY : INY ;Grab next instruction pointer PEA $8545 ;Push return pointer JML [$0012] ;Jump to pointer of PLM-like code StorePLMDelay: STA $18E4,X ;Store delay for PLM-like instructions TYA ;Put Y into A CLC ADC #$0004 ;Add 4 to skip delay argument STA $18CC,X LDA $0002,Y ;Load delay argument STA $18D8,X SkipPLMInst: SEP #$30 RTS ;Pre-PLM pointers: $18F0,X ;First set $84B8,8890DF ;Start of bomb drop $91A8 ;Halfway through flash $8DE9 ;End of flash $8EB2 ;Halfway through explosion $8B98 ;End of explosion ;Second set $84B8,$8B8F ;Start of bomb drop ;Post-PLM pointers: $18CC,X ;First set $8ACE,$8ADE ;Start of flash $8AEA ;Halfway through flash $8AF6 ;End of flash $8B02 ;Halfway through explosion $8B09 ;End of explosion $8B10 ;After explosion ;Second set $8B80,$8B8B ;Start of bomb drop $84B8: RTL 8ACE: ;Start of flash DW 8655 : DB $89 ;Put argument into $4304,X DW 866A : DB $7E ;Put argument into $4307,X DW 85B4 : DL 888B14 ;Run long argument | Sets up the flash DW 8570 : DL 8890DF ;Put address into $18F0,X, bank to $18FC,X. Set up next pre instruction DW 8682 ;Sit on this instruction 8B80: ;Start of flash, second channel DW 8655 : DB $89 ;Put argument into $4304,X DW 866A : DB $7E ;Put argument into $4307,X DW 8570 : DL 888B8F ;Put address into $18F0,X, bank to $18FC,X. Set up next pre instruction DW 8682 ;Sit on this instruction 8655: PHX LDA $18C0,X AND #$00FF TAX SEP #$20 LDA $0000,Y STA $4304,X REP #$20 PLX INY RTS 866A: PHX LDA $18C0,X AND #$00FF TAX SEP #$20 LDA $0000,Y STA $4307,X REP #$20 PLX INY RTS 8682: DEY DEY TYA STA $18CC,X PLA SEP #$30 RTS 8570: LDA $0000,y STA $18F0,x SEP #$20 LDA $0002,y STA $18FC,x REP #$20 INY INY INY RTS 85B4: LDA $0000,Y ;Get pointer to code to run STA $12 LDA $0001,Y ;Get bank of code to run STA $13 PHX PHY ;Save index used for PB code JSL 8885CA PLY PLX INY : INY : INY ;Get next routine for powerbombs RTS 8885CA: JML [$0012] ;Jump to long pointer stored at $12 888B14: ;Powerbomb flash setup SEP #$20 LDA #$FF STA $7EC606 LDA #$00 STA $7EC607 REP #$20 LDA #$0400 ;Load starting radius of flash STA $0CEC ;Set starting radius of flash LDA $8890DB ;#$3000 starting speed of flash STA $0CF0 ;Store speed of flash RTL ;88:8B32 ;Powerbomb flash clearing? (2nd run) LDA #$9F06 STA $0CF2 ;A pointer of some sort for the shape of the PB explosion? RTL ;88:8B39 Powerbomb explosion setup (3rd run) LDA #$0400 ;Load starting radius of explosion STA $0CEA ;Set starting radius of explosion LDA $888DE5 ;#$0000 starting speed of explosion STA $0CF0 ;Store speed of explosion RTL ;88:8B47 Powerbomb explosion halfway (4th run) LDA #$9246 STA $0CF2 ;A pointer of some sort for the shape of the PB explosion? RTL ;88:8B4E Crystal flash check (5th run) LDA $0AF6 ;Load samus X position CMP $0CE2 ;Compare to X position of explosion BNE NoCFlash ;If not equal (samus moved away) LDA $0AFA ;Load samus Y position CMP $0CE4 ;Compare to Y position of explosion BNE NoCFlash ;If not equal (samus moved away) PHX JSL $90D5A2 ;Check for crystal flash PLX BCC $03 NoCFlash: STZ $0CEE ;Clear Powerbomb timer STZ $0592 STZ $18B4,X ;Clear list of DMA things of PB? probably X and Y STZ $18B6,X ;Clear list of DMA things of PB? STZ $0CEC ;Clear flash radius STZ $0CEA ;Clear explosion radius LDA #$001E JSL $90F084 ;Resumes sounds for spin jump or charge if necessary RTL 8890DF: ;Seems to handle making the explosion bigger and it's area LDA $0592 BMI $01 PHP PHB REP #$30 PHX PHY JSL $888F56 PEA $8800 PLB PLB SEP #$30 LDA #$00 XBA LDY #$60 LDA $0CED STA $4202 LDA $A286 STA $4203 NOP NOP NOP LDA $4217 STA $12 TAX PEA $9125 LDA $0CE7 AND #$FF BEQ $09 DEC BEQ $03 JMP $8D04