Identify the remaining (non-mobile) uses of another WRAM union

This commit is contained in:
Rangi 2020-10-29 14:45:40 -04:00
parent ea426a8879
commit bcc0d633e9
21 changed files with 259 additions and 199 deletions

View File

@ -72,7 +72,7 @@ _LinkAbnormalMonText::
_LinkAskTradeForText:: _LinkAskTradeForText::
text "Trade @" text "Trade @"
text_ram wd004 text_ram wBufferTrademonNick
text_start text_start
line "for @" line "for @"
text_ram wStringBuffer1 text_ram wStringBuffer1

View File

@ -560,7 +560,7 @@ This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider
```diff ```diff
.got_mon .got_mon
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
call GetNick call GetNick
ld a, MON_HP ld a, MON_HP
@ -568,7 +568,7 @@ This bug affects Attract, Curse, Foresight, Mean Look, Mimic, Nightmare, Spider
ld a, [hli] ld a, [hli]
or [hl] or [hl]
jp z, .beatup_fail ; fainted jp z, .beatup_fail ; fainted
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld c, a ld c, a
ld a, [wCurBattleMon] ld a, [wCurBattleMon]
- ; BUG: this can desynchronize link battles - ; BUG: this can desynchronize link battles

View File

@ -7438,13 +7438,13 @@ AnimateExpBar:
jp nc, .finish jp nc, .finish
ldh a, [hProduct + 3] ldh a, [hProduct + 3]
ld [wd004], a ld [wExperienceGained + 2], a
push af push af
ldh a, [hProduct + 2] ldh a, [hProduct + 2]
ld [wd003], a ld [wExperienceGained + 1], a
push af push af
xor a xor a
ld [wd002], a ld [wExperienceGained], a
xor a ; PARTYMON xor a ; PARTYMON
ld [wMonType], a ld [wMonType], a
predef CopyMonToTempMon predef CopyMonToTempMon
@ -7456,10 +7456,10 @@ AnimateExpBar:
call CalcExpBar call CalcExpBar
push bc push bc
ld hl, wTempMonExp + 2 ld hl, wTempMonExp + 2
ld a, [wd004] ld a, [wExperienceGained + 2]
add [hl] add [hl]
ld [hld], a ld [hld], a
ld a, [wd003] ld a, [wExperienceGained + 1]
adc [hl] adc [hl]
ld [hld], a ld [hld], a
jr nc, .NoOverflow jr nc, .NoOverflow
@ -8788,7 +8788,7 @@ AddLastLinkBattleToLinkRecord:
.FindOpponentAndAppendRecord: .FindOpponentAndAppendRecord:
ld b, NUM_LINK_BATTLE_RECORDS ld b, NUM_LINK_BATTLE_RECORDS
ld hl, sLinkBattleRecord1End - 1 ld hl, sLinkBattleRecord1End - 1
ld de, wd002 ld de, wLinkBattleRecordBuffer
.loop3 .loop3
push bc push bc
push de push de
@ -8817,16 +8817,16 @@ AddLastLinkBattleToLinkRecord:
add b add b
add b add b
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, wd002 ld hl, wLinkBattleRecordBuffer
add hl, de add hl, de
push hl push hl
ld a, c ld a, c
add c add c
add c add c
ld e, a ld e, a
ld d, $0 ld d, 0
ld hl, wd002 ld hl, wLinkBattleRecordBuffer
add hl, de add hl, de
ld d, h ld d, h
ld e, l ld e, l
@ -8858,7 +8858,7 @@ AddLastLinkBattleToLinkRecord:
ld hl, sLinkBattleRecord ld hl, sLinkBattleRecord
call AddNTimes call AddNTimes
push hl push hl
ld de, wd002 ld de, wLinkBattleRecordBuffer
ld bc, LINK_BATTLE_RECORD_LENGTH ld bc, LINK_BATTLE_RECORD_LENGTH
call CopyBytes call CopyBytes
pop hl pop hl
@ -8872,7 +8872,7 @@ AddLastLinkBattleToLinkRecord:
push hl push hl
ld bc, LINK_BATTLE_RECORD_LENGTH ld bc, LINK_BATTLE_RECORD_LENGTH
call CopyBytes call CopyBytes
ld hl, wd002 ld hl, wLinkBattleRecordBuffer
ld bc, LINK_BATTLE_RECORD_LENGTH ld bc, LINK_BATTLE_RECORD_LENGTH
pop de pop de
call CopyBytes call CopyBytes

View File

@ -14,7 +14,7 @@ BattleCommand_BeatUp:
call DelayFrames call DelayFrames
xor a xor a
ld [wPlayerRolloutCount], a ld [wPlayerRolloutCount], a
ld [wd002], a ld [wCurBeatUpPartyMon], a
ld [wBeatUpHitAtLeastOnce], a ld [wBeatUpHitAtLeastOnce], a
jr .got_mon jr .got_mon
@ -23,10 +23,10 @@ BattleCommand_BeatUp:
ld b, a ld b, a
ld a, [wPartyCount] ld a, [wPartyCount]
sub b sub b
ld [wd002], a ld [wCurBeatUpPartyMon], a
.got_mon .got_mon
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
call GetNick call GetNick
ld a, MON_HP ld a, MON_HP
@ -34,7 +34,7 @@ BattleCommand_BeatUp:
ld a, [hli] ld a, [hli]
or [hl] or [hl]
jp z, .beatup_fail ; fainted jp z, .beatup_fail ; fainted
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld c, a ld c, a
ld a, [wCurBattleMon] ld a, [wCurBattleMon]
; BUG: this can desynchronize link battles ; BUG: this can desynchronize link battles
@ -88,7 +88,7 @@ BattleCommand_BeatUp:
xor a xor a
ld [wEnemyRolloutCount], a ld [wEnemyRolloutCount], a
ld [wd002], a ld [wCurBeatUpPartyMon], a
ld [wBeatUpHitAtLeastOnce], a ld [wBeatUpHitAtLeastOnce], a
jr .enemy_got_mon jr .enemy_got_mon
@ -97,7 +97,7 @@ BattleCommand_BeatUp:
ld b, a ld b, a
ld a, [wOTPartyCount] ld a, [wOTPartyCount]
sub b sub b
ld [wd002], a ld [wCurBeatUpPartyMon], a
.enemy_got_mon .enemy_got_mon
ld a, [wBattleMode] ld a, [wBattleMode]
@ -112,7 +112,7 @@ BattleCommand_BeatUp:
and a and a
jr nz, .link_or_tower jr nz, .link_or_tower
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, wOTPartySpecies ld hl, wOTPartySpecies
@ -123,7 +123,7 @@ BattleCommand_BeatUp:
jr .got_enemy_nick jr .got_enemy_nick
.link_or_tower .link_or_tower
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld hl, wOTPartyMonNicknames ld hl, wOTPartyMonNicknames
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call AddNTimes call AddNTimes
@ -137,7 +137,7 @@ BattleCommand_BeatUp:
or [hl] or [hl]
jp z, .beatup_fail jp z, .beatup_fail
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
ld b, a ld b, a
ld a, [wCurOTMon] ld a, [wCurOTMon]
cp b cp b
@ -217,7 +217,7 @@ GetBeatupMonLocation:
ld hl, wOTPartyMon1Species ld hl, wOTPartyMon1Species
.got_species .got_species
ld a, [wd002] ld a, [wCurBeatUpPartyMon]
add hl, bc add hl, bc
call GetPartyLocation call GetPartyLocation
pop bc pop bc

