-
Notifications
You must be signed in to change notification settings - Fork 0
/
mariomovie.asm
7995 lines (7293 loc) · 117 KB
/
mariomovie.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
nbasic_stack = 256
spritemem = 768
background_tile_array = 512
music_bug_fix = 100
texts = 0
palette_data_array = 2
att_data_array = 4
background_data_array = 6
songs = 8
which_song = 10
mute = 14
mute_new = 18
sprite_anim_data_array = 22
sprite_data_array = 24
sprite_anim_data_array2 = 26
sprite_data_array2 = 28
background_data_arrayop = 30
palette_start = 36
att_start = 37
current_NT = 38
rle_counter = 39
background_shape_distance = 40
background_shape = 41
background_tile_array_counter = 42
background_tile_array_counter_down = 43
song_number_new = 44
song_timez = 45
new_music_page = 46
new_music_page_big = 47
music_counter_file = 48
music_counter = 49
songloadloop = 50
whichsong = 51
mute_joy1a = 52
whichsongcounter = 53
global_tempo = 54
sound1a = 55
sound1b = 56
sound2a = 57
sound2b = 58
sound3a = 59
sound3b = 60
sound4a = 61
sound4b = 62
color_show = 63
color_show_beige = 64
color_show_beige2 = 65
color_show_beige3 = 66
sprite_type = 67
spritemem_array_pos = 68
sprite_mem_loc_master = 69
total_blocks_master = 70
anim_file_counter = 71
direction = 72
counter = 73
sprite_delay = 74
sprite_data_pos = 75
new_sprite_data_pos = 76
total_blocks = 77
sprite_delay_master = 78
sprite_type2 = 79
spritemem_array_pos2 = 80
sprite_mem_loc_master2 = 81
total_blocks_master2 = 82
anim_file_counter2 = 83
direction2 = 84
counter2 = 85
sprite_delay2 = 86
sprite_data_pos2 = 87
new_sprite_data_pos2 = 88
total_blocks2 = 89
sprite_delay_master2 = 90
timer = 91
music_timer = 92
scene_timer = 93
dvdcounter = 94
PPUHI = 95
PPULOW = 96
PPULOW_START = 97
TEXTPOS = 98
CHARCOUNTER = 99
special_5 = 110
special_scroll_5 = 111
scene5_temp = 112
scene5_temp_2 = 113
timer_noise = 114
scene5_loop = 115
special = 116
special_temp = 117
special_temp_2 = 118
special_temp_2_master = 119
scroll_delay = 120
scroll_delay_master = 121
special_scroll = 122
scroll = 123
scroll2 = 124
nmi_2_do_special = 125
scene6_temp = 126
scene6_temp_2 = 127
scene6_loop = 128
att_var = 129
special_att_counter = 130
special_att = 131
scene10temp = 132
pong_trick = 133
pong_trick_loc = 134
pong_trick_temp = 135
scene10loop_var = 136
nmi_to_do = 137
sprite_mem_loc = 138
sprite_across_counter = 139
sprite_down_counter = 140
sprite_width = 141
x_offset = 142
temp = 143
sprite_y = 144
sprite_x = 145
erase_sprite_var = 146
palette_counter = 147
tempcounter = 148
NT_down = 149
background_low = 150
backgroundshape_loc = 151
backgroundshape_loc_offset = 152
background_tile_loc = 153
NT_across = 154
background_hi = 155
draw_background_across_counter = 156
palette_text = 157
character = 158
joy1a = 159
joy1b = 160
joy1select = 161
joy1start = 162
joy1up = 163
joy1down = 164
joy1left = 165
joy1right = 166
i1 = 167
i2 = 168
i3 = 169
i4 = 170
nmi_to_do_special = 171
.inesprg 2
.ineschr 1
.inesmir 1
.inesmap 0
.org $8000
.bank 0
start:
sei
cld
;++++++++++++++++++++++++++++++++++++++++++++++++
;Clear Memory and crap.......
;++++++++++++++++++++++++++++++++++++++++++++++++
.vblank_clear1
lda $2002
bpl .vblank_clear1
.vblank_clear2
lda $2002
bpl .vblank_clear2
.vblank_clear3
lda $2002
bpl .vblank_clear3
sei
cld
.vblank_clear4
lda $2002
bpl .vblank_clear4
.vblank_clear5
lda $2002
bpl .vblank_clear5
.vblank_clear6
lda $2002
bpl .vblank_clear6
lda #$00
ldx #$00
.clear_out_ram
sta $000,x
sta $100,x
sta $200,x
sta $300,x
sta $400,x
sta $500,x
sta $600,x
sta $700,x
inx
bne .clear_out_ram
lda #$00
ldx #$00
.clear_out_sprites
sta $2000,x
sta $2100,x
sta $2200,x
sta $2300,x
sta $2400,x
sta $2500,x
sta $2600,x
sta $2700,x
sta $2800,x
sta $2900,x
sta $2a00,x
sta $2b00,x
sta $2c00,x
sta $2d00,x
sta $2e00,x
sta $2f00,x
inx
bne .clear_out_sprites
ldx #$FF
txs
jsr vwait
jsr vwait
jsr clear_att
lda #%10010000
sta $2000
lda #%00011000
sta $2001
init_vars:
lda #0
sta palette_start
lda #0
sta att_start
lda #0
sta current_NT
lda #0
sta rle_counter
lda #0
sta background_shape_distance
lda #0
sta background_shape
lda #0
sta background_tile_array_counter
lda #10
sta background_tile_array_counter_down
lda #0
sta song_number_new
lda #0
sta song_timez
lda #0
sta new_music_page
lda #0
sta new_music_page_big
lda #0
sta music_counter_file
lda #6
sta music_counter
lda #0
sta songloadloop
lda #1
sta whichsong
lda #1
sta mute_joy1a
lda #0
sta whichsongcounter
lda #6
sta global_tempo
lda #15
sta 16405
lda #1
ldx #0
sta mute,x
lda #1
ldx #1
sta mute,x
lda #1
ldx #2
sta mute,x
lda #0
ldx #3
sta mute,x
lda #1
ldx #0
sta mute_new,x
lda #1
ldx #1
sta mute_new,x
lda #1
ldx #2
sta mute_new,x
lda #0
ldx #3
sta mute_new,x
ldx #0
lda theme1,x
ldx #0
sta songs,x
ldx #1
lda theme1,x
ldx #1
sta songs,x
ldx #0
lda songs,x
ldx #0
sta which_song,x
ldx #1
lda songs,x
ldx #1
sta which_song,x
lda #0
sta sound1a
lda #0
sta sound1b
lda #0
sta sound2a
lda #0
sta sound2b
lda #0
sta sound3a
lda #0
sta sound3b
lda #0
sta sound4a
lda #0
sta sound4b
lda #0
sta color_show
lda #0
sta color_show_beige
lda #0
sta color_show_beige2
lda #0
sta color_show_beige3
lda #0
sta sprite_type
lda #0
sta spritemem_array_pos
lda #0
sta sprite_mem_loc_master
lda #0
sta total_blocks_master
lda #0
sta anim_file_counter
lda #0
sta direction
lda #0
sta counter
lda #0
sta sprite_delay
lda #0
sta sprite_data_pos
lda #0
sta new_sprite_data_pos
lda #0
sta total_blocks
lda #0
sta sprite_delay_master
lda #0
sta sprite_type2
lda #0
sta spritemem_array_pos2
lda #0
sta sprite_mem_loc_master2
lda #0
sta total_blocks_master2
lda #0
sta anim_file_counter2
lda #0
sta direction2
lda #0
sta counter2
lda #0
sta sprite_delay2
lda #0
sta sprite_data_pos2
lda #0
sta new_sprite_data_pos2
lda #0
sta total_blocks2
lda #0
sta sprite_delay_master2
lda #0
sta timer
lda #0
sta music_timer
lda #0
sta scene_timer
lda #0
sta dvdcounter
lda #32
sta PPUHI
lda #230
sta PPULOW
lda PPULOW
sta PPULOW_START
lda #0
sta TEXTPOS
lda #0
sta CHARCOUNTER
lda #0
sta special_5
lda #0
sta special_scroll_5
lda #0
sta scene5_temp
lda #0
sta scene5_temp_2
lda #0
sta timer_noise
lda #0
sta scene5_loop
lda #0
sta special
lda #0
sta special_temp
lda #0
sta special_temp_2
lda #64
sta special_temp_2_master
lda #5
sta scroll_delay
lda #5
sta scroll_delay_master
lda #0
sta special_scroll
lda #0
sta scroll
lda #0
sta scroll2
lda #0
sta nmi_2_do_special
lda #0
sta scene6_temp
lda #128
sta scene6_temp_2
lda #0
sta scene6_loop
lda #0
sta att_var
lda #0
sta special_att_counter
lda #0
sta special_att
lda #0
sta scene10temp
lda #0
sta pong_trick
lda #49
sta pong_trick_loc
lda #0
sta pong_trick_temp
lda #2
sta scene10loop_var
jsr screen_off
dvdtitle:
lda #2
sta scene_timer
jsr scene_title
dvdscene1:
jsr scene1
dvdscene2:
jsr scene2
dvdscene3:
jsr scene3
lda #0
ldx #0
sta songs,x
lda #128
ldx #1
sta songs,x
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #3
sta global_tempo
lda #208
sta timer_noise
lda #6
sta scene5_loop
jsr scene5
dvdscene4:
ldx #0
lda background12,x
ldx #0
sta background_data_array,x
ldx #1
lda background12,x
ldx #1
sta background_data_array,x
jsr scene4
lda #0
ldx #0
sta songs,x
lda #128
ldx #1
sta songs,x
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #3
sta global_tempo
lda #209
sta timer_noise
lda #6
sta scene5_loop
jsr scene5
jsr scene4redux
dvdscene5:
lda #9
sta scene10loop_var
jsr scene10
lda #0
ldx #0
sta songs,x
lda #128
ldx #1
sta songs,x
lda #3
sta global_tempo
lda #210
sta timer_noise
lda #6
sta scene5_loop
jsr scene5
dvdscene6:
jsr scene6
lda #0
ldx #0
sta songs,x
lda #128
ldx #1
sta songs,x
lda #3
sta global_tempo
lda #210
sta timer_noise
lda #7
sta scene5_loop
jsr scene5
dvdscene7:
jsr scene7
lda #0
ldx #0
sta songs,x
lda #128
ldx #1
sta songs,x
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #9
sta global_tempo
lda #217
sta timer_noise
lda #16
sta scene5_loop
jsr scene5
dvdscene8:
jsr scene12
lda #0
ldx #0
sta songs,x
lda #128
ldx #1
sta songs,x
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #9
sta global_tempo
lda #217
sta timer_noise
lda #18
sta scene5_loop
jsr scene5
dvdscene9:
jsr scene8
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #9
sta global_tempo
lda #247
sta timer_noise
lda #3
sta scene5_loop
jsr scene5
dvdscene10:
jsr scene9
dvdscene11:
jsr scene11
dvdscene12:
jsr scene16
dvdscene14:
jsr scene17
jsr scene18a
dvdscene15:
lda #4
sta scene_timer
jsr scene19
jmp start
sculpture1_score:
jsr reset_nmi_vars
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #9
sta global_tempo
lda #64
sta timer_noise
lda #16
sta scene5_loop
jsr scene5
sculpture2_score:
jsr reset_nmi_vars
lda #0
ldx #2
sta background_data_arrayop,x
lda #16
sta scene10loop_var
jsr scene10
ldx #0
lda bridge18,x
ldx #0
sta songs,x
ldx #1
lda bridge18,x
ldx #1
sta songs,x
jsr melody_guitar
lda #0
sta scene5_temp
lda #128
sta scene5_temp_2
lda #9
sta global_tempo
lda #64
sta timer_noise
lda #16
sta scene5_loop
jsr scene5
sculpture3_score:
jsr reset_nmi_vars
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jsr scene9
jmp sculpture1_score
main:
jmp main
animate_sprites:
lda #3
sta nmi_to_do
rts
animate_sprites2:
lda #5
sta nmi_to_do
rts
animate_both_sprites:
lda #6
sta nmi_to_do
rts
move_sprite_1:
lda #0
cmp counter
bne nbasic_autolabel_1
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta direction
inc anim_file_counter
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta counter
inc anim_file_counter
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta sprite_delay
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta sprite_delay_master
inc anim_file_counter
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta sprite_data_pos
inc anim_file_counter
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta new_sprite_data_pos
inc anim_file_counter
ldy anim_file_counter
lda [sprite_anim_data_array],y
sta total_blocks
inc anim_file_counter
nbasic_autolabel_1:
dec sprite_delay
lda #0
cmp sprite_delay
beq nbasic_autolabel_2
rts
nbasic_autolabel_2:
lda #0
cmp sprite_delay
bne nbasic_autolabel_3
lda sprite_delay_master
sta sprite_delay
nbasic_autolabel_3:
lda #240
cmp direction
bne nbasic_autolabel_4
counter_up_loop_1:
lda #0
cmp counter
bcs nbasic_autolabel_5
lda total_blocks_master
sta total_blocks
lda sprite_mem_loc_master
sta sprite_mem_loc
jsr move_y_up
dec counter
nbasic_autolabel_5:
nbasic_autolabel_4:
lda #241
cmp direction
bne nbasic_autolabel_6
counter_down_loop_1:
lda #0
cmp counter
bcs nbasic_autolabel_7
lda total_blocks_master
sta total_blocks
lda sprite_mem_loc_master
sta sprite_mem_loc
jsr move_y_down
dec counter
nbasic_autolabel_7:
nbasic_autolabel_6:
lda #242
cmp direction
bne nbasic_autolabel_8
counter_left_loop_1:
lda #0
cmp counter
bcs nbasic_autolabel_9
lda total_blocks_master
sta total_blocks
lda sprite_mem_loc_master
sta sprite_mem_loc
jsr move_y_left
dec counter
nbasic_autolabel_9:
nbasic_autolabel_8:
lda #243
cmp direction
bne nbasic_autolabel_10
counter_right_loop_1:
lda #0
cmp counter
bcs nbasic_autolabel_11
lda total_blocks_master
sta total_blocks
lda sprite_mem_loc_master
sta sprite_mem_loc
jsr move_y_right
dec counter
nbasic_autolabel_11:
nbasic_autolabel_10:
lda #244
cmp direction
bne nbasic_autolabel_12
counter_still_loop_1:
lda #0
cmp counter
bcs nbasic_autolabel_13
dec counter
nbasic_autolabel_13:
nbasic_autolabel_12:
lda #245
cmp direction
bne nbasic_autolabel_14
finish_changing_sprite:
inc sprite_data_pos
ldy new_sprite_data_pos
lda [sprite_data_array],y
sta temp
lda temp
ldx sprite_data_pos
sta spritemem,x
inc sprite_data_pos
inc new_sprite_data_pos
ldy new_sprite_data_pos
lda [sprite_data_array],y
sta temp
lda temp
ldx sprite_data_pos
sta spritemem,x
inc new_sprite_data_pos
inc sprite_data_pos
inc sprite_data_pos
dec total_blocks
bne finish_changing_sprite
dec counter
nbasic_autolabel_14:
lda #246
cmp direction
bne nbasic_autolabel_15
lda total_blocks
sta anim_file_counter
lda #0
sta counter
nbasic_autolabel_15:
lda #255
cmp direction
bne nbasic_autolabel_16
lda #0
sta nmi_to_do
nbasic_autolabel_16:
rts
move_sprite_2:
lda #0
cmp counter2
bne nbasic_autolabel_17
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta direction2
inc anim_file_counter2
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta counter2
inc anim_file_counter2
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta sprite_delay2
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta sprite_delay_master2
inc anim_file_counter2
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta sprite_data_pos2
inc anim_file_counter2
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta new_sprite_data_pos2
inc anim_file_counter2
ldy anim_file_counter2
lda [sprite_anim_data_array2],y
sta total_blocks2
inc anim_file_counter2
nbasic_autolabel_17:
dec sprite_delay2
lda #0
cmp sprite_delay2
beq nbasic_autolabel_18
rts
nbasic_autolabel_18:
lda #0
cmp sprite_delay2
bne nbasic_autolabel_19
lda sprite_delay_master2
sta sprite_delay2
nbasic_autolabel_19:
lda #240
cmp direction2
bne nbasic_autolabel_20
counter_up_loop_12:
lda #0
cmp counter2
bcs nbasic_autolabel_21
lda total_blocks_master2
sta total_blocks2
lda sprite_mem_loc_master2
sta sprite_mem_loc
jsr move_y_up2
dec counter2
nbasic_autolabel_21:
nbasic_autolabel_20:
lda #241
cmp direction2
bne nbasic_autolabel_22
counter_down_loop_12:
lda #0
cmp counter2
bcs nbasic_autolabel_23
lda total_blocks_master2
sta total_blocks2
lda sprite_mem_loc_master2
sta sprite_mem_loc
jsr move_y_down2
dec counter2
nbasic_autolabel_23:
nbasic_autolabel_22:
lda #242
cmp direction2
bne nbasic_autolabel_24
counter_left_loop_12:
lda #0
cmp counter2