a2d/desktop/ovl1c.s

1481 lines
31 KiB
ArmAsm
Raw Normal View History

;;; ============================================================
;;; Overlay for Disk Copy - $0800 - $12FF (file 4/4)
;;; ============================================================
2018-02-26 00:17:11 +00:00
.proc disk_copy_overlay4
.org $800
2018-03-29 04:05:12 +00:00
2018-04-01 20:33:53 +00:00
.macro exit_with_result arg
lda #arg
jmp exit
.endmacro
2018-02-26 00:17:11 +00:00
L0800: php
sei
jsr L083A
plp
cmp #$00
bne L080C
clc
rts
L080C: cmp #$02
bne L0815
lda #$2B
jmp L0821
L0815: cmp #$01
bne L081E
lda #$27
jmp L0821
L081E: clc
adc #$30
L0821: sec
rts
L0823: asl a
asl current_track
sta seltrack_track
2018-02-26 00:17:11 +00:00
txa
lsr a
lsr a
lsr a
lsr a
tay
lda seltrack_track
jsr select_track
lsr current_track
2018-02-26 00:17:11 +00:00
rts
L083A: tax
and #$70
sta L0C23
txa
ldx L0C23
rol a
lda #$00
rol a
bne :+
lda SELECT,x ; Select drive 1 or 2
2018-02-26 00:17:11 +00:00
jmp L0853
: lda LCBANK1,x
L0853: lda ENABLE,x ; Turn drive on
2018-02-26 00:17:11 +00:00
lda #$D7
sta $DA
lda #$50
sta current_track
2018-02-26 00:17:11 +00:00
lda #$00
jsr L0823
L0864: lda $DA
beq L086E
jsr L0B3A
jmp L0864
L086E: lda #$01
sta $D3
lda #$AA
sta $D0
lda L0C20
clc
adc #$02
sta $D4
lda #$00
sta $D1
L0882: lda $D1
ldx L0C23
jsr L0823
ldx L0C23
2018-04-01 20:33:53 +00:00
lda TESTWP,x ; Check write protect???
lda WPRES,x
2018-02-26 00:17:11 +00:00
tay
2018-04-01 20:33:53 +00:00
lda RDMODE,x ; Activate read mode
lda XMIT,x
2018-02-26 00:17:11 +00:00
tya
2018-04-01 20:33:53 +00:00
bpl :+ ; WP mode?
exit_with_result 2 ; Yes
2018-02-26 00:17:11 +00:00
2018-04-01 20:33:53 +00:00
: jsr L0B63
2018-02-26 00:17:11 +00:00
bcc L08B5
lda #$01
ldy $D4
cpy L0C1F
bcs L08B2
2018-04-01 20:33:53 +00:00
lda #4
L08B2: jmp exit
2018-02-26 00:17:11 +00:00
L08B5: ldy $D4
cpy L0C1F
bcs L08C1
2018-04-01 20:33:53 +00:00
exit_with_result 4
2018-02-26 00:17:11 +00:00
L08C1: cpy L0C20
bcc L08CB
2018-04-01 20:33:53 +00:00
exit_with_result 3
2018-02-26 00:17:11 +00:00
L08CB: lda L0C22
sta L0C25
L08D1: dec L0C25
bne L08DB
2018-04-01 20:33:53 +00:00
exit_with_result 1
2018-02-26 00:17:11 +00:00
L08DB: ldx L0C23
jsr L096A
bcs L08D1
lda $D8
bne L08D1
ldx L0C23
jsr L0907
bcs L08D1
inc $D1
lda $D1
cmp #$23
bcc L0882
2018-04-01 20:33:53 +00:00
lda #0
;; fall through
.proc exit
pha
2018-02-26 00:17:11 +00:00
ldx L0C23
lda DISABLE,x ; Turn drive off
2018-04-01 20:33:53 +00:00
lda #0
2018-02-26 00:17:11 +00:00
jsr L0823
pla
rts
2018-04-01 20:33:53 +00:00
.endproc
2018-02-26 00:17:11 +00:00
;;; ============================================================
.proc L0907
ldy #$20
2018-02-26 00:17:11 +00:00
L0909: dey
beq return_with_carry_set
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
L0911: eor #$D5
bne L0909
nop
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$AA
bne L0911
ldy #$56
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$AD
bne L0911
2018-02-26 00:17:11 +00:00
lda #$00
L092C: dey
sty $D5
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$96
bne return_with_carry_set
2018-02-26 00:17:11 +00:00
ldy $D5
bne L092C
2018-02-26 00:17:11 +00:00
L093C: sty $D5
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$96
bne return_with_carry_set
2018-02-26 00:17:11 +00:00
ldy $D5
iny
bne L093C
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$96
bne return_with_carry_set
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$DE
bne return_with_carry_set
2018-02-26 00:17:11 +00:00
nop
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$AA
beq return_with_carry_clear
.endproc
return_with_carry_set:
sec
2018-02-26 00:17:11 +00:00
rts
.proc L096A
ldy #$FC
2018-02-26 00:17:11 +00:00
sty $DC
L096E: iny
bne :+
2018-02-26 00:17:11 +00:00
inc $DC
beq return_with_carry_set
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
L097A: cmp #$D5
bne L096E
nop
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$AA
bne L097A
ldy #$03
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$96
bne L097A
2018-02-26 00:17:11 +00:00
lda #$00
L0995: sta $DB
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
rol a
sta $DD
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
and $DD
sta $D7,y
eor $DB
dey
bpl L0995
2018-02-26 00:17:11 +00:00
tay
bne return_with_carry_set
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$DE
bne return_with_carry_set
2018-02-26 00:17:11 +00:00
nop
2018-04-01 20:33:53 +00:00
: lda XMIT,x
bpl :-
2018-02-26 00:17:11 +00:00
cmp #$AA
bne return_with_carry_set
.endproc
return_with_carry_clear:
clc
2018-02-26 00:17:11 +00:00
rts
;;; ============================================================
;;; Move head to track - A = track, X = slot * 16
.proc select_track
stx seltrack_slot
sta seltrack_track
cmp current_track
beq done
2018-02-26 00:17:11 +00:00
lda #$00
sta L0C38
L09D6: lda current_track
2018-02-26 00:17:11 +00:00
sta L0C39
sec
sbc seltrack_track
2018-02-26 00:17:11 +00:00
beq L0A19
bcs L09EB
eor #$FF
inc current_track
2018-02-26 00:17:11 +00:00
bcc L09F0
L09EB: adc #$FE
dec current_track
2018-02-26 00:17:11 +00:00
L09F0: cmp L0C38
bcc L09F8
lda L0C38
L09F8: cmp #$0C
bcs L09FD
tay
L09FD: sec
jsr L0A1D
2018-04-02 03:36:02 +00:00
lda phase_on_table,y
2018-02-26 00:17:11 +00:00
jsr L0B3A
lda L0C39
clc
jsr motor
2018-04-02 03:36:02 +00:00
lda phase_off_table,y
2018-02-26 00:17:11 +00:00
jsr L0B3A
inc L0C38
bne L09D6
L0A19: jsr L0B3A
clc
L0A1D: lda current_track
motor: and #$03 ; PHASE0 + 2 * phase
2018-02-26 00:17:11 +00:00
rol a
ora seltrack_slot
2018-02-26 00:17:11 +00:00
tax
lda PHASE0,x
ldx seltrack_slot
done: rts
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-04-02 03:36:02 +00:00
.proc format_sector
jsr rts2
2018-04-01 20:33:53 +00:00
lda TESTWP,x ; Check write protect ???
lda WPRES,x
2018-04-02 03:36:02 +00:00
lda #$FF ; Self-sync data
2018-04-01 20:33:53 +00:00
sta WRMODE,x ; Turn on write mode
cmp XMIT,x ; Start sending bits to disk
pha ; 32 cycles...
2018-02-26 00:17:11 +00:00
pla
nop
2018-04-02 03:36:02 +00:00
ldy #4
sync: pha
2018-02-26 00:17:11 +00:00
pla
jsr write2
2018-02-26 00:17:11 +00:00
dey
2018-04-02 03:36:02 +00:00
bne sync
;; Address marks
2018-02-26 00:17:11 +00:00
lda #$D5
jsr write
2018-02-26 00:17:11 +00:00
lda #$AA
jsr write
2018-02-26 00:17:11 +00:00
lda #$AD
jsr write
2018-02-26 00:17:11 +00:00
ldy #$56
nop
nop
nop
2018-04-02 03:36:02 +00:00
bne :+
;; Data
loop: jsr rts2
: nop
2018-02-26 00:17:11 +00:00
nop
lda #$96
2018-04-01 20:33:53 +00:00
sta DATA,x
cmp XMIT,x
2018-02-26 00:17:11 +00:00
dey
2018-04-02 03:36:02 +00:00
bne loop
;; Checksum
2018-02-26 00:17:11 +00:00
bit $00
nop
2018-04-02 03:36:02 +00:00
check: jsr rts2
2018-02-26 00:17:11 +00:00
lda #$96
2018-04-01 20:33:53 +00:00
sta DATA,x
cmp XMIT,x
2018-02-26 00:17:11 +00:00
lda #$96
nop
iny
2018-04-02 03:36:02 +00:00
bne check
;; Slip marks
jsr write
2018-02-26 00:17:11 +00:00
lda #$DE
jsr write
2018-02-26 00:17:11 +00:00
lda #$AA
jsr write
2018-02-26 00:17:11 +00:00
lda #$EB
jsr write
2018-02-26 00:17:11 +00:00
lda #$FF
jsr write
2018-04-01 20:33:53 +00:00
lda RDMODE,x ; Turn off write mode
lda XMIT,x
2018-02-26 00:17:11 +00:00
rts
2018-04-02 03:36:02 +00:00
;; Write with appropriate cycle counts
write: nop
write2: pha
2018-02-26 00:17:11 +00:00
pla
2018-04-01 20:33:53 +00:00
sta DATA,x
cmp XMIT,x
2018-02-26 00:17:11 +00:00
rts
2018-04-02 03:36:02 +00:00
.endproc
2018-02-26 00:17:11 +00:00
;;; ============================================================
2018-04-01 20:33:53 +00:00
.proc L0AAE
sec
lda TESTWP,x ; Check write protect
lda WPRES,x
2018-02-26 00:17:11 +00:00
bmi L0B15
lda #$FF
2018-04-01 20:33:53 +00:00
sta WRMODE,x ; Turn on write mode
cmp XMIT,x ; Start sending bits to disk
pha ; 32 cycles...
2018-02-26 00:17:11 +00:00
pla
2018-04-01 20:33:53 +00:00
loop: jsr rts1
jsr rts1
sta DATA,x
cmp XMIT,x
2018-02-26 00:17:11 +00:00
nop
dey
2018-04-01 20:33:53 +00:00
bne loop
2018-02-26 00:17:11 +00:00
lda #$D5
jsr L0B2D
lda #$AA
jsr L0B2D
lda #$96
jsr L0B2D
lda $D3
jsr L0B1C
lda $D1
jsr L0B1C
lda $D2
jsr L0B1C
lda $D3
eor $D1
eor $D2
pha
lsr a
ora $D0
2018-04-01 20:33:53 +00:00
sta DATA,x
lda XMIT,x
2018-02-26 00:17:11 +00:00
pla
ora #$AA
jsr L0B2C
lda #$DE
jsr L0B2D
lda #$AA
jsr L0B2D
lda #$EB
jsr L0B2D
clc
2018-04-01 20:33:53 +00:00
L0B15: lda RDMODE,x ; Turn off write mode
lda XMIT,x
rts1: rts
.endproc
2018-02-26 00:17:11 +00:00
;;; ============================================================
2018-02-26 00:17:11 +00:00
L0B1C: pha
lsr a
ora $D0
2018-04-01 20:33:53 +00:00
sta DATA,x
cmp XMIT,x
2018-02-26 00:17:11 +00:00
pla
nop
nop
nop
ora #$AA
L0B2C: nop
L0B2D: nop
pha
pla
2018-04-01 20:33:53 +00:00
sta DATA,x
cmp XMIT,x
2018-02-26 00:17:11 +00:00
rts
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
.byte 0
.proc L0B3A
start: ldx #$11
: dex
bne :-
2018-03-29 04:05:12 +00:00
inc16 $D9
sec
sbc #1
bne start
2018-02-26 00:17:11 +00:00
rts
.endproc
2018-04-02 03:36:02 +00:00
;;; Timing (100-usecs)
phase_on_table: .byte $01, $30, $28, $24, $20, $1E, $1D, $1C, $1C, $1C, $1C, $1C
phase_off_table: .byte $70, $2C, $26, $22, $1F, $1E, $1D, $1C, $1C, $1C, $1C, $1C
2018-02-26 00:17:11 +00:00
L0B63: lda L0C21
sta $D6
L0B68: ldy #$80
lda #$00
sta $D2
jmp L0B73
L0B71: ldy $D4
L0B73: ldx L0C23
jsr L0AAE
bcc L0B7E
2018-04-02 03:36:02 +00:00
jmp rts2
2018-02-26 00:17:11 +00:00
L0B7E: ldx L0C23
2018-04-02 03:36:02 +00:00
jsr format_sector
2018-04-01 20:33:53 +00:00
inc $D2
2018-02-26 00:17:11 +00:00
lda $D2
cmp #$10
bcc L0B71
ldy #$0F
sty $D2
lda L0C22
sta L0C25
L0B96: sta L0C26,y
dey
bpl L0B96
lda $D4
sec
sbc #$05
tay
2018-04-02 03:36:02 +00:00
L0BA2: jsr rts2
jsr rts2
2018-02-26 00:17:11 +00:00
pha
pla
nop
nop
dey
bne L0BA2
ldx L0C23
jsr L096A
bcs L0BF3
lda $D8
beq L0BCE
dec $D4
lda $D4
cmp L0C1F
bcs L0BF3
sec
rts
L0BC6: ldx L0C23
jsr L096A
bcs L0BE8
L0BCE: ldx L0C23
jsr L0907
bcs L0BE8
ldy $D8
lda L0C26,y
bmi L0BE8
lda #$FF
sta L0C26,y
dec $D2
bpl L0BC6
clc
rts
L0BE8: dec L0C25
bne L0BC6
dec $D6
bne L0BF3
sec
rts
L0BF3: lda L0C22
asl a
sta L0C25
L0BFA: ldx L0C23
jsr L096A
bcs L0C08
lda $D8
cmp #$0F
beq L0C0F
L0C08: dec L0C25
bne L0BFA
sec
2018-04-02 03:36:02 +00:00
rts2: rts
2018-02-26 00:17:11 +00:00
L0C0F: ldx #$D6
2018-04-02 03:36:02 +00:00
L0C11: jsr rts2
jsr rts2
2018-02-26 00:17:11 +00:00
bit $00
dex
bne L0C11
jmp L0B68
L0C1F: .byte $0E
L0C20: .byte $1B
L0C21: .byte $03
L0C22: .byte $10
2018-03-29 04:05:12 +00:00
L0C23: .byte 0
current_track:
.byte 0
2018-03-29 04:05:12 +00:00
L0C25: .byte 0
L0C26: .byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
seltrack_track:
.byte 0
seltrack_slot:
.byte 0
2018-03-29 04:05:12 +00:00
L0C38: .byte 0
L0C39: .byte 0
2018-03-31 23:50:58 +00:00
;;; ============================================================
DEFINE_QUIT_PARAMS quit_params
DEFINE_ON_LINE_PARAMS on_line_params2,, $1300
DEFINE_ON_LINE_PARAMS on_line_params,, on_line_buffer
on_line_buffer:
.res 16, 0
DEFINE_READ_BLOCK_PARAMS block_params, $1C00, 0
;;; ============================================================
.proc MLI_RELAY
sty call
stax params
2018-02-26 00:17:11 +00:00
sta ALTZPOFF
2018-03-31 02:34:44 +00:00
lda ROMIN2
2018-02-26 00:17:11 +00:00
jsr MLI
2018-03-31 23:50:58 +00:00
call: .byte 0
params: .addr 0
2018-02-26 00:17:11 +00:00
tax
sta ALTZPON
lda LCBANK1
lda LCBANK1
txa
rts
2018-03-31 23:50:58 +00:00
.endproc
;;; ============================================================
2018-02-26 00:17:11 +00:00
2018-11-23 22:33:37 +00:00
.proc noop
2018-02-26 00:17:11 +00:00
rts
2018-11-23 22:33:37 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
;;; ============================================================
2018-11-22 05:00:49 +00:00
;;; Quit back to ProDOS (which will launch DeskTop)
2018-03-31 23:50:58 +00:00
2018-11-22 05:00:49 +00:00
.proc quit
2018-11-22 22:12:31 +00:00
jsr disk_copy_overlay3::restore_ram_disk
2018-02-26 00:17:11 +00:00
sta ALTZPOFF
2018-03-31 02:34:44 +00:00
lda ROMIN2
2018-03-31 23:50:58 +00:00
sta DHIRESOFF
sta TXTCLR
sta CLR80VID
sta SETALTCHAR
sta CLR80COL
2018-02-26 00:17:11 +00:00
jsr SETVID
jsr SETKBD
jsr INIT
jsr HOME
2018-03-31 23:50:58 +00:00
MLI_CALL QUIT, quit_params
2018-02-26 00:17:11 +00:00
rts
2018-11-22 05:00:49 +00:00
.endproc
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
;;; ============================================================
2018-11-23 00:20:54 +00:00
ldx disk_copy_overlay3::dest_drive_index
lda disk_copy_overlay3::drive_unitnum_table,x
2018-12-06 03:35:04 +00:00
sta unit_number
2018-02-26 00:17:11 +00:00
and #$0F
beq L0CCC
2018-11-23 00:20:54 +00:00
lda disk_copy_overlay3::drive_unitnum_table,x
2018-12-06 03:35:04 +00:00
jsr unit_number_to_driver_address
ldy #$FF ; offset to low byte of driver address
2018-11-20 07:21:36 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
beq L0CCC
cmp #$FF
bne L0CD3
2018-12-06 03:35:04 +00:00
L0CCC: lda unit_number
2018-02-26 00:17:11 +00:00
jsr L0800
rts
2018-12-06 03:35:04 +00:00
L0CD3: lda unit_number
jsr unit_number_to_driver_address
ldy #$FF ; offset to low byte of driver address
2018-11-20 07:21:36 +00:00
lda ($06),y
sta $06
2018-12-06 03:35:04 +00:00
lda #DRIVER_COMMAND_FORMAT
sta DRIVER_COMMAND
lda unit_number
sta DRIVER_UNIT_NUMBER
2018-11-20 07:21:36 +00:00
jmp ($06)
2018-02-26 00:17:11 +00:00
rts
2018-12-06 03:35:04 +00:00
unit_number:
.byte 0
2018-03-31 23:50:58 +00:00
;;; ============================================================
2018-04-02 03:36:02 +00:00
;;; Eject Disk via SmartPort
2018-03-31 23:50:58 +00:00
2018-04-02 03:36:02 +00:00
.proc eject_disk
2018-02-26 00:17:11 +00:00
sta L0D24
2018-12-06 03:35:04 +00:00
jsr unit_number_to_driver_address ; Point $06 at $Cn00
2018-04-02 03:36:02 +00:00
ldy #$07 ; Check firmware bytes
2018-11-20 07:21:36 +00:00
lda ($06),y ; $Cn07 = $00 ??
2018-04-02 03:36:02 +00:00
bne done
2018-02-26 00:17:11 +00:00
ldy #$FB
2018-11-20 07:21:36 +00:00
lda ($06),y ; $CnFB = $7F ??
2018-02-26 00:17:11 +00:00
and #$7F
2018-04-02 03:36:02 +00:00
bne done
2018-02-26 00:17:11 +00:00
ldy #$FF
2018-11-20 07:21:36 +00:00
lda ($06),y
2018-02-26 00:17:11 +00:00
clc
2018-04-02 03:36:02 +00:00
adc #3 ; Locate dispatch routine (offset $CnFF + 3)
2018-11-20 07:21:36 +00:00
sta $06
2018-04-02 03:36:02 +00:00
2018-02-26 00:17:11 +00:00
lda L0D24
jsr L0D51
2018-04-02 03:36:02 +00:00
sta control_params_unit_number
2018-02-26 00:17:11 +00:00
2018-04-02 03:36:02 +00:00
;; Do SmartPort call
jsr smartport_call
.byte $04 ; SmartPort: CONTROL
.addr $0D1D
2018-02-26 00:17:11 +00:00
2018-04-02 03:36:02 +00:00
done: rts
smartport_call:
2018-11-20 07:21:36 +00:00
jmp ($06)
2018-04-02 03:36:02 +00:00
.proc control_params
param_count: .byte 3
unit_number: .byte 0
control_list: .addr L0D22
control_code: .byte $04 ; Control Code: Eject disk
.endproc
control_params_unit_number := control_params::unit_number
L0D22: .byte 0, 0
2018-03-29 04:05:12 +00:00
L0D24: .byte 0
.byte 0
2018-04-02 03:36:02 +00:00
.endproc
;;; ============================================================
2018-12-06 03:35:04 +00:00
;;; Get driver address for unit number
;;; Input: unit_number in A
;;; Output: $6/$7 points at driver address
.proc unit_number_to_driver_address
sta unit_number
ldx #$11 ; $BF11 is DEVADR+1 for S0D1
lda unit_number
and #$80 ; high bit set?
beq :+
ldx #$21 ; $BF21 is DEVADR+1 for S0D2
: stx @load_addr
lda unit_number
and #$70 ; mask off slot
2018-02-26 00:17:11 +00:00
lsr a
lsr a
lsr a
clc
adc @load_addr
sta @load_addr
2018-04-02 03:36:02 +00:00
@load_addr := *+1
2018-11-22 05:00:49 +00:00
lda MLI ; self-modified
2018-12-06 03:35:04 +00:00
sta $06+1
2018-02-26 00:17:11 +00:00
lda #$00
2018-11-20 07:21:36 +00:00
sta $06
2018-02-26 00:17:11 +00:00
rts
2018-12-06 03:35:04 +00:00
unit_number:
.byte 0
.endproc
2018-04-02 03:36:02 +00:00
;;; ============================================================
2018-02-26 00:17:11 +00:00
L0D51: pha
rol a
pla
php
and #$20
lsr a
lsr a
lsr a
lsr a
plp
adc #$01
rts
2018-04-02 03:36:02 +00:00
;;; ============================================================
2018-11-23 00:20:54 +00:00
L0D5F: ldx disk_copy_overlay3::source_drive_index
lda disk_copy_overlay3::drive_unitnum_table,x
2018-03-31 23:50:58 +00:00
sta block_params::unit_num
2018-02-26 00:17:11 +00:00
lda #$00
2018-03-31 23:50:58 +00:00
sta block_params::block_num
sta block_params::block_num+1
2018-02-26 00:17:11 +00:00
jsr L12AF
bne L0D8A
2018-11-22 05:00:49 +00:00
lda $1C00+1
2018-02-26 00:17:11 +00:00
cmp #$E0
beq L0D7F
jmp L0DA4
L0D7F: lda $1C02
cmp #$70
beq L0D90
cmp #$60
beq L0D90
L0D8A: lda #$81
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD44D
2018-02-26 00:17:11 +00:00
rts
2018-11-20 07:21:36 +00:00
L0D90: addr_call disk_copy_overlay3::LDE9F, $1300
addr_call disk_copy_overlay3::adjust_case, $1300
2018-02-26 00:17:11 +00:00
lda #$C0
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD44D
2018-02-26 00:17:11 +00:00
rts
L0DA4: cmp #$A5
bne L0D8A
lda $1C02
cmp #$27
bne L0D8A
lda #$80
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD44D
2018-02-26 00:17:11 +00:00
rts
2018-04-02 03:36:02 +00:00
;;; ============================================================
L0DB5: lda #$14
2018-02-26 00:17:11 +00:00
jsr L1133
2018-11-23 00:20:54 +00:00
lda disk_copy_overlay3::source_drive_index
2018-02-26 00:17:11 +00:00
asl a
tax
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay3::LD407,x
2018-02-26 00:17:11 +00:00
sta L0EB0
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay3::LD407+1,x
2018-02-26 00:17:11 +00:00
sta L0EB1
2018-03-29 04:05:12 +00:00
lsr16 L0EB0
lsr16 L0EB0
lsr16 L0EB0
2018-11-22 05:00:49 +00:00
copy16 L0EB0, disk_copy_overlay3::LD427
bit disk_copy_overlay3::LD44D
2018-02-26 00:17:11 +00:00
bmi L0DF6
2018-11-22 22:12:31 +00:00
lda disk_copy_overlay3::quick_copy_flag
2018-02-26 00:17:11 +00:00
bne L0DF6
jmp L0E4D
L0DF6: lda #$FF
clc
2018-11-22 05:00:49 +00:00
adc disk_copy_overlay3::LD427
2018-11-20 07:21:36 +00:00
sta $06
2018-02-26 00:17:11 +00:00
lda #$13
2018-11-22 05:00:49 +00:00
adc disk_copy_overlay3::LD427+1
2018-02-26 00:17:11 +00:00
sta $07
ldy #$00
L0E07: lda #$00
2018-11-20 07:21:36 +00:00
sta ($06),y
dec $06
lda $06
2018-02-26 00:17:11 +00:00
cmp #$FF
bne L0E15
dec $07
L0E15: lda $07
cmp #$14
bne L0E07
2018-11-20 07:21:36 +00:00
lda $06
2018-02-26 00:17:11 +00:00
cmp #$00
bne L0E07
lda #$00
2018-11-20 07:21:36 +00:00
sta ($06),y
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay3::LD427+1
2018-02-26 00:17:11 +00:00
cmp #$02
bcs L0E2D
rts
L0E2D: lda #$14
2018-11-20 07:21:36 +00:00
sta $06
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay3::LD427+1
2018-02-26 00:17:11 +00:00
pha
2018-11-20 07:21:36 +00:00
L0E35: inc $06
inc $06
2018-02-26 00:17:11 +00:00
pla
sec
sbc #$02
pha
bmi L0E46
jsr L0E47
jmp L0E35
L0E46: pla
2018-11-20 07:21:36 +00:00
L0E47: lda $06
2018-02-26 00:17:11 +00:00
jsr L1133
rts
2018-11-22 05:00:49 +00:00
L0E4D: copy16 #6, block_params::block_num
2018-11-23 00:20:54 +00:00
ldx disk_copy_overlay3::source_drive_index
lda disk_copy_overlay3::drive_unitnum_table,x
2018-03-31 23:50:58 +00:00
sta block_params::unit_num
copy16 #$1400, block_params::data_buffer
2018-02-26 00:17:11 +00:00
jsr L12AF
beq L0E70
2018-03-29 04:05:12 +00:00
.byte 0
2018-02-26 00:17:11 +00:00
L0E70: lda L0EB0
sec
sbc #$00
sta L0EB0
lda L0EB1
sbc #$02
sta L0EB1
lda L0EB1
bpl L0E87
rts
L0E87: lda L0EB0
bne L0E8D
rts
2018-03-31 23:50:58 +00:00
L0E8D: add16 block_params::data_buffer, #$0200, block_params::data_buffer
inc block_params::block_num
lda block_params::data_buffer+1
2018-02-26 00:17:11 +00:00
jsr L1133
jsr L12AF
beq L0EAD
2018-03-29 04:05:12 +00:00
.byte 0
2018-02-26 00:17:11 +00:00
L0EAD: jmp L0E70
2018-03-29 04:05:12 +00:00
L0EB0: .byte 0
L0EB1: .byte 0
2018-04-02 03:36:02 +00:00
;;; ============================================================
L0EB2: and #$F0
2018-02-26 00:17:11 +00:00
sta L0ED6
2018-03-31 23:50:58 +00:00
ldx DEVCNT
L0EBA: lda DEVLST,x
2018-02-26 00:17:11 +00:00
and #$F0
cmp L0ED6
beq L0ECA
dex
bpl L0EBA
2018-03-29 04:05:12 +00:00
L0EC7: return #$00
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
L0ECA: lda DEVLST,x
2018-02-26 00:17:11 +00:00
and #$0F
cmp #$0B
bne L0EC7
2018-03-29 04:05:12 +00:00
return #$80
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
L0ED6: .byte 0
2018-04-02 03:36:02 +00:00
;;; ============================================================
2018-11-22 05:00:49 +00:00
L0ED7: bit KBDSTRB
2018-02-26 00:17:11 +00:00
sta L0FE6
and #$FF
bpl L0EFF
2018-11-22 05:00:49 +00:00
copy16 disk_copy_overlay3::LD424, disk_copy_overlay3::LD421
lda disk_copy_overlay3::LD426
sta disk_copy_overlay3::LD423
2018-11-23 00:20:54 +00:00
ldx disk_copy_overlay3::dest_drive_index
lda disk_copy_overlay3::drive_unitnum_table,x
2018-03-31 23:50:58 +00:00
sta block_params::unit_num
2018-02-26 00:17:11 +00:00
jmp L0F1A
2018-11-22 05:00:49 +00:00
L0EFF: copy16 disk_copy_overlay3::LD421, disk_copy_overlay3::LD424
lda disk_copy_overlay3::LD423
sta disk_copy_overlay3::LD426
2018-11-23 00:20:54 +00:00
ldx disk_copy_overlay3::source_drive_index
lda disk_copy_overlay3::drive_unitnum_table,x
2018-03-31 23:50:58 +00:00
sta block_params::unit_num
2018-02-26 00:17:11 +00:00
L0F1A: lda #$07
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD420
2018-02-26 00:17:11 +00:00
lda #$00
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD41F
2018-02-26 00:17:11 +00:00
sta L0FE4
sta L0FE5
2018-11-22 05:00:49 +00:00
L0F2A: lda KBD
cmp #(CHAR_ESCAPE | $80)
2018-02-26 00:17:11 +00:00
bne L0F37
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6AB
2018-02-26 00:17:11 +00:00
jmp L0F6F
L0F37: bit L0FE4
bmi L0F6C
bit L0FE5
bmi L0F69
jsr L107F
bcc L0F51
bne L0F4C
cpx #$00
beq L0F6C
L0F4C: ldy #$80
sty L0FE4
2018-03-29 04:05:12 +00:00
L0F51: stax L0FE7
2018-02-26 00:17:11 +00:00
jsr L0FE9
bcc L0F72
bne L0F62
cpx #$00
beq L0F69
L0F62: ldy #$80
sty L0FE5
bne L0F72
2018-03-29 04:05:12 +00:00
L0F69: return #$80
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
L0F6C: return #$00
2018-02-26 00:17:11 +00:00
2018-03-29 04:05:12 +00:00
L0F6F: return #$01
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
L0F72: stax block_params::block_num
2018-02-26 00:17:11 +00:00
ldx L0FE8
lda L0FE7
2018-11-22 05:00:49 +00:00
ldy disk_copy_overlay3::LD41F
2018-02-26 00:17:11 +00:00
cpy #$10
bcs L0F9A
bit L0FE6
bmi L0F92
jsr L1160
bmi L0F6F
jmp L0F2A
L0F92: jsr L11F7
bmi L0F6F
jmp L0F2A
L0F9A: cpy #$1D
bcc L0FB7
cpy #$20
bcs L0FCC
bit L0FE6
bmi L0FAF
jsr L1175
bmi L0F6F
jmp L0F2A
L0FAF: jsr L120C
bmi L0F6F
jmp L0F2A
L0FB7: bit L0FE6
bmi L0FC4
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE766
2018-02-26 00:17:11 +00:00
bmi L0F6F
jmp L0F2A
2018-11-20 07:21:36 +00:00
L0FC4: jsr disk_copy_overlay3::LE7A8
2018-02-26 00:17:11 +00:00
bmi L0F6F
jmp L0F2A
L0FCC: bit L0FE6
bmi L0FD9
jsr L11AD
bmi L0F6F
jmp L0F2A
L0FD9: jsr L123F
bmi L0FE1
jmp L0F2A
L0FE1: jmp L0F6F
2018-03-29 04:05:12 +00:00
L0FE4: .byte 0
L0FE5: .byte 0
L0FE6: .byte 0
L0FE7: .byte 0
L0FE8: .byte 0
2018-02-26 00:17:11 +00:00
L0FE9: jsr L102A
cpy #$00
bne L0FF6
pha
jsr L0FFF
pla
rts
L0FF6: jsr L0FFF
bcc L0FE9
lda #$00
tax
rts
2018-11-22 05:00:49 +00:00
L0FFF: dec disk_copy_overlay3::LD423
lda disk_copy_overlay3::LD423
2018-02-26 00:17:11 +00:00
cmp #$FF
beq L100B
L1009: clc
rts
L100B: lda #$07
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD423
inc16 disk_copy_overlay3::LD421
2018-11-23 22:33:37 +00:00
lda disk_copy_overlay3::LD421+1
2018-11-22 05:00:49 +00:00
cmp disk_copy_overlay3::LD427+1
2018-02-26 00:17:11 +00:00
bne L1009
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay3::LD421
cmp disk_copy_overlay3::LD427
2018-02-26 00:17:11 +00:00
bne L1009
sec
rts
L102A: lda #$00
clc
2018-11-22 05:00:49 +00:00
adc disk_copy_overlay3::LD421
2018-11-20 07:21:36 +00:00
sta $06
2018-02-26 00:17:11 +00:00
lda #$14
2018-11-22 05:00:49 +00:00
adc disk_copy_overlay3::LD421+1
2018-02-26 00:17:11 +00:00
sta $07
ldy #$00
2018-11-20 07:21:36 +00:00
lda ($06),y
2018-11-22 05:00:49 +00:00
ldx disk_copy_overlay3::LD423
2018-02-26 00:17:11 +00:00
cpx #$00
beq L1048
L1044: lsr a
dex
bne L1044
L1048: and #$01
bne L104F
tay
beq L1051
L104F: ldy #$FF
2018-11-22 05:00:49 +00:00
L1051: lda disk_copy_overlay3::LD421+1
2018-02-26 00:17:11 +00:00
sta L1076
2018-11-22 05:00:49 +00:00
lda disk_copy_overlay3::LD421
2018-02-26 00:17:11 +00:00
asl a
rol L1076
asl a
rol L1076
asl a
rol L1076
2018-11-22 05:00:49 +00:00
ldx disk_copy_overlay3::LD423
2018-02-26 00:17:11 +00:00
clc
adc L1077,x
pha
lda L1076
adc #$00
tax
pla
rts
2018-03-29 04:05:12 +00:00
L1076: .byte 0
2018-02-26 00:17:11 +00:00
L1077: .byte $07
asl $05
.byte $04
.byte $03
.byte $02
ora ($00,x)
L107F: jsr L10B2
cpy #$00
beq L108C
pha
jsr L1095
pla
rts
L108C: jsr L1095
bcc L107F
lda #$00
tax
rts
2018-11-22 05:00:49 +00:00
L1095: dec disk_copy_overlay3::LD420
lda disk_copy_overlay3::LD420
2018-02-26 00:17:11 +00:00
cmp #$FF
beq L10A1
L109F: clc
rts
L10A1: lda #$07
2018-11-22 05:00:49 +00:00
sta disk_copy_overlay3::LD420
inc disk_copy_overlay3::LD41F
lda disk_copy_overlay3::LD41F
2018-02-26 00:17:11 +00:00
cmp #$21
bcc L109F
sec
rts
2018-11-22 05:00:49 +00:00
L10B2: ldx disk_copy_overlay3::LD41F
2018-02-26 00:17:11 +00:00
lda L12B9,x
2018-11-22 05:00:49 +00:00
ldx disk_copy_overlay3::LD420
2018-02-26 00:17:11 +00:00
cpx #$00
beq L10C3
L10BF: lsr a
dex
bne L10BF
L10C3: and #$01
bne L10CB
ldy #$00
beq L10CD
L10CB: ldy #$FF
2018-11-22 05:00:49 +00:00
L10CD: lda disk_copy_overlay3::LD41F
2018-02-26 00:17:11 +00:00
cmp #$10
bcs L10E3
L10D4: asl a
asl a
asl a
asl a
2018-11-22 05:00:49 +00:00
ldx disk_copy_overlay3::LD420
2018-02-26 00:17:11 +00:00
clc
adc L10F3,x
tax
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
L10E3: cmp #$20
bcs L10ED
sec
sbc #$10
jmp L10D4
L10ED: sec
sbc #$13
jmp L10D4
L10F3:
.byte $0E, $0C, $0A, $08, $06, $04, $02, $00
2018-04-02 03:36:02 +00:00
;;; ============================================================
L10FB: lda #$14
2018-11-20 07:21:36 +00:00
sta $06
2018-02-26 00:17:11 +00:00
lda #$00
sta L111E
2018-11-20 07:21:36 +00:00
L1104: lda $06
2018-02-26 00:17:11 +00:00
jsr L111F
2018-11-20 07:21:36 +00:00
inc $06
inc $06
2018-02-26 00:17:11 +00:00
inc L111E
inc L111E
lda L111E
2018-11-22 05:00:49 +00:00
cmp disk_copy_overlay3::LD427+1
2018-02-26 00:17:11 +00:00
beq L1104
bcc L1104
rts
2018-03-29 04:05:12 +00:00
L111E: .byte 0
2018-02-26 00:17:11 +00:00
L111F: jsr L1149
tay
sec
cpx #$00
beq L112C
L1128: asl a
dex
bne L1128
L112C: ora L12B9,y
sta L12B9,y
rts
L1133: jsr L1149
tay
sec
cpx #$00
beq L1140
L113C: asl a
dex
bne L113C
L1140: eor #$FF
and L12B9,y
sta L12B9,y
rts
L1149: pha
and #$0F
lsr a
tax
lda L1158,x
tax
pla
lsr a
lsr a
lsr a
lsr a
rts
L1158: .byte $07
asl $05
.byte $04
.byte $03
.byte $02
ora ($00,x)
2018-03-31 23:50:58 +00:00
L1160: stax block_params::data_buffer
2018-02-26 00:17:11 +00:00
L1166: jsr L12AF
beq L1174
ldx #$00
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6FD
2018-02-26 00:17:11 +00:00
bmi L1174
bne L1166
L1174: rts
2018-11-20 07:21:36 +00:00
L1175: sta $06
2018-02-26 00:17:11 +00:00
sta $08
stx $07
stx $09
inc $09
2018-03-31 23:50:58 +00:00
copy16 #$1C00, block_params::data_buffer
2018-02-26 00:17:11 +00:00
L1189: jsr L12AF
beq L119A
ldx #$00
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6FD
2018-02-26 00:17:11 +00:00
beq L119A
bpl L1189
2018-03-29 04:05:12 +00:00
return #$80
2018-02-26 00:17:11 +00:00
L119A: ldy #$FF
iny
L119D: lda $1C00,y
2018-11-20 07:21:36 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
lda $1D00,y
sta ($08),y
iny
bne L119D
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
2018-11-20 07:21:36 +00:00
L11AD: sta $06
2018-02-26 00:17:11 +00:00
sta $08
stx $07
stx $09
inc $09
2018-03-31 23:50:58 +00:00
copy16 #$1C00, block_params::data_buffer
2018-02-26 00:17:11 +00:00
L11C1: jsr L12AF
beq L11D8
ldx #$00
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6FD
2018-02-26 00:17:11 +00:00
beq L11D8
bpl L11C1
lda LCBANK1
lda LCBANK1
2018-03-29 04:05:12 +00:00
return #$80
2018-02-26 00:17:11 +00:00
L11D8: lda LCBANK2
lda LCBANK2
2018-02-26 00:17:11 +00:00
ldy #$FF
iny
L11E1: lda $1C00,y
2018-11-20 07:21:36 +00:00
sta ($06),y
2018-02-26 00:17:11 +00:00
lda $1D00,y
sta ($08),y
iny
bne L11E1
lda LCBANK1
lda LCBANK1
2018-03-29 04:05:12 +00:00
return #$00
2018-02-26 00:17:11 +00:00
2018-03-31 23:50:58 +00:00
L11F7: stax block_params::data_buffer
2018-02-26 00:17:11 +00:00
L11FD: jsr L12A5
beq L120B
ldx #$80
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6FD
2018-02-26 00:17:11 +00:00
beq L120B
bpl L11FD
L120B: rts
2018-11-20 07:21:36 +00:00
L120C: sta $06
2018-02-26 00:17:11 +00:00
sta $08
stx $07
stx $09
inc $09
2018-03-31 23:50:58 +00:00
copy16 #$1C00, block_params::data_buffer
2018-02-26 00:17:11 +00:00
ldy #$FF
iny
2018-11-20 07:21:36 +00:00
L1223: lda ($06),y
2018-02-26 00:17:11 +00:00
sta $1C00,y
lda ($08),y
sta $1D00,y
iny
bne L1223
L1230: jsr L12A5
beq L123E
ldx #$80
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6FD
2018-02-26 00:17:11 +00:00
beq L123E
bpl L1230
L123E: rts
L123F: bit LCBANK2
bit LCBANK2
2018-11-20 07:21:36 +00:00
sta $06
2018-02-26 00:17:11 +00:00
sta $08
stx $07
stx $09
inc $09
2018-03-31 23:50:58 +00:00
copy16 #$1C00, block_params::data_buffer
2018-02-26 00:17:11 +00:00
ldy #$FF
iny
2018-11-20 07:21:36 +00:00
L125C: lda ($06),y
2018-02-26 00:17:11 +00:00
sta $1C00,y
lda ($08),y
sta $1D00,y
iny
bne L125C
lda LCBANK1
lda LCBANK1
L126F: jsr L12A5
beq L127D
ldx #$80
2018-11-20 07:21:36 +00:00
jsr disk_copy_overlay3::LE6FD
2018-02-26 00:17:11 +00:00
beq L127D
bpl L126F
L127D: rts
2018-04-02 03:36:02 +00:00
;;; ============================================================
L127E: sta ALTZPOFF
2018-03-31 02:34:44 +00:00
sta ROMIN2
2018-02-26 00:17:11 +00:00
jsr BELL1
sta ALTZPON
lda LCBANK1
lda LCBANK1
rts
2018-04-02 03:36:02 +00:00
L1291: yax_call MLI_RELAY, ON_LINE, on_line_params2
2018-02-26 00:17:11 +00:00
rts
2018-04-02 03:36:02 +00:00
L129B: yax_call MLI_RELAY, ON_LINE, on_line_params
2018-02-26 00:17:11 +00:00
rts
2018-03-31 23:50:58 +00:00
L12A5: yax_call MLI_RELAY, WRITE_BLOCK, block_params
2018-02-26 00:17:11 +00:00
rts
2018-03-31 23:50:58 +00:00
L12AF: yax_call MLI_RELAY, READ_BLOCK, block_params
2018-02-26 00:17:11 +00:00
rts
2018-04-02 03:36:02 +00:00
;;; ============================================================
2018-03-29 04:05:12 +00:00
L12B9: .byte 0
2018-02-26 00:17:11 +00:00
.byte $3C
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
.byte $FF
.byte $FF
.byte $FF
.byte $FF
.byte $FF
.byte $FF
.byte $FF
2018-04-01 20:33:53 +00:00
.byte $FE
.byte 0
.byte 0
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
.byte $0F
.byte $FF
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
.byte $FF
.byte $FF
.byte $FF
2018-03-29 04:05:12 +00:00
.byte 0
.byte 0
.byte 0
2018-02-26 00:17:11 +00:00
.byte $7F
.byte $FF
2018-04-01 20:33:53 +00:00
;;; ============================================================
2018-11-21 08:13:30 +00:00
PAD_TO $1300
2018-02-26 00:17:11 +00:00
.assert * = $1300, error, "Segment length mismatch"
2018-11-20 07:21:36 +00:00
.endproc