Merged sandwich

This commit is contained in:
neauoire 2021-04-20 17:11:02 -07:00
parent 751d198606
commit a4e54062b8
20 changed files with 10 additions and 15 deletions

View File

@ -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). Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html).
``` ```
( Dev/Console )
%RTN { JMP2r } %RTN { JMP2r }
( devices )
|0110 @Console [ &pad $8 &char $1 ]
( program ) ( program )
|0200 |0100
;hello-word ;print JSR2 ;hello-word ;print JSR2
@ -50,6 +44,9 @@ RTN
@hello-word [ 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 ] @hello-word [ 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 ]
( devices )
|ff10 @Console [ &pad $8 &char $1 ]
``` ```
## TODOs ## TODOs

View File

@ -32,7 +32,7 @@ else
fi fi
echo "Assembling.." 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.." echo "Running.."
if [ "${2}" = '--cli' ]; if [ "${2}" = '--cli' ];

View File

@ -22,9 +22,6 @@ contexts:
scope: variable.control scope: variable.control
pop: true pop: true
# constants # constants
- match: '\:(\S+)\s?'
scope: string.control
pop: true
# structs # structs
# Special # Special
@ -49,6 +46,9 @@ contexts:
- match: '\;(\S+)\s?' # absolute - match: '\;(\S+)\s?' # absolute
scope: keyword.control scope: keyword.control
pop: true pop: true
- match: '\:(\S+)\s?' # raw
scope: keyword.control
pop: true
- match: '\[\s?' - match: '\[\s?'
scope: comment scope: comment

View File

@ -25,4 +25,3 @@ RTN
( devices ) ( devices )
|ff10 @Console [ &pad $8 &char $1 ] |ff10 @Console [ &pad $8 &char $1 ]

View File

@ -84,4 +84,3 @@ BRK
|ff10 @Console [ &pad $8 &char $1 &byte $1 &short $2 &string $2 ] |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 ] |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 ] |ff40 @Controller [ &vector $2 &button $1 &key $1 ]

View File

@ -185,6 +185,7 @@ Uint8
system_poke(Uxn *u, Uint8 *m, Uint8 b0, Uint8 b1) system_poke(Uxn *u, Uint8 *m, Uint8 b0, Uint8 b1)
{ {
getcolors(&ppu, &m[0x8]); 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; reqdraw = 1;
(void)u; (void)u;
(void)b0; (void)b0;

View File

@ -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]; } 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; } void mempoke8(Uxn *u, Uint16 a, Uint8 b) { u->ram.dat[a] = b; }
Uint8 mempeek8(Uxn *u, Uint16 a) { return u->ram.dat[a]; } 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]; } 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); } void push16(Stack *s, Uint16 a) { push8(s, a >> 8); push8(s, a); }
Uint16 pop16(Stack *s) { return pop8(s) + (pop8(s) << 8); } Uint16 pop16(Stack *s) { return pop8(s) + (pop8(s) << 8); }

View File

@ -17,7 +17,6 @@ typedef unsigned short Uint16;
typedef signed short Sint16; typedef signed short Sint16;
#define PAGE_PROGRAM 0x0100 #define PAGE_PROGRAM 0x0100
#define LOAD_OFFSET 0x0100
#define genpeek16(ptr, i) ((ptr[i] << 8) + ptr[i + 1]) #define genpeek16(ptr, i) ((ptr[i] << 8) + ptr[i + 1])
#define genpoke16(ptr, i, v) \ #define genpoke16(ptr, i, v) \