;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;HDMA Effects 2.0 ;by Ice Man ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; lorom ;\ ROM is LoRom header ;/ and has a header !FreeSpace = $928000 ;| POINT THIS TO SOME FREE SPACE!!! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Hijacks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org $8093F7 ;\ Hijack level load JSL Init_Code ;| routine and jump NOP ;/ to our init routine org $80A295 ;\ Hijack level routine JSL Main_Code ;/ and jump to main org $81C6BD ;\ Hijack power-up routine JML Power_Up_Fix ;/ and jump to our code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Misc. Fixes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org $809CAD ;\ Don't disable HDMA NOP #3 ;/ on title screen org $80CB0C ;\ Circle HDMA TSB $0D9F ;/ STA -> TSB org $85B129 ;\ Don't disable HDMA NOP #3 ;/ for message boxes org $85B296 ;\ Message Box HDMA TSB $0D9F ;/ STA -> TSB ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Sprite Priority Fixes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org $80D231 ;\ Player priority NOP #5 ;/ for pipes org $80E2B9 ;\ $13F9 (Mario) db $E0,$10,$20,$30 ;/ priority org $818E84 ;\ Classic Piranha Plant db $20 ;/ priority org $81C18E ;\ Growing Vine db $20 ;/ priority org $81AF4F ;\ Thwomp db $03,$43,$03,$43,$03 ;/ high priority org $81C20C ;\ P-Balloon db $20 ;/ priority org $81C39D ;\ Berry db $20 ;/ priority org $81C4A2 ;\ Moving Coin db $20 ;/ priority org $81DB9E ;\ Line Grinder db $23,$63,$A3,$E3 ;/ +$10 each fixed org $81EBAA ;\ Yoshi db $20 ;/ priority org $829E74 ;\ Torpedo Ted's Arm db $23 ;/ priority org $82B893 ;\ Torpedo Ted db $20 ;/ priority org $82E0D5 ;\ Jumping Piranha Plant db $20 ;/ priority org $82E7C6 ;\ Chuck's Rock db $20 ;/ priority org $82EA1B ;\ Pipe Lakitu db $6B ;/ priority org $8394C5 ;\ db $A1,$A1,$A1,$A1,$A1 ;| Wooden Spike db $21,$21,$21,$21,$21 ;/ priority org $839784 ;\ Fishbone db $6D,$ED,$2D,$AD ;/ priority org $83A07C ;\ Blargg's Eye NOP #2 ;/ priority org $83A09B ;\ Blargg (right/left) db $65,$25 ;/ priority ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Map 16 Priority Fixes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org $8D84D8 ;\ Map 16 priority db $58,$38,$5A,$38,$59,$38,$5B,$38 ;/ Brown Block org $8D84E0 ;\ Map 16 priority db $00,$34,$10,$34,$01,$34,$11,$34 ;| Green horizontal pipe (top left) db $02,$34,$12,$34,$03,$34,$13,$34 ;| Green horizontal pipe (top right) db $20,$34,$20,$34,$21,$34,$21,$34 ;| Green horizontal pipe (bottom left) db $22,$34,$22,$34,$23,$34,$23,$34 ;| Green horizontal pipe (bottom right) db $00,$34,$10,$34,$01,$34,$11,$34 ;| Green horizontal pipe (top left) db $02,$34,$12,$34,$03,$34,$13,$34 ;| Green horizontal pipe (top right) db $00,$34,$10,$34,$01,$34,$11,$34 ;| Green horizontal pipe (top left) db $02,$34,$12,$34,$03,$34,$13,$34 ;/ Green horizontal pipe (top right) db $04,$34,$14,$34,$05,$34,$15,$34 ;\ Green vertical pipe (top) db $24,$34,$34,$34,$25,$34,$35,$34 ;/ Green vertical pipe (bottom) db $2E,$34,$3E,$34,$2E,$34,$3E,$34 ;\ Green vertical pipe (middle top) db $2F,$34,$3F,$34,$2F,$34,$3F,$34 ;/ Green vertical pipe (middle bottom) db $24,$34,$34,$34,$25,$34,$35,$34 ;| Green vertical pipe (bottom) org $8D8AB0 ;\ Map 16 priority db $00,$2C,$10,$2C,$01,$2C,$11,$2C ;| Grey horizontal pipe (top left) db $02,$2C,$12,$2C,$03,$2C,$13,$2C ;| Grey horizontal pipe (top right) db $20,$2C,$20,$2C,$21,$2C,$21,$2C ;| Grey horizontal pipe (bottom left) db $22,$2C,$22,$2C,$23,$2C,$23,$2C ;| Grey horizontal pipe (bottom right) db $00,$2C,$10,$2C,$01,$2C,$11,$2C ;| Grey horizontal pipe (top left) db $02,$2C,$12,$2C,$03,$2C,$13,$2C ;| Grey horizontal pipe (top right) db $00,$2C,$10,$2C,$01,$2C,$11,$2C ;| Grey horizontal pipe (top left) db $02,$2C,$12,$2C,$03,$2C,$13,$2C ;/ Grey horizontal pipe (top right) db $00,$38,$10,$38,$01,$38,$11,$38 ;\ Yellow horizontal pipe (top left) db $02,$38,$12,$38,$03,$38,$13,$38 ;| Yellow horizontal pipe (top right) db $20,$38,$20,$38,$21,$38,$21,$38 ;| Yellow horizontal pipe (bottom left) db $22,$38,$22,$38,$23,$38,$23,$38 ;| Yellow horizontal pipe (bottom right) db $00,$38,$10,$38,$01,$38,$11,$38 ;| Yellow horizontal pipe (top left) db $02,$38,$12,$38,$03,$38,$13,$38 ;| Yellow horizontal pipe (top right) db $00,$38,$10,$38,$01,$38,$11,$38 ;| Yellow horizontal pipe (top left) db $02,$38,$12,$38,$03,$38,$13,$38 ;/ Yellow horizontal pipe (top right) db $00,$3C,$10,$3C,$01,$3C,$11,$3C ;\ Blue horizontal pipe (top left) db $02,$3C,$12,$3C,$03,$3C,$13,$3C ;| Blue horizontal pipe (top right) db $20,$3C,$20,$3C,$21,$3C,$21,$3C ;| Blue horizontal pipe (bottom left) db $22,$3C,$22,$3C,$23,$3C,$23,$3C ;| Blue horizontal pipe (bottom right) db $00,$3C,$10,$3C,$01,$3C,$11,$3C ;| Blue horizontal pipe (top left) db $02,$3C,$12,$3C,$03,$3C,$13,$3C ;| Blue horizontal pipe (top right) db $00,$3C,$10,$3C,$01,$3C,$11,$3C ;| Blue horizontal pipe (top left) db $02,$3C,$12,$3C,$03,$3C,$13,$3C ;/ Blue horizontal pipe (top right) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;HDMA Init / Main Codes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; org !FreeSpace ;| Location to insert code HDMA_Return: RTS ;| Return from pointers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;HDMA Init Code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Init_Code: PHB ;\ PHK ;| Setup program bank PLB ;/ LDX #$08 ;\ Bytes of table (for X) Check_Loop: LDA $0100 ;| Get game mode CMP Reset_Table,x ;| compare with table BEQ Init_Reset ;| Reset flag, if equal CMP #$13 ;| Also reset flag, BNE Init_Reset ;/ if not game mode $13 REP #$10 ;\ Set processor 16 bit LDX $010B ;| Level number into X LDA Init_Flags,x ;| Get value fromt table STA $0F3A ;| Store to free RAM SEP #$10 ;/ Set processor 8 bit JSR Init_Pointers ;| Jump to init pointers Init_Return: PLB ;| Recover program bank LDA #$81 ;\ STA $4200 ;| Recover old code RTL ;/ Return Init_Reset: STZ $0F3A ;\ Disable HDMA flag STZ $0D9F ;| as well as HDMA BRA Init_Return ;/ and return Init_Pointers: LDA $0F3A ;\ Get init flag JSL $8086DF ;/ and execute pointer dw HDMA_Return ;\ $00 = Nothing dw HDMA_Red_Gradient ;| $01 = Basic red gradient dw HDMA_Green_Gradient ;| $02 = Basic green gradient dw HDMA_Blue_Gradient ;| $03 = Basic blue gradient dw HDMA_Yellow_Gradient ;| $04 = Basic yellow gradient dw HDMA_Underwater_Gradient_1 ;| $05 = Underwater Variant 1 dw HDMA_Underwater_Gradient_2 ;| $06 = Underwater Variant 2 dw HDMA_Lava_Gradient ;| $07 = Lava gradient dw HDMA_Desert_Gradient ;| $08 = Desert gradient dw HDMA_Fog_Gradient_1 ;| $09 = Fog Variant 1 dw HDMA_Fog_Gradient_2 ;| $0A = Fog Variant 2 dw HDMA_Fog_Gradient_3 ;| $0B = Fog Variant 3 dw HDMA_Shadow_Gradient ;| $0C = Shadow Gradient dw HDMA_25_Scanlines ;| $0D = 25% scanlines dw HDMA_50_Scanlines ;/ $0E = 50% scanlines Reset_Table: db $03,$06,$08,$09 ;\ db $0A,$10,$11,$12 ;| Game modes to db $16 ;/ disallow HDMA Init_Flags: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;00-0F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;10-1F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;20-2F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;30-3F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;40-4F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;50-5F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;60-6F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;70-7F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;80-8F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;90-9F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;A0-AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;B0-BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;C0-CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;D0-DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;E0-EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;F0-FF db $00,$00,$00,$00,$05,$05,$05,$05,$00,$00,$00,$00,$00,$00,$00,$00 ;100-10F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;110-11F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;120-12F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;130-13F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;140-14F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;150-15F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;160-16F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;170-17F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;180-18F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;190-19F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1A0-1AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1B0-1BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1C0-1CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1D0-1DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1E0-1EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1F0-1FF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;HDMA Main Code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Main_Code: PHB ;\ PHK ;| Setup program bank PLB ;/ LDA $0100 ;\ Get game mode CMP #$07 ;| compare with #$07 BEQ Run_Main ;| and #$14, otherwise CMP #$14 ;| reset main flags BNE Main_Reset ;/ and return Run_Main: REP #$10 ;\ Set processor 16 bit LDX $010B ;| Level number into X LDA Layer_1_Flags,x ;| Get value fromt table STA $0F3B ;| Store to free RAM LDA Layer_2_Flags,x ;| Get value fromt table STA $0F3C ;| Store to free RAM LDA Extra_Flags,x ;| Get value fromt table STA $0F3D ;| Store to free RAM SEP #$10 ;/ Set processor 8 bit JSR Layer_1_Pointers ;\ Jump to layer 1 pointers JSR Layer_2_Pointers ;| Jump to layer 2 pointers JSR Extra_Pointers ;/ Jump to extra pointers Main_Return: PLB ;| Recover program bank JSL $7F8000 ;\ Restore old code RTL ;/ Return Main_Reset: STZ $0F3B ;\ Disable HDMA flags STZ $0F3C ;| for layer 1, layer 2 STZ $0F3D ;| and extra pointers STZ $0D9F ;| as well as HDMA BRA Main_Return ;/ and return Layer_1_Pointers: LDA $0F3B ;\ Get layer 1 flag JSL $8086DF ;/ and execute pointer dw HDMA_Return ;\ $00 = Nothing dw HDMA_Small_L1_H ;| $01 = Small horizontal waves dw HDMA_Normal_L1_H ;| $02 = Normal horizontal waves dw HDMA_Small_L1_V ;| $03 = Small vertical waves dw HDMA_Normal_L1_V ;/ $04 = Normal vertical waves Layer_2_Pointers: LDA $0F3C ;\ Get layer 2 flag JSL $8086DF ;/ and execute pointer dw HDMA_Return ;\ $00 = Nothing dw HDMA_Small_L2_H ;| $01 = Small horizontal waves dw HDMA_Normal_L2_H ;| $02 = Normal horizontal waves dw HDMA_Heavy_L2_H ;| $03 = Heavy horizontal waves dw HDMA_Extreme_L2_H ;| $04 = Extreme horizontal waves dw HDMA_Small_L2_V ;| $05 = Small vertical waves dw HDMA_Normal_L2_V ;| $06 = Normal vertical waves dw HDMA_Normal_L2_H_Top ;| $07 = Normal horizontal waves on top only dw HDMA_Normal_L2_H_Bot ;| $08 = Normal horizontal waves on bottom only dw HDMA_Multi_Scroll_L2_1 ;| $09 = Parallax scrolling variant 1 dw HDMA_Multi_Scroll_L2_2 ;| $0A = Parallax scrolling variant 2 dw HDMA_Auto_Multi_Scroll_L2_1 ;| $0B = Automatic parallax scrolling variant 1 dw HDMA_Auto_Multi_Scroll_L2_2 ;/ $0C = Automatic parallax scrolling variant 2 Extra_Pointers: LDA $0F3D ;\ Get extra flag JSL $8086DF ;/ and execute pointer dw HDMA_Return ;\ $00 = Nothing dw HDMA_Windowing_Spotlight ;/ $01 = Spotlight Layer_1_Flags: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;00-0F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;10-1F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;20-2F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;30-3F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;40-4F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;50-5F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;60-6F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;70-7F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;80-8F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;90-9F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;A0-AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;B0-BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;C0-CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;D0-DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;E0-EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;F0-FF db $00,$00,$00,$00,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00 ;100-10F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;110-11F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;120-12F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;130-13F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;140-14F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;150-15F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;160-16F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;170-17F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;180-18F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;190-19F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1A0-1AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1B0-1BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1C0-1CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1D0-1DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1E0-1EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1F0-1FF Layer_2_Flags: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;00-0F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;10-1F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;20-2F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;30-3F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;40-4F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;50-5F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;60-6F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;70-7F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;80-8F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;90-9F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;A0-AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;B0-BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;C0-CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;D0-DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;E0-EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;F0-FF db $00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;100-10F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;110-11F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;120-12F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;130-13F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;140-14F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;150-15F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;160-16F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;170-17F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;180-18F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;190-19F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1A0-1AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1B0-1BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1C0-1CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1D0-1DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1E0-1EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1F0-1FF Extra_Flags: db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;00-0F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;10-1F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;20-2F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;30-3F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;40-4F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;50-5F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;60-6F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;70-7F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;80-8F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;90-9F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;A0-AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;B0-BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;C0-CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;D0-DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;E0-EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;F0-FF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;100-10F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;110-11F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;120-12F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;130-13F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;140-14F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;150-15F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;160-16F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;170-17F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;180-18F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;190-19F db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1A0-1AF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1B0-1BF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1C0-1CF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1D0-1DF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1E0-1EF db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;1F0-1FF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Spawned Power-Up Fix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Power_Up_Fix: LDA $9E,x ;\ Check, if current power-up CMP #$77 ;| is a cape, otherwise run BEQ Is_Cape ;| code for fire flower. CMP #$7D ;| If it is a ballon, BEQ Is_Balloon ;/ execute original code. Is_Mush_Flow_Star: LDA $157C,x ;\ Properties are based LSR A ;| on the sprite's direction LDA #$20 ;| Med. Priority + no flip BCS No_Mush_Flow_Star_Flip ;/ No flip? Branch. ORA #$60 ;| Med. Priority + X-flip No_Mush_Flow_Star_Flip: ORA $15F6,x ;\ Add in palette/gfx page STA $64 ;| Store sprite priorities BRA Return_Property ;/ Return from flower routine. Is_Cape: LDA $157C,x ;\ Properties are based LSR A ;| on the sprite's direction LDA #$30 ;| Hi. Priority + no flip BCS No_Cape_Flip ;/ No flip? Branch. ORA #$70 ;| Hi. Priority + X-flip No_Cape_Flip: ORA $64 ;\ Add in sprite priorities ORA $15F6,x ;| Add in palette/gfx page BRA Return_Property ;/ Return from flower routine. Is_Balloon: LDA $157C,x ;\ Properties are based LSR A ;| on the sprite's direction LDA #$00 ;| No Priority + no flip BCS No_Balloon_Flip ;/ No flip? Branch. ORA #$40 ;| No Priority + X-flip No_Balloon_Flip: ORA $64 ;\ Add in sprite priorities ORA $15F6,x ;| Add in palette/gfx page Return_Property: EOR $0A ;| Star palette values are here. STA $0303,y ;| Store properties PEA $C6E4 ;| Return to the hijacked JML $81C6D1 ;/ routine again. Effect_Files: incsrc kit/hdma_gradients.asm ;\ incsrc kit/hdma_misc.asm ;| Include HDMA effects incsrc kit/hdma_waves.asm ;/ CodeEnd: