More WRAM cleanup

This commit is contained in:
Remy Oukaour 2017-12-09 19:41:03 -05:00
parent 880fb511e1
commit cd2a748128
34 changed files with 1043 additions and 1024 deletions

View File

@ -57,7 +57,7 @@ _PlayBattleAnim: ; cc0e4
BattleAnimRunScript: ; cc11c BattleAnimRunScript: ; cc11c
ld a, [FXAnimIDHi] ld a, [FXAnimID + 1]
and a and a
jr nz, .hi_byte jr nz, .hi_byte
@ -86,9 +86,9 @@ BattleAnimRunScript: ; cc11c
ld de, ANIM_MISS ld de, ANIM_MISS
add hl, de add hl, de
ld a, l ld a, l
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, h ld a, h
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
.hi_byte .hi_byte
call WaitSFX call WaitSFX
@ -112,11 +112,11 @@ RunBattleAnimScript: ; cc163
call BattleAnimRequestPals call BattleAnimRequestPals
; Speed up Rollout's animation. ; Speed up Rollout's animation.
ld a, [FXAnimIDHi] ld a, [FXAnimID + 1]
or a or a
jr nz, .not_rollout jr nz, .not_rollout
ld a, [FXAnimIDLo] ld a, [FXAnimID]
cp ROLLOUT cp ROLLOUT
jr nz, .not_rollout jr nz, .not_rollout
@ -1393,7 +1393,7 @@ ClearBattleAnims: ; cc8d3
or b or b
jr nz, .loop jr nz, .loop
ld hl, FXAnimIDLo ld hl, FXAnimID
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]

View File

@ -1538,10 +1538,10 @@ Tackle_BGEffect25_2d_two:
Functionc88a5: ; c88a5 (32:48a5) Functionc88a5: ; c88a5 (32:48a5)
push af push af
ld a, [FXAnimIDHi] ; FXAnimIDHi ld a, [FXAnimID + 1] ; FXAnimID + 1
or a or a
jr nz, .not_rollout jr nz, .not_rollout
ld a, [FXAnimIDLo] ; FXAnimID ld a, [FXAnimID] ; FXAnimID
cp ROLLOUT cp ROLLOUT
jr z, .rollout jr z, .rollout
.not_rollout .not_rollout

View File

@ -633,7 +633,7 @@ ParsePlayerAction: ; 3c434
xor a xor a
ld [wMoveSelectionMenuType], a ld [wMoveSelectionMenuType], a
inc a ; POUND inc a ; POUND
ld [FXAnimIDLo], a ld [FXAnimID], a
call MoveSelectionScreen call MoveSelectionScreen
push af push af
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
@ -1305,7 +1305,7 @@ HandleWrap: ; 3c874
ld a, [de] ld a, [de]
ld [wd265], a ld [wd265], a
ld [FXAnimIDLo], a ld [FXAnimID], a
call GetMoveName call GetMoveName
dec [hl] dec [hl]
jr z, .release_from_bounds jr z, .release_from_bounds
@ -1318,7 +1318,7 @@ HandleWrap: ; 3c874
call SwitchTurnCore call SwitchTurnCore
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
predef PlayBattleAnim predef PlayBattleAnim
call SwitchTurnCore call SwitchTurnCore
@ -4213,7 +4213,7 @@ SendOutPlayerMon: ; 3db5f
call GetMonBackpic call GetMonBackpic
xor a xor a
ld [hGraphicStartTile], a ld [hGraphicStartTile], a
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
ld [CurMoveNum], a ld [CurMoveNum], a
ld [TypeModifier], a ld [TypeModifier], a
ld [wPlayerMoveStruct + MOVE_ANIM], a ld [wPlayerMoveStruct + MOVE_ANIM], a
@ -4551,11 +4551,11 @@ ItemRecoveryAnim: ; 3ddc8
push bc push bc
call EmptyBattleTextBox call EmptyBattleTextBox
ld a, RECOVER ld a, RECOVER
ld [FXAnimIDLo], a ld [FXAnimID], a
call SwitchTurnCore call SwitchTurnCore
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
predef PlayBattleAnim predef PlayBattleAnim
call SwitchTurnCore call SwitchTurnCore
pop bc pop bc
@ -5130,7 +5130,7 @@ BattleMenu: ; 3e139
.next .next
ld a, $1 ld a, $1
ld [hBGMapMode], a ld [hBGMapMode], a
ld a, [wd0d2] ld a, [wBattleMenuCursorBuffer]
cp $1 cp $1
jp z, BattleMenu_Fight jp z, BattleMenu_Fight
cp $3 cp $3
@ -6415,7 +6415,7 @@ LoadEnemyMon: ; 3e8eb
callab CalcMagikarpLength callab CalcMagikarpLength
; We're clear if the length is < 1536 ; We're clear if the length is < 1536
ld a, [MagikarpLength] ld a, [wMagikarpLength]
cp a, $06 ; $600 = 1536 cp a, $06 ; $600 = 1536
jr nz, .CheckMagikarpArea jr nz, .CheckMagikarpArea
@ -6424,7 +6424,7 @@ LoadEnemyMon: ; 3e8eb
cp a, $0c ; / $100 cp a, $0c ; / $100
jr c, .CheckMagikarpArea jr c, .CheckMagikarpArea
; Try again if > 1614 ; Try again if > 1614
ld a, [MagikarpLength + 1] ld a, [wMagikarpLength + 1]
cp a, $50 cp a, $50
jr nc, .GenerateDVs jr nc, .GenerateDVs
@ -6433,7 +6433,7 @@ LoadEnemyMon: ; 3e8eb
cp a, $32 ; / $100 cp a, $32 ; / $100
jr c, .CheckMagikarpArea jr c, .CheckMagikarpArea
; Try again if > 1598 ; Try again if > 1598
ld a, [MagikarpLength + 1] ld a, [wMagikarpLength + 1]
cp a, $40 cp a, $40
jr nc, .GenerateDVs jr nc, .GenerateDVs
@ -6458,7 +6458,7 @@ LoadEnemyMon: ; 3e8eb
cp a, $64 ; / $100 cp a, $64 ; / $100
jr c, .Happiness jr c, .Happiness
; Floor at length 1024 ; Floor at length 1024
ld a, [MagikarpLength] ld a, [wMagikarpLength]
cp a, 1024 >> 8 cp a, 1024 >> 8
jr c, .GenerateDVs ; try again jr c, .GenerateDVs ; try again
@ -6588,7 +6588,7 @@ LoadEnemyMon: ; 3e8eb
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
; Make sure the predef knows this isn't a partymon ; Make sure the predef knows this isn't a partymon
ld [MagikarpLength], a ld [wEvolutionOldSpecies], a
; Fill moves based on level ; Fill moves based on level
predef FillMoves predef FillMoves
@ -7285,9 +7285,9 @@ Call_PlayBattleAnim_OnlyIfVisible: ; 3ee0f
Call_PlayBattleAnim: ; 3ee17 Call_PlayBattleAnim: ; 3ee17
ld a, e ld a, e
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, d ld a, d
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
call WaitBGMap call WaitBGMap
predef_jump PlayBattleAnim predef_jump PlayBattleAnim
; 3ee27 ; 3ee27
@ -8405,7 +8405,7 @@ BattleIntro: ; 3f4dd
call LoadTrainerOrWildMonPic call LoadTrainerOrWildMonPic
xor a xor a
ld [TempBattleMonSpecies], a ld [TempBattleMonSpecies], a
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
xor a xor a
ld [hMapAnims], a ld [hMapAnims], a
callba PlayBattleMusic callba PlayBattleMusic
@ -8670,7 +8670,7 @@ CleanUpBattleRAM: ; 3f6d0
ld [wPartyMenuCursor], a ld [wPartyMenuCursor], a
ld [wKeyItemsPocketCursor], a ld [wKeyItemsPocketCursor], a
ld [wItemsPocketCursor], a ld [wItemsPocketCursor], a
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
ld [CurMoveNum], a ld [CurMoveNum], a
ld [wBallsPocketCursor], a ld [wBallsPocketCursor], a
ld [wLastPocket], a ld [wLastPocket], a

