aboutsummaryrefslogtreecommitdiffstats
path: root/home/text_script.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
committerdannye <33dannye@gmail.com>2024-09-25 00:45:00 -0500
commita02a98ee7ada1a658e28698484058be2796dc0df (patch)
tree945986054565bd8b5212fc755415096050d1d3a8 /home/text_script.asm
parentUse long option flags for rgbgfx, same as tools/gfx (diff)
parentUse `const_skip` (diff)
downloadpokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz
pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home/text_script.asm')
-rw-r--r--home/text_script.asm25
1 files changed, 13 insertions, 12 deletions
diff --git a/home/text_script.asm b/home/text_script.asm
index a70e0f9c..af89a043 100644
--- a/home/text_script.asm
+++ b/home/text_script.asm
@@ -3,14 +3,15 @@ UnknownText_2812:: ; unreferenced
text_end
; this function is used to display sign messages, sprite dialog, etc.
-; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID
+; INPUT: [hSpriteIndex] = sprite ID or [hTextID] = text ID
DisplayTextID::
+ assert hSpriteIndex == hTextID ; these are at the same memory location
ldh a, [hLoadedROMBank]
push af
farcall DisplayTextIDInit ; initialization
ld hl, wTextPredefFlag
- bit 0, [hl]
- res 0, [hl]
+ bit BIT_TEXT_PREDEF, [hl]
+ res BIT_TEXT_PREDEF, [hl]
jr nz, .skipSwitchToMapBank
ld a, [wCurMap]
call SwitchToMapRomBank
@@ -22,7 +23,7 @@ DisplayTextID::
ld h, [hl]
ld l, a ; hl = map text pointer
ld d, $00
- ldh a, [hSpriteIndexOrTextID] ; text ID
+ ldh a, [hTextID]
ld [wSpriteIndex], a
dict TEXT_START_MENU, DisplayStartMenu
@@ -34,7 +35,7 @@ DisplayTextID::
ld a, [wNumSprites]
ld e, a
- ldh a, [hSpriteIndexOrTextID] ; sprite ID
+ ldh a, [hSpriteIndex] ; sprite ID
cp e
jr z, .spriteHandling
jr nc, .skipSpriteHandling
@@ -42,7 +43,7 @@ DisplayTextID::
; get the text ID of the sprite
push hl
ld hl, wMapSpriteData ; NPC text entries
- ldh a, [hSpriteIndexOrTextID]
+ ldh a, [hSpriteIndex]
dec a
add a
ld e, a
@@ -123,9 +124,9 @@ CloseTextDisplay::
jr nz, .restoreSpriteFacingDirectionLoop
call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns)
ld hl, wFontLoaded
- res 0, [hl]
- ld a, [wd732]
- bit 3, a ; used fly warp
+ res BIT_FONT_LOADED, [hl]
+ ld a, [wStatusFlags6]
+ bit BIT_FLY_WARP, a
call z, LoadPlayerSpriteGraphics
call LoadCurrentMapView
pop af
@@ -191,9 +192,9 @@ PokemonFaintedText::
DisplayPlayerBlackedOutText::
ld hl, PlayerBlackedOutText
call PrintText
- ld a, [wd732]
- res 5, a ; reset forced to use bike bit
- ld [wd732], a
+ ld a, [wStatusFlags6]
+ res BIT_ALWAYS_ON_BIKE, a
+ ld [wStatusFlags6], a
CheckEvent EVENT_IN_SAFARI_ZONE
jr z, .didnotblackoutinsafari
xor a