home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------
- ;-- Liten PrinterRutin --
- ;--------------------------
-
- org $20000
- load $20000
-
-
- S: movem.l d0-d7/a0-a6,-(sp)
- bsr.S SaveAll
- bsr InitSpr
- bsr InitScreen
- bsr StartCopper
- bsr MainLoop
- bsr RestoreAll
- movem.l (sp)+,d0-d7/a0-a6
- rts
-
- SaveAll: move.l $4.W,a6
- lea.l GfxName(pc),a1
- moveq #0,d0
- jsr -408(a6)
- move.l d0,a0
- lea OldCop(pc),a2
- move.l $26(a0),(a2)+
- move.l a0,a1
- jsr -414(a6)
- lea $dff000,a6
- move.w 2(a6),d0
- bset #15,d0
- move.w d0,(a2)+
- move.w #$4000,$9a(a6)
-
- lea $bfd100,a0
- move.b #$fd,(a0)
- nop
- nop
- move.b #$f5,(a0)
- rts
-
- RestoreAll: lea OldCop(pc),a0
- move.l (a0)+,$80(a6)
- tst.w $88(a6)
- move.w (a0),$96(a6)
- rts
-
- InitSpr: lea.l CopperList(pc),a0
- move.l #BlindSpr,d0
- moveq #8-1,d7
- SprLoop1: swap d0
- move.w d0,2(a0)
- swap d0
- move.w d0,6(a0)
- addq.l #8,a0
- dbra d7,SprLoop1
- move.l #Pekare,d0
- lea.l CopperList(pc),a0
- swap d0
- move.w d0,2(a0)
- swap d0
- move.w d0,6(a0)
- lea OldX(pc),a0
- move.b $b(a6),(a0)+
- move.b $a(a6),(a0)+
- rts
-
- StartCopper: lea CopperList(pc),a0
- move.l a0,$80(a6)
- tst.w $88(a6)
- move.w #$85c0,$96(a6)
- rts
-
- InitScreen: bsr.S WB
- moveq #-1,d1
- move.l d1,$44(a6)
- move.l #$01000000,$40(a6)
- move.l Screen(pc),$54(a6)
- clr.w $66(a6)
- move.w #256*64+20,$58(a6)
- bsr.S WB
- move.l Screen(pc),d0
- lea BMap+6(pc),a0
- move.w d0,4(a0)
- swap d0
- move.w d0,(a0)
- lea BildPointer(pc),a0
- lea Bild(pc),a1
- move.l a1,(a0)
- rts
-
- WB: btst #14,2(a6)
- bne.S WB
- rts
-
- Screen: dc.l $70000
-
- ;----------------------------------------------------------------------
-
- MainLoop: cmp.b #-1,$6(a6)
- bne.S MainLoop
- W2: cmp.b #$38,$6(a6)
- bne.S W2
- bsr.S Pointer
- btst #6,$bfe001
- bne.S IngenPrick
- bsr GetPrick
- IngenPrick: btst #10,$16(a6)
- bne.S MainLoop
- rts
-
- Pointer: lea.l Pekare(pc),a0
- moveq #0,d0
- moveq #0,d1
- lea OldX(pc),a2
- move.b $b(a6),d0
- move.b $a(a6),d1
- sub.b (a2)+,d0
- sub.b (a2)+,d1
- lea 2(a2),a3
- ext.w d0
- ext.w d1
- add.w d0,(a2)
- add.w d1,(a3)
- cmp.w #$128,(a3)
- bmi.S nn1
- move.w #$128,(a3)
- nn1: cmp.w #$29,(a3)
- bhi.S nn2
- move.w #$29,(a3)
- nn2: cmp.w #$a0,(a2)
- bhi.S nn3
- move.w #$a0,(a2)
- nn3: cmp.w #$1a0,(a2)
- bmi.S nn4
- move.w #$1a0,(a2)
- nn4: move.w (a2),d0
- lsr.w #1,d0
- move.b d0,1(a0)
- move.w (a2),d1
- and.w #$1,d1
- move.w (a3),d0
- cmp.w #$100,d0
- blo.S NoPal
- bset #2,d1
- NoPal: addq.w #7,d0
- cmp.w #$100,d0
- blo.S NoPal3
- bset #1,d1
- NoPal3: subq.w #$7,d0
- move.b d1,3(a0)
- move.b d0,(a0)
- add.b #$7,d0
- move.b d0,2(a0)
- move.b $b(a6),-2(a2)
- move.b $a(a6),-1(a2)
- rts
-
- GetPrick: lea NewX(pc),a0
- move.w (a0)+,d0
- move.w (a0),d1
- sub.w #$7c,d0
- sub.w #$29,d1
-
- move.l BildPointer(pc),a1
- moveq #0,d2
- moveq #0,d3
- move.b -2(a1),d2
- move.b -1(a1),d3
- sub.w d0,d2
- sub.w d1,d3
- tst.w d2
- bne.S DrawRest
- tst.w d3
- bne.S DrawRest
- rts
-
- DrawRest: bsr DrawValues
- rts
-
- DrawValues: moveq #0,d2
- moveq #0,d3
- move.b -2(a1),d2
- move.b -1(a1),d3
- DrawLoop: btst #10,$16(a6)
- beq.S I
- move.w d0,d4
- move.w d1,d5
- sub.w d2,d4
- bgt.S NopIt
- subq.w #1,d0
- bra.S CheckY
- NopIt: addq.w #1,d0
- CheckY: sub.w d3,d5
- bgt.S NopIt2
- subq.w #1,d1
- bra.S PlotIt
- NopIt2: addq.w #1,d1
- PlotIt: bsr.S Plot
- cmp.w d0,d2
- bne.S DrawLoop
- cmp.w d1,d3
- bne.S DrawLoop
- I: rts
-
- Plot: movem.w d0-d2/a2,-(sp)
- mulu #40,d1
- move.w d0,d2
- lsr.w #3,d0
- and.w #$7,d2
- eor.w #$7,d2
- move.l Screen(pc),a2
- add.w d1,d0
- bset d2,(a2,d0.W)
- movem.w (sp)+,d0-d2/a2
- rts
-
- OldX: dc.b 0
- OldY: dc.b 0
- NewX: dc.w 0
- NewY: dc.w 0
-
- ;------------------------------------------------------------------------
-
- CopperList: dc.l $01200000,$01220000,$01240000,$01260000
- dc.l $01280000,$012a0000,$012c0000,$012e0000
- dc.l $01300000,$01320000,$01340000,$01360000
- dc.l $01380000,$013a0000,$013c0000,$013e0000
-
- dc.l $008e2c71,$00902cc0,$00920038,$009400d0
- dc.l $01020000,$01040020,$01080000,$010a0000
- dc.l $01800000,$01820311
- dc.l $01a20008,$01a4000c,$01a60fff
- BMap: dc.l $01001000,$00e00000,$00e20000
-
- dc.l $2b07fffe,$01800fff
- dc.l $2c07fffe,$01800632
-
- dc.l $ffddfffe,$2c07fffe,$01800fff
- dc.l $2d07fffe,$01800000
-
- dc.l -2
-
- ;------------------------------------------------------------------------
-
- OldCop: dc.l 0
- OldDma: dc.w 0
- BlindSpr: dc.l 0
- GfxName: dc.b 'graphics.library',0
- even
-
- Pekare:
- dc.w $2c40,$3300
- dc.w %0001000000000000,%0000000000000000
- dc.w %0000000000000000,%0001000000000000
- dc.w %0001000000000000,%0000000000000000
- dc.w %1011101000000000,%0101010000000000
- dc.w %0001000000000000,%0000000000000000
- dc.w %0000000000000000,%0001000000000000
- dc.w %0001000000000000,%0000000000000000
- dc.l 0,0,0,0
-
- BildPointer: dc.l 0
-
- Bild:
-
-