summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdata/hidden_coins.asm2
-rwxr-xr-xengine/battle/animations.asm2
-rw-r--r--engine/battle/bank3d_battle.asm2
-rwxr-xr-xengine/hall_of_fame.asm2
-rwxr-xr-xengine/menu/league_pc.asm17
-rwxr-xr-xengine/overworld/elevator.asm14
-rwxr-xr-xengine/overworld/hidden_items.asm44
-rw-r--r--home.asm6
-rw-r--r--home/pic.asm12
-rwxr-xr-xmain.asm8
-rwxr-xr-xwram.asm2
11 files changed, 56 insertions, 55 deletions
diff --git a/data/hidden_coins.asm b/data/hidden_coins.asm
index e444bf28..c0dc63b1 100755
--- a/data/hidden_coins.asm
+++ b/data/hidden_coins.asm
@@ -1,4 +1,4 @@
-HiddenCoinCoords: ; 76822 (1d:6822)
+HiddenCoinCoords: ; 7608e (1d:608e)
db GAME_CORNER,$08,$00
db GAME_CORNER,$10,$01
db GAME_CORNER,$0b,$03
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index d07e0b42..52d2ee6e 100755
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -2300,7 +2300,7 @@ ChangeMonPic: ; 798d4 (1e:58d4)
ld [wcf91], a
ld [wd0b5], a
xor a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
call GetMonHeader
coord hl, 12, 0
call LoadFrontSpriteByMonIndex
diff --git a/engine/battle/bank3d_battle.asm b/engine/battle/bank3d_battle.asm
index b9713cec..7f8854a4 100644
--- a/engine/battle/bank3d_battle.asm
+++ b/engine/battle/bank3d_battle.asm
@@ -237,7 +237,7 @@ CopyUncompressedPicToHL: ; f6203 (3d:6203)
ld bc, $707
ld de, $14
push af
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr nz, .asm_f6220
pop af
diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm
index 762850f3..d5c8b2f2 100755
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -20,7 +20,7 @@ AnimateHallOfFame: ; 701c6 (1c:41c6)
xor a
ld [wUpdateSpritesEnabled], a
ld [hTilesetType], a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
ld [wLetterPrintingDelayFlags], a ; no delay
ld [wHoFMonOrPlayer], a ; mon
inc a
diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm
index 5b8ae7f0..21ee30b0 100755
--- a/engine/menu/league_pc.asm
+++ b/engine/menu/league_pc.asm
@@ -1,4 +1,4 @@
-PKMNLeaguePC: ; 0x7657e
+PKMNLeaguePC: ; 75dfe (1d:5dfe)
ld hl, AccessedHoFPCText
call PrintText
ld hl, wd730
@@ -10,7 +10,7 @@ PKMNLeaguePC: ; 0x7657e
push af
xor a
ld [hTilesetType], a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
ld [wUpdateSpritesEnabled], a
ld [wHoFTeamIndex2], a
ld [wHoFTeamNo], a
@@ -50,7 +50,7 @@ PKMNLeaguePC: ; 0x7657e
call RunDefaultPaletteCommand
jp GBPalNormal
-LeaguePCShowTeam: ; 765e5 (1d:65e5)
+LeaguePCShowTeam: ; 75e65 (1d:5e65)
ld c, PARTY_LENGTH
.loop
push bc
@@ -77,7 +77,7 @@ LeaguePCShowTeam: ; 765e5 (1d:65e5)
scf
ret
-LeaguePCShowMon: ; 76610 (1d:6610)
+LeaguePCShowMon: ; 75e90 (1d:5e90)
call GBPalWhiteOutWithDelay3
call ClearScreen
ld hl, wHallOfFame
@@ -100,8 +100,7 @@ LeaguePCShowMon: ; 76610 (1d:6610)
call LoadFrontSpriteByMonIndex
call GBPalNormal
coord hl, 0, 13
- ld b, 2
- ld c, $12
+ lb bc, 2, 18
call TextBoxBorder
coord hl, 1, 15
ld de, HallOfFameNoText
@@ -110,11 +109,11 @@ LeaguePCShowMon: ; 76610 (1d:6610)
ld de, wHoFTeamNo
lb bc, 1, 3
call PrintNumber
- jpba HoFDisplayMonInfo
+ jpba Func_7033f
-HallOfFameNoText: ; 76670 (1d:6670)
+HallOfFameNoText: ; 75eef (1d:5eef)
db "HALL OF FAME No @"
-AccessedHoFPCText: ; 76683 (1d:6683)
+AccessedHoFPCText: ; 75f02 (1d:5f02)
TX_FAR _AccessedHoFPCText
db "@"
diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm
index 05a9cc4e..b355102f 100755
--- a/engine/overworld/elevator.asm
+++ b/engine/overworld/elevator.asm
@@ -1,11 +1,10 @@
-ShakeElevator: ; 7bf15 (1e:7f15)
+ShakeElevator: ; 75f07 (1d:5f07)
ld de, -$20
call ShakeElevatorRedrawRow
ld de, SCREEN_HEIGHT * $20
call ShakeElevatorRedrawRow
call Delay3
- ld a, $ff
- call PlaySound
+ call StopAllMusic
ld a, [hSCY]
ld d, a
ld e, $1
@@ -27,19 +26,18 @@ ShakeElevator: ; 7bf15 (1e:7f15)
jr nz, .shakeLoop
ld a, d
ld [hSCY], a
- ld a, $ff
- call PlaySound
+ call StopAllMusic
ld c, BANK(SFX_Safari_Zone_PA)
ld a, SFX_SAFARI_ZONE_PA
call PlayMusic
.musicLoop
ld a, [wChannelSoundIDs + CH4]
- cp $b9
+ cp SFX_SAFARI_ZONE_PA
jr z, .musicLoop
call UpdateSprites
jp PlayDefaultMusic
-ShakeElevatorRedrawRow: ; 7bf64 (1e:7f64)
+ShakeElevatorRedrawRow: ; 75f52 (1d:5f52)
; This function is used to redraw certain portions of the screen, but it does
; not appear to ever result in any visible effect, so this function seems to
; be pointless.
@@ -56,7 +54,7 @@ ShakeElevatorRedrawRow: ; 7bf64 (1e:7f64)
add hl, de
ld a, h
and $3
- or $98
+ or vBGMap0 / $100
ld d, a
ld a, l
pop hl
diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm
index 39bb385d..43a56658 100755
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -1,4 +1,4 @@
-HiddenItems: ; 76688 (1d:6688)
+HiddenItems: ; 75f74 (1d:5f74)
ld hl, HiddenItemCoords
call FindHiddenItemOrCoinsIndex
ld [wHiddenItemOrCoinsIndex], a
@@ -9,7 +9,7 @@ HiddenItems: ; 76688 (1d:6688)
predef FlagActionPredef
ld a, c
and a
- jr nz, .asm_75fa5
+ jr nz, .itemAlreadyFound
call EnableAutoTextBoxDrawing
ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
@@ -18,21 +18,21 @@ HiddenItems: ; 76688 (1d:6688)
call GetItemName
tx_pre_jump FoundHiddenItemText
-.asm_75fa5
+.itemAlreadyFound
ld a, $ff
ld [hItemAlreadyFound], a
ret
INCLUDE "data/hidden_item_coords.asm"
-FoundHiddenItemText: ; 7675b (1d:675b)
+FoundHiddenItemText: ; 76050 (1d:6050)
TX_FAR _FoundHiddenItemText
TX_ASM
ld a, [wHiddenObjectFunctionArgument] ; item ID
ld b, a
ld c, 1
call GiveItem
- jr nc, .BagFull
+ jr nc, .bagFull
ld hl, wObtainedHiddenItemsFlags
ld a, [wHiddenItemOrCoinsIndex]
ld c, a
@@ -42,7 +42,7 @@ FoundHiddenItemText: ; 7675b (1d:675b)
call PlaySoundWaitForCurrent
call WaitForSoundToFinish
jp TextScriptEnd
-.BagFull
+.bagFull
call WaitForTextScrollButtonPress ; wait for button press
xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
@@ -50,16 +50,16 @@ FoundHiddenItemText: ; 7675b (1d:675b)
call PrintText
jp TextScriptEnd
-HiddenItemBagFullText: ; 76794 (1d:6794)
+HiddenItemBagFullText: ; 76089 (1d:6089)
TX_FAR _HiddenItemBagFullText
db "@"
-HiddenCoins: ; 76799 (1d:6799)
+HiddenCoins: ; 7608e (1d:608e)
ld b, COIN_CASE
predef GetQuantityOfItemInBag
ld a, b
and a
- jr z, .asm_760ce
+ jr z, .doNotPickUpCoins
ld hl, HiddenCoinCoords
call FindHiddenItemOrCoinsIndex
ld [wHiddenItemOrCoinsIndex], a
@@ -70,7 +70,7 @@ HiddenCoins: ; 76799 (1d:6799)
predef FlagActionPredef
ld a, c
and a
- jr nz, .asm_760ce
+ jr nz, .doNotPickUpCoins
xor a
ld [hUnusedCoinsByte], a
ld [hCoins], a
@@ -82,10 +82,10 @@ HiddenCoins: ; 76799 (1d:6799)
cp 20
jr z, .bcd20
cp 40
- jr z, .bcd20
+ jr z, .bcd20 ; should be bcd40
jr .bcd100
-.asm_760ce
+.doNotPickUpCoins
ld a, $ff
ld [hItemAlreadyFound], a
ret
@@ -93,19 +93,19 @@ HiddenCoins: ; 76799 (1d:6799)
.bcd10
ld a, $10
ld [hCoins + 1], a
- jr .bcddone
+ jr .bcdDone
.bcd20
ld a, $20
ld [hCoins + 1], a
- jr .bcddone
+ jr .bcdDone
.bcd40 ; due to a typo, this is never used
ld a, $40
ld [hCoins + 1], a
- jr .bcddone
+ jr .bcdDone
.bcd100
ld a, $1
ld [hCoins], a
-.bcddone
+.bcdDone
ld de, wPlayerCoins + 1
ld hl, hCoins + 1
ld c, $2
@@ -118,30 +118,30 @@ HiddenCoins: ; 76799 (1d:6799)
call EnableAutoTextBoxDrawing
ld a, [wPlayerCoins]
cp $99
- jr nz, .RoomInCoinCase
+ jr nz, .roomInCoinCase
ld a, [wPlayerCoins + 1]
cp $99
- jr nz, .RoomInCoinCase
+ jr nz, .roomInCoinCase
tx_pre_id DroppedHiddenCoinsText
jr .done
-.RoomInCoinCase
+.roomInCoinCase
tx_pre_id FoundHiddenCoinsText
.done
jp PrintPredefTextID
INCLUDE "data/hidden_coins.asm"
-FoundHiddenCoinsText: ; 76847 (1d:6847)
+FoundHiddenCoinsText: ; 76143 (1d:6143)
TX_FAR _FoundHiddenCoinsText
db $10,"@"
-DroppedHiddenCoinsText: ; 7684d (1d:684d)
+DroppedHiddenCoinsText: ; 76149 (1d:6149)
TX_FAR _FoundHiddenCoins2Text
db $10
TX_FAR _DroppedHiddenCoinsText
db "@"
-FindHiddenItemOrCoinsIndex: ; 76857 (1d:6857)
+FindHiddenItemOrCoinsIndex: ; 76153 (1d:6153)
ld a, [wHiddenObjectY]
ld d, a
ld a, [wHiddenObjectX]
diff --git a/home.asm b/home.asm
index 6fb3e08b..9f62d820 100644
--- a/home.asm
+++ b/home.asm
@@ -316,7 +316,7 @@ OverwritewMoves:: ; 113a (0:113a)
LoadFlippedFrontSpriteByMonIndex:: ; 1144 (0:1144)
ld a, 1
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
LoadFrontSpriteByMonIndex:: ; 1149 (0:1149)
push hl
@@ -350,7 +350,7 @@ LoadFrontSpriteByMonIndex:: ; 1149 (0:1149)
ld [hStartTileID], a
call CopyUncompressedPicToHL
xor a
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
pop af
jp BankswitchCommon
@@ -949,7 +949,7 @@ InterlaceMergeSpriteBuffers:: ; 14c7 (0:14c7)
dec a
ld [H_SPRITEINTERLACECOUNTER], a
jr nz, .interlaceLoop
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped
ld bc, 2*SPRITEBUFFERSIZE
diff --git a/home/pic.asm b/home/pic.asm
index 96cd6cd1..25a2ceb5 100644
--- a/home/pic.asm
+++ b/home/pic.asm
@@ -299,7 +299,7 @@ SpriteDifferentialDecode:: ; 25ca (0:25ca)
ld [W_SPRITECURPOSX], a
ld [W_SPRITECURPOSY], a
call StoreSpriteOutputPointer
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped
ld hl, DecodeNybble0TableFlipped
@@ -386,7 +386,7 @@ DifferentialDecodeNybble:: ; 2663 (0:2663)
ld c, $1
.evenNumber
ld l, a
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped ; determine if initial value is 0 or one
bit 3, e ; if flipped, consider MSB of last data
@@ -479,7 +479,7 @@ XorSpriteChunks:: ; 26bd (0:26bd)
ld a, [W_SPRITEOUTPUTPTRCACHED+1]
ld d, a
.xorChunksLoop
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
and a
jr z, .notFlipped
push de
@@ -563,10 +563,10 @@ NybbleReverseTable:: ; 275d (0:275d)
; combines the two loaded chunks with xor (the chunk loaded second is the destination). Both chunks are differeintial decoded beforehand.
UnpackSpriteMode2:: ; 276d (0:276d)
call ResetSpriteBufferPointers
- ld a, [W_SPRITEFLIPPED]
+ ld a, [wSpriteFlipped]
push af
xor a
- ld [W_SPRITEFLIPPED], a ; temporarily clear flipped flag for decoding the destination chunk
+ ld [wSpriteFlipped], a ; temporarily clear flipped flag for decoding the destination chunk
ld a, [W_SPRITEOUTPUTPTRCACHED]
ld l, a
ld a, [W_SPRITEOUTPUTPTRCACHED+1]
@@ -574,7 +574,7 @@ UnpackSpriteMode2:: ; 276d (0:276d)
call SpriteDifferentialDecode
call ResetSpriteBufferPointers
pop af
- ld [W_SPRITEFLIPPED], a
+ ld [wSpriteFlipped], a
jp XorSpriteChunks
; stores hl into the output pointers
diff --git a/main.asm b/main.asm
index 22f3b315..77143ea6 100755
--- a/main.asm
+++ b/main.asm
@@ -1359,10 +1359,14 @@ INCLUDE "scripts/pewtermart.asm"
INCLUDE "data/mapObjects/pewtermart.asm"
dr $7453d,$74726
+
INCLUDE "engine/menu/vending_machine.asm"
+
dr $74851,$75dfe
-PKMNLeaguePC: ; 75dfe (1d:5dfe)
- dr $75dfe,$75f74
+
+INCLUDE "engine/menu/league_pc.asm"
+
+INCLUDE "engine/overworld/elevator.asm"
INCLUDE "engine/overworld/hidden_items.asm"
diff --git a/wram.asm b/wram.asm
index 610574da..593f7c09 100755
--- a/wram.asm
+++ b/wram.asm
@@ -1967,7 +1967,7 @@ W_SPRITELOADFLAGS:: ; d0a8
ds 1
W_SPRITEUNPACKMODE:: ; d0a9
ds 1
-W_SPRITEFLIPPED:: ; d0aa
+wSpriteFlipped:: ; d0aa
ds 1
W_SPRITEINPUTPTR:: ; d0ab