cellSail updates and many various fixes

This commit is contained in:
Raul Tambre 2014-12-19 13:31:52 +02:00
parent 83208d8b89
commit ce853bc252
9 changed files with 25 additions and 20 deletions

View file

@ -139,7 +139,7 @@ void CPUThreadManager::Exec()
{ {
std::lock_guard<std::mutex> lock(m_mtx_thread); std::lock_guard<std::mutex> lock(m_mtx_thread);
for(u32 i=0; i<m_threads.size(); ++i) for(u32 i = 0; i < m_threads.size(); ++i)
{ {
m_threads[i]->Exec(); m_threads[i]->Exec();
} }

View file

@ -36,7 +36,7 @@ public:
template<typename... Targs> __noinline void Notice(const char* fmt, Targs... args) const template<typename... Targs> __noinline void Notice(const char* fmt, Targs... args) const
{ {
LogOutput(LogNotice, " : ", fmt::Format(fmt, args...)); LogOutput(LogNotice, ": ", fmt::Format(fmt, args...));
} }
template<typename... Targs> __forceinline void Log(const char* fmt, Targs... args) const template<typename... Targs> __forceinline void Log(const char* fmt, Targs... args) const

View file

@ -195,7 +195,7 @@ u64 cellGcmGetTimeStampLocation(u32 index, u32 location)
} }
if (location == CELL_GCM_LOCATION_MAIN) { if (location == CELL_GCM_LOCATION_MAIN) {
if (index >= 1024*1024) { if (index >= 1024 * 1024) {
cellGcmSys->Error("cellGcmGetTimeStampLocation: Wrong main index (%d)", index); cellGcmSys->Error("cellGcmGetTimeStampLocation: Wrong main index (%d)", index);
return 0; return 0;
} }
@ -300,7 +300,7 @@ u32 cellGcmGetTiledPitchSize(u32 size)
{ {
cellGcmSys->Log("cellGcmGetTiledPitchSize(size=%d)", 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]) { if (tiled_pitches[i] < size && size <= tiled_pitches[i+1]) {
return tiled_pitches[i+1]; return tiled_pitches[i+1];
} }

View file

@ -11,6 +11,7 @@ int cellSailMemAllocatorInitialize(vm::ptr<CellSailMemAllocator> pSelf, vm::ptr<
cellSail->Warning("cellSailMemAllocatorInitialize(pSelf_addr=0x%x, pCallbacks_addr=0x%x)", pSelf.addr(), pCallbacks.addr()); cellSail->Warning("cellSailMemAllocatorInitialize(pSelf_addr=0x%x, pCallbacks_addr=0x%x)", pSelf.addr(), pCallbacks.addr());
pSelf->callbacks = pCallbacks; pSelf->callbacks = pCallbacks;
// TODO: Create a cellSail thread
return CELL_OK; return CELL_OK;
} }
@ -629,15 +630,18 @@ int cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType
//CellSailDescriptor *pDesc = new CellSailDescriptor(); //CellSailDescriptor *pDesc = new CellSailDescriptor();
//u32 descriptorAddress = pSelf->allocator->callbacks->pAlloc(pSelf->allocator->pArg, sizeof(CellSailDescriptor), sizeof(CellSailDescriptor)); //u32 descriptorAddress = pSelf->allocator->callbacks->pAlloc(pSelf->allocator->pArg, sizeof(CellSailDescriptor), sizeof(CellSailDescriptor));
u32 descriptorAddress = Memory.Alloc(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<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(Memory.RealToVirtualAddr(&descriptorAddress)); //vm::ptr<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(Memory.RealToVirtualAddr(&descriptorAddress));
vm::ptr<CellSailDescriptor> descriptor = vm::ptr<CellSailDescriptor>::make(descriptorAddress); ppDesc = vm::ptr<CellSailDescriptor>::make(descriptorAddress);
//descriptor->streamType = streamType; //cellSail->Error("Address 2: 0x%x", ppDesc.addr());
//descriptor->registered = false; ppDesc->streamType = streamType;
ppDesc->registered = false;
pSelf->descriptors = 0; //pSelf->descriptors = 0;
pSelf->repeatMode = 0; pSelf->repeatMode = 0;
//ppDesc = descriptor;
//cellSail->Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr()); //cellSail->Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr());
//cellSailPlayerAddDescriptor(pSelf, ppDesc); //cellSailPlayerAddDescriptor(pSelf, ppDesc);

View file

@ -679,8 +679,8 @@ typedef void(*CellSailPlayerFuncNotified)(u32 pArg, vm::ptr<CellSailEvent> event
struct CellSailMemAllocatorFuncs struct CellSailMemAllocatorFuncs
{ {
CellSailMemAllocatorFuncAlloc pAlloc; vm::ptr<CellSailMemAllocatorFuncAlloc> pAlloc;
CellSailMemAllocatorFuncFree pFree; vm::ptr<CellSailMemAllocatorFuncFree> pFree;
}; };
struct CellSailMemAllocator struct CellSailMemAllocator
@ -691,8 +691,8 @@ struct CellSailMemAllocator
struct CellSailFuture struct CellSailFuture
{ {
u32 mutex_id; be_t<u32> mutex_id;
u32 cond_id; be_t<u32> cond_id;
volatile be_t<u32> flags; volatile be_t<u32> flags;
be_t<s32> result; be_t<s32> result;
be_t<u64> userParam; be_t<u64> userParam;

View file

@ -110,7 +110,8 @@ void sys_game_process_exitspawn(vm::ptr<const char> path, u32 argv_addr, u32 env
else if (_path.substr(1, 8) == "dev_hdd1") else if (_path.substr(1, 8) == "dev_hdd1")
device = 1; device = 1;
Emu.BootGame(_path.c_str(), true, device); if (device != 0)
Emu.BootGame(_path.c_str(), true, device);
return; return;
} }

View file

@ -283,7 +283,6 @@
<ClInclude Include="..\Utilities\StrFmt.h" /> <ClInclude Include="..\Utilities\StrFmt.h" />
<ClInclude Include="..\Utilities\Thread.h" /> <ClInclude Include="..\Utilities\Thread.h" />
<ClInclude Include="..\Utilities\Timer.h" /> <ClInclude Include="..\Utilities\Timer.h" />
<ClInclude Include="cellMic.h" />
<ClInclude Include="Crypto\aes.h" /> <ClInclude Include="Crypto\aes.h" />
<ClInclude Include="Crypto\ec.h" /> <ClInclude Include="Crypto\ec.h" />
<ClInclude Include="Crypto\key_vault.h" /> <ClInclude Include="Crypto\key_vault.h" />
@ -420,8 +419,9 @@
<ClInclude Include="Emu\SysCalls\Modules\cellGifDec.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellGifDec.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellJpgDec.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellJpgDec.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellL10n.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellL10n.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellNetCtl.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellMic.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellMsgDialog.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellMsgDialog.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellNetCtl.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellPad.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellPad.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellPamf.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellPamf.h" />
<ClInclude Include="Emu\SysCalls\Modules\cellPng.h" /> <ClInclude Include="Emu\SysCalls\Modules\cellPng.h" />

View file

@ -742,6 +742,9 @@
<ClInclude Include="Emu\SysCalls\Modules\cellL10n.h"> <ClInclude Include="Emu\SysCalls\Modules\cellL10n.h">
<Filter>Emu\SysCalls\Modules</Filter> <Filter>Emu\SysCalls\Modules</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellMic.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellMouse.h"> <ClInclude Include="Emu\SysCalls\Modules\cellMouse.h">
<Filter>Emu\SysCalls\Modules</Filter> <Filter>Emu\SysCalls\Modules</Filter>
</ClInclude> </ClInclude>
@ -1252,9 +1255,6 @@
<ClInclude Include="Crypto\ec.h"> <ClInclude Include="Crypto\ec.h">
<Filter>Crypto</Filter> <Filter>Crypto</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="cellMic.h">
<Filter>Emu\SysCalls\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\PPULLVMRecompiler.h"> <ClInclude Include="Emu\Cell\PPULLVMRecompiler.h">
<Filter>Emu\CPU\Cell</Filter> <Filter>Emu\CPU\Cell</Filter>
</ClInclude> </ClInclude>