View File

@ -2103,7 +2103,7 @@ BattleCommand_LowerSub: ; 34eee
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
inc a inc a
ld [wKickCounter], a ld [wKickCounter], a
ld a, SUBSTITUTE ld a, SUBSTITUTE
@ -2280,7 +2280,7 @@ BattleCommand_RaiseSub: ; 35004
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld a, $2 ld a, $2
ld [wKickCounter], a ld [wKickCounter], a
ld a, SUBSTITUTE ld a, SUBSTITUTE
@ -2645,7 +2645,7 @@ BattleCommand_CheckDestinyBond: ; 351c0
call BattleCommand_SwitchTurn call BattleCommand_SwitchTurn
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
inc a inc a
ld [wKickCounter], a ld [wKickCounter], a
ld a, DESTINY_BOND ld a, DESTINY_BOND
@ -4738,9 +4738,9 @@ FarPlayBattleAnimation: ; 35d00
PlayFXAnimID: ; 35d08 PlayFXAnimID: ; 35d08
ld a, e ld a, e
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, d ld a, d
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld c, 3 ld c, 3
call DelayFrames call DelayFrames
@ -7882,7 +7882,7 @@ BattleCommand_Substitute: ; 36e7c
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld [wKickCounter], a ld [wKickCounter], a
ld a, SUBSTITUTE ld a, SUBSTITUTE
call LoadAnim call LoadAnim
@ -9862,14 +9862,14 @@ AnimateCurrentMove: ; 37e01
PlayDamageAnim: ; 37e19 PlayDamageAnim: ; 37e19
xor a xor a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld a, BATTLE_VARS_MOVE_ANIM ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar call GetBattleVar
and a and a
ret z ret z
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@ -9888,7 +9888,7 @@ PlayDamageAnim: ; 37e19
LoadMoveAnim: ; 37e36 LoadMoveAnim: ; 37e36
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld a, BATTLE_VARS_MOVE_ANIM ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar call GetBattleVar
@ -9901,7 +9901,7 @@ LoadMoveAnim: ; 37e36
LoadAnim: ; 37e44 LoadAnim: ; 37e44
ld [FXAnimIDLo], a ld [FXAnimID], a
; fallthrough ; fallthrough
; 37e47 ; 37e47
@ -9922,9 +9922,9 @@ PlayUserBattleAnim: ; 37e47
PlayOpponentBattleAnim: ; 37e54 PlayOpponentBattleAnim: ; 37e54
ld a, e ld a, e
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, d ld a, d
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
xor a xor a
ld [wNumHits], a ld [wNumHits], a

View File

@ -11,7 +11,7 @@ BattleCommand_Transform: ; 371cd
jp nz, BattleEffect_ButItFailed jp nz, BattleEffect_ButItFailed
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld a, $1 ld a, $1
ld [wKickCounter], a ld [wKickCounter], a
ld a, BATTLE_VARS_SUBSTATUS4 ld a, BATTLE_VARS_SUBSTATUS4
@ -129,7 +129,7 @@ BattleCommand_Transform: ; 371cd
.after_anim .after_anim
xor a xor a
ld [wNumHits], a ld [wNumHits], a
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
ld a, $2 ld a, $2
ld [wKickCounter], a ld [wKickCounter], a
pop af pop af

View File

@ -1,5 +1,5 @@
CalcMagikarpLength: ; fbbfc CalcMagikarpLength: ; fbbfc
; Return Magikarp's length (in mm) at MagikarpLength (big endian). ; Return Magikarp's length (in mm) at wMagikarpLength (big endian).
; ;
; input: ; input:
; de: EnemyMonDVs ; de: EnemyMonDVs
@ -16,9 +16,9 @@ CalcMagikarpLength: ; fbbfc
; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id) ; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id)
; if bc < 10: [MagikarpLength] = c + 190 ; if bc < 10: [wMagikarpLength] = c + 190
; if bc >= $ff00: [MagikarpLength] = c + 1370 ; if bc >= $ff00: [wMagikarpLength] = c + 1370
; else: [MagikarpLength] = z * 100 + (bc - x) / y ; else: [wMagikarpLength] = z * 100 + (bc - x) / y
; X, Y, and Z depend on the value of b as follows: ; X, Y, and Z depend on the value of b as follows:
@ -165,7 +165,7 @@ CalcMagikarpLength: ; fbbfc
.ok .ok
ld e, a ld e, a
ld hl, MagikarpLength ld hl, wMagikarpLength
ld [hl], d ld [hl], d
inc hl inc hl
ld [hl], e ld [hl], e

View File

@ -1,11 +1,11 @@
LoadBattleMenu: ; 24ef2 LoadBattleMenu: ; 24ef2
ld hl, BattleMenuDataHeader ld hl, BattleMenuDataHeader
call LoadMenuDataHeader call LoadMenuDataHeader
ld a, [wd0d2] ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
call InterpretBattleMenu call InterpretBattleMenu
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
call ExitMenu call ExitMenu
ret ret
; 24f0b ; 24f0b
@ -23,11 +23,11 @@ ContestBattleMenu: ; 24f13
; 24f19 ; 24f19
Function24f19: ; 24f19 Function24f19: ; 24f19
ld a, [wd0d2] ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
call _2DMenu call _2DMenu
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
call ExitMenu call ExitMenu
ret ret
; 24f2c ; 24f2c

View File

@ -249,10 +249,10 @@ InitBattleAnimBuffer: ; ccaaa
.check_kinesis_softboiled_milkdrink .check_kinesis_softboiled_milkdrink
sub d sub d
push af push af
ld a, [FXAnimIDHi] ld a, [FXAnimID + 1]
or a or a
jr nz, .no_sub jr nz, .no_sub
ld a, [FXAnimIDLo] ld a, [FXAnimID]
cp KINESIS cp KINESIS
jr z, .kinesis jr z, .kinesis
cp SOFTBOILED cp SOFTBOILED

View File

@ -342,3 +342,6 @@ NUM_MONMENU_ITEMS EQU 8
; maximum number of party pokemon ; maximum number of party pokemon
PARTY_LENGTH EQU 6 PARTY_LENGTH EQU 6
; number of Unown forms
NUM_UNOWN EQU 26

View File

