diff --git a/images/apple/PLASMA2-BLD.PO b/images/apple/PLASMA2-BLD.PO index 3ca188d..2e50666 100644 Binary files a/images/apple/PLASMA2-BLD.PO and b/images/apple/PLASMA2-BLD.PO differ diff --git a/images/apple/PLASMA2-SYS.PO b/images/apple/PLASMA2-SYS.PO index 78e7a25..fbbe371 100755 Binary files a/images/apple/PLASMA2-SYS.PO and b/images/apple/PLASMA2-SYS.PO differ diff --git a/images/apple/PLASMA2.2mg b/images/apple/PLASMA2.2mg index ab32847..f6c7818 100644 Binary files a/images/apple/PLASMA2.2mg and b/images/apple/PLASMA2.2mg differ diff --git a/src/inc/matchfiles.plh b/src/inc/matchfiles.plh index 9c571d4..f60b27c 100644 --- a/src/inc/matchfiles.plh +++ b/src/inc/matchfiles.plh @@ -2,4 +2,5 @@ import matchfiles predef matchName(src, exp)#1 predef matchList(pathptr, exp)#2 predef isWildName(exp)#1 + predef fileFromPath(filestr, pathstr)#0 end diff --git a/src/libsrc/apple/matchfiles.pla b/src/libsrc/apple/matchfiles.pla index bb1339e..11da710 100644 --- a/src/libsrc/apple/matchfiles.pla +++ b/src/libsrc/apple/matchfiles.pla @@ -15,7 +15,7 @@ def matchNext(src, srcofst, exp, expofst) return TRUE fin is '?' // Single char wildcard - if ^src >= srcofst + if ^src >= srcofst return matchNext(src, srcofst + 1, exp, expofst + 1) fin return FALSE @@ -103,7 +103,7 @@ end // export def isWildName(exp)#1 byte i - + if ^exp for i = 1 to ^exp if exp->[i] == '*' or exp->[i] == '?' @@ -113,5 +113,18 @@ export def isWildName(exp)#1 fin return FALSE end +// +// Utility routine to separate filename from path +// +export def fileFromPath(filestr, pathstr)#0 + byte i + + for i = ^pathstr downto 1 + if pathstr->[i] == '/' + break + fin + next + ^filestr = ^pathstr - i + memcpy(filestr + 1, pathstr + 1 + i, ^filestr) +end done - diff --git a/src/makefile b/src/makefile index bff11a6..ce2e034 100755 --- a/src/makefile +++ b/src/makefile @@ -485,11 +485,11 @@ $(MON): utilsrc/apple/mon.pla $(PLASM) ./$(PLASM) -AMOW < utilsrc/apple/mon.pla > utilsrc/apple/mon.a acme --setpc 4094 -o $(MON) utilsrc/apple/mon.a -$(COPY): utilsrc/apple/copy.pla $(PLASM) +$(COPY): utilsrc/apple/copy.pla $(MATCHFILES) $(PLASM) ./$(PLASM) -AMOW < utilsrc/apple/copy.pla > utilsrc/apple/copy.a acme --setpc 4094 -o $(COPY) utilsrc/apple/copy.a -$(DEL): utilsrc/apple/del.pla $(PLASM) +$(DEL): utilsrc/apple/del.pla $(MATCHFILES) $(PLASM) ./$(PLASM) -AMOW < utilsrc/apple/del.pla > utilsrc/apple/del.a acme --setpc 4094 -o $(DEL) utilsrc/apple/del.a @@ -497,7 +497,7 @@ $(REN): utilsrc/apple/ren.pla $(PLASM) ./$(PLASM) -AMOW < utilsrc/apple/ren.pla > utilsrc/apple/ren.a acme --setpc 4094 -o $(REN) utilsrc/apple/ren.a -$(CAT): utilsrc/apple/cat.pla $(PLASM) +$(CAT): utilsrc/apple/cat.pla $(MATCHFILES) $(PLASM) ./$(PLASM) -AMOW < utilsrc/apple/cat.pla > utilsrc/apple/cat.a acme --setpc 4094 -o $(CAT) utilsrc/apple/cat.a diff --git a/src/mockingboard/cvtmid.py b/src/mockingboard/cvtmid.py index 3a11989..f50034f 100755 --- a/src/mockingboard/cvtmid.py +++ b/src/mockingboard/cvtmid.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/python import sys #from mido import MidiFile diff --git a/src/utilsrc/apple/cat.pla b/src/utilsrc/apple/cat.pla index e7f131e..87d4d7d 100644 --- a/src/utilsrc/apple/cat.pla +++ b/src/utilsrc/apple/cat.pla @@ -12,23 +12,6 @@ char[64] path, wildname res[t_fileinfo] fileinfo res[t_fileentry] fileentry // -// Convert byte to two hex chars -// -def putb(b)#0 - char h - - h = ((b >> 4) & $0F) + '0' - if h > '9' - h = h + 7 - fin - putc(h) - h = (b & $0F) + '0' - if h > '9' - h = h + 7 - fin - putc(h) -end -// // Copy string with upper case conversion // def struprcpy(dst, src)#0 @@ -46,23 +29,12 @@ def struprcpy(dst, src)#0 fin ^dst = ^src end -def filefrompath(filestr, pathstr)#0 - byte i - - for i = ^pathstr downto 1 - if pathstr->[i] == '/' - break - fin - next - ^filestr = ^pathstr - i - memcpy(filestr + 1, pathstr + 1 + i, ^filestr) -end // // Print out a directory entry // def printentry(entryptr)#0 char type, pad, eofstr[12] - + puts(entryptr) when entryptr->entry_type is $0F // Is it a directory? @@ -88,12 +60,12 @@ def printentry(entryptr)#0 for pad = eofstr to 9 putc(' ') next - puts(@eofstr) + puts(@eofstr) putln end def printentries(pathstr, entries, num)#0 byte page - + puts(pathstr); putln puts("=NAME==========TYPE===AUX====LENGTH=\n") page = 20 diff --git a/src/utilsrc/apple/copy.pla b/src/utilsrc/apple/copy.pla index d6d9c6a..ea16d30 100644 --- a/src/utilsrc/apple/copy.pla +++ b/src/utilsrc/apple/copy.pla @@ -16,7 +16,7 @@ res[t_fileinfo] srcfileinfo, dstfileinfo // def pathcpy(dst, src)#0 byte i, chr - + if ^src for i = 1 to ^src chr = src->[i] @@ -52,7 +52,7 @@ end def pathdiff(path1, path2)#1 byte i, d char[64] abs1, abs2 - + abspath(@abs1, path1) abspath(@abs2, path2) @@ -67,17 +67,6 @@ def pathdiff(path1, path2)#1 next return FALSE end -def filefrompath(filestr, pathstr)#0 - byte i - - for i = ^pathstr + 1 downto 1 - if pathstr->[i] == '/' - break - fin - next - ^filestr = ^pathstr - i - memcpy(filestr + 1, pathstr + 1 + i, ^filestr) -end // // Check destination path // @@ -108,14 +97,14 @@ def copyfiles(srcfile, dstfile)#0 char[64] srcfilepath char[64] dstfilepath char[16] wildname - + // // Check if copying a directory // strcpy(@srcpath, srcfile) wildname = 0 if fileio:getfileinfo(@srcpath, @srcfileinfo) <> FILE_ERR_OK or (srcfileinfo.storage_type & $0D <> $0D) - filefrompath(@wildname, @srcpath) + fileFromPath(@wildname, @srcpath) srcpath = srcpath - wildname fin entrylist, entrycnt = matchList(@srcpath, @wildname) @@ -186,7 +175,7 @@ def copyfiles(srcfile, dstfile)#0 puts(" ==> "); puts(@dstfilepath); putln fin entry = entry + t_fileentry - entrycnt-- + entrycnt-- loop heaprelease(entrylist) fin diff --git a/src/utilsrc/apple/del.pla b/src/utilsrc/apple/del.pla index 3129ed4..3fa3108 100644 --- a/src/utilsrc/apple/del.pla +++ b/src/utilsrc/apple/del.pla @@ -25,17 +25,6 @@ def struprcpy(dst, src)#0 fin ^dst = ^src end -def filefrompath(filestr, pathstr)#0 - byte i - - for i = ^pathstr downto 1 - if pathstr->[i] == '/' - break - fin - next - ^filestr = ^pathstr - i - memcpy(filestr + 1, pathstr + 1 + i, ^filestr) -end // // Check filename // @@ -81,9 +70,8 @@ def delfiles(delfile)#0 strcpy(@delpath, delfile) wildname = 0 - //if fileio:getfileinfo(@delpath, @fileinfo) <> FILE_ERR_OK or fileinfo.file_type <> $0F if delpath[delpath] <> '/' - filefrompath(@wildname, @delpath) + fileFromPath(@wildname, @delpath) delpath = delpath - wildname fin // @@ -115,7 +103,7 @@ def delfiles(delfile)#0 fileio:destroy(@delfilepath) fin entry = entry + t_fileentry - entrycnt-- + entrycnt-- loop elsif not wildname puts("Not found: "); puts(@delpath); puts("/"); puts(@wildname); putln @@ -156,7 +144,7 @@ if not except(exit) strcpy(@path,fileptr) strcat(@path, "/") delfiles(@path) - fin + fin delfiles(fileptr) fileptr = fileptr + ^fileptr + 1 filecnt-- diff --git a/src/utilsrc/apple/type.pla b/src/utilsrc/apple/type.pla index 799f9f7..eca4438 100644 --- a/src/utilsrc/apple/type.pla +++ b/src/utilsrc/apple/type.pla @@ -8,23 +8,23 @@ var arg, type, aux // // Convert byte to two hex chars // -def putb(b)#0 - char h - - h = ((b >> 4) & $0F) + '0' - if h > '9' - h = h + 7 - fin - putc(h) - h = (b & $0F) + '0' - if h > '9' - h = h + 7 - fin - putc(h) -end +//def putb(b)#0 +// char h +// +// h = ((b >> 4) & $0F) + '0' +// if h > '9' +// h = h + 7 +// fin +// putc(h) +// h = (b & $0F) + '0' +// if h > '9' +// h = h + 7 +// fin +// putc(h) +//end def htoi(hexptr) var val, i, n - + val = 0 for i = 1 to ^hexptr n = toupper(^(hexptr + i)) - '0'