2016-03-18 07:26:49 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2016-03-18 07:26:49 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/DRV/PIC.DRV
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MLI.ERR.I
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPTmpPtr1 .EQ ZPDRV
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp Dev.Detect cld,jmp abs=DRV
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 DRV Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length
|
|
|
|
|
.DA DEV.HEADER-CS.START Device Header Offset
|
|
|
|
|
.DA DRV.CS.START-CS.START Driver Code Offset
|
|
|
|
|
.DA DRV.CS.END-DRV.CS.START Drv Code Length
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.MSG.DETECT .DA MSG.DETECT
|
|
|
|
|
L.MSG.DETECT.OK .DA MSG.DETECT.OK
|
|
|
|
|
L.MSG.DETECT.KO .DA MSG.DETECT.KO
|
|
|
|
|
L.DEV.HEADER.NAME .DA DEV.HEADER.NAME
|
|
|
|
|
.DA 0 End Of Reloc Table
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
Dev.Detect >STYA ARGS
|
|
|
|
|
>LDYA L.MSG.DETECT
|
2017-08-22 06:37:03 +00:00
|
|
|
|
>SYSCALL PrintFYA
|
2016-10-17 15:47:50 +00:00
|
|
|
|
|
|
|
|
|
stz ZPTmpPtr1
|
2016-03-18 07:26:49 +00:00
|
|
|
|
lda #$C1
|
|
|
|
|
sta ZPTmpPtr1+1
|
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.1 and #$0f
|
|
|
|
|
tay
|
|
|
|
|
lda A2osX.SLOTS,y
|
|
|
|
|
bne .3
|
2016-03-18 07:26:49 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
ldx #DEVSIG.Length-1
|
|
|
|
|
|
|
|
|
|
.2 ldy DEVSIG.Offset,x
|
|
|
|
|
lda (ZPTmpPtr1),y
|
|
|
|
|
cmp DEVSIG.Value,x
|
|
|
|
|
bne .3
|
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
bra .4
|
|
|
|
|
|
|
|
|
|
.3 inc ZPTmpPtr1+1 no match, try next slot....
|
2016-03-18 07:26:49 +00:00
|
|
|
|
lda ZPTmpPtr1+1
|
|
|
|
|
cmp #$C8
|
|
|
|
|
bne .1
|
2017-04-14 15:04:39 +00:00
|
|
|
|
|
2016-03-18 07:26:49 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.KO
|
2017-08-22 06:37:03 +00:00
|
|
|
|
>SYSCALL PrintFYA
|
2016-03-18 07:26:49 +00:00
|
|
|
|
|
2017-04-14 15:04:39 +00:00
|
|
|
|
lda #MLI.ERR.NODEV Not Found in any slot, exiting
|
2016-03-18 07:26:49 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2017-04-14 15:04:39 +00:00
|
|
|
|
|
|
|
|
|
.4 lda ZPTmpPtr1+1
|
2016-03-18 07:26:49 +00:00
|
|
|
|
and #$0F
|
2017-04-14 15:04:39 +00:00
|
|
|
|
pha
|
|
|
|
|
tay
|
|
|
|
|
lda #A2osX.SLOTS.COM
|
|
|
|
|
sta A2osX.SLOTS,y
|
|
|
|
|
pla
|
2016-03-18 07:26:49 +00:00
|
|
|
|
ora #$30
|
|
|
|
|
sta DEV.HEADER.NAME+4
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
asl
|
|
|
|
|
sta DEVSLOTn0
|
2017-04-14 15:04:39 +00:00
|
|
|
|
|
2016-10-17 15:47:50 +00:00
|
|
|
|
>PUSHW L.DEV.HEADER.NAME
|
2016-03-18 07:26:49 +00:00
|
|
|
|
>LDYA L.MSG.DETECT.OK
|
2017-08-22 06:37:03 +00:00
|
|
|
|
>SYSCALL PrintFYA
|
2016-03-18 07:26:49 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2017-04-14 15:04:39 +00:00
|
|
|
|
DEVSIG.Offset .HS 0507
|
|
|
|
|
DEVSIG.Value .HS 4848
|
|
|
|
|
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
|
2017-04-17 19:36:00 +00:00
|
|
|
|
MSG.DETECT >CSTR "Apple PIC (Parallel Interface Card).\r\n"
|
|
|
|
|
MSG.DETECT.OK >CSTR "PIC Installed As Device : %S\r\n"
|
|
|
|
|
MSG.DETECT.KO >CSTR "No PIC Found.\r\n"
|
2017-04-14 15:04:39 +00:00
|
|
|
|
ARGS .BS 2
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Device Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DEV.HEADER cld
|
|
|
|
|
jmp (DRV.CS.START,x)
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA #S.DEV.S.WRITE
|
|
|
|
|
.BS 6
|
|
|
|
|
DEV.HEADER.NAME >PSTR "LPT1"
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Driver Code
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
DRV.CS.START .DA STATUS
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
|
|
|
|
.DA A2osX.BADCALL
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA CONTROL
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA OPEN
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA CLOSE
|
2017-07-06 15:30:40 +00:00
|
|
|
|
.DA A2osX.BADCALL
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA WRITE
|
|
|
|
|
L.STAT .DA STAT
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA 0 end or relocation
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
STATUS >LDYA L.STAT
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
CONTROL
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
OPEN
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-04-14 15:04:39 +00:00
|
|
|
|
CLOSE
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
WRITE
|
|
|
|
|
clc
|
2016-03-18 07:26:49 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DRV.CS.END
|
|
|
|
|
DEVSLOT0n .BS 1
|
|
|
|
|
DEVSLOTCn .BS 1
|
|
|
|
|
DEVSLOTn0 .BS 1
|
2017-04-14 15:04:39 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
STAT .DA #S.DEVSTAT.S.WRITE
|
|
|
|
|
.DA #0,#0,#0
|
|
|
|
|
>PSTR "Parallel Card"
|
|
|
|
|
.DA #0,#0,#0
|
2017-06-02 15:14:42 +00:00
|
|
|
|
.DA #S.DEVSTAT.T.CHAR
|
2016-03-18 07:26:49 +00:00
|
|
|
|
.DA #0
|
2017-04-14 15:04:39 +00:00
|
|
|
|
.DA $0900
|
2016-03-18 07:26:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-04-14 15:04:39 +00:00
|
|
|
|
SAVE /A2OSX/SRC/DRV/PIC.DRV.S
|
2016-03-18 07:26:49 +00:00
|
|
|
|
ASM
|