summaryrefslogtreecommitdiff
path: root/engine/overworld/missable_objects.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld/missable_objects.asm')
-rw-r--r--engine/overworld/missable_objects.asm19
1 files changed, 8 insertions, 11 deletions
diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm
index 8587c0f7..dd601451 100644
--- a/engine/overworld/missable_objects.asm
+++ b/engine/overworld/missable_objects.asm
@@ -17,33 +17,30 @@ MarkTownVisitedAndLoadMissableObjects:
ld h, [hl]
; fall through
-LoadMissableObjects:
+; LoadMissableObjects:
+; seems to not exist in yellow (predef replaced with something near TryPushingBoulder)
ld l, a
push hl
- ld de, MapHS00 ; calculate difference between out pointer and the base pointer
ld a, l
- sub e
- jr nc, .asm_f13c
- dec h
-.asm_f13c
+ sub MapHS00 & $ff ; calculate difference between out pointer and the base pointer
ld l, a
ld a, h
- sub d
+ sbc MapHS00 / $100
ld h, a
ld a, h
ld [H_DIVIDEND], a
ld a, l
- ld [H_DIVIDEND+1], a
+ ld [H_DIVIDEND + 1], a
xor a
- ld [H_DIVIDEND+2], a
- ld [H_DIVIDEND+3], a
+ ld [H_DIVIDEND + 2], a
+ ld [H_DIVIDEND + 3], a
ld a, $3
ld [H_DIVISOR], a
ld b, $2
call Divide ; divide difference by 3, resulting in the global offset (number of missable items before ours)
ld a, [wCurMap]
ld b, a
- ld a, [H_DIVIDEND+3]
+ ld a, [H_DIVIDEND + 3]
ld c, a ; store global offset in c
ld de, wMissableObjectList
pop hl