View File

@ -65,7 +65,7 @@ RotateUnownFrontpic:
ld a, b ld a, b
ld [hli], a ld [hli], a
push hl push hl
ld hl, wd003 ld hl, wPrintedUnownTileSource + 1
call .CountSetBit call .CountSetBit
pop hl pop hl
ld a, b ld a, b

View File

@ -36,18 +36,18 @@ Rate:
ld hl, wPokedexSeen ld hl, wPokedexSeen
ld b, wEndPokedexSeen - wPokedexSeen ld b, wEndPokedexSeen - wPokedexSeen
call CountSetBits call CountSetBits
ld [wd002], a ld [wTempPokedexSeenCount], a
ld hl, wPokedexCaught ld hl, wPokedexCaught
ld b, wEndPokedexCaught - wPokedexCaught ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits call CountSetBits
ld [wd003], a ld [wTempPokedexCaughtCount], a
; print appropriate rating ; print appropriate rating
call .UpdateRatingBuffers call .UpdateRatingBuffers
ld hl, OakPCText3 ld hl, OakPCText3
call PrintText call PrintText
call JoyWaitAorB call JoyWaitAorB
ld a, [wd003] ld a, [wTempPokedexCaughtCount]
ld hl, OakRatings ld hl, OakRatings
call FindOakRating call FindOakRating
push de push de
@ -57,10 +57,10 @@ Rate:
.UpdateRatingBuffers: .UpdateRatingBuffers:
ld hl, wStringBuffer3 ld hl, wStringBuffer3
ld de, wd002 ld de, wTempPokedexSeenCount
call .UpdateRatingBuffer call .UpdateRatingBuffer
ld hl, wStringBuffer4 ld hl, wStringBuffer4
ld de, wd003 ld de, wTempPokedexCaughtCount
call .UpdateRatingBuffer call .UpdateRatingBuffer
ret ret

View File

@ -504,13 +504,13 @@ CheckSolvedUnownPuzzle:
RedrawUnownPuzzlePieces: RedrawUnownPuzzlePieces:
call GetCurrentPuzzlePieceVTileCorner call GetCurrentPuzzlePieceVTileCorner
ld [wd002], a ld [wUnownPuzzleCornerTile], a
xor a xor a
call GetUnownPuzzleCoordData ; get pixel positions call GetUnownPuzzleCoordData ; get pixel positions
ld a, [hli] ld a, [hli]
ld b, [hl] ld b, [hl]
ld c, a ld c, a
ld a, [wd002] ld a, [wUnownPuzzleCornerTile]
cp $e0 cp $e0
jr z, .NoPiece jr z, .NoPiece
ld hl, .OAM_HoldingPiece ld hl, .OAM_HoldingPiece
@ -532,7 +532,7 @@ RedrawUnownPuzzlePieces:
add c add c
ld [de], a ; x ld [de], a ; x
inc de inc de
ld a, [wd002] ld a, [wUnownPuzzleCornerTile]
add [hl] add [hl]
ld [de], a ; tile id ld [de], a ; tile id
inc hl inc hl

View File

@ -2166,11 +2166,12 @@ INCLUDE "data/items/x_stats.asm"
PokeFluteEffect: PokeFluteEffect:
ld a, [wBattleMode] ld a, [wBattleMode]
and a and a
jr nz, .dummy jr nz, .in_battle
.dummy ; overworld flute code was dummied out here
.in_battle
xor a xor a
ld [wd002], a ld [wPokeFluteCuredSleep], a
ld b, $ff ^ SLP ld b, $ff ^ SLP
@ -2193,7 +2194,7 @@ PokeFluteEffect:
and b and b
ld [hl], a ld [hl], a
ld a, [wd002] ld a, [wPokeFluteCuredSleep]
and a and a
ld hl, .PlayedFluteText ld hl, .PlayedFluteText
jp z, PrintText jp z, PrintText
@ -2202,22 +2203,22 @@ PokeFluteEffect:
ld a, [wLowHealthAlarm] ld a, [wLowHealthAlarm]
and 1 << DANGER_ON_F and 1 << DANGER_ON_F
jr nz, .dummy2 jr nz, .dummy
.dummy2 ; more code was dummied out here
.dummy
ld hl, .FluteWakeUpText ld hl, .FluteWakeUpText
jp PrintText jp PrintText
.CureSleep: .CureSleep:
ld de, PARTYMON_STRUCT_LENGTH ld de, PARTYMON_STRUCT_LENGTH
ld c, PARTY_LENGTH ld c, PARTY_LENGTH
.loop .loop
ld a, [hl] ld a, [hl]
push af push af
and SLP and SLP
jr z, .not_asleep jr z, .not_asleep
ld a, 1 ld a, TRUE
ld [wd002], a ld [wPokeFluteCuredSleep], a
.not_asleep .not_asleep
pop af pop af
and b and b
@ -2290,7 +2291,7 @@ ItemfinderEffect:
RestorePPEffect: RestorePPEffect:
ld a, [wCurItem] ld a, [wCurItem]
ld [wd002], a ld [wTempRestorePPItem], a
.loop .loop
; Party Screen opens to choose on which mon to use the Item ; Party Screen opens to choose on which mon to use the Item
@ -2299,14 +2300,14 @@ RestorePPEffect:
jp c, PPRestoreItem_Cancel jp c, PPRestoreItem_Cancel
.loop2 .loop2
ld a, [wd002] ld a, [wTempRestorePPItem]
cp MAX_ELIXER cp MAX_ELIXER
jp z, Elixer_RestorePPofAllMoves jp z, Elixer_RestorePPofAllMoves
cp ELIXER cp ELIXER
jp z, Elixer_RestorePPofAllMoves jp z, Elixer_RestorePPofAllMoves
ld hl, RaiseThePPOfWhichMoveText ld hl, RaiseThePPOfWhichMoveText
ld a, [wd002] ld a, [wTempRestorePPItem]
cp PP_UP cp PP_UP
jr z, .ppup jr z, .ppup
ld hl, RestoreThePPOfWhichMoveText ld hl, RestoreThePPOfWhichMoveText
@ -2337,7 +2338,7 @@ RestorePPEffect:
call CopyName1 call CopyName1
pop hl pop hl
ld a, [wd002] ld a, [wTempRestorePPItem]
cp PP_UP cp PP_UP
jp nz, Not_PP_Up jp nz, Not_PP_Up
@ -2486,7 +2487,7 @@ RestorePP:
cp b cp b
jr nc, .dont_restore jr nc, .dont_restore
ld a, [wd002] ld a, [wTempRestorePPItem]
cp MAX_ELIXER cp MAX_ELIXER
jr z, .restore_all jr z, .restore_all
cp MAX_ETHER cp MAX_ETHER

