uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit a4e54062b837991c1ede8fc377cd2650c3860fbf
parent 751d1986068ce91998e881d7d0e6e11196f86a06
Author: neauoire <aliceffekt@gmail.com>
Date:   Tue, 20 Apr 2021 17:11:02 -0700

Merged sandwich

Diffstat:
MREADME.md | 11++++-------
Mbuild.sh | 2+-
Metc/usm.sublime-syntax | 6+++---
Rprojects/examples/dev.audio.usm -> projects/examples/dev.audio-old.usm | 0
Mprojects/examples/dev.console.usm | 1-
Mprojects/examples/dev.controller.buttons.usm | 1-
Rprojects/examples/dev.controller.keys.usm -> projects/examples/dev.controller.keys-old.usm | 0
Rprojects/examples/dev.file.usm -> projects/examples/dev.file-old.usm | 0
Rprojects/examples/dev.mouse.usm -> projects/examples/dev.mouse-old.usm | 0
Rprojects/examples/dev.screen.usm -> projects/examples/dev.screen-old.usm | 0
Rprojects/examples/dev.time.usm -> projects/examples/dev.time-old.usm | 0
Rprojects/examples/gui.animation.usm -> projects/examples/gui.animation-old.usm | 0
Rprojects/examples/gui.hover.usm -> projects/examples/gui.hover-old.usm | 0
Rprojects/examples/gui.label.usm -> projects/examples/gui.label-old.usm | 0
Rprojects/examples/gui.picture.usm -> projects/examples/gui.picture-old.usm | 0
Rprojects/examples/gui.shapes.usm -> projects/examples/gui.shapes-old.usm | 0
Rprojects/examples/gui.wallpaper.usm -> projects/examples/gui.wallpaper-old.usm | 0
Msrc/emulator.c | 1+
Msrc/uxn.c | 2+-
Msrc/uxn.h | 1-
20 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md @@ -22,17 +22,11 @@ To build the Uxn emulator, you must have [SDL2](https://wiki.libsdl.org/). Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html). ``` -( Dev/Console ) - %RTN { JMP2r } -( devices ) - -|0110 @Console [ &pad $8 &char $1 ] - ( program ) -|0200 +|0100 ;hello-word ;print JSR2 @@ -50,6 +44,9 @@ RTN @hello-word [ 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 ] +( devices ) + +|ff10 @Console [ &pad $8 &char $1 ] ``` ## TODOs diff --git a/build.sh b/build.sh @@ -32,7 +32,7 @@ else fi echo "Assembling.." -./bin/assembler projects/examples/dev.console.usm bin/boot.rom +./bin/assembler projects/examples/dev.controller.buttons.usm bin/boot.rom echo "Running.." if [ "${2}" = '--cli' ]; diff --git a/etc/usm.sublime-syntax b/etc/usm.sublime-syntax @@ -22,9 +22,6 @@ contexts: scope: variable.control pop: true # constants - - match: '\:(\S+)\s?' - scope: string.control - pop: true # structs # Special @@ -49,6 +46,9 @@ contexts: - match: '\;(\S+)\s?' # absolute scope: keyword.control pop: true + - match: '\:(\S+)\s?' # raw + scope: keyword.control + pop: true - match: '\[\s?' scope: comment diff --git a/projects/examples/dev.audio.usm b/projects/examples/dev.audio-old.usm diff --git a/projects/examples/dev.console.usm b/projects/examples/dev.console.usm @@ -25,4 +25,3 @@ RTN ( devices ) |ff10 @Console [ &pad $8 &char $1 ] - diff --git a/projects/examples/dev.controller.buttons.usm b/projects/examples/dev.controller.buttons.usm @@ -84,4 +84,3 @@ BRK |ff10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $2 ] |ff20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] |ff40 @Controller [ &vector $2 &button $1 &key $1 ] - diff --git a/projects/examples/dev.controller.keys.usm b/projects/examples/dev.controller.keys-old.usm diff --git a/projects/examples/dev.file.usm b/projects/examples/dev.file-old.usm diff --git a/projects/examples/dev.mouse.usm b/projects/examples/dev.mouse-old.usm diff --git a/projects/examples/dev.screen.usm b/projects/examples/dev.screen-old.usm diff --git a/projects/examples/dev.time.usm b/projects/examples/dev.time-old.usm diff --git a/projects/examples/gui.animation.usm b/projects/examples/gui.animation-old.usm diff --git a/projects/examples/gui.hover.usm b/projects/examples/gui.hover-old.usm diff --git a/projects/examples/gui.label.usm b/projects/examples/gui.label-old.usm diff --git a/projects/examples/gui.picture.usm b/projects/examples/gui.picture-old.usm diff --git a/projects/examples/gui.shapes.usm b/projects/examples/gui.shapes-old.usm diff --git a/projects/examples/gui.wallpaper.usm b/projects/examples/gui.wallpaper-old.usm diff --git a/src/emulator.c b/src/emulator.c @@ -185,6 +185,7 @@ Uint8 system_poke(Uxn *u, Uint8 *m, Uint8 b0, Uint8 b1) { getcolors(&ppu, &m[0x8]); + printf("%02x%02x %02x%02x %02x%02x\n", m[0x8], m[0x9], m[0xa], m[0xb], m[0xc], m[0xd]); reqdraw = 1; (void)u; (void)b0; diff --git a/src/uxn.c b/src/uxn.c @@ -21,7 +21,7 @@ Uint8 pop8(Stack *s) { if (s->ptr == 0) { s->error = 1; return 0; } return s->d Uint8 peek8(Stack *s, Uint8 a) { if (s->ptr < a + 1) s->error = 1; return s->dat[s->ptr - a - 1]; } void mempoke8(Uxn *u, Uint16 a, Uint8 b) { u->ram.dat[a] = b; } Uint8 mempeek8(Uxn *u, Uint16 a) { return u->ram.dat[a]; } -void devpoke8(Uxn *u, Uint8 a, Uint8 b) { Device *dev = &u->dev[a >> 4]; dev->dat[a & 0xf] = dev->poke(u, dev->dat, a & 0x0f, b); } +void devpoke8(Uxn *u, Uint8 a, Uint8 b) { Device *dev = &u->dev[a >> 4]; dev->dat[a & 0xf] = b; dev->poke(u, dev->dat, a & 0x0f, b); } Uint8 devpeek8(Uxn *u, Uint8 a) { return u->dev[a >> 4].dat[a & 0xf]; } void push16(Stack *s, Uint16 a) { push8(s, a >> 8); push8(s, a); } Uint16 pop16(Stack *s) { return pop8(s) + (pop8(s) << 8); } diff --git a/src/uxn.h b/src/uxn.h @@ -17,7 +17,6 @@ typedef unsigned short Uint16; typedef signed short Sint16; #define PAGE_PROGRAM 0x0100 -#define LOAD_OFFSET 0x0100 #define genpeek16(ptr, i) ((ptr[i] << 8) + ptr[i + 1]) #define genpoke16(ptr, i, v) \