From 1b564d99fcf73cf2acfe37340eac9f1efc257e26 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 9 May 2023 21:22:31 -0500 Subject: [PATCH] Fixed Apple GFX by using other VRAM slots in the rotation --- hooks.asm | 3 +++ keydrop/dynamic_si_vram.asm | 49 +++++++++++++++++++++++++++++-------- newitems.asm | 5 ++++ shopkeeper.asm | 5 ++++ utilities.asm | 6 ++--- zoraking.asm | 2 +- 6 files changed, 56 insertions(+), 14 deletions(-) diff --git a/hooks.asm b/hooks.asm index ad32f79..438cdb4 100755 --- a/hooks.asm +++ b/hooks.asm @@ -982,6 +982,9 @@ JSL.l ChestPrep NOP #3 db $90 ; !BCC .cantOpen ;-------------------------------------------------------------------------------- +org $008A9D +JSL ConditionalPushBlockTransfer : NOP + org $00D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D) JML.l GetAnimatedSpriteGfxFile diff --git a/keydrop/dynamic_si_vram.asm b/keydrop/dynamic_si_vram.asm index f4893db..0f4ceb8 100644 --- a/keydrop/dynamic_si_vram.asm +++ b/keydrop/dynamic_si_vram.asm @@ -71,6 +71,13 @@ RequestSlottedTile: ++ LDA.b #!DynamicDropGFXSlotCount_OW +++ STA.w SprItemGFX,X JMP .success + + CMP.b #$B1 : BNE + ; if apple, use apple OAM slot + LDA.b $1B : BEQ ++ + LDA.b #!DynamicDropGFXSlotCount_UW + BRA +++ + ++ LDA.b #!DynamicDropGFXSlotCount_OW + +++ INC : STA.w SprItemGFX,X + JMP .success + PHA : PHX @@ -194,16 +201,17 @@ FreeUWGraphics: dw $8840>>1 dw $8980>>1 ; dw $9960>>1 ; Arghuss Splash apparently -; dw $9C00>>1 - dw $9CA0>>1 + dw $9C00>>1 +; dw $9CA0>>1 dw $9DC0>>1 .end FreeOWGraphics: + dw $8180>>1 ; Push Block ;dw $8800>>1 ; Shovel Dirt dw $9960>>1 ; Arghuss/Zora Splash dw $9C00>>1 ; Heart Piece - dw $9CA0>>1 ; Apple + ;dw $9CA0>>1 ; Apple ;dw $9DC0>>1 ; Whirlpool .end @@ -313,8 +321,8 @@ DynamicOAMTileUW_thin: dw 0, 0 : db $4C, $00, $20, $00 dw 0, 8 : db $5C, $00, $20, $00 - dw 0, 0 : db $E5, $00, $20, $00 - dw 0, 8 : db $F5, $00, $20, $00 + dw 0, 0 : db $E0, $00, $20, $00 + dw 0, 8 : db $F0, $00, $20, $00 dw 0, 0 : db $EE, $00, $20, $00 dw 0, 8 : db $FE, $00, $20, $00 @@ -340,7 +348,7 @@ DynamicOAMTileUW_full: dw -4, -1 : db $4C, $00, $20, $02 dd 0, 0 - dw -4, -1 : db $E5, $00, $20, $02 + dw -4, -1 : db $E0, $00, $20, $02 dd 0, 0 dw -4, -1 : db $EE, $00, $20, $02 @@ -351,7 +359,13 @@ DynamicOAMTileUW_full: dw -4, -1 : db $EA, $00, $20, $02 ; fairy dd 0, 0 + dw -4, -1 : db $E5, $00, $20, $02 ; apple + dd 0, 0 + DynamicOAMTileOW_thin: + dw 0, 0 : db $0C, $00, $20, $00 + dw 0, 8 : db $1C, $00, $20, $00 + ; dw 0, 0 : db $40, $00, $20, $00 ; dw 0, 8 : db $50, $00, $20, $00 @@ -361,8 +375,8 @@ DynamicOAMTileOW_thin: dw 0, 0 : db $E0, $00, $20, $00 dw 0, 8 : db $F0, $00, $20, $00 - dw 0, 0 : db $E5, $00, $20, $00 - dw 0, 8 : db $F5, $00, $20, $00 + ;dw 0, 0 : db $E5, $00, $20, $00 + ;dw 0, 8 : db $F5, $00, $20, $00 ;dw 0, 0 : db $EE, $00, $20, $00 ;dw 0, 8 : db $FE, $00, $20, $00 @@ -379,6 +393,9 @@ DynamicOAMTileOW_thin: dw 0, 8 : db $F4, $00, $20, $00 DynamicOAMTileOW_full: + dw 0, 0 : db $0C, $00, $20, $02 + dd 0, 0 + ; dw 0, 0 : db $40, $00, $20, $02 ; dd 0, 0 @@ -388,8 +405,8 @@ DynamicOAMTileOW_full: dw 0, 0 : db $E0, $00, $20, $02 dd 0, 0 - dw 0, 0 : db $E5, $00, $20, $02 - dd 0, 0 + ;dw 0, 0 : db $E5, $00, $20, $02 + ;dd 0, 0 ;dw 0, 0 : db $EE, $00, $20, $02 ;dd 0, 0 @@ -399,3 +416,15 @@ DynamicOAMTileOW_full: dw 0, 0 : db $EA, $00, $20, $02 ; fairy dd 0, 0 + dw 0, 0 : db $E5, $00, $20, $02 ; apple + dd 0, 0 + +ConditionalPushBlockTransfer: + LDA.b $1B : BNE + + LDA.b #$0F ; don't transfer push block when on the OW + BRA .return-3 + + + LDA.b #$1F : STA.w $420B ; what we wrote over + .return +RTL + diff --git a/newitems.asm b/newitems.asm index 64687bb..0b29d9d 100755 --- a/newitems.asm +++ b/newitems.asm @@ -87,6 +87,9 @@ GetAnimatedSpriteGfxFile: CMP.b #$4B : BNE + LDY.b #$50 : JML GetAnimatedSpriteGfxFile_return + + CMP.b #$4C : BNE + + LDY.b #$5E : JML GetAnimatedSpriteGfxFile_return + + CMP.b #$24 : !BGE + LDY.b #$5B : JML GetAnimatedSpriteGfxFile_return @@ -127,6 +130,8 @@ dw $09C0 ; Clock dw $0A20 ; Triforce dw $0A50 ; Power Star dw $09F0 ; Chicken +dw $09C0 ; Fairy ($09F0 if using uncompressed version) +dw $0988 ; Apple GetAnimatedSpriteBufferPointer: ;PHB : PHK : PLB diff --git a/shopkeeper.asm b/shopkeeper.asm index 84f514d..89491d5 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -816,6 +816,7 @@ Shopkeeper_DrawNextItem: CMP.b #$2E : BNE + : JMP .potion + CMP.b #$2F : BNE + : JMP .potion + CMP.b #$30 : BNE + : JMP .potion + + CMP.b #$B1 : BNE + : BRA .apple + CMP.b #$B2 : BNE + : BRA .fairy + CMP.b #$B5 : BNE + : BRA .goodbee + CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + @@ -857,6 +858,10 @@ Shopkeeper_DrawNextItem: LDA.b #$E4 ; good bee is #$E4/D4 because it's already there in VRAM STA.b $0E BRA .vramLoc + .apple + LDA.b #$E5 ; apple is #$E5 because it's already there in VRAM + STA.b $0E + BRA .vramLoc .potion LDA.b #$C0 ; potion is #$C0 because it's already there in VRAM + diff --git a/utilities.asm b/utilities.asm index 450030c..815f7df 100644 --- a/utilities.asm +++ b/utilities.asm @@ -155,8 +155,8 @@ RTL ;Bx db $2C ; Bee Trap - db $4A ; Apples - db $4A ; Fairy + db $4D ; Apples + db $4C ; Fairy db $4B ; Chicken db $3B ; Big Magic db $4A ; Good Bee @@ -291,7 +291,7 @@ RTL db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Big Key db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Small Key db $04 ; Bee Trap - db $08 ; Apples + db $02 ; Apples db $08 ; Fairy db $02 ; Chicken db $08 ; Big Magic diff --git a/zoraking.asm b/zoraking.asm index db39a42..4ebb0d9 100644 --- a/zoraking.asm +++ b/zoraking.asm @@ -11,7 +11,7 @@ ZoraSplashGfxFix: ; below should be set to the index used for Arrghus/Zora Splash ; FreeOWGraphics in dynamic_si_vram.asm, whatever index is $9960 ; this makes it so the first gfx that is loading is AFTER the splash - LDA.b #$00 : STA.w DynamicDropGFXIndex + LDA.b #$01 : STA.w DynamicDropGFXIndex JSL LoadCommonSprites_long REP #$30 : PLY : PLX : PLA RTL