Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Ismael-VC / vtermtest.cpp
Created October 10, 2024 04:21 — forked from shimarin/vtermtest.cpp
SDL2 terminal emulator using libvterm
// g++ -o vtermtest vtermtest.cpp -lvterm -lutil -lSDL2 -lSDL2_ttf -licuuc
#include <termios.h>
#include <pty.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <iostream>
#include <vector>
#include <vterm.h>
#include <SDL2/SDL.h>
@Ismael-VC
Ismael-VC / unrolled_uxn.c
Created September 27, 2024 02:22
Unrolled UXN core (`cpp -E src/uxn.c`).
# 0 "../tal/uxn11/src/uxn.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h"
1 3 4
# 0 "<command-line>"
2
# 1 "../tal/uxn11/src/uxn.c"
# 1 "../tal/uxn11/src/uxn.h"
1
@Ismael-VC
Ismael-VC / foo.bdf
Created September 16, 2024 18:11
example bdf char definition
STARTCHAR zero
ENCODING 48
SWIDTH 500 0
DWIDTH 8 0
BBX 7 10 0 0
BITMAP
38
6C
C6
C6
@Ismael-VC
Ismael-VC / any2bdf.py
Created September 16, 2024 18:01
Dirty little hack to convert fonts to Uxn's .uf2 font format.
#!/usr/bin/env python3
import fontforge
import os
import sys
import subprocess
def convert_to_bdf(directory):
print("Converting font files to BDF...")
@Ismael-VC
Ismael-VC / random-theme.tal
Created August 12, 2024 23:29
Changing colors at runtime in UXN.
|00 @System
&vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2
&debug $1 &state $1
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|20 @Screen
&vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2
&pixel $1 &sprite $1
➜ ~ cat blimtest.tal
|100
;foo print
;bar print
;baz print
BRK
@print ( str* -- )
LDAk #18 DEO
@Ismael-VC
Ismael-VC / uxnasm-vs-drifblim.md
Created August 5, 2024 03:52
Differences between axnasm and drifblim.
  • uxnasm: treats (foo) as comment and fails.
  • drifblim: treats (foo) as nested comment, @[bar] as invalid symbol.
➜  ~ cat blimtest.tal 
|100
  (foo)
  [bar]
  {baz}
  BRK
@Ismael-VC
Ismael-VC / syntax.tal
Created June 15, 2024 23:56
Syntax experiment with Uxntal.
%PC { LITr 00 JSRr #0003 SUB2 }
%DBG { #010e DEO }
%function { }
%break { BRK }
%constant { }
%vector { }
%unless { }
%else { }
%end { }
@Ismael-VC
Ismael-VC / lbForth.c
Created March 18, 2024 15:35 — forked from lbruder/lbForth.c
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <[email protected]> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
( usage: uxncli terminal-cli.rom )
|10 @Console &vector $2 &read $1 $5 &write $1
|0a @enter
|100
@on-reset ( -> )
;on-console .Console/vector DEO2