Disks are now loaded at 0x0200

This commit is contained in:
neauoire 2021-03-28 11:06:36 -07:00
parent 2783e2945f
commit a2370ed4e3
3 changed files with 7 additions and 5 deletions

View File

@ -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
;clip { len 2 body 256 }
;document { eof 2 body 2 }

View File

@ -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;

View File

@ -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;
}