summaryrefslogtreecommitdiff
path: root/src/wram.asm
blob: 570bd04898fc6494e04c6eafbfbf1f1185f66e12 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
INCLUDE "macros.asm"
INCLUDE "constants.asm"

INCLUDE "vram.asm"

SECTION "WRAM 0", WRAM0

wTempCardCollection:: ; c000
	ds $100

	ds $100

SECTION "WRAM Duels 1", WRAM0

wPlayerDuelVariables:: ; c200

; In order to be identified during a duel, the 60 cards of each duelist are given an index between 0 and 59.
; These indexes are assigned following the internal order of the cards that make up the deck.
; This temporary index identifies the card during the current duel and within the duelist's deck.

; 60-byte array that indicates where each of the 60 cards is.
;	$00 - deck
;	$01 - hand
;	$02 - discard pile
;	$08 - prize
;	$10 - arena (active pokemon or a card attached to it)
;	$1X - bench (where X is bench position from 1 to 5)
wPlayerCardLocations:: ; c200
	ds DECK_SIZE

	ds $6

; Which cards are in player's hand, as numbers 0 to 59
wPlayerHand:: ; c242
	ds DECK_SIZE

; 60-byte array that maps each card to its position in the deck.
; This array is initialized to 00, 01, 02, ..., 59, until deck is shuffled.
wPlayerDeckCards:: ; c27e
	ds DECK_SIZE

; Stores x = (60 - deck remaining cards)
; The first x cards in the wPlayerDeckCards array are not actually in the deck
; For example, the top card of the player's deck is at wPlayerDeckCards + [wPlayerNumberOfCardsNotInDeck]
wPlayerNumberOfCardsNotInDeck:: ; c2ba
	ds $1

; Which card is in player's side of the field, as number 0 to 59
wPlayerArenaCard:: ; c2bb
	ds $1

; Which cards are in player's bench, as numbers 0 to 59
wPlayerBench:: ; c2bc
	ds BENCH_SIZE

	ds $7

wPlayerArenaCardHP:: ; c2c8
	ds $1
wPlayerBench1CardHP:: ; c2c9
	ds $1
wPlayerBench2CardHP:: ; c2ca
	ds $1
wPlayerBench3CardHP:: ; c2cb
	ds $1
wPlayerBench4CardHP:: ; c2cc
	ds $1
wPlayerBench5CardHP:: ; c2cd
	ds $1

	ds $19

wPlayerArenaCardSubstatus1:: ; c2e7
	ds $1

wPlayerArenaCardSubstatus2:: ; c2e8
	ds $1

wPlayerArenaCardSubstatus3:: ; c2e9
	ds $1

wPlayerArenaCardSubstatus4:: ; c2ea
	ds $1

wPlayerArenaCardSubstatus5:: ; c2eb
	ds $1

; Each bit represents a prize (1 = not taken ; 0 = taken)
wPlayerPrizes:: ; c2ec
	ds $1

wPlayerNumberOfCardsInDiscardPile:: ; c2ed
	ds $1

wPlayerNumberOfCardsInHand:: ; c2ee
	ds $1

; Pokemon cards in arena + bench
wPlayerNumberOfPokemonInPlay:: ; c2ef
	ds $1

wPlayerArenaCardStatus:: ; c2f0
	ds $1

; $00   - player
; $01   - link
; other - AI controlled
wPlayerDuelistType:: ; c2f1
	ds $1

; if under the effects of amnesia, which move (0 or 1) can't be used
wPlayerArenaCardDisabledMoveIndex:: ; c2f2
	ds $1

	ds $d

wOpponentDuelVariables:: ; c300

wOpponentCardLocations:: ; c300
	ds DECK_SIZE

	ds $6

wOpponentHand:: ; c342
	ds DECK_SIZE

wOpponentDeckCards:: ; c37e
	ds DECK_SIZE

wOpponentNumberOfCardsNotInDeck:: ; c3ba
	ds $1

wOpponentArenaCard:: ; c3bb
	ds $1

wOpponentBench:: ; c3bc
	ds BENCH_SIZE

	ds $7

wOpponentArenaCardHP:: ; c3c8
	ds $1
wOpponentBench1CardHP:: ; c3c9
	ds $1
wOpponentBench2CardHP:: ; c3ca
	ds $1
wOpponentBench3CardHP:: ; c3cb
	ds $1
wOpponentBench4CardHP:: ; c3cc
	ds $1
