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
/
Defy 6.s
executable file
·2728 lines (2461 loc) · 54.4 KB
/
Defy 6.s
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
;------------------------------------------------------------------------------
;
; *** **** **** * * ***
; * * * * * * * Source Code
; * * ** ** * ***
; * * * * * * * All code by cro / CYDoNiA
; * *** **** * * ** Startup by Extremist / CDN
;
;------------------------------------------------------------------------------
; Please note: This is a good example of how NOT to code a disk-mag
;
; The data format used by this mag for storing articles is proprietry. The
; data cruncher is not available for use under AmigaOS
;
; Now includes multi-colour text!
;
; Now uses StoneCruncher instead of Ice Cruncher
;
; Devpac form
; opt o+,w-
yes equ 0
no equ 1
music_on set yes ; include music files?
ifeq music_on
incdir defy6:
include music/maccros.i
endc
incdir defy6:
include includes/custom2.i
incdir defy6:
fade_workbench equ yes
screen_res equ 1 ; 0 = lowres, 1 = hires.
screen_width equ 80
screen_height equ 194
screen_depth equ 3
screen_bitplane equ screen_width*screen_height
screen_size equ screen_depth*screen_bitplane
screen_bitplaneoffset equ screen_bitplane
screen_nextlineoffset 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 $126+12
f_w equ 80
f_h equ 8
f_d equ 1
*******************************************************************************
first jmp startup
dc.b ' - DEFY Issue #6 - ©1996 CYDoNiA - '
even
startup: bsr.s take_system
tst.l d0
beq.s .error
bsr initiations
bsr intro_bit
bsr set_main
lea modname1,a0
bsr write_music
bsr fade_panels
bsr main
bsr start_down2
.ghh bsr t_fade
tst.b d0
bne.s .ghh
bsr clear_sprites
bsr fade_panels2
ifeq music_on
stop_music
endc
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+spren,dmacon(a5)
move.w #$7fff,intena(a5)
move.l #music_int,$6c
move.w #set+inten+vertb,intena(a5)
; set copper
bsr clear_sprites
lea textbpl,a0
lea text_screen,a1
move.l a1,d0
rept 3
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0
addq.w #8,a0
add.l #screen_bitplane,d0
endr
lea topbpl,a0
lea top+32,a1
move.l a1,d0
rept 4
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0
add.l #80*30,d0 ; new top is 30 lines high
addq.w #8,a0
endr
lea botbpl,a0
lea bottom+32,a1
move.l a1,d0
rept 4
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
swap d0
add.l #40*80,d0
addq.w #8,a0
endr
move.l highlight1,d0
move.w d0,highbpl+6
swap d0
move.w d0,highbpl+2 ; set highlight plane
lea font1,a0
moveq #8-1,d0
.lkj
move.b #0,(a0)
lea 80(a0),a0
dbf d0,.lkj
rts
clear_sprites
lea screen_copper,a0
lea a_copper,a2
lea a_copper2,a3
lea nullspr,a1
move.l a1,d0
rept 8
move.w d0,6(a0)
move.w d0,6(a2)
move.w d0,6(a3)
swap d0
move.w d0,2(a0)
move.w d0,2(a2)
move.w d0,2(a3)
addq.w #8,a0
addq.w #8,a2
addq.w #8,a3
swap d0
endr
rts
****************************************************************************
* Set_First
*
* Decrunches selected article to 'text-32'
****************************************************************************
set_first
lea decr,a0
bsr write_header ; wait for new font from Souri :-)
move.w article_num,d0
lsl.w #2,d0
lea articles,a0
move.l 0(a0,d0.w),a0 ; this pointer for pack
lea text-32,a1
move.l a5,-(a7)
bsr ice_decrunch
move.l (a7)+,a5
lea text+26+20,a0 ; data store, skip author
move.w (a0),max_pagenum
move.w (a0)+,d0
lea page_offsets,a1
.loop move.w (a0)+,(a1)+
dbf d0,.loop ; get page offsets
move.l a0,start_p
move.l a0,textp ; reset_pointers!
move.w curr_pagenum,d0
lea page_offsets,a0
move.l start_p,a1
lsl.w #1,d0
add.w 0(a0,d0.w),a1
move.l a1,textp
bsr write_pagenum
move.w #1,curr_col
move.w #0,curr_font
rts
decr dc.b 'DECRUNCHING TEXT - WAIT '
dc.b ' -^-[ CYDoNiA ]-^- '
even
****************************************************************************
* Write_Header
*
* Writes article Name to top panel
* Writes Author Name to top panel
****************************************************************************
write_header
move.l a0,-(a7)
bsr clear_header
move.l (a7)+,a0
move.w #26-1,d6 ; this many chars
lea top+32+(320/8)+(5*80),a1 ; this screen, was 5
titleloop
lea font2,a4
moveq #0,d0
move.b (a0)+,d0
sub.w #" ",d0
lsl.w #1,d0 ; offset
lea text_lookup,a2
move.w 0(a2,d0.w),d0 ; this offset
add.w d0,a4
tf1 set 0
rept 7 ; height of font
move.b tf1(a4),d0
move.b d0,d1
not d1
or.b d0,tf1(a1)
and.b d1,tf1+(30*80)(a1)
and.b d1,tf1+(60*80)(a1)
and.b d1,tf1+(90*80)(a1)
tf1 set tf1+80
endr
addq.l #1,a1
dbf d6,titleloop
move.w #20-1,d6 ; this many chars
lea top+32+(320/8)+(17*80),a1 ; this screen
authorloop
lea font2,a4
moveq #0,d0
move.b (a0)+,d0
sub.w #" ",d0
lsl.w #1,d0 ; offset
lea text_lookup,a2
move.w 0(a2,d0.w),d0 ; this offset
add.w d0,a4
tf1 set 0
rept 7 ; height of font
move.b tf1(a4),d0
move.b d0,d1
not.b d1
or.b d0,tf1(a1)
and.b d1,tf1+(30*80)(a1)
and.b d1,tf1+(60*80)(a1)
and.b d1,tf1+(90*80)(a1)
tf1 set tf1+80
endr
addq.l #1,a1
dbf d6,authorloop
rts
clear_header
lea top+32+(320/8),a1 ; this screen
lea top+32+(320/8)+(17*80),a3
lea clips+(320/8),a2
lea clips+(320/8)+(17*80),a4
move.w #12-1,d0
.clear_loop
move.l (a2),(a1)
move.l 4(a2),4(a1)
move.l 8(a2),8(a1)
move.l 12(a2),12(a1)
move.l 16(a2),16(a1)
move.l 20(a2),20(a1)
move.l 24(a2),24(a1)
move.l 28(a2),28(a1)
move.l (a4),(a3)
move.l 4(a4),4(a3)
move.l 8(a4),8(a3)
move.l 12(a4),12(a3)
move.l 16(a4),16(a3)
move.l 4000(a2),2400(a1)
move.l 4004(a2),2404(a1)
move.l 4008(a2),2408(a1)
move.l 4012(a2),2412(a1)
move.l 4016(a2),2416(a1)
move.l 4020(a2),2420(a1)
move.l 4024(a2),2424(a1)
move.l 4028(a2),2428(a1)
move.l 4000(a4),2400(a3)
move.l 4004(a4),2404(a3)
move.l 4008(a4),2408(a3)
move.l 4012(a4),2412(a3)
move.l 4016(a4),2416(a3)
move.l 8000(a2),4800(a1)
move.l 8004(a2),4804(a1)
move.l 8008(a2),4808(a1)
move.l 8012(a2),4812(a1)
move.l 8016(a2),4816(a1)
move.l 8020(a2),4820(a1)
move.l 8024(a2),4824(a1)
move.l 8028(a2),4828(a1)
move.l 8000(a4),4800(a3)
move.l 8004(a4),4804(a3)
move.l 8008(a4),4808(a3)
move.l 8012(a4),4812(a3)
move.l 8016(a4),4816(a3)
move.l 12000(a2),7200(a1)
move.l 12004(a2),7204(a1)
move.l 12008(a2),7208(a1)
move.l 12012(a2),7212(a1)
move.l 12016(a2),7216(a1)
move.l 12020(a2),7220(a1)
move.l 12024(a2),7224(a1)
move.l 12028(a2),7228(a1)
move.l 12000(a4),7200(a3)
move.l 12004(a4),7204(a3)
move.l 12008(a4),7208(a3)
move.l 12012(a4),7212(a3)
move.l 12016(a4),7216(a3)
lea 80(a1),a1
lea 80(a2),a2
lea 80(a3),a3
lea 80(a4),a4
dbf d0,.clear_loop
rts
****************************************************************************
* Write_Pagenum
*
* Writes curr_pagenum and Max_pagenum to top panel
****************************************************************************
write_pagenum
; rts
movem.l d0/a1/a2,-(a7)
bsr clear_page
movem.l (a7)+,d0/a1/a2
move.w #5-1,d6 ; was 3
lea page_text,a0
tst.w max_pagenum
beq.s .nopagenum ; 1 page only, don't write
move.w curr_pagenum,d0
addq.w #1,d0
lsl.w #1,d0
lea pagenumbers,a1
add.w d0,a1
move.b (a1)+,(a0)+
move.b (a1)+,(a0)+
move.b #"/",(a0)+
move.w max_pagenum,d0
addq.w #1,d0
lsl.w #1,d0
lea pagenumbers,a1
add.w d0,a1
move.b (a1)+,(a0)+
move.b (a1)+,(a0)+ ; page/page
; addq.w #1,d0
; move.b #"0",(a0)
; add.b d0,(a0)+ ; first char
; move.b #"/",(a0)+
; move.w max_pagenum,d0
; addq.w #1,d0
; move.b #"0",(a0)
; add.b d0,(a0) ; all set...
bra.s .doit
.nopagenum rept 5 ; was 5
move.b #"0",(a0)+
endr
.doit lea page_text,a0
lea top+32+67+(17*80),a1 ; was 68
titleloop2
lea font2,a4
moveq #0,d0
move.b (a0)+,d0
sub.w #" ",d0
add.w d0,a4
tf1 set 0
rept f_h-1
move.b tf1(a4),d0
move.b d0,d1
not.b d1
or.b d0,tf1(a1)
and.b d1,tf1+(30*80)(a1)
and.b d1,tf1+(60*80)(a1)
and.b d1,tf1+(90*80)(a1)
tf1 set tf1+80
endr
addq.l #1,a1
dbf d6,titleloop2
rts
; change this to number only!!!
even
page_text dc.b ' '
even
pagenumbers dc.b '00'
dc.b '01'
dc.b '02'
dc.b '03'
dc.b '04'
dc.b '05'
dc.b '06'
dc.b '07'
dc.b '08'
dc.b '09'
dc.b '10'
dc.b '11'
dc.b '12'
dc.b '13'
dc.b '14'
dc.b '15'
dc.b '16'
dc.b '17'
dc.b '18'
dc.b '19'
even
clear_page
lea top+32+68+(17*80),a1
lea clips+68+(17*80),a2
move.w #7-1,d0
.clear_loop
move.l (a2),(a1)
move.l 4(a2),4(a1)
move.l 4000(a2),2400(a1)
move.l 4004(a2),2404(a1)
move.l 8000(a2),4800(a1)
move.l 8004(a2),4804(a1)
move.l 12000(a2),7200(a1)
move.l 12004(a2),7204(a1)
lea 80(a2),a2
lea 80(a1),a1
dbf d0,.clear_loop
rts
******************************************************************************
* Set_Main
*
* Sets up main screen
****************************************************************************
set_main
move.l #screen_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,bplcon0(a5)
move.w #$3c,ddfstrt(a5)
move.w #$d4,ddfstop(a5)
move.w #0,bpl1mod(a5)
move.w #0,bpl2mod(a5)
lea screen_copper,a0
lea pointer,a1
move.l a1,d0
move.w d0,6(a0)
swap d0
move.w d0,2(a0)
move.w #0,curr_pagenum
bsr set_first
rts
****************************************************************************
* Fade_Panels
*
* Fades top and bottom panels smoothly
****************************************************************************
fade_panels
move.l a5,-(a7)
movem.l top,d0-d7
movem.l d0-d7,dest_pal
movem.l blank,d0-d7
movem.l d0-d7,source_pal
move.w #16,d0
move.w #4,d1
lea source_pal,a0
lea dest_pal,a1
bsr trigfadeto
move.l (a7)+,a5
panel_fade
tst.w vblank
beq.s panel_fade
clr.w vblank
move.l a5,-(a7)
bsr fade_to
move.b fadetoflag(a5),d0
move.l (a7)+,a5
lea source_pal,a0
lea topcol+2,a1
lea botcol+2,a2
rept 16
move.w (a0),(a1)+
move.w (a0)+,(a2)+
addq.w #2,a1
addq.w #2,a2
endr
tst.b d0
bne panel_fade
rts
start_down2
move.l a5,-(a7)
movem.l fontpal,d0-d7
movem.l d0-d7,source_pal
movem.l blank,d0-d7
movem.l d0-d7,dest_pal
lea source_pal,a0
lea dest_pal,a1
move.w #16,d0
move.w #8,d1
bsr trigfadeto
move.l (a7)+,a5
addq.w #1,this_one
rts
fade_panels2
move.l a5,-(a7)
movem.l top,d0-d7
movem.l d0-d7,source_pal
movem.l blank,d0-d7
movem.l d0-d7,dest_pal
move.w #16,d0
move.w #4,d1
lea source_pal,a0
lea dest_pal,a1
bsr trigfadeto
move.l (a7)+,a5
jmp panel_fade
****************************************************************************
* intro_Bit
*
* Shows title pages
****************************************************************************
intro_bit
tst.w vblank
beq.w intro_bit
clr.w vblank
move.w intro_state,d0
lsl.w #2,d0
move.l intro_routines(pc,d0.w),a0
jsr (a0)
tst.w d7 ; 0 = exit!!
beq.s intro_bit
rts
intro_routines
dc.l title_up
dc.l set_title_down
dc.l title_up
dc.l set_defy_title
dc.l title_up
dc.l delay_a_bit
dc.l set_defy_down
dc.l title_up
dc.l quit_it
intro_state dc.w 0
intro_delay dc.w 200
quit_it
move.w #-1,d7
move.w #-1,intro
; bsr clear_screen
rts
title_up
move.l a5,-(a7)
bsr fade_to
move.b fadetoflag(a5),d0
move.l (a7)+,a5
move.b 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.b (a7)+,d0
tst.b d0
bne.s .exit
addq.w #1,intro_state
.exit moveq #0,d7
rts
delay_a_bit
subq.w #1,intro_delay
bne.s .exit
addq.w #1,intro_state
move.w #500,intro_delay
.exit moveq #0,d7
rts
set_title_down
movem.l dest_pal,d0-d7
movem.l d0-d7,source_pal
movem.l dest_pal+32,d0-d7
movem.l d0-d7,source_pal+32
movem.l blank3,d0-d7
movem.l d0-d7,dest_pal
movem.l d0-d7,dest_pal+32
move.l a5,-(a7)
move.w #32,d0
move.w #4,d1
lea source_pal,a0
lea dest_pal,a1
bsr trigfadeto
move.l (a7)+,a5
addq.w #1,intro_state
moveq #0,d7
rts
set_defy_title
; dc.w diwstrt,$22<<8+$81
; dc.w diwstop,($136-$100)<<8+($1c1-$100)
; dc.w bplcon0,1<<12+color
; dc.w ddfstrt,($81-17)/2
; dc.w ddfstop,($81-17)/2+8*(($1c1-$81)/16-1)
; dc.w bpl1mod,0
; dc.w bpl2mod,0
move.l #copper,cop1lch(a5)
move.w #$2c<<8+xstrt,diwstrt(a5)
move.w #($12c-$100)<<8+(xstop-$100),diwstop(a5)
move.w #5<<12+color,bplcon0(a5)
move.w #($81-17)/2,ddfstrt(a5)
move.w #($81-17)/2+8*(($1c1-$81)/16-1),ddfstop(a5)
move.w #0,bpl1mod(a5)
move.w #0,bpl2mod(a5)
lea defylogo,a0
lea text_screen-64,a1
move.l a5,-(a7)
bsr ice_decrunch
move.l (a7)+,a5
ifeq music_on
lea mod1,a0
init_music
endc
lea text_screen,a0
lea a_c2,a1
move.l a0,d0
rept 5
move.w d0,6(a1)
swap d0
move.w d0,2(a1)
swap d0
add.l #40*256,d0
addq.w #8,a1
endr ; set title copper
move.l #a_copper2,cop1lch(a5)
move.l a5,-(a7)
movem.l text_screen-64,d0-d7
movem.l d0-d7,dest_pal
movem.l blank3,d0-d7
movem.l d0-d7,source_pal
movem.l d0-d7,source_pal+32
movem.l text_screen-32,d0-d7
movem.l d0-d7,dest_pal+32
move.w #32,d0
move.w #4,d1
lea source_pal,a0
lea dest_pal,a1
bsr trigfadeto
move.l (a7)+,a5
addq.w #1,intro_state
moveq #0,d7
rts
set_defy_down
movem.l dest_pal,d0-d7
movem.l d0-d7,source_pal
movem.l dest_pal+32,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)
move.w #32,d0
move.w #4,d1
lea source_pal,a0
lea dest_pal,a1
bsr trigfadeto
move.l (a7)+,a5
addq.w #1,intro_state
moveq #0,d7
rts
clear_screen
lea text_screen,a0
lea custom,a5
.blt btst #6,dmaconr(a5)
bne.s .blt
.bltwait btst #6,dmaconr(a5)
bne.s .bltwait
move.l a0,bltdpth(a5) ; dest 1
move.l #USED<<16,bltcon0(a5)
move.w #0,bltcon1(a5)
move.w #0,bltamod(a5)
move.w #0,bltdmod(a5)
move.w #(256-1)*64+80/2,bltsize(a5)
.bltwait2 btst #6,dmaconr(a5)
bne.s .bltwait2
lea 255*80(a0),a0
move.l a0,bltdpth(a5) ; dest 1
move.l #USED<<16,bltcon0(a5)
move.w #0,bltcon1(a5)
move.w #0,bltamod(a5)
move.w #0,bltdmod(a5)
move.w #(256-1)*64+80/2,bltsize(a5)
.bltwait3 btst #6,dmaconr(a5)
bne.s .bltwait3
lea 255*80(a0),a0
move.l a0,bltdpth(a5) ; dest 1
move.w #0,bltcon1(a5)
move.w #0,bltamod(a5)
move.l #USED<<16,bltcon0(a5)
move.w #0,bltdmod(a5)
move.w #(256-1)*64+80/2,bltsize(a5)
.bltwait4 btst #6,dmaconr(a5)
bne.s .bltwait4
lea 255*80(a0),a0
move.l a0,bltdpth(a5) ; dest 1
move.l #USED<<16,bltcon0(a5)
move.w #0,bltcon1(a5)
move.w #0,bltamod(a5)
move.w #0,bltdmod(a5)
move.w #(256-1)*64+80/2,bltsize(a5)
.bltwait5 btst #6,dmaconr(a5)
bne.s .bltwait5
rts
write_music
move.l a0,-(a7)
bsr clear_music
move.l (a7)+,a0
move.w #20-1,d6 ; this many chars
lea bottom+32+(394/8)+(7*80),a1 ; this screen, was 8
mus_loop
lea font2,a4
moveq #0,d0
move.b (a0)+,d0
sub.w #" ",d0
lsl.w #1,d0 ; offset
lea text_lookup,a2
move.w 0(a2,d0.w),d0 ; this offset
add.w d0,a4
tf1 set 0
rept 7 ; height of font
move.b tf1(a4),d0
move.b d0,d1
not.b d1
or.b d0,tf1(a1)
and.b d1,tf1+(40*80)(a1)
and.b d1,tf1+(80*80)(a1)
and.b d1,tf1+(120*80)(a1)
tf1 set tf1+80
endr
addq.l #1,a1
dbf d6,mus_loop
rts
no_music_text dc.b 'Mod not playing '
even
modname1 dc.b 'Cro my friend-2 '
even
modname2 dc.b 'Defy Groove... '
even
clear_music
lea bottom+32+(384/8)+(6*80),a1 ; this screen
lea clips+(384/8)+(36*80),a2
move.w #8-1,d0
.clear_loop
move.l (a2),(a1)
move.l 4(a2),4(a1)
move.l 8(a2),8(a1)
move.l 12(a2),12(a1)
move.l 16(a2),16(a1)
move.l 20(a2),20(a1)
; move.l 24(a2),24(a1)
; move.l 28(a2),28(a1)
move.l 4000(a2),3200(a1)
move.l 4004(a2),3204(a1)
move.l 4008(a2),3208(a1)
move.l 4012(a2),3212(a1)
move.l 4016(a2),3216(a1)
move.l 4020(a2),3220(a1)
; move.l 4024(a2),3224(a1)
; move.l 4028(a2),3228(a1)
move.l 8000(a2),6400(a1)
move.l 8004(a2),6404(a1)
move.l 8008(a2),6408(a1)
move.l 8012(a2),6412(a1)
move.l 8016(a2),6416(a1)
move.l 8020(a2),6420(a1)
; move.l 8024(a2),6424(a1)
; move.l 8028(a2),6428(a1)
move.l 12000(a2),9600(a1)
move.l 12004(a2),9604(a1)
move.l 12008(a2),9608(a1)
move.l 12012(a2),9612(a1)
move.l 12016(a2),9616(a1)
move.l 12020(a2),9620(a1)
; move.l 12024(a2),9624(a1)
; move.l 12028(a2),9628(a1)
lea 80(a1),a1
lea 80(a2),a2
dbf d0,.clear_loop
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)
bsr do_highlight
tst.w this_one
bne.s .doing_stuff ; so you can't do anything while
; changing pages
bsr get_key
bsr check_key
tst.w d7
bpl.s .keyit ; key pressed ???...
.doing_stuff
btst #6,$bfe001 ; lmb ?
bne.w main
; LMB pressed... got a new article??
tst.w d6
bmi.s .notnewart
.waitlmb btst #6,$bfe001
beq.s .waitlmb
move.w d6,article_num
move.w curr_pagenum,last_menu
move.w #0,curr_pagenum
bsr set_first
bsr clear_last
move.w #1,this_one
move.w #232-5,min_y
jmp main
.notnewart
bsr checkit
.keyit tst.w d7
bmi.w main ; not a button
cmp.w #0,d7
beq PageLeft
cmp.w #1,d7
beq PageUp
cmp.w #2,d7
beq PageDown
cmp.w #3,d7
beq PageRight
cmp.w #4,d7
beq PageIndex
ifeq music_on
cmp.w #6,d7 ; music
beq.s musicstuff
endc
cmp.w #5,d7 ; exit?
bne.w main
.quiit rts
ifeq music_on
music_c dc.w 1
music_p dc.l no_music_text,modname1,modname2
music_m dc.l 0,mod1,mod2
musicstuff
ifeq music_on
.loopit btst #6,$bfe001
beq.s .loopit
stop_music
addq.w #1,music_c
cmp.w #3,music_c ;=nummods+1...
bne.s .restart
move.w #0,music_c
.stopit move.b #0,musicflag
lea no_music_text,a0
bsr write_music
bra.s .noright
.restart
move.w music_c,d0
lsl.w #2,d0
lea music_m,a0
move.l 0(a0,d0.w),a0
init_music
move.b #-1,musicflag
move.w music_c,d0
lsl.w #2,d0
lea music_p,a0
move.l 0(a0,d0.w),a0
bsr write_music
.noright
endc
jmp main
last_menu dc.w 0
musicflag dc.b -1 ; 0 = no music
even
vblank dc.w 0
routines dc.l wait
dc.l start_down
dc.l t_fade
dc.l some_text
dc.l set_new_buttons
dc.l start_up
dc.l t_fade
dc.l resetit
dc.l 0
this_one dc.w 3
check_key
moveq #0,d0
moveq #-1,d7
move.b key,d0
move.b #0,key
cmp.w #$4f,d0
bne.s .notleft
move.w #0,d7 ; left arrow
rts
.notleft cmp.w #$4e,d0
bne.s .notright
move.w #3,d7 ; right arrow
rts
.notright cmp.w #$4c,d0
bne.s .notup
move.w #1,d7 ; up arrow
rts
.notup cmp.w #$4d,d0
bne.s .notdown
move.w #2,d7 ; down arrow
rts
.notdown cmp.w #$45,d0