2021-05-31 21:17:03 +00:00
SECTION "Audio RAM" , WRAM0
2013-12-05 06:18:14 +00:00
2024-06-15 16:18:00 +00:00
wUnusedMusicByte: : db
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wSoundID: : db
2015-08-09 05:32:44 +00:00
; bit 7: whether sound has been muted
; all bits: whether the effective is active
; Store 1 to activate effect (any value in the range [1, 127] works).
; All audio is muted and music is paused. Sfx continues playing until it
; ends normally.
; Store 0 to resume music.
2021-05-31 19:04:28 +00:00
wMuteAudioAndPauseMusic: : db
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wDisableChannelOutputWhenSfxEnds: : db
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wStereoPanning: : db
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wSavedVolume: : db
2015-08-09 05:32:44 +00:00
2021-05-31 20:25:16 +00:00
wChannelCommandPointers: : ds NUM_CHANNELS * 2
wChannelReturnAddresses: : ds NUM_CHANNELS * 2
2015-08-09 05:32:44 +00:00
2021-05-31 20:25:16 +00:00
wChannelSoundIDs: : ds NUM_CHANNELS
2015-08-09 05:32:44 +00:00
2021-05-31 20:25:16 +00:00
wChannelFlags1: : ds NUM_CHANNELS
wChannelFlags2: : ds NUM_CHANNELS
2021-06-02 00:39:05 +00:00
2021-05-31 20:25:16 +00:00
wChannelDutyCycles: : ds NUM_CHANNELS
wChannelDutyCyclePatterns: : ds NUM_CHANNELS
2021-06-02 00:39:05 +00:00
2015-08-09 05:32:44 +00:00
; reloaded at the beginning of a note. counts down until the vibrato begins.
2021-05-31 20:25:16 +00:00
wChannelVibratoDelayCounters: : ds NUM_CHANNELS
wChannelVibratoExtents: : ds NUM_CHANNELS
2015-08-09 05:32:44 +00:00
; high nybble is rate (counter reload value) and low nybble is counter.
; time between applications of vibrato.
2021-05-31 20:25:16 +00:00
wChannelVibratoRates: : ds NUM_CHANNELS
wChannelFrequencyLowBytes: : ds NUM_CHANNELS
2015-08-09 05:32:44 +00:00
; delay of the beginning of the vibrato from the start of the note
2021-05-31 20:25:16 +00:00
wChannelVibratoDelayCounterReloadValues: : ds NUM_CHANNELS
2021-06-02 00:39:05 +00:00
2021-05-31 20:25:16 +00:00
wChannelPitchSlideLengthModifiers: : ds NUM_CHANNELS
wChannelPitchSlideFrequencySteps: : ds NUM_CHANNELS
wChannelPitchSlideFrequencyStepsFractionalPart: : ds NUM_CHANNELS
wChannelPitchSlideCurrentFrequencyFractionalPart: : ds NUM_CHANNELS
wChannelPitchSlideCurrentFrequencyHighBytes: : ds NUM_CHANNELS
wChannelPitchSlideCurrentFrequencyLowBytes: : ds NUM_CHANNELS
wChannelPitchSlideTargetFrequencyHighBytes: : ds NUM_CHANNELS
wChannelPitchSlideTargetFrequencyLowBytes: : ds NUM_CHANNELS
2021-06-02 00:39:05 +00:00
2015-08-09 05:32:44 +00:00
; Note delays are stored as 16-bit fixed-point numbers where the integer part
; is 8 bits and the fractional part is 8 bits.
2021-05-31 20:25:16 +00:00
wChannelNoteDelayCounters: : ds NUM_CHANNELS
wChannelLoopCounters: : ds NUM_CHANNELS
wChannelNoteSpeeds: : ds NUM_CHANNELS
wChannelNoteDelayCountersFractionalPart: : ds NUM_CHANNELS
2021-06-02 00:39:05 +00:00
2021-05-31 20:25:16 +00:00
wChannelOctaves: : ds NUM_CHANNELS
2015-08-09 05:32:44 +00:00
; also includes fade for hardware channels that support it
2021-05-31 20:25:16 +00:00
wChannelVolumes: : ds NUM_CHANNELS
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wMusicWaveInstrument: : db
wSfxWaveInstrument: : db
wMusicTempo: : dw
wSfxTempo: : dw
wSfxHeaderPointer: : dw
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wNewSoundID: : db
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wAudioROMBank: : db
wAudioSavedROMBank: : db
2015-08-09 05:32:44 +00:00
2021-05-31 15:46:10 +00:00
wFrequencyModifier: : db
wTempoModifier: : db
2015-08-09 05:32:44 +00:00
ds 13
2014-05-26 17:05:58 +00:00
2013-12-05 06:18:14 +00:00
2018-11-18 23:29:24 +00:00
SECTION "Sprite State Data" , WRAM0
2013-12-05 06:18:14 +00:00
2015-08-11 04:03:31 +00:00
wSpriteDataStart: :
2013-12-05 06:18:14 +00:00
; data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
2021-05-31 19:04:28 +00:00
wSpriteStateData1: :
2020-07-07 15:57:03 +00:00
; struct fields:
; - 0: picture ID (fixed, loaded at map init)
; - 1: movement status (0: uninitialized, 1: ready, 2: delayed, 3: moving)
; - 2: sprite image index (changed on update, $ff if off screen, includes facing direction, progress in walking animation and a sprite-specific offset)
; - 3: Y screen position delta (-1,0 or 1; added to Y pixels on each walking animation update)
; - 4: Y screen position (in pixels, always 4 pixels above grid which makes sprites appear to be in the center of a tile)
; - 5: X screen position delta (-1,0 or 1; added to field X pixels on each walking animation update)
; - 6: X screen position (in pixels, snaps to grid if not currently walking)
; - 7: intra-animation-frame counter (counting upwards to 4 until animation frame counter is incremented)
; - 8: animation frame counter (increased every 4 updates, hold four states (totalling to 16 walking frames)
; - 9: facing direction ($0: down, $4: up, $8: left, $c: right)
; - A: adjusted Y coordinate
; - B: adjusted X coordinate
; - C: direction of collision
; - D
; - E
; - F
2021-04-27 19:49:59 +00:00
wSpritePlayerStateData1: : spritestatedata1 wSpritePlayerStateData1 ; player is struct 0
2022-09-24 15:30:29 +00:00
; wSprite01StateData1 - wSprite15StateData1
2021-05-31 15:46:10 +00:00
FOR n , 1 , NUM_SPRITESTATEDATA_STRUCTS
2021-04-27 19:49:59 +00:00
wSprite { 02 d : n } StateData1 :: sp ritestatedata1 wSprite { 02 d : n } StateData1
2021-05-31 15:46:10 +00:00
ENDR
2014-05-26 17:05:58 +00:00
2013-12-05 06:18:14 +00:00
; more data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
2021-05-31 19:04:28 +00:00
wSpriteStateData2: :
2020-07-07 15:57:03 +00:00
; struct fields:
; - 0: walk animation counter (counting from $10 backwards when moving)
; - 1:
; - 2: Y displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
; - 3: X displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
; - 4: Y position (in 2x2 tile grid steps, topmost 2x2 tile has value 4)
; - 5: X position (in 2x2 tile grid steps, leftmost 2x2 tile has value 4)
; - 6: movement byte 1 (determines whether a sprite can move, $ff:not moving, $fe:random movements, others unknown)
; - 7: (?) (set to $80 when in grass, else $0; may be used to draw grass above the sprite)
; - 8: delay until next movement (counted downwards, movement status is set to ready if reached 0)
2020-07-07 20:57:51 +00:00
; - 9: original facing direction (backed up by DisplayTextIDInit, restored by CloseTextDisplay)
2020-07-07 15:57:03 +00:00
; - A
; - B
; - C
; - D: picture ID
; - E: sprite image base offset (in video ram, player always has value 1, used to compute sprite image index)
; - F
2021-04-27 19:49:59 +00:00
wSpritePlayerStateData2: : spritestatedata2 wSpritePlayerStateData2 ; player is struct 0
2022-09-24 15:30:29 +00:00
; wSprite01StateData2 - wSprite15StateData2
2021-05-31 15:46:10 +00:00
FOR n , 1 , NUM_SPRITESTATEDATA_STRUCTS
2021-04-27 19:49:59 +00:00
wSprite { 02 d : n } StateData2 :: sp ritestatedata2 wSprite { 02 d : n } StateData2
2021-05-31 15:46:10 +00:00
ENDR
2018-11-18 22:54:46 +00:00
2021-04-27 19:49:59 +00:00
; The high byte of a pointer to anywhere within wSpriteStateData1 can be incremented
; to reach within wSpriteStateData2, and vice-versa for decrementing.
2021-05-31 15:46:10 +00:00
ASSERT HIGH ( wSpriteStateData1 ) + 1 = = HIGH ( wSpriteStateData2 )
2021-09-09 00:59:22 +00:00
ASSERT LOW ( wSpriteStateData1 ) = = 0 && LOW ( wSpriteStateData2 ) = = 0
2013-12-05 06:18:14 +00:00
2015-08-11 04:03:31 +00:00
wSpriteDataEnd: :
2013-12-05 06:18:14 +00:00
2018-11-18 23:29:24 +00:00
SECTION "OAM Buffer" , WRAM0
2014-05-26 17:05:58 +00:00
2013-12-05 06:18:14 +00:00
; buffer for OAM data. Copied to OAM by DMA
2022-07-09 21:18:18 +00:00
wShadowOAM: :
; wShadowOAMSprite00 - wShadowOAMSprite39
2021-05-31 15:46:10 +00:00
FOR n , NUM_SPRITE_OAM_STRUCTS
2022-07-09 21:18:18 +00:00
wShadowOAMSprite { 02 d : n } :: sp rite_oam_struct wShadowOAMSprite { 02 d : n }
2021-05-31 15:46:10 +00:00
ENDR
2022-07-09 21:18:18 +00:00
wShadowOAMEnd: :
2013-12-05 06:18:14 +00:00
2021-05-31 21:17:03 +00:00
SECTION "Tilemap" , WRAM0
2013-12-05 06:18:14 +00:00
; buffer for tiles that are visible on screen (20 columns by 18 rows)
2021-05-31 19:04:28 +00:00
wTileMap: : ds SCREEN_WIDTH * SCREEN_HEIGHT
2015-02-07 10:43:08 +00:00
2020-11-05 21:55:39 +00:00
UNION
2013-12-05 06:18:14 +00:00
; buffer for temporarily saving and restoring current screen's tiles
; (e.g. if menus are drawn on top)
2021-05-31 19:04:28 +00:00
wTileMapBackup: : ds SCREEN_WIDTH * SCREEN_HEIGHT
2015-02-07 10:43:08 +00:00
2020-11-05 21:55:39 +00:00
NEXTU
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
2021-05-31 19:04:28 +00:00
wSerialPartyMonsPatchList: : ds 200
2013-12-05 06:18:14 +00:00
2015-02-07 10:43:08 +00:00
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
2021-05-31 19:04:28 +00:00
wSerialEnemyMonsPatchList: : ds 200
2020-11-05 21:55:39 +00:00
ENDU
2015-02-07 10:43:08 +00:00
ds 80
2013-12-05 06:18:14 +00:00
2021-05-31 21:17:03 +00:00
SECTION "Overworld Map" , WRAM0
2020-11-05 21:55:39 +00:00
UNION
2021-05-31 19:04:28 +00:00
wOverworldMap: : ds 1300
2019-07-07 04:44:21 +00:00
wOverworldMapEnd: :
2013-12-05 06:18:14 +00:00
2020-11-05 21:55:39 +00:00
NEXTU
2021-05-31 19:04:28 +00:00
wTempPic: : ds 7 * 7 tiles
2020-11-05 21:55:39 +00:00
ENDU
2021-05-31 21:17:03 +00:00
SECTION "WRAM" , WRAM0
2015-08-14 09:46:12 +00:00
; the tiles of the row or column to be redrawn by RedrawRowOrColumn
2021-05-31 19:04:28 +00:00
wRedrawRowOrColumnSrcTiles: : ds SCREEN_WIDTH * 2
2013-12-05 06:18:14 +00:00
; coordinates of the position of the cursor for the top menu item (id 0)
2021-05-31 15:46:10 +00:00
wTopMenuItemY: : db
wTopMenuItemX: : db
2013-12-05 06:18:14 +00:00
; the id of the currently selected menu item
; the top item has id 0, the one below that has id 1, etc.
; note that the "top item" means the top item currently visible on the screen
; add this value to [wListScrollOffset] to get the item's position within the list
2021-05-31 19:04:28 +00:00
wCurrentMenuItem: : db
2013-12-05 06:18:14 +00:00
; the tile that was behind the menu cursor's current location
2021-05-31 19:04:28 +00:00
wTileBehindCursor: : db
2013-12-05 06:18:14 +00:00
; id of the bottom menu item
2021-05-31 19:04:28 +00:00
wMaxMenuItem: : db
2013-12-05 06:18:14 +00:00
; bit mask of keys that the menu will respond to
2021-05-31 19:04:28 +00:00
wMenuWatchedKeys: : db
2013-12-05 06:18:14 +00:00
; id of previously selected menu item
2021-05-31 19:04:28 +00:00
wLastMenuItem: : db
2013-12-05 06:18:14 +00:00
2015-07-16 03:04:58 +00:00
; It is mainly used by the party menu to remember the cursor position while the
; menu isn't active.
; It is also used to remember the cursor position of mon lists (for the
; withdraw/deposit/release actions) in Bill's PC so that it doesn't get lost
; when you choose a mon from the list and a sub-menu is shown. It's reset when
; you return to the main Bill's PC menu.
2021-05-31 19:04:28 +00:00
wPartyAndBillsPCSavedMenuItem: : db
2015-07-16 03:04:58 +00:00
; It is used by the bag list to remember the cursor position while the menu
; isn't active.
2021-05-31 19:04:28 +00:00
wBagSavedMenuItem: : db
2015-07-16 03:04:58 +00:00
; It is used by the start menu to remember the cursor position while the menu
; isn't active.
; The battle menu uses it so that the cursor position doesn't get lost when
; a sub-menu is shown. It's reset at the start of each battle.
2021-05-31 19:04:28 +00:00
wBattleAndStartSavedMenuItem: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wPlayerMoveListIndex: : db
2013-12-05 06:18:14 +00:00
2015-07-16 03:04:58 +00:00
; index in party of currently battling mon
2021-05-31 19:04:28 +00:00
wPlayerMonNumber: : db
2013-12-05 06:18:14 +00:00
; the address of the menu cursor's current location within wTileMap
2021-05-31 19:04:28 +00:00
wMenuCursorLocation: : dw
2013-12-05 06:18:14 +00:00
ds 2
; how many times should HandleMenuInput poll the joypad state before it returns?
2021-05-31 19:04:28 +00:00
wMenuJoypadPollCount: : db
2013-12-05 06:18:14 +00:00
2014-08-09 05:39:13 +00:00
; id of menu item selected for swapping (counts from 1) (0 means that no menu item has been selected for swapping)
2021-05-31 19:04:28 +00:00
wMenuItemToSwap: : db
2013-12-05 06:18:14 +00:00
; offset of the current top menu item from the beginning of the list
; keeps track of what section of the list is on screen
2021-05-31 19:04:28 +00:00
wListScrollOffset: : db
2013-12-05 06:18:14 +00:00
2015-07-13 07:32:03 +00:00
; If non-zero, then when wrapping is disabled and the player tries to go past
; the top or bottom of the menu, return from HandleMenuInput. This is useful for
; menus that have too many items to display at once on the screen because it
; allows the caller to scroll the entire menu up or down when this happens.
2021-05-31 19:04:28 +00:00
wMenuWatchMovingOutOfBounds: : db
2015-02-07 10:43:08 +00:00
2021-05-31 15:46:10 +00:00
wTradeCenterPointerTableIndex: : db
2015-02-07 10:43:08 +00:00
ds 1
2016-09-11 09:01:37 +00:00
; destination pointer for text output
; this variable is written to, but is never read from
2021-05-31 19:04:28 +00:00
wTextDest: : dw
2014-09-13 07:50:56 +00:00
; if non-zero, skip waiting for a button press after displaying text in DisplayTextID
2021-05-31 19:04:28 +00:00
wDoNotWaitForButtonPressAfterDisplayingText: : db
2014-09-13 07:50:56 +00:00
2021-05-31 20:25:16 +00:00
UNION
; the received menu selection is stored twice
wLinkMenuSelectionReceiveBuffer: : dw
ds 3
; the menu selection byte is stored twice before sending
wLinkMenuSelectionSendBuffer: : dw
ds 3
wEnteringCableClub: :
wLinkTimeoutCounter: : db
2015-02-07 10:43:08 +00:00
2021-05-31 20:25:16 +00:00
NEXTU
2015-02-07 10:43:08 +00:00
; temporary nybble used by Serial_ExchangeNybble
2021-05-31 19:04:28 +00:00
wSerialExchangeNybbleTempReceiveData: :
2021-05-31 20:25:16 +00:00
; the final received nybble is stored here by Serial_SyncAndExchangeNybble
wSerialSyncAndExchangeNybbleReceiveData: : db
2015-02-07 10:43:08 +00:00
; the final received nybble is stored here by Serial_ExchangeNybble
2021-05-31 19:04:28 +00:00
wSerialExchangeNybbleReceiveData: : db
2015-02-07 10:43:08 +00:00
ds 3
; this nybble is sent when using Serial_SyncAndExchangeNybble or Serial_ExchangeNybble
2021-05-31 20:25:16 +00:00
wSerialExchangeNybbleSendData: : db
ds 4
wUnknownSerialCounter: : dw
ENDU
2015-02-07 10:43:08 +00:00
; $00 = player mons
; $01 = enemy mons
2021-05-31 19:04:28 +00:00
wWhichTradeMonSelectionMenu: :
2015-07-16 03:04:58 +00:00
; 0 = player's party
; 1 = enemy party
; 2 = current box
; 3 = daycare
; 4 = in-battle mon
;
; AddPartyMon uses it slightly differently.
; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
; If the entire value is 0, then the player is allowed to name the mon.
2021-05-31 19:04:28 +00:00
wMonDataLocation: : db
2013-12-05 06:18:14 +00:00
; set to 1 if you can go from the bottom to the top or top to bottom of a menu
; set to 0 if you can't go past the top or bottom of the menu
2021-05-31 19:04:28 +00:00
wMenuWrappingEnabled: : db
2013-12-05 06:18:14 +00:00
2015-07-25 03:27:59 +00:00
; whether to check for 180-degree turn (0 = don't, 1 = do)
2021-05-31 19:04:28 +00:00
wCheckFor180DegreeTurn: : db
2015-07-25 03:27:59 +00:00
ds 1
2021-05-31 15:46:10 +00:00
wMissableObjectIndex: : db
2014-05-23 22:11:09 +00:00
2021-05-31 15:46:10 +00:00
wPredefID: : db
2021-05-31 20:25:16 +00:00
wPredefHL: : dw
wPredefDE: : dw
wPredefBC: : dw
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wTrainerHeaderFlagBit: : db
2013-12-05 06:18:14 +00:00
2014-05-26 21:04:56 +00:00
ds 1
2013-12-05 06:18:14 +00:00
2014-09-10 03:55:19 +00:00
; which NPC movement script pointer is being used
; 0 if an NPC movement script is not running
2021-05-31 19:04:28 +00:00
wNPCMovementScriptPointerTableNum: : db
2014-09-10 03:55:19 +00:00
; ROM bank of current NPC movement script
2021-05-31 19:04:28 +00:00
wNPCMovementScriptBank: : db
2014-09-10 03:55:19 +00:00
ds 2
2014-06-14 21:24:35 +00:00
2021-06-02 00:39:05 +00:00
; This union spans 180 bytes.
UNION
wVermilionDockTileMapBuffer: : ds 5 * BG_MAP_WIDTH + SCREEN_WIDTH
wVermilionDockTileMapBufferEnd: :
2015-08-13 05:14:31 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wOaksAideRewardItemName: : ds ITEM_NAME_LENGTH
2015-08-13 05:14:31 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wElevatorWarpMaps: : ds 11 * 2
2015-08-13 05:14:31 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2015-08-13 05:14:31 +00:00
; List of bag items that has been filtered to a certain type of items,
; such as drinks or fossils.
2021-06-02 00:39:05 +00:00
wFilteredBagItems: : ds 4
2015-08-13 05:14:31 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2015-08-13 05:14:31 +00:00
; Saved copy of OAM for the first frame of the animation to make it easy to
; flip back from the second frame.
2021-06-02 00:39:05 +00:00
wMonPartySpritesSavedOAM: : ds $ 60
2015-08-13 05:14:31 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wTrainerCardBlkPacket: : ds $ 40
2015-08-12 09:16:56 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wHallOfFame: : ds HOF_TEAM
2021-05-31 20:25:16 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wNPCMovementDirections: : ds 180
2021-05-31 20:25:16 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wDexRatingNumMonsSeen: : db
wDexRatingNumMonsOwned: : db
wDexRatingText: : db
NEXTU
2015-07-13 20:35:35 +00:00
; If a random number greater than this value is generated, then the player is
; allowed to have three 7 symbols or bar symbols line up.
; So, this value is actually the chance of NOT entering that mode.
; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
2021-06-02 00:39:05 +00:00
wSlotMachineSevenAndBarModeChance: : db
ds 2
2015-07-13 20:35:35 +00:00
; ROM back to return to when the player is done with the slot machine
2021-05-31 19:04:28 +00:00
wSlotMachineSavedROMBank: : db
2021-06-02 00:39:05 +00:00
ds 166
wLuckySlotHiddenObjectIndex: : db
2015-07-13 20:35:35 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
wAnimationType: : db
2015-07-24 21:39:45 +00:00
ds 29
2021-06-02 00:39:05 +00:00
wAnimPalette: : db
2014-09-10 03:55:19 +00:00
2020-11-05 21:55:39 +00:00
NEXTU
2021-06-02 00:39:05 +00:00
ds 60
2014-09-10 03:55:19 +00:00
; temporary buffer when swapping party mon data
2021-05-31 20:25:16 +00:00
wSwitchPartyMonTempBuffer: : ds 44 ; party_struct size
2013-12-05 06:18:14 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
ds 120
2014-09-10 03:55:19 +00:00
; this is the end of the joypad states
; the list starts above this address and extends downwards in memory until here
; overloaded with below labels
2021-05-31 19:04:28 +00:00
wSimulatedJoypadStatesEnd: :
2014-09-10 03:55:19 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2024-07-16 17:02:54 +00:00
wUnusedFlag: :
wBoostExpByExpAll: : db
2021-06-02 00:39:05 +00:00
ds 59
wNPCMovementDirections2: : ds 10
; used in Pallet Town scripted movement
wNumStepsToTake: : db
ds 48
wRLEByteCount: : db
2020-06-28 03:03:39 +00:00
wParentMenuItem: :
2021-05-31 20:25:16 +00:00
; 0 = not added
; 1 = added
wAddedToParty: :
2015-07-19 03:49:52 +00:00
; 1 flag for each party member indicating whether it can evolve
; The purpose of these flags is to track which mons levelled up during the
; current battle at the end of the battle when evolution occurs.
; Other methods of evolution simply set it by calling TryEvolvingMon.
2023-07-15 22:36:59 +00:00
wMiscBattleData: :
2021-05-31 19:04:28 +00:00
wCanEvolveFlags: : db
2015-07-19 03:49:52 +00:00
2021-05-31 15:46:10 +00:00
wForceEvolution: : db
2015-03-31 18:40:22 +00:00
2020-06-28 03:03:39 +00:00
; if [wAILayer2Encouragement] != 1, the second AI layer is not applied
2021-05-31 15:46:10 +00:00
wAILayer2Encouragement: : db
2021-05-31 19:04:28 +00:00
2015-03-31 18:40:22 +00:00
ds 1
2013-12-05 06:18:14 +00:00
; current HP of player and enemy substitutes
2021-05-31 15:46:10 +00:00
wPlayerSubstituteHP: : db
wEnemySubstituteHP: : db
2013-12-05 06:18:14 +00:00
2023-07-15 22:36:59 +00:00
; used for TestBattle (unused in non-debug builds)
2021-05-31 19:04:28 +00:00
wTestBattlePlayerSelectedMove: : db
2015-08-14 02:13:47 +00:00
ds 1
2013-12-05 06:18:14 +00:00
; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..)
2021-05-31 19:04:28 +00:00
wMoveMenuType: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wPlayerSelectedMove: : db
wEnemySelectedMove: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wLinkBattleRandomNumberListIndex: : db
2013-12-05 06:18:14 +00:00
; number of times remaining that AI action can occur
2021-05-31 19:04:28 +00:00
wAICount: : db
2013-12-05 06:18:14 +00:00
ds 2
2021-05-31 15:46:10 +00:00
wEnemyMoveListIndex: : db
2013-12-05 06:18:14 +00:00
2015-07-24 03:48:35 +00:00
; The enemy mon's HP when it was switched in or when the current player mon
; was switched in, which was more recent.
; It's used to determine the message to print when switching out the player mon.
2021-05-31 19:04:28 +00:00
wLastSwitchInEnemyMonHP: : dw
2014-08-09 05:39:13 +00:00
; total amount of money made using Pay Day during the current battle
2021-05-31 19:04:28 +00:00
wTotalPayDayMoney: : ds 3
2014-08-09 05:39:13 +00:00
2021-05-31 15:46:10 +00:00
wSafariEscapeFactor: : db
wSafariBaitFactor: : db
2014-08-09 05:39:13 +00:00
ds 1
2021-05-31 15:46:10 +00:00
wTransformedEnemyMonOriginalDVs: : dw
2015-04-08 23:17:56 +00:00
2021-05-31 20:25:16 +00:00
wMonIsDisobedient: : db
2015-04-08 23:17:56 +00:00
2021-05-31 20:25:16 +00:00
wPlayerDisabledMoveNumber: : db
wEnemyDisabledMoveNumber: : db
2015-04-08 23:17:56 +00:00
2015-08-14 07:36:06 +00:00
; When running in the scope of HandlePlayerMonFainted, it equals 1.
; When running in the scope of HandleEnemyMonFainted, it equals 0.
2021-05-31 19:04:28 +00:00
wInHandlePlayerMonFainted: : db
2015-04-08 23:17:56 +00:00
2021-05-31 20:25:16 +00:00
wPlayerUsedMove: : db
wEnemyUsedMove: : db
2015-04-08 23:17:56 +00:00
2021-05-31 20:25:16 +00:00
wEnemyMonMinimized: : db
2014-08-09 05:39:13 +00:00
2021-05-31 20:25:16 +00:00
wMoveDidntMiss: : db
2015-04-08 23:17:56 +00:00
2014-08-09 05:39:13 +00:00
; flags that indicate which party members have fought the current enemy mon
2021-05-31 20:25:16 +00:00
wPartyFoughtCurrentEnemyFlags: : flag_array PARTY_LENGTH
2014-08-09 05:39:13 +00:00
2015-08-14 07:36:06 +00:00
; Whether the low health alarm has been disabled due to the player winning the
; battle.
2021-05-31 19:04:28 +00:00
wLowHealthAlarmDisabled: : db
2015-08-14 07:36:06 +00:00
2021-05-31 15:46:10 +00:00
wPlayerMonMinimized: : db
2015-07-12 22:51:04 +00:00
2015-07-17 07:52:25 +00:00
ds 13
2014-08-09 05:39:13 +00:00
2015-02-07 10:43:08 +00:00
; number of hits by enemy in attacks like Double Slap, etc.
2021-06-02 00:39:05 +00:00
wEnemyNumHits: : ; db
; the amount of damage accumulated by the enemy while biding
2021-05-31 20:25:16 +00:00
wEnemyBideAccumulatedDamage: : dw
2015-02-07 10:43:08 +00:00
2021-05-31 20:25:16 +00:00
ds 8
2023-07-15 22:36:59 +00:00
wMiscBattleDataEnd: :
2021-06-02 00:39:05 +00:00
ENDU
2015-02-07 10:43:08 +00:00
2021-06-02 00:39:05 +00:00
; This union spans 39 bytes.
2021-05-31 20:25:16 +00:00
UNION
wInGameTradeGiveMonSpecies: : db
wInGameTradeTextPointerTablePointer: : dw
wInGameTradeTextPointerTableIndex: : db
wInGameTradeGiveMonName: : ds NAME_LENGTH
wInGameTradeReceiveMonName: : ds NAME_LENGTH
wInGameTradeMonNick: : ds NAME_LENGTH
wInGameTradeReceiveMonSpecies: : db
2015-02-07 10:43:08 +00:00
2021-05-31 20:25:16 +00:00
NEXTU
wPlayerMonUnmodifiedLevel: : db
2021-05-31 15:46:10 +00:00
wPlayerMonUnmodifiedMaxHP: : dw
2021-05-31 20:25:16 +00:00
wPlayerMonUnmodifiedAttack: : dw
2021-05-31 15:46:10 +00:00
wPlayerMonUnmodifiedDefense: : dw
wPlayerMonUnmodifiedSpeed: : dw
wPlayerMonUnmodifiedSpecial: : dw
2013-12-05 06:18:14 +00:00
; stat modifiers for the player's current pokemon
; value can range from 1 - 13 ($1 to $D)
; 7 is normal
2014-01-27 22:09:09 +00:00
wPlayerMonStatMods: :
2021-05-31 15:46:10 +00:00
wPlayerMonAttackMod: : db
wPlayerMonDefenseMod: : db
wPlayerMonSpeedMod: : db
wPlayerMonSpecialMod: : db
wPlayerMonAccuracyMod: : db
wPlayerMonEvasionMod: : db
2021-03-25 20:33:05 +00:00
ds 2
wPlayerMonStatModsEnd: :
ds 1
2014-05-26 21:04:56 +00:00
2021-05-31 15:46:10 +00:00
wEnemyMonUnmodifiedLevel: : db
wEnemyMonUnmodifiedMaxHP: : dw
wEnemyMonUnmodifiedAttack: : dw
2021-05-31 20:25:16 +00:00
wEnemyMonUnmodifiedDefense: : dw
2021-05-31 15:46:10 +00:00
wEnemyMonUnmodifiedSpeed: : dw
2021-05-31 20:25:16 +00:00
wEnemyMonUnmodifiedSpecial: : dw
2013-12-05 06:18:14 +00:00
; stat modifiers for the enemy's current pokemon
; value can range from 1 - 13 ($1 to $D)
; 7 is normal
2014-01-27 22:09:09 +00:00
wEnemyMonStatMods: :
2021-05-31 15:46:10 +00:00
wEnemyMonAttackMod: : db
wEnemyMonDefenseMod: : db
wEnemyMonSpeedMod: : db
wEnemyMonSpecialMod: : db
wEnemyMonAccuracyMod: : db
wEnemyMonEvasionMod: : db
2021-05-31 20:25:16 +00:00
ds 2
2021-03-25 20:33:05 +00:00
wEnemyMonStatModsEnd: :
2021-05-31 20:25:16 +00:00
NEXTU
ds 30
wEngagedTrainerClass: : db
wEngagedTrainerSet: : db
ENDU
2021-03-25 20:33:05 +00:00
ds 1
2014-09-10 03:55:19 +00:00
2020-06-28 03:03:39 +00:00
wNPCMovementDirections2Index: :
2024-06-15 16:18:00 +00:00
wUnusedLinkMenuByte: :
2015-08-13 05:14:31 +00:00
; number of items in wFilteredBagItems list
2021-05-31 19:04:28 +00:00
wFilteredBagItemsCount: : db
2014-09-10 03:55:19 +00:00
; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
; 0 if the joypad state is not being simulated
2021-05-31 19:04:28 +00:00
wSimulatedJoypadStatesIndex: : db
2014-09-10 03:55:19 +00:00
; written to but nothing ever reads it
2024-06-15 16:18:00 +00:00
wUnusedSimulatedJoypadStatesMask: : db
2014-09-10 03:55:19 +00:00
; written to but nothing ever reads it
2024-06-15 16:18:00 +00:00
wUnusedOverrideSimulatedJoypadStatesIndex: : db
2014-09-10 03:55:19 +00:00
; mask indicating which real button presses can override simulated ones
; XXX is it ever not 0?
2021-05-31 19:04:28 +00:00
wOverrideSimulatedJoypadStatesMask: : db
2014-09-10 03:55:19 +00:00
ds 1
2013-12-05 06:18:14 +00:00
2021-05-31 22:44:24 +00:00
; This union spans 30 bytes.
UNION
wTradedPlayerMonSpecies: : db
wTradedEnemyMonSpecies: : db
ds 2
wTradedPlayerMonOT: : ds NAME_LENGTH
wTradedPlayerMonOTID: : dw
wTradedEnemyMonOT: : ds NAME_LENGTH
wTradedEnemyMonOTID: : dw
NEXTU
wTradingWhichPlayerMon: : db
wTradingWhichEnemyMon: : db
wNameOfPlayerMonToBeTraded: : ds NAME_LENGTH
NEXTU
2021-05-31 20:25:16 +00:00
; one byte for each falling object
2021-05-31 22:44:24 +00:00
wFallingObjectsMovementData: : ds 20
2015-07-24 21:39:45 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
2021-05-31 20:25:16 +00:00
; array of the number of mons in each box
2021-05-31 22:44:24 +00:00
wBoxMonCounts: : ds NUM_BOXES
2015-07-24 21:39:45 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wPriceTemp: : ds 3 ; BCD
2021-05-31 20:25:16 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
2021-05-31 20:25:16 +00:00
; the current mon's field moves
2021-05-31 22:44:24 +00:00
wFieldMoves: : ds NUM_MOVES
wNumFieldMoves: : db
wFieldMovesLeftmostXCoord: : db
wLastFieldMoveID: : db ; unused
2015-07-24 21:39:45 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wBoxNumString: : ds 3
2021-05-31 20:25:16 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
2015-07-23 13:07:12 +00:00
; 0 = upper half (Y < 9)
; 1 = lower half (Y >= 9)
2021-05-31 22:44:24 +00:00
wBattleTransitionCircleScreenQuadrantY: : db
wBattleTransitionCircleScreenQuadrantX: : db
NEXTU
2015-07-23 13:07:12 +00:00
; after 1 row/column has been copied, the offset to the next one to copy from
2021-05-31 22:44:24 +00:00
wBattleTransitionCopyTilesOffset: : dw
NEXTU
2015-07-23 13:07:12 +00:00
; counts down from 7 so that every time 7 more tiles of the spiral have been
; placed, the tile map buffer is copied to VRAM so that progress is visible
2021-05-31 22:44:24 +00:00
wInwardSpiralUpdateScreenCounter: : db
ds 9
; 0 = outward, 1 = inward
wBattleTransitionSpiralDirection: : db
2014-09-13 07:50:56 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
; multiplied by 16 to get the number of times to go right by 2 pixels
wSSAnneSmokeDriftAmount: : db
2015-07-23 13:07:12 +00:00
; 0 = left half (X < 10)
; 1 = right half (X >= 10)
2021-05-31 22:44:24 +00:00
wSSAnneSmokeX: : db
2014-09-14 18:29:18 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wHoFMonSpecies: :
wHoFTeamIndex: : db
wHoFPartyMonIndex: : db
wHoFMonLevel: : db
; 0 = mon, 1 = player
wHoFMonOrPlayer: : db
wHoFTeamIndex2: : db
wHoFTeamNo: : db
2014-09-13 07:50:56 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wRivalStarterTemp: : db
wRivalStarterBallSpriteIndex: : db
2015-07-23 13:07:12 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wFlyAnimUsingCoordList: : db
; $ff sentinel values at each end
wFlyLocationsList: : ds NUM_CITY_MAPS + 2
2014-09-13 07:50:56 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wWhichTownMapLocation: : db
wFlyAnimCounter: : db
wFlyAnimBirdSpriteImageIndex: : db
2015-07-23 13:07:12 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
ds 1
; difference in X between the next ball and the current one
wHUDPokeballGfxOffsetX: : db
wHUDGraphicsTiles: : ds 3
2014-09-14 18:29:18 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
; the level of the mon at the time it entered day care
wDayCareStartLevel: : db
wDayCareNumLevelsGrown: : db
wDayCareTotalCost: : dw ; BCD
wDayCarePerLevelCost: : dw ; BCD (always $100)
2015-07-23 13:07:12 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
; which wheel the player is trying to stop
; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
wStoppingWhichSlotMachineWheel: : db
wSlotMachineWheel1Offset: : db
wSlotMachineWheel2Offset: : db
wSlotMachineWheel3Offset: : db
2015-07-13 20:35:35 +00:00
; the OAM tile number of the upper left corner of the winning symbol minus 2
2021-05-31 19:04:28 +00:00
wSlotMachineWinningSymbol: :
2021-05-31 22:44:24 +00:00
wSlotMachineWheel1BottomTile: : db
wSlotMachineWheel1MiddleTile: : db
wSlotMachineWheel1TopTile: : db
2021-05-31 15:46:10 +00:00
wSlotMachineWheel2BottomTile: : db
wSlotMachineWheel2MiddleTile: : db
wSlotMachineWheel2TopTile: : db
wSlotMachineWheel3BottomTile: : db
2021-05-31 20:25:16 +00:00
wSlotMachineWheel3MiddleTile: : db
wSlotMachineWheel3TopTile: : db
2021-05-31 19:04:28 +00:00
wPayoutCoins: : dw
2015-07-13 20:35:35 +00:00
; These flags are set randomly and control when the wheels stop.
; bit 6: allow the player to win in general
; bit 7: allow the player to win with 7 or bar (plus the effect of bit 6)
2021-05-31 19:04:28 +00:00
wSlotMachineFlags: : db
2015-07-13 20:35:35 +00:00
; wheel 1 can "slip" while this is non-zero
2021-05-31 22:44:24 +00:00
wSlotMachineWheel1SlipCounter: : db
2021-05-31 20:25:16 +00:00
; wheel 2 can "slip" while this is non-zero
wSlotMachineWheel2SlipCounter: : db
2015-07-13 20:35:35 +00:00
; The remaining number of times wheel 3 will roll down a symbol until a match is
; found, when winning is enabled. It's initialized to 4 each bet.
2021-05-31 22:44:24 +00:00
wSlotMachineRerollCounter: : db
2015-07-13 20:35:35 +00:00
; how many coins the player bet on the slot machine (1 to 3)
2021-05-31 22:44:24 +00:00
wSlotMachineBet: : db
NEXTU
wCanPlaySlots: : db
ds 8
; temporary variable used to add payout amount to the player's coins
wTempCoins1: : dw
ds 2
; temporary variable used to subtract the bet amount from the player's coins
wTempCoins2: : dw
NEXTU
wHiddenObjectFunctionArgument: : db
wHiddenObjectFunctionRomBank: : db
wHiddenObjectIndex: : db
wHiddenObjectY: : db
wHiddenItemOrCoinsIndex: :
wHiddenObjectX: : db
NEXTU
wPlayerSpinInPlaceAnimFrameDelay: : db
wPlayerSpinInPlaceAnimFrameDelayDelta: : db
wPlayerSpinInPlaceAnimFrameDelayEndValue: : db
wPlayerSpinInPlaceAnimSoundID: : db
ds 6
db ; temporary space used when wFacingDirectionList is rotated
; used when spinning the player's sprite
wFacingDirectionList: : ds 4
ds 3
wSavedPlayerScreenY: : db
wSavedPlayerFacingDirection: : db
NEXTU
wPlayerSpinWhileMovingUpOrDownAnimDeltaY: : db
wPlayerSpinWhileMovingUpOrDownAnimMaxY: : db
wPlayerSpinWhileMovingUpOrDownAnimFrameDelay: : db
NEXTU
wTrainerSpriteOffset: : db
wTrainerEngageDistance: : db
wTrainerFacingDirection: : db
wTrainerScreenY: : db
wTrainerScreenX: : db
NEXTU
wTrainerInfoTextBoxWidthPlus1: : db
wTrainerInfoTextBoxWidth: : db
wTrainerInfoTextBoxNextRowOffset: : db
NEXTU
wOptionsTextSpeedCursorX: : db
wOptionsBattleAnimCursorX: : db
wOptionsBattleStyleCursorX: : db
wOptionsCancelCursorX: : db
NEXTU
; tile ID of the badge number being drawn
wBadgeNumberTile: : db
; first tile ID of the name being drawn
wBadgeNameTile: : db
; a list of the first tile IDs of each badge or face (depending on whether the
; badge is owned) to be drawn on the trainer screen
; the byte after the list gets read when shifting back one byte
wBadgeOrFaceTiles: : ds NUM_BADGES + 1
ds 1
; temporary list created when displaying the badges on the trainer screen
; one byte for each badge; 0 = not obtained, 1 = obtained
wTempObtainedBadgesBooleans: : ds NUM_BADGES
NEXTU
2024-06-15 16:18:00 +00:00
wUnusedCreditsByte: : db
2021-05-31 22:44:24 +00:00
; the number of credits mons that have been displayed so far
wNumCreditsMonsDisplayed: : db
NEXTU
ds 1
db ; temporary space used when wJigglypuffFacingDirections is rotated
wJigglypuffFacingDirections: : ds 4
NEXTU
ds 16
; $3d = tree tile, $52 = grass tile
wCutTile: : db
ds 2
2015-07-14 21:32:49 +00:00
; 0 = cut animation, 1 = boulder dust animation
2021-05-31 20:25:16 +00:00
wWhichAnimationOffsets: : db
2021-05-31 22:44:24 +00:00
NEXTU
ds 18
; the index of the sprite the emotion bubble is to be displayed above
wEmotionBubbleSpriteIndex: : db
wWhichEmotionBubble: : db
2015-02-07 10:43:08 +00:00
2021-05-31 22:44:24 +00:00
NEXTU
wChangeBoxSavedMapTextPointer: : dw
NEXTU
wSavedY: :
wTempSCX: :
; which entry from TradeMons to select
wWhichTrade: :
wDexMaxSeenMon: :
wPPRestoreItem: :
wWereAnyMonsAsleep: :
wNumShakes: :
wWhichBadge: :
wTitleMonSpecies: :
wPlayerCharacterOAMTile: :
; the number of small stars OAM entries to move down
wMoveDownSmallStarsOAMCount: :
wChargeMoveNum: :
wCoordIndex: :
wSwappedMenuItem: :
; 0 = no bite
; 1 = bite
; 2 = no fish on map
wRodResponse: :
db
ENDU
2015-02-07 10:43:08 +00:00
2015-07-25 03:27:59 +00:00
; 0 = neither
; 1 = warp pad
; 2 = hole
2021-05-31 19:04:28 +00:00
wStandingOnWarpPadOrHole: :
2020-06-28 03:03:39 +00:00
wOAMBaseTile: :
2021-05-31 15:46:10 +00:00
wGymTrashCanIndex: : db
2015-07-25 03:27:59 +00:00
2021-05-31 15:46:10 +00:00
wSymmetricSpriteOAMAttributes: : db
2015-03-14 22:25:21 +00:00
2021-05-31 15:46:10 +00:00
wMonPartySpriteSpecies: : db
2015-03-14 22:25:21 +00:00
; in the trade animation, the mon that leaves the left gameboy
2021-05-31 19:04:28 +00:00
wLeftGBMonSpecies: : db
2015-03-14 22:25:21 +00:00
; in the trade animation, the mon that leaves the right gameboy
2021-05-31 19:04:28 +00:00
wRightGBMonSpecies: : db
2013-12-05 06:18:14 +00:00
2024-07-16 17:02:54 +00:00
wMiscFlags: : db
2013-12-05 06:18:14 +00:00
2014-05-26 21:04:56 +00:00
ds 9
2015-07-15 06:16:06 +00:00
; This has overlapping related uses.
; When the player tries to use an item or use certain field moves, 0 is stored
; when the attempt fails and 1 is stored when the attempt succeeds.
; In addition, some items store 2 for certain types of failures, but this
; cannot happen in battle.
; In battle, a non-zero value indicates the player has taken their turn using
; something other than a move (e.g. using an item or switching pokemon).
; So, when an item is successfully used in battle, this value becomes non-zero
; and the player is not allowed to make a move and the two uses are compatible.
2021-05-31 19:04:28 +00:00
wActionResultOrTookBattleTurn: : db
2013-12-05 06:18:14 +00:00
2014-05-25 17:51:53 +00:00
; Set buttons are ignored.
2021-05-31 19:04:28 +00:00
wJoyIgnore: : db
2013-12-05 06:18:14 +00:00
2015-07-15 06:16:06 +00:00
; size of downscaled mon pic used in pokeball entering/exiting animation
; $00 = 5× 5
; $01 = 3× 3
2021-05-31 19:04:28 +00:00
wDownscaledMonSize: :
2015-07-15 06:16:06 +00:00
; FormatMovesString stores the number of moves minus one here
2021-05-31 19:04:28 +00:00
wNumMovesMinusOne: : db
2015-07-15 06:16:06 +00:00
2018-03-21 22:55:09 +00:00
UNION
2024-07-24 16:21:59 +00:00
; storage buffer for various name strings
wNameBuffer: : ds NAME_BUFFER_LENGTH
2021-04-14 00:08:07 +00:00
2021-05-31 20:25:16 +00:00
NEXTU
2024-07-24 16:21:59 +00:00
; data copied from Moves for one move
wMoveData: : ds MOVE_LENGTH
NEXTU
; amount of money made from one use of Pay Day
wPayDayMoney: : ds 3
NEXTU
; evolution data for one mon
wEvoDataBuffer: : ds 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
NEXTU
wBattleMenuCurrentPP: : db
ds 3
2021-05-31 19:04:28 +00:00
wStatusScreenCurrentPP: : db
2015-07-15 06:16:06 +00:00
ds 6
; list of normal max PP (without PP up) values
2021-05-31 20:25:16 +00:00
wNormalMaxPPList: : ds NUM_MOVES
2018-03-21 22:55:09 +00:00
ENDU
2021-06-02 00:39:05 +00:00
UNION
2015-02-07 10:43:08 +00:00
; buffer for transferring the random number list generated by the other gameboy
2021-06-02 00:39:05 +00:00
wSerialOtherGameboyRandomNumberListBlock: : ds $ 11
NEXTU
2013-12-05 06:18:14 +00:00
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
2021-06-02 00:39:05 +00:00
wTileMapBackup2: : ds SCREEN_WIDTH * SCREEN_HEIGHT
ENDU
2013-12-05 06:18:14 +00:00
2021-06-02 00:39:05 +00:00
; This union spans 30 bytes.
UNION
2021-05-31 20:25:16 +00:00
; Temporary storage area
2021-06-02 00:39:05 +00:00
wBuffer: : ds 30
2015-07-25 03:27:59 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wEvoOldSpecies: : db
wEvoNewSpecies: : db
wEvoMonTileOffset: : db
wEvoCancelled: : db
2015-07-19 03:49:52 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wNamingScreenNameLength: : db
2015-07-25 03:27:59 +00:00
; non-zero when the player has chosen to submit the name
2021-06-02 00:39:05 +00:00
wNamingScreenSubmitName: : db
; 0 = upper case
; 1 = lower case
wAlphabetCase: : db
ds 1
wNamingScreenLetter: : db
2015-07-24 21:39:45 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wChangeMonPicEnemyTurnSpecies: : db
wChangeMonPicPlayerTurnSpecies: : db
NEXTU
wHPBarMaxHP: : dw
2021-05-31 20:25:16 +00:00
wHPBarOldHP: : dw
wHPBarNewHP: : dw
wHPBarDelta: : db
wHPBarTempHP: : dw
ds 11
2021-06-02 00:39:05 +00:00
wHPBarHPDifference: : dw
2015-07-19 03:49:52 +00:00
2021-05-31 20:25:16 +00:00
NEXTU
2021-06-02 00:39:05 +00:00
; lower nybble is x, upper nybble is y
wTownMapCoords: :
; whether WriteMonMoves is being used to make a mon learn moves from day care
; non-zero if so
wLearningMovesFromDayCare: :
2021-05-31 20:25:16 +00:00
db
2015-07-19 03:49:52 +00:00
2021-06-02 00:39:05 +00:00
ds 27
2014-05-26 21:04:56 +00:00
2015-07-15 06:16:06 +00:00
; the item that the AI used
2021-05-31 19:04:28 +00:00
wAIItem: : db
2021-05-31 15:46:10 +00:00
wUsedItemOnWhichPokemon: : db
2021-06-02 00:39:05 +00:00
ENDU
2013-12-05 06:18:14 +00:00
; sound ID during battle animations
2021-05-31 19:04:28 +00:00
wAnimSoundID: : db
2013-12-05 06:18:14 +00:00
2015-07-15 06:16:06 +00:00
; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
2021-05-31 19:04:28 +00:00
wBankswitchHomeSavedROMBank: : db
2015-07-15 06:16:06 +00:00
; used as a temp storage value for the bank to switch to
2021-05-31 19:04:28 +00:00
wBankswitchHomeTemp: : db
2015-07-13 06:00:48 +00:00
; 0 = nothing bought or sold in pokemart
; 1 = bought or sold something in pokemart
; this value is not used for anything
2021-05-31 19:04:28 +00:00
wBoughtOrSoldItemInMart: : db
2015-07-13 06:00:48 +00:00
2014-08-09 05:39:13 +00:00
; $00 - win
; $01 - lose
; $02 - draw
2021-05-31 19:04:28 +00:00
wBattleResult: : db
2014-09-13 07:50:56 +00:00
; bit 0: if set, DisplayTextID automatically draws a text box
2021-05-31 19:04:28 +00:00
wAutoTextBoxDrawingControl: : db
2014-09-13 07:50:56 +00:00
2023-11-20 23:53:23 +00:00
; used in some overworld scripts to vary scripted movement
wSavedCoordIndex: :
wOakWalkedToPlayer: :
wNextSafariZoneGateScript: : db
2015-07-15 06:16:06 +00:00
; used in CheckForTilePairCollisions2 to store the tile the player is on
2021-05-31 19:04:28 +00:00
wTilePlayerStandingOn: : db
2015-07-15 06:16:06 +00:00
2021-05-31 20:25:16 +00:00
wNPCNumScriptedSteps: : db
2014-09-10 03:55:19 +00:00
; which script function within the pointer table indicated by
; wNPCMovementScriptPointerTableNum
2021-05-31 19:04:28 +00:00
wNPCMovementScriptFunctionNum: : db
2014-09-10 03:55:19 +00:00
2015-07-15 06:16:06 +00:00
; bit 0: set when printing a text predef so that DisplayTextID doesn't switch
; to the current map's bank
2021-05-31 19:04:28 +00:00
wTextPredefFlag: : db
2014-05-23 22:11:09 +00:00
2021-05-31 15:46:10 +00:00
wPredefParentBank: : db
2014-05-23 22:11:09 +00:00
2021-05-31 20:25:16 +00:00
wSpriteIndex: : db
2013-12-05 06:18:14 +00:00
; movement byte 2 of current sprite
2021-05-31 19:04:28 +00:00
wCurSpriteMovement2: : db
2013-12-05 06:18:14 +00:00
2014-05-26 21:04:56 +00:00
ds 2
2014-09-10 03:55:19 +00:00
; sprite offset of sprite being controlled by NPC movement script
2021-05-31 19:04:28 +00:00
wNPCMovementScriptSpriteOffset: : db
2014-09-10 03:55:19 +00:00
2021-05-31 15:46:10 +00:00
wScriptedNPCWalkCounter: : db
2015-07-15 20:58:21 +00:00
ds 1
2014-05-23 22:34:35 +00:00
2021-05-31 15:46:10 +00:00
wGBC: : db
2014-05-23 22:34:35 +00:00
2014-09-13 07:50:56 +00:00
; if running on SGB, it's 1, else it's 0
2021-05-31 19:04:28 +00:00
wOnSGB: : db
2014-09-13 07:50:56 +00:00
2021-05-31 15:46:10 +00:00
wDefaultPaletteCommand: : db
2015-08-12 09:16:56 +00:00
2021-06-02 00:39:05 +00:00
UNION
2023-09-20 19:43:01 +00:00
wPlayerHPBarColor: : db
2015-08-12 09:16:56 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2015-08-12 09:16:56 +00:00
; species of the mon whose palette is used for the whole screen
2021-05-31 19:04:28 +00:00
wWholeScreenPaletteMonSpecies: : db
2023-09-20 19:43:01 +00:00
ENDU
2015-08-12 09:16:56 +00:00
2021-05-31 15:46:10 +00:00
wEnemyHPBarColor: : db
2015-08-12 09:16:56 +00:00
; 0: green
; 1: yellow
; 2: red
2021-05-31 20:25:16 +00:00
wPartyMenuHPBarColors: : ds PARTY_LENGTH
2015-08-12 09:16:56 +00:00
2021-05-31 15:46:10 +00:00
wStatusScreenHPBarColor: : db
2015-08-12 09:16:56 +00:00
ds 7
2020-06-28 03:03:39 +00:00
wCopyingSGBTileData: :
wWhichPartyMenuHPBar: :
2021-05-31 20:25:16 +00:00
wPalPacket: :
db
2015-08-12 09:16:56 +00:00
2021-06-02 00:39:05 +00:00
; This union spans 49 bytes.
UNION
wPartyMenuBlkPacket: : ds $ 30
2015-08-12 09:16:56 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2021-05-31 20:25:16 +00:00
ds 29
2020-11-05 21:55:39 +00:00
; storage buffer for various strings
2021-08-28 21:02:20 +00:00
wStringBuffer: : ds 20
2021-05-31 20:25:16 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
ds 29
2021-05-31 20:25:16 +00:00
; the total amount of exp a mon gained
wExpAmountGained: : dw
2021-05-31 15:46:10 +00:00
wGainBoostedExp: : db
2021-06-02 00:39:05 +00:00
ENDU
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wGymCityName: : ds 17
2015-07-15 06:16:06 +00:00
2021-05-31 19:04:28 +00:00
wGymLeaderName: : ds NAME_LENGTH
2015-07-15 06:16:06 +00:00
2021-05-31 19:04:28 +00:00
wItemList: : ds 16
2014-05-26 21:04:56 +00:00
2021-05-31 15:46:10 +00:00
wListPointer: : dw
2015-02-08 02:37:40 +00:00
2015-08-07 19:39:29 +00:00
; used to store pointers, but never read
2024-06-15 16:18:00 +00:00
wUnusedNamePointer: : dw
2015-02-08 02:37:40 +00:00
2021-05-31 15:46:10 +00:00
wItemPrices: : dw
2015-02-08 02:37:40 +00:00
2024-08-04 14:05:33 +00:00
wCurPartySpecies: :
wCurItem: :
wCurListMenuItem: :
db
2013-12-05 06:18:14 +00:00
; which pokemon you selected
2021-05-31 19:04:28 +00:00
wWhichPokemon: : db
2013-12-05 06:18:14 +00:00
2015-07-13 06:00:48 +00:00
; if non-zero, then print item prices when displaying lists
2021-05-31 19:04:28 +00:00
wPrintItemPrices: : db
2013-12-05 06:18:14 +00:00
2015-02-08 06:18:42 +00:00
; type of HP bar
; $00 = enemy HUD in battle
; $01 = player HUD in battle / status screen
; $02 = party menu
2021-05-31 19:04:28 +00:00
wHPBarType: :
2013-12-05 06:18:14 +00:00
; ID used by DisplayListMenuID
2021-05-31 19:04:28 +00:00
wListMenuID: : db
2013-12-05 06:18:14 +00:00
2015-07-13 06:36:56 +00:00
; if non-zero, RemovePokemon will remove the mon from the current box,
; else it will remove the mon from the party
2021-05-31 19:04:28 +00:00
wRemoveMonFromBox: :
2015-07-13 06:36:56 +00:00
; 0 = move from box to party
; 1 = move from party to box
; 2 = move from daycare to party
; 3 = move from party to daycare
2021-05-31 19:04:28 +00:00
wMoveMonType: : db
2015-07-13 06:00:48 +00:00
2021-05-31 15:46:10 +00:00
wItemQuantity: : db
2015-07-13 06:00:48 +00:00
2021-05-31 15:46:10 +00:00
wMaxItemQuantity: : db
2015-02-08 02:37:40 +00:00
; LoadMonData copies mon data here
2020-06-28 03:03:39 +00:00
wLoadedMon: : party_struct wLoadedMon
2015-02-08 02:37:40 +00:00
2015-02-09 02:40:08 +00:00
; bit 0: The space in VRAM that is used to store walk animation tile patterns
; for the player and NPCs is in use for font tile patterns.
; This means that NPC movement must be disabled.
; The other bits are unused.
2021-05-31 19:04:28 +00:00
wFontLoaded: : db
2013-12-05 06:18:14 +00:00
2013-12-08 09:49:40 +00:00
; walk animation counter
2021-05-31 19:04:28 +00:00
wWalkCounter: : db
2013-12-05 06:18:14 +00:00
2014-09-13 07:50:56 +00:00
; background tile number in front of the player (either 1 or 2 steps ahead)
2021-05-31 19:04:28 +00:00
wTileInFrontOfPlayer: : db
2013-12-08 09:49:40 +00:00
2015-08-09 05:32:44 +00:00
; The desired fade counter reload value is stored here prior to calling
; PlaySound in order to cause the current music to fade out before the new
; music begins playing. Storing 0 causes no fade out to occur and the new music
; to begin immediately.
; This variable has another use related to fade-out, as well. PlaySound stores
; the sound ID of the music that should be played after the fade-out is finished
; in this variable. FadeOutAudio checks if it's non-zero every V-Blank and
; fades out the current audio if it is. Once it has finished fading out the
; audio, it zeroes this variable and starts playing the sound ID stored in it.
2021-05-31 19:04:28 +00:00
wAudioFadeOutControl: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wAudioFadeOutCounterReloadValue: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wAudioFadeOutCounter: : db
2015-08-09 05:32:44 +00:00
; This is used to determine whether the default music is already playing when
; attempting to play the default music (in order to avoid restarting the same
; music) and whether the music has already been stopped when attempting to
; fade out the current music (so that the new music can be begin immediately
; instead of waiting).
; It sometimes contains the sound ID of the last music played, but it may also
; contain $ff (if the music has been stopped) or 0 (because some routines zero
; it in order to prevent assumptions from being made about the current state of
; the music).
2021-05-31 19:04:28 +00:00
wLastMusicSoundID: : db
2014-09-13 07:50:56 +00:00
2015-07-15 11:27:59 +00:00
; $00 = causes sprites to be hidden and the value to change to $ff
; $01 = enabled
; $ff = disabled
; other values aren't used
2021-05-31 19:04:28 +00:00
wUpdateSpritesEnabled: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wEnemyMoveNum: : db
wEnemyMoveEffect: : db
wEnemyMovePower: : db
wEnemyMoveType: : db
wEnemyMoveAccuracy: : db
wEnemyMoveMaxPP: : db
wPlayerMoveNum: : db
wPlayerMoveEffect: : db
wPlayerMovePower: : db
wPlayerMoveType: : db
wPlayerMoveAccuracy: : db
wPlayerMoveMaxPP: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wEnemyMonSpecies2: : db
wBattleMonSpecies2: : db
2013-12-08 09:49:40 +00:00
2020-06-28 03:03:39 +00:00
wEnemyMonNick: : ds NAME_LENGTH
2013-12-05 06:18:14 +00:00
2020-06-28 03:03:39 +00:00
wEnemyMon: : battle_struct wEnemyMon
2013-12-08 09:49:40 +00:00
2021-05-31 20:25:16 +00:00
wEnemyMonBaseStats: : ds NUM_STATS
wEnemyMonActualCatchRate: : db
wEnemyMonBaseExp: : db
2013-12-08 09:49:40 +00:00
2020-06-28 03:03:39 +00:00
wBattleMonNick: : ds NAME_LENGTH
wBattleMon: : battle_struct wBattleMon
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wTrainerClass: : db
2013-12-08 09:49:40 +00:00
2014-05-26 21:04:56 +00:00
ds 1
2021-05-31 15:46:10 +00:00
wTrainerPicPointer: : dw
2021-05-31 19:04:28 +00:00
2015-04-09 11:05:57 +00:00
ds 1
2015-08-14 07:36:06 +00:00
2021-06-02 00:39:05 +00:00
UNION
wTempMoveNameBuffer: : ds 14
2015-08-14 07:36:06 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2015-08-14 07:36:06 +00:00
; The name of the mon that is learning a move.
2021-06-02 00:39:05 +00:00
wLearnMoveMonName: : ds NAME_LENGTH
ENDU
2021-05-31 20:25:16 +00:00
2021-06-02 00:39:05 +00:00
ds 2
2015-07-25 03:27:59 +00:00
2021-12-09 16:30:15 +00:00
; money received after battle = base money × level of last enemy mon
2021-05-31 22:44:24 +00:00
wTrainerBaseMoney: : dw ; BCD
2015-07-25 03:27:59 +00:00
2021-05-31 15:46:10 +00:00
wMissableObjectCounter: : db
2015-07-25 03:27:59 +00:00
ds 1
2013-12-23 01:05:44 +00:00
; 13 bytes for the letters of the opposing trainer
; the name is terminated with $50 with possible
; unused trailing letters
2021-05-31 19:04:28 +00:00
wTrainerName: : ds 13
2013-12-08 09:49:40 +00:00
2015-07-25 03:27:59 +00:00
; lost battle, this is -1
2013-12-08 09:49:40 +00:00
; no battle, this is 0
; wild battle, this is 1
; trainer battle, this is 2
2021-05-31 19:04:28 +00:00
wIsInBattle: : db
2013-12-08 09:49:40 +00:00
2014-08-09 05:39:13 +00:00
; flags that indicate which party members should be be given exp when GainExperience is called
2021-05-31 20:25:16 +00:00
wPartyGainExpFlags: : flag_array PARTY_LENGTH
2013-12-08 09:49:40 +00:00
; in a wild battle, this is the species of pokemon
2019-07-07 04:44:21 +00:00
; in a trainer battle, this is the trainer class + OPP_ID_OFFSET
2021-05-31 19:04:28 +00:00
wCurOpponent: : db
2013-12-08 09:49:40 +00:00
; in normal battle, this is 0
; in old man battle, this is 1
; in safari battle, this is 2
2021-05-31 19:04:28 +00:00
wBattleType: : db
2013-12-08 09:49:40 +00:00
2015-03-31 18:28:42 +00:00
; bits 0-6: Effectiveness
; $0 = immune
; $5 = not very effective
; $a = neutral
; $14 = super-effective
; bit 7: STAB
2021-05-31 19:04:28 +00:00
wDamageMultipliers: : db
2013-12-08 09:49:40 +00:00
; which entry in LoneAttacks to use
; it's actually the same thing as ^
2021-05-31 19:04:28 +00:00
wLoneAttackNo: :
wGymLeaderNo: : db
2013-12-08 09:49:40 +00:00
; which instance of [youngster, lass, etc] is this?
2021-05-31 19:04:28 +00:00
wTrainerNo: : db
2013-12-08 09:49:40 +00:00
2014-08-09 05:39:13 +00:00
; $00 = normal attack
; $01 = critical hit
; $02 = successful OHKO
; $ff = failed OHKO
2021-05-31 19:04:28 +00:00
wCriticalHitOrOHKO: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wMoveMissed: : db
2013-12-08 09:49:40 +00:00
2015-02-08 09:44:41 +00:00
; always 0
2021-05-31 19:04:28 +00:00
wPlayerStatsToDouble: : db
2015-02-08 09:44:41 +00:00
; always 0
2021-05-31 19:04:28 +00:00
wPlayerStatsToHalve: : db
2013-12-08 09:49:40 +00:00
2021-05-31 19:04:28 +00:00
wPlayerBattleStatus1: : db
wPlayerBattleStatus2: : db
wPlayerBattleStatus3: : db
2013-12-08 09:49:40 +00:00
2015-02-08 09:44:41 +00:00
; always 0
2021-05-31 19:04:28 +00:00
wEnemyStatsToDouble: : db
2015-02-08 09:44:41 +00:00
; always 0
2021-05-31 19:04:28 +00:00
wEnemyStatsToHalve: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wEnemyBattleStatus1: : db
wEnemyBattleStatus2: : db
wEnemyBattleStatus3: : db
2013-12-08 09:49:40 +00:00
2014-08-09 05:39:13 +00:00
; when the player is attacking multiple times, the number of attacks left
2021-05-31 19:04:28 +00:00
wPlayerNumAttacksLeft: : db
2014-08-09 05:39:13 +00:00
2021-05-31 15:46:10 +00:00
wPlayerConfusedCounter: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wPlayerToxicCounter: : db
2015-08-31 02:38:41 +00:00
2015-04-08 23:17:56 +00:00
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
2021-05-31 19:04:28 +00:00
wPlayerDisabledMove: : db
2013-12-05 06:18:14 +00:00
2014-05-26 21:04:56 +00:00
ds 1
2015-01-31 17:26:05 +00:00
; when the enemy is attacking multiple times, the number of attacks left
2021-05-31 19:04:28 +00:00
wEnemyNumAttacksLeft: : db
2014-08-09 05:39:13 +00:00
2021-05-31 15:46:10 +00:00
wEnemyConfusedCounter: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wEnemyToxicCounter: : db
2015-08-31 02:38:41 +00:00
2015-04-08 23:17:56 +00:00
; high nibble: which move is disabled (1-4)
; low nibble: disable turns left
2021-05-31 19:04:28 +00:00
wEnemyDisabledMove: : db
2013-12-05 06:18:14 +00:00
2013-12-08 09:49:40 +00:00
ds 1
2013-12-05 06:18:14 +00:00
2021-06-02 00:39:05 +00:00
UNION
2021-05-31 20:25:16 +00:00
; the amount of damage accumulated by the player while biding
2021-06-02 00:39:05 +00:00
wPlayerBideAccumulatedDamage: : dw
2015-02-07 10:43:08 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
wUnknownSerialCounter2: : dw
2015-02-07 10:43:08 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2021-05-31 20:25:16 +00:00
; number of hits by player in attacks like Double Slap, etc.
wPlayerNumHits: : db
2021-06-02 00:39:05 +00:00
ENDU
2013-12-05 06:18:14 +00:00
2021-06-02 00:39:05 +00:00
ds 2
2014-08-09 05:39:13 +00:00
; non-zero when an item or move that allows escape from battle was used
2021-05-31 19:04:28 +00:00
wEscapedFromBattle: : db
2014-08-09 05:39:13 +00:00
2021-06-02 00:39:05 +00:00
UNION
wAmountMoneyWon: : ds 3 ; BCD
2015-07-25 03:27:59 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2021-05-31 15:46:10 +00:00
wObjectToHide: : db
wObjectToShow: : db
2021-06-02 00:39:05 +00:00
ENDU
2013-12-05 06:18:14 +00:00
2015-08-30 00:15:05 +00:00
; the map you will start at when the debug bit is set
2021-05-31 19:04:28 +00:00
wDefaultMap: :
2020-06-28 03:03:39 +00:00
wMenuItemOffset: :
2013-12-08 09:49:40 +00:00
; ID number of the current battle animation
2021-05-31 19:04:28 +00:00
wAnimationID: : db
2013-12-08 09:49:40 +00:00
2020-06-28 03:03:39 +00:00
wNamingScreenType: :
wPartyMenuTypeOrMessageID: :
2015-07-13 22:40:33 +00:00
; temporary storage for the number of tiles in a tileset
2021-05-31 19:04:28 +00:00
wTempTilesetNumTiles: : db
2015-07-13 06:00:48 +00:00
; used by the pokemart code to save the existing value of wListScrollOffset
; so that it can be restored when the player is done with the pokemart NPC
2021-05-31 19:04:28 +00:00
wSavedListScrollOffset: : db
2015-07-13 06:00:48 +00:00
ds 2
2013-12-05 06:18:14 +00:00
; base coordinates of frame block
2021-05-31 15:46:10 +00:00
wBaseCoordX: : db
wBaseCoordY: : db
2013-12-08 09:49:40 +00:00
2015-03-12 14:49:35 +00:00
; low health alarm counter/enable
; high bit = enable, others = timer to cycle frequencies
2021-05-31 20:25:16 +00:00
wLowHealthAlarm: : db
2013-12-08 09:49:40 +00:00
; counts how many tiles of the current frame block have been drawn
2021-05-31 19:04:28 +00:00
wFBTileCounter: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wMovingBGTilesCounter2: : db
2013-12-08 09:49:40 +00:00
; duration of each frame of the current subanimation in terms of screen refreshes
2021-05-31 19:04:28 +00:00
wSubAnimFrameDelay: : db
2013-12-08 09:49:40 +00:00
; counts the number of subentries left in the current subanimation
2021-05-31 19:04:28 +00:00
wSubAnimCounter: : db
2013-12-05 06:18:14 +00:00
2015-07-19 03:49:52 +00:00
; 1 = no save file or save file is corrupted
; 2 = save file exists and no corruption has been detected
2021-05-31 19:04:28 +00:00
wSaveFileStatus: : db
2013-12-05 06:18:14 +00:00
2013-12-08 09:49:40 +00:00
; number of tiles in current battle animation frame block
2021-05-31 19:04:28 +00:00
wNumFBTiles: : db
2013-12-05 06:18:14 +00:00
2021-06-02 00:39:05 +00:00
UNION
wSpiralBallsBaseY: : db
wSpiralBallsBaseX: : db
NEXTU
2015-07-24 21:39:45 +00:00
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
; bit 7: direction; 0 = right, 1 = left
2021-06-02 00:39:05 +00:00
wFallingObjectMovementByte: : db
wNumFallingObjects: : db
NEXTU
wFlashScreenLongCounter: :
2020-06-28 03:03:39 +00:00
wNumShootingBalls: :
2015-03-14 22:25:21 +00:00
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
2021-05-31 19:04:28 +00:00
wTradedMonMovingRight: :
2020-06-28 03:03:39 +00:00
wOptionsInitialized: :
wNewSlotMachineBallTile: :
2015-07-24 21:39:45 +00:00
; how much to add to the X/Y coord
2021-05-31 19:04:28 +00:00
wCoordAdjustmentAmount: :
2024-06-15 16:18:00 +00:00
wUnusedWaterDropletsByte: :
2021-05-31 20:25:16 +00:00
db
2015-07-24 21:39:45 +00:00
2020-06-28 03:03:39 +00:00
wSlideMonDelay: :
2015-07-13 20:35:35 +00:00
; generic counter variable for various animations
2021-05-31 19:04:28 +00:00
wAnimCounter: :
2013-12-08 09:49:40 +00:00
; controls what transformations are applied to the subanimation
2013-12-05 06:18:14 +00:00
; 01: flip horizontally and vertically
; 02: flip horizontally and translate downwards 40 pixels
; 03: translate base coordinates of frame blocks, but don't change their internal coordinates or flip their tiles
; 04: reverse the subanimation
2021-05-31 20:25:16 +00:00
wSubAnimTransform: :
db
2021-06-02 00:39:05 +00:00
ENDU
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wEndBattleWinTextPointer: : dw
wEndBattleLoseTextPointer: : dw
2013-12-08 09:49:40 +00:00
ds 2
2021-05-31 15:46:10 +00:00
wEndBattleTextRomBank: : db
2013-12-08 09:49:40 +00:00
ds 1
2013-12-05 06:18:14 +00:00
2013-12-08 09:49:40 +00:00
; the address _of the address_ of the current subanimation entry
2021-05-31 19:04:28 +00:00
wSubAnimAddrPtr: : dw
2015-07-13 20:35:35 +00:00
2021-06-02 00:39:05 +00:00
UNION
2021-05-31 20:25:16 +00:00
; the address of the current subentry of the current subanimation
2021-06-02 00:39:05 +00:00
wSubAnimSubEntryAddr: : dw
2021-05-31 20:25:16 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2015-07-13 20:35:35 +00:00
; If non-zero, the allow matches flag is always set.
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
; the only way it can increase. Winning certain payout amounts will decrement it
; or zero it.
2021-05-31 20:25:16 +00:00
wSlotMachineAllowMatchesCounter: : db
2021-06-02 00:39:05 +00:00
ENDU
2013-12-05 06:18:14 +00:00
2021-06-02 00:39:05 +00:00
ds 2
2014-05-26 21:04:56 +00:00
2021-05-31 15:46:10 +00:00
wOutwardSpiralTileMapPointer: : db
2015-07-24 21:39:45 +00:00
2020-06-28 03:03:39 +00:00
wPartyMenuAnimMonEnabled: :
2014-09-14 18:29:18 +00:00
; non-zero when enabled. causes nest locations to blink on and off.
; the town selection cursor will blink regardless of what this value is
2021-05-31 19:04:28 +00:00
wTownMapSpriteBlinkingEnabled: :
2024-06-15 16:18:00 +00:00
wUnusedMoveAnimByte: : db
2013-12-05 06:18:14 +00:00
2013-12-08 09:49:40 +00:00
; current destination address in OAM for frame blocks (big endian)
2021-05-31 19:04:28 +00:00
wFBDestAddr: : dw
2013-12-05 06:18:14 +00:00
2013-12-08 09:49:40 +00:00
; controls how the frame blocks are put together to form frames
2013-12-05 06:18:14 +00:00
; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
; 00: clean OAM buffer and delay
; 02: move onto the next frame block with no delay and no cleaning OAM buffer
; 03: delay, but don't clean OAM buffer
2015-08-31 02:38:41 +00:00
; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
2021-05-31 19:04:28 +00:00
wFBMode: : db
2013-12-08 09:49:40 +00:00
2015-07-24 21:39:45 +00:00
; 0 = small
; 1 = big
2021-05-31 19:04:28 +00:00
wLinkCableAnimBulgeToggle: :
2020-06-28 03:03:39 +00:00
wIntroNidorinoBaseTile: :
wOutwardSpiralCurrentDirection: :
wDropletTile: :
wNewTileBlockID: :
wWhichBattleAnimTileset: :
2015-07-24 21:39:45 +00:00
; 0 = left
; 1 = right
2021-05-31 19:04:28 +00:00
wSquishMonCurrentDirection: :
2015-07-24 21:39:45 +00:00
; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
2021-05-31 20:25:16 +00:00
wSlideMonUpBottomRowLeftTile: :
db
2015-07-24 21:39:45 +00:00
2021-05-31 20:25:16 +00:00
wDisableVBlankWYUpdate: : db ; if non-zero, don't update WY during V-blank
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wSpriteCurPosX: : db
wSpriteCurPosY: : db
wSpriteWidth: : db
wSpriteHeight: : db
2013-12-08 09:49:40 +00:00
; current input byte
2021-05-31 19:04:28 +00:00
wSpriteInputCurByte: : db
2013-12-08 09:49:40 +00:00
; bit offset of last read input bit
2021-05-31 19:04:28 +00:00
wSpriteInputBitCounter: : db
2013-12-08 09:49:40 +00:00
2021-05-31 19:04:28 +00:00
; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
2013-12-05 06:18:14 +00:00
; 3 -> XX000000 1st column
; 2 -> 00XX0000 2nd column
; 1 -> 0000XX00 3rd column
; 0 -> 000000XX 4th column
2021-05-31 19:04:28 +00:00
wSpriteOutputBitOffset: : db
2013-12-05 06:18:14 +00:00
2020-07-04 02:11:35 +00:00
; bit 0 determines used buffer (0 -> sSpriteBuffer1, 1 -> sSpriteBuffer2)
2013-12-05 06:18:14 +00:00
; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
2021-05-31 19:04:28 +00:00
wSpriteLoadFlags: : db
2021-05-31 15:46:10 +00:00
wSpriteUnpackMode: : db
wSpriteFlipped: : db
2013-12-08 09:49:40 +00:00
; pointer to next input byte
2021-05-31 19:04:28 +00:00
wSpriteInputPtr: : dw
2013-12-08 09:49:40 +00:00
; pointer to current output byte
2021-05-31 19:04:28 +00:00
wSpriteOutputPtr: : dw
2013-12-08 09:49:40 +00:00
; used to revert pointer for different bit offsets
2021-05-31 19:04:28 +00:00
wSpriteOutputPtrCached: : dw
2013-12-08 09:49:40 +00:00
; pointer to differential decoding table (assuming initial value 0)
2021-05-31 19:04:28 +00:00
wSpriteDecodeTable0Ptr: : dw
2013-12-08 09:49:40 +00:00
; pointer to differential decoding table (assuming initial value 1)
2021-05-31 19:04:28 +00:00
wSpriteDecodeTable1Ptr: : dw
2013-12-08 09:49:40 +00:00
2021-05-31 20:25:16 +00:00
wd0b5: : db ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wNameListType: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wPredefBank: : db
2013-12-08 09:49:40 +00:00
2020-06-28 03:03:39 +00:00
wMonHeader: :
2017-06-24 20:01:43 +00:00
; In the ROM base stats data structure, this is the dex number, but it is
2015-08-07 19:39:29 +00:00
; overwritten with the internal index number after the header is copied to WRAM.
2021-05-31 19:04:28 +00:00
wMonHIndex: : db
2020-06-28 03:03:39 +00:00
wMonHBaseStats: :
2021-05-31 15:46:10 +00:00
wMonHBaseHP: : db
wMonHBaseAttack: : db
wMonHBaseDefense: : db
wMonHBaseSpeed: : db
wMonHBaseSpecial: : db
2020-06-28 03:03:39 +00:00
wMonHTypes: :
2021-05-31 15:46:10 +00:00
wMonHType1: : db
wMonHType2: : db
wMonHCatchRate: : db
wMonHBaseEXP: : db
wMonHSpriteDim: : db
wMonHFrontSprite: : dw
wMonHBackSprite: : dw
2021-05-31 19:04:28 +00:00
wMonHMoves: : ds NUM_MOVES
2021-05-31 15:46:10 +00:00
wMonHGrowthRate: : db
2021-05-31 19:04:28 +00:00
wMonHLearnset: : flag_array NUM_TMS + NUM_HMS
2014-05-26 21:04:56 +00:00
ds 1
2020-11-17 21:27:44 +00:00
wMonHeaderEnd: :
2013-12-08 09:49:40 +00:00
2015-07-20 00:52:26 +00:00
; saved at the start of a battle and then written back at the end of the battle
2021-05-31 19:04:28 +00:00
wSavedTileAnimations: : db
2015-07-20 00:52:26 +00:00
ds 2
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wDamage: : dw
2013-12-08 09:49:40 +00:00
2015-07-17 07:52:25 +00:00
ds 2
2015-02-03 19:51:53 +00:00
2021-05-31 15:46:10 +00:00
wRepelRemainingSteps: : db
2015-02-08 08:17:03 +00:00
; list of moves for FormatMovesString
2021-05-31 19:04:28 +00:00
wMoves: : ds NUM_MOVES
2015-02-08 08:17:03 +00:00
2021-05-31 15:46:10 +00:00
wMoveNum: : db
2015-02-08 08:17:03 +00:00
2021-05-31 19:04:28 +00:00
wMovesString: : ds 56
2015-02-08 08:17:03 +00:00
2024-06-15 16:18:00 +00:00
wUnusedCurMapTilesetCopy: : db
2014-09-13 07:50:56 +00:00
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
2021-05-31 19:04:28 +00:00
wWalkBikeSurfStateCopy: : db
2014-09-13 07:50:56 +00:00
2015-07-13 06:00:48 +00:00
; the type of list for InitList to init
2021-05-31 19:04:28 +00:00
wInitListType: : db
2015-07-13 06:00:48 +00:00
2015-07-25 03:27:59 +00:00
; 0 if no mon was captured
2021-05-31 19:04:28 +00:00
wCapturedMonSpecies: : db
2015-07-25 03:27:59 +00:00
; Non-zero when the first player mon and enemy mon haven't been sent out yet.
; It prevents the game from asking if the player wants to choose another mon
; when the enemy sends out their first mon and suppresses the "no will to fight"
; message when the game searches for the first non-fainted mon in the party,
; which will be the first mon sent out.
2021-05-31 19:04:28 +00:00
wFirstMonsNotOutYet: : db
2015-07-25 03:27:59 +00:00
2020-06-28 03:03:39 +00:00
wPokeBallCaptureCalcTemp: :
2015-08-07 12:20:37 +00:00
; lower nybble: number of shakes
; upper nybble: number of animations to play
2020-06-28 03:03:39 +00:00
wPokeBallAnimData: :
wUsingPPUp: :
wMaxPP: :
2015-08-07 12:20:37 +00:00
; 0 for player, non-zero for enemy
2020-06-28 03:03:39 +00:00
wCalculateWhoseStats: :
wTypeEffectiveness: :
wMoveType: :
wNumSetBits: :
2021-05-31 20:25:16 +00:00
; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
wd11e: :
db
2015-07-25 03:27:59 +00:00
; When this value is non-zero, the player isn't allowed to exit the party menu
; by pressing B and not choosing a mon.
2021-05-31 19:04:28 +00:00
wForcePlayerToChooseMon: : db
2014-08-09 05:39:13 +00:00
; number of times the player has tried to run from battle
2021-05-31 19:04:28 +00:00
wNumRunAttempts: : db
2014-08-09 05:39:13 +00:00
2021-05-31 15:46:10 +00:00
wEvolutionOccurred: : db
2015-07-25 03:27:59 +00:00
2021-05-31 15:46:10 +00:00
wVBlankSavedROMBank: : db
2015-07-25 03:27:59 +00:00
ds 1
2021-05-31 15:46:10 +00:00
wIsKeyItem: : db
2015-02-07 10:43:08 +00:00
2021-05-31 15:46:10 +00:00
wTextBoxID: : db
2015-02-07 10:43:08 +00:00
2021-05-31 20:25:16 +00:00
wCurrentMapScriptFlags: : db ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
2013-12-08 09:49:40 +00:00
2024-07-16 17:02:54 +00:00
wCurEnemyLevel: : db
2013-12-08 09:49:40 +00:00
2015-07-13 06:00:48 +00:00
; pointer to list of items terminated by $FF
2021-05-31 19:04:28 +00:00
wItemListPointer: : dw
2015-07-13 06:00:48 +00:00
2015-07-13 07:32:03 +00:00
; number of entries in a list
2021-05-31 19:04:28 +00:00
wListCount: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wLinkState: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wTwoOptionMenuID: : db
2015-07-13 06:00:48 +00:00
; the id of the menu item the player ultimately chose
2021-05-31 19:04:28 +00:00
wChosenMenuItem: :
2015-07-13 06:00:48 +00:00
; non-zero when the whole party has fainted due to out-of-battle poison damage
2021-05-31 19:04:28 +00:00
wOutOfBattleBlackout: : db
2015-07-13 06:00:48 +00:00
; the way the user exited a menu
; for list menus and the buy/sell/quit menu:
; $01 = the user pressed A to choose a menu item
; $02 = the user pressed B to cancel
; for two-option menus:
; $01 = the user pressed A with the first menu item selected
; $02 = the user pressed B or pressed A with the second menu item selected
2021-05-31 19:04:28 +00:00
wMenuExitMethod: : db
2015-07-13 06:00:48 +00:00
2015-07-26 02:26:54 +00:00
; the size is always 6, so they didn't need a variable in RAM for this
2021-05-31 19:04:28 +00:00
wDungeonWarpDataEntrySize: :
2015-07-26 02:26:54 +00:00
; 0 = museum guy
; 1 = gym guy
2021-05-31 19:04:28 +00:00
wWhichPewterGuy: :
2015-07-26 02:26:54 +00:00
; there are 3 windows, from 0 to 2
2021-05-31 19:04:28 +00:00
wWhichPrizeWindow: :
2015-07-26 02:26:54 +00:00
; a horizontal or vertical gate block
2021-05-31 19:04:28 +00:00
wGymGateTileBlock: : db
2015-07-26 02:26:54 +00:00
2021-05-31 15:46:10 +00:00
wSavedSpriteScreenY: : db
wSavedSpriteScreenX: : db
wSavedSpriteMapY: : db
wSavedSpriteMapX: : db
2015-07-26 02:26:54 +00:00
ds 5
2021-05-31 15:46:10 +00:00
wWhichPrize: : db
2014-09-14 18:29:18 +00:00
; counts downward each frame
2024-07-16 17:02:54 +00:00
; when it hits 0, BIT_DISABLE_JOYPAD of wStatusFlags5 is reset
2021-05-31 19:04:28 +00:00
wIgnoreInputCounter: : db
2014-09-13 07:50:56 +00:00
; counts down once every step
2021-05-31 19:04:28 +00:00
wStepCounter: : db
2014-09-13 07:50:56 +00:00
; after a battle, you have at least 3 steps before a random battle can occur
2021-05-31 19:04:28 +00:00
wNumberOfNoRandomBattleStepsLeft: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wPrize1: : db
wPrize2: : db
wPrize3: : db
2013-12-08 09:49:40 +00:00
2014-05-26 21:04:56 +00:00
ds 1
2021-06-02 00:39:05 +00:00
UNION
wSerialRandomNumberListBlock: : ds $ 11
2015-02-07 10:43:08 +00:00
2021-06-02 00:39:05 +00:00
NEXTU
2021-05-31 15:46:10 +00:00
wPrize1Price: : dw
wPrize2Price: : dw
wPrize3Price: : dw
2015-07-26 02:26:54 +00:00
ds 1
2015-02-07 10:43:08 +00:00
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
2021-05-31 19:04:28 +00:00
wLinkBattleRandomNumberList: : ds 10
2021-06-02 00:39:05 +00:00
ENDU
2015-02-07 10:43:08 +00:00
2021-05-31 22:44:24 +00:00
wSerialPlayerDataBlock: : ; ds $1a8
2015-02-07 10:43:08 +00:00
2015-07-26 02:26:54 +00:00
; When a real item is being used, this is 0.
; When a move is acting as an item, this is the ID of the item it's acting as.
; For example, out-of-battle Dig is executed using a fake Escape Rope item. In
; that case, this would be ESCAPE_ROPE.
2021-05-31 19:04:28 +00:00
wPseudoItemID: : db
2015-07-26 02:26:54 +00:00
2024-06-15 16:18:00 +00:00
wUnusedAlreadyOwnedFlag: : db
2015-07-26 02:26:54 +00:00
ds 2
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wEvoStoneItemID: : db
2015-07-26 02:26:54 +00:00
2021-05-31 15:46:10 +00:00
wSavedNPCMovementDirections2Index: : db
2013-12-08 09:49:40 +00:00
2021-05-31 19:04:28 +00:00
wPlayerName: : ds NAME_LENGTH
2013-12-08 09:49:40 +00:00
2015-08-11 04:03:31 +00:00
2021-05-31 21:17:03 +00:00
SECTION "Party Data" , WRAM0
2015-08-11 04:03:31 +00:00
wPartyDataStart: :
2021-05-31 20:25:16 +00:00
wPartyCount: : db
2021-04-27 19:49:59 +00:00
wPartySpecies: : ds PARTY_LENGTH + 1
2013-12-08 09:49:40 +00:00
2014-06-14 11:12:40 +00:00
wPartyMons: :
2021-04-27 19:49:59 +00:00
; wPartyMon1 - wPartyMon6
2021-05-31 15:46:10 +00:00
FOR n , 1 , PARTY_LENGTH + 1
2021-04-27 19:49:59 +00:00
wPartyMon { d : n } :: party_struct wPartyMon { d : n }
2021-05-31 15:46:10 +00:00
ENDR
2021-04-27 19:49:59 +00:00
wPartyMonOT: :
; wPartyMon1OT - wPartyMon6OT
2021-05-31 15:46:10 +00:00
FOR n , 1 , PARTY_LENGTH + 1
2021-04-27 19:49:59 +00:00
wPartyMon { d : n } OT :: ds NAME_LENGTH
2021-05-31 15:46:10 +00:00
ENDR
2021-04-27 19:49:59 +00:00
wPartyMonNicks: :
; wPartyMon1Nick - wPartyMon6Nick
2021-05-31 15:46:10 +00:00
FOR n , 1 , PARTY_LENGTH + 1
2021-04-27 19:49:59 +00:00
wPartyMon { d : n } Nick :: ds NAME_LENGTH
2021-05-31 15:46:10 +00:00
ENDR
2020-07-05 20:41:45 +00:00
wPartyMonNicksEnd: :
2013-12-05 06:18:14 +00:00
2015-08-11 04:03:31 +00:00
wPartyDataEnd: :
2021-05-31 21:17:03 +00:00
SECTION "Main Data" , WRAM0
2015-08-11 04:03:31 +00:00
wMainDataStart: :
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wPokedexOwned: : flag_array NUM_POKEMON
2014-01-27 22:09:09 +00:00
wPokedexOwnedEnd: :
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wPokedexSeen: : flag_array NUM_POKEMON
2014-01-27 22:09:09 +00:00
wPokedexSeenEnd: :
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wNumBagItems: : db
2013-12-08 09:49:40 +00:00
; item, quantity
2021-05-31 19:04:28 +00:00
wBagItems: : ds BAG_ITEM_CAPACITY * 2 + 1
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wPlayerMoney: : ds 3 ; BCD
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wRivalName: : ds NAME_LENGTH
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wOptions: : db
2013-12-05 06:18:14 +00:00
2021-05-31 20:25:16 +00:00
wObtainedBadges: : flag_array NUM_BADGES
2013-12-05 06:18:14 +00:00
2014-05-26 21:04:56 +00:00
ds 1
2021-05-31 19:04:28 +00:00
wLetterPrintingDelayFlags: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wPlayerID: : dw
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wMapMusicSoundID: : db
wMapMusicROMBank: : db
2014-09-13 07:50:56 +00:00
; offset subtracted from FadePal4 to get the background and object palettes for the current map
; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
2021-05-31 19:04:28 +00:00
wMapPalOffset: : db
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wCurMap: : db
2013-12-08 09:49:40 +00:00
2014-09-13 07:50:56 +00:00
; pointer to the upper left corner of the current view in the tile block map
2021-05-31 19:04:28 +00:00
wCurrentTileBlockMapViewPointer: : dw
2013-12-05 06:18:14 +00:00
2020-07-07 01:15:12 +00:00
; player's position on the current map
2021-05-31 19:04:28 +00:00
wYCoord: : db
2021-05-31 15:46:10 +00:00
wXCoord: : db
2013-12-08 19:25:19 +00:00
2021-05-31 20:25:16 +00:00
; player's position (by block)
2021-05-31 19:04:28 +00:00
wYBlockCoord: : db
2021-05-31 15:46:10 +00:00
wXBlockCoord: : db
2014-04-27 06:44:29 +00:00
2021-05-31 15:46:10 +00:00
wLastMap: : db
2024-06-15 16:18:00 +00:00
wUnusedLastMapWidth: : db
2013-12-08 19:25:19 +00:00
2023-11-17 18:50:27 +00:00
wCurMapHeader: :
2021-05-31 15:46:10 +00:00
wCurMapTileset: : db
2023-11-22 15:09:21 +00:00
wCurMapHeight: : db
2021-05-31 19:04:28 +00:00
wCurMapWidth: : db
2023-11-17 18:50:27 +00:00
wCurMapDataPtr: : dw
wCurMapTextPtr: : dw
wCurMapScriptPtr: : dw
wCurMapConnections: : db
wCurMapHeaderEnd: :
2013-12-08 19:25:19 +00:00
2021-05-31 20:25:16 +00:00
wNorthConnectionHeader: : map_connection_struct wNorth
wSouthConnectionHeader: : map_connection_struct wSouth
wWestConnectionHeader: : map_connection_struct wWest
wEastConnectionHeader: : map_connection_struct wEast
2013-12-05 06:18:14 +00:00
2013-12-08 19:25:19 +00:00
; sprite set for the current map (11 sprite picture ID's)
2021-05-31 19:04:28 +00:00
wSpriteSet: : ds 11
2013-12-08 19:25:19 +00:00
; sprite set ID for the current map
2021-05-31 19:04:28 +00:00
wSpriteSetID: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wObjectDataPointerTemp: : dw
2015-07-20 00:52:26 +00:00
ds 2
; the tile shown outside the boundaries of the map
2021-05-31 19:04:28 +00:00
wMapBackgroundTile: : db
2014-09-13 07:50:56 +00:00
2021-05-31 20:25:16 +00:00
; number of warps in current map (up to 32)
2021-05-31 19:04:28 +00:00
wNumberOfWarps: : db
2014-09-13 07:50:56 +00:00
; current map warp entries
2021-05-31 20:25:16 +00:00
wWarpEntries: : ds 32 * 4 ; Y, X, warp ID, map ID
2014-09-13 07:50:56 +00:00
; if $ff, the player's coordinates are not updated when entering the map
2021-05-31 19:04:28 +00:00
wDestinationWarpID: : db
2014-09-13 07:50:56 +00:00
ds 128
2015-07-20 00:52:26 +00:00
; number of signs in the current map (up to 16)
2021-05-31 19:04:28 +00:00
wNumSigns: : db
2015-07-20 00:52:26 +00:00
2021-05-31 20:25:16 +00:00
wSignCoords: : ds 16 * 2 ; Y, X
2021-05-31 19:04:28 +00:00
wSignTextIDs: : ds 16
2013-12-05 06:18:14 +00:00
2021-05-31 20:25:16 +00:00
; number of sprites on the current map (up to 16)
2021-05-31 19:04:28 +00:00
wNumSprites: : db
2014-05-26 21:04:56 +00:00
2014-09-13 07:50:56 +00:00
; these two variables track the X and Y offset in blocks from the last special warp used
; they don't seem to be used for anything
2021-05-31 15:46:10 +00:00
wYOffsetSinceLastSpecialWarp: : db
wXOffsetSinceLastSpecialWarp: : db
2013-12-05 06:18:14 +00:00
2021-05-31 20:25:16 +00:00
wMapSpriteData: : ds 16 * 2 ; movement byte 2, text ID
wMapSpriteExtraData: : ds 16 * 2 ; trainer class/item ID, trainer set ID
2014-05-26 21:04:56 +00:00
2015-07-20 00:52:26 +00:00
; map height in 2x2 meta-tiles
2021-05-31 19:04:28 +00:00
wCurrentMapHeight2: : db
2015-07-20 00:52:26 +00:00
; map width in 2x2 meta-tiles
2021-05-31 19:04:28 +00:00
wCurrentMapWidth2: : db
2014-09-14 18:29:18 +00:00
; the address of the upper left corner of the visible portion of the BG tile map in VRAM
2021-05-31 19:04:28 +00:00
wMapViewVRAMPointer: : dw
2014-09-14 18:29:18 +00:00
2015-07-20 00:52:26 +00:00
; In the comments for the player direction variables below, "moving" refers to
; both walking and changing facing direction without taking a step.
; if the player is moving, the current direction
; if the player is not moving, zero
; map scripts write to this in order to change the player's facing direction
2021-05-31 19:04:28 +00:00
wPlayerMovingDirection: : db
2015-07-20 00:52:26 +00:00
; the direction in which the player was moving before the player last stopped
2021-05-31 19:04:28 +00:00
wPlayerLastStopDirection: : db
2015-07-20 00:52:26 +00:00
; if the player is moving, the current direction
; if the player is not moving, the last the direction in which the player moved
2021-05-31 19:04:28 +00:00
wPlayerDirection: : db
2013-12-08 19:25:19 +00:00
2021-05-31 15:46:10 +00:00
wTilesetBank: : db
2013-12-08 19:25:19 +00:00
; maps blocks (4x4 tiles) to tiles
2021-05-31 19:04:28 +00:00
wTilesetBlocksPtr: : dw
2013-12-08 19:25:19 +00:00
2021-05-31 15:46:10 +00:00
wTilesetGfxPtr: : dw
2013-12-08 19:25:19 +00:00
; list of all walkable tiles
2021-05-31 19:04:28 +00:00
wTilesetCollisionPtr: : dw
2013-12-08 19:25:19 +00:00
2021-05-31 19:04:28 +00:00
wTilesetTalkingOverTiles: : ds 3
2013-12-08 19:25:19 +00:00
2021-05-31 15:46:10 +00:00
wGrassTile: : db
2013-12-05 06:18:14 +00:00
2014-05-26 17:05:58 +00:00
ds 4
2013-12-08 09:49:40 +00:00
2021-05-31 15:46:10 +00:00
wNumBoxItems: : db
2013-12-08 09:49:40 +00:00
; item, quantity
2021-05-31 19:04:28 +00:00
wBoxItems: : ds PC_ITEM_CAPACITY * 2 + 1
2013-12-08 09:49:40 +00:00
2015-07-19 03:49:52 +00:00
; bits 0-6: box number
; bit 7: whether the player has changed boxes before
2023-05-10 14:49:45 +00:00
wCurrentBoxNum: : db
ds 1
2015-07-15 02:46:52 +00:00
; number of HOF teams
2021-05-31 19:04:28 +00:00
wNumHoFTeams: : db
2015-07-15 02:46:52 +00:00
2024-06-15 16:18:00 +00:00
wUnusedMapVariable: : db
2013-12-05 06:18:14 +00:00
2023-11-22 15:12:40 +00:00
wPlayerCoins: : dw ; BCD
2013-12-08 09:49:40 +00:00
; bit array of missable objects. set = removed
2021-05-31 20:25:16 +00:00
wMissableObjectFlags: : flag_array $ 100
2015-08-10 04:56:20 +00:00
wMissableObjectFlagsEnd: :
ds 7
2014-05-26 21:04:56 +00:00
2023-11-20 23:53:23 +00:00
; saved copy of SPRITESTATEDATA1_IMAGEINDEX (used for sprite facing/anim)
wSavedSpriteImageIndex: : db
2013-12-05 06:18:14 +00:00
; each entry consists of 2 bytes
; * the sprite ID (depending on the current map)
2015-08-31 02:38:41 +00:00
; * the missable object index (global, used for wMissableObjectFlags)
2013-12-05 06:18:14 +00:00
; terminated with $FF
2021-05-31 20:25:16 +00:00
wMissableObjectList: : ds 16 * 2 + 1
ds 1
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wGameProgressFlags: :
2021-05-31 15:46:10 +00:00
wOaksLabCurScript: : db
wPalletTownCurScript: : db
ds 1
wBluesHouseCurScript: : db
wViridianCityCurScript: : db
ds 2
wPewterCityCurScript: : db
wRoute3CurScript: : db
wRoute4CurScript: : db
ds 1
wViridianGymCurScript: : db
wPewterGymCurScript: : db
wCeruleanGymCurScript: : db
wVermilionGymCurScript: : db
wCeladonGymCurScript: : db
wRoute6CurScript: : db
wRoute8CurScript: : db
wRoute24CurScript: : db
wRoute25CurScript: : db
wRoute9CurScript: : db
wRoute10CurScript: : db
wMtMoon1FCurScript: : db
wMtMoonB2FCurScript: : db
wSSAnne1FRoomsCurScript: : db
wSSAnne2FRoomsCurScript: : db
wRoute22CurScript: : db
ds 1
wRedsHouse2FCurScript: : db
wViridianMartCurScript: : db
wRoute22GateCurScript: : db
wCeruleanCityCurScript: : db
2013-12-08 19:48:17 +00:00
ds 7
2021-05-31 15:46:10 +00:00
wSSAnneBowCurScript: : db
wViridianForestCurScript: : db
wMuseum1FCurScript: : db
wRoute13CurScript: : db
wRoute14CurScript: : db
wRoute17CurScript: : db
wRoute19CurScript: : db
wRoute21CurScript: : db
wSafariZoneGateCurScript: : db
wRockTunnelB1FCurScript: : db
wRockTunnel1FCurScript: : db
ds 1
wRoute11CurScript: : db
wRoute12CurScript: : db
wRoute15CurScript: : db
wRoute16CurScript: : db
wRoute18CurScript: : db
wRoute20CurScript: : db
wSSAnneB1FRoomsCurScript: : db
wVermilionCityCurScript: : db
wPokemonTower2FCurScript: : db
wPokemonTower3FCurScript: : db
wPokemonTower4FCurScript: : db
wPokemonTower5FCurScript: : db
wPokemonTower6FCurScript: : db
wPokemonTower7FCurScript: : db
wRocketHideoutB1FCurScript: : db
wRocketHideoutB2FCurScript: : db
wRocketHideoutB3FCurScript: : db
wRocketHideoutB4FCurScript: : db
ds 1
wRoute6GateCurScript: : db
wRoute8GateCurScript: : db
ds 1
wCinnabarIslandCurScript: : db
wPokemonMansion1FCurScript: : db
ds 1
wPokemonMansion2FCurScript: : db
wPokemonMansion3FCurScript: : db
wPokemonMansionB1FCurScript: : db
wVictoryRoad2FCurScript: : db
wVictoryRoad3FCurScript: : db
ds 1
wFightingDojoCurScript: : db
wSilphCo2FCurScript: : db
wSilphCo3FCurScript: : db
wSilphCo4FCurScript: : db
wSilphCo5FCurScript: : db
wSilphCo6FCurScript: : db
wSilphCo7FCurScript: : db
wSilphCo8FCurScript: : db
wSilphCo9FCurScript: : db
wHallOfFameCurScript: : db
wChampionsRoomCurScript: : db
wLoreleisRoomCurScript: : db
wBrunosRoomCurScript: : db
wAgathasRoomCurScript: : db
wCeruleanCaveB1FCurScript: : db
wVictoryRoad1FCurScript: : db
ds 1
wLancesRoomCurScript: : db
2013-12-08 19:48:17 +00:00
ds 4
2021-05-31 15:46:10 +00:00
wSilphCo10FCurScript: : db
wSilphCo11FCurScript: : db
ds 1
wFuchsiaGymCurScript: : db
wSaffronGymCurScript: : db
ds 1
wCinnabarGymCurScript: : db
wGameCornerCurScript: : db
wRoute16Gate1FCurScript: : db
wBillsHouseCurScript: : db
wRoute5GateCurScript: : db
wPowerPlantCurScript: : ; overload
wRoute7GateCurScript: : db
ds 1
wSSAnne2FCurScript: : db
wSeafoamIslandsB3FCurScript: : db
wRoute23CurScript: : db
wSeafoamIslandsB4FCurScript: : db
wRoute18Gate1FCurScript: : db
2015-08-10 04:56:20 +00:00
ds 78
wGameProgressFlagsEnd: :
ds 56
2014-05-26 21:04:56 +00:00
2024-05-05 14:56:08 +00:00
wObtainedHiddenItemsFlags: : flag_array MAX_HIDDEN_ITEMS
2015-07-19 03:49:52 +00:00
2024-05-05 14:56:08 +00:00
wObtainedHiddenCoinsFlags: : flag_array MAX_HIDDEN_COINS
2014-09-13 07:50:56 +00:00
; $00 = walking
; $01 = biking
; $02 = surfing
2021-05-31 19:04:28 +00:00
wWalkBikeSurfState: : db
2014-09-13 07:50:56 +00:00
ds 10
2013-12-08 19:48:17 +00:00
2021-05-31 19:04:28 +00:00
wTownVisitedFlag: : flag_array NUM_CITY_MAPS
2013-12-08 19:48:17 +00:00
; starts at 502
2021-05-31 19:04:28 +00:00
wSafariSteps: : dw
2013-12-08 19:48:17 +00:00
; item given to cinnabar lab
2021-05-31 19:04:28 +00:00
wFossilItem: : db
2013-12-08 19:48:17 +00:00
; mon that will result from the item
2021-05-31 19:04:28 +00:00
wFossilMon: : db
2013-12-08 19:48:17 +00:00
ds 2
2019-07-07 04:44:21 +00:00
; trainer classes start at OPP_ID_OFFSET
2021-05-31 19:04:28 +00:00
wEnemyMonOrTrainerClass: : db
2013-12-08 19:48:17 +00:00
2021-05-31 15:46:10 +00:00
wPlayerJumpingYScreenCoordsIndex: : db
2013-12-08 19:48:17 +00:00
2021-05-31 15:46:10 +00:00
wRivalStarter: : db
2013-12-08 19:48:17 +00:00
ds 1
2021-05-31 15:46:10 +00:00
wPlayerStarter: : db
2013-12-08 19:48:17 +00:00
2014-09-13 07:50:56 +00:00
; sprite index of the boulder the player is trying to push
2021-05-31 19:04:28 +00:00
wBoulderSpriteIndex: : db
2014-04-27 06:44:29 +00:00
2021-05-31 15:46:10 +00:00
wLastBlackoutMap: : db
2014-04-27 06:44:29 +00:00
2014-09-13 07:50:56 +00:00
; destination map (for certain types of special warps, not ordinary walking)
2021-05-31 19:04:28 +00:00
wDestinationMap: : db
2014-09-13 07:50:56 +00:00
2024-06-15 16:18:00 +00:00
; initialized to $ff, but nothing ever reads it
wUnusedPlayerDataByte: : db
2014-09-13 07:50:56 +00:00
; used to store the tile in front of the boulder when trying to push a boulder
2021-05-31 19:04:28 +00:00
; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
wTileInFrontOfBoulderAndBoulderCollisionResult: : db
2014-09-13 07:50:56 +00:00
; destination map for dungeon warps
2021-05-31 19:04:28 +00:00
wDungeonWarpDestinationMap: : db
2014-09-13 07:50:56 +00:00
; which dungeon warp within the source map was used
2021-05-31 19:04:28 +00:00
wWhichDungeonWarp: : db
2014-09-13 07:50:56 +00:00
2024-06-15 16:18:00 +00:00
wUnusedCardKeyGateID: : db
2015-07-26 02:26:54 +00:00
ds 8
2014-09-10 03:55:19 +00:00
2024-07-16 17:02:54 +00:00
wStatusFlags1: : db
2014-09-10 03:55:19 +00:00
ds 1
2024-07-16 17:02:54 +00:00
wBeatGymFlags: : db ; redundant because it matches wObtainedBadges
2015-07-26 02:26:54 +00:00
ds 1
2024-07-16 17:02:54 +00:00
wStatusFlags2: : db
wCableClubDestinationMap: :
wStatusFlags3: : db
wStatusFlags4: : db
2015-08-30 00:15:05 +00:00
ds 1
2024-07-16 17:02:54 +00:00
wStatusFlags5: : db
2014-09-10 03:55:19 +00:00
ds 1
2024-07-16 17:02:54 +00:00
wStatusFlags6: : db
wStatusFlags7: : db
wElite4Flags: : db
2020-11-05 21:55:39 +00:00
ds 1
2024-07-16 17:02:54 +00:00
wMovementFlags: : db
2014-09-10 03:55:19 +00:00
2021-05-31 15:46:10 +00:00
wCompletedInGameTradeFlags: : dw
2015-02-07 10:43:08 +00:00
ds 2
2021-05-31 15:46:10 +00:00
wWarpedFromWhichWarp: : db
wWarpedFromWhichMap: : db
2015-07-26 02:26:54 +00:00
ds 2
2014-09-14 18:29:18 +00:00
2021-05-31 15:46:10 +00:00
wCardKeyDoorY: : db
wCardKeyDoorX: : db
2014-09-14 18:29:18 +00:00
ds 2
2021-05-31 15:46:10 +00:00
wFirstLockTrashCanIndex: : db
wSecondLockTrashCanIndex: : db
2015-07-21 01:32:02 +00:00
2015-07-25 03:27:59 +00:00
ds 2
2020-11-05 21:55:39 +00:00
2021-05-31 19:04:28 +00:00
wEventFlags: : flag_array NUM_EVENTS
2013-12-05 06:18:14 +00:00
2020-11-28 22:11:12 +00:00
UNION
wGrassRate: : db
2021-05-31 19:04:28 +00:00
wGrassMons: : ds 10 * 2
2020-11-28 22:11:12 +00:00
ds 8
wWaterRate: : db
2021-05-31 19:04:28 +00:00
wWaterMons: : ds 10 * 2
2020-11-28 22:11:12 +00:00
NEXTU
2015-02-07 10:43:08 +00:00
; linked game's trainer name
2021-05-31 19:04:28 +00:00
wLinkEnemyTrainerName: : ds NAME_LENGTH
2015-02-07 10:43:08 +00:00
2013-12-08 19:58:05 +00:00
ds 1
2013-12-05 06:18:14 +00:00
2021-05-31 19:04:28 +00:00
wSerialEnemyDataBlock: : ; ds $1a8
2020-11-28 22:11:12 +00:00
2015-08-31 03:04:08 +00:00
ds 9
2013-12-05 06:18:14 +00:00
2020-06-28 03:03:39 +00:00
wEnemyPartyCount: : ds 1
2021-04-27 19:49:59 +00:00
wEnemyPartySpecies: : ds PARTY_LENGTH + 1
2013-12-05 06:18:14 +00:00
2020-06-28 03:03:39 +00:00
wEnemyMons: :
2021-04-27 19:49:59 +00:00
; wEnemyMon1 - wEnemyMon6
2021-05-31 15:46:10 +00:00
FOR n , 1 , PARTY_LENGTH + 1
2021-04-27 19:49:59 +00:00
wEnemyMon { d : n } :: party_struct wEnemyMon { d : n }
2021-05-31 15:46:10 +00:00
ENDR
2021-04-27 19:49:59 +00:00
wEnemyMonOT: :
; wEnemyMon1OT - wEnemyMon6OT
2021-05-31 15:46:10 +00:00
FOR n , 1 , PARTY_LENGTH + 1
2021-04-27 19:49:59 +00:00
wEnemyMon { d : n } OT :: ds NAME_LENGTH
2021-05-31 15:46:10 +00:00
ENDR
2021-04-27 19:49:59 +00:00
wEnemyMonNicks: :
; wEnemyMon1Nick - wEnemyMon6Nick
2021-05-31 15:46:10 +00:00
FOR n , 1 , PARTY_LENGTH + 1
2021-04-27 19:49:59 +00:00
wEnemyMon { d : n } Nick :: ds NAME_LENGTH
2021-05-31 15:46:10 +00:00
ENDR
2014-05-26 21:04:56 +00:00
2017-09-30 02:16:08 +00:00
ENDU
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wTrainerHeaderPtr: : dw
2013-12-05 06:18:14 +00:00
2014-05-26 21:04:56 +00:00
ds 6
2015-07-26 02:26:54 +00:00
; the trainer the player must face after getting a wrong answer in the Cinnabar
; gym quiz
2024-06-15 16:18:00 +00:00
wOpponentAfterWrongAnswer: : db
2013-12-05 06:18:14 +00:00
; index of current map script, mostly used as index for function pointer array
2017-06-24 20:01:43 +00:00
; mostly copied from map-specific map script pointer and written back later
2021-05-31 19:04:28 +00:00
wCurMapScript: : db
2013-12-05 06:18:14 +00:00
2016-01-03 19:17:10 +00:00
ds 7
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wPlayTimeHours: : db
wPlayTimeMaxed: : db
wPlayTimeMinutes: : db
wPlayTimeSeconds: : db
wPlayTimeFrames: : db
2013-12-05 06:18:14 +00:00
2021-05-31 15:46:10 +00:00
wSafariZoneGameOver: : db
2013-12-08 19:58:05 +00:00
2021-05-31 15:46:10 +00:00
wNumSafariBalls: : db
2013-12-08 19:58:05 +00:00
2014-06-14 11:12:40 +00:00
2014-01-06 00:24:01 +00:00
; 0 if no pokemon is in the daycare
; 1 if pokemon is in the daycare
2021-05-31 19:04:28 +00:00
wDayCareInUse: : db
2014-01-06 00:24:01 +00:00
2020-06-28 03:03:39 +00:00
wDayCareMonName: : ds NAME_LENGTH
wDayCareMonOT: : ds NAME_LENGTH
2014-05-26 21:04:56 +00:00
2020-06-28 03:03:39 +00:00
wDayCareMon: : box_struct wDayCareMon
2013-12-08 19:58:05 +00:00
2015-08-11 04:03:31 +00:00
wMainDataEnd: :
2021-05-31 21:17:03 +00:00
SECTION "Current Box Data" , WRAM0
2015-08-11 04:03:31 +00:00
wBoxDataStart: :
2013-12-08 19:58:05 +00:00
2021-05-31 20:25:16 +00:00
wBoxCount: : db
2014-06-14 11:12:40 +00:00
wBoxSpecies: : ds MONS_PER_BOX + 1
2013-12-08 19:58:05 +00:00
2014-06-14 11:12:40 +00:00
wBoxMons: :
2021-04-27 19:49:59 +00:00
; wBoxMon1 - wBoxMon20
2021-05-31 15:46:10 +00:00
FOR n , 1 , MONS_PER_BOX + 1
2021-04-27 19:49:59 +00:00
wBoxMon { d : n } :: box_struct wBoxMon { d : n }
2021-05-31 15:46:10 +00:00
ENDR
2021-04-27 19:49:59 +00:00
wBoxMonOT: :
; wBoxMon1OT - wBoxMon20OT
2021-05-31 15:46:10 +00:00
FOR n , 1 , MONS_PER_BOX + 1
2021-04-27 19:49:59 +00:00
wBoxMon { d : n } OT :: ds NAME_LENGTH
2021-05-31 15:46:10 +00:00
ENDR
2021-04-27 19:49:59 +00:00
wBoxMonNicks: :
; wBoxMon1Nick - wBoxMon20Nick
2021-05-31 15:46:10 +00:00
FOR n , 1 , MONS_PER_BOX + 1
2021-04-27 19:49:59 +00:00
wBoxMon { d : n } Nick :: ds NAME_LENGTH
2021-05-31 15:46:10 +00:00
ENDR
2020-06-28 03:03:39 +00:00
wBoxMonNicksEnd: :
2013-12-05 06:18:14 +00:00
2015-08-11 04:03:31 +00:00
wBoxDataEnd: :
2014-05-23 22:34:35 +00:00
2018-11-18 23:29:24 +00:00
SECTION "Stack" , WRAM0
2020-11-05 21:55:39 +00:00
2021-05-31 15:46:10 +00:00
; the stack grows downward
ds $ 100 - 1
2021-05-31 19:04:28 +00:00
wStack: : db
2024-01-03 15:59:04 +00:00
ENDSECTION