;;; Disassembly of Bird's Better Bye, 40 column program selector ;;; (Found in a copy of ProDOS 1.8, but not believed to be original?) ;;; ;;; Installer wrapper added by Joshua Bell inexorabletash@gmail.com .setcpu "65C02" .linecont + .feature string_escapes .include "apple2.inc" .include "apple2.mac" .include "../inc/apple2.inc" .include "../inc/macros.inc" .include "../inc/prodos.inc" .include "../inc/ascii.inc" ;;; ************************************************************ .include "../inc/driver_preamble.inc" ;;; ************************************************************ ;;; ------------------------------------------------------------ ;;; 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. ;;; ------------------------------------------------------------ ;;; Installer ;;; ------------------------------------------------------------ max_size = $300 .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 #dst sta dst_ptr+1 lda #end bne loop lda src_ptr cmp #filename_table sta name_ptr+1 ldy #$00 lda (name_ptr),y sta name_len rts .endproc ;;; ============================================================ .proc DisplayFilename lda #5 sta CH lda index clc adc #$05 jsr TABV jsr space ldx index lda type_table,x ; folder? bmi :+ ; nope lda #HI('/') ; yes - suffix with '/' jsr Cout : jsr SetNamePtrAndLen : iny lda (name_ptr),y jsr Cout cpy name_len bcc :- space: lda #HI(' ') jmp Cout .endproc ;;; ============================================================ .proc AssignRefNum lda open_ref_num sta read_ref_num sta get_eof_ref_num ; also set_mark_position rts .endproc ;;; ============================================================ default_devnum: .byte 0 ;;; ============================================================ ;;; Messages ;;; ============================================================ message_table: msg_select_drive := * - message_table scrcode "TAB: SELECT DRIVE\r" .byte 0 msg_select_file := * - message_table scrcode "RETURN: SELECT FILE\r\r" .byte 0 ;;; ============================================================ ;;; Parameter Blocks ;;; ============================================================ ;;; OPEN params open_params: .byte 3 open_pathname: .addr PREFIX open_io_buffer: .addr $1800 open_ref_num: .byte 0 ;;; CLOSE params close_params: .byte 1 .byte 0 ;;; ON_LINE params on_line_params: .byte $02 on_line_unit_num: .byte $60 on_line_buffer: .addr PREFIX+1 ;;; READ params read_params: .byte 4 read_ref_num: .byte 0 read_data_buffer: .addr $2000 read_request_count: .word 0 read_transfer_count: .word 0 ;;; SET_PREFIX params set_prefix_params: .byte 1 .addr PREFIX ;;; GET_EOF params ;;; SET_MARK params get_eof_params: set_mark_params: .byte 2 get_eof_ref_num: set_mark_ref_num: .byte 0 get_eof_eof: set_mark_position: .faraddr $A0A0A0 ;;; ------------------------------------------------------------ .endproc .assert .sizeof(bbb) - bbb <= $300, error, "Must fit in $300 bytes" install_size = $300 poporg ;;; ************************************************************ .include "../inc/driver_postamble.inc" ;;; ************************************************************