Another memstick ioctl, minor fixes

This commit is contained in:
Henrik Rydgard 2012-11-09 10:01:54 +01:00
parent 8e5fb74c12
commit 1b90a8b327
5 changed files with 30 additions and 6 deletions

View File

@ -261,7 +261,7 @@ void sceAudioOutput2OutputBlocking()
int vol = PARAM(0); int vol = PARAM(0);
u32 dataPtr = PARAM(1); u32 dataPtr = PARAM(1);
ERROR_LOG(HLE,"UNIMPL sceAudioOutput2OutputBlocking(%i, %08x)", vol, dataPtr); WARN_LOG(HLE,"FAKE sceAudioOutput2OutputBlocking(%i, %08x)", vol, dataPtr);
chans[0].running = true; chans[0].running = true;
chans[0].leftVolume = vol; chans[0].leftVolume = vol;
chans[0].rightVolume = vol; chans[0].rightVolume = vol;

View File

@ -602,10 +602,27 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void
} }
return; return;
} }
case 0x02425823: // Check if valid
if (Memory::IsValidAddress(outPtr)) case 0x02415823: // Set FAT as enabled
Memory::Write_U32(1, outPtr); // TODO: Make a headless mode for running tests! if (Memory::IsValidAddress(argAddr) && argLen == 4) {
MemoryStick_SetFatState((MemStickFatState)Memory::Read_U32(argAddr));
RETURN(0);
} else {
ERROR_LOG(HLE, "Failed 0x02415823 fat");
RETURN(-1);
}
break; break;
case 0x02425823: // Check if FAT enabled
if (Memory::IsValidAddress(outPtr) && outLen == 4) {
Memory::Write_U32(MemoryStick_FatState(), outPtr);
RETURN(0);
} else {
ERROR_LOG(HLE, "Failed 0x02425823 fat");
RETURN(-1);
}
break;
case 0x02425818: // Get memstick size etc case 0x02425818: // Get memstick size etc
// Pretend we have a 2GB memory stick. // Pretend we have a 2GB memory stick.
{ {

View File

@ -148,13 +148,13 @@ retry:
break; break;
} }
} }
// RETURN(0);
//pop the thread that were released from waiting //pop the thread that were released from waiting
// I don't think we should reschedule here // I don't think we should reschedule here
//if (wokeThreads) //if (wokeThreads)
// __KernelReSchedule("semaphore signalled"); // __KernelReSchedule("semaphore signalled");
RETURN(0);
} }
else else
{ {

View File

@ -22,4 +22,9 @@ u64 MemoryStick_SectorSize()
u64 MemoryStick_FreeSpace() u64 MemoryStick_FreeSpace()
{ {
return 1ULL * 1024 * 1024 * 1024; // 1GB return 1ULL * 1024 * 1024 * 1024; // 1GB
} }
void MemoryStick_SetFatState(MemStickFatState state)
{
memStickFatState = state;
}

View File

@ -17,5 +17,7 @@ enum MemStickFatState {
MemStickState MemoryStick_State(); MemStickState MemoryStick_State();
MemStickFatState MemoryStick_FatState(); MemStickFatState MemoryStick_FatState();
void MemoryStick_SetFatState(MemStickFatState state);
u64 MemoryStick_SectorSize(); u64 MemoryStick_SectorSize();
u64 MemoryStick_FreeSpace(); u64 MemoryStick_FreeSpace();