From 9094d118df575758f2d93bfc39c4797dae6847b5 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 14 Nov 2021 17:08:06 -0600 Subject: [PATCH 1/4] Fixed Inverted Double-Swap issue --- invertedmaps.asm | 69 +++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/invertedmaps.asm b/invertedmaps.asm index 382e4e9..8c4b46a 100644 --- a/invertedmaps.asm +++ b/invertedmaps.asm @@ -1,23 +1,38 @@ Overworld_LoadNewTiles: { - ; add sign to EDM for OWG people to read LDA $040A : AND #$00FF : CMP #$0005 : BNE + + ; add sign to EDM for OWG people to read LDA #$0101 : STA $7E2E18 ; #$0101 is the sign tile16 id, $7E2D98 is the position of the tile16 on map - + - - ; GT sign - LDA InvertedMode : AND #$00FF : BNE + - LDA $040A : AND #$00FF : CMP #$0043 : BNE + - LDA #$0101 : STA $7E2550 - + - - ; Pyramid sign - LDA InvertedMode : AND #$00FF : BNE + - LDA $040A : AND #$00FF : CMP #$005B : BNE + - LDA #$0101 : STA $7E27B6 ;Moved sign near statue - LDA #$05C2 : STA $7E27B4 ;added a pyramid peg on the left of the sign - + + BRA .invertedMods + + CMP #$005B : BNE .invertedMods + ; add Goal sign to Pyramid + LDA #$0101 : STA $7E27B6 ; Moved sign near statue + LDA #$05C2 : STA $7E27B4 ; added a pyramid peg on the left of the sign + + .invertedMods + LDA InvertedMode : AND #$00FF : BEQ ++ ; forced inverted changes + LDA $040A : AND #$00FF : CMP #$0043 : BNE + + LDA #$08D5 : STA $7E235E ; GT entrance auto-opened + LDA #$08E3 : STA $7E23DE + LDA #$0E90 : STA $7E245E + LDA #$0E96 : STA $7E24DE + STA $7E255E + LDA #$08D6 : STA $7E2360 + LDA #$08E4 : STA $7E23E0 + LDA #$0E91 : STA $7E2460 + LDA #$0E97 : STA $7E24E0 + STA $7E2560 + LDA #$0E94 : STA $7E25DE + LDA #$0E95 : STA $7E25E0 + BRA .postInverted + + CMP #$001B : BNE .postInverted + LDA #$0101 : STA $7E222C ; add sign for Tower Entry at HC + BRA .postInverted + ++ ; forced non-inverted changes + LDA $040A : AND #$00FF : CMP #$0043 : BNE .postInverted + LDA #$0101 : STA $7E2550 ; GT sign + .postInverted SEP #$30 LDX $8A : LDA.l OWTileMapAlt, X : BEQ .notInverted PHB @@ -340,6 +355,8 @@ LDA #$0465 : STA $219E LDA #$0466 : STA $21A0 + LDA.l OWTileMapAlt+$1B : AND #$0001 : BEQ .notSwapped +LDA #$0101 : STA $2252 ; add sign for Goal at HC + ; CHECK IF AGAHNIM 2 IS DEAD AND WE HAVE ALREADY LANDED LDA $7EF2DB : AND #$0020 : BEQ .agahnim2Alive LDA #$0E3A : STA $24BC @@ -356,10 +373,6 @@ LDA #$0491 : STA $25C0 .agahnim2Alive .notSwapped -LDA.l InvertedMode : AND #$00FF : BEQ .notInverted - LDA #$0101 : STA $7E222C : STA $7E2252 ; add sign for Tower Entry - -.notInverted LDA.l OWTileMapAlt+$1B : AND #$0002 : BEQ .return ;rocks for hardlock protection LDA #$02FA : STA $2F80 @@ -945,20 +958,6 @@ RTS map067: { -LDA.l InvertedMode : AND #$00FF : BEQ .notInverted - LDA #$08D5 : STA $235E ; GT entrance auto-opened - LDA #$08E3 : STA $23DE - LDA #$0E90 : STA $245E - LDA #$0E96 : STA $24DE - STA $255E - LDA #$08D6 : STA $2360 - LDA #$08E4 : STA $23E0 - LDA #$0E91 : STA $2460 - LDA #$0E97 : STA $24E0 - STA $2560 - LDA #$0E94 : STA $25DE - LDA #$0E95 : STA $25E0 -.notInverted LDA.l OWTileMapAlt+$43 : AND #$0001 : BEQ .owshuffle LDA #$0180 : STA $275E ; ladder LDA #$0181 : STA $2760 @@ -1022,6 +1021,10 @@ RTS map091: ;Pyramid { LDA.l OWTileMapAlt+$5B : AND #$0001 : BEQ + +; delete Goal sign +LDA #$09F1 : STA $27B6 ; remove sign +LDA #$09F0 : STA $27B4 ; remove the added pyramid peg on the left of the sign + LDA #$0A06 : STA $2E1C ; cover up entrance LDA #$0A0E : STA $2E1E From 3262c6ff1af09d343616a549b5ed65ec0f3c0f7f Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sat, 20 Nov 2021 00:34:57 -0600 Subject: [PATCH 2/4] Fix mirror portals getting erased when changing worlds --- owrando.asm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/owrando.asm b/owrando.asm index 86a6586..83d30e6 100644 --- a/owrando.asm +++ b/owrando.asm @@ -383,6 +383,21 @@ OWWorldUpdate: ; x = owid of destination screen { lda.l OWTileWorldAssoc,x : cmp.l $7ef3ca : beq .return sta.l $7ef3ca ; change world + + ; activate mirror portal sprite + phx : cmp #0 : beq + : lda #1 + + cmp.l InvertedMode : bne + + lda #$09 : pha : bra .setPortalSpriteState + + lda #$07 : pha ; some state that allows the portal to persist without it getting overwritten + + .setPortalSpriteState + ldx #$0f + - lda $0e20,x : cmp #$6C : bne + + pla : sta $0dd0,x : plx : bra .playSfx + + dex : bpl - + pla : plx + + .playSfx lda #$38 : sta $012f ; play sfx - #$3b is an alternative ; toggle bunny mode From 10ad8ab8346fcf600f68821d007688e12fa32f4f Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 22 Nov 2021 09:07:38 -0600 Subject: [PATCH 3/4] Fix mirror portals getting erased when changing worlds --- owrando.asm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/owrando.asm b/owrando.asm index 83d30e6..214bbfa 100644 --- a/owrando.asm +++ b/owrando.asm @@ -12,6 +12,9 @@ dw 0 org $02a999 jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA +org $05af75 +jsl OWPreserveMirrorSprite : nop #2 ; LDA $7EF3CA : BNE $05AFDF + ; whirlpool shuffle cross world change org $02b3bd jsl OWWhirlpoolUpdate ;JSL $02EA6C @@ -139,6 +142,19 @@ OWWhirlpoolUpdate: rtl } +OWPreserveMirrorSprite: +{ + lda.l OWMode+1 : and.b #!FLAG_OW_CROSSED : beq .vanilla + rtl ; if OW Crossed, skip world check and continue + .vanilla + lda $7ef3ca : bne .deleteMirror + rtl + + .deleteMirror + pla : lda #$de : pha ; in vanilla, if in dark world, jump to $05afdf + rtl +} + OWFluteCancel: { lda.l OWFlags+1 : and #$01 : bne + @@ -383,25 +399,10 @@ OWWorldUpdate: ; x = owid of destination screen { lda.l OWTileWorldAssoc,x : cmp.l $7ef3ca : beq .return sta.l $7ef3ca ; change world - - ; activate mirror portal sprite - phx : cmp #0 : beq + : lda #1 - + cmp.l InvertedMode : bne + - lda #$09 : pha : bra .setPortalSpriteState - + lda #$07 : pha ; some state that allows the portal to persist without it getting overwritten - - .setPortalSpriteState - ldx #$0f - - lda $0e20,x : cmp #$6C : bne + - pla : sta $0dd0,x : plx : bra .playSfx - + dex : bpl - - pla : plx - - .playSfx lda #$38 : sta $012f ; play sfx - #$3b is an alternative ; toggle bunny mode - + lda $7ef357 : bne .nobunny + lda $7ef357 : bne .nobunny lda.l InvertedMode : bne .inverted lda $7ef3ca : and.b #$40 : bra + .inverted lda $7ef3ca : and.b #$40 : eor #$40 From a1fff4ff76e9c7d0a1a792bd5d620185b57f1219 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Wed, 24 Nov 2021 15:58:39 -0600 Subject: [PATCH 4/4] Fix mirror portals getting erased when changing worlds --- owrando.asm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/owrando.asm b/owrando.asm index 214bbfa..ada8e1c 100644 --- a/owrando.asm +++ b/owrando.asm @@ -147,7 +147,10 @@ OWPreserveMirrorSprite: lda.l OWMode+1 : and.b #!FLAG_OW_CROSSED : beq .vanilla rtl ; if OW Crossed, skip world check and continue .vanilla - lda $7ef3ca : bne .deleteMirror + lda InvertedMode : beq + + lda $7ef3ca : beq .deleteMirror + rtl + + lda $7ef3ca : bne .deleteMirror rtl .deleteMirror