-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdesktop.asm
More file actions
1314 lines (1270 loc) · 62.3 KB
/
desktop.asm
File metadata and controls
1314 lines (1270 loc) · 62.3 KB
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
;BANK 0
Y_OFFSET_DESKTOP = $28
; all things "desktop"
; desktop as in command center of Vec T Rex
;
; "must" be included beforehand, so some
; vars (pointers) are known
include "titleScenery.asm"
; some variable in RAM
bss
TITLE_DISPLAY_MAN = %00000001
TITLE_MUST_INIT_STAGE = %10000000
TITLE_DESKTOP_LIT = %00000010
titleRoundCounter ds 2
desktop_flags ds 1
screenSize ds 1
screenIntensity ds 1
iconIntensity ds 1
interStageCounter ds 1
introStage ds 1
stageRAM_start ds 0
code
;.....................................................................
; first time on desktop
; init all
initAllTitle
clr introStage
lda #TITLE_MUST_INIT_STAGE
sta desktop_flags
clr iconIntensity
lda #$1f
sta screenIntensity
ldd #0
std titleRoundCounter
rts
;.....................................................................
; init for "storyboard player"
initScenery1 ;#isfunction
clr screenSize
clr interStageCounter
ldu #(laneRAM-laneData)
leau laneData,u
ldx #lane1Data
jsr initLane
ldd #0
sta stageCounter
std roundCounter
leau laneData,u
std ,u
rts
;.....................................................................
;
; this is called from the "title" loop
; and does one step of desktop "animation"
;.....................................................................
oneVBTitleStep ;#isfunction
; ...................
; get current joystick position and remember it
clr joystickDir
if ADDITIONAL_INPUT = 1
ldb additionalFlags
andb #BIT_INPUT_VARIANT
bne noDekstopJoystick
endif
jsr queryJoystick
;
lda Vec_Joy_1_X
beq notLeftt
bmi notRightt
lda #RIGHT
sta joystickDir
bra joystickDone
notRightt
lda #LEFT
sta joystickDir
bra joystickDone
notLeftt
lda Vec_Joy_1_Y
beq joystickDone
bmi notUpt
lda #UP
sta joystickDir
bra joystickDone
notUpt
lda #DOWN
sta joystickDir
notDownt
joystickDone
noDekstopJoystick
; ...................
; draw command center
; screen is drawn "dim" from start - but gets brighter when swiched on
lda screenIntensity
_INTENSITY_A ; Intensity_a
lda gameScale
sta <VIA_t1_cnt_lo
ldu #CommandCenter_0 ; screen
jsr draw_synced_list_fromzero__noshift
lda iconIntensity
ldb joystickDir
cmpb #RIGHT
bne notRight2t
lda #$5f
notRight2t
_INTENSITY_A
ldu #CommandCenter_1 ; arrow right
jsr draw_synced_list_fromzero__noshift
lda iconIntensity
ldb joystickDir
cmpb #UP
bne notUp2t
lda #$5f
notUp2t
_INTENSITY_A
ldu #CommandCenter_2 ; arrow
jsr draw_synced_list_fromzero__noshift
lda iconIntensity
ldb joystickDir
cmpb #LEFT
bne notLeft2t
lda #$5f
notLeft2t
_INTENSITY_A
ldu #CommandCenter_3 ; arrow left
jsr draw_synced_list_fromzero__noshift
lda iconIntensity
ldb joystickDir
cmpb #DOWN
bne notDown2t
lda #$5f
notDown2t
; ...................
; draw icons
_INTENSITY_A
ldu #CommandCenter_4 ; arrow
jsr draw_synced_list_fromzero__noshift
; calibration for smart lists
jsr calibrationZero7
lda iconIntensity
ldb joystickDir
cmpb #DOWN
bne notDown2t_icon
lda #$5f
notDown2t_icon
_INTENSITY_A
; V1.06
ldb #1
STB <VIA_port_b ;turn off mux
; draw high score stairs
ldd #$da00
MY_MOVE_TO_D_START_NO_SHIFT
lda #$05
sta <VIA_t1_cnt_lo
ldu #HSStairs
MY_MOVE_TO_A_END
jsr SMVB_drawSmart
; draw high fighter (anim)
lda iconIntensity
ldb joystickDir
cmpb #UP
bne notUp2t_icon
lda #$5f
notUp2t_icon
_INTENSITY_A
; V1.06
ldb #1
STB <VIA_port_b ;turn off mux
ldd #$5700
MY_MOVE_TO_D_START_NO_SHIFT
lda #$05
sta <VIA_t1_cnt_lo
clrb
ldu #SM_Fighter_Anim
lda Vec_Loop_Count+1
anda #2
beq zeroF
ldb #2
zeroF
ldu b,u
MY_MOVE_TO_A_END
jsr SMVB_drawSmart
_ZERO_VECTOR_BEAM
; jsr calibrationZero7
lda gameScale
sta <VIA_t1_cnt_lo
; draw tools (options)
lda iconIntensity
ldb joystickDir
cmpb #RIGHT
bne notRight2t_icon
lda #$5f
notRight2t_icon
_INTENSITY_A
; V1.06
ldb #1
STB <VIA_port_b ;turn off mux
ldd #$1657
MY_MOVE_TO_D_START_NO_SHIFT
lda #$05
sta <VIA_t1_cnt_lo
ldu #HSOptions
MY_MOVE_TO_A_END
jsr SMVB_drawSmart
; jsr calibrationZero7
; draw scroll (achievements)
lda iconIntensity
ldb joystickDir
cmpb #LEFT
bne notLeft2t_icon
lda #$5f
notLeft2t_icon
_INTENSITY_A
; V1.06
ldb #1
STB <VIA_port_b ;turn off mux
ldd #$1ea3
MY_MOVE_TO_D_START_NO_SHIFT
lda #$05
sta <VIA_t1_cnt_lo
ldu #HSAchievements
MY_MOVE_TO_A_END
jsr SMVB_drawSmart
; draw console - always
lda #$1f
ldb desktop_flags
andb #TITLE_DESKTOP_LIT
beq notLit
lda #$3f
notLit
jsr Intensity_a
_LDD -$36-Y_OFFSET_DESKTOP, $4b
MY_MOVE_TO_D_START_NO_SHIFT
lda #$07
sta <VIA_t1_cnt_lo
ldu #HSConsole
MY_MOVE_TO_A_END
jsr SMVB_drawSmart
ldb desktop_flags
andb #TITLE_DISPLAY_MAN
beq doAStage
; jsr calibrationZero7
lda #80
sta <VIA_t1_cnt_lo
lda #-60 -Y_OFFSET_DESKTOP
ldb #55
MY_MOVE_TO_D_START_NO_SHIFT
lda #$07 ; 9
sta <VIA_t1_cnt_lo
ldu #HSMJStandingBack
MY_MOVE_TO_A_END
jsr SMVB_drawSmart
jsr Reset_Pen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; now different "stages" of the desktop will be done
; as of now x stages ...
; 0 scroll text
; 1 intro do enemies
; 2 particles
;
; if more are to come, than I will do a proper "switch case"
doAStage
ldx #stagesPointer
lda introStage
lsla
ldx a,x
bne stageOk
clr introStage
lda #TITLE_MUST_INIT_STAGE
sta desktop_flags
bra doAStage
stageOk
jmp ,x
;
; .....................................................
;
stagesPointer
dw doStageSwitchLightsOn
dw doStageManComes
dw doStageScroller
dw doStageManGoes
dw doStageWait
dw doStageBonusExplain
dw doStageParticles
dw doStageDemo
dw 0
;
; .....................................................
;
initStageStageWait ;#isfunction
ldd #0
std titleRoundCounter
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
rts
;
; .....................................................
;
doStageWait
lda desktop_flags
bpl initIsDoneStageWait
bsr initStageStageWait
initIsDoneStageWait
ldd titleRoundCounter
addd #1
std titleRoundCounter
cmpd #100 ; 2 seconds
bne exitWait
inc introStage
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
exitWait
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE -2 scroll text ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
initStageStageSwitchLightsOn ;#isfunction
ldd #0
std titleRoundCounter
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
lda #$1f
sta screenIntensity
clr iconIntensity
rts
;
; .....................................................
;
doStageSwitchLightsOn ;#isfunction
lda desktop_flags
bpl initIsDoneStageSwitchLightsOn
bsr initStageStageSwitchLightsOn
initIsDoneStageSwitchLightsOn
ldd titleRoundCounter
addd #1
std titleRoundCounter
ldx titleRoundCounter
cmpx #25 ; half a second
blo exitThis
cmpx #25
bne not25
lda desktop_flags
ora #TITLE_DESKTOP_LIT
sta desktop_flags
rts
not25
cmpx #30
bne not30
lda desktop_flags
anda #$ff-TITLE_DESKTOP_LIT
sta desktop_flags
rts
not30
cmpx #35
bne not35
lda desktop_flags
ora #TITLE_DESKTOP_LIT
sta desktop_flags
rts
not35
cmpx #40
bne not40
lda desktop_flags
anda #$ff-TITLE_DESKTOP_LIT
sta desktop_flags
rts
not40
cmpx #45
bne not45
lda desktop_flags
ora #TITLE_DESKTOP_LIT
sta desktop_flags
rts
not45
cmpx #70
bne not70
lda #$2f
sta screenIntensity
rts
not70
ldd titleRoundCounter+1
anda #%00000011
bne noLighter
inc iconIntensity
rts
noLighter
cmpx #150
bne exitThis
lda #$2f
sta iconIntensity
inc introStage
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
exitThis
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE 0 scroll text ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include "titleScroll.asm"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bss
org stageRAM_start
it_stringCounter ds 1 ; which string in the pointer list to start with
it_lineCounter ds 1 ; line for the scroll line within one string (bitmap)
it_linePrintOffset ds 1 ; compensation offset while printing for line gap between two strings
it_xlinePrintOffset ds 1 ; x offset of line (used to ensure MID alignment)
tmp2_lc ds 1 ; counter of how many string lines have been processed within the scroller (coutdown from BITMAP_LINES_TITLE)
tmp3_lc ds 1
code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
initStageScroller ;#isfunction
clr it_stringCounter
clr it_lineCounter
clr it_linePrintOffset
ldd #IntroTextScrollPointers
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
rts
MAX_STRING_NO_DISPLAY = 89 ;64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; scroller
doStageScroller ;#isfunction
lda desktop_flags
bpl initIsDoneStageScroller
bsr initStageScroller
initIsDoneStageScroller
lda #$38 ;30;28 ; scale used for positioning of scroller (strength is maxed $) changing -> waits in scroller must be adjusted
sta <VIA_t1_cnt_lo
jsr Reset_Pen
jsr Intensity_5F
ldd #$7fa0 ;$7f90;$7f81 ; move to
suba it_linePrintOffset
tfr d,x
ldu #IntroTextScrollPointers
ldb it_stringCounter
clra
MY_LSL_D
ldu d,u
lda it_lineCounter
jsr printStringList_25_Sync_direct
lda Vec_Loop_Count+1
anda #%11 ; decrease scroller each 3rd round
bne noChangeStageScroller
lda it_linePrintOffset
bne offsetChangeOnly
lda it_lineCounter
inca
cmpa #FONT_HEIGHT
bne staLineCounter
clra
ldb it_linePrintOffset
addb #SPACE_BETWEEN_STRINGS
stb it_linePrintOffset
ldb it_stringCounter
incb
cmpb #MAX_STRING_NO_DISPLAY ; number of max string lines printed at the moment (should be determined somehow)
bne keepStrinGlines
bra StageScrollerFinished
clrb
keepStrinGlines
stb it_stringCounter
staLineCounter
sta it_lineCounter
noChangeStageScroller
rts
offsetChangeOnly
ldb it_linePrintOffset
subb #SPACE_BETWEEN_LINES
stb it_linePrintOffset
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE 0 END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bss
org stageRAM_start
sceneryLooped ds 1 ; indicator, rthat scenery has reseted this round!
code
StageScrollerFinished
inc introStage
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE -1a ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
initStageManGoes
lda #$2f
sta screenIntensity
clr stageCounter
clr interStageCounter
clr sceneryLooped
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE -TITLE_DISPLAY_MAN
sta desktop_flags
jsr initScenery1
lda #23 ; skip 18 stages
sta titleRoundCounter
doNextLane2
ldy #laneRAM
doNextLane1
ldd ,y
beq lanesDone1
jsr initNextElementSilent
leay laneData,y
bra doNextLane1
lanesDone1
dec titleRoundCounter
bne doNextLane2
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
doStageManGoes
lda desktop_flags
bpl initIsDoneStageManGoes
bsr initStageManGoes
initIsDoneStageManGoes
lda sceneryLooped ; scenery had reseted -> go to next stage!
beq checkOn_st2
inc introStage
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
jmp doAStage
checkOn_st2
jsr Reset_Pen
jsr oneScenarioStep1
_ZERO_VECTOR_BEAM
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE -1b ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
initStageManComes
lda #$2f
sta screenIntensity
clr stageCounter
clr interStageCounter
clr sceneryLooped
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
jmp initScenery1
doStageManComes
lda desktop_flags
bpl initIsDoneStageManComes
bsr initStageManComes
initIsDoneStageManComes
; do sceneries of enemies
; Scenery: _GTitle1.xml (new )
;
; look in what scenery stage we are
;
lda sceneryLooped ; scenery had reseted -> go to next stage!
beq checkOn_st
inc introStage
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
jmp doAStage
checkOn_st
lda stageCounter
cmpa #2 ; from that stage on grow the screen
blo lowerStageManComes ; lower stage 2, than draw nothing special
bne higherStageManComes
drawStageManComes
lda desktop_flags
ora #TITLE_DISPLAY_MAN
sta desktop_flags
;stage 2 screen was switched on and increases in size and brightness
inc interStageCounter
inc interStageCounter
inc interStageCounter
inc interStageCounter
inc interStageCounter
bpl sizeiscok_2
lda #$7f
sta interStageCounter
inc introStage
lda #$5f ;interStageCounter
sta screenIntensity
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
sizeiscok_2
lda interStageCounter
sta <VIA_t1_cnt_lo
ldu #CommandCenter_0
jsr draw_synced_list_fromzero__noshift ; this is only drawn when growing, the full grown screen switches to higher intensity of the "normal" desktop
_ZERO_VECTOR_BEAM
rts
higherStageManComes
LAST_STAGES_1 = 3 ;+19
lda stageCounter
cmpa #2 ;3
bne lowerStageManComes
lda #5
sta stageCounter
lda desktop_flags
ora #TITLE_DISPLAY_MAN
sta desktop_flags
rts
lowerStageManComes
jsr Reset_Pen
jsr oneScenarioStep1
_ZERO_VECTOR_BEAM
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
initStageBonusExplain ;#isfunction
clr stageCounter
clr interStageCounter
clr sceneryLooped
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
jmp initScenery1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
doStageBonusExplain ;#isfunction
lda desktop_flags
bpl initIsDoneStageBonusExplain
bsr initStageBonusExplain
initIsDoneStageBonusExplain
; do sceneries of enemies
; Scenery: _GTitle1.xml (new )
;
; look in what scenery stage we are
;
lda sceneryLooped ; scenery had reseted -> go to next stage!
beq checkOn_1
inc introStage
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
jmp doAStage
checkOn_1
lda stageCounter
cmpa #2 ; from that stage on grow the screen
lblo lowerStageBonusExplain ; lower stage 2, than draw nothing special
bne higherStageBonusExplain
drawStageBonusExplain
;stage 2 screen was switched on and increases in size and brightness
inc interStageCounter
inc interStageCounter
inc interStageCounter
inc interStageCounter
inc interStageCounter
bpl sizeiscok_1
lda #$7f
sta interStageCounter
sizeiscok_1
lda interStageCounter
sta <VIA_t1_cnt_lo
ldu #CommandCenter_0
jsr draw_synced_list_fromzero__noshift ; this is only drawn when growing, the full grown screen switches to higher intensity of the "normal" desktop
_ZERO_VECTOR_BEAM
bra fromlower2_1
higherStageBonusExplain
lda #$5f ;interStageCounter
sta screenIntensity
fromlower2_1
LAST_STAGES = 3 +19
lda stageCounter
cmpa #LAST_STAGES
bhi noMan_1
lda desktop_flags
ora #TITLE_DISPLAY_MAN
sta desktop_flags
noMan_1
lda stageCounter
cmpa #3
blo noTextDisplay_1
lsla
ldu #textPointer2
ldu a,u
beq noTextDisplay_1
ldd Vec_Text_Height
pshs d
ldd #$fb40
std Vec_Text_Height
IRQ_TO_0_T1
lda gameScale
sta VIA_t1_cnt_lo
ldb ,u+
clra
jsr syncPrintStrd
puls d
std Vec_Text_Height
IRQ_TO_0_SHIFT
lda #$2f
jsr Intensity_a
_ZERO_VECTOR_BEAM
noTextDisplay_1
lowerStageBonusExplain
jsr Reset_Pen
jsr oneScenarioStep1
_ZERO_VECTOR_BEAM
lda #$2f
jsr Intensity_a
lda stageCounter
cmpa #5 +18 ; from that stage on switch the screen off
blo returnnow1_1
lda #$2f ;interStageCounter
sta screenIntensity
lda desktop_flags
anda #$ff-TITLE_DISPLAY_MAN
sta desktop_flags
returnnow1_1
rts
textPointer2
dw 0
dw 0
dw 0
dw shot1
dw shot2
dw faster
dw slower
dw sfaster
dw sslower
dw extrabullet
dw lessbullet
dw scoopEnemy
dw shielding
dw armoring
dw mining
dw mul2
dw mul5
dw cashbomb
dw diamondbomb
dw timering
dw doubleCash
dw powerUp
dw liveup
dw 0
dw 0
dw 0
dw 0
dw 0
dw 0
;
ONE_CHAR = 2
HALF_ONE_CHAR = 3
TWO_CHAR = 4
HALF_TWO_CHAR = 5
THREE_CHAR = 6
FOUR_CHAR = 8
HALF_FOUR_CHAR = 9
CHAR_WIDTH = 5
ORIGIN_TEXT = -66
shot1 db ORIGIN_TEXT+28, "ONE SHOT",$80
shot2 db ORIGIN_TEXT+28, "TWO SHOT",$80
faster db ORIGIN_TEXT+CHAR_WIDTH*HALF_ONE_CHAR-1, "SHIP FASTER",$80 ; half
slower db ORIGIN_TEXT+CHAR_WIDTH*HALF_ONE_CHAR-1, "SHIP SLOWER",$80 ; half
sfaster db ORIGIN_TEXT+CHAR_WIDTH*HALF_ONE_CHAR-1, "SHOT FASTER",$80 ; half
sslower db ORIGIN_TEXT+CHAR_WIDTH*HALF_ONE_CHAR-1, "SHOT SLOWER",$80 ; half
extrabullet db ORIGIN_TEXT+CHAR_WIDTH*ONE_CHAR, "MORE BULLETS",$80
lessbullet db ORIGIN_TEXT+CHAR_WIDTH*ONE_CHAR, "LESS BULLETS",$80
scoopEnemy db ORIGIN_TEXT+CHAR_WIDTH*HALF_ONE_CHAR-1, "SCOOP ENEMY",$80 ; half
shielding db ORIGIN_TEXT+CHAR_WIDTH*FOUR_CHAR-4, "SHIELD",$80
armoring db ORIGIN_TEXT+CHAR_WIDTH*HALF_FOUR_CHAR-4, "ARMOR",$80 ; half
mining db ORIGIN_TEXT+CHAR_WIDTH*HALF_TWO_CHAR-1, "MINESTORM",$80 ; half
mul2 db ORIGIN_TEXT+CHAR_WIDTH*ONE_CHAR, "MULTIPLY X 2",$80
mul5 db ORIGIN_TEXT+CHAR_WIDTH*ONE_CHAR, "MULTIPLY X 5",$80
cashbomb db ORIGIN_TEXT+CHAR_WIDTH*HALF_TWO_CHAR-1, "CASH BOMB",$80 ; half
diamondbomb db ORIGIN_TEXT+CHAR_WIDTH*ONE_CHAR, "DIAMOND BOMB",$80
timering db ORIGIN_TEXT+CHAR_WIDTH*TWO_CHAR, "BONUS TIME",$80
doubleCash db ORIGIN_TEXT+CHAR_WIDTH*HALF_ONE_CHAR-1, "DOUBLE CASH",$80 ; half
powerUp db ORIGIN_TEXT+28, "POWER UP",$80
liveup db ORIGIN_TEXT+CHAR_WIDTH*TWO_CHAR, "EXTRA LIFE",$80
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE 1 END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include "particles.asm"
bss
org stageRAM_start
;
u_offset1 = -NEXT_OBJECT ; behaviour offset is determined by next structure element
PARTICLES_DONE_A ds 2 ;
PARTICLES_DONE = PARTICLES_DONE_A-2
; jump back addresses
; for "last" behaviour routine
;
PLIST_COMPARE_ADDRESS:
startParticleRAM ds 0
anglechangeCountDown ds 1
angleChangePointer ds 2
emitterData1 ds EmitterData
emitterData2 ds EmitterData
emitterData3 ds EmitterData
;random_seed ds 1
plist_empty_head ds 2 ; if empty these contain a value that points to a RTS, smaller than OBJECT_LIST_COMPARE_ADDRESS
plist_objects_head ds 2 ; if greater OBJECT_LIST_COMPARE_ADDRESS, than this is a pointer to a RAM location of an Object
pCount ds 1
pobject_list ds Particle*PARTICLE1_MAX_COUNT
pobject_list_end ds 0
;
; ROM
code
initStageParticles
jsr initParticle1
ldd #0
std Vec_Loop_Count
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
doStageParticles
lda desktop_flags
bpl initIsDoneStageParticles
bsr initStageParticles
initIsDoneStageParticles
ldd Vec_Loop_Count
cmpd #750 ; 15 seconds particle demo
blo stayWithParticels
lda desktop_flags
ora #TITLE_MUST_INIT_STAGE
sta desktop_flags
inc introStage
jmp doAStage
stayWithParticels
JSR Intensity_3F ; Sets the intensity of the
; jmp playParticle1;
lda #23
sta <VIA_t1_cnt_lo
jmp playParticle1 ; playParticleInteractive
initStageDemo
lda desktop_flags
anda #$ff-TITLE_MUST_INIT_STAGE
sta desktop_flags
rts
doStageDemo
lda desktop_flags
bpl initIsDoneStageDemo
bsr initStageDemo
initIsDoneStageDemo
lda #1
sta isDemoMode
REPLACE_1_2_main11_varFrom1_21 ; bank 1 replace
ldx #0 ; main11
jmp jmpBankIRQ3X
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;; STAGE 2 END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CommandCenter_0:
DB $01, -$16, +$28 ; sync and move to y, x
DB $FF, +$12, +$19 ; draw, y, x
DB $FF, +$38, +$00 ; draw, y, x
DB $FF, +$13, -$18 ; draw, y, x
DB $FF, +$00, -$50 ; draw, y, x
DB $FF, -$13, -$19 ; draw, y, x
DB $FF, -$38, +$00 ; draw, y, x
DB $FF, -$12, +$19 ; draw, y, x
DB $FF, +$00, +$50 ; draw, y, x
DB $02 ; endmarker
CommandCenter_1:
DB $01, +$19, +$32 ; sync and move to y, x
DB $00, +$00, +$32 ; additional sync move to y, x
DB $00, +$00, +$06 ; additional sync move to y, x
DB $FF, -$19, -$20 ; draw, y, x
DB $FF, +$32, +$00 ; draw, y, x
DB $FF, -$18, +$20 ; draw, y, x
DB $02 ; endmarker
CommandCenter_2:
DB $01, +$46, +$00 ; sync and move to y, x
DB $00, +$26, +$00 ; additional sync move to y, x
DB $FF, -$1A, +$22 ; draw, y, x
DB $FF, +$00, -$46 ; draw, y, x
DB $FF, +$1A, +$24 ; draw, y, x
DB $02 ; endmarker
CommandCenter_3:
DB $01, +$18, -$32 ; sync and move to y, x
DB $00, +$00, -$32 ; additional sync move to y, x
DB $00, +$00, -$06 ; additional sync move to y, x
DB $FF, +$1A, +$20 ; draw, y, x
DB $FF, -$32, +$00 ; draw, y, x
DB $FF, +$18, -$20 ; draw, y, x
DB $02 ; endmarker
CommandCenter_4:
DB $01, -$39, +$00 ; sync and move to y, x
DB $FF, +$1A, -$22 ; draw, y, x
DB $FF, +$00, +$46 ; draw, y, x
DB $FF, -$1A, -$23 ; draw, y, x
DB $02 ; endmarker
HSStairs
db -$24, $01, $00, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db -$12, $01, $00, hi(SMVB_startMove_single), lo(SMVB_startMove_single)
db $ee, $01, -$7F, hi(SMVB_startDraw_newY_eq_oldX_single), lo(SMVB_startDraw_newY_eq_oldX_single) ; y was $00, now $ee
db -$48, $01, $00, hi(SMVB_continue6_single), lo(SMVB_continue6_single)
db $00, $01, $7F
db $48, $01, $00
db $00, $01, $7F
db -$48, $01, $00
db $00, $01, -$7F
db $12, $01, $36, hi(SMVB_startMove_single), lo(SMVB_startMove_single)
db $00, $01, $12, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db $12, $01, $00, hi(SMVB_continue_newY_eq_oldX_single), lo(SMVB_continue_newY_eq_oldX_single) ; y is $12
db $ce, $01, -$12, hi(SMVB_startMove_newY_eq_oldX_single), lo(SMVB_startMove_newY_eq_oldX_single) ; y was $00, now $ce
db $ee, $01, $12, hi(SMVB_startDraw_yStays_single), lo(SMVB_startDraw_yStays_single) ; y was $00, now $ee
db $12, $01, $00, hi(SMVB_continue2_single), lo(SMVB_continue2_single)
db $00, $01, -$12
db $12, $01, $00, hi(SMVB_startMove_single), lo(SMVB_startMove_single)
db $49, $01, $00, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db $00, $01, -$6C, hi(SMVB_continue2_single), lo(SMVB_continue2_single)
db -$49, $01, $00
db -$12, $01, -$12, hi(SMVB_startMove_yEqx_single), lo(SMVB_startMove_yEqx_single) ; y is -$12
db $00, $01, $12, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db -$12, $01, $00, hi(SMVB_continue4_single), lo(SMVB_continue4_single)
db $00, $01, -$12
db -$12, $01, $00
db $00, $01, $12
db $40, $00, $00, hi(SMVB_lastDraw_rts), lo(SMVB_lastDraw_rts)
HSOptions
db $07, $01, -$0A, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db $4D, $01, -$4C, hi(SMVB_continue7_single), lo(SMVB_continue7_single)
db $02, $01, $0B
db $35, $01, -$35
db -$15, $01, -$15
db -$35, $01, $35
db $0C, $01, $03
db -$4D, $01, $4E
db -$08, $01, $06, hi(SMVB_continue5_single), lo(SMVB_continue5_single)
db $08, $01, $09
db -$18, $01, $15
db -$05, $01, -$06
db $15, $01, -$18
db -$15, $01, -$57, hi(SMVB_startMove_single), lo(SMVB_startMove_single)
db $15, $01, -$15, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db $69, $01, $7E, hi(SMVB_continue7_single), lo(SMVB_continue7_single)
db $15, $01, -$15
db $2B, $01, $2A
db -$40, $01, $40
db -$2A, $01, $00
db $00, $01, -$2B
db $15, $01, -$15
db -$69, $01, -$7E, hi(SMVB_continue_single), lo(SMVB_continue_single)
db $40, $00, $00, hi(SMVB_lastDraw_rts), lo(SMVB_lastDraw_rts)
HSAchievements
db -$13, $01, -$17, hi(SMVB_startDraw_single), lo(SMVB_startDraw_single)
db -$17, $01, -$04, hi(SMVB_continue6_single), lo(SMVB_continue6_single)
db -$16, $01, $0C
db $01, $01, $1D
db -$7A, $01, -$15
db -$14, $01, $08
db -$0E, $01, $1B
db $03, $01, $4F, hi(SMVB_continue_double), lo(SMVB_continue_double)
db $12, $01, $11, hi(SMVB_continue4_single), lo(SMVB_continue4_single)
db $19, $01, $03
db $15, $01, -$0D
db -$06, $01, -$57