mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-10 02:36:59 +00:00
277 lines
5.9 KiB
Plaintext
277 lines
5.9 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.BUILD
|
||
LOMEM $A00
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF /A2OSX.BUILD/DRV/DHGR.DRV
|
||
*--------------------------------------
|
||
.INB /A2OSX.BUILD/INC/MACROS.I
|
||
.INB /A2OSX.BUILD/INC/A2OSX.I
|
||
.INB /A2OSX.BUILD/INC/IO.I
|
||
.INB /A2OSX.BUILD/INC/LIBGUI.I
|
||
*--------------------------------------
|
||
ZPCmdPtr .EQ ZPDRV
|
||
ZPBasePtr .EQ ZPDRV+2
|
||
ZPPalettePtr .EQ ZPDRV+4
|
||
ZPBMDataPtr .EQ ZPDRV+6
|
||
ZPBMMaskPtr .EQ ZPDRV+8
|
||
*--------------------------------------
|
||
* 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
|
||
.DA 0 End Of Reloc Table
|
||
*--------------------------------------
|
||
Dev.Detect >LDYA L.MSG.DETECT
|
||
>SYSCALL PrintF.YA
|
||
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
MSG.DETECT >CSTR "Apple IIe/IIc DHGR Driver.\r\n"
|
||
*--------------------------------------
|
||
* Device Header (16 Bytes)
|
||
*--------------------------------------
|
||
DEV.HEADER cld
|
||
jmp (DRV.CS.START,x)
|
||
.DA #0
|
||
.BS 6
|
||
DEV.HEADER.NAME >CSTR "GFX"
|
||
.BS 1
|
||
*--------------------------------------
|
||
* Driver Code
|
||
*--------------------------------------
|
||
DRV.CS.START .DA STATUS
|
||
.DA A2osX.BADCALL
|
||
.DA A2osX.BADCALL
|
||
.DA A2osX.BADCALL
|
||
.DA CONTROL
|
||
.DA A2osX.BADCALL
|
||
.DA OPEN
|
||
.DA CLOSE
|
||
.DA A2osX.BADCALL
|
||
.DA WRITE
|
||
.DA A2osX.BADCALL
|
||
*--------------------------------------
|
||
J.Cmds .DA SETPIXEL
|
||
.DA GETPIXEL
|
||
.DA HLINE
|
||
.DA VLINE
|
||
.DA FILLRECT
|
||
.DA BITBLT
|
||
*--------------------------------------
|
||
L.DSTAT .DA DSTAT
|
||
L.DIV7.0 .DA DIV7.0
|
||
.DA DIV7.256
|
||
.DA DIV7.512
|
||
L.MOD7.0 .DA MOD7.0
|
||
.DA MOD7.256
|
||
.DA MOD7.512
|
||
L.Color.Pixels .DA Color.Pixels
|
||
.DA 0 end or relocation
|
||
*--------------------------------------
|
||
STATUS >LDYA L.DSTAT
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
OPEN sta A2osX.SCRNDEVS+2 DEV.ID in A
|
||
|
||
ldy #0
|
||
ldx #0
|
||
|
||
.1 lda L.DIV7.0,y
|
||
sta DIV7.lo,x
|
||
lda L.MOD7.0,y
|
||
sta MOD7.lo,x
|
||
|
||
iny
|
||
|
||
lda L.DIV7.0,y
|
||
sta DIV7.hi,x
|
||
lda L.MOD7.0,y
|
||
sta MOD7.hi,x
|
||
|
||
iny
|
||
inx
|
||
cpx #3
|
||
bne .1
|
||
*--------------------------------------
|
||
CONTROL sta CLRTEXT
|
||
sta CLRMIXED
|
||
sta SETHIRES
|
||
sta CLR80STORE
|
||
sta CLRPAGE2
|
||
sta SETIOUDIS
|
||
sta SETDHIRES
|
||
|
||
* sta CLR80DISP
|
||
* sta SETDHIRES
|
||
* sta CLRDHIRES
|
||
* sta SET80DISP
|
||
* sta SETDHIRES
|
||
* sta CLRDHIRES
|
||
* sta SETDHIRES
|
||
|
||
lda #3
|
||
sta A2osX.ASCREEN
|
||
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
CLOSE clc
|
||
rts
|
||
*--------------------------------------
|
||
WRITE >STYA ZPCmdPtr
|
||
|
||
sta SETHIRES Make sure SET80STORE active a $2000
|
||
sta SET80STORE
|
||
|
||
lda (ZPCmdPtr) Get Cmd
|
||
|
||
.1 tax
|
||
ldy CB.CmdLen,x
|
||
|
||
.2 lda (ZPCmdPtr),y
|
||
sta CB.Cache,y
|
||
dey
|
||
bpl .2
|
||
|
||
.3 jsr .10
|
||
|
||
sta CLR80STORE
|
||
|
||
clc
|
||
rts
|
||
|
||
.10 jmp (J.Cmds,x)
|
||
*--------------------------------------
|
||
* IN:
|
||
* Y = LO
|
||
* A = HI
|
||
* OUT:
|
||
* A = DIV
|
||
* X = MOD
|
||
*--------------------------------------
|
||
DIVMOD7YA dec
|
||
beq DIVMOD7Y1
|
||
bpl DIVMOD7Y2
|
||
|
||
DIVMOD7Y0 lda DIV7.0,y
|
||
ldx MOD7.0,y
|
||
rts
|
||
|
||
DIVMOD7Y1 lda DIV7.256,y
|
||
clc
|
||
adc #$24
|
||
ldx MOD7.256,y
|
||
rts
|
||
|
||
DIVMOD7Y2 lda DIV7.512,y
|
||
clc
|
||
adc #$49
|
||
ldx MOD7.512,y
|
||
rts
|
||
*--------------------------------------
|
||
* IN:
|
||
* Y,A = num1 (16)
|
||
* X = num2 (8)
|
||
* OUT:
|
||
* Y,A = (Y,A) * X
|
||
*--------------------------------------
|
||
YAMultX stx GBYTE
|
||
|
||
sty GWORD
|
||
sta GWORD+1
|
||
|
||
ldy #0 Result LO
|
||
tya Result HI
|
||
|
||
bra .3
|
||
|
||
.1 pha
|
||
tya
|
||
clc
|
||
adc GWORD
|
||
tay
|
||
pla
|
||
adc GWORD+1
|
||
|
||
.2 asl GWORD
|
||
rol GWORD+1
|
||
|
||
.3 lsr GBYTE
|
||
bcs .1
|
||
bne .2
|
||
rts
|
||
*--------------------------------------
|
||
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.PIX
|
||
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.LINE
|
||
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.RECT
|
||
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.BLT
|
||
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.LBUF
|
||
*--------------------------------------
|
||
DRV.CS.END
|
||
*--------------------------------------
|
||
.INB /A2OSX.SRC/DRV/DHGR.DRV.T
|
||
*--------------------------------------
|
||
CB.CmdLen .DA S.CB.Y1+1 SETPIXEL
|
||
.DA S.CB.Y1+1 GETPIXEL
|
||
.DA S.CB.X2+1 HLINE
|
||
.DA S.CB.Y2+1 VLINE
|
||
.DA S.CB.Y2+1 FILLRECT
|
||
.DA S.CB.DstPtr+1 BITBLT
|
||
*--------------------------------------
|
||
CB.Cache .BS S.CB
|
||
BM.Cache .BS S.BM
|
||
*--------------------------------------
|
||
DIV7.lo .BS 3
|
||
DIV7.hi .BS 3
|
||
MOD7.lo .BS 3
|
||
MOD7.hi .BS 3
|
||
*--------------------------------------
|
||
LBUF.C1 .BS 1
|
||
LBUF.C1.MASK .BS 1 Bits to CLR in VMEM : 11100000 00000000 00111111
|
||
LBUF.C1.DATA .BS 1 Bits to SET/ORA/XOR : 000ccccc cccccccc cc000000
|
||
LBUF.C2 .BS 1 C1 C2
|
||
LBUF.C2.MASK .BS 1
|
||
LBUF.C2.DATA .BS 1
|
||
LBUF.MASK .BS 80
|
||
LBUF.DATA .BS 80
|
||
*--------------------------------------
|
||
XDIV7 .BS 1
|
||
XMOD7 .BS 1
|
||
XCOL7 .BS 1
|
||
GBYTE .BS 1
|
||
GWORD .BS 2
|
||
*--------------------------------------
|
||
DSTAT .DA #0
|
||
.DA #0,#0,#0
|
||
>PSTR "Apple II DHGR"
|
||
.BS 3
|
||
.DA #S.DSTAT.T.GFX
|
||
.DA #0
|
||
.DA $0900
|
||
*--------------------------------------
|
||
DEVSTAT.MODES .DA #S.CB.MODE.MONO+S.CB.MODE.C16
|
||
DEVSTAT.W .DA 560 X.SIZE
|
||
DEVSTAT.H .DA 192 Y.SIZE
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/DRV/DHGR.DRV.S
|
||
ASM
|