home *** CD-ROM | disk | FTP | other *** search
-
- org $40200
- load $40200
- j move.w #$7fff,$dff09a
- move.w #$7fff,$dff09c
- LEA C92(PC),A0
- MOVE.L A0,$10
- ILLEGAL
- C92 move.l 4.w,a6
- move.b $212(a6),d0
- cmp.b #$32,d0
- seq $dd20
- bsr c094
-
- LeA $40000,SP
- MOVE.W #0,SR
- LEA $40100,SP
- MOVE.W #$7FFF,D0
- MOVE.W D0,$00DFF09A
- MOVE.W #$0C7F,$00DFF096
- LEA $00BFD000,A0
- ORI.B #$F8,$0100(A0)
- ANDI.B #$87,$0100(A0)
- ORI.B #$78,$0100(A0)
- MOVE.B #$7F,$1D01(A0)
- MOVE.B #$7F,$0D00(A0)
- MOVE.W D0,$00DFF09C
- MOVE.W #$7FFF,$00DFF09E
- MOVE.W #$9500,$00DFF09E
- MOVE.W #$4489,$00DFF07E
- LEA main+4,A1
- LEA $DD00,A0
- MOVEQ #7,D0
- C01C MOVE.L (A0)+,(A1)+
- DBRA D0,C01C
- MOVE.B (A0)+,(A1)
- LEA $00DFF142,A0
- MOVEQ #$07,D0
- LB_F090 CLR.W (A0)
- ADDQ.W #8,A0
- DBF D0,LB_F090
-
- ; LEA routines,A0
- ; LEA $7f000,A1
- ; MOVE.W #[routines1-routines]-1,D0
- ;LB_F0A6 MOVE.b (A0)+,(A1)+
- ; DBF D0,LB_F0A6
-
- LEA main,A0
- LEA $0100.W,A1
- MOVE.L A1,A2
- MOVE.W #$0FFF,D0
- .w MOVE.L (A0)+,(A1)+
- DBF D0,.w
-
- move.l #$954,a2
- move.l #$854,d0
- lea $50000,a6
- jmp (A2)
- C094 LEA pic+12(PC),A5
- C098 MOVE.L (A5)+,D0
- CMP.L #$424F4459,D0
- BEQ.S C0EC
- CMP.L #$434D4150,D0
- BEQ.S C0B0
- MOVE.L (A5)+,D0
- ADDA.L D0,A5
- BRA.S C098
- C0B0 MOVE.L (A5)+,D0
- ADD.L A5,D0
- MOVE.L D0,-(SP)
- C0B6 MOVE.L $DFF004,D0
- AND.L #$1FF00,D0
- CMP.L #$A00,D0
- BCC.S C0B6
- LEA $DD00,A2
- MOVEQ #15,D2
- C0D2 MOVEQ #0,D1
- MOVE.B (A5)+,D1
- LSL.W #4,D1
- MOVE.B (A5)+,D1
- MOVE.B (A5)+,D0
- LSR.B #4,D0
- OR.B D0,D1
- ; moveq #0,d1
- MOVE.W D1,(A2)+
- DBRA D2,C0D2
- MOVEA.L (SP)+,A5
- BRA.S C098
-
- C0EC ADDQ.W #4,A5
- MOVE.W #$EF,D7
- LEA $E600,A0
- LEA $3EC,A1
- MOVE.L A0,(A1)+
- ADDA.W #$2940,A0
- MOVE.L A0,(A1)+
- ADDA.W #$2940,A0
- MOVE.L A0,(A1)+
- ADDA.W #$2940,A0
- MOVE.L A0,(A1)+
- C110 MOVEQ #3,D5
- LEA $3EC,A2
- C116 MOVEA.L (A2),A3
- MOVE.W #$2B,D6
- C11C MOVEQ #0,D0
- MOVE.B (A5)+,D0
- BPL.S C130
- NEG.B D0
- SUB.W D0,D6
- MOVE.B (A5)+,D3
- C128 MOVE.B D3,(A3)+
- DBRA D0,C128
- BRA.S C138
- C130 SUB.W D0,D6
- C132 MOVE.B (A5)+,(A3)+
- DBRA D0,C132
- C138 DBRA D6,C11C
- ADDI.L #$2C,(A2)
- ADDQ.W #4,A2
- DBRA D5,C116
- DBRA D7,C110
- BSR.L C390
- C150 MOVE.L $DFF004,D0
- AND.L #$1FF00,D0
- CMP.L #$A00,D0
- BCC.S C150
- MOVE.W #$8180,$DFF096
- MOVE.W #$4200,$DFF100
- RTS
- C390 LEA $30000,A0
- MOVE.L #$1201FFFE,(A0)+
- LEA $E600,A1
- MOVEQ #3,D0
- MOVE.W #$E0,D1
- C3A8 MOVE.W D1,(A0)+
- MOVE.L A1,D2
- SWAP D2
- MOVE.W D2,(A0)+
- ADDQ.W #2,D1
- MOVE.W D1,(A0)+
- SWAP D2
- MOVE.W D2,(A0)+
- ADDA.W #$2940,A1
- ADDQ.W #2,D1
- DBRA D0,C3A8
- LEA $DD00,A1
- MOVE.W #$180,D3
- MOVEQ #15,D0
- C3CE MOVE.W D3,(A0)+
- MOVE.W (A1)+,(A0)+
- ADDQ.W #2,D3
- DBRA D0,C3CE
- MOVE.L #$FFFFFFFE,(A0)
- MOVE.L #$30000,$DFF080
- TST.B $DD20
- BNE.L C406
- MOVE.W #$1571,$DFF08E
- MOVE.W #$5D1,$DFF090
- BRA.L C416
- C406 MOVE.W #$3C71,$DFF08E
- MOVE.W #$2CD1,$DFF090
- C416 MOVE.W #$30,$DFF092
- MOVE.W #$D8,$DFF094
- MOVE.W #0,$DFF108
- MOVE.W #0,$DFF10A
- MOVE.W #$200,$DFF100
- MOVE.L #0,$DFF102
- MOVE.W #0,$DFF088
- RTS
- pic incbin "pic"
-
-
-
- org $45000
- load $45000
- main incbin "dlmain1a"
-
-
- DATA = $2d550
-
- WRONGDISK = -5
- WRONGTRACK = -6
- CHECKSUMERROR = -6
-
- PARTS = 22 ;22 Tracks On The Extra Disk
- WAIT = $b
-
- * Dragons Lair III routines
- org $7f000
- load $7f000
-
- Routines:
- bra.l Calc_Sector
- bra.l Block_Finished
- bra.l Decode_Sector
- bra.l Check_HighTrack
-
- Calc_Sector:
- moveq #0,d1
- move.w d0,d1
- lea COLOR(pc),a0
- clr.w (a0)
- lea DIRECTORY(pc),a0
- clr.l (a0) ;Directory, Extra, Request, Executed
- clr.b 4(a0) ;HighOn
- mulu #$640,d1
- seq (a0)
- divu #$1600,d1
- move.w d1,$2e4.w
- lea DOSOFFSET(pc),a0
- swap d1
- move.w d1,(a0)
- move.l d0,d1
- moveq #0,d0
- rts
-
- Block_Finished:
- movem.l d1-d2/d4-d7/a0-a6,-(a7)
- bsr.s Check_Dos_Data
- bmi.s Fuckit
- beq.s Fuckit
- moveq #-1,d3
- tst.b $359.w
- bne.s DiskEn
- move.w #$1600,d2
- sub.w DOSOFFSET(pc),d2
- Block_Loop:
- addq.l #1,d3
- sub.w #$640,d2
- bgt.s Block_Loop
- bra.s BloFin
-
- DiskEn: move.b EXTRA(pc),d1
- beq.s Dosofn
- subq.l #1,d3
- Dosofn: move.l $334.w,a0
- moveq #1,d4
- End_Loop:
- addq.l #1,d3
- cmp.b (a0)+,d4
- bne.s End_Loop
- BloFin: move.w d3,$338.w
- Fuckit: movem.l (a7)+,d1-d2/d4-d7/a0-a6
- tst.w d0
- rts
-
- Check_Dos_Data:
- lea Data,a0
- lea -$38(a0),a4 ;Skip Dos Header
- lea [$1b00*2]-$400(a0),a2
- lea SectorTable_End(pc),a1
- moveq #-1,d1
- moveq #5,d2
- ClSectors:
- move.l d1,-(a1)
- dbf d2,ClSectors
-
- moveq #11-1,d2
- move.w #$4489,d6
- move.l #$55555555,d4
- moveq #$f,d5
- lea $2e5.w,a6
-
- Sync: cmp.l a0,a2
- bcs.s Check_Finished
- cmp.w (a0)+,d6
- bne.s Sync
- cmp.w (a0),d6
- beq.s Sync
-
- move.l a0,a3
- moveq #0,d0
- move.w #$10d,d7
- GetDChk:move.l (a3)+,d1
- eor.l d1,d0
- dbf d7,GetDChk
- and.l d4,d0
- bne.s Sync
-
- move.l a0,d3
- sub.l a4,d3
-
- exg a0,a3
- bsr.L Decode1LW
- swap d1
- moveq #WRONGTRACK,d0
- cmp.b (a6),d1
- bne.s Check_Error
- rol.l #8,d1
- and.w d5,d1
- add.w d1,d1
- move.w d3,(a1,d1.w)
-
- dbf d2,Sync
-
- Check_Finished:
- moveq #WRONGTRACK,d0
- moveq #11-1,d2
- Cheer: tst.w (a1)+
- dbmi d2,Cheer
- bmi.s Check_Error
-
- move.w #2,$2fc.w
-
- move.b REQUEST(pc),d1
- bne.s Reqer
-
- lea DIRECTORY(pc),a2
- moveq #1,d0
- tst.b (a2)
- beq.s Check_Error
-
- Reqer: moveq #WRONGDISK,d0
-
- moveq #$38,d1
- bsr.s ReadDir
- move.l #"SKID",d2
- cmp.l d1,d2
- bne.s Check_Error
-
- moveq #$3c,d1
- bsr.s ReadDir
-
- move.w d1,$342.w
- cmp.w $330.w,d1
- bne.s Check_Error
- sf (a2)
- moveq #1,d0
- Check_Error:
- lea REQUEST(pc),a0
- move.b (a0),d1
- clr.w (a0) ;Clear Request + Executed
- tst.b d1
- bne.s Req_IdCode
- Check_Done:
- tst.w d0
- bne.s Blop
- subq.w #1,$2e4.w
- tst.w d0
- Blop: rts
-
- Req_IDCode:
- st $2e8.w
- tst.w $2e4.w
- beq.s Req_TrOk
- clr.w $2e4.w
- moveq #WRONGTRACK,d0
- bra.s Check_Done
- Req_TrOk:
- moveq #1,d1 ;All Read Ok
- cmp.w d1,d0
- beq.s Req_IDOk
- moveq #WRONGDISK,d1 ;Disk is different from [$330].w
- cmp.w d1,d0
- bne.s Req_IDFinished
- cmp.l #"SKID",d2 ;SKID Id Is Not There!
- beq.s Req_IDFinished
- Req_IDOk:
- st 1(a0) ;Set Executed = All Id Read Ok
- Req_IDFinished:
- moveq #0,d0
- bra.s Check_Done
-
- ReadDir:
- lea SECTORTABLE(pc),a1
- sub.l a0,a0
- move.w 6(a1),a0
- add.l #$2d550,a0
- add.l d1,a0
- move.l (a0),d1
- and.l d4,d1
- add.l d1,d1
- move.l $200(a0),d2
- and.l d4,d2
- or.l d2,d1
- rts
-
- Decode1LW:
- move.l (a3)+,d1
- and.l d4,d1
- add.l d1,d1
- move.l (a3)+,d0
- and.l d4,d0
- or.l d0,d1
- rts
-
- Wait_Blit:
- move.w #$0040,$dff09a
- btst #6,$dff002
- .e btst #6,$dff002
- bne.s .e
- move.w #$8040,$dff09a
- rts
-
- Copiere:
- bsr.s Copier
- bra Finitor
-
- Copier: sf $2f8.w
- bsr Wait_Blit
- lea $3b610,a0
- move.l a0,$050(a5)
- add.l #$17700,a0
- move.l a0,$054(a5)
- moveq #0,d2
- move.l d2,$064(a5)
- move.w #$9f0,$040(a5)
- move.w d2,$042(a5)
- move.w #$c801,$058(a5)
- rts
-
- Decode_Sector:
- movem.l d1-d7/a1-a6,-(a7)
- lea $31a.w,a6
- move.l #$640,d5
- lea $dff000,a5
- moveq #0,d1
- moveq #0,d4
- tst.b $2f8.w
- bne.s Copiere
- moveq #-1,d7 ;Normal Decode Type
-
- move.l (a6),d0
- sub.l #$3afd0,d0
- beq.s N_Type
-
- move.l $334.w,a4
- move.l a4,d0
- sub.l #$3afd0-1,d0
-
- move.b (a4)+,d7
- move.l a4,$334.w
- tst.b d7
- bne.s N_Type
- addq.w #2,$2be.w
- addq.l #4,a6 ;31e
- add.w d5,d5 ;640+640=c80
- N_Type:
- lea EXTRA(pc),a0
- move.b (a0),d1
- sf (a0)
- tst.b d1
- beq.s No_Correct
- addq.w #1,d0
- No_Correct:
- lea DOSOFFSET(pc),a3
- clr.w (a3)
- move.l (a6),a1 ;Destination
- add.l d5,(a6) ;End
-
- mulu #$640,d0
- divu #$1600,d0
- clr.w d0
- swap d0
- move.l d0,d3
-
- tst.b d1
- beq.s Complete_Sector
-
- moveq #0,d3 ;Start At Sector 0
- add.l d5,a1
- move.l d0,d4
- sub.l d0,a1
- tst.b d7
- bne.s Niebig
- sub.l d0,a1
- Niebig:
- bra.s Half_Sector
- Complete_Sector:
- move.w #$640,d4
- add.w d4,d0
- sub.w #$1600,d0
- bcs.s Half_Sector
- beq.s Half_Sector
- sub.l d5,(a6)
- moveq #0,d5
- st (a0) ;Set EXTRA Flag
- subq.l #1,$334.w
- sub.w d0,d4
- move.w d0,(a3)
- Half_Sector:
- * D4 # Of bytes To Decode
-
- moveq #-2,d0
- moveq #0,d2
- move.w d3,d2
- lsr.w #8,d3
- and.w d0,d3
- and.w #$1ff,d2
-
- lea SECTORTABLE(pc),a3
-
- Next_Sector:
- move.w #$200,d0
- sub.w d2,d0
- cmp.w d0,d4
- bcc.s LenOk
- move.w d4,d0
- LenOk: sub.l a0,a0
- move.w 0(a3,d3.w),a0
- add.l #$2d550,a0
- add.l d2,a0
- bsr.L Blit_Dec
- moveq #0,d2
- addq.w #2,d3
- sub.w d0,d4
- beq.s Oooops
- bcc.s Next_Sector
- Oooops: tst.w d5
- beq.s Finitor
- tst.b d7
- beq.s Finiq
- move.l (a6),a0
- move.l a0,d2
- sub.l #$3b610+$640,d2
- seq $2f8.w
- cmp.l #$17700-$640,d2
- bne.s Finitor
- sub.l #$17700,a0
- move.l a0,(a6)
- bra.s Finitor
- Finiq: move.l (a6),a1
- cmp.l #$3afd0,a1
- bne.s NoDecPR
- lea $30d50,a1
- NoDecPR:move.l a1,(a6)
- clr.w $2be.w
- Finitor:
- bsr Wait_Blit
- tst.b d1
- beq.s AllOk
- tst.b $2f8.w
- beq.s NoDeal
- bsr Copier
- NoDeal: movem.l (a7)+,d1-d7/a1-a6
- bra.L Decode_Sector
- AllOk: moveq #-1,d0
- sub.l a0,a0
- tst.b $2f8.w
- bne.s End_it
- move.w $308.w,d0
- addq.w #2,$308.w
- move.w $338.w,d1
- add.w d1,d1
- cmp.w d1,d0
- bne NotFun
- lea $3ad0.w,a0
- NotFun: moveq #0,d0
- End_It: movem.l (a7)+,d1-d7/a1-a6
- tst.w d0
- rts
-
- Blit_Dec:
- * D0 Length
- * A0 Source
- * A5 DFF000
-
- bclr #0,d0
- tst.b d7 ;Decrunch ?
- beq Decruncher
- bsr.s Use_Blitter
- rts
-
- Use_Blitter:
- move.l a1,$328.w
- lea -1(a1,d0.w),a1
- lea -1(a0,d0.w),a0
- move.w d0,d6
- lsl.w #5,d6
- addq.w #1,d6
- lea $200(a0),a2
-
- bsr Wait_Blit
-
- move.l #$FFFFFFFF,$044(a5)
- move.l a0,$050(a5)
- move.l a2,$04c(a5)
- move.w #$5555,$070(a5)
- move.l a1,$054(a5)
- addq.l #1,a1
-
- clr.l $062(a5)
- clr.w $066(a5)
- clr.w $042(a5)
- move.l #$1dd80002,$040(a5)
-
- move.w d6,$058(a5)
- rts
-
- Do_Decrunch:
- * D0 Length
- * A0 Source
- * A1 Destination
-
- move.w d0,d6
- lsl.l #4,d6
- or.w #$0002,d6
- bsr Wait_Blit
- move.l #$F0F0F0F0,$044(a5)
- move.l a0,$050(a5)
- move.l a1,$054(a5)
-
- clr.w $064(a5)
- move.w #$0004,$066(a5)
-
- move.w #$09f0,$040(a5)
- clr.w $042(a5)
-
- move.w d6,$058(a5)
-
- bsr Wait_Blit
- lea -2(a0,d0.w),a0
- lea (a1,d0.w),a1
- lea -2(a1,d0.w),a1
- move.l #$FFFF0FFF,$044(a5)
- move.l a0,$050(a5)
- move.l a1,$054(a5)
- addq.l #2,a1
-
- clr.w $064(a5)
- move.w #$0004,$066(a5)
-
- move.l #$49f00002,$040(a5)
-
- move.w d6,$058(a5)
- bsr Wait_Blit
- move.l #$FFFFFFFF,$044(a5)
- rts
-
- Decruncher:
- move.l a1,a4
- move.l a0,a1
- bsr.L Use_Blitter
- move.l $328.w,a0
- move.l a4,a1
- bsr.L Do_Decrunch
- rts
-
- Check_HighTrack:
- lea COLOR(pc),a1
- lea HIGHON(pc),a0
- tst.b (a0)
- bne.w In_Progress
- moveq #0,d0
- move.w $2e4.w,d0
- sub.w #$a0,d0
- bcs.s Lower160
- Higher160:
- move.w d0,$2e4.w
- move.b NEWDISK(pc),d1
- bne.s Track_Ok
- move.w $330.w,$302.w
- move.w #$00f,(a1)
- st (a0)
- moveq #0,d1
- move.w $330.w,d1
- subq.w #1,d1
- mulu #PARTS,d1
- addq.w #4,d1
- add.w d0,d1
- lea STARTTRACK(pc),a0
- move.w d1,(a0)
- .k move.w #$f0f,$dff180
- btst #6,$bfe001
- bne.s .k
- moveq #0,d0
- bsr Request_Disk
- bra.s Track_Ok
- Lower160:
- tst.w (a1)
- bne.s Track_Ok
- move.w $330.w,d1
- cmp.w $302.w,d1
- beq.s SameDisk
- lea NEWDISK(pc),a0
- sf (a0)
- bra.s Track_Ok
- SameDisk:
- move.b NEWDISK(pc),d1
- beq.s Track_Ok
- move.w #$0f0,(a1)
- st (a0)
- move.w $2e4.w,d1
- lea STARTTRACK(pc),a0
- move.w d1,(a0)
- move.w $33e.w,d0
- bsr Request_Disk
-
- Track_Ok
- move.b #$ff,$bfd300
- or.b #$7,$bfd100
- rts
-
- In_Progress:
- lea EXECUTED(pc),a0
- move.b (a0),d1
- sf (a0)
- tst.b d1
- bne.s In_IDOk
- bsr Request_Again
- bra.s Track_Ok
- In_IDOk:
- movem.l d2-d3,-(a7)
- lea REQUEST(pc),a0
- st (a0)
- move.w $342.w,d0
- moveq #-1,d3
- moveq #8,d1
- move.w COLOR(pc),d2
- cmp.w #$00f,d2
- beq.s D1Ok
- moveq #0,d3
- move.w $330.w,d1
- D1Ok: cmp.w d1,d0
- bne.s DiskNOk
- clr.l (a0) ;Request, Highon & Executed
- lea NEWDISK(pc),a0
- move.b d3,(a0)
- move.w STARTTRACK(pc),$2e4.w
- DiskNOk:
- movem.l (a7)+,d2-d3
- bra.s Track_Ok
-
- Request_Disk:
- * D0 Drive Number
- lea REQUEST(pc),a1
- st (a1)
- bsr Select_Drive
- rts
-
- Request_Again:
- lea REQUEST(pc),a1
- st (a1)
- bra.s Select_Again
-
-
- Select_Drive:
- move.w d0,$300.w
- Select_Again:
- move.w $300.w,d0
- bsr motoron
- bne.s select_bon
- st active
-
- btst #6,$dff002
- .r12 btst #6,$dff002
- bne.s .r12
-
- move.w #$4000,$dff09a
- move.w $dff002,d2
- and.w #$f,d2
- or.w #$8000,d2
- clr.w dda+2
- move.w d2,dda+2
- move.w #$f,$dff096
- move.l #cop,$dff080
- move.w #%11000000,d2
- WaitM move.b $bfe001,d1
- and.b d2,d1
- cmp.w d2,d1
- beq.s WaitM
- bra.w Select_Again
- Select_Bon:
- tst.b active
- beq.s .r
- .rra sf active
- bsr.w return
- move.w #$c000,$dff09a
- .r rts
-
- active dc.w 0
-
- *********************************
- * Select a Drive, Drive # in D0 *
- *********************************
- MotorOn addq.w #3,d0
- move.b #$ff,$bfd100
- nop
- nop
- and.b #$87,$bfd100
- nop
- nop
- move.b #$ff,$bfd100
- nop
- nop
- MOVE.B #$7D,$bfd100
- NOP
- move.b #$7D,d1
- bclr d0,d1
- MOVE.B d1,$bfd100
- BTST #5,$bfe001
- Beq.S .Wloka
- moveq #0,d0
- rts
- .wloka MOVEQ #1,D0
- RTS
-
-
- return MOVE.L #$1ee,$DFF080
- TST.B $124.w
- BNE.W C4061
- MOVE.W #$1571,$DFF08E
- MOVE.W #$5D1,$DFF090
- BRA.W C4161
- C4061 MOVE.W #$3C71,$DFF08E
- MOVE.W #$2CD1,$DFF090
- C4161 MOVE.W #$30,$DFF092
- MOVE.W #$D8,$DFF094
- MOVE.W #$4200,$DFF100
- MOVE.W #0,$DFF108
- MOVE.W #0,$DFF10A
- MOVE.L #0,$DFF102
- MOVE.W #0,$DFF088
- dda move.w #$0,$dff096
- rts
- cop dc.l $008e9081
- dc.l $00909ac1
- dc.l $00920038
- dc.l $009400d0
- dc.l $00e00000+[[disk8>>16]&$ffff]
- dc.l $00e20000+[disk8&$ffff]
- dc.l $01001200
- dc.l $01800000
- dc.l $01820fff
- dc.l $01020000
- dc.l $01080000
- dc.l $010a0000
- dc.l -2
- disk8 incbin "diskbrush.bit"
-
- SectorTable:
- blk.w 12,0
- SectorTable_End:
- blk.w 4,0
-
- COLOR dc.w 0
- STARTTRACK dc.w 0
- DOSOFFSET dc.w 0
- DIRECTORY dc.b 0
- EXTRA dc.b 0
- REQUEST dc.b 0
- EXECUTED dc.b 0
- HIGHON dc.b 0
- dc.b 0
- NEWDISK dc.b 0
- even
- routines1
-
-
-