Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/ram/wram.asm
1270 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 7 * 7 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
wMissableObjectIndex:: 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 $60
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
wLuckySlotHiddenObjectIndex:: 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 44 ; party_struct size
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:: ds 3
692
693
NEXTU
694
; the level of the mon at the time it entered day care
695
wDayCareStartLevel:: db
696
wDayCareNumLevelsGrown:: db
697
wDayCareTotalCost:: dw ; BCD
698
wDayCarePerLevelCost:: dw ; BCD (always $100)
699
700
NEXTU
701
; which wheel the player is trying to stop
702
; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
703
wStoppingWhichSlotMachineWheel:: db
704
wSlotMachineWheel1Offset:: db
705
wSlotMachineWheel2Offset:: db
706
wSlotMachineWheel3Offset:: db
707
; the OAM tile number of the upper left corner of the winning symbol minus 2
708
wSlotMachineWinningSymbol::
709
wSlotMachineWheel1BottomTile:: db
710
wSlotMachineWheel1MiddleTile:: db
711
wSlotMachineWheel1TopTile:: db
712
wSlotMachineWheel2BottomTile:: db
713
wSlotMachineWheel2MiddleTile:: db
714
wSlotMachineWheel2TopTile:: db
715
wSlotMachineWheel3BottomTile:: db
716
wSlotMachineWheel3MiddleTile:: db
717
wSlotMachineWheel3TopTile:: db
718
wPayoutCoins:: dw
719
; These flags are set randomly and control when the wheels stop.
720
; bit 6: allow the player to win in general
721
; bit 7: allow the player to win with 7 or bar (plus the effect of bit 6)
722
wSlotMachineFlags:: db
723
; wheel 1 can "slip" while this is non-zero
724
wSlotMachineWheel1SlipCounter:: db
725
; wheel 2 can "slip" while this is non-zero
726
wSlotMachineWheel2SlipCounter:: db
727
; The remaining number of times wheel 3 will roll down a symbol until a match is
728
; found, when winning is enabled. It's initialized to 4 each bet.
729
wSlotMachineRerollCounter:: db
730
; how many coins the player bet on the slot machine (1 to 3)
731
wSlotMachineBet:: db
732
733
NEXTU
734
wCanPlaySlots:: db
735
ds 8
736
; temporary variable used to add payout amount to the player's coins
737
wTempCoins1:: dw
738
ds 2
739
; temporary variable used to subtract the bet amount from the player's coins
740
wTempCoins2:: dw
741
742
NEXTU
743
wHiddenObjectFunctionArgument:: db
744
wHiddenObjectFunctionRomBank:: db
745
wHiddenObjectIndex:: db
746
wHiddenObjectY:: db
747
wHiddenItemOrCoinsIndex::
748
wHiddenObjectX:: db
749
750
NEXTU
751
wPlayerSpinInPlaceAnimFrameDelay:: db
752
wPlayerSpinInPlaceAnimFrameDelayDelta:: db
753
wPlayerSpinInPlaceAnimFrameDelayEndValue:: db
754
wPlayerSpinInPlaceAnimSoundID:: db
755
ds 6
756
db ; temporary space used when wFacingDirectionList is rotated
757
; used when spinning the player's sprite
758
wFacingDirectionList:: ds 4
759
ds 3
760
wSavedPlayerScreenY:: db
761
wSavedPlayerFacingDirection:: db
762
763
NEXTU
764
wPlayerSpinWhileMovingUpOrDownAnimDeltaY:: db
765
wPlayerSpinWhileMovingUpOrDownAnimMaxY:: db
766
wPlayerSpinWhileMovingUpOrDownAnimFrameDelay:: db
767
768
NEXTU
769
wTrainerSpriteOffset:: db
770
wTrainerEngageDistance:: db
771
wTrainerFacingDirection:: db
772
wTrainerScreenY:: db
773
wTrainerScreenX:: db
774
775
NEXTU
776
wTrainerInfoTextBoxWidthPlus1:: db
777
wTrainerInfoTextBoxWidth:: db
778
wTrainerInfoTextBoxNextRowOffset:: db
779
780
NEXTU
781
wOptionsTextSpeedCursorX:: db
782
wOptionsBattleAnimCursorX:: db
783
wOptionsBattleStyleCursorX:: db
784
wOptionsCancelCursorX:: db
785
786
NEXTU
787
; tile ID of the badge number being drawn
788
wBadgeNumberTile:: db
789
; first tile ID of the name being drawn
790
wBadgeNameTile:: db
791
; a list of the first tile IDs of each badge or face (depending on whether the
792
; badge is owned) to be drawn on the trainer screen
793
; the byte after the list gets read when shifting back one byte
794
wBadgeOrFaceTiles:: ds NUM_BADGES + 1
795
ds 1
796
; temporary list created when displaying the badges on the trainer screen
797
; one byte for each badge; 0 = not obtained, 1 = obtained
798
wTempObtainedBadgesBooleans:: ds NUM_BADGES
799
800
NEXTU
801
wUnusedCreditsByte:: db
802
; the number of credits mons that have been displayed so far
803
wNumCreditsMonsDisplayed:: db
804
805
NEXTU
806
ds 1
807
db ; temporary space used when wJigglypuffFacingDirections is rotated
808
wJigglypuffFacingDirections:: ds 4
809
810
NEXTU
811
ds 16
812
; $3d = tree tile, $52 = grass tile
813
wCutTile:: db
814
ds 2
815
; 0 = cut animation, 1 = boulder dust animation
816
wWhichAnimationOffsets:: db
817
818
NEXTU
819
ds 18
820
; the index of the sprite the emotion bubble is to be displayed above
821
wEmotionBubbleSpriteIndex:: db
822
wWhichEmotionBubble:: db
823
824
NEXTU
825
wChangeBoxSavedMapTextPointer:: dw
826
827
NEXTU
828
wSavedY::
829
wTempSCX::
830
; which entry from TradeMons to select
831
wWhichTrade::
832
wDexMaxSeenMon::
833
wPPRestoreItem::
834
wWereAnyMonsAsleep::
835
wNumShakes::
836
wWhichBadge::
837
wTitleMonSpecies::
838
wPlayerCharacterOAMTile::
839
; the number of small stars OAM entries to move down
840
wMoveDownSmallStarsOAMCount::
841
wChargeMoveNum::
842
wCoordIndex::
843
wSwappedMenuItem::
844
; 0 = no bite
845
; 1 = bite
846
; 2 = no fish on map
847
wRodResponse::
848
db
849
ENDU
850
851
; 0 = neither
852
; 1 = warp pad
853
; 2 = hole
854
wStandingOnWarpPadOrHole::
855
wOAMBaseTile::
856
wGymTrashCanIndex:: db
857
858
wSymmetricSpriteOAMAttributes:: db
859
860
wMonPartySpriteSpecies:: db
861
862
; in the trade animation, the mon that leaves the left gameboy
863
wLeftGBMonSpecies:: db
864
865
; in the trade animation, the mon that leaves the right gameboy
866
wRightGBMonSpecies:: db
867
868
wMiscFlags:: db
869
870
ds 9
871
872
; This has overlapping related uses.
873
; When the player tries to use an item or use certain field moves, 0 is stored
874
; when the attempt fails and 1 is stored when the attempt succeeds.
875
; In addition, some items store 2 for certain types of failures, but this
876
; cannot happen in battle.
877
; In battle, a non-zero value indicates the player has taken their turn using
878
; something other than a move (e.g. using an item or switching pokemon).
879
; So, when an item is successfully used in battle, this value becomes non-zero
880
; and the player is not allowed to make a move and the two uses are compatible.
881
wActionResultOrTookBattleTurn:: db
882
883
; Set buttons are ignored.
884
wJoyIgnore:: db
885
886
; size of downscaled mon pic used in pokeball entering/exiting animation
887
; $00 = 5×5
888
; $01 = 3×3
889
wDownscaledMonSize::
890
; FormatMovesString stores the number of moves minus one here
891
wNumMovesMinusOne:: db
892
893
; This union spans 20 bytes.
894
UNION
895
; storage buffer for various name strings
896
wNameBuffer:: ds NAME_BUFFER_LENGTH
897
898
NEXTU
899
; data copied from Moves for one move
900
wMoveData:: ds MOVE_LENGTH
901
wPPUpCountAndMaxPP:: db
902
903
NEXTU
904
; amount of money made from one use of Pay Day
905
wPayDayMoney:: ds 3
906
907
NEXTU
908
; evolution data for one mon
909
wEvoDataBuffer:: ds NUM_EVOS_IN_BUFFER * 4 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator
910
wEvoDataBufferEnd::
911
912
NEXTU
913
wBattleMenuCurrentPP:: db
914
ds 3
915
wStatusScreenCurrentPP:: db
916
ds 6
917
; list of normal max PP (without PP up) values
918
wNormalMaxPPList:: ds NUM_MOVES
919
ENDU
920
921
UNION
922
; buffer for transferring the random number list generated by the other gameboy
923
wSerialOtherGameboyRandomNumberListBlock:: ds $11
924
NEXTU
925
; second buffer for temporarily saving and restoring current screen's tiles (e.g. if menus are drawn on top)
926
wTileMapBackup2:: ds SCREEN_AREA
927
ENDU
928
929
; This union spans 30 bytes.
930
UNION
931
; Temporary storage area
932
wBuffer:: ds 30
933
934
NEXTU
935
wEvoOldSpecies:: db
936
wEvoNewSpecies:: db
937
wEvoMonTileOffset:: db
938
wEvoCancelled:: db
939
940
NEXTU
941
wNamingScreenNameLength:: db
942
; non-zero when the player has chosen to submit the name
943
wNamingScreenSubmitName:: db
944
; 0 = upper case
945
; 1 = lower case
946
wAlphabetCase:: db
947
ds 1
948
wNamingScreenLetter:: db
949
950
NEXTU
951
wChangeMonPicEnemyTurnSpecies:: db
952
wChangeMonPicPlayerTurnSpecies:: db
953
954
NEXTU
955
wHPBarMaxHP:: dw
956
wHPBarOldHP:: dw
957
wHPBarNewHP:: dw
958
wHPBarDelta:: db
959
wHPBarTempHP:: dw
960
ds 11
961
wHPBarHPDifference:: dw
962
963
NEXTU
964
; lower nybble is x, upper nybble is y
965
wTownMapCoords::
966
; whether WriteMonMoves is being used to make a mon learn moves from day care
967
; non-zero if so
968
wLearningMovesFromDayCare::
969
db
970
971
ds 27
972
973
; the item that the AI used
974
wAIItem:: db
975
wUsedItemOnWhichPokemon:: db
976
ENDU
977
978
; sound ID during battle animations
979
wAnimSoundID:: db
980
981
; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
982
wBankswitchHomeSavedROMBank:: db
983
984
; used as a temp storage value for the bank to switch to
985
wBankswitchHomeTemp:: db
986
987
; 0 = nothing bought or sold in pokemart
988
; 1 = bought or sold something in pokemart
989
; this value is not used for anything
990
wBoughtOrSoldItemInMart:: db
991
992
; $00 - win
993
; $01 - lose
994
; $02 - draw
995
wBattleResult:: db
996
997
; bit 0: if set, prevents DisplayTextID from automatically drawing a text box
998
wAutoTextBoxDrawingControl:: db
999
1000
; used in some overworld scripts to vary scripted movement
1001
wSavedCoordIndex::
1002
wOakWalkedToPlayer::
1003
wNextSafariZoneGateScript:: db
1004
1005
; used in CheckForTilePairCollisions2 to store the tile the player is on
1006
wTilePlayerStandingOn:: db
1007
1008
wNPCNumScriptedSteps:: db
1009
1010
; which script function within the pointer table indicated by
1011
; wNPCMovementScriptPointerTableNum
1012
wNPCMovementScriptFunctionNum:: db
1013
1014
; bit 0: set when printing a text predef so that DisplayTextID doesn't switch
1015
; to the current map's bank
1016
wTextPredefFlag:: db
1017
1018
wPredefParentBank:: db
1019
1020
wSpriteIndex:: db
1021
1022
; movement byte 2 of current sprite
1023
wCurSpriteMovement2:: db
1024
1025
ds 2
1026
1027
; sprite offset of sprite being controlled by NPC movement script
1028
wNPCMovementScriptSpriteOffset:: db
1029
1030
wScriptedNPCWalkCounter:: db
1031
1032
ds 1
1033
1034
; always 0 since full CGB support was not implemented
1035
wOnCGB:: db
1036
1037
; if running on SGB, it's 1, else it's 0
1038
wOnSGB:: db
1039
1040
wDefaultPaletteCommand:: db
1041
1042
UNION
1043
wPlayerHPBarColor:: db
1044
1045
NEXTU
1046
; species of the mon whose palette is used for the whole screen
1047
wWholeScreenPaletteMonSpecies:: db
1048
ENDU
1049
1050
wEnemyHPBarColor:: db
1051
1052
; 0: green
1053
; 1: yellow
1054
; 2: red
1055
wPartyMenuHPBarColors:: ds PARTY_LENGTH
1056
1057
wStatusScreenHPBarColor:: db
1058
1059
ds 7
1060
1061
wCopyingSGBTileData::
1062
wWhichPartyMenuHPBar::
1063
wPalPacket::
1064
db
1065
1066
; This union spans 49 bytes.
1067
UNION
1068
wPartyMenuBlkPacket:: ds $30
1069
1070
NEXTU
1071
ds 29
1072
; storage buffer for various strings
1073
wStringBuffer:: ds NAME_BUFFER_LENGTH
1074
1075
NEXTU
1076
ds 29
1077
; the total amount of exp a mon gained
1078
wExpAmountGained:: dw
1079
wGainBoostedExp:: db
1080
ENDU
1081
1082
wGymCityName:: ds 17
1083
1084
wGymLeaderName:: ds NAME_LENGTH
1085
1086
wItemList:: ds 16
1087
1088
wListPointer:: dw
1089
1090
; used to store pointers, but never read
1091
wUnusedNamePointer:: dw
1092
1093
wItemPrices:: dw
1094
1095
wCurPartySpecies::
1096
wCurItem::
1097
wCurListMenuItem::
1098
db
1099
1100
; which pokemon you selected
1101
wWhichPokemon:: db
1102
1103
; if non-zero, then print item prices when displaying lists
1104
wPrintItemPrices:: db
1105
1106
; type of HP bar
1107
; $00 = enemy HUD in battle
1108
; $01 = player HUD in battle / status screen
1109
; $02 = party menu
1110
wHPBarType::
1111
; ID used by DisplayListMenuID
1112
wListMenuID:: db
1113
1114
; if non-zero, RemovePokemon will remove the mon from the current box,
1115
; else it will remove the mon from the party
1116
wRemoveMonFromBox::
1117
; 0 = move from box to party
1118
; 1 = move from party to box
1119
; 2 = move from daycare to party
1120
; 3 = move from party to daycare
1121
wMoveMonType:: db
1122
1123
wItemQuantity:: db
1124
1125
wMaxItemQuantity:: db
1126
1127
; LoadMonData copies mon data here
1128
wLoadedMon:: party_struct wLoadedMon
1129
1130
; bit 0: The space in VRAM that is used to store walk animation tile patterns
1131
; for the player and NPCs is in use for font tile patterns.
1132
; This means that NPC movement must be disabled.
1133
; The other bits are unused.
1134
wFontLoaded:: db
1135
1136
; walk animation counter
1137
wWalkCounter:: db
1138
1139
; background tile number in front of the player (either 1 or 2 steps ahead)
1140
wTileInFrontOfPlayer:: db
1141
1142
; The desired fade counter reload value is stored here prior to calling
1143
; PlaySound in order to cause the current music to fade out before the new
1144
; music begins playing. Storing 0 causes no fade out to occur and the new music
1145
; to begin immediately.
1146
; This variable has another use related to fade-out, as well. PlaySound stores
1147
; the sound ID of the music that should be played after the fade-out is finished
1148
; in this variable. FadeOutAudio checks if it's non-zero every V-Blank and
1149
; fades out the current audio if it is. Once it has finished fading out the
1150
; audio, it zeroes this variable and starts playing the sound ID stored in it.
1151
wAudioFadeOutControl:: db
1152
1153
wAudioFadeOutCounterReloadValue:: db
1154
1155
wAudioFadeOutCounter:: db
1156
1157
; This is used to determine whether the default music is already playing when
1158
; attempting to play the default music (in order to avoid restarting the same
1159
; music) and whether the music has already been stopped when attempting to
1160
; fade out the current music (so that the new music can be begin immediately
1161
; instead of waiting).
1162
; It sometimes contains the sound ID of the last music played, but it may also
1163
; contain $ff (if the music has been stopped) or 0 (because some routines zero
1164
; it in order to prevent assumptions from being made about the current state of
1165
; the music).
1166
wLastMusicSoundID:: db
1167
1168
; $00 = causes sprites to be hidden and the value to change to $ff
1169
; $01 = enabled
1170
; $ff = disabled
1171
; other values aren't used
1172
wUpdateSpritesEnabled:: db
1173
1174
wEnemyMoveNum:: db
1175
wEnemyMoveEffect:: db
1176
wEnemyMovePower:: db
1177
wEnemyMoveType:: db
1178
wEnemyMoveAccuracy:: db
1179
wEnemyMoveMaxPP:: db
1180
wPlayerMoveNum:: db
1181
wPlayerMoveEffect:: db
1182
wPlayerMovePower:: db
1183
wPlayerMoveType:: db
1184
wPlayerMoveAccuracy:: db
1185
wPlayerMoveMaxPP:: db
1186
1187
wEnemyMonSpecies2:: db
1188
wBattleMonSpecies2:: db
1189
1190
wEnemyMonNick:: ds NAME_LENGTH
1191
1192
wEnemyMon:: battle_struct wEnemyMon
1193
1194
wEnemyMonBaseStats:: ds NUM_STATS
1195
wEnemyMonActualCatchRate:: db
1196
wEnemyMonBaseExp:: db
1197
1198
wBattleMonNick:: ds NAME_LENGTH
1199
wBattleMon:: battle_struct wBattleMon
1200
1201
1202
wTrainerClass:: db
1203
1204
ds 1
1205
1206
wTrainerPicPointer:: dw
1207
1208
ds 1
1209
1210
UNION
1211
wTempMoveNameBuffer:: ds ITEM_NAME_LENGTH + 1
1212
1213
NEXTU
1214
; The name of the mon that is learning a move.
1215
wLearnMoveMonName:: ds NAME_LENGTH
1216
ENDU
1217
1218
ds 2
1219
1220
; money received after battle = base money × level of last enemy mon
1221
wTrainerBaseMoney:: dw ; BCD
1222
1223
wMissableObjectCounter:: db
1224
1225
ds 1
1226
1227
; 13 bytes for the letters of the opposing trainer
1228
; the name is terminated with $50 with possible
1229
; unused trailing letters
1230
wTrainerName:: ds 13
1231
1232
; lost battle, this is -1
1233
; no battle, this is 0
1234
; wild battle, this is 1
1235
; trainer battle, this is 2
1236
wIsInBattle:: db
1237
1238
; flags that indicate which party members should be be given exp when GainExperience is called
1239
wPartyGainExpFlags:: flag_array PARTY_LENGTH
1240
1241
; in a wild battle, this is the species of pokemon
1242
; in a trainer battle, this is the trainer class + OPP_ID_OFFSET
1243
wCurOpponent:: db
1244
1245
; in normal battle, this is 0
1246
; in old man battle, this is 1
1247
; in safari battle, this is 2
1248
wBattleType:: db
1249
1250
; bits 0-6: Effectiveness
1251
; $0 = immune
1252
; $5 = not very effective
1253
; $a = neutral
1254
; $14 = super-effective
1255
; bit 7: STAB
1256
wDamageMultipliers:: db
1257
1258
; which entry in LoneAttacks to use
1259
; it's actually the same thing as ^
1260
wLoneAttackNo::
1261
wGymLeaderNo:: db
1262
; which instance of [youngster, lass, etc] is this?
1263
wTrainerNo:: db
1264
1265
; $00 = normal attack
1266
; $01 = critical hit
1267
; $02 = successful OHKO
1268
; $ff = failed OHKO
1269
wCriticalHitOrOHKO:: db
1270
1271
wMoveMissed:: db
1272
1273
; always 0
1274
wPlayerStatsToDouble:: db
1275
; always 0
1276
wPlayerStatsToHalve:: db
1277
1278
wPlayerBattleStatus1:: db
1279
wPlayerBattleStatus2:: db
1280
wPlayerBattleStatus3:: db
1281
1282
; always 0
1283
wEnemyStatsToDouble:: db
1284
; always 0
1285
wEnemyStatsToHalve:: db
1286
1287
wEnemyBattleStatus1:: db
1288
wEnemyBattleStatus2:: db
1289
wEnemyBattleStatus3:: db
1290
1291
; when the player is attacking multiple times, the number of attacks left
1292
wPlayerNumAttacksLeft:: db
1293
1294
wPlayerConfusedCounter:: db
1295
1296
wPlayerToxicCounter:: db
1297
1298
; high nibble: which move is disabled (1-4)
1299
; low nibble: disable turns left
1300
wPlayerDisabledMove:: db
1301
1302
ds 1
1303
1304
; when the enemy is attacking multiple times, the number of attacks left
1305
wEnemyNumAttacksLeft:: db
1306
1307
wEnemyConfusedCounter:: db
1308
1309
wEnemyToxicCounter:: db
1310
1311
; high nibble: which move is disabled (1-4)
1312
; low nibble: disable turns left
1313
wEnemyDisabledMove:: db
1314
1315
ds 1
1316
1317
UNION
1318
; the amount of damage accumulated by the player while biding
1319
wPlayerBideAccumulatedDamage:: dw
1320
1321
NEXTU
1322
wUnknownSerialCounter2:: dw
1323
1324
NEXTU
1325
; number of hits by player in attacks like Double Slap, etc.
1326
wPlayerNumHits:: db
1327
ENDU
1328
1329
ds 2
1330
1331
; non-zero when an item or move that allows escape from battle was used
1332
wEscapedFromBattle:: db
1333
1334
UNION
1335
wAmountMoneyWon:: ds 3 ; BCD
1336
1337
NEXTU
1338
wObjectToHide:: db
1339
wObjectToShow:: db
1340
ENDU
1341
1342
; the map you will start at when the debug bit is set
1343
wDefaultMap::
1344
wMenuItemOffset::
1345
; ID number of the current battle animation
1346
wAnimationID:: db
1347
1348
wNamingScreenType::
1349
wPartyMenuTypeOrMessageID::
1350
; temporary storage for the number of tiles in a tileset
1351
wTempTilesetNumTiles:: db
1352
1353
; used by the pokemart code to save the existing value of wListScrollOffset
1354
; so that it can be restored when the player is done with the pokemart NPC
1355
wSavedListScrollOffset:: db
1356
1357
ds 2
1358
1359
; base coordinates of frame block
1360
wBaseCoordX:: db
1361
wBaseCoordY:: db
1362
1363
; low health alarm counter/enable
1364
; high bit = enable, others = timer to cycle frequencies
1365
wLowHealthAlarm:: db
1366
1367
; counts how many tiles of the current frame block have been drawn
1368
wFBTileCounter:: db
1369
1370
wMovingBGTilesCounter2:: db
1371
1372
; duration of each frame of the current subanimation in terms of screen refreshes
1373
wSubAnimFrameDelay:: db
1374
; counts the number of subentries left in the current subanimation
1375
wSubAnimCounter:: db
1376
1377
; 1 = no save file or save file is corrupted
1378
; 2 = save file exists and no corruption has been detected
1379
wSaveFileStatus:: db
1380
1381
; number of tiles in current battle animation frame block
1382
wNumFBTiles:: db
1383
1384
UNION
1385
wSpiralBallsBaseY:: db
1386
wSpiralBallsBaseX:: db
1387
1388
NEXTU
1389
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
1390
; bit 7: direction; 0 = right, 1 = left
1391
wFallingObjectMovementByte:: db
1392
wNumFallingObjects:: db
1393
1394
NEXTU
1395
wFlashScreenLongCounter::
1396
wNumShootingBalls::
1397
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
1398
wTradedMonMovingRight::
1399
wOptionsInitialized::
1400
wNewSlotMachineBallTile::
1401
; how much to add to the X/Y coord
1402
wCoordAdjustmentAmount::
1403
wUnusedWaterDropletsByte::
1404
db
1405
1406
wSlideMonDelay::
1407
; generic counter variable for various animations
1408
wAnimCounter::
1409
; controls what transformations are applied to the subanimation
1410
; 01: flip horizontally and vertically
1411
; 02: flip horizontally and translate downwards 40 pixels
1412
; 03: translate base coordinates of frame blocks, but don't change their internal coordinates or flip their tiles
1413
; 04: reverse the subanimation
1414
wSubAnimTransform::
1415
db
1416
ENDU
1417
1418
wEndBattleWinTextPointer:: dw
1419
wEndBattleLoseTextPointer:: dw
1420
ds 2
1421
wEndBattleTextRomBank:: db
1422
1423
ds 1
1424
1425
; the address _of the address_ of the current subanimation entry
1426
wSubAnimAddrPtr:: dw
1427
1428
UNION
1429
; the address of the current subentry of the current subanimation
1430
wSubAnimSubEntryAddr:: dw
1431
1432
NEXTU
1433
; If non-zero, the allow matches flag is always set.
1434
; There is a 1/256 (~0.4%) chance that this value will be set to 60, which is
1435
; the only way it can increase. Winning certain payout amounts will decrement it
1436
; or zero it.
1437
wSlotMachineAllowMatchesCounter:: db
1438
ENDU
1439
1440
ds 2
1441
1442
wOutwardSpiralTileMapPointer:: db
1443
1444
wPartyMenuAnimMonEnabled::
1445
; non-zero when enabled. causes nest locations to blink on and off.
1446
; the town selection cursor will blink regardless of what this value is
1447
wTownMapSpriteBlinkingEnabled::
1448
wUnusedMoveAnimByte:: db
1449
1450
; current destination address in OAM for frame blocks (big endian)
1451
wFBDestAddr:: dw
1452
1453
; controls how the frame blocks are put together to form frames
1454
; specifically, after finishing drawing the frame block, the frame block's mode determines what happens
1455
; 00: clean OAM buffer and delay
1456
; 02: move onto the next frame block with no delay and no cleaning OAM buffer
1457
; 03: delay, but don't clean OAM buffer
1458
; 04: delay, without cleaning OAM buffer, and do not advance [wFBDestAddr], so that the next frame block will overwrite this one
1459
wFBMode:: db
1460
1461
; 0 = small
1462
; 1 = big
1463
wLinkCableAnimBulgeToggle::
1464
wIntroNidorinoBaseTile::
1465
wOutwardSpiralCurrentDirection::
1466
wDropletTile::
1467
wNewTileBlockID::
1468
wWhichBattleAnimTileset::
1469
; 0 = left
1470
; 1 = right
1471
wSquishMonCurrentDirection::
1472
; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
1473
wSlideMonUpBottomRowLeftTile::
1474
db
1475
1476
wDisableVBlankWYUpdate:: db ; if non-zero, don't update WY during V-blank
1477
1478
wSpriteCurPosX:: db
1479
wSpriteCurPosY:: db
1480
wSpriteWidth:: db
1481
wSpriteHeight:: db
1482
; current input byte
1483
wSpriteInputCurByte:: db
1484
; bit offset of last read input bit
1485
wSpriteInputBitCounter:: db
1486
1487
; determines where in the output byte the two bits are placed. Each byte contains four columns (2bpp data)
1488
; 3 -> XX000000 1st column
1489
; 2 -> 00XX0000 2nd column
1490
; 1 -> 0000XX00 3rd column
1491
; 0 -> 000000XX 4th column
1492
wSpriteOutputBitOffset:: db
1493
1494
; bit 0 determines used buffer (0 -> sSpriteBuffer1, 1 -> sSpriteBuffer2)
1495
; bit 1 loading last sprite chunk? (there are at most 2 chunks per load operation)
1496
wSpriteLoadFlags:: db
1497
wSpriteUnpackMode:: db
1498
wSpriteFlipped:: db
1499
1500
; pointer to next input byte
1501
wSpriteInputPtr:: dw
1502
; pointer to current output byte
1503
wSpriteOutputPtr:: dw
1504
; used to revert pointer for different bit offsets
1505
wSpriteOutputPtrCached:: dw
1506
; pointer to differential decoding table (assuming initial value 0)
1507
wSpriteDecodeTable0Ptr:: dw
1508
; pointer to differential decoding table (assuming initial value 1)
1509
wSpriteDecodeTable1Ptr:: dw
1510
1511
; input for GetMonHeader
1512
wCurSpecies::
1513
; input for GetName
1514
wNameListIndex:: db
1515
wNameListType:: db
1516
1517
wPredefBank:: db
1518
1519
wMonHeader::
1520
; In the ROM base stats data structure, this is the dex number, but it is
1521
; overwritten with the internal index number after the header is copied to WRAM.
1522
wMonHIndex:: db
1523
wMonHBaseStats::
1524
wMonHBaseHP:: db
1525
wMonHBaseAttack:: db
1526
wMonHBaseDefense:: db
1527
wMonHBaseSpeed:: db
1528
wMonHBaseSpecial:: db
1529
wMonHTypes::
1530
wMonHType1:: db
1531
wMonHType2:: db
1532
wMonHCatchRate:: db
1533
wMonHBaseEXP:: db
1534
wMonHSpriteDim:: db
1535
wMonHFrontSprite:: dw
1536
wMonHBackSprite:: dw
1537
wMonHMoves:: ds NUM_MOVES
1538
wMonHGrowthRate:: db
1539
wMonHLearnset:: flag_array NUM_TMS + NUM_HMS
1540
ds 1
1541
wMonHeaderEnd::
1542
1543
; saved at the start of a battle and then written back at the end of the battle
1544
wSavedTileAnimations:: db
1545
1546
ds 2
1547
1548
wDamage:: dw
1549
1550
ds 2
1551
1552
wRepelRemainingSteps:: db
1553
1554
; list of moves for FormatMovesString
1555
wMoves:: ds NUM_MOVES
1556
1557
wMoveNum:: db
1558
1559
wMovesString:: ds 56
1560
1561
wUnusedCurMapTilesetCopy:: db
1562
1563
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
1564
wWalkBikeSurfStateCopy:: db
1565
1566
; the type of list for InitList to init
1567
wInitListType:: db
1568
1569
; 0 if no mon was captured
1570
wCapturedMonSpecies:: db
1571
1572
; Non-zero when the first player mon and enemy mon haven't been sent out yet.
1573
; It prevents the game from asking if the player wants to choose another mon
1574
; when the enemy sends out their first mon and suppresses the "no will to fight"
1575
; message when the game searches for the first non-fainted mon in the party,
1576
; which will be the first mon sent out.
1577
wFirstMonsNotOutYet:: db
1578
1579
wNamedObjectIndex::
1580
wTempByteValue::
1581
wNumSetBits::
1582
wTypeEffectiveness::
1583
wMoveType::
1584
wPokedexNum::
1585
wTempTMHM::
1586
wUsingPPUp::
1587
wMaxPP::
1588
wMoveGrammar::
1589
; 0 for player, non-zero for enemy
1590
wCalculateWhoseStats::
1591
wPokeBallCaptureCalcTemp::
1592
; lower nybble: number of shakes
1593
; upper nybble: number of animations to play
1594
wPokeBallAnimData::
1595
db
1596
1597
; When this value is non-zero, the player isn't allowed to exit the party menu
1598
; by pressing B and not choosing a mon.
1599
wForcePlayerToChooseMon:: db
1600
1601
; number of times the player has tried to run from battle
1602
wNumRunAttempts:: db
1603
1604
wEvolutionOccurred:: db
1605
1606
wVBlankSavedROMBank:: db
1607
1608
ds 1
1609
1610
wIsKeyItem:: db
1611
1612
wTextBoxID:: db
1613
1614
; bit 5: set when maps first load; can be reset to re-run a script
1615
; bit 6: set when maps first load; can be reset to re-run a script (used less often than bit 5)
1616
; bit 7: set when using an elevator map's menu; triggers the shaking animation
1617
wCurrentMapScriptFlags:: db
1618
1619
wCurEnemyLevel:: db
1620
1621
; pointer to list of items terminated by $FF
1622
wItemListPointer:: dw
1623
1624
; number of entries in a list
1625
wListCount:: db
1626
1627
wLinkState:: db
1628
1629
wTwoOptionMenuID:: db
1630
1631
; the id of the menu item the player ultimately chose
1632
wChosenMenuItem::
1633
; non-zero when the whole party has fainted due to out-of-battle poison damage
1634
wOutOfBattleBlackout:: db
1635
1636
; the way the user exited a menu
1637
; for list menus and the buy/sell/quit menu:
1638
; $01 = the user pressed A to choose a menu item
1639
; $02 = the user pressed B to cancel
1640
; for two-option menus:
1641
; $01 = the user pressed A with the first menu item selected
1642
; $02 = the user pressed B or pressed A with the second menu item selected
1643
wMenuExitMethod:: db
1644
1645
; the size is always 6, so they didn't need a variable in RAM for this
1646
wDungeonWarpDataEntrySize::
1647
; 0 = museum guy
1648
; 1 = gym guy
1649
wWhichPewterGuy::
1650
; there are 3 windows, from 0 to 2
1651
wWhichPrizeWindow::
1652
; a horizontal or vertical gate block
1653
wGymGateTileBlock:: db
1654
1655
wSavedSpriteScreenY:: db
1656
wSavedSpriteScreenX:: db
1657
wSavedSpriteMapY:: db
1658
wSavedSpriteMapX:: db
1659
1660
ds 5
1661
1662
wWhichPrize:: db
1663
1664
; counts downward each frame
1665
; when it hits 0, BIT_DISABLE_JOYPAD of wStatusFlags5 is reset
1666
wIgnoreInputCounter:: db
1667
1668
; counts down once every step
1669
wStepCounter:: db
1670
1671
; after a battle, you have at least 3 steps before a random battle can occur
1672
wNumberOfNoRandomBattleStepsLeft:: db
1673
1674
wPrize1:: db
1675
wPrize2:: db
1676
wPrize3:: db
1677
1678
ds 1
1679
1680
UNION
1681
wSerialRandomNumberListBlock:: ds $11
1682
1683
NEXTU
1684
wPrize1Price:: dw
1685
wPrize2Price:: dw
1686
wPrize3Price:: dw
1687
1688
ds 1
1689
1690
; shared list of 9 random numbers, indexed by wLinkBattleRandomNumberListIndex
1691
wLinkBattleRandomNumberList:: ds 10
1692
ENDU
1693
1694
wSerialPlayerDataBlock:: ; ds $1a8
1695
1696
; When a real item is being used, this is 0.
1697
; When a move is acting as an item, this is the ID of the item it's acting as.
1698
; For example, out-of-battle Dig is executed using a fake Escape Rope item. In
1699
; that case, this would be ESCAPE_ROPE.
1700
wPseudoItemID:: db
1701
1702
wUnusedAlreadyOwnedFlag:: db
1703
1704
ds 2
1705
1706
wEvoStoneItemID:: db
1707
1708
wSavedNPCMovementDirections2Index:: db
1709
1710
wPlayerName:: ds NAME_LENGTH
1711
1712
1713
SECTION "Party Data", WRAM0
1714
1715
wPartyDataStart::
1716
1717
wPartyCount:: db
1718
wPartySpecies:: ds PARTY_LENGTH + 1
1719
1720
wPartyMons::
1721
; wPartyMon1 - wPartyMon6
1722
FOR n, 1, PARTY_LENGTH + 1
1723
wPartyMon{d:n}:: party_struct wPartyMon{d:n}
1724
ENDR
1725
1726
wPartyMonOT::
1727
; wPartyMon1OT - wPartyMon6OT
1728
FOR n, 1, PARTY_LENGTH + 1
1729
wPartyMon{d:n}OT:: ds NAME_LENGTH
1730
ENDR
1731
1732
wPartyMonNicks::
1733
; wPartyMon1Nick - wPartyMon6Nick
1734
FOR n, 1, PARTY_LENGTH + 1
1735
wPartyMon{d:n}Nick:: ds NAME_LENGTH
1736
ENDR
1737
wPartyMonNicksEnd::
1738
1739
wPartyDataEnd::
1740
1741
1742
SECTION "Main Data", WRAM0
1743
1744
wMainDataStart::
1745
1746
wPokedexOwned:: flag_array NUM_POKEMON
1747
wPokedexOwnedEnd::
1748
1749
wPokedexSeen:: flag_array NUM_POKEMON
1750
wPokedexSeenEnd::
1751
1752
wNumBagItems:: db
1753
; item, quantity
1754
wBagItems:: ds BAG_ITEM_CAPACITY * 2 + 1
1755
1756
wPlayerMoney:: ds 3 ; BCD
1757
1758
wRivalName:: ds NAME_LENGTH
1759
1760
wOptions:: db
1761
1762
wObtainedBadges:: flag_array NUM_BADGES
1763
1764
wUnusedObtainedBadges:: db
1765
1766
wLetterPrintingDelayFlags:: db
1767
1768
wPlayerID:: dw
1769
1770
wMapMusicSoundID:: db
1771
wMapMusicROMBank:: db
1772
1773
; offset subtracted from FadePal4 to get the background and object palettes for the current map
1774
; normally, it is 0. it is 6 when Flash is needed, causing FadePal2 to be used instead of FadePal4
1775
wMapPalOffset:: db
1776
1777
wCurMap:: db
1778
1779
; pointer to the upper left corner of the current view in the tile block map
1780
wCurrentTileBlockMapViewPointer:: dw
1781
1782
; player's position on the current map
1783
wYCoord:: db
1784
wXCoord:: db
1785
1786
; player's position (by block)
1787
wYBlockCoord:: db
1788
wXBlockCoord:: db
1789
1790
wLastMap:: db
1791
wUnusedLastMapWidth:: db
1792
1793
wCurMapHeader::
1794
wCurMapTileset:: db
1795
wCurMapHeight:: db
1796
wCurMapWidth:: db
1797
wCurMapDataPtr:: dw
1798
wCurMapTextPtr:: dw
1799
wCurMapScriptPtr:: dw
1800
wCurMapConnections:: db
1801
wCurMapHeaderEnd::
1802
1803
wNorthConnectionHeader:: map_connection_struct wNorth
1804
wSouthConnectionHeader:: map_connection_struct wSouth
1805
wWestConnectionHeader:: map_connection_struct wWest
1806
wEastConnectionHeader:: map_connection_struct wEast
1807
1808
; sprite set for the current map (11 sprite picture ID's)
1809
wSpriteSet:: ds 11
1810
; sprite set ID for the current map
1811
wSpriteSetID:: db
1812
1813
wObjectDataPointerTemp:: dw
1814
1815
ds 2
1816
1817
; the tile shown outside the boundaries of the map
1818
wMapBackgroundTile:: db
1819
1820
; number of warps in current map (up to MAX_WARP_EVENTS)
1821
wNumberOfWarps:: db
1822
1823
; current map warp entries
1824
wWarpEntries:: ds MAX_WARP_EVENTS * 4 ; Y, X, warp ID, map ID
1825
1826
; if $ff, the player's coordinates are not updated when entering the map
1827
wDestinationWarpID:: db
1828
1829
ds 128
1830
1831
; number of signs in the current map (up to MAX_BG_EVENTS)
1832
wNumSigns:: db
1833
1834
wSignCoords:: ds MAX_BG_EVENTS * 2 ; Y, X
1835
wSignTextIDs:: ds MAX_BG_EVENTS
1836
1837
; number of sprites on the current map (up to MAX_OBJECT_EVENTS)
1838
wNumSprites:: db
1839
1840
; these two variables track the X and Y offset in blocks from the last special warp used
1841
; they don't seem to be used for anything
1842
wYOffsetSinceLastSpecialWarp:: db
1843
wXOffsetSinceLastSpecialWarp:: db
1844
1845
wMapSpriteData:: ds MAX_OBJECT_EVENTS * 2 ; movement byte 2, text ID
1846
wMapSpriteExtraData:: ds MAX_OBJECT_EVENTS * 2 ; trainer class/item ID, trainer set ID
1847
1848
; map height in 2x2 meta-tiles
1849
wCurrentMapHeight2:: db
1850
1851
; map width in 2x2 meta-tiles
1852
wCurrentMapWidth2:: db
1853
1854
; the address of the upper left corner of the visible portion of the BG tile map in VRAM
1855
wMapViewVRAMPointer:: dw
1856
1857
; In the comments for the player direction variables below, "moving" refers to
1858
; both walking and changing facing direction without taking a step.
1859
1860
; if the player is moving, the current direction
1861
; if the player is not moving, zero
1862
; map scripts write to this in order to change the player's facing direction
1863
wPlayerMovingDirection:: db
1864
1865
; the direction in which the player was moving before the player last stopped
1866
wPlayerLastStopDirection:: db
1867
1868
; if the player is moving, the current direction
1869
; if the player is not moving, the last the direction in which the player moved
1870
wPlayerDirection:: db
1871
1872
wTilesetBank:: db
1873
1874
; maps blocks (4x4 tiles) to tiles
1875
wTilesetBlocksPtr:: dw
1876
1877
wTilesetGfxPtr:: dw
1878
1879
; list of all walkable tiles
1880
wTilesetCollisionPtr:: dw
1881
1882
wTilesetTalkingOverTiles:: ds 3
1883
1884
wGrassTile:: db
1885
1886
ds 4
1887
1888
wNumBoxItems:: db
1889
; item, quantity
1890
wBoxItems:: ds PC_ITEM_CAPACITY * 2 + 1
1891
1892
; bits 0-6: box number
1893
; bit 7: whether the player has changed boxes before
1894
wCurrentBoxNum:: db
1895
1896
ds 1
1897
1898
; number of HOF teams
1899
wNumHoFTeams:: db
1900
1901
wUnusedMapVariable:: db
1902
1903
wPlayerCoins:: dw ; BCD
1904
1905
; bit array of missable objects. set = removed
1906
wMissableObjectFlags:: flag_array $100
1907
wMissableObjectFlagsEnd::
1908
1909
ds 7
1910
1911
; saved copy of SPRITESTATEDATA1_IMAGEINDEX (used for sprite facing/anim)
1912
wSavedSpriteImageIndex:: db
1913
1914
; each entry consists of 2 bytes
1915
; * the sprite ID (depending on the current map)
1916
; * the missable object index (global, used for wMissableObjectFlags)
1917
; terminated with $FF
1918
wMissableObjectList:: ds 16 * 2 + 1
1919
1920
ds 1
1921
1922
wGameProgressFlags::
1923
wOaksLabCurScript:: db
1924
wPalletTownCurScript:: db
1925
ds 1
1926
wBluesHouseCurScript:: db
1927
wViridianCityCurScript:: db
1928
ds 2
1929
wPewterCityCurScript:: db
1930
wRoute3CurScript:: db
1931
wRoute4CurScript:: db
1932
ds 1
1933
wViridianGymCurScript:: db
1934
wPewterGymCurScript:: db
1935
wCeruleanGymCurScript:: db
1936
wVermilionGymCurScript:: db
1937
wCeladonGymCurScript:: db
1938
wRoute6CurScript:: db
1939
wRoute8CurScript:: db
1940
wRoute24CurScript:: db
1941
wRoute25CurScript:: db
1942
wRoute9CurScript:: db
1943
wRoute10CurScript:: db
1944
wMtMoon1FCurScript:: db
1945
wMtMoonB2FCurScript:: db
1946
wSSAnne1FRoomsCurScript:: db
1947
wSSAnne2FRoomsCurScript:: db
1948
wRoute22CurScript:: db
1949
ds 1
1950
wRedsHouse2FCurScript:: db
1951
wViridianMartCurScript:: db
1952
wRoute22GateCurScript:: db
1953
wCeruleanCityCurScript:: db
1954
ds 7
1955
wSSAnneBowCurScript:: db
1956
wViridianForestCurScript:: db
1957
wMuseum1FCurScript:: db
1958
wRoute13CurScript:: db
1959
wRoute14CurScript:: db
1960
wRoute17CurScript:: db
1961
wRoute19CurScript:: db
1962
wRoute21CurScript:: db
1963
wSafariZoneGateCurScript:: db
1964
wRockTunnelB1FCurScript:: db
1965
wRockTunnel1FCurScript:: db
1966
ds 1
1967
wRoute11CurScript:: db
1968
wRoute12CurScript:: db
1969
wRoute15CurScript:: db
1970
wRoute16CurScript:: db
1971
wRoute18CurScript:: db
1972
wRoute20CurScript:: db
1973
wSSAnneB1FRoomsCurScript:: db
1974
wVermilionCityCurScript:: db
1975
wPokemonTower2FCurScript:: db
1976
wPokemonTower3FCurScript:: db
1977
wPokemonTower4FCurScript:: db
1978
wPokemonTower5FCurScript:: db
1979
wPokemonTower6FCurScript:: db
1980
wPokemonTower7FCurScript:: db
1981
wRocketHideoutB1FCurScript:: db
1982
wRocketHideoutB2FCurScript:: db
1983
wRocketHideoutB3FCurScript:: db
1984
wRocketHideoutB4FCurScript:: db
1985
ds 1
1986
wRoute6GateCurScript:: db
1987
wRoute8GateCurScript:: db
1988
ds 1
1989
wCinnabarIslandCurScript:: db
1990
wPokemonMansion1FCurScript:: db
1991
ds 1
1992
wPokemonMansion2FCurScript:: db
1993
wPokemonMansion3FCurScript:: db
1994
wPokemonMansionB1FCurScript:: db
1995
wVictoryRoad2FCurScript:: db
1996
wVictoryRoad3FCurScript:: db
1997
ds 1
1998
wFightingDojoCurScript:: db
1999
wSilphCo2FCurScript:: db
2000
wSilphCo3FCurScript:: db
2001
wSilphCo4FCurScript:: db
2002
wSilphCo5FCurScript:: db
2003
wSilphCo6FCurScript:: db
2004
wSilphCo7FCurScript:: db
2005
wSilphCo8FCurScript:: db
2006
wSilphCo9FCurScript:: db
2007
wHallOfFameCurScript:: db
2008
wChampionsRoomCurScript:: db
2009
wLoreleisRoomCurScript:: db
2010
wBrunosRoomCurScript:: db
2011
wAgathasRoomCurScript:: db
2012
wCeruleanCaveB1FCurScript:: db
2013
wVictoryRoad1FCurScript:: db
2014
ds 1
2015
wLancesRoomCurScript:: db
2016
ds 4
2017
wSilphCo10FCurScript:: db
2018
wSilphCo11FCurScript:: db
2019
ds 1
2020
wFuchsiaGymCurScript:: db
2021
wSaffronGymCurScript:: db
2022
ds 1
2023
wCinnabarGymCurScript:: db
2024
wGameCornerCurScript:: db
2025
wRoute16Gate1FCurScript:: db
2026
wBillsHouseCurScript:: db
2027
wRoute5GateCurScript:: db
2028
wPowerPlantCurScript:: ; overload
2029
wRoute7GateCurScript:: db
2030
ds 1
2031
wSSAnne2FCurScript:: db
2032
wSeafoamIslandsB3FCurScript:: db
2033
wRoute23CurScript:: db
2034
wSeafoamIslandsB4FCurScript:: db
2035
wRoute18Gate1FCurScript:: db
2036
ds 78
2037
wGameProgressFlagsEnd::
2038
2039
ds 56
2040
2041
wObtainedHiddenItemsFlags:: flag_array MAX_HIDDEN_ITEMS
2042
2043
wObtainedHiddenCoinsFlags:: flag_array MAX_HIDDEN_COINS
2044
2045
; $00 = walking
2046
; $01 = biking
2047
; $02 = surfing
2048
wWalkBikeSurfState:: db
2049
2050
ds 10
2051
2052
wTownVisitedFlag:: flag_array NUM_CITY_MAPS
2053
2054
; starts at 502
2055
wSafariSteps:: dw
2056
2057
; item given to cinnabar lab
2058
wFossilItem:: db
2059
; mon that will result from the item
2060
wFossilMon:: db
2061
2062
ds 2
2063
2064
; trainer classes start at OPP_ID_OFFSET
2065
wEnemyMonOrTrainerClass:: db
2066
2067
wPlayerJumpingYScreenCoordsIndex:: db
2068
2069
wRivalStarter:: db
2070
2071
ds 1
2072
2073
wPlayerStarter:: db
2074
2075
; sprite index of the boulder the player is trying to push
2076
wBoulderSpriteIndex:: db
2077
2078
wLastBlackoutMap:: db
2079
2080
; destination map (for certain types of special warps, not ordinary walking)
2081
wDestinationMap:: db
2082
2083
; initialized to $ff, but nothing ever reads it
2084
wUnusedPlayerDataByte:: db
2085
2086
; used to store the tile in front of the boulder when trying to push a boulder
2087
; also used to store the result of the collision check ($ff for a collision and $00 for no collision)
2088
wTileInFrontOfBoulderAndBoulderCollisionResult:: db
2089
2090
; destination map for dungeon warps
2091
wDungeonWarpDestinationMap:: db
2092
2093
; which dungeon warp within the source map was used
2094
wWhichDungeonWarp:: db
2095
2096
wUnusedCardKeyGateID:: db
2097
2098
ds 8
2099
2100
wStatusFlags1:: db
2101
ds 1
2102
wBeatGymFlags:: db ; redundant because it matches wObtainedBadges
2103
ds 1
2104
wStatusFlags2:: db
2105
wCableClubDestinationMap::
2106
wStatusFlags3:: db
2107
wStatusFlags4:: db
2108
ds 1
2109
wStatusFlags5:: db
2110
ds 1
2111
wStatusFlags6:: db
2112
wStatusFlags7:: db
2113
wElite4Flags:: db
2114
ds 1
2115
wMovementFlags:: db
2116
2117
wCompletedInGameTradeFlags:: dw
2118
2119
ds 2
2120
2121
wWarpedFromWhichWarp:: db
2122
wWarpedFromWhichMap:: db
2123
2124
ds 2
2125
2126
wCardKeyDoorY:: db
2127
wCardKeyDoorX:: db
2128
2129
ds 2
2130
2131
wFirstLockTrashCanIndex:: db
2132
wSecondLockTrashCanIndex:: db
2133
2134
ds 2
2135
2136
wEventFlags:: flag_array NUM_EVENTS
2137
2138
2139
UNION
2140
wGrassRate:: db
2141
wGrassMons:: ds WILDDATA_LENGTH - 1
2142
2143
ds 8
2144
2145
wWaterRate:: db
2146
wWaterMons:: ds WILDDATA_LENGTH - 1
2147
2148
NEXTU
2149
; linked game's trainer name
2150
wLinkEnemyTrainerName:: ds NAME_LENGTH
2151
2152
ds 1
2153
2154
wSerialEnemyDataBlock:: ; ds $1a8
2155
2156
ds 9
2157
2158
wEnemyPartyCount:: db
2159
wEnemyPartySpecies:: ds PARTY_LENGTH + 1
2160
2161
wEnemyMons::
2162
; wEnemyMon1 - wEnemyMon6
2163
FOR n, 1, PARTY_LENGTH + 1
2164
wEnemyMon{d:n}:: party_struct wEnemyMon{d:n}
2165
ENDR
2166
2167
wEnemyMonOT::
2168
; wEnemyMon1OT - wEnemyMon6OT
2169
FOR n, 1, PARTY_LENGTH + 1
2170
wEnemyMon{d:n}OT:: ds NAME_LENGTH
2171
ENDR
2172
2173
wEnemyMonNicks::
2174
; wEnemyMon1Nick - wEnemyMon6Nick
2175
FOR n, 1, PARTY_LENGTH + 1
2176
wEnemyMon{d:n}Nick:: ds NAME_LENGTH
2177
ENDR
2178
2179
ENDU
2180
2181
2182
wTrainerHeaderPtr:: dw
2183
2184
ds 6
2185
2186
; the trainer the player must face after getting a wrong answer in the Cinnabar
2187
; gym quiz
2188
wOpponentAfterWrongAnswer:: db
2189
2190
; index of current map script, mostly used as index for function pointer array
2191
; mostly copied from map-specific map script pointer and written back later
2192
wCurMapScript:: db
2193
2194
ds 7
2195
2196
wPlayTimeHours:: db
2197
wPlayTimeMaxed:: db
2198
wPlayTimeMinutes:: db
2199
wPlayTimeSeconds:: db
2200
wPlayTimeFrames:: db
2201
2202
wSafariZoneGameOver:: db
2203
2204
wNumSafariBalls:: db
2205
2206
2207
; 0 if no pokemon is in the daycare
2208
; 1 if pokemon is in the daycare
2209
wDayCareInUse:: db
2210
2211
wDayCareMonName:: ds NAME_LENGTH
2212
wDayCareMonOT:: ds NAME_LENGTH
2213
2214
wDayCareMon:: box_struct wDayCareMon
2215
2216
wMainDataEnd::
2217
2218
2219
SECTION "Current Box Data", WRAM0
2220
2221
wBoxDataStart::
2222
2223
wBoxCount:: db
2224
wBoxSpecies:: ds MONS_PER_BOX + 1
2225
2226
wBoxMons::
2227
; wBoxMon1 - wBoxMon20
2228
FOR n, 1, MONS_PER_BOX + 1
2229
wBoxMon{d:n}:: box_struct wBoxMon{d:n}
2230
ENDR
2231
2232
wBoxMonOT::
2233
; wBoxMon1OT - wBoxMon20OT
2234
FOR n, 1, MONS_PER_BOX + 1
2235
wBoxMon{d:n}OT:: ds NAME_LENGTH
2236
ENDR
2237
2238
wBoxMonNicks::
2239
; wBoxMon1Nick - wBoxMon20Nick
2240
FOR n, 1, MONS_PER_BOX + 1
2241
wBoxMon{d:n}Nick:: ds NAME_LENGTH
2242
ENDR
2243
wBoxMonNicksEnd::
2244
2245
wBoxDataEnd::
2246
2247
2248
SECTION "Stack", WRAM0
2249
2250
; the stack grows downward
2251
ds $100 - 1
2252
wStack:: db
2253
2254
ENDSECTION
2255
2256