;******************************************************* ; ; Develop Code Samples. ; ; Written by Matt Gulick. Started October 16,1990 ; ;******************************************************* ;******************************************************* ; ; This file contains the code samples that are used in ; the Scanning From ProDOS article in DEVELOP. These ; code segments may be used freely by anyone. All ; code in this file assumes that we are running in an ; 8 bit Apple IIe. ; ;******************************************************* ;******************************************************* ; ; Revision History: ; ;******************************************************* ; Oct 16, 1990 File started. ; STRING PASCAL BLANKS OFF PAGESIZE 70 PRINT NOGEN PRINT NOMDIR MACHINE M65C02 EJECT ;******************************************************* ; ; CODE SAMPLE #1 ; ; This first code segment walks the slots starting at ; slot 7, looking first for a card of any kind. Once ; found, we check the ID bytes for a Smartport card. ; Once found we check the ID Type byte to see if it is ; a SCSI Card. If it passes all these tests, we then ; issue a Device $00 Status $00 call to further ensure ; that this is the Apple High-Speed SCSI Card. ; ;******************************************************* ; ; The following are Equates ; that will bee used in all ; the Sample Code Segments ; that follow. ; slot_7 equ $C7 slot_1 equ $C1 My_ZPage equ $42 KBD equ $C000 ;Keyboard CLR80VID equ $C00C ;Disable 80-column hardware SET80VID equ $C00D ;Enable 80-column hardware KBD_STRB equ $C010 ;Keyboard Strobe RD80COL equ $C018 ;Read 80 Col. Mode RDTEXT equ $C01A ;Read Text Mode RDMIX equ $C01B ;Read Mix Mode RDPAGE2 equ $C01C ;Read Page 2 setting RDHIRES equ $C01D ;Read HiRes setting TXTCLR equ $C050 ;Clear Text Mode TXTSET equ $C051 ;Set Text Mode MIXCLR equ $C052 ;Clear Mixed Mode MIXSET equ $C053 ;Set Mixed Mode TXTPAGE1 equ $C054 ;Set Text Page 1 TXTPAGE2 equ $C055 ;Set Text page 2 LORES equ $C056 ;Set LoRes Graphics HIRES equ $C057 ;Set HiRes Graphics CLRAN3 equ $C05E ;Clear annunciator 3 SETAN3 equ $C05F ;Set annunciator 3 ESC equ $9B ;High bit set ASCII ESC Key Blk_sig1 equ $01 Blk_sig2 equ $03 Blk_sig3 equ $05 SPort_sig equ $07 SPort_ID equ $FB Ext_SPort equ %10000000 ;Bit 7 SCSI equ %00000010 ;Bit 2 No_Err equ $00 IO_Err equ $27 No_dev equ $28 ;******************************************************* EXPORT P8_Scanner P8_Scanner PROC ; ; Main Code Segment. ; jsr find_card jsr find_scanr jsr htone_filter jsr def_window jsr start_scan jsr get_data jsr display bcc P8_Scanner rts ;******************************************************* ; ; CODE SAMPLE #1 ; ; This first code segment walks the slots starting at ; slot 7, looking first for a card of any kind. Once ; found, we check the ID bytes for a Smartport card. ; Once found we check the ID Type byte to see if it is ; a SCSI Card. If it passes all these tests, we then ; issue a Device $00 Status $00 call to further ensure ; that this is the Apple High-Speed SCSI Card. ; ;******************************************************* find_card ; ; Save the current Zero ; Page values before ; using them. ; lda