From f68a635e2ba3516ceeca7f6b374faafbb1381099 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Fri, 12 Feb 2021 23:00:24 +0100 Subject: [PATCH 1/4] Minor fixes for in-room stairs --- spiral.asm | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/spiral.asm b/spiral.asm index 0d13c4e..2dd2ab8 100644 --- a/spiral.asm +++ b/spiral.asm @@ -170,10 +170,10 @@ InroomStairsWarp: { ; should be the same as lda $0462 : and #$04 : lsr #2 : eor #$01 : sta $07 lda $01 : and #$80 : beq .notEdge lda $07 : sta $03 : beq + - lda $01 : jsr LoadSouthMidpoint : sta $22 : lda #$e0 + lda $01 : jsr LoadSouthMidpoint : sta $22 : lda #$f4 bra ++ + - lda $01 : jsr LoadNorthMidpoint : sta $22 : lda #$1b + lda $01 : jsr LoadNorthMidpoint : sta $22 : dec $21 : lda #$f7 ++ sta $20 lda $01 : and #$20 : beq + @@ -185,26 +185,36 @@ InroomStairsWarp: { brl .layer .notEdge lda $01 : and #$03 : cmp #$03 : bne .normal + txa : and #$06 : sta $07 lda $01 : and #$30 : lsr #3 : tay - lda.w InroomStairsX,y : sta $22 lda.w InroomStairsX+1,y : sta $02 lda.w InroomStairsY+1,y : sta $03 - lda.w InroomStairsY,y - ldy $07 : beq + - !add #$07 - + - sta $20 + cpy $07 : beq .vanillaTransition + lda.w InroomStairsX,y : sta $22 + lda.w InroomStairsY,y + ldy $07 : beq + + !add #$07 + + + sta $20 + inc $07 + bra ++ + .vanillaTransition + lda #$c0 : sta $07 ; leave camera + ++ %StonewallCheck($1b) - inc $07 lda $01 : and #$04 : lsr #2 bra .layer .normal lda $01 : sta $fe ; trap door lda $07 : sta $03 : beq + + ldy $a0 : cpy #$51 : beq .specialFix ; throne room + cpy #$02 : beq .specialFix ; sewers pull switch + cpy #$71 : beq .specialFix ; castle armory lda #$e0 - ldy $a0 : cpy #$51 : bne ++ ; special fix for throne room - !sub #$18 - bra ++ + bra ++ + .specialFix + lda #$c8 + bra ++ + %StonewallCheck($43) lda #$1b @@ -235,12 +245,15 @@ InroomStairsWarp: { ldy #$01 : jsr ShiftQuadSimple .skipYQuad + lda $07 : bmi .skipCamera ldy #$00 : jsr SetCamera ; horizontal camera ldy #$01 : sty $07 : jsr SetCamera ; vertical camera lda $20 : cmp #$e0 : bcc + lda $e8 : bne + lda #$10 : sta $e8 ; adjust vertical camera at bottom + + .skipCamera + jsr StairCleanup ply : plx : plb ; pull the stuff we pushed rts From d15dc91db43dbb8d267f41f156782d6c5ce40704 Mon Sep 17 00:00:00 2001 From: aerinon Date: Sat, 13 Feb 2021 20:48:51 -0700 Subject: [PATCH 2/4] Fix for BallnChain guard when keydropshuffle is off --- inventory.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory.asm b/inventory.asm index 73802f6..cd55423 100644 --- a/inventory.asm +++ b/inventory.asm @@ -322,7 +322,7 @@ AddInventory: CMP.l BallNChainDungeon : BNE + CPY.b #$32 : BNE + - BRL .fullItemCounts + BRL .done + LSR : TAX : LDA $7EF4BF, X : INC : STA $7EF4BF, X CPX.b #$0D : BNE + LDA $7EF366 : AND #$04 : BNE ++ From 9d607b7caac69735353c5b6c926cf55be272c4cc Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 16 Feb 2021 13:36:44 -0700 Subject: [PATCH 3/4] Inverted fix - no longer a bunny in DW sanc Standard fix - can't kill Aga1 before rescuing Zelda Total locations to check set on file load, and displayed in HUD --- dr_lobby.asm | 1 + drhooks.asm | 3 +++ events.asm | 1 + hudadditions.asm | 18 ++++++++++++++---- overrides.asm | 7 +++++++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/dr_lobby.asm b/dr_lobby.asm index c2f08fa..cf3ed69 100644 --- a/dr_lobby.asm +++ b/dr_lobby.asm @@ -1,5 +1,6 @@ CheckDarkWorldSanc: STA $A0 : STA $048E ; what we wrote over + LDA.l InvertedMode : BNE + LDA.l SancDarkWorldFlag : BEQ + SEP #$30 LDA $A0 : CMP #$12 : BNE ++ diff --git a/drhooks.asm b/drhooks.asm index 1aa62dd..c4939e9 100644 --- a/drhooks.asm +++ b/drhooks.asm @@ -170,6 +170,9 @@ JSL CheckDarkWorldSanc : NOP org $01891e ; <- Bank 01.asm : 991 Dungeon_LoadType2Object (LDA $00 : XBA : AND.w #$00FF) JSL RainPrevention : NOP #2 +org $1edabf ; <- sprite_energy_ball.asm : 86-7 Sprite_EnergyBall (LDA.b #$10 : LDX.b #$00) +JSL StandardAgaDmg + ; 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/events.asm b/events.asm index dbdafb7..c9ffa67 100644 --- a/events.asm +++ b/events.asm @@ -88,6 +88,7 @@ RTL OnFileLoad: REP #$10 ; set 16 bit index registers JSL.l EnableForceBlank ; what we wrote over + REP #$20 : LDA.l $30F010 : STA.l $7EF33E : SEP #$20 LDA.b #$07 : STA $210c ; Restore screen 3 to normal tile area diff --git a/hudadditions.asm b/hudadditions.asm index 94edd3d..4568b12 100644 --- a/hudadditions.asm +++ b/hudadditions.asm @@ -8,11 +8,21 @@ DrHudOverride: HudAdditions: { lda.l DRFlags : and #$0008 : beq ++ - lda $7EF423 + LDA.w #$28A4 : STA !GOAL_DRAW_ADDRESS + lda $7EF423 jsr HudHexToDec4DigitCopy - LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+10 ; draw 100's digit - LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+12 ; draw 10's digit - LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+14 ; draw 1's digit + LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+2 ; draw 100's digit + LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+4 ; draw 10's digit + LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+6 ; draw 1's digit + LDA.w #$2830 : STA !GOAL_DRAW_ADDRESS+8 ; draw slash + LDA.l DRFlags : AND #$0100 : BNE + + lda $7EF33E + jsr HudHexToDec4DigitCopy + LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+10 ; draw 100's digit + LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+12 ; draw 10's digit + LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+14 ; draw 1's digit + BRA ++ + + LDA.w #$2405 : STA !GOAL_DRAW_ADDRESS+10 : STA !GOAL_DRAW_ADDRESS+12 : STA !GOAL_DRAW_ADDRESS+14 ++ LDX $1B : BNE + : RTS : + ; Skip if outdoors diff --git a/overrides.asm b/overrides.asm index d47d565..28eb7f9 100644 --- a/overrides.asm +++ b/overrides.asm @@ -142,3 +142,10 @@ RainPrevention: PLA : LDA #$0008 : RTL .done PLA : RTL +; A should be how much dmg to do to Aga when leaving this function +StandardAgaDmg: + LDX.b #$00 ; part of what we wrote over + LDA.l $7EF3C6 : AND #$04 : BEQ + ; zelda's not been rescued + LDA.b #$10 ; hurt him! + + RTL ; A is zero if the AND results in zero and then Agahnim's invincible! + From 4ae59ad1e6cfbbc719170dcfd2c34611219917df Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 17 Feb 2021 11:50:51 -0700 Subject: [PATCH 4/4] Double count hera basement cage in keydropshuffle --- stats.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stats.asm b/stats.asm index e854827..055ab53 100644 --- a/stats.asm +++ b/stats.asm @@ -244,7 +244,9 @@ IncrementSmallKeysNoPrimary: PHP : REP #$20 ; set 16-bit accumulator LDA $048E : CMP.w #$0087 : BNE ++ ; hera basement PLP : PHY : LDY.b #$24 : JSL.l FullInventoryExternal - JSR CountChestKey : PLY : BRA + + LDA ShuffleKeyDrops : BNE +++ + JSR CountChestKey + +++ PLY : BRA + ++ PLP +