home *** CD-ROM | disk | FTP | other *** search
-
- * Bigmama's DMA-AmigaDos fileloader
- * And it's great...
-
-
- incdir SYS:include/
- include hardware/custom.i
-
-
- DriveStatus = $F01
- ICR = $C00
- CRA = $D00
- TALO = $300
- TAHI = $400
-
-
- Start: dc.l $444F5300
- dc.l 0
- dc.l $54524821
-
- move.l #$3400+8000,D0
- moveq #$3,D1
- jsr -198(A6)
- lea root(PC),A4
- move.l D0,(A4)+
- beq.w mainerror
- add.l #$200,D0
- move.l D0,(A4)+
- add.l #$3200,D0
- move.l D0,(A4)
- subq.l #8,A4
- lea $DFF000,A6
- move.w #$7FFF,D0
- move.w D0,intena(A6)
- move.w D0,intreq(A6)
- move.w D0,dmacon(A6)
- move.w D0,adkcon(A6)
- moveq #13,D0
- moveq #0,D1
- lea $BFD100,A5
- move.w #$8210,dmacon(A6)
- move.w #$A58,color(A6)
-
- lea spr(A6),A0
- KillSprites: move.l D1,(A0)+
- dbf D0,killsprites
-
- StartMtr: bset #3,(A5)
- nop
- bclr #7,(A5)
- nop
- bclr #3,(A5)
-
- move.l #880,D0
- move.l (A4),A0
- bsr.w loadsector
- tst.l D0
- bmi.b mainerror
-
- moveq #0,D1
- moveq #0,D2
- lea filename(PC),A1
- move.b (A1)+,D1
- move.w D1,D7
- subq.w #1,D7
- CalcHash: mulu #13,D1
- move.b (A1)+,D2
- add.w D2,D1
- and.w #$7FF,D1
- dbf D7,calchash
- divu #72,D1
- swap D1
- add.w D1,D1
- add.w D1,D1
- move.l (A4),A0
- move.l 24(A0,D1.w),D0
- bne.b seekfile
-
- MainError: or.b #$88,(A5)
- nop
- bclr #3,(A5)
- nop
- bset #3,(A5)
- ErrorLoop: move.w vhposr(A6),color(A6)
- bra.b errorloop
-
- SeekFile: bsr.w loadsector
- tst.l D0
- bmi.b mainerror
-
- lea 432(A0),A1
- lea filename(PC),A2
- move.b (A1)+,D7
- cmp.b (A2)+,D7
- beq.b cmpname
- NotTheFile: move.l 496(A0),D0
- bne.b seekfile
- bra.b mainerror
-
- CmpName: move.b (A1)+,D6
- cmp.b #"a",D6
- blo.b caseok
- cmp.b #"z",D6
- bhi.b caseok
- sub.b #32,D6
- CaseOk: cmp.b (A2)+,D6
- bne.b notthefile
- subq.b #1,D7
- bne.b cmpname
-
- move.l destination(PC),A3
- move.l 16(A0),D0
- beq.b mainerror
-
- LoadBlocks: bsr.w loadsector
- tst.l D0
- bmi.b mainerror
- move.w 14(A0),D0
- subq.b #1,D0
- lea 24(A0),A1
- Copy: move.b (A1)+,(A3)+
- dbf D0,copy
- move.l 16(A0),D0
- bne.b loadblocks
- move.l destination(PC),A0
- jmp $20(A0)
-
- dc.b " This loader was made by Bigmama of Trash in 1992 "
- dc.b "and don't you steal it, or ... Anyway, call our BBS "
- dc.b "on : -» Metal Connextion «- +45 74435949 "
-
- Root: dc.l $0
- TrackBuffer: dc.l $0
- Destination: dc.l $0
- CurrentTrack: dc.w -1
-
- LoadSector: movem.l A0/A3,-(SP)
- divu #11,D0
- cmp.w currenttrack(PC),D0
- beq.b sametrack
- bsr.w loadtrack
- SameTrack: swap D0
- move.l #$55555555,D2
- move.l trackbuffer(PC),A1
- lea $3200(A1),A2
- moveq #10,D5
- SeekSync: cmp.l A2,A1
- bhi.w errorexit
- cmp.w #$4489,(A1)+
- bne.b seeksync
- cmp.w #$4489,(A1)+
- beq.b dualsync
- subq.l #2,A1
- DualSync: move.l 40(A1),D3
- and.l D2,D3
- add.l D3,D3
- move.l 44(A1),D4
- and.l D2,D4
- or.l D3,D4
- moveq #9,D7
- moveq #0,D6
- move.l A1,A3
- CalcHeaderSum: move.l (A3)+,D3
- eor.l D3,D6
- dbf D7,calcheadersum
- and.l D2,D6
- cmp.l D4,D6
- bne.b errorexit
-
- HeaderSumOk: move.b 1(A1),D3
- and.b D2,D3
- add.b D3,D3
- move.b 5(A1),D4
- and.b D2,D4
- or.b D3,D4
- cmp.b (currenttrack+1)(PC),D4
- bne.b errorexit
-
- TrackOk: move.b 2(A1),D3
- and.b D2,D3
- add.b D3,D3
- move.b 6(A1),D4
- and.b D2,D4
- or.b D3,D4
- cmp.b D0,D4
- beq.b foundsector
- lea 1080(A1),A1
- dbf D5,seeksync
- bra.b errorexit
-
- FoundSector: lea 48(A1),A1
- move.l (A1)+,D3
- and.l D2,D3
- add.l D3,D3
- move.l (A1)+,D4
- and.l D2,D4
- or.l D3,D4
- move.w #255,D7
- moveq #0,D6
- move.l A1,A3
- CalcBlockSum: move.l (A3)+,D3
- eor.l D3,D6
- dbf D7,calcblocksum
- and.l D2,D6
- cmp.l D4,D6
- bne.b errorexit
-
- BlockSumOk: moveq #127,D7
- lea 512(A1),A3
- DecodeSector: move.l (A1)+,D3
- and.l D2,D3
- add.l D3,D3
- move.l (A3)+,D4
- and.l D2,D4
- or.l D3,D4
- move.l D4,(A0)+
- dbf D7,decodesector
- moveq #0,D0
- ExitSectorLoad: movem.l (SP)+,A0/A3
- rts
- ErrorExit: moveq #-1,D0
- bra.b exitsectorload
-
- LoadTrack: move.w currenttrack(PC),D1
- bge.b trackisknown
- or.b #$6,(A5)
- clr.w D1
- Cyl0Search: btst #4,drivestatus(A5)
- beq.b trackisknown
- bsr.w step
- bra.b cyl0search
- TrackIsKnown: move.w D0,(currenttrack-root)(A4)
- lsr.w #1,D0
- bcc.b gotoside0
- bclr #2,(A5) * goto side 1
- bra.b sideok
- GotoSide0: bset #2,(A5) * goto side 0
- SideOk: nop
- nop
- lsr.w #1,D1
- sub.w D1,D0
- beq.b readtrack
- bge.b inwards
- neg.w D0
- btst #1,(A5)
- bne.b directionok
- bset #1,(A5) * step out
- bsr.w directiondelay
- bra.b directionok
- Inwards: btst #1,(A5)
- beq.b directionok
- bclr #1,(A5) * step in
- bsr.b directiondelay
- DirectionOk: subq.w #1,D0
- SeekTrack: bsr.b step
- dbf D0,seektrack
-
- ReadTrack: move.w #$4000,dsklen(A6)
- move.w #$8500,adkcon(A6)
- move.w #$4489,dsksync(A6)
- TestReady: btst #5,drivestatus(A5)
- bne.b testready
- move.l trackbuffer(PC),dskpt(A6)
- move.w #$9900,dsklen(A6) load 6400 words
- move.w #$9900,dsklen(A6)
- WaitForBlock: btst #1,(intreqr+1)(A6)
- beq.b waitforblock
- move.w #$2,intreq(A6)
- move.w #$4000,dsklen(A6)
- rts
-
- Step: bclr #0,(A5)
- nop
- nop
- bset #0,(A5)
- move.b #$7F,icr(A5)
- move.b #$08,cra(A5)
- move.b #$70,talo(A5)
- move.b #$08,tahi(A5)
- WaitForDelay: btst #0,icr(A5)
- beq.b waitfordelay
- rts
-
- DirectionDelay: move.b #$7F,icr(A5)
- move.b #$08,cra(A5)
- move.b #$00,talo(A5)
- move.b #$33,tahi(A5)
- bra.b waitfordelay
-
- FileName: dc.b 9,"DUCKS.EXE" * MUST be uppercase!!!
- even
-
- Junk: blk.l (1024-(junk-start))/4,"THR!"
- End:
-