More fixes and logging improvements

This commit is contained in:
Henrik Rydgard 2012-11-06 18:56:56 +01:00
parent 7894c6a1c5
commit aca35fc96c
7 changed files with 25 additions and 9 deletions

View File

@ -273,7 +273,7 @@ u32 ISOFileSystem::OpenFile(std::string filename, FileAccess access)
{
u32 sectorStart = 0xFFFFFFFF, readSize = 0xFFFFFFFF;
parseLBN(filename, &sectorStart, &readSize);
INFO_LOG(FILESYS, "Got a raw sector read %s, sector %08x, size %08x", filename.c_str(), sectorStart, readSize);
INFO_LOG(FILESYS, "Got a raw sector open: %s, sector %08x, size %08x", filename.c_str(), sectorStart, readSize);
u32 newHandle = hAlloc->GetNewHandle();
entry.seekPos = 0;
entry.file = 0;

View File

@ -256,11 +256,11 @@ void sceIoGetstat()
{
const char *filename = Memory::GetCharPointer(PARAM(0));
u32 addr = PARAM(1);
DEBUG_LOG(HLE,"sceIoGetstat(%s, %08x)",filename,addr);
SceIoStat *stat = (SceIoStat*)Memory::GetPointer(addr);
PSPFileInfo info = pspFileSystem.GetFileInfo(filename);
__IoGetStat(stat, info);
DEBUG_LOG(HLE,"sceIoGetstat(%s, %08x) : sector = %08x",filename,addr,info.startSector);
RETURN(0);
}

View File

@ -825,8 +825,11 @@ u32 sceKernelStartThread()
//now copy argument to stack
for (int i = 0; i < (int)argSize; i++)
Memory::Write_U8(Memory::Read_U8(argBlockPtr + i), sp + i);
Memory::Write_U8(argBlockPtr ? Memory::Read_U8(argBlockPtr + i) : 0, sp + i);
if (!argBlockPtr && argSize > 0) {
WARN_LOG(HLE,"sceKernelStartThread : had NULL arg");
}
return 0;
}
else

View File

@ -83,10 +83,9 @@ void sceUmdActivate()
{
u32 unknown = PARAM(0);
const char *name = Memory::GetCharPointer(PARAM(1));
u32 retVal = 1;
u32 retVal = 0;
__KernelUmdActivate();
DEBUG_LOG(HLE,"%i=sceUmdActivate(%08x, %s)", retVal, unknown, name);
//__KernelUMDActivate();
RETURN(retVal);
}

View File

@ -379,9 +379,15 @@ void sceUtilityGetSystemParamInt()
RETURN(0);
}
u32 sceUtilityLoadNetModule(u32 module)
{
DEBUG_LOG(HLE,"FAKE: sceUtilityLoadNetModule(%i)", module);
return 0;
}
const HLEFunction sceUtility[] =
{
{0x1579a159, 0, "sceUtilityLoadNetModule"},
{0x1579a159, &WrapU_U<sceUtilityLoadNetModule>, "sceUtilityLoadNetModule"},
{0xf88155f6, 0, "sceUtilityNetconfShutdownStart"},
{0x4db1e739, 0, "sceUtilityNetconfInitStart"},
{0x91e70e35, 0, "sceUtilityNetconfUpdate"},

View File

@ -126,7 +126,7 @@ void MIPSState::RunLoopUntil(u64 globalTicks)
#ifdef _DEBUG
while (CoreTiming::downcount >= 0 && coreState == CORE_RUNNING)
#else
while (CoreTiming::downcount >= 0)
while (CoreTiming::downcount >= 0 && mipsr4k.pc)
#endif
{
// int cycles = 0;

View File

@ -302,22 +302,30 @@ namespace MIPSInt
}
void Int_RType3(u32 op)
{
int rt = _RT;
int rs = _RS;
int rd = _RD;
static bool has_warned = false;
switch (op & 63)
{
case 10: if (R(rt) == 0) R(rd) = R(rs); break; //movz
case 11: if (R(rt) != 0) R(rd) = R(rs); break; //movn
case 32:
if (!has_warned) {
ERROR_LOG(HLE,"WARNING : exception-causing add at %08x", PC);
has_warned = true;
}
R(rd) = R(rs) + R(rt); break; //add
case 33: R(rd) = R(rs) + R(rt); break; //addu
case 34:
if (!has_warned) {
ERROR_LOG(HLE,"WARNING : exception-causing sub at %08x", PC);
has_warned = true;
}
R(rd) = R(rs) - R(rt); break; //sub
case 35: R(rd) = R(rs) - R(rt); break; //subu
case 36: R(rd) = R(rs) & R(rt); break; //and