diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 0fd3206..1262569 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -535,6 +535,9 @@ CalculateTransitionLanding: org $02C176 Overworld_FinalizeEntryOntoScreen_Data: +org $82C3F2 +OverworldLoadScreensPaletteSet_long: + org $02D9B9 Underworld_LoadSpawnEntrance: diff --git a/owrando.asm b/owrando.asm index 25eb1fc..f5d6dfc 100644 --- a/owrando.asm +++ b/owrando.asm @@ -47,6 +47,9 @@ Overworld_LoadSpecialOverworld_RoomId: org $04E8B4 Overworld_LoadSpecialOverworld: +org $02A9DA +JSL OWSkipMosiac + org $07982A Link_ResetSwimmingState: @@ -945,7 +948,19 @@ OWNewDestination: ; crossed OW shuffle and terrain ldx $05 : ldy $08 : jsr OWWorldTerrainUpdate - lda $05 : sta $8a + lda $05 : sta $8a : JSR OWDetermineScreensPaletteSet + + ;PLA : AND.b #$3F : BEQ .leaving_woods + ;LDA $8A : AND.b #$3F : BEQ .entering_woods + CPX.w $0AB3 : BEQ .skip_palette ; check if next screen's palette is different + LDA $00 : PHA + JSL OverworldLoadScreensPaletteSet_long ; loading correct OW palette + PLA : STA $00 + ;.leaving_woods + ;.entering_woods + .skip_palette + lda $8a + rep #$30 : rts } OWLoadSpecialArea: @@ -1085,6 +1100,30 @@ OWLoadGearPalettes: PLA : STA $00 : PLY : PLX RTS } +OWDetermineScreensPaletteSet: ; A = OWID to check +{ + LDX.b #$02 + PHA : AND.b #$3F + CMP.b #$03 : BEQ .death_mountain + CMP.b #$05 : BEQ .death_mountain + CMP.b #$07 : BEQ .death_mountain + LDX.b #$00 + .death_mountain + PLA : PHX : TAX : LDA.l OWTileWorldAssoc,x : BEQ + + PLX : INX : RTS + + PLX : RTS +} +OWSkipMosiac: +{ + LDA.l OWMode : ORA.l OWMode+1 : BEQ .vanilla + PLA : PLA : PEA $A9F2 + RTL + .vanilla + LDA.b $8A : AND.b #$3F : BNE + ; what we wrote over, kinda + PLA : PLA : PEA $A9E3 + + + RTL +} OWAdjustExitPosition: { LDA.w $06FC : CMP.b #$60 : BEQ .stone_bridge