From 482862c7baedfc4a4790edf68fb177144196b376 Mon Sep 17 00:00:00 2001 From: Travis Shears Date: Tue, 6 Jan 2026 21:41:46 +0100 Subject: [PATCH] init repo --- .gitignore | 2 + README.md | 21 ++++ footer.1line | Bin 0 -> 5456 bytes one_line_canvas.tal | 196 +++++++++++++++++++++++++++++++++++++ one_line_file_type_spec.md | 26 +++++ 5 files changed, 245 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 footer.1line create mode 100644 one_line_canvas.tal create mode 100644 one_line_file_type_spec.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549ce76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.rom +*.sym diff --git a/README.md b/README.md new file mode 100644 index 0000000..84962bd --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# One Line + +This is an art project drawing canvas tool that enables drawing low resolution +pixel images. The project includes a file specification for the drawings and a canvas +app for making the files. + + +## Dev + +I compile and run the `.tal` file with `../my_projects/run_ui.sh one_line_canvas.tal` + +The `run_ui.sh` looks like this: + +```bash +#!/bin/sh + +filename="${1%.*}" +rom_filename="${filename}.rom" + +../uxn/bin/uxnasm $1 $rom_filename && ../uxn/bin/uxnemu $rom_filename +``` diff --git a/footer.1line b/footer.1line new file mode 100644 index 0000000000000000000000000000000000000000..f7bdf51ca5d66e2cab6dce8c332e6b591f667cc4 GIT binary patch literal 5456 zcmeIuNe+TA00mHQ0)>(S9dN|N ) + .Mouse/x DEI2 .x STZ2 + .Mouse/y DEI2 .y STZ2 + draw-cursor + add-px-to-drawing + BRK + +@draw-cursor + ( clear fg ) + LIT2 0000 .Screen/x DEO2 + LIT2 0000 .Screen/y DEO2 + #c0 .Screen/pixel DEO + ( draw cursor sprite to fg ) + .x LDZ2 #0002 SUB2 .Screen/x DEO2 + .y LDZ2 #0002 SUB2 .Screen/y DEO2 + ;cursor-sprite .Screen/addr DEO2 + #41 .Screen/sprite DEO + JMP2r + +@draw-v-line ( l x y ) + SWP ( l y x ) + #00 ( l y x 00 ) + SWP .Screen/x DEO2 ( l y ) + ( store vars ) + !{ &y $1 &l $1 } + ,/y STR ,/l STR + + &loop + ( set y ) + ,/y LDR DUP ( y y ) + #00 SWP ( y 00 y ) + .Screen/y DEO2 ( y ) + ( draw pixel ) + PX + ( incrment y ) + INC ( y+1 ) + ,/y STR ( ) + ( decrement l ) + ,/l LDR #01 ( l 01 ) + SUB ( l-1 ) + ,/l STRk POP ( l ) + #00 NEQ ?&loop + JMP2r + +@draw-h-line ( l x y ) + #00 ( l x y 00 ) + SWP .Screen/y DEO2 ( l x ) + ( store vars ) + !{ &x $1 &l $1 } + ,/x STR ,/l STR + + &loop + ( set x ) + ,/x LDR DUP ( x x ) + #00 SWP ( x 00 x ) + .Screen/x DEO2 ( x ) + ( draw pixel ) + PX + ( incrment x ) + INC ( x+1 ) + ,/x STR ( ) + ( decrement l ) + ,/l LDR #01 ( l 01 ) + SUB ( l-1 ) + ,/l STRk POP ( l ) + #00 NEQ ?&loop + JMP2r + +@setup-gui ( -- ) + (set screen height and width the 3x canvas size) + LIT2 =canvas-width #0003 MUL2 .Screen/width DEO2 + LIT2 =canvas-height #0003 MUL2 .Screen/height DEO2 + (set basic color scheme) + #f07f .System/r DEO2 + #f0d6 .System/g DEO2 + #f0b2 .System/b DEO2 + JMP2r + + +@cursor-sprite + 20 20 d8 20 20 00 00 00 +( +. . # . . . . . 20 +. . # . . . . . 20 +# # . # # . . . d8 +. . # . . . . . 20 +. . # . . . . . 20 +. . . . . . . . 00 +. . . . . . . . 00 +. . . . . . . . 00 +) + +@pxs-pt $2 +@pxs $1550 ( 5456 ) +( + pxs are the pixels of the drawing in order they are drawn + 0001 05 <-- x1 + 0002 04 <-- y1 + 0003 05 <-- x2 + 0004 03 <-- y2 +) diff --git a/one_line_file_type_spec.md b/one_line_file_type_spec.md new file mode 100644 index 0000000..adf732d --- /dev/null +++ b/one_line_file_type_spec.md @@ -0,0 +1,26 @@ +# .1line File Format Specification + +## Version +1.0.0 + +## Overview +Brief description of what .1line files are for and why they exist. + +## File Extension +- Extension: `.1line` +- MIME Type: `text/x-1line` (or `application/x-1line` if not plain text) + +## Character Encoding +UTF-8 (or specify your encoding) + +## Format Description +Detailed description of the format rules. + +## Syntax +Formal or semi-formal syntax definition. + +## Examples + +### Valid Examples +```/dev/null/example.1line +(example content)