-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrintC64Star10
executable file
·893 lines (892 loc) · 16.1 KB
/
PrintC64Star10
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
cmpi.l #1,d0
bne NoSyntaxError
rts
NoSyntaxError clr.b flag
cmpi.l #5,d0
blt NoOptions
movea.l a0,a1
adda.l d0,a1
subq.l #4,a1
cmpi.b #" ",(a1)+
bne NoOptions
cmpi.b #"-",(a1)+
bne NoOptions
cmpi.b #48,(a1)
blt NoOptions
cmpi.b #53,(a1)
bhi NoOptions
moveq #0,d1
move.b (a1),d1
sub.b #48,d1
lsl.b d1
lea NWerteTabelle,a1
move.w (a1,d1.w),Mode
bset #0,flag
subq.l #3,d0
NoOptions subq.l #2,d0
lea DateiName,a1
CopyFileName move.b (a0)+,(a1)+
dbf d0,CopyFileName
clr.b (a1)
include "/includes/exec/exec_lib.i"
include "/includes/libraries/dos_lib.i"
include "/includes/hardware/offsets.i"
atn equ 4
clkin equ 5
datain equ 3
clkout equ 6
dataout equ 7
lea PlaneAdr,a0
clr.l (a0)+
clr.l (a0)+
clr.l (a0)+
clr.l (a0)+
clr.l (a0)
move.l 4.w,a6
lea dosname,a1
moveq #0,d0
jsr OpenLibrary(a6)
move.l d0,_DosBase
move.l #DateiName,d1
move.l #-2,d2
move.l _DosBase,a6
jsr Lock(a6)
tst.l d0
beq NotFound
move.l d0,d7
move.l #260,d0
move.l #1,d1
move.l 4.w,a6
jsr AllocMem(a6)
move.l d0,IFFData
move.l d7,d1
move.l IFFData,d2
move.l d2,d6
move.l _DosBase,a6
jsr Examine(a6)
move.l d7,d1
jsr UnLock(a6)
move.l d6,a6
move.l 124(a6),DateiLength
move.l IFFData,a1
move.l #260,d0
move.l 4.w,a6
jsr FreeMem(a6)
move.l DateiLength,d0
move.l #1,d1
jsr AllocMem(a6)
move.l d0,IFFData
move.l #DateiName,d1
move.l #1005,d2
move.l _DosBase,a6
jsr Open(a6)
move.l d0,d7
move.l d7,d1
move.l IFFData,d2
move.l DateiLength,d3
jsr Read(a6)
move.l d7,d1
jsr Close(a6)
move.l IFFData,a2
cmpi.l #"FORM",(a2)
bne TextDruck
move.w 20(a2),d0
move.w d0,Width
lsr.w #3,d0
move.w d0,BytesPerRow
move.w 22(a2),Hight
move.b 28(a2),Depth+1
move.b 30(a2),Compression+1
move.l 4.w,a6
moveq #0,d1
move.w 22(a2),d1
add.w #7,d1
mulu d1,d0
move.w d0,PlaneLength
move.w Depth,d6
subq.w #1,d6
lea PlaneAdr,a4
and.l #$FFFF,d0
move.l d0,d5
AllocPlanes move.l d5,d0
move.l #$10001,d1
jsr AllocMem(a6)
move.l d0,(a4)+
dbf d6,AllocPlanes
btst #0,flag
bne ModeSetYet
bsr SetMode
ModeSetYet clr.l Empty
lea Empty,a0
BODYLoop move.b 1(a0),(a0)
move.b 2(a0),1(a0)
move.b 3(a0),2(a0)
move.b (a2)+,3(a0)
cmpi.l #"BODY",Empty
bne BODYLoop
adda.l #4,a2
move.l a2,BodyBegin
DeCode tst.w Compression
bne DifficultCode
moveq #0,d3
EasyBit move.w Hight,d2
sub.w #1,d2
EasyHight lea PlaneAdr,a0
move.w Depth,d1
sub.w #1,d1
EasyDepth move.l (a0)+,a1
add.l d3,a1
move.w BytesPerRow,d0
sub.w #1,d0
EasyCopy move.b (a2)+,(a1)+
dbf d0,EasyCopy
dbf d1,EasyDepth
add.l BytesRowLong,d3
dbf d2,EasyHight
DifficultCode clr.l xyPos
move.w Hight,d3
sub.w #1,d3
HightLoop lea PlaneAdr,a1
move.w Depth,d2
sub.w #1,d2
DepthLoop move.l (a1)+,d0
add.l xyPos,d0
move.l d0,a0
moveq #0,d1
Row cmp.w BytesPerRow,d1
bge Interpreted
move.b (a2)+,Byte
move.b (a2)+,Byte+1
moveq #0,d0
move.b Byte,d0
cmpi.b #127,d0
bls DeEasy
DeSame sub.b #3,d0
move.w #254,d4
sub.b d0,d4
add.w d4,d1
sub.w #1,d4
DeSameCopy move.b Byte+1,(a0)+
dbf d4,DeSameCopy
bra Row
DeEasy move.b Byte+1,(a0)+
add.w #1,d1
tst.b Byte
beq Row
add.w d0,d1
sub.w #1,d0
DeEasyCopy move.b (a2)+,(a0)+
dbf d0,DeEasyCopy
bra Row
Interpreted dbf d2,DepthLoop
move.l BytesRowLong,d0
add.l d0,xyPos
dbf d3,HightLoop
DeCodeEnd move.l IFFData,a1
move.l DateiLength,d0
move.l 4.w,a6
jsr FreeMem(a6)
cmpi.w #1,Depth
beq Color2Mode
bsr ColorRechner
Color2Mode tst.b Normal
beq Horizontal
bsr VertAlloc
bra FirstBytes
Horizontal bsr HoriAlloc
FirstBytes move.l PlaneAdr,a0
move.l SerialData,a1
move.b #$0A,(a1)+
move.b #$08,(a1)+
move.w SerialLength,Empty
sub.w #4,Empty
move.b Empty+1,(a1)+
move.b Empty,(a1)+
move.b #27,(a1)+
move.b #51,(a1)+
move.b #25,(a1)+
tst.b Normal
bne Vertical
bsr HoriDraw
bra CalcEnd
Vertical bsr VertiDraw
CalcEnd move.l PlaneAdr,a1
moveq #0,d0
move.w PlaneLength,d0
jsr FreeMem(a6)
TextDruckReJum move.l _DosBase,a6
move.l #Fenster,d1
move.l #1005,d2
jsr Open(a6)
move.l d0,FensterPointer
lea ciabpra,a5
move.l FensterPointer,d1
move.l #WaitClickText,d2
move.l #WaitClickEnd-WaitClickText,d3
move.l _DosBase,a6
jsr Write(a6)
WaitMouseClick btst #2,potgor+$DFF000
beq AbbruchJust
btst #6,ciaapra
bne WaitMouseClick
move.l FensterPointer,d1
jsr Close(a6)
clr.b flag
bsr Init
bsr GetDeviceNum
bsr ReadyForNext
bsr ReadChar
ReadingName bsr ReadyForNext
bsr ReadChar
btst #7,flag
beq ReadingName
clr.b (a0)
bsr ReadyForNext
bsr ReadChar Unlisten
bsr ReadyForNext
bsr ReadyForNext
bsr ReadChar Talk
bsr ReadyForNext
bsr ReadChar Sekund�radresse
bset #dataout,(a5)
bsr WAtnLow
bclr #dataout,(a5)
bsr WDataHigh
bset #clkout,(a5)
move.w #$4FFF,d7
WaitUntilSend dbf d7,WaitUntilSend
move.l SerialData,a4
moveq #0,d7
move.w SerialLength,d7
sub.l #1,d7
bclr #clkout,(a5)
SendingLoop move.b (a4)+,d5
bsr SendByte
sub.l #1,d7
bne SendingLoop
bset #clkout,(a5)
bsr WDataHigh
bclr #clkout,(a5)
move.b (a4)+,d5
bsr LastByte
bsr WAtnHigh
bsr WClkHigh
bset #dataout,(a5)
bsr WClkLow
bclr #dataout,(a5)
bsr ReadChar Untalk
bsr ReadyForNext
bsr ReadyForNext
bsr ReadChar Listen
bsr ReadyForNext
bsr ReadChar Sekund�radresse
bsr ReadyForNext
bsr ReadChar Unlisten
bsr ReadyForNext
bsr ReInit
bra EverythingOK
AbbruchJust move.l FensterPointer,d1
move.l _DosBase,a6
jsr Close(a6)
EverythingOK move.l SerialData,a1
moveq #0,d0
move.w SerialLength,d0
move.l 4.w,a6
jsr FreeMem(a6)
NotFound move.l 4.w,a6
move.l _DosBase,a1
jsr CloseLibrary(a6)
rts
ColorRechner move.l 4.w,a6
move.l #200,d0
move.l #1,d1
jsr AllocMem(a6)
move.l d0,IFFData
move.l _DosBase,a6
move.l #DateiName,d1
move.l #1005,d2
jsr Open(a6)
move.l d0,d7
move.l d0,d1
move.l IFFData,d2
move.l #200,d3
jsr Read(a6)
move.l d7,d1
jsr Close(a6)
movea.l IFFData,a2
movea.l a2,a1
clr.l Empty
lea Empty,a0
CMAPLoop move.b 1(a0),(a0)
move.b 2(a0),1(a0)
move.b 3(a0),2(a0)
move.b (a2)+,3(a0)
cmpi.l #"CMAP",Empty
bne CMAPLoop
adda.l #4,a2
moveq #1,d7
move.w Depth,d6
lsl.w d6,d7
subq.w #1,d7
FarbInit moveq #0,d1
moveq #0,d2
moveq #0,d3
move.b (a2)+,d1
move.b (a2)+,d2
move.b (a2)+,d3
lsr.b #4,d1
lsr.b #4,d2
lsr.b #4,d3
add.b d1,d3
add.b d2,d3
and.l #$FF,d3
divu #3,d3
move.b d3,(a1)+
dbf d7,FarbInit
lea PlaneAdr,a4
moveq #4,d7
move.l 4.w,a6
ErganzungPlane tst.l (a4,d7.w)
bne ErganzPlaneNo
move.w PlaneLength,d0
move.l #1,d1
jsr AllocMem(a6)
move.l d0,(a4,d7.w)
ErganzPlaneNo addq.w #4,d7
cmpi.w #16,d7
bne ErganzungPlane
move.l IFFData,a0
lea PlaneAdr,a1
moveq #0,d4
move.w Hight,d7
subq.w #1,d7
ErganzHight move.w BytesPerRow,d6
subq.w #1,d6
ErganzRow moveq #7,d5
ErganzByte moveq #0,d0
moveq #0,d1
moveq #0,d2
ErganzGetColor move.l (a1,d1.w),a2
btst d5,(a2,d4.w)
beq ErganzNoBitSet
bset d2,d0
ErganzNoBitSet addq.w #4,d1
addq.w #1,d2
cmp.w Depth,d2
bne ErganzGetColor
move.b (a0,d0.w),d0
moveq #3,d2
moveq #12,d1
ErganzSetColor move.l (a1,d1.w),a2
bclr d5,(a2,d4.w)
btst d2,d0
beq ErganzNoToSet
bset d5,(a2,d4.w)
ErganzNoToSet subq.w #4,d1
dbf d2,ErganzSetColor
dbf d5,ErganzByte
addq.w #1,d4
dbf d6,ErganzRow
dbf d7,ErganzHight
move.l IFFData,a1
move.l #200,d0
jsr FreeMem(a6)
cmpi.w #5,Depth
bne No32Colors
move.l PlaneAdr+16,a1
move.w PlaneLength,d0
jsr FreeMem(a6)
No32Colors move.w #4,Depth
bra ColorMode16
TextDruck move.l DateiLength,d0
add.l #10000,d0
move.l d0,-(sp)
moveq #1,d1
move.l 4.w,a6
jsr AllocMem(a6)
move.l d0,-(sp)
move.l d0,a4
move.l IFFData,a2
move.l d0,d5
move.b #$0A,(a4)+
move.b #$08,(a4)+
clr.w (a4)+
move.b #27,(a4)+
move.b #93,(a4)+
move.b #49,(a4)+
move.b #27,(a4)+
move.b #82,(a4)+
move.b #1,(a4)+
move.l DateiLength,d6
subq.w #1,d6
TextInterprete move.b (a2)+,d0
bsr CheckSteuer
bsr CheckLanguage
move.b d0,(a4)+
dbf d6,TextInterprete
move.l IFFData,a1
move.l DateiLength,d0
jsr FreeMem(a6)
move.l a4,d7
sub.l d5,d7
move.l d7,d0
move.w d0,SerialLength
moveq #1,d1
jsr AllocMem(a6)
move.l d0,SerialData
move.l d0,a0
move.l (sp),a1
move.w d7,Empty
sub.w #4,Empty
move.b Empty+1,2(a1)
move.b Empty,3(a1)
TextRightCopy move.b (a1)+,(a0)+
subq.l #1,d7
bne TextRightCopy
move.l (sp)+,a1
move.l (sp)+,d0
jsr FreeMem(a6)
bra TextDruckReJum
CheckLanguage moveq #0,d1
cmpi.b #"Ä",d0
bne LanguageNext1
move.b #91,d1
bra WriteSonder
LanguageNext1 cmpi.b #"Ö",d0
bne LanguageNext2
move.b #92,d1
bra WriteSonder
LanguageNext2 cmpi.b #"Ü",d0
bne LanguageNext3
move.b #93,d1
bra WriteSonder
LanguageNext3 cmpi.b #"ß",d0
bne LanguageNext4
move.b #126,d1
bra WriteSonder
LanguageNext4 cmpi.b #"ä",d0
bne LanguageNext5
move.b #123,d1
bra WriteSonder
LanguageNext5 cmpi.b #"ö",d0
bne LanguageNext6
move.b #124,d1
bra WriteSonder
LanguageNext6 cmpi.b #"ü",d0
bne WriteSonder
move.b #125,d1
bra WriteSonder
WriteSonder tst.b d1
beq NoSpecial
move.b #27,(a4)+
move.b #82,(a4)+
move.b #2,(a4)+
move.b d1,(a4)+
move.b #27,(a4)+
move.b #82,(a4)+
move.b #1,d0
NoSpecial rts
CheckSteuer cmpi.b #"(",d0
bne NoSteuer
cmpi.b #"#",(a2)
bne NoSteuer
adda.l #1,a2
SteuerSetter move.b (a2)+,d0
move.b d0,d1
and.b #%11011111,d1
cmpi.b #"U",d1 Unterstrichen
bne SteuerNext1
move.b #27,(a4)+
move.b #45,(a4)+
move.b #48,d1
btst #5,d0
bne Steuer1Off
move.b #49,d1
Steuer1Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext1 cmpi.b #"D",d1 DoppelteGroesse
bne SteuerNext2
move.b #27,(a4)+
move.b #104,(a4)+
move.b #0,d1
btst #5,d0
bne Steuer2Off
move.b #1,d1
Steuer2Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext2 cmpi.b #"V",d1 VierfacheGroesse
bne SteuerNext3
move.b #27,(a4)+
move.b #104,(a4)+
move.b #2,(a4)+
bra SteuerSetterOK
SteuerNext3 cmpi.b #"P",d1 Proportional
bne SteuerNext4
move.b #27,(a4)+
move.b #112,(a4)+
move.b #48,d1
btst #5,d0
bne Steuer4Off
move.b #49,d1
Steuer4Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext4 cmpi.b #"B",d1 Bold
bne SteuerNext6
move.b #27,(a4)+
move.b #72,d1
btst #5,d0
bne Steuer5Off
move.b #71,d1
Steuer5Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext6 cmpi.b #"I",d1 Kursiv
bne SteuerNext7
move.b #27,(a4)+
move.b #53,d1
btst #5,d0
bne Steuer7Off
move.b #52,d1
Steuer7Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext7 cmpi.b #"L",d1 Breitschrift
bne SteuerNext8
move.b #27,(a4)+
move.b #87,(a4)+
move.b #48,d1
btst #5,d0
bne Steuer8Off
move.b #49,d1
Steuer8Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext8 cmpi.b #"N",d1 Pica/NLQ
bne SteuerNext9
move.b #27,(a4)+
move.b #80,(a4)+
move.b #27,(a4)+
move.b #120,(a4)+
move.b #49,d1
btst #5,d0
bne Steuer9Off
move.b #48,d1
Steuer9Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext9 cmpi.b #"C",d1 Condensed(136)
bne SteuerNext10
move.b #27,(a4)+
move.b #15,(a4)+
bra SteuerSetterOK
SteuerNext10 cmpi.b #"E",d1 Elite(96)
bne SteuerNext11
move.b #27,(a4)+
move.b #77,(a4)+
bra SteuerSetterOK
SteuerNext11 cmpi.b #"Z",d1 1/8inch
bne SteuerNext12
move.b #27,(a4)+
move.b #50,d1
btst #5,d0
bne Steuer12Off
move.b #48,d1
Steuer12Off move.b d1,(a4)+
bra SteuerSetterOK
SteuerNext12
SteuerSetterOK cmpi.b #"#",(a2)
bne SteuerSetter
adda.l #2,a2
move.b (a2)+,d0
NoSteuer rts
SetMode move.b #76,Mode
cmpi.w #639,Width
bhi DoubleDensity
move.b #75,Mode
DoubleDensity rts
VertAlloc moveq #0,d0
move.w BytesPerRow,d0
moveq #0,d1
move.w Hight,d1
addq.w #6,d1
mulu d1,d0
addq.w #7,d0
move.w d0,SerialLength
and.l #$FFFF,d0
move.l #$10001,d1
move.l 4.w,a6
jsr AllocMem(a6)
move.l d0,SerialData
move.w BytesPerRow,d7
subq.w #1,d7
rts
HoriAlloc moveq #0,d0
move.w Width,d0
add.w #6,d0
moveq #0,d1
move.w Hight,d1
add.w #7,d1
lsr.w #3,d1
move.w d1,Lines
mulu d1,d0
addq.w #7,d0
move.w d0,SerialLength
and.l #$FFFF,d0
move.l #$10001,d1
move.l 4.w,a6
jsr AllocMem(a6)
move.l d0,SerialData
move.w Lines,d7
subq.w #1,d7
rts
VertiDraw move.l a0,a2
move.w BytesPerRow,d4
move.w d4,d5
move.w Hight,d3
sub.w #1,d3
mulu d3,d4
adda.l d4,a2
move.b #27,(a1)+
move.b Mode,(a1)+
move.b Hight+1,(a1)+
move.b Hight,(a1)+
VertiCopy move.b (a2),(a1)+
suba.l d5,a2
dbf d3,VertiCopy
clr.b (a1)+
move.b #10,(a1)+
addq.l #1,a0
dbf d7,VertiDraw
rts
HoriDraw moveq #0,d3
move.w BytesPerRow,d3
Rotating move.b #27,(a1)+
move.b Mode,(a1)+
move.b Width+1,(a1)+
move.b Width,(a1)+
move.w d3,d4
subq.w #1,d4
RotatingLoop moveq #7,d5 SourceBit
RotatingInner move.l a0,a2
moveq #0,d2
moveq #7,d1 DestBit
RotatingCheck btst d5,(a2)
beq NoPointOn
bset d1,(a1)
NoPointOn adda.l d3,a2
dbf d1,RotatingCheck
adda.l #1,a1
dbf d5,RotatingInner
adda.l #1,a0
dbf d4,RotatingLoop
clr.b (a1)+
move.b #10,(a1)+
add.l d3,a0
add.l d3,a0
add.l d3,a0
add.l d3,a0
add.l d3,a0
add.l d3,a0
add.l d3,a0
dbf d7,Rotating
rts
Init move.l 4.w,a6
jsr Forbid(a6)
move.w #$20,intena+$DFF000
move.w #$20,dmacon+$DFF000
move.w #$8800,adkcon+$DFF000
move.b #0,(a5)
rts
ReInit move.w #$800,adkcon+$DFF000
move.l 4.w,a6
jsr Permit(a6)
move.w #$8020,intena+$DFF000
move.w #$8020,dmacon+$DFF000
rts
ReadyForNext bsr WClkHigh
bset #dataout,(a5)
bsr WClkLow
clr.b (a5)
rts
WasWaitingFor bset #dataout,(a5)
move.w #10,d1
WasWaitingLoop dbf d1,WasWaitingLoop
clr.b (a5)
bset #7,flag
bra ReadCharLoop
rts
ReadChar moveq #0,d0
moveq #0,d5
ReadCharLoop move.w #20,d1
ReadNextLoop sub.w #1,d1
beq WasWaitingFor
btst #clkin,(a5)
beq ReadNextLoop
bsr WClkLow
btst #datain,(a5)
bne NoOnReadChar
bset d0,d5
NoOnReadChar addq.b #1,d0
cmpi.b #8,d0
bne ReadCharLoop
rts
GetDeviceNum bsr WAtnHigh
bsr WClkHigh
bset #dataout,(a5)
bsr WClkLow
clr.b (a5)
bsr ReadChar
and.b #15,d5
move.b d5,gerat
rts
WDataHigh btst #datain,(a5)
beq WDataHigh
rts
WDataLow btst #datain,(a5)
bne WDataLow
rts
WAtnHigh btst #atn,(a5)
beq WAtnHigh
rts
WAtnLow btst #atn,(a5)
bne WAtnLow
rts
WClkLow btst #clkin,(a5)
bne WClkLow
rts
WClkHigh btst #clkin,(a5)
beq WClkHigh
rts
SendByte bsr WDataHigh
bsr WDataLow
bset #clkout,(a5)
moveq #40,d0
SendByteSleep dbf d0,SendByteSleep
moveq #0,d0
bclr #dataout,(a5)
SendByteLoop btst d0,d5
bne SendBitLow
bset #dataout,(a5)
SendBitLow bclr #clkout,(a5)
move.w #40,d1
SendBitWait dbf d1,SendBitWait
bclr #dataout,(a5)
bset #clkout,(a5)
move.w #40,d1
SendBitWait2 dbf d1,SendBitWait2
add.b #1,d0
cmpi.b #8,d0
bne SendByteLoop
bclr #clkout,(a5)
bclr #dataout,(a5)
rts
LastByte bsr WDataHigh
bsr WDataLow
bsr SendByte
rts
ColorMode16 moveq #0,d0
move.w PlaneLength,d0
lsl.w #2,d0
move.l #$10001,d1
move.l 4.w,a6
jsr AllocMem(a6)
move.l d0,d7
move.l PlaneAdr,a0
move.l PlaneAdr+4,a1
move.l PlaneAdr+8,a2
move.l PlaneAdr+12,a3
move.l d0,a4
lea Werte16Color,a6
move.w Hight,d6
subq.w #1,d6
HightLoop16 move.w BytesPerRow,d5
subq.w #1,d5
ByteRow16 moveq #7,d4
RowLoop16 moveq #0,d3
btst d4,(a3)
bne First1Not
bset #3,d3
First1Not btst d4,(a2)
bne First2Not
bset #2,d3
First2Not btst d4,(a1)
bne First3Not
bset #1,d3
First3Not btst d4,(a0)
bne First4Not
bset #0,d3
First4Not move.b (a6,d3.w),d2
lsl.b #4,d2
moveq #0,d3
subq.w #1,d4
btst d4,(a3)
bne Second1Not
bset #3,d3
Second1Not btst d4,(a2)
bne Second2Not
bset #2,d3
Second2Not btst d4,(a1)
bne Second3Not
bset #1,d3
Second3Not btst d4,(a0)
bne Second4Not
bset #0,d3
Second4Not add.b (a6,d3.w),d2
move.b d2,(a4)+
dbf d4,RowLoop16
adda.l #1,a0
adda.l #1,a1
adda.l #1,a2
adda.l #1,a3
dbf d5,ByteRow16
dbf d6,HightLoop16
moveq #3,d6
moveq #0,d5
move.w PlaneLength,d5
lea PlaneAdr,a4
move.l 4.w,a6
Free4Planes move.l d5,d0
move.l (a4)+,a1
jsr FreeMem(a6)
dbf d6,Free4Planes
move.l d7,PlaneAdr
move.w Width,d0
lsl.w #2,d0
move.w d0,Width
move.w BytesPerRow,d0
lsl.w #2,d0
move.w d0,BytesPerRow
move.w #1,Depth
move.b #90,Mode
move.b #0,Normal
move.w PlaneLength,d0
lsl.w #2,d0
move.w d0,PlaneLength
rts
_DosBase dc.l 0
dosname DOSNAME
DateiName ds.b 98
Mode dc.b 75
Normal dc.b 1
Compression dc.w 0
Depth dc.w 0
BytesRowLong dc.w 0
BytesPerRow dc.w 0
Byte dc.w 0
Width dc.w 0
Hight dc.w 0
Lines dc.w 0
PlaneLength dc.w 0
SerialLength dc.w 0
SerialData dc.l 0
PlaneAdr ds.l 5
DateiLength dc.l 0
Empty dc.l 0
xyPos dc.l 0
BodyBegin dc.l 0
IFFData dc.l 0
FensterPointer dc.l 0
NWerteTabelle dc.b 75,1,75,0,76,0,90,0,76,1,90,1
Werte16Color dc.b %0000,%0000,%0000,%0000,%0001,%1000,%0010,%0100
dc.b %1100,%0110,%1010,%1110,%0111,%1011,%1111,%1111
flag dc.b 0
gerat dc.b 0
Fenster dc.b "CON:95/117/450/21/ ** * Star NL-10 Ausdrucker * ** ",0
WaitClickText dc.b 10,"Wenn C64 an und Stecker angeschlossen, Maus druecken!"
WaitClickEnd