Kernel version 0.9 : saved few bytes with MemMgr Optimization

This commit is contained in:
Rémy GIBERT 2017-07-01 15:45:53 +02:00
parent e9062c4674
commit bde13143d0
12 changed files with 139 additions and 117 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -26,7 +26,7 @@ OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#b
MSG.USAGE >CSTR "Usage : CP [Src File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n -Y : Dont't prompt for override\r\n"
MSG.DIR >CSTR "CP Dir :%S to %S..."
MSG.FILE >CSTR "CP File:%S to %S..."
MSG.OVERWRITE >CSTR "\r\nOverwrite %S [Yes,No,All]?"
MSG.OVERWRITE >CSTR "Overwrite %S [Yes,No,All]?"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
MSG.DONE >PSTR "%D File(s) Copied.\r\n"

View File

@ -26,7 +26,7 @@ OptionVars .DA #bContinue,#bRecurse,#bNoConfirm,#bQuiet,#bContinue,#bRecurse,#b
MSG.USAGE >CSTR "Usage : MV [Src File/Dir, *,? wildcards allowed]\r\n -C : Continue on error\r\n -Q : Quiet\r\n -R : Recurse subdirectories\r\n -Y : Dont't prompt for override\r\n"
MSG.DIR >CSTR "MV Dir :%S to %S..."
MSG.FILE >CSTR "MV File:%S to %S..."
MSG.OVERWRITE >CSTR "\r\nOverwrite %S [Yes,No,All]?"
MSG.OVERWRITE >CSTR "Overwrite %S [Yes,No,All]?"
MSG.OK >PSTR "[OK]\r\n"
MSG.ERR >PSTR "[%h]\r\n"
MSG.DONE >PSTR "%D File(s) Moved.\r\n"

View File

@ -302,10 +302,7 @@ CS.RUN >SYSCALL GetC
sec
.9 rts
*--------------------------------------
CS.RUN.CR.NEXT lda #13
>SYSCALL PutCA
lda #10
>SYSCALL PutCA
CS.RUN.CR.NEXT jsr CS.RUN.CR
CS.RUN.NEXT jsr GetNextEntry
bcs CS.RUN.LEAVE
rts
@ -440,9 +437,6 @@ CS.RUN.FILE jsr CS.RUN.FILE.MSG
lda (pData),y
bmi .2 no prompt, ovverwrite
jsr CS.RUN.FILE.MSG
bcs .90
jsr CS.RUN.OVERWRITE.MSG
bcs .9
@ -545,13 +539,29 @@ CS.RUN.FILE.MSG clc
*--------------------------------------
.DO X.COPY.TO.DEST=1
CS.RUN.OVERWRITE.MSG
ldy #hDstFullPath
ldy #bQuiet
lda (pData),y
bmi .1
jsr CS.RUN.CR
.1 ldy #hDstFullPath
jsr CS.RUN.GetPathY
>PUSHYA
>LDYA L.MSG.OVERWRITE
>SYSCALL CPrintFYA
rts
CS.RUN.OVERWRITE.KEY
rts
.FIN
*--------------------------------------
CS.RUN.CR lda #13
>SYSCALL PutCA
lda #10
>SYSCALL PutCA
rts
*--------------------------------------
.DO X.COPY.TO.DEST=1
.DO X.DELETE.SOURCE=1

View File

@ -57,11 +57,11 @@ DEV.HEADER cld
* Driver Code
*--------------------------------------
DRV.CS.START .DA STATUS
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA READ
@ -86,10 +86,6 @@ J.EscSequences .DA Esc.DispAttr m
.DA Esc.Home H
.DA 0 end of relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.STAT
clc
rts

View File

