-
Notifications
You must be signed in to change notification settings - Fork 7
/
_old_patch.asm
3288 lines (2968 loc) · 63.3 KB
/
_old_patch.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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The old version of the
; SMW Practice Cart - Version 6.4B
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!cont_all_a = $0DA2
!cont_all_b = $0DA4
!cont_frame_a = $0DA6
!cont_frame_b = $0DA8
!restore_timer_min = $0F3A
!restore_timer_sec = $0F3B
!restore_timer_frames = $0F3C
!restore_timer_flag = $0F3D
!curr_selection = $0F3E
!curr_drawing = $0F3F
!status_table = $0F5E
!yellow_status = $0F5E
!green_status = $0F5F
!red_status = $0F60
!blue_status = $0F61
!special_status = $0F62
!yoshi_status = $0F63
!powerup_status = $0F64
!itembox_status = $0F65
!erase_status = $0F66
!speedometer_status = $0F67
!drop_item_status = $0F68
!show_slots_status = $0F69
!enemy_status = $0F6A
!timer_min = $0F6B
!timer_sec = $0F6C
!timer_frames = $0F6D
!timer_flag = $0F6E
!timer_save_low = $0F6F
!timer_save_high = $0F70
!timer_save_bank = $0F71
!dynamic_stripe = $1938
!potential_translevel = $1F2F
!erase_records_flag = $1F30
!l_r_reset_flag = $1F31
!coins_this_level = $1F32
!yoshi_flag = $1F34
!orb_flag = $1F35
!room_timer_min = $1F36
!room_timer_sec = $1F37
!room_timer_frames = $1F38
!recent_secondary_exit = $1F39
!reset_room_flag = $1F3A
!tick_rta_timer_flag = $1F3B
!restore_room_powerup = $1F3C
!restore_room_yoshi = $1F3D
!restore_room_itembox = $1F3E
!speedometer_flag = $1F3F
!restore_room_pspeed = $1F40
!restore_room_item = $1F41
!drop_item_flag = $1F42
!show_slots_flag = $1F43
!slot_gfx_loaded = $1F44
!restore_igt_hundreds = $1F45
!restore_igt_tens = $1F46
!restore_igt_ones = $1F47
!slot_held = $1F48
!restore_powerup = $1FEE
!restore_yoshi = $1FEF
!restore_itembox = $1FF0
!initial_level_time = $1FF1
!restore_boo_ring = $1FF2 ; 4 bytes
!restore_rng = $1FF6 ; 4 bytes
;;;;;;;;;;;;;;;;
; Hex edits
;;;;;;;;;;;;;;;;
ORG $00FFC0
db "SMW PRACTICE CART "
; NMI hijack
ORG $0081AA
JSL NMIHijack
NOP
; nintendo presents sound
ORG $0093C1
db $05
; stripe image pointers
ORG $0084F1
dw !dynamic_stripe
db $7E
dl #save_confirm_message
dl #new_record_message
; status bar tilemap
ORG $008C89
db $FC,$3C,$FC,$2C,$FC,$2C,$FC,$3C
db $FC,$3C,$27,$3C,$85,$3C,$27,$3C
db $27,$3C,$86,$3C,$27,$3C,$27,$3C
ORG $008CAB
db $2E,$3C,$FC,$38,$00,$38,$FC,$3C
db $FC,$3C,$FC,$28,$FC,$28,$FC,$28
db $FC,$28,$FC,$28,$FC,$28
ORG $008CC1
db $FC,$38,$FC,$38,$FC,$3C,$FC,$38
db $27,$38,$85,$38,$27,$38,$27,$38
db $86,$38,$27,$38,$27,$38
ORG $008CEB
db $FC,$28,$FC,$28,$FC,$28,$FC,$28
db $FC,$28,$FC,$28
ORG $008293
db $26 ; 26 scanlines tall
; disable tempo hike at 99 seconds
ORG $008E59
db $80
; disable death at 0 seconds
ORG $008E69
db $80
; keep count of how many coins collected this level
ORG $008F25
JSR $C57A
ORG $00C57A
INC $0DBF
INC !coins_this_level
RTS
; don't draw lives to the status bar, and bowser timer
ORG $008F55
NOP
NOP
JSL display_bowser_timers
; don't go to bonus game
ORG $008F67
db $EA,$EA,$EA
; subtract 1 star when you hit 100
ORG $008F6F
db $01
; don't draw score to status bar
ORG $008EDB
db $EA,$EA,$EA
; don't draw bonus stars to status bar
ORG $008FA4
db $EA,$EA,$EA,$EA,$EA,$EA
ORG $008FB7
db $EA,$EA,$EA
ORG $008FBD
db $EA,$EA,$EA
ORG $008FEF
db $EA,$EA,$EA
; draw coins to status bar in different spot
ORG $008F7E
STA $0F0C
STX $0F0B
; don't draw lives to status bar
ORG $009053
db $EA,$EA,$EA
ORG $009068
db $EA,$EA,$EA
; new game modes
ORG $00933F
dw $FFAC
ORG $009347
dw $FFB8
ORG $00934F
dw $FFB8
ORG $009351
dw $A249
ORG $00935B
dw $9510
ORG $00936B
dw $FFB0
ORG $00936F
dw $FFB4
; load credits differently
ORG $009510
LDA #$08
STA $13C6
JMP $9468
; remove original save function
ORG $009BC9
db $6B
; reload music on death
ORG $00F610
db $00
; save file indices
ORG $009CCB
db $00,$10,$20
db $00,$00,$00
; disable something about overwriting sram
ORG $009CF7
STZ $0109
JMP $9D22
; display 3 digits for number of times gotten
ORG $009D66
REP #$20
LDA $700005,X
SEP #$10
JSL HexToDec16
TXY
LDX $00
STA $7F8383,X
TYA
JSL HexToDec16
TXY
LDX $00
STA $7F8381,X
TYA
STA $7F837F,X
SEP #$20
LDA #$38
STA $7F8380,X
STA $7F8382,X
STA $7F8384,X
NOP
NOP
NOP
NOP
NOP
NOP
NOP
; how to tell if a file is new or not
ORG $009DB5
LDA $9CCB,X
XBA
LDA $9CCE,X
REP #$30
TAX
PHX
LDA #$0070
STA $08
STX $06
LDY #$1000
LDA #$0000
PHA
loop:
DEY
DEY
DEY
DEY
CPY #$0020
BCC done
LDA [$06],Y
CMP #$FFFF
BEQ loop
PLA
INC A
PHA
BRA loop
done:
PLA
PLX
STA $700005,X
LDA $700001,X ; $700001,file = 0000 if not new
SEP #$20
RTS
; start with 99 lives
ORG $009E25
db $62
; disable file erase
ORG $009E6C
db $03
; disable 2-player game
ORG $009E6E
db $01
; relax timer on intro startup
ORG $00A09C
db $08
; level mode hijack
ORG $00A249
JSL precise_timer
JMP $A1DA
; load level will add 40 frames to timer
ORG $00A5AB
JSL level_load_penalty
; disable fade out at level end
ORG $00AF35
JMP $B091
NOP
ORG $00B091
fade_out:
LDA $13C6
BEQ .return
LDA $13
AND #$03
JMP $AF39
.return:
RTS
; modify drop item from item box
ORG $00C56C
JSL drop_item_box
CMP #$00
BNE .no_drop
JMP $C585
.no_drop:
JMP $C58F
; disable midway points
ORG $00CA2C
db $00
; don't decrement lives on death
ORG $00D0D8
db $EA,$EA,$EA
; use this address for free ram
ORG $00D94F
NOP
NOP
NOP
; activate ! blocks every time
ORG $00EEB1
db $EA,$EA
ORG $0DEC9A
db $EA,$EA
; update position of star and splash in GFX00
ORG $01C60B
db $68
ORG $028D42
db $6A,$6A
; don't remember 1ups, moons, or dragon coins
ORG $00F2BB
db $EA,$EA,$EA
ORG $00F325
db $EA,$EA,$EA
ORG $00F354
db $EA,$EA,$EA
ORG $0DA5A7
LDA #$00
NOP
ORG $0DA59C
LDA #$00
NOP
ORG $0DB2D7
LDA #$00
NOP
; quick death
ORG $00F61C
db $10
; death flag
ORG $00F625
INC $188A
; new game mode hijacks
ORG $00FFAC
JML yoshi_wings
JML load_menu
JML overworld_menu
JSL tmpfade_timer
JML $009F37
; more SRAM
ORG $00FFD8
db $04
; finish levels faster
ORG $00EECD ; switch palace
db $01
ORG $00C962
;db $10
ORG $01877C ; orb
;db $01
ORG $01C0FA ; goal tape
db $01
ORG $01D04B ; Morton & Roy
db $EE
ORG $01FB29 ; Iggy & Larry
db $01
ORG $038098 ; Big Boo
db $01
ORG $0398E2 ; Reznor
db $01
ORG $03AC12 ; Bowser
db $93,$14
ORG $03C7A2 ; Lemmy & Wendy
db $01
ORG $03CE95 ; Ludwig
db $01
; orb sets flag
ORG $018778
JSR $C062
ORG $01C062
STZ $14C8,X
LDA $9E,X
CMP #$4A ; orb
BNE not_orb
LDA #$20
STA !orb_flag
not_orb:
RTS
; fix enemy direction spawning
ORG $01AD30
JSL sub_horiz_pos
RTS
; draw slot sprite
ORG $0180AF
JSR $CD1E
ORG $01CD1E
JSR $8127
JSL draw_slot_sprite
RTS
; disable score sprites if show slots is enabled
ORG $02AEA5
JSL check_score_sprites
BEQ .not_disabled
RTS
.not_disabled:
NOP
NOP
NOP
NOP
NOP
; overworld controls hijack
ORG $048244
JSL overworld_controls
; vertical level names
ORG $03BB49
db $80,$25
ORG $03BB4F
db $50,$C1
; disable overworld panning
ORG $048380
db $00
; faster star road warp
ORG $049E5E
db $01
ORG $049E69
LDA #$FF
STA $1DF7
db $EA,$EA,$EA,$EA,$EA
db $EA,$EA,$EA,$EA,$EA
; overworld border
ORG $04A484
db $50,$2D,$00,$01,$A0,$39
ORG $04A48A
db $50,$4D,$00,$01,$B0,$39
ORG $04A490
db $50,$6D,$00,$01,$C0,$39
ORG $04A49C
db $50,$8D,$00,$01,$D0,$39
ORG $04A4A2
db $50,$55,$00,$01,$FE,$38
ORG $04A52C
db $50,$87,$00,$01,$FE,$38
ORG $05DC16
LDA #$FE
STA $7F8383
LDA #$38
ORG $05DC24
LDA #$FE
STA $7F8381
LDA #$38
; remove save prompt
ORG $04E5E6
db $00,$00,$00,$00,$00,$00,$00,$00
; rewrite how initial time is worked
ORG $058587
JSR $D680
ORG $05D680
STA $0F31
STA !initial_level_time
RTS
; disable no-yoshi intros
ORG $05DA19
JMP $DAD7
; disable chocolate island 2 weirdness
ORG $05DAE5
db $00
; level load store level number
ORG $05D7C0
JSL took_secondary_exit
NOP
; file select stripe images
ORG $05B801
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
ORG $05B825
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
ORG $05B849
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
ORG $05B85D
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
ORG $05B8AC
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38,$FC,$38
db $FC,$38
; load credits differently
ORG $0C9F16
JSL load_record
ORG $0C9F6C
JSL credits_records
LDX #$00
NOP
NOP
ORG $0C9F88
db $EA,$EA,$EA,$EA,$EA,$EA
ORG $0C9F68
db $FF,$FF
ORG $0C9FB3
db $EA,$EA
reset bytes
;;;;;;;;;;;;;;;;
; NMI Hijack
;;;;;;;;;;;;;;;;
ORG $16F000
NMIHijack:
LDA #$80
STA $2100 ; force blank
LDA $0100
CMP #$23
BNE .check_lvl_start
LDX !curr_selection
JSL update_graphics_menu
PHX
DEX
CPX #$FF
BNE .go_on
LDX #$0E
.go_on:
JSL update_graphics_menu
PLX
INX
CPX #$0F
BNE .go_on2
LDX #$00
.go_on2:
JSL update_graphics_menu
BRA .done
.check_lvl_start:
CMP #$14
BNE .clear_load_flag
JSL load_slots_gfx
LDA #$01
STA !slot_gfx_loaded
BRA .done
.clear_load_flag
STZ !slot_gfx_loaded
.done:
RTL
;;;;;;;;;;;;;;;;
; Overworld controls
;;;;;;;;;;;;;;;;
ORG $178000
overworld_controls:
PHP
PHB
PHK
PLB
REP #$30
LDA $1F1F ; set potential translevel
AND #$000F ; (code taken from $05D850)
STA $00
LDA $1F21
AND #$000F
ASL A
ASL A
ASL A
ASL A
STA $02
LDA $1F1F
AND #$0010
ASL A
ASL A
ASL A
ASL A
ORA $00
STA $00
LDA $1F21
AND #$0010
ASL A
ASL A
ASL A
ASL A
ASL A
ORA $02
ORA $00
TAX
LDA $1F11
AND #$00FF
BEQ .no_add
TXA
CLC
ADC #$0400
TAX
.no_add:
SEP #$20
LDA $7ED000,X
STA !potential_translevel
SEP #$30
LDA $010A
AND #$03
ASL A
ASL A
ASL A
ASL A
STA !timer_save_high
LDA !potential_translevel
AND #$7F
LSR A
LSR A
LSR A
TSB !timer_save_high
LDA !potential_translevel
ASL A
ASL A
ASL A
ASL A
ASL A
STA !timer_save_low
LDA #$70 ; clear save pointer
STA !timer_save_bank
LDA !timer_save_low
STA $00
LDA !timer_save_high
STA $01
LDA !timer_save_bank
STA $02
LDA $13D9
CMP #$03
BNE .be_done
LDA $144E
BNE .do_records_display
.be_done:
JMP .done_times
.do_records_display:
LDY #$08
.loop_display_time:
DEY
BMI .be_done
JSR load_unran_time
TYA
ASL A
ASL A
PHY
TAY
LDA [$00],Y ; get first byte of time
CMP #$FF
BEQ .draw_unran
PHX
LDA [$00],Y
STA $0D
JSL $00974C ; hex -> dec
TAX
LDA tile_numbers,X
STA !dynamic_stripe+4
INY
LDA [$00],Y
STA $0E
JSL $00974C ; hex -> dec
PHA
LDA tile_numbers,X
STA !dynamic_stripe+8
PLA
TAX
LDA tile_numbers,X
STA !dynamic_stripe+10
INY
LDA [$00],Y
STA $0F
JSL $00974C ; hex -> dec
PHA
LDA tile_numbers,X
STA !dynamic_stripe+14
PLA
TAX
LDA tile_numbers,X
STA !dynamic_stripe+16
PLX
JSR comp_to_gold
JSR load_stripe_from_buffer
PLY
BRA .loop_display_time
.draw_unran:
PLY
LDA !potential_translevel
TAX
LDA translevel_types,X
PHY
.shift_loop:
CPY #$00
BEQ .no_shift
LSR A
DEY
BRA .shift_loop
.no_shift:
PLY
AND #$01
BEQ .draw_blank
JSR load_stripe_from_buffer
JMP .loop_display_time
.draw_blank
JSR load_blank_time
JSR load_stripe_from_buffer
JMP .loop_display_time
.done_times:
LDA $0DB2
BEQ .testL ; return if in 2-player mode
RTL
.testL: ; L = Yoshi color
LDA !cont_frame_b
AND #$20
BEQ .testR
LDA $0DBA
.loopA:
INC A
INC A
CMP #$02
BEQ .loopA
CMP #$0C
BNE .skip0A
LDA #$00
.skip0A:
STA $13C7
STA $0DBA
INC $0DC1
.testR: ; R = powerup
LDA !cont_frame_b
AND #$10
BEQ .testSTART
LDA $19
INC A
CMP #$04
BNE .skip0B
LDA #$00
.skip0B:
STA $19
STA $0DB8
.testSTART: ; START = menu
LDA $144E
BNE .testSELECT ; make sure Mario is facing forward
LDA $1DF7
BNE .testSELECT ; and he's not warping off star road
LDA !cont_frame_a
AND #$10
BEQ .testSELECT
LDA #$1C ; play sound
STA $1DFC
LDA #$20 ; set game mode
STA $0100
.testSELECT: ; SELECT = swap powerup / item box
LDA !cont_frame_a
AND #$20
BEQ .save_lvl_states
LDA $19
AND #$FC ; powerup must be 0,1,3,2
BNE .save_lvl_states
LDA $0DC2
CMP #$03
BEQ .save_lvl_states
CMP #$04
BNE .stupid_inc
DEC A
.stupid_inc:
AND #$FC
BNE .save_lvl_states ; item box must be 0,1,2,4
JSR swap_powerup_item_box
.save_lvl_states:
LDX #$04
.loop_boo_ring:
DEX
BMI .save_rng
LDA $0FAE,X
STA !restore_boo_ring,X
BRA .loop_boo_ring
.save_rng:
LDX #$04
.loop_rng:
DEX
BMI .relax_timer
LDA $148B,X
STA !restore_rng,X
BRA .loop_rng
.relax_timer:
LDA #$FF
STA !curr_selection ; set pointer to unused state
STZ !timer_min ; clear timer
STZ !timer_sec
STZ !timer_frames
STZ !room_timer_min ; clear timer
STZ !room_timer_sec
STZ !room_timer_frames
STZ !restore_timer_min ; clear timer
STZ !restore_timer_sec
STZ !restore_timer_frames
STZ !timer_flag ; clear timer lock
STZ !coins_this_level ; clear coin counter
STZ !yoshi_flag
STZ !orb_flag
STZ !tick_rta_timer_flag
STZ !restore_room_item
STZ !recent_secondary_exit
STZ $1DF7 ; clear star road warp speed
STZ $13C5 ; clear 3up moon counter
STZ $0DB6 ; clear coin counter
LDA $0DBA
STA !restore_yoshi
STA !restore_room_yoshi
LDA $19
STA !restore_powerup
STA !restore_room_powerup
LDA $0DC2
STA !restore_itembox
STA !restore_room_itembox
LDX #$05
LDA $13C1 ; current overworld tile
.find_no_yoshi:
DEX
BMI .not_found
CMP no_yoshi_intros,X
BEQ .found
BRA .find_no_yoshi
.found:
LDA #$01
STA $1B9B
BRA .done
.not_found:
STZ $1B9B
.done:
PLB
PLP
RTL
swap_powerup_item_box:
LDA $19
CMP #$02
BNE .not_cape_mario
ASL A
.not_cape_mario:
CMP #$03
BNE .not_fire_mario
DEC A
.not_fire_mario:
STA $00
LDA $0DC2
CMP #$02
BNE .not_flower
INC A
.not_flower:
CMP #$04
BNE .not_feather
LSR A
.not_feather:
STA $19
STA $0DB8
LDA $00
STA $0DC2
STA $0DBC
RTS
load_unran_time:
PHY
LDY #$13
.loop:
DEY
BMI .done
LDA default_time_stripe,Y
STA !dynamic_stripe,Y
BRA .loop
.done:
PLY
LDA times_position,Y
STA !dynamic_stripe+1
RTS
load_blank_time:
PHY
LDY #$13
.loop:
DEY
BMI .done
LDA blank_stripe,Y
STA !dynamic_stripe,Y
BRA .loop
.done:
PLY
LDA times_position,Y
STA !dynamic_stripe+1
RTS
load_stripe_from_buffer:
PHY
PHX
REP #$30
LDA $7F837B
TAX
SEP #$20
LDY #$0000
.loop:
CPY #$0013
BCS .done
LDA !dynamic_stripe,Y
STA $7F837D,X
INY
INX
BRA .loop
.done:
REP #$20
DEX
TXA
STA $7F837B