diff --git a/projects/software/left.usm b/projects/software/left.usm index 29917e0..4b273f6 100644 --- a/projects/software/left.usm +++ b/projects/software/left.usm @@ -713,7 +713,7 @@ RTN @filepath1 [ projects/examples/gui.hover.usm 00 ] @filepath [ projects/software/noodle.usm 00 ] -|3000 ;document { eof 2 body 8000 } -|c000 ;clip { len 2 body 256 } +@ERROR BRK -|d000 @ERROR BRK \ No newline at end of file +;clip { len 2 body 256 } +;document { eof 2 body 2 } \ No newline at end of file diff --git a/src/assembler.c b/src/assembler.c index c969885..ed6f065 100644 --- a/src/assembler.c +++ b/src/assembler.c @@ -11,6 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ +#define OFFSET 0x0200 + typedef unsigned char Uint8; typedef signed char Sint8; typedef unsigned short Uint16; @@ -462,7 +464,7 @@ main(int argc, char *argv[]) error("Assembly", "Failed"); return 1; } - fwrite(p.data, p.ptr, 1, fopen(argv[2], "wb")); + fwrite(p.data + OFFSET, p.ptr - OFFSET, 1, fopen(argv[2], "wb")); fclose(f); cleanup(argv[2]); return 0; diff --git a/src/uxn.c b/src/uxn.c index d3885c8..0d140ff 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -187,7 +187,7 @@ loaduxn(Uxn *u, char *filepath) FILE *f; if(!(f = fopen(filepath, "rb"))) return haltuxn(u, "Missing input rom.", 0); - fread(u->ram.dat, sizeof(u->ram.dat), 1, f); + fread(u->ram.dat + PAGE_VECTORS, sizeof(u->ram.dat) - PAGE_VECTORS, 1, f); printf("Uxn loaded[%s].\n", filepath); return 1; }