- implemented pass-by-reference arguments - so far only for memory based variables.

- changed Dehacked weapon function lookup to check the symbol table instead of directly referencing the VM functions. Once scriptified these pointers will no longer be available.
- removed all special ATAGs from the VM. While well intentioned any pointer tagged with them is basically unusable because it'd trigger asserts all over the place.
- scriptified A_Punch for testing pass-by-reference parameters and stack variables.
This commit is contained in:
Christoph Oelckers 2016-11-19 01:23:56 +01:00
commit 3ce699bf9b
20 changed files with 205 additions and 126 deletions

View file

@ -87,7 +87,7 @@ begin:
OP(LFP):
ASSERTA(a); assert(sfunc != NULL); assert(sfunc->ExtraSpace > 0);
reg.a[a] = f->GetExtra();
reg.atag[a] = ATAG_FRAMEPOINTER;
reg.atag[a] = ATAG_GENERIC; // using ATAG_FRAMEPOINTER will cause endless asserts.
NEXTOP;
OP(LB):
@ -461,7 +461,7 @@ begin:
break;
case REGT_INT | REGT_ADDROF:
assert(C < f->NumRegD);
::new(param) VMValue(&reg.d[C], ATAG_DREGISTER);
::new(param) VMValue(&reg.d[C], ATAG_GENERIC);
break;
case REGT_INT | REGT_KONST:
assert(C < sfunc->NumKonstD);
@ -473,7 +473,7 @@ begin:
break;
case REGT_STRING | REGT_ADDROF:
assert(C < f->NumRegS);
::new(param) VMValue(&reg.s[C], ATAG_SREGISTER);
::new(param) VMValue(&reg.s[C], ATAG_GENERIC);
break;
case REGT_STRING | REGT_KONST:
assert(C < sfunc->NumKonstS);
@ -485,7 +485,7 @@ begin:
break;
case REGT_POINTER | REGT_ADDROF:
assert(C < f->NumRegA);
::new(param) VMValue(&reg.a[C], ATAG_AREGISTER);
::new(param) VMValue(&reg.a[C], ATAG_GENERIC);
break;
case REGT_POINTER | REGT_KONST:
assert(C < sfunc->NumKonstA);
@ -512,7 +512,7 @@ begin:
break;
case REGT_FLOAT | REGT_ADDROF:
assert(C < f->NumRegF);
::new(param) VMValue(&reg.f[C], ATAG_FREGISTER);
::new(param) VMValue(&reg.f[C], ATAG_GENERIC);
break;
case REGT_FLOAT | REGT_KONST:
assert(C < sfunc->NumKonstF);