ref: 54c1893d579cdf6853c6a64953bae281a6075fe3
parent: a002d01860a2c5a745e5837c4ff9f5d3c9e110fe
parent: fc9af362ae65d24c66b39ea7759637cc9c1f9b0a
author: Daniel Harding <corrnondacqb@yahoo.com>
date: Sat Jul 18 08:29:05 EDT 2015
Merge pull request #104 from YamaArashi/master fix variable naming
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -163,7 +163,7 @@
PlayAnimation: ; 780f1 (1e:40f1)
xor a
- ld [$FF8B],a
+ ld [$FF8B],a ; it looks like nothing reads this
ld [W_SUBANIMTRANSFORM],a
ld a,[W_ANIMATIONID] ; get animation number
dec a
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1310,7 +1310,7 @@
; if a is 8, the slide is to the right, else it is to the left
; bug: when this is called, [H_AUTOBGTRANSFERENABLED] is non-zero, so there is screen tearing
SlideTrainerPicOffScreen: ; 3c8df (f:48df)
- ld [$FF8B], a
+ ld [hSlideAmount], a
ld c, a
.slideStepLoop ; each iteration, the trainer pic is slid one tile left/right
push bc
@@ -1318,10 +1318,10 @@
ld b, 7 ; number of rows
.rowLoop
push hl
- ld a, [$FF8B]
+ ld a, [hSlideAmount]
ld c, a
.columnLoop
- ld a, [$FF8B]
+ ld a, [hSlideAmount]
cp 8
jr z, .slideRight
.slideLeft ; slide player sprite off screen
@@ -1590,14 +1590,14 @@
ld a, [hl]
ld [H_MULTIPLICAND + 2], a
ld a, [de]
- ld [$ff8d], a
+ ld [hEnemySpeed], a
inc de
ld a, [de]
- ld [$ff8e], a
+ ld [hEnemySpeed + 1], a
call LoadScreenTilesFromBuffer1
ld de, H_MULTIPLICAND + 1
- ld hl, $ff8d
- ld c, $2
+ ld hl, hEnemySpeed
+ ld c, 2
call StringCmp
jr nc, .canEscape ; jump if player speed greater than enemy speed
xor a
@@ -1609,9 +1609,9 @@
ld [H_DIVIDEND], a
ld a, [H_PRODUCT + 3]
ld [H_DIVIDEND + 1], a
- ld a, [$ff8d]
+ ld a, [hEnemySpeed]
ld b, a
- ld a, [$ff8e]
+ ld a, [hEnemySpeed + 1]
; divide enemy speed by 4
srl b
rr a
@@ -6411,7 +6411,7 @@
predef ScaleSpriteByTwo
ld hl, wOAMBuffer
xor a
- ld [$FF8B], a ; initial tile number
+ ld [hOAMTile], a ; initial tile number
ld b, $7 ; 7 columns
ld e, $a0 ; X for the left-most column
.loop ; each loop iteration writes 3 OAM entries in a vertical column
@@ -6425,16 +6425,16 @@
add d ; increase Y by height of tile
ld d, a
inc hl
- ld a, [$FF8B]
+ ld a, [hOAMTile]
ld [hli], a ; OAM tile number
inc a ; increment tile number
- ld [$FF8B], a
+ ld [hOAMTile], a
inc hl
dec c
jr nz, .innerLoop
- ld a, [$FF8B]
+ ld a, [hOAMTile]
add $4 ; increase tile number by 4
- ld [$FF8B], a
+ ld [hOAMTile], a
ld a, $8 ; width of tile
add e ; increase X by width of tile
ld e, a
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -89,7 +89,7 @@
jr .willEncounter
.lastRepelStep
ld [wRepelRemainingSteps], a
- ld a, $d2
+ ld a, 210
ld [H_DOWNARROWBLINKCNT2], a
call EnableAutoTextBoxDrawing
call DisplayTextID
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -556,11 +556,11 @@
jp PrintText
.tryToStopSurfing
xor a
- ld [$ff8c],a
+ ld [hSpriteIndexOrTextID],a
ld d,16 ; talking range in pixels (normal range)
call IsSpriteInFrontOfPlayer2
res 7,[hl]
- ld a,[$ff8c]
+ ld a,[hSpriteIndexOrTextID]
and a ; is there a sprite in the way?
jr nz,.cannotStopSurfing
ld hl,TilePairCollisionsWater
--- a/engine/items/tm_prices.asm
+++ b/engine/items/tm_prices.asm
@@ -1,7 +1,6 @@
GetMachinePrice: ; 7bf86 (1e:7f86)
; Input: [wcf91] = Item Id of a TM
-; Output: Stores the 2-byte TM price in [H_DOWNARROWBLINKCNT1] and [H_DOWNARROWBLINKCNT2]
-; as a BCD
+; Output: Stores the TM price at hItemPrice
ld a, [wcf91] ; a contains TM item id
sub TM_01
ret c
@@ -17,10 +16,10 @@
swap a
.highNybbleIsPrice
and $f0
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hItemPrice + 1], a
xor a
- ld [H_DOWNARROWBLINKCNT1], a
- ld [$ff8d], a
+ ld [hItemPrice], a
+ ld [hItemPrice + 2], a
ret
INCLUDE "data/tm_prices.asm"
--- a/engine/menu/pokedex.asm
+++ b/engine/menu/pokedex.asm
@@ -512,25 +512,25 @@
inc de
inc de ; de = address of upper byte of weight
push de
-; put weight in big-endian order at $ff8b
- ld hl,$ff8b
- ld a,[hl] ; save existing value of [$ff8b]
+; put weight in big-endian order at hDexWeight
+ ld hl,hDexWeight
+ ld a,[hl] ; save existing value of [hDexWeight]
push af
ld a,[de] ; a = upper byte of weight
- ld [hli],a ; store upper byte of weight in [$ff8b]
- ld a,[hl] ; save existing value of [$ff8c]
+ ld [hli],a ; store upper byte of weight in [hDexWeight]
+ ld a,[hl] ; save existing value of [hDexWeight + 1]
push af
dec de
ld a,[de] ; a = lower byte of weight
- ld [hl],a ; store lower byte of weight in [$ff8c]
- ld de,$ff8b
+ ld [hl],a ; store lower byte of weight in [hDexWeight + 1]
+ ld de,hDexWeight
hlCoord 11, 8
ld bc,$0205 ; no leading zeroes, right-aligned, 2 bytes, 5 digits
call PrintNumber ; print weight
hlCoord 14, 8
- ld a,[$ff8c]
+ ld a,[hDexWeight + 1]
sub a,10
- ld a,[$ff8b]
+ ld a,[hDexWeight]
sbc a,0
jr nc,.next
ld [hl],"0" ; if the weight is less than 10, put a 0 before the decimal point
@@ -540,9 +540,9 @@
ld [hld],a ; make space for the decimal point by moving the last digit forward one tile
ld [hl],$f2 ; decimal point tile
pop af
- ld [$ff8c],a ; restore original value of [$ff8c]
+ ld [hDexWeight + 1],a ; restore original value of [hDexWeight + 1]
pop af
- ld [$ff8b],a ; restore original value of [$ff8b]
+ ld [hDexWeight],a ; restore original value of [hDexWeight]
pop hl
inc hl ; hl = address of pokedex description text
bcCoord 1, 11
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -58,13 +58,13 @@
GetPrizeMenuId: ; 5278e (14:678e)
; determine which one among the three
; prize-texts has been selected
-; using the text ID (stored in [$FF8C])
+; using the text ID (stored in [hSpriteIndexOrTextID])
; load the three prizes at wd13d-wd13f
; load the three prices at wd141-wd146
; display the three prizes' names
; (distinguishing between Pokemon names
; and Items (specifically TMs) names)
- ld a,[$FF8C]
+ ld a,[hSpriteIndexOrTextID]
sub a,$03 ; prize-texts' id are 3, 4 and 5
ld [wd12f],a ; prize-texts' id (relative, i.e. 0, 1 or 2)
add a
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -524,7 +524,7 @@
DrawTrainerInfo: ; 1349a (4:749a)
ld de,RedPicFront
ld bc,(BANK(RedPicFront) << 8) | $01
- predef Predef3B
+ predef DisplayPicCenteredOrUpperRight
call DisableLCD
hlCoord 0, 2
ld a," "
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -34,9 +34,9 @@
OakSpeech: ; 6115 (1:6115)
ld a,$FF
call PlaySound ; stop music
- ld a, BANK(Music_Routes2) ; bank of song
+ ld a, BANK(Music_Routes2)
ld c,a
- ld a, MUSIC_ROUTES2 ; song #
+ ld a, MUSIC_ROUTES2
call PlayMusic
call ClearScreen
call LoadTextBoxTilePatterns
@@ -54,50 +54,49 @@
xor a
ld [hTilesetType],a
ld a,[wd732]
- bit 1,a ; XXX when is bit 1 set?
- jp nz,Func_61bc ; easter egg: skip the intro
+ bit 1,a ; possibly a debug mode bit
+ jp nz,.skipChoosingNames
ld de,ProfOakPic
ld bc, (Bank(ProfOakPic) << 8) | $00
- call IntroPredef3B ; displays Oak pic?
+ call IntroDisplayPicCenteredOrUpperRight
call FadeInIntroPic
ld hl,OakSpeechText1
- call PrintText ; prints text box
+ call PrintText
call GBFadeOutToWhite
call ClearScreen
ld a,NIDORINO
- ld [wd0b5],a ; pic displayed is stored at this location
+ ld [wd0b5],a
ld [wcf91],a
- call GetMonHeader ; this is also related to the pic
- hlCoord 6, 4 ; position on tilemap the pic is displayed
- call LoadFlippedFrontSpriteByMonIndex ; displays pic?
+ call GetMonHeader
+ hlCoord 6, 4
+ call LoadFlippedFrontSpriteByMonIndex
call MovePicLeft
ld hl,OakSpeechText2
- call PrintText ; Prints text box
+ call PrintText
call GBFadeOutToWhite
call ClearScreen
ld de,RedPicFront
ld bc,(Bank(RedPicFront) << 8) | $00
- call IntroPredef3B ; displays player pic?
+ call IntroDisplayPicCenteredOrUpperRight
call MovePicLeft
ld hl,IntroducePlayerText
call PrintText
- call LoadDefaultNamesPlayer ; brings up NewName/Red/etc menu
+ call ChoosePlayerName
call GBFadeOutToWhite
call ClearScreen
ld de,Rival1Pic
ld bc,(Bank(Rival1Pic) << 8) | $00
- call IntroPredef3B ; displays rival pic
+ call IntroDisplayPicCenteredOrUpperRight
call FadeInIntroPic
ld hl,IntroduceRivalText
call PrintText
- call LoadDefaultNamesRival
-
-Func_61bc: ; 61bc (1:61bc)
+ call ChooseRivalName
+.skipChoosingNames
call GBFadeOutToWhite
call ClearScreen
ld de,RedPicFront
ld bc,(Bank(RedPicFront) << 8) | $00
- call IntroPredef3B
+ call IntroDisplayPicCenteredOrUpperRight
call GBFadeInFromWhite
ld a,[wd72d]
and a
@@ -120,12 +119,12 @@
call CopyVideoData
ld de,ShrinkPic1
ld bc,(BANK(ShrinkPic1) << 8) | $00
- call IntroPredef3B
+ call IntroDisplayPicCenteredOrUpperRight
ld c,4
call DelayFrames
ld de,ShrinkPic2
ld bc,(BANK(ShrinkPic2) << 8) | $00
- call IntroPredef3B
+ call IntroDisplayPicCenteredOrUpperRight
call ResetPlayerSpriteData
ld a,[H_LOADEDROMBANK]
push af
@@ -207,10 +206,12 @@
ld [rWX],a
jr .next
-Predef3B: ; 62a1 (1:62a1)
+DisplayPicCenteredOrUpperRight: ; 62a1 (1:62a1)
call GetPredefRegisters
-IntroPredef3B: ; 62a4 (1:62a4)
-; bank of sprite given in b
+IntroDisplayPicCenteredOrUpperRight: ; 62a4 (1:62a4)
+; b = bank
+; de = address of compressed pic
+; c: 0 = centred, non-zero = upper-right
push bc
ld a,b
call UncompressSpriteFromDE
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -1,29 +1,29 @@
-LoadDefaultNamesPlayer: ; 695d (1:695d)
- call Func_6a12
+ChoosePlayerName: ; 695d (1:695d)
+ call OakSpeechSlidePicRight
ld de, DefaultNamesPlayer
call DisplayIntroNameTextBox
ld a, [wCurrentMenuItem]
and a
- jr z, .asm_697a
+ jr z, .customName
ld hl, DefaultNamesPlayerList
- call Func_6ad6
+ call GetDefaultName
ld de, wPlayerName
- call Func_69ec
- jr .asm_6999
-.asm_697a
+ call OakSpeechSlidePicLeft
+ jr .done
+.customName
ld hl, wPlayerName
xor a ; NAME_PLAYER_SCREEN
ld [wNamingScreenType], a
call DisplayNamingScreen
ld a, [wcf4b]
- cp $50
- jr z, .asm_697a
+ cp "@"
+ jr z, .customName
call ClearScreen
call Delay3
ld de, RedPicFront
ld b, BANK(RedPicFront)
- call IntroPredef3B
-.asm_6999
+ call IntroDisplayPicCenteredOrUpperRight
+.done
ld hl, YourNameIsText
jp PrintText
@@ -31,32 +31,32 @@
TX_FAR _YourNameIsText
db "@"
-LoadDefaultNamesRival: ; 69a4 (1:69a4)
- call Func_6a12
+ChooseRivalName: ; 69a4 (1:69a4)
+ call OakSpeechSlidePicRight
ld de, DefaultNamesRival
call DisplayIntroNameTextBox
ld a, [wCurrentMenuItem]
and a
- jr z, .asm_69c1
+ jr z, .customName
ld hl, DefaultNamesRivalList
- call Func_6ad6
+ call GetDefaultName
ld de, W_RIVALNAME
- call Func_69ec
- jr .asm_69e1
-.asm_69c1
+ call OakSpeechSlidePicLeft
+ jr .done
+.customName
ld hl, W_RIVALNAME
ld a, NAME_RIVAL_SCREEN
ld [wNamingScreenType], a
call DisplayNamingScreen
ld a, [wcf4b]
- cp $50
- jr z, .asm_69c1
+ cp "@"
+ jr z, .customName
call ClearScreen
call Delay3
ld de, Rival1Pic
ld b, $13
- call IntroPredef3B
-.asm_69e1
+ call IntroDisplayPicCenteredOrUpperRight
+.done
ld hl, HisNameIsText
jp PrintText
@@ -64,11 +64,11 @@
TX_FAR _HisNameIsText
db "@"
-Func_69ec: ; 69ec (1:69ec)
+OakSpeechSlidePicLeft: ; 69ec (1:69ec)
push de
hlCoord 0, 0
- ld bc, $c0b
- call ClearScreenArea
+ lb bc, 12, 11
+ call ClearScreenArea ; clear the name list text box
ld c, 10
call DelayFrames
pop de
@@ -77,77 +77,83 @@
call CopyData
call Delay3
hlCoord 12, 4
- ld de, $67d
+ lb de, 6, 6 * SCREEN_WIDTH + 5
ld a, $ff
- jr asm_6a19
+ jr OakSpeechSlidePicCommon
-Func_6a12: ; 6a12 (1:6a12)
+OakSpeechSlidePicRight: ; 6a12 (1:6a12)
hlCoord 5, 4
- ld de, $67d
+ lb de, 6, 6 * SCREEN_WIDTH + 5
xor a
-asm_6a19: ; 6a19 (1:6a19)
+
+OakSpeechSlidePicCommon: ; 6a19 (1:6a19)
push hl
push de
push bc
- ld [$ff8d], a
+ ld [hSlideDirection], a
ld a, d
- ld [H_DOWNARROWBLINKCNT1], a
+ ld [hSlideAmount], a
ld a, e
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSlidingRegionSize], a
ld c, a
- ld a, [$ff8d]
+ ld a, [hSlideDirection]
and a
- jr nz, .asm_6a2d
- ld d, $0
+ jr nz, .next
+; If sliding right, point hl to the end of the pic's tiles.
+ ld d, 0
add hl, de
-.asm_6a2d
+.next
ld d, h
ld e, l
-.asm_6a2f
+.loop
xor a
ld [H_AUTOBGTRANSFERENABLED], a
- ld a, [$ff8d]
+ ld a, [hSlideDirection]
and a
- jr nz, .asm_6a3c
+ jr nz, .slideLeft
+; sliding right
ld a, [hli]
ld [hld], a
dec hl
- jr .asm_6a3f
-.asm_6a3c
+ jr .next2
+.slideLeft
ld a, [hld]
ld [hli], a
inc hl
-.asm_6a3f
+.next2
dec c
- jr nz, .asm_6a2f
- ld a, [$ff8d]
+ jr nz, .loop
+ ld a, [hSlideDirection]
and a
- jr z, .asm_6a4a
+ jr z, .next3
+; If sliding left, we need to zero the last tile in the pic (there is no need
+; to take a corresponding action when sliding right because hl initially points
+; to a 0 tile in that case).
xor a
dec hl
ld [hl], a
-.asm_6a4a
- ld a, $1
+.next3
+ ld a, 1
ld [H_AUTOBGTRANSFERENABLED], a
call Delay3
- ld a, [H_DOWNARROWBLINKCNT2]
+ ld a, [hSlidingRegionSize]
ld c, a
ld h, d
ld l, e
- ld a, [$ff8d]
+ ld a, [hSlideDirection]
and a
- jr nz, .asm_6a5e
+ jr nz, .slideLeft2
inc hl
- jr .asm_6a5f
-.asm_6a5e
+ jr .next4
+.slideLeft2
dec hl
-.asm_6a5f
+.next4
ld d, h
ld e, l
- ld a, [H_DOWNARROWBLINKCNT1]
+ ld a, [hSlideAmount]
dec a
- ld [H_DOWNARROWBLINKCNT1], a
- jr nz, .asm_6a2f
+ ld [hSlideAmount], a
+ jr nz, .loop
pop bc
pop de
pop hl
@@ -229,22 +235,24 @@
db "@"
ENDC
-Func_6ad6: ; 6ad6 (1:6ad6)
+GetDefaultName: ; 6ad6 (1:6ad6)
+; a = name index
+; hl = name list
ld b, a
- ld c, $0
-.asm_6ad9
+ ld c, 0
+.loop
ld d, h
ld e, l
-.asm_6adb
+.innerLoop
ld a, [hli]
- cp $50
- jr nz, .asm_6adb
+ cp "@"
+ jr nz, .innerLoop
ld a, b
cp c
- jr z, .asm_6ae7
+ jr z, .foundName
inc c
- jr .asm_6ad9
-.asm_6ae7
+ jr .loop
+.foundName
ld h, d
ld l, e
ld de, wcd6d
--- a/engine/overworld/item.asm
+++ b/engine/overworld/item.asm
@@ -1,7 +1,7 @@
-PickupItem:
+PickUpItem:
call EnableAutoTextBoxDrawing
- ld a, [H_DOWNARROWBLINKCNT2]
+ ld a, [hSpriteIndexOrTextID]
ld b, a
ld hl, W_MISSABLEOBJECTLIST
.missableObjectsListLoop
@@ -18,7 +18,7 @@
ld [$ffdb], a
ld hl, W_MAPSPRITEEXTRADATA
- ld a, [H_DOWNARROWBLINKCNT2]
+ ld a, [hSpriteIndexOrTextID]
dec a
add a
ld d, 0
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -39,7 +39,7 @@
ld b,$10 ; number of sprite slots
ld hl,wSpriteStateData2 + $0d
xor a
- ld [$ff8e],a ; 4-tile sprite counter
+ ld [hFourTileSpriteCount],a
.copyPictureIDLoop ; loop to copy picture ID from $C2XD to $C2XE
ld a,[hli] ; $C2XD (sprite picture ID)
ld [hld],a ; $C2XE
@@ -98,7 +98,7 @@
cp a,SPRITE_BALL ; is it a 4-tile sprite?
jr c,.notFourTileSprite
pop af
- ld a,[$ff8e] ; 4-tile sprite counter
+ ld a,[hFourTileSpriteCount]
add a,11
jr .storeVRAMSlot
.notFourTileSprite
@@ -105,7 +105,7 @@
pop af
.storeVRAMSlot
ld [hl],a ; store VRAM slot at $C2XE
- ld [$ff8d],a ; used to determine if it's 4-tile sprite later
+ ld [hVRAMSlot],a ; used to determine if it's 4-tile sprite later
ld a,b ; a = current sprite picture ID
dec a
add a
@@ -128,7 +128,7 @@
push bc
ld hl,vNPCSprites ; VRAM base address
ld bc,$c0 ; number of bytes per VRAM slot
- ld a,[$ff8d]
+ ld a,[hVRAMSlot]
cp a,11 ; is it a 4-tile sprite?
jr nc,.fourTileSpriteVRAMAddr
ld d,a
@@ -142,13 +142,13 @@
jr .loadStillTilePattern
.fourTileSpriteVRAMAddr
ld hl,vSprites + $7c0 ; address for second 4-tile sprite
- ld a,[$ff8e] ; 4-tile sprite counter
- and a ; is it the first 4-tile sprite?
+ ld a,[hFourTileSpriteCount]
+ and a
jr nz,.loadStillTilePattern
; if it's the first 4-tile sprite
ld hl,vSprites + $780 ; address for first 4-tile sprite
inc a
- ld [$ff8e],a ; 4-tile sprite counter
+ ld [hFourTileSpriteCount],a
.loadStillTilePattern
pop bc
pop de
@@ -168,7 +168,7 @@
.skipFirstLoad
pop de
pop hl
- ld a,[$ff8d]
+ ld a,[hVRAMSlot]
cp a,11 ; is it a 4-tile sprite?
jr nc,.skipSecondLoad ; if so, there is no second block
push de
--- a/engine/predefs.asm
+++ b/engine/predefs.asm
@@ -111,7 +111,7 @@
add_predef InternalClockTradeAnim
add_predef TrainerEngage
add_predef IndexToPokedex
- add_predef Predef3B; 3B display pic?
+ add_predef DisplayPicCenteredOrUpperRight; 3B display pic?
add_predef UsedCut
add_predef ShowPokedexData
add_predef WriteMonMoves
@@ -144,7 +144,7 @@
add_predef GetTileTwoStepsInFrontOfPlayer
add_predef CheckForCollisionWhenPushingBoulder
add_predef PrintStrengthTxt
- add_predef PickupItem
+ add_predef PickUpItem
add_predef PrintMoveType
add_predef LoadMovePPs
add_predef DrawHP ; 5F
--- a/home.asm
+++ b/home.asm
@@ -969,10 +969,10 @@
TX_FAR _PokeCenterSignText
db "@"
-Predef5CText:: ; 24f4 (0:24f4)
+PickUpItemText:: ; 24f4 (0:24f4)
; XXX better label (what does predef $5C do?)
TX_ASM
- predef PickupItem
+ predef PickUpItem
jp TextScriptEnd
@@ -1050,7 +1050,7 @@
jp PlaySound
; this function is used to display sign messages, sprite dialog, etc.
-; INPUT: [$ff8c] = sprite ID or text ID
+; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID
DisplayTextID:: ; 2920 (0:2920)
ld a,[H_LOADEDROMBANK]
push af
@@ -1069,7 +1069,7 @@
ld h,[hl]
ld l,a ; hl = map text pointer
ld d,$00
- ld a,[$ff8c] ; text ID
+ ld a,[hSpriteIndexOrTextID] ; text ID
ld [wSpriteIndex],a
and a
jp z,DisplayStartMenu
@@ -1083,7 +1083,7 @@
jp z,DisplayRepelWoreOffText
ld a,[W_NUMSPRITES]
ld e,a
- ld a,[$ff8c] ; sprite ID
+ ld a,[hSpriteIndexOrTextID] ; sprite ID
cp e
jr z,.spriteHandling
jr nc,.skipSpriteHandling
@@ -1096,7 +1096,7 @@
pop bc
pop de
ld hl,W_MAPSPRITEDATA ; NPC text entries
- ld a,[$ff8c]
+ ld a,[hSpriteIndexOrTextID]
dec a
add a
add l
@@ -1235,10 +1235,12 @@
ret
DisplayPokemonCenterDialogue:: ; 2a72 (0:2a72)
+; zeroing these doesn't appear to serve any purpose
xor a
ld [$ff8b],a
ld [$ff8c],a
ld [$ff8d],a
+
inc hl
ld a,[H_LOADEDROMBANK]
push af
@@ -2487,8 +2489,8 @@
ld c, a
call TrainerFlagAction ; read trainer flag
ld a, c
- and a
- jr nz, .trainerAlreadyFought
+ and a ; has the trainer already been defeated?
+ jr nz, .continue
push hl
push de
push hl
@@ -2507,7 +2509,7 @@
ld a, [wTrainerSpriteOffset]
and a
ret nz ; break if the trainer is engaging
-.trainerAlreadyFought
+.continue
ld hl, $c
add hl, de
ld d, h
@@ -2737,7 +2739,7 @@
ld a, $9
ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData1
- ld a, [$ff8d]
+ ld a, [hSpriteFacingDirection]
ld [hl], a
ret
@@ -2858,18 +2860,18 @@
inc a ; include sentinel in counting
ret
-; sets movement byte 1 for sprite [$FF8C] to $FE and byte 2 to [$FF8D]
+; sets movement byte 1 for sprite [H_SPRITEINDEX] to $FE and byte 2 to [hSpriteMovementByte2]
SetSpriteMovementBytesToFE:: ; 3533 (0:3533)
push hl
call GetSpriteMovementByte1Pointer
ld [hl], $fe
call GetSpriteMovementByte2Pointer
- ld a, [$ff8d]
+ ld a, [hSpriteMovementByte2]
ld [hl], a
pop hl
ret
-; sets both movement bytes for sprite [$FF8C] to $FF
+; sets both movement bytes for sprite [H_SPRITEINDEX] to $FF
SetSpriteMovementBytesToFF:: ; 3541 (0:3541)
push hl
call GetSpriteMovementByte1Pointer
@@ -2879,20 +2881,20 @@
pop hl
ret
-; returns the sprite movement byte 1 pointer for sprite [$FF8C] in hl
+; returns the sprite movement byte 1 pointer for sprite [H_SPRITEINDEX] in hl
GetSpriteMovementByte1Pointer:: ; 354e (0:354e)
ld h,$C2
- ld a,[H_SPRITEINDEX] ; the sprite to move
+ ld a,[H_SPRITEINDEX]
swap a
add a,6
ld l,a
ret
-; returns the sprite movement byte 2 pointer for sprite [$FF8C] in hl
+; returns the sprite movement byte 2 pointer for sprite [H_SPRITEINDEX] in hl
GetSpriteMovementByte2Pointer:: ; 3558 (0:3558)
push de
ld hl,W_MAPSPRITEDATA
- ld a,[$FF8C] ; the sprite to move
+ ld a,[H_SPRITEINDEX]
dec a
add a
ld d,0
--- a/home/copy2.asm
+++ b/home/copy2.asm
@@ -1,10 +1,10 @@
FarCopyData2::
-; Identical to FarCopyData, but uses $ff8b
+; Identical to FarCopyData, but uses hROMBankTemp
; as temp space instead of wBuffer.
- ld [$ff8b],a
+ ld [hROMBankTemp],a
ld a,[H_LOADEDROMBANK]
push af
- ld a,[$ff8b]
+ ld a,[hROMBankTemp]
ld [H_LOADEDROMBANK],a
ld [MBC1RomBank],a
call CopyData
@@ -15,10 +15,10 @@
FarCopyData3::
; Copy bc bytes from a:de to hl.
- ld [$ff8b],a
+ ld [hROMBankTemp],a
ld a,[H_LOADEDROMBANK]
push af
- ld a,[$ff8b]
+ ld a,[hROMBankTemp]
ld [H_LOADEDROMBANK],a
ld [MBC1RomBank],a
push hl
@@ -38,10 +38,10 @@
FarCopyDataDouble::
; Expand bc bytes of 1bpp image data
; from a:hl to 2bpp data at de.
- ld [$ff8b],a
+ ld [hROMBankTemp],a
ld a,[H_LOADEDROMBANK]
push af
- ld a,[$ff8b]
+ ld a,[hROMBankTemp]
ld [H_LOADEDROMBANK],a
ld [MBC1RomBank],a
.loop
@@ -70,7 +70,7 @@
ld [H_AUTOBGTRANSFERENABLED], a
ld a, [H_LOADEDROMBANK]
- ld [$ff8b], a
+ ld [hROMBankTemp], a
ld a, b
ld [H_LOADEDROMBANK], a
@@ -94,7 +94,7 @@
.done
ld [H_VBCOPYSIZE], a
call DelayFrame
- ld a, [$ff8b]
+ ld a, [hROMBankTemp]
ld [H_LOADEDROMBANK], a
ld [MBC1RomBank], a
pop af
@@ -119,7 +119,7 @@
xor a ; disable auto-transfer while copying
ld [H_AUTOBGTRANSFERENABLED], a
ld a, [H_LOADEDROMBANK]
- ld [$ff8b], a
+ ld [hROMBankTemp], a
ld a, b
ld [H_LOADEDROMBANK], a
@@ -143,7 +143,7 @@
.done
ld [H_VBCOPYDOUBLESIZE], a
call DelayFrame
- ld a, [$ff8b]
+ ld a, [hROMBankTemp]
ld [H_LOADEDROMBANK], a
ld [MBC1RomBank], a
pop af
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -444,7 +444,7 @@
ld a,[hli]
ld [wDestinationWarpID],a
ld a,[hl]
- ld [$ff8b],a ; save target map
+ ld [hWarpDestinationMap],a
jr WarpFound2
.retry1
inc hl
@@ -466,7 +466,7 @@
ld a,[hli]
ld [wDestinationWarpID],a
ld a,[hli]
- ld [$ff8b],a ; save target map
+ ld [hWarpDestinationMap],a
WarpFound2:: ; 073c (0:073c)
ld a,[wNumberOfWarps]
@@ -481,8 +481,8 @@
ld [wLastMap],a
ld a,[W_CURMAPWIDTH]
ld [wd366],a
- ld a,[$ff8b] ; destination map number
- ld [W_CURMAP],a ; change current map to destination map
+ ld a,[hWarpDestinationMap]
+ ld [W_CURMAP],a
cp a,ROCK_TUNNEL_1
jr nz,.notRockTunnel
ld a,$06
@@ -493,11 +493,11 @@
jr .done
; for maps that can have the 0xFF destination map, which means to return to the outside map; not all these maps are necessarily indoors, though
.indoorMaps
- ld a,[$ff8b] ; destination map
+ ld a,[hWarpDestinationMap] ; destination map
cp a,$ff
jr z,.goBackOutside
; if not going back to the previous map
- ld [W_CURMAP],a ; current map number
+ ld [W_CURMAP],a
callba IsPlayerStandingOnWarpPadOrHole
ld a,[wcd5b]
dec a ; is the player on a warp pad?
@@ -539,22 +539,22 @@
jr nz,.checkEastMap
ld a,[W_MAPCONN3PTR]
ld [W_CURMAP],a
- ld a,[wd38f] ; new X coordinate upon entering west map
+ ld a,[wWestConnectedMapXAlignment] ; new X coordinate upon entering west map
ld [W_XCOORD],a
ld a,[W_YCOORD]
ld c,a
- ld a,[wd38e] ; Y adjustment upon entering west map
+ ld a,[wWestConnectedMapYAlignment] ; Y adjustment upon entering west map
add c
ld c,a
ld [W_YCOORD],a
- ld a,[wd390] ; pointer to upper left corner of map without adjustment for Y position
+ ld a,[wWestConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position
ld l,a
- ld a,[wd391]
+ ld a,[wWestConnectedMapViewPointer + 1]
ld h,a
srl c
jr z,.savePointer1
.pointerAdjustmentLoop1
- ld a,[wd38d] ; width of connected map
+ ld a,[wWestConnectedMapWidth] ; width of connected map
add a,$06
ld e,a
ld d,$00
@@ -575,22 +575,22 @@
jr nz,.checkNorthMap
ld a,[W_MAPCONN4PTR]
ld [W_CURMAP],a
- ld a,[wd39a] ; new X coordinate upon entering east map
+ ld a,[wEastConnectedMapXAlignment] ; new X coordinate upon entering east map
ld [W_XCOORD],a
ld a,[W_YCOORD]
ld c,a
- ld a,[wd399] ; Y adjustment upon entering east map
+ ld a,[wEastConnectedMapYAlignment] ; Y adjustment upon entering east map
add c
ld c,a
ld [W_YCOORD],a
- ld a,[wd39b] ; pointer to upper left corner of map without adjustment for Y position
+ ld a,[wEastConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position
ld l,a
- ld a,[wd39c]
+ ld a,[wEastConnectedMapViewPointer + 1]
ld h,a
srl c
jr z,.savePointer2
.pointerAdjustmentLoop2
- ld a,[wd398]
+ ld a,[wEastConnectedMapWidth]
add a,$06
ld e,a
ld d,$00
@@ -610,19 +610,19 @@
jr nz,.checkSouthMap
ld a,[W_MAPCONN1PTR]
ld [W_CURMAP],a
- ld a,[wd378] ; new Y coordinate upon entering north map
+ ld a,[wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map
ld [W_YCOORD],a
ld a,[W_XCOORD]
ld c,a
- ld a,[wd379] ; X adjustment upon entering north map
+ ld a,[wNorthConnectedMapXAlignment] ; X adjustment upon entering north map
add c
ld c,a
ld [W_XCOORD],a
- ld a,[wd37a] ; pointer to upper left corner of map without adjustment for X position
+ ld a,[wNorthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position
ld l,a
- ld a,[wd37b]
+ ld a,[wNorthConnectedMapViewPointer + 1]
ld h,a
- ld b,$00
+ ld b,0
srl c
add hl,bc
ld a,l
@@ -637,19 +637,19 @@
jr nz,.didNotEnterConnectedMap
ld a,[W_MAPCONN2PTR]
ld [W_CURMAP],a
- ld a,[wd383] ; new Y coordinate upon entering south map
+ ld a,[wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map
ld [W_YCOORD],a
ld a,[W_XCOORD]
ld c,a
- ld a,[wd384] ; X adjustment upon entering south map
+ ld a,[wSouthConnectedMapXAlignment] ; X adjustment upon entering south map
add c
ld c,a
ld [W_XCOORD],a
- ld a,[wd385] ; pointer to upper left corner of map without adjustment for X position
+ ld a,[wSouthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position
ld l,a
- ld a,[wd386]
+ ld a,[wSouthConnectedMapViewPointer + 1]
ld h,a
- ld b,$00
+ ld b,0
srl c
add hl,bc
ld a,l
@@ -884,9 +884,9 @@
; a 3-byte border at the edges of the map is kept so that there is space for map connections
ld hl,wOverworldMap
ld a,[W_CURMAPWIDTH]
- ld [$ff8c],a
+ ld [hMapWidth],a
add a,$06 ; border (east and west)
- ld [$ff8b],a ; map width + border
+ ld [hMapStride],a ; map width + border
ld b,$00
ld c,a
; make space for north border (next 3 lines)
@@ -903,7 +903,7 @@
ld b,a
.rowLoop ; copy one row each iteration
push hl
- ld a,[$ff8c] ; map width (without border)
+ ld a,[hMapWidth] ; map width (without border)
ld c,a
.rowInnerLoop
ld a,[de]
@@ -913,7 +913,7 @@
jr nz,.rowInnerLoop
; add the map width plus the border to the base address of the current row to get the next row's address
pop hl
- ld a,[$ff8b] ; map width + border
+ ld a,[hMapStride] ; map width + border
add l
ld l,a
jr nc,.noCarry
@@ -926,18 +926,18 @@
cp a,$ff
jr z,.southConnection
call SwitchToMapRomBank
- ld a,[wd372]
+ ld a,[wNorthConnectionStripSrc]
ld l,a
- ld a,[wd373]
+ ld a,[wNorthConnectionStripSrc + 1]
ld h,a
- ld a,[wd374]
+ ld a,[wNorthConnectionStripDest]
ld e,a
- ld a,[wd375]
+ ld a,[wNorthConnectionStripDest + 1]
ld d,a
- ld a,[wd376]
- ld [$ff8b],a
- ld a,[wd377]
- ld [$ff8c],a
+ ld a,[wNorthConnectionStripWidth]
+ ld [hNorthSouthConnectionStripWidth],a
+ ld a,[wNorthConnectedMapWidth]
+ ld [hNorthSouthConnectedMapWidth],a
call LoadNorthSouthConnectionsTileMap
.southConnection
ld a,[W_MAPCONN2PTR]
@@ -944,18 +944,18 @@
cp a,$ff
jr z,.westConnection
call SwitchToMapRomBank
- ld a,[wd37d]
+ ld a,[wSouthConnectionStripSrc]
ld l,a
- ld a,[wd37e]
+ ld a,[wSouthConnectionStripSrc + 1]
ld h,a
- ld a,[wd37f]
+ ld a,[wSouthConnectionStripDest]
ld e,a
- ld a,[wd380]
+ ld a,[wSouthConnectionStripDest + 1]
ld d,a
- ld a,[wd381]
- ld [$ff8b],a
- ld a,[wd382]
- ld [$ff8c],a
+ ld a,[wSouthConnectionStripWidth]
+ ld [hNorthSouthConnectionStripWidth],a
+ ld a,[wSouthConnectedMapWidth]
+ ld [hNorthSouthConnectedMapWidth],a
call LoadNorthSouthConnectionsTileMap
.westConnection
ld a,[W_MAPCONN3PTR]
@@ -962,18 +962,18 @@
cp a,$ff
jr z,.eastConnection
call SwitchToMapRomBank
- ld a,[wd388]
+ ld a,[wWestConnectionStripSrc]
ld l,a
- ld a,[wd389]
+ ld a,[wWestConnectionStripSrc + 1]
ld h,a
- ld a,[wd38a]
+ ld a,[wWestConnectionStripDest]
ld e,a
- ld a,[wd38b]
+ ld a,[wWestConnectionStripDest + 1]
ld d,a
- ld a,[wd38c]
+ ld a,[wWestConnectionStripHeight]
ld b,a
- ld a,[wd38d]
- ld [$ff8b],a
+ ld a,[wWestConnectedMapWidth]
+ ld [hEastWestConnectedMapWidth],a
call LoadEastWestConnectionsTileMap
.eastConnection
ld a,[W_MAPCONN4PTR]
@@ -980,18 +980,18 @@
cp a,$ff
jr z,.done
call SwitchToMapRomBank
- ld a,[wd393]
+ ld a,[wEastConnectionStripSrc]
ld l,a
- ld a,[wd394]
+ ld a,[wEastConnectionStripSrc + 1]
ld h,a
- ld a,[wd395]
+ ld a,[wEastConnectionStripDest]
ld e,a
- ld a,[wd396]
+ ld a,[wEastConnectionStripDest + 1]
ld d,a
- ld a,[wd397]
+ ld a,[wEastConnectionStripHeight]
ld b,a
- ld a,[wd398]
- ld [$ff8b],a
+ ld a,[wEastConnectedMapWidth]
+ ld [hEastWestConnectedMapWidth],a
call LoadEastWestConnectionsTileMap
.done
ret
@@ -1001,7 +1001,7 @@
.loop
push de
push hl
- ld a,[$ff8b] ; width of connection
+ ld a,[hNorthSouthConnectionStripWidth]
ld b,a
.innerLoop
ld a,[hli]
@@ -1011,7 +1011,7 @@
jr nz,.innerLoop
pop hl
pop de
- ld a,[$ff8c] ; width of connected map
+ ld a,[hNorthSouthConnectedMapWidth]
add l
ld l,a
jr nc,.noCarry1
@@ -1040,7 +1040,7 @@
jr nz,.innerLoop
pop de
pop hl
- ld a,[$ff8b] ; width of connected map
+ ld a,[hEastWestConnectedMapWidth]
add l
ld l,a
jr nc,.noCarry1
@@ -2022,7 +2022,7 @@
ld b,a
res 7,a
ld [W_CURMAPTILESET],a
- ld [$ff8b],a
+ ld [hPreviousTileset],a
bit 7,b
ret nz
ld hl,MapHeaderPointers
@@ -2191,24 +2191,24 @@
ld a,[hli]
ld [de],a ; store movement byte 1 at C2X6
ld a,[hli]
- ld [$ff8d],a ; save movement byte 2
+ ld [hLoadSpriteTemp1],a ; save movement byte 2
ld a,[hli]
- ld [$ff8e],a ; save text ID and flags byte
+ ld [hLoadSpriteTemp2],a ; save text ID and flags byte
push bc
push hl
ld b,$00
ld hl,W_MAPSPRITEDATA
add hl,bc
- ld a,[$ff8d]
+ ld a,[hLoadSpriteTemp1]
ld [hli],a ; store movement byte 2 in byte 0 of sprite entry
- ld a,[$ff8e]
+ ld a,[hLoadSpriteTemp2]
ld [hl],a ; this appears pointless, since the value is overwritten immediately after
- ld a,[$ff8e]
- ld [$ff8d],a
+ ld a,[hLoadSpriteTemp2]
+ ld [hLoadSpriteTemp1],a
and a,$3f
ld [hl],a ; store text ID in byte 1 of sprite entry
pop hl
- ld a,[$ff8d]
+ ld a,[hLoadSpriteTemp1]
bit 6,a
jr nz,.trainerSprite
bit 7,a
@@ -2216,25 +2216,25 @@
jr .regularSprite
.trainerSprite
ld a,[hli]
- ld [$ff8d],a ; save trainer class
+ ld [hLoadSpriteTemp1],a ; save trainer class
ld a,[hli]
- ld [$ff8e],a ; save trainer number (within class)
+ ld [hLoadSpriteTemp2],a ; save trainer number (within class)
push hl
ld hl,W_MAPSPRITEEXTRADATA
add hl,bc
- ld a,[$ff8d]
+ ld a,[hLoadSpriteTemp1]
ld [hli],a ; store trainer class in byte 0 of the entry
- ld a,[$ff8e]
+ ld a,[hLoadSpriteTemp2]
ld [hl],a ; store trainer number in byte 1 of the entry
pop hl
jr .nextSprite
.itemBallSprite
ld a,[hli]
- ld [$ff8d],a ; save item number
+ ld [hLoadSpriteTemp1],a ; save item number
push hl
ld hl,W_MAPSPRITEEXTRADATA
add hl,bc
- ld a,[$ff8d]
+ ld a,[hLoadSpriteTemp1]
ld [hli],a ; store item number in byte 0 of the entry
xor a
ld [hl],a ; zero byte 1, since it is not used
--- a/hram.asm
+++ b/hram.asm
@@ -1,9 +1,3 @@
-
-H_SPRITEWIDTH EQU $FF8B ; in tiles
-H_SPRITEINTERLACECOUNTER EQU $FF8B
-H_SPRITEHEIGHT EQU $FF8C ; in tiles
-H_SPRITEOFFSET EQU $FF8D
-
hSoftReset EQU $FF8A
; Initialized to 16.
; Decremented each input iteration if the player
@@ -12,8 +6,28 @@
hBaseTileID EQU $FF8B
+; 3-byte BCD number
hItemPrice EQU $FF8B
+hDexWeight EQU $FF8B
+
+hWarpDestinationMap EQU $FF8B
+
+hOAMTile EQU $FF8B
+
+hROMBankTemp EQU $FF8B
+
+hPreviousTileset EQU $FF8B
+
+hEastWestConnectedMapWidth EQU $FF8B
+
+hSlideAmount EQU $FF8B
+
+H_SPRITEWIDTH EQU $FF8B ; in tiles
+H_SPRITEINTERLACECOUNTER EQU $FF8B
+H_SPRITEHEIGHT EQU $FF8C ; in tiles
+H_SPRITEOFFSET EQU $FF8D
+
; counters for blinking down arrow
H_DOWNARROWBLINKCNT1 EQU $FF8B
H_DOWNARROWBLINKCNT2 EQU $FF8C
@@ -21,10 +35,39 @@
H_SPRITEDATAOFFSET EQU $FF8B
H_SPRITEINDEX EQU $FF8C
+hMapStride EQU $FF8B
+hMapWidth EQU $FF8C
+
+hNorthSouthConnectionStripWidth EQU $FF8B
+hNorthSouthConnectedMapWidth EQU $FF8C
+
; DisplayTextID's argument
hSpriteIndexOrTextID EQU $FF8C
hPartyMonIndex EQU $FF8C
+
+; the total number of tiles being shifted each time the pic slides by one tile
+hSlidingRegionSize EQU $FF8C
+
+; 2 bytes
+hEnemySpeed EQU $FF8D
+
+hVRAMSlot EQU $FF8D
+
+hFourTileSpriteCount EQU $FF8E
+
+; -1 = left
+; 0 = right
+hSlideDirection EQU $FF8D
+
+hSpriteFacingDirection EQU $FF8D
+
+hSpriteMovementByte2 EQU $FF8D
+
+hSpriteImageIndex EQU $FF8D
+
+hLoadSpriteTemp1 EQU $FF8D
+hLoadSpriteTemp2 EQU $FF8E
hHalveItemPrices EQU $FF8E
--- a/macros.asm
+++ b/macros.asm
@@ -13,7 +13,11 @@
percent EQUS "* $ff / 100"
+lb: MACRO ; r, hi, lo
+ ld \1, (\2) << 8 + (\3)
+ ENDM
+
; Constant enumeration is useful for monsters, items, moves, etc.
const_def: MACRO
const_value = 0
@@ -530,7 +534,7 @@
SOUTH_MAP_CONNECTION: MACRO
db \1 ; map id
dw \6 + \4 ; "Conection Strip" location
- dw wOverworldMap + 3 + (\8 + 3) * (\7 + 6) + \3 ; current map positoin
+ dw wOverworldMap + 3 + (\8 + 3) * (\7 + 6) + \3 ; current map position
db \5 ; width of connection strip
db \2 ; map width
db 0 ; y alignment (y coordinate of player when entering map)
--- a/main.asm
+++ b/main.asm
@@ -996,7 +996,7 @@
ld a,[wAutoTextBoxDrawingControl]
bit 0,a
jr nz,.skipDrawingTextBoxBorder
- ld a,[$ff8c] ; text ID (or sprite ID)
+ ld a,[hSpriteIndexOrTextID] ; text ID (or sprite ID)
and a
jr nz,.notStartMenu
; if text ID is 0 (i.e. the start menu)
@@ -2094,7 +2094,7 @@
ld a, [hli] ; target warp
ld [wDestinationWarpID], a
ld a, [hl] ; target map
- ld [$ff8b], a
+ ld [hWarpDestinationMap], a
ld hl, wd736
set 2, [hl] ; standing on warp flag
ret
@@ -2593,7 +2593,7 @@
ld [wJoyIgnore], a
call EnableAutoTextBoxDrawing
ld a, $d0
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
pop de
pop hl
@@ -2640,7 +2640,7 @@
jr nz, .noBlackOut
call EnableAutoTextBoxDrawing
ld a, $d1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd72e
set 5, [hl]
@@ -2692,7 +2692,7 @@
jr c, .asm_c797
ld a, [W_CURMAPTILESET]
ld b, a
- ld a, [$ff8b]
+ ld a, [hPreviousTileset]
cp b
jr z, .done
.asm_c797
@@ -3454,15 +3454,15 @@
bit 1, a ; has boulder dust animation from previous push played yet?
ret nz
xor a
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call IsSpriteInFrontOfPlayer
- ld a, [$ff8c]
+ ld a, [hSpriteIndexOrTextID]
ld [wBoulderSpriteIndex], a
and a
jp z, ResetBoulderPushFlags
ld hl, wSpriteStateData1 + 1
ld d, $0
- ld a, [$ff8c]
+ ld a, [hSpriteIndexOrTextID]
swap a
ld e, a
add hl, de
--- a/scripts/agatha.asm
+++ b/scripts/agatha.asm
@@ -76,7 +76,7 @@
jr z, AgathaScript_76474
.asm_764b4
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, D_UP
ld [wSimulatedJoypadStatesEnd], a
@@ -112,7 +112,7 @@
cp $ff
jp z, AgathaScript_76464
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [W_GARYCURSCRIPT], a
--- a/scripts/billshouse.asm
+++ b/scripts/billshouse.asm
@@ -23,7 +23,7 @@
ld de, MovementData_1e7a0
.notDown
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $2
ld [W_BILLSHOUSECURSCRIPT], a
@@ -82,7 +82,7 @@
ld c, 8
call DelayFrames
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld de, MovementData_1e807
call MoveSprite
ld a, $4
@@ -113,7 +113,7 @@
BillsHouseScript5: ; 1e827 (7:6827)
ld a, $4
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $0
ld [W_BILLSHOUSECURSCRIPT], a
--- a/scripts/bruno.asm
+++ b/scripts/bruno.asm
@@ -76,7 +76,7 @@
jr z, BrunoScript_7631d
.asm_7635d
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, D_UP
ld [wSimulatedJoypadStatesEnd], a
@@ -112,7 +112,7 @@
cp $ff
jp z, BrunoScript_7630d
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
BrunoTextPointers: ; 763a8 (1d:63a8)
--- a/scripts/celadongamecorner.asm
+++ b/scripts/celadongamecorner.asm
@@ -58,10 +58,10 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $d
- ld [H_SPRITEHEIGHT], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $b
- ld [H_SPRITEHEIGHT], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld de, MovementData_48c5a
ld a, [W_YCOORD]
@@ -76,7 +76,7 @@
ld de, MovementData_48c63
.asm_48c4d
ld a, $b
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $2
ld [W_CELADONGAMECORNERCURSCRIPT], a
--- a/scripts/celadongym.asm
+++ b/scripts/celadongym.asm
@@ -44,7 +44,7 @@
CeladonGymText_48963: ; 48963 (12:4963)
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd77c
set 1, [hl]
@@ -52,7 +52,7 @@
call GiveItem
jr nc, .BagFull
ld a, $a
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd77c
set 0, [hl]
@@ -59,7 +59,7 @@
jr .asm_4898c
.BagFull
ld a, $b
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_4898c
ld hl, W_OBTAINEDBADGES
--- a/scripts/ceruleancity.asm
+++ b/scripts/ceruleancity.asm
@@ -28,7 +28,7 @@
ld hl, wd75b
set 7, [hl]
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wJoyIgnore], a
@@ -55,7 +55,7 @@
ld [wSpriteStateData1 + $29], a
call Delay3
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
.asm_194f7
ld a, [wd75a]
@@ -82,9 +82,9 @@
cp $14
jr z, .asm_19535
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, $5
- ld [$ff8b], a
+ ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData2
ld [hl], $19
.asm_19535
@@ -93,7 +93,7 @@
predef ShowObject
ld de, CeruleanCityMovement1
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $1
ld [W_CERULEANCITYCURSCRIPT], a
@@ -117,9 +117,9 @@
CeruleanCityScript_1955d: ; 1955d (6:555d)
ld a,1
- ld [$ff8c],a
+ ld [H_SPRITEINDEX],a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d],a
+ ld [hSpriteFacingDirection],a
jp SetSpriteFacingDirectionAndDelay ; face object
CeruleanCityScript1: ; 19567 (6:5567)
@@ -129,7 +129,7 @@
xor a
ld [wJoyIgnore], a
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd72d
set 6, [hl]
@@ -173,7 +173,7 @@
ld hl, wd75a
set 0, [hl]
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wc0ee], a
@@ -180,7 +180,7 @@
call PlaySound
callba Music_RivalAlternateStart
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld a, [W_XCOORD]
cp $14
@@ -191,7 +191,7 @@
ld de, CeruleanCityMovement3
.asm_195f3
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $3
ld [W_CERULEANCITYCURSCRIPT], a
@@ -295,7 +295,7 @@
ld hl, CeruleanCityText_196ee
ld de, CeruleanCityText_196ee
call SaveEndBattleTextPointers
- ld a, [$ff8c]
+ ld a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
--- a/scripts/ceruleangym.asm
+++ b/scripts/ceruleangym.asm
@@ -44,7 +44,7 @@
CeruleanGymScript_5c70d: ; 5c70d (17:470d)
ld a, $5
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd75e
set 7, [hl]
@@ -52,7 +52,7 @@
call GiveItem
jr nc, .BagFull
ld a, $6
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd75e
set 6, [hl]
@@ -59,7 +59,7 @@
jr .asm_5c736
.BagFull
ld a, $7
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5c736
ld hl, W_OBTAINEDBADGES
--- a/scripts/cinnabargym.asm
+++ b/scripts/cinnabargym.asm
@@ -37,7 +37,7 @@
ret
CinnabarGymScript_757a0: ; 757a0 (1d:57a0)
- ld a, [H_DOWNARROWBLINKCNT2]
+ ld a, [hSpriteIndexOrTextID]
ld [wTrainerHeaderFlagBit], a
ret
@@ -51,7 +51,7 @@
ld a, [wda38]
and a
ret z
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
cp $4
jr nz, .asm_757c3
ld a, $4
@@ -86,7 +86,7 @@
ld [wJoyIgnore], a
ld a, [wda38]
ld [wTrainerHeaderFlagBit], a
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
CinnabarGymScript_757f1: ; 757f1 (1d:57f1)
@@ -139,7 +139,7 @@
ld [wJoyIgnore], a
CinnabarGymScript3_75857: ; 75857 (1d:5857)
ld a, $a
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd79a
set 1, [hl]
@@ -147,7 +147,7 @@
call GiveItem
jr nc, .BagFull
ld a, $b
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd79a
set 0, [hl]
@@ -154,7 +154,7 @@
jr .asm_75880
.BagFull
ld a, $c
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_75880
ld hl, W_OBTAINEDBADGES
@@ -189,7 +189,7 @@
dw TM38NoRoomText
CinnabarGymScript_758b7: ; 758b7 (1d:58b7)
- ld a, [H_DOWNARROWBLINKCNT2]
+ ld a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
--- a/scripts/cinnabarisland.asm
+++ b/scripts/cinnabarisland.asm
@@ -27,7 +27,7 @@
ld a, $8
ld [wd528], a
ld a, $8
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
--- a/scripts/fightingdojo.asm
+++ b/scripts/fightingdojo.asm
@@ -45,12 +45,12 @@
ld a, $1
ld [wd528], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ret
@@ -64,9 +64,9 @@
ld a, $1
ld [wd528], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
.asm_5cde4
@@ -76,7 +76,7 @@
or $3e
ld [wd7b1], a
ld a, $8
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wJoyIgnore], a
@@ -148,7 +148,7 @@
ld hl, FightingDojoText_5ce93
ld de, FightingDojoText_5ce93
call SaveEndBattleTextPointers
- ld a, [H_SPRITEINDEX]
+ ld a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
--- a/scripts/fuchsiagym.asm
+++ b/scripts/fuchsiagym.asm
@@ -44,7 +44,7 @@
ld [wJoyIgnore], a
FuchsiaGymScript3_75497: ; 75497 (1d:5497)
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd792
set 1, [hl]
@@ -52,7 +52,7 @@
call GiveItem
jr nc, .BagFull
ld a, $a
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd792
set 0, [hl]
@@ -59,7 +59,7 @@
jr .asm_754c0
.BagFull
ld a, $b
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_754c0
ld hl, W_OBTAINEDBADGES
--- a/scripts/fuchsiahouse2.asm
+++ b/scripts/fuchsiahouse2.asm
@@ -3,7 +3,7 @@
FuchsiaHouse2TextPointers: ; 750b8 (1d:50b8)
dw FuchsiaHouse2Text1
- dw Predef5CText
+ dw PickUpItemText
dw BoulderText
dw FuchsiaHouse2Text4
dw FuchsiaHouse2Text5
--- a/scripts/gary.asm
+++ b/scripts/gary.asm
@@ -55,7 +55,7 @@
ld hl, W_OPTIONS
res 7, [hl]
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld hl, wd72d
@@ -99,10 +99,10 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld a, $4
ld [W_GARYCURSCRIPT], a
@@ -111,14 +111,14 @@
GaryScript4: ; 75fe4 (1d:5fe4)
callba Music_Cities1AlternateTempo
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld de, MovementData_76014
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, HS_CHAMPIONS_ROOM_OAK
ld [wcc4d], a
@@ -142,17 +142,17 @@
ld a, $2
ld [wd528], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
- call SetSpriteFacingDirectionAndDelay ; face object
+ ld [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $6
ld [W_GARYCURSCRIPT], a
@@ -160,12 +160,12 @@
GaryScript6: ; 76047 (1d:6047)
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_RIGHT
- ld [$ff8d], a
- call SetSpriteFacingDirectionAndDelay ; face object
+ ld [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
ld a, $4
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld a, $7
ld [W_GARYCURSCRIPT], a
@@ -173,16 +173,16 @@
GaryScript7: ; 7605f (1d:605f)
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
- call SetSpriteFacingDirectionAndDelay ; face object
+ ld [hSpriteFacingDirection], a
+ call SetSpriteFacingDirectionAndDelay
ld a, $5
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call GaryScript_760c8
ld de, MovementData_76080
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $8
ld [W_GARYCURSCRIPT], a
--- a/scripts/halloffameroom.asm
+++ b/scripts/halloffameroom.asm
@@ -83,10 +83,10 @@
ld a, $1
ld [wd528], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
- ld a, SPRITE_FACING_LEFT
- ld [$ff8d], a
+ ld a, $8
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call Delay3
xor a
@@ -94,7 +94,7 @@
inc a
ld [wd528], a
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wJoyIgnore], a
--- a/scripts/lance.asm
+++ b/scripts/lance.asm
@@ -64,7 +64,7 @@
cp $3
jr nc, .asm_5a325
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
.asm_5a325
cp $5
@@ -93,7 +93,7 @@
cp $ff
jp z, LanceScript_5a2f5
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
LanceScript_5a35b: ; 5a35b (16:635b)
--- a/scripts/lorelei.asm
+++ b/scripts/lorelei.asm
@@ -77,7 +77,7 @@
jr z, LoreleiScript_761c6
.asm_76206
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, D_UP
ld [wSimulatedJoypadStatesEnd], a
@@ -112,7 +112,7 @@
cp $ff
jp z, LoreleiScript_761b6
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
LoreleiTextPointers: ; 76251 (1d:6251)
--- a/scripts/mansion1.asm
+++ b/scripts/mansion1.asm
@@ -53,7 +53,7 @@
xor a
ld [hJoyHeld], a
ld a, $4
- ld [H_SPRITEHEIGHT], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
Mansion1ScriptPointers: ; 44326 (11:4326)
@@ -63,8 +63,8 @@
Mansion1TextPointers: ; 4432c (11:432c)
dw Mansion1Text1
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw Mansion1Text4
Mansion1TrainerHeaders: ; 44334 (11:4334)
--- a/scripts/mansion2.asm
+++ b/scripts/mansion2.asm
@@ -49,7 +49,7 @@
xor a
ld [hJoyHeld], a
ld a, $5
- ld [H_SPRITEHEIGHT], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
Mansion2ScriptPointers: ; 52047 (14:6047)
@@ -59,7 +59,7 @@
Mansion2TextPointers: ; 5204d (14:604d)
dw Mansion2Text1
- dw Predef5CText
+ dw PickUpItemText
dw Mansion2Text3
dw Mansion2Text4
dw Mansion2Text5
--- a/scripts/mansion3.asm
+++ b/scripts/mansion3.asm
@@ -80,14 +80,14 @@
xor a
ld [hJoyHeld], a
ld a, $6
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
Mansion3TextPointers: ; 5228a (14:628a)
dw Mansion3Text1
dw Mansion3Text2
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw Mansion3Text5
dw Mansion3Text6
--- a/scripts/mansion4.asm
+++ b/scripts/mansion4.asm
@@ -51,7 +51,7 @@
xor a
ld [hJoyHeld], a
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
Mansion4ScriptPointers: ; 52430 (14:6430)
@@ -62,12 +62,12 @@
Mansion4TextPointers: ; 52436 (14:6436)
dw Mansion4Text1
dw Mansion4Text2
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw Mansion4Text7
- dw Predef5CText
+ dw PickUpItemText
dw Mansion3Text6
Mansion4TrainerHeaders: ; 52448 (14:6448)
--- a/scripts/mtmoon1.asm
+++ b/scripts/mtmoon1.asm
@@ -20,12 +20,12 @@
dw MtMoon1Text5
dw MtMoon1Text6
dw MtMoon1Text7
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw MtMoon1Text14
MtMoon1TrainerHeaders: ; 499fd (12:59fd)
--- a/scripts/mtmoon3.asm
+++ b/scripts/mtmoon3.asm
@@ -66,7 +66,7 @@
xor a
ld [hJoyHeld], a
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
MtMoon3Script_49d91: ; 49d91 (12:5d91)
@@ -92,7 +92,7 @@
MtMoon3Script4: ; 49dba (12:5dba)
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld hl, CoordsData_49dea
call ArePlayerCoordsInArray
@@ -106,7 +106,7 @@
ld de, MovementData_49df8
.asm_49dda
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $5
ld [W_MTMOON3CURSCRIPT], a
@@ -140,7 +140,7 @@
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, $a
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, [wd7f6]
bit 6, a
@@ -167,8 +167,8 @@
dw MtMoon3Text5
dw MtMoon3Text6
dw MtMoon3Text7
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw MtMoon3Text_49f99
MtMoon3TrainerHeaders: ; 49e48 (12:5e48)
--- a/scripts/museum1f.asm
+++ b/scripts/museum1f.asm
@@ -25,7 +25,7 @@
xor a
ld [hJoyHeld], a
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
Museum1FScript1: ; 5c12a (17:412a)
@@ -69,7 +69,7 @@
call PrintText
jp Museum1FScriptEnd
.asm_3ded4
- ld a, $13
+ ld a, MONEY_BOX
ld [wTextBoxID], a
call DisplayTextBoxID
xor a
@@ -96,15 +96,15 @@
ld hl, wd754
set 0, [hl]
xor a
- ld [wWhichTrade], a
- ld [wTrainerEngageDistance], a
+ ld [wMuseumPriceTemp], a
+ ld [wMuseumPriceTemp + 1], a
ld a, $50
- ld [wTrainerFacingDirection], a
- ld hl, wTrainerFacingDirection
+ ld [wMuseumPriceTemp + 2], a
+ ld hl, wMuseumPriceTemp + 2
ld de, wPlayerMoney + 2
ld c, $3
predef SubBCDPredef
- ld a, $13
+ ld a, MONEY_BOX
ld [wTextBoxID], a
call DisplayTextBoxID
ld a, (SFX_02_5a - SFX_Headers_02) / 3
--- a/scripts/oakslab.asm
+++ b/scripts/oakslab.asm
@@ -89,13 +89,13 @@
call StartSimulatingJoypadStates
ld a, $1
ld [H_SPRITEINDEX], a
- xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
+ xor a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $5
ld [H_SPRITEINDEX], a
- xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
+ xor a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $4
@@ -117,7 +117,7 @@
ld a, $1
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call UpdateSprites
ld hl, W_FLAGS_D733
@@ -132,19 +132,19 @@
ld a, $fc
ld [wJoyIgnore], a
ld a, $11
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld a, $12
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld a, $13
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld a, $14
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd74b
set 1, [hl]
@@ -162,16 +162,16 @@
ld a, $5
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $1
ld [H_SPRITEINDEX], a
xor a
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call UpdateSprites
ld a, $c
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
@@ -261,7 +261,7 @@
ld a, $1
ld [H_SPRITEINDEX], a
ld a, $4
- ld [$ff8b], a
+ ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData1
push hl
ld [hl], $4c
@@ -302,10 +302,10 @@
ld a, $1
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $d
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, [wTrainerEngageDistance]
cp $2
@@ -331,10 +331,10 @@
ld a, $1
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $e
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd74b
set 2, [hl]
@@ -352,7 +352,7 @@
ld a, $1
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $8
ld [wd528], a
@@ -360,7 +360,7 @@
ld a, MUSIC_MEET_RIVAL
call PlayMusic
ld a, $f
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [hNPCPlayerRelativePosPerspective], a
@@ -432,7 +432,7 @@
ld a, $1
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
predef HealParty
ld hl, wd74b
@@ -446,7 +446,7 @@
ld c, 20
call DelayFrames
ld a, $10
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
callba Music_RivalAlternateStart
ld a, $1
@@ -522,7 +522,7 @@
call PlaySound
callba Music_RivalAlternateStart
ld a, $15
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call OaksLabScript_1d02b
ld a, HS_OAKS_LAB_RIVAL
@@ -549,12 +549,12 @@
ld a, $1
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $8
ld [H_SPRITEINDEX], a
xor a ; SPRITE_FACING_DOWN
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
jp SetSpriteFacingDirectionAndDelay
OaksLabScript16: ; 1cf12 (7:4f12)
@@ -567,21 +567,21 @@
ld [wJoyIgnore], a
call OaksLabScript_1cefd
ld a, $16
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
call OaksLabScript_1cefd
ld a, $17
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
call OaksLabScript_1cefd
ld a, $18
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call DelayFrame
ld a, $19
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld a, HS_POKEDEX_1
@@ -592,16 +592,16 @@
predef HideObject
call OaksLabScript_1cefd
ld a, $1a
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_RIGHT
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
call Delay3
ld a, $1b
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd74b
set 5, [hl]
@@ -856,13 +856,13 @@
ld a, $5
ld [H_SPRITEINDEX], a
ld a, $9
- ld [$ff8b], a
+ ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData1
ld [hl], $0
ld a, $1
ld [H_SPRITEINDEX], a
ld a, $9
- ld [$ff8b], a
+ ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData1
ld [hl], $c
ld hl, wd730
@@ -962,7 +962,7 @@
ld a, $5
ld [H_SPRITEINDEX], a
ld a, $9
- ld [$ff8b], a
+ ld [H_SPRITEDATAOFFSET], a
call GetPointerWithinSpriteStateData1
ld [hl], $0
ld hl, OaksLabLastMonText
--- a/scripts/pallettown.asm
+++ b/scripts/pallettown.asm
@@ -67,7 +67,7 @@
ld a,1
ld [H_SPRITEINDEX],a
ld a,SPRITE_FACING_UP
- ld [$FF8D],a
+ ld [hSpriteFacingDirection],a
call SetSpriteFacingDirectionAndDelay
call Delay3
ld a,1
--- a/scripts/pewtercity.asm
+++ b/scripts/pewtercity.asm
@@ -31,7 +31,7 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $5
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
CoordsData_19277: ; 19277 (6:5277)
@@ -48,16 +48,16 @@
ld a, $3
ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_UP
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, ($3 << 4) | SPRITE_FACING_UP
- ld [$ff8d], a
+ ld [hSpriteImageIndex], a
call SetSpriteImageIndexAfterSettingFacingDirection
call PlayDefaultMusic
ld hl, wFlags_0xcd60
set 4, [hl]
ld a, $d
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $3c
ld [$ffeb], a
@@ -71,7 +71,7 @@
ld [wSpriteIndex], a
call SetSpritePosition1
ld a, $3
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld de, MovementData_PewterMuseumGuyExit
call MoveSprite
ld a, $2
@@ -114,18 +114,18 @@
and a
ret nz
ld a, $5
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, SPRITE_FACING_LEFT
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, ($1 << 4) | SPRITE_FACING_LEFT
- ld [$ff8d], a
+ ld [hSpriteImageIndex], a
call SetSpriteImageIndexAfterSettingFacingDirection
call PlayDefaultMusic
ld hl, wFlags_0xcd60
set 4, [hl]
ld a, $e
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $3c
ld [$ffeb], a
@@ -139,7 +139,7 @@
ld [wSpriteIndex], a
call SetSpritePosition1
ld a, $5
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld de, MovementData_PewterGymGuyExit
call MoveSprite
ld a, $5
--- a/scripts/pewtergym.asm
+++ b/scripts/pewtergym.asm
@@ -44,7 +44,7 @@
PewterGymScript_5c3df: ; 5c3df (17:43df)
ld a, $4
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd755
set 7, [hl]
@@ -52,7 +52,7 @@
call GiveItem
jr nc, .BagFull
ld a, $5
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd755
set 6, [hl]
@@ -59,7 +59,7 @@
jr .asm_5c408
.BagFull
ld a, $6
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5c408
ld hl, W_OBTAINEDBADGES
--- a/scripts/pokemontower2.asm
+++ b/scripts/pokemontower2.asm
@@ -31,7 +31,7 @@
call PlayMusic
ld hl, wd764
res 6, [hl]
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
cp $1
ld a, $8
ld b, SPRITE_FACING_DOWN
@@ -43,12 +43,12 @@
.asm_60544
ld [wd528], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
ld a, b
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
@@ -69,7 +69,7 @@
ld hl, wd764
set 7, [hl]
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld de, MovementData_605b2
ld a, [wd764]
@@ -78,7 +78,7 @@
ld de, MovementData_605a9
.asm_60589
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $ff
ld [wc0ee], a
--- a/scripts/pokemontower3.asm
+++ b/scripts/pokemontower3.asm
@@ -16,7 +16,7 @@
dw PokemonTower3Text1
dw PokemonTower3Text2
dw PokemonTower3Text3
- dw Predef5CText
+ dw PickUpItemText
PokemonTower3TrainerHeaders: ; 606ed (18:46ed)
PokemonTower3TrainerHeader0: ; 606ed (18:46ed)
--- a/scripts/pokemontower4.asm
+++ b/scripts/pokemontower4.asm
@@ -16,9 +16,9 @@
dw PokemonTower4Text1
dw PokemonTower4Text2
dw PokemonTower4Text3
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
PokemonTower4TrainerHeaders: ; 6081b (18:481b)
PokemonTower4TrainerHeader0: ; 6081b (18:481b)
--- a/scripts/pokemontower5.asm
+++ b/scripts/pokemontower5.asm
@@ -38,7 +38,7 @@
call Delay3
call GBFadeInFromWhite
ld a, $7
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wJoyIgnore], a
@@ -57,7 +57,7 @@
dw PokemonTower5Text3
dw PokemonTower5Text4
dw PokemonTower5Text5
- dw Predef5CText
+ dw PickUpItemText
dw PokemonTower5Text7
PokemonTower5TrainerHeaders: ; 609a9 (18:49a9)
--- a/scripts/pokemontower6.asm
+++ b/scripts/pokemontower6.asm
@@ -31,7 +31,7 @@
xor a
ld [hJoyHeld], a
ld a, $6
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, MAROWAK
ld [W_CUROPPONENT], a
@@ -63,7 +63,7 @@
ld hl, wd768
set 7, [hl]
ld a, $7
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wJoyIgnore], a
@@ -100,8 +100,8 @@
dw PokemonTower6Text1
dw PokemonTower6Text2
dw PokemonTower6Text3
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw PokemonTower6Text6
dw PokemonTower6Text7
--- a/scripts/pokemontower7.asm
+++ b/scripts/pokemontower7.asm
@@ -31,7 +31,7 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, [wSpriteIndex]
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call PokemonTower7Script_60db6
ld a, $3
@@ -72,7 +72,7 @@
ld a, SPRITE_FACING_UP
ld [wSpriteStateData1 + 9], a
ld a, LAVENDER_HOUSE_1
- ld [H_DOWNARROWBLINKCNT1], a
+ ld [hWarpDestinationMap], a
ld a, $1
ld [wDestinationWarpID], a
ld a, LAVENDER_TOWN
@@ -107,7 +107,7 @@
ld d, [hl]
ld e, a
ld a, [wSpriteIndex]
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
jp MoveSprite
.asm_60dde
inc hl
--- a/scripts/powerplant.asm
+++ b/scripts/powerplant.asm
@@ -22,11 +22,11 @@
dw PowerPlantText7
dw PowerPlantText8
dw PowerPlantText9
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
PowerPlantTrainerHeaders: ; 1e2fb (7:62fb)
PowerPlantTrainerHeader0: ; 1e2fb (7:62fb)
--- a/scripts/rockethideout1.asm
+++ b/scripts/rockethideout1.asm
@@ -43,8 +43,8 @@
dw RocketHideout1Text3
dw RocketHideout1Text4
dw RocketHideout1Text5
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
RocketHideout1TrainerHeaders: ; 44c22 (11:4c22)
RocketHideout1TrainerHeader0: ; 44c22 (11:4c22)
--- a/scripts/rockethideout2.asm
+++ b/scripts/rockethideout2.asm
@@ -415,10 +415,10 @@
RocketHideout2TextPointers: ; 450c7 (11:50c7)
dw RocketHideout2Text1
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
RocketHideout2TrainerHeaders: ; 450d1 (11:50d1)
RocketHideout2TrainerHeader0: ; 450d1 (11:50d1)
--- a/scripts/rockethideout3.asm
+++ b/scripts/rockethideout3.asm
@@ -146,8 +146,8 @@
RocketHideout3TextPointers: ; 452fa (11:52fa)
dw RocketHideout3Text1
dw RocketHideout3Text2
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
RocketHideout3TrainerHeaders: ; 45302 (11:5302)
RocketHideout3TrainerHeader0: ; 45302 (11:5302)
--- a/scripts/rockethideout4.asm
+++ b/scripts/rockethideout4.asm
@@ -56,7 +56,7 @@
ld hl, wd81b
set 7, [hl]
ld a, $a
- ld [H_SPRITEHEIGHT], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call GBFadeOutToBlack
ld a, HS_ROCKET_HIDEOUT_4_GIOVANNI
@@ -81,11 +81,11 @@
dw RocketHideout4Text2
dw RocketHideout4Text3
dw RocketHideout4Text4
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw RocketHideout4Text10
RocketHideout4TrainerHeaders: ; 45515 (11:5515)
--- a/scripts/route12.asm
+++ b/scripts/route12.asm
@@ -28,7 +28,7 @@
res 6, [hl]
jp z, CheckFightingMapTrainers
ld a, $d
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, SNORLAX
ld [W_CUROPPONENT], a
@@ -51,7 +51,7 @@
cp $2
jr z, .asm_59664
ld a, $e
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_59664
ld hl, wd7d8
@@ -71,8 +71,8 @@
dw Route12Text6
dw Route12Text7
dw Route12Text8
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw Route12Text11
dw Route12Text12
dw Route12Text13
--- a/scripts/route15.asm
+++ b/scripts/route15.asm
@@ -23,7 +23,7 @@
dw Route15Text8
dw Route15Text9
dw Route15Text10
- dw Predef5CText
+ dw PickUpItemText
dw Route15Text12
Route15TrainerHeaders: ; 597df (16:57df)
--- a/scripts/route16.asm
+++ b/scripts/route16.asm
@@ -28,7 +28,7 @@
res 0, [hl]
jp z, CheckFightingMapTrainers
ld a, $a
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, SNORLAX
ld [W_CUROPPONENT], a
@@ -52,7 +52,7 @@
cp $2
jr z, .asm_599a8
ld a, $b
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_599a8
ld hl, wd7e0
--- a/scripts/route16gate.asm
+++ b/scripts/route16gate.asm
@@ -19,14 +19,14 @@
call ArePlayerCoordsInArray
ret nc
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
cp $1
jr z, .asm_4970e
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
dec a
ld [wSimulatedJoypadStatesIndex], a
ld b, $0
@@ -59,7 +59,7 @@
Route16GateScript2: ; 49727 (12:5727)
ld a, $1
- ld [H_SPRITEHEIGHT], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
--- a/scripts/route18gate.asm
+++ b/scripts/route18gate.asm
@@ -19,17 +19,17 @@
call ArePlayerCoordsInArray
ret nc
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
cp $1
jr z, .asm_498c6
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
dec a
ld [wSimulatedJoypadStatesIndex], a
- ld b, $0
+ ld b, 0
ld c, a
ld a, D_UP
ld hl, wSimulatedJoypadStatesEnd
@@ -59,7 +59,7 @@
Route18GateScript2: ; 498df (12:58df)
ld a, $1
- ld [H_SPRITEHEIGHT], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
--- a/scripts/route2.asm
+++ b/scripts/route2.asm
@@ -2,8 +2,8 @@
jp EnableAutoTextBoxDrawing
Route2TextPointers: ; 554e6 (15:54e6)
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw Route2Text3
dw Route2Text4
--- a/scripts/route22.asm
+++ b/scripts/route22.asm
@@ -43,8 +43,8 @@
inc de
.asm_50ef1
call MoveSprite
- ld a, $c
- ld [$ff8d], a
+ ld a, SPRITE_FACING_RIGHT
+ ld [hSpriteFacingDirection], a
jp SetSpriteFacingDirectionAndDelay
Route22RivalMovementData: ; 50efb (14:4efb)
@@ -61,7 +61,7 @@
ld hl, .Route22RivalBattleCoords
call ArePlayerCoordsInArray
ret nc
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
ld [wcf0d], a
xor a
ld [hJoyHeld], a
@@ -98,7 +98,7 @@
ld a, MUSIC_MEET_RIVAL
call PlayMusic
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call Route22MoveRivalSprite
ld a, $1
ld [W_ROUTE22CURSCRIPT], a
@@ -113,19 +113,19 @@
jr nz, .asm_50f78
ld a, $4
ld [wd528], a
- ld a, $4
+ ld a, SPRITE_FACING_UP
jr .asm_50f7a
.asm_50f78
- ld a, $c
+ ld a, SPRITE_FACING_RIGHT
.asm_50f7a
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteFacingDirectionAndDelay
xor a
ld [wJoyIgnore], a
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd72d
set 6, [hl]
@@ -159,9 +159,9 @@
.notDown
ld a, SPRITE_FACING_RIGHT
.done
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteFacingDirectionAndDelay
ld a, $f0
ld [wJoyIgnore], a
@@ -168,7 +168,7 @@
ld hl, wd7eb
set 5, [hl]
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wc0ee], a
@@ -194,7 +194,7 @@
ld de, Route22RivalExitMovementData2
Route22MoveRival1: ; 51010 (14:5010)
ld a, $1
- ld [H_SPRITEHEIGHT], a
+ ld [H_SPRITEINDEX], a
jp MoveSprite
Route22RivalExitMovementData1: ; 51017 (14:5017)
@@ -255,7 +255,7 @@
call PlaySound
callba Music_RivalAlternateTempo
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call Route22MoveRivalSprite
ld a, $4
ld [W_ROUTE22CURSCRIPT], a
@@ -266,25 +266,25 @@
bit 0, a
ret nz
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
ld a, [wcf0d]
cp $1
jr nz, .asm_510a1
ld a, $4
ld [wd528], a
- ld a, $4
+ ld a, SPRITE_FACING_UP
jr .asm_510a8
.asm_510a1
ld a, $2
ld [wd528], a
- ld a, $c
+ ld a, SPRITE_FACING_RIGHT
.asm_510a8
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
xor a
ld [wJoyIgnore], a
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd72d
set 6, [hl]
@@ -310,20 +310,20 @@
cp $ff
jp z, Route22Script_50ece
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
ld a, [wcf0d]
cp $1
jr nz, .asm_510fb
ld a, $4
ld [wd528], a
- ld a, $4
+ ld a, SPRITE_FACING_UP
jr .asm_51102
.asm_510fb
ld a, $2
ld [wd528], a
- ld a, $c
+ ld a, SPRITE_FACING_RIGHT
.asm_51102
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $f0
ld [wJoyIgnore], a
@@ -330,7 +330,7 @@
ld hl, wd7eb
set 6, [hl]
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wc0ee], a
@@ -356,7 +356,7 @@
ld de, MovementData_5114d
Route22MoveRival2: ; 51145 (14:5145)
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
jp MoveSprite
MovementData_5114c: ; 5114c (14:514c)
--- a/scripts/route22gate.asm
+++ b/scripts/route22gate.asm
@@ -24,7 +24,7 @@
xor a
ld [hJoyHeld], a
ld a, $1
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
Route22GateScriptCoords: ; 1e6b5 (7:66b5)
--- a/scripts/route23.asm
+++ b/scripts/route23.asm
@@ -49,9 +49,9 @@
ret nc
.asm_51237
ld a, e
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
ld a, c
- ld [wWhichTrade], a
+ ld [wWhichBadge], a
ld b, $2
ld hl, wd7ed
predef FlagActionPredef
@@ -69,9 +69,9 @@
Route23Script_5125d: ; 5125d (14:525d)
ld hl, BadgeTextPointers
- ld a, [wWhichTrade]
+ ld a, [wWhichBadge]
ld c, a
- ld b, $0
+ ld b, 0
add hl, bc
add hl, bc
ld a, [hli]
@@ -78,12 +78,12 @@
ld h, [hl]
ld l, a
ld de, wcd6d
-.asm_5126e
+.copyTextLoop
ld a, [hli]
ld [de], a
inc de
- cp $50
- jr nz, .asm_5126e
+ cp "@"
+ jr nz, .copyTextLoop
ret
BadgeTextPointers: ; 51276 (14:5276)
@@ -188,9 +188,9 @@
jp TextScriptEnd
Route23Script_51346: ; 51346 (14:5346)
- ld [wWhichTrade], a
+ ld [wWhichBadge], a
call Route23Script_5125d
- ld a, [wWhichTrade]
+ ld a, [wWhichBadge]
inc a
ld c, a
ld b, $2
@@ -208,7 +208,7 @@
.asm_5136e
ld hl, VictoryRoadGuardText2
call PrintText
- ld a, [wWhichTrade]
+ ld a, [wWhichBadge]
ld c, a
ld b, $1
ld hl, wd7ed
--- a/scripts/route24.asm
+++ b/scripts/route24.asm
@@ -31,7 +31,7 @@
xor a
ld [hJoyHeld], a
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd7f0
bit 1, [hl]
@@ -70,7 +70,7 @@
ld hl, wd7ef
set 1, [hl]
ld a, $1
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [wJoyIgnore], a
@@ -87,7 +87,7 @@
dw Route24Text5
dw Route24Text6
dw Route24Text7
- dw Predef5CText
+ dw PickUpItemText
Route24TrainerHeaders: ; 5145b (14:545b)
Route24TrainerHeader0: ; 5145b (14:545b)
@@ -170,7 +170,7 @@
ld hl, Route24Text_5152b
ld de, Route24Text_5152b
call SaveEndBattleTextPointers
- ld a, [$ff8c]
+ ld a, [hSpriteIndexOrTextID]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
--- a/scripts/route25.asm
+++ b/scripts/route25.asm
@@ -51,7 +51,7 @@
dw Route25Text7
dw Route25Text8
dw Route25Text9
- dw Predef5CText
+ dw PickUpItemText
dw Route25Text11
Route25TrainerHeaders: ; 5163e (14:563e)
--- a/scripts/route4.asm
+++ b/scripts/route4.asm
@@ -15,7 +15,7 @@
Route4TextPointers: ; 55671 (15:5671)
dw Route4Text1
dw Route4Text2
- dw Predef5CText
+ dw PickUpItemText
dw PokeCenterSignText
dw Route4Text5
dw Route4Text6
--- a/scripts/route5gate.asm
+++ b/scripts/route5gate.asm
@@ -31,7 +31,7 @@
and a
jr nz, .asm_1df82
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Route5GateScript_1df43
ld a, $1
@@ -39,7 +39,7 @@
ret
.asm_1df82
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd728
set 6, [hl]
--- a/scripts/route6gate.asm
+++ b/scripts/route6gate.asm
@@ -25,7 +25,7 @@
and a
jr nz, .asm_1e080
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Route6GateScript_1e0a1
ld a, $1
@@ -35,7 +35,7 @@
ld hl, wd728
set 6, [hl]
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
CoordsData_1e08c: ; 1e08c (7:608c)
--- a/scripts/route7gate.asm
+++ b/scripts/route7gate.asm
@@ -37,7 +37,7 @@
and a
jr nz, .asm_1e15a
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Route7GateScript_1e111
ld a, $1
@@ -45,7 +45,7 @@
ret
.asm_1e15a
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd728
set 6, [hl]
--- a/scripts/route8gate.asm
+++ b/scripts/route8gate.asm
@@ -36,7 +36,7 @@
and a
jr nz, .asm_1e220
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Route8GateScript_1e1d7
ld a, $1
@@ -46,7 +46,7 @@
ld hl, wd728
set 6, [hl]
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
jp DisplayTextID
CoordsData_1e22c: ; 1e22c (7:622c)
--- a/scripts/route9.asm
+++ b/scripts/route9.asm
@@ -22,7 +22,7 @@
dw Route9Text7
dw Route9Text8
dw Route9Text9
- dw Predef5CText
+ dw PickUpItemText
dw Route9Text11
Route9TrainerHeaders: ; 556eb (15:56eb)
--- a/scripts/safarizonecenter.asm
+++ b/scripts/safarizonecenter.asm
@@ -2,7 +2,7 @@
jp EnableAutoTextBoxDrawing
SafariZoneCenterTextPointers: ; 45bb5 (11:5bb5)
- dw Predef5CText
+ dw PickUpItemText
dw SafariZoneCenterText2
dw SafariZoneCenterText3
--- a/scripts/safarizoneeast.asm
+++ b/scripts/safarizoneeast.asm
@@ -2,10 +2,10 @@
jp EnableAutoTextBoxDrawing
SafariZoneEastTextPointers: ; 4586e (11:586e)
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw SafariZoneEastText5
dw SafariZoneEastText6
dw SafariZoneEastText7
--- a/scripts/safarizoneentrance.asm
+++ b/scripts/safarizoneentrance.asm
@@ -18,7 +18,7 @@
call ArePlayerCoordsInArray
ret nc
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wJoyIgnore], a
@@ -56,7 +56,7 @@
ld [wJoyIgnore], a
call UpdateSprites
ld a, $4
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wJoyIgnore], a
@@ -83,7 +83,7 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $6
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [W_NUMSAFARIBALLS], a
@@ -95,7 +95,7 @@
jr .asm_75286
.asm_7527f
ld a, $5
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_75286
ret
--- a/scripts/safarizonenorth.asm
+++ b/scripts/safarizonenorth.asm
@@ -2,8 +2,8 @@
jp EnableAutoTextBoxDrawing
SafariZoneNorthTextPointers: ; 459ae (11:59ae)
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw SafariZoneNorthText3
dw SafariZoneNorthText4
dw SafariZoneNorthText5
--- a/scripts/safarizonewest.asm
+++ b/scripts/safarizonewest.asm
@@ -2,10 +2,10 @@
jp EnableAutoTextBoxDrawing
SafariZoneWestTextPointers: ; 4a1b8 (12:61b8)
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw SafariZoneWestText5
dw SafariZoneWestText6
dw SafariZoneWestText7
--- a/scripts/saffrongym.asm
+++ b/scripts/saffrongym.asm
@@ -44,7 +44,7 @@
SaffronGymText_5d068: ; 5d068 (17:5068)
ld a, $a
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd7b3
set 1, [hl]
@@ -52,7 +52,7 @@
call GiveItem
jr nc, .BagFull
ld a, $b
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd7b3
set 0, [hl]
@@ -59,7 +59,7 @@
jr .asm_5d091
.BagFull
ld a, $c
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5d091
ld hl, W_OBTAINEDBADGES
--- a/scripts/silphco10.asm
+++ b/scripts/silphco10.asm
@@ -44,9 +44,9 @@
dw SilphCo10Text1
dw SilphCo10Text2
dw SilphCo10Text3
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
SilphCo10TrainerHeaders: ; 5a192 (16:6192)
SilphCo10TrainerHeader0: ; 5a192 (16:6192)
--- a/scripts/silphco11.asm
+++ b/scripts/silphco11.asm
@@ -170,7 +170,7 @@
ld hl, CoordsData_62211
call ArePlayerCoordsInArray
jp nc, CheckFightingMapTrainers
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
ld [wcf0d], a
xor a
ld [hJoyHeld], a
@@ -177,10 +177,10 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $3
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $3
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld de, MovementData_62216
call MoveSprite
@@ -201,9 +201,9 @@
SilphCo11Script_6221a: ; 6221a (18:621a)
ld [wd528], a
ld a, $3
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
ld a, b
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
jp SetSpriteFacingDirectionAndDelay
SilphCo11Script5: ; 62227 (18:6227)
@@ -214,17 +214,17 @@
cp $1
jr z, .asm_6223c
ld a, $2
- ld b, $c
+ ld b, SPRITE_FACING_RIGHT
jr .asm_62240
.asm_6223c
ld a, $8
- ld b, $0
+ ld b, SPRITE_FACING_DOWN
.asm_62240
call SilphCo11Script_6221a
ld a, $f0
ld [wJoyIgnore], a
ld a, $6
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call GBFadeOutToBlack
call SilphCo11Script_6216d
@@ -242,17 +242,17 @@
bit 0, a
ret nz
ld a, $3
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld a, [wcf0d]
cp $1
jr z, .asm_62284
ld a, $2
- ld b, $c
+ ld b, SPRITE_FACING_RIGHT
jr .asm_62288
.asm_62284
ld a, $8
- ld b, $0
+ ld b, SPRITE_FACING_DOWN
.asm_62288
call SilphCo11Script_6221a
call Delay3
@@ -266,7 +266,7 @@
ld hl, SilphCo10Text_62330
ld de, SilphCo10Text_62330
call SaveEndBattleTextPointers
- ld a, [H_DOWNARROWBLINKCNT2]
+ ld a, [H_SPRITEINDEX]
ld [wSpriteIndex], a
call EngageMapTrainer
call InitBattleEnemyParameters
--- a/scripts/silphco3.asm
+++ b/scripts/silphco3.asm
@@ -58,7 +58,7 @@
dw SilphCo3Text1
dw SilphCo3Text2
dw SilphCo3Text3
- dw Predef5CText
+ dw PickUpItemText
SilphCo3TrainerHeaders: ; 59fcc (16:5fcc)
SilphCo3TrainerHeader0: ; 59fcc (16:5fcc)
--- a/scripts/silphco4.asm
+++ b/scripts/silphco4.asm
@@ -95,9 +95,9 @@
dw SilphCo4Text2
dw SilphCo4Text3
dw SilphCo4Text4
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
SilphCo4TrainerHeaders: ; 19dae (6:5dae)
SilphCo4TrainerHeader0: ; 19dae (6:5dae)
--- a/scripts/silphco5.asm
+++ b/scripts/silphco5.asm
@@ -74,9 +74,9 @@
dw SilphCo5Text3
dw SilphCo5Text4
dw SilphCo5Text5
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw SilphCo5Text9
dw SilphCo5Text10
dw SilphCo5Text11
--- a/scripts/silphco6.asm
+++ b/scripts/silphco6.asm
@@ -50,8 +50,8 @@
dw SilphCo6Text6
dw SilphCo6Text7
dw SilphCo6Text8
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
SilphCo6TrainerHeaders: ; 1a20a (6:620a)
SilphCo6TrainerHeader0: ; 1a20a (6:620a)
--- a/scripts/silphco7.asm
+++ b/scripts/silphco7.asm
@@ -136,10 +136,10 @@
ld a, MUSIC_MEET_RIVAL
call PlayMusic
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld de, MovementData_51c7d
ld a, [wWhichTrade]
@@ -149,7 +149,7 @@
inc de
.asm_51c6c
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $3
jp SilphCo7Text_51c10
@@ -173,7 +173,7 @@
xor a
ld [wJoyIgnore], a
ld a, $d
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld hl, wd72d
@@ -212,12 +212,12 @@
ld a, $4
ld [wd528], a
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
- ld a, $4
- ld [$ff8d], a
+ ld [H_SPRITEINDEX], a
+ ld a, SPRITE_FACING_UP
+ ld [hSpriteFacingDirection], a
call SetSpriteFacingDirectionAndDelay
ld a, $f
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $ff
ld [wc0ee], a
@@ -230,7 +230,7 @@
ld de, MovementData_51d1a
.asm_51d0e
ld a, $9
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $5
jp SilphCo7Text_51c10
@@ -272,9 +272,9 @@
dw SilphCo7Text7
dw SilphCo7Text8
dw SilphCo7Text9
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw SilphCo7Text13
dw SilphCo7Text14
dw SilphCo7Text15
--- a/scripts/ssanne10.asm
+++ b/scripts/ssanne10.asm
@@ -21,9 +21,9 @@
dw SSAnne10Text6
dw SSAnne10Text7
dw SSAnne10Text8
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
SSAnne10TrainerHeaders: ; 61d84 (18:5d84)
SSAnne10TrainerHeader0: ; 61d84 (18:5d84)
--- a/scripts/ssanne2.asm
+++ b/scripts/ssanne2.asm
@@ -30,7 +30,7 @@
ld c, BANK(Music_MeetRival)
ld a, MUSIC_MEET_RIVAL
call PlayMusic
- ld a, [wWhichTrade]
+ ld a, [wCoordIndex]
ld [$ffdb], a
ld a, HS_SS_ANNE_2_RIVAL
ld [wcc4d], a
@@ -37,7 +37,7 @@
predef ShowObject
call Delay3
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
xor a
ld [hJoyHeld], a
@@ -79,11 +79,11 @@
ld a, SPRITE_FACING_RIGHT
jr .asm_61427
.asm_61426
- xor a
+ xor a ; SPRITE_FACING_DOWN
.asm_61427
- ld [$ff8d], a
+ ld [hSpriteFacingDirection], a
ld a, $2
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [H_SPRITEINDEX], a
jp SetSpriteFacingDirectionAndDelay
SSAnne2Script1: ; 61430 (18:5430)
@@ -94,7 +94,7 @@
xor a
ld [wJoyIgnore], a
ld a, $2
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
call Delay3
ld a, SONY2 + $c8
@@ -129,10 +129,10 @@
ld a, $f0
ld [wJoyIgnore], a
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteMovementBytesToFF
ld a, [W_XCOORD]
cp $25
@@ -143,7 +143,7 @@
ld de, MovementData_614b7
.asm_6149a
ld a, $2
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call MoveSprite
ld a, $ff
ld [wc0ee], a
--- a/scripts/ssanne8.asm
+++ b/scripts/ssanne8.asm
@@ -22,7 +22,7 @@
dw SSAnne8Text7
dw SSAnne8Text8
dw SSAnne8Text9
- dw Predef5CText
+ dw PickUpItemText
dw SSAnne8Text11
SSAnne8TrainerHeaders: ; 619a5 (18:59a5)
--- a/scripts/ssanne9.asm
+++ b/scripts/ssanne9.asm
@@ -21,10 +21,10 @@
dw SSAnne9Text3
dw SSAnne9Text4
dw SSAnne9Text5
- dw Predef5CText
+ dw PickUpItemText
dw SSAnne9Text7
dw SSAnne9Text8
- dw Predef5CText
+ dw PickUpItemText
dw SSAnne9Text10
dw SSAnne9Text11
dw SSAnne9Text12
--- a/scripts/tradecenter.asm
+++ b/scripts/tradecenter.asm
@@ -2,13 +2,13 @@
call EnableAutoTextBoxDrawing
ld a, [$ffaa]
cp $2
- ld a, $8
- jr z, .asm_4fd1d
- ld a, $c
-.asm_4fd1d
- ld [$ff8d], a
+ ld a, SPRITE_FACING_LEFT
+ jr z, .next
+ ld a, SPRITE_FACING_RIGHT
+.next
+ ld [hSpriteFacingDirection], a
ld a, $1
- ld [$ff8c], a
+ ld [H_SPRITEINDEX], a
call SetSpriteFacingDirection
ld hl, wd72d
bit 0, [hl]
--- a/scripts/unknowndungeon1.asm
+++ b/scripts/unknowndungeon1.asm
@@ -2,6 +2,6 @@
jp EnableAutoTextBoxDrawing
UnknownDungeon1TextPointers: ; 74d0f (1d:4d0f)
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
--- a/scripts/unknowndungeon2.asm
+++ b/scripts/unknowndungeon2.asm
@@ -2,6 +2,6 @@
jp EnableAutoTextBoxDrawing
UnknownDungeon2TextPointers: ; 45e0e (11:5e0e)
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
--- a/scripts/unknowndungeon3.asm
+++ b/scripts/unknowndungeon3.asm
@@ -14,8 +14,8 @@
UnknownDungeon3TextPointers: ; 45f09 (11:5f09)
dw UnknownDungeon3Text1
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
UnknownDungeon3TrainerHeaders: ; 45f0f (11:5f0f)
UnknownDungeon3TrainerHeader0: ; 45f0f (11:5f0f)
--- a/scripts/vermilioncity.asm
+++ b/scripts/vermilioncity.asm
@@ -49,7 +49,7 @@
ld [hJoyHeld], a
ld [wcf0d], a
ld a, $3
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld a, [wd803]
bit 2, a
--- a/scripts/vermiliongym.asm
+++ b/scripts/vermiliongym.asm
@@ -64,7 +64,7 @@
VermilionGymScript_5caaa: ; 5caaa (17:4aaa)
ld a, $6
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd773
set 7, [hl]
@@ -72,7 +72,7 @@
call GiveItem
jr nc, .BagFull
ld a, $7
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd773
set 6, [hl]
@@ -79,7 +79,7 @@
jr .asm_5cad3
.BagFull
ld a, $8
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_5cad3
ld hl, W_OBTAINEDBADGES
--- a/scripts/victoryroad1.asm
+++ b/scripts/victoryroad1.asm
@@ -43,8 +43,8 @@
VictoryRoad1TextPointers: ; 5da5f (17:5a5f)
dw VictoryRoad1Text1
dw VictoryRoad1Text2
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw BoulderText
dw BoulderText
dw BoulderText
--- a/scripts/victoryroad2.asm
+++ b/scripts/victoryroad2.asm
@@ -77,10 +77,10 @@
dw VictoryRoad2Text4
dw VictoryRoad2Text5
dw VictoryRoad2Text6
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw BoulderText
dw BoulderText
dw BoulderText
--- a/scripts/victoryroad3.asm
+++ b/scripts/victoryroad3.asm
@@ -83,8 +83,8 @@
dw VictoryRoad3Text2
dw VictoryRoad3Text3
dw VictoryRoad3Text4
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
dw BoulderText
dw BoulderText
dw BoulderText
--- a/scripts/viridiancity.asm
+++ b/scripts/viridiancity.asm
@@ -32,7 +32,7 @@
cp $20
ret nz
ld a, $e
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
@@ -52,7 +52,7 @@
cp $13
ret nz
ld a, $5
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [hJoyHeld], a
@@ -98,7 +98,7 @@
xor a
ld [wJoyIgnore], a
ld a, $f
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
xor a
ld [W_BATTLETYPE], a
--- a/scripts/viridianforest.asm
+++ b/scripts/viridianforest.asm
@@ -17,9 +17,9 @@
dw ViridianForestText2
dw ViridianForestText3
dw ViridianForestText4
- dw Predef5CText
- dw Predef5CText
- dw Predef5CText
+ dw PickUpItemText
+ dw PickUpItemText
+ dw PickUpItemText
dw ViridianForestText8
dw ViridianForestText9
dw ViridianForestText10
--- a/scripts/viridiangym.asm
+++ b/scripts/viridiangym.asm
@@ -140,7 +140,7 @@
ld [wJoyIgnore], a
ViridianGymScript3_74995: ; 74995 (1d:4995)
ld a, $c
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd751
set 1, [hl]
@@ -148,7 +148,7 @@
call GiveItem
jr nc, .BagFull
ld a, $d
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wd751
set 0, [hl]
@@ -155,7 +155,7 @@
jr .asm_749be
.BagFull
ld a, $e
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
.asm_749be
ld hl, W_OBTAINEDBADGES
@@ -190,7 +190,7 @@
dw ViridianGymText8
dw ViridianGymText9
dw ViridianGymText10
- dw Predef5CText
+ dw PickUpItemText
dw ViridianGymText12
dw ViridianGymText13
dw ViridianGymText14
--- a/scripts/viridianmart.asm
+++ b/scripts/viridianmart.asm
@@ -28,7 +28,7 @@
ViridianMartScript0: ; 1d49b (7:549b)
call UpdateSprites
ld a, $4
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld hl, wSimulatedJoypadStatesEnd
ld de, RLEMovement1d4bb
@@ -51,7 +51,7 @@
ret nz
call Delay3
ld a, $5
- ld [$ff8c], a
+ ld [hSpriteIndexOrTextID], a
call DisplayTextID
ld bc, (OAKS_PARCEL << 8) + 1
call GiveItem
--- a/text.asm
+++ b/text.asm
@@ -2087,7 +2087,7 @@
ENDC
_Char00Text:: ; 8a696 (22:6696)
- TX_NUM $FF8C,1,2
+ TX_NUM hSpriteIndexOrTextID,1,2
text " ERROR."
done
--- a/wram.asm
+++ b/wram.asm
@@ -634,6 +634,11 @@
ds 1
+wWhichBadge:: ; cd3d
+
+wMuseumPriceTemp:: ; cd3d
+; 3-byte BCD number
+
wTitleMonSpecies:: ; cd3d
wPlayerCharacterOAMTile:: ; cd3d
@@ -1891,58 +1896,98 @@
W_MAPCONN1PTR:: ; d371
ds 1
-wd372:: ds 1 ; some connection stuff, too bothered to label it
-wd373:: ds 1
-wd374:: ds 1
-wd375:: ds 1
-wd376:: ds 1
-wd377:: ds 1
-wd378:: ds 1
-wd379:: ds 1
-wd37a:: ds 1
-wd37b:: ds 1
+wNorthConnectionStripSrc:: ; d372
+ ds 2
+wNorthConnectionStripDest:: ; d374
+ ds 2
+
+wNorthConnectionStripWidth:: ; d376
+ ds 1
+
+wNorthConnectedMapWidth:: ; d377
+ ds 1
+
+wNorthConnectedMapYAlignment:: ; d378
+ ds 1
+
+wNorthConnectedMapXAlignment:: ; d379
+ ds 1
+
+wNorthConnectedMapViewPointer:: ; d37a
+ ds 2
+
W_MAPCONN2PTR:: ; d37c
ds 1
-wd37d:: ds 1
-wd37e:: ds 1
-wd37f:: ds 1
-wd380:: ds 1
-wd381:: ds 1
-wd382:: ds 1
-wd383:: ds 1
-wd384:: ds 1
-wd385:: ds 1
-wd386:: ds 1
+wSouthConnectionStripSrc:: ; d37d
+ ds 2
+wSouthConnectionStripDest:: ; d37f:
+ ds 2
+
+wSouthConnectionStripWidth:: ; d381
+ ds 1
+
+wSouthConnectedMapWidth:: ; d382
+ ds 1
+
+wSouthConnectedMapYAlignment:: ; d383
+ ds 1
+
+wSouthConnectedMapXAlignment:: ; d384
+ ds 1
+
+wSouthConnectedMapViewPointer:: ; d385
+ ds 2
+
W_MAPCONN3PTR:: ; d387
ds 1
-wd388:: ds 1
-wd389:: ds 1
-wd38a:: ds 1
-wd38b:: ds 1
-wd38c:: ds 1
-wd38d:: ds 1
-wd38e:: ds 1
-wd38f:: ds 1
-wd390:: ds 1
-wd391:: ds 1
+wWestConnectionStripSrc:: ; d388
+ ds 2
+wWestConnectionStripDest:: ; d38a
+ ds 2
+
+wWestConnectionStripHeight:: ; d38c
+ ds 1
+
+wWestConnectedMapWidth:: ; d38d
+ ds 1
+
+wWestConnectedMapYAlignment:: ; d38e
+ ds 1
+
+wWestConnectedMapXAlignment:: ; d38f
+ ds 1
+
+wWestConnectedMapViewPointer:: ; d390
+ ds 2
+
W_MAPCONN4PTR:: ; d392
ds 1
-wd393:: ds 1
-wd394:: ds 1
-wd395:: ds 1
-wd396:: ds 1
-wd397:: ds 1
-wd398:: ds 1
-wd399:: ds 1
-wd39a:: ds 1
-wd39b:: ds 1
-wd39c:: ds 1
+wEastConnectionStripSrc:: ; d393
+ ds 2
+
+wEastConnectionStripDest:: ; d395
+ ds 2
+
+wEastConnectionStripHeight:: ; d397
+ ds 1
+
+wEastConnectedMapWidth:: ; d398
+ ds 1
+
+wEastConnectedMapYAlignment:: ; d399
+ ds 1
+
+wEastConnectedMapXAlignment:: ; d39a
+ ds 1
+
+wEastConnectedMapViewPointer:: ; d39b
+ ds 2
W_SPRITESET:: ; d39d
; sprite set for the current map (11 sprite picture ID's)