diff --git a/A2OSX.BOOT.po b/A2OSX.BOOT.po index 2a0bb660..22cb1241 100644 Binary files a/A2OSX.BOOT.po and b/A2OSX.BOOT.po differ diff --git a/A2OSX.DEV.po b/A2OSX.DEV.po index f7c90bab..4628d0af 100644 Binary files a/A2OSX.DEV.po and b/A2OSX.DEV.po differ diff --git a/A2OSX.SRC.po b/A2OSX.SRC.po index 15a7cbfc..caa6a8dc 100644 Binary files a/A2OSX.SRC.po and b/A2OSX.SRC.po differ diff --git a/DRV/DHGR.DRV.S.txt b/DRV/DHGR.DRV.S.txt index 5430bb68..07bcafd1 100644 --- a/DRV/DHGR.DRV.S.txt +++ b/DRV/DHGR.DRV.S.txt @@ -11,9 +11,10 @@ AUTO 6 .INB INC/MACROS.I .INB INC/A2OSX.I .INB INC/IO.I + .INB INC/LIBGFX.I *-------------------------------------- ZPBASE .EQ ZPDRV -ZPCOLOR .EQ ZPDRV+2 +ZPBitBlt .EQ ZPDRV+2 *-------------------------------------- * File Header (16 Bytes) *-------------------------------------- @@ -324,25 +325,37 @@ VLINE rts *-------------------------------------- FILLREC rts *-------------------------------------- -* -* 0 : hStockObject -* 1 : Operation -* Replace -* Combine (Ora) -* CombineEx (And with Src Mask,Ora with Src BM) -* 2 : SrcX -* 4 : SrcY -* 6 : DestX -* 8 : DestY -* 12 : Width -* 14 : Height +* BitBlt +*-------------------------------------- +* 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 * *-------------------------------------- -BITBLT +BITBLT >STYA ZPBitBlt + lda (ZPBitBlt) rts *-------------------------------------- DRV.CS.END *-------------------------------------- +Shift.0 .HS 0000000000000000 + .HS 0120040810204000 +*-------------------------------------- +Shift.1 .HS 0000000000000000 + .HS 0000000000000001 +*-------------------------------------- +*-------------------------------------- Mono.NMasks .DA #%01111110 .DA #%01111101 .DA #%01111011 diff --git a/INC/LIBGFX.I.txt b/INC/LIBGFX.I.txt index eee49fb3..f654d3d2 100644 --- a/INC/LIBGFX.I.txt +++ b/INC/LIBGFX.I.txt @@ -3,10 +3,23 @@ PREFIX /A2OSX.SRC NEW INC 1 AUTO 6 - .LIST OFF - .OP 65C02 + .LIST OFF + .OP 65C02 *-------------------------------------- -LIBGFX.test .EQ 4 +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 +*-------------------------------------- +LIBGFX.InitDevA .EQ 4 +LIBGFX.CUR.show .EQ 6 +LIBGFX.CUR.Hide .EQ 8 +LIBGFX.CUR.Select .EQ 10 *-------------------------------------- MAN SAVE INC/LIBGFX.I diff --git a/LIB/LIBGFX.S.txt b/LIB/LIBGFX.S.txt index 66d30235..9d8b5f45 100644 --- a/LIB/LIBGFX.S.txt +++ b/LIB/LIBGFX.S.txt @@ -12,6 +12,8 @@ AUTO 6 .INB INC/A2OSX.I .INB INC/LIBGFX.I *-------------------------------------- +ZPPtr1 .EQ ZPLIB +*-------------------------------------- * File Header (16 Bytes) *-------------------------------------- CS.START cld @@ -28,14 +30,53 @@ CS.START cld *-------------------------------------- .1 .DA LIB.LOAD .DA LIB.UNLOAD -*-------------------------------------- + .DA InitDevA + .DA CUR.Show + .DA CUR.Hide + .DA CUR.Select .DA 0 *-------------------------------------- LIB.LOAD LIB.UNLOAD clc rts + +*-------------------------------------- +InitDevA sta hDev + >SYSCALL SYS.GetDevInfoA + bcs .9 + >STYA ZPPtr1 + + + clc + rts + +.9 stz hDev + sec + rts +*-------------------------------------- + .INB LIB/LIBGFX.S.CUR *-------------------------------------- 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.Ora .DA #%00000000 + .DA #%00000000 + .DA #%00000010 + .DA #%00000110 + .DA #%00001110 + .DA #%00011100 + .DA #%00001000 + .DA #%00000000 +*-------------------------------------- MAN SAVE LIB/LIBGFX.S ASM diff --git a/README.md b/README.md index d68b490d..1ac7ede0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # A2osX Multi-Tasking OS for Apple II ## Requires : -Enh IIe (65c02 cpu) with 128k, //c, IIgs +Enhanced IIe (65c02 cpu) with 128k, //c, IIgs + ## General Information: -**A2OSX.BOOT.po** : 140k A2osX boot disk will all binaries -**A2OSX.SRC.po** : 800k S-C MASM boot disk with all sources +**A2OSX.BOOT.po** : 140k A2osX boot disk with all binaries +**A2OSX.DEV.po** : 140k A2osX disk will ASM binaries & INClude files +**A2OSX.SRC.po** : 800k S-C MASM boot disk with all sources OApple+1,OApple+2,OApple+3 to switch between screens : Kernel Log, text, DHGR. (OApple+shift+1,OApple+shift+2,OApple+shift+3 on FR keyboard) diff --git a/SBIN/DESKTOP.S.txt b/SBIN/DESKTOP.S.txt index 6ca80e1e..3fdc213e 100644 --- a/SBIN/DESKTOP.S.txt +++ b/SBIN/DESKTOP.S.txt @@ -10,6 +10,7 @@ AUTO 6 *-------------------------------------- .INB INC/MACROS.I .INB INC/A2OSX.I + .INB INC/LIBGFX.I *-------------------------------------- * File Header (16 Bytes) *-------------------------------------- @@ -29,6 +30,7 @@ CS.START cld .DA CS.RUN .DA CS.DOEVENT .DA CS.QUIT +L.LIBGFX .DA LIBGFX L.DEVNAME.GFX .DA DEVNAME.GFX L.DEVNAME.MOUSE .DA DEVNAME.MOUSE L.MSG.INIT .DA MSG.INIT @@ -37,6 +39,10 @@ L.MSG.INIT .DA MSG.INIT CS.INIT >LDYA L.MSG.INIT >SYSCALL SYS.PSTROutYA + >LDYA L.LIBGFX + >SYSCALL SYS.LoadLibYA + sta hLIBGFX + >LDYA L.DEVNAME.GFX >SYSCALL SYS.GetDevByNameYA bcc .10 @@ -80,6 +86,9 @@ CS.INIT >LDYA L.MSG.INIT pla sta pDev + lda hDevGFX + >LIBCALL hLibGFX,LIBGFX.InitDevA + * jmp .8 lda #15 @@ -146,14 +155,10 @@ CS.DOEVENT ldy #S.EVT.hDEV cmp hDevMouse bne .99 - lda (pEvent) - and #S.EVT.F.MOUSE - beq .99 - ldy #S.EVT.DATALO lda (pEvent),y and #4 mouse move - beq .99 + beq .98 >PUSHBI 15 COLOR @@ -173,7 +178,7 @@ CS.DOEVENT ldy #S.EVT.hDEV ldx #DEVMGR.GFX.SETPIXEL jsr GoDevGFX - clc +.98 clc rts .99 sec @@ -188,7 +193,9 @@ GoDevMouse jmp (pDevMouse) CS.END DEVNAME.GFX >PSTRING "GFX" DEVNAME.MOUSE >PSTRING "MOU1" +LIBGFX >PSTRING "libgfx.o" MSG.INIT >PSTRING "DESKTOP:Init...\n" +hLibGFX .BS 1 hDevGFX .BS 1 pDevGFX .BS 2 hDevMouse .BS 1 diff --git a/SBIN/GFX/MOUSE.PTR.S.txt b/SBIN/GFX/MOUSE.PTR.S.txt deleted file mode 100644 index 6ab52969..00000000 --- a/SBIN/GFX/MOUSE.PTR.S.txt +++ /dev/null @@ -1,33 +0,0 @@ -PR#3 -PREFIX /A2OSX.SRC -NEW -INC 1 -AUTO 6 - .LIST OFF - .OP 65C02 - .OR $2000 - .TF /A2OSX.BOOT/SBIN/GFX/MOUSE.PTR -*-------------------------------------- - -*-------------------------------------- -Arrow.And .DA #%00000001 - .DA #%00000011 - .DA #%00000101 - .DA #%00001001 - .DA #%00010001 - .DA #%00100011 - .DA #%01110101 - .DA #%00011000 -*-------------------------------------- -Arrow.Ora .DA #%00000000 - .DA #%00000000 - .DA #%00000010 - .DA #%00000110 - .DA #%00001110 - .DA #%00011100 - .DA #%00001000 - .DA #%00000000 -*-------------------------------------- -MAN -SAVE SBIN/GFX/MOUSE.PTR.S -ASM \ No newline at end of file diff --git a/SYS/KERNEL.S.BIN.txt b/SYS/KERNEL.S.BIN.txt index 5471fc9a..f672375f 100644 --- a/SYS/KERNEL.S.BIN.txt +++ b/SYS/KERNEL.S.BIN.txt @@ -136,145 +136,6 @@ S.LoadBinA.hMem .BS 1 S.LoadBinA.AuxType .BS 2 S.LoadBinA.FileLen .BS 2 *-------------------------------------- -* S.BinRelocateYA : -* YA = Ptr to Code -* R.AX = Code Length -* R.BX = Range Start address to relocate -* R.CX = Range End address to relocate -* R.DX = offset to apply to all abs addresses between R.BX and R.CX -*-------------------------------------- -S.BinRelocateYA >STYA ZPQuickPtr1 - ldy #H.BIN.JMP relocate Main JMP - lda (ZPQuickPtr1),y - clc - adc R.DL - sta (ZPQuickPtr1),y - - iny - lda (ZPQuickPtr1),y - adc R.DH - sta (ZPQuickPtr1),y - - ldy #H.BIN.RELOC.TABLE skip Header, CS.SIZE & DS.SIZE... (16 bytes) - bra S.JmpRelocate - -S.DrvRelocateYA >STYA ZPQuickPtr1 - ldy #0 - -S.JmpRelocate lda (ZPQuickPtr1),y Start Relocate JMP table - tax - iny - ora (ZPQuickPtr1),y - beq S.CodeRelocate $0000 = end of table - - dey - txa - clc - adc R.DL - sta (ZPQuickPtr1),y - - iny - lda (ZPQuickPtr1),y - adc R.DH - sta (ZPQuickPtr1),y - - iny - - bra S.JmpRelocate - -S.CodeRelocate lda ZPQuickPtr1 - clc - adc R.AL Make ZPQuickPtr2=End of code - sta ZPQuickPtr2 =ZPQuickPtr1+AX (code len) - lda ZPQuickPtr1+1 - adc R.AH - sta ZPQuickPtr2+1 - - iny - tya add current offset in Y to Ptr - clc - adc ZPQuickPtr1 - sta ZPQuickPtr1 - bcc .5 - inc ZPQuickPtr1+1 ZPQuickPtr1=Current Code PTR - clc - -.5 lda (ZPQuickPtr1) get OPCODE - tax - lda OPCODES,x get OPCODE definition - bpl .7 abs addressing? - - and #3 save Opcode length... - pha - - ldy #1 - lda (ZPQuickPtr1),y Get LO - sec - sbc R.BL - iny - lda (ZPQuickPtr1),y Get HI - sbc R.BH - bcc .6 addr < AX, out of range - - dey - lda (ZPQuickPtr1),y Get LO - sec - sbc R.CL - iny - lda (ZPQuickPtr1),y Get HI - sbc R.CH - bcs .6 addr > CX, out of range - - dey - lda (ZPQuickPtr1),y Get LO - clc - adc R.DL add DX to abs address - sta (ZPQuickPtr1),y store relocated addr LO - iny - lda (ZPQuickPtr1),y Get HI - adc R.DH - sta (ZPQuickPtr1),y store relocated addr HI - -.6 pla - -.7 clc A = OPCODE length - adc ZPQuickPtr1 - sta ZPQuickPtr1 - bcc .8 - inc ZPQuickPtr1+1 - -.8 lda ZPQuickPtr1 is Current PTR < Code Limit ? - sec - sbc ZPQuickPtr2 - lda ZPQuickPtr1+1 - sbc ZPQuickPtr2+1 - bcc .5 yes, continue relocating - - clc - rts -*-------------------------------------- -* 65C02 OPCODES -* Bit 7 : 1 absolute addressing -* Bit 1-0 : opcode + @ length -*-------------------------------------- -* x0.x1.x2.x3.x4.x5.x6.x7.x8.x9.xA.xB.xC.xD.xE.xF -OPCODES .HS 01.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 - .HS 83.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 - .HS 01.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.01.83.83.03 - .HS 01.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.01.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 - .HS 02.02.02.01.02.02.02.02.01.83.01.01.01.83.83.03 -*-------------------------------------- MAN SAVE SYS/KERNEL.S.BIN LOAD SYS/KERNEL.S diff --git a/SYS/KERNEL.S.REL.txt b/SYS/KERNEL.S.REL.txt new file mode 100644 index 00000000..fedd59e0 --- /dev/null +++ b/SYS/KERNEL.S.REL.txt @@ -0,0 +1,152 @@ +PR#3 +PREFIX /A2OSX.SRC +NEW +INC 1 +AUTO 6 + .LIST OFF +*-------------------------------------- +* S.BinRelocateYA : +* YA = Ptr to Code +* R.AX = Code Length +* R.BX = Range Start address to relocate +* R.CX = Range End address to relocate +* R.DX = offset to apply to all abs addresses between R.BX and R.CX +*-------------------------------------- +S.BinRelocateYA >STYA ZPQuickPtr1 + + ldy #H.BIN.JMP relocate Main JMP + lda (ZPQuickPtr1),y + clc + adc R.DL + sta (ZPQuickPtr1),y + + iny + lda (ZPQuickPtr1),y + adc R.DH + sta (ZPQuickPtr1),y + + ldy #H.BIN.RELOC.TABLE skip Header, CS.SIZE & DS.SIZE... (16 bytes) + bra S.JmpRelocate + +S.DrvRelocateYA >STYA ZPQuickPtr1 + + ldy #0 + +S.JmpRelocate lda (ZPQuickPtr1),y Start Relocate JMP table + tax + iny + ora (ZPQuickPtr1),y + beq S.CodeRelocate $0000 = end of table + + dey + txa + clc + adc R.DL + sta (ZPQuickPtr1),y + + iny + lda (ZPQuickPtr1),y + adc R.DH + sta (ZPQuickPtr1),y + + iny + + bra S.JmpRelocate + +S.CodeRelocate lda ZPQuickPtr1 + clc + adc R.AL Make ZPQuickPtr2=End of code + sta ZPQuickPtr2 =ZPQuickPtr1+AX (code len) + lda ZPQuickPtr1+1 + adc R.AH + sta ZPQuickPtr2+1 + + iny + tya add current offset in Y to Ptr + clc + adc ZPQuickPtr1 + sta ZPQuickPtr1 + bcc .5 + inc ZPQuickPtr1+1 ZPQuickPtr1=Current Code PTR + clc + +.5 lda (ZPQuickPtr1) get OPCODE + tax + lda OPCODES,x get OPCODE definition + bpl .7 abs addressing? + + and #3 save Opcode length... + pha + + ldy #1 + lda (ZPQuickPtr1),y Get LO + sec + sbc R.BL + iny + lda (ZPQuickPtr1),y Get HI + sbc R.BH + bcc .6 addr < AX, out of range + + dey + lda (ZPQuickPtr1),y Get LO + sec + sbc R.CL + iny + lda (ZPQuickPtr1),y Get HI + sbc R.CH + bcs .6 addr > CX, out of range + + dey + lda (ZPQuickPtr1),y Get LO + clc + adc R.DL add DX to abs address + sta (ZPQuickPtr1),y store relocated addr LO + iny + lda (ZPQuickPtr1),y Get HI + adc R.DH + sta (ZPQuickPtr1),y store relocated addr HI + +.6 pla + +.7 clc A = OPCODE length + adc ZPQuickPtr1 + sta ZPQuickPtr1 + bcc .8 + inc ZPQuickPtr1+1 + +.8 lda ZPQuickPtr1 is Current PTR < Code Limit ? + sec + sbc ZPQuickPtr2 + lda ZPQuickPtr1+1 + sbc ZPQuickPtr2+1 + bcc .5 yes, continue relocating + + clc + rts +*-------------------------------------- +* 65C02 OPCODES +* Bit 7 : 1 absolute addressing +* Bit 1-0 : opcode + @ length +*-------------------------------------- +* x0.x1.x2.x3.x4.x5.x6.x7.x8.x9.xA.xB.xC.xD.xE.xF +OPCODES .HS 01.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 + .HS 83.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 + .HS 01.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.01.83.83.03 + .HS 01.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.01.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.02.01.01.83.83.83.03 + .HS 02.02.02.01.02.02.02.02.01.83.01.01.01.83.83.03 +*-------------------------------------- +MAN +SAVE SYS/KERNEL.S.REL +LOAD SYS/KERNEL.S +ASM diff --git a/SYS/KERNEL.S.txt b/SYS/KERNEL.S.txt index 32068cd4..ef49ab95 100644 --- a/SYS/KERNEL.S.txt +++ b/SYS/KERNEL.S.txt @@ -243,6 +243,7 @@ A2osX.E000 .EQ * .INB SYS/KERNEL.S.BIN .INB SYS/KERNEL.S.DRV .INB SYS/KERNEL.S.LIB + .INB SYS/KERNEL.S.REL .INB SYS/KERNEL.S.TSK .INB SYS/KERNEL.S.EVT *-------------------------------------- diff --git a/ScreenShot.bmp b/ScreenShot.IP1.bmp similarity index 100% rename from ScreenShot.bmp rename to ScreenShot.IP1.bmp diff --git a/ScreenShot.IP2.bmp b/ScreenShot.IP2.bmp new file mode 100644 index 00000000..6eae9bf0 Binary files /dev/null and b/ScreenShot.IP2.bmp differ diff --git a/_MAKEDIR.txt b/_MAKEDIR.txt index ea391711..81f13f61 100644 --- a/_MAKEDIR.txt +++ b/_MAKEDIR.txt @@ -7,10 +7,12 @@ CREATE SBIN CREATE SBIN/GFX CREATE SYS CREATE USR +PREFIX /A2OSX.DEV +CREATE INC +CREATE BIN PREFIX /A2OSX.SRC CREATE BIN CREATE DRV -CREATE INC CREATE LIB CREATE SBIN CREATE SBIN/GFX