mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-14 00:14:05 +09:00
tvdos files append functions
This commit is contained in:
@@ -55,7 +55,7 @@ for (let portNo = 1; portNo < 4; portNo++) {
|
|||||||
sys.spin()
|
sys.spin()
|
||||||
let devname = com.sendMessageGetBytes(portNo, "DEVTYP\x17").substring(0,4)
|
let devname = com.sendMessageGetBytes(portNo, "DEVTYP\x17").substring(0,4)
|
||||||
let driver = devnameToDriver[devname]
|
let driver = devnameToDriver[devname]
|
||||||
serial.println(`port: ${portNo}, devname: ${devname} ${com.sendMessageGetBytes(portNo, "DEVNAM\x17")}`)
|
// serial.println(`port: ${portNo}, devname: ${devname} ${com.sendMessageGetBytes(portNo, "DEVNAM\x17")}`)
|
||||||
if (driver) {
|
if (driver) {
|
||||||
let dlet = currentDriveLetter[portNo]
|
let dlet = currentDriveLetter[portNo]
|
||||||
_TVDOS.DRIVEFS[dlet] = driver
|
_TVDOS.DRIVEFS[dlet] = driver
|
||||||
@@ -116,7 +116,7 @@ class TVDOSFileDescriptor {
|
|||||||
this._path = p.substring(2) // detaches $:
|
this._path = p.substring(2) // detaches $:
|
||||||
this._driverID = driverID
|
this._driverID = driverID
|
||||||
this._driver = _TVDOS.DRV.FS[driverID]
|
this._driver = _TVDOS.DRV.FS[driverID]
|
||||||
serial.println(`TVDOSFileDescriptor input path: ${path0}, p = ${p}, driveLetter = ${this._driveLetter}, path = ${this._path}`)
|
// serial.println(`TVDOSFileDescriptor input path: ${path0}, p = ${p}, driveLetter = ${this._driveLetter}, path = ${this._path}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,6 +174,20 @@ class TVDOSFileDescriptor {
|
|||||||
swrite(string) {
|
swrite(string) {
|
||||||
this.driver.swrite(this, string)
|
this.driver.swrite(this, string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ptr where the byes are (offsets from the base ptr can be coded as `baseptr + offset`)
|
||||||
|
* @param count how many bytes to append
|
||||||
|
*/
|
||||||
|
pappend(ptr, count) {
|
||||||
|
this.driver.pappend(this, ptr, count)
|
||||||
|
}
|
||||||
|
bappend(bytes) {
|
||||||
|
this.driver.bappend(this, bytes)
|
||||||
|
}
|
||||||
|
sappend(string) {
|
||||||
|
this.driver.sappend(this, string)
|
||||||
|
}
|
||||||
|
|
||||||
flush() {
|
flush() {
|
||||||
this.driver.flush(this)
|
this.driver.flush(this)
|
||||||
@@ -302,7 +316,7 @@ _TVDOS.DRV.FS.SERIAL.pread = (fd, ptr, count, offset) => {
|
|||||||
if (response < 0 || response >= 128) {
|
if (response < 0 || response >= 128) {
|
||||||
throw Error("Reading a file failed with "+response)
|
throw Error("Reading a file failed with "+response)
|
||||||
}
|
}
|
||||||
dma.comToRam(port[0], offset, ptr, count)
|
dma.comToRam(port[0], offset || 0, ptr, count || 0)
|
||||||
}
|
}
|
||||||
_TVDOS.DRV.FS.SERIAL.sread = (fd) => {
|
_TVDOS.DRV.FS.SERIAL.sread = (fd) => {
|
||||||
if (129 == _TVDOS.DRV.FS.SERIAL._openr(fd)) throw Error(`No such file: ${fd.fullPath}`)
|
if (129 == _TVDOS.DRV.FS.SERIAL._openr(fd)) throw Error(`No such file: ${fd.fullPath}`)
|
||||||
@@ -318,6 +332,14 @@ _TVDOS.DRV.FS.SERIAL.sread = (fd) => {
|
|||||||
}
|
}
|
||||||
return com.pullMessage(port[0])
|
return com.pullMessage(port[0])
|
||||||
}
|
}
|
||||||
|
_TVDOS.DRV.FS.SERIAL.bread = (fd) => {
|
||||||
|
let str = _TVDOS.DRV.FS.SERIAL.sread(fd)
|
||||||
|
let bytes = new Uint8Array(str.length)
|
||||||
|
for (let i = 0; i < str.length; i++) {
|
||||||
|
bytes[i] = str.charCodeAt(i)
|
||||||
|
}
|
||||||
|
return bytes
|
||||||
|
}
|
||||||
_TVDOS.DRV.FS.SERIAL.pwrite = (fd, ptr, count, offset) => {
|
_TVDOS.DRV.FS.SERIAL.pwrite = (fd, ptr, count, offset) => {
|
||||||
if (offset) throw Error(`Write offset not supported on Serial device such as disk drives`)
|
if (offset) throw Error(`Write offset not supported on Serial device such as disk drives`)
|
||||||
|
|
||||||
@@ -325,7 +347,6 @@ _TVDOS.DRV.FS.SERIAL.pwrite = (fd, ptr, count, offset) => {
|
|||||||
|
|
||||||
let port = _TVDOS.DRV.FS.SERIAL._toPorts(fd.driveLetter)
|
let port = _TVDOS.DRV.FS.SERIAL._toPorts(fd.driveLetter)
|
||||||
dma.ramToCom(ptr, port[0], count)
|
dma.ramToCom(ptr, port[0], count)
|
||||||
|
|
||||||
}
|
}
|
||||||
_TVDOS.DRV.FS.SERIAL.swrite = (fd, string) => {
|
_TVDOS.DRV.FS.SERIAL.swrite = (fd, string) => {
|
||||||
let rrrr = _TVDOS.DRV.FS.SERIAL._openw(fd); if (rrrr != 0) throw Error("Writing a file failed with "+rrrr)
|
let rrrr = _TVDOS.DRV.FS.SERIAL._openw(fd); if (rrrr != 0) throw Error("Writing a file failed with "+rrrr)
|
||||||
@@ -342,18 +363,36 @@ _TVDOS.DRV.FS.SERIAL.swrite = (fd, string) => {
|
|||||||
com.sendMessage(port[0], string)
|
com.sendMessage(port[0], string)
|
||||||
_TVDOS.DRV.FS.SERIAL._flush(port[0]);_TVDOS.DRV.FS.SERIAL._close(port[0])
|
_TVDOS.DRV.FS.SERIAL._flush(port[0]);_TVDOS.DRV.FS.SERIAL._close(port[0])
|
||||||
}
|
}
|
||||||
_TVDOS.DRV.FS.SERIAL.bread = (fd) => {
|
|
||||||
let str = _TVDOS.DRV.FS.SERIAL.sread(fd)
|
|
||||||
let bytes = new Uint8Array(str.length)
|
|
||||||
for (let i = 0; i < str.length; i++) {
|
|
||||||
bytes[i] = str.charCodeAt(i)
|
|
||||||
}
|
|
||||||
return bytes
|
|
||||||
}
|
|
||||||
_TVDOS.DRV.FS.SERIAL.bwrite = (fd, bytes) => { // pwrite replaces DMA.ramToCom
|
_TVDOS.DRV.FS.SERIAL.bwrite = (fd, bytes) => { // pwrite replaces DMA.ramToCom
|
||||||
let string = String.fromCharCode.apply(null, bytes) // no spreading: has length limit
|
let string = String.fromCharCode.apply(null, bytes) // no spreading: has length limit
|
||||||
_TVDOS.DRV.FS.SERIAL.swrite(fd, string)
|
_TVDOS.DRV.FS.SERIAL.swrite(fd, string)
|
||||||
}
|
}
|
||||||
|
_TVDOS.DRV.FS.SERIAL.pappend = (fd, ptr, count) => {
|
||||||
|
let rrrr = _TVDOS.DRV.FS.SERIAL._opena(fd); if (rrrr != 0) throw Error("Appending to a file failed with "+rrrr)
|
||||||
|
|
||||||
|
let port = _TVDOS.DRV.FS.SERIAL._toPorts(fd.driveLetter)
|
||||||
|
dma.ramToCom(ptr, port[0], count)
|
||||||
|
}
|
||||||
|
_TVDOS.DRV.FS.SERIAL.bappend = (fd, bytes) => { // pwrite replaces DMA.ramToCom
|
||||||
|
let string = String.fromCharCode.apply(null, bytes) // no spreading: has length limit
|
||||||
|
_TVDOS.DRV.FS.SERIAL.sappend(fd, string)
|
||||||
|
}
|
||||||
|
_TVDOS.DRV.FS.SERIAL.sappend = (fd, string) => {
|
||||||
|
let rrrr = _TVDOS.DRV.FS.SERIAL._opena(fd); if (rrrr != 0) throw Error("Appending to a file failed with "+rrrr)
|
||||||
|
|
||||||
|
let port = _TVDOS.DRV.FS.SERIAL._toPorts(fd.driveLetter)
|
||||||
|
com.sendMessage(port[0], "WRITE"+string.length)
|
||||||
|
let response = com.getStatusCode(port[0])
|
||||||
|
if (135 == response) {
|
||||||
|
throw Error("File not opened")
|
||||||
|
}
|
||||||
|
if (response < 0 || response >= 128) {
|
||||||
|
throw Error("Appending to a file failed with "+response)
|
||||||
|
}
|
||||||
|
com.sendMessage(port[0], string)
|
||||||
|
_TVDOS.DRV.FS.SERIAL._flush(port[0]);_TVDOS.DRV.FS.SERIAL._close(port[0])
|
||||||
|
}
|
||||||
|
|
||||||
_TVDOS.DRV.FS.SERIAL.isDirectory = (fd) => {
|
_TVDOS.DRV.FS.SERIAL.isDirectory = (fd) => {
|
||||||
if (129 == _TVDOS.DRV.FS.SERIAL._openr(fd)) return false // file not exists
|
if (129 == _TVDOS.DRV.FS.SERIAL._openr(fd)) return false // file not exists
|
||||||
|
|
||||||
@@ -626,7 +665,7 @@ _TVDOS.DRV.FS.NET.sread = (fd) => {
|
|||||||
let port = _TVDOS.DRV.FS.SERIAL._toPorts(fd.driveLetter)
|
let port = _TVDOS.DRV.FS.SERIAL._toPorts(fd.driveLetter)
|
||||||
let url = fd.path.substring(fd.path.indexOf("\\")+1).replaceAll("\\","/")
|
let url = fd.path.substring(fd.path.indexOf("\\")+1).replaceAll("\\","/")
|
||||||
|
|
||||||
serial.println("NETFILE GET " + url)
|
// serial.println("NETFILE GET " + url)
|
||||||
com.sendMessage(port[0], "GET " + url)
|
com.sendMessage(port[0], "GET " + url)
|
||||||
com.waitUntilReady(port[0])
|
com.waitUntilReady(port[0])
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ const welcome_text = (termWidth > 40) ? `${osName}, version ${_TVDOS.VERSION}`
|
|||||||
const greetLeftPad = (termWidth - welcome_text.length - 6) >> 1
|
const greetLeftPad = (termWidth - welcome_text.length - 6) >> 1
|
||||||
const greetRightPad = termWidth - greetLeftPad - welcome_text.length - 6
|
const greetRightPad = termWidth - greetLeftPad - welcome_text.length - 6
|
||||||
|
|
||||||
|
function debugprintln(t) {
|
||||||
|
if (DEBUG_PRINT) serial.println(t)
|
||||||
|
}
|
||||||
|
|
||||||
function makeHash() {
|
function makeHash() {
|
||||||
let e = "YBNDRFG8EJKMCPQXOTLVWIS2A345H769"
|
let e = "YBNDRFG8EJKMCPQXOTLVWIS2A345H769"
|
||||||
let m = e.length
|
let m = e.length
|
||||||
@@ -314,29 +318,29 @@ shell.resolvePathInput = function(input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
serial.println("command.js > resolvePathInput > sanitised input: "+pathstr)
|
debugprintln("command.js > resolvePathInput > sanitised input: "+pathstr)
|
||||||
|
|
||||||
let startsWithSlash = pathstr.startsWith('/')
|
let startsWithSlash = pathstr.startsWith('/')
|
||||||
let newPwd = []
|
let newPwd = []
|
||||||
|
|
||||||
serial.println("command.js > resolvePathInput > path starts with slash: "+startsWithSlash)
|
debugprintln("command.js > resolvePathInput > path starts with slash: "+startsWithSlash)
|
||||||
|
|
||||||
// split them into an array while filtering empty elements except for the root 'head'
|
// split them into an array while filtering empty elements except for the root 'head'
|
||||||
let ipwd = (startsWithSlash ? [""] : shell_pwd).concat(pathstr.split("/").filter(function(it) { return (it.length > 0); }))
|
let ipwd = (startsWithSlash ? [""] : shell_pwd).concat(pathstr.split("/").filter(function(it) { return (it.length > 0); }))
|
||||||
|
|
||||||
serial.println("command.js > resolvePathInput > ipwd = "+ipwd)
|
debugprintln("command.js > resolvePathInput > ipwd = "+ipwd)
|
||||||
serial.println("command.js > resolvePathInput > newPwd = "+newPwd)
|
debugprintln("command.js > resolvePathInput > newPwd = "+newPwd)
|
||||||
|
|
||||||
// process dots
|
// process dots
|
||||||
ipwd.forEach(function(it) {
|
ipwd.forEach(function(it) {
|
||||||
serial.println("command.js > resolvePathInput > ipwd.forEach > it = "+it)
|
debugprintln("command.js > resolvePathInput > ipwd.forEach > it = "+it)
|
||||||
if (it === ".." && newPwd[1] !== undefined) {
|
if (it === ".." && newPwd[1] !== undefined) {
|
||||||
newPwd.pop()
|
newPwd.pop()
|
||||||
}
|
}
|
||||||
else if (it !== ".." && it !== ".") {
|
else if (it !== ".." && it !== ".") {
|
||||||
newPwd.push(it)
|
newPwd.push(it)
|
||||||
}
|
}
|
||||||
serial.println("command.js > resolvePathInput > newPwd = "+newPwd)
|
debugprintln("command.js > resolvePathInput > newPwd = "+newPwd)
|
||||||
})
|
})
|
||||||
|
|
||||||
// construct new pathstr from pwd arr so it will be sanitised
|
// construct new pathstr from pwd arr so it will be sanitised
|
||||||
@@ -372,7 +376,7 @@ shell.coreutils = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let path = shell.resolvePathInput(args[1])
|
let path = shell.resolvePathInput(args[1])
|
||||||
if (DEBUG_PRINT) serial.println("command.js > cd > pathstr = "+path.string)
|
debugprintln("command.js > cd > pathstr = "+path.string)
|
||||||
|
|
||||||
// check if path is valid
|
// check if path is valid
|
||||||
let file = files.open(path.full)
|
let file = files.open(path.full)
|
||||||
@@ -394,8 +398,8 @@ shell.coreutils = {
|
|||||||
let sourceFile = files.open(path.full)
|
let sourceFile = files.open(path.full)
|
||||||
let destFile = files.open(pathd.full)
|
let destFile = files.open(pathd.full)
|
||||||
|
|
||||||
serial.println(`[cp] source path: ${path.full}`)
|
debugprintln(`[cp] source path: ${path.full}`)
|
||||||
serial.println(`[cp] dest path: ${pathd.full}`)
|
debugprintln(`[cp] dest path: ${pathd.full}`)
|
||||||
|
|
||||||
if (sourceFile.isDirectory || !sourceFile.exists) { printerrln(`${args[0].toUpperCase()} failed for '${sourceFile.fullPath}'`); return 1 } // if file is directory or failed to open, IO error code will be returned
|
if (sourceFile.isDirectory || !sourceFile.exists) { printerrln(`${args[0].toUpperCase()} failed for '${sourceFile.fullPath}'`); return 1 } // if file is directory or failed to open, IO error code will be returned
|
||||||
if (destFile.isDirectory) { printerrln(`${args[0].toUpperCase()} failed for '${destFile.fullPath}'`); return 1 } // if file is directory or failed to open, IO error code will be returned
|
if (destFile.isDirectory) { printerrln(`${args[0].toUpperCase()} failed for '${destFile.fullPath}'`); return 1 } // if file is directory or failed to open, IO error code will be returned
|
||||||
@@ -489,7 +493,7 @@ shell.coreutils = {
|
|||||||
}
|
}
|
||||||
let path = shell.resolvePathInput(args[1])
|
let path = shell.resolvePathInput(args[1])
|
||||||
let file = files.open(path.full)
|
let file = files.open(path.full)
|
||||||
if (DEBUG_PRINT) serial.println("command.js > mkdir > pathstr = "+path.full)
|
debugprintln("command.js > mkdir > pathstr = "+path.full)
|
||||||
|
|
||||||
// check if path is valid
|
// check if path is valid
|
||||||
if (!file.exists) {
|
if (!file.exists) {
|
||||||
@@ -596,7 +600,7 @@ shell.execute = function(line) {
|
|||||||
|
|
||||||
// TODO : if operator is not undefined, swap built-in print functions with ones that 'prints' on pipes instead of stdout
|
// TODO : if operator is not undefined, swap built-in print functions with ones that 'prints' on pipes instead of stdout
|
||||||
if (op == '|') {
|
if (op == '|') {
|
||||||
serial.println(`Statement #${c+1}: pushing anon pipe`)
|
debugprintln(`Statement #${c+1}: pushing anon pipe`)
|
||||||
shell.pushAnonPipe('')
|
shell.pushAnonPipe('')
|
||||||
|
|
||||||
print = shell.stdio.pipe.print
|
print = shell.stdio.pipe.print
|
||||||
@@ -656,7 +660,7 @@ shell.execute = function(line) {
|
|||||||
searchPath = trimStartRevSlash(search + cmd + pathExt[j])
|
searchPath = trimStartRevSlash(search + cmd + pathExt[j])
|
||||||
|
|
||||||
if (DEBUG_PRINT) {
|
if (DEBUG_PRINT) {
|
||||||
serial.println("[command.js > shell.execute] file search path: "+searchPath)
|
debugprintln("[command.js > shell.execute] file search path: "+searchPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
searchFile = files.open(`${CURRENT_DRIVE}:\\${searchPath}`)
|
searchFile = files.open(`${CURRENT_DRIVE}:\\${searchPath}`)
|
||||||
@@ -735,8 +739,8 @@ shell.execute = function(line) {
|
|||||||
|
|
||||||
// destroy pipe if operator is not pipe
|
// destroy pipe if operator is not pipe
|
||||||
if (op != "|" && op != ">>" && op != ">") {
|
if (op != "|" && op != ">>" && op != ">") {
|
||||||
serial.println(`Statement #${c+1}: destroying pipe`)
|
debugprintln(`Statement #${c+1}: destroying pipe`)
|
||||||
serial.println(`its content was: ${shell.removePipe()}`)
|
debugprintln(`its content was: ${shell.removePipe()}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,77 +26,12 @@ if (!outfilename) {
|
|||||||
let outfile = files.open(_G.shell.resolvePathInput(outfilename).full)
|
let outfile = files.open(_G.shell.resolvePathInput(outfilename).full)
|
||||||
|
|
||||||
|
|
||||||
const filesystem = {};
|
|
||||||
|
|
||||||
filesystem._toPorts = (driveLetter) => {
|
|
||||||
if (driveLetter.toUpperCase === undefined) {
|
|
||||||
throw Error("'"+driveLetter+"' (type: "+typeof driveLetter+") is not a valid drive letter");
|
|
||||||
}
|
|
||||||
var port = _TVDOS.DRIVES[driveLetter.toUpperCase()];
|
|
||||||
if (port === undefined) {
|
|
||||||
throw Error("Drive letter '" + driveLetter.toUpperCase() + "' does not exist");
|
|
||||||
}
|
|
||||||
return port
|
|
||||||
}
|
|
||||||
filesystem._close = (portNo) => {
|
|
||||||
com.sendMessage(portNo, "CLOSE")
|
|
||||||
}
|
|
||||||
filesystem._flush = (portNo) => {
|
|
||||||
com.sendMessage(portNo, "FLUSH")
|
|
||||||
}
|
|
||||||
filesystem.open = (driveLetter, path, operationMode) => {
|
|
||||||
var port = filesystem._toPorts(driveLetter);
|
|
||||||
|
|
||||||
filesystem._flush(port[0]); filesystem._close(port[0]);
|
|
||||||
|
|
||||||
var mode = operationMode.toUpperCase();
|
|
||||||
if (mode != "R" && mode != "W" && mode != "A") {
|
|
||||||
throw Error("Unknown file opening mode: " + mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
com.sendMessage(port[0], "OPEN"+mode+'"'+path+'",'+port[1]);
|
|
||||||
return com.getStatusCode(port[0]);
|
|
||||||
}
|
|
||||||
filesystem.getFileLen = (driveLetter) => {
|
|
||||||
var port = filesystem._toPorts(driveLetter);
|
|
||||||
com.sendMessage(port[0], "GETLEN");
|
|
||||||
var response = com.getStatusCode(port[0]);
|
|
||||||
if (135 == response) {
|
|
||||||
throw Error("File not opened");
|
|
||||||
}
|
|
||||||
if (response < 0 || response >= 128) {
|
|
||||||
throw Error("Reading a file failed with "+response);
|
|
||||||
}
|
|
||||||
return Number(com.pullMessage(port[0]));
|
|
||||||
}
|
|
||||||
filesystem.write = (driveLetter, string) => {
|
|
||||||
var port = filesystem._toPorts(driveLetter);
|
|
||||||
com.sendMessage(port[0], "WRITE"+string.length);
|
|
||||||
var response = com.getStatusCode(port[0]);
|
|
||||||
if (135 == response) {
|
|
||||||
throw Error("File not opened");
|
|
||||||
}
|
|
||||||
if (response < 0 || response >= 128) {
|
|
||||||
throw Error("Writing a file failed with "+response);
|
|
||||||
}
|
|
||||||
com.sendMessage(port[0], string);
|
|
||||||
filesystem._flush(port[0]); filesystem._close(port[0]);
|
|
||||||
}
|
|
||||||
filesystem.writeBytes = (driveLetter, bytes) => {
|
|
||||||
var string = String.fromCharCode.apply(null, bytes); // no spreading: has length limit
|
|
||||||
filesystem.write(driveLetter, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function appendToOutfile(bytes) {
|
function appendToOutfile(bytes) {
|
||||||
filesystem.open("A", outfilename, "A")
|
outfile.bappend(bytes)
|
||||||
filesystem.writeBytes("A", bytes)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendToOutfilePtr(ptr, len) {
|
function appendToOutfilePtr(ptr, len) {
|
||||||
filesystem.open("A", outfilename, "A")
|
outfile.pappend(ptr, len)
|
||||||
dma.ramToCom(ptr, 0, len)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// write header to the file
|
// write header to the file
|
||||||
@@ -113,14 +48,13 @@ let headerBytes = [
|
|||||||
let ipfFun = (IPFMODE == 1) ? graphics.encodeIpf1 : (IPFMODE == 2) ? graphics.encodeIpf2 : 0
|
let ipfFun = (IPFMODE == 1) ? graphics.encodeIpf1 : (IPFMODE == 2) ? graphics.encodeIpf2 : 0
|
||||||
if (!ipfFun) throw Error("Unknown IPF mode "+IPFMODE)
|
if (!ipfFun) throw Error("Unknown IPF mode "+IPFMODE)
|
||||||
|
|
||||||
filesystem.open("A", outfilename, "W")
|
outfile.bwrite(headerBytes)
|
||||||
filesystem.writeBytes("A", headerBytes)
|
|
||||||
|
|
||||||
for (let f = 1; f <= TOTAL_FRAMES; f++) {
|
for (let f = 1; f <= TOTAL_FRAMES; f++) {
|
||||||
let fname = PATHFUN(f)
|
let fname = PATHFUN(f)
|
||||||
filesystem.open("A", fname, "R")
|
let framefile = files.open(_G.shell.resolvePathInput(fname).full)
|
||||||
let fileLen = filesystem.getFileLen("A")
|
let fileLen = framefile.size
|
||||||
dma.comToRam(0, 0, infile, fileLen)
|
framefile.pread(infile, fileLen)
|
||||||
|
|
||||||
|
|
||||||
let [_1, _2, channels, _3] = graphics.decodeImageTo(infile, fileLen, imagearea)
|
let [_1, _2, channels, _3] = graphics.decodeImageTo(infile, fileLen, imagearea)
|
||||||
|
|||||||
Reference in New Issue
Block a user