mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-18 21:06:07 +00:00
137 lines
3.1 KiB
Plaintext
137 lines
3.1 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF /A2OSX.BOOT/DRV/PIC.DRV
|
||
*--------------------------------------
|
||
.INB /A2OSX.DEV/INC/MACROS.I
|
||
.INB /A2OSX.DEV/INC/A2OSX.I
|
||
*--------------------------------------
|
||
ZPTmpPtr1 .EQ ZPDRV
|
||
*--------------------------------------
|
||
SIG.05 .EQ $48
|
||
SIG.07 .EQ $48
|
||
*--------------------------------------
|
||
* 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
|
||
*--------------------------------------
|
||
Dev.Detect >LDYA L.MSG.DETECT
|
||
>SYSCALL PrintFYA
|
||
|
||
stz ZPTmpPtr1
|
||
lda #$C1
|
||
sta ZPTmpPtr1+1
|
||
.1 ldy #5
|
||
lda (ZPTmpPtr1),y
|
||
cmp #SIG.05
|
||
bne .2
|
||
|
||
ldy #7
|
||
lda (ZPTmpPtr1),y
|
||
cmp #SIG.07
|
||
beq .3
|
||
|
||
.2 inc ZPTmpPtr1+1
|
||
lda ZPTmpPtr1+1
|
||
cmp #$C8
|
||
bne .1
|
||
|
||
>LDYA L.MSG.DETECT.KO
|
||
>SYSCALL PrintFYA
|
||
|
||
lda #DEVMGR.ERRNOHW Not Found in any slot, exiting
|
||
sec
|
||
rts
|
||
|
||
.3 lda ZPTmpPtr1+1
|
||
sta DEVSLOTCn
|
||
and #$0F
|
||
sta DEVSLOT0n
|
||
ora #$30
|
||
sta DEV.HEADER.NAME+4
|
||
asl
|
||
asl
|
||
asl
|
||
asl
|
||
sta DEVSLOTn0
|
||
|
||
>PUSHW L.DEV.HEADER.NAME
|
||
>LDYA L.MSG.DETECT.OK
|
||
>SYSCALL PrintFYA
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
MSG.DETECT >CSTR "Apple PIC (Parallel Interface Card).\n"
|
||
MSG.DETECT.OK >CSTR "PIC Installed As Device : %S\n"
|
||
MSG.DETECT.KO >CSTR "No PIC Found.\n"
|
||
*--------------------------------------
|
||
* Device Header (16 Bytes)
|
||
*--------------------------------------
|
||
DEV.HEADER cld
|
||
jmp (DRV.CS.START,x)
|
||
.DA #S.DEV.F.EVENT+S.DEV.F.COUT+S.DEV.F.CHAR
|
||
DEV.HEADER.NAME >PSTR "LPT1" NAME
|
||
.HS 00.00
|
||
.HS 00.00.00.00
|
||
*--------------------------------------
|
||
* Driver Code
|
||
*--------------------------------------
|
||
DRV.CS.START .DA OPEN
|
||
.DA GETEVENT
|
||
.DA COUT
|
||
.DA CLOSE
|
||
.DA GETINFO
|
||
.DA IRQ
|
||
L.DEVINFO .DA DEVINFO
|
||
.DA 0 end or relocation
|
||
*--------------------------------------
|
||
OPEN clc
|
||
rts
|
||
*--------------------------------------
|
||
GETEVENT lda #0
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
COUT clc
|
||
rts
|
||
*--------------------------------------
|
||
CLOSE clc
|
||
rts
|
||
*--------------------------------------
|
||
GETINFO >LDYA L.DEVINFO
|
||
IRQ clc
|
||
rts
|
||
*--------------------------------------
|
||
DRV.CS.END
|
||
DEVSLOT0n .BS 1
|
||
DEVSLOTCn .BS 1
|
||
DEVSLOTn0 .BS 1
|
||
DEVINFO .DA #S.DEVINFO.TYPE.CHAR
|
||
.DA #0
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE DRV/PIC.DRV.S
|
||
ASM
|