@ -66,7 +66,7 @@ RestartClock: ; 20021 (8:4021)
.SetClock: ; 20051 (8:4051) .SetClock: ; 20051 (8:4051)
ld a, 1 ld a, 1
ld [Buffer1], a ; which digit ld [Buffer1], a ; which digit
ld [Buffer2], a ; wd1eb (aliases: MovementType) ld [Buffer2], a
ld a, 8 ld a, 8
ld [Buffer3], a ld [Buffer3], a
call UpdateTime call UpdateTime
@ -151,7 +151,7 @@ RestartClock: ; 20021 (8:4021)
ret ret
.pressed_up .pressed_up
ld a, [Buffer1] ; wd1ea (aliases: MagikarpLength) ld a, [Buffer1]
call ResetClock_GetWraparoundTime call ResetClock_GetWraparoundTime
ld a, [de] ld a, [de]
inc a inc a
@ -163,7 +163,7 @@ RestartClock: ; 20021 (8:4021)
jr .done_scroll jr .done_scroll
.pressed_down .pressed_down
ld a, [Buffer1] ; wd1ea (aliases: MagikarpLength) ld a, [Buffer1]
call ResetClock_GetWraparoundTime call ResetClock_GetWraparoundTime
ld a, [de] ld a, [de]
dec a dec a
@ -176,14 +176,14 @@ RestartClock: ; 20021 (8:4021)
jr .done_scroll jr .done_scroll
.pressed_left .pressed_left
ld hl, Buffer1 ; wd1ea (aliases: MagikarpLength) ld hl, Buffer1
dec [hl] dec [hl]
jr nz, .done_scroll jr nz, .done_scroll
ld [hl], $3 ld [hl], $3
jr .done_scroll jr .done_scroll
.pressed_right .pressed_right
ld hl, Buffer1 ; wd1ea (aliases: MagikarpLength) ld hl, Buffer1
inc [hl] inc [hl]
ld a, [hl] ld a, [hl]
cp $4 cp $4
@ -209,14 +209,14 @@ RestartClock: ; 20021 (8:4021)
ld c, a ld c, a
decoord 11, 8 decoord 11, 8
callba PrintHoursMins callba PrintHoursMins
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
lb de, " ", " " lb de, " ", " "
call .PlaceChars call .PlaceChars
ld a, [Buffer1] ; wd1ea (aliases: MagikarpLength) ld a, [Buffer1]
lb de, "▲", "▼" lb de, "▲", "▼"
call .PlaceChars call .PlaceChars
ld a, [Buffer1] ; wd1ea (aliases: MagikarpLength) ld a, [Buffer1]
ld [Buffer2], a ; wd1eb (aliases: MovementType) ld [Buffer2], a
ret ret
; 20160 (8:4160) ; 20160 (8:4160)

View File

@ -196,7 +196,7 @@ Credits:: ; 109847
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld [CreditsPos], a ld [CreditsPos], a
ld [wcd21], a ld [CreditsUnusedCD21], a
ld [CreditsTimer], a ld [CreditsTimer], a
.execution_loop .execution_loop

View File

@ -908,16 +908,16 @@ DecoAction_putawayornament: ; 26dc9
DecoAction_FinishUp_Ornament: ; 26dd6 DecoAction_FinishUp_Ornament: ; 26dd6
call QueryWhichSide call QueryWhichSide
ld a, [wd1ec] ld a, [wSelectedDecoration]
ld [hl], a ld [hl], a
ld a, [wd1ed] ld a, [wOtherDecoration]
ld [de], a ld [de], a
xor a xor a
ret ret
; 26de3 ; 26de3
DecoAction_SetItUp_Ornament: ; 26de3 DecoAction_SetItUp_Ornament: ; 26de3
ld a, [wd1ec] ld a, [wSelectedDecoration]
and a and a
jr z, .nothingthere jr z, .nothingthere
ld b, a ld b, a
@ -931,7 +931,7 @@ DecoAction_SetItUp_Ornament: ; 26de3
ld hl, StringBuffer4 ld hl, StringBuffer4
call GetDecorationName call GetDecorationName
ld a, [MenuSelection] ld a, [MenuSelection]
ld [wd1ec], a ld [wSelectedDecoration], a
call .getwhichside call .getwhichside
ld hl, DecoText_PutAwayAndSetUp ld hl, DecoText_PutAwayAndSetUp
call MenuTextBoxBackup call MenuTextBoxBackup
@ -940,7 +940,7 @@ DecoAction_SetItUp_Ornament: ; 26de3
.nothingthere .nothingthere
ld a, [MenuSelection] ld a, [MenuSelection]
ld [wd1ec], a ld [wSelectedDecoration], a
call .getwhichside call .getwhichside
ld a, [MenuSelection] ld a, [MenuSelection]
ld hl, StringBuffer3 ld hl, StringBuffer3
@ -960,11 +960,11 @@ DecoAction_SetItUp_Ornament: ; 26de3
.getwhichside ; 26e33 .getwhichside ; 26e33
ld a, [MenuSelection] ld a, [MenuSelection]
ld b, a ld b, a
ld a, [wd1ed] ld a, [wOtherDecoration]
cp b cp b
ret nz ret nz
xor a xor a
ld [wd1ed], a ld [wOtherDecoration], a
ret ret
; 26e41 ; 26e41
@ -975,7 +975,7 @@ UnknownText_0x26e41: ; 0x26e41
; 0x26e46 ; 0x26e46
DecoAction_PutItAway_Ornament: ; 26e46 DecoAction_PutItAway_Ornament: ; 26e46
ld a, [wd1ec] ld a, [wSelectedDecoration]
and a and a
jr z, .nothingthere jr z, .nothingthere
ld hl, StringBuffer3 ld hl, StringBuffer3
@ -983,7 +983,7 @@ DecoAction_PutItAway_Ornament: ; 26e46
ld a, $1 ld a, $1
ld [Buffer5], a ld [Buffer5], a
xor a xor a
ld [wd1ec], a ld [wSelectedDecoration], a
ld hl, DecoText_PutAwayTheDeco ld hl, DecoText_PutAwayTheDeco
call MenuTextBoxBackup call MenuTextBoxBackup
xor a xor a
@ -1015,9 +1015,9 @@ DecoAction_AskWhichSide: ; 26e70
ld [Buffer2], a ld [Buffer2], a
call QueryWhichSide call QueryWhichSide
ld a, [hl] ld a, [hl]
ld [wd1ec], a ld [wSelectedDecoration], a
ld a, [de] ld a, [de]
ld [wd1ed], a ld [wOtherDecoration], a
xor a xor a
ret ret

View File

@ -390,7 +390,7 @@ Gen2ToGen2LinkComms: ; 28177
ld [de], a ld [de], a
.skip_mail .skip_mail
ld hl, wLinkData ld hl, wLinkPlayerName
ld de, OTPlayerName ld de, OTPlayerName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes

View File

@ -370,9 +370,9 @@ BuyMenu: ; 15c62
call FadeToMenu call FadeToMenu
callba BlankScreen callba BlankScreen
xor a xor a
ld [wd045 + 1], a ld [wMenuScrollPositionBackup], a
ld a, 1 ld a, 1
ld [wd045], a ld [wMenuCursorBufferBackup], a
.loop .loop
call BuyMenuLoop ; menu loop call BuyMenuLoop ; menu loop
jr nc, .loop jr nc, .loop
@ -471,15 +471,15 @@ BuyMenuLoop: ; 15cef
call UpdateSprites call UpdateSprites
ld hl, MenuDataHeader_Buy ld hl, MenuDataHeader_Buy
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wd045] ld a, [wMenuCursorBufferBackup]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd045 + 1] ld a, [wMenuScrollPositionBackup]
ld [wMenuScrollPosition], a ld [wMenuScrollPosition], a
call ScrollingMenu call ScrollingMenu
ld a, [wMenuScrollPosition] ld a, [wMenuScrollPosition]
ld [wd045 + 1], a ld [wMenuScrollPositionBackup], a
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
ld [wd045], a ld [wMenuCursorBufferBackup], a
call SpeechTextBox call SpeechTextBox
ld a, [wMenuJoypad] ld a, [wMenuJoypad]
cp B_BUTTON cp B_BUTTON

