Disable experiment overworld entrance, area, cleanup lost woods cam

This commit is contained in:
scawful
2024-11-10 18:48:28 -05:00
parent 526ed5b20a
commit 6044a92a3a
5 changed files with 141 additions and 218 deletions

View File

@@ -2,7 +2,7 @@
; Lost Woods Hack
;
; Area: 29
; East Exit 2A
; East Exit 2A
; North Exit 21
; South is 31
; West is 28
@@ -15,6 +15,7 @@
!SouthArea = #$31
!EastArea = #$2A
!ComboCounter = $1CF7 ; ram address to store combo counter
!RestoreCam = $1CF8
; ==========================================================
@@ -22,79 +23,59 @@
org $02AA7D
JSL LOST_WOOD_HOOK
; Gets the small/large map true ID of the current screen
Overworld_ActualScreenID = $02A5EC
; At this stage the accumulator contains area currently in
; X contains the area you're moving to.
org $A0F000
LOST_WOOD_HOOK:
LOST_WOOD_HOOK:
{
CMP #$29 ; are we in the right area?
BEQ begincode
normalfinish:
{
; Overworld_ActualScreenID
; Gets the small/large map true ID of the current screen
LDA $02A5EC, x ; not right area so return.
; are we in the right area?
CMP #$29 : BEQ begincode
; not right area so return.
normalfinish:
LDA !RestoreCam : BEQ +
+
LDA Overworld_ActualScreenID, X
STZ !ComboCounter
RTL
} ; label normalfinish
begincode:
{
CPX !EastArea
BEQ normalfinish
begincode:
; Return from where we came from
CPX !EastArea : BEQ normalfinish
; from here onwards, use the ram address to determine which combo you're up to
; this code is pretty repeatable
LDA !ComboCounter
LDA !ComboCounter : CMP #$00 : BNE combo1
; did you get it right?
CPX !NorthArea : BEQ UP_CORRECT
STZ !ComboCounter
BRA RESOLVE_INCORRECT
CMP #$00
BNE combo1
CPX !NorthArea ; did you get it right?
BEQ UP_CORRECT
STZ !ComboCounter
BRA RESOLVE_INCORRECT
} ; label begincode
combo1:
CMP #$01 : BNE combo2
CPX !WestArea : BEQ LEFT_CORRECT
STZ !ComboCounter
BRA RESOLVE_INCORRECT
combo1:
{
CMP #$01
BNE combo2
CPX !WestArea ; did you get it right?
BEQ LEFT_CORRECT
STZ !ComboCounter
BRA RESOLVE_INCORRECT
} ; label comb1
combo2:
CMP #$02 : BNE combo3
CPX !SouthArea : BEQ DOWN_CORRECT
STZ !ComboCounter
BRA RESOLVE_INCORRECT
combo2:
{
CMP #$02
BNE combo3
CPX !SouthArea ; did you get it right?
BEQ DOWN_CORRECT
STZ !ComboCounter
BRA RESOLVE_INCORRECT
} ; label comb2
combo3:
{
CPX !WestArea ; did you get it right?
BNE RESOLVE_INCORRECT ; we want to load the down area, since we complete the combos
LDA #$1B
STA $012F ; play fanfare
BRA normalfinish
combo3:
; we want to load the down area, since we complete the combos
CPX !WestArea : BNE RESOLVE_INCORRECT
LDA #$1B : STA $012F ; play fanfare
BRA normalfinish
RESOLVE_INCORRECT:
CPX !NorthArea
BEQ CASE_UP
CPX !WestArea
BEQ CASE_LEFT
CPX !NorthArea : BEQ CASE_UP
CPX !WestArea : BEQ CASE_LEFT
BRA CASE_DOWN
} ; label combo3
DOWN_CORRECT:
DOWN_CORRECT:
{
INC !ComboCounter
CASE_DOWN:
@@ -116,7 +97,7 @@ LOST_WOOD_HOOK:
} ; label DOWN_CORRECT
UP_CORRECT:
UP_CORRECT:
{
INC !ComboCounter
CASE_UP:
@@ -134,11 +115,12 @@ LOST_WOOD_HOOK:
CLC
ADC #$10
STA $700
LDA.b #$01 : STA !RestoreCam
BRA all
} ; label UP_CORRECT
LEFT_CORRECT:
LEFT_CORRECT:
{
INC !ComboCounter
CASE_LEFT:
@@ -156,43 +138,9 @@ LOST_WOOD_HOOK:
INC $700
} ; label LEFT_CORRECT
all:
all:
{
LDA #$29 ; load the same area.
RTL
}
; TODO: Restore camera values on invalid combinations.
RestoreCameraNorth:
{
LDA $700
SEC
SBC #$10
STA $700
RTS
}
RestoreCameraSouth:
{
LDA $700
CLC
ADC #$10
STA $700
RTS
}
RestoreCameraWest:
{
DEC $700
DEC $700
RTS
}
RestoreCameraEast:
{
INC $700
INC $700
RTS
}
} ; label LOST_WOOD_HOOK
} ; label LOST_WOOD_HOOK