forked from pret/pokered
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wram.asm
3163 lines (2353 loc) · 60.3 KB
/
wram.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
INCLUDE "constants.asm"
INCLUDE "macros/wram.asm"
INCLUDE "vram.asm"
SECTION "WRAM", WRAM0
wUnusedC000::
ds 1
wSoundID::
ds 1
wMuteAudioAndPauseMusic::
; bit 7: whether sound has been muted
; all bits: whether the effective is active
; Store 1 to activate effect (any value in the range [1, 127] works).
; All audio is muted and music is paused. Sfx continues playing until it
; ends normally.
; Store 0 to resume music.
ds 1
wDisableChannelOutputWhenSfxEnds::
ds 1
wStereoPanning::
ds 1
wSavedVolume::
ds 1
wChannelCommandPointers::
ds 16
wChannelReturnAddresses::
ds 16
wChannelSoundIDs::
ds 8
wChannelFlags1::
ds 8
wChannelFlags2::
ds 8
wChannelDutyCycles::
ds 8
wChannelDutyCyclePatterns::
ds 8
wChannelVibratoDelayCounters::
; reloaded at the beginning of a note. counts down until the vibrato begins.
ds 8
wChannelVibratoExtents::
ds 8
wChannelVibratoRates::
; high nybble is rate (counter reload value) and low nybble is counter.
; time between applications of vibrato.
ds 8
wChannelFrequencyLowBytes::
ds 8
wChannelVibratoDelayCounterReloadValues::
; delay of the beginning of the vibrato from the start of the note
ds 8
wChannelPitchSlideLengthModifiers::
ds 8
wChannelPitchSlideFrequencySteps::
ds 8
wChannelPitchSlideFrequencyStepsFractionalPart::
ds 8
wChannelPitchSlideCurrentFrequencyFractionalPart::
ds 8
wChannelPitchSlideCurrentFrequencyHighBytes::
ds 8
wChannelPitchSlideCurrentFrequencyLowBytes::
ds 8
wChannelPitchSlideTargetFrequencyHighBytes::
ds 8
wChannelPitchSlideTargetFrequencyLowBytes::
ds 8
wChannelNoteDelayCounters::
; Note delays are stored as 16-bit fixed-point numbers where the integer part
; is 8 bits and the fractional part is 8 bits.
ds 8
wChannelLoopCounters::
ds 8
wChannelNoteSpeeds::
ds 8
wChannelNoteDelayCountersFractionalPart::
ds 8
wChannelOctaves::
ds 8
wChannelVolumes::
; also includes fade for hardware channels that support it
ds 8
wMusicWaveInstrument::
ds 1
wSfxWaveInstrument::
ds 1
wMusicTempo::
ds 2
wSfxTempo::
ds 2
wSfxHeaderPointer::
ds 2
wNewSoundID::
ds 1
wAudioROMBank::
ds 1
wAudioSavedROMBank::
ds 1
wFrequencyModifier::
ds 1
wTempoModifier::
ds 1
ds 13
SECTION "Sprite State Data", WRAM0
wSpriteDataStart::
wSpriteStateData1::
; data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
; player sprite is always sprite 0
; struct fields:
; - 0: picture ID (fixed, loaded at map init)
; - 1: movement status (0: uninitialized, 1: ready, 2: delayed, 3: moving)
; - 2: sprite image index (changed on update, $ff if off screen, includes facing direction, progress in walking animation and a sprite-specific offset)
; - 3: Y screen position delta (-1,0 or 1; added to Y pixels on each walking animation update)
; - 4: Y screen position (in pixels, always 4 pixels above grid which makes sprites appear to be in the center of a tile)
; - 5: X screen position delta (-1,0 or 1; added to field X pixels on each walking animation update)
; - 6: X screen position (in pixels, snaps to grid if not currently walking)
; - 7: intra-animation-frame counter (counting upwards to 4 until animation frame counter is incremented)
; - 8: animation frame counter (increased every 4 updates, hold four states (totalling to 16 walking frames)
; - 9: facing direction ($0: down, $4: up, $8: left, $c: right)
; - A: adjusted Y coordinate
; - B: adjusted X coordinate
; - C: direction of collision
; - D
; - E
; - F
wSpritePlayerStateData1:: spritestatedata1 wSpritePlayerStateData1
wSprite01StateData1:: spritestatedata1 wSprite01StateData1
wSprite02StateData1:: spritestatedata1 wSprite02StateData1
wSprite03StateData1:: spritestatedata1 wSprite03StateData1
wSprite04StateData1:: spritestatedata1 wSprite04StateData1
wSprite05StateData1:: spritestatedata1 wSprite05StateData1
wSprite06StateData1:: spritestatedata1 wSprite06StateData1
wSprite07StateData1:: spritestatedata1 wSprite07StateData1
wSprite08StateData1:: spritestatedata1 wSprite08StateData1
wSprite09StateData1:: spritestatedata1 wSprite09StateData1
wSprite10StateData1:: spritestatedata1 wSprite10StateData1
wSprite11StateData1:: spritestatedata1 wSprite11StateData1
wSprite12StateData1:: spritestatedata1 wSprite12StateData1
wSprite13StateData1:: spritestatedata1 wSprite13StateData1
wSprite14StateData1:: spritestatedata1 wSprite14StateData1
wSprite15StateData1:: spritestatedata1 wSprite15StateData1
wSpriteStateData2::
; more data for all sprites on the current map
; holds info for 16 sprites with $10 bytes each
; player sprite is always sprite 0
; struct fields:
; - 0: walk animation counter (counting from $10 backwards when moving)
; - 1:
; - 2: Y displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
; - 3: X displacement (initialized at 8, supposed to keep moving sprites from moving too far, but bugged)
; - 4: Y position (in 2x2 tile grid steps, topmost 2x2 tile has value 4)
; - 5: X position (in 2x2 tile grid steps, leftmost 2x2 tile has value 4)
; - 6: movement byte 1 (determines whether a sprite can move, $ff:not moving, $fe:random movements, others unknown)
; - 7: (?) (set to $80 when in grass, else $0; may be used to draw grass above the sprite)
; - 8: delay until next movement (counted downwards, movement status is set to ready if reached 0)
; - 9: original facing direction (backed up by DisplayTextIDInit, restored by CloseTextDisplay)
; - A
; - B
; - C
; - D: picture ID
; - E: sprite image base offset (in video ram, player always has value 1, used to compute sprite image index)
; - F
wSpritePlayerStateData2:: spritestatedata2 wSpritePlayerStateData2
wSprite01StateData2:: spritestatedata2 wSprite01StateData2
wSprite02StateData2:: spritestatedata2 wSprite02StateData2
wSprite03StateData2:: spritestatedata2 wSprite03StateData2
wSprite04StateData2:: spritestatedata2 wSprite04StateData2
wSprite05StateData2:: spritestatedata2 wSprite05StateData2
wSprite06StateData2:: spritestatedata2 wSprite06StateData2
wSprite07StateData2:: spritestatedata2 wSprite07StateData2
wSprite08StateData2:: spritestatedata2 wSprite08StateData2
wSprite09StateData2:: spritestatedata2 wSprite09StateData2
wSprite10StateData2:: spritestatedata2 wSprite10StateData2
wSprite11StateData2:: spritestatedata2 wSprite11StateData2
wSprite12StateData2:: spritestatedata2 wSprite12StateData2
wSprite13StateData2:: spritestatedata2 wSprite13StateData2
wSprite14StateData2:: spritestatedata2 wSprite14StateData2
wSprite15StateData2:: spritestatedata2 wSprite15StateData2
wSpriteDataEnd::
SECTION "OAM Buffer", WRAM0
wOAMBuffer::
; buffer for OAM data. Copied to OAM by DMA
ds 4 * 40
wOAMBufferEnd::
wTileMap::
; buffer for tiles that are visible on screen (20 columns by 18 rows)
ds SCREEN_WIDTH * SCREEN_HEIGHT
UNION
wTileMapBackup::
; buffer for temporarily saving and restoring current screen's tiles
; (e.g. if menus are drawn on top)
ds SCREEN_WIDTH * SCREEN_HEIGHT
NEXTU
wSerialPartyMonsPatchList::
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
ds 200
wSerialEnemyMonsPatchList::
; list of indexes to patch with SERIAL_NO_DATA_BYTE after transfer
ds 200
ENDU
ds 80
UNION
wOverworldMap::
ds 1300
wOverworldMapEnd::
NEXTU
wTempPic::
ds 7 * 7 tiles
ENDU
wRedrawRowOrColumnSrcTiles::
; the tiles of the row or column to be redrawn by RedrawRowOrColumn
ds SCREEN_WIDTH * 2
; coordinates of the position of the cursor for the top menu item (id 0)
wTopMenuItemY::
ds 1
wTopMenuItemX::
ds 1
wCurrentMenuItem::
; the id of the currently selected menu item
; the top item has id 0, the one below that has id 1, etc.
; note that the "top item" means the top item currently visible on the screen
; add this value to [wListScrollOffset] to get the item's position within the list
ds 1
wTileBehindCursor::
; the tile that was behind the menu cursor's current location
ds 1
wMaxMenuItem::
; id of the bottom menu item
ds 1
wMenuWatchedKeys::
; bit mask of keys that the menu will respond to
ds 1
wLastMenuItem::
; id of previously selected menu item
ds 1
wPartyAndBillsPCSavedMenuItem::
; It is mainly used by the party menu to remember the cursor position while the
; menu isn't active.
; It is also used to remember the cursor position of mon lists (for the
; withdraw/deposit/release actions) in Bill's PC so that it doesn't get lost
; when you choose a mon from the list and a sub-menu is shown. It's reset when
; you return to the main Bill's PC menu.
ds 1
wBagSavedMenuItem::
; It is used by the bag list to remember the cursor position while the menu
; isn't active.
ds 1
wBattleAndStartSavedMenuItem::
; It is used by the start menu to remember the cursor position while the menu
; isn't active.
; The battle menu uses it so that the cursor position doesn't get lost when
; a sub-menu is shown. It's reset at the start of each battle.
ds 1
wPlayerMoveListIndex::
ds 1
wPlayerMonNumber::
; index in party of currently battling mon
ds 1
wMenuCursorLocation::
; the address of the menu cursor's current location within wTileMap
ds 2
ds 2
wMenuJoypadPollCount::
; how many times should HandleMenuInput poll the joypad state before it returns?
ds 1
wMenuItemToSwap::
; id of menu item selected for swapping (counts from 1) (0 means that no menu item has been selected for swapping)
ds 1
wListScrollOffset::
; offset of the current top menu item from the beginning of the list
; keeps track of what section of the list is on screen
ds 1
wMenuWatchMovingOutOfBounds::
; If non-zero, then when wrapping is disabled and the player tries to go past
; the top or bottom of the menu, return from HandleMenuInput. This is useful for
; menus that have too many items to display at once on the screen because it
; allows the caller to scroll the entire menu up or down when this happens.
ds 1
wTradeCenterPointerTableIndex::
ds 1
ds 1
wTextDest::
; destination pointer for text output
; this variable is written to, but is never read from
ds 2
wDoNotWaitForButtonPressAfterDisplayingText::
; if non-zero, skip waiting for a button press after displaying text in DisplayTextID
ds 1
wSerialSyncAndExchangeNybbleReceiveData::
; the final received nybble is stored here by Serial_SyncAndExchangeNybble
wSerialExchangeNybbleTempReceiveData::
; temporary nybble used by Serial_ExchangeNybble
wLinkMenuSelectionReceiveBuffer::
; two byte buffer
; the received menu selection is stored twice
ds 1
wSerialExchangeNybbleReceiveData::
; the final received nybble is stored here by Serial_ExchangeNybble
ds 1
ds 3
wSerialExchangeNybbleSendData::
; this nybble is sent when using Serial_SyncAndExchangeNybble or Serial_ExchangeNybble
wLinkMenuSelectionSendBuffer::
; two byte buffer
; the menu selection byte is stored twice before sending
ds 5
wLinkTimeoutCounter::
; 1 byte
wUnknownSerialCounter::
; 2 bytes
wEnteringCableClub::
; 1 byte
ds 2
wWhichTradeMonSelectionMenu::
; $00 = player mons
; $01 = enemy mons
wMonDataLocation::
; 0 = player's party
; 1 = enemy party
; 2 = current box
; 3 = daycare
; 4 = in-battle mon
;
; AddPartyMon uses it slightly differently.
; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
; If the entire value is 0, then the player is allowed to name the mon.
ds 1
wMenuWrappingEnabled::
; set to 1 if you can go from the bottom to the top or top to bottom of a menu
; set to 0 if you can't go past the top or bottom of the menu
ds 1
wCheckFor180DegreeTurn::
; whether to check for 180-degree turn (0 = don't, 1 = do)
ds 1
ds 1
wMissableObjectIndex::
ds 1
wPredefID::
ds 1
wPredefRegisters::
ds 6
wTrainerHeaderFlagBit::
ds 1
ds 1
wNPCMovementScriptPointerTableNum::
; which NPC movement script pointer is being used
; 0 if an NPC movement script is not running
ds 1
wNPCMovementScriptBank::
; ROM bank of current NPC movement script
ds 1
ds 2
wUnusedCC5B::
wVermilionDockTileMapBuffer::
; 180 bytes
wOaksAideRewardItemName::
wDexRatingNumMonsSeen::
wFilteredBagItems::
; List of bag items that has been filtered to a certain type of items,
; such as drinks or fossils.
wElevatorWarpMaps::
wMonPartySpritesSavedOAM::
; Saved copy of OAM for the first frame of the animation to make it easy to
; flip back from the second frame.
; $60 bytes
wTrainerCardBlkPacket::
; $40 bytes
wSlotMachineSevenAndBarModeChance::
; If a random number greater than this value is generated, then the player is
; allowed to have three 7 symbols or bar symbols line up.
; So, this value is actually the chance of NOT entering that mode.
; If the slot is lucky, it equals 250, giving a 5/256 (~2%) chance.
; Otherwise, it equals 253, giving a 2/256 (~0.8%) chance.
wHallOfFame::
wBoostExpByExpAll::
wAnimationType::
; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon...
wNPCMovementDirections::
ds 1
wDexRatingNumMonsOwned::
ds 1
wDexRatingText::
ds 1
wSlotMachineSavedROMBank::
; ROM back to return to when the player is done with the slot machine
ds 1
ds 26
wAnimPalette::
ds 1
ds 29
UNION
wNPCMovementDirections2::
ds 10
NEXTU
wSwitchPartyMonTempBuffer::
; temporary buffer when swapping party mon data
ds 49
NEXTU
ds 10
wNumStepsToTake::
; used in Pallet Town scripted movement
ds 1
ENDU
ds 10
wRLEByteCount::
ds 1
wAddedToParty::
; 0 = not added
; 1 = added
wSimulatedJoypadStatesEnd::
; this is the end of the joypad states
; the list starts above this address and extends downwards in memory until here
; overloaded with below labels
wParentMenuItem::
wCanEvolveFlags::
; 1 flag for each party member indicating whether it can evolve
; The purpose of these flags is to track which mons levelled up during the
; current battle at the end of the battle when evolution occurs.
; Other methods of evolution simply set it by calling TryEvolvingMon.
ds 1
wForceEvolution::
ds 1
; if [wAILayer2Encouragement] != 1, the second AI layer is not applied
wAILayer2Encouragement::
ds 1
ds 1
; current HP of player and enemy substitutes
wPlayerSubstituteHP::
ds 1
wEnemySubstituteHP::
ds 1
wTestBattlePlayerSelectedMove::
; The player's selected move during a test battle.
; InitBattleVariables sets it to the move Pound.
ds 1
ds 1
wMoveMenuType::
; 0=regular, 1=mimic, 2=above message box (relearn, heal pp..)
ds 1
wPlayerSelectedMove::
ds 1
wEnemySelectedMove::
ds 1
wLinkBattleRandomNumberListIndex::
ds 1
wAICount::
; number of times remaining that AI action can occur
ds 1
ds 2
wEnemyMoveListIndex::
ds 1
wLastSwitchInEnemyMonHP::
; The enemy mon's HP when it was switched in or when the current player mon
; was switched in, which was more recent.
; It's used to determine the message to print when switching out the player mon.
ds 2
wTotalPayDayMoney::
; total amount of money made using Pay Day during the current battle
ds 3
wSafariEscapeFactor::
ds 1
wSafariBaitFactor::
ds 1
ds 1
wTransformedEnemyMonOriginalDVs::
ds 2
wMonIsDisobedient:: ds 1
wPlayerDisabledMoveNumber:: ds 1
wEnemyDisabledMoveNumber:: ds 1
wInHandlePlayerMonFainted::
; When running in the scope of HandlePlayerMonFainted, it equals 1.
; When running in the scope of HandleEnemyMonFainted, it equals 0.
ds 1
wPlayerUsedMove:: ds 1
wEnemyUsedMove:: ds 1
wEnemyMonMinimized:: ds 1
wMoveDidntMiss:: ds 1
wPartyFoughtCurrentEnemyFlags::
; flags that indicate which party members have fought the current enemy mon
flag_array 6
wLowHealthAlarmDisabled::
; Whether the low health alarm has been disabled due to the player winning the
; battle.
ds 1
wPlayerMonMinimized::
ds 1
ds 13
wLuckySlotHiddenObjectIndex::
wEnemyNumHits::
; number of hits by enemy in attacks like Double Slap, etc.
wEnemyBideAccumulatedDamage::
; the amount of damage accumulated by the enemy while biding (2 bytes)
ds 10
wInGameTradeGiveMonSpecies::
wPlayerMonUnmodifiedLevel::
ds 1
wInGameTradeTextPointerTablePointer::
wPlayerMonUnmodifiedMaxHP::
ds 2
wInGameTradeTextPointerTableIndex::
wPlayerMonUnmodifiedAttack::
ds 1
wInGameTradeGiveMonName::
ds 1
wPlayerMonUnmodifiedDefense::
ds 2
wPlayerMonUnmodifiedSpeed::
ds 2
wPlayerMonUnmodifiedSpecial::
ds 2
; stat modifiers for the player's current pokemon
; value can range from 1 - 13 ($1 to $D)
; 7 is normal
wPlayerMonStatMods::
wPlayerMonAttackMod::
ds 1
wPlayerMonDefenseMod::
ds 1
wPlayerMonSpeedMod::
ds 1
wPlayerMonSpecialMod::
ds 1
wInGameTradeReceiveMonName::
wPlayerMonAccuracyMod::
ds 1
wPlayerMonEvasionMod::
ds 1
ds 2
wPlayerMonStatModsEnd::
ds 1
wEnemyMonUnmodifiedLevel::
ds 1
wEnemyMonUnmodifiedMaxHP::
ds 2
wEnemyMonUnmodifiedAttack::
ds 2
wEnemyMonUnmodifiedDefense::
ds 1
wInGameTradeMonNick::
ds 1
wEnemyMonUnmodifiedSpeed::
ds 2
wEnemyMonUnmodifiedSpecial::
ds 1
wEngagedTrainerClass::
ds 1
wEngagedTrainerSet::
; ds 1
; stat modifiers for the enemy's current pokemon
; value can range from 1 - 13 ($1 to $D)
; 7 is normal
wEnemyMonStatMods::
wEnemyMonAttackMod::
ds 1
wEnemyMonDefenseMod::
ds 1
wEnemyMonSpeedMod::
ds 1
wEnemyMonSpecialMod::
ds 1
wEnemyMonAccuracyMod::
ds 1
wEnemyMonEvasionMod::
ds 1
wInGameTradeReceiveMonSpecies::
ds 1
ds 1
wEnemyMonStatModsEnd::
ds 1
wNPCMovementDirections2Index::
wUnusedCD37::
wFilteredBagItemsCount::
; number of items in wFilteredBagItems list
ds 1
wSimulatedJoypadStatesIndex::
; the next simulated joypad state is at wSimulatedJoypadStatesEnd plus this value minus 1
; 0 if the joypad state is not being simulated
ds 1
wWastedByteCD39::
; written to but nothing ever reads it
ds 1
wWastedByteCD3A::
; written to but nothing ever reads it
ds 1
wOverrideSimulatedJoypadStatesMask::
; mask indicating which real button presses can override simulated ones
; XXX is it ever not 0?
ds 1
ds 1
wFallingObjectsMovementData::
; up to 20 bytes (one byte for each falling object)
wSavedY::
wTempSCX::
wBattleTransitionCircleScreenQuadrantY::
; 0 = upper half (Y < 9)
; 1 = lower half (Y >= 9)
wBattleTransitionCopyTilesOffset::
; 2 bytes
; after 1 row/column has been copied, the offset to the next one to copy from
wInwardSpiralUpdateScreenCounter::
; counts down from 7 so that every time 7 more tiles of the spiral have been
; placed, the tile map buffer is copied to VRAM so that progress is visible
wHoFTeamIndex::
wSSAnneSmokeDriftAmount::
; multiplied by 16 to get the number of times to go right by 2 pixels
wRivalStarterTemp::
wBoxMonCounts::
; 12 bytes
; array of the number of mons in each box
wDexMaxSeenMon::
wPPRestoreItem::
wWereAnyMonsAsleep::
wCanPlaySlots::
wNumShakes::
wDayCareStartLevel::
; the level of the mon at the time it entered day care
wWhichBadge::
wPriceTemp::
; 3-byte BCD number
wTitleMonSpecies::
wPlayerCharacterOAMTile::
wMoveDownSmallStarsOAMCount::
; the number of small stars OAM entries to move down
wChargeMoveNum::
wCoordIndex::
wOptionsTextSpeedCursorX::
wTrainerInfoTextBoxWidthPlus1::
wSwappedMenuItem::
wHoFMonSpecies::
wFieldMoves::
; 4 bytes
; the current mon's field moves
wBadgeNumberTile::
; tile ID of the badge number being drawn
wRodResponse::
; 0 = no bite
; 1 = bite
; 2 = no fish on map
wWhichTownMapLocation::
wStoppingWhichSlotMachineWheel::
; which wheel the player is trying to stop
; 0 = none, 1 = wheel 1, 2 = wheel 2, 3 or greater = wheel 3
wTradedPlayerMonSpecies::
wTradingWhichPlayerMon::
wChangeBoxSavedMapTextPointer::
wFlyAnimUsingCoordList::
wPlayerSpinInPlaceAnimFrameDelay::
wPlayerSpinWhileMovingUpOrDownAnimDeltaY::
wBoxNumString::
wHiddenObjectFunctionArgument::
wWhichTrade::
; which entry from TradeMons to select
wTrainerSpriteOffset::
wUnusedCD3D::
ds 1
wHUDPokeballGfxOffsetX::
; difference in X between the next ball and the current one
wBattleTransitionCircleScreenQuadrantX::
; 0 = left half (X < 10)
; 1 = right half (X >= 10)
wSSAnneSmokeX::
wRivalStarterBallSpriteIndex::
wDayCareNumLevelsGrown::
wOptionsBattleAnimCursorX::
wTrainerInfoTextBoxWidth::
wHoFPartyMonIndex::
wNumCreditsMonsDisplayed::
; the number of credits mons that have been displayed so far
wBadgeNameTile::
; first tile ID of the name being drawn
wFlyLocationsList::
; NUM_CITY_MAPS bytes plus $ff sentinel values at each end
wSlotMachineWheel1Offset::
wTradedEnemyMonSpecies::
wTradingWhichEnemyMon::
wFlyAnimCounter::
wPlayerSpinInPlaceAnimFrameDelayDelta::
wPlayerSpinWhileMovingUpOrDownAnimMaxY::
wHiddenObjectFunctionRomBank::
wTrainerEngageDistance::
ds 1
wHUDGraphicsTiles::
; 3 bytes
wDayCareTotalCost::
; 2-byte BCD number
wJigglypuffFacingDirections::
wOptionsBattleStyleCursorX::
wTrainerInfoTextBoxNextRowOffset::
wHoFMonLevel::
wBadgeOrFaceTiles::
; 8 bytes
; a list of the first tile IDs of each badge or face (depending on whether the
; badge is owned) to be drawn on the trainer screen
wSlotMachineWheel2Offset::
wNameOfPlayerMonToBeTraded::
wFlyAnimBirdSpriteImageIndex::
wPlayerSpinInPlaceAnimFrameDelayEndValue::
wPlayerSpinWhileMovingUpOrDownAnimFrameDelay::
wHiddenObjectIndex::
wTrainerFacingDirection::
ds 1
wHoFMonOrPlayer::
; show mon or show player?
; 0 = mon
; 1 = player
wSlotMachineWheel3Offset::
wPlayerSpinInPlaceAnimSoundID::
wHiddenObjectY::
wTrainerScreenY::
wOptionsCancelCursorX::
ds 1
wDayCarePerLevelCost::
; 2-byte BCD number (always set to $100)
wHoFTeamIndex2::
wHiddenItemOrCoinsIndex::
wTradedPlayerMonOT::
wHiddenObjectX::