View File

@ -9,7 +9,7 @@ PrepMysteryGiftDataToSend: ; 2c642 (b:4642)
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
ld b, a ld b, a
inc de inc de ; wc802
ld a, [hl] ld a, [hl]
ld [de], a ld [de], a
ld c, a ld c, a

View File

@ -1619,8 +1619,8 @@ RadioChannels:
LoadStation_OaksPokemonTalk: ; 91753 (24:5753) LoadStation_OaksPokemonTalk: ; 91753 (24:5753)
xor a ; OAKS_POKEMON_TALK xor a ; OAKS_POKEMON_TALK
ld [wd002], a ld [wCurrentRadioLine], a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1629,9 +1629,9 @@ LoadStation_OaksPokemonTalk: ; 91753 (24:5753)
LoadStation_PokedexShow: ; 91766 (24:5766) LoadStation_PokedexShow: ; 91766 (24:5766)
ld a, POKEDEX_SHOW ld a, POKEDEX_SHOW
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1640,9 +1640,9 @@ LoadStation_PokedexShow: ; 91766 (24:5766)
LoadStation_PokemonMusic: ; 9177b (24:577b) LoadStation_PokemonMusic: ; 9177b (24:577b)
ld a, POKEMON_MUSIC ld a, POKEMON_MUSIC
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1651,9 +1651,9 @@ LoadStation_PokemonMusic: ; 9177b (24:577b)
LoadStation_LuckyChannel: ; 91790 (24:5790) LoadStation_LuckyChannel: ; 91790 (24:5790)
ld a, LUCKY_CHANNEL ld a, LUCKY_CHANNEL
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1662,9 +1662,9 @@ LoadStation_LuckyChannel: ; 91790 (24:5790)
LoadStation_BuenasPassword: ; 917a5 (24:57a5) LoadStation_BuenasPassword: ; 917a5 (24:57a5)
ld a, BUENAS_PASSWORD ld a, BUENAS_PASSWORD
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1682,9 +1682,9 @@ NotBuenasPasswordName: db "@"
LoadStation_UnownRadio: ; 917d5 (24:57d5) LoadStation_UnownRadio: ; 917d5 (24:57d5)
ld a, UNOWN_RADIO ld a, UNOWN_RADIO
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1693,9 +1693,9 @@ LoadStation_UnownRadio: ; 917d5 (24:57d5)
LoadStation_PlacesAndPeople: ; 917ea (24:57ea) LoadStation_PlacesAndPeople: ; 917ea (24:57ea)
ld a, PLACES_AND_PEOPLE ld a, PLACES_AND_PEOPLE
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1704,9 +1704,9 @@ LoadStation_PlacesAndPeople: ; 917ea (24:57ea)
LoadStation_LetsAllSing: ; 917ff (24:57ff) LoadStation_LetsAllSing: ; 917ff (24:57ff)
ld a, LETS_ALL_SING ld a, LETS_ALL_SING
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1717,9 +1717,9 @@ LoadStation_LetsAllSing: ; 917ff (24:57ff)
LoadStation_RocketRadio: ; 91814 LoadStation_RocketRadio: ; 91814
ld a, ROCKET_RADIO ld a, ROCKET_RADIO
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1730,9 +1730,9 @@ LoadStation_RocketRadio: ; 91814
LoadStation_PokeFluteRadio: ; 91829 (24:5829) LoadStation_PokeFluteRadio: ; 91829 (24:5829)
ld a, POKE_FLUTE_RADIO ld a, POKE_FLUTE_RADIO
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1741,9 +1741,9 @@ LoadStation_PokeFluteRadio: ; 91829 (24:5829)
LoadStation_EvolutionRadio: ; 9183e (24:583e) LoadStation_EvolutionRadio: ; 9183e (24:583e)
ld a, EVOLUTION_RADIO ld a, EVOLUTION_RADIO
ld [wd002], a ld [wCurrentRadioLine], a
xor a xor a
ld [wd005], a ld [wNumRadioLinesPrinted], a
ld a, BANK(PlayRadioShow) ld a, BANK(PlayRadioShow)
ld hl, PlayRadioShow ld hl, PlayRadioShow
call Radio_BackUpFarCallParams call Radio_BackUpFarCallParams
@ -1855,20 +1855,20 @@ _TownMap: ; 9191c
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
call TownMap_GetCurrentLandmark call TownMap_GetCurrentLandmark
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
ld [wd003], a ld [wTownMapCursorLandmark], a
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call .InitTilemap call .InitTilemap
call WaitBGMap2 call WaitBGMap2
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
call PokegearMap_InitPlayerIcon call PokegearMap_InitPlayerIcon
ld a, [wd003] ld a, [wTownMapCursorLandmark]
call PokegearMap_InitCursor call PokegearMap_InitCursor
ld a, c ld a, c
ld [wd004], a ld [wTownMapCursorObjectPointer], a
ld a, b ld a, b
ld [wd005], a ld [wTownMapCursorObjectPointer + 1], a
ld b, SCGB_POKEGEAR_PALS ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout call GetSGBLayout
call SetPalettes call SetPalettes
@ -1880,7 +1880,7 @@ _TownMap: ; 9191c
call DelayFrame call DelayFrame
.dmg .dmg
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
cp KANTO_LANDMARK cp KANTO_LANDMARK
jr nc, .kanto jr nc, .kanto
ld d, KANTO_LANDMARK - 1 ld d, KANTO_LANDMARK - 1
@ -1925,7 +1925,7 @@ _TownMap: ; 9191c
jr .loop jr .loop
.pressed_up .pressed_up
ld hl, wd003 ld hl, wTownMapCursorLandmark
ld a, [hl] ld a, [hl]
cp d cp d
jr c, .okay jr c, .okay
@ -1938,7 +1938,7 @@ _TownMap: ; 9191c
jr .next jr .next
.pressed_down .pressed_down
ld hl, wd003 ld hl, wTownMapCursorLandmark
ld a, [hl] ld a, [hl]
cp e cp e
jr nz, .okay2 jr nz, .okay2
@ -1951,20 +1951,20 @@ _TownMap: ; 9191c
.next .next
push de push de
ld a, [wd003] ld a, [wTownMapCursorLandmark]
call PokegearMap_UpdateLandmarkName call PokegearMap_UpdateLandmarkName
ld a, [wd004] ld a, [wTownMapCursorObjectPointer]
ld c, a ld c, a
ld a, [wd005] ld a, [wTownMapCursorObjectPointer + 1]
ld b, a ld b, a
ld a, [wd003] ld a, [wTownMapCursorLandmark]
call PokegearMap_UpdateCursorPosition call PokegearMap_UpdateCursorPosition
pop de pop de
jr .loop2 jr .loop2
; 91a04 ; 91a04
.InitTilemap: ; 91a04 .InitTilemap: ; 91a04
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
cp KANTO_LANDMARK cp KANTO_LANDMARK
jr nc, .kanto2 jr nc, .kanto2
ld e, $0 ld e, $0
@ -1992,7 +1992,7 @@ _TownMap: ; 9191c
call ByteFill call ByteFill
hlcoord 19, 2 hlcoord 19, 2
ld [hl], $17 ld [hl], $17
ld a, [wd003] ld a, [wTownMapCursorLandmark]
call PokegearMap_UpdateLandmarkName call PokegearMap_UpdateLandmarkName
callba TownMapPals callba TownMapPals
ret ret
@ -2147,7 +2147,7 @@ _FlyMap: ; 91af3
jr .exit jr .exit
.pressedA .pressedA
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl add hl, hl
@ -2155,7 +2155,7 @@ _FlyMap: ; 91af3
add hl, de add hl, de
ld a, [hl] ld a, [hl]
.exit .exit
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
pop af pop af
ld [hInMenu], a ld [hInMenu], a
call ClearBGPalettes call ClearBGPalettes
@ -2165,7 +2165,7 @@ _FlyMap: ; 91af3
ld [hBGMapAddress], a ld [hBGMapAddress], a
ld a, VBGMap0 / $100 ld a, VBGMap0 / $100
ld [hBGMapAddress + 1], a ld [hBGMapAddress + 1], a
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld e, a ld e, a
ret ret
@ -2186,7 +2186,7 @@ FlyMapScroll: ; 91b73
ret ret
.ScrollNext: .ScrollNext:
ld hl, wd002 ld hl, wTownMapPlayerIconLandmark
ld a, [hl] ld a, [hl]
cp d cp d
jr nz, .NotAtEndYet jr nz, .NotAtEndYet
@ -2200,7 +2200,7 @@ FlyMapScroll: ; 91b73
jr .Finally jr .Finally
.ScrollPrev: .ScrollPrev:
ld hl, wd002 ld hl, wTownMapPlayerIconLandmark
ld a, [hl] ld a, [hl]
cp e cp e
jr nz, .NotAtStartYet jr nz, .NotAtStartYet
@ -2269,7 +2269,7 @@ TownMapBubble: ; 91bb5
.Name: .Name:
; We need the map location of the default flypoint ; We need the map location of the default flypoint
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl ; two bytes per flypoint add hl, hl ; two bytes per flypoint
@ -2285,7 +2285,7 @@ TownMapBubble: ; 91bb5
; 91c17 ; 91c17
GetMapCursorCoordinates: ; 91c17 GetMapCursorCoordinates: ; 91c17
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld l, a ld l, a
ld h, $0 ld h, $0
add hl, hl add hl, hl
@ -2293,9 +2293,9 @@ GetMapCursorCoordinates: ; 91c17
add hl, de add hl, de
ld e, [hl] ld e, [hl]
callba GetLandmarkCoords callba GetLandmarkCoords
ld a, [wd003] ld a, [wTownMapCursorCoordinates]
ld c, a ld c, a
ld a, [wd004] ld a, [wTownMapCursorCoordinates + 1]
ld b, a ld b, a
ld hl, $4 ld hl, $4
add hl, bc add hl, bc
@ -2389,8 +2389,7 @@ FlyMap: ; 91c90
ld c, a ld c, a
call GetWorldMapLocation call GetWorldMapLocation
; If we're not in a valid location, i.e. Pokecenter floor 2F, ; If we're not in a valid location, i.e. Pokecenter floor 2F,
; the backup map information is used.
; the backup map information is used
cp SPECIAL_MAP cp SPECIAL_MAP
jr nz, .CheckRegion jr nz, .CheckRegion
ld a, [BackupMapGroup] ld a, [BackupMapGroup]
@ -2399,7 +2398,7 @@ FlyMap: ; 91c90
ld c, a ld c, a
call GetWorldMapLocation call GetWorldMapLocation
.CheckRegion: .CheckRegion:
; The first 46 locations are part of Johto. The rest are in Kanto ; The first 46 locations are part of Johto. The rest are in Kanto.
cp KANTO_LANDMARK cp KANTO_LANDMARK
jr nc, .KantoFlyMap jr nc, .KantoFlyMap
.JohtoFlyMap: .JohtoFlyMap:
@ -2407,10 +2406,10 @@ FlyMap: ; 91c90
push af push af
; Start from New Bark Town ; Start from New Bark Town
ld a, FLY_NEW_BARK ld a, FLY_NEW_BARK
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
; Flypoints begin at New Bark Town... ; Flypoints begin at New Bark Town...
ld [StartFlypoint], a ld [StartFlypoint], a
; ..and end at Silver Cave ; ..and end at Silver Cave.
ld a, FLY_MT_SILVER ld a, FLY_MT_SILVER
ld [EndFlypoint], a ld [EndFlypoint], a
; Fill out the map ; Fill out the map
@ -2422,17 +2421,13 @@ FlyMap: ; 91c90
.KantoFlyMap: .KantoFlyMap:
; The event that there are no flypoints enabled in a map is not ; The event that there are no flypoints enabled in a map is not
; accounted for. As a result, if you attempt to select a flypoint ; accounted for. As a result, if you attempt to select a flypoint
; when there are none enabled, the game will crash. Additionally, ; when there are none enabled, the game will crash. Additionally,
; the flypoint selection has a default starting point that ; the flypoint selection has a default starting point that
; can be flown to even if none are enabled ; can be flown to even if none are enabled.
; To prevent both of these things from happening when the player ; To prevent both of these things from happening when the player
; enters Kanto, fly access is restricted until Indigo Plateau is ; enters Kanto, fly access is restricted until Indigo Plateau is
; visited and its flypoint enabled.
; visited and its flypoint enabled
push af push af
ld c, SPAWN_INDIGO ld c, SPAWN_INDIGO
call HasVisitedSpawn call HasVisitedSpawn
@ -2447,9 +2442,8 @@ FlyMap: ; 91c90
ld a, FLY_INDIGO ld a, FLY_INDIGO
ld [EndFlypoint], a ld [EndFlypoint], a
; Because Indigo Plateau is the first flypoint the player ; Because Indigo Plateau is the first flypoint the player
; visits, it's made the default flypoint.
; visits, it's made the default flypoint ld [wTownMapPlayerIconLandmark], a
ld [wd002], a
; Fill out the map ; Fill out the map
call FillKantoMap call FillKantoMap
call .MapHud call .MapHud
@ -2462,7 +2456,7 @@ FlyMap: ; 91c90
; Start from New Bark Town ; Start from New Bark Town
ld a, FLY_NEW_BARK ld a, FLY_NEW_BARK
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
; Flypoints begin at New Bark Town... ; Flypoints begin at New Bark Town...
ld [StartFlypoint], a ld [StartFlypoint], a
; ..and end at Silver Cave ; ..and end at Silver Cave
@ -2477,21 +2471,21 @@ FlyMap: ; 91c90
call TownMapBGUpdate call TownMapBGUpdate
call TownMapMon call TownMapMon
ld a, c ld a, c
ld [wd003], a ld [wTownMapCursorCoordinates], a
ld a, b ld a, b
ld [wd004], a ld [wTownMapCursorCoordinates + 1], a
ret ret
; 91d11 ; 91d11
_Area: ; 91d11 _Area: ; 91d11
; e: Current landmark ; e: Current landmark
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
push af push af
ld a, [wd003] ld a, [wTownMapCursorLandmark]
push af push af
ld a, e ld a, e
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
call ClearSprites call ClearSprites
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
@ -2545,9 +2539,9 @@ _Area: ; 91d11
.a_b .a_b
call ClearSprites call ClearSprites
pop af pop af
ld [wd003], a ld [wTownMapCursorLandmark], a
pop af pop af
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
ret ret
; 91d9b ; 91d9b
@ -2636,7 +2630,7 @@ _Area: ; 91d11
; 91e1e ; 91e1e
.GetAndPlaceNest: ; 91e1e .GetAndPlaceNest: ; 91e1e
ld [wd003], a ld [wTownMapCursorLandmark], a
ld e, a ld e, a
callba FindNest ; load nest landmarks into TileMap[0,0] callba FindNest ; load nest landmarks into TileMap[0,0]
decoord 0, 0 decoord 0, 0
@ -2678,7 +2672,7 @@ _Area: ; 91d11
.HideNestsShowPlayer: ; 91e5a .HideNestsShowPlayer: ; 91e5a
call .CheckPlayerLocation call .CheckPlayerLocation
ret c ret c
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld e, a ld e, a
callba GetLandmarkCoords callba GetLandmarkCoords
ld c, e ld c, e
@ -2731,22 +2725,21 @@ _Area: ; 91d11
.CheckPlayerLocation: ; 91ea9 .CheckPlayerLocation: ; 91ea9
; Don't show the player's sprite if you're ; Don't show the player's sprite if you're
; not in the same region as what's currently ; not in the same region as what's currently
; on the screen. ; on the screen.
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP cp FAST_SHIP
jr z, .johto jr z, .johto
cp KANTO_LANDMARK cp KANTO_LANDMARK
jr c, .johto jr c, .johto
.kanto .kanto
ld a, [wd003] ld a, [wTownMapCursorLandmark]
and a and a
jr z, .clear jr z, .clear
jr .ok jr .ok
.johto .johto
ld a, [wd003] ld a, [wTownMapCursorLandmark]
and a and a
jr nz, .clear jr nz, .clear
.ok .ok
@ -2764,7 +2757,7 @@ _Area: ; 91d11
; 91ed0 ; 91ed0
.GetPlayerOrFastShipIcon: ; 91ed0 .GetPlayerOrFastShipIcon: ; 91ed0
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
cp FAST_SHIP cp FAST_SHIP
jr z, .FastShip jr z, .FastShip
callba GetPlayerIcon callba GetPlayerIcon
@ -2991,7 +2984,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
; XXX ; XXX
xor a xor a
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
call ClearBGPalettes call ClearBGPalettes
call ClearTileMap call ClearTileMap
call ClearSprites call ClearSprites
@ -3019,9 +3012,9 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
call TownMapBGUpdate call TownMapBGUpdate
call TownMapMon call TownMapMon
ld a, c ld a, c
ld [wd003], a ld [wTownMapCursorCoordinates], a
ld a, b ld a, b
ld [wd004], a ld [wTownMapCursorCoordinates + 1], a
ld b, SCGB_POKEGEAR_PALS ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout call GetSGBLayout
call SetPalettes call SetPalettes
@ -3045,7 +3038,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
jr .finished_a_b jr .finished_a_b
.pressedA .pressedA
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl add hl, hl
@ -3053,7 +3046,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
add hl, de add hl, de
ld a, [hl] ld a, [hl]
.finished_a_b .finished_a_b
ld [wd002], a ld [wTownMapPlayerIconLandmark], a
pop af pop af
ld [hInMenu], a ld [hInMenu], a
call ClearBGPalettes call ClearBGPalettes
@ -3063,7 +3056,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
ld [hBGMapAddress], a ld [hBGMapAddress], a
ld a, VBGMap0 / $100 ld a, VBGMap0 / $100
ld [hBGMapAddress + 1], a ld [hBGMapAddress + 1], a
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
ld e, a ld e, a
ret ret
@ -3080,7 +3073,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
ret ret
.down_right .down_right
ld hl, wd002 ld hl, wTownMapPlayerIconLandmark
ld a, [hl] ld a, [hl]
cp FLY_INDIGO cp FLY_INDIGO
jr c, .okay_dr jr c, .okay_dr
@ -3090,7 +3083,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
jr .continue jr .continue
.up_left .up_left
ld hl, wd002 ld hl, wTownMapPlayerIconLandmark
ld a, [hl] ld a, [hl]
and a and a
jr nz, .okay_ul jr nz, .okay_ul
@ -3098,7 +3091,7 @@ INCBIN "gfx/pokegear/flymap_label_border.1bpp"
.okay_ul .okay_ul
dec [hl] dec [hl]
.continue .continue
ld a, [wd002] ld a, [wTownMapPlayerIconLandmark]
cp KANTO_FLYPOINT cp KANTO_FLYPOINT
jr c, .johto jr c, .johto
call FillKantoMap call FillKantoMap

