From 3262c6ff1af09d343616a549b5ed65ec0f3c0f7f Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sat, 20 Nov 2021 00:34:57 -0600 Subject: [PATCH] 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