Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Ismael-VC / gulpfile.js
Created March 8, 2024 05:40
Gulp watcher for Uxntal development.
const { exec } = require('child_process');
const gulp = require('gulp');
async function build() {
exec(
'clear && uxnasm test.tal test.rom && uxncli test.rom',
(error, stdout, stderr) => {
if (!(stdout.length === 0)) {
console.log(`${stdout}`);
@Ismael-VC
Ismael-VC / settings.json
Created March 4, 2024 03:06
Micro editor settings.
{
"colorcolumn": 80,
"diffgutter": true,
"hlsearch": true,
"indentchar": "⋅",
"rmtrailingws": true,
"scrollbar": true,
"softwrap": true,
"tabmovement": true,
"tabsize": 2,
@Ismael-VC
Ismael-VC / pong.tal
Created January 21, 2024 17:26
Pong Game in Uxntal.
( pong.tal )
( devices )
|00 @System [
&vector $2
&pad $6
&r $2
&g $2
&b $2
@Ismael-VC
Ismael-VC / chromatic-scale.tal
Last active May 11, 2023 18:29
Qwerty keyboard input from G2 to G5 (3 octaves) for uxntal piano.tal
(
QWERTY from G2 to G5:
2 3 5 6 7 9 0 = | C#4 D#4 F#4 G#4 A#4 C#5 D#5 F#5
q w e r t y u i o p [ ] | C4 D4 E4 F4 G4 A4 B4 C5 D5 E5 F5 G5
s d g h k l ; | G#2 A#2 C#3 D#3 F#3 G#3 A#3
z x c v b n m , . / | G2 A2 B2 C3 D3 E3 F3 G3 A3 B3
)
.Controller/key DEI
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
|0100 @on-reset ( -> )
#03 #00
&for
( send ) ;hello-word print-text
( loop ) INC GTHk ?&for
POP2
diff --git a/build.sh b/build.sh
index 28682b5..88076e8 100755
--- a/build.sh
+++ b/build.sh
@@ -67,7 +67,7 @@ fi
mkdir -p bin
CC="${CC:-cc}"
-CFLAGS="${CFLAGS:--std=c89 -Wall -Wno-unknown-pragmas}"
+CFLAGS="${CFLAGS:--std=c89 -Wall -Wno-unknown-pragmas -D_DARWIN_C_SOURCE}"
(
LDA I
CMP J
BEQ EQL
BGE LBL
)
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
@foo ( a b -- bool ) [
( if ) [ ( a b ) EQU ] ?&then [
( else ) [
#00 ( return false )
RTN
] &then [
#01 ( return true )
]
]
RTN
@Ismael-VC
Ismael-VC / if-then-else.tal
Created April 11, 2023 22:15
If statements in uxntal.
@foo ( a b -- bool )
( if ) [ ( a b ) EQU ] ?&then
( else )
#00 ( return false )
!&end
&then
#01 ( return true )
&end
( endif )
RTN
➜ roms uxncli console.rom
Welcome to Uxn!
hello
You said: hello
this is great
You said: this
You said: is
You said: great