View File

@ -275,7 +275,7 @@ _PrintNum:: ; c4c7
dec e dec e
ret nz ret nz
inc hl inc hl
ld [hl], "<PERIOD>" ld [hl], "<DOT>"
ret ret
.PrintLeadingZero: ; c644 .PrintLeadingZero: ; c644

View File

@ -1355,19 +1355,19 @@ Script_earthquake:
; param (DecimalParam) ; param (DecimalParam)
ld hl, EarthquakeMovement ld hl, EarthquakeMovement
ld de, wd002 ld de, wEarthquakeMovementDataBuffer
ld bc, EarthquakeMovementEnd - EarthquakeMovement ld bc, EarthquakeMovementEnd - EarthquakeMovement
call CopyBytes call CopyBytes
call GetScriptByte call GetScriptByte
ld [wd003], a ld [wEarthquakeMovementDataBuffer + 1], a
and (1 << 6) - 1 and %00111111
ld [wd005], a ld [wEarthquakeMovementDataBuffer + 3], a
ld b, BANK(.script) ld b, BANK(.script)
ld de, .script ld de, .script
jp ScriptCall jp ScriptCall
.script .script
applymovement PLAYER, wd002 applymovement PLAYER, wEarthquakeMovementDataBuffer
end end
EarthquakeMovement: EarthquakeMovement:

