scsi-2 powa!

This commit is contained in:
Antoine Vignau 2024-08-15 21:27:35 +02:00
parent e5e274a569
commit fae5db3afd
20 changed files with 1324 additions and 0 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
; from E16.Control octlOwner EQU 4 octlRect EQU 8 octlFlag EQU 16 octlHilite EQU 17 octlValue EQU 18 octlColor EQU 36 ctlInVis EQU $0080 ; invisible mask for any type of control recSize EQU $000C ; Return record size command. ; from E16.Event owhat EQU 0 owhere EQU 10 mouseUpEvt EQU $0002 mUpMask EQU $0004 ; from E16.QuickDraw oportRect EQU 16 ; PortRect ; from E16.Window owFrame EQU 210 noPart EQU $0000 fHilited EQU $0001 ; Window is highlighted. fCtlTie EQU $0008 ; Window state tied to controls. ; from M16.Control MACRO &lab _DragRect &lab ldx #$1D10 jsl $E10000 MEND ; from m16.Event MACRO &lab _GetNextEvent &lab ldx #$0A06 jsl $E10000 MEND ; from M16.IntMath MACRO &lab _UDivide &lab ldx #$0B0B jsl $E10000 MEND ; from m16.QuickDraw MACRO &lab _GetMasterSCB &lab ldx #$1704 jsl $E10000 MEND MACRO &lab _SetPenState &lab ldx #$2A04 jsl $E10000 MEND MACRO &lab _GetPenState &lab ldx #$2B04 jsl $E10000 MEND MACRO &lab _SetPenSize &lab ldx #$2C04 jsl $E10000 MEND MACRO &lab _SetPenMode &lab ldx #$2E04 jsl $E10000 MEND MACRO &lab _SetPenPat &lab ldx #$3004 jsl $E10000 MEND MACRO &lab _SetSolidPenPat &lab ldx #$3704 jsl $E10000 MEND MACRO &lab _InsetRect &lab ldx #$4C04 jsl $E10000 MEND MACRO &lab _PtInRect &lab ldx #$4F04 jsl $E10000 MEND MACRO &lab _FrameRect &lab ldx #$5304 jsl $E10000 MEND MACRO &lab _PaintRect &lab ldx #$5404 jsl $E10000 MEND MACRO &lab _EraseRect &lab ldx #$5504 jsl $E10000 MEND MACRO &lab _GlobalToLocal &lab ldx #$8504 jsl $E10000 MEND ; from M16.Util ;............................................................ ; ; Push long (4 bytes) onto stack ; ; pushlong address - push contents of address ; pushlong address,x - push contents of address,x ; pushlong const,s - push contents of stack+const ; pushlong #address/const - push address or constant ; pushlong [zeropage],offset - push using indirect address ;............................................................... MACRO pushlong &addr,&offset IF &addr[1:1]='#' THEN pea &addr[2:255]>>16 pea |&addr[2:255] ELSEIF &addr[1:1]='[' THEN ldy #&offset+2 pushword &addr,y ldy #&offset pushword &addr,y ELSEIF &offset='s' THEN pushword &addr+2,s pushword &addr+2,s ELSEIF &offset='' THEN pushword &addr+2 pushword &addr ELSE pushword &addr+2,&offset pushword &addr,&offset ENDIF MEND ;............................................................... ; ; Push 2 bytes onto stack ; ; pushword loc -- pushes bytes onto stack from 'loc' ; pushword loc,x -- pushes bytes onto stack from 'loc,x' ; pushword #n -- pushes constant #n onto stack ; pushword -- pushes bytes onto stack (from A) ;............................................................... MACRO pushword &addr,&reg IF &addr[1:1]='#' AND &SETTING('LONGA')='ON' THEN pea |&addr[2:255] ELSE IF &addr­'' THEN IF &reg­'' THEN lda &addr,&reg ELSE lda &addr ENDIF ENDIF pha ENDIF MEND ;............................................................... ; ; Pull 2 bytes from stack ; ; pullword loc -- pulls bytes off stack and stores in 'loc' ; pullword loc,x -- pulls bytes off stack and stores in 'loc,x' ; pullword -- pulls bytes off stack and leaves in A ;............................................................... MACRO pullword &addr,&reg pla IF &addr­'' THEN IF &reg­'' THEN sta &addr,&reg ELSE sta &addr ENDIF ELSEIF &reg­'' THEN AERROR 'Illegal 2nd parameter' ENDIF MEND ; from M16.Window MACRO &lab _InvalRect &lab ldx #$3A0E jsl $E10000 MEND * * my own custom macros * ; cmps - signed comparison ; use just like the cmp instruction, but destroys contents of accumulator ; conditions c and z flags just like the built in cmp instruction. ; MACRO cmps &oprnd ; signed comparison sec sbc &oprnd beq @1 bvs @2 if &Setting('LONGA')='OFF' then ; must determine correct operand size eor #$80 else eor #$8000 endif @2 bmi @greaterThan clc dc.b $B0 ; BCS opcode @greaterThan sec @1 ENDM

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*********************************************************************** * * Globals.c * * Copyright (c) * Apple Computer, Inc. 1986-1989 * All Rights Reserved. * * This file contains the code which intializes the global variables * used by the scanner program. * ***********************************************************************/ #include "Scan.h" #include <qdaux.h> #include <quickdraw.h> #include <window.h> unsigned int quitFlag = 0; /* True when quitting */ unsigned int staggerCount = 0; /* Used to stagger windows as they open */ WmTaskRec event; /* All events are returned here */ scannerWindowDef sWindowDef; GrafPortPtr previewWindowPtr = NULL; GrafPortPtr settingsWindowPtr = NULL; PicHndl previewRuler = NULL; int scanDevnum; /* device number of Scanner */ word Scanner_Type; long (*Setup[2])() = {Setup_Apple,Setup_CPCScan}; void initGlobals() { quitFlag = staggerCount = 0; sWindowDef.reserved0 = sWindowDef.reserved0 = sWindowDef.reserved1 = sWindowDef.reserved2 = 0; sWindowDef.reserved3 = sWindowDef.reserved4 = sWindowDef.reserved5 = 0; sWindowDef.windDescBlockLenMSB = sWindowDef.windDescBlockLenLSB = 0; sWindowDef.windowIdentifier = sWindowDef.reserved6 = sWindowDef.xResolution = 0; sWindowDef.yResolution = sWindowDef.xUpperLeft = sWindowDef.yUpperLeft = 0; sWindowDef.width = sWindowDef.length = sWindowDef.brightness = 0; sWindowDef.threshold = sWindowDef.contrast = sWindowDef.imageComposition = 0; sWindowDef.bitsPerPixel = sWindowDef.halfTone = sWindowDef.paddingType = 0; }

