From e7287fae372ca01392618e0e9438444fd0669c84 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Wed, 29 Apr 2026 03:53:40 +0900 Subject: [PATCH] taut: graphical buttons --- assets/disk0/tvdos/bin/taut.js | 35 +++++++++++++++++++++++------ assets/disk0/tvdos/bin/tautbtn.png | Bin 0 -> 214 bytes assets/disk0/tvdos/bin/tautbtn.r8 | 1 + assets/disk0/tvdos/bin/tautbtn0.r8 | 1 + terranmon.txt | 2 +- 5 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 assets/disk0/tvdos/bin/tautbtn.png create mode 100644 assets/disk0/tvdos/bin/tautbtn.r8 create mode 100644 assets/disk0/tvdos/bin/tautbtn0.r8 diff --git a/assets/disk0/tvdos/bin/taut.js b/assets/disk0/tvdos/bin/taut.js index 869102a..3b2f00a 100644 --- a/assets/disk0/tvdos/bin/taut.js +++ b/assets/disk0/tvdos/bin/taut.js @@ -537,6 +537,7 @@ function loadTaud(filePath, songIndex) { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// const [SCRH, SCRW] = con.getmaxyx() +const [SCRPW, SCRPH] = graphics.getPixelDimension() const PTNVIEW_OFFSET_X = 3 const PTNVIEW_OFFSET_Y = 5 const PTNVIEW_HEIGHT = SCRH - PTNVIEW_OFFSET_Y @@ -612,6 +613,7 @@ const transportControlReverse = [PLAYMODE_NONE, PLAYMODE_ROW, PLAYMODE_CUE, PLAY const transportControlSymbol = [sym.stop, sym.playrow, sym.playcue, sym.playall] const transportControlColour = [160,20,20,20] const transportControlHint = ["O","I","U","Y"] +let transportControlOldPos = 3 // index for transportControlReverse function drawStatusBar() { fillLine(1, colStatus, 255) fillLine(2, colStatus, 255) @@ -627,25 +629,38 @@ function drawStatusBar() { const sSpd = ''+audio.getTickRate(PLAYHEAD) // transport control and its control hints + let transportControlNewPos = transportControlOldPos transportControlReverse.forEach((thisMode, j) => { let active = (playbackMode == thisMode) if (active) - con.color_pair(transportControlColour[j], colPushBtnBack) + con.color_pair(transportControlColour[j], 255) else con.color_pair(colStatus, 255) - con.move(1, SCRW - 5*(j+1) + 1) - print(` ${transportControlSymbol[j]} `) + con.move(1, SCRW - 5*(j+1) + 1 + 2) + print(transportControlSymbol[j]) if (active) - con.color_pair(transportControlColour[j], colPushBtnBack) + con.color_pair(transportControlColour[j], 255) else con.color_pair(colVoiceHdr, 255) - con.move(2, SCRW - 5*(j+1) + 1) - print(` ${transportControlHint[j]} `) + con.move(2, SCRW - 5*(j+1) + 1 + 2) + print(transportControlHint[j]) + + if (active) transportControlNewPos = j; }) + // draw button background + if (transportControlOldPos != transportControlNewPos) { + // erase button from old pos + gl.drawTexImage(buttonNullTexture, SCRPW - 35*(transportControlOldPos+1), 0) + // paint button in new pos + gl.drawTexImage(buttonTexture, SCRPW - 35*(transportControlNewPos+1), 0) + // update pos tracking + transportControlOldPos = transportControlNewPos + } + // current audio device status // play/stop sym @@ -680,7 +695,7 @@ function drawStatusBar() { con.move(2, (SCRW - (s2.length & 254)) >>> 1) con.color_pair(colSep, 255); print('tracker for ') con.color_pair(74, 255); print('tsvm')*/ - gl.drawTexImage(logoTexture, (graphics.getPixelDimension()[0]-logoTexture.width) >>> 1, 6) + gl.drawTexImage(logoTexture, (SCRPW-logoTexture.width) >>> 1, 6) } @@ -1166,6 +1181,12 @@ if (fullPathObj === undefined) { const logofile = files.open("A:/tvdos/bin/tauthdr.r8") const logoBytes = logofile.bread(); logofile.close() const logoTexture = new gl.Texture(88, 12, logoBytes) +const buttonfile = files.open("A:/tvdos/bin/tautbtn.r8") +const buttonBytes = buttonfile.bread(); buttonfile.close() +const buttonTexture = new gl.Texture(35, 28, buttonBytes) +const buttonNullfile = files.open("A:/tvdos/bin/tautbtn0.r8") +const buttonNullBytes = buttonNullfile.bread(); buttonNullfile.close() +const buttonNullTexture = new gl.Texture(35, 28, buttonNullBytes) font.setLowRom("A:/tvdos/bin/tautfont_low.chr") font.setHighRom("A:/tvdos/bin/tautfont_high.chr") diff --git a/assets/disk0/tvdos/bin/tautbtn.png b/assets/disk0/tvdos/bin/tautbtn.png new file mode 100644 index 0000000000000000000000000000000000000000..33d270617d7b698537cd25428e82d248bbfc581a GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^%0Mi`!3HE>e`QkyQk(@Ik;M!QdO!(1WyXr7_GLi9 z4o?@y5Rc<;ryt}!puoe-`HIOPCH)1*8V2PJOxgy_$_F@dg;$>6m%QXhvc3PrjVwFE zi_hKG)IR3H-rQrjCGv^FmFn>Qr_|p!q!{cs$kyfLc<0O^Brqo```fH<4UU={-8J>C zuSTssuMDmRTcKsPaX My85}Sb4q9e05K*_9RL6T literal 0 HcmV?d00001 diff --git a/assets/disk0/tvdos/bin/tautbtn.r8 b/assets/disk0/tvdos/bin/tautbtn.r8 new file mode 100644 index 0000000..9366d67 --- /dev/null +++ b/assets/disk0/tvdos/bin/tautbtn.r8 @@ -0,0 +1 @@ +ÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿþûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûþûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúûúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùúùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøùøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷a÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷aÿaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaÿ \ No newline at end of file diff --git a/assets/disk0/tvdos/bin/tautbtn0.r8 b/assets/disk0/tvdos/bin/tautbtn0.r8 new file mode 100644 index 0000000..db9fc06 --- /dev/null +++ b/assets/disk0/tvdos/bin/tautbtn0.r8 @@ -0,0 +1 @@ +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ \ No newline at end of file diff --git a/terranmon.txt b/terranmon.txt index 8daee60..50f25bf 100644 --- a/terranmon.txt +++ b/terranmon.txt @@ -2177,7 +2177,7 @@ Tracker Note Effects has been moved to `TAUD_NOTE_EFFECTS.md` **Taud serialisation format** Created by CuriousTorvald on 2026-04-19 -This is a file format for Taud tracker data. Taud can be extended with project data in backward-and-forward-compatible manner. +This is a file format for Taud tracker data. Taud can be extended with Microtone (taut.js) project data in backward-and-forward-compatible manner. Endianness: Little