@ -10,7 +10,7 @@ AUTO 6
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
.INB /A2OSX.BUILD/INC/MLI.ERR.I
* .INB /A2OSX.BUILD/INC/MLI.ERR.I
.INB /A2OSX.BUILD/INC/IO.I
.INB /A2OSX.BUILD/INC/LIBGFX.I
*--------------------------------------
@ -138,16 +138,16 @@ DEV.HEADER.NAME >PSTR "GFX"
* Driver Code
*--------------------------------------
DRV.CS.START .DA STATUS
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
*--------------------------------------
.DA SETPIXEL
.DA GETPIXEL
@ -170,10 +170,6 @@ L.DIVMOD7Y0 .DA DIVMOD7Y0
.DA DIVMOD7Y2
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.STAT
clc
rts
@ -493,69 +489,69 @@ VLINE >STYA ZPBase
sta SET80STORE
VLINE.MONO ldx CB.Cache+S.CB.X1+1 Get X Hi byte....
lda DIV7.lo,x
sta .1+1
lda DIV7.hi,x
sta .1+2
lda MOD7.lo,x
sta .2+1
lda MOD7.hi,x
sta .2+2
lda DIV7.BASE,x
ldx CB.Cache+S.CB.X1
clc
.1 adc $ffff,x DIV7 : x = X.LO, a = X DIV 7
sta XDIV7 save X DIV 7
.2 lda $ffff,x MOD7 : x = X.LO, y = X MOD 7
sta XMOD7
lda CB.Cache+S.CB.OP
beq .4
beq VLINE.OP0
VLINE.XOR jsr VLINE.DIVMOD7
ldy XMOD7
lda Mono.Masks,y
sta .2+1
ldy XCOL7
ldx CB.Cache+S.CB.Y1
.3 lda XDIV7
tay
lsr
clc
adc BASEL,x
.1 lda BASEL,x
sta ZPBase
lda BASEH,x
sta ZPBase+1
ldx COL.BANK,y
sta $C000,x
lda (ZPBase),y XOR
.2 eor #$ff
sta (ZPBase),y
ldy XMOD7
lda (ZPBase) XOR
eor Mono.Masks,y y = mod 7
sta (ZPBase)
bra .6
.4 lda (ZPBase)
ldx CB.Cache+S.CB.COLOR get color
bne .5
and Mono.NMasks,y includes And $7F for mono
sta (ZPBase)
bra .6
.5 and #$7F switch back this byte to mono
ora Mono.Masks,y
sta (ZPBase)
.6 inc CB.Cache+S.CB.Y1
ldx CB.Cache+S.CB.Y1
inx
cpx CB.Cache+S.CB.Y2
bne .3
bcc .1
beq .1
sta CLR80STORE
rts
VLINE.OP0 lda CB.Cache+S.CB.MODE
dec
bne VLINE.C16
VLINE.MONO jsr VLINE.DIVMOD7
ldy XMOD7
lda Mono.NMasks,y includes And $7F for mono
sta .3+1
lda CB.Cache+S.CB.COLOR get color
beq .1
lda Mono.Masks,y
.1 sta .4+1
ldy XCOL7
ldx CB.Cache+S.CB.Y1
.2 lda BASEL,x
sta ZPBase
lda BASEH,x
sta ZPBase+1
lda (ZPBase),y
.3 and #$ff
.4 ora #$ff
sta (ZPBase),y
inx
cpx CB.Cache+S.CB.Y2
bcc .2
beq .2
sta CLR80STORE
rts
@ -648,6 +644,36 @@ VLINE.C16 lda CB.Cache+S.CB.X1
.13 sta CLR80STORE
rts
VLINE.DIVMOD7 ldx CB.Cache+S.CB.X1+1 Get X Hi byte....
lda DIV7.lo,x
sta .2+1
lda DIV7.hi,x
sta .2+2
lda MOD7.lo,x
sta .3+1
lda MOD7.hi,x
sta .3+2
lda DIV7.BASE,x
ldx CB.Cache+S.CB.X1
clc
.2 adc $ffff,x DIV7 : x = X.LO, a = X DIV 7
* sta XDIV7 save X DIV 7
tay
lsr
sta XCOL7
ldx COL.BANK,y
sta $C000,x
.3 lda $ffff,x MOD7 : x = X.LO, y = X MOD 7
sta XMOD7
rts
*--------------------------------------
* FILLRECT
* 2 : Mode
@ -696,16 +722,6 @@ BITBLT >STYA ZPBase
dey
bpl .1
clc
rts
*--------------------------------------
@ -764,6 +780,7 @@ CB.Cache .BS S.CB
*--------------------------------------
XDIV7 .BS 1
XMOD7 .BS 1
XCOL7 .BS 1
GBYTE .BS 1
*--------------------------------------
STAT .DA #0

