1
0
mirror of https://github.com/a2stuff/prodos-drivers.git synced 2024-12-29 06:30:06 +00:00
prodos-drivers/selectors/bye.system.s

664 lines
17 KiB
ArmAsm
Raw Permalink Normal View History

;;; Disassembly of the ProDOS 8 Selector ("BYE") found in ProDOS 1.9
;;; and 2.0.x and installed automatically for 80-column systems.
;;;
;;; Installer wrapper added by Joshua Bell inexorabletash@gmail.com
2017-11-12 04:44:15 +00:00
.setcpu "65C02"
.linecont +
.feature string_escapes
2017-12-09 17:03:44 +00:00
.include "apple2.inc"
2019-10-05 01:10:01 +00:00
.include "apple2.mac"
2017-11-12 04:44:15 +00:00
2019-10-05 01:10:01 +00:00
.include "../inc/apple2.inc"
.include "../inc/macros.inc"
2019-10-05 01:10:01 +00:00
.include "../inc/prodos.inc"
.include "../inc/ascii.inc"
2017-12-09 17:03:44 +00:00
;;; ************************************************************
.include "../inc/driver_preamble.inc"
;;; ************************************************************
2017-12-09 22:11:29 +00:00
;;; ------------------------------------------------------------
;;; ProDOS Technical Reference Manual, 5.1.5.2:
;;;
;;; ProDOS MLI call $65, the QUIT call, moves addresses $D100 through
;;; $D3FF from the second 4K bank of RAM of the language card to
;;; $1000, and executes a JMP to $1000. What initially resides in that
;;; area is Apple's dispatcher code.
2017-12-09 21:00:27 +00:00
;;; ------------------------------------------------------------
;;; Installer
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
max_size = $300
2017-11-13 15:57:57 +00:00
.proc maybe_install_driver
src := install_src
end := install_src + install_size
dst := $D100 ; Install location in ProDOS (bank 2)
src_ptr := $19
dst_ptr := $1B
sta ALTZPOFF
lda ROMIN
lda ROMIN
lda #>src
sta src_ptr+1
lda #<src
sta src_ptr
lda #>dst
sta dst_ptr+1
lda #<dst
sta dst_ptr
loop: lda (src_ptr)
sta (dst_ptr)
inc src_ptr
bne :+
inc src_ptr+1
: inc dst_ptr
bne :+
inc dst_ptr+1
: lda src_ptr+1
cmp #>end
bne loop
lda src_ptr
cmp #<end
bne loop
lda (src_ptr)
sta (dst_ptr)
sta ALTZPOFF
sta ROMINWB1
sta ROMINWB1
rts
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 21:00:27 +00:00
;;; ------------------------------------------------------------
;;; Selector
;;; ------------------------------------------------------------
install_src := *
pushorg $1000
2017-11-12 04:44:15 +00:00
.proc bbb
2017-11-13 15:57:57 +00:00
2017-12-09 21:00:27 +00:00
prefix := $280 ; length-prefixed
filenames := $1400 ; each is length + 15 bytes
read_buffer := $2000 ; Also, start location for launched SYS files
2017-11-13 15:57:57 +00:00
2017-12-09 22:11:29 +00:00
mark_params := $60
mark_ref_num := $61
mark_position := $62 ; 3-bytes
2017-12-09 22:28:54 +00:00
next_device_num := $65 ; next device number to try
2017-12-09 22:11:29 +00:00
2017-12-09 21:00:27 +00:00
current_entry := $67 ; index of current entry
num_entries := $68 ; length of |filenames|
curr_len := $69 ; length of current entry name
curr_ptr := $6C ; address of current entry name (in |filenames|)
2017-12-09 17:29:35 +00:00
2017-12-09 22:28:54 +00:00
prefix_depth := $6B ; 0 = root
2017-12-10 00:06:31 +00:00
entry_length := $6E
entries_per_block := $6F
file_count := $70 ; 2 bytes
2017-12-10 00:17:29 +00:00
entry_num := $72
2017-12-11 04:22:34 +00:00
page_start := $73 ; index of first entry shown on screen
2017-12-10 00:17:29 +00:00
2017-12-09 22:11:29 +00:00
max_entries := 128 ; max # of entries; more are ignored
types_table := $74 ; high bit clear = dir, set = sys
2017-12-09 21:00:27 +00:00
top_row := 2 ; first row used on screen
bottom_row := 21 ; last row used on screen
;;; ------------------------------------------------------------
cld ; ProDOS protocol for QUIT routine
2019-10-05 01:10:01 +00:00
lda ROMIN2 ; Page in ROM for reads, writes ignored
2017-12-09 21:00:27 +00:00
;; Point reset vector at this routine
stz RESETVEC
lda #>bbb
sta RESETVEC+1
2017-12-11 04:22:34 +00:00
jsr SETPWRC ; update validity check byte
2017-12-09 17:03:44 +00:00
2017-11-12 04:44:15 +00:00
lda #$A0
2017-12-09 22:49:16 +00:00
jsr SLOT3 ; Activate 80-Column Firmware
2017-12-09 21:00:27 +00:00
;; Update system bitmap
ldx #BITMAP_SIZE-1 ; zero it all out
2017-12-09 22:11:29 +00:00
: stz BITMAP,x
2017-11-12 04:44:15 +00:00
dex
2017-12-09 21:00:27 +00:00
bpl :-
2017-12-09 22:11:29 +00:00
inc BITMAP+BITMAP_SIZE-1 ; protect ProDOS global page
lda #%11001111 ; protect zp, stack, text page 1
sta BITMAP
;; Find device
lda #2
2017-12-11 04:22:34 +00:00
sta mark_params
2017-12-09 22:11:29 +00:00
ldx DEVCNT ; max device num
2017-12-09 22:28:54 +00:00
stx next_device_num
2017-12-09 22:11:29 +00:00
lda DEVNUM
2017-12-09 22:28:54 +00:00
bne check_device
2017-12-09 22:11:29 +00:00
2017-12-09 22:28:54 +00:00
next_device:
ldx next_device_num
2017-12-09 22:11:29 +00:00
lda DEVLST,x
cpx #1
bcs :+
ldx DEVCNT
2017-11-12 04:44:15 +00:00
inx
2017-12-09 22:11:29 +00:00
: dex
2017-12-09 22:28:54 +00:00
stx next_device_num
2017-12-09 22:11:29 +00:00
2017-12-09 22:28:54 +00:00
check_device:
sta on_line_params_unit
2017-11-12 04:44:15 +00:00
MLI_CALL ON_LINE, on_line_params
2017-12-09 22:28:54 +00:00
bcs next_device
2017-12-09 22:11:29 +00:00
2017-12-09 22:28:54 +00:00
stz prefix_depth
2017-11-13 15:57:57 +00:00
lda prefix+1
2017-11-12 04:44:15 +00:00
and #$0F
2017-12-09 22:28:54 +00:00
beq next_device
2017-12-09 22:49:16 +00:00
adc #2
2017-11-12 04:44:15 +00:00
tax
2017-11-13 15:57:57 +00:00
2017-12-09 22:28:54 +00:00
;; Resize prefix to length x and open the directory for reading
2017-12-09 22:49:16 +00:00
.proc resize_prefix_and_open
2017-12-09 22:28:54 +00:00
stx prefix
2017-11-13 15:57:57 +00:00
lda #'/'
sta prefix+1
sta prefix,x
stz prefix+1,x
2017-11-12 04:44:15 +00:00
MLI_CALL OPEN, open_params
2017-12-09 22:28:54 +00:00
bcc :+
;; Open failed
lda prefix_depth ; root?
beq next_device
jsr BELL1 ; no, but failed; beep
jsr pop_prefix ; and go up a level
2017-11-13 15:57:57 +00:00
stx prefix
2017-11-12 04:44:15 +00:00
jmp keyboard_loop
2017-12-09 22:49:16 +00:00
2017-12-09 22:28:54 +00:00
;; Open succeeded
: inc prefix_depth
2017-12-09 17:03:44 +00:00
stz num_entries
2017-11-12 04:44:15 +00:00
lda open_params_ref_num
sta read_params_ref_num
2017-12-09 22:11:29 +00:00
sta mark_ref_num
2019-10-05 01:10:01 +00:00
lda #.sizeof(SubdirectoryHeader)
2017-11-12 04:44:15 +00:00
sta read_params_request
stz read_params_request+1
2017-11-13 15:57:57 +00:00
jsr do_read
2017-12-10 00:06:31 +00:00
bcs finish_read2
2017-12-09 22:49:16 +00:00
2017-12-10 00:06:31 +00:00
;; Store entry_length/entries_per_block/file_count
2017-12-09 22:49:16 +00:00
ldx #3
2019-10-05 01:10:01 +00:00
: lda read_buffer + SubdirectoryHeader::entry_length,x
2017-12-10 00:06:31 +00:00
sta entry_length,x
2017-11-12 04:44:15 +00:00
dex
2017-12-10 00:06:31 +00:00
bpl :-
2017-11-12 04:44:15 +00:00
sta read_params_request
2017-12-10 00:06:31 +00:00
lda #1
2017-12-11 04:22:34 +00:00
sta entry_num
2017-12-09 22:11:29 +00:00
stz mark_position+1
stz mark_position+2
2017-12-09 22:49:16 +00:00
2017-12-10 00:06:31 +00:00
lda file_count
ora file_count+1
bne next_file_entry ; any files?
finish_read2:
bra finish_read
2017-12-09 22:49:16 +00:00
2017-12-10 00:06:31 +00:00
next_file_entry:
2017-12-10 00:17:29 +00:00
bit file_count+1 ; wrap around?
2017-12-10 00:06:31 +00:00
bmi finish_read2
2017-12-10 00:17:29 +00:00
;; TODO: The math here is mysterious; understand and document
2017-12-10 00:06:31 +00:00
floop: lda mark_position+1
2017-11-12 04:44:15 +00:00
and #$FE
2017-12-09 22:11:29 +00:00
sta mark_position+1
2017-12-10 00:17:29 +00:00
ldy entry_num
2017-12-10 00:06:31 +00:00
lda #0
cpy entries_per_block
2017-12-10 00:17:29 +00:00
bcc :+
2017-11-12 04:44:15 +00:00
tay
2017-12-10 00:17:29 +00:00
sty entry_num
2017-12-09 22:28:54 +00:00
inc mark_position+1
2017-12-10 00:17:29 +00:00
carry: inc mark_position+1
: dey
2017-11-12 04:44:15 +00:00
clc
2017-12-10 00:17:29 +00:00
bmi :+
2017-12-10 00:06:31 +00:00
adc entry_length
2017-12-10 00:17:29 +00:00
bcc :-
bcs carry
: adc #4
2017-12-09 22:11:29 +00:00
sta mark_position
MLI_CALL SET_MARK, mark_params
2017-12-10 00:06:31 +00:00
bcs finish_read2
2017-11-13 15:57:57 +00:00
jsr do_read
2017-12-10 00:06:31 +00:00
bcs finish_read2
2017-12-10 00:17:29 +00:00
inc entry_num
2019-10-05 01:10:01 +00:00
lda read_buffer + FileEntry::storage_type_name_length
2017-12-10 00:06:31 +00:00
and #$F0 ; mask off storage_type
beq floop ; inactive file entry
dec file_count
bne :+
dec file_count+1
;; Check read access
: ror read_buffer + FileEntry::access
bcc next_file_entry
;; Check file type
lda read_buffer + FileEntry::file_type
2019-10-05 01:10:01 +00:00
cmp #FT_DIRECTORY
2017-12-10 00:06:31 +00:00
beq :+
2019-10-05 01:10:01 +00:00
cmp #FT_SYSTEM
2017-12-10 00:06:31 +00:00
bne next_file_entry
;; Check to see if we have room
: ldx num_entries
2017-12-09 22:11:29 +00:00
cpx #max_entries
2017-12-09 21:00:27 +00:00
bcs finish_read
2017-12-10 00:06:31 +00:00
;; Store type
2017-12-09 22:11:29 +00:00
sta types_table,x
2017-12-09 22:49:16 +00:00
2017-12-10 00:06:31 +00:00
;; Copy name
jsr update_curr_ptr
ldy #$0F ; name length + 1 (includes length byte)
2017-12-09 22:49:16 +00:00
: lda read_buffer,y
2017-12-09 21:00:27 +00:00
sta (curr_ptr),y
2017-11-12 04:44:15 +00:00
dey
2017-12-09 22:49:16 +00:00
bpl :-
iny ; Y = 0
2017-12-10 00:06:31 +00:00
and #$0F ; mask off name length (remove storage_type)
2017-12-09 22:49:16 +00:00
sta (curr_ptr),y ; store length
2017-12-10 00:06:31 +00:00
;; Next
2017-12-09 17:03:44 +00:00
inc num_entries
2017-12-10 00:06:31 +00:00
bne next_file_entry
2017-12-09 22:49:16 +00:00
next: jmp next_device
2017-11-12 04:44:15 +00:00
2017-12-09 21:00:27 +00:00
finish_read:
MLI_CALL CLOSE, close_params
2017-12-09 22:49:16 +00:00
bcs next
;; fall through
.endproc
2017-12-09 17:03:44 +00:00
2017-12-09 22:49:16 +00:00
;;; ------------------------------------------------------------
.proc draw_screen
2017-12-10 00:29:06 +00:00
jsr SETTXT ; TEXT
jsr HOME ; HOME
2017-12-09 21:00:27 +00:00
lda #23 ; VTAB 23
2017-12-10 00:29:06 +00:00
jsr TABV
2017-12-09 17:03:44 +00:00
;; Print help text
ldy #0
lda #20 ; HTAB 20
jsr cout_string_hpos
2017-12-09 21:00:27 +00:00
;; Draw prefix
jsr home
2017-12-09 17:03:44 +00:00
ldx #0
: lda prefix+1,x
2017-12-09 22:49:16 +00:00
beq :+
2017-12-09 17:29:35 +00:00
jsr ascii_cout
2017-11-12 04:44:15 +00:00
inx
2017-12-09 17:03:44 +00:00
bne :-
2017-12-09 22:49:16 +00:00
: stz current_entry
2017-12-09 17:29:35 +00:00
stz page_start
2017-12-09 17:03:44 +00:00
lda num_entries
2017-12-09 22:49:16 +00:00
beq keyboard_loop ; no entries (empty directory)
row_count := $6A
cmp #bottom_row ; more entries than fit?
bcc :+
lda #(bottom_row - top_row + 1)
: sta row_count
lda #2
sta WNDTOP
sta WNDLFT
lda #22
sta WNDWDTH
sta WNDBTM
loop: jsr draw_current_line
2017-12-09 17:03:44 +00:00
inc current_entry
2017-12-09 22:49:16 +00:00
dec row_count
bne loop
2017-12-09 17:03:44 +00:00
stz current_entry
beq draw_current_line_inv
2017-12-09 22:49:16 +00:00
.endproc
2017-12-09 17:03:44 +00:00
2017-12-09 17:29:35 +00:00
;;; ------------------------------------------------------------
2017-12-09 17:03:44 +00:00
.proc on_up
2017-12-09 21:00:27 +00:00
jsr draw_current_line ; clear inverse selection
2017-12-09 17:03:44 +00:00
ldx current_entry
2017-12-09 17:29:35 +00:00
beq draw_current_line_inv ; first one? just redraw
dec current_entry ; go to previous
2017-12-09 21:00:27 +00:00
lda CV
cmp #top_row ; at the top?
bne draw_current_line_inv ; if not, just draw
dec page_start ; yes, adjust page and
lda #ASCII_SYN ; scroll screen up
2017-12-09 17:03:44 +00:00
bne draw_current_line_with_char
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 17:29:35 +00:00
;;; ------------------------------------------------------------
2017-12-09 17:03:44 +00:00
.proc on_down
2017-12-09 21:00:27 +00:00
jsr draw_current_line ; clear inverse selection
2017-12-09 17:03:44 +00:00
ldx current_entry
2017-11-12 04:44:15 +00:00
inx
2017-12-09 21:00:27 +00:00
cpx num_entries ; past the limit?
bcs draw_current_line_inv ; yes, just redraw
stx current_entry ; go to next
lda CV
cmp #bottom_row ; at the bottom?
bne draw_current_line_inv ; if not, just draw
inc page_start ; yes, adjust page and
lda #ASCII_ETB ; scroll screen down
2017-12-09 17:03:44 +00:00
;; fall through
.endproc
2017-12-09 17:29:35 +00:00
;;; ------------------------------------------------------------
2017-12-09 17:03:44 +00:00
draw_current_line_with_char:
jsr COUT
draw_current_line_inv:
jsr SETINV
jsr draw_current_line
;; fall through
;;; ------------------------------------------------------------
2017-11-12 04:44:15 +00:00
2017-12-09 17:29:35 +00:00
.proc keyboard_loop
2017-11-12 04:44:15 +00:00
lda KBD
bpl keyboard_loop
sta KBDSTRB
jsr SETNORM
2017-12-09 17:03:44 +00:00
ldx num_entries
2017-12-09 17:29:35 +00:00
beq :+ ; no up/down/return if empty
2017-12-09 21:00:27 +00:00
cmp #HI(ASCII_CR)
2017-11-13 15:57:57 +00:00
beq on_return
2017-12-09 17:03:44 +00:00
cmp #HI(ASCII_DOWN)
2017-11-12 04:44:15 +00:00
beq on_down
2017-12-09 17:03:44 +00:00
cmp #HI(ASCII_UP)
2017-11-12 04:44:15 +00:00
beq on_up
2017-12-09 17:29:35 +00:00
: cmp #HI(ASCII_TAB)
2017-11-12 04:44:15 +00:00
beq next_drive
2017-12-09 17:03:44 +00:00
cmp #HI(ASCII_ESCAPE)
2017-11-12 04:44:15 +00:00
bne keyboard_loop
2017-12-09 17:29:35 +00:00
;; fall through
.endproc
;;; ------------------------------------------------------------
2017-11-12 04:44:15 +00:00
2017-12-09 17:29:35 +00:00
.proc on_escape
2017-12-09 22:28:54 +00:00
jsr pop_prefix ; leaves length in X
dec prefix_depth
bra resize_prefix_and_open_jmp
2017-12-09 17:29:35 +00:00
.endproc
;;; ------------------------------------------------------------
2017-12-09 22:28:54 +00:00
;; Remove level from prefix; returns new length in X
.proc pop_prefix
ldx prefix
loop: dex
2017-11-13 15:57:57 +00:00
lda prefix,x
cmp #'/'
2017-12-09 22:28:54 +00:00
bne loop
2017-12-09 22:49:16 +00:00
cpx #1
2017-12-09 22:28:54 +00:00
bne done
2017-11-13 15:57:57 +00:00
ldx prefix
2017-12-09 22:28:54 +00:00
done: rts
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 22:49:16 +00:00
;;; ------------------------------------------------------------
2017-11-12 04:44:15 +00:00
next_drive:
2017-12-09 22:28:54 +00:00
jmp next_device
2017-12-11 04:22:34 +00:00
inc_resize_prefix_and_open:
2017-12-09 22:28:54 +00:00
inx
2017-11-12 04:44:15 +00:00
2017-12-09 22:28:54 +00:00
resize_prefix_and_open_jmp:
jmp resize_prefix_and_open
2017-11-12 04:44:15 +00:00
2017-12-09 17:29:35 +00:00
;;; ------------------------------------------------------------
.proc on_return
2017-11-13 15:57:57 +00:00
MLI_CALL SET_PREFIX, set_prefix_params
2017-11-12 04:44:15 +00:00
bcs next_drive
2017-12-09 17:03:44 +00:00
ldx current_entry
2017-12-09 21:00:27 +00:00
jsr update_curr_ptr
2017-11-13 15:57:57 +00:00
ldx prefix
: iny
2017-12-09 21:00:27 +00:00
lda (curr_ptr),y
2017-11-12 04:44:15 +00:00
inx
2017-11-13 15:57:57 +00:00
sta prefix,x
2017-12-09 21:00:27 +00:00
cpy curr_len
2017-11-13 15:57:57 +00:00
bcc :-
stx prefix
2017-12-09 17:03:44 +00:00
ldy current_entry
2017-12-09 22:11:29 +00:00
lda types_table,y
2017-12-11 04:22:34 +00:00
bpl inc_resize_prefix_and_open ; is directory???
2017-12-09 17:29:35 +00:00
;; nope, system file, so...
;; fall through
.endproc
2017-11-13 15:57:57 +00:00
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
2017-11-13 15:57:57 +00:00
.proc launch_sys_file
2017-12-10 00:29:06 +00:00
jsr SETTXT
jsr HOME
2017-12-09 22:49:16 +00:00
lda #HI(ASCII_RIGHT) ; Right arrow
2017-11-12 04:44:15 +00:00
jsr COUT
2017-11-13 15:57:57 +00:00
2017-11-12 04:44:15 +00:00
MLI_CALL OPEN, open_params
bcs next_drive
lda open_params_ref_num
sta read_params_ref_num
2017-11-13 15:57:57 +00:00
lda #$FF ; Load up to $FFFF bytes
2017-11-12 04:44:15 +00:00
sta read_params_request
sta read_params_request+1
2017-11-13 15:57:57 +00:00
jsr do_read
2017-11-12 04:44:15 +00:00
php
MLI_CALL CLOSE, close_params
plp
bcs next_drive
2017-11-13 15:57:57 +00:00
jmp read_buffer ; Invoke the loaded code
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
cout_string_hpos:
2017-12-09 21:00:27 +00:00
sta CH
2017-11-13 15:57:57 +00:00
2017-12-09 17:29:35 +00:00
.proc cout_string
2017-12-11 04:22:34 +00:00
loop: lda help_string,y
2017-12-09 17:29:35 +00:00
beq done
2017-11-12 04:44:15 +00:00
jsr COUT
iny
2017-12-11 04:22:34 +00:00
bne loop
2017-12-09 17:29:35 +00:00
done: rts
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 17:29:35 +00:00
;;; ------------------------------------------------------------
2017-12-09 21:00:27 +00:00
;; Compute address/length of curr_ptr/curr_len
;; Call with entry index in X.
.proc update_curr_ptr
stz curr_ptr+1
2017-11-12 04:44:15 +00:00
txa
asl a
2017-12-09 21:00:27 +00:00
rol curr_ptr+1
2017-11-12 04:44:15 +00:00
asl a
2017-12-09 21:00:27 +00:00
rol curr_ptr+1
2017-11-12 04:44:15 +00:00
asl a
2017-12-09 21:00:27 +00:00
rol curr_ptr+1
2017-11-12 04:44:15 +00:00
asl a
2017-12-09 21:00:27 +00:00
rol curr_ptr+1
sta curr_ptr
lda #>filenames
2017-11-12 04:44:15 +00:00
clc
2017-12-09 21:00:27 +00:00
adc curr_ptr+1
sta curr_ptr+1
ldy #0
lda (curr_ptr),y
sta curr_len
2017-11-12 04:44:15 +00:00
rts
2017-12-09 21:00:27 +00:00
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 17:29:35 +00:00
;;; ------------------------------------------------------------
2017-12-09 22:49:16 +00:00
.proc draw_current_line
2017-12-09 17:29:35 +00:00
lda #2 ; hpos = 2
sta COL80HPOS
ldx current_entry ; vpos = entry - page_start + 2
2017-11-12 04:44:15 +00:00
txa
sec
2017-12-09 17:29:35 +00:00
sbc page_start
2017-11-12 04:44:15 +00:00
inc a
inc a
2017-12-10 00:29:06 +00:00
jsr TABV
2017-12-09 17:29:35 +00:00
2017-12-09 22:11:29 +00:00
lda types_table,x
bmi name ; is sys file?
;; Draw folder glyph
2017-12-09 17:29:35 +00:00
stz COL80HPOS
2017-12-09 21:00:27 +00:00
lda INVFLG
2017-11-12 04:44:15 +00:00
pha
2017-11-13 15:57:57 +00:00
ldy #(folder_string - string_start) ; Draw folder glyphs
jsr cout_string
2017-11-12 04:44:15 +00:00
pla
2017-12-09 21:00:27 +00:00
sta INVFLG
2017-12-09 22:11:29 +00:00
;; Draw the name
name: jsr space
2017-12-09 21:00:27 +00:00
jsr update_curr_ptr
2017-12-09 22:49:16 +00:00
loop: iny
2017-12-09 21:00:27 +00:00
lda (curr_ptr),y
2017-12-09 17:29:35 +00:00
jsr ascii_cout
2017-12-09 21:00:27 +00:00
cpy curr_len
2017-12-09 22:49:16 +00:00
bcc loop
2017-12-09 21:00:27 +00:00
space: lda #HI(' ')
2017-12-09 17:29:35 +00:00
bne cout ; implicit RTS
2017-12-09 22:49:16 +00:00
;; fall through
.endproc
2017-12-09 21:00:27 +00:00
home: lda #HI(ASCII_EM) ; move cursor to top left
2017-12-09 17:29:35 +00:00
;; Sets high bit before calling COUT
ascii_cout:
ora #$80
cout: jmp COUT
2017-11-12 04:44:15 +00:00
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
2017-11-13 15:57:57 +00:00
.proc do_read
MLI_CALL READ, read_params
2017-11-12 04:44:15 +00:00
rts
2017-11-13 15:57:57 +00:00
.endproc
2017-11-12 04:44:15 +00:00
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
2017-11-12 04:44:15 +00:00
2017-11-13 15:57:57 +00:00
string_start := *
2017-11-12 04:44:15 +00:00
.proc help_string
2019-10-05 01:10:01 +00:00
scrcode "RETURN: Select | TAB: Chg Vol | ESC: Back"
.byte 0
2017-11-12 04:44:15 +00:00
.endproc
;; Mousetext sequence: Enable, folder left, folder right, disable
.proc folder_string
.byte $0F,$1B,$D8,$D9,$18,$0E
.byte 0 ; null terminated
.endproc
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
2017-11-12 04:44:15 +00:00
.proc open_params
params: .byte 3
2017-11-13 15:57:57 +00:00
path: .addr prefix
2017-11-12 04:44:15 +00:00
buffer: .addr $1C00
ref_num:.byte 0
.endproc
open_params_ref_num := open_params::ref_num
.proc close_params
params: .byte 1
ref_num:.byte 0
.endproc
.proc on_line_params
params: .byte 2
unit: .byte $60
2017-11-13 15:57:57 +00:00
buffer: .addr prefix+1
2017-11-12 04:44:15 +00:00
.endproc
on_line_params_unit := on_line_params::unit
.proc set_prefix_params
params: .byte 1
2017-11-13 15:57:57 +00:00
path: .addr prefix
2017-11-12 04:44:15 +00:00
.endproc
.proc read_params
params: .byte 4
ref_num:.byte 1
2017-11-13 15:57:57 +00:00
buffer: .word read_buffer
2017-11-12 04:44:15 +00:00
request:.word 0
trans: .word 0
.endproc
read_params_ref_num := read_params::ref_num
read_params_request := read_params::request
2017-12-11 04:22:34 +00:00
.assert read_params::request - bbb <= $300, error, "Must fit in $300 bytes"
2017-12-09 17:03:44 +00:00
;;; ------------------------------------------------------------
2017-11-12 04:44:15 +00:00
.endproc
install_size = $300
poporg
2017-11-12 04:44:15 +00:00
;;; ************************************************************
.include "../inc/driver_postamble.inc"
;;; ************************************************************