From 314121b226c3c4c2bacc07e8390d70d26e80a5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20GIBERT?= Date: Wed, 15 Jun 2016 17:58:45 +0200 Subject: [PATCH] GUI:preliminary reorg --- DRV/DHGR.DRV.S.txt | 95 ++++++++++++++++++++++++++++++++++++++-------- INC/LIBGFX.I.txt | 34 ++++++++++------- LIB/LIBGFX.S.txt | 66 ++++++++++++++++++++++---------- 3 files changed, 146 insertions(+), 49 deletions(-) diff --git a/DRV/DHGR.DRV.S.txt b/DRV/DHGR.DRV.S.txt index 07bcafd1..138d4206 100644 --- a/DRV/DHGR.DRV.S.txt +++ b/DRV/DHGR.DRV.S.txt @@ -67,6 +67,10 @@ DRV.CS.START .DA OPEN .DA VLINE .DA BITBLT .DA FILLREC + .DA SETCURPOS + .DA SETCUR + .DA HIDECUR + .DA SHOWCUR L.DEVINFO .DA DEVINFO .DA 0 end or relocation *-------------------------------------- @@ -326,25 +330,76 @@ VLINE rts FILLREC rts *-------------------------------------- * BitBlt -*-------------------------------------- +* In : YA = Ptr to Job : * 0 : Operation -* 1 - Replace -* 2 - Combine (Ora) -* 3 - CombineEx (And with Src BitMask,Ora with Src BitMap) -* 4 - Exchange -* 2 : pSrcBitMap -* 4 : pSrcBitMask -* 6 : pDstBitMap -* 8 : SrcAX -* 10 : SrcAY -* 12 : SrcBX -* 14 : SrcBY -* 16 : DestX -* 18 : DestY -* +* %00000001 : Save +* %00000010 : Replace +* %00000100 : AND with Src BitMask +* %00001000 : ORA with Src BitMap +* %00010000 : XOR +* 2 : SavePTR +* 4 : SrcAX +* 6 : SrcAY +* 8 : SrcBX +* 10 : SrcBY +* 12 : DestX +* 14 : DestY +* 16 : BM Struct *-------------------------------------- BITBLT >STYA ZPBitBlt lda (ZPBitBlt) + clc + rts +*-------------------------------------- +SETCURPOS >STYA ZPBASE + + ldy #3 +.1 lda (ZPBase),y + sta CUR.X,y + dey + bpl .1 + + bit CUR.State + bpl .2 + jsr HIDECUR.I + jsr SHOWCUR.I +.2 clc + rts +*-------------------------------------- +SETCUR >STYA ZPBase + ldy #S.CUR-1 +.1 lda (ZPBase),y + sta CUR.BitMap,y + dey + bpl .1 + + bit CUR.State + bpl .2 + jsr HIDECUR.I + jsr SHOWCUR.I +.2 clc + rts +*-------------------------------------- +SHOWCUR bit CUR.State + bmi .8 + +SHOWCUR.I lda CUR.X + + + sec + ror CUR.State +.8 clc + rts +*-------------------------------------- +HIDECUR bit CUR.State + bpl .8 + +HIDECUR.I + + + clc + ror CUR.State +.8 clc rts *-------------------------------------- DRV.CS.END @@ -558,6 +613,16 @@ CY .BS 1 COL .BS 1 GBYTE .BS 1 *-------------------------------------- +CUR.State .BS 1 +CUR.X .BS 2 +CUR.Y .BS 2 +CUR.BitMap .BS S.CUR +CUR.SaveCol .BS 1 +CUR.SaveColCnt .BS 1 +CUR.SaveRow .BS 1 +CUR.SaveRowCnt .BS 1 +CUR.SaveBuf .BS 3*16 MAX 3 bytes*16 rows +*-------------------------------------- DEVINFO .DA #S.DEVINFO.TYPE.GFX type of DEVINFO STRUCT DEVINFO.MODES .DA #%10000011 XOR,16 & B/W DEVINFO.W .DA 560 X.SIZE diff --git a/INC/LIBGFX.I.txt b/INC/LIBGFX.I.txt index f654d3d2..17d5a832 100644 --- a/INC/LIBGFX.I.txt +++ b/INC/LIBGFX.I.txt @@ -6,20 +6,28 @@ AUTO 6 .LIST OFF .OP 65C02 *-------------------------------------- -S.BITMAP.F .EQ 0 -S.BITMAP.F.BBP1 .EQ %00000001 -S.BITMAP.F.BBP2 .EQ %00000010 -S.BITMAP.F.BBP4 .EQ %00000100 -S.BITMAP.F.BBP8 .EQ %00001000 -S.BITMAP.RowBytes .EQ 1 -S.BITMAP.W .EQ 4 -S.BITMAP.H .EQ 6 -S.BITMAP.DATA .EQ 8 +S.CUR.HotPointX .EQ 0 +S.CUR.HotPointY .EQ 1 +S.CUR.DATA .EQ 2 16x16 bits = 32 bytes +S.CUR.MASK .EQ 34 +S.CUR .EQ 66 *-------------------------------------- -LIBGFX.InitDevA .EQ 4 -LIBGFX.CUR.show .EQ 6 -LIBGFX.CUR.Hide .EQ 8 -LIBGFX.CUR.Select .EQ 10 +S.BM.F .EQ 0 +S.BM.F.BBP1 .EQ %00000001 +S.BM.F.BBP2 .EQ %00000010 +S.BM.F.BBP4 .EQ %00000100 +S.BM.F.BBP8 .EQ %00001000 +S.BM.RowBytes .EQ 1 +S.BM.W .EQ 2 +S.BM.H .EQ 4 +S.BM.MASK.OFFSET .EQ 6 +S.BM.DATA .EQ 8 +*-------------------------------------- +LIBGFX.InitGFXA .EQ 4 +LIBGFX.SetCursorPos .EQ 6 +LIBGFX.SetCursorYA .EQ 8 +LIBGFX.HideCursor .EQ 10 +LIBGFX.ShowCursor .EQ 12 *-------------------------------------- MAN SAVE INC/LIBGFX.I diff --git a/LIB/LIBGFX.S.txt b/LIB/LIBGFX.S.txt index 9d8b5f45..9433cff2 100644 --- a/LIB/LIBGFX.S.txt +++ b/LIB/LIBGFX.S.txt @@ -30,10 +30,11 @@ CS.START cld *-------------------------------------- .1 .DA LIB.LOAD .DA LIB.UNLOAD - .DA InitDevA - .DA CUR.Show - .DA CUR.Hide - .DA CUR.Select + .DA InitGFXA + .DA InitCursor + .DA SetCursorYA + .DA HideCursor + .DA ShowCursor .DA 0 *-------------------------------------- LIB.LOAD @@ -41,7 +42,7 @@ LIB.UNLOAD clc rts *-------------------------------------- -InitDevA sta hDev +InitGFXA sta hDev >SYSCALL SYS.GetDevInfoA bcs .9 >STYA ZPPtr1 @@ -59,23 +60,46 @@ InitDevA sta hDev CS.END hDev .BS 1 *-------------------------------------- -CUR.Arrow.And .DA #%00000001 - .DA #%00000011 - .DA #%00000101 - .DA #%00001001 - .DA #%00010001 - .DA #%00100011 - .DA #%01110101 - .DA #%00011000 +CUR.Arrow .DA #0 + .DA #0 +CUR.Arrow.DATA .DA %00000001.000000000 + .DA %00000011.000000000 + .DA %00000101.000000000 + .DA %00001001.000000000 + .DA %00010001.000000000 + .DA %00100011.000000000 + .DA %01110101.000000000 + .DA %00011000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 +CUR.Arrow.MASK .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000010.000000000 + .DA %00000110.000000000 + .DA %00001110.000000000 + .DA %00011100.000000000 + .DA %00001000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 + .DA %00000000.000000000 *-------------------------------------- -CUR.Arrow.Ora .DA #%00000000 - .DA #%00000000 - .DA #%00000010 - .DA #%00000110 - .DA #%00001110 - .DA #%00011100 - .DA #%00001000 - .DA #%00000000 +PAT.Arrow .DA #S.BITMAP.F.BBP1 + .DA #1 RowBytes + .DA 7 W + .DA 8 H + .DA 0 *-------------------------------------- MAN SAVE LIB/LIBGFX.S