From 8d7d534bc847c3de3029075112860df790b17a9e Mon Sep 17 00:00:00 2001 From: minjaesong Date: Tue, 28 Apr 2026 01:20:48 +0900 Subject: [PATCH] taud logo; command.js supporting .alias file --- assets/disk0/tvdos/TVDOS.SYS | 6 +++--- assets/disk0/tvdos/bin/command.js | 19 +++++++++++++++++ assets/disk0/tvdos/bin/microtone.alias | 1 + assets/disk0/tvdos/bin/taut.js | 27 ++++++++++++++++--------- assets/disk0/tvdos/bin/tauthdr.png | Bin 0 -> 353 bytes assets/disk0/tvdos/bin/tauthdr.r8 | 1 + assets/disk0/tvdos/include/gl.mjs | 2 +- 7 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 assets/disk0/tvdos/bin/microtone.alias create mode 100644 assets/disk0/tvdos/bin/tauthdr.png create mode 100644 assets/disk0/tvdos/bin/tauthdr.r8 diff --git a/assets/disk0/tvdos/TVDOS.SYS b/assets/disk0/tvdos/TVDOS.SYS index 8580cfc..327c4ea 100644 --- a/assets/disk0/tvdos/TVDOS.SYS +++ b/assets/disk0/tvdos/TVDOS.SYS @@ -147,7 +147,7 @@ _TVDOS.variables = { LANG: "EN", KEYBOARD: "us_qwerty", PATH: "\\tvdos\\bin;\\home", - PATHEXT: ".com;.bat;.app;.js", + PATHEXT: ".com;.bat;.app;.js;.alias", HELPPATH: "\\tvdos\\help", OS_NAME: "TSVM Disk Operating System", OS_VERSION: _TVDOS.VERSION @@ -423,11 +423,11 @@ _TVDOS.DRV.FS.SERIAL.sread = (fd) => { } _TVDOS.DRV.FS.SERIAL.bread = (fd) => { let str = _TVDOS.DRV.FS.SERIAL.sread(fd) - let bytes = new Int8Array(str.length) + let bytes = []//new Int8Array(str.length) for (let i = 0; i < str.length; i++) { // let p = str.charCodeAt(i) // bytes[i] = (p > 127) ? p - 255 : p - bytes[i] = str.charCodeAt(i) + bytes.push(str.charCodeAt(i)) } return bytes } diff --git a/assets/disk0/tvdos/bin/command.js b/assets/disk0/tvdos/bin/command.js index c5c7e59..ab916b3 100644 --- a/assets/disk0/tvdos/bin/command.js +++ b/assets/disk0/tvdos/bin/command.js @@ -753,6 +753,25 @@ shell.execute = function(line) { shell.execute(line) }) } + else if ("ALIAS" == extension) { + // parse alias + // $0: all arguments + // $1..9: specific arguments + var lines = programCode.split('\n').filter(function(it) { return it.length > 0 }) // this return is not shell's return! + lines.forEach(function(line) { + var newLine = line + + // replace $1..$9 + for (let j = 1; j < 9; j++) { + newLine = newLine.replaceAll('$'+j, tokens[j]) + } + + // replace $0 + newLine = newLine.replaceAll('$0', tokens.slice(1).join(' ')) + + shell.execute(newLine) + }) + } else if ("APP" == extension) { let appexec = `A:${_TVDOS.variables.DOSDIR}\\sbin\\appexec.js` let foundFile = searchFile.fullPath diff --git a/assets/disk0/tvdos/bin/microtone.alias b/assets/disk0/tvdos/bin/microtone.alias new file mode 100644 index 0000000..ffc34a9 --- /dev/null +++ b/assets/disk0/tvdos/bin/microtone.alias @@ -0,0 +1 @@ +taut $0 diff --git a/assets/disk0/tvdos/bin/taut.js b/assets/disk0/tvdos/bin/taut.js index 334ac0d..506a1c7 100644 --- a/assets/disk0/tvdos/bin/taut.js +++ b/assets/disk0/tvdos/bin/taut.js @@ -8,9 +8,7 @@ const win = require("wintex") const font = require("font") const taud = require("taud") const keys = require("keysym") - -font.setLowRom("A:/tvdos/bin/tautfont_low.chr") -font.setHighRom("A:/tvdos/bin/tautfont_high.chr") +const gl = require("gl") const BUILD_DATE = "260424" const TRACKER_SIGNATURE = "TsvmTaut"+BUILD_DATE // 14-byte string @@ -674,14 +672,16 @@ function drawStatusBar() { con.color_pair(colEffOp, 255); print(`${sSpd}`) // app title - let s1 = "Microtone" + /*let s1 = "Microtone" let s2 = "tracker for tsvm" con.move(1, (SCRW - (s1.length & 254)) >>> 1) con.color_pair(colBrand, 255); print('Micro') con.color_pair(colStatus, 255); print('tone') con.move(2, (SCRW - (s2.length & 254)) >>> 1) con.color_pair(colSep, 255); print('tracker for ') - con.color_pair(74, 255); print('tsvm') + con.color_pair(74, 255); print('tsvm')*/ + gl.drawTexImage(logoTexture, (graphics.getPixelDimension()[0]-logoTexture.width) >>> 1, 6) + } function drawTabBar() { @@ -1163,6 +1163,12 @@ if (fullPathObj === undefined) { return 1 } +const logofile = files.open("A:/tvdos/bin/tauthdr.r8") +const logoBytes = logofile.bread(); logofile.close() +const logoTexture = new gl.Texture(88, 12, logoBytes) + +font.setLowRom("A:/tvdos/bin/tautfont_low.chr") +font.setHighRom("A:/tvdos/bin/tautfont_high.chr") const song = loadTaud(fullPathObj.full, 0) const voiceMutes = new Array(NUM_VOICES).fill(false) @@ -2137,7 +2143,7 @@ function applyGoto(num) { } function openConfirmQuit() { - const pw = 24 + const pw = 25 const ph = 5 const px = ((SCRW - pw) / 2 | 0) + 1 const py = ((SCRH - ph) / 2 | 0) @@ -2151,7 +2157,7 @@ function openConfirmQuit() { con.move(py + 2, px + 2) con.color_pair(colStatus, colPopupBack) - print('Exit taut? ') + print('Exit Microtone? ') con.color_pair(230, 240) print('[Y/N]') @@ -2159,11 +2165,13 @@ function openConfirmQuit() { let result = false let done = false + let eventJustReceived = true while (!done) { input.withEvent(ev => { if (ev[0] !== 'key_down') return if (1 !== ev[2]) return const ks = ev[1] + if (ks === 'y' || ks === 'Y' || ks === '\n') { result = true; done = true } else if (ks === 'n' || ks === 'N' || ks === '') { done = true } }) @@ -2195,12 +2203,12 @@ function openGotoPopup() { const ks = ev[1] if (1 !== ev[2]) return // not key just hit - if (eventJustReceived) { // filter Shift-G input + if (eventJustReceived) { // filter lingering input eventJustReceived = false return } - if (ks === '') { + if (ks === '' || ks === 'x') { done = true } else if (ks === '\n') { if (buf.length > 0) applyGoto(parseInt(buf, 16)) @@ -2299,6 +2307,7 @@ resetAudioDevice() sys.free(SCRATCH_PTR) font.resetLowRom() font.resetHighRom() +graphics.clearPixels(255) con.clear() con.move(1, 1) con.curs_set(1) diff --git a/assets/disk0/tvdos/bin/tauthdr.png b/assets/disk0/tvdos/bin/tauthdr.png new file mode 100644 index 0000000000000000000000000000000000000000..8352118f28dbe005419aff846f3bc33a05bbf37c GIT binary patch literal 353 zcmV-n0iOPeP)1zME}~v*jxtuYdj_!F>PBM})8by-_0H`e7u{5* zsne?IJ*?(aoYcY>Ybh70lYFF3D_6T8&!^uttBw)EdJWMtPJZ