- Added a RETI instruction for returning 15-bit signed immediate values.

- Changed Actor's Damage property into an actual function. All access to the damage property
  must now be done through GetMissileDamage. actor->GetMissileDamage(0, 1) is equivalent
  to the former actor->Damage, for the case where actor->Damage was not an expression. (I
  suppose I will probably need to make a thunk for DECORATE expressions that want to read it.)
- Cleaned up some decorate expression evaluation functions that are no longer used.

SVN r3919 (scripting)
This commit is contained in:
Randy Heit 2012-10-28 04:36:52 +00:00
commit 6e88529324
23 changed files with 270 additions and 195 deletions

View file

@ -490,6 +490,27 @@ size_t VMFunctionBuilder::EmitLoadInt(int regnum, int value)
}
}
//==========================================================================
//
// VMFunctionBuilder :: EmitRetInt
//
// Returns an integer, using either an immediate value or a constant
// register, as appropriate.
//
//==========================================================================
size_t VMFunctionBuilder::EmitRetInt(int retnum, bool final, int value)
{
if (value >= -16384 && value <= 16383)
{
return Emit(OP_RETI, retnum, value | (final << 15));
}
else
{
return Emit(OP_RETI, retnum, REGT_INT | REGT_KONST | (final ? REGT_FINAL : 0), GetConstantInt(value));
}
}
//==========================================================================
//
// VMFunctionBuilder :: Backpatch