View File

@ -139,21 +139,17 @@ DEV.HEADER.NAME >PSTR "MOUX"
*--------------------------------------
DRV.CS.START .DA STATUS
.DA READBLOCK
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.DEVSTAT
clc
rts

View File

@ -102,6 +102,8 @@ DevMgr.HiMem .EQ $FFFA Protect IRQ vectors in Aux LC
A2osX.SYSCALL .EQ $BD00
A2osX.LIBCALL .EQ $BD03
A2osX.MLICALL .EQ $BD06
*
A2osX.BADCALL .EQ $BD0C
*--------------------------------------
pCodeJmp .EQ $BD10
*pLibJmp .EQ $BD13
@ -253,17 +255,17 @@ SYS.FreeMemA .EQ $92
SYS.GetMemPtrA .EQ $94
SYS.GetMemByIDA .EQ $96
SYS.GetMemYA .EQ $98
SYS.LoadStkObjYA .EQ $9A
SYS.GetStkObjA .EQ $9C
SYS.FreeStkObjA .EQ $9E
* .EQ $9A
* .EQ $9C
* .EQ $9E
*--------------------------------------
SYS.SetLoMem .EQ $A0
SYS.GetMemStatYA .EQ $A2
* .EQ $A4
* .EQ $A6
* .EQ $A8
* .EQ $AA
* .EQ $AC
SYS.LoadStkObjYA .EQ $A8
SYS.GetStkObjA .EQ $AA
SYS.FreeStkObjA .EQ $AC
* .EQ $AE
*--------------------------------------
SYS.FPutCAY .EQ $B0

View File

@ -225,7 +225,8 @@ Destop.Paint lda #S.CB.MODE.C16
cmp #16
bne .1
.4 >PUSHW L.DrawLine1.CB
.4
>PUSHW L.DrawLine1.CB
>LIBCALL hLibGFX,LIBGFX.DrawLine
>PUSHW L.DrawLine2.CB
>LIBCALL hLibGFX,LIBGFX.DrawLine

View File

@ -6,22 +6,22 @@ PREFIX /A2OSX.BUILD
echo \fBuilding A2OSX.BOOT Media...
format S6D1 A2OSX.BOOT
echo Copying Files...
cp -q ProDOS /A2OSX.BOOT
cp ProDOS /A2OSX.BOOT
md /A2OSX.BOOT/SYS
cp -q SYS/* /A2OSX.BOOT/SYS
cp SYS/* /A2OSX.BOOT/SYS
md /A2OSX.BOOT/DRV
cp -q DRV/* /A2OSX.BOOT/DRV
cp DRV/* /A2OSX.BOOT/DRV
md /A2OSX.BOOT/LIB
cp -q LIB/* /A2OSX.BOOT/LIB
cp LIB/* /A2OSX.BOOT/LIB
md /A2OSX.BOOT/SBIN
cp -q SBIN/* /A2OSX.BOOT/SBIN
cp SBIN/* /A2OSX.BOOT/SBIN
md /A2OSX.BOOT/BIN
cp -q BIN/* /A2OSX.BOOT/BIN
cp BIN/* /A2OSX.BOOT/BIN
md /A2OSX.BOOT/ETC
echo Done!
cp -q A2OSX.SYSTEM /A2OSX.BOOT
cp A2OSX.SYSTEM /A2OSX.BOOT
chtyp /A2OSX.BOOT/A2OSX.SYSTEM SYS
cp -q A2OSX.STARTUP /A2OSX.BOOT
cp A2OSX.STARTUP /A2OSX.BOOT
MAN
TEXT MAKEBOOT