wOpponentBench5CardHP:: ; c3cd
	ds $1

	ds $19

wOpponentArenaCardSubstatus1:: ; c3e7
	ds $1

wOpponentArenaCardSubstatus2:: ; c3e8
	ds $1

wOpponentArenaCardSubstatus3:: ; c3e9
	ds $1

wOpponentArenaCardSubstatus4:: ; c3ea
	ds $1

wOpponentArenaCardSubstatus5:: ; c3eb
	ds $1

wOpponentPrizes:: ; c3ec
	ds $1

wOpponentNumberOfCardsInDiscardPile:: ; c3ed
	ds $1

wOpponentNumberOfCardsInHand:: ; c3ee
	ds $1

wOpponentNumberOfPokemonInPlay:: ; c3ef
	ds $1

wOpponentArenaCardStatus:: ; c3f0
	ds $1

; $00   - player
; $01   - link
; other - AI controlled
wOpponentDuelistType:: ; c3f1
	ds $1

wOpponentArenaCardDisabledMoveIndex:: ; c3f2
	ds $1

	ds $d

UNION

wBoosterCardsDrawn:: ; c400
wBoosterTempNonEnergiesDrawn:: ; c400
	ds $b
wBoosterTempEnergiesDrawn:: ; c40b
	ds $b
wBoosterCardsDrawnEnd::
	ds $6a

NEXTU

wPlayerDeck:: ; c400
	ds $80

ENDU

wOpponentDeck:: ; c480
	ds $80

	ds $10

; this holds a list of cards (e.g. in hand or in bench) or the attack list of a pokemon card
wDuelCardOrAttackList:: ; c510
	ds $80

; this appears to be kept updated with some default text that is used
; when the text printing functions are called with text id $0000
wc590:: ; c590
	ds $70

SECTION "WRAM Text Engine", WRAM0

wc600:: ; c600
	ds $100

wc700:: ; c700
	ds $100

wc800:: ; c800
	ds $100

wc900:: ; c900
	ds $100

SECTION "WRAM Engine 1", WRAM0

wBufOAM:: ; ca00
	ds $a0

wcaa0:: ; caa0
	ds $10

wcab0:: ; cab0
	ds $1

wcab1:: ; cab1
	ds $1

wcab2:: ; cab2
	ds $1

; initial value of the A register--used to tell the console when reset
wInitialA:: ; cab3
	ds $1

; what console we are playing on, either 0 (DMG), 1 (SGB) or 2 (CGB)
; use constants CONSOLE_DMG, CONSOLE_SGB and CONSOLE_CGB for checks
wConsole:: ; cab4
	ds $1

wcab5:: ; cab5
	ds $1

wTileMapFill:: ; cab6
	ds $1

wIE:: ; cab7
	ds $1

wVBlankCtr:: ; cab8
	ds $1

	ds $1

; bit0: is in vblank interrupt?
; bit1: is in timer interrupt?
wReentrancyFlag:: ; caba
	ds $1

wLCDC:: ; cabb
	ds $1

wBGP:: ; cabc
	ds $1

wOBP0:: ; cabd
	ds $1

wOBP1:: ; cabe
	ds $1

wFlushPaletteFlags:: ; cabf
	ds $1

wVBlankOAMCopyToggle:: ; cac0
	ds $1

wcac1:: ; cac1
	ds $1

wcac2:: ; cac2
	ds $1

wCounterCtr:: ; cac3
	ds $1

wPlayTimeCounterEnable:: ; cac4
	ds $1

; byte0: 1/60ths of a second
; byte1: seconds
; byte2: minutes
; byte3: hours (lower byte)
; byte4: hours (upper byte)
wPlayTimeCounter:: ; cac5
	ds $5

wRNG1:: ; caca
	ds $1

wRNG2:: ; cacb
	ds $1

wCounter:: ; cacc
	ds $1

; the LCDC status interrupt is always disabled and this always reads as jp $0000
wLCDCFunctiontrampoline:: ; cacd
	ds $3

wVBlankFunctionTrampoline:: ; cad0
	ds $3

wDoFrameFunction:: ; cad3
	ds $1

wcad4:: ; cad4
	ds $1

wcad5:: ; cad5
	ds $1

	ds $8

wcade:: ; cade
	ds $4

wcae2:: ; cae2
	ds $e

wBufPalette:: ; caf0
	ds $80

	ds $4

SECTION "WRAM Serial transfer bytes", WRAM0

