; Separate Luigi Graphics 2.1 ; By Smallhacker ;Mario and Luigi graphics are stored separately in the files ;"Mario.bin" and "Luigi.bin". The graphics in GFX32 are no longer used. ;The hack must have been edited by Lunar Magic before applying this patch. ;If your hack DOESN'T use ExGFX, you need to change one of the lines. ;(Look for a commented line further down) ;CHANGE THESE ADDRESSES TO FREE SECTIONS OF THE ROM! ;The two addresses must be located in different banks. ;Both addresses must be near the start of the bank (no later than $xx/A000) ;(Recommendation: Point these to the start of two empty banks) !freeSpace1 = $128000 !freeSpace2 = $138000 !freeSpace3 = $148000 ;MUST BE AN UNUSED RAM ADDRESS ;(Default address: "Unused" part of stack) !currentGfx = $7E010F ;Replacement GFX files for Luigi !gfx00Luigi = #$00 ;Extended tiles !gfx22Luigi = #$22 ;Blushing graphics (Small) !gfx24Luigi = #$24 ;Blushing graphics (Super) lorom header org $00AA6B JSL Gfx org $049DD6 JSL SwitchPlayer org $00B8A4 JSL Load1st RTS org $009AA4 JSL Title org $00A99B JSL Setup org $00A1DA JML Select org !freeSpace1 db "STAR" dw RATS_End1-RATS_Start1 dw RATS_End1-RATS_Start1^#$FFFF RATS_Start1: Select: JSR Change ;\Don't change this, it will upload the graphics every frame. JSR Upload ;/Scroll Down to see the Change: LDA $1426 ;\ BEQ Select2 ;|Restore Codes JML $80A1DF ;| ;| Select2: ;| JML $80A1E4 ;/ SwitchPlayer: STA $0DB3 TAX JSR Change JSR Upload RTL Setup: LDA #$FF STA !currentGfx LDA #$03 STA $0F RTL Load1st: SEP #$30 JSR Change JSR Upload RTL Title: JSR Change JSR Upload JML $04F675 Change: LDA $0DB3 ;\ CMP #$00 ;|See this? You can change this to whatever you want. BEQ Mario ;| ;| LDA $0DB3 ;| CMP #$01 ;| BEQ Luigi ;/ RTS Luigi: LDA.b #LuigiGfx STA $4302 LDA.b #LuigiGfx>>8 STA $4303 LDA.b #LuigiGfx>>16 STA $4304 LDA #$01 RTS ;BRA Upload Mario: LDA.b #MarioGfx STA $4302 LDA.b #MarioGfx>>8 STA $4303 LDA.b #MarioGfx>>16 LDA.b #MarioGfx>>16 STA $4304 LDA #$00 RTS Upload: CMP !currentGfx BEQ Return STA !currentGfx LDA #$00 STA $4305 LDA #$5D STA $4306 LDA #$00 STA $2181 LDA #$20 STA $2182 LDA #$7E STA $2183 LDA #$80 STA $4301 LDA #$00 STA $4300 LDA #$01 STA $420B Return: RTS Gfx: LDA !currentGfx CMP #$01 BNE GfxGo CPY #$00 BEQ Gfx00 CPY #$22 BEQ Gfx22 CPY #$24 BEQ Gfx24 GfxGo: JML $00BA28 ; Change to $00BA28 if your hack doesn't use ExGFX Gfx00: LDY !gfx00Luigi BRA GfxGo Gfx22: LDY !gfx22Luigi BRA GfxGo Gfx24: LDY !gfx24Luigi BRA GfxGo RATS_End1: org !freeSpace2 db "STAR" dw RATS_End2-RATS_Start2 dw RATS_End2-RATS_Start2^#$FFFF RATS_Start2: MarioGfx: incbin Mario.bin RATS_End2: org !freeSpace3 db "STAR" dw RATS_End3-RATS_Start3 dw RATS_End3-RATS_Start3^#$FFFF RATS_Start3: LuigiGfx: incbin Luigi.bin RATS_End3: