diff --git a/drhooks.asm b/drhooks.asm index 41295aa..9b60310 100644 --- a/drhooks.asm +++ b/drhooks.asm @@ -139,6 +139,14 @@ org $019dbd ; <- Bank01.asm : 4465 of Object_Draw8xN (LDA $9B52, Y : STA $7E2000 jsl CutoffEntranceRug : bra .nextTile : nop .nextTile +;maybe set 02e2 to 0 + +org $0799de ; <- Bank07.asm : 4088 (LDA.b #$15 : STA $5D) +JSL StoreTempBunnyState +; +org $08c450 ; <- ancilla_receive_item.asm : 146-148 (STY $5D : STZ $02D8) +JSL RetrieveBunnyState : NOP + ; These two, if enabled together, have implications for vanilla BK doors in IP/Hera/Mire ; IPBJ is common enough to consider not doing this. Mire is not a concern for vanilla - maybe glitched modes ; Hera BK door back can be seen with Pot clipping - likely useful for no logic seeds diff --git a/keydropshuffle.asm b/keydropshuffle.asm index 90a21c4..67241d7 100644 --- a/keydropshuffle.asm +++ b/keydropshuffle.asm @@ -116,10 +116,12 @@ KeyGet: lda $7ef36f ; what we wrote over pha lda.l ShuffleKeyDrops : bne + - pla : rtl - + - ldy $0e80, x - phy + - pla : rtl + + ldy $0e80, x + lda $a0 : cmp #$87 : bne + + jsr ShouldKeyBeCountedForDungeon : bcc - + jsl CountChestKeyLong : bra - + + phy jsr KeyGetPlayer : sta !MULTIWORLD_ITEM_PLAYER_ID jsl.l $0791b3 ; Player_HaltDashAttackLong jsl.l Link_ReceiveItem @@ -136,6 +138,16 @@ KeyGet: pla : dec : rtl } +; Input Y - the item type +ShouldKeyBeCountedForDungeon: +{ + phx + lda $040c : lsr : tax + tya : cmp KeyTable, x : bne + + - plx : sec : rts + + cmp #$24 : beq - + plx : clc : rts +} BigKeyGet: { diff --git a/overrides.asm b/overrides.asm index a7830f1..7db52a2 100644 --- a/overrides.asm +++ b/overrides.asm @@ -1,4 +1,5 @@ ;================================================================================ +;================================================================================ ; Lamp Mantle & Light Cone Fix ;-------------------------------------------------------------------------------- ; Output: 0 for darkness, 1 for lamp cone @@ -49,11 +50,6 @@ MirrorCheckOverride: rtl + lda.l DRScroll : rtl -;moved to base rom -;MirrorCheckOverride2: -; lda $7ef353 : and #$02 : rtl - - BlockEraseFix: lda $7ef353 : and #$02 : beq + stz $05fc : stz $05fd @@ -93,6 +89,7 @@ SuctionOverworldFix: CutoffRooms: db $bc, $a2, $1a, $49, $14, $8c, $9f, $c2 db $66, $5d, $a8 +; Don't forget CutoffRoomCount!!! CutoffEntranceRug: pha : phx @@ -101,7 +98,7 @@ CutoffEntranceRug: cmp #$000C : bne .norm + lda $a0 : sep #$20 : ldx #$0000 - cmp.l CutoffRooms, x : beq .check - inx : cpx #$0009 : !blt - ; CutoffRoom Count is here! + inx : cpx #$000B : !blt - ; CutoffRoomCount is here! rep #$20 .norm plx : pla : lda $9B52, y : sta $7E2000, x ; what we wrote over rtl @@ -113,3 +110,15 @@ rtl bra .norm .skip plx : pla : rtl + +StoreTempBunnyState: + LDA $5D : CMP #$1C : BNE + + STA $5F + + LDA #$15 : STA $5D ; what we wrote over +RTL + +RetrieveBunnyState: + STY $5D : STZ $02D8 ; what we wrote over + LDA $5F : BEQ + + STA $5D ++ RTL diff --git a/stats.asm b/stats.asm index e98381e..72cd524 100644 --- a/stats.asm +++ b/stats.asm @@ -223,7 +223,8 @@ IncrementSmallKeysNoPrimary: LDA $1B : BEQ + ; skip room check if outdoors PHP : REP #$20 ; set 16-bit accumulator LDA $048E : CMP.w #$0087 : BNE ++ ; hera basement - PLP : PHY : LDY.b #24 : JSL.l FullInventoryExternal : PLY : BRA + + PLP : PHY : LDY.b #24 : JSL.l FullInventoryExternal + JSR CountChestKey : PLY : BRA + ++ PLP +