View File

@ -27,7 +27,7 @@ LinkCommunications:
call PlaceString call PlaceString
call SetTradeRoomBGPals call SetTradeRoomBGPals
call WaitBGMap2 call WaitBGMap2
ld hl, wcf5d ld hl, wLinkByteTimeout
xor a ; LOW($5000) xor a ; LOW($5000)
ld [hli], a ld [hli], a
ld [hl], HIGH($5000) ld [hl], HIGH($5000)
@ -510,6 +510,8 @@ LinkTimeout:
text_end text_end
ExchangeBytes: ExchangeBytes:
; This is similar to Serial_ExchangeBytes,
; but without a SERIAL_PREAMBLE_BYTE check.
ld a, TRUE ld a, TRUE
ldh [hSerialIgnoringInitialData], a ldh [hSerialIgnoringInitialData], a
.loop .loop
@ -520,9 +522,9 @@ ExchangeBytes:
ld b, a ld b, a
inc hl inc hl
ld a, 48 ld a, 48
.delay_cycles .wait
dec a dec a
jr nz, .delay_cycles jr nz, .wait
ldh a, [hSerialIgnoringInitialData] ldh a, [hSerialIgnoringInitialData]
and a and a
ld a, b ld a, b
@ -1423,13 +1425,13 @@ Function28926:
pop af pop af
ld [wMenuCursorY], a ld [wMenuCursorY], a
dec a dec a
ld [wd002], a ld [wCurTradePartyMon], a
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
farcall Function16d6ce farcall Function16d6ce
ld a, [wOtherPlayerLinkMode] ld a, [wOtherPlayerLinkMode]
cp $f cp $f
jp z, InitTradeMenuDisplay jp z, InitTradeMenuDisplay
ld [wd003], a ld [wCurOTTradePartyMon], a
call Function28b68 call Function28b68
ld c, 100 ld c, 100
call DelayFrames call DelayFrames
@ -1454,7 +1456,7 @@ Function28926:
xor a xor a
ld [wcf57], a ld [wcf57], a
ld [wOtherPlayerLinkAction], a ld [wOtherPlayerLinkAction], a
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartySpecies ld hl, wOTPartySpecies
ld c, a ld c, a
ld b, 0 ld b, 0
@ -1610,7 +1612,7 @@ LinkTrade:
ld c, 18 ld c, 18
call LinkTextboxAtHL call LinkTextboxAtHL
farcall Link_WaitBGMap farcall Link_WaitBGMap
ld a, [wd002] ld a, [wCurTradePartyMon]
ld hl, wPartySpecies ld hl, wPartySpecies
ld c, a ld c, a
ld b, 0 ld b, 0
@ -1619,10 +1621,10 @@ LinkTrade:
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
call GetPokemonName call GetPokemonName
ld hl, wStringBuffer1 ld hl, wStringBuffer1
ld de, wd004 ld de, wBufferTrademonNick
ld bc, MON_NAME_LENGTH ld bc, MON_NAME_LENGTH
call CopyBytes call CopyBytes
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartySpecies ld hl, wOTPartySpecies
ld c, a ld c, a
ld b, 0 ld b, 0
@ -1702,7 +1704,7 @@ LinkTrade:
.asm_28c7b .asm_28c7b
ld hl, sPartyMail ld hl, sPartyMail
ld a, [wd002] ld a, [wCurTradePartyMon]
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call AddNTimes call AddNTimes
ld a, BANK(sPartyMail) ld a, BANK(sPartyMail)
@ -1711,7 +1713,7 @@ LinkTrade:
ld e, l ld e, l
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
add hl, bc add hl, bc
ld a, [wd002] ld a, [wCurTradePartyMon]
ld c, a ld c, a
.asm_28c96 .asm_28c96
inc c inc c
@ -1732,7 +1734,7 @@ LinkTrade:
call AddNTimes call AddNTimes
push hl push hl
ld hl, wc9f4 ld hl, wc9f4
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call AddNTimes call AddNTimes
pop de pop de
@ -1743,7 +1745,7 @@ LinkTrade:
ld de, wPlayerTrademonSenderName ld de, wPlayerTrademonSenderName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ld a, [wd002] ld a, [wCurTradePartyMon]
ld hl, wPartySpecies ld hl, wPartySpecies
ld b, 0 ld b, 0
ld c, a ld c, a
@ -1751,27 +1753,27 @@ LinkTrade:
ld a, [hl] ld a, [hl]
ld [wPlayerTrademonSpecies], a ld [wPlayerTrademonSpecies], a
push af push af
ld a, [wd002] ld a, [wCurTradePartyMon]
ld hl, wPartyMonOT ld hl, wPartyMonOT
call SkipNames call SkipNames
ld de, wPlayerTrademonOTName ld de, wPlayerTrademonOTName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ld hl, wPartyMon1ID ld hl, wPartyMon1ID
ld a, [wd002] ld a, [wCurTradePartyMon]
call GetPartyLocation call GetPartyLocation
ld a, [hli] ld a, [hli]
ld [wPlayerTrademonID], a ld [wPlayerTrademonID], a
ld a, [hl] ld a, [hl]
ld [wPlayerTrademonID + 1], a ld [wPlayerTrademonID + 1], a
ld hl, wPartyMon1DVs ld hl, wPartyMon1DVs
ld a, [wd002] ld a, [wCurTradePartyMon]
call GetPartyLocation call GetPartyLocation
ld a, [hli] ld a, [hli]
ld [wPlayerTrademonDVs], a ld [wPlayerTrademonDVs], a
ld a, [hl] ld a, [hl]
ld [wPlayerTrademonDVs + 1], a ld [wPlayerTrademonDVs + 1], a
ld a, [wd002] ld a, [wCurTradePartyMon]
ld hl, wPartyMon1Species ld hl, wPartyMon1Species
call GetPartyLocation call GetPartyLocation
ld b, h ld b, h
@ -1783,34 +1785,34 @@ LinkTrade:
ld de, wOTTrademonSenderName ld de, wOTTrademonSenderName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartySpecies ld hl, wOTPartySpecies
ld b, 0 ld b, 0
ld c, a ld c, a
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wOTTrademonSpecies], a ld [wOTTrademonSpecies], a
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartyMonOT ld hl, wOTPartyMonOT
call SkipNames call SkipNames
ld de, wOTTrademonOTName ld de, wOTTrademonOTName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ld hl, wOTPartyMon1ID ld hl, wOTPartyMon1ID
ld a, [wd003] ld a, [wCurOTTradePartyMon]
call GetPartyLocation call GetPartyLocation
ld a, [hli] ld a, [hli]
ld [wOTTrademonID], a ld [wOTTrademonID], a
ld a, [hl] ld a, [hl]
ld [wOTTrademonID + 1], a ld [wOTTrademonID + 1], a
ld hl, wOTPartyMon1DVs ld hl, wOTPartyMon1DVs
ld a, [wd003] ld a, [wCurOTTradePartyMon]
call GetPartyLocation call GetPartyLocation
ld a, [hli] ld a, [hli]
ld [wOTTrademonDVs], a ld [wOTTrademonDVs], a
ld a, [hl] ld a, [hl]
ld [wOTTrademonDVs + 1], a ld [wOTTrademonDVs + 1], a
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartyMon1Species ld hl, wOTPartyMon1Species
call GetPartyLocation call GetPartyLocation
ld b, h ld b, h
@ -1818,14 +1820,14 @@ LinkTrade:
farcall GetCaughtGender farcall GetCaughtGender
ld a, c ld a, c
ld [wOTTrademonCaughtData], a ld [wOTTrademonCaughtData], a
ld a, [wd002] ld a, [wCurTradePartyMon]
ld [wCurPartyMon], a ld [wCurPartyMon], a
ld hl, wPartySpecies ld hl, wPartySpecies
ld b, 0 ld b, 0
ld c, a ld c, a
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd002], a ld [wCurTradePartyMon], a
xor a ; REMOVE_PARTY xor a ; REMOVE_PARTY
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
callfar RemoveMonFromPartyOrBox callfar RemoveMonFromPartyOrBox
@ -1834,14 +1836,14 @@ LinkTrade:
ld [wCurPartyMon], a ld [wCurPartyMon], a
ld a, TRUE ld a, TRUE
ld [wForceEvolution], a ld [wForceEvolution], a
ld a, [wd003] ld a, [wCurOTTradePartyMon]
push af push af
ld hl, wOTPartySpecies ld hl, wOTPartySpecies
ld b, 0 ld b, 0
ld c, a ld c, a
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd003], a ld [wCurOTTradePartyMon], a
ld c, 100 ld c, 100
call DelayFrames call DelayFrames
call ClearTilemap call ClearTilemap
@ -2248,7 +2250,7 @@ CheckLinkTimeout_Receptionist:
ld a, $1 ld a, $1
ld [wPlayerLinkAction], a ld [wPlayerLinkAction], a
ld hl, wLinkTimeoutFrames ld hl, wLinkTimeoutFrames
ld a, $3 ld a, 3
ld [hli], a ld [hli], a
xor a xor a
ld [hl], a ld [hl], a

