-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtensor.asm
3170 lines (2861 loc) · 58.1 KB
/
tensor.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; "Tensor Trzaskowskiego" for Atari 8-bit by mgr_inz_rafal
; This project is licensed under "THE BEER-WARE LICENSE" (Revision 42).
; rchabowski@gmail.com wrote this project. As long as you retain this
; notice you can do whatever you want with this stuff.
; If we meet some day, and you think this stuff is worth it,
; you can buy me a beer in return.
; Selected ATARI registes
icl "include\atari.inc"
CREDITCOLSTART equ $00
CREDITCOLEND equ CREDITCOLSTART+$0f
LEVELFLIPDELAY equ %00000011
AMYGDALFLIPDEL equ %00000111
SOURCEDECO equ $ff-8*3
TARGETDECO equ $b0
PMGDECOOFFSET equ 12
DIGITOFFSET equ 6
SHADOWOFFSET equ 60
TITLEOFFSET equ 60+20
MAPCOUNT equ 51
MUSICPLAYER equ $9000
MAPSIZE equ 12
SCWIDTH equ 20
MARGIN equ (SCWIDTH-MAPSIZE)/2
TOPMARG equ 16
LFTMARG equ 80
MV_IDLE equ 0 ; Element not moving
MV_MRGH equ 1 ; Element is moving right
MV_MLFT equ 2 ; Element is moving left
MV_MUP equ 3 ; Element is moving up
MV_MBTM equ 4 ; Element is moving bottom
MV_CTRD equ 4 ; Single move distance when falling down
MV_CTR equ 8 ; Single move distance when moving left or right
C_PLAYR equ $5d ; Player color
C_OBSTA equ $76 ; Obstacles
C_WALL1 equ $54 ; Wall #1
C_WALL2 equ $14 ; Wall #2
GS_GRAV equ 0 ; Making sure everything is on the ground
GS_PLAY equ 1 ; Player movement
GS_FIN equ 2 ; Level completed
ROT_CTR equ 20 ; Delay between rotations
PL_CHR equ 1 ; Player character
CS_FADEOUT equ 0 ; Credits are fading out
CS_FADEIN equ 1 ; Credits are fading in
CS_SHOW equ 2 ; Credits are being shown
.zpvar .byte antic_tmp
.zpvar .byte stop_intermission
.zpvar .byte scroll_tmp
.zpvar .byte credits_flips
.zpvar .byte credits_timer
.zpvar .byte credits_color
.zpvar .byte credits_state
.zpvar .byte scroll
.zpvar .byte old_instafall
.zpvar .byte rotation_warmup
.zpvar .byte instafall
.zpvar .byte first_run
.zpvar .byte amygdala_color
.zpvar .byte amygdala_type
.zpvar .byte reducer
.zpvar .byte collecting
.zpvar .byte delayer
.zpvar .byte showsummary
.zpvar .byte mapnumber
.zpvar .word curmap
.zpvar .word curmapname
.zpvar .word ptr0
.zpvar .word ptr1
.zpvar .word ptr2
.zpvar .word ptr3
.zpvar .byte px
.zpvar .byte ppx
.zpvar .byte psx
.zpvar .byte py
.zpvar .byte ppy
.zpvar .byte pby
.zpvar .byte psy
.zpvar .byte mvstate
.zpvar .byte mvcntr
.zpvar .byte ignorestick
.zpvar .byte moved
.zpvar .byte gstate
.zpvar .byte movable
.zpvar .byte compared
.zpvar .byte sync
.zpvar .byte any_moved
.zpvar .byte collect
.zpvar .byte target
.zpvar .byte collectibles
.zpvar .byte repaint
.zpvar .byte direction ; 0 - N, 1 - W, 2 - S, 3 - E
.zpvar .byte ludek_offset
.zpvar .byte ludek_face ; 0 - L, 1 - R
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; BEGIN: TENSOR LOGO G2F ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/***************************************/
/* Use MADS http://mads.atari8.info/ */
/* Mode: GED- (bitmap mode) */
/***************************************/
icl "include\tensor5.h"
org $00
zc .ds ZCOLORS
org $f0
fcnt .ds 2
fadr .ds 2
fhlp .ds 2
cloc .ds 1
regA .ds 1
regX .ds 1
regY .ds 1
WIDTH = 40
HEIGHT = 30
; --- BASIC switch OFF
org $2000\ mva #$ff portb\ rts\ ini $2000
; --- MAIN PROGRAM
org $2000
scr ins "data\tensor5.raw" +0,+0,3520
MODUL
opt h-
ins "music\TENSOR.rmt"
opt h+
org $3900-3+1087
bit_mirror_lut
dta b(0),b(128),b(64),b(192),b(32),b(160),b(96),b(224),b(16),b(144),b(80),b(208),b(48),b(176),b(112),b(240),b(8),b(136),b(72),b(200),b(40),b(168),b(104),b(232),b(24),b(152),b(88),b(216),b(56),b(184),b(120),b(248),b(4),b(132),b(68),b(196),b(36),b(164),b(100),b(228),b(20),b(148),b(84),b(212),b(52),b(180),b(116),b(244),b(12),b(140),b(76),b(204),b(44),b(172),b(108),b(236),b(28),b(156),b(92),b(220),b(60),b(188),b(124),b(252),b(2),b(130),b(66),b(194),b(34),b(162),b(98),b(226),b(18),b(146),b(82),b(210),b(50),b(178),b(114),b(242),b(10),b(138),b(74),b(202),b(42),b(170),b(106),b(234),b(26),b(154),b(90),b(218),b(58),b(186),b(122),b(250),b(6),b(134),b(70),b(198),b(38),b(166),b(102),b(230),b(22),b(150),b(86),b(214),b(54),b(182),b(118),b(246),b(14),b(142),b(78),b(206),b(46),b(174),b(110),b(238),b(30),b(158),b(94),b(222),b(62),b(190),b(126),b(254),b(1),b(129),b(65),b(193),b(33),b(161),b(97),b(225),b(17),b(145),b(81),b(209),b(49),b(177),b(113),b(241),b(9),b(137),b(73),b(201),b(41),b(169),b(105),b(233),b(25),b(153),b(89),b(217),b(57),b(185),b(121),b(249),b(5),b(133),b(69),b(197),b(37),b(165),b(101),b(229),b(21),b(149),b(85),b(213),b(53),b(181),b(117),b(245),b(13),b(141),b(77),b(205),b(45),b(173),b(109),b(237),b(29),b(157),b(93),b(221),b(61),b(189),b(125),b(253),b(3),b(131),b(67),b(195),b(35),b(163),b(99),b(227),b(19),b(147),b(83),b(211),b(51),b(179),b(115),b(243),b(11),b(139),b(75),b(203),b(43),b(171),b(107),b(235),b(27),b(155),b(91),b(219),b(59),b(187),b(123),b(251),b(7),b(135),b(71),b(199),b(39),b(167),b(103),b(231),b(23),b(151),b(87),b(215),b(55),b(183),b(119),b(247),b(15),b(143),b(79),b(207),b(47),b(175),b(111),b(239),b(31),b(159),b(95),b(223),b(63),b(191),b(127),b(255)
AMYGDALA_DATA_0 ; Kielich
dta b(0),b(124),b(116),b(116),b(116),b(40),b(16),b(116),b($fa)
AMYGDALA_DATA_1 ; Maska
dta b(0),b(130),b(254),b(146),b(214),b(124),b(68),b(56),b($c6)
AMYGDALA_DATA_2 ; Diament
dta b(0),b(124),b(142),b(250),b(116),b(40),b(16),b(0),b($06)
AMYGDALA_DATA_3 ; Serce
dta b(0),b(108),b(190),b(250),b(116),b(56),b(16),b(0),b($36)
AMYGDALA_DATA_4 ; Swiecznik
dta b(16),b(24),b(48),b(16),b(68),b(56),b(16),b(56),b($ea)
AMYGDALA_DATA_5 ; Miecz
dta b(0),b(192),b(160),b(84),b(44),b(24),b(52),b(2),b($64)
AMYGDALA_DATA_6 ; Pierscionek
dta b(0),b(60),b(24),b(52),b(82),b(64),b(66),b(52),b($a6)
AMYGDALA_DATA_7 ; Robak
dta b(0),b(146),b(130),b(84),b(16),b(88),b(16),b(56),b($34)
TITLE_PART_1
dta b(62)
:38 dta b(125)
dta b(93)
dta b(124),d' Docent Ireneusz Trzaskowski poszukuje',b(124)
dta b(124),d'na Jowiszu mistycznych ',b(31),d'MIGDA',b(11),b(5),d'W X4',b(30),b(124)
dta b(124),d'Nie skacze, nie strzela, ale za pomoc',b(81),b(124)
dta b(124),b(31),d'Tensora Miotu Grawitacyjnego',b(30),d' miesza',b(124)
dta b(124),d'przestrzeni',b(81),d' i powoduje opad rzeczy.',b(124)
TITLE_PART_2
dta b(124),d'Pom',b(80),b(88),d' mu wypr',b(80),b(88),d'ni',b(86),d' wszelkie pieczary.',b(124)
dta b(124),d' ',b(124)
dta b(124),d'Kierunek ',b(28),d' FIRE zmienia grawitacj',b(68),d'. ',b(124)
dta b(124),d'D',b(88),d'oj w d',b(80),b(123),d' przyspiesza ospa',b(123),d'e spadki. ',b(124)
dta b(63)
:38 dta b(74)
dta b(29)
dta b(124)
dta b(128)
dta b(94+128)
dta b(95+128)
dta d' - PIECZARA:'*
TITLE_LEVEL_NUMBER
dta d' '*
dta b(32+128),b(64+128)
dta d' - '*
TITLE_AMYGDALA_SPEED
dta d' '*,b(124)
TITLE_PART_3
dta b(91)
:1 dta b(125)
dta b(126)
; http://github.com/mgr-inz-rafal/tensor
dta b(66)
dta b(83)
dta b(79)
dta b(90)
dta b(76)
dta b(65)
dta b(84)
dta b(67)
dta b(69)
dta b(96)
dta b(27)
dta b(59)
dta b(60)
dta b(61)
dta b(120)
dta b(89)
dta b(8)
dta b(7)
dta b(127)
:12 dta b(125)
dta b(126)
dta b(72)
dta b(73)
dta b(127)
dta b(125)
dta b(92)
MAP_01_NAME
dta d'kr'*,b(1+64*3),d'pcewo w prawo'*
dta d' I W LEWO '*
MAP_01_NAME_END
dta d'01'
MAP_02_NAME
dta d' staro'*,b(10+64*3),d'ytne '*
dta d' KO'*,b(2+64*2),d'CIEPIECHO '*
dta d'02'
dta d'sple'*,b(2+64*3),d'nia'*,b(11+64*3),d'a grota'*
dta d' OTY'*,b(11+64*2),d'EGO KOTA '*
dta d'03'
dta d' sawa woda alfa '*
dta d' SANTIAGO BELLA '*
dta d'04'
dta d' wydrapany loft '*
dta d'FERMENTACJI SERA'*
dta d'05'
dta d' dystopia sze'*,b(2+64*3),b(3+64*3),d' '*
dta d'DLA UMYTYCH LW'*,b(5+64*2),d'W'*
dta d'06'
dta d'komora kompresji'*
dta d'STAWONOG'*,b(5+64*2),d'W I KUR'*
dta d'07'
dta d' miejsce bytu '*
dta d'DWUMOLIBDENOWEGO'*
dta d'08'
dta d'swie'*,b(10+64*3),d'o wydr'*,b(4+64*3),b(10+64*3),d'ona'*
dta d'JAMA '*,b(10+64*2),d'UKA ZENONA'*
dta d'09'
dta d' przesi'*,b(4+64*3),d'kni'*,b(1+64*3),d'cie '*
dta d' PONUREGO Z'*,b(11+64*2),d'A '*
dta d'10'
dta d'tryskaj'*,b(4+64*3),d'ca jadem'*
dta d'KLITA CHRZCIELNA'*
dta d'11'
dta d' grzyby widelec '*
dta b(10+64*2),d'AR'*,b(5+64*2),d'WKA ROBOT V4'*
dta d'12'
dta d'podwodna piwnica'*
dta d'Z MI'*,b(1+64*2),d'SEM I PSAMI'*
dta d'13'
dta d' krater z'*,b(11+64*3),d'a i '*
dta d'SPIENIONEJ PIANY'*
dta d'14'
dta d'nisza schorza'*,b(11+64*3),d'ej'*
dta d' KOLONISTKI OLI '*
dta d'15'
dta d'izba sn'*,b(5+64*3),d'w du'*,b(10+64*3),d'ego'*
dta d'P'*,b(1+64*2),d'KATEGO SZATANA'*
dta d'16'
dta d'sprz'*,b(1+64*3),d'g kolimacji'*
dta d'NIKLOWO-KADMOWEJ'*
dta d'17'
dta d' ponury k'*,b(4+64*3),d't '*
dta d'ZAKICHANYCH CIA'*,b(11+64*2)
dta d'18'
dta d' jama przebicia '*
dta d'SYFU Z ZA'*,b(2+64*2),d'WIAT'*,b(5+64*2),d'W'*
dta d'19'
dta d' zw'*,b(1+64*3),d'glona budka '*
dta d' PE'*,b(11+64*2),d'NA MITOZY '*
dta d'20'
dta d' gibony strachu '*
dta d' TU JADA'*,b(11+64*2),d'Y '*,b(2+64*2),d'LUZ '*
dta d'21'
dta d' dom '*,b(10+64*3),d'ony brata '*
dta d' SIOSTRY TE'*,b(2+64*2),d'CIA '*
dta d'22'
dta d'podwodny bezkres'*
dta d'POLA '*,b(2+64*2),d'LEDZIOWEGO'*
dta d'23'
dta d' dwie zaropia'*,b(11+64*3),d'e '*
dta d'WN'*,b(1+64*2),d'TRZNO'*,b(2+64*2),d'CI DYNI'*
dta d'24'
dta b(2+64*3),d'luza numer trzy'*
dta d'ONGI'*,b(2+64*2),d' DZIA'*,b(11+64*2),d'AJ'*,b(4+64*2),d'CA'*
dta d'25'
dta d' przedpok'*,b(5+64*3),d'j '*
dta d'SNYCERSKICH PS'*,b(5+64*2),d'W'*
dta d'26'
dta d'zbiornik balsamu'*
dta d' Z DERMATOFIT'*,b(5+64*2),d'W '*
dta d'27'
dta d'miejsce poch'*,b(5+64*3),d'wku'*
dta d'OGORZA'*,b(11+64*2),d'EJ ESTERY'*
dta d'28'
dta d' upiorny loft '*
dta d'Z KRWAW'*,b(4+64*2),d' KAPLIC'*,b(4+64*2)
dta d'29'
dta d' biblioteka z '*
dta d' UMAR'*,b(11+64*2),b(4+64*2),d' PRAS'*,b(4+64*2),d' '*
dta d'30'
dta d' pop'*,b(1+64*3),d'kany strop '*
dta d' GROZI KOLAPSJ'*,b(4+64*2),d' '*
dta d'31'
dta d' wiktoria'*,b(15+64*3),d'ski '*
dta d' RYGIEL '*
dta d'32'
dta d' tunele pod '*
dta d' MIASTEM UWI'*,b(4+64*2),d'DU '*
dta d'33'
dta d' przeci'*,b(4+64*3),d'g jak '*
dta d' Z KOSZMARU '*
dta d'34'
dta d' bezkresne pola '*
dta d' OGLEJONU '*
dta d'35'
dta d' jaskinia '*
dta d'PONUREGO KINTARO'*
dta d'36'
dta d' w'*,b(5+64*3),d'lka '*
dta d' DOBROWOLSKA '*
dta d'37'
dta d' prze'*,b(11+64*3),b(1+64*3),d'cz '*
dta d' MASZTALERSKA '*
dta d'38'
dta d' anomalia '*
dta d' RZYGULIN '*
dta d'39'
dta d' ch'*,b(5+64*3),d'r '*
dta d' BEMBNIST'*,b(5+64*2),d'W '*
dta d'40'
dta d' zau'*,b(11+64*3),d'ek '*
dta d' Z'*,b(11+64*2),d'EJ TEKTONIKI '*
dta d'41'
dta d' termy '*,b(10+64*3),d'ywego '*
dta d' BOGA '*
dta d'42'
dta d' buda sanacyjna '*
dta d' NAD PRZEPA'*,b(2+64*2),d'CI'*,b(4+64*2),d' '*
dta d'43'
dta d' podkop '*
dta d' DR. KAMI'*,b(15+64*2),d'SKIEJ '*
dta d'44'
dta d' paul morty '*
dta d'KOHORTY GERIATRY'*
dta d'45'
dta d'ponure podziemne'*
dta d'OPACTWO PRZEMOCY'*
dta d'46'
dta d' przepastne '*
dta d' BEZDRO'*,b(10+64*2),d'A '*
dta d'47'
dta d' podziemny targ '*
dta d'Z RYBAMI I SEREM'*
dta d'48'
dta d' kryj'*,b(5+64*3),d'wka '*
dta d' KORUPCJONIST'*,b(5+64*2),d'W '*
dta d'49'
dta d' zalany tunel '*
dta d' SZMUGLER'*,b(5+64*2),d'W '*
dta d'50'
dta d' dwa anihilanty '*
dta d'ZNAMION KALECTWA'*
dta d'51'
MAP_NAME_LAST
dta b($9b)
FONT_MAPPER
dta b(>GAME_FONT) ; North
dta b(>GAME_FONT+2) ; West
dta b(>GAME_FONT_2) ; South
dta b(>GAME_FONT_2+2) ; East
LUDEK_DATA
dta b($62)
dta b($16)
dta b($38)
dta b($18)
dta b($70)
dta b($30)
dta b($70)
dta b($00)
dta b($30)
dta b($1C)
dta b($18)
dta b($18)
dta b($10)
dta b($38)
dta b($18)
dta b($38)
dta b($18)
dta b($18)
dta b($1C)
dta b($18)
dta b($10)
dta b($38)
dta b($18)
dta b($38)
dta b($0C)
dta b($30)
dta b($18)
dta b($18)
dta b($10)
dta b($38)
dta b($18)
dta b($38)
fnt
ift USESPRITES
.ALIGN $0800
pmg .ds $0300
ift FADECHR = 0
SPRITES
els
.ds $500
eif
eif
.ALIGN $0400
ant ANTIC_PROGRAM scr,ant
main
disable_antic
ldy #64
@ jsr synchro
dey
cpy #0
bne @-
mwa #TITLE_PART_1 ptr0
mwa #TITLE_PART_2 ptr1
lda #CS_FADEIN
sta credits_state
ldx #0
stx credits_timer
inx
stx credits_flips
mwa #CREDITS_BASE+80 ANTIC_PROGRAM0.CREDITS_ADDRESS_DL
ldx #CREDITCOLSTART
stx credits_color
lda #0
sta mapnumber
sta showsummary
lda >TITLE_FONT
sta CHBAS
jsr paint_title_text
jsr paint_level_number
jsr paint_amygdala_speed
enable_antic
ift USESPRITES
mva >pmg pmbase ;missiles and players data address
mva #$03 pmcntl ;enable players and missiles
eif
lda:cmp:req $14 ;wait 1 frame
sei ;stop interrups
mva #$00 nmien ;stop all interrupts
mva #$fe portb ;switch off ROM to get 16k more ram
ZPINIT
////////////////////
// RASTER PROGRAM //
////////////////////
lda #00
ldx #<MODUL
ldy #>MODUL
jsr RASTERMUSICTRACKER ;Init
jmp raster_program_end
LOOP lda vcount ;synchronization for the first screen line
cmp #$02
bne LOOP
mva #@dmactl(standard|dma|lineX1|players|missiles) dmactl ;set new screen width
mva <ant dlptr
mva >ant dlptr+1
; Initial values
c0 lda #$00
sta colbak
sta hposm1
sta color0
sta color2
sta color3
sta sizep0
sta sizep1
sta sizep2
sta sizep3
c1 lda #$0A
sta color1
lda #$02
sta chrctl
lda #$01
sta gtictl
s4 lda #$13
sta sizem
x0 lda #$60
sta hposp0
x1 lda #$68
sta hposp1
x2 lda #$70
sta hposp2
x3 lda #$81
sta hposp3
x4 lda #$77
sta hposm0
x5 lda #$69
sta hposm2
x6 lda #$89
sta hposm3
c4 lda #$10
sta colpm0
sta colpm1
sta colpm2
sta colpm3
:2 sta wsync
; --- wait 18 cycles
jsr _rts
cmp (0,x)
; --- set global offset (27 cycles)
jsr _rts
jsr _rts
cmp 0
; --- empty line
jsr wait54cycle
cmp 0\ nop
line0
jsr wait54cycle
cmp 0\ nop
line1
jsr wait54cycle
cmp 0\ nop
line2
jsr wait54cycle
cmp 0\ nop
line3
jsr wait54cycle
cmp 0\ nop
line4
jsr wait54cycle
cmp 0\ nop
line5
jsr wait54cycle
cmp 0\ nop
line6
jsr wait54cycle
cmp 0\ nop
line7
jsr wait54cycle
cmp 0
line8
jsr wait54cycle
cmp 0\ nop
line9
jsr wait54cycle
cmp 0\ nop
line10
jsr wait54cycle
cmp 0\ nop
line11
jsr wait54cycle
cmp 0\ nop
line12
jsr wait54cycle
cmp 0\ nop
line13
jsr wait54cycle
cmp 0\ nop
line14
jsr wait54cycle
cmp 0\ nop
line15
x8 lda #$81
x9 ldx #$92
sta hposp1
stx hposm3
cmp (0,x)
jsr wait36cycle
cmp 0
line16
x10 lda #$89
x11 ldx #$94
sta hposp2
stx hposp3
cmp (0,x)
jsr wait36cycle
cmp 0\ nop
line17
jsr wait54cycle
cmp 0\ nop
line18
jsr wait54cycle
cmp 0\ nop
line19
jsr wait54cycle
cmp 0\ nop
line20
jsr wait54cycle
cmp 0\ nop
line21
x12 lda #$6D
sta hposp0
jsr _rts
jsr wait36cycle
cmp 0\ nop
line22
x13 lda #$90
x14 ldx #$76
x15 ldy #$91
sta hposp3
stx hposm2
sty hposm3
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line23
jsr wait18cycle
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ nop
line24
jsr wait18cycle
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line25
x16 lda #$7E
sta hposm3
jsr _rts
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line26
jsr wait18cycle
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line27
jsr wait18cycle
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line28
jsr wait18cycle
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line29
s5 lda #$53
sta sizem
jsr _rts
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line30
x17 lda #$75
sta hposp2
jsr _rts
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
jsr _rts
cmp (0,x)\ cmp 0,x
line31
x18 lda #$7D
sta hposm3
jsr _rts
lda zc+0
sta hposp3
lda cl+0
:2 nop
sta hposp3
ldy #$70
ldx #$00
jsr _rts
:2 nop
line32
jsr wait18cycle
lda zc+0
stx color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line33
jsr wait18cycle
lda zc+0
stx color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line34
jsr wait18cycle
lda zc+0
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line35
jsr wait18cycle
lda zc+0
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line36
jsr wait18cycle
lda zc+0
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line37
jsr wait18cycle
lda zc+0
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line38
jsr wait18cycle
lda zc+0
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line39
jsr wait18cycle
lda zc+1
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
cmp (0,x)\ pha:pla
line40
x19 lda #$CB
c9 ldx #$00
sta hposp0
stx colpm0
cmp (0,x)
lda zc+1
sty color2
sta hposp3
lda cl+0
sta hposp3
cmp 0
stx color2
jsr _rts
cmp 0
line41
jsr wait18cycle
lda zc+1
sty color2
sta hposp3
lda cl+0
pha:pla
stx color2
jsr _rts
cmp 0
line42
jsr wait18cycle
sty color2
jsr _rts
jsr _rts
cmp (0,x)\ pha:pla
line43
jsr wait54cycle
cmp 0\ nop
line44
jsr wait54cycle
cmp 0\ nop
line45
jsr wait54cycle
cmp 0\ nop
line46
jsr wait54cycle
cmp 0\ nop
line47
jsr wait54cycle
cmp 0
line48
jsr wait54cycle
cmp 0\ nop
line49
s6 lda #$03
c10 ldx #$00
sta sizep1
stx colpm1
cmp (0,x)
jsr wait36cycle
cmp 0\ nop
line80
x20 lda #$2D
sta hposp1
ldy #$26
@ jsr wait54cycle
dey
bne @-
; At this point we are at the beginning of the instruction section
lda >TITLE_FONT
sta CHBASE
lda #$bd
sta color2
lda #$50
sta color1
ldy #$69
@ jsr wait54cycle
dey
bne @-
:4 jsr wait18cycle
; At this point we are at the beginning of the credits section
lda >CREDITS_FONT
sta CHBASE
lda credits_state
cmp #CS_FADEIN
bne cred_state_0
inc credits_color
lda credits_color
cmp #CREDITCOLEND
bne cred_state_fin
lda #CS_SHOW
sta credits_state
jmp cred_state_fin
cred_state_0
cmp #CS_FADEOUT
bne cred_state_1
dec credits_color
lda credits_color
cmp #CREDITCOLSTART
bne cred_state_fin
lda #CS_FADEIN
sta credits_state
jsr flip_credits
jmp cred_state_fin
cred_state_1
inc credits_timer
lda credits_timer
cmp #$70
bne cred_state_fin
lda #0
sta credits_timer
lda #CS_FADEOUT
sta credits_state
cred_state_fin