wSerialOp:: ; cb74
	ds $1

wSerialFlags:: ; cb75
	ds $1

wSerialCounter:: ; cb76
	ds $1

wSerialCounter2:: ; cb77
	ds $1

wSerialTimeoutCounter:: ; cb78
	ds $1

	ds $4

wSerialSendSave:: ; cb7d
	ds $1

wSerialSendBufToggle:: ; cb7e
	ds $1

wSerialSendBufIndex:: ; cb7f
	ds $1

wcb80:: ; cb80
	ds $1

wSerialSendBuf:: ; cb81
	ds $20

wSerialLastReadCA:: ; cba1
	ds $1

wSerialRecvCounter:: ; cba2
	ds $1

wcba3:: ; cba3
	ds $1

wSerialRecvIndex:: ; cba4
	ds $1

wSerialRecvBuf:: ; cba5 - cbc4
	ds $20

	ds $1

SECTION "WRAM Duels 2", WRAM0

; In a duel, the main menu current or last selected menu item
; From 0 to 5: Hand, Attack, Check, Pkmn Power, Retreat, Done
wCurrentDuelMenuItem:: ; cbc6
	ds $1

; When we're viewing a card's information, the page we are currently at
; For Pokemon cards, values from $1 to $6 (two pages for move descriptions)
; For Energy cards, it's always $9
; For Trainer cards, $d or $e (two pages for trainer card descriptions)
wCardPageNumber:: ; cbc7
	ds $1

	ds $1

wcbc9:: ; cbc9
	ds $2

wBenchSelectedPokemon:: ; cbcb
	ds $1

	ds $2

wAttachedEnergiesAccum:: ; cbce
	ds $1

; When you're in a duel submenu like the cards in your hand and you press A,
; the following two addresses keep track of which item was selected by the cursor
wSelectedDuelSubMenuItem:: ; cbcf
	ds $1

wSelectedDuelSubMenuScrollOffset:: ; cbd0
	ds $1

	ds $14

wcbe5:: ; cbe5
	ds $1

wcbe6:: ; cbe6
	ds $1

wcbe7:: ; cbe7
	ds $6

wcbed:: ; cbed
	ds $c

wcbf9:: ; cbf9
	ds $b

wcc04:: ; cc04
	ds $1

wcc05:: ; cc05
	ds $1

wcc06:: ; cc06
	ds $1

; 0 = no one has won duel yet
; 1 = player whose turn it is has won the duel
; 2 = player whose turn it is has lost the duel
; 3 = duel ended in a draw
wDuelFinished:: ; cc07
	ds $1

wcc08:: ; cc08
	ds $1

wcc09:: ; cc09
	ds $1

wcc0a:: ; cc0a
	ds $1

wAlreadyPlayedEnergy:: ; cc0b
	ds $1

wcc0c:: ; cc0c
	ds $1

wcc0d:: ; cc0d
	ds $1

; this seems to hold the current opponent's deck id - 2,
; perhaps to account for the two unused pointers at the
; beginning of DeckPointers
wOpponentDeckId:: ; cc0e
	ds $1

	ds $1

wcc10:: ; cc10
	ds $1

wcc11:: ; cc11
	ds $1

wcc12:: ; cc12
	ds $1

wIsPracticeDuel:: ; cc13
	ds $1

	ds $1

wcc15:: ; cc15
	ds $1

wcc16:: ; cc16
	ds $1

wcc17:: ; cc17
	ds $1

wcc18:: ; cc18
	ds $1

wcc19:: ; cc19
	ds $1

wDuelTheme:: ; cc1a
	ds $1

; holds the energies attached to a given pokemon card. 1 byte for each of the
; 8 energy types (including the unused one that shares byte with the colorless energy)
wAttachedEnergies:: ; cc1b
	ds NUM_TYPES

; holds the total amount of energies attached to a given pokemon card
wTotalAttachedEnergies:: ; cc23
	ds $1

; Used as temporary storage for a loaded card's data
wLoadedCard1:: ; cc24
	card_data_struct wLoadedCard1

wLoadedCard2:: ; cc65
	card_data_struct wLoadedCard2

wLoadedMove:: ; cca6
	move_data_struct wLoadedMove

; big-endian
wDamage:: ; ccb9
	ds $2

; wccbb and wccbc appear to be used for AI scoring
wccbb::
	ds $1

wccbc::
	ds $1

	ds $2

