home *** CD-ROM | disk | FTP | other *** search
- ****************************************
- *special reader (midwinter,time warrior) (10 sectors, $1400)
- ****************************************
- *A0 LOAD addr
- *d0 start trk
- *d1 nrs to read
- **********************
-
- ;first 3,7 $60000
- ;next 10,$2c $800
-
-
- Fileno: equ 66
-
-
-
- ;sttrk: equ 5
- ;Flen: equ $14a90
-
- org $c70000
- load $c70000
- j: move.w #$7fff,$dff09a
- MOVE.W #$7fff,$dff096
- lea $c80000,a0
- moveq #0,d0
- move.l #Fileno,d7
- subq.l #1,d7
- mulu #$20,d7
- lea (a0,d7.l),a0
- move.w (a0),d0
- move.l 4(a0),d7
- add.l #10,d7
- divu #$17c0,d7
- and.l #$ffff,d7
- addq.w #1,d7
-
- move.l d0,d2
- and.l #1,d2
- lsr.l #1,d0
-
- lea $25000,a0
- dt: movem.l d0/d2/d7,-(a7)
- bsr load
- movem.l (A7)+,d0/d2/d7
- clr.l driveside
- clr.l track
- eor.w #1,d2
- bne.s notrk
- addq.l #1,d0
- notrk: subq.l #1,d7
- bne.s Dt
- UDr: move.w #$83f0,$dff096
- move.w #$e02c,$dff09a
- lea $c80000,a0
- move.l #Fileno,d7
- subq.l #1,d7
- mulu #$20,d7
- lea (a0,d7.l),a2
- move.l 4(a2),d7
- add.l #10,d7
- lea $25000,a0
- move.l a0,a1
- add.l d7,a1
- lea AA(pc),a3
- lea 8(a2),a2
- rt: move.b (a2)+,(a3)+
- tst.b (a2)
- bne.s rt
- rts
-
- aa: blk.b 50,0
-
-
- driveside: dc.w 0
- drive: dc.w 0
- track: dc.w 0
- side: dc.w 0
-
- LOAD: move.w #$8210,$dff096
- ; move.l #2,d0
- move.l #1,d1
- lea $dff000,a6
- ; lea $c90000,a0
- CLR.W drive
- ST track
- move.W d2,side
- bsr C148
- tst.w d4
- bmi.s notok
- bra.s ok
- notok: ;move.w #$f,$dff180
- ;btst #6,$bfe001
- ;bne.s notok
- ok: rts
-
- C05C: LEA $0BFD000,A4
- MOVE.L #$55555555,D5
- MOVE.W drive,D2
- MOVEQ #0,D3
- ADD.W #3,D2
- BSET D2,D3
- MOVE.W side,D2
- BEQ.S C07E
- BSET #2,D3
- C07E: MOVE.B D3,driveside
- MOVE.B #$FF,$100(A4)
- MOVE.B #$7F,$100(A4)
- OR.B #$80,D3
- NOT.B D3
- MOVE.B D3,$100(A4)
- MOVE.W #$C000,D2
- C09C: MOVE.W D2,D4
- MULU D4,D4
- MULU D4,D4
- BTST #5,$1001(A4)
- DBEQ D2,C09C
- BNE C1EE
- MOVEQ #0,D4
- RTS
- C0B4: MOVE.B #$FF,$100(A4)
- MOVE.B #$BF,$100(A4)
- MOVE.B #$DF,$100(A4)
- MOVE.B #$EF,$100(A4)
- MOVE.B #$F7,$100(A4)
- MOVE.B #$FF,$100(A4)
- RTS
- C0DA: BTST #4,$1001(A4)
- BEQ.S C0EA
- MOVEQ #1,D0
- BSR C10A
- BRA.S C0DA
- C0EA: CLR.W track
- RTS
- C0F0: MOVE.W D0,D6
- TST.W track
- BPL.S C0FA
- BSR.S C0DA
- C0FA: SUB.W track,D6
- BEQ.S C146
- ADD.W d6,track
- MOVE.W D6,D0
- BPL.S C114
- NEG.W D0
- C10A: MOVE.B driveside,D1
- OR.B #$80,D1
- BRA.S C11C
- C114: MOVE.B driveside,D1
- OR.B #$82,D1
- C11C: MOVE.B D1,D2
- OR.B #1,D2
- NOT.B D1
- NOT.B D2
- SUBQ.W #1,D0
- C128: MOVE.B D2,$100(A4)
- BRA C130
-
- C130: BRA C134
-
- C134: MOVE.B D1,$100(A4)
- MOVE.W #$208,D3
- C13C: MULU D4,D4
- DBRA D3,C13C
- DBRA D0,C128
- C146: RTS
- C148: SUBQ.W #1,D1
- BMI.S C17C
- BSR C05C
- BMI.S C17E
- C152: MOVE.W #4,$1F4
- C158: MOVEM.W D0/D1,-(SP)
- MOVE.L A0,-(SP)
- BSR.L C0F0
- BSR C19A
- BMI.S C186
- MOVE.L A0,A5
- BSR C1F2
- BMI.S C186
- MOVE.L A5,A0
- ADDQ.W #4,SP
- MOVEM.W (SP)+,D0/D1
- addq.w #1,D0
- onu: DBRA D1,C152
- C17C: MOVEQ #0,D4
- C17E: BSR C0B4
- TST.W D4
- RTS
- C186: MOVE.L (SP)+,A0
- MOVEM.W (SP)+,D0/D1
- SUBQ.W #1,$1F4
- BMI.S C17E
- BNE.S C158
- ST track
- BRA.S C158
-
- C19A: MOVE.W #$4000,$024(A6)
- MOVE.W #2,$09C(A6)
- MOVE.L #$70000,$020(A6)
- MOVE.W #$7f00,$09E(A6)
- MOVE.W #$8500,$09E(A6)
- MOVE.W #$4489,$07E(A6)
- MOVE.W #$9b00,$024(A6)
- MOVE.W #$9b00,$024(A6)
- MOVE.l #$1a00000,D0
- C1CE: btst #1,$dff01f
- bne.s tu
- subq.l #1,d0
- bne.s c1ce
- tu: MOVE.W #$4000,$024(A6)
- MOVEQ #0,D4
- RTS
- C1E8: MOVE.W #$4000,$024(A6)
- C1EE: MOVEQ #-1,D4
- RTS
- C1F2: move.w #$4489,d4
- LEA $70000,A2
- CMP.W (A2)+,d4
- BEQ.S C200
- SUBQ.W #2,A2
- C200: CMP.W (A2)+,d4
- BEQ.S C202
- SUBQ.W #2,A2
- C202: MOVE.L A2,A0
- BSR C254
- MOVE.W track,D1
- ADD.W D1,D1
- ADD.W side,D1
- CMP.B D0,D1
- BNE.S C1EE
- LEA 8(A2),A0
- BSR C254
- MOVE.L D0,D7
- LEA $a0(A2),A0
- BSR C242
- and.l #$55555555,d0
- CMP.L D0,D7
- ; BNE.S C1EE
- move.l TRkok2(pc),a0
- move.w track(pc),(a0)+
- move.w side(pc),(a0)+
- move.w $dff006,$dff180
- move.l a0,trkok2
- LEA $a0(A2),A0
- MOVE.l #$17c0,D0
- BSR C262
- MOVEQ #0,D4
- RTS
- MOVEQ #-1,D4
- RTS
- trkok2: dc.l trkok
-
-
-
- C242: move.l #$bdf,d1
- moveq #0,d0
- C248: move.l (a0)+,d2
- EOR.L d2,D0
- DBf D1,C248
- RTS
- C254: MOVE.L (A0)+,D0
- MOVE.L (A0)+,D1
- AND.L D5,D0
- AND.L D5,D1
- ADD.L D0,D0
- OR.L D1,D0
- RTS
- C262: lea $17c0(a0),a1
- LSR.W #2,D0
- SUBQ.W #1,D0
- C26A: MOVE.L (A0)+,D1
- MOVE.L (A1)+,D2
- AND.L D5,D1
- AND.L D5,D2
- ADD.L D1,D1
- OR.L D2,D1
- MOVE.L D1,(A5)+
- DBf D0,C26A
- RTS
- trkok: blk.w 200,-1
-