View File

@ -1,11 +1,11 @@
; These functions seem to be related to backwards compatibility ; These functions seem to be related to backwards compatibility
ValidateOTTrademon: ValidateOTTrademon:
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartyMon1Species ld hl, wOTPartyMon1Species
call GetPartyLocation call GetPartyLocation
push hl push hl
ld a, [wd003] ld a, [wCurOTTradePartyMon]
inc a inc a
ld c, a ld c, a
ld b, 0 ld b, 0
@ -30,7 +30,7 @@ ValidateOTTrademon:
cp LINK_TIMECAPSULE cp LINK_TIMECAPSULE
jr nz, .normal jr nz, .normal
ld hl, wOTPartySpecies ld hl, wOTPartySpecies
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld c, a ld c, a
ld b, 0 ld b, 0
add hl, bc add hl, bc
@ -65,11 +65,11 @@ ValidateOTTrademon:
ret ret
CheckAnyOtherAliveMonsForTrade: CheckAnyOtherAliveMonsForTrade:
ld a, [wd002] ld a, [wCurTradePartyMon]
ld d, a ld d, a
ld a, [wPartyCount] ld a, [wPartyCount]
ld b, a ld b, a
ld c, $0 ld c, 0
.loop .loop
ld a, c ld a, c
cp d cp d
@ -87,7 +87,7 @@ CheckAnyOtherAliveMonsForTrade:
inc c inc c
dec b dec b
jr nz, .loop jr nz, .loop
ld a, [wd003] ld a, [wCurOTTradePartyMon]
ld hl, wOTPartyMon1HP ld hl, wOTPartyMon1HP
call GetPartyLocation call GetPartyLocation
ld a, [hli] ld a, [hli]

View File

