-
Notifications
You must be signed in to change notification settings - Fork 1
/
wram.asm
3262 lines (2718 loc) · 62.5 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 "Stack", WRAM0
wStackBottom::
ds $100 - 1
wStack::
wStackTop::
ds 1
SECTION "Audio RAM", WRAM0
wMusic::
; nonzero if playing
wMusicPlaying:: db
wChannels::
wChannel1:: channel_struct wChannel1
wChannel2:: channel_struct wChannel2
wChannel3:: channel_struct wChannel3
wChannel4:: channel_struct wChannel4
wSFXChannels::
wChannel5:: channel_struct wChannel5
wChannel6:: channel_struct wChannel6
wChannel7:: channel_struct wChannel7
wChannel8:: channel_struct wChannel8
ds 1
wCurTrackDuty:: db
wCurTrackIntensity:: db
wCurTrackFrequency:: dw
wUnusedBCDNumber:: db ; BCD value, dummied out
wCurNoteDuration:: db ; used in MusicE0 and LoadNote
wCurMusicByte:: db
wCurChannel:: db
wVolume::
; corresponds to rNR50
; Channel control / ON-OFF / Volume (R/W)
; bit 7 - Vin->SO2 ON/OFF
; bit 6-4 - SO2 output level (volume) (# 0-7)
; bit 3 - Vin->SO1 ON/OFF
; bit 2-0 - SO1 output level (volume) (# 0-7)
db
wSoundOutput::
; corresponds to rNR51
; bit 4-7: ch1-4 so2 on/off
; bit 0-3: ch1-4 so1 on/off
db
wSoundInput::
; corresponds to rNR52
; bit 7: global on/off
; bit 0: ch1 on/off
; bit 1: ch2 on/off
; bit 2: ch3 on/off
; bit 3: ch4 on/off
db
wMusicID:: dw
wMusicBank:: db
wNoiseSampleAddress:: dw
wNoiseSampleDelay:: db
ds 1
wMusicNoiseSampleSet:: db
wSFXNoiseSampleSet:: db
wLowHealthAlarm::
; bit 7: on/off
; bit 4: pitch
; bit 0-3: counter
db
wMusicFade::
; fades volume over x frames
; bit 7: fade in/out
; bit 0-5: number of frames for each volume level
; $00 = none (default)
db
wMusicFadeCount:: db
wMusicFadeID:: dw
ds 5
wCryPitch:: dw
wCryLength:: dw
wLastVolume:: db
wUnusedMusicF9Flag:: db
wSFXPriority::
; if nonzero, turn off music when playing sfx
db
ds 1
wChannel1JumpCondition:: db
wChannel2JumpCondition:: db
wChannel3JumpCondition:: db
wChannel4JumpCondition:: db
wStereoPanningMask:: db
wCryTracks::
; plays only in left or right track depending on what side the monster is on
; both tracks active outside of battle
db
wSFXDuration:: db
wCurSFX::
; id of sfx currently playing
db
wChannelsEnd::
wMapMusic:: db
wDontPlayMapMusicOnReload:: db
wMusicEnd::
SECTION "WRAM", WRAM0
wLZAddress:: dw
wLZBank:: db
ds 1
wBoxAlignment:: db
wInputType:: db
wAutoInputAddress:: dw
wAutoInputBank:: db
wAutoInputLength:: db
wDebugFlags:: db
wGameLogicPaused:: db
wSpriteUpdatesEnabled:: db
ds 1
wMapTimeOfDay:: db
ds 3
wPrinterConnectionOpen:: db
wPrinterOpcode:: db
ds 1
wDisableTextAcceleration:: db
wPrevLandmark:: db
wCurLandmark:: db
wLandmarkSignTimer:: dw
wLinkMode::
; a LINK_* value for the link type
db
wScriptVar:: db
wPlayerNextMovement:: db
wPlayerMovement:: db
ds 2
wc2e2::
wMovementObject::
db
wMovementDataBank:: db
wMovementDataAddress:: dw
wc2e6:: ds 4
wMovementByteWasControlSwitch:: db
wMovementPointer:: dw
ds 3
wTempObjectCopyMapObjectIndex:: db
wTempObjectCopySprite:: db
wTempObjectCopySpriteVTile:: db
wTempObjectCopyPalette:: db
wTempObjectCopyMovement:: db
wTempObjectCopyRange:: db
wTempObjectCopyX:: db
wTempObjectCopyY:: db
wTempObjectCopyRadius:: db
wForceEncounter:: db
wTileDown:: db
wTileUp:: db
wTileLeft:: db
wTileRight:: db
wTilePermissions::
; set if tile behavior prevents
; you from walking in that direction
; bit 3: down
; bit 2: up
; bit 1: left
; bit 0: right
db
wSpinning:: db
SECTION "wSpriteAnims", WRAM0
UNION
; wSpriteAnimDict is a 10x2 dictionary
; keys: taken from third column of SpriteAnimSeqData
; values: vTiles
wSpriteAnimDict:: ds 10 * 2
wSpriteAnimationStructs::
; field 0: index
; fields 1-3: loaded from SpriteAnimSeqData
wSpriteAnim1:: sprite_anim_struct wSpriteAnim1
wSpriteAnim2:: sprite_anim_struct wSpriteAnim2
wSpriteAnim3:: sprite_anim_struct wSpriteAnim3
wSpriteAnim4:: sprite_anim_struct wSpriteAnim4
wSpriteAnim5:: sprite_anim_struct wSpriteAnim5
wSpriteAnim6:: sprite_anim_struct wSpriteAnim6
wSpriteAnim7:: sprite_anim_struct wSpriteAnim7
wSpriteAnim8:: sprite_anim_struct wSpriteAnim8
wSpriteAnim9:: sprite_anim_struct wSpriteAnim9
wSpriteAnim10:: sprite_anim_struct wSpriteAnim10
wSpriteAnimationStructsEnd::
NEXTU
; mobile data
wc300:: ds 1
wc301:: ds 1
wc302:: ds 1
wc303:: ds 2
wc305:: ds 1
wc306:: ds 1
wc307:: ds 1
wc308:: ds 1
wc309:: ds 1
wc30a:: ds 1
wc30b:: ds 1
wc30c:: ds 1
wc30d:: ds 1
wc30e:: ds 1
wc30f:: ds 1
wc310:: ds 1
wc311:: ds 1
wc312:: ds 1
wc313:: ds 1
wc314:: ds 152
wc3ac:: ds 8
ENDU
wSpriteAnimCount:: db
wCurSpriteOAMAddr:: db
wCurIcon:: db
wCurIconTile:: db
wSpriteAnimAddrBackup::
wSpriteAnimIDBuffer::
wCurSpriteOAMFlags::
dw
wCurAnimVTile:: db
wCurAnimXCoord:: db
wCurAnimYCoord:: db
wCurAnimXOffset:: db
wCurAnimYOffset:: db
wGlobalAnimYOffset:: db
wGlobalAnimXOffset:: db
wSpriteAnimsEnd::
ds 10
wBattleEnvironment:: db
; mobile data
wc3cc:: ds 1
wc3cd:: ds 31
wc3ec:: ds 1
wc3ed:: ds 1
wc3ee:: ds 1
wc3ef:: ds 1
wc3f0:: ds 1
wc3f1:: ds 1
wc3f2:: ds 1
wc3f3:: ds 1
wc3f4:: ds 1
wc3f5:: ds 1
wc3f6:: ds 1
wc3f7:: ds 1
wc3f8:: ds 1
wc3f9:: ds 1
wc3fa:: ds 1
wc3fb:: ds 1
wc3fc:: ds 1
ds 3
SECTION "Sprites", WRAM0
wVirtualOAM::
wVirtualOAMSprite00:: sprite_oam_struct wVirtualOAMSprite00
wVirtualOAMSprite01:: sprite_oam_struct wVirtualOAMSprite01
wVirtualOAMSprite02:: sprite_oam_struct wVirtualOAMSprite02
wVirtualOAMSprite03:: sprite_oam_struct wVirtualOAMSprite03
wVirtualOAMSprite04:: sprite_oam_struct wVirtualOAMSprite04
wVirtualOAMSprite05:: sprite_oam_struct wVirtualOAMSprite05
wVirtualOAMSprite06:: sprite_oam_struct wVirtualOAMSprite06
wVirtualOAMSprite07:: sprite_oam_struct wVirtualOAMSprite07
wVirtualOAMSprite08:: sprite_oam_struct wVirtualOAMSprite08
wVirtualOAMSprite09:: sprite_oam_struct wVirtualOAMSprite09
wVirtualOAMSprite10:: sprite_oam_struct wVirtualOAMSprite10
wVirtualOAMSprite11:: sprite_oam_struct wVirtualOAMSprite11
wVirtualOAMSprite12:: sprite_oam_struct wVirtualOAMSprite12
wVirtualOAMSprite13:: sprite_oam_struct wVirtualOAMSprite13
wVirtualOAMSprite14:: sprite_oam_struct wVirtualOAMSprite14
wVirtualOAMSprite15:: sprite_oam_struct wVirtualOAMSprite15
wVirtualOAMSprite16:: sprite_oam_struct wVirtualOAMSprite16
wVirtualOAMSprite17:: sprite_oam_struct wVirtualOAMSprite17
wVirtualOAMSprite18:: sprite_oam_struct wVirtualOAMSprite18
wVirtualOAMSprite19:: sprite_oam_struct wVirtualOAMSprite19
wVirtualOAMSprite20:: sprite_oam_struct wVirtualOAMSprite20
wVirtualOAMSprite21:: sprite_oam_struct wVirtualOAMSprite21
wVirtualOAMSprite22:: sprite_oam_struct wVirtualOAMSprite22
wVirtualOAMSprite23:: sprite_oam_struct wVirtualOAMSprite23
wVirtualOAMSprite24:: sprite_oam_struct wVirtualOAMSprite24
wVirtualOAMSprite25:: sprite_oam_struct wVirtualOAMSprite25
wVirtualOAMSprite26:: sprite_oam_struct wVirtualOAMSprite26
wVirtualOAMSprite27:: sprite_oam_struct wVirtualOAMSprite27
wVirtualOAMSprite28:: sprite_oam_struct wVirtualOAMSprite28
wVirtualOAMSprite29:: sprite_oam_struct wVirtualOAMSprite29
wVirtualOAMSprite30:: sprite_oam_struct wVirtualOAMSprite30
wVirtualOAMSprite31:: sprite_oam_struct wVirtualOAMSprite31
wVirtualOAMSprite32:: sprite_oam_struct wVirtualOAMSprite32
wVirtualOAMSprite33:: sprite_oam_struct wVirtualOAMSprite33
wVirtualOAMSprite34:: sprite_oam_struct wVirtualOAMSprite34
wVirtualOAMSprite35:: sprite_oam_struct wVirtualOAMSprite35
wVirtualOAMSprite36:: sprite_oam_struct wVirtualOAMSprite36
wVirtualOAMSprite37:: sprite_oam_struct wVirtualOAMSprite37
wVirtualOAMSprite38:: sprite_oam_struct wVirtualOAMSprite38
wVirtualOAMSprite39:: sprite_oam_struct wVirtualOAMSprite39
wVirtualOAMEnd::
SECTION "Tilemap", WRAM0
wTileMap::
; 20x18 grid of 8x8 tiles
ds SCREEN_WIDTH * SCREEN_HEIGHT
wTileMapEnd::
SECTION "Miscellaneous", WRAM0
; This union spans 480 bytes from c608 to c7e8.
UNION
; surrounding tiles
; This buffer determines the size for the rest of the union;
; it uses exactly 480 bytes.
wSurroundingTiles:: ds SURROUNDING_WIDTH * SURROUNDING_HEIGHT
NEXTU
; box save buffer
; SaveBoxAddress uses this buffer in three steps because it
; needs more space than the buffer can hold.
wBoxPartialData:: ds 480
wBoxPartialDataEnd::
NEXTU
; battle tower temp struct
wBT_OTTemp:: battle_tower_struct wBT_OTTemp
NEXTU
; battle data
wBattle::
wEnemyMoveStruct:: move_struct wEnemyMoveStruct
wPlayerMoveStruct:: move_struct wPlayerMoveStruct
wEnemyMonNick:: ds MON_NAME_LENGTH
wBattleMonNick:: ds MON_NAME_LENGTH
wBattleMon:: battle_struct wBattleMon
wPlayerTauntCount:: db
wEnemyTauntCount:: db
wWildMon:: db
ds 1
wEnemyTrainerItem1:: db
wEnemyTrainerItem2:: db
wEnemyTrainerBaseReward:: db
wEnemyTrainerAIFlags:: ds 3
wOTClassName:: ds TRAINER_CLASS_NAME_LENGTH
wCurOTMon:: db
wBattleParticipantsNotFainted::
; Bit array. Bits 0 - 5 correspond to party members 1 - 6.
; Bit set if the mon appears in battle.
; Bit cleared if the mon faints.
; Backed up if the enemy switches.
; All bits cleared if the enemy faints.
db
wTypeModifier::
; >10: super-effective
; 10: normal
; <10: not very effective
; bit 7: stab
db
wCriticalHit::
; 0 if not critical
; 1 for a critical hit
; 2 for a OHKO
db
wAttackMissed::
; nonzero for a miss
db
wPlayerSubStatus1::
; bit
; 7 in love
; 6 rollout
; 5 endure
; 4 perish song
; 3 identified
; 2 protect
; 1 curse
; 0 nightmare
db
wPlayerSubStatus2::
; bit
; 7
; 6
; 5 flinched
; 4 damaged this turn (for assurance)
; 3 roosting
; 2 charged last turn
; 1 charged
; 0 curled
db
wPlayerSubStatus3::
; bit
; 7 confused
; 6 flying
; 5 underground
; 4 charged
; 3 diving
; 2 in loop
; 1 rampage
; 0 bide
db
wPlayerSubStatus4::
; bit
; 7 leech seed
; 6 rage
; 5 recharge
; 4 substitute
; 3
; 2 focus energy
; 1 mist
; 0 x accuracy
db
wPlayerSubStatus5::
; bit
; 7 can't run
; 6 destiny bond
; 5 lock-on
; 4 encored
; 3 transformed
; 2 aqua ring
; 1
; 0 toxic
db
wEnemySubStatus1::
; see wPlayerSubStatus1
db
wEnemySubStatus2::
; see wPlayerSubStatus2
db
wEnemySubStatus3::
; see wPlayerSubStatus3
db
wEnemySubStatus4::
; see wPlayerSubStatus4
db
wEnemySubStatus5::
; see wPlayerSubStatus5
db
wPlayerRolloutCount:: db
wPlayerConfuseCount:: db
wPlayerToxicCount:: db
wPlayerDisableCount:: db
wPlayerEncoreCount:: db
wPlayerPerishCount:: db
wPlayerFuryCutterCount:: db
wPlayerProtectCount:: db
wEnemyRolloutCount:: db
wEnemyConfuseCount:: db
wEnemyToxicCount:: db
wEnemyDisableCount:: db
wEnemyEncoreCount:: db
wEnemyPerishCount:: db
wEnemyFuryCutterCount:: db
wEnemyProtectCount:: db
wPlayerDamageTaken:: dw
wEnemyDamageTaken:: dw
wBattleReward:: ds 3
wBattleAnimParam::
wKickCounter::
wPresentPower::
db
wBattleScriptBuffer:: ds 40
wBattleScriptBufferAddress:: dw
wTurnEnded:: db
ds 1
wPlayerStats::
wPlayerAttack:: dw
wPlayerDefense:: dw
wPlayerSpeed:: dw
wPlayerSpAtk:: dw
wPlayerSpDef:: dw
ds 1
wEnemyStats::
wEnemyAttack:: dw
wEnemyDefense:: dw
wEnemySpeed:: dw
wEnemySpAtk:: dw
wEnemySpDef:: dw
ds 1
wPlayerStatLevels::
; 07 neutral
wPlayerAtkLevel:: db
wPlayerDefLevel:: db
wPlayerSpdLevel:: db
wPlayerSAtkLevel:: db
wPlayerSDefLevel:: db
wPlayerAccLevel:: db
wPlayerEvaLevel:: db
ds 1
wPlayerStatLevelsEnd::
wEnemyStatLevels::
; 07 neutral
wEnemyAtkLevel:: db
wEnemyDefLevel:: db
wEnemySpdLevel:: db
wEnemySAtkLevel:: db
wEnemySDefLevel:: db
wEnemyAccLevel:: db
wEnemyEvaLevel:: db
ds 1
wEnemyTurnsTaken:: db
wPlayerTurnsTaken:: db
ds 1
wPlayerSubstituteHP:: db
wEnemySubstituteHP:: db
wUnusedPlayerLockedMove:: db
ds 1
wCurPlayerMove:: db
wCurEnemyMove:: db
wLinkBattleRNCount::
; how far through the prng stream
db
wEnemyItemState:: db
ds 2
wCurEnemyMoveNum:: db
wEnemyHPAtTimeOfPlayerSwitch:: dw
wPayDayMoney:: ds 3
wSafariMonAngerCount:: db
wSafariMonEating:: db
ds 1
wEnemyBackupDVs:: dw ; used when enemy is transformed
wAlreadyDisobeyed:: db
wDisabledMove:: db
wEnemyDisabledMove:: db
wWhichMonFaintedFirst:: db
; exists so you can't counter on switch
wLastPlayerCounterMove:: db
wLastEnemyCounterMove:: db
wEnemyMinimized:: db
wAlreadyPerformed:: db
wBattleParticipantsIncludingFainted:: db
wBattleLowHealthAlarm:: db
wPlayerMinimized:: db
wPlayerScreens::
; bit
; 7
; 6
; 5
; 4 reflect
; 3 light screen
; 2 safeguard
; 1
; 0 spikes
db
wEnemyScreens::
; see wPlayerScreens
db
wPlayerSafeguardCount:: db
wPlayerLightScreenCount:: db
wPlayerReflectCount:: db
wPlayerKnockOff:: db
wEnemySafeguardCount:: db
wEnemyLightScreenCount:: db
wEnemyReflectCount:: db
wEnemyKnockOff:: db
ds 1
wBattleWeather::
; 00 normal
; 01 rain
; 02 sun
; 03 sandstorm
; 04 rain stopped
; 05 sunliight faded
; 06 sandstorm subsided
db
wWeatherCount::
; # turns remaining
db
wLoweredStat:: db
wEffectFailed:: db
wFailedMessage:: db
wEnemyGoesFirst:: db
wPlayerIsSwitching:: db
wEnemyIsSwitching:: db
wPlayerUsedMoves::
; add a move that has been used once by the player
; added in order of use
ds NUM_MOVES
wEnemyAISwitchScore:: db
wEnemySwitchMonParam:: db
wEnemySwitchMonIndex:: db
wTempLevel:: db
wLastPlayerMon:: db
wLastPlayerMove:: db
wLastEnemyMove:: db
wPlayerFutureSightCount:: db
wEnemyFutureSightCount:: db
wGivingExperienceToExpShareHolders:: db
wBackupEnemyMonBaseStats:: ds 5
wBackupEnemyMonCatchRate:: db
wBackupEnemyMonBaseExp:: db
wPlayerFutureSightDamage:: dw
wEnemyFutureSightDamage:: dw
wPlayerRageCounter:: db
wEnemyRageCounter:: db
wBeatUpHitAtLeastOnce:: db
wPlayerTrappingMove:: db
wEnemyTrappingMove:: db
wPlayerWrapCount:: db
wEnemyWrapCount:: db
wPlayerCharging:: db
wEnemyCharging:: db
wBattleEnded:: db
wWildMonMoves:: ds NUM_MOVES
wWildMonPP:: ds NUM_MOVES
wAmuletCoin:: db
wSomeoneIsRampaging:: db
wPlayerJustGotFrozen:: db
wEnemyJustGotFrozen:: db
wFakeTypeMatchupBuffer::
wButtonSortBuffer:: ds 12
wBattleEnd::
NEXTU
; unown puzzle
wUnownPuzzle::
ds 200
wPuzzlePieces:: ds 6 * 6
ds 244
wUnownPuzzleEnd::
NEXTU
; This union spans 200 bytes from c608 to c6d0.
UNION
; timeset temp storage
wTimeSetBuffer::
ds 20
wInitHourBuffer:: db
ds 9
wInitMinuteBuffer:: db
ds 19
wTimeSetBufferEnd::
NEXTU
; hall of fame temp struct
wHallOfFameTemp:: hall_of_fame wHallOfFameTemp
NEXTU
; link engine data
wLink_c608:: ds 10
wc612:: ds 10
NEXTU
; odd egg
wOddEgg:: party_struct wOddEgg
wOddEggName:: ds MON_NAME_LENGTH
wOddEggOTName:: ds NAME_LENGTH
NEXTU
; mobile data
wc608:: ds 53
wc63d:: ds 5
wc642:: ds 5
wc647:: ds 33
wc668:: ds 32
wc688:: ds 2
wc68a:: ds 4
ds 66
ENDU
; This union spans 280 bytes from c6d0 to c7e8.
UNION
; pokedex
wPokedexDataStart::
wDexListingScrollOffset:: dw ; offset of the first displayed entry from the start
wDexListingCursor:: db ; Dex cursor
wDexListingEnd:: dw ; Last mon to display
wDexListingHeight:: db ; number of entries displayed at once in the dex listing
wCurDexMode:: db ; Pokedex Mode
wDexSearchMonType1:: db ; first type to search
wDexSearchMonType2:: db ; second type to search
wDexSearchResultCount:: dw
wDexArrowCursorPosIndex:: db
wDexArrowCursorDelayCounter:: db
wDexArrowCursorBlinkCounter:: db
wDexSearchSlowpokeFrame:: db
wUnlockedUnownMode:: db
wDexCurUnownIndex:: db
wDexUnownCount:: db
wDexConvertedMonType:: db ; mon type converted from dex search mon type
wDexListingScrollOffsetBackup:: dw
wDexListingCursorBackup:: db
wBackupDexListingCursor:: db
wBackupDexListingPage:: dw
wDexCurLocation:: db
wPokedexStatus:: db
wPokedexDisplayNumber:: dw
wDexLastSeenIndex:: db ; index into wPokedexSeen containing the last non-zero value
wDexLastSeenValue:: db ; value at index
wDexTempCounter:: dw
wPokedexDataEnd::
wPrevDexEntry:: dw
wPrevDexEntryBackup:: dw
wPrevDexEntryJumptableIndex:: db
wPokedexNameBuffer:: ds MON_NAME_LENGTH
ds 231
NEXTU
wMoveRelearnerSpecies:: dw
wMoveRelearnerLevel:: db
wMoveRelearnerMoveCount:: db
wMoveRelearnerMoveList:: ds 2 * 63
wMoveRelearnerMoveListTerminator:: dw
wMoveRelearnerCursor:: db
wMoveRelearnerScroll:: db
NEXTU
wTextViewerCurrentLine:: db
wTextViewerLineCount:: db
wTextViewerLineTable:: dw
wTextViewerFileName:: ds 13
NEXTU
; pokegear
wPokegearPhoneLoadNameBuffer:: db
wPokegearPhoneCursorPosition:: db
wPokegearPhoneScrollPosition:: db
wPokegearPhoneSelectedPerson:: db
wPokegearPhoneSubmenuCursor:: db
wPokegearMapCursorObjectPointer:: dw
wPokegearMapCursorLandmark:: db
wPokegearMapPlayerIconLandmark:: db
wPokegearRadioChannelBank:: db
wPokegearRadioChannelAddr:: dw
wPokegearRadioMusicPlaying:: db
NEXTU
; trade
wTrademons::
wPlayerTrademon:: trademon wPlayerTrademon
wOTTrademon:: trademon wOTTrademon
wTrademonsEnd::
wTradeAnimAddress:: dw
wLinkPlayer1Name:: ds NAME_LENGTH
wLinkPlayer2Name:: ds NAME_LENGTH
wLinkTradeSendmonSpecies:: db
wLinkTradeGetmonSpecies:: db
NEXTU
; naming screen
wNamingScreenDestinationPointer:: dw
wNamingScreenCurNameLength:: db
wNamingScreenMaxNameLength:: db
wNamingScreenType:: db
wNamingScreenCursorObjectPointer:: dw
wNamingScreenLastCharacter:: db
wNamingScreenStringEntryCoord:: dw
NEXTU
; slot machine
wSlots::
wReel1:: slot_reel wReel1
wReel2:: slot_reel wReel2
wReel3:: slot_reel wReel3
wReel1Stopped:: ds 3
wReel2Stopped:: ds 3
wReel3Stopped:: ds 3
wSlotBias:: db
wSlotBet:: db
wFirstTwoReelsMatching:: db
wFirstTwoReelsMatchingSevens:: db
wSlotMatched:: db
wCurReelStopped:: ds 3
wPayout:: dw
wCurReelXCoord:: db
wCurReelYCoord:: db
ds 2
wSlotBuildingMatch:: db
wSlotsDataEnd::
ds 28
wSlotsEnd::
NEXTU
; card flip
wCardFlip::
wDeck:: ds 24
wDeckEnd::
wCardFlipNumCardsPlayed:: db
wCardFlipFaceUpCard:: db
wDiscardPile:: ds 24
wDiscardPileEnd::
wCardFlipEnd::
NEXTU
; dummy game
wDummyGame::
wDummyGameCards:: ds 9 * 5
wDummyGameCardsEnd::
wDummyGameLastCardPicked:: db
wDummyGameCard1:: db
wDummyGameCard2:: db
wDummyGameCard1Location:: db
wDummyGameCard2Location:: db
wDummyGameNumberTriesRemaining:: db
wDummyGameLastMatches:: ds 5
wDummyGameCounter:: db
wDummyGameNumCardsMatched:: db
wDummyGameEnd::
NEXTU
; mobile data
wc6d0:: ds 56
wc708:: db
wc709:: db
wc70a:: db
wc70b:: db
wc70c:: db
wc70d:: db
wc70e:: db
wc70f:: db
wc710:: db
wc711:: db
wc712:: ds 60
wc74e:: ds 107
wc7b9:: ds 1
wc7ba:: ds 1
wc7bb:: ds 2
wc7bd:: ds 19
wc7d0:: ds 1
wc7d1:: ds 1
wc7d2:: ds 1
wc7d3:: ds 1
wc7d4:: ds 1
ENDU
ENDU
SECTION "Chatty Variables", WRAM0
wChattyOverride:: db ;tells the code not to ask chatty for things. controlled by the ROM
wScriptActive:: db ;set to 0 when done accepting script text or other stuff, if it's still 0 when doing something else then the game assumes the script is dead
wChattySpace:: db ;the amount of space being used up in this textbox
wChattyHPType:: db ;The type chatty hidden power should be
wChattyHPPower:: db ;The power chatty hidden power should be
wChattyChatterMove:: dw ;the move to call with chatter
wCurrentForme:: db
wRequestedBoxSwitch:: db
wTempLoopCounter:: db
wChattyTrainerClass:: db
wChattyTrainerID:: db
wTPPFeatureLock:: db ; set to $ba to lock in TPP-only features
wChattyFlags:: db ; bit 0: enable button tally
ds 2
align 3
wButtonTally::
wButtonTallyA:: db
wButtonTallyB:: db
wButtonTallySelect:: db
wButtonTallyStart:: db
wButtonTallyRight:: db
wButtonTallyLeft:: db
wButtonTallyUp:: db
wButtonTallyDown:: db
SECTION "Overworld Map", WRAM0
UNION
; overworld map blocks
wOverworldMapBlocks:: ds 1300
wOverworldMapBlocksEnd::
NEXTU
; GB Printer screen RAM
wGameboyPrinterRAM::
wGameboyPrinterScreen:: ds SCREEN_HEIGHT * SCREEN_WIDTH
wGameboyPrinterScreenEnd::
NEXTU
; GB Printer data
wGameboyPrinter2bppSource:: ds 40 tiles
wGameboyPrinter2bppSourceEnd::
wca80:: db
wPrinterRowIndex:: db
; Printer data
wPrinterData:: ds 4