View File

@ -16,7 +16,7 @@ StartMenu:: ; 125cd
call LoadMenuDataHeader call LoadMenuDataHeader
call .SetUpMenuItems call .SetUpMenuItems
ld a, [wd0d2] ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
call .DrawMenuAccount_ call .DrawMenuAccount_
call DrawVariableLengthMenuBox call DrawVariableLengthMenuBox
@ -32,7 +32,7 @@ StartMenu:: ; 125cd
call UpdateSprites call UpdateSprites
call UpdateTimePals call UpdateTimePals
call .SetUpMenuItems call .SetUpMenuItems
ld a, [wd0d2] ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
.Select: .Select:
@ -40,7 +40,7 @@ StartMenu:: ; 125cd
jr c, .Exit jr c, .Exit
call .DrawMenuAccount call .DrawMenuAccount
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
call PlayClickSFX call PlayClickSFX
call PlaceHollowCursor call PlaceHollowCursor
call .OpenMenu call .OpenMenu

View File

@ -420,7 +420,7 @@ StatsScreen_InitUpperHalf: ; 4deea (13:5eea)
ld d, a ld d, a
ld e, [hl] ld e, [hl]
callba ComputeHPBarPixels callba ComputeHPBarPixels
ld hl, wcda1 ld hl, wCurHPPal
call SetHPPal call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout call GetSGBLayout
@ -601,7 +601,7 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
call .CalcExpToNextLevel call .CalcExpToNextLevel
hlcoord 13, 13 hlcoord 13, 13
lb bc, 3, 7 lb bc, 3, 7
ld de, Buffer1 ; wd1ea (aliases: MagikarpLength) ld de, Buffer1
call PrintNum call PrintNum
ld de, .LevelUpStr ld de, .LevelUpStr
hlcoord 10, 12 hlcoord 10, 12
@ -649,14 +649,14 @@ StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
ld a, [hQuotient + 1] ld a, [hQuotient + 1]
sbc [hl] sbc [hl]
dec hl dec hl
ld [Buffer2], a ; wd1eb (aliases: MovementType) ld [Buffer2], a
ld a, [hQuotient] ld a, [hQuotient]
sbc [hl] sbc [hl]
ld [Buffer1], a ; wd1ea (aliases: MagikarpLength) ld [Buffer1], a
ret ret
.AlreadyAtMaxLevel: .AlreadyAtMaxLevel:
ld hl, Buffer1 ; wd1ea (aliases: MagikarpLength) ld hl, Buffer1
xor a xor a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
@ -973,7 +973,7 @@ Unknown_4e32a: ; 4e32a
EggStatsScreen: ; 4e33a EggStatsScreen: ; 4e33a
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld hl, wcda1 ld hl, wCurHPPal
call SetHPPal call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout call GetSGBLayout

