Clean up WRAM, SRAM, and HRAM space (#6)

This commit is contained in:
xCrystal 2023-07-25 19:49:25 +02:00
parent 787caa2147
commit 2d5bd722cd
10 changed files with 19 additions and 335 deletions

View File

@ -51,11 +51,3 @@ DEF MOBILE_EVENT_OBJECT_GS_BALL EQU $b
const BATTLETOWERTEXT_INTRO const BATTLETOWERTEXT_INTRO
const BATTLETOWERTEXT_WIN_TEXT const BATTLETOWERTEXT_WIN_TEXT
const BATTLETOWERTEXT_LOSS_TEXT const BATTLETOWERTEXT_LOSS_TEXT
; sBattleTowerChallengeState values
const_def
const BATTLETOWER_NO_CHALLENGE
const BATTLETOWER_SAVED_AND_LEFT
const BATTLETOWER_CHALLENGE_IN_PROGRESS
const BATTLETOWER_WON_CHALLENGE
const BATTLETOWER_RECEIVED_REWARD

View File

@ -39,7 +39,7 @@
DEF NUM_TILESETS EQU const_value - 1 DEF NUM_TILESETS EQU const_value - 1
; wTileset struct size ; wTileset struct size
DEF TILESET_LENGTH EQU 15 DEF TILESET_LENGTH EQU 13
; roof length (see gfx/tilesets/roofs) ; roof length (see gfx/tilesets/roofs)
DEF ROOF_LENGTH EQU 9 DEF ROOF_LENGTH EQU 9

View File

@ -1,7 +1,6 @@
MACRO tileset MACRO tileset
dba \1GFX, \1Meta, \1Coll dba \1GFX, \1Meta, \1Coll
dw \1Anim dw \1Anim
dw NULL
dw \1PalMap dw \1PalMap
ENDM ENDM

View File

@ -39,8 +39,8 @@ LoadMenuMonIcon:
dw NamingScreen_InitAnimatedMonIcon ; MONICON_NAMINGSCREEN dw NamingScreen_InitAnimatedMonIcon ; MONICON_NAMINGSCREEN
dw MoveList_InitAnimatedMonIcon ; MONICON_MOVES dw MoveList_InitAnimatedMonIcon ; MONICON_MOVES
dw Trade_LoadMonIconGFX ; MONICON_TRADE dw Trade_LoadMonIconGFX ; MONICON_TRADE
dw Mobile_InitAnimatedMonIcon ; MONICON_MOBILE1 dw Unused_GetPartyMenuMonIcon ; MONICON_MOBILE1
dw Mobile_InitPartyMenuBGPal71 ; MONICON_MOBILE2 dw Unused_GetPartyMenuMonIcon ; MONICON_MOBILE2
dw Unused_GetPartyMenuMonIcon ; MONICON_UNUSED dw Unused_GetPartyMenuMonIcon ; MONICON_UNUSED
Unused_GetPartyMenuMonIcon: Unused_GetPartyMenuMonIcon:
@ -80,43 +80,6 @@ Unused_GetPartyMenuMonIcon:
ld [hl], a ld [hl], a
ret ret
Mobile_InitAnimatedMonIcon:
call PartyMenu_InitAnimatedMonIcon
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
ld a, SPRITE_ANIM_SEQ_NULL
ld [hl], a
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld a, 9 * 8
ld [hl], a
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, 9 * 8
ld [hl], a
ret
Mobile_InitPartyMenuBGPal71:
call InitPartyMenuIcon
call SetPartyMonIconAnimSpeed
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
ld a, SPRITE_ANIM_SEQ_NULL
ld [hl], a
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld a, 3 * 8
ld [hl], a
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, 12 * 8
ld [hl], a
ld a, c
ld [wc608], a
ld a, b
ld [wc608 + 1], a
ret
PartyMenu_InitAnimatedMonIcon: PartyMenu_InitAnimatedMonIcon:
call InitPartyMenuIcon call InitPartyMenuIcon
call .SpawnItemIcon call .SpawnItemIcon

View File

@ -278,15 +278,6 @@ _SaveGameData:
call UpdateStackTop call UpdateStackTop
farcall BackupPartyMonMail farcall BackupPartyMonMail
farcall SaveRTC farcall SaveRTC
ld a, BANK(sBattleTowerChallengeState)
call OpenSRAM
ld a, [sBattleTowerChallengeState]
cp BATTLETOWER_RECEIVED_REWARD
jr nz, .ok
xor a
ld [sBattleTowerChallengeState], a
.ok
call CloseSRAM
ret ret
UpdateStackTop: UpdateStackTop:
@ -659,15 +650,6 @@ LoadPlayerData:
ld de, wCurMapData ld de, wCurMapData
ld bc, wCurMapDataEnd - wCurMapData ld bc, wCurMapDataEnd - wCurMapData
call CopyBytes call CopyBytes
call CloseSRAM
ld a, BANK(sBattleTowerChallengeState)
call OpenSRAM
ld a, [sBattleTowerChallengeState]
cp BATTLETOWER_RECEIVED_REWARD
jr nz, .not_4
ld a, BATTLETOWER_WON_CHALLENGE
ld [sBattleTowerChallengeState], a
.not_4
call CloseSRAM call CloseSRAM
ret ret

View File

@ -7,7 +7,6 @@ ResetMapBufferEventFlags::
ResetBikeFlags:: ResetBikeFlags::
xor a xor a
ld hl, wBikeFlags ld hl, wBikeFlags
ld [hli], a
ld [hl], a ld [hl], a
ret ret

View File

@ -285,7 +285,6 @@ SRAM $01
"Link Battle Data" "Link Battle Data"
"SRAM Hall of Fame" "SRAM Hall of Fame"
"SRAM Crystal Data" "SRAM Crystal Data"
"SRAM Battle Tower"
SRAM $02 SRAM $02
"Boxes 1-7" "Boxes 1-7"
SRAM $03 SRAM $03

View File

@ -11,8 +11,6 @@ hRTCHours:: db
hRTCMinutes:: db hRTCMinutes:: db
hRTCSeconds:: db hRTCSeconds:: db
ds 2
hHours:: db hHours:: db
ds 1 ds 1
hMinutes:: db hMinutes:: db
@ -20,12 +18,8 @@ hMinutes:: db
hSeconds:: db hSeconds:: db
ds 1 ds 1
ds 1
hVBlankCounter:: db hVBlankCounter:: db
ds 1
hROMBank:: db hROMBank:: db
hVBlank:: db hVBlank:: db
hMapEntryMethod:: db hMapEntryMethod:: db
@ -44,8 +38,6 @@ hJoyLast:: db
hInMenu:: db hInMenu:: db
ds 1
hPrinter:: db hPrinter:: db
hGraphicStartTile:: db hGraphicStartTile:: db
hMoveMon:: db hMoveMon:: db
@ -86,17 +78,6 @@ hMathBuffer:: ds 5
NEXTU NEXTU
; PrintNum scratch space ; PrintNum scratch space
hPrintNumBuffer:: ds 10 hPrintNumBuffer:: ds 10
NEXTU
; Mystery Gift
hMGExchangedByte:: db
hMGExchangedWord:: dw
hMGNumBits:: db
hMGChecksum:: dw
ds 1
hMGUnusedMsgLength:: db
hMGRole:: db
hMGStatusFlags:: db
ENDU ENDU
UNION UNION
@ -145,8 +126,6 @@ hSPBuffer:: dw
hBGMapUpdate:: db hBGMapUpdate:: db
hBGMapTileCount:: db hBGMapTileCount:: db
ds 1
hMapAnims:: db hMapAnims:: db
hTileAnimFrame:: db hTileAnimFrame:: db
@ -172,5 +151,3 @@ if DEF(_DEBUG)
hDebugRoomMenuPage:: hDebugRoomMenuPage::
endc endc
hClockResetTrigger:: db hClockResetTrigger:: db
ds 19

View File

@ -32,7 +32,6 @@ sMailbox{d:n}Backup:: mailmsg sMailbox{d:n}Backup
endr endr
sRTCStatusFlags:: db sRTCStatusFlags:: db
ds 7
sLuckyNumberDay:: db sLuckyNumberDay:: db
sLuckyIDNumber:: dw sLuckyIDNumber:: dw
@ -49,8 +48,6 @@ sBackupCurMapData:: ds wCurMapDataEnd - wCurMapData
sBackupPokemonData:: ds wPokemonDataEnd - wPokemonData sBackupPokemonData:: ds wPokemonDataEnd - wPokemonData
sBackupGameDataEnd:: sBackupGameDataEnd::
ds $18a
sBackupChecksum:: dw sBackupChecksum:: dw
sBackupCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption sBackupCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption
@ -78,8 +75,6 @@ sCurMapData:: ds wCurMapDataEnd - wCurMapData
sPokemonData:: ds wPokemonDataEnd - wPokemonData sPokemonData:: ds wPokemonDataEnd - wPokemonData
sGameDataEnd:: sGameDataEnd::
ds $18a
sChecksum:: dw sChecksum:: dw
sCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption sCheckValue2:: db ; loaded with SAVE_CHECK_VALUE_2, used to check save corruption
@ -89,8 +84,6 @@ SECTION "Active Box", SRAM
sBox:: box sBox sBox:: box sBox
ds $100
SECTION "Link Battle Data", SRAM SECTION "Link Battle Data", SRAM
@ -122,34 +115,6 @@ SECTION "SRAM Crystal Data", SRAM
sCrystalData:: ds wCrystalDataEnd - wCrystalData sCrystalData:: ds wCrystalDataEnd - wCrystalData
SECTION "SRAM Battle Tower", SRAM
; Battle Tower data must be in SRAM because you can save and leave between battles
sBattleTowerChallengeState::
; 0: normal
; 2: battle tower
db
sNrOfBeatenBattleTowerTrainers:: db
sBTChoiceOfLevelGroup:: db
; Battle Tower trainers are saved here, so nobody appears more than once
sBTTrainers:: ds BATTLETOWER_STREAK_LENGTH
sBattleTowerSaveFileFlags:: db
sBattleTowerReward:: db
sBTMonOfTrainers::
; team of previous trainer
; sBTMonPrevTrainer1 - sBTMonPrevTrainer3
for n, 1, BATTLETOWER_PARTY_LENGTH + 1
sBTMonPrevTrainer{d:n}:: db
endr
; team of preprevious trainer
; sBTMonPrevPrevTrainer1 - sBTMonPrevPrevTrainer3
for n, 1, BATTLETOWER_PARTY_LENGTH + 1
sBTMonPrevPrevTrainer{d:n}:: db
endr
; The PC boxes will not fit into one SRAM bank, ; The PC boxes will not fit into one SRAM bank,
; so they use multiple SECTIONs ; so they use multiple SECTIONs
DEF box_n = 0 DEF box_n = 0

View File

@ -114,8 +114,6 @@ SECTION "WRAM", WRAM0
wLZAddress:: dw wLZAddress:: dw
wLZBank:: db wLZBank:: db
ds 1
wBoxAlignment:: db wBoxAlignment:: db
wInputType:: db wInputType:: db
@ -131,8 +129,6 @@ wUnusedScriptByte:: db
wMapTimeOfDay:: db wMapTimeOfDay:: db
ds 3
wPrinterConnectionOpen:: db wPrinterConnectionOpen:: db
wPrinterOpcode:: db wPrinterOpcode:: db
wPrevDexEntry:: db wPrevDexEntry:: db
@ -150,16 +146,12 @@ wScriptVar:: db
wPlayerNextMovement:: db wPlayerNextMovement:: db
wPlayerMovement:: db wPlayerMovement:: db
ds 2
wMovementObject:: wMovementObject::
db db
wMovementDataBank:: db wMovementDataBank:: db
wMovementDataAddress:: dw wMovementDataAddress:: dw
wIndexedMovement2Pointer:: dw wIndexedMovement2Pointer:: dw
ds 2
wContinueReadingMovement:: db wContinueReadingMovement:: db
UNION UNION
@ -167,7 +159,6 @@ wObjectPriorities:: ds NUM_OBJECT_STRUCTS
NEXTU NEXTU
wMovementPointer:: dw wMovementPointer:: dw
ds 3
wTempObjectCopyMapObjectIndex:: db wTempObjectCopyMapObjectIndex:: db
wTempObjectCopySprite:: db wTempObjectCopySprite:: db
wTempObjectCopySpriteVTile:: db wTempObjectCopySpriteVTile:: db
@ -179,8 +170,6 @@ wTempObjectCopyY:: db
wTempObjectCopyRadius:: db wTempObjectCopyRadius:: db
ENDU ENDU
ds 1
wTileDown:: db wTileDown:: db
wTileUp:: db wTileUp:: db
wTileLeft:: db wTileLeft:: db
@ -237,8 +226,6 @@ wGlobalAnimXOffset:: db
wSpriteAnimDataEnd:: wSpriteAnimDataEnd::
ds 11
SECTION "Sprites", WRAM0 SECTION "Sprites", WRAM0
@ -288,10 +275,7 @@ wBattleMonNickname:: ds MON_NAME_LENGTH
wBattleMon:: battle_struct wBattleMon wBattleMon:: battle_struct wBattleMon
ds 2
wWildMon:: db wWildMon:: db
ds 1
wEnemyTrainerItem1:: db wEnemyTrainerItem1:: db
wEnemyTrainerItem2:: db wEnemyTrainerItem2:: db
@ -369,15 +353,12 @@ wBattleScriptBufferAddress:: dw
wTurnEnded:: db wTurnEnded:: db
ds 1
wPlayerStats:: wPlayerStats::
wPlayerAttack:: dw wPlayerAttack:: dw
wPlayerDefense:: dw wPlayerDefense:: dw
wPlayerSpeed:: dw wPlayerSpeed:: dw
wPlayerSpAtk:: dw wPlayerSpAtk:: dw
wPlayerSpDef:: dw wPlayerSpDef:: dw
ds 1
wEnemyStats:: wEnemyStats::
wEnemyAttack:: dw wEnemyAttack:: dw
@ -385,7 +366,6 @@ wEnemyDefense:: dw
wEnemySpeed:: dw wEnemySpeed:: dw
wEnemySpAtk:: dw wEnemySpAtk:: dw
wEnemySpDef:: dw wEnemySpDef:: dw
ds 1
wPlayerStatLevels:: wPlayerStatLevels::
wPlayerAtkLevel:: db wPlayerAtkLevel:: db
@ -395,7 +375,7 @@ wPlayerSAtkLevel:: db
wPlayerSDefLevel:: db wPlayerSDefLevel:: db
wPlayerAccLevel:: db wPlayerAccLevel:: db
wPlayerEvaLevel:: db wPlayerEvaLevel:: db
ds 1 ds 1 ; NUM_LEVEL_STATS
wEnemyStatLevels:: wEnemyStatLevels::
wEnemyAtkLevel:: db wEnemyAtkLevel:: db
@ -405,17 +385,15 @@ wEnemySAtkLevel:: db
wEnemySDefLevel:: db wEnemySDefLevel:: db
wEnemyAccLevel:: db wEnemyAccLevel:: db
wEnemyEvaLevel:: db wEnemyEvaLevel:: db
ds 1 ds 1 ; NUM_LEVEL_STATS
wEnemyTurnsTaken:: db wEnemyTurnsTaken:: db
wPlayerTurnsTaken:: db wPlayerTurnsTaken:: db
ds 1
wPlayerSubstituteHP:: db wPlayerSubstituteHP:: db
wEnemySubstituteHP:: db wEnemySubstituteHP:: db
wUnusedPlayerLockedMove:: db wUnusedPlayerLockedMove:: db
ds 1
wCurPlayerMove:: db wCurPlayerMove:: db
wCurEnemyMove:: db wCurEnemyMove:: db
@ -425,7 +403,7 @@ wLinkBattleRNCount::
db db
wEnemyItemState:: db wEnemyItemState:: db
ds 2
wCurEnemyMoveNum:: db wCurEnemyMoveNum:: db
wEnemyHPAtTimeOfPlayerSwitch:: dw wEnemyHPAtTimeOfPlayerSwitch:: dw
@ -433,7 +411,7 @@ wPayDayMoney:: ds 3
wSafariMonAngerCount:: db ; unreferenced wSafariMonAngerCount:: db ; unreferenced
wSafariMonEating:: db wSafariMonEating:: db
ds 1
wEnemyBackupDVs:: dw ; used when enemy is transformed wEnemyBackupDVs:: dw ; used when enemy is transformed
wAlreadyDisobeyed:: db wAlreadyDisobeyed:: db
@ -469,14 +447,10 @@ wEnemyScreens::
wPlayerSafeguardCount:: db wPlayerSafeguardCount:: db
wPlayerLightScreenCount:: db wPlayerLightScreenCount:: db
wPlayerReflectCount:: db wPlayerReflectCount:: db
ds 1
wEnemySafeguardCount:: db wEnemySafeguardCount:: db
wEnemyLightScreenCount:: db wEnemyLightScreenCount:: db
wEnemyReflectCount:: db wEnemyReflectCount:: db
ds 1
ds 1
wBattleWeather:: wBattleWeather::
; 00 normal ; 00 normal
@ -579,7 +553,6 @@ NEXTU
wDebugMiddleColors:: wDebugMiddleColors::
wDebugLightColor:: ds 2 wDebugLightColor:: ds 2
wDebugDarkColor:: ds 2 wDebugDarkColor:: ds 2
ds 6
wDebugRedChannel:: db wDebugRedChannel:: db
wDebugGreenChannel:: db wDebugGreenChannel:: db
wDebugBlueChannel:: db wDebugBlueChannel:: db
@ -602,17 +575,6 @@ wUnknownMon:: party_struct wUnknownMon
wUnknownMonOT:: ds NAME_LENGTH_JAPANESE - 1 wUnknownMonOT:: ds NAME_LENGTH_JAPANESE - 1
wUnknownMonNick:: ds NAME_LENGTH_JAPANESE - 1 wUnknownMonNick:: ds NAME_LENGTH_JAPANESE - 1
wUnknownMonMail:: mailmsg_jp wUnknownMonMail wUnknownMonMail:: mailmsg_jp wUnknownMonMail
NEXTU
wc608:: ds 7
wc60f:: ds 9
wc618:: ds 48
wc648:: ds 2
wc64a:: ds 62
wc688:: ds 2
wc68a:: ds 15
wc699:: ds 15
wc6a8:: ds 40
ENDU ENDU
; This union spans 280 bytes. ; This union spans 280 bytes.
@ -642,14 +604,8 @@ wDexListingCursorBackup:: db
wBackupDexListingCursor:: db wBackupDexListingCursor:: db
wBackupDexListingPage:: db wBackupDexListingPage:: db
wDexCurLocation:: db wDexCurLocation:: db
if DEF(_CRYSTAL11)
wPokedexStatus:: db wPokedexStatus:: db
wPokedexDataEnd:: wPokedexDataEnd::
else
wPokedexDataEnd::
ds 1
endc
ds 2
NEXTU NEXTU
; pokegear ; pokegear
@ -703,10 +659,8 @@ wCurReelStopped:: ds 3
wPayout:: dw wPayout:: dw
wCurReelXCoord:: db wCurReelXCoord:: db
wCurReelYCoord:: db wCurReelYCoord:: db
ds 2
wSlotBuildingMatch:: db wSlotBuildingMatch:: db
wSlotsDataEnd:: wSlotsDataEnd::
ds 28
wSlotsEnd:: wSlotsEnd::
NEXTU NEXTU
@ -720,7 +674,6 @@ wDiscardPileEnd::
; beta poker game ; beta poker game
wBetaPokerSGBPals:: dw wBetaPokerSGBPals:: dw
ds 1
wBetaPokerSGBAttr:: db wBetaPokerSGBAttr:: db
wBetaPokerSGBCol:: db wBetaPokerSGBCol:: db
wBetaPokerSGBRow:: db wBetaPokerSGBRow:: db
@ -788,11 +741,9 @@ wPrinterSendByteCounter:: dw
; tilemap backup? ; tilemap backup?
wPrinterTilemapBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH wPrinterTilemapBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH
wPrinterStatus:: db wPrinterStatus:: db
ds 1
; High nibble is for margin before the image, low nibble is for after. ; High nibble is for margin before the image, low nibble is for after.
wPrinterMargins:: db wPrinterMargins:: db
wPrinterExposureTime:: db wPrinterExposureTime:: db
ds 16
wGameboyPrinterRAMEnd:: wGameboyPrinterRAMEnd::
@ -1002,8 +953,6 @@ wEnemyHPPal:: db
wHPPals:: ds PARTY_LENGTH wHPPals:: ds PARTY_LENGTH
wCurHPPal:: db wCurHPPal:: db
ds 7
wSGBPals:: ds 48 wSGBPals:: ds 48
wAttrmap:: wAttrmap::
@ -1020,9 +969,7 @@ wAttrmapEnd::
UNION UNION
; addresses dealing with serial comms ; addresses dealing with serial comms
ds 1
wcf42:: db wcf42:: db
ds 1
wcf44:: db wcf44:: db
wcf45:: db wcf45:: db
@ -1034,10 +981,8 @@ ENDU
UNION UNION
wOtherPlayerLinkMode:: db wOtherPlayerLinkMode:: db
wOtherPlayerLinkAction:: db wOtherPlayerLinkAction:: db
ds 3
wPlayerLinkAction:: db wPlayerLinkAction:: db
wUnusedLinkAction:: db wUnusedLinkAction:: db
ds 3
NEXTU NEXTU
wLinkReceivedSyncBuffer:: ds 5 wLinkReceivedSyncBuffer:: ds 5
wLinkPlayerSyncBuffer:: ds 5 wLinkPlayerSyncBuffer:: ds 5
@ -1051,10 +996,7 @@ wCurSpecies:: db
wNamedObjectType:: db wNamedObjectType:: db
ds 1 wJumptableIndex:: db
wJumptableIndex::
db
UNION UNION
; intro data ; intro data
@ -1075,14 +1017,7 @@ wCreditsLYOverride:: db
NEXTU NEXTU
; pokedex ; pokedex
wPrevDexEntryJumptableIndex:: db wPrevDexEntryJumptableIndex:: db
if DEF(_CRYSTAL11)
wPrevDexEntryBackup:: db wPrevDexEntryBackup:: db
else
; BUG: Crystal 1.0 reused the same byte in WRAM for
; wPokedexStatus and wPrevDexEntryBackup.
wPokedexStatus::
wPrevDexEntryBackup:: db
endc
wUnusedPokedexByte:: db wUnusedPokedexByte:: db
NEXTU NEXTU
@ -1106,7 +1041,6 @@ wTrainerCardBadgeAttributes:: db
NEXTU NEXTU
; slot machine ; slot machine
wSlotsDelay:: db wSlotsDelay:: db
ds 1
wUnusedSlotReelIconDelay:: db wUnusedSlotReelIconDelay:: db
NEXTU NEXTU
@ -1281,8 +1215,6 @@ wGameTimerPaused::
; bit 7: something mobile ; bit 7: something mobile
db db
ds 1
wJoypadDisable:: wJoypadDisable::
; bits 4, 6, or 7 can be used to disable joypad input ; bits 4, 6, or 7 can be used to disable joypad input
; bit 4 ; bit 4
@ -1290,15 +1222,11 @@ wJoypadDisable::
; bit 7: ongoing sgb data transfer ; bit 7: ongoing sgb data transfer
db db
ds 1
wInBattleTowerBattle:: wInBattleTowerBattle::
; 0 not in BattleTower-Battle ; 0 not in BattleTower-Battle
; 1 BattleTower-Battle ; 1 BattleTower-Battle
db db
ds 1
wFXAnimID:: dw wFXAnimID:: dw
wPlaceBallsX:: db wPlaceBallsX:: db
@ -1313,8 +1241,6 @@ wOBP1:: db
wNumHits:: db wNumHits:: db
ds 1
wOptions:: wOptions::
; bit 0-2: number of frames to delay when printing text ; bit 0-2: number of frames to delay when printing text
; fast 1; mid 3; slow 5 ; fast 1; mid 3; slow 5
@ -1371,7 +1297,6 @@ SECTION UNION "Miscellaneous WRAM 1", WRAMX
wBufferMonNickname:: ds MON_NAME_LENGTH wBufferMonNickname:: ds MON_NAME_LENGTH
wBufferMonOT:: ds NAME_LENGTH wBufferMonOT:: ds NAME_LENGTH
wBufferMon:: party_struct wBufferMon wBufferMon:: party_struct wBufferMon
ds 8
wMonOrItemNameBuffer:: ds NAME_LENGTH wMonOrItemNameBuffer:: ds NAME_LENGTH
ds NAME_LENGTH ds NAME_LENGTH
@ -1406,7 +1331,6 @@ wBugContestResults::
bugcontestwinner wBugContestThirdPlace bugcontestwinner wBugContestThirdPlace
wBugContestWinnersEnd:: wBugContestWinnersEnd::
bugcontestwinner wBugContestTemp bugcontestwinner wBugContestTemp
ds 4
wBugContestWinnerName:: ds NAME_LENGTH wBugContestWinnerName:: ds NAME_LENGTH
@ -1454,7 +1378,6 @@ wNextRadioLine:: db
wRadioTextDelay:: db wRadioTextDelay:: db
wNumRadioLinesPrinted:: db wNumRadioLinesPrinted:: db
wOaksPKMNTalkSegmentCounter:: db wOaksPKMNTalkSegmentCounter:: db
ds 5
wRadioText:: ds 2 * SCREEN_WIDTH wRadioText:: ds 2 * SCREEN_WIDTH
@ -1494,7 +1417,6 @@ wPrintedUnownTileDest:: ds 1 tiles
SECTION UNION "Miscellaneous WRAM 1", WRAMX SECTION UNION "Miscellaneous WRAM 1", WRAMX
; trainer HUD data ; trainer HUD data
ds 1
wPlaceBallsDirection:: db wPlaceBallsDirection:: db
wTrainerHUDTiles:: ds 4 wTrainerHUDTiles:: ds 4
@ -1543,7 +1465,6 @@ SECTION UNION "Miscellaneous WRAM 1", WRAMX
UNION UNION
wBoxNameBuffer:: ds BOX_NAME_LENGTH wBoxNameBuffer:: ds BOX_NAME_LENGTH
NEXTU NEXTU
ds 1
wBillsPCTempListIndex:: db wBillsPCTempListIndex:: db
wBillsPCTempBoxCount:: db wBillsPCTempBoxCount:: db
ENDU ENDU
@ -1608,12 +1529,6 @@ wDebugColorIsShiny:: db
wDebugColorCurTMHM:: db wDebugColorCurTMHM:: db
SECTION UNION "Miscellaneous WRAM 1", WRAMX
; Every previous SECTION UNION takes up 60 or fewer bytes,
; except the initial "mon buffer" one.
ds 60
UNION UNION
; trainer data ; trainer data
wSeenTrainerBank:: db wSeenTrainerBank:: db
@ -1668,7 +1583,6 @@ wCurCoordEvent::
wCurCoordEventSceneID:: db wCurCoordEventSceneID:: db
wCurCoordEventMapY:: db wCurCoordEventMapY:: db
wCurCoordEventMapX:: db wCurCoordEventMapX:: db
ds 1
wCurCoordEventScriptAddr:: dw wCurCoordEventScriptAddr:: dw
NEXTU NEXTU
@ -1700,12 +1614,10 @@ wFacingDirection:: db
wWalkingX:: db wWalkingX:: db
wWalkingY:: db wWalkingY:: db
wWalkingTile:: db wWalkingTile:: db
ds 6
wPlayerTurningDirection:: db wPlayerTurningDirection:: db
NEXTU NEXTU
; std script buffer ; std script buffer
ds 1
wJumpStdScriptBuffer:: ds 3 wJumpStdScriptBuffer:: ds 3
NEXTU NEXTU
@ -1717,12 +1629,10 @@ wAvailableCallers:: ds CONTACT_LIST_SIZE
NEXTU NEXTU
; phone caller contact ; phone caller contact
ds 1
wCallerContact:: ds PHONE_CONTACT_SIZE wCallerContact:: ds PHONE_CONTACT_SIZE
NEXTU NEXTU
; backup menu data ; backup menu data
ds 7
wMenuCursorPositionBackup:: db wMenuCursorPositionBackup:: db
wMenuScrollPositionBackup:: db wMenuScrollPositionBackup:: db
@ -1734,8 +1644,6 @@ wPoisonStepPartyFlags:: ds PARTY_LENGTH
wPoisonStepDataEnd:: wPoisonStepDataEnd::
ENDU ENDU
ds 23
SECTION "More WRAM 1", WRAMX SECTION "More WRAM 1", WRAMX
@ -1749,8 +1657,6 @@ wStringBuffer5:: ds STRING_BUFFER_LENGTH
wBattleMenuCursorPosition:: db wBattleMenuCursorPosition:: db
ds 1
wCurBattleMon:: wCurBattleMon::
; index of the player's mon currently in battle (0-5) ; index of the player's mon currently in battle (0-5)
db db
@ -1767,7 +1673,6 @@ wBallsPocketCursor:: db
wTMHMPocketCursor:: db wTMHMPocketCursor:: db
wPCItemsScrollPosition:: db wPCItemsScrollPosition:: db
ds 1
wItemsPocketScrollPosition:: db wItemsPocketScrollPosition:: db
wKeyItemsPocketScrollPosition:: db wKeyItemsPocketScrollPosition:: db
wBallsPocketScrollPosition:: db wBallsPocketScrollPosition:: db
@ -1865,8 +1770,6 @@ wSpriteFlags:: db
wHandlePlayerStep:: db wHandlePlayerStep:: db
ds 1
wPartyMenuActionText:: db wPartyMenuActionText:: db
wItemAttributeValue:: db wItemAttributeValue:: db
@ -1875,8 +1778,6 @@ wCurPartyLevel:: db
wScrollingMenuListSize:: db wScrollingMenuListSize:: db
ds 1
; used when following a map warp ; used when following a map warp
wNextWarp:: db wNextWarp:: db
wNextMapGroup:: db wNextMapGroup:: db
@ -1901,7 +1802,6 @@ wUsedSprites:: ds SPRITE_GFX_LIST_CAPACITY * 2
wUsedSpritesEnd:: wUsedSpritesEnd::
NEXTU NEXTU
ds 31
wd173:: db ; related to command queue type 3 wd173:: db ; related to command queue type 3
ENDU ENDU
@ -1943,7 +1843,6 @@ wTilesetBlocksAddress:: dw
wTilesetCollisionBank:: db wTilesetCollisionBank:: db
wTilesetCollisionAddress:: dw wTilesetCollisionAddress:: dw
wTilesetAnim:: dw ; bank 3f wTilesetAnim:: dw ; bank 3f
ds 2 ; unused
wTilesetPalettes:: dw ; bank 3f wTilesetPalettes:: dw ; bank 3f
wTilesetEnd:: wTilesetEnd::
assert wTilesetEnd - wTileset == TILESET_LENGTH assert wTilesetEnd - wTileset == TILESET_LENGTH
@ -2024,7 +1923,6 @@ wCutWhirlpoolReplacementBlock:: db
wCutWhirlpoolAnimationType:: wCutWhirlpoolAnimationType::
wStrengthSpecies:: wStrengthSpecies::
wFishingResult:: db wFishingResult:: db
ds 1
wFieldMoveDataEnd:: wFieldMoveDataEnd::
NEXTU NEXTU
@ -2080,7 +1978,6 @@ wRestartClockMin:: db
NEXTU NEXTU
; link ; link
ds 9
wLinkBattleRNPreamble:: ds SERIAL_RN_PREAMBLE_LENGTH wLinkBattleRNPreamble:: ds SERIAL_RN_PREAMBLE_LENGTH
wLinkBattleRNs:: ds SERIAL_RNS_LENGTH wLinkBattleRNs:: ds SERIAL_RNS_LENGTH
@ -2091,7 +1988,6 @@ wRegisteredPhoneNumbers::
wListMovesLineSpacing:: db wListMovesLineSpacing:: db
wSwitchMonTo:: db wSwitchMonTo:: db
wSwitchMonFrom:: db wSwitchMonFrom:: db
ds 4
wCurEnemyItem:: db wCurEnemyItem:: db
NEXTU NEXTU
@ -2175,8 +2071,6 @@ wCurBaseDataEnd::
wCurDamage:: dw wCurDamage:: dw
ds 2
wMornEncounterRate:: db wMornEncounterRate:: db
wDayEncounterRate:: db wDayEncounterRate:: db
wNiteEncounterRate:: db wNiteEncounterRate:: db
@ -2210,8 +2104,6 @@ wMonTriedToEvolve:: db
wTimeOfDay:: db wTimeOfDay:: db
ds 1
SECTION "Enemy Party", WRAMX SECTION "Enemy Party", WRAMX
@ -2227,7 +2119,6 @@ NEXTU
wOTPartyData:: wOTPartyData::
wOTPlayerName:: ds NAME_LENGTH wOTPlayerName:: ds NAME_LENGTH
wOTPlayerID:: dw wOTPlayerID:: dw
ds 8
wOTPartyCount:: db wOTPartyCount:: db
wOTPartySpecies:: ds PARTY_LENGTH wOTPartySpecies:: ds PARTY_LENGTH
wOTPartyEnd:: db ; older code doesn't check PartyCount wOTPartyEnd:: db ; older code doesn't check PartyCount
@ -2266,8 +2157,6 @@ wDudeNumBalls:: db
wDudeBalls:: ds 2 * 4 + 1 wDudeBalls:: ds 2 * 4 + 1
ENDU ENDU
ds 4
wBattleAction:: db wBattleAction:: db
wLinkBattleSentAction:: db wLinkBattleSentAction:: db
@ -2277,7 +2166,6 @@ wMapEventStatus:: db
wScriptFlags:: wScriptFlags::
; bit 3: run deferred script ; bit 3: run deferred script
db db
ds 1
wScriptFlags2:: wScriptFlags2::
; bit 0: count steps ; bit 0: count steps
; bit 1: coord events ; bit 1: coord events
@ -2293,7 +2181,7 @@ wScriptPos:: dw
wScriptStackSize:: db wScriptStackSize:: db
wScriptStack:: ds 3 * 5 wScriptStack:: ds 3 * 5
ds 1
wScriptDelay:: db wScriptDelay:: db
wDeferredScriptBank:: wDeferredScriptBank::
@ -2302,14 +2190,13 @@ wScriptTextBank::
wDeferredScriptAddr:: wDeferredScriptAddr::
wScriptTextAddr:: wScriptTextAddr::
dw dw
ds 1
wWildEncounterCooldown:: db wWildEncounterCooldown:: db
wXYComparePointer:: dw wXYComparePointer:: dw
ds 4
wBattleScriptFlags:: db wBattleScriptFlags:: db
ds 1
wPlayerSpriteSetupFlags:: wPlayerSpriteSetupFlags::
; bit 7: if set, cancel wPlayerAction ; bit 7: if set, cancel wPlayerAction
; bit 6: RefreshMapSprites doesn't reload player sprite ; bit 6: RefreshMapSprites doesn't reload player sprite
@ -2322,23 +2209,15 @@ wMapReentryScriptQueueFlag:: db
wMapReentryScriptBank:: db wMapReentryScriptBank:: db
wMapReentryScriptAddress:: dw wMapReentryScriptAddress:: dw
ds 4
wTimeCyclesSinceLastCall:: db wTimeCyclesSinceLastCall:: db
wReceiveCallDelay_MinsRemaining:: db wReceiveCallDelay_MinsRemaining:: db
wReceiveCallDelay_StartTime:: ds 3 wReceiveCallDelay_StartTime:: ds 3
ds 3
wBugContestMinsRemaining:: db wBugContestMinsRemaining:: db
wBugContestSecsRemaining:: db wBugContestSecsRemaining:: db
ds 2
wMapStatusEnd:: wMapStatusEnd::
ds 2
wCrystalData:: wCrystalData::
wPlayerGender:: wPlayerGender::
; bit 0: ; bit 0:
@ -2376,8 +2255,6 @@ wStartSecond:: db
wRTC:: ds 4 wRTC:: ds 4
ds 4
wDST:: wDST::
; bit 7: dst ; bit 7: dst
db db
@ -2389,12 +2266,8 @@ wGameTimeMinutes:: db
wGameTimeSeconds:: db wGameTimeSeconds:: db
wGameTimeFrames:: db wGameTimeFrames:: db
ds 2
wCurDay:: db wCurDay:: db
ds 1
wObjectFollow_Leader:: db wObjectFollow_Leader:: db
wObjectFollow_Follower:: db wObjectFollow_Follower:: db
wCenteredObject:: db wCenteredObject:: db
@ -2410,8 +2283,6 @@ endr
wCmdQueue:: ds CMDQUEUE_CAPACITY * CMDQUEUE_ENTRY_SIZE wCmdQueue:: ds CMDQUEUE_CAPACITY * CMDQUEUE_ENTRY_SIZE
ds 40
wMapObjects:: wMapObjects::
wPlayerObject:: map_object wPlayer ; player is map object 0 wPlayerObject:: map_object wPlayer ; player is map object 0
; wMap1Object - wMap15Object ; wMap1Object - wMap15Object
@ -2424,15 +2295,12 @@ wObjectMasks:: ds NUM_OBJECTS
wVariableSprites:: ds $100 - SPRITE_VARS wVariableSprites:: ds $100 - SPRITE_VARS
wEnteredMapFromContinue:: db wEnteredMapFromContinue:: db
ds 2
wTimeOfDayPal:: db wTimeOfDayPal:: db
ds 4
wTimeOfDayPalFlags:: db wTimeOfDayPalFlags:: db
wTimeOfDayPalset:: db wTimeOfDayPalset:: db
wCurTimeOfDay:: db wCurTimeOfDay:: db
ds 1
wSecretID:: dw wSecretID:: dw
wStatusFlags:: wStatusFlags::
; bit 0: pokedex ; bit 0: pokedex
@ -2495,79 +2363,38 @@ wPokegearFlags::
db db
wRadioTuningKnob:: db wRadioTuningKnob:: db
wLastDexMode:: db wLastDexMode:: db
ds 1
wWhichRegisteredItem:: db wWhichRegisteredItem:: db
wRegisteredItem:: db wRegisteredItem:: db
wPlayerState:: db wPlayerState:: db
wHallOfFameCount:: db wHallOfFameCount:: db
ds 1
wTradeFlags:: flag_array NUM_NPC_TRADES wTradeFlags:: flag_array NUM_NPC_TRADES
ds 1
wMooMooBerries:: db wMooMooBerries:: db
wUndergroundSwitchPositions:: db wUndergroundSwitchPositions:: db
wFarfetchdPosition:: db wFarfetchdPosition:: db
ds 13
; map scene ids (data/maps/scenes.asm:MapScenes) ; map scene ids (data/maps/scenes.asm:MapScenes)
; wPokecenter2FSceneID:: db ; wPokecenter2FSceneID:: db
ds 49
; fight counts
wJackFightCount:: db
wBeverlyFightCount:: db ; unreferenced
wHueyFightCount:: db
wGavenFightCount:: db
wBethFightCount:: db
wJoseFightCount:: db
wReenaFightCount:: db
wJoeyFightCount:: db
wWadeFightCount:: db
wRalphFightCount:: db
wLizFightCount:: db
wAnthonyFightCount:: db
wToddFightCount:: db
wGinaFightCount:: db
wIrwinFightCount:: db ; unreferenced
wArnieFightCount:: db
wAlanFightCount:: db
wDanaFightCount:: db
wChadFightCount:: db
wDerekFightCount:: db ; unreferenced
wTullyFightCount:: db
wBrentFightCount:: db
wTiffanyFightCount:: db
wVanceFightCount:: db
wWiltonFightCount:: db
wKenjiFightCount:: db ; unreferenced
wParryFightCount:: db
wErinFightCount:: db
ds 100
wEventFlags:: flag_array NUM_EVENTS wEventFlags:: flag_array NUM_EVENTS
wCurBox:: db wCurBox:: db
ds 2
wBoxNames:: ds BOX_NAME_LENGTH * NUM_BOXES wBoxNames:: ds BOX_NAME_LENGTH * NUM_BOXES
wCelebiEvent:: wCelebiEvent::
; bit 2: forest is restless ; bit 2: forest is restless
db db
ds 1
wBikeFlags:: wBikeFlags::
; bit 0: using strength ; bit 0: using strength
; bit 1: always on bike ; bit 1: always on bike
; bit 2: downhill ; bit 2: downhill
db db
ds 1 ; cleared along with wBikeFlags by ResetBikeFlags
wCurMapSceneScriptPointer:: dw wCurMapSceneScriptPointer:: dw
@ -2585,8 +2412,6 @@ wCurMapSceneScriptsPointer:: dw
wCurMapCallbackCount:: db wCurMapCallbackCount:: db
wCurMapCallbacksPointer:: dw wCurMapCallbacksPointer:: dw
ds 2
; Sprite id of each decoration ; Sprite id of each decoration
wDecoBed:: db wDecoBed:: db
wDecoCarpet:: db wDecoCarpet:: db
@ -2606,39 +2431,29 @@ wDailyResetTimer:: dw
wDailyFlags1:: db wDailyFlags1:: db
wDailyFlags2:: db wDailyFlags2:: db
wSwarmFlags:: db wSwarmFlags:: db
ds 2
wTimerEventStartDay:: db wTimerEventStartDay:: db
ds 3
wFruitTreeFlags:: flag_array NUM_FRUIT_TREES wFruitTreeFlags:: flag_array NUM_FRUIT_TREES
ds 2
wLuckyNumberDayTimer:: dw wLuckyNumberDayTimer:: dw
ds 2
wSpecialPhoneCallID:: db wSpecialPhoneCallID:: db
ds 3
wBugContestStartTime:: ds 4 ; day, hour, min, sec wBugContestStartTime:: ds 4 ; day, hour, min, sec
wUnusedTwoDayTimerOn:: db wUnusedTwoDayTimerOn:: db
wUnusedTwoDayTimer:: db wUnusedTwoDayTimer:: db
wUnusedTwoDayTimerStartDate:: db wUnusedTwoDayTimerStartDate:: db
ds 4
wMobileOrCable_LastSelection:: db
wdc41:: ds 1
wdc42:: ds 8
wBuenasPassword:: db wBuenasPassword:: db
wBlueCardBalance:: db wBlueCardBalance:: db
wKenjiBreakTimer:: ds 2 ; Kenji wKenjiBreakTimer:: ds 2 ; Kenji
wYanmaMapGroup:: db wYanmaMapGroup:: db
wYanmaMapNumber:: db wYanmaMapNumber:: db
ds 18
wStepCount:: db wStepCount:: db
wPoisonStepCount:: db wPoisonStepCount:: db
ds 2
wHappinessStepCount:: db wHappinessStepCount:: db
ds 1
wParkBallsRemaining:: wParkBallsRemaining::
wSafariBallsRemaining:: db wSafariBallsRemaining:: db
@ -2646,10 +2461,7 @@ wSafariTimeRemaining:: dw
wPhoneList:: ds CONTACT_LIST_SIZE + 1 wPhoneList:: ds CONTACT_LIST_SIZE + 1
ds 22
wLuckyNumberShowFlag:: db wLuckyNumberShowFlag:: db
ds 1
wLuckyIDNumber:: dw wLuckyIDNumber:: dw
wRepelEffect:: db ; If a Repel is in use, it contains the nr of steps it's still active wRepelEffect:: db ; If a Repel is in use, it contains the nr of steps it's still active
@ -2672,8 +2484,6 @@ wBackupWarpNumber:: db
wBackupMapGroup:: db wBackupMapGroup:: db
wBackupMapNumber:: db wBackupMapNumber:: db
ds 3
wLastSpawnMapGroup:: db wLastSpawnMapGroup:: db
wLastSpawnMapNumber:: db wLastSpawnMapNumber:: db
@ -2714,8 +2524,6 @@ wPartyMon{d:n}Nickname:: ds MON_NAME_LENGTH
endr endr
wPartyMonNicknamesEnd:: wPartyMonNicknamesEnd::
ds 22
wPokedexCaught:: flag_array NUM_POKEMON wPokedexCaught:: flag_array NUM_POKEMON
wEndPokedexCaught:: wEndPokedexCaught::