This commit is contained in:
Antoine Vignau 2024-08-17 21:08:20 +02:00
commit 35a4953478

View File

@ -32,18 +32,25 @@ devSCANNER = $001a
maxDEVICES = 8 maxDEVICES = 8
dcINQUIRY = $8012 dcEXPLORE = $800e ; status
doMODESELECT = $8015 dcINQUIRY = $8012 ; status
dcMODESELECT = $8015
dcMODESENSE6 = $801a dcMODESENSE6 = $801a
dcSTARTSTOP = $801b ; also eject/insert dcSTARTSTOP = $801b ; also eject/insert
dcGETWINDOW24 = $8024 ; for scanner dcSETWINDOWPARAMETERS = $8024 ; for scanner (control)
dcGETWINDOW25 = $8025 ; for scanner dcGETWINDOWPARAMETERS = $8025 ; for scanner (status)
dcREADCAPACITY = $8025
dcSUBCHANNEL = $8042 stEXPLORE = $0e ; status
dcREADTOC = $8043 stINQUIRY = $12 ; status
dcPATI = $8048 stMODESELECT = $15
dcPAUSERESUME = $804b stMODESENSE6 = $1a
dcMODESENSE10 = $805a stSTARTSTOP = $1b ; also eject/insert
stSETWINDOWPARAMETERS = $24 ; for scanner (control)
stGETWINDOWPARAMETERS = $25 ; for scanner (status)
DInfo = $202c
DStatus = $202d
DControl = $202e
*---------- *----------
@ -119,18 +126,6 @@ dcMODESENSE10 = $805a
PushWord #$0c ; home PushWord #$0c ; home
_WriteChar _WriteChar
* DEBUG
lda #proSTATUS
stal $300
lda #^proSTATUS
stal $302
lda #proCONTROL
stal $310
lda #^proCONTROL
stal $312
*---------------------------- *----------------------------
* MAIN MENU * MAIN MENU
*---------------------------- *----------------------------
@ -339,30 +334,58 @@ deviceMENU2 cmp #"5"+1
deviceMENU3 jsr $bdbd deviceMENU3 jsr $bdbd
jmp deviceMENU jmp deviceMENU
ptrCOMMANDS da doINQUIRY ptrCOMMANDS
da doGWP2424 da doINQUIRY
da doGWP2425 da doMODESENSE6
da doGWP2524 da doEXPLORE
da doGWP2525 da doGETMODE
da doGETWINDOWPARAMETERS
*--- Data *--- Data
strDEVICEMENU asc 0d'Using SCSI Scanner device $' strDEVICEMENU
strDEVMENU asc '0000'0d asc 0d'Using SCSI Scanner device $'
strDEVMENU
asc '0000'0d
asc ' 0. Go back to previous menu'0d asc ' 0. Go back to previous menu'0d
asc ' 1. Inquiry'0d asc ' 1. Inquiry'0d
asc ' 2. Get Window Parameters 24/24'0d asc ' 2. Mode Sense (6)'0d
asc ' 3. Get Window Parameters 24/25'0d asc ' 3. Exploratory status'0d
asc ' 4. Get Window Parameters 25/24'0d asc ' 4. Get mode'0d
asc ' 5. Get Window Parameters 25/25'0d asc ' 5. Get Window Parameters'0d
asc 00 asc 00
*----------------
* APPLE SCANNERS
*
* Scanner (300dpi 4-bit grey)
* 06 00 02 02 2C 00 00 00 'APPLE SCANNER A9M0337 '
* 06 00 02 02 28 00 00 00 'CPC INC Smart Scan(FW) '
*
* OneScanner (300dpi 8-bit grey)
* 06 00 02 02 2C 20 04 08 'APPLE SCANNER II 2.02'
* 00 20 00 90 00 27 34 01 08 A0 48 00 FF FF
*
* Color OneScanner (300dpi 24-bit color)
*
*
* Color OneScanner 600/27 (600dpi 27-bit color)
* 06 00 02 02 1F 00 00 10 'CANON IX-03035B 1.01' FF
*
* Color OneScanner 1200/30 (1200dpi 30-bit color)
* 06 00 02 02 1F 00 00 10 'CANON IX-06015C 1.07' FF
*
* ---End of list
*---------------- *----------------
* SCSI COMMANDS * SCSI COMMANDS
*---------------- *----------------
doINQUIRY = * *-----------------------
* STATUS $8012 - INQUIRY
*-----------------------
doINQUIRY
jsr initSTATUSDATA jsr initSTATUSDATA
ldx #6-2 ; put the inquiry data ldx #6-2 ; put the inquiry data
@ -616,7 +639,7 @@ doINQUIRY1
*--- Data *--- Data
scsiINQUIRY hex 12,00,00,00,00,00 scsiINQUIRY hex 12,00,00,00,F0,00
strPQ asc 0d' Peripheral qualifier: '00 strPQ asc 0d' Peripheral qualifier: '00
strPDT asc ' - Peripheral device type : '00 strPDT asc ' - Peripheral device type : '00
@ -639,28 +662,203 @@ strVI asc 0d' Vendor identification: '00
strPI asc 0d' Product identification: '00 strPI asc 0d' Product identification: '00
strPRL asc 0d' Product revision level: '00 strPRL asc 0d' Product revision level: '00
*---------------- *-----------------------
* STATUS $801A - MODE SENSE (6)
*-----------------------
doGWP2424 lda #dcGETWINDOW24 doMODESENSE6
ldx #$24 jsr initSTATUSDATA
bra doGETWINDOW
doGWP2425 lda #dcGETWINDOW24 ldx #6-2 ; put the inquiry data
ldx #$25 ]lp lda scsiMODESENSE6,x
bra doGETWINDOW sta statusDATA,x
dex
dex
bpl ]lp
doGWP2524 lda #dcGETWINDOW25 lda #doMODESENSE6
ldx #$24 stal $300
bra doGETWINDOW lda #^doMODESENSE6
stal $302
doGWP2525 lda #dcGETWINDOW25 lda #dcMODESENSE6
ldx #$25 jsr statusCALL
jmp waitKEY
doGETWINDOW sta doGETWIN0+1 *--- Data
sep #$10
stx scsiGETWIN
rep #$10
scsiMODESENSE6
hex 1A,00,3F,00,F0,00
* 00_11_1111
*-----------------------
* BLINK BORDER
*-----------------------
blinkBORDER
sep #$20
ldal $c034
inc
stal $c034
rep #$20
rts
*-----------------------
* STATUS $800E - EXPLORE (NOT DESCRIBED BY APPLE)
*-----------------------
doEXPLORE
jsr getDEVICEID
sta proEXPLORE+2
jsl GSOS
dw DStatus
adrl proEXPLORE
bcc doEXPLORE1
jsr blinkBORDER
doEXPLORE1
*--- Display status
PushLong #strXSTATUS
_WriteCString
lda expBUFF
jsr showBYTE
*--- Display rate
PushLong #strTRATE
_WriteCString
lda expBUFF+1
xba
jsr showWORD
jmp waitKEY
*--- Data
proEXPLORE dw 5
ds 2
dw $800E
adrl exploreBUFF
adrl 12
ds 4
exploreBUFF dw 0
hex 0e
hex 00,00,00
dfb 12
hex 00,00,00,00,00,00,00
adrl expBUFF
expBUFF ds 12
strXSTATUS asc 0d' Status: '00
strTRATE asc 0d' Rate: '00
*-----------------------
* STATUS $801A - MODE SENSE 6
*-----------------------
doGETMODE jsr getDEVICEID
sta proGETMODE+2
jsl GSOS
dw DStatus
adrl proGETMODE
bcc doGETMODE1
jsr blinkBORDER
doGETMODE1
*--- Display Type
PushLong #strTYPE
_WriteCString
lda gmBUFF+4
and #$ff
cmp #$80
bcs doPAGETYPE
PushLong #strTYPEH
_WriteCString
bra doGETMODE2
doPAGETYPE PushLong #strTYPEP
_WriteCString
*--- Display Page control
doGETMODE2 PushLong #strPAGECTL
_WriteCString
lda gmBUFF+6
jsr showBYTE
*--- Display Hand control
PushLong #strHANDCTL
_WriteCString
lda gmBUFF+7
jsr showBYTE
*--- Display Bytes per line
PushLong #strSCANLEN
_WriteCString
lda gmBUFF+8
xba
jsr showWORD
*--- Display Shutoff timer
PushLong #strTIMER
_WriteCString
lda gmBUFF+10
xba
jsr showWORD
jmp waitKEY
*--- Data
proGETMODE dw 5
ds 2
dw $801A
adrl getmodeBUFF
adrl 12
ds 4
getmodeBUFF dw 0
hex 1A
hex 00,00,00
dfb 12
hex 00,00,00,00,00,00,00
adrl gmBUFF
gmBUFF ds 12
strTYPE asc 0d'Scanner type: '00
strTYPEP asc 'Page'00
strTYPEH asc 'Hand'00
strPAGECTL asc 0d'Page control: '00
strHANDCTL asc 0d'Hand control: '00
strSCANLEN asc 0d'Byter per line: '00
strTIMER asc 0d'Shutoff timer: '00
*-----------------------
* STATUS $8025 - GET WINDOW PARAMETERS
*-----------------------
doGETWINDOWPARAMETERS
jsr initSTATUSDATA jsr initSTATUSDATA
ldx #10-2 ; put the getwindow data ldx #10-2 ; put the getwindow data
@ -670,13 +868,21 @@ doGETWINDOW sta doGETWIN0+1
dex dex
bpl ]lp bpl ]lp
doGETWIN0 lda #dcGETWINDOW24 lda #dcGETWINDOWPARAMETERS
jsr statusCALL jsr statusCALL
bcc doGETWINDOW1 bcc doGETWINDOW1
rts rts
doGETWINDOW1 doGETWINDOW1
PushLong #strGWXRES
_WriteCString
ldy #2
lda [Debut],y
xba
jsr showWORD
*--- Check response length *--- Check response length
lda #statusBUFF lda #statusBUFF
@ -907,7 +1113,7 @@ okGWCT asl
*--- Data *--- Data
scsiGETWIN hex 25,00,00,00,00,00,00,00,00,00 scsiGETWIN hex 25,00,00,00,F0,00,00,00,00,00
strGWID asc 0d'Window identifier: $'00 strGWID asc 0d'Window identifier: $'00
strGWXRES asc 0d'X-Axis resolution: $'00 strGWXRES asc 0d'X-Axis resolution: $'00
@ -1038,6 +1244,11 @@ showERR bcc showNOERR
sec ; force carry sec ; force carry
showNOERR rts showNOERR rts
*--- Get my Device ID
getDEVICEID lda theDEVICE ; get our ID
rts
*---------------------------- *----------------------------
* TEXT ROUTINES * TEXT ROUTINES
*---------------------------- *----------------------------
@ -1047,10 +1258,10 @@ showNOERR rts
* X: nb of chars to print * X: nb of chars to print
* offset from commandBUFF * offset from commandBUFF
showTEXT ldy #^commandBUFF showTEXT ldy #^statusBUFF
phy phy
clc clc
adc #commandBUFF adc #statusBUFF
pha pha
PushWord #0 PushWord #0
phx phx
@ -1254,7 +1465,7 @@ proSTATUS dw 5 ; 00 pcount
ds 2 ; 02 device num ds 2 ; 02 device num
dw $8000 ; 04 status/control code dw $8000 ; 04 status/control code
adrl statusLIST ; 06 status list adrl statusLIST ; 06 status list
adrl 1024 ; 0A request count adrl 240 ; 0A request count (AVI was 1024/32)
ds 4 ; 0E transfer count ds 4 ; 0E transfer count
statusLIST ds 2 ; always 0000 statusLIST ds 2 ; always 0000
@ -1262,7 +1473,7 @@ statusDATA hex 00 ; 00
hex 00 ; 01 hex 00 ; 01
hex 00 ; 02 hex 00 ; 02
hex 00 ; 03 hex 00 ; 03
hex 00 ; 04 dfb 240 ; 04 - (AVI was $00)
hex 00 ; 05 hex 00 ; 05
hex 00 ; 06 hex 00 ; 06
hex 00 ; 07 hex 00 ; 07
@ -1271,13 +1482,13 @@ statusDATA hex 00 ; 00
hex 00 ; 10 hex 00 ; 10
hex 00 ; 11 hex 00 ; 11
adrl statusBUFF adrl statusBUFF
statusBUFF ds 1234 ; more than 1024 statusBUFF ds 256 ; more than 240
proCONTROL dw 5 ; 00 pcount proCONTROL dw 5 ; 00 pcount
ds 2 ; 02 device num ds 2 ; 02 device num
dw $8000 ; 04 status/control code dw $8000 ; 04 status/control code
adrl controlLIST ; 06 status list adrl controlLIST ; 06 status list
adrl 1024 ; 0A request count adrl 240 ; 0A request count
ds 4 ; 0E transfer count ds 4 ; 0E transfer count
controlLIST ds 2 ; always 0000 controlLIST ds 2 ; always 0000
@ -1285,7 +1496,7 @@ commandDATA hex 00 ; 00
hex 00 ; 01 hex 00 ; 01
hex 00 ; 02 hex 00 ; 02
hex 00 ; 03 hex 00 ; 03
hex 00 ; 04 dfb 240 ; 04
hex 00 ; 05 hex 00 ; 05
hex 00 ; 06 hex 00 ; 06
hex 00 ; 07 hex 00 ; 07
@ -1294,7 +1505,7 @@ commandDATA hex 00 ; 00
hex 00 ; 10 hex 00 ; 10
hex 00 ; 11 hex 00 ; 11
commandPTR adrl commandBUFF commandPTR adrl commandBUFF
commandBUFF ds 1234 ; more than 1024 commandBUFF ds 256 ; more than 240
*---------- *----------