View File

@ -1,7 +1,7 @@
UpdateUnownDex: ; fba18 UpdateUnownDex: ; fba18
ld a, [UnownLetter] ld a, [UnownLetter]
ld c, a ld c, a
ld b, 26 ld b, NUM_UNOWN
ld hl, UnownDex ld hl, UnownDex
.loop .loop
ld a, [hli] ld a, [hli]

View File

@ -184,7 +184,7 @@ LoadWarpData: ; 1046c6
ret z ret z
.not_mt_moon_or_tin_tower .not_mt_moon_or_tin_tower
ld a, [wPrevWarp] ld a, [wPrevWarp]
ld [wDigWarp], a ld [wDigWarpNumber], a
ld a, [wPrevMapGroup] ld a, [wPrevMapGroup]
ld [wDigMapGroup], a ld [wDigMapGroup], a
ld a, [wPrevMapNumber] ld a, [wPrevMapNumber]

View File

@ -489,7 +489,7 @@ DisplayHOFMon: ; 86748
hlcoord 1, 13 hlcoord 1, 13
ld a, "№" ld a, "№"
ld [hli], a ld [hli], a
ld [hl], "<PERIOD>" ld [hl], "<DOT>"
hlcoord 3, 13 hlcoord 3, 13
ld de, wd265 ld de, wd265
lb bc, PRINTNUM_LEADINGZEROS | 1, 3 lb bc, PRINTNUM_LEADINGZEROS | 1, 3

View File

@ -33,14 +33,14 @@ Special_CheckMagikarpLength: ; fbb32
call PrintText call PrintText
; Did we beat the record? ; Did we beat the record?
ld hl, Buffer1 ld hl, wMagikarpLength
ld de, wBestMagikarpLengthFeet ld de, wBestMagikarpLengthFeet
ld c, 2 ld c, 2
call StringCmp call StringCmp
jr nc, .not_long_enough jr nc, .not_long_enough
; NEW RECORD!!! Let's save that. ; NEW RECORD!!! Let's save that.
ld hl, Buffer1 ld hl, wMagikarpLength
ld de, wBestMagikarpLengthFeet ld de, wBestMagikarpLengthFeet
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -93,12 +93,12 @@ INCBIN "gfx/unknown/0fbbbb.2bpp"
PrintMagikarpLength: ; fbbdb PrintMagikarpLength: ; fbbdb
call Magikarp_LoadFeetInchesChars call Magikarp_LoadFeetInchesChars
ld hl, StringBuffer1 ld hl, StringBuffer1
ld de, Buffer1 ld de, wMagikarpLength
lb bc, PRINTNUM_RIGHTALIGN | 1, 2 lb bc, PRINTNUM_RIGHTALIGN | 1, 2
call PrintNum call PrintNum
ld [hl], "" ld [hl], ""
inc hl inc hl
ld de, Buffer2 ld de, wMagikarpLength + 1
lb bc, PRINTNUM_RIGHTALIGN | 1, 2 lb bc, PRINTNUM_RIGHTALIGN | 1, 2
call PrintNum call PrintNum
ld [hl], "″" ld [hl], "″"
@ -108,7 +108,7 @@ PrintMagikarpLength: ; fbbdb
; fbbfc ; fbbfc
CalcMagikarpLength: ; fbbfc CalcMagikarpLength: ; fbbfc
; Return Magikarp's length (in mm) at MagikarpLength (big endian). ; Return Magikarp's length (in mm) at wMagikarpLength (big endian).
; ;
; input: ; input:
; de: EnemyMonDVs ; de: EnemyMonDVs
@ -125,9 +125,9 @@ CalcMagikarpLength: ; fbbfc
; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id) ; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id)
; if bc < 10: [MagikarpLength] = c + 190 ; if bc < 10: [wMagikarpLength] = c + 190
; if bc ≥ $ff00: [MagikarpLength] = c + 1370 ; if bc ≥ $ff00: [wMagikarpLength] = c + 1370
; else: [MagikarpLength] = z × 100 + (bc x) / y ; else: [wMagikarpLength] = z × 100 + (bc x) / y
; X, Y, and Z depend on the value of b as follows: ; X, Y, and Z depend on the value of b as follows:
@ -274,7 +274,7 @@ CalcMagikarpLength: ; fbbfc
.ok .ok
ld e, a ld e, a
ld hl, MagikarpLength ld hl, wMagikarpLength
ld [hl], d ld [hl], d
inc hl inc hl
ld [hl], e ld [hl], e
@ -326,9 +326,9 @@ CalcMagikarpLength: ; fbbfc
Special_MagikarpHouseSign: ; fbcd2 Special_MagikarpHouseSign: ; fbcd2
ld a, [wBestMagikarpLengthFeet] ld a, [wBestMagikarpLengthFeet]
ld [Buffer1], a ld [wMagikarpLength], a
ld a, [wBestMagikarpLengthInches] ld a, [wBestMagikarpLengthInches]
ld [Buffer2], a ld [wMagikarpLength + 1], a
call PrintMagikarpLength call PrintMagikarpLength
ld hl, .CurrentRecordtext ld hl, .CurrentRecordtext
call PrintText call PrintText

View File

