Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/ram/wram.asm
2009 views
1
SECTION "Audio RAM", WRAM0
2
3
wUnusedMusicByte:: db
4
5
wSoundID:: db
6
7
; bit 7: whether sound has been muted
8
; all bits: whether the effective is active
9
; Store 1 to activate effect (any value in the range [1, 127] works).
10
; All audio is muted and music is paused. Sfx continues playing until it
11
; ends normally.
12
; Store 0 to resume music.
13
wMuteAudioAndPauseMusic:: db
14
15
wDisableChannelOutputWhenSfxEnds:: db
16
17
wStereoPanning:: db
18
19
wSavedVolume:: db
20
21
wChannelCommandPointers:: ds NUM_CHANNELS * 2
22
wChannelReturnAddresses:: ds NUM_CHANNELS * 2
23
24
wChannelSoundIDs:: ds NUM_CHANNELS
25
26
wChannelFlags1:: ds NUM_CHANNELS
27
wChannelFlags2:: ds NUM_CHANNELS
28
29
wChannelDutyCycles:: ds NUM_CHANNELS
30
wChannelDutyCyclePatterns:: ds NUM_CHANNELS
31
32
; reloaded at the beginning of a note. counts down until the vibrato begins.
33
wChannelVibratoDelayCounters:: ds NUM_CHANNELS
34
wChannelVibratoExtents:: ds NUM_CHANNELS
35
; high nybble is rate (counter reload value) and low nybble is counter.
36
; time between applications of vibrato.
37
wChannelVibratoRates:: ds NUM_CHANNELS
38
wChannelFrequencyLowBytes:: ds NUM_CHANNELS
39
; delay of the beginning of the vibrato from the start of the note
40
wChannelVibratoDelayCounterReloadValues:: ds NUM_CHANNELS
41
42
wChannelPitchSlideLengthModifiers:: ds NUM_CHANNELS
43
wChannelPitchSlideFrequencySteps:: ds NUM_CHANNELS
44
wChannelPitchSlideFrequencyStepsFractionalPart:: ds NUM_CHANNELS
45
wChannelPitchSlideCurrentFrequencyFractionalPart:: ds NUM_CHANNELS
46
wChannelPitchSlideCurrentFrequencyHighBytes:: ds NUM_CHANNELS
47
wChannelPitchSlideCurrentFrequencyLowBytes:: ds NUM_CHANNELS
48
wChannelPitchSlideTargetFrequencyHighBytes:: ds NUM_CHANNELS
49
wChannelPitchSlideTargetFrequencyLowBytes:: ds NUM_CHANNELS
50
51
; Note delays are stored as 16-bit fixed-point numbers where the integer part
52
; is 8 bits and the fractional part is 8 bits.
53
wChannelNoteDelayCounters:: ds NUM_CHANNELS
54
wChannelLoopCounters:: ds NUM_CHANNELS
55
wChannelNoteSpeeds:: ds NUM_CHANNELS
56
wChannelNoteDelayCountersFractionalPart:: ds NUM_CHANNELS
57
58
wChannelOctaves:: ds NUM_CHANNELS
59
; also includes fade for hardware channels that support it
60
wChannelVolumes:: ds NUM_CHANNELS
61
62
wMusicWaveInstrument:: db
63
wSfxWaveInstrument:: db
64
wMusicTempo:: dw
65
wSfxTempo:: dw
66
wSfxHeaderPointer:: dw
67
68
wNewSoundID:: db
69
70
wAudioROMBank:: db
71
wAudioSavedROMBank:: db
72
73
wFrequencyModifier:: db
74
wTempoModifier:: db
75
76
ds 13
77
78
79
SECTION "Sprite State Data", WRAM0
80
81
wSpriteDataStart::
82
83
; data for all sprites on the current map
84
; holds info for 16 sprites with $10 bytes each
85
wSpriteStateData1::
86
; struct fields:
87
; - 0: picture ID (fixed, loaded at map init)
88
; - 1: movement status (0: uninitialized, 1: ready, 2: delayed, 3: moving)
89
; - 2: sprite image index (changed on update, $ff if off screen, includes facing direction, progress in walking animation and a sprite-specific offset)
90
; - 3: Y screen position delta (-1,0 or 1; added to Y pixels on each walking animation update)
91
; - 4: Y screen position (in pixels, always 4 pixels above grid which makes sprites appear to be in the center of a tile)
92
; - 5: X screen position delta (-1,0 or 1; added to field X pixels on each walking animation update)
93
; - 6: X screen position (in pixels, snaps to grid if not currently walking)
94
; - 7: intra-animation-frame counter (counting upwards to 4 until animation frame counter is incremented)
95
; - 8: animation frame counter (increased every 4 updates, hold four states (totalling to 16 walking frames)
96
; - 9: facing direction ($0: down, $4: up, $8: left, $c: right)
97
; - A: adjusted Y coordinate
98
; - B: adjusted X coordinate
99
; - C: direction of collision
100
; - D
101
; - E
102
; - F
103
wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1 ; player is struct 0
104
; wSprite01StateData1 - wSprite15StateData1
105
FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
106
wSprite{02d:n}StateData1:: spritestatedata1 wSprite{02d:n}StateData1
107
ENDR
108
109
; more data for all sprites on the current map
110
; holds info for 16 sprites with $10 bytes each
111
wSpriteStateData2::
112
; struct fields:
113
; - 0: walk animation counter (counting from $10 backwards when moving)
114
; - 1:
115
; - 2: Y displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
116
; - 3: X displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
117
; - 4: Y position (in 2x2 tile grid steps, topmost 2x2 tile has value 4)
118
; - 5: X position (in 2x2 tile grid steps, leftmost 2x2 tile has value 4)
119
; - 6: movement byte 1 (determines whether a sprite can move, $ff:not moving, $fe:random movements, others unknown)
120
; - 7: (?) (set to $80 when in grass, else $0; may be used to draw grass above the sprite)
121
; - 8: delay until next movement (counted downwards, movement status is set to ready if reached 0)
122
; - 9: original facing direction (backed up by DisplayTextIDInit, restored by CloseTextDisplay)
123
; - A
124
; - B
125
; - C
126
; - D: picture ID
127
; - E: sprite image base offset (in video ram, player always has value 1, used to compute sprite image index)
128
; - F
129
wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2 ; player is struct 0
130
; wSprite01StateData2 - wSprite15StateData2
131
FOR n, 1, NUM_SPRITESTATEDATA_STRUCTS
132
wSprite{02d:n}StateData2:: spritestatedata2 wSprite{02d:n}StateData2
133
ENDR
134
135
; The high byte of a pointer to anywhere within wSpriteStateData1 can be incremented
136
; to reach within wSpriteStateData2, and vice-versa for decrementing.
137
ASSERT HIGH(wSpriteStateData1) + 1 == HIGH(wSpriteStateData2)
138
ASSERT LOW(wSpriteStateData1) == 0 && LOW(wSpriteStateData2) == 0
139
140
wSpriteDataEnd::
141
142
143
SECTION "OAM Buffer", WRAM0
144
145
; buffer for OAM data. Copied to OAM by DMA
146
wShadowOAM::
147
; wShadowOAMSprite00 - wShadowOAMSprite39
148
FOR n, OAM_COUNT
149
wShadowOAMSprite{02d:n}:: sprite_oam_struct wShadowOAMSprite{02d:n}
150
ENDR
151
wShadowOAMEnd::
152
153
154
SECTION "Tilemap", WRAM0
155
156
; buffer for tiles that are visible on screen (20 columns by 18 rows)
157
wTileMap:: ds SCREEN_AREA
158
159
; This union spans 480 bytes.
160
UNION
161
; buffer for temporarily saving and restoring current screen's tiles
162
; (e.g. if menus are drawn on top)
163
wTileMapBackup:: ds SCREEN_AREA
164
165
NEXTU
166
; buffer for the blocks surrounding the player (6 columns by 5 rows of 4x4-tile blocks)
167
wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT
168
169
NEXTU
170
; buffer for temporarily saving and restoring shadow OAM
171
wShadowOAMBackup::
172
; wShadowOAMBackupSprite00 - wShadowOAMBackupSprite39
173
FOR n, OAM_COUNT
174
wShadowOAMBackupSprite{02d:n}:: sprite_oam_struct wShadowOAMBackupSprite{02d:n}
175
ENDR
176
wShadowOAMBackupEnd::
177
178
NEXTU
179
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
180
wSerialPartyMonsPatchList:: ds 200
181
182
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
183
wSerialEnemyMonsPatchList:: ds 200
184
ENDU
185
186
187
SECTION "Overworld Map", WRAM0
188
189
UNION
190
wOverworldMap:: ds 1300
191
wOverworldMapEnd::
192
193
NEXTU
194
wTempPic:: ds PIC_SIZE tiles
195
ENDU
196
197
198
SECTION "WRAM", WRAM0
199
200
; the tiles of the row or column to be redrawn by RedrawRowOrColumn
201
wRedrawRowOrColumnSrcTiles:: ds SCREEN_WIDTH * 2
202
203
; coordinates of the position of the cursor for the top menu item (id 0)
204
wTopMenuItemY:: db
205
wTopMenuItemX:: db
206
207
; the id of the currently selected menu item
208
; the top item has id 0, the one below that has id 1, etc.
209
; note that the "top item" means the top item currently visible on the screen
210
; add this value to [wListScrollOffset] to get the item's position within the list
211
wCurrentMenuItem:: db
212
213
; the tile that was behind the menu cursor's current location
214
wTileBehindCursor:: db
215
216
; id of the bottom menu item
217
wMaxMenuItem:: db
218
219
; bit mask of keys that the menu will respond to
220
wMenuWatchedKeys:: db
221
222
; id of previously selected menu item
223
wLastMenuItem:: db
224
225
; It is mainly used by the party menu to remember the cursor position while the
226
; menu isn't active.
227
; It is also used to remember the cursor position of mon lists (for the
228
; withdraw/deposit/release actions) in Bill's PC so that it doesn't get lost
229
; when you choose a mon from the list and a sub-menu is shown. It's reset when
230
; you return to the main Bill's PC menu.
231
wPartyAndBillsPCSavedMenuItem:: db
232
233
; It is used by the bag list to remember the cursor position while the menu
234
; isn't active.
235
wBagSavedMenuItem:: db
236
237
; It is used by the start menu to remember the cursor position while the menu
238
; isn't active.
239
; The battle menu uses it so that the cursor position doesn't get lost when
240
; a sub-menu is shown. It's reset at the start of each battle.
241
wBattleAndStartSavedMenuItem:: db
242
243
wPlayerMoveListIndex:: db
244
245
; index in party of currently battling mon
246
wPlayerMonNumber:: db
247
248
; the address of the menu cursor's current location within wTileMap
249
wMenuCursorLocation:: dw
250
251
ds 2
252
253
; how many times should HandleMenuInput poll the joypad state before it returns?
254
wMenuJoypadPollCount:: db
255
256
; id of menu item selected for swapping (counts from 1) (0 means that no menu item has been selected for swapping)
257
wMenuItemToSwap:: db
258
259
; offset of the current top menu item from the beginning of the list
260
; keeps track of what section of the list is on screen
261
wListScrollOffset:: db
262
263
; If non-zero, then when wrapping is disabled and the player tries to go past
264
; the top or bottom of the menu, return from HandleMenuInput. This is useful for
265
; menus that have too many items to display at once on the screen because it
266
; allows the caller to scroll the entire menu up or down when this happens.
267
wMenuWatchMovingOutOfBounds:: db
268
269
wTradeCenterPointerTableIndex:: db
270
271
ds 1
272
273
; destination pointer for text output
274
; this variable is written to, but is never read from
275
wTextDest:: dw
276
277
; if non-zero, skip waiting for a button press after displaying text in DisplayTextID
278
wDoNotWaitForButtonPressAfterDisplayingText:: db
279
280
UNION
281
; the received menu selection is stored twice
282
wLinkMenuSelectionReceiveBuffer:: dw
283
ds 3
284
; the menu selection byte is stored twice before sending
285
wLinkMenuSelectionSendBuffer:: dw
286
ds 3
287
wEnteringCableClub::
288
wLinkTimeoutCounter:: db
289
290
NEXTU
291
; temporary nybble used by Serial_ExchangeNybble
292
wSerialExchangeNybbleTempReceiveData::
293
; the final received nybble is stored here by Serial_SyncAndExchangeNybble
294
wSerialSyncAndExchangeNybbleReceiveData:: db
295
; the final received nybble is stored here by Serial_ExchangeNybble
296
wSerialExchangeNybbleReceiveData:: db
297
ds 3
298
; this nybble is sent when using Serial_SyncAndExchangeNybble or Serial_ExchangeNybble
299
wSerialExchangeNybbleSendData:: db
300
ds 4
301
wUnknownSerialCounter:: dw
302
ENDU
303
304
; $00 = player mons
305
; $01 = enemy mons
306
wWhichTradeMonSelectionMenu::
307
; 0 = player's party
308
; 1 = enemy party
309
; 2 = current box
310
; 3 = daycare
311
; 4 = in-battle mon
312
;
313
; AddPartyMon uses it slightly differently.
314
; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
315
; If the entire value is 0, then the player is allowed to name the mon.
316
wMonDataLocation:: db
317
318
; set to 1 if you can go from the bottom to the top or top to bottom of a menu
319
; set to 0 if you can't go past the top or bottom of the menu
320
wMenuWrappingEnabled:: db
321
322
; whether to check for 180-degree turn (0 = don't, 1 = do)
323
wCheckFor180DegreeTurn:: db
324
325
ds 1
326
327
wToggleableObjectIndex:: db
328
329
wPredefID:: db
330
wPredefHL:: dw
331
wPredefDE:: dw
332
wPredefBC:: dw
333
334
wTrainerHeaderFlagBit:: db
335
336
ds 1
337
338
; which NPC movement script pointer is being used
339
; 0 if an NPC movement script is not running
340
wNPCMovementScriptPointerTableNum:: db
341
342
; ROM bank of current NPC movement script
343
wNPCMovementScriptBank:: db
344
345
ds 2
346
347
; This union spans 180 bytes.
348
UNION
349
wVermilionDockTileMapBuffer:: ds 5 * TILEMAP_WIDTH + SCREEN_WIDTH
350
wVermilionDockTileMapBufferEnd::
351
352
NEXTU
353
wOaksAideRewardItemName:: ds ITEM_NAME_LENGTH
354
355
NEXTU
356
wElevatorWarpMaps:: ds 11 * 2
357
358
NEXTU
359
; List of bag items that has been filtered to a certain type of items,
360
; such as drinks or fossils.
361
wFilteredBagItems:: ds 4
362
363
NEXTU
364
; Saved copy of OAM for the first frame of the animation to make it easy to
365
; flip back from the second frame.
366
wMonPartySpritesSavedOAM:: ds OBJ_SIZE * 4 * PARTY_LENGTH
367
368
NEXTU
369
wTrainerCardBlkPacket:: ds $40
370
371
NEXTU
372
wHallOfFame:: ds HOF_TEAM
373
374
NEXTU
375
wNPCMovementDirections:: ds 180
376
377
NEXTU
378
wDexRatingNumMonsSeen:: db
379
wDexRatingNumMonsOwned:: db
380
wDexRatingText:: db
381
382
NEXTU
383
; If a random number greater than this value is generated, then the player is
384
; allowed to have three 7 symbols or bar symbols line up.
385
; So, this value is actually the chance of NOT entering that mode.
386
; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
387
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
388
wSlotMachineSevenAndBarModeChance:: db
389
ds 2
390
; ROM back to return to when the player is done with the slot machine
391
wSlotMachineSavedROMBank:: db
392
ds 166
393
wLuckySlotHiddenEventIndex:: db
394
395
NEXTU
396
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
397
wAnimationType:: db
398
ds 29
399
wAnimPalette:: db
400
401
NEXTU
402
ds 60
403
; temporary buffer when swapping party mon data
404
wSwitchPartyMonTempBuffer:: ds PARTYMON_STRUCT_LENGTH
405
406
NEXTU
407
ds 120
408
; this is the end of the joypad states
409
; the list starts above this address and extends downwards in memory until here
410
; overloaded with below labels
411
wSimulatedJoypadStatesEnd::
412
413
NEXTU
414
wUnusedFlag::
415
wBoostExpByExpAll:: db
416
417
ds 59
418
419
wNPCMovementDirections2:: ds 10
420
; used in Pallet Town scripted movement
421
wNumStepsToTake:: db
422
423
ds 48
424
425
wRLEByteCount:: db
426
427
wParentMenuItem::
428
; 0 = not added
429
; 1 = added
430
wAddedToParty::
431
; 1 flag for each party member indicating whether it can evolve
432
; The purpose of these flags is to track which mons levelled up during the
433
; current battle at the end of the battle when evolution occurs.
434
; Other methods of evolution simply set it by calling TryEvolvingMon.
435
wMiscBattleData::
436
wCanEvolveFlags:: db
437
438
wForceEvolution:: db
439
440
; if [wAILayer2Encouragement] != 1, the second AI layer is not applied
441
wAILayer2Encouragement:: db
442
443
ds 1
444
445
; current HP of player and enemy substitutes
446
wPlayerSubstituteHP:: db
447
wEnemySubstituteHP:: db
448
449
; used for TestBattle (unused in non-debug builds)
450
wTestBattlePlayerSelectedMove:: db
451
452
ds 1
453
454
; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..)
455
wMoveMenuType:: db
456
457
wPlayerSelectedMove:: db
458
wEnemySelectedMove:: db
459
460
wLinkBattleRandomNumberListIndex:: db
461
462
; number of times remaining that AI action can occur
463
wAICount:: db
464
465
ds 2
466
467
wEnemyMoveListIndex:: db
468
469
; The enemy mon's HP when it was switched in or when the current player mon
470
; was switched in, which was more recent.
471
; It's used to determine the message to print when switching out the player mon.
472
wLastSwitchInEnemyMonHP:: dw
473
474
; total amount of money made using Pay Day during the current battle
475
wTotalPayDayMoney:: ds 3
476
477
wSafariEscapeFactor:: db
478
wSafariBaitFactor:: db
479
480
ds 1
481
482
wTransformedEnemyMonOriginalDVs:: dw
483
484
wMonIsDisobedient:: db
485
486
wPlayerDisabledMoveNumber:: db
487
wEnemyDisabledMoveNumber:: db
488
489
; When running in the scope of HandlePlayerMonFainted, it equals 1.
490
; When running in the scope of HandleEnemyMonFainted, it equals 0.
491
wInHandlePlayerMonFainted:: db
492
493
wPlayerUsedMove:: db
494
wEnemyUsedMove:: db
495
496
wEnemyMonMinimized:: db
497
498
wMoveDidntMiss:: db
499
500
; flags that indicate which party members have fought the current enemy mon
501
wPartyFoughtCurrentEnemyFlags:: flag_array PARTY_LENGTH
502
503
; Whether the low health alarm has been disabled due to the player winning the
504
; battle.
505
wLowHealthAlarmDisabled:: db
506
507
wPlayerMonMinimized:: db
508
509
ds 13
510
511
UNION
512
; the amount of damage accumulated by the enemy while biding
513
wEnemyBideAccumulatedDamage:: dw
514
NEXTU
515
; number of hits by enemy in attacks like Double Slap, etc.
516
wEnemyNumHits:: db
517
ENDU
518
519
ds 8
520
wMiscBattleDataEnd::
521
ENDU
522
523
; This union spans 39 bytes.
524
UNION
525
wInGameTradeGiveMonSpecies:: db
526
wInGameTradeTextPointerTablePointer:: dw
527
wInGameTradeTextPointerTableIndex:: db
528
wInGameTradeGiveMonName:: ds NAME_LENGTH
529
wInGameTradeReceiveMonName:: ds NAME_LENGTH
530
wInGameTradeMonNick:: ds NAME_LENGTH
531
wInGameTradeReceiveMonSpecies:: db
532
533
NEXTU
534
wPlayerMonUnmodifiedLevel:: db
535
wPlayerMonUnmodifiedMaxHP:: dw
536
wPlayerMonUnmodifiedAttack:: dw
537
wPlayerMonUnmodifiedDefense:: dw
538
wPlayerMonUnmodifiedSpeed:: dw
539
wPlayerMonUnmodifiedSpecial:: dw
540
541
; stat modifiers for the player's current pokemon
542
; value can range from 1 - 13 ($1 to $D)
543
; 7 is normal
544
wPlayerMonStatMods::
545
wPlayerMonAttackMod:: db
546
wPlayerMonDefenseMod:: db
547
wPlayerMonSpeedMod:: db
548
wPlayerMonSpecialMod:: db
549
wPlayerMonAccuracyMod:: db
550
wPlayerMonEvasionMod:: db
551
ds 2
552
wPlayerMonStatModsEnd::
553
554
ds 1
555
556
wEnemyMonUnmodifiedLevel:: db
557
wEnemyMonUnmodifiedMaxHP:: dw
558
wEnemyMonUnmodifiedAttack:: dw
559
wEnemyMonUnmodifiedDefense:: dw
560
wEnemyMonUnmodifiedSpeed:: dw
561
wEnemyMonUnmodifiedSpecial:: dw
562
563
; stat modifiers for the enemy's current pokemon
564
; value can range from 1 - 13 ($1 to $D)
565
; 7 is normal
566
wEnemyMonStatMods::
567
wEnemyMonAttackMod:: db
568
wEnemyMonDefenseMod:: db
569
wEnemyMonSpeedMod:: db
570
wEnemyMonSpecialMod:: db
571
wEnemyMonAccuracyMod:: db
572
wEnemyMonEvasionMod:: db
573
ds 2
574
wEnemyMonStatModsEnd::
575
576
NEXTU
577
ds 30
578
wEngagedTrainerClass:: db
579
wEngagedTrainerSet:: db
580
ENDU
581
582
ds 1
583
584
wNPCMovementDirections2Index::
585
wUnusedLinkMenuByte::
586
; number of items in wFilteredBagItems list
587
wFilteredBagItemsCount:: db
588
589
; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
590
; 0 if the joypad state is not being simulated
591
wSimulatedJoypadStatesIndex:: db
592
; written to but nothing ever reads it
593
wUnusedSimulatedJoypadStatesMask:: db
594
; written to but nothing ever reads it
595
wUnusedOverrideSimulatedJoypadStatesIndex:: db
596
; mask indicating which real button presses can override simulated ones
597
; XXX is it ever not 0?
598
wOverrideSimulatedJoypadStatesMask:: db
599
600
ds 1
601
602
; This union spans 30 bytes.
603
UNION
604
wTradedPlayerMonSpecies:: db
605
wTradedEnemyMonSpecies:: db
606
ds 2
607
wTradedPlayerMonOT:: ds NAME_LENGTH
608
wTradedPlayerMonOTID:: dw
609
wTradedEnemyMonOT:: ds NAME_LENGTH
610
wTradedEnemyMonOTID:: dw
611
612
NEXTU
613
wTradingWhichPlayerMon:: db
614
wTradingWhichEnemyMon:: db
615
wNameOfPlayerMonToBeTraded:: ds NAME_LENGTH
616
617
NEXTU
618
; one byte for each falling object
619
wFallingObjectsMovementData:: ds 20
620
621
NEXTU
622
; array of the number of mons in each box
623
wBoxMonCounts:: ds NUM_BOXES
624
625
NEXTU
626
wPriceTemp:: ds 3 ; BCD
627
628
NEXTU
629
; the current mon's field moves
630
wFieldMoves:: ds NUM_MOVES
631
wNumFieldMoves:: db
632
wFieldMovesLeftmostXCoord:: db
633
wLastFieldMoveID:: db ; unused
634
635
NEXTU
636
wBoxNumString:: ds 3
637
638
NEXTU
639
; 0 = upper half (Y < 9)
640
; 1 = lower half (Y >= 9)
641
wBattleTransitionCircleScreenQuadrantY:: db
642
wBattleTransitionCircleScreenQuadrantX:: db
643
644
NEXTU
645
; after 1 row/column has been copied, the offset to the next one to copy from
646
wBattleTransitionCopyTilesOffset:: dw
647
648
NEXTU
649
; counts down from 7 so that every time 7 more tiles of the spiral have been
650
; placed, the tile map buffer is copied to VRAM so that progress is visible
651
wInwardSpiralUpdateScreenCounter:: db
652
ds 9
653
; 0 = outward, 1 = inward
654
wBattleTransitionSpiralDirection:: db
655
656
NEXTU
657
; multiplied by 16 to get the number of times to go right by 2 pixels
658
wSSAnneSmokeDriftAmount:: db
659
; 0 = left half (X < 10)
660
; 1 = right half (X >= 10)
661
wSSAnneSmokeX:: db
662
663
NEXTU
664
wHoFMonSpecies::
665
wHoFTeamIndex:: db
666
wHoFPartyMonIndex:: db
667
wHoFMonLevel:: db
668
; 0 = mon, 1 = player
669
wHoFMonOrPlayer:: db
670
wHoFTeamIndex2:: db
671
wHoFTeamNo:: db
672
673
NEXTU
674
wRivalStarterTemp:: db
675
wRivalStarterBallSpriteIndex:: db
676
677
NEXTU
678
wFlyAnimUsingCoordList:: db
679
; $ff sentinel values at each end
680
wFlyLocationsList:: ds NUM_CITY_MAPS + 2
681
682
NEXTU
683
wWhichTownMapLocation:: db
684
wFlyAnimCounter:: db
685
wFlyAnimBirdSpriteImageIndex:: db
686
687
NEXTU
688
ds 1
689
; difference in X between the next ball and the current one
690
wHUDPokeballGfxOffsetX:: db
691
wHUDGraphicsTiles::
692
wHUDUnusedTopTile:: db
693
wHUDCornerTile:: db
694
wHUDTriangleTile:: db
695
wHUDGraphicsTilesEnd::
696
697
NEXTU
698
; the level of the mon at the time it entered day care
699
wDayCareStartLevel:: db
700
wDayCareNumLevelsGrown:: db
701
wDayCareTotalCost:: dw ; BCD
702
wDayCarePerLevelCost:: dw ; BCD (always $100)
703
704
NEXTU
705
; which wheel the player is trying to stop
706
; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
707
wStoppingWhichSlotMachineWheel:: db
708
wSlotMachineWheel1Offset:: db
709
wSlotMachineWheel2Offset:: db
710
wSlotMachineWheel3Offset:: db
711
; the OAM tile number of the upper left corner of the winning symbol minus 2
712
wSlotMachineWinningSymbol::
713
wSlotMachineWheel1BottomTile:: db
714
wSlotMachineWheel1MiddleTile:: db
715
wSlotMachineWheel1TopTile:: db
716
wSlotMachineWheel2BottomTile:: db
717
wSlotMachineWheel2MiddleTile:: db
718
wSlotMachineWheel2TopTile:: db
719
wSlotMachineWheel3BottomTile:: db
720
wSlotMachineWheel3MiddleTile:: db
721
wSlotMachineWheel3TopTile:: db
722
wPayoutCoins:: dw
723
; These flags are set randomly and control when the wheels stop.
724
; bit 6: allow the player to win in general
725
; bit 7: allow the player to win with 7 or bar (plus the effect of bit 6)
726
wSlotMachineFlags:: db
727
; wheel 1 can "slip" while this is non-zero
728
wSlotMachineWheel1SlipCounter:: db
729
; wheel 2 can "slip" while this is non-zero
730
wSlotMachineWheel2SlipCounter:: db
731
; The remaining number of times wheel 3 will roll down a symbol until a match is
732
; found, when winning is enabled. It's initialized to 4 each bet.
733
wSlotMachineRerollCounter:: db
734
; how many coins the player bet on the slot machine (1 to 3)
735
wSlotMachineBet:: db
736
737
NEXTU
738
wCanPlaySlots:: db
739
ds 8
740
; temporary variable used to add payout amount to the player's coins
741
wTempCoins1:: dw
742
ds 2
743
; temporary variable used to subtract the bet amount from the player's coins
744
wTempCoins2:: dw
745
746
NEXTU
747
wHiddenEventFunctionArgument:: db
748
wHiddenEventFunctionRomBank:: db
749
wHiddenEventIndex:: db
750
wHiddenEventY:: db
751
wHiddenItemOrCoinsIndex::
752
wHiddenEventX:: db
753
754
NEXTU
755
wPlayerSpinInPlaceAnimFrameDelay:: db
756
wPlayerSpinInPlaceAnimFrameDelayDelta:: db
757
wPlayerSpinInPlaceAnimFrameDelayEndValue:: db
758
wPlayerSpinInPlaceAnimSoundID:: db
759
ds 6
760
db ; temporary space used when wFacingDirectionList is rotated
761
; used when spinning the player's sprite
762
wFacingDirectionList:: ds 4
763
ds 3
764
wSavedPlayerScreenY:: db
765
wSavedPlayerFacingDirection:: db
766
767
NEXTU
768
wPlayerSpinWhileMovingUpOrDownAnimDeltaY:: db
769
wPlayerSpinWhileMovingUpOrDownAnimMaxY:: db
770
wPlayerSpinWhileMovingUpOrDownAnimFrameDelay:: db
771
772
NEXTU
773
wTrainerSpriteOffset:: db
774
wTrainerEngageDistance:: db
775
wTrainerFacingDirection:: db
776
wTrainerScreenY:: db
777
wTrainerScreenX:: db
778
779
NEXTU
780
wTrainerInfoTextBoxWidthPlus1:: db
781
wTrainerInfoTextBoxWidth:: db
782
wTrainerInfoTextBoxNextRowOffset:: db
783
784
NEXTU
785
wOptionsTextSpeedCursorX:: db
786
wOptionsBattleAnimCursorX:: db
787
wOptionsBattleStyleCursorX:: db
788
wOptionsCancelCursorX:: db
789
790
NEXTU
791
; tile ID of the badge number being drawn
792
wBadgeNumberTile:: db
793
; first tile ID of the name being drawn
794
wBadgeNameTile:: db
795
; a list of the first tile IDs of each badge or face (depending on whether the
796
; badge is owned) to be drawn on the trainer screen
797
; the byte after the list gets read when shifting back one byte
798
wBadgeOrFaceTiles:: ds NUM_BADGES + 1
799
ds 1
800
; temporary list created when displaying the badges on the trainer screen
801
; one byte for each badge; 0 = not obtained, 1 = obtained
802
wTempObtainedBadgesBooleans:: ds NUM_BADGES
803
804
NEXTU
805
wUnusedCreditsByte:: db
806
; the number of credits mons that have been displayed so far
807
wNumCreditsMonsDisplayed:: db
808
809
NEXTU
810
ds 1
811
db ; temporary space used when wJigglypuffFacingDirections is rotated
812
wJigglypuffFacingDirections:: ds 4
813
814
NEXTU
815
ds 16
816
; $3d = tree tile, $52 = grass tile
817
wCutTile:: db
818
ds 2
819
; 0 = cut animation, 1 = boulder dust animation
820
wWhichAnimationOffsets:: db
821
822
NEXTU
823
ds 18
824
; the index of the sprite the emotion bubble is to be displayed above
825
wEmotionBubbleSpriteIndex:: db
826
wWhichEmotionBubble:: db
827
828
NEXTU
829
wChangeBoxSavedMapTextPointer:: dw
830
831
NEXTU
832
wSavedY::
833
wTempSCX::
834
; which entry from TradeMons to select
835
wWhichTrade::
836
wDexMaxSeenMon::
837
wPPRestoreItem::
838
wWereAnyMonsAsleep::
839
wNumShakes::
840
wWhichBadge::
841
wTitleMonSpecies::
842
wPlayerCharacterOAMTile::
843
; the number of small stars OAM entries to move down
844
wMoveDownSmallStarsOAMCount::
845
wChargeMoveNum::
846
wCoordIndex::
847
wSwappedMenuItem::
848
; 0 = no bite
849
; 1 = bite
850
; 2 = no fish on map
851
wRodResponse::
852
db
853
ENDU
854
855
; 0 = neither
856
; 1 = warp pad
857
; 2 = hole
858
wStandingOnWarpPadOrHole::
859
wOAMBaseTile::
860
wGymTrashCanIndex:: db
861
862
wSymmetricSpriteOAMAttributes:: db
863
864
wMonPartySpriteSpecies:: db
865
866
; in the trade animation, the mon that leaves the left gameboy
867
wLeftGBMonSpecies:: db
868
869
; in the trade animation, the mon that leaves the right gameboy
870
wRightGBMonSpecies:: db
871
872
wMiscFlags:: db
873
874
ds 9
875
876
; This has overlapping related uses.
877
; When the player tries to use an item or use certain field moves, 0 is stored
878
; when the attempt fails and 1 is stored when the attempt succeeds.
879
; In addition, some items store 2 for certain types of failures, but this
880
; cannot happen in battle.
881
; In battle, a non-zero value indicates the player has taken their turn using
882
; something other than a move (e.g. using an item or switching pokemon).
883
; So, when an item is successfully used in battle, this value becomes non-zero
884
; and the player is not allowed to make a move and the two uses are compatible.
885
wActionResultOrTookBattleTurn:: db
886
887
; Set buttons are ignored.
888
wJoyIgnore:: db
889
890
; size of downscaled mon pic used in pokeball entering/exiting animation
891
; $00 = 5×5
892
; $01 = 3×3
893
wDownscaledMonSize::
894
; FormatMovesString stores the number of moves minus one here
895
wNumMovesMinusOne:: db
896
897
; This union spans 20 bytes.
898
UNION
899
; storage buffer for various name strings
900
wNameBuffer:: ds NAME_BUFFER_LENGTH
901
902
NEXTU
903
; data copied from Moves for one move
904
wMoveData:: ds MOVE_LENGTH
905
wPPUpCountAndMaxPP:: db
906
907
NEXTU
908
; amount of money made from one use of Pay Day
909
wPayDayMoney:: ds 3
910
911
NEXTU
912
; evolution data for one mon
913
wEvoDataBuffer:: ds NUM_EVOS_IN_BUFFER * 4 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
914
wEvoDataBufferEnd::
915
916
NEXTU
917
wBattleMenuCurrentPP:: db
918
ds 3
919
wStatusScreenCurrentPP:: db
920
ds 6
921
; list of normal max PP (without PP up) values
922
wNormalMaxPPList:: ds NUM_MOVES
923
ENDU
924
925
UNION
926
; buffer for transferring the random number list generated by the other gameboy
927
wSerialOtherGameboyRandomNumberListBlock:: ds $11
928
NEXTU
929
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
930
wTileMapBackup2:: ds SCREEN_AREA
931
ENDU
932
933
; This union spans 30 bytes.
934
UNION
935
; Temporary storage area
936
wBuffer:: ds 30
937
938
NEXTU
939
wEvoOldSpecies:: db
940
wEvoNewSpecies:: db
941
wEvoMonTileOffset:: db
942
wEvoCancelled:: db
943
944
NEXTU
945
wNamingScreenNameLength:: db
946
; non-zero when the player has chosen to submit the name
947
wNamingScreenSubmitName:: db
948
; 0 = upper case
949
; 1 = lower case
950
wAlphabetCase:: db
951
ds 1
952
wNamingScreenLetter:: db
953
954
NEXTU
955
wChangeMonPicEnemyTurnSpecies:: db
956
wChangeMonPicPlayerTurnSpecies:: db
957
958
NEXTU
959
wHPBarMaxHP:: dw
960
wHPBarOldHP:: dw
961
wHPBarNewHP:: dw
962
wHPBarDelta:: db
963
wHPBarTempHP:: dw
964
ds 11
965
wHPBarHPDifference:: dw
966
967
NEXTU
968
; lower nybble is x, upper nybble is y
969
wTownMapCoords::
970
; whether WriteMonMoves is being used to make a mon learn moves from day care
971
; non-zero if so
972
wLearningMovesFromDayCare::
973
db
974
975
ds 27
976
977
; the item that the AI used
978
wAIItem:: db
979
wUsedItemOnWhichPokemon:: db
980
ENDU
981
982
; sound ID during battle animations
983
wAnimSoundID:: db
984
985
; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
986
wBankswitchHomeSavedROMBank:: db
987
988
; used as a temp storage value for the bank to switch to
989
wBankswitchHomeTemp:: db
990
991
; 0 = nothing bought or sold in pokemart
992
; 1 = bought or sold something in pokemart
993
; this value is not used for anything
994
wBoughtOrSoldItemInMart:: db
995
996
; $00 - win
997
; $01 - lose
998
; $02 - draw
999
wBattleResult:: db
1000
1001
; bit 0: if set, prevents DisplayTextID from automatically drawing a text box
1002
wAutoTextBoxDrawingControl:: db
1003
1004
; used in some overworld scripts to vary scripted movement
1005
wSavedCoordIndex::
1006
wOakWalkedToPlayer::
1007
wNextSafariZoneGateScript:: db
1008
1009
; used in CheckForTilePairCollisions2 to store the tile the player is on
1010
wTilePlayerStandingOn:: db
1011
1012
wNPCNumScriptedSteps:: db
1013
1014
; which script function within the pointer table indicated by
1015
; wNPCMovementScriptPointerTableNum
1016
wNPCMovementScriptFunctionNum:: db
1017
1018
; bit 0: set when printing a text predef so that DisplayTextID doesn't switch
1019
; to the current map's bank
1020
wTextPredefFlag:: db
1021
1022
wPredefParentBank:: db
1023
1024
wSpriteIndex:: db
1025
1026
; movement byte 2 of current sprite
1027
wCurSpriteMovement2:: db
1028
1029
ds 2
1030
1031
; sprite offset of sprite being controlled by NPC movement script
1032
wNPCMovementScriptSpriteOffset:: db
1033
1034
wScriptedNPCWalkCounter:: db
1035
1036
ds 1
1037
1038
; always 0 since full CGB support was not implemented
1039
wOnCGB:: db
1040
1041
; if running on SGB, it's 1, else it's 0
1042
wOnSGB:: db
1043
1044
wDefaultPaletteCommand:: db
1045
1046
UNION
1047
wPlayerHPBarColor:: db
1048
1049
NEXTU
1050
; species of the mon whose palette is used for the whole screen
1051
wWholeScreenPaletteMonSpecies:: db
1052
ENDU
1053
1054
wEnemyHPBarColor:: db
1055
1056
; 0: green
1057
; 1: yellow
1058
; 2: red
1059
wPartyMenuHPBarColors:: ds PARTY_LENGTH
1060
1061
wStatusScreenHPBarColor:: db
1062
1063
ds 7
1064
1065
wCopyingSGBTileData::
1066
wWhichPartyMenuHPBar::
1067
wPalPacket::
1068
db
1069
1070
; This union spans 49 bytes.
1071
UNION
1072
wPartyMenuBlkPacket:: ds $30
1073
1074
NEXTU
1075
ds 29
1076
; storage buffer for various strings
1077
wStringBuffer:: ds NAME_BUFFER_LENGTH
1078
1079
NEXTU
1080
ds 29
1081
; the total amount of exp a mon gained
1082
wExpAmountGained:: dw
1083
wGainBoostedExp:: db
1084
ENDU
1085
1086
wGymCityName:: ds GYM_CITY_LENGTH
1087
1088
wGymLeaderName:: ds NAME_LENGTH
1089
1090
wItemList:: ds 16
1091
1092
wListPointer:: dw
1093
1094
; used to store pointers, but never read
1095
wUnusedNamePointer:: dw
1096
1097
wItemPrices:: dw
1098
1099
wCurPartySpecies::
1100
wCurItem::
1101
wCurListMenuItem::
1102
db
1103
1104
; which pokemon you selected
1105
wWhichPokemon:: db
1106
1107
; if non-zero, then print item prices when displaying lists
1108
wPrintItemPrices:: db
1109
1110
; type of HP bar
1111
; $00 = enemy HUD in battle
1112
; $01 = player HUD in battle / status screen
1113
; $02 = party menu
1114
wHPBarType::
1115
; ID used by DisplayListMenuID
1116
wListMenuID:: db
1117
1118
; if non-zero, RemovePokemon will remove the mon from the current box,
1119
; else it will remove the mon from the party
1120
wRemoveMonFromBox::
1121
; 0 = move from box to party
1122
; 1 = move from party to box
1123
; 2 = move from daycare to party
1124
; 3 = move from party to daycare
1125
wMoveMonType:: db
1126
1127
wItemQuantity:: db
1128
1129
wMaxItemQuantity:: db
1130
1131
; LoadMonData copies mon data here
1132
wLoadedMon:: party_struct wLoadedMon
1133
1134
; bit 0: The space in VRAM that is used to store walk animation tile patterns
1135
; for the player and NPCs is in use for font tile patterns.
1136
; This means that NPC movement must be disabled.
1137
; The other bits are unused.
1138
wFontLoaded:: db
1139
1140
; walk animation counter
1141
wWalkCounter:: db
1142
1143
; background tile number in front of the player (either 1 or 2 steps ahead)
1144
wTileInFrontOfPlayer:: db
1145
1146
; The desired fade counter reload value is stored here prior to calling
1147
; PlaySound in order to cause the current music to fade out before the new
1148
; music begins playing. Storing 0 causes no fade out to occur and the new music
1149
; to begin immediately.
1150
; This variable has another use related to fade-out, as well. PlaySound stores
1151
; the sound ID of the music that should be played after the fade-out is finished
1152
; in this variable. FadeOutAudio checks if it's non-zero every V-Blank and
1153
; fades out the current audio if it is. Once it has finished fading out the
1154
; audio, it zeroes this variable and starts playing the sound ID stored in it.
1155
wAudioFadeOutControl:: db
1156
1157
wAudioFadeOutCounterReloadValue:: db
1158
1159
wAudioFadeOutCounter:: db
1160
1161
; This is used to determine whether the default music is already playing when
1162
; attempting to play the default music (in order to avoid restarting the same
1163
; music) and whether the music has already been stopped when attempting to
1164
; fade out the current music (so that the new music can be begin immediately
1165
; instead of waiting).
1166
; It sometimes contains the sound ID of the last music played, but it may also
1167
; contain $ff (if the music has been stopped) or 0 (because some routines zero
1168
; it in order to prevent assumptions from being made about the current state of
1169
; the music).
1170
wLastMusicSoundID:: db
1171
1172
; $00 = causes sprites to be hidden and the value to change to $ff
1173
; $01 = enabled
1174
; $ff = disabled
1175
; other values aren't used
1176
wUpdateSpritesEnabled:: db
1177
1178
wEnemyMoveNum:: db
1179
wEnemyMoveEffect:: db
1180
wEnemyMovePower:: db
1181
wEnemyMoveType:: db
1182
wEnemyMoveAccuracy:: db
1183
wEnemyMoveMaxPP:: db
1184
wPlayerMoveNum:: db
1185
wPlayerMoveEffect:: db
1186
wPlayerMovePower:: db
1187
wPlayerMoveType:: db
1188
wPlayerMoveAccuracy:: db
1189
wPlayerMoveMaxPP:: db
1190
1191
wEnemyMonSpecies2:: db
1192
wBattleMonSpecies2:: db
1193
1194
wEnemyMonNick:: ds NAME_LENGTH
1195
1196
wEnemyMon:: battle_struct wEnemyMon
1197
1198
wEnemyMonBaseStats:: ds NUM_STATS
1199
wEnemyMonActualCatchRate:: db
1200
wEnemyMonBaseExp:: db
1201
1202
wBattleMonNick:: ds NAME_LENGTH
1203
wBattleMon:: battle_struct wBattleMon
1204
1205
1206
wTrainerClass:: db
1207
1208
ds 1
1209
1210
wTrainerPicPointer:: dw
1211
1212
ds 1
1213
1214
UNION
1215
wTempMoveNameBuffer:: ds MOVE_NAME_LENGTH
1216
1217
NEXTU
1218
; The name of the mon that is learning a move.
1219
wLearnMoveMonName:: ds NAME_LENGTH
1220
ENDU
1221
1222
ds 2
1223
1224
; money received after battle = base money × level of last enemy mon
1225
wTrainerBaseMoney:: dw ; BCD
1226
1227
wToggleableObjectCounter:: db
1228
1229
ds 1
1230
1231
; 13 bytes for the letters of the opposing trainer
1232
; the name is terminated with $50 with possible
1233
; unused trailing letters
1234
wTrainerName:: ds 13
1235
1236
; lost battle, this is -1
1237
; no battle, this is 0
1238
; wild battle, this is 1
1239
; trainer battle, this is 2
1240
wIsInBattle:: db
1241
1242
; flags that indicate which party members should be be given exp when GainExperience is called
1243
wPartyGainExpFlags:: flag_array PARTY_LENGTH
1244
1245
; in a wild battle, this is the species of pokemon
1246
; in a trainer battle, this is the trainer class + OPP_ID_OFFSET
1247
wCurOpponent:: db
1248
1249
; in normal battle, this is 0
1250
; in old man battle, this is 1
1251
; in safari battle, this is 2
1252
wBattleType:: db
1253
1254
; bits 0-6: Effectiveness
1255
; $0 = immune
1256
; $5 = not very effective
1257
; $a = neutral
1258
; $14 = super-effective
1259
; bit 7: STAB
1260
wDamageMultipliers:: db
1261
1262
; which entry in LoneAttacks to use
1263
; it's actually the same thing as ^
1264
wLoneAttackNo::
1265
wGymLeaderNo:: db
1266
; which instance of [youngster, lass, etc] is this?
1267
wTrainerNo:: db
1268
1269
; $00 = normal attack
1270
; $01 = critical hit
1271
; $02 = successful OHKO
1272
; $ff = failed OHKO
1273
wCriticalHitOrOHKO:: db
1274
1275
wMoveMissed:: db
1276
1277
wBattleStatusData::
1278
; always 0
1279
wPlayerStatsToDouble:: db
1280
; always 0
1281
wPlayerStatsToHalve:: db
1282
1283
wPlayerBattleStatus1:: db
1284
wPlayerBattleStatus2:: db
1285
wPlayerBattleStatus3:: db
1286
1287
; always 0
1288
wEnemyStatsToDouble:: db
1289
; always 0
1290
wEnemyStatsToHalve:: db
1291
1292
wEnemyBattleStatus1:: db
1293
wEnemyBattleStatus2:: db
1294
wEnemyBattleStatus3:: db
1295
1296
; when the player is attacking multiple times, the number of attacks left
1297
wPlayerNumAttacksLeft:: db
1298
1299
wPlayerConfusedCounter:: db
1300
1301
wPlayerToxicCounter:: db
1302
1303
; high nibble: which move is disabled (1-4)
1304
; low nibble: disable turns left
1305
wPlayerDisabledMove:: db
1306
1307
ds 1
1308
1309
; when the enemy is attacking multiple times, the number of attacks left
1310
wEnemyNumAttacksLeft:: db
1311
1312
wEnemyConfusedCounter:: db
1313
1314
wEnemyToxicCounter:: db
1315
1316
; high nibble: which move is disabled (1-4)
1317
; low nibble: disable turns left
1318
wEnemyDisabledMove:: db
1319
1320
ds 1
1321
1322
UNION
1323
; the amount of damage accumulated by the player while biding
1324
wPlayerBideAccumulatedDamage:: dw
1325
1326
NEXTU
1327
wUnknownSerialCounter2:: dw
1328
1329
NEXTU
1330
; number of hits by player in attacks like Double Slap, etc.
1331
wPlayerNumHits:: db
1332
ENDU
1333
1334
ds 2
1335
wBattleStatusDataEnd::
1336
1337
; non-zero when an item or move that allows escape from battle was used
1338
wEscapedFromBattle:: db
1339
1340
UNION
1341
wAmountMoneyWon:: ds 3 ; BCD
1342
1343
NEXTU
1344
wObjectToHide:: db
1345
wObjectToShow:: db
1346
ENDU
1347
1348
; the map you will start at when the debug bit is set
1349
wDefaultMap::
1350
wMenuItemOffset::
1351
; ID number of the current battle animation
1352
wAnimationID:: db
1353
1354
wNamingScreenType::
1355
wPartyMenuTypeOrMessageID::
1356
; temporary storage for the number of tiles in a tileset
1357
wTempTilesetNumTiles:: db
1358
1359
; used by the pokemart code to save the existing value of wListScrollOffset
1360
; so that it can be restored when the player is done with the pokemart NPC
1361
wSavedListScrollOffset:: db
1362
1363
ds 2
1364
1365
; base coordinates of frame block
1366
wBaseCoordX:: db
1367
wBaseCoordY:: db
1368
1369
; low health alarm counter/enable
1370
; high bit = enable, others = timer to cycle frequencies
1371
wLowHealthAlarm:: db
1372
1373
; counts how many tiles of the current frame block have been drawn
1374
wFBTileCounter:: db
1375
1376
wMovingBGTilesCounter2:: db
1377
1378
; duration of each frame of the current subanimation in terms of screen refreshes
1379
wSubAnimFrameDelay:: db
1380
; counts the number of subentries left in the current subanimation
1381
wSubAnimCounter:: db
1382
1383
; 1 = no save file or save file is corrupted
1384
; 2 = save file exists and no corruption has been detected
1385
wSaveFileStatus:: db
1386
1387
; number of tiles in current battle animation frame block
1388
wNumFBTiles:: db
1389
1390
UNION
1391
wSpiralBallsBaseY:: db
1392
wSpiralBallsBaseX:: db
1393
1394
NEXTU
1395
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
1396
; bit 7: direction; 0 = right, 1 = left
1397
wFallingObjectMovementByte:: db
1398
wNumFallingObjects:: db
1399
1400
NEXTU
1401
wFlashScreenLongCounter::
1402
wNumShootingBalls::
1403
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
1404
wTradedMonMovingRight::
1405
wOptionsInitialized::
1406
wNewSlotMachineBallTile::
1407
; how much to add to the X/Y coord
1408
wCoordAdjustmentAmount::
1409
wUnusedWaterDropletsByte::
1410
db
1411
1412
wSlideMonDelay::
1413
; generic counter variable for various animations
1414
wAnimCounter::
1415
; controls what transformations are applied to the subanimation
1416
; 01: flip horizontally and vertically
1417
; 02: flip horizontally and translate downwards 40 pixels
1418
; 03: translate base coordinates of frame blocks, but don't change their internal coordinates or flip their tiles
1419
; 04: reverse the subanimation
1420
wSubAnimTransform::
1421
db
1422
ENDU
1423
1424
wEndBattleWinTextPointer:: dw
1425
wEndBattleLoseTextPointer:: dw
1426
ds 2
1427
wEndBattleTextRomBank:: db
1428
1429
ds 1
1430
1431
; the address _of the address_ of the current subanimation entry
1432
wSubAnimAddrPtr:: dw
1433
1434
UNION
1435
; the address of the current subentry of the current subanimation
1436
wSubAnimSubEntryAddr:: dw
1437
1438
NEXTU
1439
; If non-zero, the allow matches flag is always set.
1440
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
1441
; the only way it can increase. Winning certain payout amounts will decrement it
1442
; or zero it.
1443
wSlotMachineAllowMatchesCounter:: db
1444
ENDU
1445
1446
ds 2
1447
1448
wOutwardSpiralTileMapPointer:: db
1449
1450
wPartyMenuAnimMonEnabled::
1451
; non-zero when enabled. causes nest locations to blink on and off.
1452
; the town selection cursor will blink regardless of what this value is
1453
wTownMapSpriteBlinkingEnabled::
1454
wUnusedMoveAnimByte:: db
1455
1456
; current destination address in OAM for frame blocks (big endian)
1457
wFBDestAddr:: dw
1458
1459
; controls how the frame blocks are put together to form frames
1460
; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
1461
; 00: clean OAM buffer and delay
1462
; 02: move onto the next frame block with no delay and no cleaning OAM buffer
1463
; 03: delay, but don't clean OAM buffer
1464
; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
1465
wFBMode:: db
1466
1467
; 0 = small
1468
; 1 = big
1469
wLinkCableAnimBulgeToggle::
1470
wIntroNidorinoBaseTile::
1471
wOutwardSpiralCurrentDirection::
1472
wDropletTile::
1473
wNewTileBlockID::
1474
wWhichBattleAnimTileset::
1475
; 0 = left
1476
; 1 = right
1477
wSquishMonCurrentDirection::
1478
; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
1479
wSlideMonUpBottomRowLeftTile::
1480
db
1481
1482
wDisableVBlankWYUpdate:: db ; if non-zero, don't update WY during V-blank
1483
1484
wSpriteCurPosX:: db
1485
wSpriteCurPosY:: db
1486
wSpriteWidth:: db
1487
wSpriteHeight:: db
1488
; current input byte
1489
wSpriteInputCurByte:: db
1490
; bit offset of last read input bit
1491
wSpriteInputBitCounter:: db
1492
1493
; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
1494
; 3 -> XX000000 1st column
1495
; 2 -> 00XX0000 2nd column
1496
; 1 -> 0000XX00 3rd column
1497
; 0 -> 000000XX 4th column
1498
wSpriteOutputBitOffset:: db
1499
1500
; bit 0 determines used buffer (0 -> sSpriteBuffer1, 1 -> sSpriteBuffer2)
1501
; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
1502
wSpriteLoadFlags:: db
1503
wSpriteUnpackMode:: db
1504
wSpriteFlipped:: db
1505
1506
; pointer to next input byte
1507
wSpriteInputPtr:: dw
1508
; pointer to current output byte
1509
wSpriteOutputPtr:: dw
1510
; used to revert pointer for different bit offsets
1511
wSpriteOutputPtrCached:: dw
1512
; pointer to differential decoding table (assuming initial value 0)
1513
wSpriteDecodeTable0Ptr:: dw
1514
; pointer to differential decoding table (assuming initial value 1)
1515
wSpriteDecodeTable1Ptr:: dw
1516
1517
; input for GetMonHeader
1518
wCurSpecies::
1519
; input for GetName
1520
wNameListIndex:: db
1521
wNameListType:: db
1522
1523
wPredefBank:: db
1524
1525
wMonHeader::
1526
; In the ROM base stats data structure, this is the dex number, but it is
1527
; overwritten with the internal index number after the header is copied to WRAM.
1528
wMonHIndex:: db
1529
wMonHBaseStats::
1530
wMonHBaseHP:: db
1531
wMonHBaseAttack:: db
1532
wMonHBaseDefense:: db
1533
wMonHBaseSpeed:: db
1534
wMonHBaseSpecial:: db
1535
wMonHTypes::
1536
wMonHType1:: db
1537
wMonHType2:: db
1538
wMonHCatchRate:: db
1539
wMonHBaseEXP:: db
1540
wMonHSpriteDim:: db
1541
wMonHFrontSprite:: dw
1542
wMonHBackSprite:: dw
1543
wMonHMoves:: ds NUM_MOVES
1544
wMonHGrowthRate:: db
1545
wMonHLearnset:: flag_array NUM_TMS + NUM_HMS
1546
ds 1
1547
wMonHeaderEnd::
1548
1549
; saved at the start of a battle and then written back at the end of the battle
1550
wSavedTileAnimations:: db
1551
1552
ds 2
1553
1554
wDamage:: dw
1555
1556
ds 2
1557
1558
wRepelRemainingSteps:: db
1559
1560
; list of moves for FormatMovesString
1561
wMoves:: ds NUM_MOVES
1562
1563
wMoveNum:: db
1564
1565
; concatenated move name list where intermediate '@' are replaced with '<NEXT>'
1566
wMovesString:: ds NUM_MOVES * MOVE_NAME_LENGTH
1567
1568
wUnusedCurMapTilesetCopy:: db
1569
1570
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
1571
wWalkBikeSurfStateCopy:: db
1572
1573
; the type of list for InitList to init
1574
wInitListType:: db
1575
1576
; 0 if no mon was captured
1577
wCapturedMonSpecies:: db
1578
1579
; Non-zero when the first player mon and enemy mon haven't been sent out yet.
1580
; It prevents the game from asking if the player wants to choose another mon
1581
; when the enemy sends out their first mon and suppresses the "no will to fight"
1582
; message when the game searches for the first non-fainted mon in the party,
1583
; which will be the first mon sent out.
1584
wFirstMonsNotOutYet:: db
1585
1586
wNamedObjectIndex::
1587
wTempByteValue::
1588
wNumSetBits::
1589
wTypeEffectiveness::
1590
wMoveType::
1591
wPokedexNum::
1592
wTempTMHM::
1593
wUsingPPUp::
1594
wMaxPP::
1595
wMoveGrammar::
1596
; 0 for player, non-zero for enemy
1597
wCalculateWhoseStats::
1598
wPokeBallCaptureCalcTemp::
1599
; lower nybble: number of shakes
1600
; upper nybble: number of animations to play
1601
wPokeBallAnimData::
1602
db
1603
1604
; When this value is non-zero, the player isn't allowed to exit the party menu
1605
; by pressing B and not choosing a mon.
1606
wForcePlayerToChooseMon:: db
1607
1608
; number of times the player has tried to run from battle
1609
wNumRunAttempts:: db
1610
1611
wEvolutionOccurred:: db
1612
1613
wVBlankSavedROMBank:: db
1614
1615
ds 1
1616
1617
wIsKeyItem:: db
1618
1619
wTextBoxID:: db
1620
1621
; bit 5: set when maps first load; can be reset to re-run a script
1622
; bit 6: set when maps first load; can be reset to re-run a script (used less often than bit 5)
1623
; bit 7: set when using an elevator map's menu; triggers the shaking animation
1624
wCurrentMapScriptFlags:: db
1625
1626
wCurEnemyLevel:: db
1627
1628
; pointer to list of items terminated by $FF
1629
wItemListPointer:: dw
1630
1631
; number of entries in a list
1632
wListCount:: db
1633
1634
wLinkState:: db
1635
1636
wTwoOptionMenuID:: db
1637
1638
; the id of the menu item the player ultimately chose
1639
wChosenMenuItem::
1640
; non-zero when the whole party has fainted due to out-of-battle poison damage
1641
wOutOfBattleBlackout:: db
1642
1643
; the way the user exited a menu
1644
; for list menus and the buy/sell/quit menu:
1645
; $01 = the user pressed A to choose a menu item
1646
; $02 = the user pressed B to cancel
1647
; for two-option menus:
1648
; $01 = the user pressed A with the first menu item selected
1649
; $02 = the user pressed B or pressed A with the second menu item selected
1650
wMenuExitMethod:: db
1651
1652
; the size is always 6, so they didn't need a variable in RAM for this
1653
wDungeonWarpDataEntrySize::
1654
; 0 = museum guy
1655
; 1 = gym guy
1656
wWhichPewterGuy::
1657
; there are 3 windows, from 0 to 2
1658
wWhichPrizeWindow::
1659
; a horizontal or vertical gate block
1660
wGymGateTileBlock:: db
1661
1662
wSavedSpriteScreenY:: db
1663
wSavedSpriteScreenX:: db
1664
wSavedSpriteMapY:: db
1665
wSavedSpriteMapX:: db
1666
1667
ds 5
1668
1669
wWhichPrize:: db
1670
1671
; counts downward each frame
1672
; when it hits 0, BIT_DISABLE_JOYPAD of wStatusFlags5 is reset
1673
wIgnoreInputCounter:: db
1674
1675
; counts down once every step
1676
wStepCounter:: db
1677
1678
; after a battle, you have at least 3 steps before a random battle can occur
1679
wNumberOfNoRandomBattleStepsLeft:: db
1680
1681
wPrize1:: db
1682
wPrize2:: db
1683
wPrize3:: db
1684
1685
ds 1
1686
1687
UNION
1688
wSerialRandomNumberListBlock:: ds $11
1689
1690
NEXTU
1691
wPrize1Price:: dw
1692
wPrize2Price:: dw
1693
wPrize3Price:: dw
1694
1695
ds 1
1696
1697
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
1698
wLinkBattleRandomNumberList:: ds 10
1699
ENDU
1700
1701
wSerialPlayerDataBlock:: ; ds $1a8
1702
1703
; When a real item is being used, this is 0.
1704
; When a move is acting as an item, this is the ID of the item it's acting as.
1705
; For example, out-of-battle Dig is executed using a fake Escape Rope item. In
1706
; that case, this would be ESCAPE_ROPE.
1707
wPseudoItemID:: db
1708
1709
wUnusedAlreadyOwnedFlag:: db
1710
1711
ds 2
1712
1713
wEvoStoneItemID:: db
1714
1715
wSavedNPCMovementDirections2Index:: db
1716
1717
wPlayerName:: ds NAME_LENGTH
1718
1719
1720
SECTION "Party Data", WRAM0
1721
1722
wPartyDataStart::
1723
1724
wPartyCount:: db
1725
wPartySpecies:: ds PARTY_LENGTH + 1
1726
1727
wPartyMons::
1728
; wPartyMon1 - wPartyMon6
1729
FOR n, 1, PARTY_LENGTH + 1
1730
wPartyMon{d:n}:: party_struct wPartyMon{d:n}
1731
ENDR
1732
1733
wPartyMonOT::
1734
; wPartyMon1OT - wPartyMon6OT
1735
FOR n, 1, PARTY_LENGTH + 1
1736
wPartyMon{d:n}OT:: ds NAME_LENGTH
1737
ENDR
1738
1739
wPartyMonNicks::
1740
; wPartyMon1Nick - wPartyMon6Nick
1741
FOR n, 1, PARTY_LENGTH + 1
1742
wPartyMon{d:n}Nick:: ds NAME_LENGTH
1743
ENDR
1744
wPartyMonNicksEnd::
1745
1746
wPartyDataEnd::
1747
1748
1749
SECTION "Main Data", WRAM0
1750
1751
wMainDataStart::
1752
1753
wPokedexOwned:: flag_array NUM_POKEMON
1754
wPokedexOwnedEnd::
1755
1756
wPokedexSeen:: flag_array NUM_POKEMON
1757
wPokedexSeenEnd::
1758
1759
wNumBagItems:: db
1760
; item, quantity
1761
wBagItems:: ds BAG_ITEM_CAPACITY * 2 + 1
1762
1763
wPlayerMoney:: ds 3 ; BCD
1764
1765
wRivalName:: ds NAME_LENGTH
1766
1767
wOptions:: db
1768
1769
wObtainedBadges:: flag_array NUM_BADGES
1770
1771
wUnusedObtainedBadges:: db
1772
1773
wLetterPrintingDelayFlags:: db
1774
1775
wPlayerID:: dw
1776
1777
wMapMusicSoundID:: db
1778
wMapMusicROMBank:: db
1779
1780
; offset subtracted from FadePal4 to get the background and object palettes for the current map
1781
; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
1782
wMapPalOffset:: db
1783
1784
wCurMap:: db
1785
1786
; pointer to the upper left corner of the current view in the tile block map
1787
wCurrentTileBlockMapViewPointer:: dw
1788
1789
; player's position on the current map
1790
wYCoord:: db
1791
wXCoord:: db
1792
1793
; player's position (by block)
1794
wYBlockCoord:: db
1795
wXBlockCoord:: db
1796
1797
wLastMap:: db
1798
wUnusedLastMapWidth:: db
1799
1800
wCurMapHeader::
1801
wCurMapTileset:: db
1802
wCurMapHeight:: db
1803
wCurMapWidth:: db
1804
wCurMapDataPtr:: dw
1805
wCurMapTextPtr:: dw
1806
wCurMapScriptPtr:: dw
1807
wCurMapConnections:: db
1808
wCurMapHeaderEnd::
1809
1810
wNorthConnectionHeader:: map_connection_struct wNorth
1811
wSouthConnectionHeader:: map_connection_struct wSouth
1812
wWestConnectionHeader:: map_connection_struct wWest
1813
wEastConnectionHeader:: map_connection_struct wEast
1814
1815
; sprite set for the current map (11 sprite picture ID's)
1816
wSpriteSet:: ds SPRITE_SET_LENGTH
1817
; sprite set ID for the current map
1818
wSpriteSetID:: db
1819
1820
wObjectDataPointerTemp:: dw
1821
1822
ds 2
1823
1824
; the tile shown outside the boundaries of the map
1825
wMapBackgroundTile:: db
1826
1827
; number of warps in current map (up to MAX_WARP_EVENTS)
1828
wNumberOfWarps:: db
1829
1830
; current map warp entries
1831
wWarpEntries:: ds MAX_WARP_EVENTS * 4 ; Y, X, warp ID, map ID
1832
1833
; if $ff, the player's coordinates are not updated when entering the map
1834
wDestinationWarpID:: db
1835
1836
ds 128
1837
1838
; number of signs in the current map (up to MAX_BG_EVENTS)
1839
wNumSigns:: db
1840
1841
wSignCoords:: ds MAX_BG_EVENTS * 2 ; Y, X
1842
wSignTextIDs:: ds MAX_BG_EVENTS
1843
1844
; number of sprites on the current map (up to MAX_OBJECT_EVENTS)
1845
wNumSprites:: db
1846
1847
; these two variables track the X and Y offset in blocks from the last special warp used
1848
; they don't seem to be used for anything
1849
wYOffsetSinceLastSpecialWarp:: db
1850
wXOffsetSinceLastSpecialWarp:: db
1851
1852
wMapSpriteData:: ds MAX_OBJECT_EVENTS * 2 ; movement byte 2, text ID
1853
wMapSpriteExtraData:: ds MAX_OBJECT_EVENTS * 2 ; trainer class/item ID, trainer set ID
1854
1855
; map height in 2x2 meta-tiles
1856
wCurrentMapHeight2:: db
1857
1858
; map width in 2x2 meta-tiles
1859
wCurrentMapWidth2:: db
1860
1861
; the address of the upper left corner of the visible portion of the BG tile map in VRAM
1862
wMapViewVRAMPointer:: dw
1863
1864
; In the comments for the player direction variables below, "moving" refers to
1865
; both walking and changing facing direction without taking a step.
1866
1867
; if the player is moving, the current direction
1868
; if the player is not moving, zero
1869
; map scripts write to this in order to change the player's facing direction
1870
wPlayerMovingDirection:: db
1871
1872
; the direction in which the player was moving before the player last stopped
1873
wPlayerLastStopDirection:: db
1874
1875
; if the player is moving, the current direction
1876
; if the player is not moving, the last the direction in which the player moved
1877
wPlayerDirection:: db
1878
1879
wTilesetBank:: db
1880
1881
; maps blocks (4x4 tiles) to tiles
1882
wTilesetBlocksPtr:: dw
1883
1884
wTilesetGfxPtr:: dw
1885
1886
; list of all walkable tiles
1887
wTilesetCollisionPtr:: dw
1888
1889
wTilesetTalkingOverTiles:: ds 3
1890
1891
wGrassTile:: db
1892
1893
ds 4
1894
1895
wNumBoxItems:: db
1896
; item, quantity
1897
wBoxItems:: ds PC_ITEM_CAPACITY * 2 + 1
1898
1899
; bits 0-6: box number
1900
; bit 7: whether the player has changed boxes before
1901
wCurrentBoxNum:: db
1902
1903
ds 1
1904
1905
; number of HOF teams
1906
wNumHoFTeams:: db
1907
1908
wUnusedMapVariable:: db
1909
1910
wPlayerCoins:: dw ; BCD
1911
1912
; bit array of toggleable objects; bit set = toggled off
1913
wToggleableObjectFlags:: flag_array $100
1914
wToggleableObjectFlagsEnd::
1915
1916
ds 7
1917
1918
; saved copy of SPRITESTATEDATA1_IMAGEINDEX (used for sprite facing/anim)
1919
wSavedSpriteImageIndex:: db
1920
1921
; each entry consists of 2 bytes
1922
; * the sprite ID (depending on the current map)
1923
; * the toggleable object index (global, used for wToggleableObjectFlags)
1924
; terminated with $FF
1925
wToggleableObjectList:: ds 16 * 2 + 1
1926
1927
ds 1
1928
1929
wGameProgressFlags::
1930
wOaksLabCurScript:: db
1931
wPalletTownCurScript:: db
1932
ds 1
1933
wBluesHouseCurScript:: db
1934
wViridianCityCurScript:: db
1935
ds 2
1936
wPewterCityCurScript:: db
1937
wRoute3CurScript:: db
1938
wRoute4CurScript:: db
1939
ds 1
1940
wViridianGymCurScript:: db
1941
wPewterGymCurScript:: db
1942
wCeruleanGymCurScript:: db
1943
wVermilionGymCurScript:: db
1944
wCeladonGymCurScript:: db
1945
wRoute6CurScript:: db
1946
wRoute8CurScript:: db
1947
wRoute24CurScript:: db
1948
wRoute25CurScript:: db
1949
wRoute9CurScript:: db
1950
wRoute10CurScript:: db
1951
wMtMoon1FCurScript:: db
1952
wMtMoonB2FCurScript:: db
1953
wSSAnne1FRoomsCurScript:: db
1954
wSSAnne2FRoomsCurScript:: db
1955
wRoute22CurScript:: db
1956
ds 1
1957
wRedsHouse2FCurScript:: db
1958
wViridianMartCurScript:: db
1959
wRoute22GateCurScript:: db
1960
wCeruleanCityCurScript:: db
1961
ds 7
1962
wSSAnneBowCurScript:: db
1963
wViridianForestCurScript:: db
1964
wMuseum1FCurScript:: db
1965
wRoute13CurScript:: db
1966
wRoute14CurScript:: db
1967
wRoute17CurScript:: db
1968
wRoute19CurScript:: db
1969
wRoute21CurScript:: db
1970
wSafariZoneGateCurScript:: db
1971
wRockTunnelB1FCurScript:: db
1972
wRockTunnel1FCurScript:: db
1973
ds 1
1974
wRoute11CurScript:: db
1975
wRoute12CurScript:: db
1976
wRoute15CurScript:: db
1977
wRoute16CurScript:: db
1978
wRoute18CurScript:: db
1979
wRoute20CurScript:: db
1980
wSSAnneB1FRoomsCurScript:: db
1981
wVermilionCityCurScript:: db
1982
wPokemonTower2FCurScript:: db
1983
wPokemonTower3FCurScript:: db
1984
wPokemonTower4FCurScript:: db
1985
wPokemonTower5FCurScript:: db
1986
wPokemonTower6FCurScript:: db
1987
wPokemonTower7FCurScript:: db
1988
wRocketHideoutB1FCurScript:: db
1989
wRocketHideoutB2FCurScript:: db
1990
wRocketHideoutB3FCurScript:: db
1991
wRocketHideoutB4FCurScript:: db
1992
ds 1
1993
wRoute6GateCurScript:: db
1994
wRoute8GateCurScript:: db
1995
ds 1
1996
wCinnabarIslandCurScript:: db
1997
wPokemonMansion1FCurScript:: db
1998
ds 1
1999
wPokemonMansion2FCurScript:: db
2000
wPokemonMansion3FCurScript:: db
2001
wPokemonMansionB1FCurScript:: db
2002
wVictoryRoad2FCurScript:: db
2003
wVictoryRoad3FCurScript:: db
2004
ds 1
2005
wFightingDojoCurScript:: db
2006
wSilphCo2FCurScript:: db
2007
wSilphCo3FCurScript:: db
2008
wSilphCo4FCurScript:: db
2009
wSilphCo5FCurScript:: db
2010
wSilphCo6FCurScript:: db
2011
wSilphCo7FCurScript:: db
2012
wSilphCo8FCurScript:: db
2013
wSilphCo9FCurScript:: db
2014
wHallOfFameCurScript:: db
2015
wChampionsRoomCurScript:: db
2016
wLoreleisRoomCurScript:: db
2017
wBrunosRoomCurScript:: db
2018
wAgathasRoomCurScript:: db
2019
wCeruleanCaveB1FCurScript:: db
2020
wVictoryRoad1FCurScript:: db
2021
ds 1
2022
wLancesRoomCurScript:: db
2023
ds 4
2024
wSilphCo10FCurScript:: db
2025
wSilphCo11FCurScript:: db
2026
ds 1
2027
wFuchsiaGymCurScript:: db
2028
wSaffronGymCurScript:: db
2029
ds 1
2030
wCinnabarGymCurScript:: db
2031
wGameCornerCurScript:: db
2032
wRoute16Gate1FCurScript:: db
2033
wBillsHouseCurScript:: db
2034
wRoute5GateCurScript:: db
2035
wPowerPlantCurScript:: ; overload
2036
wRoute7GateCurScript:: db
2037
ds 1
2038
wSSAnne2FCurScript:: db
2039
wSeafoamIslandsB3FCurScript:: db
2040
wRoute23CurScript:: db
2041
wSeafoamIslandsB4FCurScript:: db
2042
wRoute18Gate1FCurScript:: db
2043
ds 78
2044
wGameProgressFlagsEnd::
2045
2046
ds 56
2047
2048
wObtainedHiddenItemsFlags:: flag_array MAX_HIDDEN_ITEMS
2049
2050
wObtainedHiddenCoinsFlags:: flag_array MAX_HIDDEN_COINS
2051
2052
; $00 = walking
2053
; $01 = biking
2054
; $02 = surfing
2055
wWalkBikeSurfState:: db
2056
2057
ds 10
2058
2059
wTownVisitedFlag:: flag_array NUM_CITY_MAPS
2060
2061
; starts at 502
2062
wSafariSteps:: dw
2063
2064
; item given to cinnabar lab
2065
wFossilItem:: db
2066
; mon that will result from the item
2067
wFossilMon:: db
2068
2069
ds 2
2070
2071
; trainer classes start at OPP_ID_OFFSET
2072
wEnemyMonOrTrainerClass:: db
2073
2074
wPlayerJumpingYScreenCoordsIndex:: db
2075
2076
wRivalStarter:: db
2077
2078
ds 1
2079
2080
wPlayerStarter:: db
2081
2082
; sprite index of the boulder the player is trying to push
2083
wBoulderSpriteIndex:: db
2084
2085
wLastBlackoutMap:: db
2086
2087
; destination map (for certain types of special warps, not ordinary walking)
2088
wDestinationMap:: db
2089
2090
; initialized to $ff, but nothing ever reads it
2091
wUnusedPlayerDataByte:: db
2092
2093
; used to store the tile in front of the boulder when trying to push a boulder
2094
; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
2095
wTileInFrontOfBoulderAndBoulderCollisionResult:: db
2096
2097
; destination map for dungeon warps
2098
wDungeonWarpDestinationMap:: db
2099
2100
; which dungeon warp within the source map was used
2101
wWhichDungeonWarp:: db
2102
2103
wUnusedCardKeyGateID:: db
2104
2105
ds 8
2106
2107
wStatusFlags1:: db
2108
ds 1
2109
wBeatGymFlags:: db ; redundant because it matches wObtainedBadges
2110
ds 1
2111
wStatusFlags2:: db
2112
wCableClubDestinationMap::
2113
wStatusFlags3:: db
2114
wStatusFlags4:: db
2115
ds 1
2116
wStatusFlags5:: db
2117
ds 1
2118
wStatusFlags6:: db
2119
wStatusFlags7:: db
2120
wElite4Flags:: db
2121
ds 1
2122
wMovementFlags:: db
2123
2124
wCompletedInGameTradeFlags:: dw
2125
2126
ds 2
2127
2128
wWarpedFromWhichWarp:: db
2129
wWarpedFromWhichMap:: db
2130
2131
ds 2
2132
2133
wCardKeyDoorY:: db
2134
wCardKeyDoorX:: db
2135
2136
ds 2
2137
2138
wFirstLockTrashCanIndex:: db
2139
wSecondLockTrashCanIndex:: db
2140
2141
ds 2
2142
2143
wEventFlags:: flag_array NUM_EVENTS
2144
2145
2146
UNION
2147
wGrassRate:: db
2148
wGrassMons:: ds WILDDATA_LENGTH - 1
2149
2150
ds 8
2151
2152
wWaterRate:: db
2153
wWaterMons:: ds WILDDATA_LENGTH - 1
2154
2155
NEXTU
2156
; linked game's trainer name
2157
wLinkEnemyTrainerName:: ds NAME_LENGTH
2158
2159
ds 1
2160
2161
wSerialEnemyDataBlock:: ; ds $1a8
2162
2163
ds 9
2164
2165
wEnemyPartyCount:: db
2166
wEnemyPartySpecies:: ds PARTY_LENGTH + 1
2167
2168
wEnemyMons::
2169
; wEnemyMon1 - wEnemyMon6
2170
FOR n, 1, PARTY_LENGTH + 1
2171
wEnemyMon{d:n}:: party_struct wEnemyMon{d:n}
2172
ENDR
2173
2174
wEnemyMonOT::
2175
; wEnemyMon1OT - wEnemyMon6OT
2176
FOR n, 1, PARTY_LENGTH + 1
2177
wEnemyMon{d:n}OT:: ds NAME_LENGTH
2178
ENDR
2179
2180
wEnemyMonNicks::
2181
; wEnemyMon1Nick - wEnemyMon6Nick
2182
FOR n, 1, PARTY_LENGTH + 1
2183
wEnemyMon{d:n}Nick:: ds NAME_LENGTH
2184
ENDR
2185
2186
ENDU
2187
2188
2189
wTrainerHeaderPtr:: dw
2190
2191
ds 6
2192
2193
; the trainer the player must face after getting a wrong answer in the Cinnabar
2194
; gym quiz
2195
wOpponentAfterWrongAnswer:: db
2196
2197
; index of current map script, mostly used as index for function pointer array
2198
; mostly copied from map-specific map script pointer and written back later
2199
wCurMapScript:: db
2200
2201
ds 7
2202
2203
wPlayTimeHours:: db
2204
wPlayTimeMaxed:: db
2205
wPlayTimeMinutes:: db
2206
wPlayTimeSeconds:: db
2207
wPlayTimeFrames:: db
2208
2209
wSafariZoneGameOver:: db
2210
2211
wNumSafariBalls:: db
2212
2213
2214
; 0 if no pokemon is in the daycare
2215
; 1 if pokemon is in the daycare
2216
wDayCareInUse:: db
2217
2218
wDayCareMonName:: ds NAME_LENGTH
2219
wDayCareMonOT:: ds NAME_LENGTH
2220
2221
wDayCareMon:: box_struct wDayCareMon
2222
2223
wMainDataEnd::
2224
2225
2226
SECTION "Current Box Data", WRAM0
2227
2228
wBoxDataStart::
2229
2230
wBoxCount:: db
2231
wBoxSpecies:: ds MONS_PER_BOX + 1
2232
2233
wBoxMons::
2234
; wBoxMon1 - wBoxMon20
2235
FOR n, 1, MONS_PER_BOX + 1
2236
wBoxMon{d:n}:: box_struct wBoxMon{d:n}
2237
ENDR
2238
2239
wBoxMonOT::
2240
; wBoxMon1OT - wBoxMon20OT
2241
FOR n, 1, MONS_PER_BOX + 1
2242
wBoxMon{d:n}OT:: ds NAME_LENGTH
2243
ENDR
2244
2245
wBoxMonNicks::
2246
; wBoxMon1Nick - wBoxMon20Nick
2247
FOR n, 1, MONS_PER_BOX + 1
2248
wBoxMon{d:n}Nick:: ds NAME_LENGTH
2249
ENDR
2250
wBoxMonNicksEnd::
2251
2252
wBoxDataEnd::
2253
2254
2255
SECTION "Stack", WRAM0
2256
2257
; the stack grows downward
2258
ds $100 - 1
2259
wStack:: db
2260
2261
ENDSECTION
2262
2263