wccbf:: ; ccbf
	ds $2

wccc1:: ; ccc1
	ds $1

wTempCardId:: ; ccc2
	ds $1

wTempTurnDuelistCardId:: ; ccc3
	ds $1

wTempNonTurnDuelistCardId:: ; ccc4
	ds $1

	ds $1

; may contain 0 or 1 depending on which move was selected
wSelectedMoveIndex:: ; ccc6
	ds $1

; if affected by a no damage or effect substatus, this flag indicates what the cause was
wNoDamageOrEffect:: ; ccc7
	ds $2

wccc9:: ; ccc9
	ds $4

wcccd:: ; cccd
	ds $1

wccce:: ; ccce
	ds $18

wcce6:: ; cce6
	ds $5

wcceb:: ; cceb
	ds $1

wccec:: ; ccec
	ds $1

wcced:: ; cced
	ds $2

wccef:: ; ccef
	ds $1

wccf0:: ; ccf0
	ds $1

wccf1:: ; ccf1
	ds $1

wccf2:: ; ccf2
	ds $1

SECTION "WRAM Engine 2", WRAM0

; color/pattern of the text box border. Values between 0-7?. Interpreted differently depending on console type
; Note that this doesn't appear to be a selectable option, just changes with the situation.
; For example the value 4 seems to be used a lot during duels.
wFrameType:: ; ccf3
	ds $1

	ds $10

wcd04:: ; cd04
	ds $1

wcd05:: ; cd05
	ds $1

wcd06:: ; cd06
	ds $1

wcd07:: ; cd07
	ds $1

wcd08:: ; cd08
	ds $1

wcd09:: ; cd09
	ds $1

wcd0a:: ; cd0a
	ds $1

wcd0b:: ; cd0b
	ds $2

wUppercaseFlag:: ; cd0d
	ds $1

	ds $1

; Handles timing of (horizontal or vertical) arrow blinking while waiting for user input.
wCursorBlinkCounter:: ; cd0f
	ds $1

wCurMenuItem:: ; cd10
	ds $1

wCursorXPosition:: ; cd11
	ds $1

wCursorYPosition:: ; cd12
	ds $1

wYDisplacementBetweenMenuItems:: ; cd13
	ds $1

wNumMenuItems:: ; cd14
	ds $1

wCursorTileNumber:: ; cd15
	ds $1

wTileBehindCursor:: ; cd16
	ds $1

wcd17:: ; cd17
	ds 2

	ds $7f

wLeftmostItemCursorX:: ; cd98
	ds $1

wRefreshMenuCursorSFX:: ; cd99
	ds $1

wcd9a:: ; cd9a
	ds $2

wcd9c:: ; cd9c
	ds $1

wcd9d:: ; cd9d
	ds $1

wcd9e:: ; cd9e
	ds $1

wcd9f:: ; cd9f
	ds $83

; During a duel, this is always $b after the first attack.
; $b is the bank where the functions associated to card or effect commands are.
; Its only purpose seems to be store this value to be read by TryExecuteEffectCommandFunction.
wce22:: ; ce22
	ds $1d

wce3f:: ; cd3f
	ds $1

wce40:: ; ce40
	ds $1

wce41:: ; ce41
	ds $1

wce42:: ; ce42
	ds $1

wce43:: ; ce43
	ds $1

wce44:: ; ce44
	ds $3

; when printing text, number of frames to wait between each text tile
wTextSpeed:: ; ce47
	ds $1

wce48:: ; ce48
	ds $1

wce49:: ; ce49
	ds $1

wce4a:: ; ce4a
	ds $1

wce4b:: ; ce4b
	ds $3

wCoinTossScreenTextId:: ; ce4e
	ds $2

wce50:: ; ce50
	ds $1

wce51:: ; ce51
	ds $8

wce59:: ; ce59
	ds $7

wce60:: ; ce60
	ds $3

wce63:: ; ce63
	ds $9

wce6c:: ; ce6c
	ds $1

wce6d:: ; ce6d
	ds $1

wce6e:: ; ce6e
	ds $1

wce6f:: ; ce6f
	ds $d

wce7c:: ; ce7c
	ds $27

wcea3:: ; cea3
	ds $c

wceaf:: ; ceaf
	ds $1

wceb0:: ; ceb0
	ds $1

wceb1:: ; ceb1
	ds $1

wceb2:: ; ceb2
	ds $1

wceb3:: ; ceb3
	ds $1