@ -432,7 +432,7 @@ SurfFunction: ; c909
.DoSurf: ; c95f (3:495f) .DoSurf: ; c95f (3:495f)
call GetSurfType call GetSurfType
ld [Buffer2], a ; wd1eb (aliases: MovementType) ld [Buffer2], a
call GetPartyNick call GetPartyNick
ld hl, SurfFromMenuScript ld hl, SurfFromMenuScript
call QueueScript call QueueScript
@ -569,7 +569,7 @@ TrySurfOW:: ; c9e7
jr nz, .quit jr nz, .quit
call GetSurfType call GetSurfType
ld [MovementType], a ld [Buffer2], a
call GetPartyNick call GetPartyNick
ld a, BANK(AskSurfScript) ld a, BANK(AskSurfScript)
@ -837,7 +837,7 @@ dig_incave
ret ret
.incave .incave
ld hl, wDigWarp ld hl, wDigWarpNumber
ld a, [hli] ld a, [hli]
and a and a
jr z, .fail jr z, .fail
@ -851,7 +851,7 @@ dig_incave
ret ret
.DoDig: ; cbd8 .DoDig: ; cbd8
ld hl, wDigWarp ld hl, wDigWarpNumber
ld de, wNextWarp ld de, wNextWarp
ld bc, 3 ld bc, 3
call CopyBytes call CopyBytes

View File

@ -3,11 +3,11 @@ InitMovementBuffer:: ; 1b1e
xor a xor a
ld [wMovementBufferCount], a ld [wMovementBufferCount], a
ld a, $0 ; useless ld a, $0 ; useless
ld [wd004], a ld [wUnusedMovementBufferBank], a
ld a, MovementBuffer % $100 ld a, MovementBuffer % $100
ld [wd005], a ld [wUnusedMovementBufferPointer], a
ld a, MovementBuffer / $100 ld a, MovementBuffer / $100
ld [wd006], a ld [wUnusedMovementBufferPointer + 1], a
ret ret
; 1b35 ; 1b35

View File

@ -407,9 +407,9 @@ ParkBall: ; e8a2
ld de, ANIM_THROW_POKE_BALL ld de, ANIM_THROW_POKE_BALL
ld a, e ld a, e
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, d ld a, d
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
xor a xor a
ld [hBattleTurn], a ld [hBattleTurn], a
ld [Buffer2], a ld [Buffer2], a
@ -2945,9 +2945,9 @@ UseBallInTrainerBattle: ; f7a0
call ReturnToBattle_UseBall call ReturnToBattle_UseBall
ld de, ANIM_THROW_POKE_BALL ld de, ANIM_THROW_POKE_BALL
ld a, e ld a, e
ld [FXAnimIDLo], a ld [FXAnimID], a
ld a, d ld a, d
ld [FXAnimIDHi], a ld [FXAnimID + 1], a
xor a xor a
ld [wBattleAnimParam], a ld [wBattleAnimParam], a
ld [hBattleTurn], a ld [hBattleTurn], a

View File

@ -188,7 +188,7 @@
charmap "♂", $ef charmap "♂", $ef
charmap "¥", $f0 charmap "¥", $f0
charmap "×", $f1 charmap "×", $f1
charmap "<PERIOD>", $f2 ; same as "." in English charmap "<DOT>", $f2 ; same as "." in English
charmap "/", $f3 charmap "/", $f3
charmap ",", $f4 charmap ",", $f4
charmap "♀", $f5 charmap "♀", $f5

View File

@ -4501,13 +4501,13 @@ _SwitchPartyMons:
ld b, a ld b, a
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
dec a dec a
ld [Buffer2], a ; wd1eb (aliases: MovementType) ld [Buffer2], a
cp b cp b
jr z, .skip jr z, .skip
call .SwapMonAndMail call .SwapMonAndMail
ld a, [Buffer3] ld a, [Buffer3]
call .ClearSprite call .ClearSprite
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
call .ClearSprite call .ClearSprite
.skip .skip
ret ret
@ -4540,7 +4540,7 @@ _SwitchPartyMons:
push de push de
push bc push bc
ld bc, PartySpecies ld bc, PartySpecies
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
ld l, a ld l, a
ld h, $0 ld h, $0
add hl, bc add hl, bc
@ -4556,8 +4556,8 @@ _SwitchPartyMons:
ld [hl], a ld [hl], a
pop af pop af
ld [de], a ld [de], a
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
ld hl, PartyMons ; wdcdf (aliases: PartyMon1, PartyMon1Species) ld hl, PartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes call AddNTimes
push hl push hl
@ -4576,7 +4576,7 @@ _SwitchPartyMons:
ld hl, wd002 ld hl, wd002
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes call CopyBytes
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
ld hl, PartyMonOT ld hl, PartyMonOT
call SkipNames call SkipNames
push hl push hl
@ -4591,7 +4591,7 @@ _SwitchPartyMons:
ld hl, wd002 ld hl, wd002
call .CopyName call .CopyName
ld hl, PartyMonNicknames ld hl, PartyMonNicknames
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
call SkipNames call SkipNames
push hl push hl
call .CopyNameTowd002 call .CopyNameTowd002
@ -4605,7 +4605,7 @@ _SwitchPartyMons:
ld hl, wd002 ld hl, wd002
call .CopyName call .CopyName
ld hl, sPartyMail ld hl, sPartyMail
ld a, [Buffer2] ; wd1eb (aliases: MovementType) ld a, [Buffer2]
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call AddNTimes call AddNTimes
push hl push hl

View File

@ -1804,14 +1804,14 @@ Function100b12: ; 100b12
call FarCall_de call FarCall_de
ld a, BANK(BattleMenuDataHeader) ld a, BANK(BattleMenuDataHeader)
ld [wMenuData2_2DMenuItemStringsBank], a ld [wMenuData2_2DMenuItemStringsBank], a
ld a, [wd0d2] ld a, [wBattleMenuCursorBuffer]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
call Function100e72 call Function100e72
call Function100b45 call Function100b45
callba InitPartyMenuBGPal7 callba InitPartyMenuBGPal7
call Function100ed4 call Function100ed4
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
ld [wd0d2], a ld [wBattleMenuCursorBuffer], a
call ExitMenu call ExitMenu
ret ret
; 100b45 ; 100b45

View File

@ -1313,7 +1313,7 @@ MobileTradeAnim_DisplayEggData
.EggTemplate: ; 108a1d .EggTemplate: ; 108a1d
db "タマゴ" db "タマゴ"
next "おや/?????" next "おや/?????"
next "<ID>№<PERIOD>?????" next "<ID>№<DOT>?????"
db "@" db "@"
; 108a33 ; 108a33
@ -1353,10 +1353,10 @@ MobileTradeAnim_LoadMonTemplate: ; 108a5b
; 108a79 ; 108a79
.MonTemplate: ; 108a79 .MonTemplate: ; 108a79
db "─ №<PERIOD>" db "─ №<DOT>"
next "" next ""
next "おや/" next "おや/"
next "<ID>№<PERIOD>" next "<ID>№<DOT>"
db "@" db "@"
; 108a87 ; 108a87

View File

@ -204,7 +204,7 @@ _CGB_PokegearPals: ; 8eb9
_CGB_StatsScreenHPPals: ; 8edb _CGB_StatsScreenHPPals: ; 8edb
ld de, UnknBGPals ld de, UnknBGPals
ld a, [wcda1] ld a, [wCurHPPal]
ld l, a ld l, a
ld h, $0 ld h, $0
add hl, hl add hl, hl

View File

@ -168,7 +168,7 @@ Predef_LoadSGBLayout: ; 864c
ld de, wSGBPals ld de, wSGBPals
ld bc, $10 ld bc, $10
call CopyBytes call CopyBytes
ld a, [wcda1] ld a, [wCurHPPal]
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl add hl, hl

1635
wram.asm

File diff suppressed because it is too large Load Diff