Logging, stubs and fixes

This commit is contained in:
Henrik Rydgard 2012-11-06 20:56:19 +01:00
parent d769297d06
commit 83fb5e96de
10 changed files with 94 additions and 25 deletions

View File

@ -126,7 +126,7 @@ void sceGeContinue()
u32 sceGeSetCallback(u32 structAddr)
{
ERROR_LOG(HLE,"HALFIMPL sceGeSetCallback(struct=%08x)", structAddr);
DEBUG_LOG(HLE,"sceGeSetCallback(struct=%08x)", structAddr);
PspGeCallbackData ge_callback_data;
Memory::ReadStruct(structAddr, &ge_callback_data);

View File

@ -516,7 +516,7 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void
switch (cmd)
{
// does one of these set a callback as well? (see coded arms)
case 0x02025804: // Register callback
case 0x02015804: // Register callback
if (Memory::IsValidAddress(argAddr) && argLen == 4) {
u32 cbId = Memory::Read_U32(argAddr);
if (0 == __KernelRegisterCallback(THREAD_CALLBACK_MEMORYSTICK, cbId)) {

View File

@ -354,7 +354,7 @@ u32 sceKernelReleaseSubIntrHandler(u32 intrNumber, u32 subIntrNumber)
u32 sceKernelEnableSubIntr(u32 intrNumber, u32 subIntrNumber)
{
ERROR_LOG(HLE,"sceKernelEnableSubIntr(%i, %i)", intrNumber, subIntrNumber);
DEBUG_LOG(HLE,"sceKernelEnableSubIntr(%i, %i)", intrNumber, subIntrNumber);
if (intrNumber < 0 || intrNumber >= PSP_NUMBER_INTERRUPTS)
return -1;
@ -367,7 +367,7 @@ u32 sceKernelEnableSubIntr(u32 intrNumber, u32 subIntrNumber)
u32 sceKernelDisableSubIntr(u32 intrNumber, u32 subIntrNumber)
{
ERROR_LOG(HLE,"sceKernelDisableSubIntr(%i, %i)", intrNumber, subIntrNumber);
DEBUG_LOG(HLE,"sceKernelDisableSubIntr(%i, %i)", intrNumber, subIntrNumber);
if (intrNumber < 0 || intrNumber >= PSP_NUMBER_INTERRUPTS)
return -1;
@ -379,8 +379,6 @@ u32 sceKernelDisableSubIntr(u32 intrNumber, u32 subIntrNumber)
}
struct PspIntrHandlerOptionParam {
int size; //+00
u32 entry; //+04
@ -427,7 +425,7 @@ const HLEFunction Kernel_Library[] =
{0xDC692EE3,0, "sceKernelTryLockLwMutex"},
{0xbea46419,0, "sceKernelLockLwMutex"},
{0x15b6446b,0, "sceKernelUnlockLwMutex"},
{0x293b45b8,0, "sceKernelGetThreadId"},
{0x293b45b8,sceKernelGetThreadId, "sceKernelGetThreadId"},
{0x1839852A,0,"sce_paf_private_memcpy"},
{0xA089ECA4,0,"sce_paf_private_memset"},
};

View File

@ -97,7 +97,7 @@ void sceKernelReceiveMbx()
u32 timeoutPtr = PARAM(2);
ERROR_LOG(HLE, "UNIMPL sceKernelReceiveMbx(%i, %08x, %08x)", uid, packetAddrPtr, timeoutPtr);
RETURN(0);
RETURN(SCE_KERNEL_ERROR_MBOX_NOMSG);
}
void sceKernelReceiveMbxCB()
@ -108,7 +108,7 @@ void sceKernelReceiveMbxCB()
__KernelCheckCallbacks();
ERROR_LOG(HLE, "UNIMPL sceKernelReceiveMbxCB(%i, %08x, %08x)", uid, packetAddrPtr, timeoutPtr);
RETURN(0);
RETURN(SCE_KERNEL_ERROR_MBOX_NOMSG);
}
void sceKernelPollMbx()
@ -117,7 +117,7 @@ void sceKernelPollMbx()
u32 packetAddrPtr = PARAM(1);
ERROR_LOG(HLE, "UNIMPL sceKernelPollMbx(%i, %08x)", uid, packetAddrPtr);
RETURN(0);
RETURN(SCE_KERNEL_ERROR_MBOX_NOMSG);
}
void sceKernelCancelReceiveMbx()

View File

@ -133,3 +133,45 @@ u32 sceKernelUnlockMutex(u32 id, u32 count)
// TODO....
return 0;
}
struct NativeLwMutex
{
SceSize size;
char name[32];
SceUInt attr;
SceUID mutexUid;
SceUInt opaqueWorkAreaAddr;
int numWaitThreads;
int locked;
int threadid; // thread holding the lock
};
void sceKernelCreateLwMutex()
{
DEBUG_LOG(HLE,"UNIMPL sceKernelCreateLwMutex()");
RETURN(0);
}
void sceKernelDeleteLwMutex()
{
DEBUG_LOG(HLE,"UNIMPL sceKernelDeleteLwMutex()");
RETURN(0);
}
void sceKernelTryLockLwMutex()
{
DEBUG_LOG(HLE,"UNIMPL sceKernelTryLockLwMutex()");
RETURN(0);
}
void sceKernelLockLwMutex()
{
DEBUG_LOG(HLE,"UNIMPL sceKernelLockLwMutex()");
RETURN(0);
}
void sceKernelUnlockLwMutex()
{
DEBUG_LOG(HLE,"UNIMPL void sceKernelUnlockLwMutex()");
RETURN(0);
}

View File

@ -24,7 +24,8 @@ u32 sceKernelLockMutex(u32 id, u32 count, u32 timeoutPtr);
u32 sceKernelLockMutexCB(u32 id, u32 count, u32 timeoutPtr);
u32 sceKernelUnlockMutex(u32 id, u32 count);
/*
void sceKernelCreateLwMutex();
void sceKernelDeleteLwMutex();
*/
void sceKernelTryLockLwMutex();
void sceKernelLockLwMutex();
void sceKernelUnlockLwMutex();

View File

@ -30,7 +30,6 @@
// TODO : improve, look in the file more
EmuFileType Identify_File(const char *filename)
{
//then: easy bulletproof IDs.
FILE *f = fopen(filename, "rb");
if (!f)
@ -60,15 +59,15 @@ EmuFileType Identify_File(const char *filename)
{
return FILETYPE_PSP_PBP;
}
else if (strstr(filename,".iso"))
else if (strstr(filename,".iso") || strstr(filename,".ISO"))
{
return FILETYPE_PSP_ISO;
}
else if (strstr(filename,".cso"))
else if (strstr(filename,".cso") || strstr(filename,".CSO"))
{
return FILETYPE_PSP_ISO;
}
else if (strstr(filename,".bin"))
else if (strstr(filename,".bin") || strstr(filename,".BIN"))
{
return FILETYPE_UNKNOWN_BIN;
}

View File

@ -562,6 +562,34 @@ namespace MIPSInt
PC += 4;
EatPrefixes();
}
// TODO: CHECK
void Int_Vh2f2h(u32 op)
{
_dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted");
/*
int s[4];
float d[4];
int vd = _VD;
int vs = _VS;
int imm = (op >> 16) & 0x1f;
float mult = 1.0f/(float)(1 << imm);
VectorSize sz = GetVecSize(op);
ReadVector((float*)&s, sz, vs);
ApplySwizzleS((float*)&s, sz); //TODO: and the mask to kill everything but swizzle
for (int i = 0; i < GetNumVectorElements(sz); i++)
{
d[i] = (float)s[i] * mult;
}
ApplyPrefixD(d, sz); //TODO: and the mask to kill everything but mask
WriteVector(d, sz, vd);
*/
PC += 4;
EatPrefixes();
}
void Int_Vi2x(u32 op)
{
int s[4];

View File

@ -34,14 +34,14 @@ namespace MIPSInt
void Int_VMatrixInit(u32 op);
void Int_VVectorInit(u32 op);
void Int_Vmmul(u32 op);
void Int_Vmscl(u32 op);
void Int_Vmscl(u32 op);
void Int_Vmmov(u32 op);
void Int_VV2Op(u32 op);
void Int_Vrot(u32 op);
void Int_VDot(u32 op);
void Int_Vavg(u32 op);
void Int_Vfad(u32 op);
void Int_Vocp(u32 op);
void Int_Vavg(u32 op);
void Int_Vfad(u32 op);
void Int_Vocp(u32 op);
void Int_Vsgn(u32 op);
void Int_Vtfm(u32 op);
void Int_Viim(u32 op);
@ -58,8 +58,9 @@ namespace MIPSInt
void Int_Vi2f(u32 op);
void Int_Vi2x(u32 op);
void Int_VBranch(u32 op);
void Int_Vrnds(u32 op);
void Int_VrndX(u32 op);
void Int_ColorConv(u32 op);
void Int_Vrnds(u32 op);
void Int_VrndX(u32 op);
void Int_ColorConv(u32 op);
void Int_Vh2f2h(u32 op);
}

View File

@ -558,8 +558,8 @@ MIPSInstruction tableVFPU7[32] =
//16
{-2},
{-2},
INSTR("vf2h", &Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU),
INSTR("vh2f", &Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU),
INSTR("vf2h", &Jit::Comp_Generic, Dis_Generic, Int_Vh2f2h, IS_VFPU),
INSTR("vh2f", &Jit::Comp_Generic, Dis_Generic, Int_Vh2f2h, IS_VFPU),
{-2},
{-2},