@ -44,7 +44,7 @@ _PlayerDecorationMenu:
.MenuData: .MenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items db 0 ; items
dw wd002 dw wNumOwnedDecoCategories
dw PlaceNthMenuStrings dw PlaceNthMenuStrings
dw .pointers dw .pointers
@ -75,7 +75,7 @@ _PlayerDecorationMenu:
ld a, 7 ld a, 7
call .AppendToStringBuffer2 call .AppendToStringBuffer2
ld hl, wStringBuffer2 ld hl, wStringBuffer2
ld de, wd002 ld de, wDecoNameBuffer
ld bc, ITEM_NAME_LENGTH ld bc, ITEM_NAME_LENGTH
call CopyBytes call CopyBytes
ret ret
@ -133,10 +133,11 @@ _PlayerDecorationMenu:
Deco_FillTempWithMinusOne: Deco_FillTempWithMinusOne:
xor a xor a
ld hl, wd002 ld hl, wNumOwnedDecoCategories
ld [hli], a ld [hli], a
assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories
ld a, -1 ld a, -1
ld bc, $10 ld bc, 16
call ByteFill call ByteFill
ret ret
@ -161,10 +162,11 @@ CheckAllDecorationFlags:
ret ret
AppendDecoIndex: AppendDecoIndex:
ld hl, wd002 ld hl, wNumOwnedDecoCategories
inc [hl] inc [hl]
assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories
ld e, [hl] ld e, [hl]
ld d, $0 ld d, 0
add hl, de add hl, de
ld [hl], a ld [hl], a
ret ret
@ -176,7 +178,7 @@ FindOwnedDecosInCategory:
pop hl pop hl
call CheckAllDecorationFlags call CheckAllDecorationFlags
pop bc pop bc
ld a, [wd002] ld a, [wNumOwnedDecoCategories]
and a and a
ret z ret z
@ -335,7 +337,7 @@ DecoExitMenu:
ret ret
PopulateDecoCategoryMenu: PopulateDecoCategoryMenu:
ld a, [wd002] ld a, [wNumOwnedDecoCategories]
and a and a
jr z, .empty jr z, .empty
cp 8 cp 8
@ -353,9 +355,10 @@ PopulateDecoCategoryMenu:
ret ret
.beyond_eight .beyond_eight
ld hl, wd002 ld hl, wNumOwnedDecoCategories
ld e, [hl] ld e, [hl]
dec [hl] dec [hl]
assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories
ld d, 0 ld d, 0
add hl, de add hl, de
ld [hl], -1 ld [hl], -1
@ -395,7 +398,7 @@ PopulateDecoCategoryMenu:
.NonscrollingMenuData: .NonscrollingMenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items db 0 ; items
dw wd002 dw wDecoNameBuffer
dw DecorationMenuFunction dw DecorationMenuFunction
dw DecorationAttributes dw DecorationAttributes
@ -409,10 +412,10 @@ PopulateDecoCategoryMenu:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 8, 0 ; rows, columns db 8, 0 ; rows, columns
db SCROLLINGMENU_ITEMS_NORMAL ; item format db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wd002 ; text pointer dbw 0, wDecoNameBuffer ; text pointer
dba DecorationMenuFunction dba DecorationMenuFunction
dbw 0, 0 dbw 0, NULL
dbw 0, 0 dbw 0, NULL
GetDecorationData: GetDecorationData:
ld hl, DecorationAttributes ld hl, DecorationAttributes

View File

@ -1703,7 +1703,7 @@ Script_givepokemail:
push bc push bc
inc hl inc hl
ld bc, MAIL_MSG_LENGTH ld bc, MAIL_MSG_LENGTH
ld de, wd002 ld de, wMonMailMessageBuffer
ld a, [wScriptBank] ld a, [wScriptBank]
call FarCopyBytes call FarCopyBytes
pop bc pop bc

View File

@ -1377,20 +1377,20 @@ copy_box_data: MACRO
jr z, .done\@ jr z, .done\@
and a and a
jr z, .done\@ jr z, .done\@
ld [de], a ld [de], a ; species
inc de inc de
ld a, [wBillsPC_LoadedBox] ld a, [wBillsPC_LoadedBox]
ld [de], a ld [de], a ; box number
inc de inc de
ld a, [wd003] ld a, [wBillsPCTempListIndex]
ld [de], a ld [de], a ; list index
inc a inc a
ld [wd003], a ld [wBillsPCTempListIndex], a
inc de inc de
inc hl inc hl
ld a, [wd004] ld a, [wBillsPCTempBoxCount]
inc a inc a
ld [wd004], a ld [wBillsPCTempBoxCount], a
jr .loop\@ jr .loop\@
.done\@ .done\@
@ -1399,7 +1399,7 @@ if \1
endc endc
ld a, -1 ld a, -1
ld [de], a ld [de], a
ld a, [wd004] ld a, [wBillsPCTempBoxCount]
inc a inc a
ld [wBillsPC_NumMonsInBox], a ld [wBillsPC_NumMonsInBox], a
ENDM ENDM
@ -1411,8 +1411,8 @@ CopyBoxmonSpecies:
call ByteFill call ByteFill
ld de, wBillsPCPokemonList ld de, wBillsPCPokemonList
xor a xor a
ld [wd003], a ld [wBillsPCTempListIndex], a
ld [wd004], a ld [wBillsPCTempBoxCount], a
ld a, [wBillsPC_LoadedBox] ld a, [wBillsPC_LoadedBox]
and a and a
jr z, .party jr z, .party
@ -2455,7 +2455,7 @@ BillsPC_ChangeBoxSubmenu:
.Name: .Name:
ld b, NAME_BOX ld b, NAME_BOX
ld de, wd002 ld de, wBoxNameBuffer
farcall NamingScreen farcall NamingScreen
call ClearTilemap call ClearTilemap
call LoadStandardFont call LoadStandardFont
@ -2465,13 +2465,13 @@ BillsPC_ChangeBoxSubmenu:
call GetBoxName call GetBoxName
ld e, l ld e, l
ld d, h ld d, h
ld hl, wd002 ld hl, wBoxNameBuffer
ld c, BOX_NAME_LENGTH - 1 ld c, BOX_NAME_LENGTH - 1
call InitString call InitString
ld a, [wMenuSelection] ld a, [wMenuSelection]
dec a dec a
call GetBoxName call GetBoxName
ld de, wd002 ld de, wBoxNameBuffer
call CopyName2 call CopyName2
ret ret

View File

@ -512,7 +512,7 @@ FillMoves:
ld a, [wEvolutionOldSpecies] ld a, [wEvolutionOldSpecies]
and a and a
jr z, .CheckMove jr z, .CheckMove
ld a, [wd002] ld a, [wPrevPartyLevel]
cp b cp b
jr nc, .GetMove jr nc, .GetMove

View File

@ -206,7 +206,7 @@ GivePokeMail::
call AddNTimes call AddNTimes
ld d, h ld d, h
ld e, l ld e, l
ld hl, wd002 ld hl, wMonMailMessageBuffer
ld bc, MAIL_MSG_LENGTH + 1 ld bc, MAIL_MSG_LENGTH + 1
ld a, BANK(sPartyMail) ld a, BANK(sPartyMail)
call OpenSRAM call OpenSRAM