View File

@ -0,0 +1 @@
# File: makefile # Target: AppleScan.GS # Created: Tuesday, August 29, 1989 10:46:51 AM Objs = Scan.obj ¶ Event.obj ¶ Globals.obj ¶ Menu.obj ¶ Utils.obj ¶ Window.obj ¶ Control.obj ¶ xSaveFile.obj ¶ Scanner_gsos.obj ¶ BoxCtrl.DefProc.obj AppleScan.GS ÄÄ Scan.r ScannerDefs.h "{RIIGSIncludes}"TypesIIGS.r RezIIGS Scan.r -o AppleScan.GS AppleScan.GS ÄÄ "{CIIGSLibrary}"Start.obj {objs} LinkIIGS -l >AppleScan.map -at $0000DB03 "{CIIGSLibrary}"BankAlign.obj # used only during debugging ¶ "{CIIGSLibrary}"Start.obj ¶ {objs} ¶ -lib "{CIIGSLibrary}"CLib ¶ -o AppleScan.GS ¶ -w2 # warnings are treated as fatal errors .obj Ä .c CIIGS {default}.c -o {default}.obj .obj Ä .aii ASMIIGS {default}.aii -o {default}.obj # include file dependencies Scan.h Ä "{CIIGSIncludes}"Types.h ScannerDefs.h SetFile -m . Scan.h Control.obj Ä "{CIIGSIncludes}"control.h "{CIIGSIncludes}"intmath.h "{CIIGSIncludes}"types.h "{CIIGSIncludes}"list.h "{CIIGSIncludes}"locator.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"qdaux.h "{CIIGSIncludes}"event.h "{CIIGSIncludes}"lineEdit.h "{CIIGSIncludes}"menu.h "{CIIGSIncludes}"memory.h "{CIIGSIncludes}"resources.h "{CIIGSIncludes}"window.h Scan.h Scanner_GSOS.h Event.obj Ä "{CIIGSIncludes}"types.h "{CIIGSIncludes}"locator.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"event.h "{CIIGSIncludes}"menu.h "{CIIGSIncludes}"window.h Scan.h Globals.obj Ä Scan.h "{CIIGSIncludes}"qdaux.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"window.h Menu.obj Ä "{CIIGSIncludes}"control.h "{CIIGSIncludes}"types.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"qdaux.h "{CIIGSIncludes}"window.h "{CIIGSIncludes}"event.h "{CIIGSIncludes}"menu.h "{CIIGSIncludes}"desk.h "{CIIGSIncludes}"intmath.h "{CIIGSIncludes}"stdfile.h "{CIIGSIncludes}"gsos.h "{CIIGSIncludes}"memory.h "{CIIGSIncludes}"malloc.h Scan.h Scan.obj Ä "{CIIGSIncludes}"types.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"locator.h "{CIIGSIncludes}"TextTool.h "{CIIGSIncludes}"IntMath.h Utils.obj Ä "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"QDAux.h "{CIIGSIncludes}"GSOS.h "{CIIGSIncludes}"Window.h "{CIIGSIncludes}"MiscTool.h "{CIIGSIncludes}"texttool.h Scan.h Window.obj Ä "{CIIGSIncludes}"intmath.h "{CIIGSIncludes}"memory.h "{CIIGSIncludes}"types.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"qdaux.h "{CIIGSIncludes}"resources.h "{CIIGSIncludes}"window.h "{CIIGSIncludes}"misctool.h "{CIIGSIncludes}"control.h "{CIIGSIncludes}"menu.h "{CIIGSIncludes}"malloc.h Scan.h xSaveFile.obj Ä "{CIIGSIncludes}"gsos.h "{CIIGSIncludes}"memory.h "{CIIGSIncludes}"malloc.h "{CIIGSIncludes}"string.h "{CIIGSIncludes}"quickdraw.h "{CIIGSIncludes}"qdaux.h "{CIIGSIncludes}"misctool.h BoxCtrl.DefProc.obj Ä BoxCtrl.DefProc.mac

