A2osX/DRV/DHGR.DRV.S.txt

347 lines
6.6 KiB
Plaintext
Raw Normal View History

2015-03-14 21:48:35 +00:00
PR#3
PREFIX /A2OSX.BUILD
LOMEM $A00
2015-03-14 21:48:35 +00:00
INC 1
AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
.TF /A2OSX.BUILD/DRV/DHGR.DRV
2015-03-14 21:48:35 +00:00
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/IO.I
.INB /A2OSX.BUILD/INC/LIBGFX.I
2015-03-14 21:48:35 +00:00
*--------------------------------------
ZPBase .EQ ZPDRV
ZPCount .EQ ZPDRV+2
ZPCountCol .EQ ZPDRV+4
ZPCountMod .EQ ZPDRV+5
2015-03-14 21:48:35 +00:00
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
2015-03-14 21:48:35 +00:00
*--------------------------------------
CS.START cld
2015-06-03 18:30:57 +00:00
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 PrintFYA
2015-06-03 18:30:57 +00:00
2016-06-21 15:29:27 +00:00
ldx #0
.1 txa
stz Shift0.hi,x
asl
rol Shift0.hi,x
lsr
sta Shift0.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .1
2016-06-21 15:29:27 +00:00
2016-06-22 15:29:43 +00:00
ldx #0
2016-06-21 15:29:27 +00:00
.2 lda Shift0.hi,x
sta Shift1.hi,x
lda Shift0.lo,x
asl
asl
rol Shift1.hi,x
lsr
sta Shift1.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .2
2016-06-21 15:29:27 +00:00
2016-06-22 15:29:43 +00:00
ldx #0
2016-06-21 15:29:27 +00:00
.3 lda Shift1.hi,x
sta Shift2.hi,x
lda Shift1.lo,x
asl
asl
rol Shift2.hi,x
lsr
sta Shift2.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .3
2016-06-21 15:29:27 +00:00
2016-06-22 15:29:43 +00:00
ldx #0
2016-06-21 15:29:27 +00:00
.4 lda Shift2.hi,x
sta Shift3.hi,x
lda Shift2.lo,x
asl
asl
rol Shift3.hi,x
lsr
sta Shift3.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .4
2016-06-21 15:29:27 +00:00
2016-06-22 15:29:43 +00:00
ldx #0
2016-06-21 15:29:27 +00:00
.5 lda Shift3.hi,x
sta Shift4.hi,x
lda Shift3.lo,x
asl
asl
rol Shift4.hi,x
lsr
sta Shift4.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .5
2016-06-21 15:29:27 +00:00
2016-06-22 15:29:43 +00:00
ldx #0
2016-06-21 15:29:27 +00:00
.6 lda Shift4.hi,x
sta Shift5.hi,x
lda Shift4.lo,x
asl
asl
rol Shift5.hi,x
lsr
sta Shift5.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .6
2016-06-21 15:29:27 +00:00
2016-06-22 15:29:43 +00:00
ldx #0
2016-06-21 15:29:27 +00:00
.7 lda Shift5.hi,x
sta Shift6.hi,x
lda Shift5.lo,x
asl
asl
rol Shift6.hi,x
lsr
sta Shift6.lo,x
inx
2016-06-22 15:29:43 +00:00
bpl .7
2016-06-21 15:29:27 +00:00
2015-06-03 18:30:57 +00:00
clc
rts
CS.END
MSG.DETECT >CSTR "Apple IIe/IIc DHGR Driver.\r\n"
2015-06-03 18:30:57 +00:00
*--------------------------------------
* Device Header (16 Bytes)
*--------------------------------------
DEV.HEADER cld
jmp (DRV.CS.START,x)
.DA #0
.BS 6
DEV.HEADER.NAME >PSTR "GFX"
.BS 1
2015-06-03 18:30:57 +00:00
*--------------------------------------
* Driver Code
*--------------------------------------
DRV.CS.START .DA STATUS
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA A2osX.BADCALL
.DA OPEN
2015-03-14 21:48:35 +00:00
.DA CLOSE
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
*--------------------------------------
2015-03-14 21:48:35 +00:00
.DA SETPIXEL
.DA GETPIXEL
.DA HLINE
.DA VLINE
.DA FILLRECT
2015-03-14 21:48:35 +00:00
.DA BITBLT
*--------------------------------------
L.STAT .DA STAT
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.Shift0.Lo .DA Shift0.lo
L.Shift0.Hi .DA Shift0.hi
L.DIVMOD7Y0 .DA DIVMOD7Y0
.DA DIVMOD7Y1
.DA DIVMOD7Y2
2015-03-14 21:48:35 +00:00
.DA 0 end or relocation
*--------------------------------------
STATUS >LDYA L.STAT
clc
rts
*--------------------------------------
OPEN sta A2osX.SCRNDEVS+2 DEV.ID in A
2016-10-07 20:48:49 +00:00
2016-07-22 14:11:13 +00:00
ldy #0
ldx #0
.1 lda L.DIV7.0,y
sta DIV7.lo,x
lda L.MOD7.0,y
2016-07-22 14:11:13 +00:00
sta MOD7.lo,x
2016-07-22 14:11:13 +00:00
iny
lda L.DIV7.0,y
sta DIV7.hi,x
2016-07-22 14:11:13 +00:00
lda L.MOD7.0,y
sta MOD7.hi,x
2016-07-22 14:11:13 +00:00
iny
inx
cpx #3
bne .1
ldx #7
lda L.Shift0.Lo+1
.10 sta Shiftlo.hi,x
inc
dex
bne .10
ldx #7
lda L.Shift0.hi+1
.11 sta Shifthi.hi,x
inc
dex
bne .11
.8 clc
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
CONTROL sta CLRTEXT
2016-06-07 06:10:18 +00:00
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
2016-06-07 06:10:18 +00:00
clc
rts
*--------------------------------------
CLOSE clc
rts
*--------------------------------------
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.PIX
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.LIN
.INB /A2OSX.SRC/DRV/DHGR.DRV.S.BLT
2016-06-15 15:58:45 +00:00
*--------------------------------------
* FILLRECT
* 2 : Mode
* 3 : Color
* 4 : SrcX1
* 6 : SrcY1
* 8 : SrcX2
* 10 : SrcY2
*--------------------------------------
FILLRECT >STYA ZPBase
ldy #S.CB.Y2
2016-06-15 15:58:45 +00:00
.1 lda (ZPBase),y
sta CB.Cache,y
2016-06-15 15:58:45 +00:00
dey
bpl .1
.2 jsr HLINE.I
lda CB.Cache+S.CB.Y1
cmp CB.Cache+S.CB.Y2
beq .8
2016-06-15 15:58:45 +00:00
inc CB.Cache+S.CB.Y1
bra .2
.8 rts
2016-06-15 15:58:45 +00:00
*--------------------------------------
* IN:
* Y = LO
* X = HI
* OUT:
* A = DIV
* X = MOD
*--------------------------------------
DIVMOD7YX jmp (L.DIVMOD7Y0,x)
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
2016-06-15 15:58:45 +00:00
clc
adc #$49
ldx MOD7.512,y
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
2015-06-03 18:30:57 +00:00
DRV.CS.END
*--------------------------------------
Shift0.lo .BS 128
Shift0.hi .BS 128
Shift1.lo .BS 128
Shift1.hi .BS 128
Shift2.lo .BS 128
Shift2.hi .BS 128
Shift3.lo .BS 128
Shift3.hi .BS 128
Shift4.lo .BS 128
Shift4.hi .BS 128
Shift5.lo .BS 128
Shift5.hi .BS 128
2016-06-22 15:29:43 +00:00
Shift6.lo .BS 128
Shift6.hi .BS 128
*--------------------------------------
.INB /A2OSX.SRC/DRV/DHGR.DRV.T
*--------------------------------------
DIV7.lo .BS 3
DIV7.hi .BS 3
2016-07-22 14:11:13 +00:00
MOD7.lo .BS 3
MOD7.hi .BS 3
Shiftlo.hi .BS 7
Shifthi.hi .BS 7
2015-03-14 21:48:35 +00:00
*--------------------------------------
CB.Cache .BS S.CB
*--------------------------------------
XDIV7 .BS 1
XMOD7 .BS 1
XCOL7 .BS 1
2015-03-23 17:09:21 +00:00
GBYTE .BS 1
2015-03-14 21:48:35 +00:00
*--------------------------------------
STAT .DA #0
.DA #0,#0,#0
>PSTR "Apple II DHGR"
.BS 3
.DA #S.DEVSTAT.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
2016-06-22 21:12:09 +00:00
*--------------------------------------
2016-06-21 15:29:27 +00:00
DRV.SIZE .EQ *-DRV.CS.START
2016-06-22 21:12:09 +00:00
*--------------------------------------
2016-06-21 15:29:27 +00:00
.LIST OFF
2015-03-14 21:48:35 +00:00
MAN
SAVE /A2OSX.SRC/DRV/DHGR.DRV.S
2015-03-14 21:48:35 +00:00
ASM