View File

@ -780,7 +780,7 @@ RetrieveMonFromDayCareMan:
call WaitSFX call WaitSFX
call GetBreedMon1LevelGrowth call GetBreedMon1LevelGrowth
ld a, b ld a, b
ld [wd002], a ld [wPrevPartyLevel], a
ld a, e ld a, e
ld [wCurPartyLevel], a ld [wCurPartyLevel], a
xor a xor a
@ -795,12 +795,12 @@ RetrieveMonFromDayCareLady:
call WaitSFX call WaitSFX
call GetBreedMon2LevelGrowth call GetBreedMon2LevelGrowth
ld a, b ld a, b
ld [wd002], a ld [wPrevPartyLevel], a
ld a, e ld a, e
ld [wCurPartyLevel], a ld [wCurPartyLevel], a
ld a, PC_DEPOSIT ld a, PC_DEPOSIT
ld [wPokemonWithdrawDepositParameter], a ld [wPokemonWithdrawDepositParameter], a
jp RetrieveBreedmon jp RetrieveBreedmon ; pointless
RetrieveBreedmon: RetrieveBreedmon:
ld hl, wPartyCount ld hl, wPartyCount

View File

@ -65,7 +65,7 @@ _SwitchPartyMons:
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes call AddNTimes
push hl push hl
ld de, wd002 ld de, wSwitchMonBuffer
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes call CopyBytes
ld a, [wBuffer3] ld a, [wBuffer3]
@ -77,14 +77,14 @@ _SwitchPartyMons:
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes call CopyBytes
pop de pop de
ld hl, wd002 ld hl, wSwitchMonBuffer
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes call CopyBytes
ld a, [wBuffer2] ld a, [wBuffer2]
ld hl, wPartyMonOT ld hl, wPartyMonOT
call SkipNames call SkipNames
push hl push hl
call .CopyNameTowd002 call .CopyNameToSwitchMonBuffer
ld a, [wBuffer3] ld a, [wBuffer3]
ld hl, wPartyMonOT ld hl, wPartyMonOT
call SkipNames call SkipNames
@ -92,13 +92,13 @@ _SwitchPartyMons:
push hl push hl
call .CopyName call .CopyName
pop de pop de
ld hl, wd002 ld hl, wSwitchMonBuffer
call .CopyName call .CopyName
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
ld a, [wBuffer2] ld a, [wBuffer2]
call SkipNames call SkipNames
push hl push hl
call .CopyNameTowd002 call .CopyNameToSwitchMonBuffer
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
ld a, [wBuffer3] ld a, [wBuffer3]
call SkipNames call SkipNames
@ -106,14 +106,14 @@ _SwitchPartyMons:
push hl push hl
call .CopyName call .CopyName
pop de pop de
ld hl, wd002 ld hl, wSwitchMonBuffer
call .CopyName call .CopyName
ld hl, sPartyMail ld hl, sPartyMail
ld a, [wBuffer2] ld a, [wBuffer2]
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call AddNTimes call AddNTimes
push hl push hl
ld de, wd002 ld de, wSwitchMonBuffer
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
ld a, BANK(sPartyMail) ld a, BANK(sPartyMail)
call OpenSRAM call OpenSRAM
@ -127,7 +127,7 @@ _SwitchPartyMons:
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call CopyBytes call CopyBytes
pop de pop de
ld hl, wd002 ld hl, wSwitchMonBuffer
ld bc, MAIL_STRUCT_LENGTH ld bc, MAIL_STRUCT_LENGTH
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
@ -136,8 +136,8 @@ _SwitchPartyMons:
pop hl pop hl
ret ret
.CopyNameTowd002: .CopyNameToSwitchMonBuffer:
ld de, wd002 ld de, wSwitchMonBuffer
.CopyName: .CopyName:
ld bc, NAME_LENGTH ld bc, NAME_LENGTH

View File

@ -50,7 +50,7 @@ Init::
ldh [rOBP1], a ldh [rOBP1], a
ldh [rTMA], a ldh [rTMA], a
ldh [rTAC], a ldh [rTAC], a
ld [wUnusedInitializedToZero], a ld [wBetaTitleSequenceOpeningType], a
ld a, %100 ; Start timer at 4096Hz ld a, %100 ; Start timer at 4096Hz
ldh [rTAC], a ldh [rTAC], a

View File

@ -2,7 +2,7 @@ InitMovementBuffer::
ld [wMovementBufferObject], a ld [wMovementBufferObject], a
xor a xor a
ld [wMovementBufferCount], a ld [wMovementBufferCount], a
ld a, $0 ; useless ld a, $0 ; was BANK(wMovementBuffer) in G/S
ld [wUnusedMovementBufferBank], a ld [wUnusedMovementBufferBank], a
ld a, LOW(wMovementBuffer) ld a, LOW(wMovementBuffer)
ld [wUnusedMovementBufferPointer], a ld [wUnusedMovementBufferPointer], a

View File

