aboutsummaryrefslogtreecommitdiffstats
path: root/engine/items/town_map.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 /engine/items/town_map.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 'engine/items/town_map.asm')
-rw-r--r--engine/items/town_map.asm41
1 files changed, 22 insertions, 19 deletions
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index 1ed146f2..a49e751e 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -1,5 +1,7 @@
DEF NOT_VISITED EQU $fe
+DEF BIRD_BASE_TILE EQU $04
+
DisplayTownMap:
call LoadTownMap
ld hl, wUpdateSpritesEnabled
@@ -12,15 +14,15 @@ DisplayTownMap:
ld a, [wCurMap]
push af
ld b, $0
- call DrawPlayerOrBirdSprite ; player sprite
+ call DrawPlayerOrBirdSprite
hlcoord 1, 0
- ld de, wcd6d
+ ld de, wNameBuffer
call PlaceString
ld hl, wShadowOAM
ld de, wTileMapBackup
ld bc, $10
call CopyData
- ld hl, vSprites tile $04
+ ld hl, vSprites tile BIRD_BASE_TILE
ld de, TownMapCursor
lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8
call CopyVideoDataDouble
@@ -50,15 +52,15 @@ DisplayTownMap:
ld hl, wShadowOAMSprite04
call WriteTownMapSpriteOAM ; town map cursor sprite
pop hl
- ld de, wcd6d
+ ld de, wNameBuffer
.copyMapName
ld a, [hli]
ld [de], a
inc de
- cp $50
+ cp "@"
jr nz, .copyMapName
hlcoord 1, 0
- ld de, wcd6d
+ ld de, wNameBuffer
call PlaceString
ld hl, wShadowOAMSprite04
ld de, wTileMapBackup + 16
@@ -73,9 +75,9 @@ DisplayTownMap:
jr z, .inputLoop
ld a, SFX_TINK
call PlaySound
- bit 6, b
+ bit BIT_D_UP, b
jr nz, .pressedUp
- bit 7, b
+ bit BIT_D_DOWN, b
jr nz, .pressedDown
xor a
ld [wTownMapSpriteBlinkingEnabled], a
@@ -153,7 +155,7 @@ LoadTownMap_Fly::
ld de, BirdSprite
ld b, BANK(BirdSprite)
ld c, 12
- ld hl, vSprites tile $04
+ ld hl, vSprites tile BIRD_BASE_TILE
call CopyVideoData
ld de, TownMapUpArrow
ld hl, vChars1 tile $6d
@@ -183,10 +185,10 @@ LoadTownMap_Fly::
call ClearScreenArea
pop hl
ld a, [hl]
- ld b, $4
- call DrawPlayerOrBirdSprite ; draw bird sprite
+ ld b, BIRD_BASE_TILE
+ call DrawPlayerOrBirdSprite
hlcoord 3, 0
- ld de, wcd6d
+ ld de, wNameBuffer
call PlaceString
ld c, 15
call DelayFrames
@@ -204,13 +206,13 @@ LoadTownMap_Fly::
pop hl
and A_BUTTON | B_BUTTON | D_UP | D_DOWN
jr z, .inputLoop
- bit 0, b
+ bit BIT_A_BUTTON, b
jr nz, .pressedA
ld a, SFX_TINK
call PlaySound
- bit 6, b
+ bit BIT_D_UP, b
jr nz, .pressedUp
- bit 7, b
+ bit BIT_D_DOWN, b
jr nz, .pressedDown
jr .pressedB
.pressedA
@@ -218,10 +220,11 @@ LoadTownMap_Fly::
call PlaySound
ld a, [hl]
ld [wDestinationMap], a
- ld hl, wd732
- set 3, [hl]
+ ld hl, wStatusFlags6
+ set BIT_FLY_WARP, [hl]
+ assert wStatusFlags6 + 1 == wStatusFlags7
inc hl
- set 7, [hl]
+ set BIT_USED_FLY, [hl]
.pressedB
xor a
ld [wTownMapSpriteBlinkingEnabled], a
@@ -365,7 +368,7 @@ DrawPlayerOrBirdSprite:
call TownMapCoordsToOAMCoords
call WritePlayerOrBirdSpriteOAM
pop hl
- ld de, wcd6d
+ ld de, wNameBuffer
.loop
ld a, [hli]
ld [de], a