mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-06-01 09:21:58 +00:00
Get rid of Sys_FPU_StackIsEmpty()
Same as with Sys_FPU_GetState().
This commit is contained in:
parent
0ccef1eba8
commit
b58f51dbfa
11 changed files with 0 additions and 74 deletions
|
@ -205,7 +205,6 @@ void idSysLocal::DebugVPrintf( const char *fmt, va_list arg ) {}
|
||||||
double idSysLocal::GetClockTicks( void ) { return 0.0; }
|
double idSysLocal::GetClockTicks( void ) { return 0.0; }
|
||||||
double idSysLocal::ClockTicksPerSecond( void ) { return 1.0; }
|
double idSysLocal::ClockTicksPerSecond( void ) { return 1.0; }
|
||||||
int idSysLocal::GetProcessorId( void ) { return 0; }
|
int idSysLocal::GetProcessorId( void ) { return 0; }
|
||||||
bool idSysLocal::FPU_StackIsEmpty( void ) { return true; }
|
|
||||||
void idSysLocal::FPU_SetFTZ( bool enable ) {}
|
void idSysLocal::FPU_SetFTZ( bool enable ) {}
|
||||||
void idSysLocal::FPU_SetDAZ( bool enable ) {}
|
void idSysLocal::FPU_SetDAZ( bool enable ) {}
|
||||||
|
|
||||||
|
|
|
@ -2656,10 +2656,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const {
|
||||||
float ratio_x;
|
float ratio_x;
|
||||||
float ratio_y;
|
float ratio_y;
|
||||||
|
|
||||||
if ( !sys->FPU_StackIsEmpty() ) {
|
|
||||||
Error( "idGameLocal::CalcFov: FPU stack not empty" );
|
|
||||||
}
|
|
||||||
|
|
||||||
// first, calculate the vertical fov based on a 640x480 view
|
// first, calculate the vertical fov based on a 640x480 view
|
||||||
x = 640.0f / tan( base_fov / 360.0f * idMath::PI );
|
x = 640.0f / tan( base_fov / 360.0f * idMath::PI );
|
||||||
y = atan2( 480.0f, x );
|
y = atan2( 480.0f, x );
|
||||||
|
|
|
@ -561,14 +561,6 @@ void idEvent::ServiceEvents( void ) {
|
||||||
assert( event->object );
|
assert( event->object );
|
||||||
event->object->ProcessEventArgPtr( ev, args );
|
event->object->ProcessEventArgPtr( ev, args );
|
||||||
|
|
||||||
#if 0
|
|
||||||
// event functions may never leave return values on the FPU stack
|
|
||||||
// enable this code to check if any event call left values on the FPU stack
|
|
||||||
if ( !sys->FPU_StackIsEmpty() ) {
|
|
||||||
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, ev->GetName() );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// return the event to the free list
|
// return the event to the free list
|
||||||
event->Free();
|
event->Free();
|
||||||
|
|
||||||
|
@ -661,14 +653,6 @@ void idEvent::ServiceFastEvents() {
|
||||||
assert( event->object );
|
assert( event->object );
|
||||||
event->object->ProcessEventArgPtr( ev, args );
|
event->object->ProcessEventArgPtr( ev, args );
|
||||||
|
|
||||||
#if 0
|
|
||||||
// event functions may never leave return values on the FPU stack
|
|
||||||
// enable this code to check if any event call left values on the FPU stack
|
|
||||||
if ( !sys->FPU_StackIsEmpty() ) {
|
|
||||||
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, event->eventdef->GetName() );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// return the event to the free list
|
// return the event to the free list
|
||||||
event->Free();
|
event->Free();
|
||||||
|
|
||||||
|
|
|
@ -2426,11 +2426,6 @@ void idCommonLocal::Frame( void ) {
|
||||||
|
|
||||||
// set idLib frame number for frame based memory dumps
|
// set idLib frame number for frame based memory dumps
|
||||||
idLib::frameNumber = com_frameNumber;
|
idLib::frameNumber = com_frameNumber;
|
||||||
|
|
||||||
// the FPU stack better be empty at this point or some bad code or compiler bug left values on the stack
|
|
||||||
if ( !Sys_FPU_StackIsEmpty() ) {
|
|
||||||
FatalError( "idCommon::Frame: the FPU stack is not empty at the end of the frame\n" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
catch( idException & ) {
|
catch( idException & ) {
|
||||||
|
|
|
@ -2391,10 +2391,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const {
|
||||||
float ratio_x;
|
float ratio_x;
|
||||||
float ratio_y;
|
float ratio_y;
|
||||||
|
|
||||||
if ( !sys->FPU_StackIsEmpty() ) {
|
|
||||||
Error( "idGameLocal::CalcFov: FPU stack not empty" );
|
|
||||||
}
|
|
||||||
|
|
||||||
// first, calculate the vertical fov based on a 640x480 view
|
// first, calculate the vertical fov based on a 640x480 view
|
||||||
x = 640.0f / tan( base_fov / 360.0f * idMath::PI );
|
x = 640.0f / tan( base_fov / 360.0f * idMath::PI );
|
||||||
y = atan2( 480.0f, x );
|
y = atan2( 480.0f, x );
|
||||||
|
|
|
@ -528,14 +528,6 @@ void idEvent::ServiceEvents( void ) {
|
||||||
assert( event->object );
|
assert( event->object );
|
||||||
event->object->ProcessEventArgPtr( ev, args );
|
event->object->ProcessEventArgPtr( ev, args );
|
||||||
|
|
||||||
#if 0
|
|
||||||
// event functions may never leave return values on the FPU stack
|
|
||||||
// enable this code to check if any event call left values on the FPU stack
|
|
||||||
if ( !sys->FPU_StackIsEmpty() ) {
|
|
||||||
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, ev->GetName() );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// return the event to the free list
|
// return the event to the free list
|
||||||
event->Free();
|
event->Free();
|
||||||
|
|
||||||
|
|
|
@ -315,10 +315,6 @@ void Sys_SetClipboardData( const char *string ) {
|
||||||
Sys_Printf( "TODO: Sys_SetClipboardData\n" );
|
Sys_Printf( "TODO: Sys_SetClipboardData\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sys_FPU_StackIsEmpty( void ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
Sys_LockMemory
|
Sys_LockMemory
|
||||||
|
|
|
@ -61,10 +61,6 @@ int idSysLocal::GetProcessorId( void ) {
|
||||||
return Sys_GetProcessorId();
|
return Sys_GetProcessorId();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool idSysLocal::FPU_StackIsEmpty( void ) {
|
|
||||||
return Sys_FPU_StackIsEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void idSysLocal::FPU_SetFTZ( bool enable ) {
|
void idSysLocal::FPU_SetFTZ( bool enable ) {
|
||||||
Sys_FPU_SetFTZ( enable );
|
Sys_FPU_SetFTZ( enable );
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ public:
|
||||||
|
|
||||||
virtual unsigned int GetMilliseconds( void );
|
virtual unsigned int GetMilliseconds( void );
|
||||||
virtual int GetProcessorId( void );
|
virtual int GetProcessorId( void );
|
||||||
virtual bool FPU_StackIsEmpty( void );
|
|
||||||
virtual void FPU_SetFTZ( bool enable );
|
virtual void FPU_SetFTZ( bool enable );
|
||||||
virtual void FPU_SetDAZ( bool enable );
|
virtual void FPU_SetDAZ( bool enable );
|
||||||
|
|
||||||
|
|
|
@ -133,9 +133,6 @@ unsigned int Sys_Milliseconds( void );
|
||||||
// returns a selection of the CPUID_* flags
|
// returns a selection of the CPUID_* flags
|
||||||
int Sys_GetProcessorId( void );
|
int Sys_GetProcessorId( void );
|
||||||
|
|
||||||
// returns true if the FPU stack is empty
|
|
||||||
bool Sys_FPU_StackIsEmpty( void );
|
|
||||||
|
|
||||||
// sets the FPU precision
|
// sets the FPU precision
|
||||||
void Sys_FPU_SetPrecision();
|
void Sys_FPU_SetPrecision();
|
||||||
|
|
||||||
|
@ -365,7 +362,6 @@ public:
|
||||||
|
|
||||||
virtual unsigned int GetMilliseconds( void ) = 0;
|
virtual unsigned int GetMilliseconds( void ) = 0;
|
||||||
virtual int GetProcessorId( void ) = 0;
|
virtual int GetProcessorId( void ) = 0;
|
||||||
virtual bool FPU_StackIsEmpty( void ) = 0;
|
|
||||||
virtual void FPU_SetFTZ( bool enable ) = 0;
|
virtual void FPU_SetFTZ( bool enable ) = 0;
|
||||||
virtual void FPU_SetDAZ( bool enable ) = 0;
|
virtual void FPU_SetDAZ( bool enable ) = 0;
|
||||||
|
|
||||||
|
|
|
@ -118,26 +118,3 @@ int Sys_FPU_PrintStateFlags( char *ptr, int ctrl, int stat, int tags, int inof,
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
Sys_FPU_StackIsEmpty
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
bool Sys_FPU_StackIsEmpty( void ) {
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
__asm {
|
|
||||||
mov eax, statePtr
|
|
||||||
fnstenv [eax]
|
|
||||||
mov eax, [eax+8]
|
|
||||||
xor eax, 0xFFFFFFFF
|
|
||||||
and eax, 0x0000FFFF
|
|
||||||
jz empty
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
empty:
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue