VFPU fixes, misc

This commit is contained in:
Henrik Rydgard 2012-11-15 10:15:40 +01:00
parent 790451905b
commit 90654bcd0e
7 changed files with 50 additions and 46 deletions

View file

@ -85,6 +85,7 @@ const HLEFunction UtilsForUser[] =
{0xB435DEC5, sceKernelDcacheWritebackInvalidateAll, "sceKernelDcacheWritebackInvalidateAll"}, {0xB435DEC5, sceKernelDcacheWritebackInvalidateAll, "sceKernelDcacheWritebackInvalidateAll"},
{0x3EE30821, sceKernelDcacheWritebackRange, "sceKernelDcacheWritebackRange"}, {0x3EE30821, sceKernelDcacheWritebackRange, "sceKernelDcacheWritebackRange"},
{0x34B9FA9E, sceKernelDcacheWritebackInvalidateRange, "sceKernelDcacheWritebackInvalidateRange"}, {0x34B9FA9E, sceKernelDcacheWritebackInvalidateRange, "sceKernelDcacheWritebackInvalidateRange"},
{0xC2DF770E, 0, "sceKernelIcacheInvalidateRange"},
{0x80001C4C, 0, "sceKernelDcacheProbe"}, {0x80001C4C, 0, "sceKernelDcacheProbe"},
{0x16641D70, 0, "sceKernelDcacheReadTag"}, {0x16641D70, 0, "sceKernelDcacheReadTag"},
{0x4FD31C9D, 0, "sceKernelIcacheProbe"}, {0x4FD31C9D, 0, "sceKernelIcacheProbe"},

View file

@ -344,7 +344,6 @@ const HLEFunction ThreadManForUser[] =
{0x6b30100f,&WrapU_UU<sceKernelUnlockMutex>,"sceKernelUnlockMutex"}, {0x6b30100f,&WrapU_UU<sceKernelUnlockMutex>,"sceKernelUnlockMutex"},
{0xb7d098c6,&WrapU_CUU<sceKernelCreateMutex>,"sceKernelCreateMutex"}, {0xb7d098c6,&WrapU_CUU<sceKernelCreateMutex>,"sceKernelCreateMutex"},
{0x0DDCD2C9, 0, "sceKernelTryLockMutex"}, {0x0DDCD2C9, 0, "sceKernelTryLockMutex"},
// NOTE: LockLwMutex and UnlockLwMutex are in Kernel_Library, see sceKernelInterrupt.cpp. // NOTE: LockLwMutex and UnlockLwMutex are in Kernel_Library, see sceKernelInterrupt.cpp.
{0xFCCFAD26,sceKernelCancelWakeupThread,"sceKernelCancelWakeupThread"}, {0xFCCFAD26,sceKernelCancelWakeupThread,"sceKernelCancelWakeupThread"},

View file

@ -427,6 +427,7 @@ const HLEFunction Kernel_Library[] =
{0xb55249d2,sceKernelIsCpuIntrEnable, "sceKernelIsCpuIntrEnable"}, {0xb55249d2,sceKernelIsCpuIntrEnable, "sceKernelIsCpuIntrEnable"},
{0xa089eca4,sceKernelMemset, "sceKernelMemset"}, {0xa089eca4,sceKernelMemset, "sceKernelMemset"},
{0xDC692EE3,0, "sceKernelTryLockLwMutex"}, {0xDC692EE3,0, "sceKernelTryLockLwMutex"},
{0x37431849,0, "sceKernelTryLockLwMutex_600"},
{0xbea46419,0, "sceKernelLockLwMutex"}, {0xbea46419,0, "sceKernelLockLwMutex"},
{0x1FC64E09,0, "sceKernelLockLwMutexCB"}, {0x1FC64E09,0, "sceKernelLockLwMutexCB"},
{0x15b6446b,0, "sceKernelUnlockLwMutex"}, {0x15b6446b,0, "sceKernelUnlockLwMutex"},

View file

@ -567,6 +567,7 @@ const HLEFunction sceUtility[] =
{0x32E32DCB, 0, "sceUtilityGamedataInstallShutdownStart"}, {0x32E32DCB, 0, "sceUtilityGamedataInstallShutdownStart"},
{0x4AECD179, 0, "sceUtilityGamedataInstallUpdate"}, {0x4AECD179, 0, "sceUtilityGamedataInstallUpdate"},
{0xB57E95D9, 0, "sceUtilityGamedataInstallGetStatus"}, {0xB57E95D9, 0, "sceUtilityGamedataInstallGetStatus"},
{0x180F7B62, 0, "sceUtilityGamedataInstallAbortFunction"},
}; };
void Register_sceUtility() void Register_sceUtility()

View file

@ -498,7 +498,7 @@ namespace MIPSInt
ApplySwizzleS(s, sz); ApplySwizzleS(s, sz);
for (int i = 0; i < GetNumVectorElements(sz); i++) for (int i = 0; i < GetNumVectorElements(sz); i++)
{ {
d[i] = 1.0f - s[i]; //vocp d[i] = 1.0f - s[i];
} }
ApplyPrefixD(d, sz); ApplyPrefixD(d, sz);
WriteVector(d, sz, vd); WriteVector(d, sz, vd);
@ -516,12 +516,15 @@ namespace MIPSInt
ApplySwizzleS(s, sz); ApplySwizzleS(s, sz);
for (int i = 0; i < GetNumVectorElements(sz); i++) for (int i = 0; i < GetNumVectorElements(sz); i++)
{ {
if (s[i] > 0.0f) // To handle NaNs correctly, we do this with integer hackery
d[i] = 1.0f; u32 val;
else if (s[i] < 0.0f) memcpy(&val, &s[i], sizeof(u32));
d[i] = -1.0f; if (val == 0 || val == 0x80000000)
else
d[i] = 0.0f; d[i] = 0.0f;
else if ((val >> 31) == 0)
d[i] = 1.0f;
else
d[i] = -1.0f;
} }
ApplyPrefixD(d, sz); ApplyPrefixD(d, sz);
WriteVector(d, sz, vd); WriteVector(d, sz, vd);
@ -581,7 +584,6 @@ namespace MIPSInt
void Int_Vh2f(u32 op) void Int_Vh2f(u32 op)
{ {
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
/* /*
int s[4]; int s[4];
float d[4]; float d[4];
@ -607,6 +609,7 @@ namespace MIPSInt
void Int_Vf2h(u32 op) void Int_Vf2h(u32 op)
{ {
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
// See http://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion
/* /*
int s[4]; int s[4];
@ -630,11 +633,6 @@ namespace MIPSInt
EatPrefixes(); EatPrefixes();
} }
u32 replicate3(u32 low) {
low &= 0xFF;
return low | (low << 8) | (low << 16);
}
void Int_Vx2i(u32 op) void Int_Vx2i(u32 op)
{ {
int s[4]; int s[4];

View file

@ -65,6 +65,10 @@ bool Load_PSP_ISO(const char *filename, std::string *error_string)
pspFileSystem.Mount("DISC0:", umd2); pspFileSystem.Mount("DISC0:", umd2);
std::string bootpath("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN"); std::string bootpath("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN");
// bypass patchers
if (pspFileSystem.GetFileInfo("disc0:/PSP_GAME/SYSDIR/EBOOT.OLD").exists) {
bootpath = "disc0:/PSP_GAME/SYSDIR/EBOOT.OLD";
}
bool hasEncrypted = false; bool hasEncrypted = false;
u32 fd; u32 fd;
if ((fd = pspFileSystem.OpenFile(bootpath, FILEACCESS_READ)) != 0) if ((fd = pspFileSystem.OpenFile(bootpath, FILEACCESS_READ)) != 0)

@ -1 +1 @@
Subproject commit 871e721dece5acd3c631e0a30226b6482a00362d Subproject commit cb8c23e1748d9e98ebb21797d8449d8711f04439