1
scsi2/AppleScanGS/Menu.c Normal file

File diff suppressed because one or more lines are too long

1
scsi2/AppleScanGS/Scan.c Normal file
View File

@ -0,0 +1 @@
/*********************************************************************** * * Scan.c (Main Program) * * Copyright (c) * Apple Computer, Inc. 1986-1989 * All Rights Reserved. * * This file contains the scanner program. * ***********************************************************************/ #include <types.h> #include <quickdraw.h> #include <qdaux.h> #include <window.h> #include <locator.h> #include <texttool.h> #include <intmath.h> /* Include this line to use Tool039 (the Scanner Toolset) #include "scToolSet.h" */ main() { Ref initRef; /* This holds the reference to the startstop record */ char errBuf[5]; initGlobals(); /* Initialize our globals. */ TLStartUp(); /* start up the tool locator */ /* Startup the tools using the new toolbox call */ initRef = StartUpTools(_ownerid, refIsResource, 0x0001L); if (!_toolErr) { #ifdef __scToolSet__ LoadOneTool(39, 1); /* load the Scanner toolset */ if(_toolErr) { InitCursor(); ErrorWindow(0,NULL,_toolErr); WaitCursor(); } else if(findScanner()) { /* find the device number of the scanner */ #else if(findScanner()) { /* find the device number of the scanner */ #endif setupMenus(); /* Set up menus */ setupWindows(); InitCursor(); /* Make cursor show ready */ mainEvent(); /* Use application */ #ifdef __scToolSet__ scShutDown(); /* shut down the scanner toolset */ UnloadOneTool(39); #endif } ShutDownTools(refIsHandle, initRef); /* Let the toolbox shutdown the tools. */ } else { Int2Hex(_toolErr, &errBuf[1], 4); errBuf[0] = 4; WriteLine("\pUnable to start toolsets."); WriteCString("Error code = $"); WriteLine(errBuf); WriteLine("\pPress any key to quit..."); ReadChar(0); } TLShutDown(); /* qFlags = 0x4000; /* we can be restarted from memory */ }

