shithub: pokered

Download patch

ref: b0aa4cb14a602bc2acf15bc0f2591a94a30487a2
parent: a77999f7f151567a47dd69affe9a29378f298ff4
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sun Jul 5 12:35:06 EDT 2020

Port two HRAM labels from pokeyellow

--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -14,14 +14,14 @@
 	set 4, [hl]
 	ret
 
-; if a hidden object was found, stores $00 in [hFoundHiddenObject], else stores $ff
+; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff
 CheckForHiddenObject::
-	ld hl, hFoundHiddenObjectOrBookshelf
+	ld hl, hItemAlreadyFound
 	xor a
-	ld [hli], a ; [hFoundHiddenObjectOrBookshelf]
+	ld [hli], a ; [hItemAlreadyFound]
 	ld [hli], a ; [hSavedMapTextPtr]
 	ld [hli], a ; [hSavedMapTextPtr + 1]
-	ld [hl], a  ; [hFoundHiddenObject]
+	ld [hl], a  ; [hDidntFindAnyHiddenObject]
 	ld de, $0
 	ld hl, HiddenObjectMaps
 .hiddenMapLoop
@@ -81,7 +81,7 @@
 	ret
 .noMatch
 	ld a, $ff
-	ld [hFoundHiddenObject], a
+	ld [hDidntFindAnyHiddenObject], a
 	ret
 
 ; checks if the coordinates in front of the player's sprite match Y in b and X in c
--- a/home.asm
+++ b/home.asm
@@ -1752,7 +1752,7 @@
 	ld [MBC1RomBank], a
 	ld [hLoadedROMBank], a
 	call CheckForHiddenObject
-	ld a, [hFoundHiddenObject]
+	ld a, [hDidntFindAnyHiddenObject]
 	and a
 	jr nz, .hiddenObjectNotFound
 	ld a, [wHiddenObjectFunctionRomBank]
@@ -1772,7 +1772,7 @@
 .nothingFound
 	ld a, $ff
 .done
-	ld [hFoundHiddenObjectOrBookshelf], a
+	ld [hItemAlreadyFound], a
 	pop af
 	ld [MBC1RomBank], a
 	ld [hLoadedROMBank], a
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -88,7 +88,7 @@
 	call IsPlayerCharacterBeingControlledByGame
 	jr nz, .checkForOpponent
 	call CheckForHiddenObjectOrBookshelfOrCardKeyDoor
-	ld a, [hFoundHiddenObjectOrBookshelf]
+	ld a, [hItemAlreadyFound]
 	and a
 	jp z, OverworldLoop ; jump if a hidden object or bookshelf was found, but not if a card key door was found
 	call IsSpriteOrSignInFrontOfPlayer
--- a/hram.asm
+++ b/hram.asm
@@ -350,8 +350,8 @@
 hSpriteMapYCoord    EQU $FFED
 hSpriteMapXCoord    EQU $FFEE
 
-hFoundHiddenObjectOrBookshelf EQU $FFEB
-hFoundHiddenObject EQU $FFEE
+hItemAlreadyFound         EQU $FFEB
+hDidntFindAnyHiddenObject EQU $FFEE
 
 hSavedMapTextPtr EQU $FFEC