home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CBM Funet Archive
/
cbm-funet-archive-2003.iso
/
cbm
/
firmware
/
drives
/
old
/
8050
/
d
/
8250romfdc.dis
< prev
next >
Wrap
Text File
|
1995-02-02
|
20KB
|
740 lines
IRQCOUNTER_FDC = $0
IRQ16COUNTER_FDC = $1
ACLTIM_FDC? = $2
DRVST_FDC = $4
TMP_FDC = $8
WORK_FDC = $9
la = $a
CSECT_FDC = $d
HEADER_ID1_FDC = $e
HEADER_TRACK_FDC = $10
HEADER_SECT_FDC = $11
DRIVE_FDC = $13
TRACC_FDC = $14
NEXTS_FDC = $15
SECTR_FDC = $16
BUFPNT_FDC = $17
BUFPNT_FDC+1 = $18
HDRPNT_FDC = $19
SYNC_COUNTER_FDC = $1e
JOB_FDC = $1f
JOBN_FDC = $20
DRVTRK_FDC = $21
STEPTMP_FDC = $23
CHKSUM_FDC = $25
SAVE_JOBN_FDC = $28
NXTRK_FDC = $29
IO_VIA40_PB_FDC = $40
IO_DISKDATA_READ_FDC = $41
IO_VIA40_T1LC_FDC = $45
IO_VIA40_PCR_FDC = $4c
IO_VIA40_IFR_FDC = $4d
IO_DISKDATA_WRITE_FDC = $80
IO_RIOT80_PB_FDC = $82
IO_RIOT80_T8_FDC = $8f
l2a0 = $2a0
FDC_RESETPHASE_FDC = $400
l401 = $401
l402 = $402
JOBS_FDC = $403
HWDEP_1099_MAXSECPERZONE = $499
HEADERGAP_SIZE_FDC = $49d
l4a0 = $4a0
PHASE_FDC = $4a1
MIN_SYNC_LENGTH_FDC = $4a5
WPSW_FDC = $4a6
LWPT_FDC = $4a8
l4a9 = $4a9
KILLP_FLAG_FDC = $4ab
TRKNUM_SIDE0?_FDC-1 = $4af
TRKNUM_SIDE0?_FDC = $4b0
TRKNUM_SIDE1?_FDC-1 = $4b3
STEPS?_FDC = $4eb
MINTRK_SIDE2?_FDC = $4ed
BUFF0_FDC = $500
l9a9 = $9a9
lba9 = $ba9
.org $fc00
fc00 ITOP_FDC:
fc02 IERRR_FDC = * + 2
fc00 17 fc db .byte $17,$fc,$db
fc03 lfc03:
fc03 fe a0 02 inc l2a0,x
fc06 LCC_FDC:
fc06 8c 00 04 sty FDC_RESETPHASE_FDC
fc09 lfc09:
fc09 ad 00 04 lda FDC_RESETPHASE_FDC
fc0c d0 fb bne lfc09
fc0e lfc0e:
fc0e 88 dey
fc0f d0 f5 bne LCC_FDC
fc11 lfc11:
fc11 4c 00 05 jmp BUFF0_FDC
fc14 lfc14:
fc14 88 dey
fc15 10 02 bpl CONT10_FDC
fc17 TOP_FDC:
fc17 a0 0e ldy #$e
fc19 CONT10_FDC:
fc19 58 cli
fc1a b9 03 04 lda JOBS_FDC,y
fc1d 10 f5 bpl lfc14
fc1f lfc1f:
fc1f c9 d0 cmp #$d0
fc21 d0 06 bne CONT30_FDC
fc23 lfc23:
fc23 98 tya
fc24 85 20 sta JOBN_FDC
fc26 4c 00 fd jmp lfd00
fc29 CONT30_FDC:
fc29 78 sei
fc2a 29 01 and #$1
fc2c aa tax
fc2d 85 13 sta DRIVE_FDC
fc2f a5 40 lda IO_VIA40_PB_FDC
fc31 3d e6 ff and PHASE_1_FDC,x
fc34 f0 11 beq lfc47
fc36 lfc36:
fc36 45 40 eor IO_VIA40_PB_FDC
fc38 85 40 sta IO_VIA40_PB_FDC
fc3a a5 01 lda IRQ16COUNTER_FDC
fc3c 6d 01 04 adc l401
fc3f 95 02 sta ACLTIM_FDC?,x
fc41 b5 04 lda DRVST_FDC,x
fc43 09 80 ora #$80
fc45 95 04 sta DRVST_FDC,x
fc47 lfc47:
fc47 b5 04 lda DRVST_FDC,x
fc49 30 c9 bmi lfc14
fc4b lfc4b:
fc4b 20 d9 ff jsr lffd9
fc4e b5 04 lda DRVST_FDC,x
fc50 0a asl a
fc51 30 c1 bmi lfc14
fc53 lfc53:
fc53 58 cli
fc54 a0 0e ldy #$e
fc56 84 20 sty JOBN_FDC
fc58 lfc58:
fc58 20 20 fd jsr SETJB_FDC
fc5b 30 20 bmi QUE20_FDC
fc5d QUE05_FDC?:
fc5d c6 20 dec JOBN_FDC
fc5f 10 f7 bpl lfc58
fc61 lfc61:
fc61 a4 28 ldy SAVE_JOBN_FDC
fc63 20 22 fd jsr SETJB_Y_FDC
fc66 a5 29 lda NXTRK_FDC
fc68 78 sei
fc69 9d eb 04 sta STEPS?_FDC,x
fc6c a9 08 lda #$8
fc6e 95 23 sta STEPTMP_FDC,x
fc70 a9 41 lda #$41
fc72 15 04 ora DRVST_FDC,x
fc74 95 04 sta DRVST_FDC,x
fc76 b1 19 lda (HDRPNT_FDC),y
fc78 95 21 sta DRVTRK_FDC,x
fc7a lfc7a:
fc7a 4c 17 fc jmp TOP_FDC
fc7d QUE20_FDC:
fc7d 29 01 and #$1
fc7f c5 13 cmp DRIVE_FDC
fc81 d0 da bne QUE05_FDC?
fc83 lfc83:
fc83 a5 82 lda IO_RIOT80_PB_FDC
fc85 09 10 ora #$10
fc87 85 82 sta IO_RIOT80_PB_FDC
fc89 b1 19 lda (HDRPNT_FDC),y
fc8b cd b0 04 cmp TRKNUM_SIDE0?_FDC
fc8e 90 12 bcc lfca2
fc90 lfc90:
fc90 a5 82 lda IO_RIOT80_PB_FDC
fc92 29 ef and #$ef
fc94 85 82 sta IO_RIOT80_PB_FDC
fc96 b5 21 lda DRVTRK_FDC,x
fc98 cd b0 04 cmp TRKNUM_SIDE0?_FDC
fc9b b0 11 bcs lfcae
fc9d lfc9d:
fc9d 6d ed 04 adc MINTRK_SIDE2?_FDC
fca0 d0 0a bne lfcac
fca2 lfca2:
fca2 b5 21 lda DRVTRK_FDC,x
fca4 cd b0 04 cmp TRKNUM_SIDE0?_FDC
fca7 90 05 bcc lfcae
fca9 lfca9:
fca9 ed ed 04 sbc MINTRK_SIDE2?_FDC
fcac lfcac:
fcac 95 21 sta DRVTRK_FDC,x
fcae lfcae:
fcae b5 21 lda DRVTRK_FDC,x
fcb0 f0 0d beq GOTU_FDC
fcb2 lfcb2:
fcb2 38 sec
fcb3 f1 19 sbc (HDRPNT_FDC),y
fcb5 f0 08 beq GOTU_FDC
fcb7 lfcb7:
fcb7 85 29 sta NXTRK_FDC
fcb9 a5 20 lda JOBN_FDC
fcbb 85 28 sta SAVE_JOBN_FDC
fcbd 10 9e bpl QUE05_FDC?
fcbf GOTU_FDC:
fcbf a2 04 ldx #$4
fcc1 b1 19 lda (HDRPNT_FDC),y
fcc3 85 14 sta TRACC_FDC
fcc5 cd b0 04 cmp TRKNUM_SIDE0?_FDC
fcc8 b0 08 bcs lfcd2
fcca lfcca:
fcca dd af 04 cmp TRKNUM_SIDE0?_FDC-1,x
fccd ca dex
fcce b0 fa bcs lfcca
fcd0 lfcd0:
fcd0 90 06 bcc lfcd8
fcd2 lfcd2:
fcd2 dd b3 04 cmp TRKNUM_SIDE1?_FDC-1,x
fcd5 ca dex
fcd6 b0 fa bcs lfcd2
fcd8 lfcd8:
fcd8 bd 99 04 lda HWDEP_1099_MAXSECPERZONE,x
fcdb 85 16 sta SECTR_FDC
fcdd 8a txa
fcde 0a asl a
fcdf 85 09 sta WORK_FDC
fce1 a5 82 lda IO_RIOT80_PB_FDC
fce3 29 f8 and #$f8
fce5 05 09 ora WORK_FDC
fce7 05 13 ora DRIVE_FDC
fce9 85 82 sta IO_RIOT80_PB_FDC
fceb a6 13 ldx DRIVE_FDC
fced b5 04 lda DRVST_FDC,x
fcef 30 89 bmi lfc7a
fcf1 lfcf1:
fcf1 a5 1f lda JOB_FDC
fcf3 c9 40 cmp #$40
fcf5 f0 11 beq BMP_FDC
fcf7 EXE_FDC:
fcf7 c9 60 cmp #$60
fcf9 f0 03 beq EX_FDC
fcfb lfcfb:
fcfb 4c 5a fe jmp SEAK_FDC
fcfe EX_FDC:
fcfe a5 20 lda JOBN_FDC
fd00 lfd00:
fd00 18 clc
fd01 69 05 adc #$5
fd03 85 18 sta BUFPNT_FDC+1
fd05 6c 17 00 jmp (BUFPNT_FDC)
fd08 BMP_FDC:
fd08 78 sei
fd09 a9 41 lda #$41
fd0b 95 04 sta DRVST_FDC,x
fd0d a9 01 lda #$1
fd0f 95 21 sta DRVTRK_FDC,x
fd11 bd e4 ff lda PHASE_3_FDC,x
fd14 05 40 ora IO_VIA40_PB_FDC
fd16 85 40 sta IO_VIA40_PB_FDC
fd18 a9 5c lda #$5c
fd1a 9d eb 04 sta STEPS?_FDC,x
fd1d 4c ea ff jmp lffea
fd20 SETJB_FDC:
fd20 a4 20 ldy JOBN_FDC
fd22 SETJB_Y_FDC:
fd22 b9 03 04 lda JOBS_FDC,y
fd25 48 pha
fd26 29 78 and #$78
fd28 85 1f sta JOB_FDC
fd2a 98 tya
fd2b 0a asl a
fd2c 0a asl a
fd2d 0a asl a
fd2e 69 21 adc #$21
fd30 85 19 sta HDRPNT_FDC
fd32 a0 02 ldy #$2
fd34 68 pla
fd35 60 rts
fd36 lfd36:
fd36 a0 03 ldy #$3
fd38 b1 19 lda (HDRPNT_FDC),y
fd3a 85 11 sta HEADER_SECT_FDC
fd3c WSECT_FDC?:
fd3c a9 7f lda #$7f
fd3e 85 0d sta CSECT_FDC
fd40 a5 11 lda HEADER_SECT_FDC
fd42 18 clc
fd43 69 02 adc #$2
fd45 c5 16 cmp SECTR_FDC
fd47 90 02 bcc L_460_FDC
fd49 lfd49:
fd49 a9 00 lda #$0
fd4b L_460_FDC:
fd4b 85 15 sta NEXTS_FDC
fd4d a2 0e ldx #$e
fd4f 86 20 stx JOBN_FDC
fd51 a2 ff ldx #$ff
fd53 L_480_FDC:
fd53 20 20 fd jsr SETJB_FDC
fd56 10 2c bpl L_470_FDC
fd58 lfd58:
fd58 85 09 sta WORK_FDC
fd5a 29 01 and #$1
fd5c c5 13 cmp DRIVE_FDC
fd5e d0 24 bne L_470_FDC
fd60 lfd60:
fd60 b1 19 lda (HDRPNT_FDC),y
fd62 c5 14 cmp TRACC_FDC
fd64 d0 1e bne L_470_FDC
fd66 lfd66:
fd66 a5 1f lda JOB_FDC
fd68 c9 60 cmp #$60
fd6a f0 18 beq L_470_FDC
fd6c lfd6c:
fd6c c8 iny
fd6d 38 sec
fd6e b1 19 lda (HDRPNT_FDC),y
fd70 e5 15 sbc NEXTS_FDC
fd72 10 03 bpl L_465_FDC
fd74 lfd74:
fd74 18 clc
fd75 65 16 adc SECTR_FDC
fd77 L_465_FDC:
fd77 c5 0d cmp CSECT_FDC
fd79 b0 09 bcs L_470_FDC
fd7b DOITT_FDC:
fd7b 85 0d sta CSECT_FDC
fd7d a5 20 lda JOBN_FDC
fd7f aa tax
fd80 69 05 adc #$5
fd82 85 18 sta BUFPNT_FDC+1
fd84 L_470_FDC:
fd84 c6 20 dec JOBN_FDC
fd86 10 cb bpl L_480_FDC
fd88 lfd88:
fd88 8a txa
fd89 10 03 bpl lfd8e
fd8b lfd8b:
fd8b 4c 17 fc jmp TOP_FDC
fd8e lfd8e:
fd8e 8e a0 04 stx l4a0
fd91 86 20 stx JOBN_FDC
fd93 20 20 fd jsr SETJB_FDC
fd96 a5 1f lda JOB_FDC
fd98 REED_FDC:
fd98 c9 00 cmp #$0
fd9a d0 36 bne WRIGHT_FDC
fd9c READ01_FDC:
fd9c 20 c7 fd jsr DSTRT_FDC
fd9f lfd9f:
fd9f 50 fe bvc lfd9f
fda1 lfda1:
fda1 b8 clv
fda2 a5 41 lda IO_DISKDATA_READ_FDC
fda4 91 17 sta (BUFPNT_FDC),y
fda6 c8 iny
fda7 d0 f6 bne lfd9f
fda9 READ_CHECKSUM_FDC:
fda9 50 fe bvc READ_CHECKSUM_FDC
fdab lfdab:
fdab a5 41 lda IO_DISKDATA_READ_FDC
fdad 85 25 sta CHKSUM_FDC
fdaf a9 10 lda #$10
fdb1 24 4d bit IO_VIA40_IFR_FDC
fdb3 d0 0f bne lfdc4
fdb5 lfdb5:
fdb5 20 36 ff jsr CHKBLK_FDC
fdb8 c5 25 cmp CHKSUM_FDC
fdba d0 03 bne lfdbf
fdbc lfdbc:
fdbc 4c 9f fe jmp DONE_FDC
fdbf lfdbf:
fdbf a9 05 lda #$5
fdc2 lfdc2 = * + 1
; iNSTRUCTION PARAMETER JUMPED TO.
fdc1 2c a9 04 bit l4a9
fdc4 lfdc4:
fdc4 4c db fe jmp ERRR_FDC
fdc7 DSTRT_FDC:
fdc7 20 aa fe jsr SRCH_FDC
fdca 20 f7 fe jsr SYNC?_FDC
fdcd c9 07 cmp #$7
fdcf d0 f1 bne lfdc2
fdd1 lfdd1:
fdd1 60 rts
fdd2 WRIGHT_FDC:
fdd2 c9 10 cmp #$10
fdd4 d0 65 bne VRFY_FDC
fdd6 lfdd6:
fdd6 20 36 ff jsr CHKBLK_FDC
fdd9 85 25 sta CHKSUM_FDC
fddb a5 82 lda IO_RIOT80_PB_FDC
fddd 29 08 and #$8
fddf d0 e3 bne lfdc4
fde1 WRT10_FDC:
fde1 20 aa fe jsr SRCH_FDC
fde4 ae 9d 04 ldx HEADERGAP_SIZE_FDC
fde7 lfde7:
fde7 50 fe bvc lfde7
fde9 lfde9:
fde9 b8 clv
fdea ca dex
fdeb d0 fa bne lfde7
fded lfded:
fded a9 de lda #$de
fdef 85 4c sta IO_VIA40_PCR_FDC
fdf1 a9 dc lda #$dc
fdf3 a2 ff ldx #$ff
fdf5 20 2d ff jsr WRITE_2_BYTES_FDC
fdf8 20 2d ff jsr WRITE_2_BYTES_FDC
fdfb lfdfb:
fdfb 50 fe bvc lfdfb
fdfd lfdfd:
fdfd b8 clv
fdfe 85 4c sta IO_VIA40_PCR_FDC
fe00 a9 07 lda #$7
fe02 85 80 sta IO_DISKDATA_WRITE_FDC
fe04 a0 00 ldy #$0
fe06 lfe06:
fe06 50 fe bvc lfe06
fe08 lfe08:
fe08 b8 clv
fe09 b1 17 lda (BUFPNT_FDC),y
fe0b 85 80 sta IO_DISKDATA_WRITE_FDC
fe0d c8 iny
fe0e d0 f6 bne lfe06
fe10 lfe10:
fe10 a6 25 ldx CHKSUM_FDC
fe12 lfe12:
fe12 50 fe bvc lfe12
fe14 lfe14:
fe14 b8 clv
fe15 86 80 stx IO_DISKDATA_WRITE_FDC
fe17 20 30 ff jsr WRITE_A_BYTE_FDC
fe1a a2 00 ldx #$0
fe1c 20 30 ff jsr WRITE_A_BYTE_FDC
fe1f a9 fc lda #$fc
fe21 lfe21:
fe21 50 fe bvc lfe21
fe23 lfe23:
fe23 b8 clv
fe24 85 4c sta IO_VIA40_PCR_FDC
fe26 a2 28 ldx #$28
fe28 lfe28:
fe28 20 27 ff jsr READ_A_BYTE_FDC
fe2b ca dex
fe2c d0 fa bne lfe28
fe2e lfe2e:
fe2e a4 20 ldy JOBN_FDC
fe30 b9 03 04 lda JOBS_FDC,y
fe33 49 30 eor #$30
fe35 99 03 04 sta JOBS_FDC,y
fe38 4c 36 fd jmp lfd36
fe3b VRFY_FDC:
fe3b c9 20 cmp #$20
fe3d d0 16 bne SECTSK_FDC
fe3f lfe3f:
fe3f 20 c7 fd jsr DSTRT_FDC
fe42 lfe42:
fe42 50 fe bvc lfe42
fe44 lfe44:
fe44 b8 clv
fe45 a5 41 lda IO_DISKDATA_READ_FDC
fe47 d1 17 cmp (BUFPNT_FDC),y
fe49 d0 06 bne lfe51
fe4b lfe4b:
fe4b c8 iny
fe4c d0 f4 bne lfe42
fe4e lfe4e:
fe4e 4c a9 fd jmp READ_CHECKSUM_FDC
fe51 lfe51:
fe51 a9 07 lda #$7
fe53 d0 52 bne lfea7
fe55 SECTSK_FDC:
fe55 20 aa fe jsr SRCH_FDC
fe58 f0 45 beq DONE_FDC
fe5a SEAK_FDC:
fe5a a2 b4 ldx #$b4
fe5c 20 d5 fe jsr WAIT_FOR_HDRBLOCK_FDC
fe5f a0 04 ldy #$4
fe61 lfe61:
fe61 50 fe bvc lfe61
fe63 lfe63:
fe63 b8 clv
fe64 a5 41 lda IO_DISKDATA_READ_FDC
fe66 99 0e 00 sta HEADER_ID1_FDC,y
fe69 88 dey
fe6a 10 f5 bpl lfe61
fe6c lfe6c:
fe6c a0 04 ldy #$4
fe6e a9 00 lda #$0
fe70 lfe70:
fe70 59 0e 00 eor HEADER_ID1_FDC,y
fe73 88 dey
fe74 10 fa bpl lfe70
fe76 lfe76:
fe76 c9 00 cmp #$0
fe78 d0 28 bne lfea2
fe7a lfe7a:
fe7a a6 13 ldx DRIVE_FDC
fe7c a5 10 lda HEADER_TRACK_FDC
fe7e 95 21 sta DRVTRK_FDC,x
fe80 a5 1f lda JOB_FDC
fe82 c9 30 cmp #$30
fe84 f0 0f beq ESEEK_FDC
fe86 lfe86:
fe86 a0 01 ldy #$1
fe88 lfe88:
fe88 b1 19 lda (HDRPNT_FDC),y
fe8a d9 0e 00 cmp HEADER_ID1_FDC,y
fe8d d0 16 bne BADID_FDC
fe8f lfe8f:
fe8f 88 dey
fe90 10 f6 bpl lfe88
fe92 lfe92:
fe92 4c 3c fd jmp WSECT_FDC?
fe95 ESEEK_FDC:
fe95 a0 04 ldy #$4
fe97 lfe97:
fe97 b9 0e 00 lda HEADER_ID1_FDC,y
fe9a 91 19 sta (HDRPNT_FDC),y
fe9c 88 dey
fe9d 10 f8 bpl lfe97
fe9f DONE_FDC:
fe9f a9 01 lda #$1
fea2 lfea2 = * + 1
; iNSTRUCTION PARAMETER JUMPED TO.
fea1 2c a9 09 bit l9a9
fea5 BADID_FDC = * + 1
; iNSTRUCTION PARAMETER JUMPED TO.
fea4 2c a9 0b bit lba9
fea7 lfea7:
fea7 4c db fe jmp ERRR_FDC
feaa SRCH_FDC:
feaa a0 03 ldy #$3
feac a9 00 lda #$0
feae lfeae:
feae 51 19 eor (HDRPNT_FDC),y
feb0 88 dey
feb1 10 fb bpl lfeae
feb3 lfeb3:
feb3 a0 04 ldy #$4
feb5 91 19 sta (HDRPNT_FDC),y
feb7 a4 20 ldy JOBN_FDC
feb9 a2 b4 ldx #$b4
febb lfebb:
febb 20 d5 fe jsr WAIT_FOR_HDRBLOCK_FDC
febe a0 04 ldy #$4
fec0 lfec0:
fec0 50 fe bvc lfec0
fec2 lfec2:
fec2 b8 clv
fec3 a5 41 lda IO_DISKDATA_READ_FDC
fec5 d1 19 cmp (HDRPNT_FDC),y
fec7 d0 f2 bne lfebb
fec9 lfec9:
fec9 88 dey
feca 10 f4 bpl lfec0
fecc lfecc:
fecc c8 iny
fecd lfecd:
fecd 60 rts
fece lfece:
fece 20 f7 fe jsr SYNC?_FDC
fed1 c9 08 cmp #$8
fed3 f0 f8 beq lfecd
fed5 WAIT_FOR_HDRBLOCK_FDC:
fed5 58 cli
fed6 ca dex
fed7 d0 f5 bne lfece
fed9 lfed9:
fed9 a9 02 lda #$2
fedb ERRR_FDC:
fedb a4 20 ldy JOBN_FDC
fedd 99 03 04 sta JOBS_FDC,y
fee0 48 pha
fee1 a5 01 lda IRQ16COUNTER_FDC
fee3 a6 13 ldx DRIVE_FDC
fee5 6d 02 04 adc l402
fee8 95 02 sta ACLTIM_FDC?,x
feea 68 pla
feeb 4a lsr a
feec d0 03 bne lfef1
feee lfeee:
feee 4c 36 fd jmp lfd36
fef1 lfef1:
fef1 a2 3f ldx #$3f
fef3 9a txs
fef4 4c 17 fc jmp TOP_FDC
fef7 SYNC?_FDC:
fef7 a9 1e lda #$1e
fef9 85 1e sta SYNC_COUNTER_FDC
fefb lfefb:
fefb a5 40 lda IO_VIA40_PB_FDC
fefd 29 bf and #$bf
feff 85 40 sta IO_VIA40_PB_FDC
ff01 78 sei
ff02 a9 d0 lda #$d0
ff04 85 45 sta IO_VIA40_T1LC_FDC
ff06 a9 03 lda #$3
ff08 c6 1e dec SYNC_COUNTER_FDC
ff0a 30 cf bmi ERRR_FDC
ff0c lff0c:
ff0c 24 45 bit IO_VIA40_T1LC_FDC
ff0e 10 cb bpl ERRR_FDC
ff10 lff10:
ff10 24 40 bit IO_VIA40_PB_FDC
ff12 30 f8 bmi lff0c
ff14 lff14:
ff14 ac a5 04 ldy MIN_SYNC_LENGTH_FDC
ff17 lff17:
ff17 24 40 bit IO_VIA40_PB_FDC
ff19 30 e0 bmi lfefb
ff1b lff1b:
ff1b 88 dey
ff1c d0 f9 bne lff17
ff1e lff1e:
ff1e a5 40 lda IO_VIA40_PB_FDC
ff20 09 40 ora #$40
ff22 85 40 sta IO_VIA40_PB_FDC
ff24 24 41 bit IO_DISKDATA_READ_FDC
ff26 b8 clv
ff27 READ_A_BYTE_FDC:
ff27 50 fe bvc READ_A_BYTE_FDC
ff29 lff29:
ff29 b8 clv
ff2a a5 41 lda IO_DISKDATA_READ_FDC
ff2c 60 rts
ff2d WRITE_2_BYTES_FDC:
ff2d 20 30 ff jsr WRITE_A_BYTE_FDC
ff30 WRITE_A_BYTE_FDC:
ff30 50 fe bvc WRITE_A_BYTE_FDC
ff32 lff32:
ff32 b8 clv
ff33 86 80 stx IO_DISKDATA_WRITE_FDC
ff35 60 rts
ff36 CHKBLK_FDC:
ff36 a9 00 lda #$0
ff38 a8 tay
ff39 lff39:
ff39 51 17 eor (BUFPNT_FDC),y
ff3b c8 iny
ff3c d0 fb bne lff39
ff3e lff3e:
ff3e 60 rts
ff3f IRQ_FDC:
ff3f 48 pha
ff40 8a txa
ff41 48 pha
ff42 a9 03 lda #$3
ff44 85 8f sta IO_RIOT80_T8_FDC
ff46 85 8f sta IO_RIOT80_T8_FDC
ff48 e6 00 inc IRQCOUNTER_FDC
ff4a a5 00 lda IRQCOUNTER_FDC
ff4c 29 0f and #$f
ff4e d0 02 bne lff52
ff50 lff50:
ff50 e6 01 inc IRQ16COUNTER_FDC
ff52 lff52:
ff52 a2 01 ldx #$1
ff54 a5 82 lda IO_RIOT80_PB_FDC
ff56 48 pha
ff57 09 01 ora #$1
ff59 lff59:
ff59 85 82 sta IO_RIOT80_PB_FDC
ff5b a5 82 lda IO_RIOT80_PB_FDC
ff5d 29 08 and #$8
ff5f dd a8 04 cmp LWPT_FDC,x
ff62 9d a8 04 sta LWPT_FDC,x
ff65 f0 05 beq lff6c
ff67 lff67:
ff67 a9 01 lda #$1
ff69 9d a6 04 sta WPSW_FDC,x
ff6c lff6c:
ff6c a5 01 lda IRQ16COUNTER_FDC
ff6e d5 02 cmp ACLTIM_FDC?,x
ff70 d0 11 bne lff83
ff72 lff72:
ff72 16 04 asl DRVST_FDC,x
ff74 b0 07 bcs lff7d
ff76 lff76:
ff76 bd e6 ff lda PHASE_1_FDC,x
ff79 05 40 ora IO_VIA40_PB_FDC
ff7b 85 40 sta IO_VIA40_PB_FDC
ff7d lff7d:
ff7d 20 d9 ff jsr lffd9
ff80 18 clc
ff81 76 04 ror DRVST_FDC,x
ff83 lff83:
ff83 bd eb 04 lda STEPS?_FDC,x
ff86 d0 14 bne lff9c
ff88 lff88:
ff88 b5 23 lda STEPTMP_FDC,x
ff8a f0 04 beq lff90
ff8c lff8c:
ff8c d6 23 dec STEPTMP_FDC,x
ff8e 10 38 bpl lffc8
ff90 lff90:
ff90 9d a1 04 sta PHASE_FDC,x
ff93 b5 04 lda DRVST_FDC,x
ff95 29 bf and #$bf
ff97 95 04 sta DRVST_FDC,x
ff99 4c c8 ff jmp lffc8
ff9c lff9c:
ff9c 0a asl a
ff9d a5 40 lda IO_VIA40_PB_FDC
ff9f 3d e0 ff and PHASE_MASKREST_FDC,x
ffa2 85 08 sta TMP_FDC
ffa4 a5 40 lda IO_VIA40_PB_FDC
ffa6 3d e4 ff and PHASE_3_FDC,x
ffa9 b0 09 bcs lffb4
ffab lffab:
ffab de eb 04 dec STEPS?_FDC,x
ffae 5d e4 ff eor PHASE_3_FDC,x
ffb1 4c b7 ff jmp lffb7
ffb4 lffb4:
ffb4 fe eb 04 inc STEPS?_FDC,x
ffb7 lffb7:
ffb7 5d e2 ff eor PHASE_2_FDC,x
ffba f0 08 beq lffc4
ffbc lffbc:
ffbc dd e4 ff cmp PHASE_3_FDC,x
ffbf f0 03 beq lffc4
ffc1 lffc1:
ffc1 5d e4 ff eor PHASE_3_FDC,x
ffc4 lffc4:
ffc4 05 08 ora TMP_FDC
ffc6 85 40 sta IO_VIA40_PB_FDC
ffc8 lffc8:
ffc8 a5 82 lda IO_RIOT80_PB_FDC
ffca 29 fe and #$fe
ffcc ca dex
ffcd 10 8a bpl lff59
ffcf lffcf:
ffcf 4e ab 04 lsr KILLP_FLAG_FDC
ffd2 68 pla
ffd3 85 82 sta IO_RIOT80_PB_FDC
ffd5 68 pla
ffd6 aa tax
ffd7 68 pla
ffd8 40 rti
ffd9 lffd9:
ffd9 a5 01 lda IRQ16COUNTER_FDC
ffdb 95 02 sta ACLTIM_FDC?,x
ffdd d6 02 dec ACLTIM_FDC?,x
ffdf 60 rts
ffe0 PHASE_MASKREST_FDC:
ffe2 PHASE_2_FDC = * + 2
ffe0 f3 fc 08 .byte $f3,$fc,$8
ffe4 PHASE_3_FDC = * + 1
ffe3 02 0c 03 .byte $2,$c,$3
ffe6 PHASE_1_FDC:
ffe6 20 10 aa .byte $20,$10,$aa
ffe9 aa .byte $aa
ffea lffea:
ffea 95 23 sta STEPTMP_FDC,x
ffec 4c 9f fe jmp DONE_FDC
ffef aa aa aa .byte $aa,$aa,$aa
fff2 aa aa aa .byte $aa,$aa,$aa
fff5 aa aa aa .byte $aa,$aa,$aa
fff8 aa aa 53 .byte $aa,$aa,$53
fffb a3 04 fc .byte $a3,$4,$fc
0000 IRQCOUNTER_FDC = * + 2
fffe 3f ff 00 .byte $3f,$ff,$0