A2osX/BIN/GTEST.S.txt

284 lines
5.4 KiB
Plaintext
Raw Normal View History

2019-07-30 15:35:42 +00:00
NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/GTEST
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB INC/GFX.I
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
hDevGFX .BS 1
hFont .BS 1
2019-08-06 07:14:22 +00:00
hFontB .BS 1
2019-07-30 15:35:42 +00:00
ZS.END
.ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 #S.PS.F.EVENT S.PS.F
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data Segment Size
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.DEVNAME.GFX .DA DEVNAME.GFX
L.FONTFILE .DA FONTFILE
2019-08-06 15:58:01 +00:00
L.FONTFILEB .DA FONTFILEB
2019-08-06 07:14:22 +00:00
L.PIXFILE .DA PIXFILE
2019-07-30 15:35:42 +00:00
L.CB.RECT .DA CB.RECT
2019-08-06 15:58:01 +00:00
L.CB.TEXTB .DA CB.TEXTB
2019-07-30 15:35:42 +00:00
L.CB.TEXT .DA CB.TEXT
2019-08-06 07:14:22 +00:00
L.CB.PIX .DA CB.PIX
2019-07-30 15:35:42 +00:00
L.CB.Apple .DA CB.Apple
L.BM.Apple .DA BM.Apple
2019-08-06 15:58:01 +00:00
L.MESSAGEB .DA MESSAGEB
2019-07-30 15:35:42 +00:00
L.MESSAGE .DA MESSAGE
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN jsr GFX.Open
2019-08-06 15:58:01 +00:00
bcs .9
2019-07-30 15:35:42 +00:00
2019-08-06 15:58:01 +00:00
jsr LoadResources
bcs .9
2019-08-06 07:14:22 +00:00
2019-07-30 15:35:42 +00:00
>LDYA L.CB.RECT
jsr GFX.Write.YA
2019-08-06 15:58:01 +00:00
2019-07-30 15:35:42 +00:00
>LDYA L.BM.Apple
>STYA CB.Apple+S.CB.SrcPtr
2019-08-06 07:14:22 +00:00
>LDYA L.CB.PIX
jsr GFX.Write.YA
2019-08-06 15:58:01 +00:00
2019-07-30 15:35:42 +00:00
>LDYA L.CB.Apple
jsr GFX.Write.YA
2019-08-02 14:36:49 +00:00
2019-08-06 15:58:01 +00:00
lda hFontB
sta CB.TEXTB+S.CB.hFont
>LDYA L.MESSAGEB
>STYA CB.TEXTB+S.CB.TxtPtr
>LDYA L.CB.TEXTB
>SYSCALL OSD
bcs .9
>LDYA L.CB.TEXTB
jsr GFX.Write.YA
2019-08-06 07:14:22 +00:00
lda hFont
sta CB.TEXT+S.CB.hFont
2019-08-06 15:58:01 +00:00
2019-08-06 07:14:22 +00:00
>LDYA L.MESSAGE
>STYA CB.TEXT+S.CB.TxtPtr
2019-08-06 15:58:01 +00:00
2019-08-06 07:14:22 +00:00
>LDYA L.CB.TEXT
>SYSCALL OSD
bcs .9
>LDYA L.CB.TEXT
jsr GFX.Write.YA
2019-07-30 15:35:42 +00:00
lda #0
sec
.9 rts
*--------------------------------------
CS.DOEVENT clc
rts
*--------------------------------------
CS.QUIT lda hFont
2019-08-02 14:36:49 +00:00
beq .1
2019-07-30 15:35:42 +00:00
>SYSCALL FreeStkObj
2019-08-06 07:14:22 +00:00
.1 lda hFontB
2019-08-06 15:58:01 +00:00
beq .2
2019-08-06 07:14:22 +00:00
>SYSCALL FreeStkObj
2019-08-06 15:58:01 +00:00
.2 lda CB.PIX+S.CB.SrcPtr
2019-08-06 07:14:22 +00:00
beq .3
>SYSCALL FreeStkObj
.3
lda hDevGFX
beq .8
2019-08-02 14:36:49 +00:00
* >DEBUG
* >SYSCALL close
* >DEBUG
2019-08-06 07:14:22 +00:00
.8
2019-08-02 14:36:49 +00:00
clc
2019-07-30 15:35:42 +00:00
rts
*--------------------------------------
2019-08-06 15:58:01 +00:00
LoadResources >PUSHWZ Aux type
>PUSHBI $CC Type
>PUSHBI O.RDONLY
>LDYA L.FONTFILE
>SYSCALL LoadStkObj
bcs .9
stx hFont
>PUSHWZ Aux type
>PUSHBI $CC Type
>PUSHBI O.RDONLY
>LDYA L.FONTFILEB
>SYSCALL LoadStkObj
bcs .9
stx hFontb
>PUSHWZ Aux type
>PUSHBI $CB Type
>PUSHBI O.RDONLY
>LDYA L.PIXFILE
>SYSCALL LoadStkObj
bcs .9
stx CB.PIX+S.CB.SrcPtr
.9 rts
*--------------------------------------
2019-07-30 15:35:42 +00:00
GFX.Open >PUSHBI 0
>LDYA L.DEVNAME.GFX
>SYSCALL open
bcs .9
sta hDevGFX
.9 rts
*--------------------------------------
GFX.Write.YA >PUSHYA
>PUSHBI IOCTL.WRITE
lda hDevGFX
>SYSCALL IOCTL
rts
*--------------------------------------
CS.END
DEVNAME.GFX .AZ "/DEV/GFX"
2019-08-06 15:58:01 +00:00
FONTFILE .AZ "${ROOT}SBIN/GUI/SYSX7"
FONTFILEB .AZ "${ROOT}SBIN/GUI/SYSX7B"
2019-08-06 07:14:22 +00:00
PIXFILE .AZ "${ROOT}ROOT/GUITEST/MARILYN"
2019-08-06 15:58:01 +00:00
MESSAGEB .AZ " DHGR Driver & OSD 'Off-Screen Driver' Test (SYSX7B Font, Inverse) "
MESSAGE .AZ " 1234567890 abcdefghijklmnopqrstuvwxyz { + - * / } (SYSX7B Font, Normal) "
2019-07-30 15:35:42 +00:00
CB.RECT .DA #S.CB.CMD.FILLRECT
.DA #S.CB.OP.SET
.DA #S.CB.M.C16
.DA #6 Color
.DA 20
.DA 10
.DA 540
.DA 182
2019-08-06 07:14:22 +00:00
CB.Apple .DA #S.CB.CMD.BITBLT
.DA #S.CB.OP.ORA+S.CB.OP.MASK+S.CB.OP.COLOR
.DA #S.CB.M.C16
.DA #0
.DA 0 X1
.DA 0 Y1
.DA 16 SrcW
.DA 7 SrcH
.DA 20 DstX
.DA 184 DstY
.BS 2 SrcPtr
.DA 0 DSTPTR
CB.PIX .DA #S.CB.CMD.BITBLT
.DA #S.CB.OP.SET+S.CB.OP.COLOR
.DA #S.CB.M.MONO
.DA #0
.DA 10 X1
.DA 20 Y1
.DA 120 SrcW
.DA 100 SrcH
.DA 60 DstX
.DA 50 DstY
.BS 2 SrcPtr
.DA 0 DSTPTR
2019-08-06 15:58:01 +00:00
CB.TEXTB .DA #S.CB.CMD.DRAWTEXT
.DA #S.CB.OP.SET+S.CB.OP.INVERSE
.DA #S.CB.M.MONO
.BS 1 hFONT
.DA 0 X1
.DA 0 Y1
.DA 0 X2
.DA 0 Y2
.DA 7 DstX
.DA 1 DstY
.BS 2 TXTPTR
.DA 0 DSTPTR
2019-07-30 15:35:42 +00:00
CB.TEXT .DA #S.CB.CMD.DRAWTEXT
.DA #S.CB.OP.SET
.DA #S.CB.M.MONO
.BS 1 hFONT
.DA 0 X1
.DA 0 Y1
.DA 0 X2
.DA 0 Y2
2019-08-06 15:58:01 +00:00
.DA 50 DstX
.DA 184 DstY
2019-07-30 15:35:42 +00:00
.BS 2 TXTPTR
.DA 0 DSTPTR
*--------------------------------------
BM.Apple .DA #S.BM.F.BBP4
.DA #2 RowBytes
.DA 16 W
.DA 7 H
2019-08-06 07:14:22 +00:00
.DA BM.Apple.AND-BM.Apple
2019-07-30 15:35:42 +00:00
2019-08-06 07:14:22 +00:00
.HS 0006 green (8)
.HS 6006 green (8)
2019-07-30 15:35:42 +00:00
.HS EEEE yellow (15)
2019-08-06 07:14:22 +00:00
.HS CC0C orange (14)
.HS 8808 magenta (10)
2019-07-30 15:35:42 +00:00
.HS 9999 violet (11)
2019-08-06 07:14:22 +00:00
.HS 1001 Dark blue (4)
BM.Apple.AND .HS FFF0
.HS 0FF0
.HS 0000
.HS 00F0
.HS 00F0
.HS 0000
.HS 0FF0
2019-07-30 15:35:42 +00:00
*--------------------------------------
.DUMMY
.OR 0
DS.START
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/GTEST.S
ASM