This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scrapbook.asm
executable file
·1809 lines (1559 loc) · 31 KB
/
Scrapbook.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
; ScrapBook Code
opt o+,w-
yes equ 0
no equ 1
scroll_speed equ 2
music_on set yes ; include music files?
;incdir hd1:
;incdir work:cdn/scrapbook/
include music/maccros.i
;incdir work:cdn/scrapbook/
include includes/custom2.i
;incdir work:cdn/scrapbook/
fade_workbench equ yes
screen_res equ 1 ; 0 = lowres, 1 = hires.
screen_width equ 80
screen_height equ 512
screen_depth equ 4
screen_bitplane equ screen_width*screen_height
screen_size equ screen_depth*screen_bitplane
screen_bitplaneoffset equ screen_bitplane
screen_nextlneoffset equ screen_width
xmin equ 0
xmax equ (screen_width*8)-1
ymin equ 0
ymax equ screen_height-1
xstrt equ $081
ystrt equ $01c
xstop equ $1c1
ystop equ $11c ; 256 lines high - using LACE!
f_w equ 80
f_h equ 8
f_d equ 1
*******************************************************************************
first jmp startup
dc.b ' - ScrapBook - ©1995 SeCT - '
even
startup: bsr take_system
tst.l d0
beq.s .error
bsr initiations
bsr intro_bit
; for testing
; bsr set_menu
; bsr fade_it
; move.w #0,this_one
bsr main
stop_music
bsr free_system
moveq #0,d0
.error rts
include includes/takefree_system.i
*******************************************************************************
initiations: lea custom,a5
lea data_segment,a6
movem.l blank,d0-d7
movem.l d0-d7,color00(a5)
movem.l d0-d7,color16(a5)
.wait move.l vposr(a5),d0 ; wait for vertical blank.
and.l #$1ff00,d0
bne.s .wait
move.l #copper,cop1lch(a5) ; for intro
move.w #set+dmaen+blten+bplen+copen,dmacon(a5)
move.w #$7fff,intena(a5)
move.l #music_int,$6c
move.w #set+inten+vertb,intena(a5)
; set copper
lea mod1,a0 ; this is the first mod!
init_music
;set_screen
move.l #copper,cop1lch(a5)
move.w #ystrt<<8+xstrt,diwstrt(a5)
move.w #(ystop-$100)<<8+(xstop-$100),diwstop(a5)
; move.w #screen_depth<<12+color+hires+LACE,bplcon0(a5)
move.w #0,bplcon1(a5)
move.w #0,bplcon2(a5)
move.w #$3c,ddfstrt(a5)
move.w #$d4,ddfstop(a5)
move.w #80,bpl1mod(a5)
move.w #80,bpl2mod(a5)
moveq #0,d0
move.w joy0dat(a5),d0
and.w #$ff00,d0
lsr.w #8,d0 ; vert move only
move.w d0,mouse_y ; first one
rts
set_logo
lea sect_logo,a0
move.l #80*512,d6
bsr set_screen16
move.w #hires+4<<12+color,bplcon0(a5)
move.w #80,bpl1mod(a5)
move.w #80,bpl2mod(a5)
bsr set_lace
rts
set_title lea sb_title,a0
move.l #80*512,d6
bsr set_screen16
move.w #4<<12+color+hires,bplcon0(a5)
bsr set_lace
rts
set_menu2
.vbl1 tst.w vblank
beq.s .vbl1 ; wait for VBL interrupt
clr.w vblank
.vbl2 tst.w vblank
beq.s .vbl2 ; wait for VBL interrupt
clr.w vblank
bra.s set_menu3
set_menu
lea sb_menu,a0
move.l #80*512,d6
lea menu_pal,a1
movem.l d0-d7/a0-a6,-(a7)
jsr ice_decrunch
movem.l (a7)+,d0-d7/a0-a6
set_menu3
movem.l blank,d0-d7
movem.l d0-d7,color00(a5)
movem.l d0-d7,source_pal
movem.l menu_pal,d0-d7
movem.l d0-d7,dest_pal
; set fade details
move.l a5,-(a7)
lea source_pal,a0
lea dest_pal,a1
move.w #32,d0 ; colours
move.w #3,d1 ; speed
bsr trigfadeto
move.l (a7)+,a5
move.w #ystrt<<8+xstrt,diwstrt(a5)
move.w #(ystop-$100)<<8+(xstop-$100),diwstop(a5)
move.w #4<<12+color+hires+LACE,bplcon0(a5)
move.w #0,bplcon1(a5)
move.w #0,bplcon2(a5)
move.w #$3c,ddfstrt(a5)
move.w #$d0,ddfstop(a5)
move.w #80,bpl1mod(a5)
move.w #80,bpl2mod(a5)
; move.w #4<<12+color+hires,bplcon0(a5)
; move.w #80,bpl1mod(a5)
; move.w #80,bpl2mod(a5)
lea menupl1,a0
lea menupl2,a1
lea menu_scr,a3
move.l a3,d0
rept 4
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0 ; field 1
add.l #80,d0
move.w d0,6(a1)
swap d0
move.w d0,2(a1)
swap d0
sub.l #80,d0 ; field 2
add.l #80*512,d0
add.l #8,a0
add.l #8,a1
endr
lea menucopper1,a3
move.l a3,d0
lea menucopper2,a3
move.l a3,d1
lea menucop1,a0
lea menucop2,a1
move.w d0,6(a1) ; set copper1 to copper2
swap d0
move.w d0,2(a1)
swap d0
move.w d1,6(a0)
swap d1
move.w d1,2(a0)
swap d1
lea menucopper1,a3
move.l a3,d0
lea menucopper2,a3
move.l a3,d1
lea lacecop1,a0
lea lacecop2,a1
move.w d0,6(a1) ; set copper1 to copper2
swap d0
move.w d0,2(a1)
swap d0
move.w d1,6(a0)
swap d1
move.w d1,2(a0)
swap d1
lea menu_scr,a0
add.l #504*80,a0 ; this far down, base
lea sc1,a1
lea sc2,a2
move.l a0,d0
move.w d0,6(a1)
move.w d0,6(a2)
swap d0
move.w d0,2(a1)
move.w d0,2(a2)
swap d0
move.l #menucopper1,cop1lch(a5)
addq.w #1,this_one
rts
set_lace
lea lacepl1,a0
lea lacepl2,a1
lea screen,a3
move.l a3,d0
lea 80(a3),a3
move.l a3,d1
rept 4
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0 ; field 1
; add.l #80,d0
move.w d1,6(a1)
swap d1
move.w d1,2(a1)
swap d1
; sub.l #80,d0 ; field 2
add.l #80*512,d0
add.l #80*512,d1
add.l #8,a0
add.l #8,a1
endr
lea lacecopper1,a3
move.l a3,d0
lea lacecopper2,a3
move.l a3,d1
lea lacecop1,a0
lea lacecop2,a1
move.w d0,6(a1) ; set copper1 to copper2
swap d0
move.w d0,2(a1)
swap d0
move.w d1,6(a0)
swap d1
move.w d1,2(a0)
swap d1
move.l #lacecopper1,cop1lch(a5)
rts
set_screen16
; call with d6=bitplanesize
; a0=source_pic
lea piccy16,a1
movem.l d0-d7/a0-a6,-(a7)
jsr ice_decrunch
movem.l (a7)+,d0-d7/a0-a6
lea screen,a1
lea c4,a0
move.l a1,d0
rept 4 ; 4 bitplanes
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0
add.l d6,d0 ; next bitplane
add.l #8,a0
endr
movem.l blank,d0-d7
movem.l d0-d7,color00(a5)
movem.l d0-d7,source_pal
movem.l piccy16,d0-d7
movem.l d0-d7,dest_pal
lea menucop1,a0
lea menucop2,a1
lea copper4,a2
move.l a2,d0
move.w d0,6(a0)
move.w d0,6(a1)
swap d0
move.w d0,2(a0)
move.w d0,2(a1)
swap d0
; move.l #copper4,cop1lch(a5)
; set fade details
move.l a5,-(a7)
lea source_pal,a0
lea dest_pal,a1
move.w #16,d0 ; colours
move.w #3,d1 ; speed
bsr trigfadeto
move.l (a7)+,a5
rts
set_screen32
; call with d6=bitplanesize
; a0=source_pic
lea piccy32,a1
jsr ice_decrunch
lea screen,a1
lea c5,a0
move.l a1,d0
rept 5 ; 5 bitplanes
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0
add.l d6,d0 ; next bitplane
add.l #8,a0
endr
movem.l blank,d0-d7
movem.l d0-d7,color00(a5)
movem.l d0-d7,color16(a5)
movem.l d0-d7,source_pal
movem.l piccy32,d0-d7
movem.l d0-d7,dest_pal
movem.l piccy32+32,d0-d7
movem.l d0-d7,dest_pal+32
lea menucop1,a0
lea menucop2,a1
lea copper5,a2
move.l a2,d0
move.w d0,6(a0)
move.w d0,6(a1)
swap d0
move.w d0,2(a0)
move.w d0,2(a1)
swap d0
; move.l #copper5,cop1lch(a5)
move.l a5,-(a7)
; set fade details
lea source_pal,a0
lea dest_pal,a1
move.w #32,d0 ; colours
move.w #3,d1 ; speed
bsr trigfadeto
move.l (a7)+,a5
rts
set_screen64ehb
; call with d6=bitplanesize
; a0=source_pic
lea piccy32,a1
jsr ice_decrunch
lea screen,a1
lea ehbc5,a0
move.l a1,d0
rept 6 ; 6 bitplanes
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0
add.l d6,d0 ; next bitplane
add.l #8,a0
endr
movem.l blank,d0-d7
movem.l d0-d7,color00(a5)
movem.l d0-d7,color16(a5)
movem.l d0-d7,source_pal
movem.l piccy32,d0-d7
movem.l d0-d7,dest_pal
movem.l piccy32+32,d0-d7
movem.l d0-d7,dest_pal+32
lea menucop1,a0
lea menucop2,a1
lea ehbcopper5,a2
move.l a2,d0
move.w d0,6(a0)
move.w d0,6(a1)
swap d0
move.w d0,2(a0)
move.w d0,2(a1)
swap d0
move.l #ehbcopper5,cop1lch(a5)
move.l a5,-(a7)
; set fade details
lea source_pal,a0
lea dest_pal,a1
move.w #32,d0 ; colours
move.w #3,d1 ; speed
bsr trigfadeto
move.l (a7)+,a5
rts
fade_it_down
lea dest_pal,a0
movem.l (a0),d0-d7
movem.l d0-d7,source_pal
movem.l 32(a0),d0-d7
movem.l d0-d7,source_pal+32
movem.l blank,d0-d7
movem.l d0-d7,dest_pal
movem.l d0-d7,dest_pal+32
move.l a5,-(a7)
; set fade details
lea source_pal,a0
lea dest_pal,a1
move.w #32,d0 ; colours
move.w #3,d1 ; speed
bsr trigfadeto
move.l (a7)+,a5
fade_it
tst.w vblank
beq.s fade_it ; relies on VertB
clr.w vblank
move.l a5,-(a7)
bsr fade_to
move.b fadetoflag(a5),d0
move.l (a7)+,a5
move.l d0,-(a7)
movem.l source_pal,d0-d7
movem.l d0-d7,color00(a5)
movem.l source_pal+32,d0-d7
movem.l d0-d7,color16(a5)
move.l (a7)+,d0
tst.b d0
bne.s fade_it
add.w #1,this_one
rts
fade_it_down2
lea dest_pal,a0
movem.l (a0),d0-d7
movem.l d0-d7,source_pal
movem.l 32(a0),d0-d7
movem.l d0-d7,source_pal+32
movem.l blank,d0-d7
movem.l d0-d7,dest_pal
movem.l d0-d7,dest_pal+32
move.l a5,-(a7)
; set fade details
lea source_pal,a0
lea dest_pal,a1
move.w #32,d0 ; colours
move.w #3,d1 ; speed
bsr trigfadeto
move.l (a7)+,a5
fade_it2
tst.w vblank
beq.w fade_it2 ; relies on VertB
clr.w vblank
bsr decrease_cols
move.l a5,-(a7)
bsr fade_to
move.b fadetoflag(a5),d0
move.l (a7)+,a5
move.l d0,-(a7)
movem.l source_pal,d0-d7
movem.l d0-d7,color00(a5)
movem.l source_pal+32,d0-d7
movem.l d0-d7,color16(a5)
move.l (a7)+,d0
tst.b d0
bne.w fade_it2
add.w #1,this_one
rts
pause_it
tst.w vblank
beq.s pause_it ; relies on VertB
clr.w vblank
btst #2,$dff017
bne.s .noright
move.w #1,delay_it
.noright subq.w #1,delay_it
bne.s pause_it
move.w #300,delay_it
addq.w #1,this_one
rts
delay_it dc.w 300
intro_bit
bsr set_logo
bsr fade_it
bsr pause_it
bsr fade_it_down
bsr set_title
bsr fade_it
bsr pause_it
bsr fade_it_down
bsr set_menu
bsr fade_it
move.w #0,this_one
rts
*******************************************************************************
* Main
*
* The main control routines for the mag
****************************************************************************
main:
tst.w vblank
beq.s main ; wait for VBL interrupt
clr.w vblank
move.w this_one,d0
lsl.w #2,d0
lea routines,a0
move.l 0(a0,d0.w),a0
jsr (a0)
; btst #10,$dff016
; beq.s .bye
btst #6,$bfe001 ; lmb ?
bne.w main
move.w menu_item,d0
bmi.s main ; -1, no menu item
cmp.w #22,d0
beq.s .bye ; pressed exit...
cmp.w #12,d0
bge.s music_maybe
; got pic...
addq.w #1,this_one
bra.s main
.bye rts
music_maybe
cmp.w #17,d0
bge.s .scrolltext
sub.w #12,d0 ; get music number
stop_music
lea mod_l,a0
lsl.w #2,d0
move.l 0(a0,d0.w),a0
init_music
move.w #-1,menu_item
bra.w main
.scrolltext
sub.w #17,d0 ; this scroll
cmp.w last_menu,d0
beq.s .no_change
move.w d0,last_menu
lea texts,a0
lsl.w #2,d0
move.l 0(a0,d0.w),a0 ; this scroll!
move.l a0,textp
move.l a0,lasttext
.no_change
move.w #-1,menu_item
bra.w main
exit_flag dc.w 0
even
vblank dc.w 0
routines dc.l wait_menu
dc.l fade_it_down2
dc.l set_picture
dc.l fade_it
dc.l pause_it
dc.l fade_it_down
dc.l set_menu2
dc.l fade_it
dc.l resetit
dc.l 0
this_one dc.w 0 ; show menu is first!
resetit move.w #0,this_one
rts
set_picture
move.w menu_item,d0
lsl.w #1,d0
lea size_look,a0
move.w 0(a0,d0.w),d0
tst.w d0
beq.s .hires
sub.w #1,d0
beq.s .loresehb
sub.w #1,d0
beq.w .lores32
addq.w #1,this_one
rts
.hires
move.w menu_item,d0
lsl.w #2,d0
lea pic_look,a0
move.l 0(a0,d0.w),a0
move.w #80*256,d6
bsr set_screen16
.vbl1 tst.w vblank
beq.s .vbl1 ; wait for VBL interrupt
clr.w vblank
.vbl2 tst.w vblank
beq.s .vbl2 ; wait for VBL interrupt
clr.w vblank
addq.w #1,this_one
move.w #hires+4<<12+color,bplcon0(a5)
move.w #0,bpl1mod(a5)
move.w #0,bpl2mod(a5)
rts
.loresehb
move.w menu_item,d0
lsl.w #2,d0
lea pic_look,a0
move.l 0(a0,d0.w),a0
move.w #40*256,d6
bsr set_screen64ehb
.vbl3 tst.w vblank
beq.s .vbl3 ; wait for VBL interrupt
clr.w vblank
.vbl4 tst.w vblank
beq.s .vbl4 ; wait for VBL interrupt
clr.w vblank
; move.w #6<<12+color+homod,bplcon0(a5)
move.w #0,bpl1mod(a5)
move.w #0,bpl2mod(a5)
addq.w #1,this_one
rts
.lores32
move.w menu_item,d0
lsl.w #2,d0
lea pic_look,a0
move.l 0(a0,d0.w),a0
move.w #40*256,d6
bsr set_screen32
.vbl5 tst.w vblank
beq.s .vbl5 ; wait for VBL interrupt
clr.w vblank
.vbl6 tst.w vblank
beq.s .vbl6 ; wait for VBL interrupt
clr.w vblank
move.w #5<<12+color,bplcon0(a5)
move.w #0,bpl1mod(a5)
move.w #0,bpl2mod(a5)
addq.w #1,this_one
rts
mouse_y dc.w 0
mouse_yo dc.w 0
update_mouse
moveq #0,d0
move.w joy0dat(a5),d0
and.w #$ff00,d0
lsr.w #8,d0 ; vert move only
move.w mouse_yo,d2
move.w d0,mouse_yo
sub.w d2,d0
move.w mouse_y,d2
ext.w d0
add.w d0,d2 ; new Y
cmp.w #40/2,d2
bge.s .ok1
move.w #40/2,d2
.ok1
cmp.w #465/2,d2
ble.s .ok2
move.w #465/2,d2
.ok2 move.w d2,mouse_y
rts
; actual routines here
wait_menu
bsr update_mouse
bsr update_menu_cop
bsr put_col
bsr text_writer
rts
update_menu_cop
bsr decrease_cols
move.w #-1,menu_item
; btst #6,$bfe001
; bne.s .ok_nomouse
; rts
;.ok_nomouse
move.w mouse_y,d0
; coarse
cmp.w #456/2,d0
bge.w exit_bit
cmp.w #373/2,d0
bge.w scroll_bits
cmp.w #273/2,d0
bge.w music_bits
cmp.w #156/2,d0
bge.s rob_bits
cmp.w #40/2,d0
bge.s zex_bits
move.w #-1,menu_item
rts
zex_bits
cmp.w #55/2,d0
bge.s .2
move.w #0,menu_item ; first picture
rts
.2 cmp.w #70/2,d0
bge.s .3
move.w #1,menu_item
rts
.3 cmp.w #86/2,d0
bge.s .4
move.w #2,menu_item
rts
.4 cmp.w #100/2,d0
bge.s .5
move.w #3,menu_item
rts
.5 cmp.w #115/2,d0
bge.s .6
move.w #4,menu_item
rts
.6 cmp.w #126/2,d0
bge.s .zex_e
move.w #5,menu_item
.zex_e rts
rob_bits
cmp.w #156/2,d0
blt.s .rob_e ; outside range!
cmp.w #171/2,d0
bge.s .2
move.w #6,menu_item ; first picture
rts
.2 cmp.w #186/2,d0
bge.s .3
move.w #7,menu_item
rts
.3 cmp.w #201/2,d0
bge.s .4
move.w #8,menu_item
rts
.4 cmp.w #215/2,d0
bge.s .5
move.w #9,menu_item
rts
.5 cmp.w #231/2,d0
bge.s .6
move.w #10,menu_item
rts
.6 cmp.w #242/2,d0
bge.s .rob_e
move.w #11,menu_item
.rob_e rts
music_bits
cmp.w #273/2,d0
blt.s .music_e
cmp.w #287/2,d0
bge.s .2
move.w #12,menu_item ; first picture
rts
.2 cmp.w #302/2,d0
bge.s .3
move.w #13,menu_item
rts
.3 cmp.w #317/2,d0
bge.s .4
move.w #14,menu_item
rts
.4 cmp.w #332/2,d0
bge.s .5
move.w #15,menu_item
rts
.5 cmp.w #344/2,d0
bge.s .music_e
move.w #16,menu_item
.music_e rts
scroll_bits
cmp.w #373/2,d0
blt.s .scroll_e
cmp.w #388/2,d0
bge.s .2
move.w #17,menu_item ; first picture
rts
.2 cmp.w #404/2,d0
bge.s .3
move.w #18,menu_item
rts
.3 cmp.w #418/2,d0
bge.s .4
move.w #19,menu_item
rts
.4 cmp.w #433/2,d0
bge.s .5
move.w #20,menu_item
rts
.5 cmp.w #444/2,d0
bge.s .scroll_e
move.w #21,menu_item
.scroll_e rts
exit_bit
cmp.w #456/2,d0
blt.s .exit_e
cmp.w #467/2,d0
bge.s .exit_e
move.w #22,menu_item
.exit_e rts
put_col
lea menu_colours1,a0
lea menu_colours2,a1
move.w menu_item,d0
bmi.s .skipit
bra.s .l2
.loop add.w #8,a0
add.w #8,a1
.l2 dbf d0,.loop
move.w #$949,2(a0)
move.w #$949,2(a1)
.skipit rts
decrease_cols
lea menu_colours1,a0
lea menu_colours2,a1
move.w #23-1,d6
.loop
tst.w 2(a0)
beq.s .no_change
move.w 2(a0),d0
move.w d0,d1
move.w d1,d2
and.w #$f00,d0
and.w #$f0,d1
and.w #$f,d2
tst.w d0
beq.s .skip_red
sub.w #$100,d0
.skip_red
tst.w d1
beq.s .skip_green
sub.w #$10,d1
.skip_green
tst.w d2
beq.s .skip_blue
sub.w #$1,d2
.skip_blue
or.w d2,d0
or.w d1,d0
move.w d0,2(a0)
move.w d0,2(a1)
.no_change add.w #8,a0
add.w #8,a1
dbf d6,.loop
rts
menu_item dc.w 0
last_menu dc.w 0
text_writer
rept scroll_speed
bsr scroll_text
endr
bsr write_text
rts
scroll_text
lea scroll_data,a0
move.w #8-1,d7
.loop
moveq #0,d3
addx.w d3,d3
roxl 40(a0)
roxl 38(a0)
roxl 36(a0)
roxl 34(a0)
roxl 32(a0)
roxl 30(a0)
roxl 28(a0)
roxl 26(a0)
roxl 24(a0)
roxl 22(a0)
roxl 20(a0)
roxl 18(a0)
roxl 16(a0)
roxl 14(a0)
roxl 12(a0)
roxl 10(a0)
roxl 8(a0)
roxl 6(a0)
roxl 4(a0)
roxl 2(a0)
roxl (a0)
add.l #42,a0
dbf d7,.loop
subq.w #1,counter
cmp.w #0,counter
bgt.s .exit
bsr.s newletter
move.w #8,counter
.exit rts
newletter
movea.l textp,a1
tst.b (a1)
bne.s .noreset
move.l lasttext,a1
add.l #14,a1 ; skip '<TEXT CHANGE>'
move.l a1,textp
bra.s newletter
.noreset
move.l textp,a1
moveq #0,d0
move.b (a1)+,d0
move.l a1,textp
sub.w #" ",d0
bpl.s .skip_ret
moveq #0,d0
.skip_ret
lsl.w #1,d0
lea scroll_data+40,a0
lea font,a1
lea font_lookup,a2
move.w 0(a2,d0.w),d0
add.w d0,a1 ; this letter