;******************************************************* ; ; SCSI Driver 'Control' filter. ; ; Written by Matt Gulick. Started August 13,1988 ; ; Copyright Apple Computer, Inc. 1988-90 ; ;******************************************************* ;******************************************************* ; ; This file contains the 'Control' filter as defined ; in the ERS. ; ;******************************************************* ;******************************************************* ; ; Revision History: ; ;******************************************************* ; Aug 13, 1988 File started. STRING PASCAL BLANKS OFF PAGESIZE 70 PRINT NOGEN PRINT NOMDIR MACHINE M65816 IMPORT call_type IMPORT internal IMPORT main_drvr IMPORT f_partition IMPORT direct_page IMPORT gsos_dpage IMPORT internal_buff IMPORT set_our_dp IMPORT chk_lnk_offline IMPORT set_disk_sw IMPORT disk_switch IMPORT rebld_dibs IMPORT trash_volume IMPORT trash_it IMPORT ko_cache IMPORT trans_flag IMPORT uses_dc IMPORT dib_data_struct IMPORT display_cnt IMPORT current_fmt IMPORT opt1_blk_cnt IMPORT opt1_blk_siz IMPORT opt1_interleave IMPORT opt1_med_siz IMPORT opt2_blk_cnt IMPORT opt2_blk_siz IMPORT opt2_interleave IMPORT opt2_med_siz IMPORT opt3_blk_cnt IMPORT opt3_blk_siz IMPORT opt3_interleave IMPORT opt3_med_siz IMPORT format_data IMPORT check_532_rw IMPORT sense_data IMPORT t_dvc_blocks ENTRY reset_dvc ENTRY eject ENTRY s_config_parms ENTRY s_wait_mode ENTRY format_opt ENTRY assign_part ENTRY arm_signal ENTRY disarm_sig ENTRY set_p_map ENTRY format_dvc PRINT OFF INCLUDE 'scsihd.equates' INCLUDE 'M16.MEMORY' INCLUDE 'M16.UTIL' PRINT ON EJECT ;******************************************************* ; ; Main Entry point to the 'Control' filter. This ; "Filter" is called when a Control Command comes in. ; See the headers of the seperate sections for the ; details of the commands. ; ; Called via 'JSR' ; ; Inputs: [dib_ptr] = Target DIB l (LONG) ; Acc = Unspecified ; Carry = Unspecified ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Returns via 'RTS' ; ; Outputs: Acc = 0 ; Carry = 0 ; or ; Acc = Error ; Carry = 1 ; ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Errors: See Spec. ; ;******************************************************* EXPORT control control PROC ; ; Is the device online? ; ldy #dib.dvcflag lda [dib_ptr],y and #dvc_online bne @online ;Yes. ; ; Device is currently offline. ; lda #drvr_off_line sec rts ; ; Zero out the Data Chaining Flag ; @online stz |uses_dc ; ; Clear transfer count. ; lda #null ldy #dib.trx_len sta [dib_ptr],y ldy #dib.trx_len+2 sta [dib_ptr],y ; ; Entry to the Control Call Filter. ; This filter acts as a mini driver. ; It examines the Control Code sent ; and calls the appropriate routines. ; If the Command is $8000 or greater, ; then it will be routed to the device ; specific section. ; lda 0000. ; ; Called via 'JSR' ; ; Inputs: [dib_ptr] = Target DIB l (LONG) ; Acc = Unspecified ; Carry = Unspecified ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Returns via 'RTS' ; ; Outputs: Acc = 0 ; Carry = 0 ; or ; Acc = Error ; Carry = 1 ; ; Y register = Unspecified ; X register = Unspecified ; P register = 0=M=X=e ; Direct Page = Ours ; Data Bank = Ours ; ; Errors: See Spec. ; ;******************************************************* EXPORT format_opt format_opt PROC ;------------------------------------------------------------------------------- IF block_dvc = true\ AND character_dvc = false THEN ;------------------------------------------------------------------------------- IF scsi_dtype = apple_cd THEN ; ; If the device is a CD_ROM, then there ; are no format options. ; stz > High. xba ; Send it out High >> Low. sta |c_block_num ; ; Set Main Driver Pointer to ; our data for the command. ; lda #cmd_$800A sta