From 1b90a8b3273d932a78dc001ebd426704b449626c Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Fri, 9 Nov 2012 10:01:54 +0100 Subject: [PATCH] Another memstick ioctl, minor fixes --- Core/HLE/sceAudio.cpp | 2 +- Core/HLE/sceIo.cpp | 23 ++++++++++++++++++++--- Core/HLE/sceKernelSemaphore.cpp | 2 +- Core/HW/MemoryStick.cpp | 7 ++++++- Core/HW/MemoryStick.h | 2 ++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Core/HLE/sceAudio.cpp b/Core/HLE/sceAudio.cpp index e2ad72349..0db852144 100644 --- a/Core/HLE/sceAudio.cpp +++ b/Core/HLE/sceAudio.cpp @@ -261,7 +261,7 @@ void sceAudioOutput2OutputBlocking() int vol = PARAM(0); 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].leftVolume = vol; chans[0].rightVolume = vol; diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 0e0023dd4..a4c8ab551 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -602,10 +602,27 @@ void sceIoDevctl() //(const char *name, int cmd, void *arg, size_t arglen, void } return; } - case 0x02425823: // Check if valid - if (Memory::IsValidAddress(outPtr)) - Memory::Write_U32(1, outPtr); // TODO: Make a headless mode for running tests! + + case 0x02415823: // Set FAT as enabled + 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; + + 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 // Pretend we have a 2GB memory stick. { diff --git a/Core/HLE/sceKernelSemaphore.cpp b/Core/HLE/sceKernelSemaphore.cpp index 161ff6efb..11d71ceaf 100644 --- a/Core/HLE/sceKernelSemaphore.cpp +++ b/Core/HLE/sceKernelSemaphore.cpp @@ -148,13 +148,13 @@ retry: break; } } + // RETURN(0); //pop the thread that were released from waiting // I don't think we should reschedule here //if (wokeThreads) // __KernelReSchedule("semaphore signalled"); - RETURN(0); } else { diff --git a/Core/HW/MemoryStick.cpp b/Core/HW/MemoryStick.cpp index 105a63a7a..4d83e4783 100644 --- a/Core/HW/MemoryStick.cpp +++ b/Core/HW/MemoryStick.cpp @@ -22,4 +22,9 @@ u64 MemoryStick_SectorSize() u64 MemoryStick_FreeSpace() { return 1ULL * 1024 * 1024 * 1024; // 1GB -} \ No newline at end of file +} + +void MemoryStick_SetFatState(MemStickFatState state) +{ + memStickFatState = state; +} diff --git a/Core/HW/MemoryStick.h b/Core/HW/MemoryStick.h index 199a24521..1ccd9b64f 100644 --- a/Core/HW/MemoryStick.h +++ b/Core/HW/MemoryStick.h @@ -17,5 +17,7 @@ enum MemStickFatState { MemStickState MemoryStick_State(); MemStickFatState MemoryStick_FatState(); +void MemoryStick_SetFatState(MemStickFatState state); + u64 MemoryStick_SectorSize(); u64 MemoryStick_FreeSpace(); \ No newline at end of file