1
scsi2/AppleScanGS/Scan.h Normal file
View File

@ -0,0 +1 @@
/*********************************************************************** * * Scan.h * * Copyright (c) 1990 * Apple Computer, Inc. * All Rights Reserved. * * This file contains the header data used by the scanner program. * ***********************************************************************/ #ifndef _scanner_ #define _scanner_ 1 #include <types.h> extern Word SwapBytes(); extern Long SwapWords(); extern void testPause(); extern long Setup_Apple(),Setup_CPCScan(); extern Word Scanner_Type; typedef struct scannerWindowStruct { byte reserved0,reserved1,reserved2,reserved3,reserved4,reserved5; byte windDescBlockLenMSB,windDescBlockLenLSB; byte windowIdentifier; byte reserved6; word xResolution,yResolution; long xUpperLeft,yUpperLeft,width,length; byte brightness,threshold,contrast,imageComposition,bitsPerPixel; word halfTone; byte paddingType; byte reserved[10]; } scannerWindowDef; #define SHORTINDEX 123 #define AppWindow 0x1000 #include "ScannerDefs.h" struct cocoonMemRec { long itemRefID; byte listFlags; long windowID; }; typedef struct cocoonMemRec *cocoonMemRecPtr; /* constants used to define the box control */ #define XINSET 30 #define YINSET 20 #define XOFFSET 2 #define YOFFSET 2 #define hPPI 16 /* pixels per inch as displayed on screen rulers */ #define vPPI 10 #endif

1
scsi2/AppleScanGS/Scan.r Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
extern void Scanner_Open(); extern Long Scanner_Read(); extern void Scanner_Close(); extern void Scanner_Scan(); extern void Scanner_DefWindow(); extern void Scanner_SetHalfTones(); extern void Scanner_SetMode(); extern void CPCScan_SetMode(); extern void CPCScan_GetMode(); extern void CPC_GDStatus(); extern void CPC_XSense(); extern void CPC_Read(); extern void CPC_Unload(); extern Long CPC_Scan(); extern void Scan_Inquiry();

View File

