From ce853bc2521f8d005e1076d9619ffc84e3c6b92f Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Fri, 19 Dec 2014 13:31:52 +0200 Subject: [PATCH] cellSail updates and many various fixes --- rpcs3/Emu/CPU/CPUThreadManager.cpp | 2 +- rpcs3/Emu/SysCalls/LogBase.h | 2 +- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 4 ++-- rpcs3/{ => Emu/SysCalls/Modules}/cellMic.h | 0 rpcs3/Emu/SysCalls/Modules/cellSail.cpp | 16 ++++++++++------ rpcs3/Emu/SysCalls/Modules/cellSail.h | 8 ++++---- rpcs3/Emu/SysCalls/lv2/sys_process.cpp | 3 ++- rpcs3/emucore.vcxproj | 4 ++-- rpcs3/emucore.vcxproj.filters | 6 +++--- 9 files changed, 25 insertions(+), 20 deletions(-) rename rpcs3/{ => Emu/SysCalls/Modules}/cellMic.h (100%) diff --git a/rpcs3/Emu/CPU/CPUThreadManager.cpp b/rpcs3/Emu/CPU/CPUThreadManager.cpp index b745da0177..86608f2602 100644 --- a/rpcs3/Emu/CPU/CPUThreadManager.cpp +++ b/rpcs3/Emu/CPU/CPUThreadManager.cpp @@ -139,7 +139,7 @@ void CPUThreadManager::Exec() { std::lock_guard lock(m_mtx_thread); - for(u32 i=0; iExec(); } diff --git a/rpcs3/Emu/SysCalls/LogBase.h b/rpcs3/Emu/SysCalls/LogBase.h index 24b257d472..d3aa862efb 100644 --- a/rpcs3/Emu/SysCalls/LogBase.h +++ b/rpcs3/Emu/SysCalls/LogBase.h @@ -36,7 +36,7 @@ public: template __noinline void Notice(const char* fmt, Targs... args) const { - LogOutput(LogNotice, " : ", fmt::Format(fmt, args...)); + LogOutput(LogNotice, ": ", fmt::Format(fmt, args...)); } template __forceinline void Log(const char* fmt, Targs... args) const diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 8e08a1faf7..99ddaa6c98 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -195,7 +195,7 @@ u64 cellGcmGetTimeStampLocation(u32 index, u32 location) } if (location == CELL_GCM_LOCATION_MAIN) { - if (index >= 1024*1024) { + if (index >= 1024 * 1024) { cellGcmSys->Error("cellGcmGetTimeStampLocation: Wrong main index (%d)", index); return 0; } @@ -300,7 +300,7 @@ u32 cellGcmGetTiledPitchSize(u32 size) { cellGcmSys->Log("cellGcmGetTiledPitchSize(size=%d)", size); - for (size_t i=0; i < sizeof(tiled_pitches)/sizeof(tiled_pitches[0]) - 1; i++) { + for (size_t i=0; i < sizeof(tiled_pitches) / sizeof(tiled_pitches[0]) - 1; i++) { if (tiled_pitches[i] < size && size <= tiled_pitches[i+1]) { return tiled_pitches[i+1]; } diff --git a/rpcs3/cellMic.h b/rpcs3/Emu/SysCalls/Modules/cellMic.h similarity index 100% rename from rpcs3/cellMic.h rename to rpcs3/Emu/SysCalls/Modules/cellMic.h diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp index b4d1eba987..d240fd2c62 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp @@ -11,6 +11,7 @@ int cellSailMemAllocatorInitialize(vm::ptr pSelf, vm::ptr< cellSail->Warning("cellSailMemAllocatorInitialize(pSelf_addr=0x%x, pCallbacks_addr=0x%x)", pSelf.addr(), pCallbacks.addr()); pSelf->callbacks = pCallbacks; + // TODO: Create a cellSail thread return CELL_OK; } @@ -629,15 +630,18 @@ int cellSailPlayerCreateDescriptor(vm::ptr pSelf, s32 streamType //CellSailDescriptor *pDesc = new CellSailDescriptor(); //u32 descriptorAddress = pSelf->allocator->callbacks->pAlloc(pSelf->allocator->pArg, sizeof(CellSailDescriptor), sizeof(CellSailDescriptor)); u32 descriptorAddress = Memory.Alloc(sizeof(CellSailDescriptor), sizeof(CellSailDescriptor)); - cellSail->Error("Address: 0x%x", descriptorAddress); + //CellSailMemAllocatorFuncAlloc test = pSelf->allocator->callbacks->pAlloc.call(Emu.GetCPU()); + //u32 descriptorAddress2 = test(pSelf->allocator->pArg, sizeof(CellSailDescriptor), sizeof(CellSailDescriptor)); + //cellSail->Error("Address: 0x%x", pSelf->allocator->callbacks.addr()); + //cellSail->Error("Address 2: 0x%x", descriptorAddress2); //vm::ptr descriptor = vm::ptr::make(Memory.RealToVirtualAddr(&descriptorAddress)); - vm::ptr descriptor = vm::ptr::make(descriptorAddress); - //descriptor->streamType = streamType; - //descriptor->registered = false; + ppDesc = vm::ptr::make(descriptorAddress); + //cellSail->Error("Address 2: 0x%x", ppDesc.addr()); + ppDesc->streamType = streamType; + ppDesc->registered = false; - pSelf->descriptors = 0; + //pSelf->descriptors = 0; pSelf->repeatMode = 0; - //ppDesc = descriptor; //cellSail->Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr()); //cellSailPlayerAddDescriptor(pSelf, ppDesc); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.h b/rpcs3/Emu/SysCalls/Modules/cellSail.h index eb518f110d..d0244fed6d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.h @@ -679,8 +679,8 @@ typedef void(*CellSailPlayerFuncNotified)(u32 pArg, vm::ptr event struct CellSailMemAllocatorFuncs { - CellSailMemAllocatorFuncAlloc pAlloc; - CellSailMemAllocatorFuncFree pFree; + vm::ptr pAlloc; + vm::ptr pFree; }; struct CellSailMemAllocator @@ -691,8 +691,8 @@ struct CellSailMemAllocator struct CellSailFuture { - u32 mutex_id; - u32 cond_id; + be_t mutex_id; + be_t cond_id; volatile be_t flags; be_t result; be_t userParam; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp index b041044f95..f74b438775 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp @@ -110,7 +110,8 @@ void sys_game_process_exitspawn(vm::ptr path, u32 argv_addr, u32 env else if (_path.substr(1, 8) == "dev_hdd1") device = 1; - Emu.BootGame(_path.c_str(), true, device); + if (device != 0) + Emu.BootGame(_path.c_str(), true, device); return; } diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index b0990ba2f6..79a1d44d55 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -283,7 +283,6 @@ - @@ -420,8 +419,9 @@ - + + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 9335c19690..d32c333bf4 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -742,6 +742,9 @@ Emu\SysCalls\Modules + + Emu\SysCalls\Modules + Emu\SysCalls\Modules @@ -1252,9 +1255,6 @@ Crypto - - Emu\SysCalls\Modules - Emu\CPU\Cell