Fix file reading, fix ARG implementation

This commit is contained in:
Simon Robertshaw
2012-09-15 12:26:52 +01:00
parent 3b2f4d59fc
commit b8a5b8ecb3
3 changed files with 3 additions and 5 deletions

View File

@@ -227,7 +227,7 @@ namespace vm
OPDEF(ARG) /* Marshal TOS to to-call argument list */ OPDEF(ARG) /* Marshal TOS to to-call argument list */
{ {
Marshal(parameter.int4, Pop()); Marshal(parameter.uint1, Pop());
return 0; return 0;
} }

View File

@@ -61,9 +61,7 @@ namespace vm
TRAPDEF(partCreate) TRAPDEF(partCreate)
{ {
printf("%d, %d, %d, %d\n", ARG(0).int4, ARG(1).int4, ARG(2).int4, ARG(3).int4); Push<int4_t>(sim->create_part(ARG(0).int4, ARG(1).int4, ARG(2).int4, ARG(3).int4));
Push<int4_t>(0);
//Push<int4_t>(sim->create_part(ARG(0).int4, ARG(1).int4, ARG(2).int4, ARG(3).int4));
} }
TRAPDEF(partChangeType) TRAPDEF(partChangeType)

View File

@@ -137,7 +137,7 @@ namespace vm
if ((i = opcodeParameterSize(n))) if ((i = opcodeParameterSize(n)))
{ {
x[0] = x[1] = x[2] = x[3] = 0; x[0] = x[1] = x[2] = x[3] = 0;
input.readsome((char*)x, 4); input.readsome((char*)x, i);
w.uint4 = (x[0]) | (x[1] << 8) | (x[2] << 16) | (x[3] << 24); w.uint4 = (x[0]) | (x[1] << 8) | (x[2] << 16) | (x[3] << 24);
} }
rom[romSize].Operation = n; rom[romSize].Operation = n;