@ -57,13 +57,13 @@ Serial::
xor a xor a
ldh [rSB], a ldh [rSB], a
ld a, 3 ld a, 3
ldh [rDIV], a ldh [rDIV], a
.delay_loop
.wait_bit_7
ldh a, [rDIV] ldh a, [rDIV]
bit 7, a bit 7, a
jr nz, .wait_bit_7 jr nz, .delay_loop
ld a, (0 << rSC_ON) | (0 << rSC_CLOCK) ld a, (0 << rSC_ON) | (0 << rSC_CLOCK)
ldh [rSC], a ldh [rSC], a
@ -89,8 +89,9 @@ Serial::
reti reti
Serial_ExchangeBytes:: Serial_ExchangeBytes::
ld a, $1 ld a, TRUE
ldh [hSerialIgnoringInitialData], a ldh [hSerialIgnoringInitialData], a
.loop .loop
ld a, [hl] ld a, [hl]
ldh [hSerialSend], a ldh [hSerialSend], a
@ -98,10 +99,12 @@ Serial_ExchangeBytes::
push bc push bc
ld b, a ld b, a
inc hl inc hl
ld a, $30
ld a, 48
.wait .wait
dec a dec a
jr nz, .wait jr nz, .wait
ldh a, [hSerialIgnoringInitialData] ldh a, [hSerialIgnoringInitialData]
and a and a
ld a, b ld a, b
@ -124,7 +127,7 @@ Serial_ExchangeBytes::
ret ret
Serial_ExchangeByte:: Serial_ExchangeByte::
.loop .timeout_loop
xor a xor a
ldh [hSerialReceivedNewData], a ldh [hSerialReceivedNewData], a
ldh a, [hSerialConnectionStatus] ldh a, [hSerialConnectionStatus]
@ -135,16 +138,16 @@ Serial_ExchangeByte::
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK) ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
ldh [rSC], a ldh [rSC], a
.not_player_2 .not_player_2
.loop2 .loop
ldh a, [hSerialReceivedNewData] ldh a, [hSerialReceivedNewData]
and a and a
jr nz, .reset_ffca jr nz, .await_new_data
ldh a, [hSerialConnectionStatus] ldh a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK cp USING_EXTERNAL_CLOCK
jr nz, .not_player_1_or_wLinkTimeoutFrames_zero jr nz, .not_player_1_or_timed_out
call CheckwLinkTimeoutFramesNonzero call CheckLinkTimeoutFramesNonzero
jr z, .not_player_1_or_wLinkTimeoutFrames_zero jr z, .not_player_1_or_timed_out
call .delay_15_cycles call .ShortDelay
push hl push hl
ld hl, wLinkTimeoutFrames + 1 ld hl, wLinkTimeoutFrames + 1
inc [hl] inc [hl]
@ -154,51 +157,51 @@ Serial_ExchangeByte::
.no_rollover_up .no_rollover_up
pop hl pop hl
call CheckwLinkTimeoutFramesNonzero call CheckLinkTimeoutFramesNonzero
jr nz, .loop2 jr nz, .loop
jp SerialDisconnected jp SerialDisconnected
.not_player_1_or_wLinkTimeoutFrames_zero .not_player_1_or_timed_out
ldh a, [rIE] ldh a, [rIE]
and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
cp 1 << SERIAL cp 1 << SERIAL
jr nz, .loop2 jr nz, .loop
ld a, [wcf5d] ld a, [wLinkByteTimeout]
dec a dec a
ld [wcf5d], a ld [wLinkByteTimeout], a
jr nz, .loop2 jr nz, .loop
ld a, [wcf5d + 1] ld a, [wLinkByteTimeout + 1]
dec a dec a
ld [wcf5d + 1], a ld [wLinkByteTimeout + 1], a
jr nz, .loop2 jr nz, .loop
ldh a, [hSerialConnectionStatus] ldh a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK cp USING_EXTERNAL_CLOCK
jr z, .reset_ffca jr z, .await_new_data
ld a, 255 ld a, 255
.delay_255_cycles .long_delay_loop
dec a dec a
jr nz, .delay_255_cycles jr nz, .long_delay_loop
.reset_ffca .await_new_data
xor a xor a
ldh [hSerialReceivedNewData], a ldh [hSerialReceivedNewData], a
ldh a, [rIE] ldh a, [rIE]
and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
sub 1 << SERIAL sub 1 << SERIAL
jr nz, .rIE_not_equal_8 jr nz, .non_serial_interrupts_enabled
; LOW($5000) ; a == LOW($5000)
ld [wcf5d], a ld [wLinkByteTimeout], a
ld a, HIGH($5000) ld a, HIGH($5000)
ld [wcf5d + 1], a ld [wLinkByteTimeout + 1], a
.rIE_not_equal_8 .non_serial_interrupts_enabled
ldh a, [hSerialReceive] ldh a, [hSerialReceive]
cp SERIAL_NO_DATA_BYTE cp SERIAL_NO_DATA_BYTE
ret nz ret nz
call CheckwLinkTimeoutFramesNonzero call CheckLinkTimeoutFramesNonzero
jr z, .linkTimeoutFrames_zero jr z, .timed_out
push hl push hl
ld hl, wLinkTimeoutFrames + 1 ld hl, wLinkTimeoutFrames + 1
ld a, [hl] ld a, [hl]
@ -210,10 +213,10 @@ Serial_ExchangeByte::
.no_rollover .no_rollover
pop hl pop hl
call CheckwLinkTimeoutFramesNonzero call CheckLinkTimeoutFramesNonzero
jr z, SerialDisconnected jr z, SerialDisconnected
.linkTimeoutFrames_zero .timed_out
ldh a, [rIE] ldh a, [rIE]
and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
cp 1 << SERIAL cp 1 << SERIAL
@ -222,16 +225,16 @@ Serial_ExchangeByte::
ld a, [hl] ld a, [hl]
ldh [hSerialSend], a ldh [hSerialSend], a
call DelayFrame call DelayFrame
jp .loop jp .timeout_loop
.delay_15_cycles .ShortDelay:
ld a, 15 ld a, 15
.delay_cycles .short_delay_loop
dec a dec a
jr nz, .delay_cycles jr nz, .short_delay_loop
ret ret
CheckwLinkTimeoutFramesNonzero:: CheckLinkTimeoutFramesNonzero::
push hl push hl
ld hl, wLinkTimeoutFrames ld hl, wLinkTimeoutFrames
ld a, [hli] ld a, [hli]
@ -239,8 +242,10 @@ CheckwLinkTimeoutFramesNonzero::
pop hl pop hl
ret ret
; This sets wLinkTimeoutFrames to $ffff, since
; a is always 0 when it is called.
SerialDisconnected:: SerialDisconnected::
dec a ; a is always 0 when this is called dec a
ld [wLinkTimeoutFrames], a ld [wLinkTimeoutFrames], a
ld [wLinkTimeoutFrames + 1], a ld [wLinkTimeoutFrames + 1], a
ret ret
@ -281,9 +286,7 @@ Serial_PrintWaitingTextAndSyncAndExchangeNybble::
Serial_SyncAndExchangeNybble:: ; unreferenced Serial_SyncAndExchangeNybble:: ; unreferenced
call LoadTilemapToTempTilemap call LoadTilemapToTempTilemap
callfar PlaceWaitingText callfar PlaceWaitingText
jp WaitLinkTransfer jp WaitLinkTransfer ; pointless
; One "giant" leap for machinekind
WaitLinkTransfer:: WaitLinkTransfer::
ld a, $ff ld a, $ff
@ -291,7 +294,7 @@ WaitLinkTransfer::
.loop .loop
call LinkTransfer call LinkTransfer
call DelayFrame call DelayFrame
call CheckwLinkTimeoutFramesNonzero call CheckLinkTimeoutFramesNonzero
jr z, .check jr z, .check
push hl push hl
ld hl, wLinkTimeoutFrames + 1 ld hl, wLinkTimeoutFrames + 1