@ -0,0 +1 @@
#define fFamily0 0x1 #define fFamily1 0x2 #define fFamily2 0x3 /**********************************/ /* */ /* window resource ID definitions */ /* */ /**********************************/ #ifdef RezIIGS #define ImageWindow 0x00000001 #define ScannerWindow 0x00001100 #define PreviewWindow 0x00001200 #define PrefWindow 0x00001300 #define SettingsWindow 0x00001400 #define ThermWindow 0x00001500 #else #define ImageWindow 0x00000001L #define ScannerWindow 0x00001100L #define PreviewWindow 0x00001200L #define PrefWindow 0x00001300L #define SettingsWindow 0x00001400L #define ThermWindow 0x00001500L #endif #ifdef RezIIGS #define ScannerWindowID 0x00001101 #define PreviewWindowID 0x00001201 #define PrefWindowID 0x00001301 #else #define ScannerWindowID 0x00001101L #define PreviewWindowID 0x00001201L #define PrefWindowID 0x00001301L #endif #ifdef RezIIGS #define SettingsWindowID 0x00001401 #define CompositionPopUp 0x00001410 #define CompositionPopUpItem1 0x00001411 #define CompositionPopUpItem2 0x00001412 #define CompositionPopUpItem3 0x00001413 #define XResolutionPopUp 0x00001420 #define XResolutionPopUpItem1 0x00001421 #define XResolutionPopUpItem2 0x00001422 #define XResolutionPopUpItem3 0x00001423 #define XResolutionPopUpItem4 0x00001424 #define XResolutionPopUpItem5 0x00001425 #define YResolutionPopUp 0x00001430 #define YResolutionPopUpItem1 0x00001431 #define YResolutionPopUpItem2 0x00001432 #define YResolutionPopUpItem3 0x00001433 #define YResolutionPopUpItem4 0x00001434 #define YResolutionPopUpItem5 0x00001435 #define BrightnessScroll 0x00001440 #define BrightnessStatText 0x00001441 #define ContrastScroll 0x00001450 #define ContrastStatText 0x00001451 #define ThresholdScroll 0x00001460 #define ThresholdStatText 0x00001461 #define ScanButton 0x00001470 #define PreviewButton 0x00001480 #else #define SettingsWindowID 0x00001401L #define CompositionPopUp 0x00001410L #define CompositionPopUpItem1 0x00001411L #define CompositionPopUpItem2 0x00001412L #define CompositionPopUpItem3 0x00001413L #define XResolutionPopUp 0x00001420L #define XResolutionPopUpItem1 0x00001421L #define XResolutionPopUpItem2 0x00001422L #define XResolutionPopUpItem3 0x00001423L #define XResolutionPopUpItem4 0x00001424L #define XResolutionPopUpItem5 0x00001425L #define YResolutionPopUp 0x00001430L #define YResolutionPopUpItem1 0x00001431L #define YResolutionPopUpItem2 0x00001432L #define YResolutionPopUpItem3 0x00001433L #define YResolutionPopUpItem4 0x00001434L #define YResolutionPopUpItem5 0x00001435L #define BrightnessScroll 0x00001440L #define BrightnessStatText 0x00001441L #define ContrastScroll 0x00001450L #define ContrastStatText 0x00001451L #define ThresholdScroll 0x00001460L #define ThresholdStatText 0x00001461L #define ScanButton 0x00001470L #define PreviewButton 0x00001480L #endif #ifdef RezIIGS #define PalletteWindowID 0x00001501 #define ToolWindowID 0x00001601 #else #define PalletteWindowID 0x00001501L #define ToolWindowID 0x00001601L #endif /********************************/ /* */ /* Menu resource ID definitions */ /* */ /********************************/ #define AppleMenuID 0x901 #define FileMenuID 0x902 #define EditMenuID 0x903 #define ScanMenuID 0x904 #define UndoID 250 /* For DA's */ #define CutID 251 /* For DA's */ #define CopyID 252 /* For DA's */ #define PasteID 253 /* For DA's */ #define ClearID 254 /* For DA's */ #define CloseID 255 /* For DA's */ #define AboutID CloseID+1 #define OpenID AboutID+1 #define SaveID OpenID+1 #define SaveAsID SaveID+1 #define PrefID SaveAsID+1 #define PrintID PrefID+1 #define QuitID PrintID+1 #define SettingsID QuitID+1 #define PreviewID SettingsID+1 /********************************/ /* */ /* Alert String resource IDs */ /* */ /********************************/ #define AboutBox 1 #define noMemAvailable 2 #define noScannerFound 3 #define scannerNotReady 4

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*********************************************************************************************/ long doScan(bufferHandle, bufferSize, sWindowDef, Width, Length) Handle bufferHandle; unsigned long bufferSize, Width, Length; scannerWindowDef *sWindowDef; { extern Long (*Setup[])(); unsigned long requestCount, transferCount; Scanner_Open(); transferCount = (*Setup[Scanner_Type])(bufferHandle, bufferSize, sWindowDef, Width, Length); Scanner_Close(); return(transferCount); } long Setup_Apple(bufferHandle, bufferSize, sWindowDef, Width, Length) Handle bufferHandle; unsigned long bufferSize, Width, Length; scannerWindowDef *sWindowDef; { unsigned long requestCount, transferCount; Scanner_SetMode(); Scanner_SetHalfTones(); Scanner_DefWindow(sWindowDef); Scanner_Scan(); transferCount = Scanner_Read(*bufferHandle, bufferSize); return(transferCount); } long Setup_CPCScan(bufferHandle, bufferSize, sWindowDef, Width, Length) Handle bufferHandle; unsigned long bufferSize, Width, Length; scannerWindowDef *sWindowDef; { unsigned long requestCount, transferCount; transferCount = CPC_Scan(*bufferHandle, bufferSize, Width, Length); return(transferCount); }

File diff suppressed because one or more lines are too long

1307
scsi2/SCANNERSCSI.S Normal file

File diff suppressed because it is too large Load Diff