wceb4:: ; ceb4
	ds $1

wceb5:: ; ceb5
	ds $17

wcecc:: ; cecc
	ds $9c

wHandCardBuffer:: ; cf68
	ds $51

wcfb9:: ; cfb9
	ds $2a

wcfe3:: ; cfe3

SECTION "WRAM1", WRAMX
	ds $a9

wd0a9:: ; d0a9
	ds $b

wd0b4:: ; d0b4
	ds $1

wd0b5:: ; d0b5
	ds $1

wSCX:: ; d0b6
	ds $1

wSCY:: ; d0b7
	ds $1

wd0b8:: ; d0b8
	ds $1

wd0b9:: ; d0b9
	ds $1

wd0ba:: ; d0ba
	ds $1

wd0bb:: ; d0bb
	ds $1

wd0bc:: ; d0bc
	ds $1

wd0bd:: ; d0bd
	ds $1

wd0be:: ; d0be
	ds $1

wd0bf:: ; d0bf
	ds $1

wd0c0:: ; d0c0
	ds $1

wd0c1:: ; d0c1
	ds $1

wd0c2:: ; d0c2
	ds $1

wd0c3:: ; d0c3
	ds $1

wd0c4:: ; d0c4
	ds $1

wd0c5:: ; d0c5
	ds $1

wd0c6:: ; d0c6
	ds $1

wd0c7:: ; d0c7
	ds $1

wd0c8:: ; d0c8
	ds $1

wd0c9:: ; d0c9
	ds $1

wd0ca:: ; d0ca
	ds $1

wd0cb:: ; d0cb
	ds $41

wd10c:: ; d10c
	ds $1

wd10d:: ; d10d
	ds $1

wd10e:: ; d10e
	ds $1

wd10f:: ; d10f
	ds $1

wd110:: ; d110
	ds $1

wd111:: ; d111
	ds $1

wd112:: ; d112
	ds $1

wMatchStartTheme:: ; d113
	ds $1

wd114:: ; d114
	ds $1

wd115:: ; d115
	ds $1

wd116:: ; d116
	ds $1

wd117:: ; d117
	ds $4

wd11b:: ; d11b
	ds $2

wPCPackSelection:: ; d11d
	ds $1

; 7th bit of each pack corresponds to whether or not it's been read
wPCPacks:: ; d11e
	ds $c

	ds $3

wPCLastDirectionPressed:: ; d12d
	ds $1

	ds $3

wd131:: ; d131
	ds $1

wd132:: ; d132
	ds $1

wBoosterViableCardList:: ; d133
wFloorObjectMap:: ; map of the current room with unpassable objects (walls, NPCs, etc). Might be a permission map
	ds $100

wd233:: ; d233
	ds $1

wd234:: ; d234
	ds $1

wSCXBuffer:: ; d235
	ds $1

wSCYBuffer:: ; d236
	ds $1

wd237:: ; d237
	ds $1

wd238:: ; d238
	ds $57

wd28f:: ; d28f
	ds $1

wd290:: ; d290
	ds $1

wd291:: ; d291
	ds $92

wd323:: ; d323
	ds $1

wd324:: ; d324
	ds $a

wd32e:: ; d32e
	ds $1

wCurMap:: ; d32f
	ds $1

wPlayerXCoord:: ; d330
	ds $1

wPlayerYCoord:: ; d331
	ds $1

wd332:: ; d332
	ds $1

wd333:: ; d333
	ds $1

wd334:: ; d334
	ds $1

wd335:: ; d335
	ds $1

wd336:: ; d336
	ds $1

wd337:: ; d337
	ds $1

wd338:: ; d338
	ds $3

wd33b:: ; d33b
	ds $1

wd33c:: ; d33c
	ds $1

wd33d:: ; d33d
	ds $1

wd33e:: ; d33e
	ds $1

wd33f:: ; d33f
	ds $1

wd340:: ; d340
	ds $1

wd341:: ; d341
	ds $2

wd343:: ; d343
	ds $1

wd344:: ; d344
	ds $1

wd345:: ; d345
	ds $1

wd346:: ; d346
	ds $1

wd347:: ; d347
	ds $1

wd348:: ; d348
	ds $62

wd3aa:: ; d3aa
	ds $1

wd3ab:: ; d3ab
	ds $4

wd3af:: ; d3af
	ds $1

wd3b0:: ; d3b0
	ds $1