109
wram.asm
View File

@ -1341,7 +1341,7 @@ wPlayerLinkAction:: db
wcf57:: db wcf57:: db
ds 3 ds 3
wLinkTimeoutFrames:: dw wLinkTimeoutFrames:: dw
wcf5d:: dw wLinkByteTimeout:: dw
wMonType:: db wMonType:: db
@ -1664,13 +1664,19 @@ SECTION "WRAM 1", WRAMX
wGBCOnlyDecompressBuffer:: ; a $540-byte buffer that continues past this SECTION wGBCOnlyDecompressBuffer:: ; a $540-byte buffer that continues past this SECTION
wUnusedInitializedToZero:: db wBetaTitleSequenceOpeningType::
; This selected the title screen animation (fire/notes) in pokegold-spaceworld.
db
wDefaultSpawnpoint:: db wDefaultSpawnpoint:: db
UNION UNION
; mail temp storage ; mon buffer
wTempMail:: mailmsg wTempMail wBufferMonNick:: ds MON_NAME_LENGTH
wBufferMonOT:: ds NAME_LENGTH
wBufferMon:: party_struct wBufferMon
ds 8
wMonOrItemNameBuffer:: ds 22
NEXTU NEXTU
; poke seer ; poke seer
@ -1686,12 +1692,8 @@ wSeerCaughtData:: db
wSeerCaughtGender:: db wSeerCaughtGender:: db
NEXTU NEXTU
; mon buffer ; mail temp storage
wBufferMonNick:: ds MON_NAME_LENGTH wTempMail:: mailmsg wTempMail
wBufferMonOT:: ds NAME_LENGTH
wBufferMon:: party_struct wBufferMon
ds 8
wMonOrItemNameBuffer::
NEXTU NEXTU
; bug-catching contest ; bug-catching contest
@ -1725,6 +1727,8 @@ wTownMapCursorLandmark:: db
wTownMapCursorObjectPointer:: dw wTownMapCursorObjectPointer:: dw
NEXTU NEXTU
wTownMapCursorCoordinates:: dw wTownMapCursorCoordinates:: dw
wStartFlypoint:: db
wEndFlypoint:: db
ENDU ENDU
NEXTU NEXTU
@ -1780,6 +1784,10 @@ wMobileParticipant1Nickname:: ds NAME_LENGTH_JAPANESE
wMobileParticipant2Nickname:: ds NAME_LENGTH_JAPANESE wMobileParticipant2Nickname:: ds NAME_LENGTH_JAPANESE
wMobileParticipant3Nickname:: ds NAME_LENGTH_JAPANESE wMobileParticipant3Nickname:: ds NAME_LENGTH_JAPANESE
NEXTU
; battle exp gain
wExperienceGained:: ds 3
NEXTU NEXTU
; earthquake data buffer ; earthquake data buffer
wEarthquakeMovementDataBuffer:: ds 5 wEarthquakeMovementDataBuffer:: ds 5
@ -1788,16 +1796,65 @@ NEXTU
; switching items in pack ; switching items in pack
wSwitchItemBuffer:: ds 2 ; may store 1 or 2 bytes wSwitchItemBuffer:: ds 2 ; may store 1 or 2 bytes
NEXTU
; switching pokemon in party
; may store NAME_LENGTH, PARTYMON_STRUCT_LENGTH, or MAIL_STRUCT_LENGTH bytes
wSwitchMonBuffer:: ds 48
NEXTU
; giving pokemon mail
wMonMailMessageBuffer:: ds MAIL_MSG_LENGTH + 1
NEXTU
; bill's pc
UNION
wBoxNameBuffer:: ds BOX_NAME_LENGTH
NEXTU
ds 1
wBillsPCTempListIndex:: db
wBillsPCTempBoxCount:: db
ENDU
NEXTU
; prof. oak's pc
wTempPokedexSeenCount:: db
wTempPokedexCaughtCount:: db
NEXTU
; player's room pc
UNION
wDecoNameBuffer:: ds ITEM_NAME_LENGTH
NEXTU
wNumOwnedDecoCategories:: db
wOwnedDecoCategories:: ds 16
ENDU
NEXTU
; trade
wCurTradePartyMon:: db
wCurOTTradePartyMon:: db
wBufferTrademonNick:: ds MON_NAME_LENGTH
NEXTU
; link battle record data
wLinkBattleRecordBuffer::
wLinkBattleRecordName:: ds NAME_LENGTH
wLinkBattleRecordWins:: dw
wLinkBattleRecordLosses:: dw
wLinkBattleRecordDraws:: dw
NEXTU NEXTU
; miscellaneous ; miscellaneous
wTempDayOfWeek:: wTempDayOfWeek::
wPrevPartyLevel::
wCurBeatUpPartyMon::
wUnownPuzzleCornerTile::
wKeepSevenBiasChance::
wPokeFluteCuredSleep::
wTempRestorePPItem::
wApricorns:: wApricorns::
wKeepSevenBiasChance:: ; used in the slots to handle the favoring of 7 symbol streaks
wSuicuneFrame:: wSuicuneFrame::
db db
ds 2
wStartFlypoint:: db
wEndFlypoint:: db
NEXTU NEXTU
; debug color picker ; debug color picker
@ -1806,21 +1863,11 @@ wDebugColorIsShiny:: db
wDebugColorCurTMHM:: db wDebugColorCurTMHM:: db
NEXTU NEXTU
; link battle record data
wLinkBattleRecordName:: ds NAME_LENGTH
wLinkBattleRecordWins:: dw
wLinkBattleRecordLosses:: dw
wLinkBattleRecordDraws:: dw
NEXTU
; unidentified
wd002:: db
wd003:: db
wd004:: db
; mobile? ; mobile?
ds 1 wd002:: ds 1
ds 2 wd003:: ds 1
wd004:: ds 1
ds 3
wd008:: ds 2 wd008:: ds 2
ds 6 ds 6
wd010:: ds 1 wd010:: ds 1
@ -1842,7 +1889,11 @@ wd032:: ds 1
wd033:: ds 1 wd033:: ds 1
wd034:: ds 2 wd034:: ds 2
wd036:: ds 2 wd036:: ds 2
ds 6
NEXTU
; Every previous NEXTU takes up 60 or fewer bytes,
; except the initial "mon buffer" UNION.
ds 60
UNION UNION
; trainer data ; trainer data