Update map hide/show data labels

Fixes #235
This commit is contained in:
Rangi 2020-07-05 14:38:08 -04:00
parent d6820cdcbf
commit d9db3d7495
3 changed files with 568 additions and 578 deletions

View file

@ -1,3 +1,6 @@
HIDE EQU $11
SHOW EQU $15
; this is a list of the sprites that can be enabled/disabled during the game
; sprites marked with an X are constants that are never used
; because those sprites are not (de)activated in a map's script

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,7 @@ MarkTownVisitedAndLoadMissableObjects::
LoadMissableObjects:
ld l, a
push hl
ld de, MapHS00 ; calculate difference between out pointer and the base pointer
ld de, MissableObjects ; calculate difference between out pointer and the base pointer
ld a, l
sub e
jr nc, .asm_f13c
@ -49,7 +49,7 @@ LoadMissableObjects:
pop hl
.writeMissableObjectsListLoop
ld a, [hli]
cp $ff
cp -1
jr z, .done ; end of list
cp b
jr nz, .done ; not for current map anymore
@ -63,7 +63,7 @@ LoadMissableObjects:
inc de
jr .writeMissableObjectsListLoop
.done
ld a, $ff
ld a, -1
ld [de], a ; write sentinel
ret
@ -72,17 +72,17 @@ InitializeMissableObjectsFlags:
ld bc, wMissableObjectFlagsEnd - wMissableObjectFlags
xor a
call FillMemory ; clear missable objects flags
ld hl, MapHS00
ld hl, MissableObjects
xor a
ld [wMissableObjectCounter], a
.missableObjectsLoop
ld a, [hli]
cp $ff ; end of list
cp -1 ; end of list
ret z
push hl
inc hl
ld a, [hl]
cp Hide
cp HIDE
jr nz, .skip
ld hl, wMissableObjectFlags
ld a, [wMissableObjectCounter]
@ -105,7 +105,7 @@ IsObjectHidden:
ld hl, wMissableObjectList
.loop
ld a, [hli]
cp $ff
cp -1
jr z, .notHidden ; not missable -> not hidden
cp b
ld a, [hli]