wd3b1:: ; d3b1
	ds $1

wd3b2:: ; d3b2
	ds $4

wd3b6:: ; d3b6
	ds $2

wd3b8:: ; d3b8
	ds $18

wd3d0:: ; d3d0
	ds $1

wd3d1:: ; d3d1
	ds $1

wEventFlags::
	ds $3f

wd411:: ; d411
	ds $1

; 0 keeps looping, other values break the loop in RST20
wBreakOWScriptLoop:: ; d412
	ds $1

wOWScriptPointer:: ; d413
	ds $2

	ds $8

wd41d:: ; d41d
	ds $1

wd41e:: ; d41e
	ds $1

wd41f:: ; d41f
	ds $1

wd420:: ; d420
	ds $1

wd421:: ; d421
	ds $1

wd422:: ; d422
	ds $8

wd42a:: ; d42a
	ds $82

wd4ac:: ; d4ac
	ds $12

wd4be:: ; d4be
	ds $4

wd4c2:: ; d4c2
	ds $1

wd4c3:: ; d4c3
	ds $1

wd4c4:: ; d4c4
	ds $1

wd4c5:: ; d4c5
	ds $1

wd4c6:: ; d4c6
	ds $1

wd4c7:: ; d4c7
	ds $1

wd4c8:: ; d4c8
	ds $2

wd4ca:: ; d4ca
	ds $1

wd4cb:: ; d4cb
	ds $4

; some sort of control bit for the OAMBuffer
wd4cf:: ; d4cf
	ds $1

; this might be more of an animation buffer as I can't find any properties like which tile sprites go where.
wOAMBuffer:: ; d4d0
	ds $103

wd5d3:: ; d5d3
	ds $4

wd5d7:: ; d5d7
	ds $41

wd618:: ; d618
	ds $3

wd61b:: ; d61b
	ds $3

wd61e:: ; d61e
	ds $6

wd624:: ; d624
	ds $2

wd626:: ; d626
	ds $1

wd627:: ; d627
	ds $1

wd628:: ; d628
	ds $b

wd633:: ; d633
	ds $2

wd635:: ; d635
	ds $34

wBoosterIndex:: ; d669
	ds $1

wBoosterTempCard:: ; d66a
	ds $1

wBoosterSelectedCardType:: ; d66b
	ds $1

wBoosterCurRarity:: ; d66c
	ds $1

wBoosterAveragedTypeChances:: ; d66d
	ds $1

wBoosterDataCommonAmount:: ; d66e
	ds $1

wBoosterDataUncommonAmount:: ; d66f
	ds $1

wBoosterDataRareAmount:: ; d670
	ds $1

wBoosterAmountOfCardTypeTable:: ; d671
	ds NUM_BOOSTER_CARD_TYPES

wBoosterTempTypeChanceTable:: ; d67a
	ds NUM_BOOSTER_CARD_TYPES

wBoosterCurrentCardType:: ; d683
	ds $1

wBoosterCurrentCardRarity:: ; d684
	ds $1

wBoosterCurrentCardSet:: ; d685
	ds $1

wBoosterDataSet:: ; d686
	ds $1

wBoosterDataEnergyFunctionPointer:: ; d687
	ds $2

wBoosterDataTypeChances:: ; d689
	ds NUM_BOOSTER_CARD_TYPES

	ds $6ee

SECTION "WRAM Music", WRAMX

; bit 7 is set once the song has been started
wCurSongID:: ; dd80
	ds $1

wCurSongBank:: ; dd81
	ds $1

; bit 7 is set once the sfx has been started
wCurSfxID:: ; dd82
	ds $1

wdd83:: ; dd83
	ds $1

wMusicDC:: ; dd84
	ds $1

wdd85:: ; dd85
	ds $1

wMusicDuty1:: ; dd86
	ds $1

wMusicDuty2:: ; dd87
	ds $3

wMusicWave:: ; dd8a
	ds $1

wMusicWaveChange:: ; dd8b
	ds $1

wdd8c:: ; dd8c
	ds $1

wMusicIsPlaying:: ; dd8d
	ds $4

wMusicTie:: ; dd91
	ds $4

; 4 pointers to the current music commands being executed
wMusicChannelPointers:: ; dd95
	ds $8

; 4 pointers to the addresses of the beginning of the main loop for each channel
wMusicMainLoopStart:: ; dd9d
	ds $8

wMusicCh1CurPitch:: ; dda5
	ds $1

