mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +00:00
- The fixed_t type for the VM also is not needed any longer and was removed.
This commit is contained in:
parent
8cdfbeea01
commit
2b33601d00
7 changed files with 1 additions and 112 deletions
|
@ -79,7 +79,6 @@ PName *TypeName;
|
|||
PSound *TypeSound;
|
||||
PColor *TypeColor;
|
||||
PStatePointer *TypeState;
|
||||
PFixed *TypeFixed;
|
||||
|
||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
|
@ -505,7 +504,6 @@ void PType::StaticInit()
|
|||
RUNTIME_CLASS(PPrototype)->TypeTableType = RUNTIME_CLASS(PPrototype);
|
||||
RUNTIME_CLASS(PClass)->TypeTableType = RUNTIME_CLASS(PClass);
|
||||
RUNTIME_CLASS(PStatePointer)->TypeTableType = RUNTIME_CLASS(PStatePointer);
|
||||
RUNTIME_CLASS(PFixed)->TypeTableType = RUNTIME_CLASS(PFixed);
|
||||
|
||||
// Create types and add them type the type table.
|
||||
TypeTable.AddType(TypeError = new PErrorType);
|
||||
|
@ -524,7 +522,6 @@ void PType::StaticInit()
|
|||
TypeTable.AddType(TypeSound = new PSound);
|
||||
TypeTable.AddType(TypeColor = new PColor);
|
||||
TypeTable.AddType(TypeState = new PStatePointer);
|
||||
TypeTable.AddType(TypeFixed = new PFixed);
|
||||
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_sByte, TypeSInt8));
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Byte, TypeUInt8));
|
||||
|
@ -542,7 +539,6 @@ void PType::StaticInit()
|
|||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Sound, TypeSound));
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Color, TypeColor));
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_State, TypeState));
|
||||
GlobalSymbols.AddSymbol(new PSymbolType(NAME_Fixed, TypeFixed));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1081,67 +1077,6 @@ PColor::PColor()
|
|||
assert(sizeof(PalEntry) == __alignof(PalEntry));
|
||||
}
|
||||
|
||||
/* PFixed *****************************************************************/
|
||||
|
||||
IMPLEMENT_CLASS(PFixed)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PFixed Default Constructor
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
PFixed::PFixed()
|
||||
: PFloat(sizeof(fixed_t))
|
||||
{
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PFixed :: SetValue
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void PFixed::SetValue(void *addr, int val)
|
||||
{
|
||||
assert(((intptr_t)addr & (Align - 1)) == 0 && "unaligned address");
|
||||
*(fixed_t *)addr = val << FRACBITS;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PFixed :: GetValueInt
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int PFixed::GetValueInt(void *addr) const
|
||||
{
|
||||
assert(((intptr_t)addr & (Align - 1)) == 0 && "unaligned address");
|
||||
return *(fixed_t *)addr >> FRACBITS;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PFixed :: GetStoreOp
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int PFixed::GetStoreOp() const
|
||||
{
|
||||
return OP_SX;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// PFixed :: GetLoadOp
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int PFixed::GetLoadOp() const
|
||||
{
|
||||
return OP_LX;
|
||||
}
|
||||
|
||||
/* PStatePointer **********************************************************/
|
||||
|
||||
IMPLEMENT_CLASS(PStatePointer)
|
||||
|
|
|
@ -400,21 +400,6 @@ public:
|
|||
PColor();
|
||||
};
|
||||
|
||||
// Variations of floating point types ---------------------------------------
|
||||
// These get converted to floats when they're loaded from memory.
|
||||
|
||||
class PFixed : public PFloat
|
||||
{
|
||||
DECLARE_CLASS(PFixed, PFloat);
|
||||
public:
|
||||
PFixed();
|
||||
|
||||
virtual void SetValue(void *addr, int val);
|
||||
virtual int GetValueInt(void *addr) const;
|
||||
virtual int GetStoreOp() const;
|
||||
virtual int GetLoadOp() const;
|
||||
};
|
||||
|
||||
// Pointers -----------------------------------------------------------------
|
||||
|
||||
class PStatePointer : public PBasicType
|
||||
|
@ -771,7 +756,6 @@ extern PName *TypeName;
|
|||
extern PSound *TypeSound;
|
||||
extern PColor *TypeColor;
|
||||
extern PStatePointer *TypeState;
|
||||
extern PFixed *TypeFixed;
|
||||
|
||||
// A constant value ---------------------------------------------------------
|
||||
|
||||
|
|
|
@ -192,7 +192,6 @@ std2:
|
|||
|
||||
/* other DECORATE top level keywords */
|
||||
'#include' { RET(TK_Include); }
|
||||
'fixed_t' { RET(TK_Fixed_t); }
|
||||
|
||||
L (L|D)* { RET(TK_Identifier); }
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ xx(TK_Global, "'global'")
|
|||
xx(TK_Self, "'self'")
|
||||
xx(TK_Stop, "'stop'")
|
||||
xx(TK_Include, "'include'")
|
||||
xx(TK_Fixed_t, "'fixed_t'")
|
||||
|
||||
xx(TK_Is, "'is'")
|
||||
xx(TK_Replaces, "'replaces'")
|
||||
|
|
|
@ -486,10 +486,6 @@ static void ParseNativeFunction(FScanner &sc, PClassActor *cls)
|
|||
rets.Push(TypeFloat64);
|
||||
break;
|
||||
|
||||
case TK_Fixed_t:
|
||||
rets.Push(TypeFixed);
|
||||
break;
|
||||
|
||||
case TK_State:
|
||||
rets.Push(TypeState);
|
||||
break;
|
||||
|
|
|
@ -210,16 +210,6 @@ begin:
|
|||
reg.f[a+2] = v[2];
|
||||
}
|
||||
NEXTOP;
|
||||
OP(LX):
|
||||
ASSERTF(a); ASSERTA(B); ASSERTKD(C);
|
||||
GETADDR(PB,KC,X_READ_NIL);
|
||||
reg.f[a] = *(VM_SWORD *)ptr / 65536.0;
|
||||
NEXTOP;
|
||||
OP(LX_R):
|
||||
ASSERTF(a); ASSERTA(B); ASSERTD(C);
|
||||
GETADDR(PB,RC,X_READ_NIL);
|
||||
reg.f[a] = *(VM_SWORD *)ptr / 65536.0;
|
||||
NEXTOP;
|
||||
OP(LBIT):
|
||||
ASSERTD(a); ASSERTA(B);
|
||||
GETADDR(PB,0,X_READ_NIL);
|
||||
|
@ -316,16 +306,6 @@ begin:
|
|||
v[2] = (float)reg.f[B+2];
|
||||
}
|
||||
NEXTOP;
|
||||
OP(SX):
|
||||
ASSERTA(a); ASSERTF(B); ASSERTKD(C);
|
||||
GETADDR(PA,KC,X_WRITE_NIL);
|
||||
*(VM_SWORD *)ptr = (VM_SWORD)(reg.f[B] * 65536.0);
|
||||
NEXTOP;
|
||||
OP(SX_R):
|
||||
ASSERTA(a); ASSERTF(B); ASSERTD(C);
|
||||
GETADDR(PA,RC,X_WRITE_NIL);
|
||||
*(VM_SWORD *)ptr = (VM_SWORD)(reg.f[B] * 65536.0);
|
||||
NEXTOP;
|
||||
OP(SBIT):
|
||||
ASSERTA(a); ASSERTD(B);
|
||||
GETADDR(PA,0,X_WRITE_NIL);
|
||||
|
|
|
@ -35,8 +35,6 @@ xx(LP, lp, RPRPKI), // load pointer
|
|||
xx(LP_R, lp, RPRPRI),
|
||||
xx(LV, lv, RVRPKI), // load vector
|
||||
xx(LV_R, lv, RVRPRI),
|
||||
xx(LX, lx, RFRPKI), // load fixed point
|
||||
xx(LX_R, lx, RFRPRI),
|
||||
|
||||
xx(LBIT, lbit, RIRPI8), // rA = !!(*rB & C) -- *rB is a byte
|
||||
|
||||
|
@ -57,8 +55,6 @@ xx(SP, sp, RPRPKI), // store pointer
|
|||
xx(SP_R, sp, RPRPRI),
|
||||
xx(SV, sv, RPRVKI), // store vector
|
||||
xx(SV_R, sv, RPRVRI),
|
||||
xx(SX, sx, RPRFKI), // store fixed point
|
||||
xx(SX_R, sx, RPRFRI),
|
||||
|
||||
xx(SBIT, sbit, RPRII8), // *rA |= C if rB is true, *rA &= ~C otherwise
|
||||
|
||||
|
|
Loading…
Reference in a new issue