-
Notifications
You must be signed in to change notification settings - Fork 20
/
wram.asm
3159 lines (2644 loc) · 65.6 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 ; c100
wChannels::
wChannel1:: channel_struct wChannel1 ; c101
wChannel2:: channel_struct wChannel2 ; c133
wChannel3:: channel_struct wChannel3 ; c165
wChannel4:: channel_struct wChannel4 ; c197
wSFXChannels::
wChannel5:: channel_struct wChannel5 ; c1c9
wChannel6:: channel_struct wChannel6 ; c1fb
wChannel7:: channel_struct wChannel7 ; c22d
wChannel8:: channel_struct wChannel8 ; c25f
ds 1 ; c291
wCurTrackDuty:: db
wCurTrackIntensity:: db
wCurTrackFrequency:: dw
wUnusedBCDNumber:: db ; BCD value, dummied out
wCurNoteDuration:: db ; used in MusicE0 and LoadNote
wCurMusicByte:: db ; c298
wCurChannel:: db ; c299
wVolume:: ; c29a
; 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:: ; c29b
; corresponds to rNR51
; bit 4-7: ch1-4 so2 on/off
; bit 0-3: ch1-4 so1 on/off
db
wSoundInput:: ; c29c
; 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 ; c29d
wMusicBank:: db ; c29f
wNoiseSampleAddress:: dw ; c2a0
wNoiseSampleDelay:: db ; c2a2
ds 1 ; c2a3
wMusicNoiseSampleSet:: db ; c2a4
wSFXNoiseSampleSet:: db ; c2a5
wLowHealthAlarm:: ; c2a6
; bit 7: on/off
; bit 4: pitch
; bit 0-3: counter
db
wMusicFade:: ; c2a7
; 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 ; c2a8
wMusicFadeID:: dw ; c2a9
ds 5
wCryPitch:: dw ; c2b0
wCryLength:: dw ; c2b2
wLastVolume:: db ; c2b4
wUnusedMusicF9Flag:: db ; c2b5
wSFXPriority:: ; c2b6
; if nonzero, turn off music when playing sfx
db
ds 1
wChannel1JumpCondition:: db
wChannel2JumpCondition:: db
wChannel3JumpCondition:: db
wChannel4JumpCondition:: db
wStereoPanningMask:: db ; c2bc
wCryTracks:: ; c2bd
; 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:: ; c2bf
; id of sfx currently playing
db
wChannelsEnd::
wMapMusic:: db ; c2c0
wDontPlayMapMusicOnReload:: db
wMusicEnd::
SECTION "WRAM", WRAM0
wLZAddress:: dw ; c2c2
wLZBank:: db ; c2c4
ds 1
wBoxAlignment:: db
wInputType:: db ; c2c7
wAutoInputAddress:: dw ; c2c8
wAutoInputBank:: db ; c2ca
wAutoInputLength:: db ; c2cb
wDebugFlags:: db
wGameLogicPaused:: db ; c2cd
wSpriteUpdatesEnabled:: db
wUnusedScriptByteBuffer:: db
wMapTimeOfDay:: db
ds 3
wPrinterConnectionOpen:: db
wPrinterOpcode:: db
wPrevDexEntry:: db
wDisableTextAcceleration:: db
wPrevLandmark:: db
wCurLandmark:: db
wLandmarkSignTimer:: dw
wLinkMode::
; a LINK_* value for the link type
db ; c2dc
wScriptVar:: db ; c2dd
wPlayerNextMovement:: db
wPlayerMovement:: db
ds 2
wc2e2::
wMovementObject::
db
wMovementDataBank:: db
wMovementDataAddress:: dw
wc2e6:: ds 4
wMovementByteWasControlSwitch:: db
wMovementPointer:: dw ; c2eb
ds 3
wTempObjectCopyMapObjectIndex:: db ; c2f0
wTempObjectCopySprite:: db ; c2f1
wTempObjectCopySpriteVTile:: db ; c2f2
wTempObjectCopyPalette:: db ; c2f3
wTempObjectCopyMovement:: db ; c2f4
wTempObjectCopyRange:: db ; c2f5
wTempObjectCopyX:: db ; c2f6
wTempObjectCopyY:: db ; c2f7
wTempObjectCopyRadius:: db ; c2f8
ds 1
wTileDown:: db ; c2fa
wTileUp:: db ; c2fb
wTileLeft:: db ; c2fc
wTileRight:: db ; c2fd
wTilePermissions:: ; c2fe
; set if tile behavior prevents
; you from walking in that direction
; bit 3: down
; bit 2: up
; bit 1: left
; bit 0: right
db
ds 1
SECTION "wSpriteAnims", WRAM0
UNION ; c300
; 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 ; c300
; 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 ; c3b4
wSpriteAnimCount:: db
wCurSpriteOAMAddr:: db
wCurIcon:: db ; c3b6
wCurIconTile:: db
wSpriteAnimAddrBackup::
wSpriteAnimIDBuffer::
wCurSpriteOAMFlags::
dw
wCurAnimVTile:: db
wCurAnimXCoord:: db
wCurAnimYCoord:: db
wCurAnimXOffset:: db
wCurAnimYOffset:: db
wGlobalAnimYOffset:: db
wGlobalAnimXOffset:: db
wSpriteAnimsEnd::
ds 11
; 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:: ; c400
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:: ; c4a0
; 20x18 grid of 8x8 tiles
ds SCREEN_WIDTH * SCREEN_HEIGHT
wTileMapEnd::
SECTION "Miscellaneous", WRAM0
; This union spans 480 bytes from c608 to c7e8.
UNION ; c608
; 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 ; c608
; 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 ; c608
; battle tower temp struct
wBT_OTTemp:: battle_tower_struct wBT_OTTemp
NEXTU ; c608
; battle data
wBattle::
wEnemyMoveStruct:: move_struct wEnemyMoveStruct ; c608
wPlayerMoveStruct:: move_struct wPlayerMoveStruct ; c60f
wEnemyMonNick:: ds MON_NAME_LENGTH ; c616
wBattleMonNick:: ds MON_NAME_LENGTH ; c621
wBattleMon:: battle_struct wBattleMon ; c62c
ds 2
wWildMon:: db ; c64e
ds 1
wEnemyTrainerItem1:: db ; c650
wEnemyTrainerItem2:: db ; c651
wEnemyTrainerBaseReward:: db ; c652
wEnemyTrainerAIFlags:: ds 3 ; c653
wOTClassName:: ds TRAINER_CLASS_NAME_LENGTH ; c656
wCurOTMon:: db ; c663
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:: ; c665
; >10: super-effective
; 10: normal
; <10: not very effective
; bit 7: stab
db
wCriticalHit:: ; c666
; 0 if not critical
; 1 for a critical hit
; 2 for a OHKO
db
wAttackMissed:: ; c667
; nonzero for a miss
db
wPlayerSubStatus1:: ; c668
; bit
; 7 in love
; 6 rollout
; 5 endure
; 4 perish song
; 3 identified
; 2 protect
; 1 curse
; 0 nightmare
db
wPlayerSubStatus2:: ; c669
; bit
; 7
; 6
; 5
; 4
; 3
; 2
; 1
; 0 curled
db
wPlayerSubStatus3:: ; c66a
; bit
; 7 confused
; 6 flying
; 5 underground
; 4 charged
; 3 flinched
; 2 in loop
; 1 rampage
; 0 bide
db
wPlayerSubStatus4:: ; c66b
; bit
; 7 leech seed
; 6 rage
; 5 recharge
; 4 substitute
; 3
; 2 focus energy
; 1 mist
; 0 x accuracy
db
wPlayerSubStatus5:: ; c66c
; bit
; 7 can't run
; 6 destiny bond
; 5 lock-on
; 4 encored
; 3 transformed
; 2
; 1
; 0 toxic
db
wEnemySubStatus1:: ; c66d
; see wPlayerSubStatus1
db
wEnemySubStatus2:: ; c66e
; see wPlayerSubStatus2
db
wEnemySubStatus3:: ; c66f
; see wPlayerSubStatus3
db
wEnemySubStatus4:: ; c670
; see wPlayerSubStatus4
db
wEnemySubStatus5:: ; c671
; see wPlayerSubStatus5
db
wPlayerRolloutCount:: db ; c672
wPlayerConfuseCount:: db ; c673
wPlayerToxicCount:: db ; c674
wPlayerDisableCount:: db ; c675
wPlayerEncoreCount:: db ; c676
wPlayerPerishCount:: db ; c677
wPlayerFuryCutterCount:: db ; c678
wPlayerProtectCount:: db ; c679
wEnemyRolloutCount:: db ; c67a
wEnemyConfuseCount:: db ; c67b
wEnemyToxicCount:: db ; c67c
wEnemyDisableCount:: db ; c67d
wEnemyEncoreCount:: db ; c67e
wEnemyPerishCount:: db ; c67f
wEnemyFuryCutterCount:: db ; c680
wEnemyProtectCount:: db ; c681
wPlayerDamageTaken:: dw ; c682
wEnemyDamageTaken:: dw ; c684
wBattleReward:: ds 3 ; c686
wBattleAnimParam::
wKickCounter::
wPresentPower::
db ; c689
wBattleScriptBuffer:: ds 40 ; c68a
wBattleScriptBufferAddress:: dw ; c6b2
wTurnEnded:: db ; c6b4
ds 1
wPlayerStats:: ; c6b6
wPlayerAttack:: dw
wPlayerDefense:: dw
wPlayerSpeed:: dw
wPlayerSpAtk:: dw
wPlayerSpDef:: dw
ds 1
wEnemyStats:: ; c6c1
wEnemyAttack:: dw
wEnemyDefense:: dw
wEnemySpeed:: dw
wEnemySpAtk:: dw
wEnemySpDef:: dw
ds 1
wPlayerStatLevels:: ; c6cc
; 07 neutral
wPlayerAtkLevel:: db ; c6cc
wPlayerDefLevel:: db ; c6cd
wPlayerSpdLevel:: db ; c6ce
wPlayerSAtkLevel:: db ; c6cf
wPlayerSDefLevel:: db ; c6d0
wPlayerAccLevel:: db ; c6d1
wPlayerEvaLevel:: db ; c6d2
ds 1 ; c6d3
wPlayerStatLevelsEnd::
wEnemyStatLevels:: ; c6d4
; 07 neutral
wEnemyAtkLevel:: db ; c6d4
wEnemyDefLevel:: db ; c6d5
wEnemySpdLevel:: db ; c6d6
wEnemySAtkLevel:: db ; c6d7
wEnemySDefLevel:: db ; c6d8
wEnemyAccLevel:: db ; c6d9
wEnemyEvaLevel:: db ; c6da
ds 1
wEnemyTurnsTaken:: db ; c6dc
wPlayerTurnsTaken:: db ; c6dd
ds 1
wPlayerSubstituteHP:: db ; c6df
wEnemySubstituteHP:: db ; c6e0
wUnusedPlayerLockedMove:: db ; c6e1
ds 1
wCurPlayerMove:: db ; c6e3
wCurEnemyMove:: db ; c6e4
wLinkBattleRNCount:: ; c6e5
; how far through the prng stream
db
wEnemyItemState:: db ; c6e6
ds 2
wCurEnemyMoveNum:: db ; c6e9
wEnemyHPAtTimeOfPlayerSwitch:: dw ; c6ea
wPayDayMoney:: ds 3 ; c6ec
wSafariMonAngerCount:: db
wSafariMonEating:: db
ds 1
wEnemyBackupDVs:: dw ; used when enemy is transformed
wAlreadyDisobeyed:: db ; c6f4
wDisabledMove:: db ; c6f5
wEnemyDisabledMove:: db ; c6f6
wWhichMonFaintedFirst:: db
; exists so you can't counter on switch
wLastPlayerCounterMove:: db ; c6f8
wLastEnemyCounterMove:: db ; c6f9
wEnemyMinimized:: db ; c6fa
wAlreadyFailed:: db ; c6fb
wBattleParticipantsIncludingFainted:: db ; c6fc
wBattleLowHealthAlarm:: db ; c6fd
wPlayerMinimized:: db ; c6fe
wPlayerScreens:: ; c6ff
; bit
; 7
; 6
; 5
; 4 reflect
; 3 light screen
; 2 safeguard
; 1
; 0 spikes
db
wEnemyScreens:: ; c700
; see wPlayerScreens
db
wPlayerSafeguardCount:: db ; c701
wPlayerLightScreenCount:: db ; c702
wPlayerReflectCount:: db ; c703
ds 1
wEnemySafeguardCount:: db ; c705
wEnemyLightScreenCount:: db ; c706
wEnemyReflectCount:: db ; c707
ds 2
wBattleWeather:: ; c70a
; 00 normal
; 01 rain
; 02 sun
; 03 sandstorm
; 04 rain stopped
; 05 sunliight faded
; 06 sandstorm subsided
db
wWeatherCount:: ; c70b
; # turns remaining
db
wLoweredStat:: db ; c70c
wEffectFailed:: db ; c70d
wFailedMessage:: db ; c70e
wEnemyGoesFirst:: db ; c70f
wPlayerIsSwitching:: db ; c710
wEnemyIsSwitching:: db ; c711
wPlayerUsedMoves:: ; c712
; add a move that has been used once by the player
; added in order of use
ds NUM_MOVES
wEnemyAISwitchScore:: db ; c716
wEnemySwitchMonParam:: db ; c717
wEnemySwitchMonIndex:: db ; c718
wTempLevel:: db ; c719
wLastPlayerMon:: db ; c71a
wLastPlayerMove:: db ; c71b
wLastEnemyMove:: db ; c71c
wPlayerFutureSightCount:: db ; c71d
wEnemyFutureSightCount:: db ; c71e
wGivingExperienceToExpShareHolders:: db ; c71f
wBackupEnemyMonBaseStats:: ds 5 ; c720
wBackupEnemyMonCatchRate:: db ; c725
wBackupEnemyMonBaseExp:: db ; c726
wPlayerFutureSightDamage:: dw ; c727
wEnemyFutureSightDamage:: dw ; c729
wPlayerRageCounter:: db ; c72b
wEnemyRageCounter:: db ; c72c
wBeatUpHitAtLeastOnce:: db ; c72d
wPlayerTrappingMove:: db ; c72e
wEnemyTrappingMove:: db ; c72f
wPlayerWrapCount:: db ; c730
wEnemyWrapCount:: db ; c731
wPlayerCharging:: db ; c732
wEnemyCharging:: db ; c733
wBattleEnded:: db ; c734
wWildMonMoves:: ds NUM_MOVES ; c735
wWildMonPP:: ds NUM_MOVES ; c739
wAmuletCoin:: db ; c73a
wSomeoneIsRampaging:: db ; c73b
wPlayerJustGotFrozen:: db ; c73c
wEnemyJustGotFrozen:: db ; c73d
wBattleEnd::
NEXTU ; c608
; unown puzzle
wUnownPuzzle::
ds 200
wPuzzlePieces:: ds 6 * 6
ds 244
wUnownPuzzleEnd::
NEXTU ; c608
; This union spans 200 bytes from c608 to c6d0.
UNION ; c608
; timeset temp storage
wTimeSetBuffer::
ds 20
wInitHourBuffer:: db ; c61c
ds 9
wInitMinuteBuffer:: db ; c626
ds 19
wTimeSetBufferEnd::
NEXTU ; c608
; hall of fame temp struct
wHallOfFameTemp:: hall_of_fame wHallOfFameTemp
NEXTU ; c608
; link engine data
wLink_c608:: ds 10
wc612:: ds 10
NEXTU ; c608
; odd egg
wOddEgg:: party_struct wOddEgg
wOddEggName:: ds MON_NAME_LENGTH
wOddEggOTName:: ds NAME_LENGTH
NEXTU ; c608
; 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 ; c6d0
; This union spans 280 bytes from c6d0 to c7e8.
UNION ; c6d0
; pokedex
wPokedexDataStart:: ; c6d0
wPokedexOrder:: ds $100 ; >= NUM_POKEMON
wPokedexOrderEnd::
wDexListingScrollOffset:: db ; offset of the first displayed entry from the start
wDexListingCursor:: db ; Dex cursor
wDexListingEnd:: db ; 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:: db
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:: db
wDexListingCursorBackup:: db
wBackupDexListingCursor:: db
wBackupDexListingPage:: db
wDexCurLocation:: db
wPokedexStatus:: db
wPokedexDataEnd::
ds 2
NEXTU ; c6d0
; pokegear
wPokegearPhoneLoadNameBuffer:: db ; c6d0
wPokegearPhoneCursorPosition:: db ; c6d1
wPokegearPhoneScrollPosition:: db ; c6d2
wPokegearPhoneSelectedPerson:: db ; c6d3
wPokegearPhoneSubmenuCursor:: db ; c6d4
wPokegearMapCursorObjectPointer:: dw ; c6d5
wPokegearMapCursorLandmark:: db ; c6d7
wPokegearMapPlayerIconLandmark:: db ; c6d8
wPokegearRadioChannelBank:: db ; c6d9
wPokegearRadioChannelAddr:: dw ; c6da
wPokegearRadioMusicPlaying:: db ; c6dc
NEXTU ; c6d0
; trade
wTrademons:: ; c6d0
wPlayerTrademon:: trademon wPlayerTrademon
wOTTrademon:: trademon wOTTrademon
wTrademonsEnd::
wTradeAnimAddress:: dw
wLinkPlayer1Name:: ds NAME_LENGTH
wLinkPlayer2Name:: ds NAME_LENGTH
wLinkTradeSendmonSpecies:: db
wLinkTradeGetmonSpecies:: db
NEXTU ; c6d0
; naming screen
wNamingScreenDestinationPointer:: dw ; c6d0
wNamingScreenCurNameLength:: db ; c6d2
wNamingScreenMaxNameLength:: db ; c6d3
wNamingScreenType:: db ; c6d4
wNamingScreenCursorObjectPointer:: dw ; c6d5
wNamingScreenLastCharacter:: db ; c6d7
wNamingScreenStringEntryCoord:: dw ; c6d8
NEXTU ; c6d0
; slot machine
wSlots:: ; c6d0
wReel1:: slot_reel wReel1
wReel2:: slot_reel wReel2
wReel3:: slot_reel wReel3
; c700
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 ; c6d0
; card flip
wCardFlip:: ; c6d0
wDeck:: ds 24
wDeckEnd::
; c6e8
wCardFlipNumCardsPlayed:: db
wCardFlipFaceUpCard:: db
wDiscardPile:: ds 24
wDiscardPileEnd::
wCardFlipEnd::
NEXTU ; c6d0
; dummy game
wDummyGame:: ; c6d0
wDummyGameCards:: ds 9 * 5
wDummyGameCardsEnd::
wDummyGameLastCardPicked:: db ; c6fd
wDummyGameCard1:: db ; c6fe
wDummyGameCard2:: db ; c6ff
wDummyGameCard1Location:: db ; c700
wDummyGameCard2Location:: db ; c701
wDummyGameNumberTriesRemaining:: db ; c702
wDummyGameLastMatches:: ds 5 ; c703
wDummyGameCounter:: db ; c708
wDummyGameNumCardsMatched:: db ; c709
wDummyGameEnd::
NEXTU ; c6d0
; 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 ; c7e8
ENDU ; c7e8
; This was a buffer for map-related pointers in the 1997 G/S prototype.
; See wMapBuffer in pokegold-spaceworld's wram.asm.
wUnusedMapBuffer:: ds 24
wUnusedMapBufferEnd::
SECTION "Overworld Map", WRAM0
UNION ; c800
; overworld map blocks
wOverworldMapBlocks:: ds 1300 ; c800
wOverworldMapBlocksEnd::
NEXTU ; c800
; GB Printer screen RAM
wGameboyPrinterRAM::
wGameboyPrinterScreen:: ds SCREEN_HEIGHT * SCREEN_WIDTH ; c800
wGameboyPrinterScreenEnd:: ; c968
NEXTU ; c800
; GB Printer data
wGameboyPrinter2bppSource:: ds 40 tiles
wGameboyPrinter2bppSourceEnd::
wca80:: db
wPrinterRowIndex:: db
; Printer data
wPrinterData:: ds 4
wPrinterChecksum:: dw ; ca86
wPrinterHandshake:: db
wPrinterStatusFlags::
; bit 7: set if error 1 (battery low)
; bit 6: set if error 4 (too hot or cold)
; bit 5: set if error 3 (paper jammed or empty)
; if this and the previous byte are both $ff: error 2 (connection error)
db
wHandshakeFrameDelay:: db
wPrinterSerialFrameDelay:: db
wPrinterSendByteOffset:: dw
wPrinterSendByteCounter:: dw
; tilemap backup?
wPrinterTileMapBuffer:: ds SCREEN_HEIGHT * SCREEN_WIDTH ; ca90
wPrinterTileMapBufferEnd::
wPrinterStatus:: db ; cbf8
ds 1
; High nibble is for margin before the image, low nibble is for after.
wPrinterMargins:: db ; cbfa
wPrinterExposureTime:: db ; cbfb
ds 16
wGameboyPrinterRAMEnd::
NEXTU ; c800
; bill's pc data
wBillsPCData::
wBillsPCPokemonList::
; (species, box number, list index) x30
ds 3 * 30
ds 720
wBillsPC_ScrollPosition:: db
wBillsPC_CursorPosition:: db
wBillsPC_NumMonsInBox:: db
wBillsPC_NumMonsOnScreen:: db
wBillsPC_LoadedBox:: db ; 0 if party, 1 - 14 if box, 15 if active box
wBillsPC_BackupScrollPosition:: db
wBillsPC_BackupCursorPosition:: db
wBillsPC_BackupLoadedBox:: db
wBillsPC_MonHasMail:: db
ds 5
wBillsPCDataEnd::
NEXTU ; c800
; Hall of Fame data
wHallOfFamePokemonList:: hall_of_fame wHallOfFamePokemonList
NEXTU ; c800
; raw link data
wLinkData:: ds $514
wLinkDataEnd::
NEXTU ; c800
; link data members
wLinkPlayerName:: ds NAME_LENGTH
wLinkPartyCount:: db
wLinkPartySpecies:: ds PARTY_LENGTH
wLinkPartyEnd:: db ; older code doesn't check PartyCount
UNION ; c813
; time capsule party data
wTimeCapsulePlayerData::