mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 17:49:29 +01:00
Some optimization and minor fixes
This commit is contained in:
1 parent
5a48578a12
commit
423bba5d8d
6 files changed
+22
-29
No files matched your search
@@ -131,7 +131,6 @@ u32 __AudioEnqueue(AudioChannel &chan, int chanNum, bool blocking)
|
||||
// just sleep the main emulator thread a little.
|
||||
void __AudioUpdate()
|
||||
{
|
||||
NOTICE_LOG(HLE, "__AudioUpdate");
|
||||
#ifdef _WIN32
|
||||
// HACK - TODO: Remove
|
||||
bool noThrottle = GetAsyncKeyState(VK_TAB) != 0;
|
||||
|
||||
@@ -731,7 +731,7 @@ void ThreadContext::reset()
|
||||
}
|
||||
vfpuCtrl[VFPU_CTRL_SPREFIX] = 0xe4; // neutral
|
||||
vfpuCtrl[VFPU_CTRL_TPREFIX] = 0xe4; // neutral
|
||||
vfpuCtrl[VFPU_CTRL_DPREFIX] = 0x0;
|
||||
vfpuCtrl[VFPU_CTRL_DPREFIX] = 0x0; // neutral
|
||||
vfpuCtrl[VFPU_CTRL_CC] = 0x3f;
|
||||
vfpuCtrl[VFPU_CTRL_INF4] = 0;
|
||||
vfpuCtrl[VFPU_CTRL_RCX0] = 0x3f800001;
|
||||
|
||||
+15
-19
@@ -65,8 +65,8 @@
|
||||
void ApplyPrefixST(float *v, u32 data, VectorSize size)
|
||||
{
|
||||
// Possible optimization shortcut:
|
||||
// if (data == 0xe4)
|
||||
// return;
|
||||
if (data == 0xe4)
|
||||
return;
|
||||
|
||||
int n = GetNumVectorElements(size);
|
||||
float origV[4];
|
||||
@@ -100,36 +100,38 @@ void ApplyPrefixST(float *v, u32 data, VectorSize size)
|
||||
}
|
||||
}
|
||||
|
||||
void ApplySwizzleS(float *v, VectorSize size)
|
||||
inline void ApplySwizzleS(float *v, VectorSize size)
|
||||
{
|
||||
ApplyPrefixST(v, currentMIPS->vfpuCtrl[VFPU_CTRL_SPREFIX], size);
|
||||
}
|
||||
|
||||
void ApplySwizzleT(float *v, VectorSize size)
|
||||
inline void ApplySwizzleT(float *v, VectorSize size)
|
||||
{
|
||||
ApplyPrefixST(v, currentMIPS->vfpuCtrl[VFPU_CTRL_TPREFIX], size);
|
||||
}
|
||||
|
||||
void ApplyPrefixD(float *v, VectorSize size, bool onlyWriteMask = false)
|
||||
{
|
||||
u32 data = currentMIPS->vfpuCtrl[VFPU_CTRL_DPREFIX];
|
||||
if (!data)
|
||||
return;
|
||||
int n = GetNumVectorElements(size);
|
||||
bool writeMask[4];
|
||||
u32 data = currentMIPS->vfpuCtrl[VFPU_CTRL_DPREFIX];
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
int mask = (data >> (8+i)) & 1;
|
||||
int mask = (data >> (8 + i)) & 1;
|
||||
writeMask[i] = mask ? true : false;
|
||||
if (!onlyWriteMask) {
|
||||
int sat = (data >> i*2) & 3;
|
||||
int sat = (data >> (i * 2)) & 3;
|
||||
if (sat == 1)
|
||||
{
|
||||
if (v[i] > 1.0f) v[i]=1.0f;
|
||||
if (v[i] < 0.0f) v[i]=0.0f;
|
||||
if (v[i] > 1.0f) v[i] = 1.0f;
|
||||
if (v[i] < 0.0f) v[i] = 0.0f;
|
||||
}
|
||||
else if (sat == 3)
|
||||
{
|
||||
if (v[i] > 1.0f) v[i]=1.0f;
|
||||
if (v[i] < -1.0f) v[i]=-1.0f;
|
||||
if (v[i] > 1.0f) v[i] = 1.0f;
|
||||
if (v[i] < -1.0f) v[i] = -1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,8 +140,8 @@ void ApplyPrefixD(float *v, VectorSize size, bool onlyWriteMask = false)
|
||||
|
||||
void EatPrefixes()
|
||||
{
|
||||
currentMIPS->vfpuCtrl[VFPU_CTRL_SPREFIX] = 0xe4; //passthru
|
||||
currentMIPS->vfpuCtrl[VFPU_CTRL_TPREFIX] = 0xe4; //passthru
|
||||
currentMIPS->vfpuCtrl[VFPU_CTRL_SPREFIX] = 0xe4; // passthru
|
||||
currentMIPS->vfpuCtrl[VFPU_CTRL_TPREFIX] = 0xe4; // passthru
|
||||
currentMIPS->vfpuCtrl[VFPU_CTRL_DPREFIX] = 0;
|
||||
static const bool noWriteMask[4] = {false, false, false, false};
|
||||
currentMIPS->SetWriteMask(noWriteMask);
|
||||
@@ -147,12 +149,6 @@ void EatPrefixes()
|
||||
|
||||
namespace MIPSInt
|
||||
{
|
||||
#define S_not(a,b,c) (a<<2) | (b) | (c << 5)
|
||||
#define SgetA(v) (((v)>>2)&0x7)
|
||||
#define SgetB(v) ((v)&3)
|
||||
#define SgetC(v) (((v)>>5)&0x3)
|
||||
#define VS(m,row,col) V(m*4+(row)+(col)*32)
|
||||
|
||||
void Int_VPFX(u32 op)
|
||||
{
|
||||
int data = op & 0xFFFFF;
|
||||
|
||||
@@ -196,8 +196,8 @@ void Lighter::Light(float colorOut0[4], float colorOut1[4], const float colorIn[
|
||||
|
||||
// 4?
|
||||
for (int i = 0; i < 4; i++) {
|
||||
colorOut0[i] = lightSum0[i];
|
||||
colorOut1[i] = lightSum1[i];
|
||||
colorOut0[i] = lightSum0[i] > 1.0f ? 1.0f : lightSum0[i];
|
||||
colorOut1[i] = lightSum1[i] > 1.0f ? 1.0f : lightSum1[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace MainWindow
|
||||
rc.left=20;
|
||||
rc.top=100;
|
||||
|
||||
int zoom = 1;
|
||||
int zoom = 4;
|
||||
|
||||
rc.right=480*zoom+rc.left;//+client edge
|
||||
rc.bottom=272*zoom+rc.top; //+client edge
|
||||
|
||||
+3
-5
@@ -7,8 +7,7 @@
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
#include "afxres.h"␍
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
@@ -370,7 +369,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "Comments", "PPSSPP PSP emulator"
|
||||
VALUE "CompanyName", "Henrik Rydgård Inc."
|
||||
VALUE "FileDescription", "PPSPP PSP emulator"
|
||||
VALUE "FileDescription", "PPSSPP"
|
||||
VALUE "FileVersion", "1, 0, 0, 0"
|
||||
VALUE "InternalName", "s"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2006-2012 by Henrik Rydgård"
|
||||
@@ -415,8 +414,7 @@ END
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
␍
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
Reference in new issue
Block a user