Snippets

ScorpionIlluminati Listing File

Created by ScorpionIlluminati
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
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
00000000                            ;==============================================================
00000000                            ;   Scorpion Illuminati
00000000                            ;==============================================================
00000000                            ;   SEGA Genesis (c) SegaDev 2014
00000000                            ;==============================================================
00000000                            

00000000                                  ; Include SEGA Genesis ROM header and CPU vector table
00000000                                  include 'header.asm'
00000000                            ;==============================================================
00000000                            ;   Scorpion Illuminati
00000000                            ;==============================================================
00000000                            ;   SEGA Genesis SegaDev 2014
00000000                            ;==============================================================
00000000                            

00000000                            __start:        
00000000                                  ; ******************************************************************
00000000                                  ; Sega Megadrive ROM header
00000000                                  ; ******************************************************************
00000000 00FF E000                        dc.l   0x00FFE000                                                        ; Initial stack pointer value
00000004 0000 0000                        dc.l   EntryPoint                                                        ; Start of program
00000008 0000 0000                        dc.l   BusErrorException                                                 ; Bus error
0000000C 0000 0000                        dc.l   AddressErrorException                                             ; Address error
00000010 0000 0000                        dc.l   IllegalInstructionException                                       ; Illegal instruction
00000014 0000 0000                        dc.l   ZeroDivideException                                               ; Division by zero
00000018 0000 0000                        dc.l   CHKInstructionException                                           ; CHK exception
0000001C 0000 0000                        dc.l   TRAPVInstructionException                                         ; TRAPV exception
00000020 0000 0000                        dc.l   PrivilegeViolationException                                       ; Privilege violation
00000024 0000 0000                        dc.l   NullInterrupt                                                     ; TRACE exception
00000028 0000 0000                        dc.l   LineAEmulator                                                     ; Line-A emulator
0000002C 0000 0000                        dc.l   LineFEmulator                                                     ; Line-F emulator
00000030 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000034 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000038 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
0000003C 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000040 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000044 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000048 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
0000004C 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000050 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000054 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000058 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
0000005C 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000060 0000 0000                        dc.l   NullInterrupt                                                     ; Spurious exception
00000064 0000 0000                        dc.l   NullInterrupt                                                     ; IRQ level 1
00000068 0000 0000                        dc.l   NullInterrupt                                                     ; IRQ level 2
0000006C 0000 0000                        dc.l   NullInterrupt                                                     ; IRQ level 3
00000070 0000 0000                        dc.l   HBlankInterrupt                                                   ; IRQ level 4 (horizontal retrace interrupt)
00000074 0000 0000                        dc.l   NullInterrupt                                                     ; IRQ level 5
00000078 0000 0000                        dc.l   VBlankInterrupt                                                   ; IRQ level 6 (vertical retrace interrupt)
0000007C 0000 0000                        dc.l   NullInterrupt                                                     ; IRQ level 7
00000080 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #00 exception
00000084 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #01 exception
00000088 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #02 exception
0000008C 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #03 exception
00000090 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #04 exception
00000094 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #05 exception
00000098 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #06 exception
0000009C 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #07 exception
000000A0 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #08 exception
000000A4 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #09 exception
000000A8 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #10 exception
000000AC 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #11 exception
000000B0 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #12 exception
000000B4 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #13 exception
000000B8 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #14 exception
000000BC 0000 0000                        dc.l   NullInterrupt                                                     ; TRAP #15 exception
000000C0 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000C4 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000C8 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000CC 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000D0 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000D4 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000D8 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000DC 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000E0 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000E4 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000E8 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000EC 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000F0 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000F4 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000F8 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
000000FC 0000 0000                        dc.l   NullInterrupt                                                     ; Unused (reserved)
00000100                                  ;*******************************************************************
00000100                                  ; Genesis
00000100                                  ;*******************************************************************
00000100 5345 4741 204D 4547 4120+        dc.b "SEGA MEGA DRIVE "                                                  ; Console name
00000110 2843 2953 4547 4120 3139+        dc.b "(C)SEGA 1992.SEP"                                                  ; Copyrght holder and release date
00000120 5363 6F72 7069 6F6E 2049+        dc.b "Scorpion Illuminati                             "                  ; Domestic name
00000150 5363 6F72 7069 6F6E 2049+        dc.b "Scorpion Illuminati                             "                  ; International name
00000180 474D 2058 5858 5858 5858+        dc.b "GM XXXXXXXX-00"                                                    ; Version number
0000018E 2020                             dc.b "  "                                                                ; Checksum
00000190 4A36 2020 2020 2020 2020+        dc.b "J6              "                                                  ; I/O support
000001A0 0000 0000                        dc.l __start                                                             ; Start address of ROM
000001A4 0000 0000                        dc.l __end-1                                                             ; End address of ROM
000001A8 00FF 0000                        dc.l 0x00FF0000                                                          ; Start address of RAM
000001AC 00FF FFFF                        dc.l 0x00FFFFFF                                                          ; End address of RAM
000001B0 2020 2020                        dc.b "    "                                                              ; SRAM enabled
000001B4 2020 2020                        dc.b "    "                                                              ; Unused
000001B8 2020 2020                        dc.b "    "                                                              ; Start address of SRAM
000001BC 2020 2020                        dc.b "    "                                                              ; End address of SRAM
000001C0 2020 2020                        dc.b "    "                                                              ; Unused
000001C4 2020 2020                        dc.b "    "                                                              ; Unused
000001C8 2020 2020 2020 2020 2020+        dc.b "                                        "                          ; Notes (unused)
000001F0 4620 2020 2020 2020 2020+        dc.b "F               "                                                  ; Country codes
00000200                                  ;*******************************************************************
00000200                                  ; Mega-CD
00000200                                  ;*******************************************************************
00000200 5345 4741 4449 5343 5359+        dc.b "SEGADISCSYSTEM  "
00000210 4344 424F 4F54 4C4F 4144+        dc.b "CDBOOTLOADR",0
0000021C 0100                             dc.w 0x0100
0000021E 0001                             dc.w 0x0001
00000220 5345 4741 4344 2042 4F4F+        dc.b "SEGACD BOOT",0
0000022C 0001                             dc.w 0x0001
0000022E 0000                             dc.w 0x0000
00000230 0000 0800                        dc.l 0x00000800                                                          ; Main CPU ROM offset
00000234 0000 0800                        dc.l 0x00000800                                                          ; Main CPU ROM size
00000238 0000 0000                        dc.l 0x00000000                                                          ; Main CPU ROM start offset
0000023C 0000 0000                        dc.l 0x00000000                                                          ; Main CPU work RAM size
00000240 0000 1000                        dc.l 0x00001000                                                          ; Sub CPU ROM offset
00000244 0000 7000                        dc.l 0x00007000                                                          ; Sub CPU ROM size
00000248 0000 0000                        dc.l 0x00000000                                                          ; Sub CPU ROM start offset
0000024C 0000 0000                        dc.l 0x00000000                                                          ; Sub CPU ROM work RAM size
00000250 3039 3130 3230 3134              dc.b "09102014"                                                          ; Date
00000250 3039 3130 3230 3134              dc.b "09102014"                                                          ; Date
00000258                            

00000258                                  ; assembler directives
00000258                                  include 'newtron.asm'
00000258                            ;==============================================================
00000258                            ;     Scorpion Illuminati
00000258                            ;==============================================================
00000258                            ;   SEGA Genesis (c) SegaDev 2014
00000258                            ;==============================================================
00000258 =00000000                  EnableDEBUG:	                  equ 0                                        ; change to 1 to enable debug code
00000258 =00000000                  EmulateDivideByZeroCrash:         equ 0                                        ; change to 1 to emulate a divide by zero crash
00000258 =00000000                  EmulateIllegalInstructionCrash:   equ 0                                        ; change to 1 to emulate a divide by zero crash
00000258 =00000000                  EmulateIllegalInstructionCrash:   equ 0                                        ; change to 1 to emulate a divide by zero crash
00000258                            

00000258                                  ; include framework code
00000258                                  include 'framewk\macros.asm'
00000258                            ; ******************************************
00000258                            ; push register to stack (byte)
00000258                            ; PUSHL register to push
00000258                            ; ******************************************
00000258                            PUSHB: macro reg
00000258                                move.b \reg, -(sp)
00000258                                endm
00000258                            

00000258                            ; ******************************************
00000258                            ; pop register from the stack (byte)
00000258                            ; POPL register to pop in reverse order
00000258                            ; ******************************************
00000258                            POPB: macro reg
00000258                                move.b (sp)+, \reg
00000258                                endm
00000258                            

00000258                            ; ******************************************
00000258                            ; push register to stack (word)
00000258                            ; PUSHL register to push
00000258                            ; ******************************************
00000258                            PUSHW: macro reg
00000258                                move.w \reg, -(sp)
00000258                                endm
00000258                            

00000258                            ; ******************************************
00000258                            ; pop register from the stack (word)
00000258                            ; POPL register to pop in reverse order
00000258                            ; ******************************************
00000258                            POPW: macro reg
00000258                                move.w (sp)+, \reg
00000258                                endm
00000258                            

00000258                            ; ******************************************
00000258                            ; push register to stack (longword)
00000258                            ; PUSHL register to push
00000258                            ; ******************************************
00000258                            PUSHL: macro reg
00000258                                move.l \reg, -(sp)
00000258                                endm
00000258                            

00000258                            ; ******************************************
00000258                            ; pop register from the stack (longword)
00000258                            ; POPL register to pop in reverse order
00000258                            ; ******************************************
00000258                            POPL: macro reg
00000258                                move.l (sp)+, \reg
00000258                                endm
00000258                            

00000258                            ; ******************************************
00000258                            ; Forces alignment on an even address in ram
00000258                            ; rseven
00000258                            ; ******************************************
00000258                            RSEVEN: macro
00000258                                if __RS&1
00000258                                rs.b 1
00000258                                endc
00000258                                endm
00000258                                endm
00000258                                  include 'framewk\init.asm'
00000258                            ;==============================================================
00000258                            ;   BIG EVIL CORPORATION .co.uk
00000258                            ;==============================================================
00000258                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000258                            ;==============================================================
00000258                            ;   init.asm - 68000, VDP, Z80, PSG and gamepad initialisation
00000258                            ;==============================================================
00000258                            

00000258                            ; Entry point address set in ROM header
00000258                            EntryPoint:
00000258                            

00000258                            	; Only if running on MegaCD - restore HINT vector
00000258 4EB9 0000 0000             	jsr MCD_RestoreHINT
0000025E                            

0000025E                            	; Test reset state
0000025E 4A79 0000 0000             	tst.w reset_exp    ; Test expansion reset
00000264 6600 0000                  	bne Main           ; Branch if Not Equal (to zero) - to Main
00000268 4A79 0000 0000             	tst.w reset_button ; Test reset button
0000026E 6600                       	bne.s Main         ; Branch if Not Equal (to zero) - to Main
00000270                               
00000270                            	; Clear RAM
00000270 4EB9 0000 0000             	jsr ClearRAM
00000276                            

00000276                            	; Write TMSS
00000276 4EB9 0000 0000             	jsr InitTMSS
0000027C                            

0000027C                            	; Init Z80
0000027C 4EB9 0000 0000             	jsr InitZ80
00000282                            

00000282                            	; Init PSG
00000282 4EB9 0000 0000             	jsr InitPSG
00000288                            	
00000288                            	; Init VDP
00000288 4EB9 0000 0000             	jsr InitVDP
0000028E                            

0000028E                            	; Init gamepad ports
0000028E 4EB9 0000 0000             	jsr InitGamepads
00000294                            	
00000294                            	; Init EXT port
00000294 4EB9 0000 0000             	jsr InitEXTPort
0000029A                            

0000029A                            	; Cleanup registers
0000029A 207C 0000 0000             	move.l  #ram_start, a0     ; Move address of first byte of ram (contains zero, RAM has been cleared) to a0
000002A0 4CD0 7EFE                  	movem.l (a0), d1-d7/a1-a6  ; Multiple move zero to all registers (except sp)
000002A4 207C 0000 0000             	move.l  #0x00000000, a0    ; Clear a0
000002AA                            	
000002AA                            	; Set interrupt level
000002AA 40C0                       	move.w sr, d0
000002AC 0240 F8FF                  	andi.w #0xF8FF, d0	; INT level 3 (all interrupts)
000002B0 0040 0300                  	ori.w  #0x0300, d0	; TRACE bit for debugger (NOT FOR RELEASE)
000002B4 46C0                       	move.w d0, sr
000002B6 4280                       	clr.l  d0			; Clear d0
000002B8                            

000002B8                            	; ************************************
000002B8                            	; Main
000002B8                            	; ************************************
000002B8                            Main:
000002B8                            

000002B8 6000 0000                  	bra __main ; Begin external main
000002B8 6000 0000                  	bra __main ; Begin external main
000002BC                                  include 'framewk\collisn.asm'
000002BC                            

000002BC                            ;==============================================================
000002BC                            ;   WATERSHED - A game by Matt Phillips - (c) 2014
000002BC                            ;==============================================================
000002BC                            ;   BIG EVIL CORPORATION .co.uk
000002BC                            ;==============================================================
000002BC                            ;   collision.asm - Collision data loading, collision tests
000002BC                            ;==============================================================
000002BC                            	
000002BC                            FindFloor:
000002BC                            	; a0 - Level map data addr
000002BC                            	; a1 - Collision tile data addr
000002BC                            	; d0 (w) - Probe length
000002BC                            	; d1 (ww) - Probe XY coord (pixels, scroll space) (Y = out)
000002BC                            	; d2 (w) - Map total width (tiles)
000002BC                            	
000002BC                            	; Keep copy of Y coord for return val
000002BC 4286                       	clr.l  d6
000002BE 3C01                       	move.w d1, d6
000002C0                            	
000002C0                            	; Keep copy of map width (in words) for next row
000002C0 4287                       	clr.l  d7
000002C2 3E02                       	move.w d2, d7
000002C4 E38F                       	lsl.l  #0x1, d7
000002C6                            	
000002C6                            	; =====================================================================
000002C6                            	
000002C6                            	; Convert XY coord to tile offset
000002C6 4283                       	clr.l  d3
000002C8 3601                       	move.w d1, d3					; Y to d3
000002CA 86FC 0008                  	divu   #0x8, d3					; To tiles
000002CE 2803                       	move.l d3, d4					; Keep remainder for Y offset into tile
000002D0 0283 0000 FFFF             	and.l  #0x0000FFFF, d3			; Clear remainder
000002D6 C6C2                       	mulu   d2, d3 					; To Y offset
000002D8 4241                       	clr.w  d1
000002DA 4841                       	swap   d1						; X to lower d1
000002DC 82FC 0008                  	divu   #0x8, d1					; To tiles
000002E0 2A01                       	move.l d1, d5					; Keep remainder for X offset into tile, and odd/even nybble test
000002E2 0281 0000 FFFF             	and.l  #0x0000FFFF, d1			; Clear remainder
000002E8 D681                       	add.l  d1, d3					; Add X offset
000002EA                            	
000002EA                            	; =====================================================================
000002EA                            	
000002EA                            	; Fetch tile ID from RAM
000002EA 4282                       	clr.l  d2
000002EC E38B                       	lsl.l  #0x1, d3					; Tile offset to words
000002EE D1C3                       	add.l  d3, a0					; Offset ptr, needed for next tile
000002F0 3410                       	move.w (a0), d2					; Fetch map tile
000002F2 0242 07FF                  	andi.w #%0000011111111111, d2	; Mask out palette/flipping
000002F6                            	
000002F6                            	; =====================================================================
000002F6                            	
000002F6                            	; Y line offset into tile (using remainder)
000002F6 4244                       	clr.w  d4						; Clear quotient
000002F8 4844                       	swap   d4						; Remainder to lower d5
000002FA 3204                       	move.w d4, d1					; Keep for starting byte
000002FC C2FC 0008                  	mulu   #0x8, d1					; To nybble offset
00000300 E249                       	lsr.w  #0x1, d1					; To byte offset
00000302                            	
00000302                            	; Invert Y for lines remaining in tile (for loop counter)
00000302 363C 0008                  	move.w #0x8, d3
00000306 9604                       	sub.b  d4, d3
00000308                            	
00000308                            	; X byte offset into tile (using remainder)
00000308 4245                       	clr.w  d5						; Clear quotient
0000030A 4845                       	swap   d5						; Remainder to lower d4
0000030C 3805                       	move.w d5, d4					; Keep for odd/even nybble test
0000030E E24C                       	lsr.w  #0x1, d4					; To bytes
00000310 D244                       	add.w  d4, d1					; Add to offset
00000312                            	
00000312                            	; =====================================================================
00000312                            	
00000312                            	; Calc end of collision data
00000312                            	;move.w a1, d5
00000312                            	;add.l #(SizeScreenT*2), d5
00000312                            	
00000312                            	; Calc starting byte
00000312 2649                       	move.l a1, a3					; Backup tile data ROM addr in case next tile is needed
00000314 C4FC 0000                  	mulu   #bytes_per_tile, d2		; Tile ID to byte offset
00000318 D7C2                       	add.l  d2, a3					; Add offset into ROM tile data to address
0000031A D7C1                       	add.l  d1, a3					; Add offset into current tile to address
0000031C                            	
0000031C                            	; Y coord -1 for loop
0000031C 5346                       	sub.w #0x1, d6
0000031E                            	
0000031E                            	; =====================================================================
0000031E                            	
0000031E                            	; Floor find loop
0000031E                            	@CollisionByteCheckLp:
0000031E                            	
0000031E                            	;cmp.l  d5, a1					 ; Check end of collision data
0000031E                            	;bge    @EndCheck
0000031E                            	
0000031E                            	; Fetch current collision byte, increment Y counters
0000031E 1413                       	move.b (a3), d2		 		     ; Get collision byte
00000320 588B                       	add.l  #0x4, a3 			 	 ; Next byte downwards in tile
00000322 5246                       	add.w  #0x1, d6					 ; Increment Y coord
00000324 5303                       	sub.b  #0x1, d3					 ; Decrement lines remaning in tile
00000326 0C03 0000                  	cmpi.b #0x0, d3					 ; Check if no lines remaining in tile
0000032A 6600                       	bne.s  @LinesRemaining
0000032C                            	
0000032C                            	; No lines remaining in current tile, get next tile down
0000032C 4281                       	clr.l  d1
0000032E D1C7                       	add.l  d7, a0 					 ; Next tile ID down (map width (words) in d7)
00000330 3210                       	move.w (a0), d1					 ; Fetch map tile
00000332 0241 07FF                  	andi.w #%0000011111111111, d1	 ; Mask out palette/flipping
00000336 C2FC 0000                  	mulu   #bytes_per_tile, d1		 ; Tile ID to byte offset
0000033A 2649                       	move.l a1, a3					 ; Reset tile data ROM addr
0000033C D7C1                       	add.l  d1, a3					 ; Add offset into ROM tile data to address
0000033E D7C4                       	add.l  d4, a3					 ; Add X offset into current tile to address
00000340 163C 0007                  	move.b #0x7, d3					 ; 8 lines remaining in new tile
00000344                            	
00000344                            	; Check collision byte
00000344                            	@LinesRemaining:
00000344 0C02 0000                  	cmpi.b #0x0, d2    			     ; Check if byte nonzero
00000348 6600                       	bne.s  @CheckNybble				 ; If byte nonzero, check nybble
0000034A 51C8 FFD2                  	dbra   d0, @CollisionByteCheckLp ; Collision not found (probe length in d0)
0000034E 6000                       	bra.s  @EndCheck				 ; End of data
00000350                            	
00000350                            	; Check collision nybble
00000350                            	@CheckNybble:
00000350 0805 0001                  	btst   #0x1, d5				     ; Determine if the odd or even nybble is to be tested
00000354 6600                       	bne.s  @CheckUpperNybble
00000356 E80A                       	lsr.b  #0x4, d2					 ; Shift to lower nybble
00000358                            	@CheckUpperNybble:
00000358 0202 000F                  	andi.b #0x0F, d2				 ; Clear upper nybble
0000035C 0802 0074                  	btst   #col_bit_floor, d2		 ; Check for floor bit
00000360 6600                       	bne.s  @EndCheck				 ; Collision found
00000362 51C8 FFBA                  	dbra   d0, @CollisionByteCheckLp ; Collision not found (probe length in d0)
00000366                            

00000366                            	@EndCheck:
00000366                            	
00000366                            	; =====================================================================
00000366                            	
00000366                            	; Finished search
00000366 4281                       	clr.l  d1		   ; Clear return reg
00000368 0C40 FFFF                  	cmp.w  #0xFFFF, d0 ; d0 holds lines remaining, -1 if loop finished
0000036C 6700                       	beq.s  @Return     ; No collision found
0000036E                            	
0000036E                            	; Floor found, move to return reg
0000036E 3206                       	move.w  d6, d1
00000370                            

00000370                            	; Collision nybble in d2
00000370                            	@Return:
00000370 4E75                       	rts
00000370 4E75                       	rts
00000372                                  include 'framewk\gamepad.asm'
00000372                            ;==============================================================
00000372                            ;   BIG EVIL CORPORATION .co.uk
00000372                            ;==============================================================
00000372                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000372                            ;==============================================================
00000372                            ;   gamepad.asm - Gamepad reading
00000372                            ;==============================================================
00000372                            

00000372                            InitGamepads:
00000372 13FC 0000 0000 0000        	move.b #pad_byte_latch, pad_ctrl_a  ; Controller port 1 CTRL
0000037A 13FC 0000 0000 0000        	move.b #pad_byte_latch, pad_ctrl_b  ; Controller port 2 CTRL
00000382 4E75                       	rts
00000384                            	
00000384                            InitEXTPort:
00000384 13FC 0000 0000 0000        	move.b #pad_byte_latch, pad_ctrl_c  ; EXP port CTRL
0000038C 4E75                       	rts
0000038E                            

0000038E                            ReadPadA:
0000038E                            	; d0 (w) - Pad A return result (0000MXYZ SACBRLDU)
0000038E                            

0000038E 7000                           moveq	#0, d0
00000390 7200                       	moveq	#0, d1
00000392                            

00000392 13FC 0000 0000 0000        	move.b  #pad_byte_latch, pad_ctrl_a	; Set direction
0000039A 13FC 0000 0000 0000        	move.b  #pad_byte_latch, pad_data_a	; TH = 1
000003A2 4E71                       	nop
000003A4 4E71                       	nop
000003A6 1039 0000 0000             	move.b  pad_data_a, d0		; d0.b = X | 1 | C | B | R | L | D | U |
000003AC 0200 003F                  	andi.b	#0x3F, d0		    ; d0.b = 0 | 0 | C | B | R | L | D | U |
000003B0 13FC 0000 0000 0000        	move.b	#0x0, pad_data_a	; TH = 0
000003B8 4E71                       	nop
000003BA 4E71                       	nop
000003BC 1239 0000 0000             	move.b	pad_data_a, d1		; d1.b = X | 0 | S | A | 0 | 0 | D | U |
000003C2 0201 0030                  	andi.b	#0x30, d1		    ; d1.b = 0 | 0 | S | A | 0 | 0 | 0 | 0 |
000003C6 E509                       	lsl.b	#0x2, d1		    ; d1.b = S | A | 0 | 0 | D | U | 0 | 0 |
000003C8 8001                       	or.b	d1, d0			    ; d0.b = S | A | C | B | R | L | D | U |
000003CA 13FC 0000 0000 0000        	move.b  #pad_byte_latch, pad_data_a	; TH = 1
000003D2 4E71                       	nop
000003D4 4E71                       	nop
000003D6 13FC 0000 0000 0000        	move.b	#0x0, pad_data_a	; TH = 0
000003DE 4E71                       	nop
000003E0 4E71                       	nop
000003E2 0201 000F                      andi.b #$0F, d1             ; mask the high bits d1.b 0000MXYZ
000003E6 6600                       	bne.s @Pad1ANotA6ButtonPad   ; skip code below if it isn't a 6 button controller
000003E8 13FC 0000 0000 0000        	move.b	#pad_byte_latch, pad_data_a	 ; TH = 1
000003F0 4E71                       	nop
000003F2 4E71                       	nop
000003F4 1239 0000 0000             	move.b	pad_data_a, d1		; d1.b = X | X | X | X | M | X | Y | Z
000003FA 13FC 0000 0000 0000        	move.b  #0x0, pad_data_a	; TH = 0
00000402 0241 000F                  	andi.w	#0xF, d1		    ; d1.b = 0 | 0 | 0 | 0 | M | X | Y | Z
00000406 E149                       	lsl.w	#0x8, d1		    ; d1.w = 0 | 0 | 0 | 0 | M | X | Y | Z | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00000408 8041                       	or.w	d1, d0			    ; d0.w = 0 | 0 | 0 | 0 | M | X | Y | Z | S | A | C | B | R | L | D | U |
0000040A 4640                       	not.w	d0
0000040C                            @Pad1ANotA6ButtonPad
0000040C 3239 0000 0000             	move.w	joypadA, d1
00000412 B141                       	eor.w	d0, d1
00000414 C240                       	and.w	d0, d1
00000416 33C0 0000 0000             	move.w	d0, joypadA
0000041C 33C1 0000 0000             	move.w	d1, joypadA_press
00000422 4E75                           rts
00000424                            

00000424                            ReadPadB:
00000424                            	; d0 (w) - Pad B return result (0000MXYZ SACBRLDU)
00000424 7000                           moveq	#0, d0
00000426 7200                       	moveq	#0, d1
00000428                            

00000428 13FC 0000 0000 0000        	move.b  #pad_byte_latch, pad_ctrl_b	; Set direction
00000430 13FC 0000 0000 0000        	move.b  #pad_byte_latch, pad_data_b	; TH = 1
00000438 4E71                       	nop
0000043A 4E71                       	nop
0000043C 1039 0000 0000             	move.b  pad_data_b, d0		; d0.b = X | 1 | C | B | R | L | D | U |
00000442 0200 003F                  	andi.b	#0x3F, d0		    ; d0.b = 0 | 0 | C | B | R | L | D | U |
00000446 13FC 0000 0000 0000        	move.b	#0x0, pad_data_b	; TH = 0
0000044E 4E71                       	nop
00000450 4E71                       	nop
00000452 1239 0000 0000             	move.b	pad_data_b, d1		; d1.b = X | 0 | S | A | 0 | 0 | D | U |
00000458 0201 0030                  	andi.b	#0x30, d1		    ; d1.b = 0 | 0 | S | A | 0 | 0 | 0 | 0 |
0000045C E509                       	lsl.b	#0x2, d1		    ; d1.b = S | A | 0 | 0 | D | U | 0 | 0 |
0000045E 8001                       	or.b	d1, d0			    ; d0.b = S | A | C | B | R | L | D | U |
00000460 13FC 0000 0000 0000        	move.b  #pad_byte_latch, pad_data_b	; TH = 1
00000468 4E71                       	nop
0000046A 4E71                       	nop
0000046C 13FC 0000 0000 0000        	move.b	#0x0, pad_data_b	; TH = 0
00000474 4E71                       	nop
00000476 4E71                       	nop
00000478 13FC 0000 0000 0000        	move.b	#pad_byte_latch, pad_data_b	 ; TH = 1
00000480 4E71                       	nop
00000482 4E71                       	nop
00000484 0201 000F                      andi.b #$0F, d1             ; mask the high bits d1.b 0000MXYZ
00000488 6600                       	bne.s @Pad2ANotA6ButtonPad   ; skip code below if it isn't a 6 button controller
0000048A 1239 0000 0000             	move.b	pad_data_b, d1		; d1.b = X | X | X | X | M | X | Y | Z
00000490 13FC 0000 0000 0000        	move.b  #0x0, pad_data_b	; TH = 0
00000498 0241 000F                  	andi.w	#0xF, d1		    ; d1.b = 0 | 0 | 0 | 0 | M | X | Y | Z
0000049C E149                       	lsl.w	#0x8, d1		    ; d1.w = 0 | 0 | 0 | 0 | M | X | Y | Z | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0000049E 8041                       	or.w	d1, d0			    ; d0.w = 0 | 0 | 0 | 0 | M | X | Y | Z | S | A | C | B | R | L | D | U |
000004A0 4640                       	not.w	d0
000004A2                            @Pad2ANotA6ButtonPad
000004A2 3239 0000 0000             	move.w	joypadB, d1
000004A8 B141                       	eor.w	d0, d1
000004AA C240                       	and.w	d0, d1
000004AC 33C0 0000 0000             	move.w	d0, joypadB
000004B2 33C1 0000 0000             	move.w	d1, joypadB_press
000004B8 4E75                           rts
000004B8 4E75                           rts
000004BA                                  include 'framewk\interpts.asm'
000004BA                            ;==============================================================
000004BA                            ;   BIG EVIL CORPORATION .co.uk
000004BA                            ;==============================================================
000004BA                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
000004BA                            ;==============================================================
000004BA                            ;   interpts.asm - Interrupts and exceptions
000004BA                            ;==============================================================
000004BA                            

000004BA                            HBlankInterrupt:
000004BA 52B9 0000 0000                addi.l #0x1, hblank_counter    ; Increment hinterrupt counter
000004C0 4E73                          rte
000004C2                            

000004C2                            VBlankInterrupt:
000004C2                               ; Backup registers
000004C2 48E7 FFFF                     movem.l d0-a7,-(sp)
000004C6                            

000004C6                               ; Cache Joypad inputs
000004C6 4EB8 038E                     jsr ReadPadA
000004CA 4EB8 0424                     jsr ReadPadB
000004CE                            

000004CE 52B9 0000 0000                addi.l #0x1, vblank_counter    ; Increment vinterrupt counter
000004D4 4E40                          TRAP #0 ; Sync with debugger - NOT FOR RELEASE
000004D6                            

000004D6                               ; Restore registers
000004D6 4CDF FFFF                     movem.l (sp)+,d0-a7
000004DA 4E73                          rte
000004DC                            

000004DC                            Exception:
000004DC 4E73                          rte
000004DE                            

000004DE                            BusErrorException:
000004DE 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000004E6 23FC 0000 0000 0000 0000      move.l #BusErrorString, (error_code)                                        ; store error code in ram
000004F0 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000004F6 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000004FA 4E73                          rte
000004FC                            

000004FC                            AddressErrorException:
000004FC 33EF 0008 0000 0000           move.w 8(sp), (backup_pc)                                                   ; save pc state
00000504 23FC 0000 0000 0000 0000      move.l #AddressErrorString, (error_code)                                    ; store error code in ram
0000050E 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000514 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000518 4E73                          rte
0000051A                            

0000051A                            IllegalInstructionException:
0000051A 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000522 23FC 0000 0000 0000 0000      move.l #IllegalInstructionString, (error_code)                              ; store error code in ram
0000052C 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000532 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000536 4E73                          rte
00000538                            

00000538                            ZeroDivideException:
00000538 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000540 23FC 0000 0000 0000 0000      move.l #ZeroDivideString, (error_code)                                      ; store error code in ram
0000054A 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000550 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000554 4E73                          rte
00000556                            

00000556                            CHKInstructionException:
00000556 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000055E 23FC 0000 0000 0000 0000      move.l #CHKInstructionString, (error_code)                                  ; store error code in ram
00000568 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000056E 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000572 4E73                          rte
00000574                            

00000574                            TRAPVInstructionException:
00000574 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000057C 23FC 0000 0000 0000 0000      move.l #TRAPVInstructionString, (error_code)                                ; store error code in ram
00000586 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000058C 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000590 4E73                          rte
00000592                            

00000592                            PrivilegeViolationException:
00000592 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000059A 23FC 0000 0000 0000 0000      move.l #PrivilegeViolationString, (error_code)                              ; store error code in ram
000005A4 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000005AA 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000005AE 4E73                          rte
000005B0                            

000005B0                            TRACEException:
000005B0 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000005B8 23FC 0000 0000 0000 0000      move.l #TRACEString, (error_code)                                           ; store error code in ram
000005C2 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000005C8 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000005CC 4E73                          rte
000005CE                            

000005CE                            LineAEmulator:
000005CE 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000005D6 23FC 0000 0000 0000 0000      move.l #LineAEmulatorString, (error_code)                                   ; store error code in ram
000005E0 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000005E6 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000005EA 4E73                          rte
000005EC                            

000005EC                            LineFEmulator:
000005EC 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000005F4 23FC 0000 0000 0000 0000      move.l #LineFEmulatorString, (error_code)                                   ; store error code in ram
000005FE 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000604 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000608 4E73                          rte
0000060A                            

0000060A                            TRAP00Exception:
0000060A 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000612 23FC 0000 0000 0000 0000      move.l #TRAP00ExceptionString, (error_code)                                 ; store error code in ram
0000061C 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000622 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000626 4E73                          rte
00000628                            

00000628                            TRAP01Exception:
00000628 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000630 23FC 0000 0000 0000 0000      move.l #TRAP01ExceptionString, (error_code)                                 ; store error code in ram
0000063A 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000640 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000644 4E73                          rte
00000646                            

00000646                            TRAP02Exception:
00000646 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000064E 23FC 0000 0000 0000 0000      move.l #TRAP02ExceptionString, (error_code)                                 ; store error code in ram
00000658 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000065E 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000662 4E73                          rte
00000664                            

00000664                            TRAP03Exception:
00000664 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000066C 23FC 0000 0000 0000 0000      move.l #TRAP03ExceptionString, (error_code)                                 ; store error code in ram
00000676 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000067C 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000680 4E73                          rte
00000682                            

00000682                            TRAP04Exception:
00000682 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000068A 23FC 0000 0000 0000 0000      move.l #TRAP04ExceptionString, (error_code)                                 ; store error code in ram
00000694 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000069A 4E72 2700                     stop #$2700                                                                 ; Halt CPU
0000069E 4E73                          rte
000006A0                            

000006A0                            TRAP05Exception:
000006A0 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000006A8 23FC 0000 0000 0000 0000      move.l #TRAP05ExceptionString, (error_code)                                 ; store error code in ram
000006B2 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000006B8 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000006BC 4E73                          rte
000006BE                            

000006BE                            TRAP06Exception:
000006BE 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000006C6 23FC 0000 0000 0000 0000      move.l #TRAP06ExceptionString, (error_code)                                 ; store error code in ram
000006D0 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000006D6 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000006DA 4E73                          rte
000006DC                            

000006DC                            TRAP07Exception:
000006DC 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000006E4 23FC 0000 0000 0000 0000      move.l #TRAP07ExceptionString, (error_code)                                 ; store error code in ram
000006EE 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000006F4 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000006F8 4E73                          rte
000006FA                            

000006FA                            TRAP08Exception:
000006FA 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000702 23FC 0000 0000 0000 0000      move.l #TRAP08ExceptionString, (error_code)                                 ; store error code in ram
0000070C 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000712 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000716 4E73                          rte
00000718                            

00000718                            TRAP09Exception:
00000718 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000720 23FC 0000 0000 0000 0000      move.l #TRAP09ExceptionString, (error_code)                                 ; store error code in ram
0000072A 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
00000730 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000734 4E73                          rte
00000736                            TRAP10Exception:
00000736 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000073E 23FC 0000 0000 0000 0000      move.l #TRAP10ExceptionString, (error_code)                                 ; store error code in ram
00000748 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000074E 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000752 4E73                          rte
00000754                            

00000754                            TRAP11Exception:
00000754 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000075C 23FC 0000 0000 0000 0000      move.l #TRAP11ExceptionString, (error_code)                                 ; store error code in ram
00000766 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000076C 4E72 2700                     stop #$2700                                                                 ; Halt CPU
00000770 4E73                          rte
00000772                            

00000772                            TRAP12Exception:
00000772 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
0000077A 23FC 0000 0000 0000 0000      move.l #TRAP12ExceptionString, (error_code)                                 ; store error code in ram
00000784 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
0000078A 4E72 2700                     stop #$2700                                                                 ; Halt CPU
0000078E 4E73                          rte
00000790                            

00000790                            TRAP13Exception:
00000790 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
00000798 23FC 0000 0000 0000 0000      move.l #TRAP13ExceptionString, (error_code)                                 ; store error code in ram
000007A2 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000007A8 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000007AC 4E73                          rte
000007AE                            

000007AE                            TRAP14Exception:
000007AE 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000007B6 23FC 0000 0000 0000 0000      move.l #TRAP14ExceptionString, (error_code)                                 ; store error code in ram
000007C0 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000007C6 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000007CA 4E73                          rte
000007CC                            

000007CC                            TRAP15Exception:
000007CC 33EF 0002 0000 0000           move.w 2(sp), (backup_pc)                                                   ; save pc state
000007D4 23FC 0000 0000 0000 0000      move.l #TRAP15ExceptionString, (error_code)                                 ; store error code in ram
000007DE 4EF9 0000 0000                jmp CrashHandler_Init                                                       ; jump to crash handler
000007E4 4E72 2700                     stop #$2700                                                                 ; Halt CPU
000007E8 4E73                          rte
000007EA                            

000007EA                            NullInterrupt:
000007EA 4E73                          rte
000007EA 4E73                          rte
000007EC                                  include 'framewk\megacd.asm'
000007EC                            ;==============================================================
000007EC                            ;   BIG EVIL CORPORATION .co.uk
000007EC                            ;==============================================================
000007EC                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
000007EC                            ;==============================================================
000007EC                            ;   megacd.asm - MegaCD init routines
000007EC                            ;==============================================================
000007EC                            

000007EC                            ; TODO: move to stdlib.asm
000007EC                            ; String compare
000007EC                            ; a0 - Address of string 1
000007EC                            ; a1 - Address of string 2
000007EC                            ; d0 - Return value: 0 if match, else index+1 of first different char
000007EC                            

000007EC                            CompareString:
000007EC 4280                               clr.l d0         ; Clear d0 for return val
000007EE 4283                               clr.l d3         ; Clear d3 for char counter
000007F0                            

000007F0                                    @strchecklp:
000007F0                                    ; Copy chars
000007F0 1218                               move.b (a0)+, d1 ; Copy char from str1 and increment addr
000007F2 1419                               move.b (a1)+, d2 ; Copy char from str2 and increment addr
000007F4                            

000007F4                                    ; Compare chars (BEFORE checking EOS, lengths may differ)
000007F4 9401                               sub.b d1, d2     ; Compare chars
000007F6 6600                               bne.s strcmp_diff  ; Chars differ, return
000007F8                            

000007F8                                    ; Check for end of string
000007F8 0C01 0000                          cmp.b #0x0, d1   ; Check char 1 for 0
000007FC 6700                               beq.s strcmp_end   ; End of string, return
000007FE                                    
000007FE 5243                               addi #0x1, d3    ; Increment char counter
00000800 4EF8 07F0                          jmp @strchecklp
00000804                            

00000804                            strcmp_diff:
00000804 2003                               move.l d3, d0    ; Strings diff, move idx to return val
00000806 5240                               addi   #0x1, d0  ; Index+1
00000808                            

00000808                            strcmp_end:
00000808 4E75                               rts
0000080A                            

0000080A                            

0000080A                            ; Checks if MegaCD is attached and returns BIOS type
0000080A                            ; (looks at MCD signature in BIOS header)
0000080A                            ; d0 - Return value: BIOS index if MCD present, 0 if not
0000080A                            

0000080A                            GetMCDType:
0000080A                                    ; Check BIOS signature 1
0000080A 41F9 0000 0000                     lea mcd_sig_1, a0
00000810 43F9 0000 0000                     lea mcd_bios_addr_1+mcd_sig_offset, a1
00000816 4EB8 07EC                          jsr CompareString
0000081A 0C00 0000                          cmp.b #0x0, d0
0000081E 6600                               bne.s @NotType1
00000820 7201                               move.l #0x1, d1 ; Found type 1
00000822 4E75                               rts
00000824                            

00000824                                    @NotType1:
00000824 41F9 0000 0000                     lea mcd_sig_2, a0
0000082A 43F9 0000 0000                     lea mcd_bios_addr_2+mcd_sig_offset, a1
00000830 4EB8 07EC                          jsr CompareString
00000834 0C00 0000                          cmp.b #0x0, d0
00000838 6600                               bne.s @NotType2
0000083A 7202                               move.l #0x2, d1 ; Found type 2
0000083C 4E75                               rts
0000083E                            

0000083E                                    @NotType2:
0000083E 41F9 0000 0000                     lea mcd_sig_3, a0
00000844 43F9 0000 0000                     lea mcd_bios_addr_3+mcd_sig_offset, a1
0000084A 4EB8 07EC                          jsr CompareString
0000084E 0C00 0000                          cmp.b #0x0, d0
00000852 6600                               bne.s @NotType3
00000854 7203                               move.l #0x3, d1 ; Found type 3
00000856 4E75                               rts
00000858                            

00000858                                    @NotType3:
00000858 41F9 0000 0000                     lea mcd_sig_4, a0
0000085E 43F9 0000 0000                     lea mcd_bios_addr_4+mcd_sig_offset, a1
00000864 4EB8 07EC                          jsr CompareString
00000868 0C00 0000                          cmp.b #0x0, d0
0000086C 6600                               bne.s @NotType4
0000086E 7204                               move.l #0x4, d1 ; Found type 4
00000870 4E75                               rts
00000872                            

00000872                                    @NotType4:
00000872 4280                               clr.l d0 ; MegaCD not found
00000874 4E75                               rts
00000876                            

00000876                            MCD_RestoreHINT:
00000876                                    ; Put HINT vector back into the table
00000876 21FC 0000 0000 FD08                move.l #SubCPU_int, (0xFFFFFD08).w
0000087E 33FC 04BA 00A1 2006                move.w #HBlankInterrupt, (0x00A12006).l
00000886 21FC 0000 0000 FD0E                move.l #SubCPU_rte, (0xFFFFFD0E).w
0000088E                            

0000088E 4E75                       	rts
00000890                            

00000890                            ; Initialise MegaCD in Mode 1 (boot from cartridge)
00000890                            InitMCD_Mode1:
00000890                            

00000890                                    ; Put HINT vector back into the table
00000890 21FC 0000 0000 FD08                move.l #SubCPU_int, (0xFFFFFD08).w
00000898 33FC 04BA 00A1 2006                move.w #HBlankInterrupt, (0x00A12006).l
000008A0 21FC 0000 0000 FD0E                move.l #SubCPU_rte, (0xFFFFFD0E).w
000008A8                            

000008A8                                    ; Reset gate array
000008A8 23F9 0000 FF00 00A1 2002           move.l 0xFF00, 0x00A12002
000008B2 13F8 0003 00A1 2001                move.b 0x03, 0x00A12001
000008BA 13F8 0002 00A1 2001                move.b 0x02, 0x00A12001
000008C2 13F8 0000 00A1 2001                move.b 0x00, 0x00A12001
000008CA                            

000008CA                                    ; Reset SUB-CPU, wait for bus access
000008CA                                    @WaitForBus:
000008CA 13FC 0002 00A1 2001                move.b #0x02, 0x00A12001 ; Reset, request bus
000008D2 1039 00A1 2001                     move.b 0x00A12001, d0    ; Check for bus access
000008D8 0800 0001                          btst #0x1, d0
000008DC 67EC                               beq.s @WaitForBus
000008DE                            

000008DE 13FC 0000 00A1 200E                move.b #0x00, 0x00A1200E ; Clear main comm port
000008E6 13FC 002A 00A1 2002                move.b #0x2A, 0x00A12002 ; Write protect up to 0x00005400
000008EE                                    
000008EE                                    ; Run SUB-CPU, wait until started
000008EE                                    @WaitForRun:
000008EE 13FC 0001 00A1 2001                move.b #0x01, 0x00A12001 ; Clear bus req, run SUB-CPU
000008F6 1039 00A1 2001                     move.b 0x00A12001, d0    ; Check if running
000008FC 0800 0000                          btst #0x0, d0
00000900 67EC                               beq.s @WaitForRun
00000902                            

00000902 4E75                               rts
00000904                            

00000904                            

00000904                            SubCPU_int:
00000904 08F9 0000 00A1 2000                bset #0x0, (0x00A12000).l
0000090C                            

0000090C                            SubCPU_rte:
0000090C 4E73                               rte
0000090C 4E73                               rte
0000090E                                  include 'framewk\memory.asm'
0000090E                            ;==============================================================
0000090E                            ;   BIG EVIL CORPORATION .co.uk
0000090E                            ;==============================================================
0000090E                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
0000090E                            ;==============================================================
0000090E                            ;   memory.asm - RAM routines
0000090E                            ;==============================================================
0000090E                            

0000090E                            ClearRAM:
0000090E                            

0000090E 2017                       	move.l (sp), d0			   ; Backup subroutine return address from stack
00000910 207C 0000 0000             	move.l #ram_start, a0      ; Start address
00000916 223C 0000 0000             	move.l #(ram_size_l-1), d1 ; Clearing 64k's worth of longwords (minus 1 for loop counter)
0000091C                            	
0000091C                            	@Clear:
0000091C 20FC 0000 0000             	move.l #0x00000000, (a0)+  ; Write 0 and increment
00000922 51C9 FFF8                  	dbra d1, @Clear            ; Decrement d0, repeat until depleted
00000926                            	
00000926 2E79 0000 0000             	move.l stack_top, sp	   ; Reset stack
0000092C 2F00                       	move.l d0, -(sp)		   ; Restore return address
0000092E 4E75                       	rts
0000092E 4E75                       	rts
00000930                                  include 'framewk\psg.asm'
00000930                            ;==============================================================
00000930                            ;   BIG EVIL CORPORATION .co.uk
00000930                            ;==============================================================
00000930                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000930                            ;==============================================================
00000930                            ;   psg.asm - PSG initialisation and control
00000930                            ;==============================================================
00000930                            

00000930                            InitPSG:
00000930                            

00000930 207C 0000 0000             	move.l #PSGInitData, a0    ; Load address of PSG data into a0
00000936 7003                       	move.l #0x03, d0           ; 4 bytes of data
00000938                            	@CopyPSG:
00000938 13D8 0000 0000             	move.b (a0)+, psg_control  ; Copy data to PSG RAM
0000093E 51C8 FFF8                  	dbra d0, @CopyPSG
00000942                            	
00000942 4E75                       	rts
00000942 4E75                       	rts
00000944                                  include 'framewk\sprites.asm'
00000944                            LoadTiles:
00000944                            	; a0 - Tiles address (l)
00000944                            	; d0 - VRAM address (l)
00000944                            	; d1 - Num tiles (w)
00000944                            

00000944                            	; Address bit pattern: --DC BA98 7654 3210 ---- ---- ---- --FE
00000944 0680 0000 0000             	add.l   #vram_addr_tiles, d0	; Add VRAM address offset
0000094A E598                       	rol.l   #0x2, d0				; Roll bits 14/15 of address to bits 16/17
0000094C E448                       	lsr.w   #0x2, d0				; Shift lower word back
0000094E 4840                       	swap    d0                     	; Swap address hi/lo
00000950 0080 0000 0000             	ori.l   #vdp_cmd_vram_write, d0 ; OR in VRAM write command
00000956 23C0 0000 0000             	move.l  d0, vdp_control        	; Move dest address to VDP control port
0000095C                            	
0000095C 0281 0000 FFFF             	and.l   #0x0000FFFF, d1
00000962 5341                       	sub.w	#0x1, d1				; Num tiles - 1
00000964                            	@CharCopy:
00000964 343C 0007                  	move.w	#0x07, d2				; 8 longwords in tile
00000968                            	@LongCopy:
00000968 23D8 0000 0000             	move.l	(a0)+, vdp_data			; Copy one line of tile to VDP data port
0000096E 51CA FFF8                  	dbra	d2, @LongCopy
00000972 51C9 FFF0                  	dbra	d1, @CharCopy
00000976                            	
00000976 4E75                       	rts
00000978                            

00000978                            LoadSpriteTable:
00000978                            	; a0 --- Sprite data address
00000978                            	; d0 (b) Sprite index
00000978                            

00000978 0280 0000 00FF             	and.l   #0x000000FF, d0
0000097E C0FC 0000                  	mulu.w  #SizeSpriteDesc, d0          ; Offset into sprite table
00000982 4840                       	swap    d0                           ; To upper word
00000984 0080 0000 0000             	or.l    #vdp_write_sprite_table, d0  ; Add to write address
0000098A 23C0 0000 0000             	move.l	d0, vdp_control				 ; Set read address
00000990                            	
00000990 23D8 0000 0000             	move.l	(a0)+, vdp_data    			 ; 8 bytes of data
00000996 23D8 0000 0000             	move.l	(a0)+, vdp_data
0000099C                            	
0000099C 4E75                       	rts
0000099E                            	
0000099E                            LoadSpriteTables:
0000099E                            	; a0 --- Sprite data address
0000099E                            	; d0 (b) Number of sprites
0000099E                            

0000099E 23FC 0000 0000 0000 0000   	move.l	#vdp_write_sprite_table, vdp_control
000009A8                            	
000009A8 0280 0000 00FF             	and.l   #0x000000FF, d0
000009AE 5300                       	subq.b	#0x1, d0           ; Minus 1 for counter
000009B0                            	@AttrCopy:
000009B0 23D8 0000 0000             	move.l	(a0)+, vdp_data    ; 8 bytes of data
000009B6 23D8 0000 0000             	move.l	(a0)+, vdp_data
000009BC 51C8 FFF2                  	dbra	d0, @AttrCopy
000009C0                            	
000009C0 4E75                       	rts
000009C2                            	
000009C2                            LinkSprite:
000009C2                            	; d0 (b) Prev index
000009C2                            	; d1 (b) Next index
000009C2                            	
000009C2 0280 0000 00FF             	and.l   #0x000000FF, d0
000009C8 0281 0000 00FF             	and.l   #0x000000FF, d1
000009CE                            	
000009CE C0FC 0000                  	mulu.w  #SizeSpriteDesc, d0          ; Offset into sprite table
000009D2 5440                       	addi.w  #0x2, d0                     ; Byte 2 holds dimensions, byte 3 holds next index
000009D4 4840                       	swap    d0                           ; To upper word
000009D6                            	
000009D6 2400                       	move.l  d0, d2                       ; Backup d2
000009D8 0082 0000 0000             	or.l    #vdp_read_sprite_table, d2   ; Add to read address
000009DE 23C2 0000 0000             	move.l	d2, vdp_control              ; Set read address
000009E4 3439 0000 0000             	move.w  vdp_data, d2                 ; Read word from VDP
000009EA                            

000009EA 1401                       	move.b  d1, d2       				 ; Set next sprite ID
000009EC                            

000009EC 0080 0000 0000             	or.l    #vdp_write_sprite_table, d0  ; Add write address to offset
000009F2 23C0 0000 0000             	move.l	d0, vdp_control              ; Set dest address
000009F8 33C2 0000 0000             	move.w  d2, vdp_data                 ; Write word back
000009FE                            	
000009FE 4E75                       	rts
00000A00                            

00000A00                            SetSpritePosX:
00000A00                            	; Set sprite X position
00000A00                            	; d0 (b)  - Sprite ID
00000A00                            	; d1 (w)  - X coord
00000A00                            	; d2 (bb) - Sprite dimensions (width/height in subsprites)
00000A00                            	; d3 (w)  - Sprite width (pixels)
00000A00                            	; d4 (b)  - X flipped
00000A00                            	; a1 ---- - Subsprite dimensions array
00000A00                            	
00000A00                            	; Correct X coord for flipping
00000A00 0C04 0000                  	cmp.b #0x0, d4
00000A04 6700                       	beq.s @NoFlipX
00000A06 D243                       	add.w d3, d1	; Flipped, working from right to left
00000A08                            	@NoFlipX:
00000A08                            		
00000A08                            	; Loop columns
00000A08 4283                       	clr.l  d3
00000A0A 3602                       	move.w d2, d3
00000A0C E04B                       	lsr.w  #0x8, d3 ; Num cols to bottom byte
00000A0E 5343                       	sub.w  #0x1, d3 ; -1 for loop counter
00000A10                            	@ColLp:
00000A10                            		
00000A10 3A11                       		move.w (a1), d5		; Get subsprite width/height from dimensions array
00000A12 E04D                       		lsr.w  #0x8, d5		; Get width
00000A14 0245 00FF                  		andi.w #0xFF, d5
00000A18 CAFC 0008                  		mulu   #0x8, d5		; To pixels
00000A1C                            	
00000A1C                            		; If flipped, pre-decrement X pos
00000A1C 0C04 0000                  		cmp.b #0x0, d4
00000A20 6700                       		beq.s @NoPreDec
00000A22 9245                       		sub.w  d5, d1       ; Working right to left, sub width
00000A24                            		@NoPreDec:
00000A24                            			
00000A24                            		; Loop rows
00000A24 4286                       		clr.l  d6
00000A26 3C02                       		move.w d2, d6
00000A28 0246 00FF                  		and.w  #0xFF, d6; Num rows in bottom byte
00000A2C 5346                       		sub.w  #0x1, d6 ; -1 for loop counter
00000A2E                            		@RowLp:
00000A2E                            		
00000A2E                            			; Write X position
00000A2E 4287                       			clr.l	d7						; Clear d7
00000A30 1E00                       			move.b	d0, d7					; Move sprite ID to d7
00000A32                            	
00000A32 CEFC 0000                  			mulu.w	#SizeSpriteDesc, d7		; Sprite array offset
00000A36 5C07                       			add.b	#0x6, d7				; X coord offset
00000A38 4847                       			swap	d7						; Move to upper word
00000A3A 0087 0000 0000             			or.l	#vdp_write_sprite_table, d7	; Add to sprite attr table
00000A40                            	
00000A40 23C7 0000 0000             			move.l	d7, vdp_control			; Set dest address
00000A46 33C1 0000 0000             			move.w	d1, vdp_data			; Move X pos to data port
00000A4C                            

00000A4C 5240                       			addq.w  #0x1, d0				; Next subsprite ID
00000A4E 5489                       			addi.l  #0x2, a1				; Next subsprite dimension
00000A50                            		
00000A50 51CE FFDC                  			dbra    d6, @RowLp
00000A54                            			
00000A54                            		; If not flipped, post-increment X pos
00000A54 0C04 0000                  		cmp.b #0x0, d4
00000A58 6600                       		bne.s @NoPostInc
00000A5A D245                       		add.w  d5, d1       ; Working left to right, add width
00000A5C                            		@NoPostInc:
00000A5C                            

00000A5C 51CB FFB2                  		dbra d3, @ColLp
00000A60                            

00000A60 4E75                       	rts
00000A62                            

00000A62                            SetSpritePosY:
00000A62                            	; Set sprite Y position
00000A62                            	; d0 (b)  - Sprite ID
00000A62                            	; d1 (w)  - Y coord
00000A62                            	; d2 (bb) - Sprite dimensions (width/height in subsprites)
00000A62                            	; d3 (w)  - Sprite height (pixels)
00000A62                            	; d4 (b)  - Y flipped
00000A62                            	; a1 ---- - Subsprite dimensions array
00000A62                            	
00000A62                            	; Correct Y coord for flipping
00000A62 0C04 0000                  	cmp.b #0x0, d4
00000A66 6700                       	beq.s @NoFlipY
00000A68 D243                       	add.w d3, d1	; Flipped, working from bottom to top
00000A6A                            	@NoFlipY:
00000A6A                            	
00000A6A                            	; Backup height
00000A6A 3A01                       	move.w d1, d5
00000A6C                            		
00000A6C                            	; Loop columns
00000A6C 4283                       	clr.l  d3
00000A6E 3602                       	move.w d2, d3
00000A70 E04B                       	lsr.w  #0x8, d3 ; Num cols to bottom byte
00000A72 5343                       	sub.w  #0x1, d3 ; -1 for loop counter
00000A74                            	@ColLp:
00000A74                            		
00000A74                            		; Reset height
00000A74 3205                       		move.w d5, d1
00000A76                            		
00000A76                            		; Loop rows
00000A76 4286                       		clr.l  d6
00000A78 3C02                       		move.w d2, d6
00000A7A 0246 00FF                  		and.w  #0xFF, d6; Num rows in bottom byte
00000A7E 5346                       		sub.w  #0x1, d6 ; -1 for loop counter
00000A80                            		@RowLp:
00000A80                            		
00000A80                            			; If flipped, pre-decrement Y pos
00000A80 0C04 0000                  			cmp.b #0x0, d4
00000A84 6700                       			beq.s @NoPreDec
00000A86 3E19                       			move.w (a1)+, d7	; Get subsprite width/height from dimensions array
00000A88 0247 00FF                  			andi.w #0xFF, d7	; Get height
00000A8C CEFC 0008                  			mulu   #0x8, d7		; To pixels
00000A90 9247                       			sub.w  d7, d1       ; Working bottom to top, sub height
00000A92                            			@NoPreDec:
00000A92                            		
00000A92                            			; Write X position
00000A92 4287                       			clr.l	d7						; Clear d7
00000A94 1E00                       			move.b	d0, d7					; Move sprite ID to d7
00000A96                            	
00000A96 CEFC 0000                  			mulu.w	#SizeSpriteDesc, d7		; Sprite array offset, Y in first byte
00000A9A 4847                       			swap	d7						; Move to upper word
00000A9C 0087 0000 0000             			or.l	#vdp_write_sprite_table, d7	; Add to sprite attr table
00000AA2                            	
00000AA2 23C7 0000 0000             			move.l	d7, vdp_control			; Set dest address
00000AA8 33C1 0000 0000             			move.w	d1, vdp_data			; Move Y pos to data port
00000AAE                            

00000AAE 5240                       			addq.w  #0x1, d0				; Next subsprite ID
00000AB0                            		
00000AB0                            			; If not flipped, post-increment Y pos
00000AB0 0C04 0000                  			cmp.b #0x0, d4
00000AB4 6600                       			bne.s @NoPostInc
00000AB6 3E19                       			move.w (a1)+, d7	; Get subsprite width/height from dimensions array
00000AB8 0247 00FF                  			andi.w #0xFF, d7	; Get height
00000ABC CEFC 0008                  			mulu   #0x8, d7		; To pixels
00000AC0 D247                       			add.w  d7, d1       ; Working top to bottom, add height
00000AC2                            			@NoPostInc:
00000AC2                            		
00000AC2 51CE FFBC                  			dbra    d6, @RowLp
00000AC6                            

00000AC6 51CB FFAC                  		dbra d3, @ColLp
00000ACA                            

00000ACA 4E75                       	rts
00000ACC                            	
00000ACC                            SetSubSpritePosX:
00000ACC                            	; Set sprite X position
00000ACC                            	; d0 (b) - Sprite ID
00000ACC                            	; d1 (w) - X coord
00000ACC                            

00000ACC 4283                       	clr.l	d3						; Clear d3
00000ACE 1600                       	move.b	d0, d3					; Move sprite ID to d3
00000AD0                            	
00000AD0 C6FC 0000                  	mulu.w	#SizeSpriteDesc, d3		; Sprite array offset
00000AD4 5C03                       	add.b	#0x6, d3				; X coord offset
00000AD6 4843                       	swap	d3						; Move to upper word
00000AD8 0083 0000 0000             	or.l	#vdp_write_sprite_table, d3	; Add to sprite attr table
00000ADE                            	
00000ADE 23C3 0000 0000             	move.l	d3, vdp_control			; Set dest address
00000AE4 33C1 0000 0000             	move.w	d1, vdp_data			; Move X pos to data port
00000AEA                            

00000AEA 4E75                       	rts
00000AEC                            		
00000AEC                            SetSubSpritePosY:
00000AEC                            	; Set sprite Y position
00000AEC                            	; d0 (b) - Sprite ID
00000AEC                            	; d1 (w) - Y coord
00000AEC                            

00000AEC 4283                       	clr.l	d3						; Clear d3
00000AEE 1600                       	move.b	d0, d3					; Move sprite ID to d3
00000AF0                            	
00000AF0 C6FC 0000                  	mulu.w	#SizeSpriteDesc, d3		; Sprite array offset
00000AF4 4843                       	swap	d3						; Move to upper word
00000AF6 0083 0000 0000             	or.l	#vdp_write_sprite_table, d3	; Add to sprite attr table
00000AFC                            	
00000AFC 23C3 0000 0000             	move.l	d3, vdp_control			; Set dest address
00000B02 33C1 0000 0000             	move.w	d1, vdp_data			; Move Y pos to data port
00000B08                            	
00000B08 4E75                       	rts
00000B0A                            

00000B0A                            SpriteHFlipOn:
00000B0A                            	; d0 (w) - Sprite ID
00000B0A                            	; d1 (b) - Num sub-sprites
00000B0A                            

00000B0A 0281 0000 00FF             	and.l   #0x000000FF, d1				 ; Clear rest of d1
00000B10 5341                       	subq    #0x1, d1					 ; -1 for loop counter
00000B12                            	@SubSpriteLp:
00000B12 4282                       	clr.l   d2
00000B14 1400                       	move.b  d0, d2
00000B16 C4FC 0000                  	mulu.w  #SizeSpriteDesc, d2          ; Offset into sprite table
00000B1A 5842                       	addi.w  #0x4, d2                     ; Bytes 4 and 5 hold flipping/palette/priority/ID
00000B1C 0682 0000 0000             	add.l   #vram_addr_sprite_table, d2	 ; Add VRAM address offset
00000B22 E59A                       	rol.l   #0x2, d2					 ; Roll bits 14/15 of address to bits 16/17
00000B24 E44A                       	lsr.w   #0x2, d2					 ; Shift lower word back
00000B26 4842                       	swap    d2                     		 ; Swap address hi/lo
00000B28                            

00000B28 2602                       	move.l  d2, d3                       ; To d3 (we need the address again to write back)
00000B2A 0083 0000 0000             	ori.l   #vdp_cmd_vram_read, d3       ; OR in VRAM read command
00000B30 23C3 0000 0000             	move.l	d3, vdp_control              ; Set read command+address
00000B36 3639 0000 0000             	move.w  vdp_data, d3                 ; Read word from VDP
00000B3C                            

00000B3C 0043 0800                  	or.w    #%0000100000000000, d3       ; Mask in H flipping (bit 3 of the upper byte)
00000B40                            

00000B40 0082 0000 0000             	or.l    #vdp_cmd_vram_write, d2      ; OR in VRAM write command
00000B46 23C2 0000 0000             	move.l	d2, vdp_control              ; Set write command+address
00000B4C 33C3 0000 0000             	move.w  d3, vdp_data                 ; Write word back
00000B52                            	
00000B52 5240                       	addq    #0x1, d0					 ; Next sub-sprite
00000B54 51C9 FFBC                  	dbra    d1, @SubSpriteLp			 ; Loop
00000B58                            

00000B58 4E75                       	rts
00000B5A                            

00000B5A                            SpriteHFlipOff:
00000B5A                            	; d0 (w) - Sprite ID
00000B5A                            	; d1 (b) - Num sub-sprites
00000B5A                            

00000B5A 0281 0000 00FF             	and.l   #0x000000FF, d1				 ; Clear rest of d1
00000B60 5341                       	subq    #0x1, d1					 ; -1 for loop counter
00000B62                            	@SubSpriteLp:
00000B62 4282                       	clr.l   d2
00000B64 1400                       	move.b  d0, d2
00000B66 C4FC 0000                  	mulu.w  #SizeSpriteDesc, d2          ; Offset into sprite table
00000B6A 5842                       	addi.w  #0x4, d2                     ; Bytes 4 and 5 hold flipping/palette/priority/ID
00000B6C 0682 0000 0000             	add.l   #vram_addr_sprite_table, d2	 ; Add VRAM address offset
00000B72 E59A                       	rol.l   #0x2, d2					 ; Roll bits 14/15 of address to bits 16/17
00000B74 E44A                       	lsr.w   #0x2, d2					 ; Shift lower word back
00000B76 4842                       	swap    d2                     		 ; Swap address hi/lo
00000B78                            

00000B78 2602                       	move.l  d2, d3                       ; To d3 (we need the offset again later)
00000B7A 0083 0000 0000             	ori.l   #vdp_cmd_vram_read, d3       ; OR in VRAM read command
00000B80 23C3 0000 0000             	move.l	d3, vdp_control              ; Set read command+address
00000B86 3639 0000 0000             	move.w  vdp_data, d3                 ; Read word from VDP
00000B8C                            

00000B8C 0243 F7FF                  	and.w   #%1111011111111111, d3       ; Mask out H flipping (bit 3 of the upper byte)
00000B90                            

00000B90 0082 0000 0000             	or.l    #vdp_cmd_vram_write, d2      ; OR in VRAM write command
00000B96 23C2 0000 0000             	move.l	d2, vdp_control              ; Set write command+address
00000B9C 33C3 0000 0000             	move.w  d3, vdp_data                 ; Write word back
00000BA2                            	
00000BA2 5240                       	addq    #0x1, d0					 ; Next sub-sprite
00000BA4 51C9 FFBC                  	dbra    d1, @SubSpriteLp			 ; Loop
00000BA8                            

00000BA8 4E75                       	rts
00000BAA                            

00000BAA                            GetCurrSpriteFrame:
00000BAA                                ; d0 (w) Return frame ID
00000BAA                            	; a1 --- Address of animation data (ROM)
00000BAA                            	; a2 --- Address of animation frame counter (RAM, writeable)
00000BAA                            

00000BAA 4283                       	clr.l  d3              ; Clear d3
00000BAC 1612                       	move.b (a2), d3        ; Read current anim frame number (d3)
00000BAE 1031 3000                  	move.b (a1,d3.w), d0   ; Get original frame index (d4) from anim data array, store in d0
00000BB2                            

00000BB2 4E75                       	rts
00000BB4                            

00000BB4                            GetNextSpriteFrame:
00000BB4                                ; Gets next sprite frame ID from animation data (returns in d0)
00000BB4                            	; and advances frame counter
00000BB4                            

00000BB4                                ; d0 (w) Return frame ID
00000BB4                                ; d1 (w) Number of anim frames
00000BB4                            	; a1 --- Address of animation data (ROM)
00000BB4                            	; a2 --- Address of animation frame counter (RAM, writeable)
00000BB4                            

00000BB4 4283                       	clr.l  d3              ; Clear d3
00000BB6 1612                       	move.b (a2), d3        ; Read current anim frame number (d3)
00000BB8 5212                       	addi.b #0x1, (a2)      ; Advance frame number
00000BBA B203                       	cmp.b  d3, d1          ; Check new frame count with num anim frames
00000BBC 6600                       	bne.s  @NotAtEnd       ; Branch if we haven't reached the end of anim
00000BBE 14BC 0000                  	move.b #0x0, (a2)      ; At end of anim, wrap frame counter back to zero
00000BC2                            	@NotAtEnd:
00000BC2                            

00000BC2 1212                       	move.b (a2), d1        ; Read next anim frame number (d1)
00000BC4 1031 1000                  	move.b (a1,d1.w), d0   ; Get next frame index from anim data array (d0)
00000BC8                            

00000BC8 4E75                       	rts
00000BCA                            

00000BCA                            	;cmp.b  d3, d4          ; Has anim frame index changed?
00000BCA                            	;beq    @NoChange       ; If not, there's nothing more to do
00000BCA                            

00000BCA                            SetSpriteFrame:
00000BCA                            	; Sets sprite animation frame
00000BCA                            

00000BCA                                ; d0 (w) Sprite address (VRAM)
00000BCA                            	; d1 (w) Size of one sprite frame (in tiles)
00000BCA                            	; d2 (w) Sprite frame ID
00000BCA                            	; a0 --- Address of sprite data (ROM)
00000BCA                            

00000BCA                            	; spriteDataAddr = spriteDataAddr + (sizeOfFrame * newTileID)
00000BCA 2608                       	move.l a0, d3          ; Move sprite data ROM address to d3 (can't do maths on address registers)
00000BCC 3801                       	move.w d1, d4          ; Move size of one sprite frame (in tiles) to d4 (can't trash d1, it's needed later)
00000BCE C8FC 0000                  	mulu.w #SizeTile, d4   ; Multiply by size of one tile
00000BD2 C8C2                       	mulu.w d2, d4          ; Multiply with new frame index to get new ROM offset (result in d4)
00000BD4 D644                       	add.w  d4, d3          ; Add to sprite data address
00000BD6 2043                       	move.l d3, a0          ; Back to address register
00000BD8                            

00000BD8 4EB8 0944                  	jsr LoadTiles          ; New tile address is in a0, VRAM address already in d0, num tiles already in d1 - jump straight to load tiles
00000BDC                            

00000BDC 4E75                       	rts
00000BDE                            

00000BDE                            AnimateSpriteFwd:
00000BDE                            	; Advance sprite to next frame, and advance frame counter
00000BDE                            

00000BDE                            	; d0 (w) Sprite address (VRAM)
00000BDE                            	; d1 (w) Size of one sprite frame (in tiles)
00000BDE                            	; d2 (w) Number of anim frames
00000BDE                            	; a0 --- Address of sprite data (ROM)
00000BDE                            	; a1 --- Address of animation data (byte array) (ROM)
00000BDE                            	; a2 --- Address of animation frame counter (w) (RAM, writeable)
00000BDE                            

00000BDE 4283                       	clr.l  d3              ; Clear d3
00000BE0 1612                       	move.b (a2), d3        ; Read current anim frame number (d3)
00000BE2 1803                       	move.b d3, d4		   ; Backup
00000BE4 5203                       	addi.b #0x1, d3        ; Advance frame number
00000BE6 B403                       	cmp.b  d3, d2          ; Check new frame count against num anim frames
00000BE8 6600                       	bne.s  @NotAtEnd       ; Branch if we haven't reached the end of anim
00000BEA 163C 0000                  	move.b #0x0, d3        ; At end of anim, wrap frame counter back to zero
00000BEE                            	@NotAtEnd:
00000BEE 1483                       	move.b d3, (a2)		   ; Frame count back to RAM
00000BF0                            

00000BF0 1831 4000                  	move.b (a1,d4.w), d4   ; Get original frame index (d4) from anim data array
00000BF4 1631 3000                  	move.b (a1,d3.w), d3   ; Get next frame index (d5) from anim data array
00000BF8                            

00000BF8 B803                       	cmp.b  d3, d4          ; Has anim frame index changed?
00000BFA 6700                       	beq.s  @NoChange       ; If not, there's nothing more to do
00000BFC                            

00000BFC                            	; spriteDataAddr = spriteDataAddr + (sizeOfFrame * newTileID)
00000BFC 2408                       	move.l a0, d2          ; Move sprite data ROM address to d2 (can't do maths on address registers)
00000BFE 3801                       	move.w d1, d4          ; Move size of one sprite frame (in tiles) to d4 (can't trash d1, it's needed later)
00000C00 C8FC 0000                  	mulu.w #SizeTile, d4   ; Multiply by size of one tile
00000C04 C8C3                       	mulu.w d3, d4          ; Multiply with new frame index to get new ROM offset (result in d4)
00000C06 D444                       	add.w  d4, d2          ; Add to sprite data address
00000C08 2042                       	move.l d2, a0          ; Back to address register
00000C0A                            

00000C0A 4EB8 0944                  	jsr LoadTiles          ; New tile address is in a0, VRAM address already in d0, num tiles already in d1 - jump straight to load tiles
00000C0E                            

00000C0E                            	@NoChange:
00000C0E 4E75                       	rts
00000C10                            

00000C10                            SetSpriteAnimFrame:
00000C10                            	; Sets sprite frame from animation data and frame index
00000C10                            

00000C10                            	; d0 (l) Sprite address (VRAM)
00000C10                            	; d1 (w) Size of one sprite frame (in tiles)
00000C10                            	; d2 (w) Animation frame
00000C10                            	; d3 (b) Number of anim frames
00000C10                            	; a0 --- Address of sprite data (ROM)
00000C10                            	; a1 --- Address of animation data (byte array) (ROM)
00000C10                            

00000C10 0282 0000 FFFF             	and.l #0x0000FFFF, d2
00000C16 0283 0000 00FF             	and.l #0x000000FF, d3
00000C1C 4284                       	clr.l d4
00000C1E                            

00000C1E 84C3                       	divu  d3, d2           ; Div frame count against num anim frames
00000C20 4842                       	swap  d2			   ; Remainder to lower word
00000C22                            

00000C22 1631 2000                  	move.b (a1,d2.w), d3   ; Get frame index from anim data array
00000C26                            

00000C26                            	; spriteDataAddr = spriteDataAddr + (sizeOfFrame * newTileID)
00000C26 2408                       	move.l a0, d2          ; Move sprite data ROM address to d2 (can't do maths on address registers)
00000C28 3801                       	move.w d1, d4          ; Move size of one sprite frame (in tiles) to d4 (can't trash d1, it's needed later)
00000C2A C8FC 0000                  	mulu   #SizeTile, d4   ; Multiply by size of one tile
00000C2E C8C3                       	mulu   d3, d4          ; Multiply with new frame index to get new ROM offset (result in d4)
00000C30 D484                       	add.l  d4, d2          ; Add to sprite data address
00000C32 2042                       	move.l d2, a0          ; Back to address register
00000C34                            

00000C34 4EB8 0944                  	jsr LoadTiles          ; New tile address is in a0, VRAM address already in d0, num tiles already in d1 - jump straight to load tiles
00000C38                            

00000C38 4E75                       	rts
00000C38 4E75                       	rts
00000C3A                                  include 'framewk\sprlist.asm'
00000C3A                            ; *************************************************************
00000C3A                            ; ClearSprite
00000C3A                            ; Clears the sprite counter
00000C3A                            ; *************************************************************
00000C3A                            ClearSprites:
00000C3A 13FC 0000 0000 0000            move.b #0, (sprite_count)                                                  ; set sprite count to 0
00000C42 4E75                           rts
00000C44                            

00000C44                            ; *************************************************************
00000C44                            ; AddSprite
00000C44                            ; Adds a sprite to the sprite table and increments counter
00000C44                            ; d0 - sprites y position
00000C44                            ; d1 - width and height tile bits
00000C44                            ; d2 - special (flipping, palette index, priority)
00000C44                            ; d3 - tile id
00000C44                            ; d4 - sprites x position
00000C44                            ; a0 - sprite table
00000C44                            ; *************************************************************
00000C44                            AddSprite:
00000C44 4245                           clr.w d5                                                                   ; clear register d5
00000C46 1A39 0000 0000                 move.b (sprite_count), d5                                                  ; sprint count in d5
00000C4C 4246                           clr.w d6                                                                   ; clear register d6
00000C4E 1C05                           move.b d5, d6                                                              ; d6 is used to calculate the sprite table offset
00000C50 0C05 004F                      cmp.b #79, d5                                                              ; are there too many sprites in the table already?
00000C54 6E00 0000                      bgt SkipAddSprite                                                          ; if not branch
00000C58 E74E                           lsl.w #$03, d6                                                             ; calculate sprite table offset (sprite count * sprite size)
00000C5A D0C6                           add.w d6, a0                                                               ; increment address by offset
00000C5C 30C0                           move.w d0, (a0)+                                                           ; move sprites y position into table
00000C5E 10C1                           move.b d1, (a0)+                                                           ; move sprites demensions into table
00000C60 5285                           addq.l #1, d5                                                              ; increment d5(sprite_count) by 1
00000C62 10C5                           move.b d5, (a0)+                                                           ; index of next sprite is d5(sprite_count +1) 
00000C64 10C2                           move.b d2, (a0)+                                                           ; save sprites special bits
00000C66 10C3                           move.b d3, (a0)+                                                           ; save sprites tile id in table
00000C68 30C4                           move.w d4, (a0)+                                                           ; save sprites x position in table
00000C6A 5279 0000 0000                 addq #1, (sprite_count)                                                    ; increment sprite counter by 1
00000C70                            SkipAddSprite:
00000C70 4E75                           rts
00000C72                            

00000C72                            ; *************************************************************
00000C72                            ; Updates and draws the sprite table
00000C72                            ; *************************************************************
00000C72                            UpdateSprites:
00000C72 41F9 0000 0000                 lea (spritelist_table), a0                                                 ; sprite table in a0
00000C78 1039 0000 0000                 move.b (sprite_count), d0                                                  ; load sprite counter into d0
00000C7E 0280 0000 00FF             	and.l #0x000000FF, d0
00000C84 C0FC 0000                  	mulu.w #SizeSpriteDesc, d0                                                 ; Offset into sprite table
00000C88 4840                       	swap d0                                                                    ; To upper word
00000C8A 0080 0000 0000             	or.l #vdp_write_sprite_table, d0                                           ; Add to write address
00000C90 23C0 0000 0000             	move.l d0, vdp_control                                                     ; Set read address
00000C96                            

00000C96 23D8 0000 0000             	move.l (a0)+, vdp_data                                                     ; 8 bytes of data
00000C9C 23D8 0000 0000             	move.l (a0)+, vdp_data
00000CA2 4E75                           rts
00000CA2 4E75                           rts
00000CA4                                  include 'framewk\text.asm'
00000CA4                            ;==============================================================
00000CA4                            ;   BIG EVIL CORPORATION .co.uk
00000CA4                            ;==============================================================
00000CA4                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000CA4                            ;==============================================================
00000CA4                            ;   text.asm - Font loading and text display
00000CA4                            ;==============================================================
00000CA4                            

00000CA4                            LoadFont:
00000CA4                               ; a0 - Font address (l)
00000CA4                               ; d0 - VRAM address (w)
00000CA4                               ; d1 - Num chars (w)
00000CA4                            

00000CA4 4840                          swap     d0                   ; Shift VRAM addr to upper word
00000CA6 0680 0000 0000                add.l    #vdp_write_tiles, d0 ; VRAM write cmd + VRAM destination address
00000CAC 23C0 0000 0000                move.l   d0, vdp_control      ; Send address to VDP cmd port
00000CB2                            

00000CB2 5301                          subq.b   #0x1, d1             ; Num chars - 1
00000CB4                               @CharCopy:
00000CB4 343C 0007                     move.w   #0x07, d2            ; 8 longwords in tile
00000CB8                               @LongCopy:
00000CB8 23D8 0000 0000                move.l   (a0)+, vdp_data      ; Copy one line of tile to VDP data port
00000CBE 51CA FFF8                     dbra.w   d2, @LongCopy
00000CC2 51C9 FFF0                     dbra.w   d1, @CharCopy
00000CC6                            

00000CC6 4E75                          rts
00000CC8                            

00000CC8                            DrawTextPlaneA:
00000CC8                            	; a0 (l) - String address
00000CC8                            	; d0 (w) - First tile ID of font
00000CC8                            	; d1 (bb)- XY coord (in tiles)
00000CC8                            	; d2 (b) - Palette
00000CC8                            

00000CC8 4283                       	clr.l    d3                     ; Clear d3 ready to work with
00000CCA 1601                       	move.b   d1, d3                 ; Move Y coord (lower byte of d1) to d3
00000CCC C6FC 0000                  	mulu.w   #vdp_plane_width, d3   ; Multiply Y by line width (H40 mode - 64 tiles horizontally) to get Y offset
00000CD0 E099                       	ror.l    #0x8, d1               ; Shift X coord from upper to lower byte of d1
00000CD2 D601                       	add.b    d1, d3                 ; Add X coord to offset
00000CD4 C6FC 0002                  	mulu.w   #0x2, d3               ; Convert to words
00000CD8 4843                       	swap     d3                     ; Shift address offset to upper word
00000CDA 0683 0000 0000             	add.l    #vdp_write_plane_a, d3 ; Add PlaneA write cmd + address
00000CE0 23C3 0000 0000             	move.l   d3, vdp_control        ; Send to VDP control port
00000CE6                            

00000CE6 4283                       	clr.l    d3                     ; Clear d3 ready to work with again
00000CE8 1602                       	move.b   d2, d3                 ; Move palette ID (lower byte of d2) to d3
00000CEA E19B                       	rol.l    #0x8, d3               ; Shift palette ID to bits 14 and 15 of d3
00000CEC EB9B                       	rol.l    #0x5, d3               ; Can only rol bits up to 8 places in one instruction
00000CEE                            

00000CEE 43F9 0000 0000             	lea      ASCIIMap, a1           ; Load address of ASCII map into a1
00000CF4                            

00000CF4                            	@CharCopy:
00000CF4 1418                       	move.b   (a0)+, d2              ; Move ASCII byte to lower byte of d2
00000CF6 0C02 0000                  	cmp.b    #0x0, d2               ; Test if byte is zero (string terminator)
00000CFA 6700                       	beq.s    @End                   ; If byte was zero, branch to end
00000CFC                            

00000CFC 0402 0000                  	sub.b    #ASCIIStart, d2        ; Subtract first ASCII code to get table entry index
00000D00 1631 2000                  	move.b   (a1,d2.w), d3          ; Move tile ID from table (index in lower word of d2) to lower byte of d3
00000D04 D640                       	add.w    d0, d3                 ; Offset tile ID by first tile ID in font
00000D06 33C3 0000 0000             	move.w   d3, vdp_data           ; Move palette and pattern IDs to VDP data port
00000D0C 4EF8 0CF4                  	jmp      @CharCopy              ; Next character
00000D10                            

00000D10                            	@End:
00000D10 4E75                       	rts
00000D10 4E75                       	rts
00000D12                                  include 'framewk\timing.asm'
00000D12                            ;==============================================================
00000D12                            ;   BIG EVIL CORPORATION .co.uk
00000D12                            ;==============================================================
00000D12                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000D12                            ;==============================================================
00000D12                            ;   timing.asm - Timers, counters, frames
00000D12                            ;==============================================================
00000D12                            

00000D12                            WaitVBlankStart:
00000D12 3039 0000 0000             	move.w  vdp_control, d0	; Move VDP status word to d0
00000D18 0800 0003                  	btst    #0x3, d0     	; vblank state in bit 3
00000D1C 67F4                       	beq.s   WaitVBlankStart ; Branch if equal (to zero)
00000D1E 4E75                       	rts
00000D20                            

00000D20                            WaitVBlankEnd:
00000D20 3039 0000 0000             	move.w  vdp_control, d0	; Move VDP status word to d0
00000D26 0800 0003                  	btst    #0x3, d0     	; vblank state in bit 3
00000D2A 66F4                       	bne.s   WaitVBlankEnd   ; Branch if equal (to zero)
00000D2C 4E75                       	rts
00000D2E                            

00000D2E                            WaitFrames:
00000D2E                            	; d0 - Number of frames to wait
00000D2E                            

00000D2E 2239 0000 0000             	move.l  vblank_counter, d1 ; Get start vblank count
00000D34                            

00000D34                            	@Wait:
00000D34 2439 0000 0000             	move.l  vblank_counter, d2 ; Get end vblank count
00000D3A 9581                       	subx.l  d1, d2             ; Calc delta, result in d2
00000D3C B480                       	cmp.l   d0, d2             ; Compare with num frames
00000D3E 6C00                       	bge.s   @End               ; Branch to end if greater or equal to num frames
00000D40 4EF8 0D34                  	jmp     @Wait              ; Try again
00000D44                            	
00000D44                            	@End:
00000D44 4E75                       	rts
00000D44 4E75                       	rts
00000D46                                  include 'framewk\tmss.asm'
00000D46                            ;==============================================================
00000D46                            ;   BIG EVIL CORPORATION .co.uk
00000D46                            ;==============================================================
00000D46                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000D46                            ;==============================================================
00000D46                            ;   tmss.asm - TMSS checks and initialisation
00000D46                            ;==============================================================
00000D46                            

00000D46                            InitTMSS:
00000D46                            

00000D46 1039 0000 0000             	move.b hardware_ver_address, d0 ; Move Megadrive hardware version to d0
00000D4C 0200 000F                  	andi.b #0x0F, d0             ; The version is stored in last four bits, so mask it with 0F
00000D50 6700                       	beq.s @Skip                    ; If version is equal to 0, skip TMSS signature
00000D52 23FC 0000 0000 0000 0000   	move.l #tmss_signature, tmss_address ; Move the string "SEGA" to 0xA14000
00000D5C                            	@Skip:
00000D5C                            

00000D5C                            	; Check VDP
00000D5C 3039 0000 0000             	move.w vdp_control, d0     ; Read VDP status register (hangs if no access)
00000D62                            	
00000D62 4E75                       	rts
00000D62 4E75                       	rts
00000D64                                  include 'framewk\palettes.asm'
00000D64                            ;==============================================================
00000D64                            ;   BIG EVIL CORPORATION .co.uk
00000D64                            ;==============================================================
00000D64                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000D64                            ;==============================================================
00000D64                            ;   palettes.asm - Palette loading and manipulation
00000D64                            ;==============================================================
00000D64                            

00000D64                            LoadPalette;
00000D64                                ; d0 (b) Palette index
00000D64                            	; a0 --- Palette ROM address
00000D64                            

00000D64 C0FC 0000                  	mulu.w #SizePalette, d0        ; Colour index to CRAM destination address
00000D68 4840                       	swap   d0                      ; Move address to upper word
00000D6A 0080 0000 0000             	ori.l  #vdp_write_palettes, d0 ; OR CRAM write command
00000D70 23C0 0000 0000             	move.l d0, vdp_control         ; Send dest address to VDP
00000D76                            

00000D76 203C 0000 0000             	move.l #(SizePalette/SizeWord), d0 ; Size of palette
00000D7C                            	@PaletteCopy:
00000D7C 33D8 0000 0000             	move.w (a0)+, vdp_data         ; Move word to CRAM
00000D82 51C8 FFF8                  	dbra.w d0, @PaletteCopy
00000D86                            

00000D86 4E75                       	rts
00000D88                            

00000D88                            ReadPalette;
00000D88                                ; d0 (b) Palette index
00000D88                            	; a0 --- Dest RAM address
00000D88                            

00000D88 C0FC 0000                  	mulu.w #SizePalette, d0        ; Colour index to CRAM source address
00000D8C 4840                       	swap   d0                      ; Move address to upper word
00000D8E 0080 0000 0000             	ori.l  #vdp_read_palettes, d0  ; OR CRAM read command
00000D94 23C0 0000 0000             	move.l d0, vdp_control         ; Send dest address to VDP
00000D9A                            

00000D9A 203C 0000 0000             	move.l #(SizePalette/SizeWord), d0 ; Size of palette
00000DA0                            	@PaletteCopy:
00000DA0 30F9 0000 0000             	move.w vdp_data, (a0)+       ; Move word from CRAM
00000DA6 51C8 FFF8                  	dbra.w d0, @PaletteCopy
00000DAA                            

00000DAA 4E75                       	rts
00000DAA 4E75                       	rts
00000DAC                                  include 'framewk\planes.asm'
00000DAC                            ;==============================================================
00000DAC                            ;   BIG EVIL CORPORATION .co.uk
00000DAC                            ;==============================================================
00000DAC                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000DAC                            ;==============================================================
00000DAC                            ;   planes.asm - Plane A/B map loading and scrolling
00000DAC                            ;==============================================================
00000DAC                            

00000DAC                            SetCellPlaneA:
00000DAC                            	; d0 (w) - Tile ID
00000DAC                            	; d1 (ww)- XY coord (in tiles)
00000DAC                            	; d2 (b) - Palette
00000DAC                            

00000DAC 4283                       	clr.l    d3                     ; Clear d3 ready to work with
00000DAE 3601                       	move.w   d1, d3                 ; Move Y coord (lower word of d1) to d3
00000DB0 C6FC 0000                  	mulu.w   #vdp_plane_width, d3   ; Multiply Y by line width to get Y offset
00000DB4 4241                       	clr.w    d1						; Clear Y coord
00000DB6 4841                       	swap     d1                     ; Shift X coord from upper to lower word of d1
00000DB8 D681                       	add.l    d1, d3                 ; Add X coord to offset
00000DBA E38B                       	lsl.l    #0x1, d3               ; Convert to words
00000DBC E18B                       	lsl.l    #0x8, d3              ; Shift address offset to bits 16-30
00000DBE E18B                       	lsl.l    #0x8, d3
00000DC0 0083 0000 0000             	ori.l    #vdp_write_plane_a, d3 ; OR in the VRAM write cmd + PlaneA address
00000DC6 23C3 0000 0000             	move.l   d3, vdp_control        ; Send to VDP control port
00000DCC                            

00000DCC 4283                       	clr.l    d3                     ; Clear d3 ready to work with again
00000DCE 1602                       	move.b   d2, d3                 ; Move palette ID (lower byte of d2) to d3
00000DD0 E18B                       	lsl.l    #0x8, d3               ; Shift palette ID to bits 14 and 15 of d3
00000DD2 EB8B                       	lsl.l    #0x5, d3
00000DD4 8640                       	or.w     d0, d3                 ; OR in the tile ID
00000DD6 33C3 0000 0000             	move.w   d3, vdp_data           ; Move palette and pattern ID to VDP data port
00000DDC                            	
00000DDC 4E75                       	rts
00000DDE                            	
00000DDE                            LoadMapPlaneA:
00000DDE                                ; a0 (l) - Map address (ROM)
00000DDE                            	; d0 (w) - Size in words
00000DDE                            	; d1 (b) - Y offset
00000DDE                            	; d2 (w) - First tile ID
00000DDE                            	; d3 (b) - Palette ID
00000DDE                            

00000DDE C2FC 0040                  	mulu.w  #0x0040, d1            ; Multiply Y offset by line width (in words)
00000DE2                            

00000DE2                            	; Address bit pattern: --DC BA98 7654 3210 ---- ---- ---- --FE
00000DE2 0681 0000 0000             	add.l   #vram_addr_plane_a, d1	; Add VRAM address offset
00000DE8 E599                       	rol.l   #0x2, d1				; Roll bits 14/15 of address to bits 16/17
00000DEA E449                       	lsr.w   #0x2, d1				; Shift lower word back
00000DEC 4841                       	swap    d1                     	; Swap address hi/lo
00000DEE 0081 0000 0000             	ori.l   #vdp_cmd_vram_write, d1 ; OR in VRAM write command
00000DF4 23C1 0000 0000             	move.l  d1, vdp_control        	; Move dest address to VDP control port
00000DFA                            

00000DFA E19B                       	rol.l   #0x08, d3              ; Shift palette ID to bits 14-15
00000DFC EB9B                       	rol.l   #0x05, d3              ; Can only rol 8 bits at a time
00000DFE                            

00000DFE 5340                       	subq.w  #0x01, d0              ; Num words in d0, minus 1 for counter
00000E00                            	
00000E00                            	@Copy:
00000E00 3818                       	move.w  (a0)+, d4              ; Move tile ID from map data to lower d4
00000E02 0284 0000 3FFF             	and.l   #%0011111111111111, d4 ; Mask out original palette ID
00000E08 8883                       	or.l    d3, d4                 ; Replace with our own
00000E0A D842                       	add.w   d2, d4                 ; Add first tile offset to d4
00000E0C 33C4 0000 0000             	move.w  d4, vdp_data           ; Move to VRAM
00000E12 51C8 FFEC                  	dbra.w  d0, @Copy              ; Loop
00000E16                            

00000E16 4E75                           rts
00000E18                            

00000E18                            LoadMapSegmentPlaneA:
00000E18                                ; a0 (l)  Map data address (ROM)
00000E18                            	; d0 (ww) Source top/left (tiles)
00000E18                            	; d1 (ww) Destination top/left (tiles)
00000E18                            	; d2 (ww) Segment width/height (tiles)
00000E18                            	; d3 (w)  Source map total width (tiles)
00000E18                            	; d4 (w)  Art tile ID
00000E18                            	; d5 (b)  Palette ID
00000E18                            	
00000E18 0283 0000 FFFF             	and.l  #0x0000FFFF, d3
00000E1E                            	
00000E1E                            	; Source top/left to tile offset (mul Y by total map width, add X)
00000E1E 4286                       	clr.l  d6
00000E20 3C00                       	move.w d0, d6	; Y to d6
00000E22 CCC3                       	mulu   d3, d6	; To tile offset
00000E24 4240                       	clr.w  d0
00000E26 4840                       	swap   d0		; X to lower word
00000E28 D086                       	add.l  d6, d0	; Add Y to X offset
00000E2A E388                       	lsl.l  #0x1, d0	; To byte offset
00000E2C D1C0                       	add.l  d0, a0	; Offset source address
00000E2E                            	
00000E2E                            	; Dest top/left to tile offset (mul Y by VDP width, add X)
00000E2E 4286                       	clr.l  d6
00000E30 3C01                       	move.w d1, d6					; Y to d6
00000E32 CCFC 0000                  	mulu   #vdp_plane_width, d6		; To tile offset
00000E36 4241                       	clr.w  d1
00000E38 4841                       	swap   d1						; X to lower word
00000E3A D286                       	add.l  d6, d1					; Add Y to X offset
00000E3C E389                       	lsl.l  #0x1, d1					; To byte offset
00000E3E                            	
00000E3E                            	; Segment width to column counter
00000E3E 4842                       	swap   d2
00000E40 4287                       	clr.l  d7
00000E42 3E02                       	move.w d2, d7
00000E44 5347                       	sub.w  #0x1, d7
00000E46                            	
00000E46                            	; Segment height to row counter
00000E46 4242                       	clr.w  d2
00000E48 4842                       	swap   d2
00000E4A 5342                       	sub.w  #0x1, d2
00000E4C                            	
00000E4C                            	; Total map width to bytes
00000E4C E34B                       	lsl.w  #0x1, d3
00000E4E                            	
00000E4E                            	; Shift palette ID to bits 14-15
00000E4E 0245 00FF                  	and.w  #0x00FF, d5
00000E52 E14D                       	lsl.w  #0x08, d5
00000E54 EB4D                       	lsl.w  #0x05, d5
00000E56                            	
00000E56                            	; Loop rows
00000E56                            	@RowLp:
00000E56                            	
00000E56                            		; Set source address (start of curr row in a0)
00000E56 2248                       		move.l a0, a1
00000E58                            		
00000E58                            		; Set dest address	(start of curr row in d1)
00000E58                            		; Address bit pattern: --DC BA98 7654 3210 ---- ---- ---- --FE
00000E58 2001                       		move.l d1, d0
00000E5A 0680 0000 0000             		add.l   #vram_addr_plane_a, d0	; Add VRAM address offset
00000E60 E598                       		rol.l   #0x2, d0				; Roll bits 14/15 of address to bits 16/17
00000E62 E448                       		lsr.w   #0x2, d0				; Shift lower word back
00000E64 4840                       		swap    d0                     	; Swap address hi/lo
00000E66 0080 0000 0000             		ori.l   #vdp_cmd_vram_write, d0 ; OR in VRAM write command
00000E6C 23C0 0000 0000             		move.l  d0, vdp_control        	; Move dest address to VDP control port
00000E72                            	
00000E72                            		; Loop columns
00000E72 2C07                       		move.l d7, d6
00000E74                            		@ColumnLp:
00000E74                            		
00000E74                            			; Read tile and increment
00000E74 3019                       			move.w (a1)+, d0
00000E76                            

00000E76                            			; Map tile bit pattern: LPPH VTTT TTTT TTTT (L=lo/hi plane, P=Palette, H=HFlip, V=VFlip, T=TileId)
00000E76                            			
00000E76                            			; Offset first tile
00000E76 D044                       			add.w   d4, d0
00000E78                            

00000E78                            			; Mask out palette, replace with new
00000E78 0240 9FFF                  			and.w   #%1001111111111111, d0
00000E7C 8045                       			or.w    d5, d0
00000E7E                            			
00000E7E                            			; Write to VDP
00000E7E 33C0 0000 0000             			move.w  d0, vdp_data
00000E84                            		
00000E84 51CE FFEE                  		dbra d6, @ColumnLp
00000E88                            		
00000E88                            		; Increment start of curr row (source) by 1 row (total map width)
00000E88 D1C3                       		add.l d3, a0
00000E8A                            		
00000E8A                            		; Increment start of curr row (dest) by 1 row (VDP width in words)
00000E8A 0681 0000 0000             		add.l  #(vdp_plane_width*2), d1
00000E90                            		
00000E90 51CA FFC4                  	dbra d2, @RowLp
00000E94                            	
00000E94 4E75                       	rts
00000E96                            	
00000E96                            SetHScrollPlaneA:
00000E96                            	; d0 (w) HScroll value
00000E96 23FC 0000 0000 0000 0000   	move.l #vdp_write_hscroll, vdp_control
00000EA0 33C0 0000 0000             	move.w d0, vdp_data
00000EA6 4E75                       	rts
00000EA8                            

00000EA8                            SetVScrollPlaneA:
00000EA8                            	; d0 (w) VScroll value
00000EA8 23FC 0000 0000 0000 0000   	move.l #vdp_write_vscroll, vdp_control
00000EB2 33C0 0000 0000             	move.w d0, vdp_data
00000EB8 4E75                       	rts
00000EBA                            

00000EBA                            SetCellPlaneB:
00000EBA                            	; d0 (w) - Tile ID
00000EBA                            	; d1 (ww)- XY coord (in tiles)
00000EBA                            	; d2 (b) - Palette
00000EBA                            

00000EBA 4283                       	clr.l    d3                     ; Clear d3 ready to work with
00000EBC 3601                       	move.w   d1, d3                 ; Move Y coord (lower word of d1) to d3
00000EBE C6FC 0000                  	mulu.w   #vdp_plane_width, d3   ; Multiply Y by line width to get Y offset
00000EC2 4241                       	clr.w    d1						; Clear Y coord
00000EC4 4841                       	swap     d1                     ; Shift X coord from upper to lower word of d1
00000EC6 D681                       	add.l    d1, d3                 ; Add X coord to offset
00000EC8 E38B                       	lsl.l    #0x1, d3               ; Convert to words
00000ECA E18B                       	lsl.l    #0x8, d3              ; Shift address offset to bits 16-30
00000ECC E18B                       	lsl.l    #0x8, d3
00000ECE 0083 0000 0000             	ori.l    #vdp_write_plane_b, d3 ; OR in the VRAM write cmd + PlaneA address
00000ED4 23C3 0000 0000             	move.l   d3, vdp_control        ; Send to VDP control port
00000EDA                            

00000EDA 4283                       	clr.l    d3                     ; Clear d3 ready to work with again
00000EDC 1602                       	move.b   d2, d3                 ; Move palette ID (lower byte of d2) to d3
00000EDE E18B                       	lsl.l    #0x8, d3               ; Shift palette ID to bits 14 and 15 of d3
00000EE0 EB8B                       	lsl.l    #0x5, d3
00000EE2 8640                       	or.w     d0, d3                 ; OR in the tile ID
00000EE4 33C3 0000 0000             	move.w   d3, vdp_data           ; Move palette and pattern ID to VDP data port
00000EEA                            	
00000EEA 4E75                       	rts
00000EEC                            

00000EEC                            	LoadMapPlaneB:
00000EEC                                ; a0 (l) - Map address (ROM)
00000EEC                            	; d0 (w) - Size in words
00000EEC                            	; d1 (b) - Y offset
00000EEC                            	; d2 (w) - First tile ID
00000EEC                            	; d3 (b) - Palette ID
00000EEC                            

00000EEC C2FC 0040                  	mulu.w  #0x0040, d1            ; Multiply Y offset by line width (in words)
00000EF0                            

00000EF0                            	; Address bit pattern: --DC BA98 7654 3210 ---- ---- ---- --FE
00000EF0 0681 0000 0000             	add.l   #vram_addr_plane_b, d1	; Add VRAM address offset
00000EF6 E599                       	rol.l   #0x2, d1				; Roll bits 14/15 of address to bits 16/17
00000EF8 E449                       	lsr.w   #0x2, d1				; Shift lower word back
00000EFA 4841                       	swap    d1                     	; Swap address hi/lo
00000EFC 0081 0000 0000             	ori.l   #vdp_cmd_vram_write, d1 ; OR in VRAM write command
00000F02 23C1 0000 0000             	move.l  d1, vdp_control        	; Move dest address to VDP control port
00000F08                            

00000F08 E19B                       	rol.l   #0x08, d3              ; Shift palette ID to bits 14-15
00000F0A EB9B                       	rol.l   #0x05, d3              ; Can only rol 8 bits at a time
00000F0C                            

00000F0C 5340                       	subq.w  #0x01, d0              ; Num words in d0, minus 1 for counter
00000F0E                            	
00000F0E                            	@Copy:
00000F0E 3818                       	move.w  (a0)+, d4              ; Move tile ID from map data to lower d4
00000F10 0284 0000 3FFF             	and.l   #%0011111111111111, d4 ; Mask out original palette ID
00000F16 8883                       	or.l    d3, d4                 ; Replace with our own
00000F18 D842                       	add.w   d2, d4                 ; Add first tile offset to d4
00000F1A 33C4 0000 0000             	move.w  d4, vdp_data           ; Move to VRAM
00000F20 51C8 FFEC                  	dbra.w  d0, @Copy              ; Loop
00000F24                            

00000F24 4E75                           rts
00000F26                            

00000F26                            	LoadMapSegmentPlaneB:
00000F26                                ; a0 (l)  Map data address (ROM)
00000F26                            	; d0 (ww) Source top/left (tiles)
00000F26                            	; d1 (ww) Destination top/left (tiles)
00000F26                            	; d2 (ww) Segment width/height (tiles)
00000F26                            	; d3 (w)  Source map total width (tiles)
00000F26                            	; d4 (w)  Art tile ID
00000F26                            	; d5 (b)  Palette ID
00000F26                            	
00000F26 0283 0000 FFFF             	and.l  #0x0000FFFF, d3
00000F2C                            	
00000F2C                            	; Source top/left to tile offset (mul Y by total map width, add X)
00000F2C 4286                       	clr.l  d6
00000F2E 3C00                       	move.w d0, d6	; Y to d6
00000F30 CCC3                       	mulu   d3, d6	; To tile offset
00000F32 4240                       	clr.w  d0
00000F34 4840                       	swap   d0		; X to lower word
00000F36 D086                       	add.l  d6, d0	; Add Y to X offset
00000F38 E388                       	lsl.l  #0x1, d0	; To byte offset
00000F3A D1C0                       	add.l  d0, a0	; Offset source address
00000F3C                            	
00000F3C                            	; Dest top/left to tile offset (mul Y by VDP width, add X)
00000F3C 4286                       	clr.l  d6
00000F3E 3C01                       	move.w d1, d6					; Y to d6
00000F40 CCFC 0000                  	mulu   #vdp_plane_width, d6		; To tile offset
00000F44 4241                       	clr.w  d1
00000F46 4841                       	swap   d1						; X to lower word
00000F48 D286                       	add.l  d6, d1					; Add Y to X offset
00000F4A E389                       	lsl.l  #0x1, d1					; To byte offset
00000F4C                            	
00000F4C                            	; Segment width to column counter
00000F4C 4842                       	swap   d2
00000F4E 4287                       	clr.l  d7
00000F50 3E02                       	move.w d2, d7
00000F52 5347                       	sub.w  #0x1, d7
00000F54                            	
00000F54                            	; Segment height to row counter
00000F54 4242                       	clr.w  d2
00000F56 4842                       	swap   d2
00000F58 5342                       	sub.w  #0x1, d2
00000F5A                            	
00000F5A                            	; Total map width to bytes
00000F5A E34B                       	lsl.w  #0x1, d3
00000F5C                            	
00000F5C                            	; Shift palette ID to bits 14-15
00000F5C 0245 00FF                  	and.w  #0x00FF, d5
00000F60 E14D                       	lsl.w  #0x08, d5
00000F62 EB4D                       	lsl.w  #0x05, d5
00000F64                            	
00000F64                            	; Loop rows
00000F64                            	@RowLp:
00000F64                            	
00000F64                            		; Set source address (start of curr row in a0)
00000F64 2248                       		move.l a0, a1
00000F66                            		
00000F66                            		; Set dest address	(start of curr row in d1)
00000F66                            		; Address bit pattern: --DC BA98 7654 3210 ---- ---- ---- --FE
00000F66 2001                       		move.l d1, d0
00000F68 0680 0000 0000             		add.l   #vram_addr_plane_b, d0	; Add VRAM address offset
00000F6E E598                       		rol.l   #0x2, d0				; Roll bits 14/15 of address to bits 16/17
00000F70 E448                       		lsr.w   #0x2, d0				; Shift lower word back
00000F72 4840                       		swap    d0                     	; Swap address hi/lo
00000F74 0080 0000 0000             		ori.l   #vdp_cmd_vram_write, d0 ; OR in VRAM write command
00000F7A 23C0 0000 0000             		move.l  d0, vdp_control        	; Move dest address to VDP control port
00000F80                            	
00000F80                            		; Loop columns
00000F80 2C07                       		move.l d7, d6
00000F82                            		@ColumnLp:
00000F82                            		
00000F82                            			; Read tile and increment
00000F82 3019                       			move.w (a1)+, d0
00000F84                            

00000F84                            			; Map tile bit pattern: LPPH VTTT TTTT TTTT (L=lo/hi plane, P=Palette, H=HFlip, V=VFlip, T=TileId)
00000F84                            			
00000F84                            			; Offset first tile
00000F84 D044                       			add.w   d4, d0
00000F86                            

00000F86                            			; Mask out palette, replace with new
00000F86 0240 9FFF                  			and.w   #%1001111111111111, d0
00000F8A 8045                       			or.w    d5, d0
00000F8C                            			
00000F8C                            			; Write to VDP
00000F8C 33C0 0000 0000             			move.w  d0, vdp_data
00000F92                            		
00000F92 51CE FFEE                  		dbra d6, @ColumnLp
00000F96                            		
00000F96                            		; Increment start of curr row (source) by 1 row (total map width)
00000F96 D1C3                       		add.l d3, a0
00000F98                            		
00000F98                            		; Increment start of curr row (dest) by 1 row (VDP width in words)
00000F98 0681 0000 0000             		add.l  #(vdp_plane_width*2), d1
00000F9E                            		
00000F9E 51CA FFC4                  	dbra d2, @RowLp
00000FA2                            	
00000FA2 4E75                       	rts
00000FA2 4E75                       	rts
00000FA4                                  include 'framewk\utility.asm'
00000FA4                            ;==============================================================
00000FA4                            ;   BIG EVIL CORPORATION .co.uk
00000FA4                            ;==============================================================
00000FA4                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00000FA4                            ;==============================================================
00000FA4                            ;   utility.asm - Miscellaneous utility subroutines
00000FA4                            ;==============================================================
00000FA4                            ItoA_Hex_w:
00000FA4                               ; Converts a word to hex ASCII
00000FA4                               ; a0 --- In/Out: String address
00000FA4                               ; d0 (w) In: Number to convert
00000FA4                            

00000FA4                               ; 4 nybbles + 0x + terminator, working backwards
00000FA4 5E88                          add.l  #0x7, a0
00000FA6                            

00000FA6                               ; Zero terminate
00000FA6 113C 0000                     move.b #0x0, -(a0)
00000FAA                            

00000FAA 323C 0000                     move.w #0x0, d1   ; Char ptr
00000FAE 343C 0003                     move.w #0x3, d2   ; 4 nybbles in a word
00000FB2                            @NybbleLp:
00000FB2 1600                          move.b d0, d3         ; Byte to d3
00000FB4 0203 000F                     andi.b #0x0F, d3      ; Bottom nybble
00000FB8 0C03 0009                     cmp.b  #0x9, d3
00000FBC 6F00                          ble.s  @Numeric         ; Branch if in numeric range
00000FBE 0603 0000                     add.b  #(ASCIIAlphaOffset-0xA), d3   ; In alpha range (A - F)
00000FC2 1103                          move.b d3, -(a0)      ; Back to string
00000FC4 E848                          lsr.w  #0x4, d0         ; Next nybble
00000FC6 51CA FFEA                     dbra   d2, @NybbleLp   ; Loop
00000FCA 6000                          bra.s  @End
00000FCC                            @Numeric:
00000FCC 0603 0000                     add.b  #ASCIINumericOffset, d3   ; In numeric range (0 - 9)
00000FD0 1103                          move.b d3, -(a0)      ; Back to string
00000FD2 E848                          lsr.w  #0x4, d0         ; Next nybble
00000FD4 51CA FFDC                     dbra   d2, @NybbleLp   ; Loop
00000FD8                            

00000FD8                               @End:
00000FD8                            

00000FD8                               ;0X
00000FD8 113C 0058                     move.b #'X', -(a0)
00000FDC 113C 0030                     move.b #'0', -(a0)
00000FE0                            

00000FE0 4E75                          rts
00000FE2                            

00000FE2                            ItoA_Hex_l:
00000FE2                               ; Converts a long to hex ASCII
00000FE2                               ; a0 --- In/Out: String address
00000FE2                               ; d0 (w) In: Number to convert
00000FE2                            

00000FE2                               ; 8 nybbles + 0x + terminator, working backwards
00000FE2 D1FC 0000 000B                add.l  #0x0B, a0
00000FE8                            

00000FE8                               ; Zero terminate
00000FE8 113C 0000                     move.b #0x0, -(a0)
00000FEC                            

00000FEC 323C 0000                     move.w #0x0, d1   ; Char ptr
00000FF0 343C 0007                     move.w #0x7, d2   ; 8 nybbles in a long
00000FF4                            @NybbleLp:
00000FF4 1600                          move.b d0, d3         ; Byte to d3
00000FF6 0203 000F                     andi.b #0x0F, d3      ; Bottom nybble
00000FFA 0C03 0009                     cmp.b  #0x9, d3
00000FFE 6F00                          ble.s  @Numeric         ; Branch if in numeric range
00001000 0603 0000                     add.b  #(ASCIIAlphaOffset-0xA), d3   ; In alpha range (A - F)
00001004 1103                          move.b d3, -(a0)      ; Back to string
00001006 E848                          lsr.w  #0x4, d0         ; Next nybble
00001008 51CA FFEA                     dbra   d2, @NybbleLp   ; Loop
0000100C 6000                          bra.s  @End
0000100E                            @Numeric:
0000100E 0603 0000                     add.b  #ASCIINumericOffset, d3   ; In numeric range (0 - 9)
00001012 1103                          move.b d3, -(a0)      ; Back to string
00001014 E848                          lsr.w  #0x4, d0         ; Next nybble
00001016 51CA FFDC                     dbra   d2, @NybbleLp   ; Loop
0000101A                            

0000101A                               @End:
0000101A                            

0000101A                               ;0X
0000101A 113C 0058                     move.b #'X', -(a0)
0000101E 113C 0030                     move.b #'0', -(a0)
00001022                            

00001022 4E75                          rts
00001024                            

00001024                            ItoA_Int_w:
00001024                               ; Converts a word to integer ASCII
00001024                               ; a0 --- In/Out: String address
00001024                               ; d0 (w) In: Number to convert
00001024                            

00001024                               ; 4 nybbles + terminator, working backwards
00001024 5A88                          add.l  #0x5, a0
00001026                            

00001026                               ; Zero terminate
00001026 113C 0000                     move.b #0x0, -(a0)
0000102A                            

0000102A 323C 0000                     move.w #0x0, d1       ; Char ptr
0000102E 343C 0003                     move.w #0x3, d2       ; 4 nybbles in a word
00001032                            @NybbleLp:
00001032 1600                          move.b d0, d3         ; Byte to d3
00001034 0203 000F                     andi.b #0x0F, d3      ; Bottom nybble
00001038 0603 0000                     add.b #ASCIINumericOffset, d3   ; In numeric range (0 - 9)
0000103C 1103                          move.b d3, -(a0)      ; Back to string
0000103E E848                          lsr.w #0x4, d0         ; Next nybble
00001040 51CA FFF0                     dbra d2, @NybbleLp   ; Loop
00001044                            

00001044 4E75                          rts
00001046                            

00001046                            ItoA_Int_l:
00001046                               ; Converts a long to integer ASCII
00001046                               ; a0 --- In/Out: String address
00001046                               ; d0 (l) In: Number to convert
00001046                            

00001046                               ; 8 nybbles + terminator, working backwards
00001046 D1FC 0000 0009                add.l  #0x9, a0
0000104C                            

0000104C                               ; Zero terminate
0000104C 113C 0000                     move.b #0x0, -(a0)
00001050                            

00001050 323C 0000                     move.w #0x0, d1       ; Char ptr
00001054 343C 0007                     move.w #0x7, d2       ; 8 nybbles in a word
00001058                            @NybbleLp:
00001058 1600                          move.b d0, d3         ; Byte to d3
0000105A 0203 000F                     andi.b #0x0F, d3      ; Bottom nybble
0000105E 0603 0000                     add.b #ASCIINumericOffset, d3   ; In numeric range (0 - 9)
00001062 1103                          move.b d3, -(a0)      ; Back to string
00001064 E848                          lsr.w #0x4, d0         ; Next nybble
00001066 51CA FFF0                     dbra d2, @NybbleLp   ; Loop
0000106A                            

0000106A 4E75                          rts
0000106C                            

0000106C                            ItoBCD_Int_w:
0000106C                               ; D0 (w) In: binary number (0-9999)
0000106C                               ; D2 (w) Out: binary number converted to four digit BCD
0000106C 7400                          moveq   #0,d2       ;Clear conversion register.
0000106E 7E03                          moveq   #3,d7       ;Number of BCD digits-1.
00001070                            ItoBCDloop:
00001070 80FC 000A                     divu    #10,d0      ;D0:LOW = D0/10, D0:HIGH = D0%10
00001074 2200                          move.l  d0,d1       ;Copy to split quotient and remainder
00001076 0280 0000 FFFF                and.l   #$FFFF,d0   ;D0:HIGH = 0
0000107C 4241                          clr.w   d1          ;D1:LOW = 0, D1:HIGH = 0..9
0000107E D481                          add.l   d1,d2       ;Add digit to binary number.
00001080 E89A                          ror.l   #4,d2       ;Pull it back into 16-bit window
00001082 51CF FFEC                     dbra    d7,ItoBCDloop
00001086 4E75                          rts
00001086 4E75                          rts
00001088                                  include 'framewk\vdp.asm'
00001088                            ;==============================================================
00001088                            ;   BIG EVIL CORPORATION .co.uk
00001088                            ;==============================================================
00001088                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00001088                            ;==============================================================
00001088                            ;   vdp.asm - VDP initialisation and control
00001088                            ;==============================================================
00001088                            

00001088                            InitVDP:
00001088                            

00001088                            	; Set VDP registers
00001088 207C 0000 0000             	move.l #VDPRegisters, a0   		  ; Load address of register table into a0
0000108E 203C 0000 0000             	move.l #(vdp_num_registers-1), d0 ; 24 registers to write (-1 for loop counter)
00001094 223C 0000 0000             	move.l #vdp_write_register, d1    ; 'Set register 0' command
0000109A                            

0000109A                            	@CopyVDP:
0000109A 1218                       	move.b (a0)+, d1           ; Move register value to lower byte of d1
0000109C 33C1 0000 0000             	move.w d1, vdp_control     ; Write command and value to VDP control port
000010A2 0641 0100                  	add.w #0x0100, d1          ; Increment register #
000010A6 51C8 FFF2                  	dbra d0, @CopyVDP
000010AA                            	
000010AA                            	; Clear VDP memory
000010AA 4EB9 0000 0000             	jsr ClearVRAM
000010B0 4EB9 0000 0000             	jsr ClearCRAM
000010B6 4EB9 0000 0000             	jsr ClearVSRAM
000010BC                            

000010BC 4E75                       	rts
000010BE                            	
000010BE                            ClearVRAM:
000010BE                            

000010BE 33FC 8F01 0000 0000        	move.w #0x8F01, vdp_control     ; Set autoincrement to 1 byte
000010C6 33FC 93FF 0000 0000        	move.w #0x93FF, vdp_control     ; Set bytes to fill (lo) (reg 19)
000010CE 33FC 94FF 0000 0000        	move.w #0x94FF, vdp_control     ; Set bytes to fill (hi) (reg 20)
000010D6 33FC 9780 0000 0000        	move.w #0x9780, vdp_control     ; Set DMA to Fill (reg 23, bits 0-1)
000010DE 23FC 4000 0080 0000 0000   	move.l #0x40000080, vdp_control ; Set destination address
000010E8 33FC 0000 0000 0000        	move.w #0x0, vdp_data           ; Value to write
000010F0                            

000010F0                            	@WaitForDMA_vram:                    
000010F0 3239 0000 0000             	move.w vdp_control, d1          ; Read VDP status reg
000010F6 0801 0001                  	btst   #0x1, d1                 ; Check if DMA finished
000010FA 66F4                       	bne.s  @WaitForDMA_vram
000010FC                            	
000010FC 4E75                       	rts
000010FE                            	
000010FE                            ClearVSRAM:
000010FE                            

000010FE 33FC 9350 0000 0000        	move.w #0x9350, vdp_control     ; Set bytes to fill (lo) (reg 19)
00001106 33FC 9400 0000 0000        	move.w #0x9400, vdp_control     ; Set bytes to fill (hi) (reg 20)
0000110E 33FC 9780 0000 0000        	move.w #0x9780, vdp_control     ; Set DMA to Fill (reg 23, bits 0-1)
00001116 23FC 4000 0090 0000 0000   	move.l #0x40000090, vdp_control ; Set destination address
00001120 33FC 0000 0000 0000        	move.w #0x0, vdp_data           ; Value to write
00001128                            

<<<<<<< HEAD
00001128                            	@WaitForDMA_vsram:                    
00001128 3239 0000 0000             	move.w vdp_control, d1          ; Read VDP status reg
0000112E 0801 0001                  	btst   #0x1, d1                 ; Check if DMA finished
00001132 66F4                       	bne.s  @WaitForDMA_vsram
00001134                            

00001134 33FC 8F02 0000 0000        	move.w #0x8F02, vdp_control     ; Set autoincrement to 2 bytes
0000113C 33FC 8ADF 0000 0000        	move.w #0x8ADF, vdp_control     ; Set H interrupt timing
00001144                            	
00001144 4E75                       	rts
00001146                            	
00001146                            ClearCRAM:
00001146                            

00001146 23FC 0000 0000 0000 0000   	move.l #vdp_write_palettes, vdp_control ; Write to palette memory
00001150 723F                       	move.l #0x3F, d1                        ; CRAM size (in words)
00001152                            	@ClrCRAM:
00001152 33FC 0000 0000 0000        	move.w #0x0, vdp_data                   ; Write 0 (autoincrement is 2)
0000115A 51C9 FFF6                  	dbra d1, @ClrCRAM
0000115E                            	
0000115E 4E75                       	rts
0000115E 4E75                       	rts
00001160                                  include 'framewk\z80.asm'
00001160                            ;==============================================================
00001160                            ;   BIG EVIL CORPORATION .co.uk
00001160                            ;==============================================================
00001160                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00001160                            ;==============================================================
00001160                            ;   z80.asm - Z80 initialisation and control
00001160                            ;==============================================================
00001160                            

00001160                            InitZ80:
00001160                            

00001160 33FC 0100 0000 0000        	move.w #0x0100, z80_bus_request ; Request access to the Z80 bus, by writing 0x0100 into the BUSREQ port
00001168 33FC 0100 0000 0000        	move.w #0x0100, z80_bus_reset   ; Hold the Z80 in a reset state, by writing 0x0100 into the RESET port
00001170                            

00001170                            	@Wait:
00001170 0839 0000 0000 0000        	btst #0x0, z80_bus_request ; Test bit 0 of A11100 to see if the 68k has access to the Z80 bus yet
00001178 66F6                       	bne.s @Wait                  ; If we don't yet have control, branch back up to Wait
0000117A                            	
0000117A 207C 0000 0000             	move.l #Z80InitData, a0    ; Load address of data into a0
00001180 227C 0000 0000             	move.l #z80_ram_start, a1  ; Copy Z80 RAM address to a1
00001186 7029                       	move.l #0x29, d0           ; 42 bytes of init data
00001188                            	@CopyZ80:
00001188 12D8                       	move.b (a0)+, (a1)+        ; Copy data, and increment the source/dest addresses
0000118A 51C8 FFFC                  	dbra d0, @CopyZ80
0000118E                            

0000118E 33FC 0000 0000 0000        	move.w #0x0000, z80_bus_reset    ; Release reset state
00001196 33FC 0000 0000 0000        	move.w #0x0000, z80_bus_request  ; Release control of bus
0000119E                            	
0000119E 4E75                       	rts
0000119E 4E75                       	rts
000011A0                                  include 'framewk\echo.68k'
000011A0                            ;****************************************************************************
000011A0                            ; Echo_Z80Request
000011A0                            ; Requests the Z80 bus
000011A0                            ;****************************************************************************
000011A0                            
000011A0                            Echo_Z80Request macro
000011A0                                move.w  #$100, ($A11100)        ; Request Z80 bus
000011A0                            @Echo_WaitZ80\@:
000011A0                                btst.b  #0, ($A11100)           ; Did we get it yet?
000011A0                                bne.s   @Echo_WaitZ80\@         ; Keep waiting
000011A0                                endm                            ; End of macro
000011A0                            
000011A0                            ;****************************************************************************
000011A0                            ; Echo_Z80Release
000011A0                            ; Releases the Z80 bus
000011A0                            ;****************************************************************************
000011A0                            
000011A0                            Echo_Z80Release macro
000011A0                                move.w  #$000, ($A11100)        ; Release Z80 bus
000011A0                                endm                            ; End of macro
000011A0                            
000011A0                            ;****************************************************************************
000011A0                            ; Echo_Z80Reset
000011A0                            ; Resets the Z80 and YM2612
000011A0                            ;****************************************************************************
000011A0                            
000011A0                            Echo_Z80Reset macro
000011A0                                move.w  #$000, ($A11200)        ; Assert reset line
000011A0                                rept    $10                     ; Wait until hardware resets
000011A0                                nop                               ; ...
000011A0                                endr                              ; ...
000011A0                                move.w  #$100, ($A11200)        ; Release reset line
000011A0                                endm                            ; End of macro
000011A0                            
000011A0                            ;****************************************************************************
000011A0                            ; Echo_SendCommand
000011A0                            ; Sends an Echo command (no address parameter)
000011A0                            ;
000011A0                            ; input d0.b ... Echo command
000011A0                            ;****************************************************************************
000011A0                            
000011A0                            Echo_SendCommand:
000011A0 48E7 4040                      movem.l d1/a1, -(sp)            ; Save registers
000011A4 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
000011B6                            
000011B6 43F9 00A0 1FFF                 lea     ($A01FFF), a1           ; First try the 1st slot
000011BC 4A11                           tst.b   (a1)                    ; Is 1st slot available?
000011BE 6700                           beq.s   @Ready                    ; If so, move on
000011C0 5989                           subq.l  #4, a1                  ; Try 2nd slot otherwise
000011C2                            
000011C2                            @Try:
000011C2 4A11                           tst.b   (a1)                    ; Check if 2nd slot is ready
000011C4 6700                           beq.s   @Ready                  ; Too busy?
000011C6 33FC 0000 00A1 1100            Echo_Z80Release                   ; Let Echo continue
000011CE 323C 00FF                      move.w  #$FF, d1                  ; Give it some time
000011D2 51C9 FFFE                      dbf     d1, *                       ; ...
000011D6 33FC 0100 00A1 1100 0839+      Echo_Z80Request                   ; Get Z80 bus back
000011E8 60D8                           bra.s   @Try                      ; Try again
000011EA                            
000011EA                            @Ready:
000011EA 1280                           move.b  d0, (a1)                ; Write command ID
000011EC 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000011F4                            
000011F4 4CDF 0202                      movem.l (sp)+, d1/a1            ; Restore registers
000011F8 4E75                           rts                             ; End of subroutine
000011FA                            
000011FA                            ;****************************************************************************
000011FA                            ; Echo_SendCommandAddr
000011FA                            ; Sends an Echo command (with address parameter)
000011FA                            ;
000011FA                            ; input d0.b ... Echo command
000011FA                            ; input a0.l ... Address parameter
000011FA                            ;****************************************************************************
000011FA                            
000011FA                            Echo_SendCommandAddr:
000011FA                            Echo_SendCommandEx:
000011FA 48E7 C040                      movem.l d0-d1/a1, -(sp)         ; Save registers
000011FE 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001210                            
00001210 43F9 00A0 1FFF                 lea     ($A01FFF), a1           ; First try the 1st slot
00001216 4A11                           tst.b   (a1)                    ; Is 1st slot available?
00001218 6700                           beq.s   @Ready                    ; If so, move on
0000121A 5989                           subq.l  #4, a1                  ; Try 2nd slot otherwise
0000121C                            
0000121C                            @Try:
0000121C 4A11                           tst.b   (a1)                    ; Check if 2nd slot is ready
0000121E 6700                           beq.s   @Ready                  ; Too busy?
00001220 33FC 0000 00A1 1100            Echo_Z80Release                   ; Let Echo continue
00001228 323C 00FF                      move.w  #$FF, d1                  ; Give it some time
0000122C 51C9 FFFE                      dbf     d1, *                       ; ...
00001230 33FC 0100 00A1 1100 0839+      Echo_Z80Request                   ; Get Z80 bus back
00001242 60D8                           bra.s   @Try                      ; Try again
00001244                            
00001244                            @Ready:
00001244 1280                           move.b  d0, (a1)                ; Write command ID
00001246                            
00001246 2008                           move.l  a0, d0                  ; Easier to manipulate here
00001248 1340 FFFE                      move.b  d0, -2(a1)              ; Store low address byte
0000124C EE88                           lsr.l   #7, d0                  ; Get high address byte
0000124E E208                           lsr.b   #1, d0                    ; We skip one bit
00001250 08C0 0007                      bset.l  #7, d0                    ; Point into bank window
00001254 1340 FFFF                      move.b  d0, -1(a1)              ; Store high address byte
00001258                            
00001258 E048                           lsr.w   #8, d0                  ; Get bank byte
0000125A 3200                           move.w  d0, d1                    ; Parse 32X bit separately
0000125C E249                           lsr.w   #1, d1                    ; Put 32X bit in place
0000125E 0200 007F                      and.b   #$7F, d0                  ; Filter out unused bit from addresses
00001262 0201 0080                      and.b   #$80, d1                  ; Filter out all but 32X bit
00001266 8001                           or.b    d1, d0                    ; Put everything together
00001268 1340 FFFD                      move.b  d0, -3(a1)              ; Store bank byte
0000126C                            
0000126C 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
00001274                            
00001274 4CDF 0203                      movem.l (sp)+, d0-d1/a1         ; Restore registers
00001278 4E75                           rts                             ; End of subroutine
0000127A                            
0000127A                            ;****************************************************************************
0000127A                            ; Echo_SendCommandByte
0000127A                            ; Sends an Echo command (with a byte parameter)
0000127A                            ;
0000127A                            ; input d0.b ... Echo command
0000127A                            ; input d1.b ... Byte parameter
0000127A                            ;****************************************************************************
0000127A                            
0000127A                            Echo_SendCommandByte:
0000127A 48E7 6040                      movem.l d1-d2/a1, -(sp)         ; Save registers
0000127E 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001290                            
00001290 43F9 00A0 1FFF                 lea     ($A01FFF), a1           ; First try the 1st slot
00001296 4A11                           tst.b   (a1)                    ; Is 1st slot available?
00001298 6700                           beq.s   @Ready                    ; If so, move on
0000129A 5989                           subq.l  #4, a1                  ; Try 2nd slot otherwise
0000129C                            
0000129C                            @Try:
0000129C 4A11                           tst.b   (a1)                    ; Check if 2nd slot is ready
0000129E 6700                           beq.s   @Ready                  ; Too busy?
000012A0 33FC 0000 00A1 1100            Echo_Z80Release                   ; Let Echo continue
000012A8 343C 00FF                      move.w  #$FF, d2                  ; Give it some time
000012AC 51CA FFFE                      dbf     d2, *                       ; ...
000012B0 33FC 0100 00A1 1100 0839+      Echo_Z80Request                   ; Get Z80 bus back
000012C2 60D8                           bra.s   @Try                      ; Try again
000012C4                            
000012C4                            @Ready:
000012C4 1280                           move.b  d0, (a1)                ; Write command ID
000012C6 1341 FFFD                      move.b  d1, -3(a1)              ; Write parameter
000012CA 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000012D2                            
000012D2 4CDF 0206                      movem.l (sp)+, d1-d2/a1         ; Restore registers
000012D6 4E75                           rts                             ; End of subroutine
000012D8                            
000012D8                            ;****************************************************************************
000012D8                            ; Echo_PlaySFX
000012D8                            ; Plays a SFX
000012D8                            ;
000012D8                            ; input a0.l ... Pointer to SFX data
000012D8                            ;****************************************************************************
000012D8                            
000012D8                            Echo_PlaySFX:
000012D8 3F00                           move.w  d0, -(sp)               ; Save register
000012DA 103C 0002                      move.b  #$02, d0                ; Command $02 = play SFX
000012DE 6100 FF1A                      bsr     Echo_SendCommandAddr    ; Send command to Echo
000012E2 301F                           move.w  (sp)+, d0               ; Restore register
000012E4                                
000012E4 4E75                           rts                             ; End of subroutine
000012E6                            
000012E6                            ;****************************************************************************
000012E6                            ; Echo_StopSFX
000012E6                            ; Stops SFX playback
000012E6                            ;****************************************************************************
000012E6                            
000012E6                            Echo_StopSFX:
000012E6 3F00                           move.w  d0, -(sp)               ; Save register
000012E8 103C 0003                      move.b  #$03, d0                ; Command $03 = stop SFX
000012EC 6100 FEB2                      bsr     Echo_SendCommand        ; Send command to Echo
000012F0 301F                           move.w  (sp)+, d0               ; Restore register
000012F2                                
000012F2 4E75                           rts                             ; End of subroutine
000012F4                            
000012F4                            ;****************************************************************************
000012F4                            ; Echo_PlayBGM
000012F4                            ; Plays a BGM
000012F4                            ;
000012F4                            ; input a0.l ... Pointer to BGM data
000012F4                            ;****************************************************************************
000012F4                            
000012F4                            Echo_PlayBGM:
000012F4 3F00                           move.w  d0, -(sp)               ; Save register
000012F6 103C 0004                      move.b  #$04, d0                ; Command $04 = play BGM
000012FA 6100 FEFE                      bsr     Echo_SendCommandAddr    ; Send command to Echo
000012FE 301F                           move.w  (sp)+, d0               ; Restore register
00001300                                
00001300 4E75                           rts                             ; End of subroutine
00001302                            
00001302                            ;****************************************************************************
00001302                            ; Echo_StopBGM
00001302                            ; Stops BGM playback
00001302                            ;****************************************************************************
00001302                            
00001302                            Echo_StopBGM:
00001302 3F00                           move.w  d0, -(sp)               ; Save register
00001304 103C 0005                      move.b  #$05, d0                ; Command $05 = stop BGM
00001308 6100 FE96                      bsr     Echo_SendCommand        ; Send command to Echo
0000130C 301F                           move.w  (sp)+, d0               ; Restore register
0000130E                                
0000130E 4E75                           rts                             ; End of subroutine
00001310                            
00001310                            ;****************************************************************************
00001310                            ; Echo_PauseBGM
00001310                            ; Pauses BGM playback
00001310                            ;****************************************************************************
00001310                            
00001310                            Echo_PauseBGM:
00001310 3F00                           move.w  d0, -(sp)               ; Save register
00001312 103C 0008                      move.b  #$08, d0                ; Command $08 = pause BGM
00001316 6100 FE88                      bsr     Echo_SendCommand        ; Send command to Echo
0000131A 301F                           move.w  (sp)+, d0               ; Restore register
0000131C 4E75                           rts                             ; End of subroutine
0000131E                            
0000131E                            ;****************************************************************************
0000131E                            ; Echo_ResumeBGM
0000131E                            ; Resumes BGM playback
0000131E                            ;****************************************************************************
0000131E                            
0000131E                            Echo_ResumeBGM:
0000131E 3F00                           move.w  d0, -(sp)               ; Save register
00001320 103C 0006                      move.b  #$06, d0                ; Command $06 = resume BGM
00001324 6100 FE7A                      bsr     Echo_SendCommand        ; Send command to Echo
00001328 301F                           move.w  (sp)+, d0               ; Restore register
0000132A 4E75                           rts                             ; End of subroutine
0000132C                            
0000132C                            ;****************************************************************************
0000132C                            ; Echo_PlayDirect
0000132C                            ; Injects events into the BGM stream for the next tick.
0000132C                            ;
0000132C                            ; input a0.l ... Pointer to stream data
0000132C                            ;****************************************************************************
0000132C                            
0000132C                            Echo_PlayDirect:
0000132C 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
0000133E 48E7 C0C0                      movem.l d0-d1/a0-a1, -(sp)      ; Save registers
00001342                            
00001342 43F9 00A0 1F00                 lea     ($A01F00), a1           ; Skip any pending events
00001348 72FF                           moveq   #-1, d1
0000134A                            @Skip:
0000134A B211                           cmp.b   (a1), d1
0000134C 6700                           beq.s   @Load
0000134E 5249                           addq.w  #1, a1
00001350 60F8                           bra.s   @Skip
00001352                            
00001352                            @Load:                              ; Copy stream into the direct buffer
00001352 1018                           move.b  (a0)+, d0
00001354 12C0                           move.b  d0, (a1)+
00001356 B001                           cmp.b   d1, d0
00001358 66F8                           bne.s   @Load
0000135A                            
0000135A 4CDF 0303                      movem.l (sp)+, d0-d1/a0-a1      ; Restore registers
0000135E 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
00001366 4E75                           rts                             ; End of subroutine
00001368                            
00001368                            ;****************************************************************************
00001368                            ; Echo_SetPCMRate
00001368                            ; Sets the playback rate of PCM
00001368                            ;
00001368                            ; input d0.b ... New rate (timer A value)
00001368                            ;****************************************************************************
00001368                            
00001368                            Echo_SetPCMRate:
00001368 48E7 C000                      movem.l d0-d1, -(sp)            ; Save registers
0000136C 1200                           move.b  d0, d1                  ; Put parameter in place
0000136E 103C 0007                      move.b  #$07, d0                ; Command $07 = set PCM rate
00001372 6100 FF06                      bsr     Echo_SendCommandByte    ; Send command to Echo
00001376 4CDF 0003                      movem.l (sp)+, d0-d1            ; Restore registers
0000137A 4E75                           rts                             ; End of subroutine
0000137C                            
0000137C                            ;****************************************************************************
0000137C                            ; Echo_SetStereo
0000137C                            ; Sets whether stereo is enabled or not
0000137C                            ;
0000137C                            ; input d0.b ... 0 to disable, otherwise to enable
0000137C                            ;****************************************************************************
0000137C                            
0000137C                            Echo_SetStereo:
0000137C 48E7 C000                      movem.l d0-d1, -(sp)            ; Save registers
00001380 4A00                           tst.b   d0                      ; Check what we want to do
00001382 57C1                           seq.b   d1                      ; Put parameter in place
00001384 103C 0009                      move.b  #$09, d0                ; Command $09 = set stereo
00001388 6100 FEF0                      bsr     Echo_SendCommandByte    ; Send command to Echo
0000138C 4CDF 0003                      movem.l (sp)+, d0-d1            ; Restore registers
00001390 4E75                           rts                             ; End of subroutine
00001392                            
00001392                            ;****************************************************************************
00001392                            ; Echo_SetVolume
00001392                            ; Changes the global volume for every channel.
00001392                            ;
00001392                            ; input d0.b ... New volume (0 = quietest, 255 = loudest)
00001392                            ;****************************************************************************
00001392                            
00001392                            Echo_SetVolume:
00001392 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
000013A4 48E7 C0C0                      movem.l d0-d1/a0-a1, -(sp)      ; Save registers
000013A8                                
000013A8 41FA 0000                      lea     Echo_FMVolTable(pc), a0 ; Determine FM volume
000013AC 7200                           moveq   #0, d1
000013AE 1200                           move.b  d0, d1
000013B0 E409                           lsr.b   #2, d1
000013B2 1230 1000                      move.b  (a0,d1.w), d1
000013B6                                
000013B6 43F9 00A0 1FE0                 lea     ($A01FE0), a1           ; Copy new FM volume values
000013BC 12C1                           move.b  d1, (a1)+                 ; FM channel 0
000013BE 12C1                           move.b  d1, (a1)+                 ; FM channel 1
000013C0 12C1                           move.b  d1, (a1)+                 ; FM channel 2
000013C2 12C1                           move.b  d1, (a1)+                 ; FM channel 3
000013C4 12C1                           move.b  d1, (a1)+                 ; FM channel 4
000013C6 12C1                           move.b  d1, (a1)+                 ; FM channel 5
000013C8 12C1                           move.b  d1, (a1)+                 ; FM channel 6
000013CA 12C1                           move.b  d1, (a1)+                 ; FM channel 7
000013CC                                
000013CC 41FA 0000                      lea     Echo_PSGVolTable(pc),a0 ; Determine PSG volume
000013D0 7200                           moveq   #0, d1
000013D2 1200                           move.b  d0, d1
000013D4 E409                           lsr.b   #2, d1
000013D6 1230 1000                      move.b  (a0,d1.w), d1
000013DA                                
000013DA                                                                ; Copy new PSG values
000013DA 12C1                           move.b  d1, (a1)+                 ; PSG channel 0
000013DC 12C1                           move.b  d1, (a1)+                 ; PSG channel 1
000013DE 12C1                           move.b  d1, (a1)+                 ; PSG channel 2
000013E0 12C1                           move.b  d1, (a1)+                 ; PSG channel 3
000013E2                                
000013E2 0C00 0040                      cmp.b   #$40, d0                ; Determine whether PCM should be enabled
000013E6 54C1                           shs     d1                        ; (we do an heuristic for enabling PCM
000013E8 0201 0001                      and.b   #1, d1                    ; based on the volume value)
000013EC 12C1                           move.b  d1, (a1)+
000013EE                                
000013EE 13FC 0001 00A0 1FF1            move.b  #1, ($A01FF1)           ; Tell Echo to update the volume levels
000013F6                                
000013F6 4CDF 0303                      movem.l (sp)+, d0-d1/a0-a1      ; Restore registers
000013FA 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
00001402 4E75                           rts                             ; End of subroutine
00001404                            
00001404                            ;----------------------------------------------------------------------------
00001404                            
00001404                            Echo_FMVolTable:
00001404 7F7B 7773 706C 6865 615E+      dc.b    $7F,$7B,$77,$73,$70,$6C,$68,$65,$61,$5E,$5A,$57,$54,$50,$4D,$4A
00001414 4744 413F 3C39 3634 312F+      dc.b    $47,$44,$41,$3F,$3C,$39,$36,$34,$31,$2F,$2D,$2A,$28,$26,$24,$22
00001424 201E 1C1A 1816 1513 1210+      dc.b    $20,$1E,$1C,$1A,$18,$16,$15,$13,$12,$10,$0F,$0D,$0C,$0B,$0A,$09
00001434 0807 0605 0404 0302 0201+      dc.b    $08,$07,$06,$05,$04,$04,$03,$02,$02,$01,$01,$01,$00,$00,$00,$00
00001444                            
00001444                            Echo_PSGVolTable:
00001444 0F0F 0E0E 0D0D 0C0C 0B0B+      dc.b    $0F,$0F,$0E,$0E,$0D,$0D,$0C,$0C,$0B,$0B,$0B,$0A,$0A,$0A,$09,$09
00001454 0808 0807 0707 0606 0606+      dc.b    $08,$08,$08,$07,$07,$07,$06,$06,$06,$06,$05,$05,$05,$04,$04,$04
00001464 0403 0303 0303 0202 0202+      dc.b    $04,$03,$03,$03,$03,$03,$02,$02,$02,$02,$02,$02,$01,$01,$01,$01
00001474 0101 0101 0100 0000 0000+      dc.b    $01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
00001484                            
00001484                            ;****************************************************************************
00001484                            ; Echo_SetVolumeEx
00001484                            ; Changes the global volume for each individual channel.
00001484                            ;
00001484                            ; input a0.l ... Pointer to 16 bytes
00001484                            ;                  8 bytes with FM volumes (0..127)
00001484                            ;                  4 bytes with PSG volumes (0..15)
00001484                            ;                  1 byte with PCM toggle (0/1)
00001484                            ;                  3 reserved (unused for now)
00001484                            ;****************************************************************************
00001484                            
00001484                            Echo_SetVolumeEx:
00001484 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001496 48E7 00C0                      movem.l a0-a1, -(sp)            ; Save registers
0000149A                                
0000149A 43F9 00A0 1FE0                 lea     ($A01FE0), a1           ; Copy new volume values
000014A0 12D8                           move.b  (a0)+, (a1)+              ; FM channel 0
000014A2 12D8                           move.b  (a0)+, (a1)+              ; FM channel 1
000014A4 12D8                           move.b  (a0)+, (a1)+              ; FM channel 2
000014A6 12D8                           move.b  (a0)+, (a1)+              ; FM channel 3
000014A8 12D8                           move.b  (a0)+, (a1)+              ; FM channel 4
000014AA 12D8                           move.b  (a0)+, (a1)+              ; FM channel 5
000014AC 12D8                           move.b  (a0)+, (a1)+              ; FM channel 6
000014AE 12D8                           move.b  (a0)+, (a1)+              ; FM channel 7
000014B0 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 0
000014B2 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 1
000014B4 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 2
000014B6 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 3
000014B8 12D8                           move.b  (a0)+, (a1)+              ; PCM channel toggle
000014BA 12D8                           move.b  (a0)+, (a1)+              ; (reserved)
000014BC 12D8                           move.b  (a0)+, (a1)+              ; (reserved)
000014BE 12D8                           move.b  (a0)+, (a1)+              ; (reserved)
000014C0                                
000014C0 13FC 0001 00A0 1FF1            move.b  #1, ($A01FF1)           ; Tell Echo to update the volume levels
000014C8                                
000014C8 4CDF 0300                      movem.l (sp)+, a0-a1            ; Restore registers
000014CC 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000014D4 4E75                           rts                             ; End of subroutine
000014D6                            
000014D6                            ;****************************************************************************
000014D6                            ; Echo_GetStatus
000014D6                            ; Gets the current status of Echo
000014D6                            ;
000014D6                            ; output d0.w ... Echo status
000014D6                            ;                   Bit #0: SFX is playing
000014D6                            ;                   Bit #1: BGM is playing
000014D6                            ;                   Bit #14: direct events not played
000014D6                            ;                   Bit #15: command still not parsed
000014D6                            ;****************************************************************************
000014D6                            
000014D6                            Echo_GetStatus:
000014D6 48E7 6040                      movem.l d1-d2/a1, -(sp)         ; Save registers
000014DA                            
000014DA 4240                           clr.w   d0                      ; Set all needed bits to 0
000014DC 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
000014EE 1039 00A0 1FF0                 move.b  ($A01FF0), d0           ; Get the status flags
000014F4                            
000014F4 4A39 00A0 1FFB                 tst.b   ($A01FFB)               ; Check if any commands can be sent
000014FA 6700                           beq.s   @NotBusy                ; Any room left for new commands?
000014FC 08C0 000F                      bset.l  #15, d0                 ; If not, set the relevant flag
00001500                            @NotBusy:
00001500                            
00001500 0C39 00FF 00A0 1F00            cmpi.b  #$FF, ($A01F00)         ; Check if the direct buffer is empty
00001508 6700                           beq.s   @DirectEmpty            ; Any direct events still to be played?
0000150A 08C0 000E                      bset.l  #14, d0                 ; If so, set the relevant flag
0000150E                            @DirectEmpty:
0000150E                            
0000150E 7200                           moveq   #0, d1                  ; Clear unused bits from index
00001510 43FA 0000                      lea     @AndTable(pc), a1       ; Get pointer to look-up tables
00001514                                
00001514 1239 00A0 1FFF                 move.b  ($A01FFF), d1           ; Get next pending command (if any)
0000151A 6700                           beq.s   @QueueChecked           ; No commands left to process?
0000151C 1431 1000                      move.b  (a1,d1.w), d2           ; Get mask of flags to leave
00001520 C002                           and.b   d2, d0                  ; Remove flags that should be clear
00001522 1431 1000                      move.b  @OrTable-@AndTable(a1,d1.w), d2 ; Get mask of flags to set
00001526 8002                           or.b    d2, d0                  ; Insert flags that should be set
00001528                            
00001528 1239 00A0 1FFB                 move.b  ($A01FFB), d1           ; Repeat that with 2nd pending command
0000152E 6700                           beq.s   @QueueChecked
00001530 1431 1000                      move.b  (a1,d1.w), d2
00001534 C002                           and.b   d2, d0
00001536 1431 1000                      move.b  @OrTable-@AndTable(a1,d1.w), d2
0000153A 8002                           or.b    d2, d0
0000153C                            
0000153C                            @QueueChecked:
0000153C 33FC 0000 00A1 1100            Echo_Z80Release                 ; Let the Z80 go!
00001544 4CDF 0206                      movem.l (sp)+, d1-d2/a1         ; Restore registers
00001548 4E75                           rts                             ; End of subroutine
0000154A                            
0000154A                            ;----------------------------------------------------------------------------
0000154A                            ; Look-up tables used to readjust the status flags based on pending commands
0000154A                            ; that haven't been processed yet (normally they wouldn't be updated yet, but
0000154A                            ; this can catch programmers off guard so we cheat it).
0000154A                            ;
0000154A                            ; Every byte represents a possible command.
0000154A                            ;----------------------------------------------------------------------------
0000154A                            
0000154A FFFF FFFE FFFD FFFF FF     @AndTable:  dc.b $FF,$FF, $FF,$FE,$FF,$FD, $FF,$FF,$FF
00001553 0000 0100 0200 0000 00     @OrTable:   dc.b $00,$00, $01,$00,$02,$00, $00,$00,$00
0000155C                                        even
0000155C                            
=======
00001128 33FC 8F02 0000 0000        	move.w #0x8F02, vdp_control     ; Set autoincrement to 2 bytes
00001130 33FC 8ADF 0000 0000        	move.w #0x8ADF, vdp_control     ; Set H interrupt timing
00001138                            	
00001138 4E75                       	rts
0000113A                            	
0000113A                            ClearCRAM:
0000113A                            

0000113A 23FC 0000 0000 0000 0000   	move.l #vdp_write_palettes, vdp_control ; Write to palette memory
00001144 723F                       	move.l #0x3F, d1                        ; CRAM size (in words)
00001146                            	@ClrCRAM:
00001146 33FC 0000 0000 0000        	move.w #0x0, vdp_data                   ; Write 0 (autoincrement is 2)
0000114E 51C9 FFF6                  	dbra d1, @ClrCRAM
00001152                            	
00001152 4E75                       	rts
00001152 4E75                       	rts
00001154                                  include 'framewk\z80.asm'
00001154                            ;==============================================================
00001154                            ;   BIG EVIL CORPORATION .co.uk
00001154                            ;==============================================================
00001154                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00001154                            ;==============================================================
00001154                            ;   z80.asm - Z80 initialisation and control
00001154                            ;==============================================================
00001154                            

00001154                            InitZ80:
00001154                            

00001154 33FC 0100 0000 0000        	move.w #0x0100, z80_bus_request ; Request access to the Z80 bus, by writing 0x0100 into the BUSREQ port
0000115C 33FC 0100 0000 0000        	move.w #0x0100, z80_bus_reset   ; Hold the Z80 in a reset state, by writing 0x0100 into the RESET port
00001164                            

00001164                            	@Wait:
00001164 0839 0000 0000 0000        	btst #0x0, z80_bus_request ; Test bit 0 of A11100 to see if the 68k has access to the Z80 bus yet
0000116C 66F6                       	bne.s @Wait                  ; If we don't yet have control, branch back up to Wait
0000116E                            	
0000116E 207C 0000 0000             	move.l #Z80InitData, a0    ; Load address of data into a0
00001174 227C 0000 0000             	move.l #z80_ram_start, a1  ; Copy Z80 RAM address to a1
0000117A 7029                       	move.l #0x29, d0           ; 42 bytes of init data
0000117C                            	@CopyZ80:
0000117C 12D8                       	move.b (a0)+, (a1)+        ; Copy data, and increment the source/dest addresses
0000117E 51C8 FFFC                  	dbra d0, @CopyZ80
00001182                            

00001182 33FC 0000 0000 0000        	move.w #0x0000, z80_bus_reset    ; Release reset state
0000118A 33FC 0000 0000 0000        	move.w #0x0000, z80_bus_request  ; Release control of bus
00001192                            	
00001192 4E75                       	rts
00001192 4E75                       	rts
00001194                                  include 'framewk\echo.68k'
00001194                            ;****************************************************************************
00001194                            ; Echo_Z80Request
00001194                            ; Requests the Z80 bus
00001194                            ;****************************************************************************
00001194                            

00001194                            Echo_Z80Request macro
00001194                                move.w  #$100, ($A11100)        ; Request Z80 bus
00001194                            @Echo_WaitZ80\@:
00001194                                btst.b  #0, ($A11100)           ; Did we get it yet?
00001194                                bne.s   @Echo_WaitZ80\@         ; Keep waiting
00001194                                endm                            ; End of macro
00001194                            

00001194                            ;****************************************************************************
00001194                            ; Echo_Z80Release
00001194                            ; Releases the Z80 bus
00001194                            ;****************************************************************************
00001194                            

00001194                            Echo_Z80Release macro
00001194                                move.w  #$000, ($A11100)        ; Release Z80 bus
00001194                                endm                            ; End of macro
00001194                            

00001194                            ;****************************************************************************
00001194                            ; Echo_Z80Reset
00001194                            ; Resets the Z80 and YM2612
00001194                            ;****************************************************************************
00001194                            

00001194                            Echo_Z80Reset macro
00001194                                move.w  #$000, ($A11200)        ; Assert reset line
00001194                                rept    $10                     ; Wait until hardware resets
00001194                                nop                               ; ...
00001194                                endr                              ; ...
00001194                                move.w  #$100, ($A11200)        ; Release reset line
00001194                                endm                            ; End of macro
00001194                            

00001194                            ;****************************************************************************
00001194                            ; Echo_SendCommand
00001194                            ; Sends an Echo command (no address parameter)
00001194                            ;
00001194                            ; input d0.b ... Echo command
00001194                            ;****************************************************************************
00001194                            

00001194                            Echo_SendCommand:
00001194 48E7 4040                      movem.l d1/a1, -(sp)            ; Save registers
00001198 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
000011AA                            

000011AA 43F9 00A0 1FFF                 lea     ($A01FFF), a1           ; First try the 1st slot
000011B0 4A11                           tst.b   (a1)                    ; Is 1st slot available?
000011B2 6700                           beq.s   @Ready                    ; If so, move on
000011B4 5989                           subq.l  #4, a1                  ; Try 2nd slot otherwise
000011B6                            

000011B6                            @Try:
000011B6 4A11                           tst.b   (a1)                    ; Check if 2nd slot is ready
000011B8 6700                           beq.s   @Ready                  ; Too busy?
000011BA 33FC 0000 00A1 1100            Echo_Z80Release                   ; Let Echo continue
000011C2 323C 00FF                      move.w  #$FF, d1                  ; Give it some time
000011C6 51C9 FFFE                      dbf     d1, *                       ; ...
000011CA 33FC 0100 00A1 1100 0839+      Echo_Z80Request                   ; Get Z80 bus back
000011DC 60D8                           bra.s   @Try                      ; Try again
000011DE                            

000011DE                            @Ready:
000011DE 1280                           move.b  d0, (a1)                ; Write command ID
000011E0 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000011E8                            

000011E8 4CDF 0202                      movem.l (sp)+, d1/a1            ; Restore registers
000011EC 4E75                           rts                             ; End of subroutine
000011EE                            

000011EE                            ;****************************************************************************
000011EE                            ; Echo_SendCommandAddr
000011EE                            ; Sends an Echo command (with address parameter)
000011EE                            ;
000011EE                            ; input d0.b ... Echo command
000011EE                            ; input a0.l ... Address parameter
000011EE                            ;****************************************************************************
000011EE                            

000011EE                            Echo_SendCommandAddr:
000011EE                            Echo_SendCommandEx:
000011EE 48E7 C040                      movem.l d0-d1/a1, -(sp)         ; Save registers
000011F2 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001204                            

00001204 43F9 00A0 1FFF                 lea     ($A01FFF), a1           ; First try the 1st slot
0000120A 4A11                           tst.b   (a1)                    ; Is 1st slot available?
0000120C 6700                           beq.s   @Ready                    ; If so, move on
0000120E 5989                           subq.l  #4, a1                  ; Try 2nd slot otherwise
00001210                            

00001210                            @Try:
00001210 4A11                           tst.b   (a1)                    ; Check if 2nd slot is ready
00001212 6700                           beq.s   @Ready                  ; Too busy?
00001214 33FC 0000 00A1 1100            Echo_Z80Release                   ; Let Echo continue
0000121C 323C 00FF                      move.w  #$FF, d1                  ; Give it some time
00001220 51C9 FFFE                      dbf     d1, *                       ; ...
00001224 33FC 0100 00A1 1100 0839+      Echo_Z80Request                   ; Get Z80 bus back
00001236 60D8                           bra.s   @Try                      ; Try again
00001238                            

00001238                            @Ready:
00001238 1280                           move.b  d0, (a1)                ; Write command ID
0000123A                            

0000123A 2008                           move.l  a0, d0                  ; Easier to manipulate here
0000123C 1340 FFFE                      move.b  d0, -2(a1)              ; Store low address byte
00001240 EE88                           lsr.l   #7, d0                  ; Get high address byte
00001242 E208                           lsr.b   #1, d0                    ; We skip one bit
00001244 08C0 0007                      bset.l  #7, d0                    ; Point into bank window
00001248 1340 FFFF                      move.b  d0, -1(a1)              ; Store high address byte
0000124C                            

0000124C E048                           lsr.w   #8, d0                  ; Get bank byte
0000124E 3200                           move.w  d0, d1                    ; Parse 32X bit separately
00001250 E249                           lsr.w   #1, d1                    ; Put 32X bit in place
00001252 0200 007F                      and.b   #$7F, d0                  ; Filter out unused bit from addresses
00001256 0201 0080                      and.b   #$80, d1                  ; Filter out all but 32X bit
0000125A 8001                           or.b    d1, d0                    ; Put everything together
0000125C 1340 FFFD                      move.b  d0, -3(a1)              ; Store bank byte
00001260                            

00001260 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
00001268                            

00001268 4CDF 0203                      movem.l (sp)+, d0-d1/a1         ; Restore registers
0000126C 4E75                           rts                             ; End of subroutine
0000126E                            

0000126E                            ;****************************************************************************
0000126E                            ; Echo_SendCommandByte
0000126E                            ; Sends an Echo command (with a byte parameter)
0000126E                            ;
0000126E                            ; input d0.b ... Echo command
0000126E                            ; input d1.b ... Byte parameter
0000126E                            ;****************************************************************************
0000126E                            

0000126E                            Echo_SendCommandByte:
0000126E 48E7 4040                      movem.l d1/a1, -(sp)            ; Save registers
00001272 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001284                            

00001284 43F9 00A0 1FFF                 lea     ($A01FFF), a1           ; First try the 1st slot
0000128A 4A11                           tst.b   (a1)                    ; Is 1st slot available?
0000128C 6700                           beq.s   @Ready                    ; If so, move on
0000128E 5989                           subq.l  #4, a1                  ; Try 2nd slot otherwise
00001290                            

00001290                            @Try:
00001290 4A11                           tst.b   (a1)                    ; Check if 2nd slot is ready
00001292 6700                           beq.s   @Ready                  ; Too busy?
00001294 33FC 0000 00A1 1100            Echo_Z80Release                   ; Let Echo continue
0000129C 323C 00FF                      move.w  #$FF, d1                  ; Give it some time
000012A0 51C9 FFFE                      dbf     d1, *                       ; ...
000012A4 33FC 0100 00A1 1100 0839+      Echo_Z80Request                   ; Get Z80 bus back
000012B6 60D8                           bra.s   @Try                      ; Try again
000012B8                            

000012B8                            @Ready:
000012B8 1280                           move.b  d0, (a1)                ; Write command ID
000012BA 1341 FFFD                      move.b  d1, -3(a1)              ; Write parameter
000012BE 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000012C6                            

000012C6 4CDF 0202                      movem.l (sp)+, d1/a1            ; Restore registers
000012CA 4E75                           rts                             ; End of subroutine
000012CC                            

000012CC                            ;****************************************************************************
000012CC                            ; Echo_PlaySFX
000012CC                            ; Plays a SFX
000012CC                            ;
000012CC                            ; input a0.l ... Pointer to SFX data
000012CC                            ;****************************************************************************
000012CC                            

000012CC                            Echo_PlaySFX:
000012CC 3F00                           move.w  d0, -(sp)               ; Save register
000012CE 103C 0002                      move.b  #$02, d0                ; Command $02 = play SFX
000012D2 6100 FF1A                      bsr     Echo_SendCommandAddr    ; Send command to Echo
000012D6 301F                           move.w  (sp)+, d0               ; Restore register
000012D8                                
000012D8 4E75                           rts                             ; End of subroutine
000012DA                            

000012DA                            ;****************************************************************************
000012DA                            ; Echo_StopSFX
000012DA                            ; Stops SFX playback
000012DA                            ;****************************************************************************
000012DA                            

000012DA                            Echo_StopSFX:
000012DA 3F00                           move.w  d0, -(sp)               ; Save register
000012DC 103C 0003                      move.b  #$03, d0                ; Command $03 = stop SFX
000012E0 6100 FEB2                      bsr     Echo_SendCommand        ; Send command to Echo
000012E4 301F                           move.w  (sp)+, d0               ; Restore register
000012E6                                
000012E6 4E75                           rts                             ; End of subroutine
000012E8                            

000012E8                            ;****************************************************************************
000012E8                            ; Echo_PlayBGM
000012E8                            ; Plays a BGM
000012E8                            ;
000012E8                            ; input a0.l ... Pointer to BGM data
000012E8                            ;****************************************************************************
000012E8                            

000012E8                            Echo_PlayBGM:
000012E8 3F00                           move.w  d0, -(sp)               ; Save register
000012EA 103C 0004                      move.b  #$04, d0                ; Command $04 = play BGM
000012EE 6100 FEFE                      bsr     Echo_SendCommandAddr    ; Send command to Echo
000012F2 301F                           move.w  (sp)+, d0               ; Restore register
000012F4                                
000012F4 4E75                           rts                             ; End of subroutine
000012F6                            

000012F6                            ;****************************************************************************
000012F6                            ; Echo_StopBGM
000012F6                            ; Stops BGM playback
000012F6                            ;****************************************************************************
000012F6                            

000012F6                            Echo_StopBGM:
000012F6 3F00                           move.w  d0, -(sp)               ; Save register
000012F8 103C 0005                      move.b  #$05, d0                ; Command $05 = stop BGM
000012FC 6100 FE96                      bsr     Echo_SendCommand        ; Send command to Echo
00001300 301F                           move.w  (sp)+, d0               ; Restore register
00001302                                
00001302 4E75                           rts                             ; End of subroutine
00001304                            

00001304                            ;****************************************************************************
00001304                            ; Echo_PauseBGM
00001304                            ; Pauses BGM playback
00001304                            ;****************************************************************************
00001304                            

00001304                            Echo_PauseBGM:
00001304 3F00                           move.w  d0, -(sp)               ; Save register
00001306 103C 0008                      move.b  #$08, d0                ; Command $08 = pause BGM
0000130A 6100 FE88                      bsr     Echo_SendCommand        ; Send command to Echo
0000130E 301F                           move.w  (sp)+, d0               ; Restore register
00001310 4E75                           rts                             ; End of subroutine
00001312                            

00001312                            ;****************************************************************************
00001312                            ; Echo_ResumeBGM
00001312                            ; Resumes BGM playback
00001312                            ;****************************************************************************
00001312                            

00001312                            Echo_ResumeBGM:
00001312 3F00                           move.w  d0, -(sp)               ; Save register
00001314 103C 0006                      move.b  #$06, d0                ; Command $06 = resume BGM
00001318 6100 FE7A                      bsr     Echo_SendCommand        ; Send command to Echo
0000131C 301F                           move.w  (sp)+, d0               ; Restore register
0000131E 4E75                           rts                             ; End of subroutine
00001320                            

00001320                            ;****************************************************************************
00001320                            ; Echo_PlayDirect
00001320                            ; Injects events into the BGM stream for the next tick.
00001320                            ;
00001320                            ; input a0.l ... Pointer to stream data
00001320                            ;****************************************************************************
00001320                            

00001320                            Echo_PlayDirect:
00001320 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001332 48E7 C0C0                      movem.l d0-d1/a0-a1, -(sp)      ; Save registers
00001336                            

00001336 43F9 00A0 1F00                 lea     ($A01F00), a1           ; Skip any pending events
0000133C 72FF                           moveq   #-1, d1
0000133E                            @Skip:
0000133E B211                           cmp.b   (a1), d1
00001340 6700                           beq.s   @Load
00001342 5249                           addq.w  #1, a1
00001344 60F8                           bra.s   @Skip
00001346                            

00001346                            @Load:                              ; Copy stream into the direct buffer
00001346 1018                           move.b  (a0)+, d0
00001348 12C0                           move.b  d0, (a1)+
0000134A B001                           cmp.b   d1, d0
0000134C 66F8                           bne.s   @Load
0000134E                            

0000134E 4CDF 0303                      movem.l (sp)+, d0-d1/a0-a1      ; Restore registers
00001352 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
0000135A 4E75                           rts                             ; End of subroutine
0000135C                            

0000135C                            ;****************************************************************************
0000135C                            ; Echo_SetPCMRate
0000135C                            ; Sets the playback rate of PCM
0000135C                            ;
0000135C                            ; input d0.b ... New rate (timer A value)
0000135C                            ;****************************************************************************
0000135C                            

0000135C                            Echo_SetPCMRate:
0000135C 48E7 C000                      movem.l d0-d1, -(sp)            ; Save registers
00001360 1200                           move.b  d0, d1                  ; Put parameter in place
00001362 103C 0007                      move.b  #$07, d0                ; Command $07 = set PCM rate
00001366 6100 FF06                      bsr     Echo_SendCommandByte    ; Send command to Echo
0000136A 4CDF 0003                      movem.l (sp)+, d0-d1            ; Restore registers
0000136E 4E75                           rts                             ; End of subroutine
00001370                            

00001370                            ;****************************************************************************
00001370                            ; Echo_SetVolume
00001370                            ; Changes the global volume for every channel.
00001370                            ;
00001370                            ; input d0.b ... New volume (0 = quietest, 255 = loudest)
00001370                            ;****************************************************************************
00001370                            

00001370                            Echo_SetVolume:
00001370 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001382 48E7 C0C0                      movem.l d0-d1/a0-a1, -(sp)      ; Save registers
00001386                                
00001386 41FA 0000                      lea     @FMTable(pc), a0        ; Determine FM volume
0000138A 7200                           moveq   #0, d1
0000138C 1200                           move.b  d0, d1
0000138E E409                           lsr.b   #2, d1
00001390 1230 1000                      move.b  (a0,d1.w), d1
00001394                                
00001394 43F9 00A0 1FE0                 lea     ($A01FE0), a1           ; Copy new FM volume values
0000139A 12C1                           move.b  d1, (a1)+                 ; FM channel 0
0000139C 12C1                           move.b  d1, (a1)+                 ; FM channel 1
0000139E 12C1                           move.b  d1, (a1)+                 ; FM channel 2
000013A0 12C1                           move.b  d1, (a1)+                 ; FM channel 3
000013A2 12C1                           move.b  d1, (a1)+                 ; FM channel 4
000013A4 12C1                           move.b  d1, (a1)+                 ; FM channel 5
000013A6 12C1                           move.b  d1, (a1)+                 ; FM channel 6
000013A8 12C1                           move.b  d1, (a1)+                 ; FM channel 7
000013AA                                
000013AA 41FA 0000                      lea     @PSGTable(pc), a0       ; Determine PSG volume
000013AE 7200                           moveq   #0, d1
000013B0 1200                           move.b  d0, d1
000013B2 E409                           lsr.b   #2, d1
000013B4 1230 1000                      move.b  (a0,d1.w), d1
000013B8                                
000013B8                                                                ; Copy new PSG values
000013B8 12C1                           move.b  d1, (a1)+                 ; PSG channel 0
000013BA 12C1                           move.b  d1, (a1)+                 ; PSG channel 1
000013BC 12C1                           move.b  d1, (a1)+                 ; PSG channel 2
000013BE 12C1                           move.b  d1, (a1)+                 ; PSG channel 3
000013C0                                
000013C0 0C00 0040                      cmp.b   #$40, d0                ; Determine whether PCM should be enabled
000013C4 54C1                           shs     d1                        ; (we do an heuristic for enabling PCM
000013C6 0201 0001                      and.b   #1, d1                    ; based on the volume value)
000013CA 12C1                           move.b  d1, (a1)+
000013CC                                
000013CC 13FC 0001 00A0 1FF1            move.b  #1, ($A01FF1)           ; Tell Echo to update the volume levels
000013D4                                
000013D4 4CDF 0303                      movem.l (sp)+, d0-d1/a0-a1      ; Restore registers
000013D8 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000013E0 4E75                           rts                             ; End of subroutine
000013E2                            

000013E2                            ;----------------------------------------------------------------------------
000013E2                            

000013E2                            @FMTable:
000013E2 7F7B 7773 706C 6865 615E+      dc.b    $7F,$7B,$77,$73,$70,$6C,$68,$65,$61,$5E,$5A,$57,$54,$50,$4D,$4A
000013F2 4744 413F 3C39 3634 312F+      dc.b    $47,$44,$41,$3F,$3C,$39,$36,$34,$31,$2F,$2D,$2A,$28,$26,$24,$22
00001402 201E 1C1A 1816 1513 1210+      dc.b    $20,$1E,$1C,$1A,$18,$16,$15,$13,$12,$10,$0F,$0D,$0C,$0B,$0A,$09
00001412 0807 0605 0404 0302 0201+      dc.b    $08,$07,$06,$05,$04,$04,$03,$02,$02,$01,$01,$01,$00,$00,$00,$00
00001422                            

00001422                            @PSGTable:
00001422 0F0F 0E0E 0D0D 0C0C 0B0B+      dc.b    $0F,$0F,$0E,$0E,$0D,$0D,$0C,$0C,$0B,$0B,$0B,$0A,$0A,$0A,$09,$09
00001432 0808 0807 0707 0606 0606+      dc.b    $08,$08,$08,$07,$07,$07,$06,$06,$06,$06,$05,$05,$05,$04,$04,$04
00001442 0403 0303 0303 0202 0202+      dc.b    $04,$03,$03,$03,$03,$03,$02,$02,$02,$02,$02,$02,$01,$01,$01,$01
00001452 0101 0101 0100 0000 0000+      dc.b    $01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
00001462                            

00001462                            ;****************************************************************************
00001462                            ; Echo_SetVolumeEx
00001462                            ; Changes the global volume for each individual channel.
00001462                            ;
00001462                            ; input a0.l ... Pointer to 16 bytes
00001462                            ;                  8 bytes with FM volumes (0..127)
00001462                            ;                  4 bytes with PSG volumes (0..15)
00001462                            ;                  1 byte with PCM toggle (0/1)
00001462                            ;                  3 reserved (unused for now)
00001462                            ;****************************************************************************
00001462                            

00001462                            Echo_SetVolumeEx:
00001462 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001474 48E7 00C0                      movem.l a0-a1, -(sp)            ; Save registers
00001478                                
00001478 43F9 00A0 1FE0                 lea     ($A01FE0), a1           ; Copy new volume values
0000147E 12D8                           move.b  (a0)+, (a1)+              ; FM channel 0
00001480 12D8                           move.b  (a0)+, (a1)+              ; FM channel 1
00001482 12D8                           move.b  (a0)+, (a1)+              ; FM channel 2
00001484 12D8                           move.b  (a0)+, (a1)+              ; FM channel 3
00001486 12D8                           move.b  (a0)+, (a1)+              ; FM channel 4
00001488 12D8                           move.b  (a0)+, (a1)+              ; FM channel 5
0000148A 12D8                           move.b  (a0)+, (a1)+              ; FM channel 6
0000148C 12D8                           move.b  (a0)+, (a1)+              ; FM channel 7
0000148E 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 0
00001490 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 1
00001492 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 2
00001494 12D8                           move.b  (a0)+, (a1)+              ; PSG channel 3
00001496 12D8                           move.b  (a0)+, (a1)+              ; PCM channel toggle
00001498 12D8                           move.b  (a0)+, (a1)+              ; (reserved)
0000149A 12D8                           move.b  (a0)+, (a1)+              ; (reserved)
0000149C 12D8                           move.b  (a0)+, (a1)+              ; (reserved)
0000149E                                
0000149E 13FC 0001 00A0 1FF1            move.b  #1, ($A01FF1)           ; Tell Echo to update the volume levels
000014A6                                
000014A6 4CDF 0300                      movem.l (sp)+, a0-a1            ; Restore registers
000014AA 33FC 0000 00A1 1100            Echo_Z80Release                 ; We're done with the Z80 bus
000014B2 4E75                           rts                             ; End of subroutine
000014B4                            

000014B4                            ;****************************************************************************
000014B4                            ; Echo_GetStatus
000014B4                            ; Gets the current status of Echo
000014B4                            ;
000014B4                            ; output d0.w ... Echo status
000014B4                            ;                   Bit #0: SFX is playing
000014B4                            ;                   Bit #1: BGM is playing
000014B4                            ;                   Bit #14: direct events not played
000014B4                            ;                   Bit #15: command still not parsed
000014B4                            ;****************************************************************************
000014B4                            

000014B4                            Echo_GetStatus:
000014B4 48E7 4040                      movem.l d1/a1, -(sp)            ; Save registers
000014B8                            

000014B8 4240                           clr.w   d0                      ; Set all needed bits to 0
000014BA 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
000014CC 1039 00A0 1FF0                 move.b  ($A01FF0), d0           ; Get the status flags
000014D2                            

000014D2 4A39 00A0 1FFB                 tst.b   ($A01FFB)               ; Check if any commands can be sent
000014D8 6700                           beq.s   @NotBusy                ; Any room left for new commands?
000014DA 08C0 000F                      bset.l  #15, d0                 ; If not, set the relevant flag
000014DE                            @NotBusy:
000014DE                            

000014DE 0C39 00FF 00A0 1F00            cmpi.b  #$FF, ($A01F00)         ; Check if the direct buffer is empty
000014E6 6700                           beq.s   @DirectEmpty            ; Any direct events still to be played?
000014E8 08C0 000E                      bset.l  #14, d0                 ; If so, set the relevant flag
000014EC                            @DirectEmpty:
000014EC                            

000014EC 7200                           moveq   #0, d1                  ; Clear unused bits from index
000014EE 43FA 0000                      lea     @AndTable(pc), a1       ; Get pointer to look-up tables
000014F2                                
000014F2 1239 00A0 1FFF                 move.b  ($A01FFF), d1           ; Get next pending command (if any)
000014F8 6700                           beq.s   @QueueChecked           ; No commands left to process?
000014FA 1231 1000                      move.b  (a1,d1.w), d1           ; Get mask of flags to leave
000014FE C001                           and.b   d1, d0                  ; Remove flags that should be clear
00001500 1231 1000                      move.b  @OrTable-@AndTable(a1,d1.w), d1 ; Get mask of flags to set
00001504 8001                           or.b    d1, d0                  ; Insert flags that should be set
00001506                            

00001506 1239 00A0 1FFB                 move.b  ($A01FFB), d1           ; Repeat that with 2nd pending command
0000150C 6700                           beq.s   @QueueChecked
0000150E 1231 1000                      move.b  (a1,d1.w), d1
00001512 C001                           and.b   d1, d0
00001514 1231 1000                      move.b  @OrTable-@AndTable(a1,d1.w), d1
00001518 8001                           or.b    d1, d0
0000151A                            

0000151A                            @QueueChecked:
0000151A 33FC 0000 00A1 1100            Echo_Z80Release                 ; Let the Z80 go!
00001522 4CDF 0202                      movem.l (sp)+, d1/a1            ; Restore registers
00001526 4E75                           rts                             ; End of subroutine
00001528                            

00001528                            ;----------------------------------------------------------------------------
00001528                            ; Look-up tables used to readjust the status flags based on pending commands
00001528                            ; that haven't been processed yet (normally they wouldn't be updated yet, but
00001528                            ; this can catch programmers off guard so we cheat it).
00001528                            ;
00001528                            ; Every byte represents a possible command.
00001528                            ;----------------------------------------------------------------------------
00001528                            

00001528 FFFF FFFE FFFD FFFF FF     @AndTable:  dc.b $FF,$FF, $FF,$FE,$FF,$FD, $FF,$FF,$FF
00001531 0000 0100 0200 0000 00     @OrTable:   dc.b $00,$00, $01,$00,$02,$00, $00,$00,$00
0000153A                                        even
0000153A                            

0000153A                            ;****************************************************************************
0000153A                            ; Echo_GetFlags
0000153A                            ; Gets the current values of the flags.
0000153A                            ;
0000153A                            ; output d0.b ... Bitmask with flags
0000153A                            ;****************************************************************************
0000153A                            

0000153A                            Echo_GetFlags:
0000153A 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; Request Z80 bus
0000154C 1039 00A0 1FF2                 move.b  ($A01FF2), d0           ; Get the flags
00001552 33FC 0000 00A1 1100            Echo_Z80Release                 ; Done with Z80 RAM
0000155A 4E75                           rts                             ; End of subroutine
0000155C                            

>>>>>>> IncorrectButtonMappingsInGame
0000155C                            ;****************************************************************************
0000155C                            ; Echo_GetFlags
0000155C                            ; Gets the current values of the flags.
0000155C                            ;
0000155C                            ; output d0.b ... Bitmask with flags
0000155C                            ;****************************************************************************
<<<<<<< HEAD
0000155C                            
0000155C                            Echo_GetFlags:
0000155C 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; Request Z80 bus
0000156E 1039 00A0 1FF2                 move.b  ($A01FF2), d0           ; Get the flags
00001574 33FC 0000 00A1 1100            Echo_Z80Release                 ; Done with Z80 RAM
0000157C 4E75                           rts                             ; End of subroutine
0000157E                            
0000157E                            ;****************************************************************************
0000157E                            ; Echo_SetFlags
0000157E                            ; Sets flags from the 68000.
0000157E                            ;
0000157E                            ; input d0.b ... Bitmask of flags to be set (1 = set, 0 = intact)
0000157E                            ;****************************************************************************
0000157E                            
0000157E                            Echo_SetFlags:
=======
0000155C                            

0000155C                            Echo_SetFlags:
0000155C 594F                           subq.w  #4, sp                  ; Buffer for the events
0000155E 1EBC 00FA                      move.b  #$FA, (sp)                ; Set flags
00001562 1F40 0001                      move.b  d0, 1(sp)                 ; <bitmask>
00001566 1F7C 00FF 0002                 move.b  #$FF, 2(sp)               ; End of stream
0000156C                                
0000156C 2F08                           move.l  a0, -(sp)               ; Issue the events
0000156E 41EF 0004                      lea     4(sp), a0
00001572 6100 FDAC                      bsr     Echo_PlayDirect
00001576 205F                           move.l  (sp)+, a0
00001578                                
00001578 584F                           addq.w  #4, sp                  ; Done with the buffer
0000157A 4E75                           rts                             ; End of subroutine
0000157C                            

0000157C                            ;****************************************************************************
0000157C                            ; Echo_ClearFlags
0000157C                            ; Clear flags from the 68000.
0000157C                            ;
0000157C                            ; input d0.b ... Bitmask of flags to be cleared (1 = clear, 0 = intact)
0000157C                            ;****************************************************************************
0000157C                            

0000157C                            Echo_ClearFlags:
0000157C 4600                           not.b   d0                      ; Bitmask is inverted
>>>>>>> IncorrectButtonMappingsInGame
0000157E 594F                           subq.w  #4, sp                  ; Buffer for the events
00001580 1EBC 00FA                      move.b  #$FA, (sp)                ; Set flags
00001584 1F40 0001                      move.b  d0, 1(sp)                 ; <bitmask>
00001588 1F7C 00FF 0002                 move.b  #$FF, 2(sp)               ; End of stream
<<<<<<< HEAD
0000158E                                
0000158E 2F08                           move.l  a0, -(sp)               ; Issue the events
00001590 41EF 0004                      lea     4(sp), a0
00001594 6100 FD96                      bsr     Echo_PlayDirect
00001598 205F                           move.l  (sp)+, a0
0000159A                                
0000159A 584F                           addq.w  #4, sp                  ; Done with the buffer
0000159C 4E75                           rts                             ; End of subroutine
0000159E                            
0000159E                            ;****************************************************************************
0000159E                            ; Echo_ClearFlags
0000159E                            ; Clear flags from the 68000.
0000159E                            ;
0000159E                            ; input d0.b ... Bitmask of flags to be cleared (1 = clear, 0 = intact)
0000159E                            ;****************************************************************************
0000159E                            
0000159E                            Echo_ClearFlags:
0000159E 4600                           not.b   d0                      ; Bitmask is inverted
000015A0 594F                           subq.w  #4, sp                  ; Buffer for the events
000015A2 1EBC 00FB                      move.b  #$FB, (sp)                ; Set flags
000015A6 1F40 0001                      move.b  d0, 1(sp)                 ; <bitmask>
000015AA 1F7C 00FF 0002                 move.b  #$FF, 2(sp)               ; End of stream
000015B0 4600                           not.b   d0                      ; Restore register
000015B2                                
000015B2 2F08                           move.l  a0, -(sp)               ; Issue the events
000015B4 41EF 0004                      lea     4(sp), a0
000015B8 6100 FD72                      bsr     Echo_PlayDirect
000015BC 205F                           move.l  (sp)+, a0
000015BE                                
000015BE 584F                           addq.w  #4, sp                  ; Done with the buffer
000015C0 4E75                           rts                             ; End of subroutine
000015C2                            
000015C2                            ;****************************************************************************
000015C2                            ; Echo_ListEntry
000015C2                            ; Defines an entry in a pointer list
000015C2                            ;****************************************************************************
000015C2                            
000015C2                            Echo_ListEntry macro addr
000015C2                                dc.b    $80|((addr)>>8&$7F)                 ; High byte of address
000015C2                                dc.b    (addr)&$FF                          ; Low byte of address
000015C2                                dc.b    ((addr)>>15&$7F)|((addr)>>16&$80)   ; Bank number
000015C2                                endm
000015C2                            
000015C2                            ;****************************************************************************
000015C2                            ; Echo_ListEnd
000015C2                            ; Ends a pointer list
000015C2                            ;****************************************************************************
000015C2                            
000015C2                            Echo_ListEnd macro
000015C2                                dc.b    $00                     ; End of list mark
000015C2                                even                            ; Just in case...
000015C2                                endm
000015C2                            
000015C2                            ;****************************************************************************
000015C2                            ; Echo_Init
000015C2                            ; Initializes Echo
000015C2                            ;
000015C2                            ; input a0.l ... Address of pointer list
000015C2                            ;****************************************************************************
000015C2                            
000015C2                            Echo_Init:
000015C2 48E7 80C0                      movem.l d0/a0-a1, -(sp)         ; Save registers
000015C6                            
000015C6 33FC 0000 00A1 1200 4E71+      Echo_Z80Reset                   ; May not work without this...
000015F6 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
00001608                            
00001608 13FC 0001 00A0 1FFF            move.b  #$01, ($A01FFF)         ; Command: load pointer list
00001610 13FC 0000 00A0 1FFB            move.b  #$00, ($A01FFB)         ; No other command yet
00001618                            
00001618 2008                           move.l  a0, d0                  ; Easier to manipulate here
0000161A 13C0 00A0 1FFD                 move.b  d0, ($A01FFD)           ; Store low address byte
00001620 EE88                           lsr.l   #7, d0                  ; Get high address byte
00001622 E208                           lsr.b   #1, d0                    ; We skip one bit
00001624 08C0 0007                      bset.l  #7, d0                    ; Point into bank window
00001628 13C0 00A0 1FFE                 move.b  d0, ($A01FFE)           ; Store high address byte
0000162E E048                           lsr.w   #8, d0                  ; Get bank byte
00001630 3200                           move.w  d0, d1                    ; Parse 32X bit separately
00001632 E249                           lsr.w   #1, d1                    ; Put 32X bit in place
00001634 0200 007F                      and.b   #$7F, d0                  ; Filter out unused bit from addresses
00001638 0201 0080                      and.b   #$80, d1                  ; Filter out all but 32X bit
0000163C 8001                           or.b    d1, d0                    ; Put everything together
0000163E 13C0 00A0 1FFC                 move.b  d0, ($A01FFC)           ; Store bank byte
00001644                            
00001644 41FA 0000                      lea     @Z80Program(pc), a0     ; Where Z80 program starts
00001648 43F9 00A0 0000                 lea     ($A00000), a1           ; Where Z80 RAM starts
0000164E 303C 0000                      move.w  #@Z80ProgSize-1, d0     ; Size of Z80 program (DBF adjusted)
00001652                            @LoadLoop:                          ; Go through all the program
00001652 12D8                           move.b  (a0)+, (a1)+              ; Copy byte into Z80 RAM
00001654 51C8 FFFC                      dbf     d0, @LoadLoop             ; Go for next byte
00001658                            
00001658 7000                           moveq   #0, d0                  ; Set default global volumes
0000165A 41F9 00A0 1FE0                 lea     ($A01FE0), a0
00001660 10C0                           move.b  d0, (a0)+
00001662 10C0                           move.b  d0, (a0)+
00001664 10C0                           move.b  d0, (a0)+
00001666 10C0                           move.b  d0, (a0)+
00001668 10C0                           move.b  d0, (a0)+
0000166A 10C0                           move.b  d0, (a0)+
0000166C 10C0                           move.b  d0, (a0)+
0000166E 10C0                           move.b  d0, (a0)+
00001670 10C0                           move.b  d0, (a0)+
00001672 10C0                           move.b  d0, (a0)+
00001674 10C0                           move.b  d0, (a0)+
00001676 10C0                           move.b  d0, (a0)+
00001678 10FC 0001                      move.b  #1, (a0)+
0000167C 10C0                           move.b  d0, (a0)+
0000167E 10C0                           move.b  d0, (a0)+
00001680 10C0                           move.b  d0, (a0)+
00001682 13C0 00A0 1FF1                 move.b  d0, ($A01FF1)
00001688                            
00001688 13FC 00FF 00A0 1F00            move.b  #$FF, ($A01F00)         ; No direct events to execute
00001690                            
00001690 33FC 0000 00A1 1200 4E71+      Echo_Z80Reset                   ; Now reset for real
000016C0 33FC 0000 00A1 1100            Echo_Z80Release                 ; Let the Z80 go!
000016C8                            
000016C8 4CDF 0301                      movem.l (sp)+, d0/a0-a1         ; Restore registers
000016CC 4E75                           rts                             ; End of subroutine
000016CE                            
000016CE                            ;****************************************************************************
000016CE                            ; Echo Z80 program
000016CE                            ;****************************************************************************
000016CE                            
000016CE                            @Z80Program: incbin "framewk\blob\prog-z80.bin"
00002ACE =00001400                  @Z80ProgSize equ *-@Z80Program
00002ACE                                even
00002ACE                                even
00002ACE                                  include 'assets\states\title\init.asm'
00002ACE                            TitleScreen_Init:
00002ACE 7001                             moveq #0x1, d0
00002AD0 4EB8 0D2E                        jsr WaitFrames ; Wait a frame, to collect new joypad presses
00002AD4                            

00002AD4                                  ; ************************************
00002AD4                                  ; Load title screen map
00002AD4                                  ; ************************************
00002AD4 41F9 0000 0000                   lea TitleScreenMap, a0                                                   ; Map data in a0
00002ADA 303C 0000                        move.w #TitleScreenMapSizeW, d0                                          ; Size (words) in d0
00002ADE 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00002AE0 343C 0000                        move.w #TitleScreenTilesTileID, d2                                       ; First tile ID in d2
00002AE4 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00002AE6 4EB8 0EEC                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00002AEA                                  ; ************************************
00002AEA                                  ;  Draw The Press Start String
00002AEA                                  ; ************************************
00002AEA 41F9 0000 0000                   lea PressStartString, a0                                                 ; String address
00002AF0 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002AF6 323C 0F1A                        move.w #0x0F1A, d1                                                       ; XY (15, 5)
00002AFA 7400                             moveq #0x0, d2                                                           ; Palette 0
00002AFC 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B00 33FC 0000 0000 0000              move.w  #game_state_title_screen, game_state                             ; store the game state
00002B08 4E75                             rts
00002B08 4E75                             rts
00002B0A                                  include 'assets\states\title\main.asm'
00002B0A                            TitleScreen:
00002B0A 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002B10 0800 0000                        btst #pad_button_start, d0                                               ; Check start button
00002B14 67F4                             beq.s TitleScreen                                                        ; if not then do the title screen
00002B16 33FC 0000 0000 0000              move.w #game_state_title_screen_shutdown, game_state                     ; store the game state
00002B1E 4E75                             rts
00002B1E 4E75                             rts
00002B20                                  include 'assets\states\title\shutdown.asm'
00002B20                            TitleScreen_Shutdown:
00002B20 33FC 0000 0000 0000              move.w  #game_state_songlist_screen_initalize, game_state                ; store the game state
00002B28 4E75                             rts
00002B28 4E75                             rts
00002B2A                                  include 'assets\states\songlist\init.asm'
00002B2A                            SonglistScreen_Init:
00002B2A                                  ; ************************************
00002B2A                                  ; Load songlist screen map
00002B2A                                  ; ************************************
00002B2A 41F9 0000 0000                   lea SonglistScreenMap, a0                                                ; Map data in a0
00002B30 303C 0000                        move.w #SonglistScreenMapSizeW, d0                                       ; Size (words) in d0
00002B34 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00002B36 343C 0000                        move.w #SonglistScreenTilesTileID, d2                                    ; First tile ID in d2
00002B3A 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00002B3C 4EB8 0EEC                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00002B40                            

00002B40                                  ; ************************************
00002B40                                  ;  Draw The Songlist String
00002B40                                  ; ************************************
00002B40 41F9 0000 0000                   lea SonglistString, a0                                                   ; String address
00002B46 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002B4C 323C 0F02                        move.w #0x0F02, d1                                                       ; XY (15, 2)
00002B50 7400                             moveq #0x0, d2                                                           ; Palette 0
00002B52 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B56                            

00002B56                                  ; load the meta data for the 1st song
00002B56                                  ;move.l #0x0, d3
00002B56                                  ;jsr GetSongMetaData
00002B56                            

00002B56                                  ; ************************************
00002B56                                  ;  Draw The 1st song String
00002B56                                  ; ************************************
00002B56 41F9 0000 0000                   lea StringAuthorComradeOj, a0                                            ; String address
00002B5C 323C 0705                        move.w #0x0705, d1                                                       ; XY (7, 5)
00002B60 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B64                            

00002B64                                  ; ************************************
00002B64                                  ;  Draw The 1st song creator String
00002B64                                  ; ************************************
00002B64 41F9 0000 0000                   lea StringSongTwangyThing, a0                                            ; String address
00002B6A 323C 0706                        move.w #0x0706, d1                                                       ; XY (7, 6)
00002B6E 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B72                            

00002B72                                  ; load the meta data for the 2nd song
00002B72                            ;     move.l #0x1, d3
00002B72                            ;     jsr GetSongMetaData
00002B72                            

00002B72                                  ; ************************************
00002B72                                  ;  Draw The 2nd song String
00002B72                                  ; ************************************
00002B72                            ;     lea (a5), a0                                                             ; String address
00002B72                            ;     move.w #0x0709, d1                                                       ; XY (7, 9)
00002B72                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B72                            

00002B72                                  ; ************************************
00002B72                                  ;  Draw The 2nd song creator String
00002B72                                  ; ************************************
00002B72                            ;     lea (a4), a0                                                             ; String address
00002B72                            ;     move.w #0x070A, d1                                                       ; XY (7, 10)
00002B72                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B72                            

00002B72 6100 E0C6                       bsr ClearSprites                                                          ; Clear Sprite List
00002B76                            

00002B76                                 ; add the selection table to the sprite list
00002B76 303C 0000                        move.w #selectionarrow_start_position_y, d0                              ; Y coord (+ 128)
00002B7A 123C 0000                        move.b #SelectionArrowDimensionBits, d1                                  ; Width (bits 0-1) and height (bits 2-3) in tiles
00002B7E 1438 0000                        move.b 0x00, d2                                                          ; H/V flipping (bits 3/4), palette index (bits 5-6), priority (bit 7)
00002B82 163C 0000                        move.b #SelectionArrowTileID, d3                                         ; Index of first tile
00002B86 383C 0000                        move.w #selectionarrow_start_position_x, d4                              ; x coord (+ 128)
00002B8A 41F9 0000 0000                   lea (spritelist_table), a0                                               ; load address of sprite list table into a0
00002B90 6100 E0B2                        bsr AddSprite                                                            ; add the sprite to the list
00002B94                            

00002B94                                 ; *************************************
00002B94                                 ; Set selection arrows initial y position
00002B94                                 ; *************************************
00002B94 33FC 0000 0000 0000              move.w #selectionarrow_start_position_y, (selectionarrow_position_y)     ; set selection arrow's y position first
00002B9C                            

00002B9C                                 ; *************************************
00002B9C                                 ; set default song id
00002B9C                                 ; *************************************
00002B9C 33FC 0000 0000 0000             move.w #0, (song_id)                                                      ; set default song to first one
00002BA4                            

00002BA4 7001                             moveq #0x1, d0
00002BA6 4EB8 0D2E                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002BAA                            

00002BAA 33FC 0000 0000 0000              move.w  #game_state_songlist_screen, game_state                          ; store the game state
00002BB2 4E75                             rts
00002BB2 4E75                             rts
00002BB4                                  include 'assets\states\songlist\main.asm'
00002BB4                            SonglistScreen:
00002BB4                                  ; *************************************
00002BB4                                  ; draw the selection arrow
00002BB4                                  ; *************************************
00002BB4                            ;     move.w #selectionarrow_id, d0                                            ; selection arrow's sprite id
00002BB4                            ;     move.w #selectionarrow_start_position_x, d1                              ; selection arrow's x position
00002BB4                            ;     move.w #SelectionArrowDimensions, d2                                     ; selection arrow's dimensions
00002BB4                            ;     moveq #0x8, d3                                                           ; selection arrrow's width in pixels
00002BB4                            ;     moveq #0x0, d4                                                           ; selection arrow's x flipped
00002BB4                            ;     lea SelectionArrowSubSpriteDimensions, a1                                ; selection arrow's subsprite 
00002BB4                            ;     jsr SetSpritePosX                                                        ; Set selection arrow's x position
00002BB4                            

00002BB4                            ;     move.w #selectionarrow_id, d0                                            ; selection arrow's sprite id
00002BB4                            ;     move.w (selectionarrow_position_y), d1                                   ; selection arrow's y position
00002BB4                            ;     jsr SetSpritePosY                                                        ; Set selection arrow's y position
00002BB4                            

00002BB4 6100 E0BC                        bsr UpdateSprites                                                        ; update the sprites list
00002BB8                            

00002BB8 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002BBE                            ;     move.w (selectionarrow_position_y), d1                                   ; selection arrows y position in d1
00002BBE                            ;     move.w #selectionarrow_y_velocity, d2                                    ; selection arrows y velocity in d2
00002BBE                            ;     move.w #selectionarrow_boundry_top, d3                                   ; selection arrows top boundry in d3
00002BBE                            ;     move.w #selectionarrow_boundry_bottom, d4                                ; selection arrows bottom boundry in d4
00002BBE                            ;     move.w (song_id), d5
00002BBE                            ;     btst #pad_button_up, d0                                                  ; did the user press up on the dpad?
00002BBE                            ;     beq.s SonglistNotDPadUp                                                  ; if not the branch and don't move the selection arrow up
00002BBE                            ;     cmp.w d1, d3                                                             ; has the selection arrow reached the top boundry
00002BBE                            ;     beq.s SelectionArrowHitTopBoundry                                        ; if it has then don't do anything
00002BBE                            ;     sub d2, d1                                                               ; subtract the selection arrows velocity to it's position 
00002BBE                            ;SelectionArrowHitTopBoundry:
00002BBE                            ;SonglistNotDPadUp:
00002BBE                            ;     btst #pad_button_down, d0                                                ; did the user press down on the dpad?
00002BBE                            ;     beq.s SonglistNotDPadDown                                                ; if not the branch and don't move the selection arrow down
00002BBE                            ;     cmp.w d1, d4                                                             ; has the selection arrow reached the bottom boundry
00002BBE                            ;     beq.s SelectionArrowHitBottomBoundry                                     ; if it has then don't do anything
00002BBE                            ;     add d2, d1                                                               ; add the selection arrows velocity to it's position                                                                    ; temporary placeholder for when dpad is pressed down
00002BBE                            ;SelectionArrowHitBottomBoundry:
00002BBE                            ;SonglistNotDPadDown:
00002BBE                            ;     move.w d1, (selectionarrow_position_y)                                   ; store the selectoion arrows new y position
00002BBE 0800 0000                        btst #pad_button_start, d0                                               ; Check start button
00002BC2 67F0                             beq.s SonglistScreen                                                     ; if not then continue to show the player's stats
00002BC4                            ;     move.w d5, (song_id)                                                     ; store the song id
00002BC4 33FC 0000 0000 0000              move.w #game_state_songlist_screen_shutdown, game_state                  ; otherwise clean up the songlist state
00002BCC 7001                             moveq #0x1, d0
00002BCE 4EF8 0D2E                        jmp WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002BD2 4E75                             rts
00002BD2 4E75                             rts
00002BD4                                  include 'assets\states\songlist\shutdown.asm'
00002BD4                            SonglistScreen_Shutdown:
00002BD4                                  ; ************************************
00002BD4                                  ;  Clear The Songlist String
00002BD4                                  ; ************************************
00002BD4 41F9 0000 0000                   lea BlankString, a0                                                   ; String address
00002BDA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002BE0 323C 0F02                        move.w #0x0F02, d1                                                       ; XY (15, 2)
00002BE4 7400                             moveq #0x0, d2                                                           ; Palette 0
00002BE6 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BEA                            

00002BEA                                  ; ************************************
00002BEA                                  ;  Clear The 1st song String
00002BEA                                  ; ************************************
00002BEA 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002BF0 323C 0705                        move.w #0x0705, d1                                                       ; XY (7, 5)
00002BF4 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BF8                            

00002BF8                                  ; ************************************
00002BF8                                  ;  Clear The 1st song creator String
00002BF8                                  ; ************************************
00002BF8 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002BFE 323C 0706                        move.w #0x0706, d1                                                       ; XY (7, 6)
00002C02 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C06                            

00002C06                                  ; ************************************
00002C06                                  ;  Clear The 2nd song String
00002C06                                  ; ************************************
00002C06                            ;     lea BlankString, a0                                                      ; String address
00002C06                            ;     move.w #0x0709, d1                                                       ; XY (7, 9)
00002C06                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C06                            

00002C06                                  ; ************************************
00002C06                                  ;  Draw The 2nd song creator String
00002C06                                  ; ************************************
00002C06                            ;     lea BlankString, a0                                                      ; String address
00002C06                            ;     move.w #0x070A, d1                                                       ; XY (7, 10)
00002C06                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C06                            

00002C06                                  ; ************************************
00002C06                                  ;  Clear The Press Start String
00002C06                                  ; ************************************
00002C06 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002C0C 323C 0F1A                        move.w #0x0F1A, d1                                                       ; XY (15, 26)
00002C10 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C14 33FC 0000 0000 0000              move.w #game_state_game_mode_initalize, game_state                       ; store the game state
00002C1C                            

00002C1C 4E75                             rts
00002C1C 4E75                             rts
00002C1E                                  include 'assets\states\game\init.asm'
00002C1E                            GameMode_Init:
00002C1E                                  ; ************************************
00002C1E                                  ; Load game map
00002C1E                                  ; ************************************
00002C1E 41F9 0000 0000                   lea GameMap, a0                                                          ; Map data in a0
00002C24 303C 0000                        move.w #GameMapSizeW, d0                                                 ; Size (words) in d0
00002C28 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00002C2A 343C 0000                        move.w #GameTilesTileID, d2                                              ; First tile ID in d2
00002C2E 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00002C30 4EB8 0EEC                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00002C34                            

00002C34                                  ; ************************************
00002C34                                  ;  Draw The Score String
00002C34                                  ; ************************************
00002C34 41F9 0000 0000                   lea ScoreString, a0                                                      ; String address
00002C3A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002C40 323C 0301                        move.w #0x0301, d1                                                       ; XY (5, 1)
00002C44 7400                             moveq #0x0, d2                                                           ; Palette 0
00002C46 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C4A                            

00002C4A                                  ; ************************************
00002C4A                                  ;  Draw The Combo String
00002C4A                                  ; ************************************
00002C4A 41F9 0000 0000                   lea ComboString, a0                                                      ; String address
00002C50 323C 1C01                        move.w #0x1C01, d1                                                       ; XY (27, 1)
00002C54 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C58                            

00002C58                                  ; ************************************
00002C58                                  ; Initalize Everything
00002C58                                  ; ************************************
00002C58 33FC 0000 0000 0000              move.w #0, (score)                                                       ; initialize score
00002C60 33FC 0000 0000 0000              move.w #0, (combo)                                                       ; initialize combo
00002C68 33FC 0001 0000 0000              move.w #1, (multiplier)                                                  ; initialize multiplier
00002C70 33FC 0001 0000 0000              move.w #1, (scoredelta)                                                  ; initalize score delta
00002C78 33FC 0001 0000 0000              move.w #1, (tempo)                                                       ; initialize tempo
00002C80 33FC 0000 0000 0000              move.w #(note_start_position_x), (greennote_position_x)                  ; Set green note's x position
00002C88 33FC 0000 0000 0000              move.w #(note_start_position_x), (rednote_position_x)                    ; Set red note's x position
00002C90 33FC 0000 0000 0000              move.w #rockindicator_start_position_x, (rockindicator_position_x)       ; Set rock indicator's x position
00002C98                            

00002C98                                  ; load the song data for the 1st song
00002C98                                  ;move.l #0x0, d3
00002C98                                  ;jsr GetSongData
00002C98                            

00002C98                                  ; ************************************
00002C98                                  ; Load music
00002C98                                  ; ************************************
00002C98 41F9 0000 0000                   lea ComradeOj_TwangyThing, a0                                         ; song data address in a1
00002C9E                                  ;lea LinkueiBR_TotalConcentration, a0                                 ; song data address in a1
00002C9E 4EB8 12F4                        jsr Echo_PlayBGM                                                      ; play the song
00002CA2 33FC 0000 0000 0000              move.w #game_state_game_mode, game_state                              ; set game state to game mode
00002CAA                            

00002CAA                                  ; ************************************
00002CAA                                  ; hide the selection arrow from songlist
00002CAA                                  ; ************************************
00002CAA 33FC 0000 0000 0000              move.w #offscreen_position_y, (selectionarrow_position_y)                ; move the selection arrow's y position offscreen
00002CB2 303C 0000                        move.w #selectionarrow_id, d0                                            ; selection arrow's sprite id
00002CB6 3239 0000 0000                   move.w (selectionarrow_position_y), d1                                   ; selection arrow's y position
00002CBC 343C 0000                        move.w #SelectionArrowDimensions, d2                                     ; selection arrow's dimensions
00002CC0 7608                             moveq #0x8, d3                                                           ; selection arrrow's width in pixels
00002CC2 7800                             moveq #0x0, d4                                                           ; selection arrow's x flipped
00002CC4 43F9 0000 0000                   lea SelectionArrowSubSpriteDimensions, a1                                ; selection arrow's subsprite 
00002CCA 4EB8 0A62                        jsr SetSpritePosY                                                        ; Set selection arrow's y position
00002CCE                            

00002CCE 7001                             moveq #0x1, d0
00002CD0 4EB8 0D2E                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002CD4 4E75                             rts
00002CD4 4E75                             rts
00002CD6                                  include 'assets\states\game\main.asm'
00002CD6                            GameMode:
00002CD6 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002CDC 0800 0000                        btst #pad_button_start, d0                                               ; was the start button pressed
00002CE0 6700                             beq.s @NoStart                                                           ; otherwise branch
00002CE2 4E71                             nop                                                                      ; temporary
00002CE4                            ;     move.w #game_state_game_mode_pause_initalize, game_state                 ; set game state to pause init
00002CE4                            @NoStart:
00002CE4 343C 0000                        move.w #(note_plane_safearea_offset+note_bounds_left), d2                ; fret safe area offset in d2
00002CE8 3639 0000 0000                   move.w (score), d3                                                       ; player's score into d3
00002CEE 3839 0000 0000                   move.w (scoredelta), d4
00002CF4 3A39 0000 0000                   move.w (combo), d5                                                       ; player's current combo
00002CFA 7C01                             moveq #1, d6                                                             ; combo increment
00002CFC                            

00002CFC                                  ; start of green note code
00002CFC 3239 0000 0000                   move.w (greennote_position_x), d1                                        ; green note position in d1
00002D02 3039 0000 0000                   move.w joypadA, d0                                                       ; Read pad 1 state, result in d0
00002D08 0800 0070                        btst #pad_button_left, d0                                                ; Check left pad
00002D0C 6700                             beq.s @NoLeft                                                            ; Branch if button off
00002D0E B242                             cmp.w d2, d1                                                             ; is the player pressing too early
00002D10 6E00                             bgt.s @GreenNoteSafeArea                                                 ; if so then don't accept it
00002D12 323C 0000                        move.w #note_start_position_x, d1
00002D16 C704                             abcd d4, d3                                                              ; increment the player's score
00002D18 CB06                             abcd d6, d5                                                              ; increment the player's combo meter
00002D1A 41F9 0000 0000                   lea (SnareDrumLeft), a0                                                  ; load the snare drum effect with a left position
00002D20 6100 E5B6                        bsr Echo_PlaySfx                                                         ; play the snare drum sound effect
00002D24 6000 0000                        bra @GreenNoteDone                                                       ; continue through the rest of the code
00002D28                            @GreenNoteSafeArea:
00002D28                            @GreenNoteDone:
00002D28                            @NoLeft:
00002D28                                  ; green note movement code
=======
0000158E 4600                           not.b   d0                      ; Restore register
00001590                                
00001590 2F08                           move.l  a0, -(sp)               ; Issue the events
00001592 41EF 0004                      lea     4(sp), a0
00001596 6100 FD88                      bsr     Echo_PlayDirect
0000159A 205F                           move.l  (sp)+, a0
0000159C                                
0000159C 584F                           addq.w  #4, sp                  ; Done with the buffer
0000159E 4E75                           rts                             ; End of subroutine
000015A0                            

000015A0                            ;****************************************************************************
000015A0                            ; Echo_ListEntry
000015A0                            ; Defines an entry in a pointer list
000015A0                            ;****************************************************************************
000015A0                            

000015A0                            Echo_ListEntry macro addr
000015A0                                dc.b    $80|((addr)>>8&$7F)                 ; High byte of address
000015A0                                dc.b    (addr)&$FF                          ; Low byte of address
000015A0                                dc.b    ((addr)>>15&$7F)|((addr)>>16&$80)   ; Bank number
000015A0                                endm
000015A0                            

000015A0                            ;****************************************************************************
000015A0                            ; Echo_ListEnd
000015A0                            ; Ends a pointer list
000015A0                            ;****************************************************************************
000015A0                            

000015A0                            Echo_ListEnd macro
000015A0                                dc.b    $00                     ; End of list mark
000015A0                                even                            ; Just in case...
000015A0                                endm
000015A0                            

000015A0                            ;****************************************************************************
000015A0                            ; Echo_Init
000015A0                            ; Initializes Echo
000015A0                            ;
000015A0                            ; input a0.l ... Address of pointer list
000015A0                            ;****************************************************************************
000015A0                            

000015A0                            Echo_Init:
000015A0 48E7 80C0                      movem.l d0/a0-a1, -(sp)         ; Save registers
000015A4                            

000015A4 33FC 0000 00A1 1200 4E71+      Echo_Z80Reset                   ; May not work without this...
000015D4 33FC 0100 00A1 1100 0839+      Echo_Z80Request                 ; We need the Z80 bus
000015E6                            

000015E6 13FC 0001 00A0 1FFF            move.b  #$01, ($A01FFF)         ; Command: load pointer list
000015EE                            

000015EE 2008                           move.l  a0, d0                  ; Easier to manipulate here
000015F0 13C0 00A0 1FFD                 move.b  d0, ($A01FFD)           ; Store low address byte
000015F6 EE88                           lsr.l   #7, d0                  ; Get high address byte
000015F8 E208                           lsr.b   #1, d0                    ; We skip one bit
000015FA 08C0 0007                      bset.l  #7, d0                    ; Point into bank window
000015FE 13C0 00A0 1FFE                 move.b  d0, ($A01FFE)           ; Store high address byte
00001604 E048                           lsr.w   #8, d0                  ; Get bank byte
00001606 3200                           move.w  d0, d1                    ; Parse 32X bit separately
00001608 E249                           lsr.w   #1, d1                    ; Put 32X bit in place
0000160A 0200 007F                      and.b   #$7F, d0                  ; Filter out unused bit from addresses
0000160E 0201 0080                      and.b   #$80, d1                  ; Filter out all but 32X bit
00001612 8001                           or.b    d1, d0                    ; Put everything together
00001614 13C0 00A0 1FFC                 move.b  d0, ($A01FFC)           ; Store bank byte
0000161A                            

0000161A 41FA 0000                      lea     @Z80Program(pc), a0     ; Where Z80 program starts
0000161E 43F9 00A0 0000                 lea     ($A00000), a1           ; Where Z80 RAM starts
00001624 303C 0000                      move.w  #@Z80ProgSize-1, d0     ; Size of Z80 program (DBF adjusted)
00001628                            @LoadLoop:                          ; Go through all the program
00001628 12D8                           move.b  (a0)+, (a1)+              ; Copy byte into Z80 RAM
0000162A 51C8 FFFC                      dbf     d0, @LoadLoop             ; Go for next byte
0000162E                            

0000162E 7000                           moveq   #0, d0                  ; Set default global volumes
00001630 41F9 00A0 1FE0                 lea     ($A01FE0), a0
00001636 10C0                           move.b  d0, (a0)+
00001638 10C0                           move.b  d0, (a0)+
0000163A 10C0                           move.b  d0, (a0)+
0000163C 10C0                           move.b  d0, (a0)+
0000163E 10C0                           move.b  d0, (a0)+
00001640 10C0                           move.b  d0, (a0)+
00001642 10C0                           move.b  d0, (a0)+
00001644 10C0                           move.b  d0, (a0)+
00001646 10C0                           move.b  d0, (a0)+
00001648 10C0                           move.b  d0, (a0)+
0000164A 10C0                           move.b  d0, (a0)+
0000164C 10C0                           move.b  d0, (a0)+
0000164E 10FC 0001                      move.b  #1, (a0)+
00001652 10C0                           move.b  d0, (a0)+
00001654 10C0                           move.b  d0, (a0)+
00001656 10C0                           move.b  d0, (a0)+
00001658 13C0 00A0 1FF1                 move.b  d0, ($A01FF1)
0000165E                            

0000165E 13FC 00FF 00A0 1F00            move.b  #$FF, ($A01F00)         ; No direct events to execute
00001666                            

00001666 33FC 0000 00A1 1200 4E71+      Echo_Z80Reset                   ; Now reset for real
00001696 33FC 0000 00A1 1100            Echo_Z80Release                 ; Let the Z80 go!
0000169E                            

0000169E 4CDF 0301                      movem.l (sp)+, d0/a0-a1         ; Restore registers
000016A2 4E75                           rts                             ; End of subroutine
000016A4                            

000016A4                            ;****************************************************************************
000016A4                            ; Echo Z80 program
000016A4                            ;****************************************************************************
000016A4                            

000016A4                            @Z80Program: incbin "framewk\blob\prog-z80.bin"
00002AA4 =00001400                  @Z80ProgSize equ *-@Z80Program
00002AA4                                even
00002AA4                                even
00002AA4                                  include 'assets\states\title\init.asm'
00002AA4                            TitleScreen_Init:
00002AA4 7001                             moveq #0x1, d0
00002AA6 4EB8 0D22                        jsr WaitFrames ; Wait a frame, to collect new joypad presses
00002AAA                            

00002AAA                                  ; ************************************
00002AAA                                  ; Load title screen map
00002AAA                                  ; ************************************
00002AAA 41F9 0000 0000                   lea TitleScreenMap, a0                                                   ; Map data in a0
00002AB0 303C 0000                        move.w #TitleScreenMapSizeW, d0                                          ; Size (words) in d0
00002AB4 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00002AB6 343C 0000                        move.w #TitleScreenTilesTileID, d2                                       ; First tile ID in d2
00002ABA 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00002ABC 4EB8 0EE0                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00002AC0                                  ; ************************************
00002AC0                                  ;  Draw The Press Start String
00002AC0                                  ; ************************************
00002AC0 41F9 0000 0000                   lea PressStartString, a0                                                 ; String address
00002AC6 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002ACC 323C 0F1A                        move.w #0x0F1A, d1                                                       ; XY (15, 5)
00002AD0 7400                             moveq #0x0, d2                                                           ; Palette 0
00002AD2 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002AD6 33FC 0000 0000 0000              move.w  #game_state_title_screen, game_state                             ; store the game state
00002ADE 4E75                             rts
00002ADE 4E75                             rts
00002AE0                                  include 'assets\states\title\main.asm'
00002AE0                            TitleScreen:
00002AE0 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002AE6 0800 007C                        btst #pad_button_start, d0                                               ; Check start button
00002AEA 67F4                             beq.s TitleScreen                                                        ; if not then do the title screen
00002AEC 33FC 0000 0000 0000              move.w #game_state_title_screen_shutdown, game_state                     ; store the game state
00002AF4 4E75                             rts
00002AF4 4E75                             rts
00002AF6                                  include 'assets\states\title\shutdown.asm'
00002AF6                            TitleScreen_Shutdown:
00002AF6 33FC 0000 0000 0000              move.w  #game_state_songlist_screen_initalize, game_state                ; store the game state
00002AFE 4E75                             rts
00002AFE 4E75                             rts
00002B00                                  include 'assets\states\songlist\init.asm'
00002B00                            SonglistScreen_Init:
00002B00                                  ; ************************************
00002B00                                  ; Load songlist screen map
00002B00                                  ; ************************************
00002B00 41F9 0000 0000                   lea SonglistScreenMap, a0                                                ; Map data in a0
00002B06 303C 0000                        move.w #SonglistScreenMapSizeW, d0                                       ; Size (words) in d0
00002B0A 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00002B0C 343C 0000                        move.w #SonglistScreenTilesTileID, d2                                    ; First tile ID in d2
00002B10 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00002B12 4EB8 0EE0                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00002B16                            

00002B16                                  ; ************************************
00002B16                                  ;  Draw The Songlist String
00002B16                                  ; ************************************
00002B16 41F9 0000 0000                   lea SonglistString, a0                                                   ; String address
00002B1C 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002B22 323C 0F02                        move.w #0x0F02, d1                                                       ; XY (15, 2)
00002B26 7400                             moveq #0x0, d2                                                           ; Palette 0
00002B28 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B2C                            

00002B2C                                  ; load the meta data for the 1st song
00002B2C                                  ;move.l #0x0, d3
00002B2C                                  ;jsr GetSongMetaData
00002B2C                            

00002B2C                                  ; ************************************
00002B2C                                  ;  Draw The 1st song String
00002B2C                                  ; ************************************
00002B2C 41F9 0000 0000                   lea StringAuthorComradeOj, a0                                            ; String address
00002B32 323C 0705                        move.w #0x0705, d1                                                       ; XY (7, 5)
00002B36 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B3A                            

00002B3A                                  ; ************************************
00002B3A                                  ;  Draw The 1st song creator String
00002B3A                                  ; ************************************
00002B3A 41F9 0000 0000                   lea StringSongTwangyThing, a0                                            ; String address
00002B40 323C 0706                        move.w #0x0706, d1                                                       ; XY (7, 6)
00002B44 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B48                            

00002B48                                  ; load the meta data for the 2nd song
00002B48                            ;     move.l #0x1, d3
00002B48                            ;     jsr GetSongMetaData
00002B48                            

00002B48                                  ; ************************************
00002B48                                  ;  Draw The 2nd song String
00002B48                                  ; ************************************
00002B48                            ;     lea (a5), a0                                                             ; String address
00002B48                            ;     move.w #0x0709, d1                                                       ; XY (7, 9)
00002B48                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B48                            

00002B48                                  ; ************************************
00002B48                                  ;  Draw The 2nd song creator String
00002B48                                  ; ************************************
00002B48                            ;     lea (a4), a0                                                             ; String address
00002B48                            ;     move.w #0x070A, d1                                                       ; XY (7, 10)
00002B48                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002B48                            

00002B48 6100 E0E4                       bsr ClearSprites                                                          ; Clear Sprite List
00002B4C                            

00002B4C                                 ; add the selection table to the sprite list
00002B4C 303C 0000                        move.w #selectionarrow_start_position_y, d0                              ; Y coord (+ 128)
00002B50 123C 0000                        move.b #SelectionArrowDimensionBits, d1                                  ; Width (bits 0-1) and height (bits 2-3) in tiles
00002B54 1438 0000                        move.b 0x00, d2                                                          ; H/V flipping (bits 3/4), palette index (bits 5-6), priority (bit 7)
00002B58 163C 0000                        move.b #SelectionArrowTileID, d3                                         ; Index of first tile
00002B5C 383C 0000                        move.w #selectionarrow_start_position_x, d4                              ; x coord (+ 128)
00002B60 41F9 0000 0000                   lea (spritelist_table), a0                                               ; load address of sprite list table into a0
00002B66 6100 E0D0                        bsr AddSprite                                                            ; add the sprite to the list
00002B6A                            

00002B6A                                 ; *************************************
00002B6A                                 ; Set selection arrows initial y position
00002B6A                                 ; *************************************
00002B6A 33FC 0000 0000 0000              move.w #selectionarrow_start_position_y, (selectionarrow_position_y)     ; set selection arrow's y position first
00002B72                            

00002B72                                 ; *************************************
00002B72                                 ; set default song id
00002B72                                 ; *************************************
00002B72 33FC 0000 0000 0000             move.w #0, (song_id)                                                      ; set default song to first one
00002B7A                            

00002B7A 7001                             moveq #0x1, d0
00002B7C 4EB8 0D22                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002B80                            

00002B80 33FC 0000 0000 0000              move.w  #game_state_songlist_screen, game_state                          ; store the game state
00002B88 4E75                             rts
00002B88 4E75                             rts
00002B8A                                  include 'assets\states\songlist\main.asm'
00002B8A                            SonglistScreen:
00002B8A                                  ; *************************************
00002B8A                                  ; draw the selection arrow
00002B8A                                  ; *************************************
00002B8A                            ;     move.w #selectionarrow_id, d0                                            ; selection arrow's sprite id
00002B8A                            ;     move.w #selectionarrow_start_position_x, d1                              ; selection arrow's x position
00002B8A                            ;     move.w #SelectionArrowDimensions, d2                                     ; selection arrow's dimensions
00002B8A                            ;     moveq #0x8, d3                                                           ; selection arrrow's width in pixels
00002B8A                            ;     moveq #0x0, d4                                                           ; selection arrow's x flipped
00002B8A                            ;     lea SelectionArrowSubSpriteDimensions, a1                                ; selection arrow's subsprite 
00002B8A                            ;     jsr SetSpritePosX                                                        ; Set selection arrow's x position
00002B8A                            

00002B8A                            ;     move.w #selectionarrow_id, d0                                            ; selection arrow's sprite id
00002B8A                            ;     move.w (selectionarrow_position_y), d1                                   ; selection arrow's y position
00002B8A                            ;     jsr SetSpritePosY                                                        ; Set selection arrow's y position
00002B8A                            

00002B8A 6100 E0DA                        bsr UpdateSprites                                                        ; update the sprites list
00002B8E                            

00002B8E 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002B94                            ;     move.w (selectionarrow_position_y), d1                                   ; selection arrows y position in d1
00002B94                            ;     move.w #selectionarrow_y_velocity, d2                                    ; selection arrows y velocity in d2
00002B94                            ;     move.w #selectionarrow_boundry_top, d3                                   ; selection arrows top boundry in d3
00002B94                            ;     move.w #selectionarrow_boundry_bottom, d4                                ; selection arrows bottom boundry in d4
00002B94                            ;     move.w (song_id), d5
00002B94                            ;     btst #pad_button_up, d0                                                  ; did the user press up on the dpad?
00002B94                            ;     beq.s SonglistNotDPadUp                                                  ; if not the branch and don't move the selection arrow up
00002B94                            ;     cmp.w d1, d3                                                             ; has the selection arrow reached the top boundry
00002B94                            ;     beq.s SelectionArrowHitTopBoundry                                        ; if it has then don't do anything
00002B94                            ;     sub d2, d1                                                               ; subtract the selection arrows velocity to it's position 
00002B94                            ;SelectionArrowHitTopBoundry:
00002B94                            ;SonglistNotDPadUp:
00002B94                            ;     btst #pad_button_down, d0                                                ; did the user press down on the dpad?
00002B94                            ;     beq.s SonglistNotDPadDown                                                ; if not the branch and don't move the selection arrow down
00002B94                            ;     cmp.w d1, d4                                                             ; has the selection arrow reached the bottom boundry
00002B94                            ;     beq.s SelectionArrowHitBottomBoundry                                     ; if it has then don't do anything
00002B94                            ;     add d2, d1                                                               ; add the selection arrows velocity to it's position                                                                    ; temporary placeholder for when dpad is pressed down
00002B94                            ;SelectionArrowHitBottomBoundry:
00002B94                            ;SonglistNotDPadDown:
00002B94                            ;     move.w d1, (selectionarrow_position_y)                                   ; store the selectoion arrows new y position
00002B94 0800 007C                        btst #pad_button_start, d0                                               ; Check start button
00002B98 67F0                             beq.s SonglistScreen                                                     ; if not then continue to show the player's stats
00002B9A                            ;     move.w d5, (song_id)                                                     ; store the song id
00002B9A 33FC 0000 0000 0000              move.w #game_state_songlist_screen_shutdown, game_state                  ; otherwise clean up the songlist state
00002BA2 7001                             moveq #0x1, d0
00002BA4 4EF8 0D22                        jmp WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002BA8 4E75                             rts
00002BA8 4E75                             rts
00002BAA                                  include 'assets\states\songlist\shutdown.asm'
00002BAA                            SonglistScreen_Shutdown:
00002BAA                                  ; ************************************
00002BAA                                  ;  Clear The Songlist String
00002BAA                                  ; ************************************
00002BAA 41F9 0000 0000                   lea BlankString, a0                                                   ; String address
00002BB0 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002BB6 323C 0F02                        move.w #0x0F02, d1                                                       ; XY (15, 2)
00002BBA 7400                             moveq #0x0, d2                                                           ; Palette 0
00002BBC 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BC0                            

00002BC0                                  ; ************************************
00002BC0                                  ;  Clear The 1st song String
00002BC0                                  ; ************************************
00002BC0 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002BC6 323C 0705                        move.w #0x0705, d1                                                       ; XY (7, 5)
00002BCA 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BCE                            

00002BCE                                  ; ************************************
00002BCE                                  ;  Clear The 1st song creator String
00002BCE                                  ; ************************************
00002BCE 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002BD4 323C 0706                        move.w #0x0706, d1                                                       ; XY (7, 6)
00002BD8 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BDC                            

00002BDC                                  ; ************************************
00002BDC                                  ;  Clear The 2nd song String
00002BDC                                  ; ************************************
00002BDC                            ;     lea BlankString, a0                                                      ; String address
00002BDC                            ;     move.w #0x0709, d1                                                       ; XY (7, 9)
00002BDC                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BDC                            

00002BDC                                  ; ************************************
00002BDC                                  ;  Draw The 2nd song creator String
00002BDC                                  ; ************************************
00002BDC                            ;     lea BlankString, a0                                                      ; String address
00002BDC                            ;     move.w #0x070A, d1                                                       ; XY (7, 10)
00002BDC                            ;     jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BDC                            

00002BDC                                  ; ************************************
00002BDC                                  ;  Clear The Press Start String
00002BDC                                  ; ************************************
00002BDC 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002BE2 323C 0F1A                        move.w #0x0F1A, d1                                                       ; XY (15, 26)
00002BE6 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002BEA 33FC 0000 0000 0000              move.w #game_state_game_mode_initalize, game_state                       ; store the game state
00002BF2                            

00002BF2 4E75                             rts
00002BF2 4E75                             rts
00002BF4                                  include 'assets\states\game\init.asm'
00002BF4                            GameMode_Init:
00002BF4                                  ; ************************************
00002BF4                                  ; Load game map
00002BF4                                  ; ************************************
00002BF4 41F9 0000 0000                   lea GameMap, a0                                                          ; Map data in a0
00002BFA 303C 0000                        move.w #GameMapSizeW, d0                                                 ; Size (words) in d0
00002BFE 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00002C00 343C 0000                        move.w #GameTilesTileID, d2                                              ; First tile ID in d2
00002C04 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00002C06 4EB8 0EE0                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00002C0A                            

00002C0A                                  ; ************************************
00002C0A                                  ;  Draw The Score String
00002C0A                                  ; ************************************
00002C0A 41F9 0000 0000                   lea ScoreString, a0                                                      ; String address
00002C10 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002C16 323C 0301                        move.w #0x0301, d1                                                       ; XY (5, 1)
00002C1A 7400                             moveq #0x0, d2                                                           ; Palette 0
00002C1C 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C20                            

00002C20                                  ; ************************************
00002C20                                  ;  Draw The Combo String
00002C20                                  ; ************************************
00002C20 41F9 0000 0000                   lea ComboString, a0                                                      ; String address
00002C26 323C 1C01                        move.w #0x1C01, d1                                                       ; XY (27, 1)
00002C2A 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002C2E                            

00002C2E                                  ; ************************************
00002C2E                                  ; Initalize Everything
00002C2E                                  ; ************************************
00002C2E 33FC 0000 0000 0000              move.w #0, (score)                                                       ; initialize score
00002C36 33FC 0000 0000 0000              move.w #0, (combo)                                                       ; initialize combo
00002C3E 33FC 0001 0000 0000              move.w #1, (multiplier)                                                  ; initialize multiplier
00002C46 33FC 0001 0000 0000              move.w #1, (scoredelta)                                                  ; initalize score delta
00002C4E 33FC 0001 0000 0000              move.w #1, (tempo)                                                       ; initialize tempo
00002C56 33FC 0000 0000 0000              move.w #(note_start_position_x), (greennote_position_x)                  ; Set green note's x position
00002C5E 33FC 0000 0000 0000              move.w #(note_start_position_x), (rednote_position_x)                    ; Set red note's x position
00002C66 33FC 0000 0000 0000              move.w #rockindicator_start_position_x, (rockindicator_position_x)       ; Set rock indicator's x position
00002C6E                            

00002C6E                                  ; load the song data for the 1st song
00002C6E                                  ;move.l #0x0, d3
00002C6E                                  ;jsr GetSongData
00002C6E                            

00002C6E                                  ; ************************************
00002C6E                                  ; Load music
00002C6E                                  ; ************************************
00002C6E 41F9 0000 0000                   lea ComradeOj_TwangyThing, a0                                         ; song data address in a1
00002C74                                  ;lea LinkueiBR_TotalConcentration, a0                                 ; song data address in a1
00002C74 4EB8 12E8                        jsr Echo_PlayBGM                                                      ; play the song
00002C78 33FC 0000 0000 0000              move.w #game_state_game_mode, game_state                              ; set game state to game mode
00002C80                            

00002C80                                  ; ************************************
00002C80                                  ; hide the selection arrow from songlist
00002C80                                  ; ************************************
00002C80 33FC 0000 0000 0000              move.w #offscreen_position_y, (selectionarrow_position_y)                ; move the selection arrow's y position offscreen
00002C88 303C 0000                        move.w #selectionarrow_id, d0                                            ; selection arrow's sprite id
00002C8C 3239 0000 0000                   move.w (selectionarrow_position_y), d1                                   ; selection arrow's y position
00002C92 343C 0000                        move.w #SelectionArrowDimensions, d2                                     ; selection arrow's dimensions
00002C96 7608                             moveq #0x8, d3                                                           ; selection arrrow's width in pixels
00002C98 7800                             moveq #0x0, d4                                                           ; selection arrow's x flipped
00002C9A 43F9 0000 0000                   lea SelectionArrowSubSpriteDimensions, a1                                ; selection arrow's subsprite 
00002CA0 4EB8 0A56                        jsr SetSpritePosY                                                        ; Set selection arrow's y position
00002CA4                            

00002CA4 7001                             moveq #0x1, d0
00002CA6 4EB8 0D22                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002CAA 4E75                             rts
00002CAA 4E75                             rts
00002CAC                                  include 'assets\states\game\main.asm'
00002CAC                            GameMode:
00002CAC 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002CB2 0800 007C                        btst #pad_button_start, d0                                               ; was the start button pressed
00002CB6 6700                             beq.s @NoStart                                                           ; otherwise branch
00002CB8 4E71                             nop                                                                      ; temporary
00002CBA                            ;     move.w #game_state_game_mode_pause_initalize, game_state                 ; set game state to pause init
00002CBA                            @NoStart:
00002CBA 343C 0000                        move.w #(note_plane_safearea_offset+note_bounds_left), d2                ; fret safe area offset in d2
00002CBE 3639 0000 0000                   move.w (score), d3                                                       ; player's score into d3
00002CC4 3839 0000 0000                   move.w (scoredelta), d4
00002CCA 3A39 0000 0000                   move.w (combo), d5                                                       ; player's current combo
00002CD0 7C01                             moveq #1, d6                                                             ; combo increment
00002CD2                            

00002CD2                                  ; start of green note code
00002CD2 3239 0000 0000                   move.w (greennote_position_x), d1                                        ; green note position in d1
00002CD8 3039 0000 0000                   move.w joypadA, d0                                                       ; Read pad 1 state, result in d0
00002CDE 0800 00EC                        btst #pad_button_left, d0                                                ; Check left pad
00002CE2 6700                             beq.s @NoLeft                                                            ; Branch if button off
00002CE4 B242                             cmp.w d2, d1                                                             ; is the player pressing too early
00002CE6 6E00                             bgt.s @GreenNoteSafeArea                                                 ; if so then don't accept it
00002CE8 323C 0000                        move.w #note_start_position_x, d1
00002CEC C704                             abcd d4, d3                                                              ; increment the player's score
00002CEE CB06                             abcd d6, d5                                                              ; increment the player's combo meter
00002CF0 6000 0000                        bra @GreenNoteDone                                                       ; continue through the rest of the code
00002CF4                            @GreenNoteSafeArea:
00002CF4                            @GreenNoteDone:
00002CF4                            @NoLeft:
00002CF4                                  ; green note movement code
00002CF4 9279 0000 0000                   sub.w (tempo), d1                                                        ; subtract the tempo
00002CFA 0C41 0000                        cmp.w  #(note_plane_border_offset-note_bounds_left), d1                  ; did the player miss the note entirely
00002CFE 6E00                             bgt.s @GreenNoteNotWithinBounds                                          ; branch if the player hasn't
00002D00 323C 0000                        move.w #note_start_position_x, d1                                        ; otherwise the player has so move the note back to the beginning
00002D04 7A00                             moveq #0, d5                                                             ; player played missed the note so reset the player's combo
00002D06                            @GreenNoteNotWithinBounds:
00002D06 33C1 0000 0000                   move.w d1, (greennote_position_x)                                        ; set the note's position normally
00002D0C                            

00002D0C                                  ; start of red note code
00002D0C 3239 0000 0000                   move.w (rednote_position_x), d1                                          ; red note position in d1
00002D12 0800 00D0                        btst #pad_button_c, d0                                                   ; Check c button
00002D16 6700                             beq.s @NoRight                                                           ; Branch if button off
00002D18 B242                             cmp.w d2, d1                                                             ; is the player pressing too early
00002D1A 6E00                             bgt.s @RedNoteSafeArea                                                   ; if so then don't accept it
00002D1C 323C 0000                        move.w #note_start_position_x, d1
00002D20 C704                             abcd d4, d3                                                              ; increment the player's score
00002D22 CB06                             abcd d6, d5                                                              ; increment the the player's combo meter
00002D24 6000 0000                        bra @RedNoteDone                                                         ; continue through the rest of the code
00002D28                            @RedNoteSafeArea:
00002D28                            @RedNoteDone:
00002D28                            @NoRight:
00002D28                                  ; red note movement code
>>>>>>> IncorrectButtonMappingsInGame
00002D28 9279 0000 0000                   sub.w (tempo), d1                                                        ; subtract the tempo
00002D2E 0C41 0000                        cmp.w  #(note_plane_border_offset-note_bounds_left), d1                  ; did the player miss the note entirely
00002D32 6E00                             bgt.s @GreenNoteNotWithinBounds                                          ; branch if the player hasn't
00002D34 323C 0000                        move.w #note_start_position_x, d1                                        ; otherwise the player has so move the note back to the beginning
00002D38 7A00                             moveq #0, d5                                                             ; player played missed the note so reset the player's combo
00002D3A                            @GreenNoteNotWithinBounds:
00002D3A 33C1 0000 0000                   move.w d1, (greennote_position_x)                                        ; set the note's position normally
00002D40                            

00002D40                                  ; start of red note code
00002D40 3239 0000 0000                   move.w (rednote_position_x), d1                                          ; red note position in d1
00002D46 0800 0074                        btst #pad_button_right, d0                                               ; Check right pad
00002D4A 6700                             beq.s @NoRight                                                           ; Branch if button off
00002D4C B242                             cmp.w d2, d1                                                             ; is the player pressing too early
00002D4E 6E00                             bgt.s @RedNoteSafeArea                                                   ; if so then don't accept it
00002D50 323C 0000                        move.w #note_start_position_x, d1
00002D54 C704                             abcd d4, d3                                                              ; increment the player's score
00002D56 CB06                             abcd d6, d5                                                              ; increment the the player's combo meter
00002D58 41F9 0000 0000                   lea (SnareDrumRight), a0                                                 ; load the snare drum effect with a rightt position
00002D5E 6100 E578                        bsr Echo_PlaySfx                                                         ; play the snare drum sound effect
00002D62 6000 0000                        bra @RedNoteDone                                                         ; continue through the rest of the code
00002D66                            @RedNoteSafeArea:
00002D66                            @RedNoteDone:
00002D66                            @NoRight:
00002D66                                  ; red note movement code
00002D66 9279 0000 0000                   sub.w (tempo), d1                                                        ; subtract the tempo
00002D6C 0C41 0000                        cmp.w  #(note_plane_border_offset-note_bounds_left), d1                  ; did the player miss the note entirely
00002D70 6E00                             bgt.s @RedNoteNotWithinBounds                                            ; branch if the player hasn't
00002D72 323C 0000                        move.w #note_start_position_x, d1                                        ; otherwise the player has so move the note back to the beginning
00002D76 7A00                             moveq #0, d5                                                             ; player played missed the note so reset the player's combo
00002D78                            @RedNoteNotWithinBounds:
00002D78 33C1 0000 0000                   move.w d1, (rednote_position_x)                                          ; set the red note's position normally
00002D7E                            

00002D7E 0C45 0009                        cmp.w #$9, d5                                                            ; have the player reached a combo of 10
00002D82 6E00                             bgt.s @SkipX1Multiplier                                                  ; if not then branch to next step
00002D84 33FC 0001 0000 0000              move.w #1, (multiplier)                                                  ; set the multiplier to 1
00002D8C 383C 0001                        move.w #1, d4                                                            ; set score delta to 1
00002D90                            @SkipX1Multiplier:
00002D90 0C45 0010                        cmp.w #$10, d5                                                           ; has the player reached a combo of 10
00002D94 6D00                             blt.s @SkipX2Multiplier                                                  ; if not then branch to the next step
00002D96 33FC 0002 0000 0000              move.w #2, (multiplier)                                                  ; set the multiplier to 2
00002D9E 383C 0002                        move.w #2, d4                                                            ; set score delta to 2
00002DA2                            @SkipX2Multiplier:
00002DA2 0C45 0020                        cmp.w #$20, d5                                                           ; have the player reached a combo of 20
00002DA6 6D00                             blt.s @SkipX3Multiplier                                                  ; if not then branch to the next step
00002DA8 33FC 0003 0000 0000              move.w #3, (multiplier)                                                  ; set the multiplier to 3 
00002DB0 383C 0003                        move.w #3, d4                                                            ; set score delta to 3
00002DB4                            @SkipX3Multiplier:
00002DB4 0C45 0030                        cmp.w #$30, d5                                                           ; have the player reached a combo of 30
00002DB8 6D00                             blt.s @SkipX4Multiplier                                                  ; if not then branch to the next step
00002DBA 33FC 0004 0000 0000              move.w #4, (multiplier)                                                  ; set the multiplier to 4 
00002DC2 383C 0004                        move.w #4, d4                                                            ; set score delta to 4
00002DC6                            @SkipX4Multiplier:
00002DC6                            

00002DC6 33C3 0000 0000                   move.w d3, (score)                                                       ; save the player's score
00002DCC 33C4 0000 0000                   move.w d4, (scoredelta)                                                  ; save the score delta
00002DD2 33C5 0000 0000                   move.w d5, (combo)                                                       ; save the player's combo
00002DD8                            

00002DD8                            

00002DD8 4EB8 0D12                        jsr WaitVBlankStart                                                      ; Wait for start of vblank
00002DDC                            

00002DDC 4EB8 14D6                        jsr Echo_GetStatus                                                       ; get the songs status
00002DE0 0800 0001                        btst #$01, d0                                                            ; is the song finished?
00002DE4 6600                             bne.s @SongNotFinished                                                   ; ifnot then branch
00002DE6 33FC 0000 0000 0000              move.w #game_state_game_mode_shutdown, game_state                        ; set game state to stats screen
00002DEE                            @SongNotFinished:
00002DEE                            

00002DEE 4FEF FFFC                        lea -$4(sp), sp                                                          ; load effective address of stack pointer
00002DF2 204F                             move.l sp, a0                                                            ; allocate temporary buffer on stack
00002DF4                            

00002DF4                                  ; draw the score counter
00002DF4 204F                             move.l sp, a0                                                            ; String to a0
00002DF6 3039 0000 0000                   move.w (score), d0                                                       ; Integer to d0
00002DFC 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00002E00                            

00002E00 204F                             move.l sp, a0                                                            ; String to a0
00002E02 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00002E08 223C 0000 0901                   move.l #0x0901, d1                                                       ; Position to d1
00002E0E 7400                             moveq #0x0, d2                                                           ; Palette to d2
00002E10 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00002E14                            

00002E14                                  ; draw the combo counter
00002E14                            

00002E14 204F                             move.l sp, a0                                                            ; String to a0
00002E16 3039 0000 0000                   move.w (combo), d0                                                       ; Integer to d0
00002E1C 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00002E20                            

00002E20 204F                             move.l sp, a0                                                            ; String to a0
00002E22 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00002E28 223C 0000 2201                   move.l #0x2201, d1                                                       ; Position to d1
00002E2E 7400                             moveq #0x0, d2                                                           ; Palette to d2
00002E30 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00002E34                            

00002E34                                  ; draw the multiplier counter
00002E34                            

00002E34 204F                             move.l sp, a0                                                            ; String to a0
00002E36 3039 0000 0000                   move.w (multiplier), d0                                                  ; Integer to d0
00002E3C 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00002E40                            

00002E40 204F                             move.l sp, a0                                                            ; String to a0
00002E42 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00002E48 223C 0000 0419                   move.l #0x0419, d1                                                       ; Position to d1
00002E4E 7400                             moveq #0x0, d2                                                           ; Palette to d2
00002E50 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00002E54                            

00002E54 4FEF 0004                        lea $4(sp), sp                                                          ; free allocated temporary buffer
00002E58                            

00002E58                                  ; ************************************
00002E58                                  ;  Draw The Multiplier String
00002E58                                  ; ************************************
00002E58 41F9 0000 0000                   lea MultiplierString, a0                                                 ; String address
00002E5E 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002E64 323C 0419                        move.w #0x0419, d1                                                       ; XY (03, 24)
00002E68 7400                             moveq #0x0, d2                                                           ; Palette 0
00002E6A 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002E6E                            

00002E6E                                  ; Set green fret's position
00002E6E 303C 0000                        move.w #greennote_id, d0                                                 ; green fret's sprite id
00002E72 3239 0000 0000                   move.w (greennote_position_x), d1                                        ; green fret's x position
00002E78 343C 0000                        move.w #GreenNoteDimensions, d2                                          ; green fret's dimensions
00002E7C 7608                             moveq #0x8, d3                                                           ; green fret's width in pixels
00002E7E 7800                             moveq #0x0, d4                                                           ; green fret's x flipped
00002E80 43F9 0000 0000                   lea GreenNoteSubSpriteDimensions, a1                                     ; green fret's subsprite 
00002E86 4EB8 0A00                        jsr SetSpritePosX                                                        ; Set green fret's x position
00002E8A                            

00002E8A 303C 0000                        move.w #greennote_id, d0                                                 ; green note's sprite id
00002E8E 323C 0000                        move.w #green_note_start_position_y, d1                                  ; green note's y position
00002E92 4EB8 0A62                        jsr SetSpritePosY                                                        ; Set left arrow's y position
00002E96                            

00002E96                                  ; Set red note's position
00002E96 303C 0000                        move.w #rednote_id, d0                                                   ; red note's sprite id
00002E9A 3239 0000 0000                   move.w (rednote_position_x), d1                                          ; red note's x position
00002EA0 4EB8 0A00                        jsr SetSpritePosX                                                        ; Set red fret's x position
00002EA4                            

00002EA4 303C 0000                        move.w #rednote_id, d0                                                   ; red note's sprite id
00002EA8 323C 0000                        move.w #red_note_start_position_y, d1                                    ; red note's y position
00002EAC 4EB8 0A62                        jsr SetSpritePosY                                                        ; Set red note's y position
00002EB0                            

00002EB0                                  ; Set rock indicator's position
00002EB0 303C 0000                        move.w #rockindicator_id, d0                                             ; rock indicator's sprite id
00002EB4 3239 0000 0000                   move.w (rockindicator_position_x), d1                                    ; rock indicator's x position
00002EBA 4EB8 0A00                        jsr SetSpritePosX                                                        ; Set rock indicator's x position
00002EBE                            

00002EBE 303C 0000                        move.w #rockindicator_id, d0                                             ; rock indicator's sprite id
00002EC2 323C 0000                        move.w #rockindicator_start_position_y, d1                               ; rock indicator's y position
00002EC6 4EB8 0A62                        jsr SetSpritePosY                                                        ; Set rock indicator's y position
00002ECA                            

00002ECA 4EB8 0D20                        jsr WaitVBlankEnd                                                        ; Wait for end of vblank
00002ECE 4E75                             rts
00002ECE 4E75                             rts
00002ED0                                  include 'assets\states\game\shutdown.asm'
00002ED0                            GameMode_Shutdown:
00002ED0                                  ; ************************************
00002ED0                                  ; Stop Music
00002ED0                                  ; ************************************
00002ED0 4EB8 1302                        jsr Echo_StopBGM                                                         ; stop the music
00002ED4                            

00002ED4                                  ; ************************************
00002ED4                                  ; Clear the sprites
00002ED4                                  ; ************************************
00002ED4 33FC 0000 0000 0000              move.w #offscreen_position_y, (greennote_position_x)                     ; Set green note's y position
00002EDC 33FC 0000 0000 0000              move.w #offscreen_position_y, (rednote_position_x)                       ; Set red note's y position
00002EE4 33FC 0000 0000 0000              move.w #offscreen_position_x, (rockindicator_position_x)                 ; Set rock indicator's x position
00002EEC                            

00002EEC                                  ; ************************************
00002EEC                                  ;  Clear The Score String
00002EEC                                  ; ************************************
00002EEC 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002EF2 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002EF8 323C 0301                        move.w #0x0301, d1                                                       ; XY (5, 1)
00002EFC 7400                             moveq #0x0, d2                                                           ; Palette 0
00002EFE 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002F02                            

00002F02                                  ; ************************************
00002F02                                  ;  Clear The Score Counter
00002F02                                  ; ************************************
00002F02 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00002F08 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00002F0E 223C 0000 0901                   move.l #0x0901, d1                                                       ; Position to d1
00002F14 7400                             moveq #0x0, d2                                                           ; Palette to d2
00002F16 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00002F1A                            

00002F1A                                  ; ************************************
00002F1A                                  ;  Clear The Combo String
00002F1A                                  ; ************************************
00002F1A 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002F20 323C 1C01                        move.w #0x1C01, d1                                                       ; XY (27, 1)
00002F24 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002F28                            

00002F28                                  ; ************************************
00002F28                                  ; Clear The Combo Counter
00002F28                                  ; ************************************
00002F28 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00002F2E 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00002F34 223C 0000 2201                   move.l #0x2201, d1                                                       ; Position to d1
00002F3A 7400                             moveq #0x0, d2                                                           ; Palette to d2
00002F3C 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00002F40                            

00002F40                                  ; ************************************
00002F40                                  ; Clear The Multiplier Counter
00002F40                                  ; ************************************
<<<<<<< HEAD
00002F40 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00002F46 223C 0000 0419                   move.l #0x0419, d1                                                       ; Position to d1
00002F4C 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00002F50 33FC 0000 0000 0000              move.w #game_state_stats_screen_initalize, game_state                    ; store the game state
00002F58 4E75                             rts
00002F58 4E75                             rts
00002F5A                                  include 'assets\states\pause\init.asm'
00002F5A                            Pause_Init:
00002F5A 7001                             moveq #0x1, d0
00002F5C 4EB8 0D2E                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002F60                            

00002F60 41F9 0000 0000                   lea PauseString, a0                                                      ; String address
00002F66 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002F6C 323C 0810                        move.w #0x0810, d1                                                       ; XY (08, 16)
00002F70 7400                             moveq #0x0, d2                                                           ; Palette 0
00002F72 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002F76 33FC 0000 0000 0000              move.w  #game_state_game_mode_pause, game_state                          ; store the game state
00002F7E                                  ; ************************************
00002F7E                                  ; Pause Music
00002F7E                                  ; ************************************
00002F7E 4EB8 1310                        jsr Echo_PauseBGM                                                        ; pause the music
00002F82 4E75                             rts
00002F82 4E75                             rts
00002F84                                  include 'assets\states\pause\main.asm'
00002F84                            Pause:
00002F84 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002F8A 0800 0000                        btst #pad_button_start, d0                                               ; Check start button
00002F8E 67F4                             beq.s Pause                                                              ; if not then continue paused, otherwise clear the pause string...
00002F90 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002F96 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002F9C 323C 0810                        move.w #0x0810, d1                                                       ; XY (08, 16)
00002FA0 7400                             moveq #0x0, d2                                                           ; Palette 0
00002FA2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002FA6 33FC 0000 0000 0000              move.w #game_state_game_mode_pause_shutdown, game_state                  ; store the game state
00002FAE                                  ; Since we skip game_state 0x2, we need to gather new inputs here instead
00002FAE 7001                             moveq #0x1, d0
00002FB0 4EF8 0D2E                        jmp WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002FB4 4E75                             rts
00002FB4 4E75                             rts
00002FB6                                  include 'assets\states\pause\shutdown.asm'
00002FB6                            Pause_Shutdown:
00002FB6 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002FBC 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002FC2 323C 0810                        move.w #0x0810, d1                                                       ; XY (08, 16)
00002FC6 7400                             moveq #0x0, d2                                                           ; Palette 0
00002FC8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002FCC 33FC 0000 0000 0000              move.w #game_state_game_mode, game_state                                 ; store the game state
00002FD4                                  ; ************************************
00002FD4                                  ; Resume Music
00002FD4                                  ; ************************************
00002FD4 4EB8 131E                        jsr Echo_ResumeBGM                                                       ; resume the music
00002FD8 4E75                             rts
00002FD8 4E75                             rts
00002FDA                                  include 'assets\states\stats\init.asm'
00002FDA                            StatsScreen_Init:
00002FDA                                  ; ************************************
00002FDA                                  ; Temporary Placeholders
00002FDA                                  ; ************************************
00002FDA 303C 002A                        move.w #42, d0
00002FDE 4EB8 106C                        jsr ItoBCD_Int_w
00002FE2 33C2 0000 0000                   move.w d2, (hits)
00002FE8 33FC 0000 0000 0000              move.w #0, (misses)
00002FF0 33FC 0000 0000 0000              move.w #0, (errors)
00002FF8 303C 008A                        move.w #138, d0
00002FFC 4EB8 106C                        jsr ItoBCD_Int_w
00003000 33C2 0000 0000                   move.w d2, (score)
00003006 303C 002A                        move.w #42, d0
0000300A 4EB8 106C                        jsr ItoBCD_Int_w
0000300E 33C2 0000 0000                   move.w d2, (top_streak)
00003014 303C 0064                        move.w #100, d0
00003018 4EB8 106C                        jsr ItoBCD_Int_w
0000301C 33C2 0000 0000                   move.w d2, (Completion)
00003022                            

00003022                                  ; start of vblank
00003022 4EB8 0D12                        jsr WaitVBlankStart
00003026                            

00003026                                  ; ************************************
00003026                                  ; Set The Sprites  Position Offscreen
00003026                                  ; ************************************
00003026                                  ; Set green note's position
00003026 343C 0000                        move.w #GreenNoteDimensions, d2                                          ; green fret's dimensions
0000302A 7608                             moveq #0x8, d3                                                           ; green fret's width in pixels
0000302C 7800                             moveq #0x0, d4                                                           ; green fret's x flipped
0000302E 43F9 0000 0000                   lea GreenNoteSubSpriteDimensions, a1                                     ; green fret's subsprite 
00003034                            

00003034 303C 0000                        move.w #greennote_id, d0                                                 ; green's sprite id
00003038 3239 0000 0000                   move.w (greennote_position_x), d1                                        ; green's x position
0000303E 4EB8 0A00                        jsr SetSpritePosX                                                        ; Set green note's x position
00003042                            

00003042 303C 0000                        move.w #rednote_id, d0                                                   ; red note's sprite id
00003046 3239 0000 0000                   move.w (rednote_position_x), d1                                          ; red note's x position
0000304C 4EB8 0A00                        jsr SetSpritePosX                                                        ; Set red note's x position
00003050                            

00003050 303C 0000                        move.w #rockindicator_id, d0                                             ; rock indicator's sprite id
00003054 3239 0000 0000                   move.w (rockindicator_position_x), d1                                    ; rock indicator's x position
0000305A 4EB8 0A00                        jsr SetSpritePosX                                                        ; Set rock indicator's y position
0000305E                            

0000305E                                  ; ************************************
0000305E                                  ; Load stats screen map
0000305E                                  ; ************************************
0000305E 41F9 0000 0000                   lea StatsScreenMap, a0                                                   ; Map data in a0
00003064 303C 0000                        move.w #TitleScreenMapSizeW, d0                                          ; Size (words) in d0
00003068 7200                             moveq #0x0, d1                                                           ; Y offset in d1
0000306A 343C 0000                        move.w #StatsScreenTilesTileID, d2                                       ; First tile ID in d2
0000306E 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00003070 4EB8 0EEC                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00003074                            

00003074                                  ; ************************************
00003074                                  ;  Draw The Statistics String
00003074                                  ; ************************************
00003074 41F9 0000 0000                   lea StatisticsString, a0                                                 ; String address
0000307A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003080 323C 0F05                        move.w #0x0F05, d1                                                       ; XY (15, 5)
00003084 7400                             moveq #0x0, d2                                                           ; Palette 0
00003086 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000308A                            

0000308A                                  ; ************************************
0000308A                                  ;  Draw The Hits String
0000308A                                  ; ************************************
0000308A 41F9 0000 0000                   lea HitsString, a0                                                      ; String address
00003090 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003096 323C 0607                        move.w #0x0607, d1                                                       ; XY (6, 7)
0000309A 7400                             moveq #0x0, d2                                                           ; Palette 0
0000309C 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030A0                            

000030A0                                  ; ************************************
000030A0                                  ;  Draw The Misses String
000030A0                                  ; ************************************
000030A0 41F9 0000 0000                   lea MissesString, a0                                                      ; String address
000030A6 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000030AC 323C 0609                        move.w #0x0609, d1                                                       ; XY (6, 9)
000030B0 7400                             moveq #0x0, d2                                                           ; Palette 0
000030B2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030B6                            

000030B6                                  ; ************************************
000030B6                                  ;  Draw The Errors String
000030B6                                  ; ************************************
000030B6 41F9 0000 0000                   lea ErrorsString, a0                                                     ; String address
000030BC 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000030C2 323C 060B                        move.w #0x060B, d1                                                       ; XY (6, 11)
000030C6 7400                             moveq #0x0, d2                                                           ; Palette 0
000030C8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030CC                            

000030CC                                  ; ************************************
000030CC                                  ;  Draw The Score String
000030CC                                  ; ************************************
000030CC 41F9 0000 0000                   lea ScoreString, a0                                                      ; String address
000030D2 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000030D8 323C 060E                        move.w #0x060E, d1                                                       ; XY (6, 14)
000030DC 7400                             moveq #0x0, d2                                                           ; Palette 0
000030DE 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030E2                            

000030E2                                  ; ************************************
000030E2                                  ;  Draw The Top Streak String
000030E2                                  ; ************************************
000030E2 41F9 0000 0000                   lea TopStreakString, a0                                                  ; String address
000030E8 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000030EE 323C 0611                        move.w #0x0611, d1                                                       ; XY (6, 17)
000030F2 7400                             moveq #0x0, d2                                                           ; Palette 0
000030F4 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030F8                            

000030F8                                  ; ************************************
000030F8                                  ;  Draw The Completion String
000030F8                                  ; ************************************
000030F8 41F9 0000 0000                   lea CompletionString, a0                                                 ; String address
000030FE 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003104 323C 0614                        move.w #0x0614, d1                                                       ; XY (6, 20)
00003108 7400                             moveq #0x0, d2                                                           ; Palette 0
0000310A 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000310E 7001                             moveq #0x1, d0
00003110                            

00003110                                  ; ************************************
00003110                                  ; start of stack allocation
00003110                                  ; ************************************
00003110 4FEF FFF8                        lea -$8(sp), sp                                                          ; load effective address of stack pointer
00003114 204F                             move.l sp, a0                                                            ; allocate temporary buffer on stack
00003116                            

00003116                                  ; *************************************
00003116                                  ; convert the hits counter to int
00003116                                  ; *************************************
00003116 204F                             move.l sp, a0                                                            ; String to a0
00003118 3039 0000 0000                   move.w (hits), d0                                                        ; Integer to d0
0000311E 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003122                            

00003122                                  ; *************************************
00003122                                  ; draw the hits counter
00003122                                  ; *************************************
00003122 204F                             move.l sp, a0                                                            ; String to a0
00003124 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000312A 223C 0000 1C07                   move.l #0x1C07, d1                                                       ; Position to d1
00003130 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003132 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00003136                            

00003136                                  ; *************************************
00003136                                  ; convert the misses counter to int
00003136                                  ; *************************************
00003136 204F                             move.l sp, a0                                                            ; String to a0
00003138 3039 0000 0000                   move.w (misses), d0                                                      ; Integer to d0
0000313E 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003142                            

00003142                                  ; *************************************
00003142                                  ; draw the misses counter
00003142                                  ; *************************************
00003142 204F                             move.l sp, a0                                                            ; String to a0
00003144 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000314A 223C 0000 1C09                   move.l #0x1C09, d1                                                       ; Position to d1
00003150 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003152 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00003156                            

00003156                                  ; *************************************
00003156                                  ; convert the errors counter to int
00003156                                  ; *************************************
00003156 204F                             move.l sp, a0                                                            ; String to a0
00003158 3039 0000 0000                   move.w (errors), d0                                                      ; Integer to d0
0000315E 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003162                            

00003162                                  ; *************************************
00003162                                  ; draw the errors counter
00003162                                  ; *************************************
00003162 204F                             move.l sp, a0                                                            ; String to a0
00003164 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000316A 223C 0000 1C0B                   move.l #0x1C0B, d1                                                       ; Position to d1
00003170 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003172 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00003176                            

00003176                                  ; *************************************
00003176                                  ; convert the score counter to int
00003176                                  ; *************************************
00003176 204F                             move.l sp, a0                                                            ; String to a0
00003178 3039 0000 0000                   move.w (score), d0                                                       ; Integer to d0
0000317E 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003182                            

00003182                                  ; *************************************
00003182                                  ; draw the errors counter
00003182                                  ; *************************************
00003182 204F                             move.l sp, a0                                                            ; String to a0
00003184 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000318A 223C 0000 1C0E                   move.l #0x1C0E, d1                                                       ; Position to d1
00003190 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003192 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00003196                            

00003196                                  ; *************************************
00003196                                  ; convert the top streak counter to int
00003196                                  ; *************************************
00003196 204F                             move.l sp, a0                                                            ; String to a0
00003198 3039 0000 0000                   move.w (top_streak), d0                                                  ; Integer to d0
0000319E 4EB8 1024                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
000031A2                            

000031A2                                  ; *************************************
000031A2                                  ; draw the top streak counter
000031A2                                  ; *************************************
000031A2 204F                             move.l sp, a0                                                            ; String to a0
000031A4 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000031AA 223C 0000 1C11                   move.l #0x1C11, d1                                                       ; Position to d1
000031B0 7400                             moveq #0x0, d2                                                           ; Palette to d2
000031B2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000031B6                            

000031B6                                  ; *************************************
000031B6                                  ; convert the completion counter to int
000031B6                                  ; *************************************
000031B6 204F                              move.l sp, a0                                                            ; String to a0
000031B8 3039 0000 0000                    move.w (completion), d0                                                  ; Integer to d0
000031BE 4EB8 1024                         jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
000031C2                            

000031C2                                  ; *************************************
000031C2                                  ; draw the completion counter
000031C2                                  ; *************************************
000031C2 204F                             move.l sp, a0                                                            ; String to a0
000031C4 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000031CA 223C 0000 1C14                   move.l #0x1C14, d1                                                       ; Position to d1
000031D0 7400                             moveq #0x0, d2                                                           ; Palette to d2
000031D2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000031D6                            

000031D6 4FEF 0008                        lea $8(sp), sp                                                           ; free allocated temporary buffer
000031DA                            

000031DA                                  ; end of vblank
000031DA 4EB8 0D20                        jsr WaitVBlankEnd
000031DE                            

000031DE 7001                             moveq #0x1, d0
000031E0 4EB8 0D2E                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
000031E4                            

000031E4 33FC 0000 0000 0000              move.w  #game_state_stats_screen, game_state                             ; store the game state
000031EC 4E75                             rts
000031EC 4E75                             rts
000031EE                                  include 'assets\states\stats\main.asm'
000031EE                            StatsScreen:
000031EE 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
000031F4 0800 0000                        btst #pad_button_start, d0                                               ; Check start button
000031F8 67F4                             beq.s StatsScreen                                                        ; if not then continue to show the player's stats
000031FA 33FC 0000 0000 0000              move.w #game_state_stats_screen_shutdown, game_state                     ; store the game state
00003202 7001                             moveq #0x1, d0
00003204 4EF8 0D2E                        jmp WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00003208 4E75                             rts
00003208 4E75                             rts
0000320A                                  include 'assets\states\stats\shutdown.asm'
0000320A                            StatsScreen_Shutdown:
0000320A                                  ; ************************************
0000320A                                  ;  Clear The Statistics String
0000320A                                  ; ************************************
0000320A 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003210 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003216 323C 0F05                        move.w #0x0F05, d1                                                       ; XY (15, 5)
0000321A 7400                             moveq #0x0, d2                                                           ; Palette 0
0000321C 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003220                            

00003220                                  ; ************************************
00003220                                  ;  Clear The Hits String
00003220                                  ; ************************************
00003220 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003226 323C 0607                        move.w #0x0607, d1                                                       ; XY (6, 7)
0000322A 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000322E                            

0000322E                                  ; *************************************
0000322E                                  ; Clear the hits counter
0000322E                                  ; *************************************
0000322E 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00003234 223C 0000 1C07                   move.l #0x1C07, d1                                                       ; Position to d1
0000323A 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000323E                            

0000323E                                  ; ************************************
0000323E                                  ;  Clear The Misses String
0000323E                                  ; ************************************
0000323E 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003244 323C 0609                        move.w #0x0609, d1                                                       ; XY (6, 9)
00003248 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000324C                            

0000324C                                  ; *************************************
0000324C                                  ; Clear the misses counter
0000324C                                  ; *************************************
0000324C 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00003252 223C 0000 1C09                   move.l #0x1C09, d1                                                       ; Position to d1
00003258 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000325C                            

0000325C                                  ; ************************************
0000325C                                  ;  Clear The Errors String
0000325C                                  ; ************************************
0000325C 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003262 323C 060B                        move.w #0x060B, d1                                                       ; XY (6, 11)
00003266 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000326A                            

0000326A                                  ; *************************************
0000326A                                  ; Clear the errors counter
0000326A                                  ; *************************************
0000326A 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00003270 223C 0000 1C0B                   move.l #0x1C0B, d1                                                       ; Position to d1
00003276 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000327A                            

0000327A                                  ; ************************************
0000327A                                  ;  Clear The Score String
0000327A                                  ; ************************************
0000327A 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003280 323C 060E                        move.w #0x060E, d1                                                       ; XY (6, 14)
00003284 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003288                            

00003288                                  ; *************************************
00003288                                  ; Clear the errors counter
00003288                                  ; *************************************
00003288 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
0000328E 223C 0000 1C0E                   move.l #0x1C0E, d1                                                       ; Position to d1
00003294 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
00003298                            

00003298                                  ; ************************************
00003298                                  ;  Clear The Top Streak String
00003298                                  ; ************************************
00003298 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
0000329E 323C 0611                        move.w #0x0611, d1                                                       ; XY (6, 17)
000032A2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000032A6                            

000032A6                                  ; *************************************
000032A6                                  ; Clear the top streak counter
000032A6                                  ; *************************************
000032A6 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
000032AC 223C 0000 1C11                   move.l #0x1C11, d1                                                       ; Position to d1
000032B2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000032B6                            

000032B6                                  ; ************************************
000032B6                                  ;  Draw The Completion String
000032B6                                  ; ************************************
000032B6 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
000032BC 323C 0614                        move.w #0x0614, d1                                                       ; XY (6, 20)
000032C0 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000032C4                            

000032C4                                  ; *************************************
000032C4                                  ; Clear the completion counter
000032C4                                  ; *************************************
000032C4 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
000032CA 223C 0000 1C14                   move.l #0x1C14, d1                                                       ; Position to d1
000032D0 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000032D4 33FC 0000 0000 0000              move.w #game_state_title_screen_initalize, game_state                    ; store the game state
000032DC 4E75                             rts
000032DC 4E75                             rts
000032DE                                  include 'assets\states\crashand\init.asm'
000032DE                            CrashHandler_Init:
000032DE 23CF 0000 0000                   move.l sp, (backup_sp)                                                   ; save sp state
000032E4 23C8 0000 0000                   move.l a0, (register_backup_a0)                                          ; save a0 register state
000032EA 23C9 0000 0000                   move.l a1, (register_backup_a1)                                          ; save a1 register state
000032F0 23CA 0000 0000                   move.l a2, (register_backup_a2)                                          ; save a2 register state
000032F6 23CB 0000 0000                   move.l a3, (register_backup_a3)                                          ; save a3 register state
000032FC 23CC 0000 0000                   move.l a4, (register_backup_a4)                                          ; save a4 register state
00003302 23CD 0000 0000                   move.l a5, (register_backup_a5)                                          ; save a5 register state
00003308 23CE 0000 0000                   move.l a6, (register_backup_a6)                                          ; save a6 register state
0000330E 23C0 0000 0000                   move.l d0, (register_backup_d0)                                          ; save d0 register state
00003314 23C1 0000 0000                   move.l d1, (register_backup_d1)                                          ; save d1 register state
0000331A 23C2 0000 0000                   move.l d2, (register_backup_d2)                                          ; save d2 register state
00003320 23C3 0000 0000                   move.l d3, (register_backup_d3)                                          ; save d3 register state
00003326 23C4 0000 0000                   move.l d4, (register_backup_d4)                                          ; save d4 register state
0000332C 23C5 0000 0000                   move.l d5, (register_backup_d5)                                          ; save d5 register state
00003332 23C6 0000 0000                   move.l d6, (register_backup_d6)                                          ; save d6 register state
00003338 23C7 0000 0000                   move.l d7, (register_backup_d7)                                          ; save d7 register state
0000333E                            

0000333E 7001                             moveq #0x1, d0
00003340 4EB8 0D2E                        jsr WaitFrames ; Wait a frame, to collect new joypad presses
00003344                            

00003344                                  ; ************************************
00003344                                  ; Load blank map
00003344                                  ; ************************************
00003344 41F9 0000 0000                   lea BlankMap, a0                                                         ; Map data in a0
0000334A 303C 0000                        move.w #BlankMapSizeW, d0                                                ; Size (words) in d0
0000334E 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00003350 343C 0000                        move.w #CrashHandlerTilesTileID, d2                                      ; First tile ID in d2
00003354 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00003356 4EB8 0EEC                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
0000335A                            

0000335A                                  ; ************************************
0000335A                                  ;  Draw The Error String
0000335A                                  ; ************************************
0000335A 41F9 0000 0000                   lea ZeroDivideString, a0                                                 ; String address
00003360 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003366 323C 0C04                        move.w #0x0C04, d1                                                       ; XY (7, 8)
0000336A 7400                             moveq #0x0, d2                                                           ; Palette 0
0000336C 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003370                            

00003370                                  ; ************************************
00003370                                  ;  Draw The a0 register String
00003370                                  ; ************************************
00003370 41F9 0000 0000                   lea RegisterA0String, a0                                                 ; String address
00003376 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
0000337C 323C 0508                        move.w #0x0508, d1                                                       ; XY (7, 8)
00003380 7400                             moveq #0x0, d2                                                           ; Palette 0
00003382 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003386                            

00003386                                  ; ************************************
00003386                                  ;  Draw The a1 register String
00003386                                  ; ************************************
00003386 41F9 0000 0000                   lea RegisterA1String, a0                                                 ; String address
0000338C 323C 050A                        move.w #0x050A, d1                                                       ; XY (7, 10)
00003390 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003394                            

00003394                                  ; ************************************
00003394                                  ;  Draw The a2 register String
00003394                                  ; ************************************
00003394 41F9 0000 0000                   lea RegisterA2String, a0                                                 ; String address
0000339A 323C 050C                        move.w #0x050C, d1                                                       ; XY (7, 12)
0000339E 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033A2                            

000033A2                                  ; ************************************
000033A2                                  ;  Draw The a3 register String
000033A2                                  ; ************************************
000033A2 41F9 0000 0000                   lea RegisterA3String, a0                                                 ; String address
000033A8 323C 050E                        move.w #0x050E, d1                                                       ; XY (7, 14)
000033AC 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033B0                            

000033B0                                  ; ************************************
000033B0                                  ;  Draw The a4 register String
000033B0                                  ; ************************************
000033B0 41F9 0000 0000                   lea RegisterA4String, a0                                                 ; String address
000033B6 323C 0510                        move.w #0x0510, d1                                                       ; XY (7, 16)
000033BA 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033BE                            

000033BE                                  ; ************************************
000033BE                                  ;  Draw The a5 register String
000033BE                                  ; ************************************
000033BE 41F9 0000 0000                   lea RegisterA5String, a0                                                 ; String address
000033C4 323C 0512                        move.w #0x0512, d1                                                       ; XY (7, 18)
000033C8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033CC                            

000033CC                                  ; ************************************
000033CC                                  ;  Draw The a6 register String
000033CC                                  ; ************************************
000033CC 41F9 0000 0000                   lea RegisterA6String, a0                                                 ; String address
000033D2 323C 0514                        move.w #0x0514, d1                                                       ; XY (7, 20)
000033D6 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033DA                            

000033DA                                  ; ************************************
000033DA                                  ;  Draw The sp register String
000033DA                                  ; ************************************
000033DA 41F9 0000 0000                   lea StackPointerString, a0                                               ; String address
000033E0 323C 0518                        move.w #0x0518, d1                                                       ; XY (7, 20)
000033E4 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033E8                            

000033E8                                  ; ************************************
000033E8                                  ;  Draw The d0 register String
000033E8                                  ; ************************************
000033E8 41F9 0000 0000                   lea RegisterD0String, a0                                                 ; String address
000033EE 323C 1508                        move.w #0x1508, d1                                                       ; XY (20, 8)
000033F2 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033F6                            

000033F6                                  ; ************************************
000033F6                                  ;  Draw The d1 register String
000033F6                                  ; ************************************
000033F6 41F9 0000 0000                   lea RegisterD1String, a0                                                 ; String address
000033FC 323C 150A                        move.w #0x150A, d1                                                       ; XY (20, 10)
00003400 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003404                            

00003404                                  ; ************************************
00003404                                  ;  Draw The d2 register String
00003404                                  ; ************************************
00003404 41F9 0000 0000                   lea RegisterD2String, a0                                                 ; String address
0000340A 323C 150C                        move.w #0x150C, d1                                                       ; XY (20, 12)
0000340E 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003412                            

00003412                                  ; ************************************
00003412                                  ;  Draw The d3 register String
00003412                                  ; ************************************
00003412 41F9 0000 0000                   lea RegisterD3String, a0                                                 ; String address
00003418 323C 150E                        move.w #0x150E, d1                                                       ; XY (20, 14)
0000341C 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003420                            

00003420                                  ; ************************************
00003420                                  ;  Draw The d4 register String
00003420                                  ; ************************************
00003420 41F9 0000 0000                   lea RegisterD4String, a0                                                 ; String address
00003426 323C 1510                        move.w #0x1510, d1                                                       ; XY (20, 16)
0000342A 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
=======
00002F40 4EB8 1304                        jsr Echo_PauseBGM                                                        ; pause the music
00002F44 4E75                             rts
00002F44 4E75                             rts
00002F46                                  include 'assets\states\pause\main.asm'
00002F46                            Pause:
00002F46 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
00002F4C 0800 007C                        btst #pad_button_start, d0                                               ; Check start button
00002F50 67F4                             beq.s Pause                                                              ; if not then continue paused, otherwise clear the pause string...
00002F52 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002F58 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002F5E 323C 0810                        move.w #0x0810, d1                                                       ; XY (08, 16)
00002F62 7400                             moveq #0x0, d2                                                           ; Palette 0
00002F64 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002F68 33FC 0000 0000 0000              move.w #game_state_game_mode_pause_shutdown, game_state                  ; store the game state
00002F70                                  ; Since we skip game_state 0x2, we need to gather new inputs here instead
00002F70 7001                             moveq #0x1, d0
00002F72 4EF8 0D22                        jmp WaitFrames                                                           ; Wait a frame, to collect new joypad presses
00002F76 4E75                             rts
00002F76 4E75                             rts
00002F78                                  include 'assets\states\pause\shutdown.asm'
00002F78                            Pause_Shutdown:
00002F78 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00002F7E 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00002F84 323C 0810                        move.w #0x0810, d1                                                       ; XY (08, 16)
00002F88 7400                             moveq #0x0, d2                                                           ; Palette 0
00002F8A 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00002F8E 33FC 0000 0000 0000              move.w #game_state_game_mode, game_state                                 ; store the game state
00002F96                                  ; ************************************
00002F96                                  ; Resume Music
00002F96                                  ; ************************************
00002F96 4EB8 1312                        jsr Echo_ResumeBGM                                                       ; resume the music
00002F9A 4E75                             rts
00002F9A 4E75                             rts
00002F9C                                  include 'assets\states\stats\init.asm'
00002F9C                            StatsScreen_Init:
00002F9C                                  ; ************************************
00002F9C                                  ; Temporary Placeholders
00002F9C                                  ; ************************************
00002F9C 303C 002A                        move.w #42, d0
00002FA0 4EB8 1060                        jsr ItoBCD_Int_w
00002FA4 33C2 0000 0000                   move.w d2, (hits)
00002FAA 33FC 0000 0000 0000              move.w #0, (misses)
00002FB2 33FC 0000 0000 0000              move.w #0, (errors)
00002FBA 303C 008A                        move.w #138, d0
00002FBE 4EB8 1060                        jsr ItoBCD_Int_w
00002FC2 33C2 0000 0000                   move.w d2, (score)
00002FC8 303C 002A                        move.w #42, d0
00002FCC 4EB8 1060                        jsr ItoBCD_Int_w
00002FD0 33C2 0000 0000                   move.w d2, (top_streak)
00002FD6 303C 0064                        move.w #100, d0
00002FDA 4EB8 1060                        jsr ItoBCD_Int_w
00002FDE 33C2 0000 0000                   move.w d2, (Completion)
00002FE4                            

00002FE4                                  ; start of vblank
00002FE4 4EB8 0D06                        jsr WaitVBlankStart
00002FE8                            

00002FE8                                  ; ************************************
00002FE8                                  ; Set The Sprites  Position Offscreen
00002FE8                                  ; ************************************
00002FE8                                  ; Set green note's position
00002FE8 343C 0000                        move.w #GreenNoteDimensions, d2                                          ; green fret's dimensions
00002FEC 7608                             moveq #0x8, d3                                                           ; green fret's width in pixels
00002FEE 7800                             moveq #0x0, d4                                                           ; green fret's x flipped
00002FF0 43F9 0000 0000                   lea GreenNoteSubSpriteDimensions, a1                                     ; green fret's subsprite 
00002FF6                            

00002FF6 303C 0000                        move.w #greennote_id, d0                                                 ; green's sprite id
00002FFA 3239 0000 0000                   move.w (greennote_position_x), d1                                        ; green's x position
00003000 4EB8 09F4                        jsr SetSpritePosX                                                        ; Set green note's x position
00003004                            

00003004 303C 0000                        move.w #rednote_id, d0                                                   ; red note's sprite id
00003008 3239 0000 0000                   move.w (rednote_position_x), d1                                          ; red note's x position
0000300E 4EB8 09F4                        jsr SetSpritePosX                                                        ; Set red note's x position
00003012                            

00003012 303C 0000                        move.w #rockindicator_id, d0                                             ; rock indicator's sprite id
00003016 3239 0000 0000                   move.w (rockindicator_position_x), d1                                    ; rock indicator's x position
0000301C 4EB8 09F4                        jsr SetSpritePosX                                                        ; Set rock indicator's y position
00003020                            

00003020                                  ; ************************************
00003020                                  ; Load stats screen map
00003020                                  ; ************************************
00003020 41F9 0000 0000                   lea StatsScreenMap, a0                                                   ; Map data in a0
00003026 303C 0000                        move.w #TitleScreenMapSizeW, d0                                          ; Size (words) in d0
0000302A 7200                             moveq #0x0, d1                                                           ; Y offset in d1
0000302C 343C 0000                        move.w #StatsScreenTilesTileID, d2                                       ; First tile ID in d2
00003030 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00003032 4EB8 0EE0                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
00003036                            

00003036                                  ; ************************************
00003036                                  ;  Draw The Statistics String
00003036                                  ; ************************************
00003036 41F9 0000 0000                   lea StatisticsString, a0                                                 ; String address
0000303C 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003042 323C 0F05                        move.w #0x0F05, d1                                                       ; XY (15, 5)
00003046 7400                             moveq #0x0, d2                                                           ; Palette 0
00003048 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000304C                            

0000304C                                  ; ************************************
0000304C                                  ;  Draw The Hits String
0000304C                                  ; ************************************
0000304C 41F9 0000 0000                   lea HitsString, a0                                                      ; String address
00003052 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003058 323C 0607                        move.w #0x0607, d1                                                       ; XY (6, 7)
0000305C 7400                             moveq #0x0, d2                                                           ; Palette 0
0000305E 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003062                            

00003062                                  ; ************************************
00003062                                  ;  Draw The Misses String
00003062                                  ; ************************************
00003062 41F9 0000 0000                   lea MissesString, a0                                                      ; String address
00003068 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
0000306E 323C 0609                        move.w #0x0609, d1                                                       ; XY (6, 9)
00003072 7400                             moveq #0x0, d2                                                           ; Palette 0
00003074 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003078                            

00003078                                  ; ************************************
00003078                                  ;  Draw The Errors String
00003078                                  ; ************************************
00003078 41F9 0000 0000                   lea ErrorsString, a0                                                     ; String address
0000307E 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003084 323C 060B                        move.w #0x060B, d1                                                       ; XY (6, 11)
00003088 7400                             moveq #0x0, d2                                                           ; Palette 0
0000308A 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000308E                            

0000308E                                  ; ************************************
0000308E                                  ;  Draw The Score String
0000308E                                  ; ************************************
0000308E 41F9 0000 0000                   lea ScoreString, a0                                                      ; String address
00003094 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
0000309A 323C 060E                        move.w #0x060E, d1                                                       ; XY (6, 14)
0000309E 7400                             moveq #0x0, d2                                                           ; Palette 0
000030A0 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030A4                            

000030A4                                  ; ************************************
000030A4                                  ;  Draw The Top Streak String
000030A4                                  ; ************************************
000030A4 41F9 0000 0000                   lea TopStreakString, a0                                                  ; String address
000030AA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000030B0 323C 0611                        move.w #0x0611, d1                                                       ; XY (6, 17)
000030B4 7400                             moveq #0x0, d2                                                           ; Palette 0
000030B6 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030BA                            

000030BA                                  ; ************************************
000030BA                                  ;  Draw The Completion String
000030BA                                  ; ************************************
000030BA 41F9 0000 0000                   lea CompletionString, a0                                                 ; String address
000030C0 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000030C6 323C 0614                        move.w #0x0614, d1                                                       ; XY (6, 20)
000030CA 7400                             moveq #0x0, d2                                                           ; Palette 0
000030CC 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000030D0 7001                             moveq #0x1, d0
000030D2                            

000030D2                                  ; ************************************
000030D2                                  ; start of stack allocation
000030D2                                  ; ************************************
000030D2 4FEF FFF8                        lea -$8(sp), sp                                                          ; load effective address of stack pointer
000030D6 204F                             move.l sp, a0                                                            ; allocate temporary buffer on stack
000030D8                            

000030D8                                  ; *************************************
000030D8                                  ; convert the hits counter to int
000030D8                                  ; *************************************
000030D8 204F                             move.l sp, a0                                                            ; String to a0
000030DA 3039 0000 0000                   move.w (hits), d0                                                        ; Integer to d0
000030E0 4EB8 1018                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
000030E4                            

000030E4                                  ; *************************************
000030E4                                  ; draw the hits counter
000030E4                                  ; *************************************
000030E4 204F                             move.l sp, a0                                                            ; String to a0
000030E6 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000030EC 223C 0000 1C07                   move.l #0x1C07, d1                                                       ; Position to d1
000030F2 7400                             moveq #0x0, d2                                                           ; Palette to d2
000030F4 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
000030F8                            

000030F8                                  ; *************************************
000030F8                                  ; convert the misses counter to int
000030F8                                  ; *************************************
000030F8 204F                             move.l sp, a0                                                            ; String to a0
000030FA 3039 0000 0000                   move.w (misses), d0                                                      ; Integer to d0
00003100 4EB8 1018                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003104                            

00003104                                  ; *************************************
00003104                                  ; draw the misses counter
00003104                                  ; *************************************
00003104 204F                             move.l sp, a0                                                            ; String to a0
00003106 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000310C 223C 0000 1C09                   move.l #0x1C09, d1                                                       ; Position to d1
00003112 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003114 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003118                            

00003118                                  ; *************************************
00003118                                  ; convert the errors counter to int
00003118                                  ; *************************************
00003118 204F                             move.l sp, a0                                                            ; String to a0
0000311A 3039 0000 0000                   move.w (errors), d0                                                      ; Integer to d0
00003120 4EB8 1018                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003124                            

00003124                                  ; *************************************
00003124                                  ; draw the errors counter
00003124                                  ; *************************************
00003124 204F                             move.l sp, a0                                                            ; String to a0
00003126 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000312C 223C 0000 1C0B                   move.l #0x1C0B, d1                                                       ; Position to d1
00003132 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003134 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003138                            

00003138                                  ; *************************************
00003138                                  ; convert the score counter to int
00003138                                  ; *************************************
00003138 204F                             move.l sp, a0                                                            ; String to a0
0000313A 3039 0000 0000                   move.w (score), d0                                                       ; Integer to d0
00003140 4EB8 1018                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003144                            

00003144                                  ; *************************************
00003144                                  ; draw the errors counter
00003144                                  ; *************************************
00003144 204F                             move.l sp, a0                                                            ; String to a0
00003146 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000314C 223C 0000 1C0E                   move.l #0x1C0E, d1                                                       ; Position to d1
00003152 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003154 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003158                            

00003158                                  ; *************************************
00003158                                  ; convert the top streak counter to int
00003158                                  ; *************************************
00003158 204F                             move.l sp, a0                                                            ; String to a0
0000315A 3039 0000 0000                   move.w (top_streak), d0                                                  ; Integer to d0
00003160 4EB8 1018                        jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003164                            

00003164                                  ; *************************************
00003164                                  ; draw the top streak counter
00003164                                  ; *************************************
00003164 204F                             move.l sp, a0                                                            ; String to a0
00003166 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000316C 223C 0000 1C11                   move.l #0x1C11, d1                                                       ; Position to d1
00003172 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003174 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003178                            

00003178                                  ; *************************************
00003178                                  ; convert the completion counter to int
00003178                                  ; *************************************
00003178 204F                              move.l sp, a0                                                            ; String to a0
0000317A 3039 0000 0000                    move.w (completion), d0                                                  ; Integer to d0
00003180 4EB8 1018                         jsr    ItoA_Int_w                                                        ; Integer to ASCII (word)
00003184                            

00003184                                  ; *************************************
00003184                                  ; draw the completion counter
00003184                                  ; *************************************
00003184 204F                             move.l sp, a0                                                            ; String to a0
00003186 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
0000318C 223C 0000 1C14                   move.l #0x1C14, d1                                                       ; Position to d1
00003192 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003194 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003198                            

00003198 4FEF 0008                        lea $8(sp), sp                                                           ; free allocated temporary buffer
0000319C                            

0000319C                                  ; end of vblank
0000319C 4EB8 0D14                        jsr WaitVBlankEnd
000031A0                            

000031A0 7001                             moveq #0x1, d0
000031A2 4EB8 0D22                        jsr WaitFrames                                                           ; Wait a frame, to collect new joypad presses
000031A6                            

000031A6 33FC 0000 0000 0000              move.w  #game_state_stats_screen, game_state                             ; store the game state
000031AE 4E75                             rts
000031AE 4E75                             rts
000031B0                                  include 'assets\states\stats\main.asm'
000031B0                            StatsScreen:
000031B0 3039 0000 0000                   move.w joypadA_press, d0                                                 ; Read pad 1 state, result in d0
000031B6 0800 007C                        btst #pad_button_start, d0                                               ; Check start button
000031BA 67F4                             beq.s StatsScreen                                                        ; if not then continue to show the player's stats
000031BC 33FC 0000 0000 0000              move.w #game_state_stats_screen_shutdown, game_state                     ; store the game state
000031C4 7001                             moveq #0x1, d0
000031C6 4EF8 0D22                        jmp WaitFrames                                                           ; Wait a frame, to collect new joypad presses
000031CA 4E75                             rts
000031CA 4E75                             rts
000031CC                                  include 'assets\states\stats\shutdown.asm'
000031CC                            StatsScreen_Shutdown:
000031CC                                  ; ************************************
000031CC                                  ;  Clear The Statistics String
000031CC                                  ; ************************************
000031CC 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
000031D2 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
000031D8 323C 0F05                        move.w #0x0F05, d1                                                       ; XY (15, 5)
000031DC 7400                             moveq #0x0, d2                                                           ; Palette 0
000031DE 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000031E2                            

000031E2                                  ; ************************************
000031E2                                  ;  Clear The Hits String
000031E2                                  ; ************************************
000031E2 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
000031E8 323C 0607                        move.w #0x0607, d1                                                       ; XY (6, 7)
000031EC 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000031F0                            

000031F0                                  ; *************************************
000031F0                                  ; Clear the hits counter
000031F0                                  ; *************************************
000031F0 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
000031F6 223C 0000 1C07                   move.l #0x1C07, d1                                                       ; Position to d1
000031FC 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003200                            

00003200                                  ; ************************************
00003200                                  ;  Clear The Misses String
00003200                                  ; ************************************
00003200 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003206 323C 0609                        move.w #0x0609, d1                                                       ; XY (6, 9)
0000320A 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000320E                            

0000320E                                  ; *************************************
0000320E                                  ; Clear the misses counter
0000320E                                  ; *************************************
0000320E 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00003214 223C 0000 1C09                   move.l #0x1C09, d1                                                       ; Position to d1
0000321A 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
0000321E                            

0000321E                                  ; ************************************
0000321E                                  ;  Clear The Errors String
0000321E                                  ; ************************************
0000321E 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003224 323C 060B                        move.w #0x060B, d1                                                       ; XY (6, 11)
00003228 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000322C                            

0000322C                                  ; *************************************
0000322C                                  ; Clear the errors counter
0000322C                                  ; *************************************
0000322C 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00003232 223C 0000 1C0B                   move.l #0x1C0B, d1                                                       ; Position to d1
00003238 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
0000323C                            

0000323C                                  ; ************************************
0000323C                                  ;  Clear The Score String
0000323C                                  ; ************************************
0000323C 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003242 323C 060E                        move.w #0x060E, d1                                                       ; XY (6, 14)
00003246 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000324A                            

0000324A                                  ; *************************************
0000324A                                  ; Clear the errors counter
0000324A                                  ; *************************************
0000324A 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
00003250 223C 0000 1C0E                   move.l #0x1C0E, d1                                                       ; Position to d1
00003256 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
0000325A                            

0000325A                                  ; ************************************
0000325A                                  ;  Clear The Top Streak String
0000325A                                  ; ************************************
0000325A 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
00003260 323C 0611                        move.w #0x0611, d1                                                       ; XY (6, 17)
00003264 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003268                            

00003268                                  ; *************************************
00003268                                  ; Clear the top streak counter
00003268                                  ; *************************************
00003268 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
0000326E 223C 0000 1C11                   move.l #0x1C11, d1                                                       ; Position to d1
00003274 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003278                            

00003278                                  ; ************************************
00003278                                  ;  Draw The Completion String
00003278                                  ; ************************************
00003278 41F9 0000 0000                   lea BlankString, a0                                                      ; String address
0000327E 323C 0614                        move.w #0x0614, d1                                                       ; XY (6, 20)
00003282 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003286                            

00003286                                  ; *************************************
00003286                                  ; Clear the completion counter
00003286                                  ; *************************************
00003286 41F9 0000 0000                   lea BlankString, a0                                                      ; String to a0
0000328C 223C 0000 1C14                   move.l #0x1C14, d1                                                       ; Position to d1
00003292 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Draw text
00003296 33FC 0000 0000 0000              move.w #game_state_title_screen_initalize, game_state                    ; store the game state
0000329E 4E75                             rts
0000329E 4E75                             rts
000032A0                                  include 'assets\states\crashand\init.asm'
000032A0                            CrashHandler_Init:
000032A0 23CF 0000 0000                   move.l sp, (backup_sp)                                                   ; save sp state
000032A6 23C8 0000 0000                   move.l a0, (register_backup_a0)                                          ; save a0 register state
000032AC 23C9 0000 0000                   move.l a1, (register_backup_a1)                                          ; save a1 register state
000032B2 23CA 0000 0000                   move.l a2, (register_backup_a2)                                          ; save a2 register state
000032B8 23CB 0000 0000                   move.l a3, (register_backup_a3)                                          ; save a3 register state
000032BE 23CC 0000 0000                   move.l a4, (register_backup_a4)                                          ; save a4 register state
000032C4 23CD 0000 0000                   move.l a5, (register_backup_a5)                                          ; save a5 register state
000032CA 23CE 0000 0000                   move.l a6, (register_backup_a6)                                          ; save a6 register state
000032D0 23C0 0000 0000                   move.l d0, (register_backup_d0)                                          ; save d0 register state
000032D6 23C1 0000 0000                   move.l d1, (register_backup_d1)                                          ; save d1 register state
000032DC 23C2 0000 0000                   move.l d2, (register_backup_d2)                                          ; save d2 register state
000032E2 23C3 0000 0000                   move.l d3, (register_backup_d3)                                          ; save d3 register state
000032E8 23C4 0000 0000                   move.l d4, (register_backup_d4)                                          ; save d4 register state
000032EE 23C5 0000 0000                   move.l d5, (register_backup_d5)                                          ; save d5 register state
000032F4 23C6 0000 0000                   move.l d6, (register_backup_d6)                                          ; save d6 register state
000032FA 23C7 0000 0000                   move.l d7, (register_backup_d7)                                          ; save d7 register state
00003300                            

00003300 7001                             moveq #0x1, d0
00003302 4EB8 0D22                        jsr WaitFrames ; Wait a frame, to collect new joypad presses
00003306                            

00003306                                  ; ************************************
00003306                                  ; Load blank map
00003306                                  ; ************************************
00003306 41F9 0000 0000                   lea BlankMap, a0                                                         ; Map data in a0
0000330C 303C 0000                        move.w #BlankMapSizeW, d0                                                ; Size (words) in d0
00003310 7200                             moveq #0x0, d1                                                           ; Y offset in d1
00003312 343C 0000                        move.w #CrashHandlerTilesTileID, d2                                      ; First tile ID in d2
00003316 7600                             moveq #0x0, d3                                                           ; Palette ID in d3
00003318 4EB8 0EE0                        jsr LoadMapPlaneB                                                        ; Jump to subroutine
0000331C                            

0000331C                                  ; ************************************
0000331C                                  ;  Draw The Error String
0000331C                                  ; ************************************
0000331C 41F9 0000 0000                   lea ZeroDivideString, a0                                                 ; String address
00003322 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
00003328 323C 0C04                        move.w #0x0C04, d1                                                       ; XY (7, 8)
0000332C 7400                             moveq #0x0, d2                                                           ; Palette 0
0000332E 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003332                            

00003332                                  ; ************************************
00003332                                  ;  Draw The a0 register String
00003332                                  ; ************************************
00003332 41F9 0000 0000                   lea RegisterA0String, a0                                                 ; String address
00003338 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; First tile id
0000333E 323C 0508                        move.w #0x0508, d1                                                       ; XY (7, 8)
00003342 7400                             moveq #0x0, d2                                                           ; Palette 0
00003344 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003348                            

00003348                                  ; ************************************
00003348                                  ;  Draw The a1 register String
00003348                                  ; ************************************
00003348 41F9 0000 0000                   lea RegisterA1String, a0                                                 ; String address
0000334E 323C 050A                        move.w #0x050A, d1                                                       ; XY (7, 10)
00003352 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003356                            

00003356                                  ; ************************************
00003356                                  ;  Draw The a2 register String
00003356                                  ; ************************************
00003356 41F9 0000 0000                   lea RegisterA2String, a0                                                 ; String address
0000335C 323C 050C                        move.w #0x050C, d1                                                       ; XY (7, 12)
00003360 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003364                            

00003364                                  ; ************************************
00003364                                  ;  Draw The a3 register String
00003364                                  ; ************************************
00003364 41F9 0000 0000                   lea RegisterA3String, a0                                                 ; String address
0000336A 323C 050E                        move.w #0x050E, d1                                                       ; XY (7, 14)
0000336E 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003372                            

00003372                                  ; ************************************
00003372                                  ;  Draw The a4 register String
00003372                                  ; ************************************
00003372 41F9 0000 0000                   lea RegisterA4String, a0                                                 ; String address
00003378 323C 0510                        move.w #0x0510, d1                                                       ; XY (7, 16)
0000337C 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003380                            

00003380                                  ; ************************************
00003380                                  ;  Draw The a5 register String
00003380                                  ; ************************************
00003380 41F9 0000 0000                   lea RegisterA5String, a0                                                 ; String address
00003386 323C 0512                        move.w #0x0512, d1                                                       ; XY (7, 18)
0000338A 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000338E                            

0000338E                                  ; ************************************
0000338E                                  ;  Draw The a6 register String
0000338E                                  ; ************************************
0000338E 41F9 0000 0000                   lea RegisterA6String, a0                                                 ; String address
00003394 323C 0514                        move.w #0x0514, d1                                                       ; XY (7, 20)
00003398 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000339C                            

0000339C                                  ; ************************************
0000339C                                  ;  Draw The sp register String
0000339C                                  ; ************************************
0000339C 41F9 0000 0000                   lea StackPointerString, a0                                               ; String address
000033A2 323C 0518                        move.w #0x0518, d1                                                       ; XY (7, 20)
000033A6 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033AA                            

000033AA                                  ; ************************************
000033AA                                  ;  Draw The d0 register String
000033AA                                  ; ************************************
000033AA 41F9 0000 0000                   lea RegisterD0String, a0                                                 ; String address
000033B0 323C 1508                        move.w #0x1508, d1                                                       ; XY (20, 8)
000033B4 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033B8                            

000033B8                                  ; ************************************
000033B8                                  ;  Draw The d1 register String
000033B8                                  ; ************************************
000033B8 41F9 0000 0000                   lea RegisterD1String, a0                                                 ; String address
000033BE 323C 150A                        move.w #0x150A, d1                                                       ; XY (20, 10)
000033C2 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033C6                            

000033C6                                  ; ************************************
000033C6                                  ;  Draw The d2 register String
000033C6                                  ; ************************************
000033C6 41F9 0000 0000                   lea RegisterD2String, a0                                                 ; String address
000033CC 323C 150C                        move.w #0x150C, d1                                                       ; XY (20, 12)
000033D0 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033D4                            

000033D4                                  ; ************************************
000033D4                                  ;  Draw The d3 register String
000033D4                                  ; ************************************
000033D4 41F9 0000 0000                   lea RegisterD3String, a0                                                 ; String address
000033DA 323C 150E                        move.w #0x150E, d1                                                       ; XY (20, 14)
000033DE 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033E2                            

000033E2                                  ; ************************************
000033E2                                  ;  Draw The d4 register String
000033E2                                  ; ************************************
000033E2 41F9 0000 0000                   lea RegisterD4String, a0                                                 ; String address
000033E8 323C 1510                        move.w #0x1510, d1                                                       ; XY (20, 16)
000033EC 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033F0                            

000033F0                                  ; ************************************
000033F0                                  ;  Draw The d5 register String
000033F0                                  ; ************************************
000033F0 41F9 0000 0000                   lea RegisterD5String, a0                                                 ; String address
000033F6 323C 1512                        move.w #0x1512, d1                                                       ; XY (20, 18)
000033FA 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
000033FE                            

000033FE                                  ; ************************************
000033FE                                  ;  Draw The d6 register String
000033FE                                  ; ************************************
000033FE 41F9 0000 0000                   lea RegisterD6String, a0                                                 ; String address
00003404 323C 1514                        move.w #0x1514, d1                                                       ; XY (20, 16)
00003408 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000340C                            

0000340C                                  ; ************************************
0000340C                                  ;  Draw The d7 register String
0000340C                                  ; ************************************
0000340C 41F9 0000 0000                   lea RegisterD7String, a0                                                 ; String address
00003412 323C 1516                        move.w #0x1516, d1                                                       ; XY (20, 18)
00003416 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000341A                            

0000341A                                  ; ************************************
0000341A                                  ;  Draw The pc register String
0000341A                                  ; ************************************
0000341A 41F9 0000 0000                   lea ProgramCounterString, a0                                             ; String address
00003420 323C 1518                        move.w #0x1518, d1                                                       ; XY (7, 20)
00003424 4EB8 0CBC                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003428                            

00003428 4FEF FFFC                        lea -$4(sp), sp                                                          ; load effective address of stack pointer
0000342C 204F                             move.l sp, a0                                                            ; allocate temporary buffer on stack
>>>>>>> IncorrectButtonMappingsInGame
0000342E                            

0000342E                                  ; ************************************
0000342E                                  ;  Draw The d5 register String
0000342E                                  ; ************************************
0000342E 41F9 0000 0000                   lea RegisterD5String, a0                                                 ; String address
00003434 323C 1512                        move.w #0x1512, d1                                                       ; XY (20, 18)
00003438 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000343C                            

0000343C                                  ; ************************************
0000343C                                  ;  Draw The d6 register String
0000343C                                  ; ************************************
0000343C 41F9 0000 0000                   lea RegisterD6String, a0                                                 ; String address
00003442 323C 1514                        move.w #0x1514, d1                                                       ; XY (20, 16)
00003446 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
0000344A                            

0000344A                                  ; ************************************
0000344A                                  ;  Draw The d7 register String
0000344A                                  ; ************************************
0000344A 41F9 0000 0000                   lea RegisterD7String, a0                                                 ; String address
00003450 323C 1516                        move.w #0x1516, d1                                                       ; XY (20, 18)
00003454 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003458                            

00003458                                  ; ************************************
00003458                                  ;  Draw The pc register String
00003458                                  ; ************************************
00003458 41F9 0000 0000                   lea ProgramCounterString, a0                                             ; String address
0000345E 323C 1518                        move.w #0x1518, d1                                                       ; XY (7, 20)
00003462 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Call draw text subroutine
00003466                            

00003466 4FEF FFFC                        lea -$4(sp), sp                                                          ; load effective address of stack pointer
0000346A 204F                             move.l sp, a0                                                            ; allocate temporary buffer on stack
0000346C                            

0000346C                                  ; draw the a0 counter
0000346C 204F                             move.l sp, a0                                                            ; String to a0
0000346E 3039 0000 0000                   move.w (register_backup_a0), d0                                          ; Integer to d0
00003474 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003478                            

00003478 204F                             move.l sp, a0                                                            ; String to a0
0000347A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003480 223C 0000 0908                   move.l #0x0908, d1                                                       ; Position to d1
00003486 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003488 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000348C                            

0000348C                                  ; draw the a1 counter
0000348C 204F                             move.l sp, a0                                                            ; String to a0
0000348E 3039 0000 0000                   move.w (register_backup_a1), d0                                          ; Integer to d0
00003494 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003498                            

00003498 204F                             move.l sp, a0                                                            ; String to a0
0000349A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000034A0 223C 0000 090A                   move.l #0x090A, d1                                                       ; Position to d1
000034A6 7400                             moveq #0x0, d2                                                           ; Palette to d2
000034A8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000034AC                            

000034AC                                  ; draw the a2 counter
000034AC 204F                             move.l sp, a0                                                            ; String to a0
000034AE 3039 0000 0000                   move.w (register_backup_a2), d0                                          ; Integer to d0
000034B4 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
000034B8                            

000034B8 204F                             move.l sp, a0                                                            ; String to a0
000034BA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000034C0 223C 0000 090C                   move.l #0x090C, d1                                                       ; Position to d1
000034C6 7400                             moveq #0x0, d2                                                           ; Palette to d2
000034C8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000034CC                            

000034CC                                  ; draw the a3 counter
000034CC 204F                             move.l sp, a0                                                            ; String to a0
000034CE 3039 0000 0000                   move.w (register_backup_a3), d0                                          ; Integer to d0
000034D4 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
000034D8                            

000034D8 204F                             move.l sp, a0                                                            ; String to a0
000034DA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000034E0 223C 0000 090E                   move.l #0x090E, d1                                                       ; Position to d1
000034E6 7400                             moveq #0x0, d2                                                           ; Palette to d2
000034E8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000034EC                            

000034EC                                  ; draw the a4 counter
000034EC 204F                             move.l sp, a0                                                            ; String to a0
000034EE 3039 0000 0000                   move.w (register_backup_a4), d0                                          ; Integer to d0
000034F4 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
000034F8                            

000034F8 204F                             move.l sp, a0                                                            ; String to a0
000034FA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003500 223C 0000 0910                   move.l #0x0910, d1                                                       ; Position to d1
00003506 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003508 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000350C                            

0000350C                                  ; draw the a5 counter
0000350C 204F                             move.l sp, a0                                                            ; String to a0
0000350E 3039 0000 0000                   move.w (register_backup_a5), d0                                          ; Integer to d0
00003514 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003518                            

00003518 204F                             move.l sp, a0                                                            ; String to a0
0000351A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003520 223C 0000 0912                   move.l #0x0912, d1                                                       ; Position to d1
00003526 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003528 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000352C                            

0000352C                                  ; draw the a6 counter
0000352C 204F                             move.l sp, a0                                                            ; String to a0
0000352E 3039 0000 0000                   move.w (register_backup_a6), d0                                          ; Integer to d0
00003534 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003538                            

00003538 204F                             move.l sp, a0                                                            ; String to a0
0000353A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003540 223C 0000 0914                   move.l #0x0914, d1                                                       ; Position to d1
00003546 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003548 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000354C                            

0000354C                                  ; draw the sp counter
0000354C 204F                             move.l sp, a0                                                            ; String to a0
0000354E 3039 0000 0000                   move.w (backup_sp), d0                                                   ; Integer to d0
00003554 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003558                            

00003558 204F                             move.l sp, a0                                                            ; String to a0
0000355A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003560 223C 0000 0918                   move.l #0x0918, d1                                                       ; Position to d1
00003566 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003568 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000356C                            

0000356C                                  ; draw the d0 counter
0000356C 204F                             move.l sp, a0                                                            ; String to a0
0000356E 3039 0000 0000                   move.w (register_backup_d0), d0                                          ; Integer to d0
00003574 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003578                            

00003578 204F                             move.l sp, a0                                                            ; String to a0
0000357A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003580 223C 0000 1908                   move.l #0x1908, d1                                                       ; Position to d1
00003586 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003588 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000358C                            

0000358C                                  ; draw the d1 counter
0000358C 204F                             move.l sp, a0                                                            ; String to a0
0000358E 3039 0000 0000                   move.w (register_backup_d1), d0                                          ; Integer to d0
00003594 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003598                            

00003598 204F                             move.l sp, a0                                                            ; String to a0
0000359A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000035A0 223C 0000 190A                   move.l #0x190A, d1                                                       ; Position to d1
000035A6 7400                             moveq #0x0, d2                                                           ; Palette to d2
000035A8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000035AC                            

000035AC                                  ; draw the d2 counter
000035AC 204F                             move.l sp, a0                                                            ; String to a0
000035AE 3039 0000 0000                   move.w (register_backup_d2), d0                                          ; Integer to d0
000035B4 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
000035B8                            

000035B8 204F                             move.l sp, a0                                                            ; String to a0
000035BA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000035C0 223C 0000 190C                   move.l #0x190C, d1                                                       ; Position to d1
000035C6 7400                             moveq #0x0, d2                                                           ; Palette to d2
000035C8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000035CC                            

000035CC                                  ; draw the d3 counter
000035CC 204F                             move.l sp, a0                                                            ; String to a0
000035CE 3039 0000 0000                   move.w (register_backup_d3), d0                                          ; Integer to d0
000035D4 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
000035D8                            

000035D8 204F                             move.l sp, a0                                                            ; String to a0
000035DA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
000035E0 223C 0000 190E                   move.l #0x190E, d1                                                       ; Position to d1
000035E6 7400                             moveq #0x0, d2                                                           ; Palette to d2
000035E8 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
000035EC                            

000035EC                                  ; draw the d4 counter
000035EC 204F                             move.l sp, a0                                                            ; String to a0
000035EE 3039 0000 0000                   move.w (register_backup_d4), d0                                          ; Integer to d0
000035F4 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
000035F8                            

000035F8 204F                             move.l sp, a0                                                            ; String to a0
000035FA 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003600 223C 0000 1910                   move.l #0x1910, d1                                                       ; Position to d1
00003606 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003608 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000360C                            

0000360C                                  ; draw the d5 counter
0000360C 204F                             move.l sp, a0                                                            ; String to a0
0000360E 3039 0000 0000                   move.w (register_backup_d5), d0                                          ; Integer to d0
00003614 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003618                            

00003618 204F                             move.l sp, a0                                                            ; String to a0
0000361A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003620 223C 0000 1912                   move.l #0x1912, d1                                                       ; Position to d1
00003626 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003628 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000362C                            

0000362C                                  ; draw the d6 counter
0000362C 204F                             move.l sp, a0                                                            ; String to a0
0000362E 3039 0000 0000                   move.w (register_backup_d6), d0                                          ; Integer to d0
00003634 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003638                            

00003638 204F                             move.l sp, a0                                                            ; String to a0
0000363A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003640 223C 0000 1914                   move.l #0x1914, d1                                                       ; Position to d1
00003646 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003648 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000364C                            

0000364C                                  ; draw the d7 counter
0000364C 204F                             move.l sp, a0                                                            ; String to a0
0000364E 3039 0000 0000                   move.w (register_backup_d7), d0                                          ; Integer to d0
00003654 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003658                            

00003658 204F                             move.l sp, a0                                                            ; String to a0
0000365A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003660 223C 0000 1916                   move.l #0x1916, d1                                                       ; Position to d1
00003666 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003668 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000366C                            

0000366C                                  ; draw the pc counter
0000366C 204F                             move.l sp, a0                                                            ; String to a0
0000366E 3039 0000 0000                   move.w (backup_pc), d0                                                   ; Integer to d0
00003674 4EB8 0FE2                        jsr    ItoA_Hex_l                                                        ; Integer to ASCII (word)
00003678                            

00003678 204F                             move.l sp, a0                                                            ; String to a0
0000367A 203C 0000 0000                   move.l #PixelFontTileID, d0                                              ; Font to d0
00003680 223C 0000 1918                   move.l #0x1918, d1                                                       ; Position to d1
00003686 7400                             moveq #0x0, d2                                                           ; Palette to d2
00003688 4EB8 0CC8                        jsr DrawTextPlaneA                                                       ; Draw text
0000368C                            

0000368C 4FEF 0004                        lea $4(sp), sp                                                           ; free allocated temporary buffer
00003690                            

00003690 4EF9 0000 0000                   jmp CrashHandler                                                         ; jump to crash handler
00003690 4EF9 0000 0000                   jmp CrashHandler                                                         ; jump to crash handler
00003696                                  include 'assets\states\crashand\main.asm'
00003696                            CrashHandler:
00003696 4EF8 3696                        jmp CrashHandler                                                         ; loop forever
00003696 4EF8 3696                        jmp CrashHandler                                                         ; loop forever
0000369A                                  include 'assets\states\crashand\shutdown.asm'
0000369A                            CrashHandler_Shutdown:
0000369A                                  ; since we will never reach this point there is no code
0000369A 4E75                             rts
0000369A 4E75                             rts
0000369C                                  include 'utility.asm'
0000369C                            ; ==============================================================
0000369C                            ; GetSongData
0000369C                            ; d3 - index of song data to load
0000369C                            ; ==============================================================
0000369C                            GetSongData:
0000369C                                  ; Get song address in table
0000369C C6FC 0000                        mulu #song_struct_size, d3                                               ; Index to offset
000036A0 47F9 0000 0000                   lea SongList, a3                                                         ; Get song table address
000036A6 D7C3                             add.l	d3, a3                                                             ; Add offset
000036A8 286B 0000                        move.l song_vgm_address(a3), a4                                          ; Get vgm ptr, to a4
000036AC 2A6B 0000                        move.l song_beatmap_address(a3), a5                                      ; Get beatmap ptr, to a5
000036B0 4E75                             rts
000036B2                            ; ==============================================================
000036B2                            ; GetSongMetaData
000036B2                            ; d3 - index of song data to load
000036B2                            ; ==============================================================
000036B2                            GetSongMetaData:
000036B2                                  ; Get song address in table
000036B2 C6FC 0000                        mulu #song_struct_size, d3                                               ; Index to offset
000036B6 47F9 0000 0000                   lea SongList, a3                                                         ; Get song table address
000036BC D7C3                             add.l	d3, a3                                                             ; Add offset
000036BE 286B 0000                        move.l song_author_address(a3), a4                                       ; Get author name ptr, to a4
000036C2 2A6B 0000                        move.l song_title_address(a3), a5                                        ; Get song title ptr, to a5
000036C6 4E75                             rts
000036C6 4E75                             rts
000036C8                            

000036C8                            __main:
000036C8                            

000036C8                                  ; ************************************
000036C8                                  ; Load palettes
000036C8                                  ; ************************************
000036C8 41F9 0000 0000             	  lea Palette, a0                                                        ; Move Palette address to a0
000036CE 7000                       	  moveq #0x0, d0                                                         ; Palette ID in d0
000036D0 4EB8 0D64                  	  jsr LoadPalette                                                        ; Jump to subroutine
000036D4                            

000036D4                                  ; ************************************
000036D4                                  ;  Load the Pixel Font
000036D4                                  ; ************************************
000036D4 41F9 0000 0000                   lea PixelFont, a0                                                        ; Move font address to a0
000036DA 203C 0000 0000                   move.l #PixelFontVRAM, d0                                                ; Move VRAM dest address to d0
000036E0 223C 0000 0000                   move.l #PixelFontSizeT, d1                                               ; Move number of characters (font size in tiles) to d1
000036E6 4EB8 0CA4                        jsr LoadFont                                                             ; Jump to subroutine
000036EA                            

000036EA                                  ; *************************************
000036EA                                  ; Load the selection arrow sprite
000036EA                                  ; *************************************
000036EA 41F9 0000 0000                   lea SelectionArrow, a0                                                   ; Move sprite address to a0
000036F0 203C 0000 0000                   move.l #SelectionArrowVRAM, d0                                           ; Move VRAM dest address to d0
000036F6 223C 0000 0000                   move.l #SelectionArrowSizeT, d1                                          ; Move number of tiles to d1
000036FC 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
00003700                            

00003700                                  ; *************************************
00003700                                  ; Load the green note sprite
00003700                                  ; *************************************
00003700 41F9 0000 0000                   lea GreenNote, a0                                                        ; Move sprite address to a0
00003706 203C 0000 0000                   move.l #GreenNoteVRAM, d0                                                ; Move VRAM dest address to d0
0000370C 223C 0000 0000                   move.l #GreenNoteSizeT, d1                                               ; Move number of tiles to d1
00003712 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
00003716                            

00003716                                  ; *************************************
00003716                                  ; Load the red note sprite
00003716                                  ; *************************************
00003716 41F9 0000 0000                   lea RedNote, a0                                                          ; Move sprite address to a0
0000371C 203C 0000 0000                   move.l #RedNoteVRAM, d0                                                  ; Move VRAM dest address to d0
00003722 223C 0000 0000                   move.l #RedNoteSizeT, d1                                                 ; Move number of tiles to d1
00003728 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
0000372C                            

0000372C                                  ; *************************************
0000372C                                  ; Load the rock indicator sprite
0000372C                                  ; *************************************
0000372C 41F9 0000 0000                   lea RockIndicator, a0                                                    ; Move sprite address to a0
00003732 203C 0000 0000                   move.l #RockIndicatorVRAM, d0                                            ; Move VRAM dest address to d0
00003738 223C 0000 0000                   move.l #RockIndicatorSizeT, d1                                           ; Move number of tiles to d1
0000373E 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
00003742                            

00003742                                  ; ************************************
00003742                                  ; Load sprite descriptors
00003742                                  ; ************************************
00003742 41F9 0000 0000                   lea sprite_descriptor_table, a0                                          ; Sprite table data
00003748 303C 0000                        move.w #number_of_sprites, d0                                            ; 5 sprites
0000374C 4EB8 099E                        jsr LoadSpriteTables
00003750                            

00003750                                  ; ************************************
00003750                                  ; Load title screen map tiles
00003750                                  ; ************************************
00003750 41F9 0000 0000                   lea TitleScreenTiles, a0                                                 ; Move sprite address to a0
00003756 203C 0000 0000                   move.l #TitleScreenTilesVRAM, d0                                         ; Move VRAM dest address to d0
0000375C 223C 0000 0000                   move.l #TitleScreenTilesSizeT, d1                                        ; Move number of tiles to d1
00003762 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
00003766                            

00003766                                  ; ************************************
00003766                                  ; Load songlist screen map tiles
00003766                                  ; ************************************
00003766 41F9 0000 0000                   lea SonglistScreenTiles, a0                                                 ; Move sprite address to a0
0000376C 203C 0000 0000                   move.l #SonglistScreenTilesVRAM, d0                                         ; Move VRAM dest address to d0
00003772 223C 0000 0000                   move.l #SonglistScreenTilesSizeT, d1                                        ; Move number of tiles to d1
00003778 4EB8 0944                        jsr LoadTiles                                                               ; Jump to subroutine
0000377C                            

0000377C                                  ; ************************************
0000377C                                  ; Load game map tiles
0000377C                                  ; ************************************
0000377C 41F9 0000 0000                   lea GameTiles, a0                                                        ; Move sprite address to a0
00003782 203C 0000 0000                   move.l #GameTilesVRAM, d0                                                ; Move VRAM dest address to d0
00003788 223C 0000 0000                   move.l #GameTilesSizeT, d1                                               ; Move number of tiles to d1
0000378E 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
00003792                            

00003792                                  ; ************************************
00003792                                  ; Load stats screen map tiles
00003792                                  ; ************************************
00003792 41F9 0000 0000                   lea StatsScreenTiles, a0                                                 ; Move sprite address to a0
00003798 203C 0000 0000                   move.l #StatsScreenTilesVRAM, d0                                         ; Move VRAM dest address to d0
0000379E 223C 0000 0000                   move.l #StatsScreenTilesSizeT, d1                                        ; Move number of tiles to d1
000037A4 4EB8 0944                        jsr LoadTiles                                                            ; Jump to subroutine
000037A8                            

000037A8                                  ; *************************************
000037A8                                  ; Init Echo driver
000037A8                                  ; *************************************
000037A8 41F9 0000 0000                   lea (InstrumentList), a0                                                 ; list of instruments to load
000037AE 6100 DE12                        bsr Echo_Init
000037B2                            

000037B2                                  ; ************************************
000037B2                                  ; One Time Inits
000037B2                                  ; ************************************
000037B2 33FC 0000 0000 0000              move.w #game_state_title_screen_initalize, (game_state)                  ; set the game state
000037BA                            

000037BA                                  ; ******************************************************************
000037BA                                  ; Main game loop
000037BA                                  ; ******************************************************************
000037BA                            GameLoop:
000037BA                            

000037BA 7200                             moveq   #0,d1                                                             ; clear d1
000037BC 3239 0000 0000                   move.w  game_state,d1                                                     ; get game state on d1
000037C2 D241                             add.w   d1,d1                                                             ; multiply ID by 2 (if d1 = 1 -> d1 = 2)
000037C4 D241                             add.w   d1,d1                                                             ; multiply previous by 2 (if d1 = 2 -> d1 = 4)
000037C6 4EBB 1000                        jsr     @index(pc,d1.w)                                                   ; jump to @index addr + d1
000037CA 60EE                             bra     GameLoop
000037CC                            

000037CC                            @index:
000037CC 6000 F300                        bra.w   TitleScreen_Init                                                 ; (0)
000037D0 6000 F338                        bra.w   TitleScreen                                                      ; (1)
000037D4 6000 F34A                        bra.w   TitleScreen_Shutdown                                             ; (2)
000037D8 6000 F350                        bra.w   SonglistScreen_Init                                              ; (3)
000037DC 6000 F3D6                        bra.w   SonglistScreen                                                   ; (4)
000037E0 6000 F3F2                        bra.w   SonglistScreen_Shutdown                                          ; (5)
000037E4 6000 F438                        bra.w   GameMode_Init                                                    ; (6)
000037E8 6000 F4EC                        bra.w   GameMode                                                         ; (7)
000037EC 6000 F6E2                        bra.w   GameMode_Shutdown                                                ; (8)
000037F0 6000 F768                        bra.w   Pause_Init                                                       ; (9)
000037F4 6000 F78E                        bra.w   Pause                                                            ; (A)
000037F8 6000 F7BC                        bra.w   Pause_Shutdown                                                   ; (B)
000037FC 6000 F7DC                        bra.w   StatsScreen_Init                                                 ; (C)
00003800 6000 F9EC                        bra.w   StatsScreen                                                      ; (D)
00003804 6000 FA04                        bra.w   StatsScreen_Shutdown                                             ; (E)
00003808                            

00003808 4EB8 0D20                        jsr WaitVBlankEnd                                                        ; Wait for end of vblank
0000380C                            

0000380C 4EF8 37BA                        jmp GameLoop                                                             ; Back to the top
00003810                            

00003810                                  ; ************************************
00003810                                  ; Data
00003810                                  ; ************************************
00003810                            

00003810                                  ; Include framework data
00003810                                  include 'framewk\initdata.asm'
00003810                            ;==============================================================
00003810                            ;   BIG EVIL CORPORATION .co.uk
00003810                            ;==============================================================
00003810                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
00003810                            ;==============================================================
00003810                            ;   initdata.asm - Framework initialisation data
00003810                            ;==============================================================
00003810                            

00003810                            Z80InitData:
00003810 AF01 D91F                     dc.w 0xaf01, 0xd91f
00003814 1127 0021                     dc.w 0x1127, 0x0021
00003818 2600 F977                     dc.w 0x2600, 0xf977
0000381C EDB0 DDE1                     dc.w 0xedb0, 0xdde1
00003820 FDE1 ED47                     dc.w 0xfde1, 0xed47
00003824 ED4F D1E1                     dc.w 0xed4f, 0xd1e1
00003828 F108 D9C1                     dc.w 0xf108, 0xd9c1
0000382C D1E1 F1F9                     dc.w 0xd1e1, 0xf1f9
00003830 F3ED 5636                     dc.w 0xf3ed, 0x5636
00003834 E9E9 8104                     dc.w 0xe9e9, 0x8104
00003838 8F01                          dc.w 0x8f01
0000383A                            

0000383A                            PSGInitData:
0000383A 9FBF DFFF                     dc.w 0x9fbf, 0xdfff
0000383E                            

0000383E                            VDPRegisters:
0000383E 14                            dc.b 0x14 ; 0: H interrupt on, palettes on
0000383F 74                            dc.b 0x74 ; 1: V interrupt on, display on, DMA on, Genesis mode on
00003840 30                            dc.b 0x30 ; 2: Pattern table for Scroll Plane A at VRAM 0xC000 (bits 3-5 = bits 13-15)
00003841 00                            dc.b 0x00 ; 3: Pattern table for Window Plane at VRAM 0x0000 (disabled) (bits 1-5 = bits 11-15)
00003842 07                            dc.b 0x07 ; 4: Pattern table for Scroll Plane B at VRAM 0xE000 (bits 0-2 = bits 11-15)
00003843 78                            dc.b 0x78 ; 5: Sprite table at VRAM 0xF000 (bits 0-6 = bits 9-15)
00003844 00                            dc.b 0x00 ; 6: Unused
00003845 00                            dc.b 0x00 ; 7: Background colour - bits 0-3 = colour, bits 4-5 = palette
00003846 00                            dc.b 0x00 ; 8: Unused
00003847 00                            dc.b 0x00 ; 9: Unused
00003848 01                            dc.b 0x01 ; 10: Frequency of Horiz. interrupt in Rasters (number of lines travelled by the beam)
00003849 00                            dc.b 0x00 ; 11: External interrupts off, V scroll fullscreen, H scroll fullscreen
0000384A 81                            dc.b 0x81 ; 12: Shadows and highlights off, interlace off, H40 mode (320 x 240 screen res)
0000384B 3F                            dc.b 0x3F ; 13: Horiz. scroll table at VRAM 0xFC00 (bits 0-5)
0000384C 00                            dc.b 0x00 ; 14: Unused
0000384D 02                            dc.b 0x02 ; 15: Autoincrement 2 bytes
0000384E 01                            dc.b 0x01 ; 16: Vert. scroll 32, Horiz. scroll 64
0000384F 00                            dc.b 0x00 ; 17: Window Plane X pos 0 left (pos in bits 0-4, left/right in bit 7)
00003850 00                            dc.b 0x00 ; 18: Window Plane Y pos 0 up (pos in bits 0-4, up/down in bit 7)
00003851 FF                            dc.b 0xFF ; 19: DMA length lo byte
00003852 FF                            dc.b 0xFF ; 20: DMA length hi byte
00003853 00                            dc.b 0x00 ; 21: DMA source address lo byte
00003854 00                            dc.b 0x00 ; 22: DMA source address mid byte
00003855 80                            dc.b 0x80 ; 23: DMA source address hi byte, memory-to-VRAM mode (bits 6-7)
00003856                            

00003856                            ; MegaCD signatures
00003856 5345 4741 00               mcd_sig_1: dc.b 'SEGA',0
0000385B 5345 4741 00               mcd_sig_2: dc.b 'SEGA',0
00003860 574F 4E44 4552 00          mcd_sig_3: dc.b 'WONDER',0
00003867 5345 4741 00               mcd_sig_4: dc.b 'SEGA',0
00003867 5345 4741 00               mcd_sig_4: dc.b 'SEGA',0
0000386C                                  include 'framewk\globals.asm'
0000386C                            ;==============================================================
0000386C                            ;   BIG EVIL CORPORATION .co.uk
0000386C                            ;==============================================================
0000386C                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
0000386C                            ;==============================================================
0000386C                            ;   globals.asm - Framework globals
0000386C                            ;==============================================================
0000386C                            

0000386C                            ; ************************************
0000386C                            ; Constants
0000386C                            ; ************************************
0000386C =00000020                  bytes_per_tile			equ 0x20
0000386C =00000040                  nybbles_per_tile		equ (bytes_per_tile*2)
0000386C                            

0000386C =00000140                  screen_width     		equ 0x0140 ; 320 (H40 mode)
0000386C =000000E0                  screen_height	        equ 0x00E0 ; 224 (V28 mode)
0000386C                            

0000386C                            ; ************************************
0000386C                            ; RAM
0000386C                            ; ************************************
0000386C =0000FFFF                  ram_size_b				equ 0x0000FFFF
0000386C =00007FFF                  ram_size_w				equ (ram_size_b/2)
0000386C =00003FFF                  ram_size_l				equ (ram_size_b/4)
0000386C =00FF0000                  ram_start				equ 0x00FF0000
0000386C =00FFFFFF                  ram_end					equ (ram_start+ram_size_b)
0000386C =00FFE000                  stack_top				equ 0x00FFE000
0000386C                            

0000386C                            ; ************************************
0000386C                            ; System
0000386C                            ; ************************************
0000386C =00A10001                  hardware_ver_address	equ 0x00A10001
0000386C =00A14000                  tmss_address			equ 0x00A14000
0000386C =53454741                  tmss_signature			equ 'SEGA'
0000386C =00A10008                  reset_exp				equ 0x00A10008
0000386C =00A1000C                  reset_button			equ 0x00A1000C
0000386C                            

0000386C                            ; ************************************
0000386C                            ; Z80
0000386C                            ; ************************************
0000386C =00A11100                  z80_bus_request			equ 0x00A11100
0000386C =00A11200                  z80_bus_reset			equ 0x00A11200
0000386C =00A00000                  z80_ram_start			equ 0x00A00000
0000386C                            

0000386C                            ; ************************************
0000386C                            ; VDP
0000386C                            ; ************************************
0000386C =00000040                  vdp_plane_width         equ 0x0040 ; 64 tiles X
0000386C =00000020                  vdp_plane_height        equ 0x0020 ; 32 tiles Y
0000386C =0000000C                  vdp_plane_border_x      equ (vdp_plane_width-(screen_width/8))/2
0000386C =00000002                  vdp_plane_border_y      equ (vdp_plane_height-(screen_height/8))/2
0000386C                            

0000386C =00000018                  vdp_num_registers		equ 0x18
0000386C                            

0000386C =00C00004                  vdp_control             equ 0x00C00004
0000386C =00C00000                  vdp_data                equ 0x00C00000
0000386C                            

0000386C                            ; VDP memory access commands
0000386C =40000000                  vdp_cmd_vram_write		equ 0x40000000
0000386C =00000000                  vdp_cmd_vram_read		equ 0x00000000
0000386C =C0000000                  vdp_cmd_cram_write		equ 0xC0000000
0000386C =00000020                  vdp_cmd_cram_read		equ 0x00000020
0000386C =40000010                  vdp_cmd_vsram_write		equ 0x40000010
0000386C =00000010                  vdp_cmd_vsram_read		equ 0x00000010
0000386C                            

0000386C                            ; VRAM addresses (must match registers)
0000386C =00000000                  vram_addr_tiles			equ 0x0000
0000386C =0000C000                  vram_addr_plane_a		equ 0xC000
0000386C =0000E000                  vram_addr_plane_b		equ 0xE000
0000386C =0000F000                  vram_addr_sprite_table	equ 0xF000
0000386C =0000FC00                  vram_addr_hscroll		equ 0xFC00
0000386C                            

0000386C                            ; Legacy VDP write longs.
0000386C                            ; To make VDP command:
0000386C                            ; - Add VRAM address (above) to dest address
0000386C                            ; - Roll bits 14/15 round to bits 1/2 (shift the rest back), swap words
0000386C                            ; - OR in VRAM access command (above)
0000386C                            ; - Write longword to vdp_control
0000386C                            ; Could do with a macro.
0000386C =00008000                  vdp_write_register		equ 0x00008000 ; Legacy, do not use
0000386C =C0000000                  vdp_write_palettes		equ 0xC0000000 ; Legacy, do not use
0000386C =40000000                  vdp_write_tiles			equ 0x40000000 ; Legacy, do not use
0000386C =40000003                  vdp_write_plane_a		equ 0x40000003 ; Legacy, do not use
0000386C =60000003                  vdp_write_plane_b		equ 0x60000003 ; Legacy, do not use
0000386C =70000003                  vdp_write_sprite_table	equ 0x70000003 ; Legacy, do not use
0000386C =7C000003                  vdp_write_hscroll       equ 0x7C000003 ; Legacy, do not use
0000386C =40000010                  vdp_write_vscroll       equ 0x40000010 ; Legacy, do not use
0000386C                            

0000386C =00000020                  vdp_read_palettes		equ 0x00000020 ; Legacy, do not use
0000386C =00000000                  vdp_read_tiles          equ 0x00000000 ; Legacy, do not use
0000386C =00000003                  vdp_read_plane_a		equ 0x00000003 ; Legacy, do not use
0000386C =30000003                  vdp_read_sprite_table   equ 0x30000003 ; Legacy, do not use
0000386C =00000010                  vdp_read_vscroll        equ 0x00000010 ; Legacy, do not use
0000386C                            

0000386C                            ; VDP status register bits
0000386C =00000009                  vdp_status_fifoempty       equ 0x9    ; FIFO Empty
0000386C =00000008                  vdp_status_fifofull        equ 0x8    ; FIFO Full
0000386C =00000007                  vdp_status_vintpending     equ 0x7    ; Vertical interrupt pending
0000386C =00000006                  vdp_status_spriteoverflow  equ 0x6    ; Sprite overflow on current scan line
0000386C =00000005                  vdp_status_spritecollision equ 0x5    ; Sprite collision
0000386C =00000004                  vdp_status_oddframe        equ 0x4    ; Odd frame
0000386C =00000003                  vdp_status_vblank          equ 0x3    ; Vertical blanking
0000386C =00000002                  vdp_status_hblank          equ 0x2    ; Horizontal blanking
0000386C =00000001                  vdp_status_dma             equ 0x1    ; DMA in progress
0000386C =00000000                  vdp_status_pal             equ 0x0    ; PAL mode flag
0000386C                            

0000386C                            ; ************************************
0000386C                            ; PSG
0000386C                            ; ************************************
0000386C =00C00011                  psg_control             equ 0x00C00011
0000386C                            

0000386C                            ; ************************************
0000386C                            ; Gamepad ports
0000386C                            ; ************************************
0000386C =00A10003                  pad_data_a              equ 0x00A10003
0000386C =00A10005                  pad_data_b              equ 0x00A10005
0000386C =00A10007                  pad_data_c              equ 0x00A10007
0000386C =00A10009                  pad_ctrl_a              equ 0x00A10009
0000386C =00A1000B                  pad_ctrl_b              equ 0x00A1000B
0000386C =00A1000D                  pad_ctrl_c              equ 0x00A1000D
0000386C                            

0000386C =00000040                  pad_byte_latch			equ 0x40
0000386C                            

0000386C                            ;pad_button_up           equ 0x0
0000386C                            ;pad_button_down         equ 0x1
0000386C                            ;pad_button_left         equ 0x2
0000386C                            ;pad_button_right        equ 0x3
0000386C                            ;pad_button_a            equ 0xC
0000386C                            ;pad_button_b            equ 0x4
0000386C                            ;pad_button_c            equ 0x5
0000386C                            ;pad_button_start        equ 0xD
0000386C                            

0000386C =00000000                  pad_button_up    equ 0x0
0000386C =00000001                  pad_button_down  equ 0x1
0000386C =00000002                  pad_button_left  equ 0x2
0000386C =00000003                  pad_button_right equ 0x3
0000386C =00000006                  pad_button_a     equ 0x6
0000386C =00000004                  pad_button_b     equ 0x4
0000386C =00000005                  pad_button_c     equ 0x5
0000386C =0000000A                  pad_button_x     equ 0xA
0000386C =00000009                  pad_button_y     equ 0x9
0000386C =00000008                  pad_button_z     equ 0x8
0000386C =0000000B                  pad_button_mode  equ 0xB
0000386C =00000007                  pad_button_start equ 0x7
0000386C                            

0000386C                            ; ************************************
0000386C                            ; Mega-CD
0000386C                            ; ************************************
0000386C                            

0000386C                            ; BIOS addresses for various MegaCD types
0000386C =00415800                  mcd_bios_addr_1 equ 0x00415800 ; SEGA Model 1
0000386C =00416000                  mcd_bios_addr_2 equ 0x00416000 ; SEGA Model 2
0000386C =00416000                  mcd_bios_addr_3 equ 0x00416000 ; WonderMega/X'Eye
0000386C =0041AD00                  mcd_bios_addr_4 equ 0x0041AD00 ; LaserActive
0000386C                            

0000386C                            ; Offset into BIOS to find signature
0000386C =0000006D                  mcd_sig_offset equ 0x6D
0000386C                            

0000386C                            ; ************************************
0000386C                            ; Terrain/collision bits
0000386C                            ; ************************************
0000386C =00000000                  col_bit_floor 	  equ 0x0
0000386C =00000001                  col_bit_ledge_rhs equ 0x1
0000386C =00000002                  col_bit_ledge_lhs equ 0x2
0000386C =00000003                  col_bit_wall  	  equ 0x3
0000386C =00000003                  col_bit_wall  	  equ 0x3
0000386C                                  include 'framewk\charmap.asm'
0000386C                            ;==============================================================
0000386C                            ;   BIG EVIL CORPORATION .co.uk
0000386C                            ;==============================================================
0000386C                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
0000386C                            ;==============================================================
0000386C                            ;   charmap.asm - ASCII character map
0000386C                            ;==============================================================
0000386C                            

0000386C =00000020                  ASCIIStart: equ 0x20 ; First ASCII code in table
0000386C                            ASCIIAlphaOffset: equ ASCIIStart+(ASCIIAlphaStart-ASCIIMap)
0000386C                            ASCIINumericOffset: equ ASCIIStart+(ASCIINumericStart-ASCIIMap)
0000386C                            

0000386C                            ASCIIMap:
0000386C 00                         	dc.b 0x00       ; SPACE (ASCII code 0x20)
0000386D 28                         	dc.b 0x28   ; ! Exclamation mark
0000386E 2B                         	dc.b 0x2B   ; " Double quotes
0000386F 2E                         	dc.b 0x2E   ; # Hash
00003870 00                         	dc.b 0x00       ; UNUSED
00003871 00                         	dc.b 0x00       ; UNUSED
00003872 00                         	dc.b 0x00       ; UNUSED
00003873 2C                         	dc.b 0x2C   ; ' Single quote
00003874 29                         	dc.b 0x29   ; ( Open parenthesis
00003875 2A                         	dc.b 0x2A   ; ) Close parenthesis
00003876 00                         	dc.b 0x00       ; UNUSED
00003877 2F                         	dc.b 0x2F   ; + Plus
00003878 26                         	dc.b 0x26   ; , Comma
00003879 30                         	dc.b 0x30   ; - Minus
0000387A 25                         	dc.b 0x25   ; . Full stop
0000387B 31                         	dc.b 0x31   ; / Slash or divide
0000387C                            ASCIINumericStart:
0000387C 1B                         	dc.b 0x1B   ; 0 Zero
0000387D 1C                         	dc.b 0x1C   ; 1 One
0000387E 1D                         	dc.b 0x1D   ; 2 Two
0000387F 1E                         	dc.b 0x1E   ; 3 Three
00003880 1F                         	dc.b 0x1F   ; 4 Four
00003881 20                         	dc.b 0x20   ; 5 Five
00003882 21                         	dc.b 0x21   ; 6 Six
00003883 22                         	dc.b 0x22   ; 7 Seven
00003884 23                         	dc.b 0x23   ; 8 Eight
00003885 24                         	dc.b 0x24   ; 9 Nine
00003886 2D                         	dc.b 0x2D   ; : Colon
00003887 00                         	dc.b 0x00       ; UNUSED
00003888 00                         	dc.b 0x00       ; UNUSED
00003889 00                         	dc.b 0x00       ; UNUSED
0000388A 00                         	dc.b 0x00       ; UNUSED
0000388B 27                         	dc.b 0x27   ; ? Question mark
0000388C 00                         	dc.b 0x00       ; UNUSED
0000388D                            ASCIIAlphaStart:
0000388D 01                         	dc.b 0x01       ; A
0000388E 02                         	dc.b 0x02   ; B
0000388F 03                         	dc.b 0x03       ; C
00003890 04                         	dc.b 0x04   ; D
00003891 05                         	dc.b 0x05       ; E
00003892 06                         	dc.b 0x06       ; F
00003893 07                         	dc.b 0x07       ; G
00003894 08                         	dc.b 0x08       ; H
00003895 09                         	dc.b 0x09       ; I
00003896 0A                         	dc.b 0x0A       ; J
00003897 0B                         	dc.b 0x0B       ; K
00003898 0C                         	dc.b 0x0C       ; L
00003899 0D                         	dc.b 0x0D       ; M
0000389A 0E                         	dc.b 0x0E       ; N
0000389B 0F                         	dc.b 0x0F       ; O
0000389C 10                         	dc.b 0x10       ; P
0000389D 11                         	dc.b 0x11       ; Q
0000389E 12                         	dc.b 0x12       ; R
0000389F 13                         	dc.b 0x13       ; S
000038A0 14                         	dc.b 0x14       ; T
000038A1 15                         	dc.b 0x15       ; U
000038A2 16                         	dc.b 0x16       ; V
000038A3 17                         	dc.b 0x17       ; W
000038A4 18                         	dc.b 0x18       ; X
000038A5 19                         	dc.b 0x19       ; Y
000038A6 1A                         	dc.b 0x1A       ; Z (ASCII code 0x5A)
000038A7                            

000038A8 00                         	EVEN
000038A8 00                         	EVEN
000038A8                            

000038A8                                  ; Include game data
000038A8                                  include 'globals.asm'
000038A8                            ;==============================================================
000038A8                            ;   Scorpion Illuminati
000038A8                            ;==============================================================
000038A8                            ;   SEGA Genesis (c) SegaDev 2014
000038A8                            ;==============================================================
000038A8                            

000038A8                            ; Sprite constants
000038A8 =00000008                  sprite_size          equ 0x08
000038A8 =00000050                  max_sprites          equ 0x50
000038A8 =00000080                  sprite_plane_border  equ 0x0080
000038A8                            

000038A8                            ; Screen bounds
000038A8 =00000140                  screen_width         equ 0x0140                                                ; 320 (H40)
000038A8 =000000E0                  screen_height        equ 0x00E0                                                ; 224 (V28)
000038A8 =00000010                  screen_border_x      equ 0x0010
000038A8 =00000010                  screen_border_y      equ 0x0010
000038A8                            

000038A8                            ; game state constants
000038A8 =00000000                  game_state_title_screen_initalize       equ 0x0000
000038A8 =00000001                  game_state_title_screen                 equ 0x0001
000038A8 =00000002                  game_state_title_screen_shutdown        equ 0x0002
000038A8 =00000003                  game_state_songlist_screen_initalize    equ 0x0003
000038A8 =00000004                  game_state_songlist_screen              equ 0x0004
000038A8 =00000005                  game_state_songlist_screen_shutdown     equ 0x0005
000038A8 =00000006                  game_state_game_mode_initalize          equ 0x0006
000038A8 =00000007                  game_state_game_mode                    equ 0x0007
000038A8 =00000008                  game_state_game_mode_shutdown           equ 0x0008
000038A8 =00000009                  game_state_game_mode_pause_initalize    equ 0x0009
000038A8 =0000000A                  game_state_game_mode_pause              equ 0x000A
000038A8 =0000000B                  game_state_game_mode_pause_shutdown     equ 0x000B
000038A8 =0000000C                  game_state_stats_screen_initalize       equ 0x000C
000038A8 =0000000D                  game_state_stats_screen                 equ 0x000D
000038A8 =0000000E                  game_state_stats_screen_shutdown        equ 0x000E
000038A8                            

000038A8                            ; selection arrow bounds
000038A8 =000000A7                  selectionarrow_boundry_top      equ 0x00A7
000038A8 =000000C7                  selectionarrow_boundry_bottom   equ 0x00C7
000038A8                            

000038A8                            ; note collision bounds
000038A8 =00000000                  note_bounds_top      equ 0x0000
000038A8 =00000008                  note_bounds_bottom   equ 0x0008
000038A8 =00000000                  note_bounds_left     equ 0x0000
000038A8 =00000008                  note_bounds_right    equ 0x0008
000038A8                            

000038A8                            ; object offbounds positions
000038A8 =00000000                  offscreen_position_x:  equ 0x0000
000038A8 =00000000                  offscreen_position_y:  equ 0x0000
000038A8                            

000038A8                            ; position for selection arrow
000038A8 =000000A7                  selectionarrow_start_position_y: equ 0x00A7
000038A8 =000000AF                  selectionarrow_start_position_x: equ 0x00AF
000038A8 =00000002                  selectionarrow_y_velocity        equ 0x0002
000038A8                            

000038A8                            ; position for rock indicator
000038A8 =00000150                  rockindicator_start_position_y:  equ 0x0150
000038A8 =000000CF                  rockindicator_start_position_x:  equ 0x00CF
000038A8                            

000038A8                            ; start position for notes
000038A8 =0000015E                  note_start_position_x:       equ 0x015E
000038A8 =00000118                  green_note_start_position_y: equ 0x0118
000038A8 =00000128                  red_note_start_position_y:   equ 0x0128
000038A8                            

000038A8                            ; arrow boundry locations
000038A8 =000000C1                  note_plane_border_offset:   equ 0x00C1
000038A8 =000000CD                  note_plane_safearea_offset: equ 0x00CD
000038A8 =000000CD                  note_plane_safearea_offset: equ 0x00CD
000038A8                                  include 'memmap.asm'
000038A8                            ;==============================================================
000038A8                            ;     Scorpion Illuminati
000038A8                            ;==============================================================
000038A8                            ;   SEGA Genesis (c) SegaDev 2014
000038A8                            ;==============================================================
000038A8                            

000038A8                            ; **********************************************
000038A8                            ; Various size-ofs to make this easier/foolproof
000038A8                            ; **********************************************
000038A8 =00000001                  SizeByte:               equ 0x01
000038A8 =00000002                  SizeWord:               equ 0x02
000038A8 =00000004                  SizeLong:               equ 0x04
000038A8 =00000008                  SizeSpriteDesc:         equ 0x08
000038A8 =00000020                  SizeTile:               equ 0x20
000038A8 =00000040                  SizePalette:            equ 0x40
000038A8                            

000038A8                                rsset 0
000038A8                            ; ************************************
000038A8                            ; Song structure
000038A8                            ; ************************************
000038A8 =00000000                  song_author_address         rs.l 1
000038A8 =00000004                  song_title_address          rs.l 1
000038A8 =00000008                  song_vgm_address            rs.l 1
000038A8 =0000000C                  song_beatmap_address        rs.l 1
000038A8 =00000010                  song_struct_size            rs.b 0
000038A8                            

000038A8                            ; ************************************
000038A8                            ; System stuff
000038A8                            ; ************************************
000038A8                                rsset 0x00FF0000
000038A8 =00FF0000                  hblank_counter          rs.l 1                                         ; Start of RAM
000038A8 =00FF0004                  vblank_counter          rs.l 1
000038A8 =00FF0008                  audio_clock             rs.l 1
000038A8 =00FF000C                  joypadA			rs.w 1
000038A8 =00FF000E                  joypadA_press		rs.w 1
000038A8 =00FF0010                  joypadB			rs.w 1
000038A8 =00FF0012                  joypadB_press		rs.w 1
000038A8                            

000038A8                            ; ************************************
000038A8                            ; Game globals
000038A8                            ; ************************************
000038A8 =00FF0014                  spritelist_table            rs.b sprite_size*max_sprites
000038A8 =00FF0294                  sprite_count                rs.b 1
000038A8 =00FF0296                  game_state                  rs.w 1
000038A8 =00FF0298                  selectionarrow_position_y   rs.w 1
000038A8 =00FF029A                  song_id                     rs.w 1
000038A8 =00FF029C                  hits                        rs.w 1
000038A8 =00FF029E                  misses                      rs.w 1
000038A8 =00FF02A0                  errors                      rs.w 1
000038A8 =00FF02A2                  score                       rs.w 1
000038A8 =00FF02A4                  combo                       rs.w 1
000038A8 =00FF02A6                  top_streak                  rs.w 1
000038A8 =00FF02A8                  completion                  rs.w 1
000038A8 =00FF02AA                  multiplier                  rs.w 1
000038A8 =00FF02AC                  scoredelta                  rs.w 1
000038A8 =00FF02AE                  rockindicator_position_x    rs.w 1
000038A8 =00FF02B0                  tempo                       rs.w 1
000038A8 =00FF02B2                  greennote_position_x        rs.w 1
000038A8 =00FF02B4                  rednote_position_x          rs.w 1
000038A8                            

000038A8                            ; ************************************
000038A8                            ; crash handler storage
000038A8                            ; ************************************
000038A8 =00FF02B6                  error_code                  rs.l 1
000038A8 =00FF02BA                  register_backup_a0          rs.l 1
000038A8 =00FF02BE                  register_backup_a1          rs.l 1
000038A8 =00FF02C2                  register_backup_a2          rs.l 1
000038A8 =00FF02C6                  register_backup_a3          rs.l 1
000038A8 =00FF02CA                  register_backup_a4          rs.l 1
000038A8 =00FF02CE                  register_backup_a5          rs.l 1
000038A8 =00FF02D2                  register_backup_a6          rs.l 1 
000038A8 =00FF02D6                  register_backup_d0          rs.l 1
000038A8 =00FF02DA                  register_backup_d1          rs.l 1
000038A8 =00FF02DE                  register_backup_d2          rs.l 1
000038A8 =00FF02E2                  register_backup_d3          rs.l 1
000038A8 =00FF02E6                  register_backup_d4          rs.l 1
000038A8 =00FF02EA                  register_backup_d5          rs.l 1
000038A8 =00FF02EE                  register_backup_d6          rs.l 1 
000038A8 =00FF02F2                  register_backup_d7          rs.l 1
000038A8 =00FF02F6                  backup_sp                   rs.l 1
000038A8 =00FF02FA                  backup_pc                   rs.l 1
000038A8                            

000038A8 =00FF02FE                  __ramend                        rs.b 0
000038A8 =00FF02FE                  __ramend                        rs.b 0
000038A8                            

000038A8                                  ; Include game art
000038A8                                  include 'assets\assetmap.asm'
000038A8                            ;==============================================================
000038A8                            ;   Scorpion Illuminati
000038A8                            ;==============================================================
000038A8                            ;   SEGA Genesis (c) SegaDev 2014
000038A8                            ;==============================================================
000038A8                            

000038A8                            ; ************************************
000038A8                            ; Art asset VRAM mapping
000038A8                            ; ************************************
000038A8 =00000000                  PixelFontVRAM:            equ 0x0000
000038A8                            TitleScreenTilesVRAM:     equ PixelFontVRAM+PixelFontSizeB
000038A8                            SonglistScreenTilesVRAM:  equ TitleScreenTilesVRAM+TitleScreenTilesSizeB
000038A8                            GameTilesVRAM:            equ SonglistScreenTilesVRAM+SonglistScreenTilesSizeB
000038A8                            StatsScreenTilesVRAM:     equ GameTilesVRAM+GameTilesSizeB
000038A8                            CrashHandlerTilesVRAM:    equ StatsScreenTilesVRAM+StatsScreenTilesSizeB
000038A8                            SelectionArrowVRAM:       equ CrashHandlerTilesVRAM+CrashHandlerTilesSizeB
000038A8                            RockIndicatorVRAM:        equ SelectionArrowVRAM+SelectionArrowSizeB
000038A8                            GreenNoteVRAM:            equ RockIndicatorVRAM+RockIndicatorSizeB
000038A8                            RedNoteVRAM:              equ GreenNoteVRAM+GreenNoteSizeB
000038A8                            

000038A8                            ; ************************************
000038A8                            ; Include all art assets
000038A8                            ; ************************************
000038A8                                  include assets\fonts\pixelfnt.asm
000038A8                            ;==============================================================
000038A8                            ;   BIG EVIL CORPORATION .co.uk
000038A8                            ;==============================================================
000038A8                            ;   SEGA Genesis Framework (c) Matt Phillips 2014
000038A8                            ;==============================================================
000038A8                            ;   'Pixel Font' by neon280, under Creative Commons license
000038A8                            ;   fontstruct.com/fontstructions/show/7x7_pixel_font
000038A8                            ;==============================================================
000038A8                            

000038A8                            PixelFont: ; Font start address
000038A8                            

000038A8 0000 0000                  	dc.l    $00000000
000038AC 0000 0000                  	dc.l    $00000000
000038B0 0000 0000                  	dc.l    $00000000
000038B4 0000 0000                  	dc.l    $00000000
000038B8 0000 0000                  	dc.l    $00000000
000038BC 0000 0000                  	dc.l    $00000000
000038C0 0000 0000                  	dc.l    $00000000
000038C4 0000 0000                  	dc.l    $00000000
000038C8                            

000038C8 0111 1100                  	dc.l    $01111100
000038CC 1100 0110                  	dc.l    $11000110
000038D0 1011 1010                  	dc.l    $10111010
000038D4 1000 0010                  	dc.l    $10000010
000038D8 1011 1010                  	dc.l    $10111010
000038DC 1010 1010                  	dc.l    $10101010
000038E0 1110 1110                  	dc.l    $11101110
000038E4 0000 0000                  	dc.l    $00000000
000038E8                            	
000038E8 1111 1100                  	dc.l    $11111100
000038EC 1000 0110                  	dc.l    $10000110
000038F0 1011 1010                  	dc.l    $10111010
000038F4 1000 0110                  	dc.l    $10000110
000038F8 1011 1010                  	dc.l    $10111010
000038FC 1000 0110                  	dc.l    $10000110
00003900 1111 1100                  	dc.l    $11111100
00003904 0000 0000                  	dc.l    $00000000
00003908                            	
00003908 0111 1110                  	dc.l    $01111110
0000390C 1100 0010                  	dc.l    $11000010
00003910 1011 1110                  	dc.l    $10111110
00003914 1010 0000                  	dc.l    $10100000
00003918 1011 1110                  	dc.l    $10111110
0000391C 1100 0010                  	dc.l    $11000010
00003920 0111 1110                  	dc.l    $01111110
00003924 0000 0000                  	dc.l    $00000000
00003928                            	
00003928 1111 1100                  	dc.l    $11111100
0000392C 1000 0110                  	dc.l    $10000110
00003930 1011 1010                  	dc.l    $10111010
00003934 1010 1010                  	dc.l    $10101010
00003938 1011 1010                  	dc.l    $10111010
0000393C 1000 0110                  	dc.l    $10000110
00003940 1111 1100                  	dc.l    $11111100
00003944 0000 0000                  	dc.l    $00000000
00003948                            	
00003948 1111 1110                  	dc.l    $11111110
0000394C 1000 0010                  	dc.l    $10000010
00003950 1011 1110                  	dc.l    $10111110
00003954 1000 1000                  	dc.l    $10001000
00003958 1011 1110                  	dc.l    $10111110
0000395C 1000 0010                  	dc.l    $10000010
00003960 1111 1110                  	dc.l    $11111110
00003964 0000 0000                  	dc.l    $00000000
00003968                            	
00003968 1111 1110                  	dc.l    $11111110
0000396C 1000 0010                  	dc.l    $10000010
00003970 1011 1110                  	dc.l    $10111110
00003974 1000 1000                  	dc.l    $10001000
00003978 1011 1000                  	dc.l    $10111000
0000397C 1010 0000                  	dc.l    $10100000
00003980 1110 0000                  	dc.l    $11100000
00003984 0000 0000                  	dc.l    $00000000
00003988                            	
00003988 0111 1110                  	dc.l    $01111110
0000398C 1100 0010                  	dc.l    $11000010
00003990 1011 1110                  	dc.l    $10111110
00003994 1010 0010                  	dc.l    $10100010
00003998 1011 1010                  	dc.l    $10111010
0000399C 1100 0010                  	dc.l    $11000010
000039A0 0111 1110                  	dc.l    $01111110
000039A4 0000 0000                  	dc.l    $00000000
000039A8                            	
000039A8 1110 1110                  	dc.l    $11101110
000039AC 1010 1010                  	dc.l    $10101010
000039B0 1011 1010                  	dc.l    $10111010
000039B4 1000 0010                  	dc.l    $10000010
000039B8 1011 1010                  	dc.l    $10111010
000039BC 1010 1010                  	dc.l    $10101010
000039C0 1110 1110                  	dc.l    $11101110
000039C4 0000 0000                  	dc.l    $00000000
000039C8                            	
000039C8 1111 1110                  	dc.l    $11111110
000039CC 1000 0010                  	dc.l    $10000010
000039D0 1110 1110                  	dc.l    $11101110
000039D4 0010 1000                  	dc.l    $00101000
000039D8 1110 1110                  	dc.l    $11101110
000039DC 1000 0010                  	dc.l    $10000010
000039E0 1111 1110                  	dc.l    $11111110
000039E4 0000 0000                  	dc.l    $00000000
000039E8                            	
000039E8 0000 1110                  	dc.l    $00001110
000039EC 0000 1010                  	dc.l    $00001010
000039F0 0000 1010                  	dc.l    $00001010
000039F4 1110 1010                  	dc.l    $11101010
000039F8 1011 1010                  	dc.l    $10111010
000039FC 1100 0110                  	dc.l    $11000110
00003A00 0111 1100                  	dc.l    $01111100
00003A04 0000 0000                  	dc.l    $00000000
00003A08                            	
00003A08 1110 1110                  	dc.l    $11101110
00003A0C 1011 1010                  	dc.l    $10111010
00003A10 1011 0110                  	dc.l    $10110110
00003A14 1000 1100                  	dc.l    $10001100
00003A18 1011 0110                  	dc.l    $10110110
00003A1C 1011 1010                  	dc.l    $10111010
00003A20 1110 1110                  	dc.l    $11101110
00003A24 0000 0000                  	dc.l    $00000000
00003A28                            

00003A28 1110 0000                  	dc.l    $11100000
00003A2C 1010 0000                  	dc.l    $10100000
00003A30 1010 0000                  	dc.l    $10100000
00003A34 1010 0000                  	dc.l    $10100000
00003A38 1011 1110                  	dc.l    $10111110
00003A3C 1000 0010                  	dc.l    $10000010
00003A40 1111 1110                  	dc.l    $11111110
00003A44 0000 0000                  	dc.l    $00000000
00003A48                            	
00003A48 1110 1110                  	dc.l    $11101110
00003A4C 1011 1010                  	dc.l    $10111010
00003A50 1001 0010                  	dc.l    $10010010
00003A54 1010 1010                  	dc.l    $10101010
00003A58 1011 1010                  	dc.l    $10111010
00003A5C 1010 1010                  	dc.l    $10101010
00003A60 1110 1110                  	dc.l    $11101110
00003A64 0000 0000                  	dc.l    $00000000
00003A68                            	
00003A68 1110 1110                  	dc.l    $11101110
00003A6C 1011 1010                  	dc.l    $10111010
00003A70 1001 1010                  	dc.l    $10011010
00003A74 1010 1010                  	dc.l    $10101010
00003A78 1011 0010                  	dc.l    $10110010
00003A7C 1011 1010                  	dc.l    $10111010
00003A80 1110 1110                  	dc.l    $11101110
00003A84 0000 0000                  	dc.l    $00000000
00003A88                            	
00003A88 0111 1100                  	dc.l    $01111100
00003A8C 1100 0110                  	dc.l    $11000110
00003A90 1011 1010                  	dc.l    $10111010
00003A94 1010 1010                  	dc.l    $10101010
00003A98 1011 1010                  	dc.l    $10111010
00003A9C 1100 0110                  	dc.l    $11000110
00003AA0 0111 1100                  	dc.l    $01111100
00003AA4 0000 0000                  	dc.l    $00000000
00003AA8                            	
00003AA8 1111 1100                  	dc.l    $11111100
00003AAC 1000 0110                  	dc.l    $10000110
00003AB0 1011 1010                  	dc.l    $10111010
00003AB4 1000 0110                  	dc.l    $10000110
00003AB8 1011 1100                  	dc.l    $10111100
00003ABC 1010 0000                  	dc.l    $10100000
00003AC0 1110 0000                  	dc.l    $11100000
00003AC4 0000 0000                  	dc.l    $00000000
00003AC8                            	
00003AC8 0111 1100                  	dc.l    $01111100
00003ACC 1100 0110                  	dc.l    $11000110
00003AD0 1011 1010                  	dc.l    $10111010
00003AD4 1010 1010                  	dc.l    $10101010
00003AD8 1011 0110                  	dc.l    $10110110
00003ADC 1100 1010                  	dc.l    $11001010
00003AE0 0111 1110                  	dc.l    $01111110
00003AE4 0000 0000                  	dc.l    $00000000
00003AE8                            	
00003AE8 1111 1100                  	dc.l    $11111100
00003AEC 1000 0110                  	dc.l    $10000110
00003AF0 1011 1010                  	dc.l    $10111010
00003AF4 1000 0110                  	dc.l    $10000110
00003AF8 1011 0110                  	dc.l    $10110110
00003AFC 1011 1010                  	dc.l    $10111010
00003B00 1110 1110                  	dc.l    $11101110
00003B04 0000 0000                  	dc.l    $00000000
00003B08                            	
00003B08 0111 1110                  	dc.l    $01111110
00003B0C 1100 0010                  	dc.l    $11000010
00003B10 1011 1110                  	dc.l    $10111110
00003B14 1100 0110                  	dc.l    $11000110
00003B18 1111 1010                  	dc.l    $11111010
00003B1C 1000 0110                  	dc.l    $10000110
00003B20 1111 1100                  	dc.l    $11111100
00003B24 0000 0000                  	dc.l    $00000000
00003B28                            	
00003B28 1111 1110                  	dc.l    $11111110
00003B2C 1000 0010                  	dc.l    $10000010
00003B30 1110 1110                  	dc.l    $11101110
00003B34 0010 1000                  	dc.l    $00101000
00003B38 0010 1000                  	dc.l    $00101000
00003B3C 0010 1000                  	dc.l    $00101000
00003B40 0011 1000                  	dc.l    $00111000
00003B44 0000 0000                  	dc.l    $00000000
00003B48                            	
00003B48 1110 1110                  	dc.l    $11101110
00003B4C 1010 1010                  	dc.l    $10101010
00003B50 1010 1010                  	dc.l    $10101010
00003B54 1010 1010                  	dc.l    $10101010
00003B58 1011 1010                  	dc.l    $10111010
00003B5C 1100 0110                  	dc.l    $11000110
00003B60 0111 1100                  	dc.l    $01111100
00003B64 0000 0000                  	dc.l    $00000000
00003B68                            	
00003B68 1110 1110                  	dc.l    $11101110
00003B6C 1010 1010                  	dc.l    $10101010
00003B70 1011 1010                  	dc.l    $10111010
00003B74 1101 0110                  	dc.l    $11010110
00003B78 0101 0100                  	dc.l    $01010100
00003B7C 0110 1100                  	dc.l    $01101100
00003B80 0011 1000                  	dc.l    $00111000
00003B84 0000 0000                  	dc.l    $00000000
00003B88                            	
00003B88 1110 1110                  	dc.l    $11101110
00003B8C 1010 1010                  	dc.l    $10101010
00003B90 1011 1010                  	dc.l    $10111010
00003B94 1010 1010                  	dc.l    $10101010
00003B98 1001 0010                  	dc.l    $10010010
00003B9C 1011 1010                  	dc.l    $10111010
00003BA0 1110 1110                  	dc.l    $11101110
00003BA4 0000 0000                  	dc.l    $00000000
00003BA8                            	
00003BA8 1110 1110                  	dc.l    $11101110
00003BAC 1011 1010                  	dc.l    $10111010
00003BB0 1101 0110                  	dc.l    $11010110
00003BB4 0110 1100                  	dc.l    $01101100
00003BB8 1101 0110                  	dc.l    $11010110
00003BBC 1011 1010                  	dc.l    $10111010
00003BC0 1110 1110                  	dc.l    $11101110
00003BC4 0000 0000                  	dc.l    $00000000
00003BC8                            	
00003BC8 1110 1110                  	dc.l    $11101110
00003BCC 1011 1010                  	dc.l    $10111010
00003BD0 1101 0110                  	dc.l    $11010110
00003BD4 0110 1100                  	dc.l    $01101100
00003BD8 0010 1000                  	dc.l    $00101000
00003BDC 0010 1000                  	dc.l    $00101000
00003BE0 0011 1000                  	dc.l    $00111000
00003BE4 0000 0000                  	dc.l    $00000000
00003BE8                            	
00003BE8 1111 1110                  	dc.l    $11111110
00003BEC 1000 0010                  	dc.l    $10000010
00003BF0 1111 0110                  	dc.l    $11110110
00003BF4 0110 1100                  	dc.l    $01101100
00003BF8 1101 1110                  	dc.l    $11011110
00003BFC 1000 0010                  	dc.l    $10000010
00003C00 1111 1110                  	dc.l    $11111110
00003C04 0000 0000                  	dc.l    $00000000
00003C08                            	
00003C08 0111 1100                  	dc.l    $01111100
00003C0C 1100 0110                  	dc.l    $11000110
00003C10 1011 0010                  	dc.l    $10110010
00003C14 1010 1010                  	dc.l    $10101010
00003C18 1001 1010                  	dc.l    $10011010
00003C1C 1100 0110                  	dc.l    $11000110
00003C20 0111 1100                  	dc.l    $01111100
00003C24 0000 0000                  	dc.l    $00000000
00003C28                            	
00003C28 0111 1000                  	dc.l    $01111000
00003C2C 0100 1000                  	dc.l    $01001000
00003C30 0110 1000                  	dc.l    $01101000
00003C34 0010 1000                  	dc.l    $00101000
00003C38 0110 1100                  	dc.l    $01101100
00003C3C 0100 0100                  	dc.l    $01000100
00003C40 0111 1100                  	dc.l    $01111100
00003C44 0000 0000                  	dc.l    $00000000
00003C48                            	
00003C48 1111 1100                  	dc.l    $11111100
00003C4C 1000 0110                  	dc.l    $10000110
00003C50 1111 1010                  	dc.l    $11111010
00003C54 1100 0110                  	dc.l    $11000110
00003C58 1011 1110                  	dc.l    $10111110
00003C5C 1000 0010                  	dc.l    $10000010
00003C60 1111 1110                  	dc.l    $11111110
00003C64 0000 0000                  	dc.l    $00000000
00003C68                            	
00003C68 1111 1100                  	dc.l    $11111100
00003C6C 1000 0110                  	dc.l    $10000110
00003C70 1111 1010                  	dc.l    $11111010
00003C74 0010 0110                  	dc.l    $00100110
00003C78 1111 1010                  	dc.l    $11111010
00003C7C 1000 0110                  	dc.l    $10000110
00003C80 1111 1100                  	dc.l    $11111100
00003C84 0000 0000                  	dc.l    $00000000
00003C88                            	
00003C88 1110 1110                  	dc.l    $11101110
00003C8C 1010 1010                  	dc.l    $10101010
00003C90 1011 1010                  	dc.l    $10111010
00003C94 1000 0010                  	dc.l    $10000010
00003C98 1111 1010                  	dc.l    $11111010
00003C9C 0000 1010                  	dc.l    $00001010
00003CA0 0000 1110                  	dc.l    $00001110
00003CA4 0000 0000                  	dc.l    $00000000
00003CA8                            	
00003CA8 1111 1110                  	dc.l    $11111110
00003CAC 1000 0010                  	dc.l    $10000010
00003CB0 1011 1110                  	dc.l    $10111110
00003CB4 1000 0110                  	dc.l    $10000110
00003CB8 1111 1010                  	dc.l    $11111010
00003CBC 1000 0110                  	dc.l    $10000110
00003CC0 1111 1100                  	dc.l    $11111100
00003CC4 0000 0000                  	dc.l    $00000000
00003CC8                            	
00003CC8 0111 1100                  	dc.l    $01111100
00003CCC 1100 0100                  	dc.l    $11000100
00003CD0 1011 1100                  	dc.l    $10111100
00003CD4 1000 0110                  	dc.l    $10000110
00003CD8 1011 1010                  	dc.l    $10111010
00003CDC 1100 0110                  	dc.l    $11000110
00003CE0 0111 1100                  	dc.l    $01111100
00003CE4 0000 0000                  	dc.l    $00000000
00003CE8                            	
00003CE8 1111 1110                  	dc.l    $11111110
00003CEC 1000 0010                  	dc.l    $10000010
00003CF0 1111 1010                  	dc.l    $11111010
00003CF4 0011 0110                  	dc.l    $00110110
00003CF8 0110 1100                  	dc.l    $01101100
00003CFC 0101 1000                  	dc.l    $01011000
00003D00 0111 0000                  	dc.l    $01110000
00003D04 0000 0000                  	dc.l    $00000000
00003D08                            	
00003D08 0111 1100                  	dc.l    $01111100
00003D0C 1100 0110                  	dc.l    $11000110
00003D10 1011 1010                  	dc.l    $10111010
00003D14 1100 0110                  	dc.l    $11000110
00003D18 1011 1010                  	dc.l    $10111010
00003D1C 1100 0110                  	dc.l    $11000110
00003D20 0111 1100                  	dc.l    $01111100
00003D24 0000 0000                  	dc.l    $00000000
00003D28                            	
00003D28 0111 1100                  	dc.l    $01111100
00003D2C 1100 0110                  	dc.l    $11000110
00003D30 1011 1010                  	dc.l    $10111010
00003D34 1100 0010                  	dc.l    $11000010
00003D38 0111 1010                  	dc.l    $01111010
00003D3C 0100 0110                  	dc.l    $01000110
00003D40 0111 1100                  	dc.l    $01111100
00003D44 0000 0000                  	dc.l    $00000000
00003D48                            

00003D48 0000 0000                  	dc.l    $00000000
00003D4C 0000 0000                  	dc.l    $00000000
00003D50 0000 0000                  	dc.l    $00000000
00003D54 0000 0000                  	dc.l    $00000000
00003D58 0000 0000                  	dc.l    $00000000
00003D5C 1100 0000                  	dc.l    $11000000
00003D60 1100 0000                  	dc.l    $11000000
00003D64 0000 0000                  	dc.l    $00000000
00003D68                            	
00003D68 0000 0000                  	dc.l    $00000000
00003D6C 0000 0000                  	dc.l    $00000000
00003D70 0000 0000                  	dc.l    $00000000
00003D74 0000 0000                  	dc.l    $00000000
00003D78 1110 0000                  	dc.l    $11100000
00003D7C 1010 0000                  	dc.l    $10100000
00003D80 1010 0000                  	dc.l    $10100000
00003D84 1110 0000                  	dc.l    $11100000
00003D88                            	
00003D88 0111 1100                  	dc.l    $01111100
00003D8C 1100 0110                  	dc.l    $11000110
00003D90 1011 1010                  	dc.l    $10111010
00003D94 1110 0110                  	dc.l    $11100110
00003D98 0011 1100                  	dc.l    $00111100
00003D9C 0010 1000                  	dc.l    $00101000
00003DA0 0011 1000                  	dc.l    $00111000
00003DA4 0000 0000                  	dc.l    $00000000
00003DA8                            	
00003DA8 1110 0000                  	dc.l    $11100000
00003DAC 1010 0000                  	dc.l    $10100000
00003DB0 1010 0000                  	dc.l    $10100000
00003DB4 1010 0000                  	dc.l    $10100000
00003DB8 1110 0000                  	dc.l    $11100000
00003DBC 1010 0000                  	dc.l    $10100000
00003DC0 1110 0000                  	dc.l    $11100000
00003DC4 0000 0000                  	dc.l    $00000000
00003DC8                            	
00003DC8 0111 0000                  	dc.l    $01110000
00003DCC 1101 0000                  	dc.l    $11010000
00003DD0 1011 0000                  	dc.l    $10110000
00003DD4 1010 0000                  	dc.l    $10100000
00003DD8 1011 0000                  	dc.l    $10110000
00003DDC 1101 0000                  	dc.l    $11010000
00003DE0 0111 0000                  	dc.l    $01110000
00003DE4 0000 0000                  	dc.l    $00000000
00003DE8                            	
00003DE8 1110 0000                  	dc.l    $11100000
00003DEC 1011 0000                  	dc.l    $10110000
00003DF0 1101 0000                  	dc.l    $11010000
00003DF4 0101 0000                  	dc.l    $01010000
00003DF8 1101 0000                  	dc.l    $11010000
00003DFC 1011 0000                  	dc.l    $10110000
00003E00 1110 0000                  	dc.l    $11100000
00003E04 0000 0000                  	dc.l    $00000000
00003E08                            	
00003E08 1111 1000                  	dc.l    $11111000
00003E0C 1010 1000                  	dc.l    $10101000
00003E10 1010 1000                  	dc.l    $10101000
00003E14 1111 1000                  	dc.l    $11111000
00003E18 0000 0000                  	dc.l    $00000000
00003E1C 0000 0000                  	dc.l    $00000000
00003E20 0000 0000                  	dc.l    $00000000
00003E24 0000 0000                  	dc.l    $00000000
00003E28                            	
00003E28 1110 0000                  	dc.l    $11100000
00003E2C 1010 0000                  	dc.l    $10100000
00003E30 1010 0000                  	dc.l    $10100000
00003E34 1110 0000                  	dc.l    $11100000
00003E38 0000 0000                  	dc.l    $00000000
00003E3C 0000 0000                  	dc.l    $00000000
00003E40 0000 0000                  	dc.l    $00000000
00003E44 0000 0000                  	dc.l    $00000000
00003E48                            	
00003E48 0000 0000                  	dc.l    $00000000
00003E4C 1110 0000                  	dc.l    $11100000
00003E50 1010 0000                  	dc.l    $10100000
00003E54 1110 0000                  	dc.l    $11100000
00003E58 1010 0000                  	dc.l    $10100000
00003E5C 1110 0000                  	dc.l    $11100000
00003E60 0000 0000                  	dc.l    $00000000
00003E64 0000 0000                  	dc.l    $00000000
00003E68                            	
00003E68 0111 1100                  	dc.l    $01111100
00003E6C 1101 0110                  	dc.l    $11010110
00003E70 1000 0010                  	dc.l    $10000010
00003E74 1101 0110                  	dc.l    $11010110
00003E78 1000 0010                  	dc.l    $10000010
00003E7C 1101 0110                  	dc.l    $11010110
00003E80 0111 1100                  	dc.l    $01111100
00003E84 0000 0000                  	dc.l    $00000000
00003E88                            	
00003E88 0011 1000                  	dc.l    $00111000
00003E8C 0010 1000                  	dc.l    $00101000
00003E90 1110 1110                  	dc.l    $11101110
00003E94 1000 0010                  	dc.l    $10000010
00003E98 1110 1110                  	dc.l    $11101110
00003E9C 0010 1000                  	dc.l    $00101000
00003EA0 0011 1000                  	dc.l    $00111000
00003EA4 0000 0000                  	dc.l    $00000000
00003EA8                            	
00003EA8 0000 0000                  	dc.l    $00000000
00003EAC 0000 0000                  	dc.l    $00000000
00003EB0 1111 1110                  	dc.l    $11111110
00003EB4 1000 0010                  	dc.l    $10000010
00003EB8 1111 1110                  	dc.l    $11111110
00003EBC 0000 0000                  	dc.l    $00000000
00003EC0 0000 0000                  	dc.l    $00000000
00003EC4 0000 0000                  	dc.l    $00000000
00003EC8                            	
00003EC8 0001 1100                  	dc.l    $00011100
00003ECC 0011 0100                  	dc.l    $00110100
00003ED0 0110 1100                  	dc.l    $01101100
00003ED4 1101 1000                  	dc.l    $11011000
00003ED8 1011 0000                  	dc.l    $10110000
00003EDC 1110 0000                  	dc.l    $11100000
00003EE0 0000 0000                  	dc.l    $00000000
00003EE4 0000 0000                  	dc.l    $00000000
00003EE8                            

00003EE8                            PixelFontEnd                                 ; Font end address
00003EE8 =00000640                  PixelFontSizeB: equ (PixelFontEnd-PixelFont) ; Font size in bytes
00003EE8 =00000320                  PixelFontSizeW: equ (PixelFontSizeB/2)       ; Font size in words
00003EE8 =00000190                  PixelFontSizeL: equ (PixelFontSizeB/4)       ; Font size in longs
00003EE8 =00000032                  PixelFontSizeT: equ (PixelFontSizeB/32)      ; Font size in tiles
00003EE8 =00000000                  PixelFontTileID: equ (PixelFontVRAM/32)      ; ID of first tile
00003EE8 =00000000                  PixelFontTileID: equ (PixelFontVRAM/32)      ; ID of first tile
00003EE8                                  include assets\sprites\selarrow.asm
00003EE8                            ;==============================================================
00003EE8                            ;   Scorpion Illuminati
00003EE8                            ;==============================================================
00003EE8                            ;   SEGA Genesis (c) SegaDev
00003EE8                            ;==============================================================
00003EE8                            

00003EE8                            SelectionArrow:
00003EE8                            

00003EE8 0003 3000                        dc.l	0x00033000                                                         ;    XX   
00003EEC 0003 3300                        dc.l	0x00033300                                                         ;    X X  
00003EF0 3333 3330                        dc.l	0x33333330                                                         ; XXXX  X 
00003EF4 3333 3333                        dc.l	0x33333333                                                         ; X      X
00003EF8 3333 3333                        dc.l	0x33333333                                                         ; X      X
00003EFC 3333 3330                        dc.l	0x33333330                                                         ; XXXX  X 
00003F00 0003 3300                        dc.l	0x00033300                                                         ;    X X  
00003F04 0003 3000                        dc.l	0x00033000                                                         ;    XX   
00003F08                            

00003F08                            SelectionArrowEnd                                                              ; Sprite end address
00003F08 =00000020                  SelectionArrowSizeB: equ (SelectionArrowEnd-SelectionArrow)                    ; Sprite size in bytes
00003F08 =00000010                  SelectionArrowSizeW: equ (SelectionArrowSizeB/2)                               ; Sprite size in words
00003F08 =00000008                  SelectionArrowSizeL: equ (SelectionArrowSizeB/4)                               ; Sprite size in longs
00003F08 =00000001                  SelectionArrowSizeT: equ (SelectionArrowSizeB/32)                              ; Sprite size in tiles
00003F08                            SelectionArrowTileID: equ (SelectionArrowVRAM/32)                              ; ID of first tile
00003F08 =00000000                  SelectionArrowDimensionBits: equ (%00000000)                                   ; Sprite dimensions (1x1)
00003F08                            

00003F08 =00000101                  SelectionArrowDimensions: equ 0x0101                                           ; 1x1 subsprites
00003F08 =00000001                  SelectionArrowSizeS: equ 1                                                     ; Sprite size in 4x4 subsprites
00003F08 =00000008                  SelectionArrowWidth: equ 0x08                                                  ; cursor width in pixels
00003F08 =00000008                  SelectionArrowHeight: equ 0x08                                                 ; cursor height in pixels
00003F08                            

00003F08                            ; Subsprite dimensions
00003F08                            SelectionArrowSubSpriteDimensions:
00003F08 0101                             dc.w 0x0101                                                              ; Top-left     (1x1)
00003F0A                                  even
00003F0A                                  even
00003F0A                                  include assets\sprites\grnnote.asm
00003F0A                            ;==============================================================
00003F0A                            ;   Scorpion Illuminati
00003F0A                            ;==============================================================
00003F0A                            ;   SEGA Genesis (c) SegaDev
00003F0A                            ;==============================================================
00003F0A                            

00003F0A                            GreenNote:
00003F0A                            

00003F0A 0022 2200                        dc.l	0x00222200                                                         ;   XXXX  
00003F0E 0225 5220                        dc.l	0x02255220                                                         ;  XX  XX 
00003F12 2250 0522                        dc.l	0x22500522                                                         ; XX    XX
00003F16 2500 0052                        dc.l	0x25000052                                                         ; X      X
00003F1A 2500 0052                        dc.l	0x25000052                                                         ; X      X
00003F1E 2250 0522                        dc.l	0x22500522                                                         ; XX    XX
00003F22 0225 5220                        dc.l	0x02255220                                                         ;  XX  XX 
00003F26 0022 2200                        dc.l	0x00222200                                                         ;   XXXX  
00003F2A                            

00003F2A                            GreenNoteEnd                                                                   ; Sprite end address
00003F2A =00000020                  GreenNoteSizeB: equ (GreenNoteEnd-GreenNote)                                   ; Sprite size in bytes
00003F2A =00000010                  GreenNoteSizeW: equ (GreenNoteSizeB/2)                                         ; Sprite size in words
00003F2A =00000008                  GreenNoteSizeL: equ (GreenNoteSizeB/4)                                         ; Sprite size in longs
00003F2A =00000001                  GreenNoteSizeT: equ (GreenNoteSizeB/32)                                        ; Sprite size in tiles
00003F2A                            GreenNoteTileID: equ (GreenNoteVRAM/32)                                        ; ID of first tile
00003F2A =00000000                  GreenNoteDimensionBits: equ (%00000000)                                        ; Sprite dimensions (1x1)
00003F2A                            

00003F2A =00000101                  GreenNoteDimensions: equ 0x0101                                                ; 1x1 subsprites
00003F2A =00000001                  GreenNoteSizeS: equ 1                                                          ; Sprite size in 4x4 subsprites
00003F2A =00000008                  GreenNoteWidth: equ 0x08                                                       ; cursor width in pixels
00003F2A =00000008                  GreenNoteHeight: equ 0x08                                                      ; cursor height in pixels
00003F2A                            

00003F2A                            ; Subsprite dimensions
00003F2A                            GreenNoteSubSpriteDimensions:
00003F2A 0101                             dc.w 0x0101                                                              ; Top-left     (1x1)
00003F2C                                  even
00003F2C                                  even
00003F2C                                  include assets\sprites\rednote.asm
00003F2C                            ;==============================================================
00003F2C                            ;   Scorpion Illuminati
00003F2C                            ;==============================================================
00003F2C                            ;   SEGA Genesis (c) SegaDev
00003F2C                            ;==============================================================
00003F2C                            

00003F2C                            RedNote:
00003F2C                            

00003F2C 0011 1100                        dc.l	0x00111100                                                         ;   XXXX  
00003F30 0115 5110                        dc.l	0x01155110                                                         ;  XX  XX 
00003F34 1150 0511                        dc.l	0x11500511                                                         ; XX    XX
00003F38 1500 0051                        dc.l	0x15000051                                                         ; X      X
00003F3C 1500 0051                        dc.l	0x15000051                                                         ; X      X
00003F40 1150 0511                        dc.l	0x11500511                                                         ; XX    XX
00003F44 0115 5110                        dc.l	0x01155110                                                         ;  XX  XX 
00003F48 0011 1100                        dc.l	0x00111100                                                         ;   XXXX  
00003F4C                            

00003F4C                            RedNoteEnd                                                                     ; Sprite end address
00003F4C =00000020                  RedNoteSizeB: equ (RedNoteEnd-RedNote)                                         ; Sprite size in bytes
00003F4C =00000010                  RedNoteSizeW: equ (RedNoteSizeB/2)                                             ; Sprite size in words
00003F4C =00000008                  RedNoteSizeL: equ (RedNoteSizeB/4)                                             ; Sprite size in longs
00003F4C =00000001                  RedNoteSizeT: equ (RedNoteSizeB/32)                                            ; Sprite size in tiles
00003F4C                            RedNoteTileID: equ (RedNoteVRAM/32)                                            ; ID of first tile
00003F4C =00000000                  RedNoteDimensionBits: equ (%00000000)                                          ; Sprite dimensions (1x1)
00003F4C                            

00003F4C =00000101                  RedNoteDimensions: equ 0x0101                                                  ; 1x1 subsprites
00003F4C =00000001                  RedNoteSizeS: equ 1                                                            ; Sprite size in 4x4 subsprites
00003F4C =00000008                  RedNoteWidth: equ 0x08                                                         ; sprite width in pixels
00003F4C =00000008                  RedNoteHeight: equ 0x08                                                        ; sprite height in pixels
00003F4C                            

00003F4C                            ; Subsprite dimensions
00003F4C                            RedNoteSubSpriteDimensions:
00003F4C 0101                             dc.w 0x0101                                                              ; Top-left     (1x1)
00003F4E                                  even
00003F4E                                  even
00003F4E                                  include assets\sprites\rockind.asm
00003F4E                            ;==============================================================
00003F4E                            ;   Scorpion Illuminati
00003F4E                            ;==============================================================
00003F4E                            ;   SEGA Genesis (c) SegaDev
00003F4E                            ;==============================================================
00003F4E                            

00003F4E                            RockIndicator:
00003F4E                            

00003F4E 5555 5555                        dc.l	0x55555555                                                         ; XXXXXXXX
00003F52 0005 5000                        dc.l	0x00055000                                                         ;    XX   
00003F56 0005 5000                        dc.l	0x00055000                                                         ;    XX   
00003F5A 0005 5000                        dc.l	0x00055000                                                         ;    XX   
00003F5E 0005 5000                        dc.l	0x00055000                                                         ;    XX   
00003F62 0005 5000                        dc.l	0x00055000                                                         ;    XX   
00003F66 0005 5000                        dc.l	0x00055000                                                         ;    XX   
00003F6A 5555 5555                        dc.l	0x55555555                                                         ; XXXXXXXX
00003F6E                            

00003F6E                            RockIndicatorEnd                                                               ; Sprite end address
00003F6E =00000020                  RockIndicatorSizeB: equ (RockIndicatorEnd-RockIndicator)                       ; Sprite size in bytes
00003F6E =00000010                  RockIndicatorSizeW: equ (RockIndicatorSizeB/2)                                 ; Sprite size in words
00003F6E =00000008                  RockIndicatorSizeL: equ (RockIndicatorSizeB/4)                                 ; Sprite size in longs
00003F6E =00000001                  RockIndicatorSizeT: equ (RockIndicatorSizeB/32)                                ; Sprite size in tiles
00003F6E                            RockIndicatorTileID: equ (RockIndicatorVRAM/32)                                ; ID of first tile
00003F6E =00000000                  RockIndicatorDimensionBits: equ (%00000000)                                    ; Sprite dimensions (1x1)
00003F6E                            

00003F6E =00000101                  RockIndicatorDimensions: equ 0x0101                                            ; 1x1 subsprites
00003F6E =00000001                  RockIndicatorSizeS: equ 1                                                      ; Sprite size in 4x4 subsprites
00003F6E =00000008                  RockIndicatorWidth: equ 0x08                                                   ; cursor width in pixels
00003F6E =00000008                  RockIndicatorHeight: equ 0x08                                                  ; cursor height in pixels
00003F6E                            

00003F6E                            ; Subsprite dimensions
00003F6E                            RockIndicatorSubSpriteDimensions:
00003F6E 0101                             dc.w 0x0101                                                              ; Top-left     (1x1)
00003F70                                  even
00003F70                                  even
00003F70                                  include assets\tiles\title.asm
00003F70                            ;==============================================================
00003F70                            ;   Scorpion Illuminati
00003F70                            ;==============================================================
00003F70                            ;   SEGA Genesis (c) SegaDev 2014
00003F70                            ;==============================================================
00003F70                            

00003F70                            TitleScreenTiles:
00003F70 0000 0000                        dc.l	$00000000                                                          ; 
00003F74 0000 0000                        dc.l	$00000000                                                          ;
00003F78 0000 0000                        dc.l	$00000000                                                          ;
00003F7C 0000 0000                        dc.l	$00000000                                                          ;
00003F80 0000 0000                        dc.l	$00000000                                                          ;
00003F84 0000 0000                        dc.l	$00000000                                                          ;
00003F88 0000 0000                        dc.l	$00000000                                                          ;
00003F8C 0000 0000                        dc.l	$00000000                                                          ; 
00003F90                            

00003F90 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00003F94 4333 3334                        dc.l  $43333334                                                          ; X      X
00003F98 4333 3334                        dc.l  $43333334                                                          ; X      X
00003F9C 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FA0 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FA4 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FA8 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FAC 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FB0                            

00003FB0 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FB4 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FB8 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FBC 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FC0 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FC4 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FC8 4333 3334                        dc.l  $43333334                                                          ; X      X
00003FCC 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00003FD0                            

00003FD0 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00003FD4 4333 3333                        dc.l  $43333333                                                          ; X       
00003FD8 4333 3333                        dc.l  $43333333                                                          ; X       
00003FDC 4333 3333                        dc.l  $43333333                                                          ; X       
00003FE0 4333 3333                        dc.l  $43333333                                                          ; X       
00003FE4 4333 3333                        dc.l  $43333333                                                          ; X       
00003FE8 4333 3333                        dc.l  $43333333                                                          ; X       
00003FEC 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00003FF0                            

00003FF0 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00003FF4 3333 3334                        dc.l  $33333334                                                          ;        X
00003FF8 3333 3334                        dc.l  $33333334                                                          ;        X
00003FFC 3333 3334                        dc.l  $33333334                                                          ;        X
00004000 3333 3334                        dc.l  $33333334                                                          ;        X
00004004 3333 3334                        dc.l  $33333334                                                          ;        X
00004008 3333 3334                        dc.l  $33333334                                                          ;        X
0000400C 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004010                            

00004010 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004014 3333 3333                        dc.l  $33333333                                                          ;         
00004018 3333 3333                        dc.l  $33333333                                                          ;         
0000401C 3333 3333                        dc.l  $33333333                                                          ;         
00004020 3333 3333                        dc.l  $33333333                                                          ;         
00004024 3333 3333                        dc.l  $33333333                                                          ;         
00004028 3333 3333                        dc.l  $33333333                                                          ;         
0000402C 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004030                            

00004030 4333 3334                        dc.l  $43333334                                                          ; X      X
00004034 4333 3334                        dc.l  $43333334                                                          ; X      X
00004038 4333 3334                        dc.l  $43333334                                                          ; X      X
0000403C 4333 3334                        dc.l  $43333334                                                          ; X      X
00004040 4333 3334                        dc.l  $43333334                                                          ; X      X
00004044 4333 3334                        dc.l  $43333334                                                          ; X      X
00004048 4333 3334                        dc.l  $43333334                                                          ; X      X
0000404C 4333 3334                        dc.l  $43333334                                                          ; X      X
00004050                            

00004050 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004054 4333 3333                        dc.l  $43333333                                                          ; X       
00004058 4333 3333                        dc.l  $43333333                                                          ; X       
0000405C 4333 3333                        dc.l  $43333333                                                          ; X       
00004060 4333 3333                        dc.l  $43333333                                                          ; X       
00004064 4333 3333                        dc.l  $43333333                                                          ; X       
00004068 4333 3333                        dc.l  $43333333                                                          ; X       
0000406C 4333 3333                        dc.l  $43333333                                                          ; X
00004070                            

00004070 4333 3333                        dc.l  $43333333                                                          ; X
00004074 4333 3333                        dc.l  $43333333                                                          ; X       
00004078 4333 3333                        dc.l  $43333333                                                          ; X       
0000407C 4333 3333                        dc.l  $43333333                                                          ; X       
00004080 4333 3333                        dc.l  $43333333                                                          ; X       
00004084 4333 3333                        dc.l  $43333333                                                          ; X       
00004088 4333 3333                        dc.l  $43333333                                                          ; X       
0000408C 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004090                            

00004090 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004094 3333 3334                        dc.l  $33333334                                                          ;        X
00004098 3333 3334                        dc.l  $33333334                                                          ;        X
0000409C 3333 3334                        dc.l  $33333334                                                          ;        X
000040A0 3333 3334                        dc.l  $33333334                                                          ;        X
000040A4 3333 3334                        dc.l  $33333334                                                          ;        X
000040A8 3333 3334                        dc.l  $33333334                                                          ;        X
000040AC 3333 3334                        dc.l  $33333334                                                          ;        X
000040B0                            

000040B0 3333 3334                        dc.l  $33333334                                                          ;        X
000040B4 3333 3334                        dc.l  $33333334                                                          ;        X
000040B8 3333 3334                        dc.l  $33333334                                                          ;        X
000040BC 3333 3334                        dc.l  $33333334                                                          ;        X
000040C0 3333 3334                        dc.l  $33333334                                                          ;        X
000040C4 3333 3334                        dc.l  $33333334                                                          ;        X
000040C8 3333 3334                        dc.l  $33333334                                                          ;        X
000040CC 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
000040D0                            

000040D0 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX 
000040D4 3333 3333                        dc.l  $33333333                                                          ;         
000040D8 3333 3333                        dc.l  $33333333                                                          ;         
000040DC 3333 3333                        dc.l  $33333333                                                          ;         
000040E0 3333 3333                        dc.l  $33333333                                                          ;         
000040E4 3333 3333                        dc.l  $33333333                                                          ;         
000040E8 3333 3333                        dc.l  $33333333                                                          ;         
000040EC 3333 3333                        dc.l  $33333333                                                          ;         
000040F0                            

000040F0 3333 3333                        dc.l  $33333333                                                          ;         
000040F4 3333 3333                        dc.l  $33333333                                                          ;         
000040F8 3333 3333                        dc.l  $33333333                                                          ;         
000040FC 3333 3333                        dc.l  $33333333                                                          ;         
00004100 3333 3333                        dc.l  $33333333                                                          ;         
00004104 3333 3333                        dc.l  $33333333                                                          ;         
00004108 3333 3333                        dc.l  $33333333                                                          ;         
0000410C 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
00004110                            

00004110 4333 3333                        dc.l  $43333333                                                          ; X       
00004114 4333 3333                        dc.l  $43333333                                                          ; X       
00004118 4333 3333                        dc.l  $43333333                                                          ; X       
0000411C 4333 3333                        dc.l  $43333333                                                          ; X       
00004120 4333 3333                        dc.l  $43333333                                                          ; X       
00004124 4333 3333                        dc.l  $43333333                                                          ; X       
00004128 4333 3333                        dc.l  $43333333                                                          ; X       
0000412C 4333 3333                        dc.l  $43333333                                                          ; X       
00004130                            

00004130 3333 3334                        dc.l  $33333334                                                          ;        X
00004134 3333 3334                        dc.l  $33333334                                                          ;        X
00004138 3333 3334                        dc.l  $33333334                                                          ;        X
0000413C 3333 3334                        dc.l  $33333334                                                          ;        X
00004140 3333 3334                        dc.l  $33333334                                                          ;        X
00004144 3333 3334                        dc.l  $33333334                                                          ;        X
00004148 3333 3334                        dc.l  $33333334                                                          ;        X
0000414C 3333 3334                        dc.l  $33333334                                                          ;        X
00004150                            

00004150                            TitleScreenTilesEnd                                                            ; Tiles end address
00004150 =000001E0                  TitleScreenTilesSizeB: equ (TitleScreenTilesEnd-TitleScreenTiles)              ; Tiles size in bytes
00004150 =000000F0                  TitleScreenTilesSizeW: equ (TitleScreenTilesSizeB/SizeWord)                    ; Tiles size in words
00004150 =00000078                  TitleScreenTilesSizeL: equ (TitleScreenTilesSizeB/SizeLong)                    ; Tiles size in longs
00004150 =0000000F                  TitleScreenTilesSizeT: equ (TitleScreenTilesSizeB/SizeTile)                    ; Tiles size in tiles
00004150                            TitleScreenTilesTileID: equ (TitleScreenTilesVRAM/SizeTile)                    ; ID of first tile
00004150                            TitleScreenTilesTileID: equ (TitleScreenTilesVRAM/SizeTile)                    ; ID of first tile
00004150                                  include assets\tiles\songlist.asm
00004150                            ;==============================================================
00004150                            ;   Scorpion Illuminati
00004150                            ;==============================================================
00004150                            ;   SEGA Genesis (c) SegaDev 2014
00004150                            ;==============================================================
00004150                            

00004150                            SonglistScreenTiles:
00004150 0000 0000                        dc.l	$00000000                                                          ; 
00004154 0000 0000                        dc.l	$00000000                                                          ;
00004158 0000 0000                        dc.l	$00000000                                                          ;
0000415C 0000 0000                        dc.l	$00000000                                                          ;
00004160 0000 0000                        dc.l	$00000000                                                          ;
00004164 0000 0000                        dc.l	$00000000                                                          ;
00004168 0000 0000                        dc.l	$00000000                                                          ;
0000416C 0000 0000                        dc.l	$00000000                                                          ; 
00004170                            

00004170 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004174 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004178 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
0000417C 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004180 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004184 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004188 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
0000418C 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004190                            

00004190 5454 5454                        dc.l  $54545454                                                          ; X X X X 
00004194 4545 4545                        dc.l  $45454545                                                          ;  X X X X
00004198 5454 5454                        dc.l  $54545454                                                          ; X X X X 
0000419C 4545 4545                        dc.l  $45454545                                                          ;  X X X X
000041A0 5454 5454                        dc.l  $54545454                                                          ; X X X X 
000041A4 4545 4545                        dc.l  $45454545                                                          ;  X X X X
000041A8 5454 5454                        dc.l  $54545454                                                          ; X X X X 
000041AC 4545 4545                        dc.l  $45454545                                                          ;  X X X X
000041B0                            

000041B0 5544 4455                        dc.l  $55444455                                                          ;   XXXX  
000041B4 5444 4445                        dc.l  $54444445                                                          ;  XXXXXX 
000041B8 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
000041BC 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
000041C0 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
000041C4 4444 4444                        dc.l  $44444444                                                          ; XXXXXXXX
000041C8 5444 4445                        dc.l  $54444445                                                          ;  XXXXXX 
000041CC 5544 4455                        dc.l  $55444455                                                          ;   XXXX  
000041D0                            

000041D0                            SonglistScreenTilesEnd                                                         ; Tiles end address
000041D0 =00000080                  SonglistScreenTilesSizeB: equ (SonglistScreenTilesEnd-SonglistScreenTiles)     ; Tiles size in bytes
000041D0 =00000040                  SonglistScreenTilesSizeW: equ (SonglistScreenTilesSizeB/SizeWord)              ; Tiles size in words
000041D0 =00000020                  SonglistScreenTilesSizeL: equ (SonglistScreenTilesSizeB/SizeLong)              ; Tiles size in longs
000041D0 =00000004                  SonglistScreenTilesSizeT: equ (SonglistScreenTilesSizeB/SizeTile)              ; Tiles size in tiles
000041D0                            SonglistScreenTilesTileID: equ (SonglistScreenTilesVRAM/SizeTile)              ; ID of first tile
000041D0                            SonglistScreenTilesTileID: equ (SonglistScreenTilesVRAM/SizeTile)              ; ID of first tile
000041D0                                  include assets\tiles\game.asm
000041D0                            ;==============================================================
000041D0                            ;   Scorpion Illuminati
000041D0                            ;==============================================================
000041D0                            ;   SEGA Genesis (c) SegaDev 2014
000041D0                            ;==============================================================
000041D0                            

000041D0                            GameTiles:
000041D0 0000 0000                        dc.l	$00000000                                                          ; 
000041D4 0000 0000                        dc.l	$00000000                                                          ;
000041D8 0000 0000                        dc.l	$00000000                                                          ;
000041DC 0000 0000                        dc.l	$00000000                                                          ;
000041E0 0000 0000                        dc.l	$00000000                                                          ;
000041E4 0000 0000                        dc.l	$00000000                                                          ;
000041E8 0000 0000                        dc.l	$00000000                                                          ;
000041EC 0000 0000                        dc.l	$00000000                                                          ; 
000041F0                            

000041F0 0000 0000                        dc.l  $00000000                                                          ;         
000041F4 0000 0000                        dc.l  $00000000                                                          ;         
000041F8 5555 5555                        dc.l  $55555555                                                          ;   XXXX  
000041FC 5555 5555                        dc.l  $55555555                                                          ;   XXXX  
00004200 5555 5555                        dc.l  $55555555                                                          ;   XXXX  
00004204 5555 5555                        dc.l  $55555555                                                          ;   XXXX  
00004208 0000 0000                        dc.l  $00000000                                                          ;         
0000420C 0000 0000                        dc.l  $00000000                                                          ;         
00004210                            

00004210 0000 0000                        dc.l  $00000000                                                          ;         
00004214 0000 0000                        dc.l  $00000000                                                          ;         
00004218 BBBB BBBB                        dc.l  $BBBBBBBB                                                          ;   XXXX  
0000421C BBBB BBBB                        dc.l  $BBBBBBBB                                                          ;   XXXX  
00004220 BBBB BBBB                        dc.l  $BBBBBBBB                                                          ;   XXXX  
00004224 BBBB BBBB                        dc.l  $BBBBBBBB                                                          ;   XXXX  
00004228 0000 0000                        dc.l  $00000000                                                          ;         
0000422C 0000 0000                        dc.l  $00000000                                                          ;         
00004230                            

00004230 000B B000                        dc.l  $000BB000                                                          ;    XX   
00004234 000B B000                        dc.l  $000BB000                                                          ;    XX   
00004238 000B B000                        dc.l  $000BB000                                                          ;    XX   
0000423C 000B B000                        dc.l  $000BB000                                                          ;    XX   
00004240 000B B000                        dc.l  $000BB000                                                          ;    XX   
00004244 000B B000                        dc.l  $000BB000                                                          ;    XX   
00004248 000B B000                        dc.l  $000BB000                                                          ;    XX   
0000424C 000B B000                        dc.l  $000BB000                                                          ;    XX   
00004250                            

00004250 00AA AA00                        dc.l	$00AAAA00                                                          ;   XXXX  
00004254 0AA0 0AA0                        dc.l	$0AA00AA0                                                          ;  XX  XX 
00004258 AA0B B0AA                        dc.l	$AA0BB0AA                                                          ; XX XX XX
0000425C A0BB BB0A                        dc.l	$A0BBBB0A                                                          ; X XXXX X
00004260 A0BB BB0A                        dc.l	$A0BBBB0A                                                          ; X XXXX X
00004264 AA0B B0AA                        dc.l	$AA0BB0AA                                                          ; XX XX XX
00004268 0AA0 0AA0                        dc.l	$0AA00AA0                                                          ;  XX  XX 
0000426C 00AA AA00                        dc.l	$00AAAA00                                                          ;   XXXX  
00004270                            

00004270 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004274 2222 2222                        dc.l  $22222222                                                          ; XXXXXXXX
00004278 2222 2222                        dc.l  $22222222                                                          ; XXXXXXXX
0000427C 2222 2222                        dc.l  $22222222                                                          ; XXXXXXXX
00004280 2222 2222                        dc.l  $22222222                                                          ; XXXXXXXX
00004284 2222 2222                        dc.l  $22222222                                                          ; XXXXXXXX
00004288 2222 2222                        dc.l  $22222222                                                          ; XXXXXXXX
0000428C 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004290                             
00004290 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
00004294 6666 6666                        dc.l  $66666666                                                          ; XXXXXXXX
00004298 6666 6666                        dc.l  $66666666                                                          ; XXXXXXXX
0000429C 6666 6666                        dc.l  $66666666                                                          ; XXXXXXXX
000042A0 6666 6666                        dc.l  $66666666                                                          ; XXXXXXXX
000042A4 6666 6666                        dc.l  $66666666                                                          ; XXXXXXXX
000042A8 6666 6666                        dc.l  $66666666                                                          ; XXXXXXXX
000042AC 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
000042B0                             
000042B0 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
000042B4 1111 1111                        dc.l  $11111111                                                          ; XXXXXXXX
000042B8 1111 1111                        dc.l  $11111111                                                          ; XXXXXXXX
000042BC 1111 1111                        dc.l  $11111111                                                          ; XXXXXXXX
000042C0 1111 1111                        dc.l  $11111111                                                          ; XXXXXXXX
000042C4 1111 1111                        dc.l  $11111111                                                          ; XXXXXXXX
000042C8 1111 1111                        dc.l  $11111111                                                          ; XXXXXXXX
000042CC 5555 5555                        dc.l  $55555555                                                          ; XXXXXXXX
000042D0                            

000042D0                            GameTilesEnd                                                                   ; Tiles end address
000042D0 =00000100                  GameTilesSizeB: equ (GameTilesEnd-GameTiles)                                   ; Tiles size in bytes
000042D0 =00000080                  GameTilesSizeW: equ (GameTilesSizeB/SizeWord)                                  ; Tiles size in words
000042D0 =00000040                  GameTilesSizeL: equ (GameTilesSizeB/SizeLong)                                  ; Tiles size in longs
000042D0 =00000008                  GameTilesSizeT: equ (GameTilesSizeB/SizeTile)                                  ; Tiles size in tiles
000042D0                            GameTilesTileID: equ (GameTilesVRAM/SizeTile)                                  ; ID of first tile
000042D0                            GameTilesTileID: equ (GameTilesVRAM/SizeTile)                                  ; ID of first tile
000042D0                                  include assets\tiles\stats.asm
000042D0                            ;==============================================================
000042D0                            ;   Scorpion Illuminati
000042D0                            ;==============================================================
000042D0                            ;   SEGA Genesis (c) SegaDev 2014
000042D0                            ;==============================================================
000042D0                            

000042D0                            StatsScreenTiles:
000042D0 0000 0000                        dc.l	$00000000                                                          ; 
000042D4 0000 0000                        dc.l	$00000000                                                          ;
000042D8 0000 0000                        dc.l	$00000000                                                          ;
000042DC 0000 0000                        dc.l	$00000000                                                          ;
000042E0 0000 0000                        dc.l	$00000000                                                          ;
000042E4 0000 0000                        dc.l	$00000000                                                          ;
000042E8 0000 0000                        dc.l	$00000000                                                          ;
000042EC 0000 0000                        dc.l	$00000000                                                          ; 
000042F0                            

000042F0 1111 1111                        dc.l  $11111111                                                          ; 
000042F4 1111 1511                        dc.l  $11111511                                                          ; XXXXXXXX
000042F8 1555 5551                        dc.l  $15555551                                                          ; X      X
000042FC 1151 1111                        dc.l  $11511111                                                          ; X      X
00004300 1555 5551                        dc.l  $15555551                                                          ; X      X
00004304 1111 5111                        dc.l  $11115111                                                          ; X      X
00004308 1555 5551                        dc.l  $15555551                                                          ; XXXXXXXX
0000430C 1111 1111                        dc.l  $11111111                                                          ;         
00004310                            

00004310                            StatsScreenTilesEnd                                                            ; Tiles end address
00004310 =00000040                  StatsScreenTilesSizeB: equ (StatsScreenTilesEnd-StatsScreenTiles)              ; Tiles size in bytes
00004310 =00000020                  StatsScreenTilesSizeW: equ (StatsScreenTilesSizeB/SizeWord)                    ; Tiles size in words
00004310 =00000010                  StatsScreenTilesSizeL: equ (StatsScreenTilesSizeB/SizeLong)                    ; Tiles size in longs
00004310 =00000002                  StatsScreenTilesSizeT: equ (StatsScreenTilesSizeB/SizeTile)                    ; Tiles size in tiles
00004310                            StatsScreenTilesTileID: equ (StatsScreenTilesVRAM/SizeTile)                    ; ID of first tile
00004310                            StatsScreenTilesTileID: equ (StatsScreenTilesVRAM/SizeTile)                    ; ID of first tile
00004310                                  include assets\tiles\crashand.asm
00004310                            ;==============================================================
00004310                            ;   Scorpion Illuminati
00004310                            ;==============================================================
00004310                            ;   SEGA Genesis (c) SegaDev 2014
00004310                            ;==============================================================
00004310                            

00004310                            CrashHandlerTiles:
00004310 0000 0000                        dc.l	$00000000                                                          ; 
00004314 0000 0000                        dc.l	$00000000                                                          ;
00004318 0000 0000                        dc.l	$00000000                                                          ;
0000431C 0000 0000                        dc.l	$00000000                                                          ;
00004320 0000 0000                        dc.l	$00000000                                                          ;
00004324 0000 0000                        dc.l	$00000000                                                          ;
00004328 0000 0000                        dc.l	$00000000                                                          ;
0000432C 0000 0000                        dc.l	$00000000                                                          ; 
00004330                            

00004330                            CrashHandlerTilesEnd                                                           ; Tiles end address
00004330 =00000020                  CrashHandlerTilesSizeB: equ (CrashHandlerTilesEnd-CrashHandlerTiles)           ; Tiles size in bytes
00004330 =00000010                  CrashHandlerTilesSizeW: equ (CrashHandlerTilesSizeB/SizeWord)                  ; Tiles size in words
00004330 =00000008                  CrashHandlerTilesSizeL: equ (CrashHandlerTilesSizeB/SizeLong)                  ; Tiles size in longs
00004330 =00000001                  CrashHandlerTilesSizeT: equ (CrashHandlerTilesSizeB/SizeTile)                   ; Tiles size in tiles
00004330                            CrashHandlerTilesTileID: equ (CrashHandlerTilesVRAM/SizeTile)                  ; ID of first tile
00004330                            CrashHandlerTilesTileID: equ (CrashHandlerTilesVRAM/SizeTile)                  ; ID of first tile
00004330                                  include assets\maps\title.asm
00004330                            ;==============================================================
00004330                            ;   Scorpion Illuminati
00004330                            ;==============================================================
00004330                            ;   SEGA Genesis (c) SegaDev 2014
00004330                            ;==============================================================
00004330                            TitleScreenMap:
00004330                            

00004330 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000043B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004430 0000 0000 0000 0000 0007+        dc.w $0000, $0000, $0000, $0000, $0007, $0005, $0004, $0000, $0007, $0005, $0004, $0000, $0007, $0005, $0009, $0000, $0007, $0005, $0009, $0000, $0007, $0005, $0009, $0000, $0003, $000B, $0004, $0000, $0007, $0005, $0009, $0000, $0007, $0005, $0009, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000044B0 0000 0000 0000 0000 0006+        dc.w $0000, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004530 0000 0000 0000 0000 0008+        dc.w $0000, $0000, $0000, $0000, $0008, $0005, $0009, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $000D, $0005, $000A, $0000, $000D, $0005, $000A, $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000045B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004630 0000 0000 0000 0000 0003+        dc.w $0000, $0000, $0000, $0000, $0003, $0005, $000A, $0000, $0008, $0005, $0004, $0000, $0008, $0005, $000A, $0000, $0002, $0000, $0002, $0000, $0002, $0000, $0000, $0000, $0003, $000C, $0004, $0000, $0008, $0005, $000A, $0000, $0002, $0000, $0002, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000046B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004730 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000047B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004830 0000 0003 000B 0004 0000+        dc.w $0000, $0003, $000B, $0004, $0000, $0001, $0000, $0000, $0000, $0001, $0000, $0000, $0000, $0001, $0000, $0001, $0000, $0001, $0001, $0001, $0000, $0003, $000B, $0004, $0000, $0007, $0005, $0009, $0000, $0007, $000B, $0009, $0000, $0003, $000B, $0004, $0000, $0003, $000B, $0004, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000048B0 0000 0000 0006 0000 0000+        dc.w $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0006, $0006, $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0006, $0000, $000D, $0000, $000E, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004930 0000 0000 0006 0000 0000+        dc.w $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0002, $0006, $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0006, $0000, $000D, $000C, $000E, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000049B0 0000 0000 0006 0000 0000+        dc.w $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0006, $0000, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0006, $0000, $0000, $0006, $0000, $0000, $0000, $0006, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004A30 0000 0003 000C 0004 0000+        dc.w $0000, $0003, $000C, $0004, $0000, $0008, $0005, $0004, $0000, $0008, $0005, $0004, $0000, $0008, $0005, $000A, $0000, $0002, $0000, $0002, $0000, $0003, $000C, $0004, $0000, $0002, $0000, $0002, $0000, $0002, $0000, $0002, $0000, $0000, $0002, $0000, $0000, $0003, $000C, $0004, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004AB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004B30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004BB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004C30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004CB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004D30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004DB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004E30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004EB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004F30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00004FB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005030 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000050B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005130 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000051B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005230 0000 0000 0000 0000 0000+  	dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000052B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005330                            

00005330                            TitleScreenMapEnd
00005330 =00001000                  TitleScreenMapSizeB: equ (TitleScreenMapEnd-TitleScreenMap)                    ; Map size in bytes
00005330 =00000800                  TitleScreenMapSizeW: equ (TitleScreenMapSizeB/2)                               ; Map size in words
00005330 =00000400                  TitleScreenMapSizeL: equ (TitleScreenMapSizeB/4)                               ; Map size in longs
00005330                            

00005330 =00004020                  TitleScreenMapDimentions: equ 0x4020                                           ; Dimentions (W/H) (64x32)
00005330 =00004020                  TitleScreenMapDimentions: equ 0x4020                                           ; Dimentions (W/H) (64x32)
00005330                                  include assets\maps\songlist.asm
00005330                            ;==============================================================
00005330                            ;   Scorpion Illuminati
00005330                            ;==============================================================
00005330                            ;   SEGA Genesis (c) SegaDev 2014
00005330                            ;==============================================================
00005330                            SonglistScreenMap:
00005330                            

00005330 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000053B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005430 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000054B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005530 0002 0002 0003 0001 0001+        dc.w $0002, $0002, $0003, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000055B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005630 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000056B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005730 0002 0002 0003 0001 0001+        dc.w $0002, $0002, $0003, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000057B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005830 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000058B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005930 0002 0002 0003 0001 0001+        dc.w $0002, $0002, $0003, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000059B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005A30 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005AB0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005B30 0002 0002 0003 0001 0001+        dc.w $0002, $0002, $0003, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005BB0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005C30 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005CB0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005D30 0002 0002 0003 0001 0001+        dc.w $0002, $0002, $0003, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005DB0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005E30 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005EB0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005F30 0002 0002 0003 0001 0001+        dc.w $0002, $0002, $0003, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00005FB0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006030 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000060B0 0002 0002 0001 0001 0001+        dc.w $0002, $0002, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006130 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000061B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006230 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000062B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006330                            

00006330                            SonglistScreenMapEnd
00006330 =00001000                  SonglistScreenMapSizeB: equ (SonglistScreenMapEnd-SonglistScreenMap)           ; Map size in bytes
00006330 =00000800                  SonglistScreenMapSizeW: equ (SonglistScreenMapSizeB/2)                         ; Map size in words
00006330 =00000400                  SonglistScreenMapSizeL: equ (SonglistScreenMapSizeB/4)                         ; Map size in longs
00006330                            

00006330 =00004020                  SonglistScreenMapDimentions: equ 0x4020                                        ; Dimentions (W/H) (64x32)
00006330 =00004020                  SonglistScreenMapDimentions: equ 0x4020                                        ; Dimentions (W/H) (64x32)
00006330                                  include assets\maps\game.asm
00006330                            ;==============================================================
00006330                            ;   Scorpion Illuminati
00006330                            ;==============================================================
00006330                            ;   SEGA Genesis (c) SegaDev 2014
00006330                            ;==============================================================
00006330                            GameMap:
00006330                            

00006330 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000063B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006430 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000064B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006530 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000065B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006630 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000066B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006730 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000067B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006830 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000068B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006930 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000069B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006A30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006AB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006B30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006BB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006C30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006CB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0004, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006D30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0002, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006DB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0004, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0003, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006E30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006EB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006F30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00006FB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007030 0000 0000 0000 0005 0005+        dc.w $0000, $0000, $0000, $0005, $0005, $0005, $0005, $0006, $0006, $0006, $0007, $0007, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000070B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007130 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000071B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007230 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000072B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007330                            

00007330                            GameMapEnd
00007330 =00001000                  GameMapSizeB: equ (GameMapEnd-GameMap)                                         ; Map size in bytes
00007330 =00000800                  GameMapSizeW: equ (GameMapSizeB/2)                                             ; Map size in words
00007330 =00000400                  GameMapSizeL: equ (GameMapSizeB/4)                                             ; Map size in longs
00007330                            

00007330 =00004020                  GameMapDimentions: equ 0x4020                                                  ; Dimentions (W/H) (64x32)
00007330 =00004020                  GameMapDimentions: equ 0x4020                                                  ; Dimentions (W/H) (64x32)
00007330                                  include assets\maps\stats.asm
00007330                            ;==============================================================
00007330                            ;   Scorpion Illuminati
00007330                            ;==============================================================
00007330                            ;   SEGA Genesis (c) SegaDev 2014
00007330                            ;==============================================================
00007330                            StatsScreenMap:
00007330                            

00007330 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000073B0 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007430 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000074B0 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007530 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000075B0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007630 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000076B0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007730 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000077B0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007830 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000078B0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007930 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000079B0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007A30 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007AB0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007B30 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007BB0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007C30 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007CB0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007D30 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007DB0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007E30 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007EB0 0001 0001 0001 0001 0000+        dc.w $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007F30 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00007FB0 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008030 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000080B0 0001 0001 0001 0001 0001+        dc.w $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008130 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000081B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008230 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000082B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008330                            

00008330                            StatsScreenMapEnd
00008330 =00001000                  StatsScreenMapSizeB: equ (StatsScreenMapEnd-StatsScreenMap)                    ; Map size in bytes
00008330 =00000800                  StatsScreenMapSizeW: equ (StatsScreenMapSizeB/2)                               ; Map size in words
00008330 =00000400                  StatsScreenMapSizeL: equ (StatsScreenMapSizeB/4)                               ; Map size in longs
00008330                            

00008330 =00004020                  StatsScreenMapDimentions: equ 0x4020                                           ; Dimentions (W/H) (64x32)
00008330 =00004020                  StatsScreenMapDimentions: equ 0x4020                                           ; Dimentions (W/H) (64x32)
00008330                                  include assets\maps\blank.asm
00008330                            ;==============================================================
00008330                            ;   Scorpion Illuminati
00008330                            ;==============================================================
00008330                            ;   SEGA Genesis (c) SegaDev 2014
00008330                            ;==============================================================
00008330                            BlankMap:
00008330                            

00008330 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000083B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008430 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000084B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008530 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000085B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008630 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000086B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008730 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000087B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008830 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000088B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008930 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000089B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008A30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008AB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008B30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008BB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008C30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008CB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008D30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008DB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008E30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008EB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008F30 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00008FB0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00009030 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000090B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00009130 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000091B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00009230 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
000092B0 0000 0000 0000 0000 0000+        dc.w $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
00009330                            

00009330                            BlankMapEnd
00009330 =00001000                  BlankMapSizeB: equ (BlankMapEnd-BlankMap)                                      ; Map size in bytes
00009330 =00000800                  BlankMapSizeW: equ (BlankMapSizeB/2)                                            ; Map size in words
00009330 =00000400                  BlankMapSizeL: equ (BlankMapSizeB/4)                                           ; Map size in longs
00009330                            

00009330 =00004020                  BlankMapDimentions: equ 0x4020                                                 ; Dimentions (W/H) (64x32)
00009330 =00004020                  BlankMapDimentions: equ 0x4020                                                 ; Dimentions (W/H) (64x32)
00009330                            

00009330                            ; ************************************
00009330                            ; Include all music data
00009330                            ; ************************************
00009330                                  include assets\sfx\inst.asm
00009330                            ;****************************************************************************
00009330                            ; Streams used to play the drum
00009330                            ;****************************************************************************
00009330                            

00009330 F680 0C00 FF               SnareDrumLeft:            dc.b $F6,$80, $0C,$00, $FF
00009335 F640 0C00 FF               SnareDrumRight:           dc.b $F6,$40, $0C,$00, $FF
0000933A                                  even
0000933A                            

0000933A                            ;****************************************************************************
0000933A                            ; Instruments
0000933A                            ;****************************************************************************
0000933A                            InstrumentList:
0000933A 0000 00                          Echo_ListEntry SnareDrum
0000933D 00                               Echo_ListEnd
0000933E                            

0000933E                            SnareDrum:
0000933E                                incbin  "assets\sfx\snare.ewf"
0000A3DC 00                               even
0000A3DC 00                               even
0000A3DC                                  include assets\songs\songlist.asm
0000A3DC                            ComradeOj_TwangyThing:
0000A3DC                            	  incbin 'assets\songs\comrdeoj\twgythng.esf'                          ; Twangy Thing
0000B57F                            LinkueiBR_TotalConcentration:
0000B57F                            ;	  incbin 'assets\songs\linkuebr\ttlce.xgm'                             ; Total Concentration
0000B57F                            ;	  incbin 'assets\songs\linkuebr\ttlce.xgm'                             ; Total Concentration
0000B57F                            

0000B57F                            ; ************************************
0000B57F                            ; Include all beatmap data
0000B57F                            ; ************************************
0000B57F                                  include assets\beatmaps\comrdeoj\twgythng.asm
0000B57F                            ; ==============================================================
0000B57F                            ; ComradeOj Twangy Thing Beatmap
0000B57F                            ; See Beatmap Parser for format details
0000B57F                            ; ==============================================================
0000B57F                            ComradeOj_TwangyThing_Beatmap:
0000B57F 00                               dc.b %00000000
0000B580 00                               dc.b %00000000
0000B581 00                               dc.b %00000000
0000B582 00                               dc.b %00000000
0000B583 00                               dc.b %00000000
0000B584 00                               dc.b %00000000
0000B585 00                               dc.b %00000000
0000B586 00                               dc.b %00000000
0000B587 00                               dc.b %00000000
0000B588 00                               dc.b %00000000
0000B589 00                               dc.b %00000000
0000B58A 00                               dc.b %00000000
0000B58B 00                               dc.b %00000000
0000B58C 00                               dc.b %00000000
0000B58D 00                               dc.b %00000000
0000B58E 00                               dc.b %00000000
0000B58F 00                               dc.b %00000000
0000B590 00                               dc.b %00000000
0000B591 00                               dc.b %00000000
0000B592 00                               dc.b %00000000
0000B593 00                               dc.b %00000000
0000B594 00                               dc.b %00000000
0000B595 00                               dc.b %00000000
0000B596 00                               dc.b %00000000
0000B597 00                               dc.b %00000000
0000B598 00                               dc.b %00000000
0000B599 00                               dc.b %00000000
0000B59A 00                               dc.b %00000000
0000B59B 00                               dc.b %00000000
0000B59C 00                               dc.b %00000000
0000B59D 00                               dc.b %00000000
0000B59E 00                               dc.b %00000000
0000B59F 00                               dc.b %00000000
0000B5A0 00                               dc.b %00000000
0000B5A1 00                               dc.b %00000000
0000B5A2 00                               dc.b %00000000
0000B5A3 00                               dc.b %00000000
0000B5A4 00                               dc.b %00000000
0000B5A5 00                               dc.b %00000000
0000B5A6 00                               dc.b %00000000
0000B5A7 00                               dc.b %00000000
0000B5A8 00                               dc.b %00000000
0000B5A9 00                               dc.b %00000000
0000B5AA 00                               dc.b %00000000
0000B5AB 00                               dc.b %00000000
0000B5AC 00                               dc.b %00000000
0000B5AD 00                               dc.b %00000000
0000B5AE 00                               dc.b %00000000
0000B5AF 00                               dc.b %00000000
0000B5B0 00                               dc.b %00000000
0000B5B1 00                               dc.b %00000000
0000B5B2 00                               dc.b %00000000
0000B5B3 00                               dc.b %00000000
0000B5B4 00                               dc.b %00000000
0000B5B5 00                               dc.b %00000000
0000B5B6 00                               dc.b %00000000
0000B5B7 00                               dc.b %00000000
0000B5B8 00                               dc.b %00000000
0000B5B9 00                               dc.b %00000000
0000B5BA 00                               dc.b %00000000
0000B5BB 00                               dc.b %00000000
0000B5BC 00                               dc.b %00000000
0000B5BD 00                               dc.b %00000000
0000B5BE 00                               dc.b %00000000
0000B5BF 00                               dc.b %00000000
0000B5C0 00                               dc.b %00000000
0000B5C1 00                               dc.b %00000000
0000B5C2 00                               dc.b %00000000
0000B5C3 00                               dc.b %00000000
0000B5C4 00                               dc.b %00000000
0000B5C5 00                               dc.b %00000000
0000B5C6 00                               dc.b %00000000
0000B5C7 00                               dc.b %00000000
0000B5C8 00                               dc.b %00000000
0000B5C9 00                               dc.b %00000000
0000B5CA 00                               dc.b %00000000
0000B5CB 00                               dc.b %00000000
0000B5CC 00                               dc.b %00000000
0000B5CD 00                               dc.b %00000000
0000B5CE 00                               dc.b %00000000
0000B5CF 00                               dc.b %00000000
0000B5D0 00                               dc.b %00000000
0000B5D1 00                               dc.b %00000000
0000B5D2 00                               dc.b %00000000
0000B5D3 00                               dc.b %00000000
0000B5D4 00                               dc.b %00000000
0000B5D5 00                               dc.b %00000000
0000B5D6 00                               dc.b %00000000
0000B5D7 00                               dc.b %00000000
0000B5D8 00                               dc.b %00000000
0000B5D9 00                               dc.b %00000000
0000B5DA 00                               dc.b %00000000
0000B5DB 00                               dc.b %00000000
0000B5DC 00                               dc.b %00000000
0000B5DD 00                               dc.b %00000000
0000B5DE 00                               dc.b %00000000
0000B5DF 00                               dc.b %00000000
0000B5E0 00                               dc.b %00000000
0000B5E1 00                               dc.b %00000000
0000B5E2 00                               dc.b %00000000
0000B5E3 00                               dc.b %00000000
0000B5E4 00                               dc.b %00000000
0000B5E5 00                               dc.b %00000000
0000B5E6 00                               dc.b %00000000
0000B5E7 00                               dc.b %00000000
0000B5E8 00                               dc.b %00000000
0000B5E9 00                               dc.b %00000000
0000B5EA 00                               dc.b %00000000
0000B5EB 00                               dc.b %00000000
0000B5EC 00                               dc.b %00000000
0000B5ED 00                               dc.b %00000000
0000B5EE 00                               dc.b %00000000
0000B5EF 00                               dc.b %00000000
0000B5F0 00                               dc.b %00000000
0000B5F1 00                               dc.b %00000000
0000B5F2 00                               dc.b %00000000
0000B5F3 00                               dc.b %00000000
0000B5F4 00                               dc.b %00000000
0000B5F5 00                               dc.b %00000000
0000B5F6 00                               dc.b %00000000
0000B5F7 00                               dc.b %00000000
0000B5F8 00                               dc.b %00000000
0000B5F9 00                               dc.b %00000000
0000B5FA 00                               dc.b %00000000
0000B5FB 00                               dc.b %00000000
0000B5FC 00                               dc.b %00000000
0000B5FD 00                               dc.b %00000000
0000B5FE 00                               dc.b %00000000
0000B5FF 00                               dc.b %00000000
0000B600 00                               dc.b %00000000
0000B601 00                               dc.b %00000000
0000B602 00                               dc.b %00000000
0000B603 00                               dc.b %00000000
0000B604 00                               dc.b %00000000
0000B605 00                               dc.b %00000000
0000B606 00                               dc.b %00000000
0000B607 00                               dc.b %00000000
0000B608 00                               dc.b %00000000
0000B609 00                               dc.b %00000000
0000B60A 00                               dc.b %00000000
0000B60B 00                               dc.b %00000000
0000B60C 00                               dc.b %00000000
0000B60D 00                               dc.b %00000000
0000B60E 00                               dc.b %00000000
0000B60F 00                               dc.b %00000000
0000B610 00                               dc.b %00000000
0000B611 00                               dc.b %00000000
0000B612 00                               dc.b %00000000
0000B613 00                               dc.b %00000000
0000B614 00                               dc.b %00000000
0000B615 00                               dc.b %00000000
0000B616 00                               dc.b %00000000
0000B617 00                               dc.b %00000000
0000B618 00                               dc.b %00000000
0000B619 00                               dc.b %00000000
0000B61A 00                               dc.b %00000000
0000B61B 00                               dc.b %00000000
0000B61C 00                               dc.b %00000000
0000B61D 00                               dc.b %00000000
0000B61E 00                               dc.b %00000000
0000B61F 00                               dc.b %00000000
0000B620 00                               dc.b %00000000
0000B621 00                               dc.b %00000000
0000B622 00                               dc.b %00000000
0000B623 00                               dc.b %00000000
0000B624 00                               dc.b %00000000
0000B625 00                               dc.b %00000000
0000B626 00                               dc.b %00000000
0000B627 00                               dc.b %00000000
0000B628 00                               dc.b %00000000
0000B629 00                               dc.b %00000000
0000B62A 00                               dc.b %00000000
0000B62B 00                               dc.b %00000000
0000B62C 00                               dc.b %00000000
0000B62D 00                               dc.b %00000000
0000B62E 00                               dc.b %00000000
0000B62F 00                               dc.b %00000000
0000B630 00                               dc.b %00000000
0000B631 00                               dc.b %00000000
0000B632 00                               dc.b %00000000
0000B633 00                               dc.b %00000000
0000B634 00                               dc.b %00000000
0000B635 00                               dc.b %00000000
0000B636 00                               dc.b %00000000
0000B637 00                               dc.b %00000000
0000B638 00                               dc.b %00000000
0000B639 00                               dc.b %00000000
0000B63A 00                               dc.b %00000000
0000B63B 00                               dc.b %00000000
0000B63C 00                               dc.b %00000000
0000B63D 00                               dc.b %00000000
0000B63E 00                               dc.b %00000000
0000B63F 00                               dc.b %00000000
0000B640 00                               dc.b %00000000
0000B641 00                               dc.b %00000000
0000B642 00                               dc.b %00000000
0000B643 00                               dc.b %00000000
0000B644 00                               dc.b %00000000
0000B645 00                               dc.b %00000000
0000B646 00                               dc.b %00000000
0000B647 00                               dc.b %00000000
0000B648 00                               dc.b %00000000
0000B649 00                               dc.b %00000000
0000B64A 00                               dc.b %00000000
0000B64B 00                               dc.b %00000000
0000B64C 00                               dc.b %00000000
0000B64D 00                               dc.b %00000000
0000B64E 00                               dc.b %00000000
0000B64F 00                               dc.b %00000000
0000B650 00                               dc.b %00000000
0000B651 00                               dc.b %00000000
0000B652 00                               dc.b %00000000
0000B653 00                               dc.b %00000000
0000B654 00                               dc.b %00000000
0000B655 00                               dc.b %00000000
0000B656 00                               dc.b %00000000
0000B657 00                               dc.b %00000000
0000B658 00                               dc.b %00000000
0000B659 00                               dc.b %00000000
0000B65A 00                               dc.b %00000000
0000B65B 00                               dc.b %00000000
0000B65C 00                               dc.b %00000000
0000B65D 00                               dc.b %00000000
0000B65E 00                               dc.b %00000000
0000B65F 00                               dc.b %00000000
0000B660 00                               dc.b %00000000
0000B661 00                               dc.b %00000000
0000B662 00                               dc.b %00000000
0000B663 00                               dc.b %00000000
0000B664 00                               dc.b %00000000
0000B665 00                               dc.b %00000000
0000B666 00                               dc.b %00000000
0000B667 00                               dc.b %00000000
0000B668 00                               dc.b %00000000
0000B669 00                               dc.b %00000000
0000B66A 00                               dc.b %00000000
0000B66B 00                               dc.b %00000000
0000B66C 00                               dc.b %00000000
0000B66D 00                               dc.b %00000000
0000B66E 00                               dc.b %00000000
0000B66F 00                               dc.b %00000000
0000B670 00                               dc.b %00000000
0000B671 00                               dc.b %00000000
0000B672 00                               dc.b %00000000
0000B673 00                               dc.b %00000000
0000B674 00                               dc.b %00000000
0000B675 00                               dc.b %00000000
0000B676 00                               dc.b %00000000
0000B677 00                               dc.b %00000000
0000B678 80                               dc.b %10000000
0000B678 80                               dc.b %10000000
0000B679                                  include assets\beatmaps\linkuebr\ttlce.asm
0000B679                            ; ==============================================================
0000B679                            ; ComradeOj 16BitChiptunes Beatmap
0000B679                            ; See Beatmap Parser for format details
0000B679                            ; ==============================================================
0000B679                            LinkueiBR_TotalConcentration_Beatmap:
0000B679 00                               dc.b %00000000
0000B67A 00                               dc.b %00000000
0000B67B 00                               dc.b %00000000
0000B67C 00                               dc.b %00000000
0000B67D 00                               dc.b %00000000
0000B67E 00                               dc.b %00000000
0000B67F 00                               dc.b %00000000
0000B680 00                               dc.b %00000000
0000B681 00                               dc.b %00000000
0000B682 00                               dc.b %00000000
0000B683 00                               dc.b %00000000
0000B684 00                               dc.b %00000000
0000B685 00                               dc.b %00000000
0000B686 00                               dc.b %00000000
0000B687 00                               dc.b %00000000
0000B688 00                               dc.b %00000000
0000B689 00                               dc.b %00000000
0000B68A 00                               dc.b %00000000
0000B68B 00                               dc.b %00000000
0000B68C 00                               dc.b %00000000
0000B68D 00                               dc.b %00000000
0000B68E 00                               dc.b %00000000
0000B68F 00                               dc.b %00000000
0000B690 00                               dc.b %00000000
0000B691 00                               dc.b %00000000
0000B692 00                               dc.b %00000000
0000B693 00                               dc.b %00000000
0000B694 00                               dc.b %00000000
0000B695 00                               dc.b %00000000
0000B696 00                               dc.b %00000000
0000B697 00                               dc.b %00000000
0000B698 00                               dc.b %00000000
0000B699 00                               dc.b %00000000
0000B69A 00                               dc.b %00000000
0000B69B 00                               dc.b %00000000
0000B69C 00                               dc.b %00000000
0000B69D 00                               dc.b %00000000
0000B69E 00                               dc.b %00000000
0000B69F 00                               dc.b %00000000
0000B6A0 00                               dc.b %00000000
0000B6A1 00                               dc.b %00000000
0000B6A2 00                               dc.b %00000000
0000B6A3 00                               dc.b %00000000
0000B6A4 00                               dc.b %00000000
0000B6A5 00                               dc.b %00000000
0000B6A6 00                               dc.b %00000000
0000B6A7 00                               dc.b %00000000
0000B6A8 00                               dc.b %00000000
0000B6A9 00                               dc.b %00000000
0000B6AA 00                               dc.b %00000000
0000B6AB 00                               dc.b %00000000
0000B6AC 00                               dc.b %00000000
0000B6AD 00                               dc.b %00000000
0000B6AE 00                               dc.b %00000000
0000B6AF 00                               dc.b %00000000
0000B6B0 00                               dc.b %00000000
0000B6B1 00                               dc.b %00000000
0000B6B2 00                               dc.b %00000000
0000B6B3 00                               dc.b %00000000
0000B6B4 00                               dc.b %00000000
0000B6B5 00                               dc.b %00000000
0000B6B6 00                               dc.b %00000000
0000B6B7 00                               dc.b %00000000
0000B6B8 00                               dc.b %00000000
0000B6B9 00                               dc.b %00000000
0000B6BA 00                               dc.b %00000000
0000B6BB 00                               dc.b %00000000
0000B6BC 00                               dc.b %00000000
0000B6BD 00                               dc.b %00000000
0000B6BE 00                               dc.b %00000000
0000B6BF 00                               dc.b %00000000
0000B6C0 00                               dc.b %00000000
0000B6C1 00                               dc.b %00000000
0000B6C2 00                               dc.b %00000000
0000B6C3 00                               dc.b %00000000
0000B6C4 00                               dc.b %00000000
0000B6C5 00                               dc.b %00000000
0000B6C6 00                               dc.b %00000000
0000B6C7 00                               dc.b %00000000
0000B6C8 00                               dc.b %00000000
0000B6C9 00                               dc.b %00000000
0000B6CA 00                               dc.b %00000000
0000B6CB 00                               dc.b %00000000
0000B6CC 00                               dc.b %00000000
0000B6CD 00                               dc.b %00000000
0000B6CE 00                               dc.b %00000000
0000B6CF 00                               dc.b %00000000
0000B6D0 00                               dc.b %00000000
0000B6D1 00                               dc.b %00000000
0000B6D2 00                               dc.b %00000000
0000B6D3 00                               dc.b %00000000
0000B6D4 00                               dc.b %00000000
0000B6D5 00                               dc.b %00000000
0000B6D6 00                               dc.b %00000000
0000B6D7 00                               dc.b %00000000
0000B6D8 00                               dc.b %00000000
0000B6D9 00                               dc.b %00000000
0000B6DA 00                               dc.b %00000000
0000B6DB 00                               dc.b %00000000
0000B6DC 00                               dc.b %00000000
0000B6DD 00                               dc.b %00000000
0000B6DE 00                               dc.b %00000000
0000B6DF 00                               dc.b %00000000
0000B6E0 00                               dc.b %00000000
0000B6E1 00                               dc.b %00000000
0000B6E2 00                               dc.b %00000000
0000B6E3 00                               dc.b %00000000
0000B6E4 00                               dc.b %00000000
0000B6E5 00                               dc.b %00000000
0000B6E6 00                               dc.b %00000000
0000B6E7 00                               dc.b %00000000
0000B6E8 00                               dc.b %00000000
0000B6E9 00                               dc.b %00000000
0000B6EA 00                               dc.b %00000000
0000B6EB 00                               dc.b %00000000
0000B6EC 00                               dc.b %00000000
0000B6ED 00                               dc.b %00000000
0000B6EE 00                               dc.b %00000000
0000B6EF 00                               dc.b %00000000
0000B6F0 00                               dc.b %00000000
0000B6F1 00                               dc.b %00000000
0000B6F2 00                               dc.b %00000000
0000B6F3 00                               dc.b %00000000
0000B6F4 00                               dc.b %00000000
0000B6F5 00                               dc.b %00000000
0000B6F6 00                               dc.b %00000000
0000B6F7 00                               dc.b %00000000
0000B6F8 00                               dc.b %00000000
0000B6F9 00                               dc.b %00000000
0000B6FA 00                               dc.b %00000000
0000B6FB 00                               dc.b %00000000
0000B6FC 00                               dc.b %00000000
0000B6FD 00                               dc.b %00000000
0000B6FE 00                               dc.b %00000000
0000B6FF 00                               dc.b %00000000
0000B700 00                               dc.b %00000000
0000B701 00                               dc.b %00000000
0000B702 00                               dc.b %00000000
0000B703 00                               dc.b %00000000
0000B704 00                               dc.b %00000000
0000B705 00                               dc.b %00000000
0000B706 00                               dc.b %00000000
0000B707 00                               dc.b %00000000
0000B708 00                               dc.b %00000000
0000B709 00                               dc.b %00000000
0000B70A 00                               dc.b %00000000
0000B70B 00                               dc.b %00000000
0000B70C 00                               dc.b %00000000
0000B70D 00                               dc.b %00000000
0000B70E 00                               dc.b %00000000
0000B70F 00                               dc.b %00000000
0000B710 00                               dc.b %00000000
0000B711 00                               dc.b %00000000
0000B712 00                               dc.b %00000000
0000B713 00                               dc.b %00000000
0000B714 00                               dc.b %00000000
0000B715 00                               dc.b %00000000
0000B716 00                               dc.b %00000000
0000B717 00                               dc.b %00000000
0000B718 00                               dc.b %00000000
0000B719 00                               dc.b %00000000
0000B71A 00                               dc.b %00000000
0000B71B 00                               dc.b %00000000
0000B71C 00                               dc.b %00000000
0000B71D 00                               dc.b %00000000
0000B71E 00                               dc.b %00000000
0000B71F 00                               dc.b %00000000
0000B720 00                               dc.b %00000000
0000B721 00                               dc.b %00000000
0000B722 00                               dc.b %00000000
0000B723 00                               dc.b %00000000
0000B724 00                               dc.b %00000000
0000B725 00                               dc.b %00000000
0000B726 00                               dc.b %00000000
0000B727 00                               dc.b %00000000
0000B728 00                               dc.b %00000000
0000B729 00                               dc.b %00000000
0000B72A 00                               dc.b %00000000
0000B72B 00                               dc.b %00000000
0000B72C 00                               dc.b %00000000
0000B72D 00                               dc.b %00000000
0000B72E 00                               dc.b %00000000
0000B72F 00                               dc.b %00000000
0000B730 00                               dc.b %00000000
0000B731 00                               dc.b %00000000
0000B732 00                               dc.b %00000000
0000B733 00                               dc.b %00000000
0000B734 00                               dc.b %00000000
0000B735 00                               dc.b %00000000
0000B736 00                               dc.b %00000000
0000B737 00                               dc.b %00000000
0000B738 00                               dc.b %00000000
0000B739 00                               dc.b %00000000
0000B73A 00                               dc.b %00000000
0000B73B 00                               dc.b %00000000
0000B73C 00                               dc.b %00000000
0000B73D 00                               dc.b %00000000
0000B73E 00                               dc.b %00000000
0000B73F 00                               dc.b %00000000
0000B740 00                               dc.b %00000000
0000B741 00                               dc.b %00000000
0000B742 00                               dc.b %00000000
0000B743 00                               dc.b %00000000
0000B744 00                               dc.b %00000000
0000B745 00                               dc.b %00000000
0000B746 00                               dc.b %00000000
0000B747 00                               dc.b %00000000
0000B748 00                               dc.b %00000000
0000B749 00                               dc.b %00000000
0000B74A 00                               dc.b %00000000
0000B74B 00                               dc.b %00000000
0000B74C 00                               dc.b %00000000
0000B74D 00                               dc.b %00000000
0000B74E 00                               dc.b %00000000
0000B74F 00                               dc.b %00000000
0000B750 00                               dc.b %00000000
0000B751 00                               dc.b %00000000
0000B752 00                               dc.b %00000000
0000B753 00                               dc.b %00000000
0000B754 00                               dc.b %00000000
0000B755 00                               dc.b %00000000
0000B756 00                               dc.b %00000000
0000B757 00                               dc.b %00000000
0000B758 00                               dc.b %00000000
0000B759 00                               dc.b %00000000
0000B75A 00                               dc.b %00000000
0000B75B 00                               dc.b %00000000
0000B75C 00                               dc.b %00000000
0000B75D 00                               dc.b %00000000
0000B75E 00                               dc.b %00000000
0000B75F 00                               dc.b %00000000
0000B760 00                               dc.b %00000000
0000B761 00                               dc.b %00000000
0000B762 00                               dc.b %00000000
0000B763 00                               dc.b %00000000
0000B764 00                               dc.b %00000000
0000B765 00                               dc.b %00000000
0000B766 00                               dc.b %00000000
0000B767 00                               dc.b %00000000
0000B768 00                               dc.b %00000000
0000B769 00                               dc.b %00000000
0000B76A 00                               dc.b %00000000
0000B76B 00                               dc.b %00000000
0000B76C 00                               dc.b %00000000
0000B76D 00                               dc.b %00000000
0000B76E 00                               dc.b %00000000
0000B76F 00                               dc.b %00000000
0000B770 00                               dc.b %00000000
0000B771 00                               dc.b %00000000
0000B772 80                               dc.b %10000000
0000B772 80                               dc.b %10000000
0000B773                            

0000B773                            ; ************************************
0000B773                            ; Include all cue data
0000B773                            ; ************************************
0000B773                                  include assets\cues\dfltcue.asm
0000B773                            SongList:
0000B774 0000 0000 00                     dc.l StringAuthorComradeOj
0000B778 0000 0000                        dc.l StringSongTwangyThing
0000B77C 0000 A3DC                        dc.l ComradeOj_TwangyThing
0000B780 0000 B57F                        dc.l ComradeOj_TwangyThing_Beatmap
0000B784                            

0000B784                            ;     dc.l StringAuthorLinkueiBR
0000B784                            ;     dc.l StringSongTotalConcentration
0000B784                            ;     dc.l LinkueiBR_TotalConcentration
0000B784                            ;     dc.l LinkueiBR_TotalConcentration_Beatmap
0000B784                            ;     dc.l LinkueiBR_TotalConcentration_Beatmap
0000B784                            

0000B784                            ; ************************************
0000B784                            ; Include all palettes
0000B784                            ; ************************************
0000B784                                  include assets\palettes\palettes.asm
0000B784                            ;==============================================================
0000B784                            ;   Scorpion Illuminati
0000B784                            ;==============================================================
0000B784                            ;   SEGA Genesis (c) SegaDev 2014
0000B784                            ;==============================================================
0000B784                            

0000B784                            Palette:
0000B784 0000                       	dc.w 0x0000								; Colour 0 - Transparent
0000B786 000E                       	dc.w 0x000E								; Colour 1 - Red
0000B788 00E0                       	dc.w 0x00E0								; Colour 2 - Green
0000B78A 0E00                       	dc.w 0x0E00								; Colour 3 - Blue
0000B78C 0000                       	dc.w 0x0000								; Colour 4 - Black
0000B78E 0EEE                       	dc.w 0x0EEE								; Colour 5 - White
0000B790 00EE                       	dc.w 0x00EE								; Colour 6 - Yellow
0000B792 008E                       	dc.w 0x008E								; Colour 7 - Orange
0000B794 0E0E                       	dc.w 0x0E0E								; Colour 8 - Pink
0000B796 0808                       	dc.w 0x0808								; Colour 9 - Purple
0000B798 0444                       	dc.w 0x0444								; Colour A - Dark grey
0000B79A 0888                       	dc.w 0x0888								; Colour B - Light grey
0000B79C 0EE0                       	dc.w 0x0EE0								; Colour C - Turquoise
0000B79E 000A                       	dc.w 0x000A								; Colour D - Maroon
0000B7A0 0600                       	dc.w 0x0600								; Colour E - Navy blue
0000B7A2 0060                       	dc.w 0x0060								; Colour F - Dark green
0000B7A2 0060                       	dc.w 0x0060								; Colour F - Dark green
0000B7A4                            

0000B7A4                            ; ************************************
0000B7A4                            ; Include all text strings
0000B7A4                            ; ************************************
0000B7A4                                  include assets\strings\strings.asm
0000B7A4                            ;==============================================================
0000B7A4                            ;   Scorpion Illuminati
0000B7A4                            ;==============================================================
0000B7A4                            ;   SEGA Genesis (c) SegaDev 2014
0000B7A4                            ;==============================================================
0000B7A4                            BlankString:
0000B7A4 2020 2020 2020 2020 2020+        dc.b "                    ",0
0000B7B9                            

0000B7B9                            PressStartString:
0000B7B9 5052 4553 5320 5354 4152+        dc.b "PRESS START",0
0000B7C5                            

0000B7C5                            SonglistString:
0000B7C5 534F 4E47 4C49 5354 00           dc.b "SONGLIST",0
0000B7CE                            

0000B7CE                            ComboString:
0000B7CE 434F 4D42 4F00                   dc.b "COMBO",0
0000B7D4                            

0000B7D4                            CompletionString:
0000B7D4 434F 4D50 4C45 5449 4F4E+        dc.b "COMPLETION",0
0000B7DF                            

0000B7DF                            ErrorsString:
0000B7DF 4552 524F 5253 00                dc.b "ERRORS",0
0000B7E6                            

0000B7E6                            HitsString:
0000B7E6 4849 5453 00                     dc.b "HITS",0
0000B7EB                            

0000B7EB                            MissesString:
0000B7EB 4D49 5353 4553 00                dc.b "MISSES",0
0000B7F2                            

0000B7F2                            MultiplierString:
0000B7F2 2020 5800                        dc.b "  X",0
0000B7F6                            

0000B7F6                            PauseString:
0000B7F6 5041 5553 4500                   dc.b "PAUSE",0
0000B7FC                            

0000B7FC                            PercentString:
0000B7FC 6F5C 6F00                        dc.b "o\o",0
0000B800                            

0000B800                            ScoreString:
0000B800 5343 4F52 4500                   dc.b "SCORE",0
0000B806                            

0000B806                            StatisticsString:
0000B806 5354 4154 4953 5449 4353+        dc.b "STATISTICS",0
0000B811                            

0000B811                            TopStreakString:
0000B811 544F 5020 5354 5245 414B+        dc.b "TOP STREAK",0
0000B81C                                  even
0000B81C                                  even
0000B81C                                  include assets\strings\authors.asm
0000B81C                            StringAuthorComradeOj:
0000B81C 434F 4D52 4144 454F 4A00         dc.b "COMRADEOJ",0
0000B826                            

0000B826                            StringAuthorLinkueiBR:
0000B826 4C49 4E4B 5545 4942 5200         dc.b "LINKUEIBR",0
0000B826 4C49 4E4B 5545 4942 5200         dc.b "LINKUEIBR",0
0000B830                                  include assets\strings\songname.asm
0000B830                            StringSongTwangyThing:
0000B830 5457 414E 4759 2054 4849+        dc.b "TWANGY THING",0
0000B83D                            

0000B83D                            StringSongTotalConcentration:
0000B83D 544F 5441 4C20 434F 4E43+        dc.b "TOTAL CONCENTRATION",0
0000B83D 544F 5441 4C20 434F 4E43+        dc.b "TOTAL CONCENTRATION",0
0000B851                                  include assets\strings\debug.asm
0000B851                            RegisterA0String:
0000B851 4130 3A20 00                     dc.b "A0: ",0
0000B856                            

0000B856                            RegisterA1String:
0000B856 4131 3A20 00                     dc.b "A1: ",0
0000B85B                            

0000B85B                            RegisterA2String:
0000B85B 4132 3A20 00                     dc.b "A2: ",0
0000B860                            

0000B860                            RegisterA3String:
0000B860 4133 3A20 00                     dc.b "A3: ",0
0000B865                            

0000B865                            RegisterA4String:
0000B865 4134 3A20 00                     dc.b "A4: ",0
0000B86A                            

0000B86A                            RegisterA5String:
0000B86A 4135 3A20 00                     dc.b "A5: ",0
0000B86F                            

0000B86F                            RegisterA6String:
0000B86F 4136 3A20 00                     dc.b "A6: ",0
0000B874                            

0000B874                            StackPointerString:
0000B874 5350 3A20 00                     dc.b "SP: ",0
0000B879                            

0000B879                            ProgramCounterString:
0000B879 5043 3A20 00                     dc.b "PC: ",0
0000B87E                            

0000B87E                            RegisterD0String:
0000B87E 4430 3A20 00                     dc.b "D0: ",0
0000B883                            

0000B883                            RegisterD1String:
0000B883 4431 3A20 00                     dc.b "D1: ",0
0000B888                            

0000B888                            RegisterD2String:
0000B888 4432 3A20 00                     dc.b "D2: ",0
0000B88D                            

0000B88D                            RegisterD3String:
0000B88D 4433 3A20 00                     dc.b "D3: ",0
0000B892                            

0000B892                            RegisterD4String:
0000B892 4434 3A20 00                     dc.b "D4: ",0
0000B897                            

0000B897                            RegisterD5String:
0000B897 4435 3A20 00                     dc.b "D5: ",0
0000B89C                            

0000B89C                            RegisterD6String:
0000B89C 4436 3A20 00                     dc.b "D6: ",0
0000B8A1                            

0000B8A1                            RegisterD7String:
0000B8A1 4437 3A20 00                     dc.b "D7: ",0
0000B8A6                            

0000B8A6                            BusErrorString:
0000B8A6 4255 5320 4552 524F 5200         dc.b "BUS ERROR",0
0000B8B0                            

0000B8B0                            AddressErrorString:
0000B8B0 4144 4452 4553 5320 4552+        dc.b "ADDRESS ERROR",0
0000B8BE                            

0000B8BE                            IllegalInstructionString:
0000B8BE 494C 4C45 4741 4C20 494E+        dc.b "ILLEGAL INSTRUCTION",0
0000B8D2                            

0000B8D2                            ZeroDivideString:
0000B8D2 5A45 524F 2044 4956 4944+        dc.b "ZERO DIVIDE",0
0000B8DE                            

0000B8DE                            CHKInstructionString:
0000B8DE 4348 4B20 494E 5354 5255+        dc.b "CHK INSTRUCTION",0
0000B8EE                            

0000B8EE                            TRAPVInstructionString:
0000B8EE 5452 4150 5620 494E 5354+        dc.b "TRAPV INSTRUCTION",0
0000B900                            

0000B900                            PrivilegeViolationString:
0000B900 5052 4956 494C 4547 4520+        dc.b "PRIVILEGE VIOLATION",0
0000B914                            

0000B914                            TraceString:
0000B914 5452 4143 4500                   dc.b "TRACE",0
0000B91A                            

0000B91A                            LineAEmulatorString:
0000B91A 4C49 4E45 2D41 2045 4D55+        dc.b "LINE-A EMULATOR",0
0000B92A                            

0000B92A                            LineFEmulatorString:
0000B92A 4C49 4E45 2D46 2045 4D55+        dc.b "LINE-F EMULATOR",0
0000B93A                            

0000B93A                            Trap00ExceptionString:
0000B93A 5452 4150 2030 3020 4558+        dc.b "TRAP 00 EXCEPTION",0
0000B94C                            

0000B94C                            Trap01ExceptionString:
0000B94C 5452 4150 2030 3120 4558+        dc.b "TRAP 01 EXCEPTION",0
0000B95E                            

0000B95E                            Trap02ExceptionString:
0000B95E 5452 4150 2030 3220 4558+        dc.b "TRAP 02 EXCEPTION",0
0000B970                            

0000B970                            Trap03ExceptionString:
0000B970 5452 4150 2030 3320 4558+        dc.b "TRAP 03 EXCEPTION",0
0000B982                            

0000B982                            Trap04ExceptionString:
0000B982 5452 4150 2030 3420 4558+        dc.b "TRAP 04 EXCEPTION",0
0000B994                            

0000B994                            Trap05ExceptionString:
0000B994 5452 4150 2030 3520 4558+        dc.b "TRAP 05 EXCEPTION",0
0000B9A6                            

0000B9A6                            Trap06ExceptionString:
0000B9A6 5452 4150 2030 3620 4558+        dc.b "TRAP 06 EXCEPTION",0
0000B9B8                            

0000B9B8                            Trap07ExceptionString:
0000B9B8 5452 4150 2030 3720 4558+        dc.b "TRAP 07 EXCEPTION",0
0000B9CA                            

0000B9CA                            Trap08ExceptionString:
0000B9CA 5452 4150 2030 3820 4558+        dc.b "TRAP 08 EXCEPTION",0
0000B9DC                            

0000B9DC                            Trap09ExceptionString:
0000B9DC 5452 4150 2030 3920 4558+        dc.b "TRAP 09 EXCEPTION",0
0000B9EE                            

0000B9EE                            Trap10ExceptionString:
0000B9EE 5452 4150 2031 3020 4558+        dc.b "TRAP 10 EXCEPTION",0
0000BA00                            

0000BA00                            Trap11ExceptionString:
0000BA00 5452 4150 2031 3120 4558+        dc.b "TRAP 11 EXCEPTION",0
0000BA12                            

0000BA12                            Trap12ExceptionString:
0000BA12 5452 4150 2031 3220 4558+        dc.b "TRAP 12 EXCEPTION",0
0000BA24                            

0000BA24                            Trap13ExceptionString:
0000BA24 5452 4150 2031 3320 4558+        dc.b "TRAP 13 EXCEPTION",0
0000BA36                            

0000BA36                            Trap14ExceptionString:
0000BA36 5452 4150 2031 3420 4558+        dc.b "TRAP 14 EXCEPTION",0
0000BA48                            

0000BA48                            Trap15ExceptionString:
0000BA48 5452 4150 2031 3520 4558+        dc.b "TRAP 15 EXCEPTION",0
0000BA48 5452 4150 2031 3520 4558+        dc.b "TRAP 15 EXCEPTION",0
0000BA5A                                  even
0000BA5A                                  even
0000BA5A                            	include 'sprdespt.asm'
0000BA5A                            ;==============================================================
0000BA5A                            ;   Scorpion Illuminati
0000BA5A                            ;==============================================================
0000BA5A                            ;   SEGA Genesis (c) SegaDev 2014
0000BA5A                            ;==============================================================
0000BA5A                            

0000BA5A                            ; Sprite IDs
0000BA5A =00000000                  selectionarrow_id equ 0x0
0000BA5A =00000001                  greennote_id      equ 0x1
0000BA5A =00000002                  rednote_id        equ 0x2
0000BA5A =00000003                  yellownote_id     equ 0x3
0000BA5A =00000004                  bluenote_id       equ 0x4
0000BA5A =00000005                  orangenote_id     equ 0x5
0000BA5A =00000006                  rockindicator_id  equ 0x6
0000BA5A =00000007                  number_of_sprites equ 0x7
0000BA5A                            

0000BA5A                                ; Sprite descriptor structs
0000BA5A                            sprite_descriptor_table:
0000BA5A                            selectionarrow_sprite:
0000BA5A 0000                             dc.w offscreen_position_y                                                ; Y coord (+ 128)
0000BA5C 00                               dc.b SelectionArrowDimensionBits                                         ; Width (bits 0-1) and height (bits 2-3) in tiles
0000BA5D 01                               dc.b 0x01                                                                ; Index of next sprite (linked list)
0000BA5E 00                               dc.b 0x00                                                                ; H/V flipping (bits 3/4), palette index (bits 5-6), priority (bit 7)
0000BA5F 00                               dc.b SelectionArrowTileID                                                ; Index of first tile
0000BA60 0000                             dc.w offscreen_position_x                                                ; X coord (+ 128)
0000BA62                            greennote_sprite:
0000BA62 0000                             dc.w offscreen_position_y                                                ; Y coord (+ 128)
0000BA64 00                               dc.b GreenNoteDimensionBits                                              ; Width (bits 0-1) and height (bits 2-3) in tiles
0000BA65 02                               dc.b 0x02                                                                ; Index of next sprite (linked list)
0000BA66 00                               dc.b 0x00                                                                ; H/V flipping (bits 3/4), palette index (bits 5-6), priority (bit 7)
0000BA67 00                               dc.b GreenNoteTileID                                                     ; Index of first tile
0000BA68 0000                             dc.w offscreen_position_x                                                ; X coord (+ 128)
0000BA6A                            rednote_sprite:
0000BA6A 0000                             dc.w offscreen_position_y                                                ; Y coord (+ 128)
0000BA6C 00                               dc.b RedNoteDimensionBits                                                ; Width (bits 0-1) and height (bits 2-3) in tiles
0000BA6D 03                               dc.b 0x03                                                                ; Index of next sprite (linked list)
0000BA6E 00                               dc.b 0x00                                                                ; H/V flipping (bits 3/4), palette index (bits 5-6), priority (bit 7)
0000BA6F 00                               dc.b RedNoteTileID                                                       ; Index of first tile
0000BA70 0000                             dc.w offscreen_position_x                                                ; X coord (+ 128)
0000BA72                            rockindicator_sprite:
0000BA72 0000                             dc.w offscreen_position_y                                                ; Y coord (+ 128)
0000BA74 00                               dc.b RockIndicatorDimensionBits                                          ; Width (bits 0-1) and height (bits 2-3) in tiles
0000BA75 04                               dc.b 0x04                                                                ; Index of next sprite (linked list)
0000BA76 00                               dc.b 0x00                                                                ; H/V flipping (bits 3/4), palette index (bits 5-6), priority (bit 7)
0000BA77 00                               dc.b RockIndicatorTileID                                                 ; Index of first tile
0000BA78 0000                             dc.w offscreen_position_x                                                ; X coord (+ 128)
0000BA78 0000                             dc.w offscreen_position_x                                                ; X coord (+ 128)
0000BA7A                            

0000BA7A                            __end                                                                          ; Very last line, end of ROM address
0000BA7A                            

0000BA7A                                  inform 0, "*********************"                                        ; start of binary statistics header
0000BA7A                                  inform 0, "* Binary Statistics *"                                        ; binary statistics header
0000BA7A                                  inform 0, "*********************"                                        ; end of binary statistics header
0000BA7A                                  inform 0, ""                                                             ; spacer
0000BA7A                                  inform 0, "*********************"                                        ; start of rom usage header
0000BA7A                                  inform 0, "*     Rom Usage     *"                                        ; rom usage header
0000BA7A                                  inform 0, "*********************"                                        ; end of rom usage header
0000BA7A                                  inform 0,"%d bytes used", __end-$200                                     ; number of bytes used in cartridge space
0000BA7A                                  inform 0,"%d bytes left", $400000-__end                                  ; number of bytes remaining in cartridge space
0000BA7A                                  inform 0, ""                                                             ; spacer
0000BA7A                                  inform 0, "*********************"                                        ; start of ram usage header
0000BA7A                                  inform 0, "*     Ram Usage     *"                                        ; ram usage header
0000BA7A                                  inform 0, "*********************"                                        ; end of ram usage header
0000BA7A                                  inform 0,"%d bytes of ram used", __ramend-$FF0000                        ; number of bytes used in ram space
0000BA7A                                  inform 0,"%d bytes of ram left", $FFFFFF-__ramend                        ; number of bytes remaining in ram space

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.