// This code makes every door load the right section of the background when using BG_Data type 000E // Made by P.JBoy, 10/05/2009, for Super Metroid (JU)[!] arch snes.cpu ; lorom ; noheader //---------------------Hijacks---------------------- org $82E5D9 //\ jsr $F777 //} When coming out a door nop #15 /// org $82E9E7 //\ jsr $F777 //} When loading from the ship nop #15 /// //----------------------Code------------------------ org $82F777 sep #$20 lda.b #$80 //\ sta.b $00 //} Stores the low byte of the bg source address ldx.w $078D //\ lda.l $830007,x //| cmp.b #$01 //| bne BETA //| //| ALPHA: //| ldx.w #$4C00 //| bra GAMMA //} Gets the right section of VRAM to write to //| BETA: //| cmp.b #$03 //| beq ALPHA //| //| ldx.w #$4800 /// GAMMA: rep #$20 //\ asl #3 //} Gets the right section of BG to load adc.w #$8AB1 /// sta.b $01 // Stores bank and high bytes of the bg source stx.b $03 // Stores bg dest. lda.w #$0800 //\ sta.b $05 //} Stores bg size ldy.w #$0000 // Makes the game load from 7E0000 for BG_Data sty.b $07 // Ends BG_Data loop rts