SCANNING FROM PRODOS MATT GULICK This article shows just how easy it is to include support for scanner hardware in your application program. With just a little effort, you can add significant functionality to your program. In this article, we explore using the Apple Scanner (a flatbed scanner) and the Apple II High-Speed SCSI Card with either an Enhanced Apple IIe computer or an Apple IIGS computer running the ProDOS-8 operating system. (A future article will cover GS/OS.) The concepts presented here can be used for any scanner that can be connected to an Apple IIe or Apple IIGS via the Apple II SCSI card. For this article, we limit our discussion to the graphics modes available on the Apple IIe (HiRes and Double HiRes modes). These modes are more limited in resolution and color generation than the Super HiRes mode available on the IIGS, but they allow our sample program to run on most of the current Apple II family of systems in use today. We focus on 1-bit-per-pixel halftone and line art images. In so doing, we are able to display the data on the screen easily. PLAYING HIDE-AND-SEEK WITH THE SCANNER ...98, 99, 100. Ready or not, here we come. Under the ProDOS-8 operating system, we don't have access to the loaded drivers that have been written for the GS/OS environment. Since the scanner is a character device, data is returned in bytes rather than in blocks. ProDOS-8 can't help us read from character devices, so we need to walk the slots looking for the card we want and then talk to the card directly to find the device we want. APPLE HIGH-SPEED SCSI CARD, WHERE ARE YOU? We must first find which slot the high-speed SCSI card is in. We start at slot 7 and work our way down. In the following code segment, we look for a SmartPort device in the current slot. If one is found, we must determine if it is a SCSI card that supports extended SmartPort calls. Finally, we need to make sure that this is the type of card we want. In other words, "Is this card from a vendor whose command set I understand?" See Code Sample 1. ;******************************************************* ; ; CODE SAMPLE 1 ; ; In this first code segment, we walk 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 the card passes all these tests, we ; then issue a Device $00 Status $00 call to further ; ensure that this is the Apple II High-Speed SCSI Card. ; ;******************************************************* find_card ; ; Save the current Zero ; Page values before ; using them. ; lda