-
Notifications
You must be signed in to change notification settings - Fork 0
/
!RunImage.txt
14307 lines (11832 loc) · 291 KB
/
!RunImage.txt
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
ON ERROR SYS263874:MODE12:REPORT:PRINT " at line ";ERL:END
SYS6,200,0,255 TO,esc_state%
SYS6,200,1,0
DIM screen_store% 81920
VOICES4
PROCinit_filenames
PROCsetup_reference_lists
PROCinitialise_edge_tables
PROCsetup_camera
PROCsetup_sprites
PROCsetup_3d_objects
PROCsetup_3d_world
DIM menu_screen_data% 81920
ntxy%=240
DIM textures% ntxy%*1024
DIM texturemap_divisions% 512*4
PROCassemble_screen_handlers
PROCsetup_soundfx
OSCLI"Load <Perpetual_Motion$Dir>.BackDrop "+STR$~screen_store%
PROCsetup_textures
PROCassemble_poly_renderers
PROCassemble_smoke_routines
PROCassemble_3d_handlers
PROCassemble_graphical_display_code
PROCassemble_camera_control_routines
PROCassemble_player_control_routines
PROCassemble_movement_and_collision_handlers
PROCassemble_main_loop_code
CALL init_stack
CALL check_mem_size
IF!total_mem%<=2097152 THEN !no_music_loaded%=1
CALL check_riscos_version
IF!riscos_v%>=165:!crafts_available%=3
MODE15
MODE13
OFF
PROCload_score_table
!quit%=0
IF!no_music_loaded%=0 THEN
SYS"QTM_Load",intro_music%,0
ELSE
!music_status%=0
ENDIF
CALL intro_credits
!music_status%=0
IF!no_music_loaded%=0 THEN
SYS"QTM_Load",ingame_music%,0
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
ENDIF
failures%=0
REPEAT
IF!(max_prac_trackno%)<(((!game_level%)*2)+2):!(max_prac_trackno%)=(((!game_level%)*2)+2)
IF failures%<>0 OR!(game_level%)<>0:plinth_positions%!0=57
IF failures%=0 AND!(game_level%)=0:plinth_positions%!0=15
CALL main
IF(!quit%)<>1 AND(!game_type%)=0 THEN
!(!(world_data_header%+8)+116)=3
PROCchampionship_game
ENDIF
IF(!quit%)<>1 AND(!game_type%)=1 THEN
CALL practice_tracks_screen
PROCload_track(!play_track_no%)
CALL reset_race
!(!(world_data_header%+8)+116)=5
CALL main_game_code
ENDIF
IF(!quit%)<>1 AND(!game_type%)=2 AND!(demo_available%)=1 THEN
PROCdisplay_score_table
CALL fade_out_menu_backdrop
IF!no_music_loaded%=0 THEN
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
IF!(music_status%)=1 OR!(world_data_header%+52)=1:SYS"QTM_Start"
ENDIF
PROCdemo_mode
IF!no_music_loaded%=0 THEN
IF!(music_status%)=1 OR!(world_data_header%+52)=1:SYS"QTM_Stop"
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
ENDIF
ENDIF
UNTIL!quit%=1
CALL fade_out_menu_backdrop
PROCsave_score_table
SYS6,200,esc_state%,0
REM *Run <Perpetual_Disc2$Dir>.Out
END
DEF PROCchampionship_game
REPEAT
IF!(max_prac_trackno%)<(((!game_level%)*2)+2):!(max_prac_trackno%)=(((!game_level%)*2)+2)
IF!(track_status%)<>255 THEN
CALL select_track
ELSE
!(play_track_no%)=8
PROCfinal_track
ENDIF
IF(!dont_select_track%)=1 THEN
!game_type%=2
!demo_available%=0
ENDIF
IF(!dont_select_track%)=0 THEN
IF(!race_suspended%)=0 THEN
!position_pre_race_suspension%=(!(!(world_data_header%+8)+116))
ENDIF
PROCload_track(!play_track_no%)
CALL reset_race
IF(!race_suspended%)=1 THEN
!(!(world_data_header%+8)+116)=(!position_pre_race_suspension%)
ENDIF
PROCreset_starting_grid
CALL main_game_code
IF(!race_suspended%)=1:failures%+=1:!demo_available%=0
IF(!race_suspended%)=0 THEN
PROCsort_out_champ_points
CALL sort_out_track_status
IF!play_track_no%<>8:CALL track_complete
IF!play_track_no%=8:IF!(!(world_data_header%+8)+116)>2:CALL track_complete
IF!(world_data_header%+72)>!(!(world_data_header%+8)+124):PROCregister_new_lap_record:CALL congrats_new_lap_record
IF!(!(world_data_header%+8)+116)>2:failures%+=1
IF!(!(world_data_header%+8)+116)<=2:failures%=0
IF!(!(world_data_header%+8)+116)<=2 AND!play_track_no%=8 THEN
IF!no_music_loaded%=0 THEN
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
IF!(music_status%)=1 OR!(world_data_header%+52)=1:SYS"QTM_Start"
ENDIF
PROCcomplete_game
IF!no_music_loaded%=0 THEN
IF!(music_status%)=1 OR!(world_data_header%+52)=1:SYS"QTM_Stop"
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
ENDIF
PROCcheck_high_score
PROCdisplay_score_table
!game_type%=2
!game_level%=0
failures%=0
!track_status%=0
!( !(world_data_header%+68)+4 )=0
!( !(world_data_header%+68))=0
!(!(world_data_header%+8)+116)=3
!position_pre_race_suspension%=3
!demo_available%=0
IF!no_music_loaded%=0 THEN
SYS"QTM_Load",intro_music%,0
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
ENDIF
CALL intro_credits
IF!no_music_loaded%=0 THEN
SYS"QTM_Load",ingame_music%,0
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
ENDIF
ENDIF
ENDIF
IF failures%>=4 THEN
!game_type%=2
PROCload_track(!play_track_no%)
CALL reset_race
PROCreset_starting_grid
IF!no_music_loaded%=0 THEN
SYS"QTM_Load",intro_music%,0
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
IF!(music_status%)=1 OR!(world_data_header%+52)=1:SYS"QTM_Start"
ENDIF
PROCgame_over_cam
IF!no_music_loaded%=0 THEN
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
IF!(music_status%)=1 OR!(world_data_header%+52)=1:SYS"QTM_Stop"
ENDIF
IF!no_music_loaded%=0 THEN
SYS"QTM_Load",ingame_music%,0
SYS"QTM_Volume",(!(overall_sound_volume%)/2)
ENDIF
PROCcheck_high_score
PROCdisplay_score_table
!game_level%=0
failures%=0
!track_status%=0
!( !(world_data_header%+68)+4 )=0
!( !(world_data_header%+68))=0
!(!(world_data_header%+8)+116)=3
!position_pre_race_suspension%=3
!demo_available%=0
ENDIF
ENDIF
UNTIL(!game_type%)<>0
ENDPROC
DEF PROCcheck_high_score
LOCAL total%,pos%,tabscore%
total%=!( !(world_data_header%+68)+4 )
pos%=1
FOR I%=0 TO7
tabscore%=!(score_table+(I%*8)+4)
IF total%<tabscore% THEN pos%+=1
NEXT I%
IF pos%<=7 THEN
FOR I%=6 TO(pos%-1)STEP-1
tabscore%=!(score_table+(I%*8)+4)
name%=!(score_table+(I%*8))
!(score_table+(I%*8)+12)=tabscore%
!(score_table+(I%*8)+8)=name%
NEXT I%
ENDIF
IF pos%<=8:PROCenter_name(pos%)
ENDPROC
DEF PROCsort_out_champ_points
LOCAL pos%,points%,total%
pos%=!( !(world_data_header%+8)+116 )
CASE pos% OF
WHEN1
points%=10
WHEN2
points%=5
OTHERWISE
points%=0
ENDCASE
!(!(world_data_header%+68))=points%
total%=!( !(world_data_header%+68)+4 )
total% +=points%
!( !(world_data_header%+68)+4 )=total%
ENDPROC
DEF PROCreset_starting_grid
LOCAL x%,z%,pos%,crno%,I%,adr%
x%=-250
z%=-2500
crno%=1
pos%=!( !(world_data_header%+8)+116 )
FOR I%=5 TO1 STEP-1
IF pos%=I% THEN
adr%=!(world_data_header%+8)
actcraftno%=0
ELSE
adr%=!(world_data_header%+8)
adr%=adr%+(crno%*128)
actcraftno%=crno%
crno%+=1
ENDIF
poslistadr%=craft_positioning%+( (I%-1)*8 )
!(poslistadr%)=actcraftno%
!(adr%)=(x%<<10)
!(adr%+8)=(z%<<10)
z%+=300
x%=x%*-1
NEXT I%
ENDPROC
DEF PROCalter_main_lp
scrno%=0
time%=0
time1%=0
REPEAT
SYS66 TO time%
MOUSE mx,my,b
CALL screen_swap
CALL plot_ground
CALL plot_sky
obadr%=!(world_data_header%+8)
mvdadr%=!(world_data_header%+8)
rcedat%=!(world_data_header%+32)
CALL check_all_crafts_with_missiles
CALL maintain_crafts
CALL update_player_crafts_path_pos
CALL check_view_keys
cammcm%=!(camera_position%+44)
IF cammcm%=0 THEN
CALL focus_camera_on_object
ELSE
CALL tracking_camera
ENDIF
A%=0
CALL missile_motion_control
A%=1
CALL missile_motion_control
A%=2
CALL missile_motion_control
CALL analyse_craft_positions
CALL calculate_world
A%=10
CALL calculate_smoke_stream
A%=11
CALL calculate_smoke_stream
A%=12
CALL calculate_smoke_stream
CALL calculate_explosions
CALL show_lap_timer
CALL calculate_craft_speed
CALL show_damage_meter
CALL display_craft_position
CALL display_missile_icons
IF INKEY-61:OSCLI"SCREENSAVE <Perpetual_Motion$Dir>.ScrShots.ScrShots"+STR$~scrno%:scrno%+=1
REPEAT
SYS66 TO time1%
UNTIL(time1%-time%)>=4
UNTIL0
ENDPROC
DEF PROCsimple_loop
ng=0
REPEAT
MOUSE mx,my,b
CALL screen_swap
CALL clr_scr
A%=0
B%=0
C%=100
D%=200
E%=mx/8
CALL calc_line_intersection
PRINT TAB(0,0)"Xa ";A%
PRINT TAB(0,1)"Ya ";B%
PRINT TAB(0,2)"Xb ";C%
PRINT TAB(0,3)"Yb ";D%
PRINT TAB(0,4)"Const X";E%
PRINT TAB(0,6)"Intersection ";!(interseccy_coord%)
UNTIL0
ENDPROC
DEF PROCenter_name(pos%)
LOCAL x%,y%,letter%,xoff%,yoff%
pos%-=1
entry%=0
lastb%=0
hix%=0
hiy%=0
slet%=50
REPEAT
MOUSE mx,my,b
UNTIL b=0
REPEAT
CALL screen_swap
CALL refresh_screen
CALL print_enter_name
MOUSE mx,my,b
letter%=0
xoff%=64
yoff%=80
FOR y%=0 TO3
FOR x%=0 TO6
IF letter%<26 THEN
A%=letter%+slet%
B%=(x%*28)+xoff%
C%=(y%*24)+yoff%
CALL plot_letter_sprite
ENDIF
IF letter%=27 THEN
A%=138
B%=(x%*28)+xoff%
C%=(y%*24)+yoff%
CALL plot_letter_sprite
ENDIF
letter%+=1
NEXT x%
NEXT y%
hix%=mx/192
hiy%=3-(my/256)
A%=139
B%=(hix%*28)+xoff%
C%=(hiy%*24)+yoff%
CALL plot_letter_sprite
?(score_table+entry%+(pos%*8))=slet%+(hiy%*7)+hix%
B%=120
FOR I%=0 TO entry%
A%=?(score_table+I%+(pos%*8))
C%=196
IF A%<(slet%+26):CALL plot_letter_sprite
B%+=28
NEXT I%
IF b >0:b=1
IF b>lastb%:entry%+=1
IF hix%=6:IF hiy%=3:IF b>lastb%:entry%-=2:IF entry%<0 entry%=0
IF hix%=5:IF hiy%=3:IF b>lastb%:?(score_table+entry%+(pos%*8))=(slet%+30)
lastb%=b
UNTIL entry%>=3
ENDPROC
DEF PROCdisplay_score_table
LOCAL y%
y%=40
REPEAT
MOUSE mx,my,b
UNTIL b=0
CALL refresh_screen
CALL print_high_scores
FOR I%=0 TO7
A%=I%+41
B%=16
C%=y%
CALL plot_letter_sprite
B%=60
FOR n=0 TO2
A%=?(score_table+(I%*8)+n)
C%=y%
IF A%<76:CALL plot_letter_sprite
B%+=20
NEXT n
A%=!(score_table+(I%*8)+4)
B%=260
C%=y%
CALL plot_2dig_no_a
y%+=24
NEXT I%
CALL screen_swap
CALL refresh_screen
tt%=400
REPEAT
MOUSE mx,my,b
WAIT
tt%-=1
IF tt%<0 b=1
UNTIL b<>0
ENDPROC
DEF PROCfinal_track
LOCAL fade%,fdout%
fdout%=0
fade%=0
SYS6,21,9
REPEAT
MOUSE mx,my,b
UNTIL b=0
REPEAT
CALL register_frame_compensation
MOUSE mx,my,b
CALL screen_swap
CALL refresh_screen
CALL print_final_track
IF fdout%=1:fade%+=1
IF fade%<0 fade%=0
IF fade%>16 fade%=16
A%=fade%
IF fade%<>0:CALL screen_fade
IF b=1:dont_select_track%!0=1
IF b>1:dont_select_track%!0=0
IF b<>0:fdout%=1
CALL frame_compensation
UNTIL fade%>15
ENDPROC
DEF PROCgame_over_cam
LOCAL fade%,fdout%,tt%
fdout%=0
fade%=15
tt%=600
camera_position%!0=-200
camera_position%!4=-130
camera_position%!8=-1200
camera_position%!16=2
sndstat%=!(world_data_header%+52)
!(world_data_header%+52)=0
!(craft_motion_control_base%+104)=0
REPEAT
CALL register_frame_compensation
MOUSE mx,my,b
CALL screen_swap
CALL plot_ground
CALL plot_sky
obadr%=!(world_data_header%+8)+128
mvdadr%=!(world_data_header%+8)
rcedat%=!(world_data_header%+32)
CALL maintain_crafts
CALL tracking_camera
CALL calculate_world
CALL print_game_over
IF fdout%=0:fade%-=1:CALL check_sound_keys
IF fdout%=1:fade%+=1:CALL fade_out_music
IF fade%<0 fade%=0
IF fade%>16 fade%=16
A%=fade%
IF fade%<>0:CALL screen_fade
IF fade%=0:IF b<>0:fdout%=1
IF fade%=0:IF tt%<=0:fdout%=1
tt%-=1
CALL frame_compensation
UNTIL fade%>14
!(world_data_header%+52)=sndstat%
ENDPROC
DEF PROCdemo_mode
LOCAL fade%,fdout%,change%,tt%
fdout%=0
fade%=15
change%=100
PROCload_track(RND(5)-1)
CALL reset_race
sndstat%=!(world_data_header%+52)
!(world_data_header%+52)=0
camera_position%!16=2
cam_mode%=0
tt%=600
REPEAT
CALL register_frame_compensation
MOUSE mx,my,b
CALL screen_swap
CALL plot_ground
CALL plot_sky
!(craft_motion_control_base%+104)=0
CALL maintain_crafts
IF cam_mode%=0 THEN
CALL focus_camera_on_object
ELSE
CALL tracking_camera
ENDIF
A%=0
CALL missile_motion_control
A%=1
CALL missile_motion_control
A%=2
CALL missile_motion_control
CALL calculate_world
CALL calculate_explosions
IF fdout%=0:fade%-=1:CALL check_sound_keys
IF fdout%=1:fade%+=1:CALL fade_out_music
IF fade%<0 fade%=0
IF fade%>16 fade%=16
A%=fade%
IF fade%<>0:CALL screen_fade
tt%-=1
IF fade%=0:IF b<>0:fdout%=1
IF fade%=0:IF tt%<=0:fdout%=1
CALL frame_compensation
change%-=1
IF change%=0 THEN
cam_mode%-=1
IF cam_mode%<0 cam_mode%=1
camera_position%!16=RND(5)-1
camera_position%!40=-300-RND(400)
camera_position%!28=(RND(2)-1)*180
camera_position%!24=(RND(2)-1)*180
change%=RND(50)+100
ENDIF
UNTIL fade%>14
!(world_data_header%+52)=sndstat%
ENDPROC
DEF PROCcomplete_game
LOCAL fade%,fdout%,change%,tt%,txt%,txtno%
fdout%=0
fade%=15
change%=100
PROCload_track(8)
CALL reset_race
sndstat%=!(world_data_header%+52)
!(world_data_header%+52)=0
camera_position%!16=2
cam_mode%=0
tt%=1168
txt%=200
txtno%=0
REPEAT
CALL register_frame_compensation
MOUSE mx,my,b
CALL screen_swap
CALL plot_ground
CALL plot_sky
!(craft_motion_control_base%+104)=0
CALL maintain_crafts
IF cam_mode%=0 THEN
CALL focus_camera_on_object
ELSE
CALL tracking_camera
ENDIF
A%=0
CALL missile_motion_control
A%=1
CALL missile_motion_control
A%=2
CALL missile_motion_control
CALL calculate_world
CALL calculate_explosions
CASE txtno% OF
WHEN0
CALL print_congrats_drifter_complete
WHEN1
CALL print_access_secret_craft
WHEN2
CALL print_future_releases
ENDCASE
txt%-=1
IF txt%<0 txt%=200:txtno%-=1:IF txtno%<0 txtno%=2
IF fdout%=0:fade%-=1:CALL check_sound_keys
IF fdout%=1:fade%+=1:CALL fade_out_music
IF fade%<0 fade%=0
IF fade%>16 fade%=16
A%=fade%
IF fade%<>0:CALL screen_fade
tt%-=1
IF fade%=0:IF b<>0:fdout%=1:CALL check_sound_keys
IF fade%=0:IF tt%<=0:fdout%=1
CALL frame_compensation
change%-=1
IF change%=0 THEN
cam_mode%-=1
IF cam_mode%<0 cam_mode%=1
camera_position%!16=RND(5)-1
camera_position%!40=-300-RND(400)
camera_position%!28=(RND(2)-1)*180
camera_position%!24=(RND(2)-1)*180
change%=RND(50)+100
ENDIF
UNTIL fade%>15
!(world_data_header%+52)=sndstat%
ENDPROC
DEF PROCsave_score_table
LOCAL end%
end%=score_table+(8*8)
OSCLI"SAVE <Perpetual_Disc2$Dir>.Tracks._ScoreTab "+STR$~score_table+" "+STR$~end%
ENDPROC
DEF PROCload_score_table
OSCLI"LOAD <Perpetual_Disc2$Dir>.Tracks._ScoreTab "+STR$~score_table
ENDPROC
DEF PROCassemble_main_loop_code
LOCAL adr%,pass%,link,sp
link=14
sp=11
adr%=P%
FOR pass%=8 TO10 STEP2
P%=adr%
L%=code% +len%
[OPT pass%
.world_data_header_base% EQUD world_data_header%
.no_music_loaded% EQUD 0
.riscos_v% EQUD 0
.total_mem% EQUD 0
.overall_sound_volume% EQUD 127
.plot_mouse_ptr
STMFA (sp)!,{r0-r10,r12,link}
SWI "OS_Mouse"
MOV r0,r0,ASR#2
MOV r1,r1,ASR#2
RSB r1,r1,#255
CMP r0,#308
MOVGT r0,#308
CMP r1,#239
MOVGT r1,#239
ANDr3,r0,#3
BIC r0,r0,#3
MOV r2,r1
MOV r1,r0
MOV r0,#100
ADD r0,r0,r3
BL plot_letter_sprite
LDMFA (sp)!,{r0-r10,r12,link}
MOV PC,link
.snd_opt_sign% EQUD 1
.check_sound_option
STMFA (sp)!,{r0-r10,r12,link}
LDR r10,snd_opt_sign%
MOVS r10,r10
BNE cssopt_no_none
MOV r0,#64
MOV r1,#260
MOV r2,#160
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#55
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#55
BL plot_letter_sprite
.cssopt_no_none
CMP r10,#1
BNE cssopt_no_fx
MOV r0,#55
MOV r1,#280
MOV r2,#160
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#73
BL plot_letter_sprite
.cssopt_no_fx
CMP r10,#2
BNE cssopt_no_music
MOV r0,#62
MOV r1,#220
MOV r2,#160
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#70
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#68
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#58
BL plot_letter_sprite
ADD r1,r1,#20
MOV r0,#52
BL plot_letter_sprite
.cssopt_no_music
LDR r0,[r12,#4]
MOV r4,#3
CMP r0,#3
SUBEQ r4,r4,#1
LDR r0,[r12,#8]
MOVS r0,r0
SUBEQ r4,r4,#1
MOV r0,#129
MVN r1,#73
MOV r2,#255
SWI "OS_Byte"
MOV r3,#2
CMP r1,#255
SUBEQ r3,r3,#1
CMP r2,#255
SUBEQ r3,r3,#1
MOVS r3,r3
SUBEQ r4,r4,#1
MOVS r4,r4
BGT end_cssopt_bbttbb
SUBS r10,r10,#1
MOVLT r10,#2
STR r10,snd_opt_sign%
LDR r12,world_data_header_base%
CMP r10,#1
MOVEQ r0,#1
MOVNE r0,#0
STR r0,[r12,#52]
CMP r10,#2
MOVEQ r0,#1
MOVNE r0,#0
LDR r12,no_music_loaded%
MOVS r12,r12
MOVNE r0,#0
BL req_music_stat
STR r0,[r12]
.end_cssopt_bbttbb
LDMFA (sp)!,{r0-r10,r12,link}
MOV PC,link
.check_sound_keys
STMFA (sp)!,{r0-r10,r12,link}
LDR r12,overall_sound_volume%
MOV r0,#129
MVN r1,#113
MOV r2,#255
SWI "OS_Byte"
MOV r3,#2
CMP r1,#255
SUBEQ r3,r3,#1
CMP r2,#255
SUBEQ r3,r3,#1
MOVS r3,r3
SUBEQ r12,r12,#2
MOV r0,#129
MVN r1,#114
MOV r2,#255
SWI "OS_Byte"
MOV r3,#2
CMP r1,#255
SUBEQ r3,r3,#1
CMP r2,#255
SUBEQ r3,r3,#1
MOVS r3,r3
ADDEQ r12,r12,#2
MOVS r12,r12
MOVLT r12,#0
CMP r12,#127
MOVGT r12,#127