wMusicCh1CurOctave:: ; dda6
	ds $1

wMusicCh2CurPitch:: ; dda7
	ds $1

wMusicCh2CurOctave:: ; dda8
	ds $1

wMusicCh3CurPitch:: ; dda9
	ds $1

wMusicCh3CurOctave:: ; ddaa
	ds $1

wddab:: ; ddab
	ds $1

wddac:: ; ddac
	ds $3

wMusicOctave:: ; ddaf
	ds $4

wddb3:: ; ddb3
	ds $4

wddb7:: ; ddb7
	ds $1

wddb8:: ; ddb8
	ds $1

wddb9:: ; ddb9
	ds $1

wddba:: ; ddba
	ds $1

wddbb:: ; ddbb
	ds $4

wMusicE8:: ; ddbf
	ds $4

wddc3:: ; ddc3
	ds $4

wMusicE9:: ; ddc7
	ds $4

wMusicEC:: ; ddcb
	ds $4

wMusicSpeed:: ; ddcf
	ds $4

wMusicVibratoType:: ; ddd3
	ds $4

wMusicVibratoType2:: ; ddd7
	ds $4

wdddb:: ; dddb
	ds $4

wMusicVibratoDelay:: ; dddf
	ds $4

wdde3:: ; dde3
	ds $4

wMusicVolume:: ; dde7
	ds $3

wMusicE4:: ; ddea
	ds $3

wdded:: ; dded
	ds $2

wddef:: ; ddef
	ds $1

wddf0:: ; ddf0
	ds $1

wMusicPanning:: ; ddf1
	ds $1

wddf2:: ; ddf2
	ds $1

; 4 pointers to the positions on the stack for each channel
wMusicChannelStackPointers:: ; ddf3
	ds $8

; these stacks contain the address of the command to return to at the end of a sub branch (2 bytes)
; and also contain the address of the command to return to at the end of a loop (2 bytes for address and
; 1 byte for loop count)
wMusicCh1Stack:: ; ddfb
	ds $c

wMusicCh2Stack:: ; de07
	ds $c

wMusicCh3Stack:: ; de13
	ds $c

wMusicCh4Stack:: ; de1f
	ds $c

SECTION "WRAM Sfx", WRAMX

wde2b:: ; de2b
	ds $3

wde2e:: ; de2e
	ds $1

wde2f:: ; de2f
	ds $3

wde32:: ; de32
	ds $1

wde33:: ; de33
	ds $4

wde37:: ; de37
	ds $6

wde3d:: ; de3d
	ds $2

wde3f:: ; de3f
	ds $4

wde43:: ; de43
	ds $8

wde4b:: ; de4b
	ds $8

wde53:: ; de53
	ds $1

wde54:: ; de54
	ds $1

wCurSongIDBackup:: ; de55
	ds $1

wCurSongBankBackup:: ; de56
	ds $1

wMusicDCBackup:: ; de57
	ds $1

wMusicDuty1Backup:: ; de58
	ds $4

wMusicWaveBackup:: ; de5c
	ds $1

wMusicWaveChangeBackup:: ; de5d
	ds $1

wMusicIsPlayingBackup:: ; de5e
	ds $4

wMusicTieBackup:: ; de62
	ds $4

wMusicChannelPointersBackup:: ; de66
	ds $8

wMusicMainLoopStartBackup:: ; de6e
	ds $8

wde76:: ; de76
	ds $1

wde77:: ; de77
	ds $1

wMusicOctaveBackup:: ; de78
	ds $4

wde7c:: ; de7c
	ds $4

wde80:: ; de80
	ds $4

wde84:: ; de84
	ds $4

wMusicE8Backup:: ; de88
	ds $4

wde8c:: ; de8c
	ds $4

wMusicE9Backup:: ; de90
	ds $4

wMusicECBackup:: ; de94
	ds $4

wMusicSpeedBackup:: ; de98
	ds $4

wMusicVibratoType2Backup:: ; de9c
	ds $4

wMusicVibratoDelayBackup:: ; dea0
	ds $4

wMusicVolumeBackup:: ; dea4
	ds $3

wMusicE4Backup:: ; dea7
	ds $3

wdeaa:: ; deaa
	ds $2

wdeac:: ; deac
	ds $1

wMusicChannelStackPointersBackup:: ; dead
	ds $8

wMusicCh1StackBackup:: ; deb5
	ds $c * 4

INCLUDE "sram.asm"