diff --git a/README.md b/README.md index b77d7ec..0272958 100644 --- 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 index b6a4209..ff748ac 100755 --- 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 index dbf74d8..aef0f70 100644 --- 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 similarity index 100% rename from projects/examples/dev.audio.usm rename to projects/examples/dev.audio-old.usm diff --git a/projects/examples/dev.console.usm b/projects/examples/dev.console.usm index e1846bb..d132dfc 100644 --- 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 index 7d682cf..8af463e 100644 --- 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 similarity index 100% rename from projects/examples/dev.controller.keys.usm rename to projects/examples/dev.controller.keys-old.usm diff --git a/projects/examples/dev.file.usm b/projects/examples/dev.file-old.usm similarity index 100% rename from projects/examples/dev.file.usm rename to projects/examples/dev.file-old.usm diff --git a/projects/examples/dev.mouse.usm b/projects/examples/dev.mouse-old.usm similarity index 100% rename from projects/examples/dev.mouse.usm rename to projects/examples/dev.mouse-old.usm diff --git a/projects/examples/dev.screen.usm b/projects/examples/dev.screen-old.usm similarity index 100% rename from projects/examples/dev.screen.usm rename to projects/examples/dev.screen-old.usm diff --git a/projects/examples/dev.time.usm b/projects/examples/dev.time-old.usm similarity index 100% rename from projects/examples/dev.time.usm rename to projects/examples/dev.time-old.usm diff --git a/projects/examples/gui.animation.usm b/projects/examples/gui.animation-old.usm similarity index 100% rename from projects/examples/gui.animation.usm rename to projects/examples/gui.animation-old.usm diff --git a/projects/examples/gui.hover.usm b/projects/examples/gui.hover-old.usm similarity index 100% rename from projects/examples/gui.hover.usm rename to projects/examples/gui.hover-old.usm diff --git a/projects/examples/gui.label.usm b/projects/examples/gui.label-old.usm similarity index 100% rename from projects/examples/gui.label.usm rename to projects/examples/gui.label-old.usm diff --git a/projects/examples/gui.picture.usm b/projects/examples/gui.picture-old.usm similarity index 100% rename from projects/examples/gui.picture.usm rename to projects/examples/gui.picture-old.usm diff --git a/projects/examples/gui.shapes.usm b/projects/examples/gui.shapes-old.usm similarity index 100% rename from projects/examples/gui.shapes.usm rename to projects/examples/gui.shapes-old.usm diff --git a/projects/examples/gui.wallpaper.usm b/projects/examples/gui.wallpaper-old.usm similarity index 100% rename from projects/examples/gui.wallpaper.usm rename to projects/examples/gui.wallpaper-old.usm diff --git a/src/emulator.c b/src/emulator.c index 8c1c374..39aca6e 100644 --- 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 index 0199dbf..16cd4fe 100644 --- 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 index f087775..e38197d 100644 --- 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) \