From 1f46098b23d9c2e5603548cf225a50a474b33687 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 20 Jul 2014 21:03:41 +0400 Subject: [PATCH 01/21] Name fix (SPU JIT) Unnecessary check removed --- rpcs3/Emu/Cell/SPURecompiler.h | 2 +- rpcs3/Emu/Cell/SPURecompilerCore.cpp | 9 +-------- rpcs3/Gui/MainFrame.cpp | 9 ++++----- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/rpcs3/Emu/Cell/SPURecompiler.h b/rpcs3/Emu/Cell/SPURecompiler.h index 0851c70a3e..6bdcddf1cb 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.h +++ b/rpcs3/Emu/Cell/SPURecompiler.h @@ -3840,7 +3840,7 @@ private: void UNK(u32 code, u32 opcode, u32 gcode) { - UNK(fmt::Format("(SPURecompiler) Unimplemented opcode! (0x%08x, 0x%x, 0x%x)", code, opcode, gcode)); + UNK(fmt::Format("Unimplemented opcode! (0x%08x, 0x%x, 0x%x)", code, opcode, gcode)); } void UNK(const std::string& err) diff --git a/rpcs3/Emu/Cell/SPURecompilerCore.cpp b/rpcs3/Emu/Cell/SPURecompilerCore.cpp index 52563b2e0d..fe005b6804 100644 --- a/rpcs3/Emu/Cell/SPURecompilerCore.cpp +++ b/rpcs3/Emu/Cell/SPURecompilerCore.cpp @@ -23,7 +23,7 @@ SPURecompilerCore::SPURecompilerCore(SPUThread& cpu) X86CpuUtil::detect(&inf); if (!inf.hasFeature(kX86CpuFeatureSse41)) { - LOG_ERROR(SPU, "SPU Recompiler requires SSE4.1 instruction set support"); + LOG_ERROR(SPU, "SPU JIT requires SSE4.1 instruction set support"); Emu.Pause(); } } @@ -169,13 +169,6 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address) //ConLog.Write("DecodeMemory: pos=%d", pos); u32* ls = (u32*)&Memory[m_offset]; - if (!pos) - { - LOG_ERROR(Log::SPU, "SPURecompilerCore::DecodeMemory(): ls_addr = 0"); - Emu.Pause(); - return 0; - } - if (entry[pos].pointer) { // check data (hard way) diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 8fe3b05371..705aa26494 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -429,12 +429,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_hle, wxID_ANY, "Exit RPCS3 when process finishes"); wxCheckBox* chbox_hle_always_start = new wxCheckBox(p_hle, wxID_ANY, "Always start after boot"); - //cbox_cpu_decoder->Append("DisAsm"); - cbox_cpu_decoder->Append("Interpreter & DisAsm"); - cbox_cpu_decoder->Append("Interpreter"); + cbox_cpu_decoder->Append("PPU Interpreter & DisAsm"); + cbox_cpu_decoder->Append("PPU Interpreter"); - cbox_spu_decoder->Append("Interpreter"); - cbox_spu_decoder->Append("Recompiler"); + cbox_spu_decoder->Append("SPU Interpreter"); + cbox_spu_decoder->Append("SPU JIT (asmjit)"); for(int i=1; i Date: Sun, 20 Jul 2014 21:05:48 +0400 Subject: [PATCH 02/21] sys_ppu_thread_exit fix --- rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp | 20 ++++++++++++++++---- rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp index f60e144710..a991acc993 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp @@ -10,12 +10,10 @@ extern Module *sysPrxForUser; -static const u32 PPU_THREAD_ID_INVALID = 0xFFFFFFFFU; +static const u32 PPU_THREAD_ID_INVALID = 0xFFFFFFFFU/*UUUUUUUUUUuuuuuuuuuu~~~~~~~~*/; -void sys_ppu_thread_exit(u64 errorcode) +void ppu_thread_exit(u64 errorcode) { - sysPrxForUser->Log("sys_ppu_thread_exit(0x%llx)", errorcode); - PPUThread& thr = GetCurrentPPUThread(); u32 tid = thr.GetId(); @@ -29,6 +27,20 @@ void sys_ppu_thread_exit(u64 errorcode) thr.Stop(); } +void sys_ppu_thread_exit(u64 errorcode) +{ + sysPrxForUser->Log("sys_ppu_thread_exit(0x%llx)", errorcode); + + ppu_thread_exit(errorcode); +} + +void sys_internal_ppu_thread_exit(u64 errorcode) +{ + sysPrxForUser->Log("sys_internal_ppu_thread_exit(0x%llx)", errorcode); + + ppu_thread_exit(errorcode); +} + s32 sys_ppu_thread_yield() { sysPrxForUser->Log("sys_ppu_thread_yield()"); diff --git a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h index ef99ca6012..7918118e99 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.h @@ -14,6 +14,7 @@ enum ppu_thread_flags : u64 // SysCalls void sys_ppu_thread_exit(u64 errorcode); +void sys_internal_ppu_thread_exit(u64 errorcode); s32 sys_ppu_thread_yield(); s32 sys_ppu_thread_join(u64 thread_id, mem64_t vptr); s32 sys_ppu_thread_detach(u64 thread_id); From 25aeb2e086d19afd8afd8065a349c4629b6b01c7 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 20 Jul 2014 21:13:07 +0400 Subject: [PATCH 03/21] SysCall table fixes --- rpcs3/Emu/SysCalls/SysCalls.cpp | 42 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index 48c1a4c107..e92997781f 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -23,7 +23,7 @@ static func_caller* sc_table[kSyscallTableLength] = null_func, bind_func(sys_process_getpid), //1 (0x001) bind_func(sys_process_wait_for_child), //2 (0x002) ROOT - bind_func(sys_process_exit), //3 (0x003) + null_func,//bind_func(sys_process_exit), //3 (0x003) bind_func(sys_process_get_status), //4 (0x004) DBG bind_func(sys_process_detach_child), //5 (0x005) DBG @@ -55,7 +55,7 @@ static func_caller* sc_table[kSyscallTableLength] = // Unused: 32-40 null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, - bind_func(sys_ppu_thread_exit), //41 (0x029) + bind_func(sys_internal_ppu_thread_exit), //41 (0x029) null_func, // bind_func(sys_ppu_thread_yield), //43 (0x02B) bind_func(sys_ppu_thread_join), //44 (0x02C) @@ -64,9 +64,9 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_ppu_thread_set_priority), //47 (0x02F) DBG bind_func(sys_ppu_thread_get_priority), //48 (0x030) bind_func(sys_ppu_thread_get_stack_information), //49 (0x031) - bind_func(sys_ppu_thread_stop), //50 (0x032) ROOT - bind_func(sys_ppu_thread_restart), //51 (0x033) ROOT - bind_func(sys_ppu_thread_create), //52 (0x034) DBG + null_func,//bind_func(sys_ppu_thread_stop), //50 (0x032) ROOT + null_func,//bind_func(sys_ppu_thread_restart), //51 (0x033) ROOT + null_func,//bind_func(sys_ppu_thread_create), //52 (0x034) DBG null_func,//bind_func(sys_ppu_thread_start), //53 (0x035) null_func,//bind_func(), //54 (0x036) ROOT null_func,//bind_func(), //55 (0x037) ROOT @@ -115,11 +115,11 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_semaphore_wait), //92 (0x05C) bind_func(sys_semaphore_trywait), //93 (0x05D) bind_func(sys_semaphore_post), //94 (0x05E) - bind_func(sys_lwmutex_create), //95 (0x05F) - bind_func(sys_lwmutex_destroy), //96 (0x060) - bind_func(sys_lwmutex_lock), //97 (0x061) - bind_func(sys_lwmutex_trylock), //98 (0x062) - bind_func(sys_lwmutex_unlock), //99 (0x063) + null_func,//bind_func(sys_lwmutex_create), //95 (0x05F) + null_func,//bind_func(sys_lwmutex_destroy), //96 (0x060) + null_func,//bind_func(sys_lwmutex_lock), //97 (0x061) + null_func,//bind_func(sys_lwmutex_trylock), //98 (0x062) + null_func,//bind_func(sys_lwmutex_unlock), //99 (0x063) bind_func(sys_mutex_create), //100 (0x064) bind_func(sys_mutex_destroy), //101 (0x065) bind_func(sys_mutex_lock), //102 (0x066) @@ -166,7 +166,7 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_time_set_timezone) //143 (0x08F) ROOT bind_func(sys_time_get_timezone), //144 (0x090) bind_func(sys_time_get_current_time), //145 (0x091) - bind_func(sys_time_get_system_time), //146 (0x092) ROOT + null_func,//bind_func(sys_time_get_system_time), //146 (0x092) ROOT bind_func(sys_time_get_timebase_frequency), //147 (0x093) null_func,//bind_func(sys_rwlock_trywlock) //148 (0x094) @@ -342,24 +342,24 @@ static func_caller* sc_table[kSyscallTableLength] = null_func, null_func, null_func, null_func, null_func, //474 null_func, null_func, null_func, null_func, null_func, //479 - bind_func(sys_prx_load_module), //480 (0x1E0) - bind_func(sys_prx_start_module), //481 (0x1E1) - bind_func(sys_prx_stop_module), //482 (0x1E2) - bind_func(sys_prx_unload_module), //483 (0x1E3) - bind_func(sys_prx_register_module), //484 (0x1E4) + null_func,//bind_func(sys_prx_load_module), //480 (0x1E0) + null_func,//bind_func(sys_prx_start_module), //481 (0x1E1) + null_func,//bind_func(sys_prx_stop_module), //482 (0x1E2) + null_func,//bind_func(sys_prx_unload_module), //483 (0x1E3) + null_func,//bind_func(sys_prx_register_module), //484 (0x1E4) bind_func(sys_prx_query_module), //485 (0x1E5) bind_func(sys_prx_register_library), //486 (0x1E6) - bind_func(sys_prx_unregister_library), //487 (0x1E7) + null_func,//bind_func(sys_prx_unregister_library), //487 (0x1E7) bind_func(sys_prx_link_library), //488 (0x1E8) bind_func(sys_prx_unlink_library), //489 (0x1E9) bind_func(sys_prx_query_library), //490 (0x1EA) null_func, //491 (0x1EB) null_func, //492 (0x1EC) null_func,//sys_prx_dbg_get_module_info //493 (0x1ED) - bind_func(sys_prx_get_module_list), //494 (0x1EE) - bind_func(sys_prx_get_module_info), //495 (0x1EF) - bind_func(sys_prx_get_module_id_by_name), //496 (0x1F0) - bind_func(sys_prx_load_module_on_memcontainer), //497 (0x1F1) + null_func,//bind_func(sys_prx_get_module_list), //494 (0x1EE) + null_func,//bind_func(sys_prx_get_module_info), //495 (0x1EF) + null_func,//bind_func(sys_prx_get_module_id_by_name), //496 (0x1F0) + null_func,//bind_func(sys_prx_load_module_on_memcontainer),//497 (0x1F1) bind_func(sys_prx_start), //498 (0x1F2) bind_func(sys_prx_stop), //499 (0x1F3) From 3d74112aa3ba03fd942a79b1036f0d254426a8eb Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 20 Jul 2014 21:13:35 +0400 Subject: [PATCH 04/21] sys_process_is_stack fixed --- rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp index 6721a233c3..d114db9933 100644 --- a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp @@ -77,11 +77,10 @@ s64 sys_process_at_Exitspawn() int sys_process_is_stack(u32 p) { - PPCThread* CPU = GetCurrentPPCThread(); - if (p >= CPU->GetStackAddr() && p <= CPU->GetStackAddr() + CPU->GetStackSize()) - return 1; + sysPrxForUser->Log("sys_process_is_stack(p=0x%x)", p); - return 0; + // prx: compare high 4 bits with "0xD" + return (int)(bool)(p >= Memory.StackMem.GetStartAddr() && p <= Memory.StackMem.GetEndAddr()); } int sys_spu_printf_initialize(int a1, int a2, int a3, int a4, int a5) From 883885dc0b47ec4e4382bcd6ffaf448d2db9d36b Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 20 Jul 2014 21:14:04 +0400 Subject: [PATCH 05/21] cellSyncMutex fixed --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 69 +++++++------------------ rpcs3/Emu/SysCalls/Modules/cellSync.h | 38 ++++++++++++++ rpcs3/emucore.vcxproj | 3 +- rpcs3/emucore.vcxproj.filters | 5 +- 4 files changed, 64 insertions(+), 51 deletions(-) create mode 100644 rpcs3/Emu/SysCalls/Modules/cellSync.h diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index e66b8a4f3a..604aab4902 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -4,51 +4,17 @@ #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" +#include "cellSync.h" + //void cellSync_init(); //Module cellSync("cellSync", cellSync_init); Module *cellSync = nullptr; -// Return Codes -enum -{ - CELL_SYNC_ERROR_AGAIN = 0x80410101, - CELL_SYNC_ERROR_INVAL = 0x80410102, - CELL_SYNC_ERROR_NOMEM = 0x80410104, - CELL_SYNC_ERROR_DEADLK = 0x80410108, - CELL_SYNC_ERROR_PERM = 0x80410109, - CELL_SYNC_ERROR_BUSY = 0x8041010A, - CELL_SYNC_ERROR_STAT = 0x8041010F, - CELL_SYNC_ERROR_ALIGN = 0x80410110, - CELL_SYNC_ERROR_NULL_POINTER = 0x80410111, - CELL_SYNC_ERROR_NOT_SUPPORTED_THREAD = 0x80410112, - CELL_SYNC_ERROR_NO_NOTIFIER = 0x80410113, - CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE = 0x80410114, -}; - -struct CellSyncMutex -{ - be_t m_freed; - be_t m_order; - - volatile u32& m_data() - { - return *reinterpret_cast(this); - }; - /* - (???) Initialize: set zeros - (???) Lock: increase m_order and wait until m_freed == old m_order - (???) Unlock: increase m_freed - (???) TryLock: ????? - */ -}; - -static_assert(sizeof(CellSyncMutex) == 4, "CellSyncMutex: wrong sizeof"); - int cellSyncMutexInitialize(mem_ptr_t mutex) { cellSync->Log("cellSyncMutexInitialize(mutex=0x%x)", mutex.GetAddr()); - if (!mutex.IsGood()) + if (!mutex) { return CELL_SYNC_ERROR_NULL_POINTER; } @@ -57,7 +23,8 @@ int cellSyncMutexInitialize(mem_ptr_t mutex) return CELL_SYNC_ERROR_ALIGN; } - mutex->m_data() = 0; + // prx: set zero and sync + InterlockedExchange(&mutex->m_data(), 0); return CELL_OK; } @@ -65,7 +32,7 @@ int cellSyncMutexLock(mem_ptr_t mutex) { cellSync->Log("cellSyncMutexLock(mutex=0x%x)", mutex.GetAddr()); - if (!mutex.IsGood()) + if (!mutex) { return CELL_SYNC_ERROR_NULL_POINTER; } @@ -74,6 +41,7 @@ int cellSyncMutexLock(mem_ptr_t mutex) return CELL_SYNC_ERROR_ALIGN; } + // prx: increase u16 and remember its old value be_t old_order; while (true) { @@ -82,11 +50,12 @@ int cellSyncMutexLock(mem_ptr_t mutex) new_mutex.m_data() = old_data; old_order = new_mutex.m_order; - new_mutex.m_order++; + new_mutex.m_order++; // increase m_order if (InterlockedCompareExchange(&mutex->m_data(), new_mutex.m_data(), old_data) == old_data) break; } - while (old_order != mutex->m_freed) + // prx: wait until another u16 value == old value + while (old_order != mutex->m_freed) { std::this_thread::sleep_for(std::chrono::milliseconds(1)); if (Emu.IsStopped()) @@ -95,7 +64,9 @@ int cellSyncMutexLock(mem_ptr_t mutex) break; } } - _mm_mfence(); + + // prx: sync + InterlockedCompareExchange(&mutex->m_data(), 0, 0); return CELL_OK; } @@ -103,7 +74,7 @@ int cellSyncMutexTryLock(mem_ptr_t mutex) { cellSync->Log("cellSyncMutexTryLock(mutex=0x%x)", mutex.GetAddr()); - if (!mutex.IsGood()) + if (!mutex) { return CELL_SYNC_ERROR_NULL_POINTER; } @@ -112,34 +83,32 @@ int cellSyncMutexTryLock(mem_ptr_t mutex) return CELL_SYNC_ERROR_ALIGN; } - int res; - while (true) { const u32 old_data = mutex->m_data(); CellSyncMutex new_mutex; new_mutex.m_data() = old_data; + // prx: compare two u16 values and exit if not equal if (new_mutex.m_order != new_mutex.m_freed) { - res = CELL_SYNC_ERROR_BUSY; + return CELL_SYNC_ERROR_BUSY; } else { new_mutex.m_order++; - res = CELL_OK; } if (InterlockedCompareExchange(&mutex->m_data(), new_mutex.m_data(), old_data) == old_data) break; } - return res; + return CELL_OK; } int cellSyncMutexUnlock(mem_ptr_t mutex) { cellSync->Log("cellSyncMutexUnlock(mutex=0x%x)", mutex.GetAddr()); - if (!mutex.IsGood()) + if (!mutex) { return CELL_SYNC_ERROR_NULL_POINTER; } @@ -148,6 +117,8 @@ int cellSyncMutexUnlock(mem_ptr_t mutex) return CELL_SYNC_ERROR_ALIGN; } + InterlockedCompareExchange(&mutex->m_data(), 0, 0); + while (true) { const u32 old_data = mutex->m_data(); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.h b/rpcs3/Emu/SysCalls/Modules/cellSync.h new file mode 100644 index 0000000000..36a768986e --- /dev/null +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.h @@ -0,0 +1,38 @@ +#pragma once + +// Return Codes +enum +{ + CELL_SYNC_ERROR_AGAIN = 0x80410101, + CELL_SYNC_ERROR_INVAL = 0x80410102, + CELL_SYNC_ERROR_NOMEM = 0x80410104, + CELL_SYNC_ERROR_DEADLK = 0x80410108, + CELL_SYNC_ERROR_PERM = 0x80410109, + CELL_SYNC_ERROR_BUSY = 0x8041010A, + CELL_SYNC_ERROR_STAT = 0x8041010F, + CELL_SYNC_ERROR_ALIGN = 0x80410110, + CELL_SYNC_ERROR_NULL_POINTER = 0x80410111, + CELL_SYNC_ERROR_NOT_SUPPORTED_THREAD = 0x80410112, + CELL_SYNC_ERROR_NO_NOTIFIER = 0x80410113, + CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE = 0x80410114, +}; + +struct CellSyncMutex +{ + be_t m_freed; + be_t m_order; + + volatile u32& m_data() + { + return *reinterpret_cast(this); + }; +}; + +static_assert(sizeof(CellSyncMutex) == 4, "CellSyncMutex: wrong size"); + +struct CellSyncBarrier +{ + be_t m_data; +}; + +static_assert(sizeof(CellSyncBarrier) == 4, "CellSyncBarrier: wrong size"); \ No newline at end of file diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 058d68e32b..2ee34fa688 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -352,6 +352,7 @@ + @@ -560,4 +561,4 @@ - + \ No newline at end of file diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 36357d7e1a..446d1a2613 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -1090,5 +1090,8 @@ Emu\Memory + + Emu\SysCalls\Modules + - + \ No newline at end of file From bba74b90568ef94f98b6a7c05eb0bddd4af85f46 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 20 Jul 2014 21:52:27 +0400 Subject: [PATCH 06/21] Compilation fix --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 604aab4902..69c9f1ab12 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -24,7 +24,8 @@ int cellSyncMutexInitialize(mem_ptr_t mutex) } // prx: set zero and sync - InterlockedExchange(&mutex->m_data(), 0); + mutex->m_data = 0; + InterlockedCompareExchange(&mutex->m_data(), 0, 0); return CELL_OK; } From 1f64087a3be90b41247991979c6a54ac575566d6 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 20 Jul 2014 21:59:59 +0400 Subject: [PATCH 07/21] Fix of fix (damned crutch) --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 69c9f1ab12..68981edf65 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -24,7 +24,7 @@ int cellSyncMutexInitialize(mem_ptr_t mutex) } // prx: set zero and sync - mutex->m_data = 0; + mutex->m_data() = 0; InterlockedCompareExchange(&mutex->m_data(), 0, 0); return CELL_OK; } From fe49046a961fa2551739df588a3422d0980b7efb Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 02:30:16 +0400 Subject: [PATCH 08/21] sys_spinlock fixed --- rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp | 48 ++++++++++++++----------- rpcs3/Emu/SysCalls/lv2/sys_spinlock.h | 13 +++---- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp index 9d70571088..358b234f37 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp @@ -4,53 +4,59 @@ #include "Emu/System.h" #include "Emu/Cell/PPUThread.h" #include "Emu/SysCalls/SysCalls.h" + #include "sys_spinlock.h" SysCallBase sys_spinlock("sys_spinlock"); -void sys_spinlock_initialize(mem_ptr_t lock) +void sys_spinlock_initialize(mem_ptr_t>> lock) { sys_spinlock.Log("sys_spinlock_initialize(lock_addr=0x%x)", lock.GetAddr()); - lock->mutex.initialize(); + // prx: set 0 and sync + *lock = be_t::MakeFromBE(0); } -void sys_spinlock_lock(mem_ptr_t lock) +void sys_spinlock_lock(mem_ptr_t>> lock) { sys_spinlock.Log("sys_spinlock_lock(lock_addr=0x%x)", lock.GetAddr()); - be_t tid = be_t::MakeFromLE(GetCurrentPPUThread().GetId()); - switch (lock->mutex.lock(tid)) + // prx: exchange with 0xabadcafe, repeat until exchanged with 0 + while (lock->exchange(be_t::MakeFromBE(se32(0xabadcafe))).ToBE()) { - case SMR_ABORT: LOG_WARNING(HLE, "sys_spinlock_lock(0x%x) aborted", lock.GetAddr()); break; - case SMR_DEADLOCK: LOG_ERROR(HLE, "sys_spinlock_lock(0x%x) reached deadlock", lock.GetAddr()); break; // ??? - default: break; + while (lock->load(std::memory_order_relaxed).ToBE()) + { + if (Emu.IsStopped()) + { + break; + } + } + + if (Emu.IsStopped()) + { + LOG_WARNING(HLE, "sys_spinlock_lock(0x%x) aborted", lock.GetAddr()); + break; + } } } -s32 sys_spinlock_trylock(mem_ptr_t lock) +s32 sys_spinlock_trylock(mem_ptr_t>> lock) { sys_spinlock.Log("sys_spinlock_trylock(lock_addr=0x%x)", lock.GetAddr()); - be_t tid = be_t::MakeFromLE(GetCurrentPPUThread().GetId()); - switch (lock->mutex.trylock(tid)) + // prx: exchange with 0xabadcafe, translate exchanged value + if (lock->exchange(be_t::MakeFromBE(se32(0xabadcafe))).ToBE()) { - case SMR_FAILED: return CELL_EBUSY; - case SMR_ABORT: LOG_WARNING(HLE, "sys_spinlock_trylock(0x%x) aborted", lock.GetAddr()); break; - case SMR_DEADLOCK: LOG_ERROR(HLE, "sys_spinlock_trylock(0x%x) reached deadlock", lock.GetAddr()); break; - default: break; + return CELL_EBUSY; } return CELL_OK; } -void sys_spinlock_unlock(mem_ptr_t lock) +void sys_spinlock_unlock(mem_ptr_t>> lock) { sys_spinlock.Log("sys_spinlock_unlock(lock_addr=0x%x)", lock.GetAddr()); - while(true) - { - if (lock->mutex.unlock(lock->mutex.GetOwner()) != SMR_PERMITTED) - break; - } + // prx: sync and set 0 + *lock = be_t::MakeFromBE(0); } \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spinlock.h b/rpcs3/Emu/SysCalls/lv2/sys_spinlock.h index ed81750400..0dfaa371fc 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spinlock.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_spinlock.h @@ -1,12 +1,7 @@ #pragma once -struct spinlock -{ - SMutexBE mutex; -}; - // SysCalls -void sys_spinlock_initialize(mem_ptr_t lock); -void sys_spinlock_lock(mem_ptr_t lock); -s32 sys_spinlock_trylock(mem_ptr_t lock); -void sys_spinlock_unlock(mem_ptr_t lock); +void sys_spinlock_initialize(mem_ptr_t>> lock); +void sys_spinlock_lock(mem_ptr_t>> lock); +s32 sys_spinlock_trylock(mem_ptr_t>> lock); +void sys_spinlock_unlock(mem_ptr_t>> lock); From 640de8157104ebbd66bd258e0dd4b712f83ab4a3 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 18:42:43 +0400 Subject: [PATCH 09/21] Variadic templates for module logs Two new module log types: Todo() and Notice() --- rpcs3/Emu/SysCalls/Modules.cpp | 54 ---------------- rpcs3/Emu/SysCalls/Modules.h | 65 +++++++++++++++++--- rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 4 +- rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp | 46 +++++++------- rpcs3/Emu/SysCalls/Modules/cellAudio.cpp | 22 +++---- rpcs3/Emu/SysCalls/Modules/cellGame.cpp | 6 +- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 4 +- rpcs3/Emu/SysCalls/Modules/cellPamf.cpp | 8 +-- rpcs3/Emu/SysCalls/Modules/cellResc.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp | 52 ++++++++-------- rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp | 4 +- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 8 +-- rpcs3/Emu/SysCalls/Modules/libmixer.cpp | 14 ++--- rpcs3/Emu/SysCalls/Modules/libsynth2.cpp | 34 +++++----- rpcs3/Emu/SysCalls/SysCalls.h | 2 +- rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp | 12 ++-- rpcs3/Emu/SysCalls/lv2/sys_event.cpp | 8 +-- rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp | 2 +- rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp | 4 +- rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp | 2 +- rpcs3/Emu/SysCalls/lv2/sys_process.cpp | 20 +++--- rpcs3/Emu/SysCalls/lv2/sys_prx.cpp | 44 ++++++------- rpcs3/Emu/SysCalls/lv2/sys_rsx.cpp | 24 ++++---- rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp | 6 +- rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp | 4 +- rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp | 1 + rpcs3/Emu/SysCalls/lv2/sys_spu.cpp | 8 +-- rpcs3/Emu/SysCalls/lv2/sys_timer.cpp | 6 +- 29 files changed, 233 insertions(+), 235 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index b538f37779..4aa50a02fa 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -158,60 +158,6 @@ void Module::SetName(const std::string& name) m_name = name; } -void Module::Log(const u32 id, std::string fmt, ...) -{ - if(Ini.HLELogging.GetValue()) - { - va_list list; - va_start(list, fmt); - LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::FormatV(fmt, list)); - va_end(list); - } -} - -void Module::Log(std::string fmt, ...) -{ - if(Ini.HLELogging.GetValue()) - { - va_list list; - va_start(list, fmt); - LOG_NOTICE(HLE, GetName() + ": " + fmt::FormatV(fmt, list)); - va_end(list); - } -} - -void Module::Warning(const u32 id, std::string fmt, ...) -{ - va_list list; - va_start(list, fmt); - LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::FormatV(fmt, list)); - va_end(list); -} - -void Module::Warning(std::string fmt, ...) -{ - va_list list; - va_start(list, fmt); - LOG_WARNING(HLE, GetName() + " warning: " + fmt::FormatV(fmt, list)); - va_end(list); -} - -void Module::Error(const u32 id, std::string fmt, ...) -{ - va_list list; - va_start(list, fmt); - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::FormatV(fmt, list)); - va_end(list); -} - -void Module::Error(std::string fmt, ...) -{ - va_list list; - va_start(list, fmt); - LOG_ERROR(HLE, GetName() + " error: " + fmt::FormatV(fmt, list)); - va_end(list); -} - bool Module::CheckID(u32 id) const { return Emu.GetIdManager().CheckID(id) && Emu.GetIdManager().GetID(id).m_name == GetName(); diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index 31947f14c0..b65eba3f4c 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -77,15 +77,66 @@ public: void SetName(const std::string& name); public: - //TODO: use variadic function templates here to be able to use string references and forward all arguments without copying - void Log(const u32 id, std::string fmt, ...); - void Log(std::string fmt, ...); + bool IsLogging() + { + return Ini.HLELogging.GetValue(); + } - void Warning(const u32 id, std::string fmt, ...); - void Warning(std::string fmt, ...); + template void Notice(const u32 id, const char* fmt, Targs... args) + { + LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); + } - void Error(const u32 id, std::string fmt, ...); - void Error(std::string fmt, ...); + template void Notice(const char* fmt, Targs... args) + { + LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); + } + + template __forceinline void Log(const char* fmt, Targs... args) + { + if (IsLogging()) + { + Notice(fmt, args...); + } + } + + template __forceinline void Log(const u32 id, const char* fmt, Targs... args) + { + if (IsLogging()) + { + Notice(id, fmt, args...); + } + } + + template void Warning(const u32 id, const char* fmt, Targs... args) + { + LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); + } + + template void Warning(const char* fmt, Targs... args) + { + LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); + } + + template void Error(const u32 id, const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); + } + + template void Error(const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); + } + + template void Todo(const u32 id, const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); + } + + template void Todo(const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); + } bool CheckID(u32 id) const; template bool CheckId(u32 id, T*& data) diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 63caf2f4b1..7a05b506a7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -534,7 +534,7 @@ bool adecCheckType(AudioCodecType type) case CELL_ADEC_TYPE_CELP: case CELL_ADEC_TYPE_M4AAC: case CELL_ADEC_TYPE_CELP8: - cellAdec->Error("Unimplemented audio codec type (%d)", type); + cellAdec->Todo("Unimplemented audio codec type (%d)", type); break; default: return false; @@ -640,7 +640,7 @@ int cellAdecStartSeq(u32 handle, u32 param_addr) } else*/ { - cellAdec->Warning("cellAdecStartSeq: (TODO) initialization"); + cellAdec->Todo("cellAdecStartSeq(): initialization"); } adec->job.Push(task); diff --git a/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp b/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp index ef89f02ab4..fea80fdb1c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp @@ -10,7 +10,7 @@ Module *cellAtrac = nullptr; int cellAtracSetDataAndGetMemSize(mem_ptr_t pHandle, u32 pucBufferAddr, u32 uiReadByte, u32 uiBufferByte, mem32_t puiWorkMemByte) { - cellAtrac->Error("cellAtracSetDataAndGetMemSize(pHandle=0x%x, pucBufferAddr=0x%x, uiReadByte=0x%x, uiBufferByte=0x%x, puiWorkMemByte_addr=0x%x)", + cellAtrac->Todo("cellAtracSetDataAndGetMemSize(pHandle=0x%x, pucBufferAddr=0x%x, uiReadByte=0x%x, uiBufferByte=0x%x, puiWorkMemByte_addr=0x%x)", pHandle.GetAddr(), pucBufferAddr, uiReadByte, uiBufferByte, puiWorkMemByte.GetAddr()); puiWorkMemByte = 0x1000; // unproved @@ -19,7 +19,7 @@ int cellAtracSetDataAndGetMemSize(mem_ptr_t pHandle, u32 pucBuf int cellAtracCreateDecoder(mem_ptr_t pHandle, u32 pucWorkMem_addr, u32 uiPpuThreadPriority, u32 uiSpuThreadPriority) { - cellAtrac->Error("cellAtracCreateDecoder(pHandle=0x%x, pucWorkMem_addr=0x%x, uiPpuThreadPriority=%d, uiSpuThreadPriority=%d)", + cellAtrac->Todo("cellAtracCreateDecoder(pHandle=0x%x, pucWorkMem_addr=0x%x, uiPpuThreadPriority=%d, uiSpuThreadPriority=%d)", pHandle.GetAddr(), pucWorkMem_addr, uiPpuThreadPriority, uiSpuThreadPriority); pHandle->data.pucWorkMem_addr = pucWorkMem_addr; @@ -28,7 +28,7 @@ int cellAtracCreateDecoder(mem_ptr_t pHandle, u32 pucWorkMem_ad int cellAtracCreateDecoderExt(mem_ptr_t pHandle, u32 pucWorkMem_addr, u32 uiPpuThreadPriority, mem_ptr_t pExtRes) { - cellAtrac->Error("cellAtracCreateDecoderExt(pHandle=0x%x, pucWorkMem_addr=0x%x, uiPpuThreadPriority=%d, pExtRes_addr=0x%x)", + cellAtrac->Todo("cellAtracCreateDecoderExt(pHandle=0x%x, pucWorkMem_addr=0x%x, uiPpuThreadPriority=%d, pExtRes_addr=0x%x)", pHandle.GetAddr(), pucWorkMem_addr, uiPpuThreadPriority, pExtRes.GetAddr()); pHandle->data.pucWorkMem_addr = pucWorkMem_addr; @@ -37,13 +37,13 @@ int cellAtracCreateDecoderExt(mem_ptr_t pHandle, u32 pucWorkMem int cellAtracDeleteDecoder(mem_ptr_t pHandle) { - cellAtrac->Error("cellAtracDeleteDecoder(pHandle=0x%x)", pHandle.GetAddr()); + cellAtrac->Todo("cellAtracDeleteDecoder(pHandle=0x%x)", pHandle.GetAddr()); return CELL_OK; } int cellAtracDecode(mem_ptr_t pHandle, u32 pfOutAddr, mem32_t puiSamples, mem32_t puiFinishflag, mem32_t piRemainFrame) { - cellAtrac->Error("cellAtracDecode(pHandle=0x%x, pfOutAddr=0x%x, puiSamples_addr=0x%x, puiFinishFlag_addr=0x%x, piRemainFrame_addr=0x%x)", + cellAtrac->Todo("cellAtracDecode(pHandle=0x%x, pfOutAddr=0x%x, puiSamples_addr=0x%x, puiFinishFlag_addr=0x%x, piRemainFrame_addr=0x%x)", pHandle.GetAddr(), pfOutAddr, puiSamples.GetAddr(), puiFinishflag.GetAddr(), piRemainFrame.GetAddr()); puiSamples = 0; @@ -54,7 +54,7 @@ int cellAtracDecode(mem_ptr_t pHandle, u32 pfOutAddr, mem32_t p int cellAtracGetStreamDataInfo(mem_ptr_t pHandle, mem32_t ppucWritePointer, mem32_t puiWritableByte, mem32_t puiReadPosition) { - cellAtrac->Error("cellAtracGetStreamDataInfo(pHandle=0x%x, ppucWritePointer_addr=0x%x, puiWritableByte_addr=0x%x, puiReadPosition_addr=0x%x)", + cellAtrac->Todo("cellAtracGetStreamDataInfo(pHandle=0x%x, ppucWritePointer_addr=0x%x, puiWritableByte_addr=0x%x, puiReadPosition_addr=0x%x)", pHandle.GetAddr(), ppucWritePointer.GetAddr(), puiWritableByte.GetAddr(), puiReadPosition.GetAddr()); ppucWritePointer = pHandle->data.pucWorkMem_addr; @@ -65,13 +65,13 @@ int cellAtracGetStreamDataInfo(mem_ptr_t pHandle, mem32_t ppucW int cellAtracAddStreamData(mem_ptr_t pHandle, u32 uiAddByte) { - cellAtrac->Error("cellAtracAddStreamData(pHandle=0x%x, uiAddByte=0x%x)", pHandle.GetAddr(), uiAddByte); + cellAtrac->Todo("cellAtracAddStreamData(pHandle=0x%x, uiAddByte=0x%x)", pHandle.GetAddr(), uiAddByte); return CELL_OK; } int cellAtracGetRemainFrame(mem_ptr_t pHandle, mem32_t piRemainFrame) { - cellAtrac->Error("cellAtracGetRemainFrame(pHandle=0x%x, piRemainFrame_addr=0x%x)", pHandle.GetAddr(), piRemainFrame.GetAddr()); + cellAtrac->Todo("cellAtracGetRemainFrame(pHandle=0x%x, piRemainFrame_addr=0x%x)", pHandle.GetAddr(), piRemainFrame.GetAddr()); piRemainFrame = CELL_ATRAC_ALLDATA_IS_ON_MEMORY; return CELL_OK; @@ -79,7 +79,7 @@ int cellAtracGetRemainFrame(mem_ptr_t pHandle, mem32_t piRemain int cellAtracGetVacantSize(mem_ptr_t pHandle, mem32_t puiVacantSize) { - cellAtrac->Error("cellAtracGetVacantSize(pHandle=0x%x, puiVacantSize_addr=0x%x)", pHandle.GetAddr(), puiVacantSize.GetAddr()); + cellAtrac->Todo("cellAtracGetVacantSize(pHandle=0x%x, puiVacantSize_addr=0x%x)", pHandle.GetAddr(), puiVacantSize.GetAddr()); puiVacantSize = 0x1000; return CELL_OK; @@ -87,13 +87,13 @@ int cellAtracGetVacantSize(mem_ptr_t pHandle, mem32_t puiVacant int cellAtracIsSecondBufferNeeded(mem_ptr_t pHandle) { - cellAtrac->Error("cellAtracIsSecondBufferNeeded(pHandle=0x%x)", pHandle.GetAddr()); + cellAtrac->Todo("cellAtracIsSecondBufferNeeded(pHandle=0x%x)", pHandle.GetAddr()); return CELL_OK; } int cellAtracGetSecondBufferInfo(mem_ptr_t pHandle, mem32_t puiReadPosition, mem32_t puiDataByte) { - cellAtrac->Error("cellAtracGetSecondBufferInfo(pHandle=0x%x, puiReadPosition_addr=0x%x, puiDataByte_addr=0x%x)", + cellAtrac->Todo("cellAtracGetSecondBufferInfo(pHandle=0x%x, puiReadPosition_addr=0x%x, puiDataByte_addr=0x%x)", pHandle.GetAddr(), puiReadPosition.GetAddr(), puiDataByte.GetAddr()); puiReadPosition = 0; @@ -103,14 +103,14 @@ int cellAtracGetSecondBufferInfo(mem_ptr_t pHandle, mem32_t pui int cellAtracSetSecondBuffer(mem_ptr_t pHandle, u32 pucSecondBufferAddr, u32 uiSecondBufferByte) { - cellAtrac->Error("cellAtracSetSecondBuffer(pHandle=0x%x, pucSecondBufferAddr=0x%x, uiSecondBufferByte=0x%x)", + cellAtrac->Todo("cellAtracSetSecondBuffer(pHandle=0x%x, pucSecondBufferAddr=0x%x, uiSecondBufferByte=0x%x)", pHandle.GetAddr(), pucSecondBufferAddr, uiSecondBufferByte); return CELL_OK; } int cellAtracGetChannel(mem_ptr_t pHandle, mem32_t puiChannel) { - cellAtrac->Error("cellAtracGetChannel(pHandle=0x%x, puiChannel_addr=0x%x)", pHandle.GetAddr(), puiChannel.GetAddr()); + cellAtrac->Todo("cellAtracGetChannel(pHandle=0x%x, puiChannel_addr=0x%x)", pHandle.GetAddr(), puiChannel.GetAddr()); puiChannel = 2; return CELL_OK; @@ -118,7 +118,7 @@ int cellAtracGetChannel(mem_ptr_t pHandle, mem32_t puiChannel) int cellAtracGetMaxSample(mem_ptr_t pHandle, mem32_t puiMaxSample) { - cellAtrac->Error("cellAtracGetMaxSample(pHandle=0x%x, puiMaxSample_addr=0x%x)", pHandle.GetAddr(), puiMaxSample.GetAddr()); + cellAtrac->Todo("cellAtracGetMaxSample(pHandle=0x%x, puiMaxSample_addr=0x%x)", pHandle.GetAddr(), puiMaxSample.GetAddr()); puiMaxSample = 512; return CELL_OK; @@ -126,7 +126,7 @@ int cellAtracGetMaxSample(mem_ptr_t pHandle, mem32_t puiMaxSamp int cellAtracGetNextSample(mem_ptr_t pHandle, mem32_t puiNextSample) { - cellAtrac->Error("cellAtracGetNextSample(pHandle=0x%x, puiNextSample_addr=0x%x)", pHandle.GetAddr(), puiNextSample.GetAddr()); + cellAtrac->Todo("cellAtracGetNextSample(pHandle=0x%x, puiNextSample_addr=0x%x)", pHandle.GetAddr(), puiNextSample.GetAddr()); puiNextSample = 0; return CELL_OK; @@ -134,7 +134,7 @@ int cellAtracGetNextSample(mem_ptr_t pHandle, mem32_t puiNextSa int cellAtracGetSoundInfo(mem_ptr_t pHandle, mem32_t piEndSample, mem32_t piLoopStartSample, mem32_t piLoopEndSample) { - cellAtrac->Error("cellAtracGetSoundInfo(pHandle=0x%x, piEndSample_addr=0x%x, piLoopStartSample_addr=0x%x, piLoopEndSample_addr=0x%x)", + cellAtrac->Todo("cellAtracGetSoundInfo(pHandle=0x%x, piEndSample_addr=0x%x, piLoopStartSample_addr=0x%x, piLoopEndSample_addr=0x%x)", pHandle.GetAddr(), piEndSample.GetAddr(), piLoopStartSample.GetAddr(), piLoopEndSample.GetAddr()); piEndSample = 0; @@ -145,7 +145,7 @@ int cellAtracGetSoundInfo(mem_ptr_t pHandle, mem32_t piEndSampl int cellAtracGetNextDecodePosition(mem_ptr_t pHandle, mem32_t puiSamplePosition) { - cellAtrac->Error("cellAtracGetNextDecodePosition(pHandle=0x%x, puiSamplePosition_addr=0x%x)", + cellAtrac->Todo("cellAtracGetNextDecodePosition(pHandle=0x%x, puiSamplePosition_addr=0x%x)", pHandle.GetAddr(), puiSamplePosition.GetAddr()); puiSamplePosition = 0; @@ -154,7 +154,7 @@ int cellAtracGetNextDecodePosition(mem_ptr_t pHandle, mem32_t p int cellAtracGetBitrate(mem_ptr_t pHandle, mem32_t puiBitrate) { - cellAtrac->Error("cellAtracGetBitrate(pHandle=0x%x, puiBitrate_addr=0x%x)", + cellAtrac->Todo("cellAtracGetBitrate(pHandle=0x%x, puiBitrate_addr=0x%x)", pHandle.GetAddr(), puiBitrate.GetAddr()); puiBitrate = 128; @@ -163,7 +163,7 @@ int cellAtracGetBitrate(mem_ptr_t pHandle, mem32_t puiBitrate) int cellAtracGetLoopInfo(mem_ptr_t pHandle, mem32_t piLoopNum, mem32_t puiLoopStatus) { - cellAtrac->Error("cellAtracGetLoopInfo(pHandle=0x%x, piLoopNum_addr=0x%x, puiLoopStatus_addr=0x%x)", + cellAtrac->Todo("cellAtracGetLoopInfo(pHandle=0x%x, piLoopNum_addr=0x%x, puiLoopStatus_addr=0x%x)", pHandle.GetAddr(), piLoopNum.GetAddr(), puiLoopStatus.GetAddr()); piLoopNum = 0; @@ -173,13 +173,13 @@ int cellAtracGetLoopInfo(mem_ptr_t pHandle, mem32_t piLoopNum, int cellAtracSetLoopNum(mem_ptr_t pHandle, int iLoopNum) { - cellAtrac->Error("cellAtracSetLoopNum(pHandle=0x%x, iLoopNum=0x%x)", pHandle.GetAddr(), iLoopNum); + cellAtrac->Todo("cellAtracSetLoopNum(pHandle=0x%x, iLoopNum=0x%x)", pHandle.GetAddr(), iLoopNum); return CELL_OK; } int cellAtracGetBufferInfoForResetting(mem_ptr_t pHandle, u32 uiSample, mem_ptr_t pBufferInfo) { - cellAtrac->Error("cellAtracGetBufferInfoForResetting(pHandle=0x%x, uiSample=0x%x, pBufferInfo_addr=0x%x)", + cellAtrac->Todo("cellAtracGetBufferInfoForResetting(pHandle=0x%x, uiSample=0x%x, pBufferInfo_addr=0x%x)", pHandle.GetAddr(), uiSample, pBufferInfo.GetAddr()); pBufferInfo->pucWriteAddr = pHandle->data.pucWorkMem_addr; @@ -191,14 +191,14 @@ int cellAtracGetBufferInfoForResetting(mem_ptr_t pHandle, u32 u int cellAtracResetPlayPosition(mem_ptr_t pHandle, u32 uiSample, u32 uiWriteByte) { - cellAtrac->Error("cellAtracResetPlayPosition(pHandle=0x%x, uiSample=0x%x, uiWriteByte=0x%x)", + cellAtrac->Todo("cellAtracResetPlayPosition(pHandle=0x%x, uiSample=0x%x, uiWriteByte=0x%x)", pHandle.GetAddr(), uiSample, uiWriteByte); return CELL_OK; } int cellAtracGetInternalErrorInfo(mem_ptr_t pHandle, mem32_t piResult) { - cellAtrac->Error("cellAtracGetInternalErrorInfo(pHandle=0x%x, piResult_addr=0x%x)", + cellAtrac->Todo("cellAtracGetInternalErrorInfo(pHandle=0x%x, piResult_addr=0x%x)", pHandle.GetAddr(), piResult.GetAddr()); piResult = 0; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp index 8a275aed96..5461ac3134 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp @@ -736,7 +736,7 @@ int cellAudioGetPortBlockTag(u32 portNum, u64 blockNo, mem64_t tag) int cellAudioSetPortLevel(u32 portNum, float level) { - cellAudio->Error("cellAudioSetPortLevel(portNum=0x%x, level=%f)", portNum, level); + cellAudio->Todo("cellAudioSetPortLevel(portNum=0x%x, level=%f)", portNum, level); return CELL_OK; } @@ -771,7 +771,7 @@ int cellAudioCreateNotifyEventQueue(mem32_t id, mem64_t key) int cellAudioCreateNotifyEventQueueEx(mem32_t id, mem64_t key, u32 iFlags) { - cellAudio->Error("cellAudioCreateNotifyEventQueueEx(id_addr=0x%x, key_addr=0x%x, iFlags=0x%x)", id.GetAddr(), key.GetAddr(), iFlags); + cellAudio->Todo("cellAudioCreateNotifyEventQueueEx(id_addr=0x%x, key_addr=0x%x, iFlags=0x%x)", id.GetAddr(), key.GetAddr(), iFlags); return CELL_OK; } @@ -803,7 +803,7 @@ int cellAudioSetNotifyEventQueue(u64 key) int cellAudioSetNotifyEventQueueEx(u64 key, u32 iFlags) { - cellAudio->Error("cellAudioSetNotifyEventQueueEx(key=0x%llx, iFlags=0x%x)", key, iFlags); + cellAudio->Todo("cellAudioSetNotifyEventQueueEx(key=0x%llx, iFlags=0x%x)", key, iFlags); return CELL_OK; } @@ -843,49 +843,49 @@ int cellAudioRemoveNotifyEventQueue(u64 key) int cellAudioRemoveNotifyEventQueueEx(u64 key, u32 iFlags) { - cellAudio->Error("cellAudioRemoveNotifyEventQueueEx(key=0x%llx, iFlags=0x%x)", key, iFlags); + cellAudio->Todo("cellAudioRemoveNotifyEventQueueEx(key=0x%llx, iFlags=0x%x)", key, iFlags); return CELL_OK; } int cellAudioAddData(u32 portNum, mem32_t src, u32 samples, float volume) { - cellAudio->Error("cellAudioAddData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.GetAddr(), samples, volume); + cellAudio->Todo("cellAudioAddData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.GetAddr(), samples, volume); return CELL_OK; } int cellAudioAdd2chData(u32 portNum, mem32_t src, u32 samples, float volume) { - cellAudio->Error("cellAudioAdd2chData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.GetAddr(), samples, volume); + cellAudio->Todo("cellAudioAdd2chData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.GetAddr(), samples, volume); return CELL_OK; } int cellAudioAdd6chData(u32 portNum, mem32_t src, float volume) { - cellAudio->Error("cellAudioAdd6chData(portNum=0x%x, src_addr=0x%x, volume=%f)", portNum, src.GetAddr(), volume); + cellAudio->Todo("cellAudioAdd6chData(portNum=0x%x, src_addr=0x%x, volume=%f)", portNum, src.GetAddr(), volume); return CELL_OK; } int cellAudioMiscSetAccessoryVolume(u32 devNum, float volume) { - cellAudio->Error("cellAudioMiscSetAccessoryVolume(devNum=0x%x, volume=%f)", devNum, volume); + cellAudio->Todo("cellAudioMiscSetAccessoryVolume(devNum=0x%x, volume=%f)", devNum, volume); return CELL_OK; } int cellAudioSendAck(u64 data3) { - cellAudio->Error("cellAudioSendAck(data3=0x%llx)", data3); + cellAudio->Todo("cellAudioSendAck(data3=0x%llx)", data3); return CELL_OK; } int cellAudioSetPersonalDevice(int iPersonalStream, int iDevice) { - cellAudio->Error("cellAudioSetPersonalDevice(iPersonalStream=0x%x, iDevice=0x%x)", iPersonalStream, iDevice); + cellAudio->Todo("cellAudioSetPersonalDevice(iPersonalStream=0x%x, iDevice=0x%x)", iPersonalStream, iDevice); return CELL_OK; } int cellAudioUnsetPersonalDevice(int iPersonalStream) { - cellAudio->Error("cellAudioUnsetPersonalDevice(iPersonalStream=0x%x)", iPersonalStream); + cellAudio->Todo("cellAudioUnsetPersonalDevice(iPersonalStream=0x%x)", iPersonalStream); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index 1022906f7d..3b1cbf3b04 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -221,7 +221,7 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t dirName, u32 if (!Emu.GetVFS().ExistsDir(dir)) { - cellGame->Error("cellGameDataCheckCreate2(): TODO: creating directory '%s'", dir.c_str()); + cellGame->Todo("cellGameDataCheckCreate2(): creating directory '%s'", dir.c_str()); // TODO: create data return CELL_GAMEDATA_RET_OK; } @@ -275,7 +275,7 @@ int cellGameDataCheckCreate2(u32 version, const mem_list_ptr_t dirName, u32 if (cbSet->setParam.GetAddr()) { // TODO: write PARAM.SFO from cbSet - cellGame->Error("cellGameDataCheckCreate2(): TODO: writing PARAM.SFO parameters (addr=0x%x)", cbSet->setParam.GetAddr()); + cellGame->Todo("cellGameDataCheckCreate2(): writing PARAM.SFO parameters (addr=0x%x)", cbSet->setParam.GetAddr()); } switch ((s32)cbResult->result) @@ -318,7 +318,7 @@ int cellGameDataCheckCreate(u32 version, const mem_list_ptr_t dirName, u32 e int cellGameCreateGameData(mem_ptr_t init, mem_list_ptr_t tmp_contentInfoPath, mem_list_ptr_t tmp_usrdirPath) { - cellGame->Error("cellGameCreateGameData(init_addr=0x%x, tmp_contentInfoPath_addr=0x%x, tmp_usrdirPath_addr=0x%x)", + cellGame->Todo("cellGameCreateGameData(init_addr=0x%x, tmp_contentInfoPath_addr=0x%x, tmp_usrdirPath_addr=0x%x)", init.GetAddr(), tmp_contentInfoPath.GetAddr(), tmp_usrdirPath.GetAddr()); // TODO: create temporary game directory, set initial PARAM.SFO parameters diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 9ebe134f35..efb723c3b8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -612,7 +612,7 @@ int cellGcmSetWaitFlip(mem_ptr_t ctxt) int cellGcmSetZcull(u8 index, u32 offset, u32 width, u32 height, u32 cullStart, u32 zFormat, u32 aaFormat, u32 zCullDir, u32 zCullFormat, u32 sFunc, u32 sRef, u32 sMask) { - cellGcmSys->Warning("TODO: cellGcmSetZcull(index=%d, offset=0x%x, width=%d, height=%d, cullStart=0x%x, zFormat=0x%x, aaFormat=0x%x, zCullDir=0x%x, zCullFormat=0x%x, sFunc=0x%x, sRef=0x%x, sMask=0x%x)", + cellGcmSys->Todo("cellGcmSetZcull(index=%d, offset=0x%x, width=%d, height=%d, cullStart=0x%x, zFormat=0x%x, aaFormat=0x%x, zCullDir=0x%x, zCullFormat=0x%x, sFunc=0x%x, sRef=0x%x, sMask=0x%x)", index, offset, width, height, cullStart, zFormat, aaFormat, zCullDir, zCullFormat, sFunc, sRef, sMask); if (index >= RSXThread::m_zculls_count) @@ -1096,7 +1096,7 @@ int cellGcmSetFlipCommand(u32 ctx, u32 id) s64 cellGcmFunc15() { - cellGcmSys->Error("cellGcmFunc15()"); + cellGcmSys->Todo("cellGcmFunc15()"); return 0; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp b/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp index b71d83ba35..f7b32751f1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp @@ -621,7 +621,7 @@ int cellPamfReaderGetNumberOfEp(mem_ptr_t pSelf) int cellPamfReaderGetEpIteratorWithIndex(mem_ptr_t pSelf, u32 epIndex, mem_ptr_t pIt) { - cellPamf->Error("cellPamfReaderGetEpIteratorWithIndex(pSelf=0x%x, stream=%d, epIndex=%d, pIt_addr=0x%x)", pSelf.GetAddr(), pSelf->stream, epIndex, pIt.GetAddr()); + cellPamf->Todo("cellPamfReaderGetEpIteratorWithIndex(pSelf=0x%x, stream=%d, epIndex=%d, pIt_addr=0x%x)", pSelf.GetAddr(), pSelf->stream, epIndex, pIt.GetAddr()); if (!pSelf.IsGood() || !Memory.IsGoodAddr(pSelf->pAddr)) { @@ -636,7 +636,7 @@ int cellPamfReaderGetEpIteratorWithIndex(mem_ptr_t pSelf, u32 ep int cellPamfReaderGetEpIteratorWithTimeStamp(mem_ptr_t pSelf, mem_ptr_t pTimeStamp, mem_ptr_t pIt) { - cellPamf->Error("cellPamfReaderGetEpIteratorWithTimeStamp(pSelf=0x%x, pTimeStamp_addr=0x%x, pIt_addr=0x%x)", pSelf.GetAddr(), pTimeStamp.GetAddr(), pIt.GetAddr()); + cellPamf->Todo("cellPamfReaderGetEpIteratorWithTimeStamp(pSelf=0x%x, pTimeStamp_addr=0x%x, pIt_addr=0x%x)", pSelf.GetAddr(), pTimeStamp.GetAddr(), pIt.GetAddr()); const mem_ptr_t pAddr(pSelf->pAddr); @@ -647,7 +647,7 @@ int cellPamfReaderGetEpIteratorWithTimeStamp(mem_ptr_t pSelf, me int cellPamfEpIteratorGetEp(mem_ptr_t pIt, mem_ptr_t pEp) { - cellPamf->Error("cellPamfEpIteratorGetEp(pIt_addr=0x%x, pEp_addr=0x%x)", pIt.GetAddr(), pEp.GetAddr()); + cellPamf->Todo("cellPamfEpIteratorGetEp(pIt_addr=0x%x, pEp_addr=0x%x)", pIt.GetAddr(), pEp.GetAddr()); //TODO: @@ -656,7 +656,7 @@ int cellPamfEpIteratorGetEp(mem_ptr_t pIt, mem_ptr_t pIt, s32 steps, mem_ptr_t pEp) { - cellPamf->Error("cellPamfEpIteratorMove(pIt_addr=0x%x, steps=%d, pEp_addr=0x%x)", pIt.GetAddr(), steps, pEp.GetAddr()); + cellPamf->Todo("cellPamfEpIteratorMove(pIt_addr=0x%x, steps=%d, pEp_addr=0x%x)", pIt.GetAddr(), steps, pEp.GetAddr()); //TODO: diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index 3d5da159b7..bf073c0439 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -659,7 +659,7 @@ void cellRescExit() if (!s_rescInternalInstance->m_bInitialized) { - cellResc->Error("cellRescExit()"); + cellResc->Error("cellRescExit(): not initialized"); return; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index 122c0ff1ff..f60b770a34 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -167,7 +167,7 @@ int cellSpursAttributeSetNamePrefix(mem_ptr_t attr, const me int cellSpursAttributeEnableSpuPrintfIfAvailable(mem_ptr_t attr) { - cellSpurs->Error("cellSpursAttributeEnableSpuPrintfIfAvailable(attr_addr=0x%x)", attr.GetAddr()); + cellSpurs->Todo("cellSpursAttributeEnableSpuPrintfIfAvailable(attr_addr=0x%x)", attr.GetAddr()); if (attr.GetAddr() % 8 != 0) { @@ -208,7 +208,7 @@ int cellSpursAttributeSetSpuThreadGroupType(mem_ptr_t attr, int cellSpursAttributeEnableSystemWorkload(mem_ptr_t attr, const u8 priority[CELL_SPURS_MAX_SPU], u32 maxSpu, const bool isPreemptible[CELL_SPURS_MAX_SPU]) { - cellSpurs->Error("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority[%u], maxSpu=%u, isPreemptible[%u])", attr.GetAddr(), priority, maxSpu, isPreemptible); + cellSpurs->Todo("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority[%u], maxSpu=%u, isPreemptible[%u])", attr.GetAddr(), priority, maxSpu, isPreemptible); if (attr.GetAddr() % 8 != 0) { @@ -235,7 +235,7 @@ int cellSpursAttributeEnableSystemWorkload(mem_ptr_t attr, c int cellSpursGetSpuThreadGroupId(mem_ptr_t spurs, mem32_t group) { - cellSpurs->Error("cellSpursGetSpuThreadGroupId(spurs_addr=0x%x, group_addr=0x%x)", spurs.GetAddr(), group.GetAddr()); + cellSpurs->Todo("cellSpursGetSpuThreadGroupId(spurs_addr=0x%x, group_addr=0x%x)", spurs.GetAddr(), group.GetAddr()); if (spurs.GetAddr() % 128 != 0) { @@ -254,7 +254,7 @@ int cellSpursGetSpuThreadGroupId(mem_ptr_t spurs, mem32_t group) int cellSpursGetNumSpuThread(mem_ptr_t spurs, mem32_t nThreads) { - cellSpurs->Error("cellSpursGetNumSpuThread(spurs_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), nThreads.GetAddr()); + cellSpurs->Todo("cellSpursGetNumSpuThread(spurs_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), nThreads.GetAddr()); if (spurs.GetAddr() % 128 != 0) { @@ -273,7 +273,7 @@ int cellSpursGetNumSpuThread(mem_ptr_t spurs, mem32_t nThreads) int cellSpursGetSpuThreadId(mem_ptr_t spurs, mem32_t thread, mem32_t nThreads) { - cellSpurs->Error("cellSpursGetSpuThreadId(spurs_addr=0x%x, thread_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), thread.GetAddr(), nThreads.GetAddr()); + cellSpurs->Todo("cellSpursGetSpuThreadId(spurs_addr=0x%x, thread_addr=0x%x, nThreads_addr=0x%x)", spurs.GetAddr(), thread.GetAddr(), nThreads.GetAddr()); if (spurs.GetAddr() % 128 != 0) { @@ -292,7 +292,7 @@ int cellSpursGetSpuThreadId(mem_ptr_t spurs, mem32_t thread, mem32_t int cellSpursSetMaxContention(mem_ptr_t spurs, u32 workloadId, u32 maxContention) { - cellSpurs->Error("cellSpursSetMaxContention(spurs_addr=0x%x, workloadId=%u, maxContention=%u)", spurs.GetAddr(), workloadId, maxContention); + cellSpurs->Todo("cellSpursSetMaxContention(spurs_addr=0x%x, workloadId=%u, maxContention=%u)", spurs.GetAddr(), workloadId, maxContention); if (spurs.GetAddr() % 128 != 0) { @@ -311,7 +311,7 @@ int cellSpursSetMaxContention(mem_ptr_t spurs, u32 workloadId, u32 ma int cellSpursSetPriorities(mem_ptr_t spurs, u32 workloadId, const u8 priorities[CELL_SPURS_MAX_SPU]) { - cellSpurs->Error("cellSpursSetPriorities(spurs_addr=0x%x, workloadId=%u, priorities[%u])", spurs.GetAddr(), workloadId, priorities); + cellSpurs->Todo("cellSpursSetPriorities(spurs_addr=0x%x, workloadId=%u, priorities[%u])", spurs.GetAddr(), workloadId, priorities); if (spurs.GetAddr() % 128 != 0) { @@ -330,7 +330,7 @@ int cellSpursSetPriorities(mem_ptr_t spurs, u32 workloadId, const u8 int cellSpursSetPriority(mem_ptr_t spurs, u32 workloadId, u32 spuId, u32 priority) { - cellSpurs->Error("cellSpursSetPriority(spurs_addr=0x%x, workloadId=%u, spuId=%u, priority=%u)", spurs.GetAddr(), workloadId, spuId, priority); + cellSpurs->Todo("cellSpursSetPriority(spurs_addr=0x%x, workloadId=%u, spuId=%u, priority=%u)", spurs.GetAddr(), workloadId, spuId, priority); if (spurs.GetAddr() % 128 != 0) { @@ -349,7 +349,7 @@ int cellSpursSetPriority(mem_ptr_t spurs, u32 workloadId, u32 spuId, int cellSpursSetPreemptionVictimHints(mem_ptr_t spurs, const bool isPreemptible[CELL_SPURS_MAX_SPU]) { - cellSpurs->Error("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible[%u])", spurs.GetAddr(), isPreemptible); + cellSpurs->Todo("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible[%u])", spurs.GetAddr(), isPreemptible); if (spurs.GetAddr() % 128 != 0) { @@ -410,7 +410,7 @@ int cellSpursDetachLv2EventQueue(mem_ptr_t spurs, u8 port) int cellSpursEnableExceptionEventHandler(mem_ptr_t spurs, bool flag) { - cellSpurs->Error("cellSpursEnableExceptionEventHandler(spurs_addr=0x%x, flag=%u)", spurs.GetAddr(), flag); + cellSpurs->Todo("cellSpursEnableExceptionEventHandler(spurs_addr=0x%x, flag=%u)", spurs.GetAddr(), flag); if (spurs.GetAddr() % 128 != 0) { @@ -429,7 +429,7 @@ int cellSpursEnableExceptionEventHandler(mem_ptr_t spurs, bool flag) int cellSpursSetGlobalExceptionEventHandler(mem_ptr_t spurs, mem_func_ptr_t eaHandler, mem_ptr_t arg) { - cellSpurs->Error("cellSpursSetGlobalExceptionEventHandler(spurs_addr=0x%x, eaHandler_addr=0x%x, arg_addr=0x%x,)", spurs.GetAddr(), eaHandler.GetAddr(), arg.GetAddr()); + cellSpurs->Todo("cellSpursSetGlobalExceptionEventHandler(spurs_addr=0x%x, eaHandler_addr=0x%x, arg_addr=0x%x,)", spurs.GetAddr(), eaHandler.GetAddr(), arg.GetAddr()); if (spurs.GetAddr() % 128 != 0) { @@ -448,7 +448,7 @@ int cellSpursSetGlobalExceptionEventHandler(mem_ptr_t spurs, mem_func int cellSpursUnsetGlobalExceptionEventHandler(mem_ptr_t spurs) { - cellSpurs->Error("cellSpursUnsetGlobalExceptionEventHandler(spurs_addr=0x%x)", spurs.GetAddr()); + cellSpurs->Todo("cellSpursUnsetGlobalExceptionEventHandler(spurs_addr=0x%x)", spurs.GetAddr()); if (spurs.GetAddr() % 128 != 0) { @@ -467,7 +467,7 @@ int cellSpursUnsetGlobalExceptionEventHandler(mem_ptr_t spurs) int cellSpursGetInfo(mem_ptr_t spurs, mem_ptr_t info) { - cellSpurs->Error("cellSpursGetInfo(spurs_addr=0x%x, info_addr=0x%x)", spurs.GetAddr(), info.GetAddr()); + cellSpurs->Todo("cellSpursGetInfo(spurs_addr=0x%x, info_addr=0x%x)", spurs.GetAddr(), info.GetAddr()); if (spurs.GetAddr() % 128 != 0) { @@ -507,7 +507,7 @@ int _cellSpursEventFlagInitialize(mem_ptr_t spurs, mem_ptr_t eventFlag) { - cellSpurs->Error("cellSpursEventFlagAttachLv2EventQueue(eventFlag_addr=0x%x)", eventFlag.GetAddr()); + cellSpurs->Todo("cellSpursEventFlagAttachLv2EventQueue(eventFlag_addr=0x%x)", eventFlag.GetAddr()); if (eventFlag.GetAddr() % 128 != 0) { @@ -526,7 +526,7 @@ int cellSpursEventFlagAttachLv2EventQueue(mem_ptr_t eventFla int cellSpursEventFlagDetachLv2EventQueue(mem_ptr_t eventFlag) { - cellSpurs->Error("cellSpursEventFlagDetachLv2EventQueue(eventFlag_addr=0x%x)", eventFlag.GetAddr()); + cellSpurs->Todo("cellSpursEventFlagDetachLv2EventQueue(eventFlag_addr=0x%x)", eventFlag.GetAddr()); if (eventFlag.GetAddr() % 128 != 0) { @@ -545,7 +545,7 @@ int cellSpursEventFlagDetachLv2EventQueue(mem_ptr_t eventFla int cellSpursEventFlagWait(mem_ptr_t eventFlag, mem16_t mask, u32 mode) { - cellSpurs->Error("cellSpursEventFlagWait(eventFlag_addr=0x%x, mask=0x%x, mode=%u)", eventFlag.GetAddr(), mask.GetAddr(), mode); + cellSpurs->Todo("cellSpursEventFlagWait(eventFlag_addr=0x%x, mask=0x%x, mode=%u)", eventFlag.GetAddr(), mask.GetAddr(), mode); if (eventFlag.GetAddr() % 128 != 0) { @@ -564,7 +564,7 @@ int cellSpursEventFlagWait(mem_ptr_t eventFlag, mem16_t mask int cellSpursEventFlagClear(mem_ptr_t eventFlag, u16 bits) { - cellSpurs->Error("cellSpursEventFlagClear(eventFlag_addr=0x%x, bits=%u)", eventFlag.GetAddr(), bits); + cellSpurs->Todo("cellSpursEventFlagClear(eventFlag_addr=0x%x, bits=%u)", eventFlag.GetAddr(), bits); if (eventFlag.GetAddr() % 128 != 0) { @@ -583,7 +583,7 @@ int cellSpursEventFlagClear(mem_ptr_t eventFlag, u16 bits) int cellSpursEventFlagSet(mem_ptr_t eventFlag, u16 bits) { - cellSpurs->Error("cellSpursEventFlagSet(eventFlag_addr=0x%x, bits=%u)", eventFlag.GetAddr(), bits); + cellSpurs->Todo("cellSpursEventFlagSet(eventFlag_addr=0x%x, bits=%u)", eventFlag.GetAddr(), bits); if (eventFlag.GetAddr() % 128 != 0) { @@ -602,7 +602,7 @@ int cellSpursEventFlagSet(mem_ptr_t eventFlag, u16 bits) int cellSpursEventFlagTryWait(mem_ptr_t eventFlag, mem16_t mask, u32 mode) { - cellSpurs->Error("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, mask_addr=0x%x, mode=%u)", eventFlag.GetAddr(), mask.GetAddr(), mode); + cellSpurs->Todo("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, mask_addr=0x%x, mode=%u)", eventFlag.GetAddr(), mask.GetAddr(), mode); if (eventFlag.GetAddr() % 128 != 0) { @@ -663,7 +663,7 @@ int cellSpursEventFlagGetClearMode(mem_ptr_t eventFlag, mem3 int cellSpursEventFlagGetTasksetAddress(mem_ptr_t eventFlag, mem_ptr_t taskset) { - cellSpurs->Error("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, taskset_addr=0x%x)", eventFlag.GetAddr(), taskset.GetAddr()); + cellSpurs->Todo("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, taskset_addr=0x%x)", eventFlag.GetAddr(), taskset.GetAddr()); if (eventFlag.GetAddr() % 128 != 0) { @@ -944,7 +944,7 @@ int cellSpursCreateTasksetWithAttribute() int cellSpursCreateTaskset(mem_ptr_t spurs, mem_ptr_t taskset, u64 args, mem8_t priority, u32 maxContention) { - cellSpurs->Error("cellSpursCreateTaskset(spurs_addr=0x%x, taskset_addr=0x%x, args=0x%x, priority_addr=0x%x, maxContention=%u)", spurs.GetAddr(), taskset.GetAddr(), args, priority.GetAddr(), maxContention); + cellSpurs->Todo("cellSpursCreateTaskset(spurs_addr=0x%x, taskset_addr=0x%x, args=0x%x, priority_addr=0x%x, maxContention=%u)", spurs.GetAddr(), taskset.GetAddr(), args, priority.GetAddr(), maxContention); if ((spurs.GetAddr() % 128 != 0) || (taskset.GetAddr() % 128 != 0)) { @@ -966,7 +966,7 @@ int cellSpursCreateTaskset(mem_ptr_t spurs, mem_ptr_t taskset) { - cellSpurs->Error("cellSpursJoinTaskset(taskset_addr=0x%x)", taskset.GetAddr()); + cellSpurs->Todo("cellSpursJoinTaskset(taskset_addr=0x%x)", taskset.GetAddr()); if (taskset.GetAddr() % 128 != 0) { @@ -985,7 +985,7 @@ int cellSpursJoinTaskset(mem_ptr_t taskset) int cellSpursGetTasksetId(mem_ptr_t taskset, mem32_t workloadId) { - cellSpurs->Error("cellSpursGetTasksetId(taskset_addr=0x%x, workloadId_addr=0x%x)", taskset.GetAddr(), workloadId.GetAddr()); + cellSpurs->Todo("cellSpursGetTasksetId(taskset_addr=0x%x, workloadId_addr=0x%x)", taskset.GetAddr(), workloadId.GetAddr()); if (taskset.GetAddr() % 128 != 0) { @@ -1004,7 +1004,7 @@ int cellSpursGetTasksetId(mem_ptr_t taskset, mem32_t workloadI int cellSpursShutdownTaskset(mem_ptr_t taskset) { - cellSpurs->Error("cellSpursShutdownTaskset(taskset_addr=0x%x)", taskset.GetAddr()); + cellSpurs->Todo("cellSpursShutdownTaskset(taskset_addr=0x%x)", taskset.GetAddr()); if (taskset.GetAddr() % 128 != 0) { @@ -1025,7 +1025,7 @@ int cellSpursCreateTask(mem_ptr_t taskset, mem32_t taskID, mem mem_ptr_t context_addr, u32 context_size, mem_ptr_t lsPattern, mem_ptr_t argument) { - cellSpurs->Error("cellSpursCreateTask(taskset_addr=0x%x, taskID_addr=0x%x, elf_addr_addr=0x%x, context_addr_addr=0x%x, context_size=%u, lsPattern_addr=0x%x, argument_addr=0x%x)", + cellSpurs->Todo("cellSpursCreateTask(taskset_addr=0x%x, taskID_addr=0x%x, elf_addr_addr=0x%x, context_addr_addr=0x%x, context_size=%u, lsPattern_addr=0x%x, argument_addr=0x%x)", taskset.GetAddr(), taskID.GetAddr(), elf_addr.GetAddr(), context_addr.GetAddr(), context_size, lsPattern.GetAddr(), argument.GetAddr()); if (taskset.GetAddr() % 128 != 0) @@ -1045,7 +1045,7 @@ int cellSpursCreateTask(mem_ptr_t taskset, mem32_t taskID, mem int _cellSpursSendSignal(mem_ptr_t taskset, u32 taskID) { - cellSpurs->Error("_cellSpursSendSignal(taskset_addr=0x%x, taskID=%u)", taskset.GetAddr(), taskID); + cellSpurs->Todo("_cellSpursSendSignal(taskset_addr=0x%x, taskID=%u)", taskset.GetAddr(), taskID); if (taskset.GetAddr() % 128 != 0) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp index 4e0f949544..c470d28e36 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp @@ -156,7 +156,7 @@ int cellSysmoduleFinalize() int cellSysmoduleSetMemcontainer(u32 ct_id) { - cellSysmodule->Warning("TODO: cellSysmoduleSetMemcontainer(ct_id=0x%x)", ct_id); + cellSysmodule->Todo("cellSysmoduleSetMemcontainer(ct_id=0x%x)", ct_id); return CELL_OK; } @@ -164,7 +164,7 @@ int cellSysmoduleLoadModule(u16 id) { if (id == 0xf054) { - cellSysmodule->Error("cellSysmoduleLoadModule: TODO: CELL_SYSMODULE_LIBATRAC3MULTI"); + cellSysmodule->Todo("cellSysmoduleLoadModule: CELL_SYSMODULE_LIBATRAC3MULTI"); } cellSysmodule->Warning("cellSysmoduleLoadModule(%s)", getModuleName(id)); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 9d6512de52..aae129c92a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -575,7 +575,7 @@ int cellAudioOutGetNumberOfDevice(u32 audioOut) int cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, mem_ptr_t info) { - cellSysutil->Error("Unimplemented function: cellAudioOutGetDeviceInfo(audioOut=%u, deviceIndex=%u, info_addr=0x%x)", + cellSysutil->Todo("Unimplemented function: cellAudioOutGetDeviceInfo(audioOut=%u, deviceIndex=%u, info_addr=0x%x)", audioOut, deviceIndex, info.GetAddr()); if(deviceIndex) return CELL_AUDIO_OUT_ERROR_DEVICE_NOT_FOUND; diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index f2dcf61696..98365a1923 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -108,8 +108,8 @@ u32 vdecQueryAttr(CellVdecCodecType type, u32 profile, u32 spec_addr /* may be 0 switch (type) // TODO: check profile levels { case CELL_VDEC_CODEC_TYPE_AVC: cellVdec->Warning("cellVdecQueryAttr: AVC (profile=%d)", profile); break; - case CELL_VDEC_CODEC_TYPE_MPEG2: cellVdec->Error("TODO: MPEG2 not supported"); break; - case CELL_VDEC_CODEC_TYPE_DIVX: cellVdec->Error("TODO: DIVX not supported"); break; + case CELL_VDEC_CODEC_TYPE_MPEG2: cellVdec->Todo("MPEG2 not supported"); break; + case CELL_VDEC_CODEC_TYPE_DIVX: cellVdec->Todo("DIVX not supported"); break; default: return CELL_VDEC_ERROR_ARG; } @@ -620,13 +620,13 @@ int cellVdecGetPicture(u32 handle, const mem_ptr_t format, u3 if (format->formatType != CELL_VDEC_PICFMT_YUV420_PLANAR) { - cellVdec->Error("cellVdecGetPicture: TODO: unknown formatType(%d)", (u32)format->formatType); + cellVdec->Todo("cellVdecGetPicture: unknown formatType(%d)", (u32)format->formatType); return CELL_OK; } if (format->colorMatrixType != CELL_VDEC_COLOR_MATRIX_TYPE_BT709) { - cellVdec->Error("cellVdecGetPicture: TODO: unknown colorMatrixType(%d)", (u32)format->colorMatrixType); + cellVdec->Todo("cellVdecGetPicture: unknown colorMatrixType(%d)", (u32)format->colorMatrixType); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp index 00204a718b..3303469eb4 100644 --- a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp @@ -532,7 +532,7 @@ int cellSurMixerStart() int cellSurMixerSetParameter(u32 param, float value) { declCPU(); - libmixer->Error("cellSurMixerSetParameter(param=0x%x, value=%f, FPR[1]=%f, FPR[2]=%f)", param, value, (float&)CPU.FPR[1], (float&)CPU.FPR[2]); + libmixer->Todo("cellSurMixerSetParameter(param=0x%x, value=%f, FPR[1]=%f, FPR[2]=%f)", param, value, (float&)CPU.FPR[1], (float&)CPU.FPR[2]); return CELL_OK; } @@ -560,7 +560,7 @@ int cellSurMixerSurBusAddData(u32 busNo, u32 offset, u32 addr, u32 samples) } else { - libmixer->Error("cellSurMixerSurBusAddData(busNo=%d, offset=0x%x, addr=0x%x, samples=%d): unknown parameters", busNo, offset, addr, samples); + libmixer->Todo("cellSurMixerSurBusAddData(busNo=%d, offset=0x%x, addr=0x%x, samples=%d)", busNo, offset, addr, samples); return CELL_OK; } @@ -578,7 +578,7 @@ int cellSurMixerSurBusAddData(u32 busNo, u32 offset, u32 addr, u32 samples) int cellSurMixerChStripSetParameter(u32 type, u32 index, mem_ptr_t param) { - libmixer->Error("cellSurMixerChStripSetParameter(type=%d, index=%d, param_addr=0x%x)", type, index, param.GetAddr()); + libmixer->Todo("cellSurMixerChStripSetParameter(type=%d, index=%d, param_addr=0x%x)", type, index, param.GetAddr()); return CELL_OK; } @@ -614,14 +614,14 @@ int cellSurMixerGetTimestamp(u64 tag, mem64_t stamp) void cellSurMixerBeep(u32 arg) { - libmixer->Error("cellSurMixerBeep(arg=%d)", arg); + libmixer->Todo("cellSurMixerBeep(arg=%d)", arg); return; } void cellSurMixerUtilGetLevelFromDB(float dB) { // not hooked, probably unnecessary - libmixer->Error("cellSurMixerUtilGetLevelFromDB(dB=%f)", dB); + libmixer->Todo("cellSurMixerUtilGetLevelFromDB(dB=%f)", dB); declCPU(); (float&)CPU.FPR[0] = 0.0f; } @@ -629,7 +629,7 @@ void cellSurMixerUtilGetLevelFromDB(float dB) void cellSurMixerUtilGetLevelFromDBIndex(int index) { // not hooked, probably unnecessary - libmixer->Error("cellSurMixerUtilGetLevelFromDBIndex(index=%d)", index); + libmixer->Todo("cellSurMixerUtilGetLevelFromDBIndex(index=%d)", index); declCPU(); (float&)CPU.FPR[0] = 0.0f; } @@ -637,7 +637,7 @@ void cellSurMixerUtilGetLevelFromDBIndex(int index) void cellSurMixerUtilNoteToRatio(u8 refNote, u8 note) { // not hooked, probably unnecessary - libmixer->Error("cellSurMixerUtilNoteToRatio(refNote=%d, note=%d)", refNote, note); + libmixer->Todo("cellSurMixerUtilNoteToRatio(refNote=%d, note=%d)", refNote, note); declCPU(); (float&)CPU.FPR[0] = 0.0f; } diff --git a/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp b/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp index 0a6642efe1..340d586e24 100644 --- a/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp @@ -10,103 +10,103 @@ Module libsynth2("libsynth2", libsynth2_init); int cellSoundSynth2Config(s16 param, int value) { - libsynth2.Error("cellSoundSynth2Config(param=%d, value=%d)", param, value); + libsynth2.Todo("cellSoundSynth2Config(param=%d, value=%d)", param, value); return CELL_OK; } int cellSoundSynth2Init(s16 flag) { - libsynth2.Error("cellSoundSynth2Init(flag=%d)", flag); + libsynth2.Todo("cellSoundSynth2Init(flag=%d)", flag); return CELL_OK; } int cellSoundSynth2Exit() { - libsynth2.Error("cellSoundSynth2Exit()"); + libsynth2.Todo("cellSoundSynth2Exit()"); return CELL_OK; } void cellSoundSynth2SetParam(u16 reg, u16 value) { - libsynth2.Error("cellSoundSynth2SetParam(register=0x%x, value=0x%x)", reg, value); + libsynth2.Todo("cellSoundSynth2SetParam(register=0x%x, value=0x%x)", reg, value); } u16 cellSoundSynth2GetParam(u16 reg) { - libsynth2.Error("cellSoundSynth2GetParam(register=0x%x) -> 0", reg); + libsynth2.Todo("cellSoundSynth2GetParam(register=0x%x) -> 0", reg); return 0; } void cellSoundSynth2SetSwitch(u16 reg, u32 value) { - libsynth2.Error("cellSoundSynth2SetSwitch(register=0x%x, value=0x%x)", reg, value); + libsynth2.Todo("cellSoundSynth2SetSwitch(register=0x%x, value=0x%x)", reg, value); } u32 cellSoundSynth2GetSwitch(u16 reg) { - libsynth2.Error("cellSoundSynth2GetSwitch(register=0x%x) -> 0", reg); + libsynth2.Todo("cellSoundSynth2GetSwitch(register=0x%x) -> 0", reg); return 0; } int cellSoundSynth2SetAddr(u16 reg, u32 value) { - libsynth2.Error("cellSoundSynth2SetAddr(register=0x%x, value=0x%x)", reg, value); + libsynth2.Todo("cellSoundSynth2SetAddr(register=0x%x, value=0x%x)", reg, value); return CELL_OK; } u32 cellSoundSynth2GetAddr(u16 reg) { - libsynth2.Error("cellSoundSynth2GetAddr(register=0x%x) -> 0", reg); + libsynth2.Todo("cellSoundSynth2GetAddr(register=0x%x) -> 0", reg); return 0; } int cellSoundSynth2SetEffectAttr(s16 bus, mem_ptr_t attr) { - libsynth2.Error("cellSoundSynth2SetEffectAttr(bus=%d, attr_addr=0x%x)", bus, attr.GetAddr()); + libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr_addr=0x%x)", bus, attr.GetAddr()); return CELL_OK; } int cellSoundSynth2SetEffectMode(s16 bus, mem_ptr_t attr) { - libsynth2.Error("cellSoundSynth2SetEffectMode(bus=%d, attr_addr=0x%x)", bus, attr.GetAddr()); + libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr_addr=0x%x)", bus, attr.GetAddr()); return CELL_OK; } void cellSoundSynth2SetCoreAttr(u16 entry, u16 value) { - libsynth2.Error("cellSoundSynth2SetCoreAttr(entry=0x%x, value=0x%x)", entry, value); + libsynth2.Todo("cellSoundSynth2SetCoreAttr(entry=0x%x, value=0x%x)", entry, value); } int cellSoundSynth2Generate(u16 samples, u32 L_addr, u32 R_addr, u32 Lr_addr, u32 Rr_addr) { - libsynth2.Error("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)", + libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)", samples, L_addr, R_addr, Lr_addr, Rr_addr); return CELL_OK; } int cellSoundSynth2VoiceTrans(s16 channel, u16 mode, u32 mem_side_addr, u32 lib_side_addr, u32 size) { - libsynth2.Error("cellSoundSynth2VoiceTrans(channel=%d, mode=0x%x, m_addr=0x%x, s_addr=0x%x, size=0x%x)", + libsynth2.Todo("cellSoundSynth2VoiceTrans(channel=%d, mode=0x%x, m_addr=0x%x, s_addr=0x%x, size=0x%x)", channel, mode, mem_side_addr, lib_side_addr, size); return CELL_OK; } int cellSoundSynth2VoiceTransStatus(s16 channel, s16 flag) { - libsynth2.Error("cellSoundSynth2VoiceTransStatus(channel=%d, flag=%d)", channel, flag); + libsynth2.Todo("cellSoundSynth2VoiceTransStatus(channel=%d, flag=%d)", channel, flag); return CELL_OK; } u16 cellSoundSynth2Note2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine) { - libsynth2.Error("cellSoundSynth2Note2Pitch(center_note=0x%x, center_fine=0x%x, note=0x%x, fine=%d) -> 0", + libsynth2.Todo("cellSoundSynth2Note2Pitch(center_note=0x%x, center_fine=0x%x, note=0x%x, fine=%d) -> 0", center_note, center_fine, note, fine); return 0; } u16 cellSoundSynth2Pitch2Note(u16 center_note, u16 center_fine, u16 pitch) { - libsynth2.Error("cellSoundSynth2Pitch2Note(center_note=0x%x, center_fine=0x%x, pitch=0x%x) -> 0", + libsynth2.Todo("cellSoundSynth2Pitch2Note(center_note=0x%x, center_fine=0x%x, pitch=0x%x) -> 0", center_note, center_fine, pitch); return 0; } diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index ff34ff8d2f..00c3a6c903 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -143,7 +143,7 @@ public: extern int cellGcmCallback(u32 context_addr, u32 count); -#define UNIMPLEMENTED_FUNC(module) module->Error("Unimplemented function: %s", __FUNCTION__) +#define UNIMPLEMENTED_FUNC(module) module->Todo("%s", __FUNCTION__) #define SC_ARG_0 CPU.GPR[3] #define SC_ARG_1 CPU.GPR[4] diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index b62df5b512..fb1ffe58f0 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -620,7 +620,7 @@ s32 cellFsStReadGetRegid(u32 fd, mem64_t regid) s32 cellFsStReadStart(u32 fd, u64 offset, u64 size) { - sys_fs->Warning("TODO: cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size); + sys_fs->Todo("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size); vfsStream* file; if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH; @@ -645,7 +645,7 @@ s32 cellFsStReadStop(u32 fd) s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize) { - sys_fs->Warning("TODO: cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.GetAddr()); + sys_fs->Todo("cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.GetAddr()); vfsStream* file; if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH; @@ -660,7 +660,7 @@ s32 cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize) s32 cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size) { - sys_fs->Warning("TODO: cellFsStReadGetCurrentAddr(fd=%d, addr_addr=0x%x, size_addr = 0x%x)", fd, addr_addr.GetAddr(), size.GetAddr()); + sys_fs->Todo("cellFsStReadGetCurrentAddr(fd=%d, addr_addr=0x%x, size_addr = 0x%x)", fd, addr_addr.GetAddr(), size.GetAddr()); vfsStream* file; if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH; @@ -672,7 +672,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size) s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size) { - sys_fs->Warning("TODO: cellFsStReadPutCurrentAddr(fd=%d, addr_addr=0x%x, size = 0x%llx)", fd, addr_addr, size); + sys_fs->Todo("cellFsStReadPutCurrentAddr(fd=%d, addr_addr=0x%x, size = 0x%llx)", fd, addr_addr, size); vfsStream* file; if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH; @@ -684,7 +684,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size) s32 cellFsStReadWait(u32 fd, u64 size) { - sys_fs->Warning("TODO: cellFsStReadWait(fd=%d, size = 0x%llx)", fd, size); + sys_fs->Todo("cellFsStReadWait(fd=%d, size = 0x%llx)", fd, size); vfsStream* file; if(!sys_fs->CheckId(fd, file)) return CELL_ESRCH; @@ -694,7 +694,7 @@ s32 cellFsStReadWait(u32 fd, u64 size) s32 cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t func) { - sys_fs->Warning("TODO: cellFsStReadWaitCallback(fd=%d, size = 0x%llx, func_addr = 0x%x)", fd, size, func.GetAddr()); + sys_fs->Todo("cellFsStReadWaitCallback(fd=%d, size = 0x%llx, func_addr = 0x%x)", fd, size, func.GetAddr()); if (!func.IsGood()) return CELL_EFAULT; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_event.cpp b/rpcs3/Emu/SysCalls/lv2/sys_event.cpp index 20f8c98bf6..a80ef7ecc2 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_event.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_event.cpp @@ -66,7 +66,7 @@ s32 sys_event_queue_create(mem32_t equeue_id, mem_ptr_t at s32 sys_event_queue_destroy(u32 equeue_id, int mode) { - sys_event.Error("sys_event_queue_destroy(equeue_id=%d, mode=0x%x)", equeue_id, mode); + sys_event.Todo("sys_event_queue_destroy(equeue_id=%d, mode=0x%x)", equeue_id, mode); EventQueue* eq; if (!Emu.GetIdManager().GetIDData(equeue_id, eq)) @@ -111,7 +111,7 @@ s32 sys_event_queue_destroy(u32 equeue_id, int mode) s32 sys_event_queue_tryreceive(u32 equeue_id, mem_ptr_t event_array, int size, mem32_t number) { - sys_event.Error("sys_event_queue_tryreceive(equeue_id=%d, event_array_addr=0x%x, size=%d, number_addr=0x%x)", + sys_event.Todo("sys_event_queue_tryreceive(equeue_id=%d, event_array_addr=0x%x, size=%d, number_addr=0x%x)", equeue_id, event_array.GetAddr(), size, number.GetAddr()); if (size < 0 || !number.IsGood()) @@ -403,8 +403,8 @@ s32 sys_event_flag_create(mem32_t eflag_id, mem_ptr_t attr, switch (attr->protocol.ToBE()) { case se32(SYS_SYNC_PRIORITY): break; - case se32(SYS_SYNC_RETRY): sys_event.Warning("TODO: SYS_SYNC_RETRY attr"); break; - case se32(SYS_SYNC_PRIORITY_INHERIT): sys_event.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT attr"); break; + case se32(SYS_SYNC_RETRY): sys_event.Todo("sys_event_flag_create(): SYS_SYNC_RETRY"); break; + case se32(SYS_SYNC_PRIORITY_INHERIT): sys_event.Todo("sys_event_flag_create(): SYS_SYNC_PRIORITY_INHERIT"); break; case se32(SYS_SYNC_FIFO): break; default: return CELL_EINVAL; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp b/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp index 065f5cd4de..4fd7715ee5 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_interrupt.cpp @@ -83,7 +83,7 @@ s32 sys_interrupt_thread_establish(mem32_t ih, u32 intrtag, u64 intrthread, u64 s32 sys_interrupt_thread_disestablish(u32 ih) { - sc_int.Error("sys_interrupt_thread_disestablish(ih=%d)", ih); + sc_int.Todo("sys_interrupt_thread_disestablish(ih=%d)", ih); CPUThread* it = Emu.GetCPU().GetThread(ih); if (!it) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp b/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp index ab5b870efc..13a0304f7c 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp @@ -22,8 +22,8 @@ s32 sys_mutex_create(mem32_t mutex_id, mem_ptr_t attr) { case se32(SYS_SYNC_FIFO): break; case se32(SYS_SYNC_PRIORITY): break; - case se32(SYS_SYNC_PRIORITY_INHERIT): sys_mtx.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT protocol"); break; - case se32(SYS_SYNC_RETRY): sys_mtx.Error("Invalid SYS_SYNC_RETRY protocol"); return CELL_EINVAL; + case se32(SYS_SYNC_PRIORITY_INHERIT): sys_mtx.Todo("sys_mutex_create(): SYS_SYNC_PRIORITY_INHERIT"); break; + case se32(SYS_SYNC_RETRY): sys_mtx.Error("sys_mutex_create(): SYS_SYNC_RETRY"); return CELL_EINVAL; default: sys_mtx.Error("Unknown protocol attribute(0x%x)", (u32)attr->protocol); return CELL_EINVAL; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp index a991acc993..28e37ce590 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_ppu_thread.cpp @@ -72,7 +72,7 @@ s32 sys_ppu_thread_join(u64 thread_id, mem64_t vptr) s32 sys_ppu_thread_detach(u64 thread_id) { - sysPrxForUser->Error("sys_ppu_thread_detach(thread_id=%lld)", thread_id); + sysPrxForUser->Todo("sys_ppu_thread_detach(thread_id=%lld)", thread_id); CPUThread* thr = Emu.GetCPU().GetThread(thread_id); if(!thr) return CELL_ESRCH; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp index 7ea71a6d9a..a6e6ba3982 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_process.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_process.cpp @@ -17,7 +17,7 @@ s32 sys_process_getpid() s32 sys_process_getppid() { - sc_p.Warning("TODO: sys_process_getppid() returns 0"); + sc_p.Todo("sys_process_getppid() -> 0"); return 0; } @@ -46,7 +46,7 @@ void sys_game_process_exitspawn( u32 prio, u64 flags ) { - sc_p.Error("sys_game_process_exitspawn UNIMPLEMENTED"); + sc_p.Todo("sys_game_process_exitspawn()"); sc_p.Warning("path: %s", Memory.ReadString(path_addr).c_str()); sc_p.Warning("argv: 0x%x", argv_addr); sc_p.Warning("envp: 0x%x", envp_addr); @@ -94,7 +94,7 @@ void sys_game_process_exitspawn2( u32 prio, u64 flags) { - sc_p.Error("sys_game_process_exitspawn2 UNIMPLEMENTED"); + sc_p.Todo("sys_game_process_exitspawn2"); sc_p.Warning("path: %s", Memory.ReadString(path_addr).c_str()); sc_p.Warning("argv: 0x%x", argv_addr); sc_p.Warning("envp: 0x%x", envp_addr); @@ -170,7 +170,7 @@ s32 sys_process_get_number_of_object(u32 object, mem32_t nump) s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_size) { - sc_p.Warning("TODO: sys_process_get_id(object=%d, buffer_addr=0x%x, size=%d, set_size_addr=0x%x)", + sc_p.Todo("sys_process_get_id(object=%d, buffer_addr=0x%x, size=%d, set_size_addr=0x%x)", object, buffer.GetAddr(), size, set_size.GetAddr()); switch(object) @@ -213,7 +213,7 @@ s32 sys_process_get_id(u32 object, mem32_ptr_t buffer, u32 size, mem32_t set_siz s32 sys_process_get_paramsfo(mem8_ptr_t buffer) { - sc_p.Warning("TODO: sys_process_get_paramsfo(buffer_addr=0x%x) returns CELL_ENOENT", buffer.GetAddr()); + sc_p.Todo("sys_process_get_paramsfo(buffer_addr=0x%x) -> CELL_ENOENT", buffer.GetAddr()); return CELL_ENOENT; /*//Before uncommenting this code, we should check if it is actually working. @@ -243,33 +243,33 @@ s32 sys_process_get_sdk_version(u32 pid, mem32_t version) s32 sys_process_kill(u32 pid) { - sc_p.Error("TODO: sys_process_kill(pid=%d)", pid); + sc_p.Todo("sys_process_kill(pid=%d)", pid); return CELL_OK; } s32 sys_process_wait_for_child(u32 pid, mem32_t status, u64 unk) { - sc_p.Error("TODO: sys_process_wait_for_child(pid=%d, status_addr=0x%x, unk=0x%llx", + sc_p.Todo("sys_process_wait_for_child(pid=%d, status_addr=0x%x, unk=0x%llx", pid, status.GetAddr(), unk); return CELL_OK; } s32 sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u64 unk5, u64 unk6) { - sc_p.Error("TODO: sys_process_wait_for_child2(unk1=0x%llx, unk2=0x%llx, unk3=0x%llx, unk4=0x%llx, unk5=0x%llx, unk6=0x%llx)", + sc_p.Todo("sys_process_wait_for_child2(unk1=0x%llx, unk2=0x%llx, unk3=0x%llx, unk4=0x%llx, unk5=0x%llx, unk6=0x%llx)", unk1, unk2, unk3, unk4, unk5, unk6); return CELL_OK; } s32 sys_process_get_status(u64 unk) { - sc_p.Error("TODO: sys_process_get_status(unk=0x%llx)", unk); + sc_p.Todo("sys_process_get_status(unk=0x%llx)", unk); //Memory.Write32(CPU.GPR[4], GetPPUThreadStatus(CPU)); return CELL_OK; } s32 sys_process_detach_child(u64 unk) { - sc_p.Error("TODO: sys_process_detach_child(unk=0x%llx)", unk); + sc_p.Todo("sys_process_detach_child(unk=0x%llx)", unk); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp b/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp index fccdee285f..595e6ea1e1 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp @@ -14,7 +14,7 @@ s32 sys_prx_load_module(u32 path_addr, u64 flags, mem_ptr_t pOpt) { - sys_prx.Error("TODO: sys_prx_start_module(id=%d, args=%d, argp_addr=0x%x, modres_addr=0x%x, flags=0x%llx, pOpt=0x%x)", + sys_prx.Todo("sys_prx_start_module(id=%d, args=%d, argp_addr=0x%x, modres_addr=0x%x, flags=0x%llx, pOpt=0x%x)", id, args, argp_addr, modres.GetAddr(), flags, pOpt.GetAddr()); if (!modres.IsGood()) @@ -70,7 +70,7 @@ s32 sys_prx_start_module(s32 id, u32 args, u32 argp_addr, mem32_t modres, u64 fl s32 sys_prx_stop_module(s32 id, u32 args, u32 argp_addr, mem32_t modres, u64 flags, mem_ptr_t pOpt) { - sys_prx.Error("TODO: sys_prx_stop_module(id=%d, args=%d, argp_addr=0x%x, modres_addr=0x%x, flags=0x%llx, pOpt=0x%x)", + sys_prx.Todo("sys_prx_stop_module(id=%d, args=%d, argp_addr=0x%x, modres_addr=0x%x, flags=0x%llx, pOpt=0x%x)", id, args, argp_addr, modres.GetAddr(), flags, pOpt.GetAddr()); if (!modres.IsGood()) @@ -88,7 +88,7 @@ s32 sys_prx_stop_module(s32 id, u32 args, u32 argp_addr, mem32_t modres, u64 fla s32 sys_prx_unload_module(s32 id, u64 flags, mem_ptr_t pOpt) { - sys_prx.Error("TODO: sys_prx_unload_module(id=%d, flags=0x%llx, pOpt=0x%x)", id, flags, pOpt.GetAddr()); + sys_prx.Todo("sys_prx_unload_module(id=%d, flags=0x%llx, pOpt=0x%x)", id, flags, pOpt.GetAddr()); // Get the PRX, free the used memory and delete the object and its ID sys_prx_t* prx; @@ -102,90 +102,90 @@ s32 sys_prx_unload_module(s32 id, u64 flags, mem_ptr_t attr switch (attr->attr_protocol.ToBE()) { - case se(attr->attr_protocol, SYS_SYNC_PRIORITY): sys_rwlock.Warning("TODO: SYS_SYNC_PRIORITY attr"); break; - case se(attr->attr_protocol, SYS_SYNC_RETRY): sys_rwlock.Error("Invalid SYS_SYNC_RETRY attr"); break; - case se(attr->attr_protocol, SYS_SYNC_PRIORITY_INHERIT): sys_rwlock.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT attr"); break; + case se(attr->attr_protocol, SYS_SYNC_PRIORITY): sys_rwlock.Todo("SYS_SYNC_PRIORITY"); break; + case se(attr->attr_protocol, SYS_SYNC_RETRY): sys_rwlock.Error("SYS_SYNC_RETRY"); return CELL_EINVAL; + case se(attr->attr_protocol, SYS_SYNC_PRIORITY_INHERIT): sys_rwlock.Todo("SYS_SYNC_PRIORITY_INHERIT"); break; case se(attr->attr_protocol, SYS_SYNC_FIFO): break; default: return CELL_EINVAL; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp b/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp index 161f0945c0..aa0b82116a 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_semaphore.cpp @@ -35,8 +35,8 @@ s32 sys_semaphore_create(mem32_t sem, mem_ptr_t attr, i { case se32(SYS_SYNC_FIFO): break; case se32(SYS_SYNC_PRIORITY): break; - case se32(SYS_SYNC_PRIORITY_INHERIT): sys_sem.Warning("TODO: SYS_SYNC_PRIORITY_INHERIT protocol"); break; - case se32(SYS_SYNC_RETRY): sys_sem.Error("Invalid SYS_SYNC_RETRY protocol"); return CELL_EINVAL; + case se32(SYS_SYNC_PRIORITY_INHERIT): sys_sem.Todo("SYS_SYNC_PRIORITY_INHERIT"); break; + case se32(SYS_SYNC_RETRY): sys_sem.Error("SYS_SYNC_RETRY"); return CELL_EINVAL; default: sys_sem.Error("Unknown protocol attribute(0x%x)", (u32)attr->protocol); return CELL_EINVAL; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp index 358b234f37..26462efd71 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spinlock.cpp @@ -26,6 +26,7 @@ void sys_spinlock_lock(mem_ptr_t>> lock) { while (lock->load(std::memory_order_relaxed).ToBE()) { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack if (Emu.IsStopped()) { break; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index 68303a28a4..7c2c740868 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -356,7 +356,7 @@ s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status) s32 sys_spu_thread_create(mem32_t thread_id, mem32_t entry, u64 arg, int prio, u32 stacksize, u64 flags, u32 threadname_addr) { - sc_spu.Error("sys_spu_thread_create(thread_id_addr=0x%x, entry_addr=0x%x, arg=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname_addr=0x%x", + sc_spu.Todo("sys_spu_thread_create(thread_id_addr=0x%x, entry_addr=0x%x, arg=0x%llx, prio=%d, stacksize=0x%x, flags=0x%llx, threadname_addr=0x%x", thread_id.GetAddr(), entry.GetAddr(), arg, prio, stacksize, flags, threadname_addr); return CELL_OK; } @@ -524,14 +524,14 @@ s32 sys_spu_thread_write_snr(u32 id, u32 number, u32 value) s32 sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et) { - sc_spu.Error("sys_spu_thread_group_connect_event(id=%d, eq=%d, et=0x%x)", id, eq, et); + sc_spu.Todo("sys_spu_thread_group_connect_event(id=%d, eq=%d, et=0x%x)", id, eq, et); return CELL_OK; } s32 sys_spu_thread_group_disconnect_event(u32 id, u32 et) { - sc_spu.Error("sys_spu_thread_group_disconnect_event(id=%d, et=0x%x)", id, et); + sc_spu.Todo("sys_spu_thread_group_disconnect_event(id=%d, et=0x%x)", id, et); return CELL_OK; } @@ -762,7 +762,7 @@ s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, m s32 sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup) { - sc_spu.Error("sys_spu_thread_group_disconnect_event_all_threads(id=%d, spup=%d)", id, spup); + sc_spu.Todo("sys_spu_thread_group_disconnect_event_all_threads(id=%d, spup=%d)", id, spup); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_timer.cpp b/rpcs3/Emu/SysCalls/lv2/sys_timer.cpp index 3aa176e46a..f1c7271d64 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_timer.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_timer.cpp @@ -20,7 +20,7 @@ s32 sys_timer_create(mem32_t timer_id) s32 sys_timer_destroy(u32 timer_id) { - sys_timer.Warning("TODO: sys_timer_destroy(timer_id=%d)", timer_id); + sys_timer.Todo("sys_timer_destroy(timer_id=%d)", timer_id); if(!sys_timer.CheckId(timer_id)) return CELL_ESRCH; @@ -65,7 +65,7 @@ s32 sys_timer_start(u32 timer_id, s64 base_time, u64 period) s32 sys_timer_stop(u32 timer_id) { - sys_timer.Warning("TODO: sys_timer_stop()"); + sys_timer.Todo("sys_timer_stop()"); timer* timer_data = nullptr; if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH; @@ -91,7 +91,7 @@ s32 sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data s32 sys_timer_disconnect_event_queue(u32 timer_id) { - sys_timer.Warning("TODO: sys_timer_disconnect_event_queue(timer_id=%d)", timer_id); + sys_timer.Todo("sys_timer_disconnect_event_queue(timer_id=%d)", timer_id); timer* timer_data = nullptr; if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH; From 0865fca90a7cc279cf8d98bdfdad2caa8cbb6ac0 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 18:49:56 +0400 Subject: [PATCH 10/21] Fix for SysCallBase --- rpcs3/Emu/SysCalls/SysCalls.h | 75 ++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 00c3a6c903..66d07cfd45 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -64,62 +64,65 @@ public: const std::string& GetName() const { return m_module_name; } - void Log(const u32 id, std::string fmt, ...) + bool IsLogging() { - if(Ini.HLELogging.GetValue()) + return Ini.HLELogging.GetValue(); + } + + template void Notice(const u32 id, const char* fmt, Targs... args) + { + LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); + } + + template void Notice(const char* fmt, Targs... args) + { + LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); + } + + template __forceinline void Log(const char* fmt, Targs... args) + { + if (IsLogging()) { - va_list list; - va_start(list, fmt); - LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::FormatV(fmt, list)); - va_end(list); + Notice(fmt, args...); } } - void Log(std::string fmt, ...) + template __forceinline void Log(const u32 id, const char* fmt, Targs... args) { - if(Ini.HLELogging.GetValue()) + if (IsLogging()) { - va_list list; - va_start(list, fmt); - LOG_NOTICE(HLE, GetName() + ": " + fmt::FormatV(fmt, list)); - va_end(list); + Notice(id, fmt, args...); } } - void Warning(const u32 id, std::string fmt, ...) + template void Warning(const u32 id, const char* fmt, Targs... args) { -//#ifdef SYSCALLS_DEBUG - va_list list; - va_start(list, fmt); - LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::FormatV(fmt, list)); - va_end(list); -//#endif + LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); } - void Warning(std::string fmt, ...) + template void Warning(const char* fmt, Targs... args) { -//#ifdef SYSCALLS_DEBUG - va_list list; - va_start(list, fmt); - LOG_WARNING(HLE, GetName() + " warning: " + fmt::FormatV(fmt, list)); - va_end(list); -//#endif + LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); } - void Error(const u32 id, std::string fmt, ...) + template void Error(const u32 id, const char* fmt, Targs... args) { - va_list list; - va_start(list, fmt); - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::FormatV(fmt, list)); - va_end(list); + LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); } - void Error(std::string fmt, ...) + template void Error(const char* fmt, Targs... args) { - va_list list; - va_start(list, fmt); - LOG_ERROR(HLE, GetName() + " error: " + fmt::FormatV(fmt, list)); - va_end(list); + LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); + } + + template void Todo(const u32 id, const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); + } + + template void Todo(const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); } bool CheckId(u32 id) const From 5c84ad30a199b59950bebf16c3985d169c932ac5 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 19:58:03 +0400 Subject: [PATCH 11/21] LogBase class for both SysCallBase and Module --- rpcs3/Emu/SysCalls/LogBase.h | 75 +++++++++++++++++++++++++ rpcs3/Emu/SysCalls/Modules.cpp | 2 +- rpcs3/Emu/SysCalls/Modules.h | 66 +--------------------- rpcs3/Emu/SysCalls/Modules/libmixer.cpp | 6 +- rpcs3/Emu/SysCalls/SysCalls.h | 69 ++--------------------- rpcs3/emucore.vcxproj | 1 + rpcs3/emucore.vcxproj.filters | 3 + 7 files changed, 90 insertions(+), 132 deletions(-) create mode 100644 rpcs3/Emu/SysCalls/LogBase.h diff --git a/rpcs3/Emu/SysCalls/LogBase.h b/rpcs3/Emu/SysCalls/LogBase.h new file mode 100644 index 0000000000..9be179baec --- /dev/null +++ b/rpcs3/Emu/SysCalls/LogBase.h @@ -0,0 +1,75 @@ +#pragma once + +class LogBase +{ + bool m_logging; + +public: + LogBase() + : m_logging(false) + { + } + + void SetLogging(bool value) + { + m_logging = value; + } + + virtual const std::string& GetName() const = 0; + + template void Notice(const u32 id, const char* fmt, Targs... args) + { + LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); + } + + template void Notice(const char* fmt, Targs... args) + { + LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); + } + + template __forceinline void Log(const char* fmt, Targs... args) + { + if (m_logging) + { + Notice(fmt, args...); + } + } + + template __forceinline void Log(const u32 id, const char* fmt, Targs... args) + { + if (m_logging) + { + Notice(id, fmt, args...); + } + } + + template void Warning(const u32 id, const char* fmt, Targs... args) + { + LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); + } + + template void Warning(const char* fmt, Targs... args) + { + LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); + } + + template void Error(const u32 id, const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); + } + + template void Error(const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); + } + + template void Todo(const u32 id, const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); + } + + template void Todo(const char* fmt, Targs... args) + { + LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); + } +}; \ No newline at end of file diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index 4aa50a02fa..78b5d4ba8d 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -148,7 +148,7 @@ u16 Module::GetID() const return m_id; } -std::string Module::GetName() const +const std::string& Module::GetName() const { return m_name; } diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index b65eba3f4c..a7835db354 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -1,6 +1,7 @@ #pragma once #include "Emu/SysCalls/SC_FUNC.h" +#include "LogBase.h" //TODO struct ModuleFunc @@ -41,7 +42,7 @@ struct SFunc } }; -class Module +class Module : public LogBase { std::string m_name; u16 m_id; @@ -73,71 +74,10 @@ public: bool IsLoaded() const; u16 GetID() const; - std::string GetName() const; + virtual const std::string& GetName() const override; void SetName(const std::string& name); public: - bool IsLogging() - { - return Ini.HLELogging.GetValue(); - } - - template void Notice(const u32 id, const char* fmt, Targs... args) - { - LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); - } - - template void Notice(const char* fmt, Targs... args) - { - LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); - } - - template __forceinline void Log(const char* fmt, Targs... args) - { - if (IsLogging()) - { - Notice(fmt, args...); - } - } - - template __forceinline void Log(const u32 id, const char* fmt, Targs... args) - { - if (IsLogging()) - { - Notice(id, fmt, args...); - } - } - - template void Warning(const u32 id, const char* fmt, Targs... args) - { - LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); - } - - template void Warning(const char* fmt, Targs... args) - { - LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); - } - - template void Error(const u32 id, const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); - } - - template void Error(const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); - } - - template void Todo(const u32 id, const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); - } - - template void Todo(const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); - } - bool CheckID(u32 id) const; template bool CheckId(u32 id, T*& data) { diff --git a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp index 3303469eb4..81fe2a7ab7 100644 --- a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp @@ -1206,7 +1206,7 @@ void libmixer_init() 0xf000000048000000 // b ); - REG_SUB_EMPTY(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDB); - REG_SUB_EMPTY(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDBIndex); - REG_SUB_EMPTY(libmixer, "surmxUti", cellSurMixerUtilNoteToRatio); + REG_SUB(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDB, 0); + REG_SUB(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDBIndex, 0); + REG_SUB(libmixer, "surmxUti", cellSurMixerUtilNoteToRatio, 0); } diff --git a/rpcs3/Emu/SysCalls/SysCalls.h b/rpcs3/Emu/SysCalls/SysCalls.h index 66d07cfd45..61629ba897 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.h +++ b/rpcs3/Emu/SysCalls/SysCalls.h @@ -30,6 +30,7 @@ #include "Emu/Event.h" #include "rpcs3/Ini.h" +#include "LogBase.h" //#define SYSCALLS_DEBUG @@ -49,7 +50,7 @@ namespace detail{ template<> bool CheckId(u32 id, ID*& _id,const std::string &name); } -class SysCallBase //Module +class SysCallBase : public LogBase { private: std::string m_module_name; @@ -62,67 +63,9 @@ public: { } - const std::string& GetName() const { return m_module_name; } - - bool IsLogging() + virtual const std::string& GetName() const override { - return Ini.HLELogging.GetValue(); - } - - template void Notice(const u32 id, const char* fmt, Targs... args) - { - LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); - } - - template void Notice(const char* fmt, Targs... args) - { - LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); - } - - template __forceinline void Log(const char* fmt, Targs... args) - { - if (IsLogging()) - { - Notice(fmt, args...); - } - } - - template __forceinline void Log(const u32 id, const char* fmt, Targs... args) - { - if (IsLogging()) - { - Notice(id, fmt, args...); - } - } - - template void Warning(const u32 id, const char* fmt, Targs... args) - { - LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); - } - - template void Warning(const char* fmt, Targs... args) - { - LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); - } - - template void Error(const u32 id, const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); - } - - template void Error(const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); - } - - template void Todo(const u32 id, const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); - } - - template void Todo(const char* fmt, Targs... args) - { - LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); + return m_module_name; } bool CheckId(u32 id) const @@ -190,7 +133,3 @@ public: #define REG_SUB(module, group, name, ...) \ static const u64 name ## _table[] = {__VA_ARGS__ , 0}; \ module->AddFuncSub(group, name ## _table, #name, name) - -#define REG_SUB_EMPTY(module, group, name,...) \ - static const u64 name ## _table[] = {0}; \ - module->AddFuncSub(group, name ## _table, #name, name) diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 2ee34fa688..0465079533 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -315,6 +315,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 446d1a2613..11ce9c141d 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -1093,5 +1093,8 @@ Emu\SysCalls\Modules + + Emu\SysCalls + \ No newline at end of file From e3fbfc4bda38a5b341bdc5a28fe024933f747465 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 20:39:00 +0400 Subject: [PATCH 12/21] Logging option restored --- rpcs3/Emu/SysCalls/LogBase.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/SysCalls/LogBase.h b/rpcs3/Emu/SysCalls/LogBase.h index 9be179baec..3c583aa8e6 100644 --- a/rpcs3/Emu/SysCalls/LogBase.h +++ b/rpcs3/Emu/SysCalls/LogBase.h @@ -5,16 +5,22 @@ class LogBase bool m_logging; public: - LogBase() - : m_logging(false) - { - } - void SetLogging(bool value) { m_logging = value; } + bool GetLogging() + { + //return m_logging; // TODO + return Ini.HLELogging.GetValue(); + } + + LogBase() + { + SetLogging(false); + } + virtual const std::string& GetName() const = 0; template void Notice(const u32 id, const char* fmt, Targs... args) @@ -29,7 +35,7 @@ public: template __forceinline void Log(const char* fmt, Targs... args) { - if (m_logging) + if (GetLogging()) { Notice(fmt, args...); } @@ -37,7 +43,7 @@ public: template __forceinline void Log(const u32 id, const char* fmt, Targs... args) { - if (m_logging) + if (GetLogging()) { Notice(id, fmt, args...); } From fa5311718eb700a641bfbdf896cbfd83e2c46c98 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 22:35:44 +0400 Subject: [PATCH 13/21] Small SPU cleanup --- rpcs3/Emu/CPU/CPUThread.h | 2 +- rpcs3/Emu/Cell/MFC.h | 230 ------------------------------------- rpcs3/Emu/Cell/SPUThread.h | 94 +++++---------- 3 files changed, 30 insertions(+), 296 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index c7db9d1c0d..343f992d8f 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -12,7 +12,7 @@ struct reservation_struct // std::mutex doesn't work because it probably wakes up waiting threads in the most unwanted order // and doesn't give a chance to finish some work before losing the reservation u32 owner; // id of thread that got reservation - u32 addr; + u64 addr; u32 size; u32 data32; u64 data64; diff --git a/rpcs3/Emu/Cell/MFC.h b/rpcs3/Emu/Cell/MFC.h index f85e4eb9b3..9f93ce6104 100644 --- a/rpcs3/Emu/Cell/MFC.h +++ b/rpcs3/Emu/Cell/MFC.h @@ -60,237 +60,7 @@ enum MFC_SPU_MAX_QUEUE_SPACE = 0x10, }; -/*struct DMAC_Queue -{ - bool is_valid; - u64 ea; - u32 lsa; - u16 size; - u32 op; - u8 tag; - u8 rt; - u16 list_addr; - u16 list_size; - u32 dep_state; - u32 cmd; - u32 dep_type; -}; - -struct DMAC_Proxy -{ - u64 ea; - u32 lsa; - u16 size; - u32 op; - u8 tag; - u8 rt; - u16 list_addr; - u16 list_size; - u32 dep_state; - u32 cmd; - u32 dep_type; -}; - -template -class SPUReg -{ - u64 m_addr; - u32 m_pos; - -public: - static const size_t max_count = _max_count; - static const size_t size = max_count * 4; - - SPUReg() - { - Init(); - } - - void Init() - { - m_pos = 0; - } - - void SetAddr(u64 addr) - { - m_addr = addr; - } - - u64 GetAddr() const - { - return m_addr; - } - - __forceinline bool Pop(u32& res) - { - if(!m_pos) return false; - res = Memory.Read32(m_addr + m_pos--); - return true; - } - - __forceinline bool Push(u32 value) - { - if(m_pos >= max_count) return false; - Memory.Write32(m_addr + m_pos++, value); - return true; - } - - u32 GetCount() const - { - return m_pos; - } - - u32 GetFreeCount() const - { - return max_count - m_pos; - } - - void SetValue(u32 value) - { - Memory.Write32(m_addr, value); - } - - u32 GetValue() const - { - return Memory.Read32(m_addr); - } -};*/ - struct DMAC { u64 ls_offset; - - /*//DMAC_Queue queue[MFC_SPU_MAX_QUEUE_SPACE]; //not used yet - DMAC_Proxy proxy[MFC_PPU_MAX_QUEUE_SPACE+MFC_SPU_MAX_QUEUE_SPACE]; //temporarily 24 - u32 queue_pos; - u32 proxy_pos; - long queue_lock; - volatile std::atomic proxy_lock; - - bool ProcessCmd(u32 cmd, u32 tag, u32 lsa, u64 ea, u32 size) - { - //returns true if the command should be deleted from the queue - if (cmd & (MFC_BARRIER_MASK | MFC_FENCE_MASK)) _mm_mfence(); - - switch(cmd & ~(MFC_BARRIER_MASK | MFC_FENCE_MASK | MFC_LIST_MASK)) - { - case MFC_PUT_CMD: - Memory.Copy(ea, ls_offset + lsa, size); - return true; - - case MFC_GET_CMD: - Memory.Copy(ls_offset + lsa, ea, size); - return true; - - default: - LOG_ERROR(HLE, "DMAC::ProcessCmd(): Unknown DMA cmd."); - return true; - } - } - - u32 Cmd(u32 cmd, u32 tag, u32 lsa, u64 ea, u32 size) - { - if(!Memory.IsGoodAddr(ls_offset + lsa, size) || !Memory.IsGoodAddr(ea, size)) - { - return MFC_PPU_DMA_CMD_SEQUENCE_ERROR; - } - - if(proxy_pos >= MFC_PPU_MAX_QUEUE_SPACE) - { - return MFC_PPU_DMA_QUEUE_FULL; - } - - ProcessCmd(cmd, tag, lsa, ea, size); - - return MFC_PPU_DMA_CMD_ENQUEUE_SUCCESSFUL; - } - - void ClearCmd() - { - while (std::atomic_exchange(&proxy_lock, 1)); - _mm_lfence(); - memcpy(proxy, proxy + 1, --proxy_pos * sizeof(DMAC_Proxy)); - _mm_sfence(); - proxy_lock = 0; //release lock - } - - void DoCmd() - { - if(proxy_pos) - { - const DMAC_Proxy& p = proxy[0]; - if (ProcessCmd(p.cmd, p.tag, p.lsa, p.ea, p.size)) - { - ClearCmd(); - } - } - }*/ }; - -/*struct MFC -{ - SPUReg<1> MFC_LSA; - SPUReg<1> MFC_EAH; - SPUReg<1> MFC_EAL; - SPUReg<1> MFC_Size_Tag; - SPUReg<1> MFC_CMDStatus; - SPUReg<1> MFC_QStatus; - SPUReg<1> Prxy_QueryType; - SPUReg<1> Prxy_QueryMask; - SPUReg<1> Prxy_TagStatus; - SPUReg<1> SPU_Out_MBox; - SPUReg<4> SPU_In_MBox; - SPUReg<1> SPU_MBox_Status; - SPUReg<1> SPU_RunCntl; - SPUReg<1> SPU_Status; - SPUReg<1> SPU_NPC; - SPUReg<1> SPU_RdSigNotify1; - SPUReg<1> SPU_RdSigNotify2; - - DMAC dmac; - - void Handle() - { - u32 cmd = MFC_CMDStatus.GetValue(); - - if(cmd) - { - u16 op = cmd & MFC_MASK_CMD; - - switch(op) - { - case MFC_PUT_CMD: - case MFC_GET_CMD: - { - u32 lsa = MFC_LSA.GetValue(); - u64 ea = (u64)MFC_EAL.GetValue() | ((u64)MFC_EAH.GetValue() << 32); - u32 size_tag = MFC_Size_Tag.GetValue(); - u16 tag = (u16)size_tag; - u16 size = size_tag >> 16; - - LOG_WARNING(HLE, "RawSPU DMA %s:", op == MFC_PUT_CMD ? "PUT" : "GET"); - LOG_WARNING(HLE, "*** lsa = 0x%x", lsa); - LOG_WARNING(HLE, "*** ea = 0x%llx", ea); - LOG_WARNING(HLE, "*** tag = 0x%x", tag); - LOG_WARNING(HLE, "*** size = 0x%x", size); - LOG_WARNING(HLE, " "); - - MFC_CMDStatus.SetValue(dmac.Cmd(cmd, tag, lsa, ea, size)); - } - break; - - default: - LOG_ERROR(HLE, "Unknown MFC cmd. (opcode=0x%x, cmd=0x%x)", op, cmd); - break; - } - } - - if(Prxy_QueryType.GetValue() == 2) - { - Prxy_QueryType.SetValue(0); - u32 mask = Prxy_QueryMask.GetValue(); - // - MFC_QStatus.SetValue(mask); - } - } -};*/ diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index abc187e9c2..0598a55018 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -579,7 +579,7 @@ public: #define LOG_DMAC(type, text) type(Log::SPU, "DMAC::ProcessCmd(cmd=0x%x, tag=0x%x, lsa=0x%x, ea=0x%llx, size=0x%x): " text, cmd, tag, lsa, ea, size) - bool ProcessCmd(u32 cmd, u32 tag, u32 lsa, u64 ea, u32 size) + void ProcessCmd(u32 cmd, u32 tag, u32 lsa, u64 ea, u32 size) { if (cmd & (MFC_BARRIER_MASK | MFC_FENCE_MASK)) _mm_mfence(); @@ -588,7 +588,8 @@ public: if (ea >= 0x100000000) { LOG_DMAC(LOG_ERROR, "Invalid external address"); - return false; + Emu.Pause(); + return; } else if (group) { @@ -597,7 +598,8 @@ public: if (num >= group->list.size() || !group->list[num]) { LOG_DMAC(LOG_ERROR, "Invalid thread (SPU Thread Group MMIO)"); - return false; + Emu.Pause(); + return; } SPUThread* spu = (SPUThread*)Emu.GetCPU().GetThread(group->list[num]); @@ -611,18 +613,20 @@ public: else if ((cmd & MFC_PUT_CMD) && size == 4 && (addr == SYS_SPU_THREAD_SNR1 || addr == SYS_SPU_THREAD_SNR2)) { spu->WriteSNR(SYS_SPU_THREAD_SNR2 == addr, Memory.Read32(dmac.ls_offset + lsa)); - return true; + return; } else { LOG_DMAC(LOG_ERROR, "Invalid register (SPU Thread Group MMIO)"); - return false; + Emu.Pause(); + return; } } else { LOG_DMAC(LOG_ERROR, "Thread group not set (SPU Thread Group MMIO)"); - return false; + Emu.Pause(); + return; } } else if (ea >= RAW_SPU_BASE_ADDR && size == 4) @@ -632,19 +636,20 @@ public: case MFC_PUT_CMD: { Memory.Write32(ea, ReadLS32(lsa)); - return true; + return; } case MFC_GET_CMD: { WriteLS32(lsa, Memory.Read32(ea)); - return true; + return; } default: { LOG_DMAC(LOG_ERROR, "Unknown DMA command"); - return false; + Emu.Pause(); + return; } } } @@ -653,53 +658,27 @@ public: { case MFC_PUT_CMD: { - if (Memory.Copy(ea, dmac.ls_offset + lsa, size)) - { - return true; - } - else - { - LOG_DMAC(LOG_ERROR, "PUT* cmd failed"); - return false; // TODO: page fault (?) - } + memcpy(Memory + ea, Memory + dmac.ls_offset + lsa, size); + return; } case MFC_GET_CMD: { - if (Memory.Copy(dmac.ls_offset + lsa, ea, size)) - { - return true; - } - else - { - LOG_DMAC(LOG_ERROR, "GET* cmd failed"); - return false; // TODO: page fault (?) - } + memcpy(Memory + dmac.ls_offset + lsa, Memory + ea, size); + return; } default: { LOG_DMAC(LOG_ERROR, "Unknown DMA command"); - return false; // ??? + Emu.Pause(); + return; } } } #undef LOG_CMD - u32 dmacCmd(u32 cmd, u32 tag, u32 lsa, u64 ea, u32 size) - { - /*if(proxy_pos >= MFC_PPU_MAX_QUEUE_SPACE) - { - return MFC_PPU_DMA_QUEUE_FULL; - }*/ - - if (ProcessCmd(cmd, tag, lsa, ea, size)) - return MFC_PPU_DMA_CMD_ENQUEUE_SUCCESSFUL; - else - return MFC_PPU_DMA_CMD_SEQUENCE_ERROR; - } - void ListCmd(u32 lsa, u64 ea, u16 tag, u16 size, u32 cmd, MFCReg& MFCArgs) { u32 list_addr = ea & 0x3ffff; @@ -713,7 +692,7 @@ public: be_t ea; // External Address Low }; - u32 result = MFC_PPU_DMA_CMD_SEQUENCE_ERROR; + u32 result = MFC_PPU_DMA_CMD_ENQUEUE_SUCCESSFUL; for (u32 i = 0; i < list_size; i++) { @@ -723,15 +702,12 @@ public: if (size < 16 && size != 1 && size != 2 && size != 4 && size != 8) { LOG_ERROR(Log::SPU, "DMA List: invalid transfer size(%d)", size); - return; + result = MFC_PPU_DMA_CMD_SEQUENCE_ERROR; + break; } u32 addr = rec->ea; - result = dmacCmd(cmd, tag, lsa | (addr & 0xf), addr, size); - if (result == MFC_PPU_DMA_CMD_SEQUENCE_ERROR) - { - break; - } + ProcessCmd(cmd, tag, lsa | (addr & 0xf), addr, size); if (Ini.HLELogging.GetValue() || rec->s) LOG_NOTICE(Log::SPU, "*** list element(%d/%d): s = 0x%x, ts = 0x%x, low ea = 0x%x (lsa = 0x%x)", @@ -746,6 +722,8 @@ public: if (StallList[tag].MFCArgs) { LOG_ERROR(Log::SPU, "DMA List: existing stalled list found (tag=%d)", tag); + result = MFC_PPU_DMA_CMD_SEQUENCE_ERROR; + break; } StallList[tag].MFCArgs = &MFCArgs; StallList[tag].cmd = cmd; @@ -753,7 +731,7 @@ public: StallList[tag].lsa = lsa; StallList[tag].size = (list_size - i - 1) * 8; - return; + break; } } @@ -784,7 +762,8 @@ public: (op & MFC_FENCE_MASK ? "F" : ""), lsa, ea, tag, size, cmd); - MFCArgs.CMDStatus.SetValue(dmacCmd(cmd, tag, lsa, ea, size)); + ProcessCmd(cmd, tag, lsa, ea, size); + MFCArgs.CMDStatus.SetValue(MFC_PPU_DMA_CMD_ENQUEUE_SUCCESSFUL); } break; @@ -871,21 +850,6 @@ public: { MFCArgs.AtomicStat.PushUncond(MFC_PUTLLC_FAILURE); } - /*u32 last_d = last_q * 2; - if (buf[last]._u32[last_d] == reservation.data[last]._u32[last_d] && buf[last]._u32[last_d+1] != reservation.data[last]._u32[last_d+1]) - { - last_d++; - } - else if (buf[last]._u32[last_d+1] == reservation.data[last]._u32[last_d+1]) - { - last_d; - } - else // full 64 bit - { - LOG_ERROR(Log::SPU, "MFC_PUTLLC_CMD: TODO: 64bit compare and swap"); - Emu.Pause(); - MFCArgs.AtomicStat.PushUncond(MFC_PUTLLC_SUCCESS); - }*/ } } else From 2a5506dae6d0c01ee3c2a9855831277309e325e7 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 21 Jul 2014 23:05:58 +0400 Subject: [PATCH 14/21] cellSyncBarrierInitialize implemented (SPU sample works) --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 118 ++++++++++++++++++++++-- rpcs3/Emu/SysCalls/Modules/cellSync.h | 8 +- 2 files changed, 115 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 68981edf65..9265e9decd 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -10,9 +10,9 @@ //Module cellSync("cellSync", cellSync_init); Module *cellSync = nullptr; -int cellSyncMutexInitialize(mem_ptr_t mutex) +s32 cellSyncMutexInitialize(mem_ptr_t mutex) { - cellSync->Log("cellSyncMutexInitialize(mutex=0x%x)", mutex.GetAddr()); + cellSync->Log("cellSyncMutexInitialize(mutex_addr=0x%x)", mutex.GetAddr()); if (!mutex) { @@ -29,9 +29,9 @@ int cellSyncMutexInitialize(mem_ptr_t mutex) return CELL_OK; } -int cellSyncMutexLock(mem_ptr_t mutex) +s32 cellSyncMutexLock(mem_ptr_t mutex) { - cellSync->Log("cellSyncMutexLock(mutex=0x%x)", mutex.GetAddr()); + cellSync->Log("cellSyncMutexLock(mutex_addr=0x%x)", mutex.GetAddr()); if (!mutex) { @@ -58,10 +58,10 @@ int cellSyncMutexLock(mem_ptr_t mutex) // prx: wait until another u16 value == old value while (old_order != mutex->m_freed) { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack if (Emu.IsStopped()) { - LOG_WARNING(HLE, "cellSyncMutexLock(mutex=0x%x) aborted", mutex.GetAddr()); + LOG_WARNING(HLE, "cellSyncMutexLock(mutex_addr=0x%x) aborted", mutex.GetAddr()); break; } } @@ -71,9 +71,9 @@ int cellSyncMutexLock(mem_ptr_t mutex) return CELL_OK; } -int cellSyncMutexTryLock(mem_ptr_t mutex) +s32 cellSyncMutexTryLock(mem_ptr_t mutex) { - cellSync->Log("cellSyncMutexTryLock(mutex=0x%x)", mutex.GetAddr()); + cellSync->Log("cellSyncMutexTryLock(mutex_addr=0x%x)", mutex.GetAddr()); if (!mutex) { @@ -105,9 +105,9 @@ int cellSyncMutexTryLock(mem_ptr_t mutex) return CELL_OK; } -int cellSyncMutexUnlock(mem_ptr_t mutex) +s32 cellSyncMutexUnlock(mem_ptr_t mutex) { - cellSync->Log("cellSyncMutexUnlock(mutex=0x%x)", mutex.GetAddr()); + cellSync->Log("cellSyncMutexUnlock(mutex_addr=0x%x)", mutex.GetAddr()); if (!mutex) { @@ -133,10 +133,108 @@ int cellSyncMutexUnlock(mem_ptr_t mutex) return CELL_OK; } +s32 cellSyncBarrierInitialize(mem_ptr_t barrier, u16 total_count) +{ + cellSync->Log("cellSyncBarrierInitialize(barrier_addr=0x%x, total_count=%d)", barrier.GetAddr(), total_count); + + if (!barrier) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (barrier.GetAddr() % 4) + { + return CELL_SYNC_ERROR_ALIGN; + } + if (!total_count || total_count > 32767) + { + return CELL_SYNC_ERROR_INVAL; + } + + // prx: zeroize first u16, write total_count in second u16 and sync + barrier->m_value = 0; + barrier->m_count = total_count; + InterlockedCompareExchange(&barrier->m_data(), 0, 0); + return CELL_OK; +} + +s32 cellSyncBarrierNotify(mem_ptr_t barrier) +{ + cellSync->Todo("cellSyncBarrierNotify(barrier_addr=0x%x)", barrier.GetAddr()); + + if (!barrier) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (barrier.GetAddr() % 4) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + +s32 cellSyncBarrierTryNotify(mem_ptr_t barrier) +{ + cellSync->Todo("cellSyncBarrierTryNotify(barrier_addr=0x%x)", barrier.GetAddr()); + + if (!barrier) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (barrier.GetAddr() % 4) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + +s32 cellSyncBarrierWait(mem_ptr_t barrier) +{ + cellSync->Todo("cellSyncBarrierWait(barrier_addr=0x%x)", barrier.GetAddr()); + + if (!barrier) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (barrier.GetAddr() % 4) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + +s32 cellSyncBarrierTryWait(mem_ptr_t barrier) +{ + cellSync->Todo("cellSyncBarrierTryWait(barrier_addr=0x%x)", barrier.GetAddr()); + + if (!barrier) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (barrier.GetAddr() % 4) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + void cellSync_init() { cellSync->AddFunc(0xa9072dee, cellSyncMutexInitialize); cellSync->AddFunc(0x1bb675c2, cellSyncMutexLock); cellSync->AddFunc(0xd06918c4, cellSyncMutexTryLock); cellSync->AddFunc(0x91f2b7b0, cellSyncMutexUnlock); + + cellSync->AddFunc(0x07254fda, cellSyncBarrierInitialize); + cellSync->AddFunc(0xf06a6415, cellSyncBarrierNotify); + cellSync->AddFunc(0x268edd6d, cellSyncBarrierTryNotify); + cellSync->AddFunc(0x35f21355, cellSyncBarrierWait); + cellSync->AddFunc(0x6c272124, cellSyncBarrierTryWait); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.h b/rpcs3/Emu/SysCalls/Modules/cellSync.h index 36a768986e..c9dd86f607 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.h @@ -32,7 +32,13 @@ static_assert(sizeof(CellSyncMutex) == 4, "CellSyncMutex: wrong size"); struct CellSyncBarrier { - be_t m_data; + be_t m_value; + be_t m_count; + + volatile u32& m_data() + { + return *reinterpret_cast(this); + }; }; static_assert(sizeof(CellSyncBarrier) == 4, "CellSyncBarrier: wrong size"); \ No newline at end of file From 356904d198200edd2615b3d839bfe56c46b6a976 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 22 Jul 2014 01:55:02 +0400 Subject: [PATCH 15/21] .gitignore updated --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 84200d4e1b..033f921069 100644 --- a/.gitignore +++ b/.gitignore @@ -64,5 +64,6 @@ rpcs3/git-version.h bin/dev_hdd0/*.txt x64/Debug/emucore.lib x64/Release/emucore.lib +rpcs3/x64/* .DS_Store From 1c32a284e1f4d5418f09e14856eef05cfae9a287 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 22 Jul 2014 18:46:31 +0400 Subject: [PATCH 16/21] cellSyncRwmInitialize implemented cellSyncRwmRead implemented (SPU sample works) --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 139 ++++++++++++++++++++++++ rpcs3/Emu/SysCalls/Modules/cellSync.h | 51 +++++++-- 2 files changed, 178 insertions(+), 12 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 9265e9decd..bdd6dd6a0b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -225,6 +225,139 @@ s32 cellSyncBarrierTryWait(mem_ptr_t barrier) return CELL_OK; } +s32 cellSyncRwmInitialize(mem_ptr_t rwm, u32 buffer_addr, u32 buffer_size) +{ + cellSync->Log("cellSyncRwmInitialize(rwm_addr=0x%x, buffer_addr=0x%x, buffer_size=0x%x)", rwm.GetAddr(), buffer_addr, buffer_size); + + if (!rwm || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (rwm.GetAddr() % 16 || buffer_addr % 128) + { + return CELL_SYNC_ERROR_ALIGN; + } + if (buffer_size % 128 || buffer_size > 0x4000) + { + return CELL_SYNC_ERROR_INVAL; + } + + // prx: zeroize first u16 and second u16, write buffer_size in second u32, write buffer_addr in second u64 and sync + rwm->m_data() = 0; + rwm->m_size = buffer_size; + rwm->m_addr = (u64)buffer_addr; + InterlockedCompareExchange(&rwm->m_data(), 0, 0); + return CELL_OK; +} + +s32 cellSyncRwmRead(mem_ptr_t rwm, u32 buffer_addr) +{ + cellSync->Log("cellSyncRwmRead(rwm_addr=0x%x, buffer_addr=0x%x)", rwm.GetAddr(), buffer_addr); + + if (!rwm || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (rwm.GetAddr() % 16) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // prx: atomically load first u32, repeat until second u16 == 0, increase first u16 and sync + while (true) + { + const u32 old_data = rwm->m_data(); + CellSyncRwm new_rwm; + new_rwm.m_data() = old_data; + + if (new_rwm.m_writers.ToBE()) + { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack + if (Emu.IsStopped()) + { + cellSync->Warning("cellSyncRwmRead(rwm_addr=0x%x) aborted", rwm.GetAddr()); + return CELL_OK; + } + continue; + } + + new_rwm.m_readers++; + if (InterlockedCompareExchange(&rwm->m_data(), new_rwm.m_data(), old_data) == old_data) break; + } + + // copy data to buffer_addr + memcpy(Memory + buffer_addr, Memory + (u64)rwm->m_addr, (u32)rwm->m_size); + + // prx: load first u32, return 0x8041010C if first u16 == 0, atomically decrease it + while (true) + { + const u32 old_data = rwm->m_data(); + CellSyncRwm new_rwm; + new_rwm.m_data() = old_data; + + if (!new_rwm.m_readers.ToBE()) + { + cellSync->Error("cellSyncRwmRead(rwm_addr=0x%x): m_readers == 0 (m_writers=%d)", rwm.GetAddr(), (u16)new_rwm.m_writers); + return CELL_SYNC_ERROR_ABORT; + } + + new_rwm.m_readers--; + if (InterlockedCompareExchange(&rwm->m_data(), new_rwm.m_data(), old_data) == old_data) break; + } + return CELL_OK; +} + +s32 cellSyncRwmTryRead(mem_ptr_t rwm, u32 buffer_addr) +{ + cellSync->Todo("cellSyncRwmTryRead(rwm_addr=0x%x, buffer_addr=0x%x)", rwm.GetAddr(), buffer_addr); + + if (!rwm || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (rwm.GetAddr() % 16) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + +s32 cellSyncRwmWrite(mem_ptr_t rwm, u32 buffer_addr) +{ + cellSync->Todo("cellSyncRwmWrite(rwm_addr=0x%x, buffer_addr=0x%x)", rwm.GetAddr(), buffer_addr); + + if (!rwm || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (rwm.GetAddr() % 16) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + +s32 cellSyncRwmTryWrite(mem_ptr_t rwm, u32 buffer_addr) +{ + cellSync->Todo("cellSyncRwmTryWrite(rwm_addr=0x%x, buffer_addr=0x%x)", rwm.GetAddr(), buffer_addr); + + if (!rwm || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (rwm.GetAddr() % 16) + { + return CELL_SYNC_ERROR_ALIGN; + } + + // TODO + return CELL_OK; +} + void cellSync_init() { cellSync->AddFunc(0xa9072dee, cellSyncMutexInitialize); @@ -237,4 +370,10 @@ void cellSync_init() cellSync->AddFunc(0x268edd6d, cellSyncBarrierTryNotify); cellSync->AddFunc(0x35f21355, cellSyncBarrierWait); cellSync->AddFunc(0x6c272124, cellSyncBarrierTryWait); + + cellSync->AddFunc(0xfc48b03f, cellSyncRwmInitialize); + cellSync->AddFunc(0xcece771f, cellSyncRwmRead); + cellSync->AddFunc(0xa6669751, cellSyncRwmTryRead); + cellSync->AddFunc(0xed773f5f, cellSyncRwmWrite); + cellSync->AddFunc(0xba5bee48, cellSyncRwmTryWrite); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.h b/rpcs3/Emu/SysCalls/Modules/cellSync.h index c9dd86f607..02829fcdb1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.h @@ -3,18 +3,30 @@ // Return Codes enum { - CELL_SYNC_ERROR_AGAIN = 0x80410101, - CELL_SYNC_ERROR_INVAL = 0x80410102, - CELL_SYNC_ERROR_NOMEM = 0x80410104, + CELL_SYNC_ERROR_AGAIN = 0x80410101, + CELL_SYNC_ERROR_INVAL = 0x80410102, + CELL_SYNC_ERROR_NOSYS = 0x80410103, // ??? + CELL_SYNC_ERROR_NOMEM = 0x80410104, + CELL_SYNC_ERROR_SRCH = 0x80410105, // ??? + CELL_SYNC_ERROR_NOENT = 0x80410106, // ??? + CELL_SYNC_ERROR_NOEXEC = 0x80410107, // ??? CELL_SYNC_ERROR_DEADLK = 0x80410108, - CELL_SYNC_ERROR_PERM = 0x80410109, - CELL_SYNC_ERROR_BUSY = 0x8041010A, - CELL_SYNC_ERROR_STAT = 0x8041010F, - CELL_SYNC_ERROR_ALIGN = 0x80410110, - CELL_SYNC_ERROR_NULL_POINTER = 0x80410111, - CELL_SYNC_ERROR_NOT_SUPPORTED_THREAD = 0x80410112, - CELL_SYNC_ERROR_NO_NOTIFIER = 0x80410113, - CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE = 0x80410114, + CELL_SYNC_ERROR_PERM = 0x80410109, + CELL_SYNC_ERROR_BUSY = 0x8041010A, + //////////////////////// 0x8041010B, // ??? + CELL_SYNC_ERROR_ABORT = 0x8041010C, // ??? + CELL_SYNC_ERROR_FAULT = 0x8041010D, // ??? + CELL_SYNC_ERROR_CHILD = 0x8041010E, // ??? + CELL_SYNC_ERROR_STAT = 0x8041010F, + CELL_SYNC_ERROR_ALIGN = 0x80410110, + + CELL_SYNC_ERROR_NULL_POINTER = 0x80410111, + + CELL_SYNC_ERROR_NOT_SUPPORTED_THREAD = 0x80410112, // ??? + CELL_SYNC_ERROR_SHOTAGE = 0x80410112, // ??? + CELL_SYNC_ERROR_NO_NOTIFIER = 0x80410113, // ??? + CELL_SYNC_ERROR_UNKNOWNKEY = 0x80410113, // ??? + CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE = 0x80410114, // ??? }; struct CellSyncMutex @@ -41,4 +53,19 @@ struct CellSyncBarrier }; }; -static_assert(sizeof(CellSyncBarrier) == 4, "CellSyncBarrier: wrong size"); \ No newline at end of file +static_assert(sizeof(CellSyncBarrier) == 4, "CellSyncBarrier: wrong size"); + +struct CellSyncRwm +{ + be_t m_readers; + be_t m_writers; + be_t m_size; + be_t m_addr; + + volatile u32& m_data() + { + return *reinterpret_cast(this); + }; +}; + +static_assert(sizeof(CellSyncRwm) == 16, "CellSyncBarrier: wrong size"); From f55afc27a9e2153abf88ad3344f84e98325e76cd Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 22 Jul 2014 23:02:45 +0400 Subject: [PATCH 17/21] cellSyncQueue draft --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 96 +++++++++++++++++++++++++ rpcs3/Emu/SysCalls/Modules/cellSync.h | 16 +++++ 2 files changed, 112 insertions(+) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index bdd6dd6a0b..5778c67dc3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -358,6 +358,92 @@ s32 cellSyncRwmTryWrite(mem_ptr_t rwm, u32 buffer_addr) return CELL_OK; } +s32 cellSyncQueueInitialize(mem_ptr_t queue, u32 buffer_addr, u32 size, u32 depth) +{ + cellSync->Todo("cellSyncQueueInitialize(queue_addr=0x%x, buffer_addr=0x%x, size=0x%x, depth=0x%x)", queue.GetAddr(), buffer_addr, size, depth); + + if (!queue) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (size && !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32 || buffer_addr % 16) + { + return CELL_SYNC_ERROR_ALIGN; + } + if (!depth || size % 16) + { + return CELL_SYNC_ERROR_INVAL; + } + + // prx: zeroize first u64, write size in third u32, write depth in fourth u32, write address in third u64 and sync + queue->m_data() = 0; + queue->m_size = size; + queue->m_depth = depth; + queue->m_addr = (u64)buffer_addr; + InterlockedCompareExchange(&queue->m_data(), 0, 0); + return CELL_OK; +} + +s32 cellSyncQueuePush(mem_ptr_t queue, u32 buffer_addr) +{ + cellSync->Todo("cellSyncQueuePush(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + + return CELL_OK; +} + +s32 cellSyncQueueTryPush(mem_ptr_t queue, u32 buffer_addr) +{ + cellSync->Todo("cellSyncQueueTryPush(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + + return CELL_OK; +} + +s32 cellSyncQueuePop(mem_ptr_t queue, u32 buffer_addr) +{ + cellSync->Todo("cellSyncQueuePop(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + + return CELL_OK; +} + +s32 cellSyncQueueTryPop(mem_ptr_t queue, u32 buffer_addr) +{ + cellSync->Todo("cellSyncQueueTryPop(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + + return CELL_OK; +} + +s32 cellSyncQueuePeek(mem_ptr_t queue, u32 buffer_addr) +{ + cellSync->Todo("cellSyncQueuePeek(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + + return CELL_OK; +} + +s32 cellSyncQueueTryPeek(mem_ptr_t queue, u32 buffer_addr) +{ + cellSync->Todo("cellSyncQueueTryPeek(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + + return CELL_OK; +} + +s32 cellSyncQueueSize(mem_ptr_t queue) +{ + cellSync->Todo("cellSyncQueueSize(queue_addr=0x%x)", queue.GetAddr()); + + return CELL_OK; +} + +s32 cellSyncQueueClear(mem_ptr_t queue) +{ + cellSync->Todo("cellSyncQueueClear(queue_addr=0x%x)", queue.GetAddr()); + + return CELL_OK; +} + void cellSync_init() { cellSync->AddFunc(0xa9072dee, cellSyncMutexInitialize); @@ -376,4 +462,14 @@ void cellSync_init() cellSync->AddFunc(0xa6669751, cellSyncRwmTryRead); cellSync->AddFunc(0xed773f5f, cellSyncRwmWrite); cellSync->AddFunc(0xba5bee48, cellSyncRwmTryWrite); + + cellSync->AddFunc(0x3929948d, cellSyncQueueInitialize); + cellSync->AddFunc(0x5ae841e5, cellSyncQueuePush); + cellSync->AddFunc(0x705985cd, cellSyncQueueTryPush); + cellSync->AddFunc(0x4da6d7e0, cellSyncQueuePop); + cellSync->AddFunc(0xa58df87f, cellSyncQueueTryPop); + cellSync->AddFunc(0x48154c9b, cellSyncQueuePeek); + cellSync->AddFunc(0x68af923c, cellSyncQueueTryPeek); + cellSync->AddFunc(0x4da349b2, cellSyncQueueSize); + cellSync->AddFunc(0xa5362e73, cellSyncQueueClear); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.h b/rpcs3/Emu/SysCalls/Modules/cellSync.h index 02829fcdb1..22afb9bebf 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.h @@ -69,3 +69,19 @@ struct CellSyncRwm }; static_assert(sizeof(CellSyncRwm) == 16, "CellSyncBarrier: wrong size"); + +struct CellSyncQueue +{ + be_t m_value; + be_t m_size; + be_t m_depth; + be_t m_addr; + be_t reserved; + + volatile u64& m_data() + { + return *reinterpret_cast(this); + }; +}; + +static_assert(sizeof(CellSyncQueue) == 32, "CellSyncQueue: wrong size"); \ No newline at end of file From 3d184b3a594df6dd11e02b61b3017b5f232e6797 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 24 Jul 2014 01:51:57 +0400 Subject: [PATCH 18/21] cellSyncQueuePush implemented --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 65 ++++++++++++++++++++++++- rpcs3/Emu/SysCalls/Modules/cellSync.h | 3 +- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 5778c67dc3..dfab32dbd5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -360,7 +360,7 @@ s32 cellSyncRwmTryWrite(mem_ptr_t rwm, u32 buffer_addr) s32 cellSyncQueueInitialize(mem_ptr_t queue, u32 buffer_addr, u32 size, u32 depth) { - cellSync->Todo("cellSyncQueueInitialize(queue_addr=0x%x, buffer_addr=0x%x, size=0x%x, depth=0x%x)", queue.GetAddr(), buffer_addr, size, depth); + cellSync->Log("cellSyncQueueInitialize(queue_addr=0x%x, buffer_addr=0x%x, size=0x%x, depth=0x%x)", queue.GetAddr(), buffer_addr, size, depth); if (!queue) { @@ -390,8 +390,69 @@ s32 cellSyncQueueInitialize(mem_ptr_t queue, u32 buffer_addr, u32 s32 cellSyncQueuePush(mem_ptr_t queue, u32 buffer_addr) { - cellSync->Todo("cellSyncQueuePush(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + cellSync->Log("cellSyncQueuePush(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + if (!queue || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32) + { + return CELL_SYNC_ERROR_ALIGN; + } + + const u32 size = (u32)queue->m_size; + const u32 depth = (u32)queue->m_depth; + if (((u32)queue->m_v1 & 0xffffff) > depth || ((u32)queue->m_v2 & 0xffffff) > depth) + { + cellSync->Error("cellSyncQueuePush(queue_addr=0x%x): m_depth limit broken", queue.GetAddr()); + Emu.Pause(); + } + + u32 position; + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + const u32 v1 = (u32)new_queue.m_v1; + const u32 v2 = (u32)new_queue.m_v2; + // prx: compare 5th u8 with zero (repeat if not zero) + // prx: compare (second u32 (u24) + first u8) with depth (repeat if greater or equal) + if ((v2 >> 24) || ((v2 & 0xffffff) + (v1 >> 24)) >= depth) + { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack + if (Emu.IsStopped()) + { + cellSync->Warning("cellSyncQueuePush(queue_addr=0x%x) aborted", queue.GetAddr()); + return CELL_OK; + } + continue; + } + + // prx: extract first u32 (u24) (-> position), calculate (position + 1) % depth, insert it back + // prx: insert 1 in 5th u8 + // prx: extract second u32 (u24), increase it, insert it back + position = (v1 & 0xffffff); + new_queue.m_v1 = (v1 & 0xff000000) | ((position + 1) % depth); + new_queue.m_v2 = (1 << 24) | ((v2 & 0xffffff) + 1); + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } + + // prx: memcpy(position * m_size + m_addr, buffer_addr, m_size), sync + memcpy(Memory + (u64)queue->m_addr + position * size, Memory + buffer_addr, size); + + // prx: atomically insert 0 in 5th u8 + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + new_queue.m_v2 &= 0xffffff; // TODO: use InterlockedAnd() or something + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.h b/rpcs3/Emu/SysCalls/Modules/cellSync.h index 22afb9bebf..a1ef8fdf39 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.h @@ -72,7 +72,8 @@ static_assert(sizeof(CellSyncRwm) == 16, "CellSyncBarrier: wrong size"); struct CellSyncQueue { - be_t m_value; + be_t m_v1; + be_t m_v2; be_t m_size; be_t m_depth; be_t m_addr; From 74e18dc8c925c56f3fe8c269dc396a6504514cf3 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 24 Jul 2014 19:02:04 +0400 Subject: [PATCH 19/21] cellSyncQueuePop... cellSyncQueueSize, cellSyncQueueClear implemented --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 149 +++++++++++++++++++++++- 1 file changed, 145 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index dfab32dbd5..39a6facdc0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -465,8 +465,69 @@ s32 cellSyncQueueTryPush(mem_ptr_t queue, u32 buffer_addr) s32 cellSyncQueuePop(mem_ptr_t queue, u32 buffer_addr) { - cellSync->Todo("cellSyncQueuePop(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + cellSync->Log("cellSyncQueuePop(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + if (!queue || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32) + { + return CELL_SYNC_ERROR_ALIGN; + } + + const u32 size = (u32)queue->m_size; + const u32 depth = (u32)queue->m_depth; + if (((u32)queue->m_v1 & 0xffffff) > depth || ((u32)queue->m_v2 & 0xffffff) > depth) + { + cellSync->Error("cellSyncQueuePop(queue_addr=0x%x): m_depth limit broken", queue.GetAddr()); + Emu.Pause(); + } + + u32 position; + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + const u32 v1 = (u32)new_queue.m_v1; + const u32 v2 = (u32)new_queue.m_v2; + // prx: extract first u8, repeat if not zero + // prx: extract second u32 (u24), subtract 5th u8, compare with zero, repeat if less or equal + if ((v1 >> 24) || ((v2 & 0xffffff) <= (v2 >> 24))) + { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack + if (Emu.IsStopped()) + { + cellSync->Warning("cellSyncQueuePop(queue_addr=0x%x) aborted", queue.GetAddr()); + return CELL_OK; + } + continue; + } + + // prx: insert 1 in first u8 + // prx: extract first u32 (u24), add depth, subtract second u32 (u24), calculate (% depth), save to position + // prx: extract second u32 (u24), decrease it, insert it back + new_queue.m_v1 = 0x1000000 | v1; + position = ((v1 & 0xffffff) + depth - (v2 & 0xffffff)) % depth; + new_queue.m_v2 = (v2 & 0xff000000) | ((v2 & 0xffffff) - 1); + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } + + // prx: (sync), memcpy(buffer_addr, position * m_size + m_addr, m_size) + memcpy(Memory + buffer_addr, Memory + (u64)queue->m_addr + position * size, size); + + // prx: atomically insert 0 in first u8 + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + new_queue.m_v1 &= 0xffffff; // TODO: use InterlockedAnd() or something + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } return CELL_OK; } @@ -493,15 +554,95 @@ s32 cellSyncQueueTryPeek(mem_ptr_t queue, u32 buffer_addr) s32 cellSyncQueueSize(mem_ptr_t queue) { - cellSync->Todo("cellSyncQueueSize(queue_addr=0x%x)", queue.GetAddr()); + cellSync->Log("cellSyncQueueSize(queue_addr=0x%x)", queue.GetAddr()); - return CELL_OK; + if (!queue) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32) + { + return CELL_SYNC_ERROR_ALIGN; + } + + const u32 count = (u32)queue->m_v2 & 0xffffff; + const u32 depth = (u32)queue->m_depth; + if (((u32)queue->m_v1 & 0xffffff) > depth || count > depth) + { + cellSync->Error("cellSyncQueueSize(queue_addr=0x%x): m_depth limit broken", queue.GetAddr()); + Emu.Pause(); + } + + return count; } s32 cellSyncQueueClear(mem_ptr_t queue) { - cellSync->Todo("cellSyncQueueClear(queue_addr=0x%x)", queue.GetAddr()); + cellSync->Log("cellSyncQueueClear(queue_addr=0x%x)", queue.GetAddr()); + if (!queue) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32) + { + return CELL_SYNC_ERROR_ALIGN; + } + + const u32 depth = (u32)queue->m_depth; + if (((u32)queue->m_v1 & 0xffffff) > depth || ((u32)queue->m_v2 & 0xffffff) > depth) + { + cellSync->Error("cellSyncQueueSize(queue_addr=0x%x): m_depth limit broken", queue.GetAddr()); + Emu.Pause(); + } + + // TODO: optimize if possible + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + const u32 v1 = (u32)new_queue.m_v1; + // prx: extract first u8, repeat if not zero, insert 1 + if (v1 >> 24) + { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack + if (Emu.IsStopped()) + { + cellSync->Warning("cellSyncQueueClear(queue_addr=0x%x) aborted (I)", queue.GetAddr()); + return CELL_OK; + } + continue; + } + new_queue.m_v1 = v1 | 0x1000000; + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } + + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + const u32 v2 = (u32)new_queue.m_v2; + // prx: extract 5th u8, repeat if not zero, insert 1 + if (v2 >> 24) + { + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack + if (Emu.IsStopped()) + { + cellSync->Warning("cellSyncQueueClear(queue_addr=0x%x) aborted (II)", queue.GetAddr()); + return CELL_OK; + } + continue; + } + new_queue.m_v2 = v2 | 0x1000000; + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } + + queue->m_data() = 0; + InterlockedCompareExchange(&queue->m_data(), 0, 0); return CELL_OK; } From 9d0bd55ec0edafd781c05dc1af90db8549055fc8 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 25 Jul 2014 12:35:37 +0400 Subject: [PATCH 20/21] cellSyncQueueTryPush, cellSyncQueueTryPop --- rpcs3/Emu/SysCalls/Modules/cellSync.cpp | 100 +++++++++++++++++++++++- 1 file changed, 98 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 39a6facdc0..ded18c4d2d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -458,8 +458,56 @@ s32 cellSyncQueuePush(mem_ptr_t queue, u32 buffer_addr) s32 cellSyncQueueTryPush(mem_ptr_t queue, u32 buffer_addr) { - cellSync->Todo("cellSyncQueueTryPush(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + cellSync->Log("cellSyncQueueTryPush(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + if (!queue || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32) + { + return CELL_SYNC_ERROR_ALIGN; + } + + const u32 size = (u32)queue->m_size; + const u32 depth = (u32)queue->m_depth; + if (((u32)queue->m_v1 & 0xffffff) > depth || ((u32)queue->m_v2 & 0xffffff) > depth) + { + cellSync->Error("cellSyncQueueTryPush(queue_addr=0x%x): m_depth limit broken", queue.GetAddr()); + Emu.Pause(); + } + + u32 position; + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + const u32 v1 = (u32)new_queue.m_v1; + const u32 v2 = (u32)new_queue.m_v2; + if ((v2 >> 24) || ((v2 & 0xffffff) + (v1 >> 24)) >= depth) + { + return CELL_SYNC_ERROR_BUSY; + } + + position = (v1 & 0xffffff); + new_queue.m_v1 = (v1 & 0xff000000) | ((position + 1) % depth); + new_queue.m_v2 = (1 << 24) | ((v2 & 0xffffff) + 1); + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } + + memcpy(Memory + (u64)queue->m_addr + position * size, Memory + buffer_addr, size); + + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + new_queue.m_v2 &= 0xffffff; // TODO: use InterlockedAnd() or something + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } return CELL_OK; } @@ -533,8 +581,56 @@ s32 cellSyncQueuePop(mem_ptr_t queue, u32 buffer_addr) s32 cellSyncQueueTryPop(mem_ptr_t queue, u32 buffer_addr) { - cellSync->Todo("cellSyncQueueTryPop(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + cellSync->Log("cellSyncQueueTryPop(queue_addr=0x%x, buffer_addr=0x%x)", queue.GetAddr(), buffer_addr); + if (!queue || !buffer_addr) + { + return CELL_SYNC_ERROR_NULL_POINTER; + } + if (queue.GetAddr() % 32) + { + return CELL_SYNC_ERROR_ALIGN; + } + + const u32 size = (u32)queue->m_size; + const u32 depth = (u32)queue->m_depth; + if (((u32)queue->m_v1 & 0xffffff) > depth || ((u32)queue->m_v2 & 0xffffff) > depth) + { + cellSync->Error("cellSyncQueueTryPop(queue_addr=0x%x): m_depth limit broken", queue.GetAddr()); + Emu.Pause(); + } + + u32 position; + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + const u32 v1 = (u32)new_queue.m_v1; + const u32 v2 = (u32)new_queue.m_v2; + if ((v1 >> 24) || ((v2 & 0xffffff) <= (v2 >> 24))) + { + return CELL_SYNC_ERROR_BUSY; + } + + new_queue.m_v1 = 0x1000000 | v1; + position = ((v1 & 0xffffff) + depth - (v2 & 0xffffff)) % depth; + new_queue.m_v2 = (v2 & 0xff000000) | ((v2 & 0xffffff) - 1); + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } + + memcpy(Memory + buffer_addr, Memory + (u64)queue->m_addr + position * size, size); + + while (true) + { + const u64 old_data = queue->m_data(); + CellSyncQueue new_queue; + new_queue.m_data() = old_data; + + new_queue.m_v1 &= 0xffffff; // TODO: use InterlockedAnd() or something + if (InterlockedCompareExchange(&queue->m_data(), new_queue.m_data(), old_data) == old_data) break; + } return CELL_OK; } From 143a75616ceb4adb644940e024fcd89a68febb0d Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 29 Jul 2014 00:29:38 +0400 Subject: [PATCH 21/21] Conflicts fixed --- rpcs3/Emu/GS/GCM.h | 22 +- rpcs3/Emu/GS/GL/GLGSRender.cpp | 82 +- rpcs3/Emu/GS/GL/GLProgramBuffer.cpp | 4 +- rpcs3/Emu/GS/RSXThread.cpp | 650 ++----- rpcs3/Emu/GS/RSXThread.h | 2 + rpcs3/Emu/SysCalls/Modules/sceNp.cpp | 2508 +++++++++++++++++++++++++- rpcs3/Emu/SysCalls/SysCalls.cpp | 743 ++++++-- rpcs3/stdafx.h | 2 +- 8 files changed, 3314 insertions(+), 699 deletions(-) diff --git a/rpcs3/Emu/GS/GCM.h b/rpcs3/Emu/GS/GCM.h index 386c86b644..af6d412e96 100644 --- a/rpcs3/Emu/GS/GCM.h +++ b/rpcs3/Emu/GS/GCM.h @@ -190,8 +190,13 @@ enum // GPU Class Handles enum { - CELL_GCM_CONTEXT_SURFACE2D = 0x313371C3, - CELL_GCM_CONTEXT_SWIZZLE2D = 0x31337A73, + CELL_GCM_CONTEXT_DMA_MEMORY_FRAME_BUFFER = 0xFEED0000, // Local memory + CELL_GCM_CONTEXT_DMA_MEMORY_HOST_BUFFER = 0xFEED0001, // Main memory + CELL_GCM_CONTEXT_SURFACE2D = 0x313371C3, + CELL_GCM_CONTEXT_SWIZZLE2D = 0x31337A73, + CELL_GCM_CONTEXT_DMA_TO_MEMORY_GET_REPORT = 0x66626660, + CELL_GCM_CONTEXT_DMA_REPORT_LOCATION_MAIN = 0xBAD68000, + CELL_GCM_CONTEXT_DMA_NOTIFY_MAIN_0 = 0x6660420F, }; struct CellGcmControl @@ -555,7 +560,6 @@ enum NV4097_SET_VERTEX_ATTRIB_INPUT_MASK = 0x00001ff0, NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK = 0x00001ff4, NV4097_SET_TRANSFORM_BRANCH_BITS = 0x00001ff8, - NV4097_SET_FLIP = 0x0003fead, // NV03_MEMORY_TO_MEMORY_FORMAT (NV0039) NV0039_SET_OBJECT = 0x00002000, @@ -1326,7 +1330,17 @@ static const std::string GetMethodName(const u32 id) { NV4097_SET_TRANSFORM_TIMEOUT , "NV4097_SET_TRANSFORM_TIMEOUT" }, { NV4097_SET_TRANSFORM_CONSTANT_LOAD , "NV4097_SET_TRANSFORM_CONSTANT_LOAD" }, { NV4097_SET_FREQUENCY_DIVIDER_OPERATION , "NV4097_SET_FREQUENCY_DIVIDER_OPERATION" }, - { NV4097_INVALIDATE_L2 , "NV4097_INVALIDATE_L2" }, + { NV4097_SET_ATTRIB_COLOR, "NV4097_SET_ATTRIB_COLOR" }, + { NV4097_SET_ATTRIB_TEX_COORD, "NV4097_SET_ATTRIB_TEX_COORD" }, + { NV4097_SET_ATTRIB_TEX_COORD_EX, "NV4097_SET_ATTRIB_TEX_COORD_EX" }, + { NV4097_SET_ATTRIB_UCLIP0, "NV4097_SET_ATTRIB_UCLIP0" }, + { NV4097_SET_ATTRIB_UCLIP1, "NV4097_SET_ATTRIB_UCLIP1" }, + { NV4097_INVALIDATE_L2, "NV4097_INVALIDATE_L2" }, + { NV4097_SET_REDUCE_DST_COLOR, "NV4097_SET_REDUCE_DST_COLOR" }, + { NV4097_SET_NO_PARANOID_TEXTURE_FETCHES, "NV4097_SET_NO_PARANOID_TEXTURE_FETCHES" }, + { NV4097_SET_SHADER_PACKER, "NV4097_SET_SHADER_PACKER" }, + { NV4097_SET_VERTEX_ATTRIB_INPUT_MASK, "NV4097_SET_VERTEX_ATTRIB_INPUT_MASK" }, + { NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK, "NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK" }, { NV4097_SET_TRANSFORM_BRANCH_BITS, "NV4097_SET_TRANSFORM_BRANCH_BITS" } }; diff --git a/rpcs3/Emu/GS/GL/GLGSRender.cpp b/rpcs3/Emu/GS/GL/GLGSRender.cpp index 34d5f43399..99322ba4da 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.cpp +++ b/rpcs3/Emu/GS/GL/GLGSRender.cpp @@ -15,11 +15,7 @@ #endif gcmBuffer gcmBuffers[8]; -GLuint g_flip_tex; -GLuint g_depth_tex; -GLuint g_pbo[6]; - - +GLuint g_flip_tex, g_depth_tex, g_pbo[6]; int last_width = 0, last_height = 0, last_depth_format = 0; GLenum g_last_gl_error = GL_NO_ERROR; @@ -40,7 +36,6 @@ void printGlError(GLenum err, const std::string& situation) #define checkForGlError(x) /*x*/ #endif - GLGSRender::GLGSRender() : GSRender() , m_frame(nullptr) @@ -303,6 +298,7 @@ void GLGSRender::InitVertexData() l = m_program.GetLocation("scaleOffsetMat"); glUniformMatrix4fv(l, 1, false, scaleOffsetMat); + checkForGlError("glUniformMatrix4fv"); } void GLGSRender::InitFragmentData() @@ -319,7 +315,7 @@ void GLGSRender::InitFragmentData() u32 id = c.id - m_cur_shader_prog->offset; - //ConLog.Warning("fc%u[0x%x - 0x%x] = (%f, %f, %f, %f)", id, c.id, m_cur_shader_prog->offset, c.x, c.y, c.z, c.w); + //LOG_WARNING(RSX,"fc%u[0x%x - 0x%x] = (%f, %f, %f, %f)", id, c.id, m_cur_shader_prog->offset, c.x, c.y, c.z, c.w); const std::string name = fmt::Format("fc%u", id); const int l = m_program.GetLocation(name); @@ -464,28 +460,31 @@ void GLGSRender::WriteDepthBuffer() u32 address = GetAddress(m_surface_offset_z, m_context_dma_z - 0xfeed0000); if (!Memory.IsGoodAddr(address)) { - LOG_WARNING(RSX, "Bad depth address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_z, m_context_dma_z); + LOG_WARNING(RSX, "Bad depth buffer address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_z, m_context_dma_z); return; } glBindBuffer(GL_PIXEL_PACK_BUFFER, g_pbo[5]); + checkForGlError("WriteDepthBuffer(): glBindBuffer"); glBufferData(GL_PIXEL_PACK_BUFFER, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4, 0, GL_DYNAMIC_READ); + checkForGlError("WriteDepthBuffer(): glBufferData"); glReadPixels(0, 0, RSXThread::m_buffer_width, RSXThread::m_buffer_height, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, 0); - checkForGlError("WriteDepthBuffer(): glReadPixels(GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE)"); + checkForGlError("WriteDepthBuffer(): glReadPixels"); GLubyte *packed = (GLubyte *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (packed) { memcpy(&Memory[address], packed, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); + checkForGlError("WriteDepthBuffer(): glUnmapBuffer"); } glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + checkForGlError("WriteDepthBuffer(): glBindBuffer"); glBindTexture(GL_TEXTURE_2D, g_depth_tex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, RSXThread::m_buffer_width, RSXThread::m_buffer_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &Memory[address]); - checkForGlError("glTexImage2D"); + checkForGlError("WriteDepthBuffer(): glTexImage2D"); glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &Memory[address]); - checkForGlError("glGetTexImage"); - + checkForGlError("WriteDepthBuffer(): glGetTexImage"); } void GLGSRender::WriteColorBufferA() @@ -498,23 +497,27 @@ void GLGSRender::WriteColorBufferA() u32 address = GetAddress(m_surface_offset_a, m_context_dma_color_a - 0xfeed0000); if (!Memory.IsGoodAddr(address)) { - LOG_WARNING(RSX, "Bad color buffer a address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_a, m_context_dma_color_a); + LOG_ERROR(RSX, "Bad color buffer A address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_a, m_context_dma_color_a); return; } glReadBuffer(GL_COLOR_ATTACHMENT0); checkForGlError("WriteColorBufferA(): glReadBuffer(GL_COLOR_ATTACHMENT0)"); glBindBuffer(GL_PIXEL_PACK_BUFFER, g_pbo[0]); + checkForGlError("WriteColorBufferA(): glBindBuffer"); glBufferData(GL_PIXEL_PACK_BUFFER, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4, 0, GL_STREAM_READ); + checkForGlError("WriteColorBufferA(): glBufferData"); glReadPixels(0, 0, RSXThread::m_buffer_width, RSXThread::m_buffer_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, 0); - checkForGlError("WriteColorBufferA(): glReadPixels(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8)"); + checkForGlError("WriteColorBufferA(): glReadPixels"); GLubyte *packed = (GLubyte *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (packed) { memcpy(&Memory[address], packed, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); + checkForGlError("WriteColorBufferA(): glUnmapBuffer"); } glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + checkForGlError("WriteColorBufferA(): glBindBuffer"); } void GLGSRender::WriteColorBufferB() @@ -527,23 +530,27 @@ void GLGSRender::WriteColorBufferB() u32 address = GetAddress(m_surface_offset_b, m_context_dma_color_b - 0xfeed0000); if (!Memory.IsGoodAddr(address)) { - LOG_WARNING(RSX, "Bad color buffer b address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_b, m_context_dma_color_b); + LOG_ERROR(RSX, "Bad color buffer B address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_b, m_context_dma_color_b); return; } glReadBuffer(GL_COLOR_ATTACHMENT1); checkForGlError("WriteColorBufferB(): glReadBuffer(GL_COLOR_ATTACHMENT1)"); glBindBuffer(GL_PIXEL_PACK_BUFFER, g_pbo[1]); + checkForGlError("WriteColorBufferB(): glBindBuffer"); glBufferData(GL_PIXEL_PACK_BUFFER, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4, 0, GL_STREAM_READ); + checkForGlError("WriteColorBufferB(): glBufferData"); glReadPixels(0, 0, RSXThread::m_buffer_width, RSXThread::m_buffer_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, 0); - checkForGlError("WriteColorBufferB(): glReadPixels(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8)"); + checkForGlError("WriteColorBufferB(): glReadPixels"); GLubyte *packed = (GLubyte *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (packed) { memcpy(&Memory[address], packed, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); + checkForGlError("WriteColorBufferB(): glUnmapBuffer"); } glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + checkForGlError("WriteColorBufferB(): glBindBuffer"); } @@ -557,23 +564,27 @@ void GLGSRender::WriteColorBufferC() u32 address = GetAddress(m_surface_offset_c, m_context_dma_color_c - 0xfeed0000); if (!Memory.IsGoodAddr(address)) { - LOG_WARNING(RSX, "Bad color buffer c address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_c, m_context_dma_color_c); + LOG_ERROR(RSX, "Bad color buffer C address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_c, m_context_dma_color_c); return; } glReadBuffer(GL_COLOR_ATTACHMENT2); checkForGlError("WriteColorBufferC(): glReadBuffer(GL_COLOR_ATTACHMENT2)"); glBindBuffer(GL_PIXEL_PACK_BUFFER, g_pbo[2]); + checkForGlError("WriteColorBufferC(): glBindBuffer"); glBufferData(GL_PIXEL_PACK_BUFFER, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4, 0, GL_STREAM_READ); + checkForGlError("WriteColorBufferC(): glBufferData"); glReadPixels(0, 0, RSXThread::m_buffer_width, RSXThread::m_buffer_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, 0); - checkForGlError("WriteColorBufferC(): glReadPixels(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8)"); + checkForGlError("WriteColorBufferC(): glReadPixels"); GLubyte *packed = (GLubyte *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (packed) { memcpy(&Memory[address], packed, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); + checkForGlError("WriteColorBufferC(): glUnmapBuffer"); } glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + checkForGlError("WriteColorBufferC(): glBindBuffer"); } void GLGSRender::WriteColorBufferD() @@ -586,24 +597,28 @@ void GLGSRender::WriteColorBufferD() u32 address = GetAddress(m_surface_offset_d, m_context_dma_color_d - 0xfeed0000); if (!Memory.IsGoodAddr(address)) { - LOG_WARNING(RSX, "Bad color buffer d address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_d, m_context_dma_color_d); + LOG_ERROR(RSX, "Bad color buffer D address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_d, m_context_dma_color_d); return; } glReadBuffer(GL_COLOR_ATTACHMENT3); checkForGlError("WriteColorBufferD(): glReadBuffer(GL_COLOR_ATTACHMENT3)"); glBindBuffer(GL_PIXEL_PACK_BUFFER, g_pbo[3]); + checkForGlError("WriteColorBufferD(): glBindBuffer"); glBufferData(GL_PIXEL_PACK_BUFFER, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4, 0, GL_STREAM_READ); + checkForGlError("WriteColorBufferD(): glBufferData"); glReadPixels(0, 0, RSXThread::m_buffer_width, RSXThread::m_buffer_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8, 0); - checkForGlError("WriteColorBufferD(): glReadPixels(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8)"); + checkForGlError("WriteColorBufferD(): glReadPixels"); GLubyte *packed = (GLubyte *)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); if (packed) { memcpy(&Memory[address], packed, RSXThread::m_buffer_width * RSXThread::m_buffer_height * 4); glUnmapBuffer(GL_PIXEL_PACK_BUFFER); + checkForGlError("WriteColorBufferD(): glUnmapBuffer"); + } glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); - + checkForGlError("WriteColorBufferD(): glBindBuffer"); } void GLGSRender::WriteColorBuffers() @@ -670,6 +685,7 @@ void GLGSRender::OnInitThread() glEnable(GL_TEXTURE_2D); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); + glGenTextures(1, &g_depth_tex); glGenTextures(1, &g_flip_tex); glGenBuffers(6, g_pbo); @@ -691,6 +707,9 @@ void GLGSRender::OnExitThread() glDeleteTextures(1, &g_depth_tex); glDeleteBuffers(6, g_pbo); + glDisable(GL_TEXTURE_2D); + glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); + m_program.Delete(); m_rbo.Delete(); m_fbo.Delete(); @@ -824,6 +843,8 @@ void GLGSRender::InitDrawBuffers() glDrawBuffers(4, draw_buffers); break; + checkForGlError("glDrawBuffers"); + default: LOG_ERROR(RSX, "Bad surface color target: %d", m_surface_color_target); break; @@ -853,6 +874,7 @@ void GLGSRender::ExecCMD(u32 cmd) if (m_clear_surface_mask & 0x1) { glClearDepth(m_clear_surface_z / (float)0xffffff); + checkForGlError("glClearDepth"); f |= GL_DEPTH_BUFFER_BIT; } @@ -860,6 +882,7 @@ void GLGSRender::ExecCMD(u32 cmd) if (m_clear_surface_mask & 0x2) { glClearStencil(m_clear_surface_s); + checkForGlError("glClearStencil"); f |= GL_STENCIL_BUFFER_BIT; } @@ -871,11 +894,13 @@ void GLGSRender::ExecCMD(u32 cmd) m_clear_surface_color_g / 255.0f, m_clear_surface_color_b / 255.0f, m_clear_surface_color_a / 255.0f); + checkForGlError("glClearColor"); f |= GL_COLOR_BUFFER_BIT; } glClear(f); + checkForGlError("glClear"); WriteBuffers(); } @@ -892,10 +917,17 @@ void GLGSRender::ExecCMD() InitDrawBuffers(); + if (m_set_color_mask) + { + glColorMask(m_color_mask_r, m_color_mask_g, m_color_mask_b, m_color_mask_a); + checkForGlError("glColorMask"); + } + Enable(m_set_depth_test, GL_DEPTH_TEST); Enable(m_set_alpha_test, GL_ALPHA_TEST); Enable(m_set_depth_bounds_test, GL_DEPTH_BOUNDS_TEST_EXT); Enable(m_set_blend || m_set_blend_mrt1 || m_set_blend_mrt2 || m_set_blend_mrt3, GL_BLEND); + Enable(m_set_scissor_horizontal && m_set_scissor_vertical, GL_SCISSOR_TEST); Enable(m_set_logic_op, GL_LOGIC_OP); Enable(m_set_cull_face, GL_CULL_FACE); Enable(m_set_dither, GL_DITHER); @@ -955,6 +987,12 @@ void GLGSRender::ExecCMD() checkForGlError("glLogicOp"); } + if (m_set_scissor_horizontal && m_set_scissor_vertical) + { + glScissor(m_scissor_x, m_scissor_y, m_scissor_w, m_scissor_h); + checkForGlError("glScissor"); + } + if(m_set_two_sided_stencil_test_enable) { if(m_set_stencil_fail && m_set_stencil_zfail && m_set_stencil_zpass) @@ -1173,7 +1211,7 @@ void GLGSRender::ExecCMD() if(m_draw_array_count) { - //ConLog.Warning("glDrawArrays(%d,%d,%d)", m_draw_mode - 1, m_draw_array_first, m_draw_array_count); + //LOG_WARNING(RSX,"glDrawArrays(%d,%d,%d)", m_draw_mode - 1, m_draw_array_first, m_draw_array_count); glDrawArrays(m_draw_mode - 1, 0, m_draw_array_count); checkForGlError("glDrawArrays"); DisableVertexData(); diff --git a/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp b/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp index 87aacb94db..59eb82d573 100644 --- a/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp +++ b/rpcs3/Emu/GS/GL/GLProgramBuffer.cpp @@ -117,9 +117,11 @@ void GLProgramBuffer::Clear() { for(u32 i=0; i> 31); CMD_LOG("num=%d, addr=0x%x", index, addr); @@ -459,7 +425,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case_16(NV4097_SET_VERTEX_DATA_ARRAY_FORMAT, 4) : + case_16(NV4097_SET_VERTEX_DATA_ARRAY_FORMAT, 4): { const u32 a0 = ARGS(0); u16 frequency = a0 >> 16; @@ -632,7 +598,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 case NV4097_SET_REDUCE_DST_COLOR: { if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_REDUCE_DST_COLOR: 0x % x", ARGS(0)); + LOG_WARNING(RSX, "NV4097_SET_REDUCE_DST_COLOR: 0x%x", ARGS(0)); } break; @@ -714,8 +680,12 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 case NV4097_SET_CLIP_MAX: { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_CLIP_MAX: %x", ARGS(0)); + const u32 a0 = ARGS(0); + + m_set_clip = true; + m_clip_max = (float&)a0; + + CMD_LOG("clip_max=%.01f", m_clip_max); } break; @@ -845,13 +815,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case NV4097_CLEAR_REPORT_VALUE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_CLEAR_REPORT_VALUE: %x", ARGS(0)); - } - break; - case NV4097_SET_CLEAR_RECT_HORIZONTAL: { if (ARGS(0)) @@ -1527,11 +1490,14 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 // Anti-aliasing case NV4097_SET_ANTI_ALIASING_CONTROL: { - // TODO: - // (cmd)[1] = CELL_GCM_ENDIAN_SWAP((enable) | ((alphaToCoverage) << 4) | ((alphaToOne) << 8) | ((sampleMask) << 16)); \ + const u32 a0 = ARGS(0); - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_ANTI_ALIASING_CONTROL: %x", ARGS(0)); + const u8 enable = a0 & 0xf; + const u8 alphaToCoverage = (a0 >> 4) & 0xf; + const u8 alphaToOne = (a0 >> 8) & 0xf; + const u16 sampleMask = a0 >> 16; + + LOG_WARNING(RSX, "TODO: NV4097_SET_ANTI_ALIASING_CONTROL: %x", a0); } break; @@ -1626,13 +1592,13 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 break; case NV4097_ZCULL_SYNC: - { + { if (ARGS(0)) LOG_WARNING(RSX, "NV4097_ZCULL_SYNC: %x", ARGS(0)); } break; - // Reporting + // Reports case NV4097_GET_REPORT: { const u32 a0 = ARGS(0); @@ -1667,6 +1633,24 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; + case NV4097_CLEAR_REPORT_VALUE: + { + const u32 type = ARGS(0); + + switch(type) + { + case CELL_GCM_ZPASS_PIXEL_CNT: + LOG_WARNING(RSX, "TODO: NV4097_CLEAR_REPORT_VALUE: ZPASS_PIXEL_CNT"); + break; + case CELL_GCM_ZCULL_STATS: + LOG_WARNING(RSX, "TODO: NV4097_CLEAR_REPORT_VALUE: ZCULL_STATS"); + break; + default: + LOG_ERROR(RSX, "NV4097_CLEAR_REPORT_VALUE: Bad type: %d", type); + } + } + break; + // Clip Plane case NV4097_SET_USER_CLIP_PLANE_CONTROL: { @@ -1702,40 +1686,20 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 // Zmin_max case NV4097_SET_ZMIN_MAX_CONTROL: { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_ZMIN_MAX_CONTROL: %x", ARGS(0)); - - // TODO: - // (cmd)[1] = CELL_GCM_ENDIAN_SWAP((cullNearFarEnable) | ((zclampEnable) << 4) | ((cullIgnoreW)<<8)); + const u8 cullNearFarEnable = ARGS(0) & 0xf; + const u8 zclampEnable = (ARGS(0) >> 4) & 0xf; + const u8 cullIgnoreW = (ARGS(0) >> 8) & 0xf; + LOG_WARNING(RSX, "TODO: NV4097_SET_ZMIN_MAX_CONTROL: cullNearFarEnable=%d, zclampEnable=%d, cullIgnoreW=%d", + cullNearFarEnable, zclampEnable, cullIgnoreW); } break; // Windows Clipping case NV4097_SET_WINDOW_OFFSET: { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_WINDOW_OFFSET: %x", ARGS(0)); - } - break; - - case NV4097_SET_WINDOW_CLIP_TYPE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_WINDOW_CLIP_TYPE: %x", ARGS(0)); - } - break; - - case NV4097_SET_WINDOW_CLIP_HORIZONTAL: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_WINDOW_CLIP_HORIZONTAL: %x", ARGS(0)); - } - break; - - case NV4097_SET_WINDOW_CLIP_VERTICAL: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_WINDOW_CLIP_VERTICAL: %x", ARGS(0)); + const u16 x = ARGS(0); + const u16 y = ARGS(0) >> 16; + LOG_WARNING(RSX, "TODO: NV4097_SET_WINDOW_OFFSET: x=%d, y=%d", x, y); } break; @@ -1747,68 +1711,30 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 case NV4097_SET_RENDER_ENABLE: { - // TODO: - // (cmd)[1] = CELL_GCM_ENDIAN_SWAP((offset) | ((mode) << 24)); \ - - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_RENDER_ENABLE: %x", ARGS(0)); + const u32 offset = ARGS(0) & 0xffffff; + const u8 mode = ARGS(0) >> 24; + LOG_WARNING(RSX, "NV4097_SET_RENDER_ENABLE: Offset=%06x, Mode=%x", offset, mode); } break; case NV4097_SET_ZPASS_PIXEL_COUNT_ENABLE: { - if (ARGS(0)) - LOG_WARNING(RSX, "NV4097_SET_ZPASS_PIXEL_COUNT_ENABLE: %x", ARGS(0)); + const u32 enable = ARGS(0); + LOG_WARNING(RSX, "TODO: NV4097_SET_ZPASS_PIXEL_COUNT_ENABLE: %d", enable); } break; - case 0x000002c8: - case 0x000002d0: - case 0x000002d8: - case 0x000002e0: - case 0x000002e8: - case 0x000002f0: - case 0x000002f8: - break; - // NV0039 - case NV0039_SET_OBJECT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_SET_OBJECT: %x", ARGS(0)); - } - break; - - case NV0039_SET_CONTEXT_DMA_NOTIFIES: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_SET_CONTEXT_DMA_NOTIFIES: %x", ARGS(0)); - } - break; - - case NV0039_SET_CONTEXT_DMA_BUFFER_IN: // [E : RSXThread]: TODO: unknown/illegal method [0x00002184](0xfeed0000, 0xfeed0000) + case NV0039_SET_CONTEXT_DMA_BUFFER_IN: { const u32 srcContext = ARGS(0); const u32 dstContext = ARGS(1); - - if (srcContext == 0xfeed0000 && dstContext == 0xfeed0000) - { - } - else - { - LOG_WARNING(RSX, "NV0039_SET_CONTEXT_DMA_BUFFER_IN: TODO: srcContext=0x%x, dstContext=0x%x", srcContext, dstContext); - } + m_context_dma_buffer_in_src = srcContext; + m_context_dma_buffer_in_dst = dstContext; } break; - case NV0039_SET_CONTEXT_DMA_BUFFER_OUT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_SET_CONTEXT_DMA_BUFFER_OUT: %x", ARGS(0)); - } - break; - - case NV0039_OFFSET_IN: // [E : RSXThread]: TODO: unknown/illegal method [0x0000230c](0x0, 0xb00400, 0x0, 0x0, 0x384000, 0x1, 0x101, 0x0) + case NV0039_OFFSET_IN: { const u32 inOffset = ARGS(0); const u32 outOffset = ARGS(1); @@ -1816,12 +1742,16 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 const u32 outPitch = ARGS(3); const u32 lineLength = ARGS(4); const u32 lineCount = ARGS(5); - const u32 format = ARGS(6); - const u8 outFormat = (format >> 8); - const u8 inFormat = (format >> 0); + const u8 outFormat = (ARGS(6) >> 8); + const u8 inFormat = (ARGS(6) >> 0); const u32 notify = ARGS(7); - if (lineCount == 1 && !inPitch && !outPitch && !notify && format == 0x101) + // The existing GCM commands use only the value 0x1 for inFormat and outFormat + if (inFormat != 0x01 || outFormat != 0x01) { + LOG_ERROR(RSX, "NV0039_OFFSET_IN: Unsupported format: inFormat=%d, outFormat=%d", inFormat, outFormat); + } + + if (lineCount == 1 && !inPitch && !outPitch && !notify) { memcpy(&Memory[GetAddress(outOffset, 0)], &Memory[GetAddress(inOffset, 0)], lineLength); } @@ -1854,34 +1784,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case NV0039_PITCH_OUT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_PITCH_OUT: %x", ARGS(0)); - } - break; - - case NV0039_LINE_LENGTH_IN: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_LINE_LENGTH_IN: %x", ARGS(0)); - } - break; - - case NV0039_LINE_COUNT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_LINE_COUNT: %x", ARGS(0)); - } - break; - - case NV0039_FORMAT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV0039_FORMAT: %x", ARGS(0)); - } - break; - case NV0039_BUFFER_NOTIFY: { if (ARGS(0)) @@ -1890,33 +1792,18 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 break; // NV3062 - case NV3062_SET_OBJECT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3062_SET_OBJECT: %x", ARGS(0)); - } - break; - - case NV3062_SET_CONTEXT_DMA_NOTIFIES: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3062_SET_CONTEXT_DMA_NOTIFIES: %x", ARGS(0)); - } - break; - - case NV3062_SET_CONTEXT_DMA_IMAGE_SOURCE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3062_SET_CONTEXT_DMA_IMAGE_SOURCE: %x", ARGS(0)); - } - break; - case NV3062_SET_CONTEXT_DMA_IMAGE_DESTIN: { m_context_dma_img_dst = ARGS(0); } break; + case NV3062_SET_OFFSET_DESTIN: + { + m_dst_offset = ARGS(0); + } + break; + case NV3062_SET_COLOR_FORMAT: { m_color_format = ARGS(0); @@ -1925,41 +1812,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case NV3062_SET_PITCH: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3062_SET_PITCH: %x", ARGS(0)); - } - break; - - case NV3062_SET_OFFSET_SOURCE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3062_SET_OFFSET_SOURCE: %x", ARGS(0)); - } - break; - - case NV3062_SET_OFFSET_DESTIN: - { - m_dst_offset = ARGS(0); - } - break; - // NV309E - case NV309E_SET_OBJECT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV309E_SET_OBJECT: %x", ARGS(0)); - } - break; - - case NV309E_SET_CONTEXT_DMA_NOTIFIES: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV309E_SET_CONTEXT_DMA_NOTIFIES: %x", ARGS(0)); - } - break; - case NV309E_SET_CONTEXT_DMA_IMAGE: { if (ARGS(0)) @@ -1977,98 +1830,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case NV309E_SET_OFFSET: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV309E_SET_OFFSET: %x", ARGS(0)); - } - break; - // NV308A - case NV308A_SET_OBJECT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_OBJECT: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_DMA_NOTIFIES: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_DMA_NOTIFIES: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_COLOR_KEY: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_COLOR_KEY: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_CLIP_RECTANGLE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_CLIP_RECTANGLE: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_PATTERN: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_PATTERN: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_ROP: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_ROP: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_BETA1: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_BETA1: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_BETA4: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_BETA4: %x", ARGS(0)); - } - break; - - case NV308A_SET_CONTEXT_SURFACE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_CONTEXT_SURFACE: %x", ARGS(0)); - } - break; - - case NV308A_SET_COLOR_CONVERSION: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_COLOR_CONVERSION: %x", ARGS(0)); - } - break; - - case NV308A_SET_OPERATION: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_OPERATION: %x", ARGS(0)); - } - break; - - case NV308A_SET_COLOR_FORMAT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SET_COLOR_FORMAT: %x", ARGS(0)); - } - break; - case NV308A_POINT: { const u32 a0 = ARGS(0); @@ -2077,20 +1839,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case NV308A_SIZE_OUT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SIZE_OUT: %x", ARGS(0)); - } - break; - - case NV308A_SIZE_IN: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV308A_SIZE_IN: %x", ARGS(0)); - } - break; - case NV308A_COLOR: { RSXTransformConstant c; @@ -2135,54 +1883,12 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 break; // NV3089 - case NV3089_SET_OBJECT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_OBJECT: %x", ARGS(0)); - } - break; - - case NV3089_SET_CONTEXT_DMA_NOTIFIES: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_CONTEXT_DMA_NOTIFIES: %x", ARGS(0)); - } - break; - case NV3089_SET_CONTEXT_DMA_IMAGE: { m_context_dma_img_src = ARGS(0); } break; - case NV3089_SET_CONTEXT_PATTERN: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_CONTEXT_PATTERN: %x", ARGS(0)); - } - break; - - case NV3089_SET_CONTEXT_ROP: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_CONTEXT_ROP: %x", ARGS(0)); - } - break; - - case NV3089_SET_CONTEXT_BETA1: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_CONTEXT_BETA1: %x", ARGS(0)); - } - break; - - case NV3089_SET_CONTEXT_BETA4: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_CONTEXT_BETA4: %x", ARGS(0)); - } - break; - case NV3089_SET_CONTEXT_SURFACE: { if (ARGS(0) != CELL_GCM_CONTEXT_SURFACE2D) @@ -2192,80 +1898,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; - case NV3089_SET_COLOR_CONVERSION: - { - m_color_conv = ARGS(0); - m_color_conv_fmt = ARGS(1); - m_color_conv_op = ARGS(2); - m_color_conv_in_x = ARGS(3); - m_color_conv_in_y = ARGS(3) >> 16; - m_color_conv_in_w = ARGS(4); - m_color_conv_in_h = ARGS(4) >> 16; - m_color_conv_out_x = ARGS(5); - m_color_conv_out_y = ARGS(5) >> 16; - m_color_conv_out_w = ARGS(6); - m_color_conv_out_h = ARGS(6) >> 16; - m_color_conv_dsdx = ARGS(7); - m_color_conv_dtdy = ARGS(8); - } - break; - - case NV3089_SET_COLOR_FORMAT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_COLOR_FORMAT: %x", ARGS(0)); - } - break; - - case NV3089_SET_OPERATION: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_SET_OPERATION: %x", ARGS(0)); - } - break; - - case NV3089_CLIP_POINT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_CLIP_POINT: %x", ARGS(0)); - } - break; - - case NV3089_CLIP_SIZE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_CLIP_SIZE: %x", ARGS(0)); - } - break; - - case NV3089_IMAGE_OUT_POINT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_IMAGE_OUT_POINT: %x", ARGS(0)); - } - break; - - case NV3089_IMAGE_OUT_SIZE: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_IMAGE_OUT_SIZE: %x", ARGS(0)); - } - break; - - case NV3089_DS_DX: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_DS_DX: %x", ARGS(0)); - } - break; - - case NV3089_DT_DY: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_DT_DY: %x", ARGS(0)); - } - break; - case NV3089_IMAGE_IN_SIZE: { u16 width = ARGS(0); @@ -2294,25 +1926,22 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } } break; - - case NV3089_IMAGE_IN_FORMAT: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_IMAGE_IN_FORMAT: %x", ARGS(0)); - } - break; - case NV3089_IMAGE_IN_OFFSET: + case NV3089_SET_COLOR_CONVERSION: { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_IMAGE_IN_OFFSET: %x", ARGS(0)); - } - break; - - case NV3089_IMAGE_IN: - { - if (ARGS(0)) - LOG_WARNING(RSX, "NV3089_IMAGE_IN: %x", ARGS(0)); + m_color_conv = ARGS(0); + m_color_conv_fmt = ARGS(1); + m_color_conv_op = ARGS(2); + m_color_conv_in_x = ARGS(3); + m_color_conv_in_y = ARGS(3) >> 16; + m_color_conv_in_w = ARGS(4); + m_color_conv_in_h = ARGS(4) >> 16; + m_color_conv_out_x = ARGS(5); + m_color_conv_out_y = ARGS(5) >> 16; + m_color_conv_out_w = ARGS(6); + m_color_conv_out_h = ARGS(6) >> 16; + m_color_conv_dsdx = ARGS(7); + m_color_conv_dtdy = ARGS(8); } break; @@ -2324,14 +1953,105 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32 } break; + // Note: What is this? NV4097 offsets? + case 0x000002c8: + case 0x000002d0: + case 0x000002d8: + case 0x000002e0: + case 0x000002e8: + case 0x000002f0: + case 0x000002f8: + break; + + // The existing GCM commands don't use any of the following NV4097 / NV0039 / NV3062 / NV309E / NV308A / NV3089 methods + case NV4097_SET_WINDOW_CLIP_TYPE: + case NV4097_SET_WINDOW_CLIP_HORIZONTAL: + case NV4097_SET_WINDOW_CLIP_VERTICAL: + { + LOG_WARNING(RSX, "Unused NV4097 method 0x%x detected!", cmd); + } + break; + + case NV0039_SET_CONTEXT_DMA_BUFFER_OUT: + case NV0039_PITCH_OUT: + case NV0039_LINE_LENGTH_IN: + case NV0039_LINE_COUNT: + case NV0039_FORMAT: + case NV0039_SET_OBJECT: + case NV0039_SET_CONTEXT_DMA_NOTIFIES: + { + LOG_WARNING(RSX, "Unused NV0039 method 0x%x detected!", cmd); + } + break; + + case NV3062_SET_OBJECT: + case NV3062_SET_CONTEXT_DMA_NOTIFIES: + case NV3062_SET_CONTEXT_DMA_IMAGE_SOURCE: + case NV3062_SET_PITCH: + case NV3062_SET_OFFSET_SOURCE: + { + LOG_WARNING(RSX, "Unused NV3062 method 0x%x detected!", cmd); + } + break; + + case NV308A_SET_OBJECT: + case NV308A_SET_CONTEXT_DMA_NOTIFIES: + case NV308A_SET_CONTEXT_COLOR_KEY: + case NV308A_SET_CONTEXT_CLIP_RECTANGLE: + case NV308A_SET_CONTEXT_PATTERN: + case NV308A_SET_CONTEXT_ROP: + case NV308A_SET_CONTEXT_BETA1: + case NV308A_SET_CONTEXT_BETA4: + case NV308A_SET_CONTEXT_SURFACE: + case NV308A_SET_COLOR_CONVERSION: + case NV308A_SET_OPERATION: + case NV308A_SET_COLOR_FORMAT: + case NV308A_SIZE_OUT: + case NV308A_SIZE_IN: + { + LOG_WARNING(RSX, "Unused NV308A method 0x%x detected!", cmd); + } + break; + + case NV309E_SET_OBJECT: + case NV309E_SET_CONTEXT_DMA_NOTIFIES: + case NV309E_SET_OFFSET: + { + LOG_WARNING(RSX, "Unused NV309E method 0x%x detected!", cmd); + } + break; + + case NV3089_SET_OBJECT: + case NV3089_SET_CONTEXT_DMA_NOTIFIES: + case NV3089_SET_CONTEXT_PATTERN: + case NV3089_SET_CONTEXT_ROP: + case NV3089_SET_CONTEXT_BETA1: + case NV3089_SET_CONTEXT_BETA4: + case NV3089_SET_COLOR_FORMAT: + case NV3089_SET_OPERATION: + case NV3089_CLIP_POINT: + case NV3089_CLIP_SIZE: + case NV3089_IMAGE_OUT_POINT: + case NV3089_IMAGE_OUT_SIZE: + case NV3089_DS_DX: + case NV3089_DT_DY: + case NV3089_IMAGE_IN_FORMAT: + case NV3089_IMAGE_IN_OFFSET: + case NV3089_IMAGE_IN: + { + LOG_WARNING(RSX, "Unused NV3089 method 0x%x detected!", cmd); + } + break; + default: { std::string log = GetMethodName(cmd); log += "("; - for(u32 i=0; iAddFunc(0xbd28fdbf, sceNpInit); @@ -141,4 +2280,361 @@ void sceNp_init() sceNp->AddFunc(0xf283c143, sceNpDrmExecuteGamePurchase); sceNp->AddFunc(0xcf51864b, sceNpDrmGetTimelimit); sceNp->AddFunc(0xa7bff757, sceNpManagerGetStatus); + sceNp->AddFunc(0x000e53cc, sceNpManagerSubSignout); + sceNp->AddFunc(0x01cd9cfd, sceNpCommerceGetChildProductSkuInfo); + sceNp->AddFunc(0x01fbbc9b, sceNpBasicSendMessageGui); + sceNp->AddFunc(0x03c741a7, sceNpMatchingGetResult); + sceNp->AddFunc(0x04372385, sceNpBasicGetFriendListEntry); + sceNp->AddFunc(0x04ca5e6a, sceNpScoreRecordGameData); + sceNp->AddFunc(0x0561448b, sceNpCommerceGetDataFlagAbort); + sceNp->AddFunc(0x05af1cb8, sceNpBasicGetMatchingInvitationEntry); + sceNp->AddFunc(0x05d65dff, sceNpScoreGetRankingByNpId); + sceNp->AddFunc(0x0968aa36, sceNpManagerGetTicket); + sceNp->AddFunc(0x14497465, sceNpMatchingQuickMatchGUI); + sceNp->AddFunc(0x155de760, sceNpSignalingGetConnectionInfo); + sceNp->AddFunc(0x166dcc11, sceNpLookupNpId); + sceNp->AddFunc(0x1672170e, sceNpScoreRecordScore); + sceNp->AddFunc(0x168a3117, sceNpBasicAddPlayersHistory); + sceNp->AddFunc(0x168fcece, sceNpManagerGetAccountAge); + sceNp->AddFunc(0x16f88a6f, sceNpManagerGetPsHandle); + sceNp->AddFunc(0x1a2704f7, sceNpScoreWaitAsync); + sceNp->AddFunc(0x1a3fcb69, sceNpCommerceGetSkuUserData); + sceNp->AddFunc(0x1ae8a549, sceNpBasicAddBlockListEntry); + sceNp->AddFunc(0x1fdb3ec2, sceNpLookupUserProfileWithAvatarSizeAsync); + sceNp->AddFunc(0x21206642, sceNpScoreGetRankingByRangeAsync); + sceNp->AddFunc(0x227f8763, sceNpScoreGetClansRankingByClanIdAsync); + sceNp->AddFunc(0x259113b8, sceNpScoreDestroyTitleCtx); + sceNp->AddFunc(0x260caedd, sceNpBasicGetFriendPresenceByNpId2); + sceNp->AddFunc(0x2687a127, sceNpSignalingGetCtxOpt); + sceNp->AddFunc(0x26b3bc94, sceNpMatchingGetResultGUI); + sceNp->AddFunc(0x26f33146, sceNpCommerceGetProductCategoryStart); + sceNp->AddFunc(0x2706eaa1, sceNpScoreSetPlayerCharacterId); + sceNp->AddFunc(0x276c72b2, sceNpSignalingSetCtxOpt); + sceNp->AddFunc(0x27c69eba, sceNpBasicAddFriend); + sceNp->AddFunc(0x29dd45dc, sceNpScoreSetTimeout); + sceNp->AddFunc(0x2a76895a, sceNpScoreGetClansRankingByClanId); + sceNp->AddFunc(0x2ad7837d, sceNpMatchingAcceptInvitationGUI); + sceNp->AddFunc(0x2be41ece, sceNpCommerceGetNumOfChildCategory); + sceNp->AddFunc(0x2cd2a1af, sceNpScoreSanitizeCommentAsync); + sceNp->AddFunc(0x2e1c5068, sceNpMatchingDestroyCtx); + sceNp->AddFunc(0x2f2c6b3e, sceNpProfileAbortGui); + sceNp->AddFunc(0x2fccbfe0, sceNpLookupUserProfileWithAvatarSize); + sceNp->AddFunc(0x30d1cbde, sceNpBasicGetMessageEntry); + sceNp->AddFunc(0x32200389, sceNpManagerGetMyLanguages); + sceNp->AddFunc(0x32c78a6a, sceNpBasicGetFriendPresenceByIndex); + sceNp->AddFunc(0x32cf311f, sceNpScoreInit); + sceNp->AddFunc(0x32febb4c, sceNpMatchingSearchJoinRoomGUI); + sceNp->AddFunc(0x34cc0ca4, sceNpMatchingKickRoomMember); + sceNp->AddFunc(0x34ce82a0, sceNpSignalingGetConnectionFromPeerAddress); + sceNp->AddFunc(0x359642a6, sceNpCommerceGetCategoryDescription); + sceNp->AddFunc(0x36d0c2c5, sceNpManagerGetAvatarUrl); + sceNp->AddFunc(0x39a69619, sceNpCommerceGetSkuId); + sceNp->AddFunc(0x3b02418d, sceNpScoreGetGameData); + sceNp->AddFunc(0x3cc8588a, sceNpMatchingCreateRoomGUI); + sceNp->AddFunc(0x3d1760dc, sceNpLookupAbortTransaction); + sceNp->AddFunc(0x3db7914d, sceNpScoreGetRankingByNpIdAsync); + sceNp->AddFunc(0x3f0808aa, sceNpBasicSetPresence); + sceNp->AddFunc(0x3f195b3a, sceNpCommerceGetProductCategoryResult); + sceNp->AddFunc(0x4026eac5, sceNpBasicRegisterContextSensitiveHandler); + sceNp->AddFunc(0x41ffd4f2, sceNpScoreGetClansMembersRankingByNpIdPcId); + sceNp->AddFunc(0x433fcb30, sceNpScoreGetClansMembersRankingByNpIdPcIdAsync); + sceNp->AddFunc(0x43b989f5, sceNpBasicSendMessageAttachment); + sceNp->AddFunc(0x442381f7, sceNpManagerSubSignin); + sceNp->AddFunc(0x45f8f3aa, sceNpCustomMenuRegisterActions); + sceNp->AddFunc(0x474b7b13, sceNpMatchingJoinRoomGUI); + sceNp->AddFunc(0x481ce0e8, sceNpBasicAbortGui); + sceNp->AddFunc(0x4a18a89e, sceNpMatchingSetRoomInfoNoLimit); + sceNp->AddFunc(0x4b9efb7a, sceNpManagerGetCachedInfo); + sceNp->AddFunc(0x4d5e0670, sceNpScoreGetClansMembersRankingByRangeAsync); + sceNp->AddFunc(0x4d9c615d, sceNpBasicGetClanMessageEntry); + sceNp->AddFunc(0x50b86d94, sceNpSignalingAddExtendedHandler); + sceNp->AddFunc(0x52a6b523, sceNpManagerUnregisterCallback); + sceNp->AddFunc(0x58fa4fcd, sceNpManagerGetTicketParam); + sceNp->AddFunc(0x5d543bbe, sceNpBasicGetMessageAttachmentEntry); + sceNp->AddFunc(0x5de61626, sceNpLookupDestroyTitleCtx); + sceNp->AddFunc(0x5e117ed5, sceNpLookupTitleStorageAsync); + sceNp->AddFunc(0x5e849303, sceNpBasicSetPresenceDetails2); + sceNp->AddFunc(0x5f2d9257, sceNpLookupInit); + sceNp->AddFunc(0x60440c73, sceNpManagerSubSigninAbortGui); + sceNp->AddFunc(0x60897c38, sceNpSignalingActivateConnection); + sceNp->AddFunc(0x6356082e, sceNpSignalingCreateCtx); + sceNp->AddFunc(0x6453b27b, sceNpBasicGetFriendPresenceByIndex2); + sceNp->AddFunc(0x64a704cc, sceNpBasicRecvMessageAttachmentLoad); + sceNp->AddFunc(0x64dbb89d, sceNpSignalingCancelPeerNetInfo); + sceNp->AddFunc(0x674bb9ff, sceNpCommerceGetProductCategoryAbort); + sceNp->AddFunc(0x691f429d, sceNpMatchingGetRoomInfo); + sceNp->AddFunc(0x6cb81eb2, sceNpCommerceDestroyProductCategory); + sceNp->AddFunc(0x6d4adc3b, sceNpScoreGetClansMembersRankingByRange); + sceNp->AddFunc(0x6e2ab18b, sceNpCommerceGetCategoryName); + sceNp->AddFunc(0x6ee62ed2, sceNpManagerGetContentRatingFlag); + sceNp->AddFunc(0x6f5e8143, sceNpScoreCreateTransactionCtx); + sceNp->AddFunc(0x6f8fd267, sceNpMatchingSetRoomInfo); + sceNp->AddFunc(0x71e5af7e, sceNpLookupSetTimeout); + sceNp->AddFunc(0x7208dc08, sceNpCommerceGetNumOfChildProductSku); + sceNp->AddFunc(0x73931bd0, sceNpBasicGetBlockListEntryCount); + sceNp->AddFunc(0x73a2e36b, sceNpMatchingGetRoomMemberListLocal); + sceNp->AddFunc(0x741fbf24, sceNpScoreGetClanMemberGameData); + sceNp->AddFunc(0x7508112e, sceNpLookupPollAsync); + sceNp->AddFunc(0x75eb50cb, sceNpSignalingGetPeerNetInfo); + sceNp->AddFunc(0x78d7f9ad, sceNpCommerceGetSkuPrice); + sceNp->AddFunc(0x79225aa3, sceNpCommerceGetCurrencyCode); + sceNp->AddFunc(0x7b7e9137, sceNpScoreGetClansRankingByRangeAsync); + sceNp->AddFunc(0x7be47e61, sceNpScoreCensorCommentAsync); + sceNp->AddFunc(0x7deb244c, sceNpScoreCensorComment); + sceNp->AddFunc(0x7e2fef28, sceNpManagerRequestTicket); + sceNp->AddFunc(0x806960ab, sceNpBasicRecvMessageCustom); + sceNp->AddFunc(0x816c6a5f, _sceNpSysutilClientFree); + sceNp->AddFunc(0x8297f1ec, sceNpManagerRequestTicket2); + sceNp->AddFunc(0x8440537c, sceNpLookupTerm); + sceNp->AddFunc(0x860b1756, sceNpLookupTitleSmallStorageAsync); + sceNp->AddFunc(0x8b7bbd73, sceNpMatchingSendInvitationGUI); + sceNp->AddFunc(0x8d1d096c, sceNpCommerceInitProductCategory); + sceNp->AddFunc(0x8d4518a0, sceNpCommerceSetDataFlagFinish); + sceNp->AddFunc(0x9153bdf4, sceNpBasicGetMessageAttachmentEntryCount); + sceNp->AddFunc(0x9281e87a, sceNpCommerceGetDataFlagFinish); + sceNp->AddFunc(0x936df4aa, sceNpCommerceGetProductId); + sceNp->AddFunc(0x9452f4f8, sceNpCommerceGetCategoryImageURL); + sceNp->AddFunc(0x9458f464, sceNpCustomMenuRegisterExceptionList); + sceNp->AddFunc(0x95c7bba3, sceNpSignalingTerminateConnection); + sceNp->AddFunc(0x9851f805, sceNpScoreTerm); + sceNp->AddFunc(0x99ac9952, sceNpCommerceSetDataFlagStart); + sceNp->AddFunc(0x9ad7fbd1, sceNpSignalingGetLocalNetInfo); + sceNp->AddFunc(0x9ee9f97e, sceNpLookupTitleStorage); + sceNp->AddFunc(0xa15f35fe, sceNpBasicGetPlayersHistoryEntryCount); + sceNp->AddFunc(0xa1709abd, sceNpManagerGetEntitlementById); + sceNp->AddFunc(0xa284bd1d, sceNpMatchingSetRoomSearchFlag); + sceNp->AddFunc(0xa7a090e5, sceNpScorePollAsync); + sceNp->AddFunc(0xa85a4951, sceNpCommerceGetSkuDescription); + sceNp->AddFunc(0xa8afa7d4, sceNpBasicGetCustomInvitationEntryCount); + sceNp->AddFunc(0xaa16695f, sceNpDrmProcessExitSpawn); + sceNp->AddFunc(0xac66568c, sceNpMatchingCreateCtx); + sceNp->AddFunc(0xacb9ee8e, sceNpBasicUnregisterHandler); + sceNp->AddFunc(0xaee8cf71, sceNpCommerceGetCategoryId); + sceNp->AddFunc(0xaf3eba5a, sceNpCommerceDoCheckoutFinishAsync); + sceNp->AddFunc(0xaf505def, sceNpBasicGetMatchingInvitationEntryCount); + sceNp->AddFunc(0xaf57d9c9, sceNpCommerceGetCurrencyDecimals); + sceNp->AddFunc(0xafef640d, sceNpBasicGetFriendListEntryCount); + sceNp->AddFunc(0xb020684e, sceNpMatchingGetRoomInfoNoLimit); + sceNp->AddFunc(0xb082003b, sceNpScoreGetClansRankingByRange); + sceNp->AddFunc(0xb1c02d66, sceNpCommerceGetCurrencyInfo); + sceNp->AddFunc(0xb1e0718b, sceNpManagerGetAccountRegion); + sceNp->AddFunc(0xb5cb2d56, sceNpBasicRecvMessageAttachment); + sceNp->AddFunc(0xb6017827, sceNpLookupAvatarImage); + sceNp->AddFunc(0xb66d1c46, sceNpManagerGetEntitlementIdList); + sceNp->AddFunc(0xb9f93bbb, sceNpScoreCreateTitleCtx); + sceNp->AddFunc(0xba65de6d, sceNpCommerceGetChildCategoryInfo); + sceNp->AddFunc(0xbab91fc9, sceNpBasicGetPlayersHistoryEntry); + sceNp->AddFunc(0xbcc09fe7, sceNpBasicRegisterHandler); + sceNp->AddFunc(0xbcdbb2ab, sceNpBasicAddPlayersHistoryAsync); + sceNp->AddFunc(0xbdc07fd5, sceNpManagerGetNetworkTime); + sceNp->AddFunc(0xbe07c708, sceNpManagerGetOnlineId); + sceNp->AddFunc(0xbe81c71c, sceNpBasicSetPresenceDetails); + sceNp->AddFunc(0xbef887e5, sceNpScoreGetClanMemberGameDataAsync); + sceNp->AddFunc(0xbf607ec6, sceNpBasicGetClanMessageEntryCount); + sceNp->AddFunc(0xbf9eea93, sceNpLookupAvatarImageAsync); + sceNp->AddFunc(0xc3a991ee, sceNpScoreGetRankingByNpIdPcId); + sceNp->AddFunc(0xc4b6cd8f, sceNpScoreGetRankingByNpIdPcIdAsync); + sceNp->AddFunc(0xc5f4cf82, sceNpScoreDestroyTransactionCtx); + sceNp->AddFunc(0xca0a2d04, sceNpSignalingGetConnectionStatus); + sceNp->AddFunc(0xca39c4b2, sceNpLookupTitleSmallStorage); + sceNp->AddFunc(0xccbe2e69, sceNpCommerceGetSkuImageURL); + sceNp->AddFunc(0xce81c7f0, sceNpLookupCreateTitleCtx); + sceNp->AddFunc(0xceeebc7a, sceNpProfileCallGui); + sceNp->AddFunc(0xcfd469e4, sceNpCommerceGetProductCategoryFinish); + sceNp->AddFunc(0xd03cea35, sceNpCommerceGetDataFlagState); + sceNp->AddFunc(0xd053f113, sceNpBasicGetCustomInvitationEntry); + sceNp->AddFunc(0xd0958814, sceNpSignalingGetPeerNetInfoResult); + sceNp->AddFunc(0xd12e40ae, sceNpLookupNpIdAsync); + sceNp->AddFunc(0xd208f91d, sceNpUtilCmpNpId); + sceNp->AddFunc(0xd20d7798, sceNpMatchingKickRoomMemberWithOpt); + sceNp->AddFunc(0xd737fd2d, sceNpLookupWaitAsync); + sceNp->AddFunc(0xd7fb1fa6, sceNpFriendlistCustom); + sceNp->AddFunc(0xdae2d351, sceNpMatchingGrantOwnership); + sceNp->AddFunc(0xdb2e4dc2, sceNpScoreGetGameDataAsync); + sceNp->AddFunc(0xdbdb909f, sceNpCommerceGetDataFlagStart); + sceNp->AddFunc(0xddce7d15, sceNpScoreGetBoardInfoAsync); + sceNp->AddFunc(0xded17c26, sceNpScoreGetClansMembersRankingByNpId); + sceNp->AddFunc(0xdfd63b62, sceNpLookupUserProfile); + sceNp->AddFunc(0xe035f7d6, sceNpBasicGetEvent); + sceNp->AddFunc(0xe1c9f675, sceNpBasicMarkMessageAsUsed); + sceNp->AddFunc(0xe24eea19, sceNpMatchingGetRoomListLimitGUI); + sceNp->AddFunc(0xe2877bea, sceNpCommerceDestroyCtx); + sceNp->AddFunc(0xe36c660e, sceNpCommerceDoCheckoutStartAsync); + sceNp->AddFunc(0xe6c8f3f9, sceNpDrmProcessExitSpawn2); + sceNp->AddFunc(0xe7dcd3b4, sceNpManagerRegisterCallback); + sceNp->AddFunc(0xe853d388, sceNpSignalingGetConnectionFromNpId); + sceNp->AddFunc(0xe8a67160, sceNpScoreGetClansMembersRankingByNpIdAsync); + sceNp->AddFunc(0xea2e9ffc, sceNpLookupCreateTransactionCtx); + sceNp->AddFunc(0xeb5f2544, sceNpCommerceGetProductName); + sceNp->AddFunc(0xeb7a3d84, sceNpManagerGetChatRestrictionFlag); + sceNp->AddFunc(0xeb9df054, sceNpCommerceGetCategoryInfo); + sceNp->AddFunc(0xec0a1fbf, sceNpBasicSendMessage); + sceNp->AddFunc(0xecd503de, sceNpBasicGetMessageEntryCount); + sceNp->AddFunc(0xee0cc40c, _sceNpSysutilClientMalloc); + sceNp->AddFunc(0xee530059, sceNpCommerceGetSkuName); + sceNp->AddFunc(0xee5b20d9, sceNpScoreAbortTransaction); + sceNp->AddFunc(0xee64cf8e, sceNpMatchingGetRoomSearchFlag); + sceNp->AddFunc(0xf0a9182b, sceNpFriendlist); + sceNp->AddFunc(0xf0b1e399, sceNpScoreRecordScoreAsync); + sceNp->AddFunc(0xf1b77918, sceNpScoreSanitizeComment); + sceNp->AddFunc(0xf2b3338a, sceNpBasicGetBlockListEntry); + sceNp->AddFunc(0xf42c0df8, sceNpManagerGetOnlineName); + sceNp->AddFunc(0xf4e0f607, sceNpScoreGetBoardInfo); + sceNp->AddFunc(0xf59e1da8, sceNpFriendlistAbortGui); + sceNp->AddFunc(0xf5ff5f31, sceNpUtilCmpNpIdInOrder); + sceNp->AddFunc(0xf76847c2, sceNpScoreRecordGameDataAsync); + sceNp->AddFunc(0xf806c54c, sceNpMatchingLeaveRoom); + sceNp->AddFunc(0xf9732ac8, sceNpCustomMenuActionSetActivation); + sceNp->AddFunc(0xfb87cf5e, sceNpLookupDestroyTransactionCtx); + sceNp->AddFunc(0xfbc82301, sceNpScoreGetRankingByRange); + sceNp->AddFunc(0xfcac355a, sceNpCommerceCreateCtx); + sceNp->AddFunc(0xfd0eb5ae, sceNpSignalingDeactivateConnection); + sceNp->AddFunc(0xfd39ae13, sceNpBasicGetFriendPresenceByNpId); + sceNp->AddFunc(0xfe37a7f4, sceNpManagerGetNpId); + sceNp->AddFunc(0xff0a2378, sceNpLookupUserProfileAsync); + sceNp->AddFunc(0x095e12c6, sceNpClansSendInvitationResponse); + sceNp->AddFunc(0x09f9e1a9, sceNpClansUpdateClanInfo); + sceNp->AddFunc(0x0df25834, sceNpClansRetrieveChallenges); + sceNp->AddFunc(0x1221a1bf, sceNpClansSearchByProfile); + sceNp->AddFunc(0x20472da0, sceNpClansGetMemberInfo); + sceNp->AddFunc(0x299ccc9b, sceNpClansCancelMembershipRequest); + sceNp->AddFunc(0x38dadf1f, sceNpClansGetAutoAcceptStatus); + sceNp->AddFunc(0x42332cb7, sceNpClansTerm); + sceNp->AddFunc(0x4826f6d5, sceNpClansDisbandClan); + sceNp->AddFunc(0x487de998, sceNpClansGetClanInfo); + sceNp->AddFunc(0x4d06aef7, sceNpClansAddBlacklistEntry); + sceNp->AddFunc(0x560f717b, sceNpClansLeaveClan); + sceNp->AddFunc(0x56bc5a7c, sceNpClansGetBlacklist); + sceNp->AddFunc(0x59743b2b, sceNpClansSendMembershipRequest); + sceNp->AddFunc(0x5bff9da1, sceNpClansRemoveBlacklistEntry); + sceNp->AddFunc(0x5da94854, sceNpClansUpdateAutoAcceptStatus); + sceNp->AddFunc(0x672399a8, sceNpClansGetClanListByNpId); + sceNp->AddFunc(0x726dffd5, sceNpClansCancelInvitation); + sceNp->AddFunc(0x727aa7f8, sceNpClansRetrieveAnnouncements); + sceNp->AddFunc(0x83d65529, sceNpClansPostChallenge); + sceNp->AddFunc(0x856ff5c0, sceNpClansGetMemberList); + sceNp->AddFunc(0x8e785b97, sceNpClansRetrievePostedChallenges); + sceNp->AddFunc(0x942dbdc4, sceNpClansSendMembershipResponse); + sceNp->AddFunc(0x9a72232d, sceNpClansCreateRequest); + sceNp->AddFunc(0x9b820047, sceNpClansInit); + sceNp->AddFunc(0x9cac2085, sceNpClansChangeMemberRole); + sceNp->AddFunc(0xa6a31a38, sceNpClansCreateClan); + sceNp->AddFunc(0xaa7912b5, sceNpClansKickMember); + sceNp->AddFunc(0xace0cfba, sceNpClansSearchByName); + sceNp->AddFunc(0xada45b84, sceNpClansPostAnnouncement); + sceNp->AddFunc(0xbc05ef31, sceNpClansSendInvitation); + sceNp->AddFunc(0xca4181b4, sceNpClansGetClanList); + sceNp->AddFunc(0xce6dc0f0, sceNpClansRemoveChallenge); + sceNp->AddFunc(0xd3346dc4, sceNpClansRemovePostedChallenge); + sceNp->AddFunc(0xd6551cd1, sceNpClansDestroyRequest); + sceNp->AddFunc(0xdbf300ca, sceNpClansJoinClan); + sceNp->AddFunc(0xe2590f60, sceNpClansRemoveAnnouncement); + sceNp->AddFunc(0xe82969e2, sceNpClansAbortRequest); + sceNp->AddFunc(0xf4a2d52b, sceNpClansUpdateMemberInfo); + sceNp->AddFunc(0x104551a6, sceNpCommerce2DoCheckoutStartAsync); + sceNp->AddFunc(0x146618df, sceNpCommerce2GetProductInfoListGetResult); + sceNp->AddFunc(0x150fdca3, sceNpCommerce2GetContentRatingDescriptor); + sceNp->AddFunc(0x1fa1b312, sceNpCommerce2GetStoreBrowseUserdata); + sceNp->AddFunc(0x2a910f05, sceNpCommerce2DestroyReq); + sceNp->AddFunc(0x3539d233, sceNpCommerce2Init); + sceNp->AddFunc(0x371a2edd, sceNpCommerce2GetCategoryContentsStart); + sceNp->AddFunc(0x3d627d81, sceNpCommerce2GetBGDLAvailability); + sceNp->AddFunc(0x410d42be, sceNpCommerce2DoDlListFinishAsync); + sceNp->AddFunc(0x4d4a094c, sceNpCommerce2Term); + sceNp->AddFunc(0x62023e98, sceNpCommerce2CreateSessionAbort); + sceNp->AddFunc(0x6ca9efd4, sceNpCommerce2DoDlListStartAsync); + sceNp->AddFunc(0x6f67ea80, sceNpCommerce2DestroyCtx); + sceNp->AddFunc(0x7370d8d0, sceNpCommerce2GetCategoryContentsCreateReq); + sceNp->AddFunc(0x8df0057f, sceNpCommerce2AbortReq); + sceNp->AddFunc(0x8f46325b, sceNpCommerce2GetProductInfoStart); + sceNp->AddFunc(0x91f8843d, sceNpCommerce2CreateSessionFinish); + sceNp->AddFunc(0x972ab46c, sceNpCommerce2GetContentInfo); + sceNp->AddFunc(0x9825a0fc, sceNpCommerce2DoProductBrowseStartAsync); + sceNp->AddFunc(0x9cde07cc, sceNpCommerce2GetProductInfoListStart); + sceNp->AddFunc(0x9d9cb96b, sceNpCommerce2DestroyGetCategoryContentsResult); + sceNp->AddFunc(0xa5a863fe, sceNpCommerce2SetBGDLAvailability); + sceNp->AddFunc(0xa975ebb4, sceNpCommerce2GetProductInfoCreateReq); + sceNp->AddFunc(0xa9f945b3, sceNpCommerce2DoProductCodeFinishAsync); + sceNp->AddFunc(0xac78c1f3, sceNpCommerce2GetContentRatingInfoFromCategoryInfo); + sceNp->AddFunc(0xb23e3bd1, sceNpCommerce2DoProductBrowseFinishAsync); + sceNp->AddFunc(0xbd49eab2, sceNpCommerce2GetCategoryInfo); + sceNp->AddFunc(0xbf5f58ea, sceNpCommerce2GetProductInfoGetResult); + sceNp->AddFunc(0xca0ea996, sceNpCommerce2GetCategoryContentsGetResult); + sceNp->AddFunc(0xcc18cd2c, sceNpCommerce2CreateSessionStart); + sceNp->AddFunc(0xd43a130e, sceNpCommerce2DoCheckoutFinishAsync); + sceNp->AddFunc(0xd8a473a3, sceNpCommerce2InitGetCategoryContentsResult); + sceNp->AddFunc(0xd9956ce7, sceNpCommerce2GetGameProductInfoFromGetProductInfoListResult); + sceNp->AddFunc(0xd9fdcec2, sceNpCommerce2CreateCtx); + sceNp->AddFunc(0xda8e322d, sceNpCommerce2GetPrice); + sceNp->AddFunc(0xdb19194c, sceNpCommerce2GetGameSkuInfoFromGameProductInfo); + sceNp->AddFunc(0xde7ab33d, sceNpCommerce2DoProductCodeStartAsync); + sceNp->AddFunc(0xe0f90e44, sceNpCommerce2InitGetProductInfoListResult); + sceNp->AddFunc(0xe1e7b5ac, sceNpCommerce2GetProductInfoListCreateReq); + sceNp->AddFunc(0xe51a4944, sceNpCommerce2GetGameProductInfoFromContentInfo); + sceNp->AddFunc(0xec324c8f, sceNpCommerce2GetContentRatingInfoFromGameProductInfo); + sceNp->AddFunc(0xeef51be0, sceNpCommerce2ExecuteStoreBrowse); + sceNp->AddFunc(0xef645654, sceNpCommerce2GetGameProductInfo); + sceNp->AddFunc(0xef8eafcd, sceNpCommerce2DestroyGetProductInfoResult); + sceNp->AddFunc(0xf6139b58, sceNpCommerce2DestroyGetProductInfoListResult); + sceNp->AddFunc(0xf798f5e3, sceNpCommerce2InitGetProductInfoResult); + sceNp->AddFunc(0xfc216890, sceNpCommerce2GetCategoryInfoFromContentInfo); + sceNp->AddFunc(0x01711e81, sceNpTusDeleteMultiSlotDataVUser); + sceNp->AddFunc(0x0423e622, sceNpTusGetMultiSlotVariable); + sceNp->AddFunc(0x065b610d, sceNpTusSetMultiSlotVariableAsync); + sceNp->AddFunc(0x0835deb2, sceNpTusSetDataVUser); + sceNp->AddFunc(0x0d15043b, sceNpTusGetMultiUserVariable); + sceNp->AddFunc(0x17db7aa7, sceNpTusTryAndSetVariableVUserAsync); + sceNp->AddFunc(0x1904435e, sceNpTusCreateTransactionCtx); + sceNp->AddFunc(0x19bce18c, sceNpTusPollAsync); + sceNp->AddFunc(0x1fa5c87d, sceNpTusAddAndGetVariableAsync); + sceNp->AddFunc(0x225aed26, sceNpTusTerm); + sceNp->AddFunc(0x2357ba9e, sceNpTusGetMultiSlotVariableVUser); + sceNp->AddFunc(0x2ab21ea9, sceNpTusGetMultiSlotDataStatusVUserAsync); + sceNp->AddFunc(0x2d1b9f1a, sceNpTusGetMultiUserDataStatusVUser); + sceNp->AddFunc(0x2e162a62, sceNpTusDestroyTitleCtx); + sceNp->AddFunc(0x3175af23, sceNpTusDeleteMultiSlotDataAsync); + sceNp->AddFunc(0x325c6284, sceNpTusAbortTransaction); + sceNp->AddFunc(0x348dbcb4, sceNpTusGetMultiUserDataStatus); + sceNp->AddFunc(0x3602bc80, sceNpTusTryAndSetVariableVUser); + sceNp->AddFunc(0x368fec59, sceNpTusGetMultiUserDataStatusVUserAsync); + sceNp->AddFunc(0x38f364b0, sceNpTusGetDataVUserAsync); + sceNp->AddFunc(0x44eca8b4, sceNpTusDestroyTransactionCtx); + sceNp->AddFunc(0x47e9424a, sceNpTusTryAndSetVariable); + sceNp->AddFunc(0x5175abb9, sceNpTusGetDataAsync); + sceNp->AddFunc(0x59432970, sceNpTusSetTimeout); + sceNp->AddFunc(0x651fd79f, sceNpTusGetMultiSlotDataStatusAsync); + sceNp->AddFunc(0x6c511024, sceNpTusGetMultiUserVariableVUser); + sceNp->AddFunc(0x7caf58ee, sceNpTusCreateTitleCtx); + sceNp->AddFunc(0x7d5f0f0e, sceNpTusSetData); + sceNp->AddFunc(0x8ddd0d85, sceNpTusGetData); + sceNp->AddFunc(0x8f87a06b, sceNpTusInit); + sceNp->AddFunc(0x94989003, sceNpTusAddAndGetVariable); + sceNp->AddFunc(0x9549d22c, sceNpTusGetMultiUserVariableVUserAsync); + sceNp->AddFunc(0x96a06212, sceNpTusSetMultiSlotVariableVUserAsync); + sceNp->AddFunc(0x9cc0cf44, sceNpTusSetDataVUserAsync); + sceNp->AddFunc(0xa3abfadb, sceNpTusGetMultiSlotDataStatusVUser); + sceNp->AddFunc(0xa7993bf3, sceNpTusAddAndGetVariableVUserAsync); + sceNp->AddFunc(0xae4e590e, sceNpTusGetDataVUser); + sceNp->AddFunc(0xaf985783, sceNpTusDeleteMultiSlotVariable); + sceNp->AddFunc(0xb8e8ff22, sceNpTusWaitAsync); + sceNp->AddFunc(0xbb2877f2, sceNpTusGetMultiSlotVariableAsync); + sceNp->AddFunc(0xbbb244b7, sceNpTusTryAndSetVariableAsync); + sceNp->AddFunc(0xc2e18da8, sceNpTusDeleteMultiSlotVariableVUserAsync); + sceNp->AddFunc(0xc4e51fbf, sceNpTusDeleteMultiSlotVariableVUser); + sceNp->AddFunc(0xc66ba67e, sceNpTusGetMultiUserDataStatusAsync); + sceNp->AddFunc(0xc815b219, sceNpTusDeleteMultiSlotDataVUserAsync); + sceNp->AddFunc(0xc848d425, sceNpTusGetMultiSlotDataStatus); + sceNp->AddFunc(0xcc7a31cd, sceNpTusGetMultiUserVariableAsync); + sceNp->AddFunc(0xcc86a8f6, sceNpTusSetMultiSlotVariable); + sceNp->AddFunc(0xe0719847, sceNpTusDeleteMultiSlotData); + sceNp->AddFunc(0xe847341f, sceNpTusSetDataAsync); + sceNp->AddFunc(0xf5363608, sceNpTusDeleteMultiSlotVariableAsync); + sceNp->AddFunc(0xf60be06f, sceNpTusAddAndGetVariableVUser); + sceNp->AddFunc(0xf819be91, sceNpTusSetMultiSlotVariableVUser); + sceNp->AddFunc(0xfc7d346e, sceNpTusGetMultiSlotVariableVUserAsync); + sceNp->AddFunc(0x432b3cbf, sceNpUtilBandwidthTestShutdown); + sceNp->AddFunc(0xc2ced2b7, sceNpUtilBandwidthTestInitStart); + sceNp->AddFunc(0xc880f37d, sceNpUtilBandwidthTestGetStatus); + sceNp->AddFunc(0xc99ee313, sceNpUtilBandwidthTestAbort); + sceNp->AddFunc(0xa8cf8451, sceNpSignalingDestroyCtx); } diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index e92997781f..a8917cb195 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -18,6 +18,11 @@ static func_caller *null_func = bind_func(default_syscall); static const int kSyscallTableLength = 1024; +// UNS = Unused +// ROOT = Root +// DBG = Debug +// PM = Product Mode +// AuthID = Authentication ID static func_caller* sc_table[kSyscallTableLength] = { null_func, @@ -27,19 +32,17 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_process_get_status), //4 (0x004) DBG bind_func(sys_process_detach_child), //5 (0x005) DBG - // Unused: 6-11 - null_func, null_func, null_func, null_func, null_func, null_func, + null_func, null_func, null_func, null_func, null_func, null_func, //6-11 UNS bind_func(sys_process_get_number_of_object), //12 (0x00B) bind_func(sys_process_get_id), //13 (0x00C) null_func,//bind_func(sys_process_is_spu_lock_line_reservation_address), //14 (0x00D) - // Unused: 15-17 - null_func, null_func, null_func, + null_func, null_func, null_func, //15-17 UNS bind_func(sys_process_getppid), //18 (0x012) bind_func(sys_process_kill), //19 (0x013) - null_func, // + null_func, //20 (0x014) UNS null_func,//bind_func(_sys_process_spawn), //21 (0x015) DBG bind_func(sys_process_exit), //22 (0x016) bind_func(sys_process_wait_for_child2), //23 (0x017) DBG @@ -52,11 +55,10 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_process_get_paramsfo), //30 (0x01E) null_func,//bind_func(sys_process_get_ppu_guid), //31 (0x01F) - // Unused: 32-40 - null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, + null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, //32-40 UNS - bind_func(sys_internal_ppu_thread_exit), //41 (0x029) - null_func, // + bind_func(sys_internal_ppu_thread_exit), //41 (0x029) + null_func, //42 (0x02A) UNS bind_func(sys_ppu_thread_yield), //43 (0x02B) bind_func(sys_ppu_thread_join), //44 (0x02C) bind_func(sys_ppu_thread_detach), //45 (0x02D) @@ -68,15 +70,12 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_ppu_thread_restart), //51 (0x033) ROOT null_func,//bind_func(sys_ppu_thread_create), //52 (0x034) DBG null_func,//bind_func(sys_ppu_thread_start), //53 (0x035) - null_func,//bind_func(), //54 (0x036) ROOT - null_func,//bind_func(), //55 (0x037) ROOT + null_func,//bind_func(sys_ppu_...), //54 (0x036) ROOT + null_func,//bind_func(sys_ppu_...), //55 (0x037) ROOT null_func,//bind_func(sys_ppu_thread_rename), //56 (0x038) null_func,//bind_func(sys_ppu_thread_recover_page_fault)//57 (0x039) null_func,//bind_func(sys_ppu_thread_get_page_fault_context),//58 (0x03A) - - // Unused: 59 - null_func, - + null_func, //59 (0x03B) UNS bind_func(sys_trace_create), //60 (0x03C) bind_func(sys_trace_start), //61 (0x03D) bind_func(sys_trace_stop), //62 (0x03E) @@ -95,11 +94,8 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_timer_connect_event_queue), //75 (0x04B) bind_func(sys_timer_disconnect_event_queue), //76 (0x04C) null_func,//bind_func(sys_trace_create2_in_cbepm), //77 (0x04D) - null_func,//bind_func() //78 (0x04E) - - // Unused: 79 - null_func, - + null_func,//bind_func(sys_trace_...) //78 (0x04E) + null_func, //79 (0x04F) UNS null_func,//bind_func(sys_interrupt_tag_create) //80 (0x050) bind_func(sys_interrupt_tag_destroy), //81 (0x051) bind_func(sys_event_flag_create), //82 (0x052) @@ -135,11 +131,11 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_lwcond_destroy) //112 (0x070) null_func,//bind_func(sys_lwcond_queue_wait) //113 (0x071) bind_func(sys_semaphore_get_value), //114 (0x072) - null_func,//bind_func() //115 (0x073) - null_func,//bind_func() //116 (0x074) - null_func,//bind_func() //117 (0x075) + null_func,//bind_func(sys_semaphore_...) //115 (0x073) + null_func,//bind_func(sys_semaphore_...) //116 (0x074) + null_func,//bind_func(sys_semaphore_...) //117 (0x075) bind_func(sys_event_flag_clear), //118 (0x076) - null_func,//bind_func() //119 (0x077) ROOT + null_func,//bind_func(sys_event_...) //119 (0x077) ROOT bind_func(sys_rwlock_create), //120 (0x078) bind_func(sys_rwlock_destroy), //121 (0x079) bind_func(sys_rwlock_rlock), //122 (0x07A) @@ -169,10 +165,7 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_time_get_system_time), //146 (0x092) ROOT bind_func(sys_time_get_timebase_frequency), //147 (0x093) null_func,//bind_func(sys_rwlock_trywlock) //148 (0x094) - - // Unused: 149 - null_func, - + null_func, //149 (0x095) UNS bind_func(sys_raw_spu_create_interrupt_tag), //150 (0x096) bind_func(sys_raw_spu_set_int_mask), //151 (0x097) bind_func(sys_raw_spu_get_int_mask), //152 (0x098) @@ -185,13 +178,13 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_raw_spu_load) //159 (0x09F) bind_func(sys_raw_spu_create), //160 (0x0A0) bind_func(sys_raw_spu_destroy), //161 (0x0A1) - null_func, // + null_func, //162 (0x0A2) UNS bind_func(sys_raw_spu_read_puint_mb), //163 (0x0A3) - null_func, // + null_func, //164 (0x0A4) UNS bind_func(sys_spu_thread_get_exit_status), //165 (0x0A5) bind_func(sys_spu_thread_set_argument), //166 (0x0A6) null_func,//bind_func(sys_spu_thread_group_start_on_exit)//167(0x0A7) - null_func, // + null_func, //168 (0x0A8) UNS bind_func(sys_spu_initialize), //169 (0x0A9) bind_func(sys_spu_thread_group_create), //170 (0x0AA) bind_func(sys_spu_thread_group_destroy), //171 (0x0AB) @@ -206,54 +199,75 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_spu_thread_group_get_priority)//180 (0x0B4) bind_func(sys_spu_thread_write_ls), //181 (0x0B5) bind_func(sys_spu_thread_read_ls), //182 (0x0B6) - null_func, // + null_func, //183 (0x0B7) UNS bind_func(sys_spu_thread_write_snr), //184 (0x0B8) bind_func(sys_spu_thread_group_connect_event), //185 (0x0B9) bind_func(sys_spu_thread_group_disconnect_event), //186 (0x0BA) bind_func(sys_spu_thread_set_spu_cfg), //187 (0x0BB) bind_func(sys_spu_thread_get_spu_cfg), //188 (0x0BC) - null_func, // + null_func, //189 (0x0BD) UNS bind_func(sys_spu_thread_write_spu_mb), //190 (0x0BE) bind_func(sys_spu_thread_connect_event), //191 (0x0BF) bind_func(sys_spu_thread_disconnect_event), //192 (0x0C0) bind_func(sys_spu_thread_bind_queue), //193 (0x0C1) bind_func(sys_spu_thread_unbind_queue), //194 (0x0C2) - null_func, // + null_func, //195 (0x0C3) UNS bind_func(sys_raw_spu_set_spu_cfg), //196 (0x0C4) bind_func(sys_raw_spu_get_spu_cfg), //197 (0x0C5) null_func,//bind_func(sys_spu_thread_recover_page_fault)//198 (0x0C6) null_func,//bind_func(sys_raw_spu_recover_page_fault) //199 (0x0C7) - null_func, null_func, null_func, null_func, null_func, //204(0x104) - null_func, null_func, null_func, null_func, null_func, //209 - null_func, null_func, null_func, null_func, null_func, //214 - null_func, null_func, null_func, null_func, null_func, //219 - null_func, null_func, null_func, null_func, null_func, //224 - null_func, null_func, null_func, null_func, null_func, //229 - null_func, null_func, null_func, null_func, null_func, //234 - null_func, null_func, null_func, null_func, null_func, //239 - null_func, null_func, null_func, null_func, null_func, //244 - null_func, null_func, null_func, null_func, null_func, //249 - null_func, //250 + null_func, null_func, null_func, null_func, null_func, //204 UNS? + null_func, null_func, null_func, null_func, null_func, //209 UNS? + null_func, null_func, null_func, null_func, null_func, //214 UNS? - bind_func(sys_spu_thread_group_connect_event_all_threads),//251 (0x0FB) - bind_func(sys_spu_thread_group_disconnect_event_all_threads),//252 (0x0FC) + null_func,//bind_func(sys_dbg_mat_set_condition) //215 (0x0D7) + null_func,//bind_func(sys_dbg_mat_get_condition) //216 (0x0D8) + null_func,//bind_func(sys_dbg_...) //217 (0x0D9) DBG UNS? + null_func,//bind_func(sys_dbg_...) //218 (0x0DA) DBG UNS? + null_func,//bind_func(sys_dbg_...) //219 (0x0DB) DBG UNS? + + null_func, null_func, null_func, null_func, null_func, //224 UNS + null_func, null_func, null_func, null_func, null_func, //229 UNS? + + null_func,//bind_func(sys_isolated_spu_create) //230 (0x0E6) ROOT + null_func,//bind_func(sys_isolated_spu_destroy) //231 (0x0E7) ROOT + null_func,//bind_func(sys_isolated_spu_start) //232 (0x0E8) ROOT + null_func,//bind_func(sys_isolated_spu_create_interrupt_tag) //233 (0x0E9) ROOT + null_func,//bind_func(sys_isolated_spu_set_int_mask) //234 (0x0EA) ROOT + null_func,//bind_func(sys_isolated_spu_get_int_mask) //235 (0x0EB) ROOT + null_func,//bind_func(sys_isolated_spu_set_int_stat) //236 (0x0EC) ROOT + null_func,//bind_func(sys_isolated_spu_get_int_stat) //237 (0x0ED) ROOT + null_func,//bind_func(sys_isolated_spu_set_spu_cfg) //238 (0x0EE) ROOT + null_func,//bind_func(sys_isolated_spu_get_spu_cfg) //239 (0x0EF) ROOT + null_func,//bind_func(sys_isolated_spu_read_puint_mb) //240 (0x0F0) ROOT + null_func, //241 (0x0F1) ROOT UNS + null_func, //242 (0x0F2) ROOT UNS + null_func, //243 (0x0F3) ROOT UNS + null_func,//bind_func(sys_spu_thread_group_system_set_next_group) //244 (0x0F4) ROOT + null_func,//bind_func(sys_spu_thread_group_system_unset_next_group) //245 (0x0F5) ROOT + null_func,//bind_func(sys_spu_thread_group_system_set_switch_group) //246 (0x0F6) ROOT + null_func,//bind_func(sys_spu_thread_group_system_unset_switch_group) //247 (0x0F7) ROOT + null_func,//bind_func(sys_spu_thread_group...) //248 (0x0F8) ROOT + null_func,//bind_func(sys_spu_thread_group...) //249 (0x0F9) ROOT + null_func,//bind_func(sys_spu_thread_group_set_cooperative_victims) //250 (0x0FA) + bind_func(sys_spu_thread_group_connect_event_all_threads), //251 (0x0FB) + bind_func(sys_spu_thread_group_disconnect_event_all_threads), //252 (0x0FC) null_func,//bind_func() //253 (0x0FD) null_func,//bind_func(sys_spu_thread_group_log) //254 (0x0FE) - // Unused: 255-259 - null_func, null_func, null_func, null_func, null_func, + null_func, null_func, null_func, null_func, null_func, //255-259 UNS null_func,//bind_func(sys_spu_image_open_by_fd) //260 (0x104) - null_func, null_func, null_func, null_func, //264 - null_func, null_func, null_func, null_func, null_func, //269 - null_func, null_func, null_func, null_func, null_func, //274 - null_func, null_func, null_func, null_func, null_func, //279 - null_func, null_func, null_func, null_func, null_func, //284 - null_func, null_func, null_func, null_func, null_func, //289 - null_func, null_func, null_func, null_func, null_func, //294 - null_func, null_func, null_func, null_func, null_func, //299 + null_func, null_func, null_func, null_func, //264 UNS + null_func, null_func, null_func, null_func, null_func, //269 UNS + null_func, null_func, null_func, null_func, null_func, //274 UNS + null_func, null_func, null_func, null_func, null_func, //279 UNS + null_func, null_func, null_func, null_func, null_func, //284 UNS + null_func, null_func, null_func, null_func, null_func, //289 UNS + null_func, null_func, null_func, null_func, null_func, //294 UNS + null_func, null_func, null_func, null_func, null_func, //299 UNS bind_func(sys_vm_memory_map), //300 (0x12C) bind_func(sys_vm_unmap), //301 (0x12D) @@ -268,18 +282,17 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_vm_sync), //310 (0x136) bind_func(sys_vm_test), //311 (0x137) bind_func(sys_vm_get_statistics), //312 (0x138) - null_func,//bind_func() //313 (0x139) - null_func,//bind_func() //314 (0x13A) - null_func,//bind_func() //315 (0x13B) + null_func,//bind_func(sys_vm_memory_map (different)) //313 (0x139) + null_func,//bind_func(sys_...) //314 (0x13A) + null_func,//bind_func(sys_...) //315 (0x13B) - // Unused: 316-323 - null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, + null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, //316-323 UNS - bind_func(sys_memory_container_create), //324 (0x144) - bind_func(sys_memory_container_destroy), //325 (0x145) + bind_func(sys_memory_container_create), //324 (0x144) DBG + bind_func(sys_memory_container_destroy), //325 (0x145) DBG bind_func(sys_mmapper_allocate_fixed_address), //326 (0x146) bind_func(sys_mmapper_enable_page_fault_notification), //327 (0x147) - null_func,//bind_func() //328 (0x148) + null_func,//bind_func(sys_mmapper_...) //328 (0x148) null_func,//bind_func(sys_mmapper_free_shared_memory) //329 (0x149) bind_func(sys_mmapper_allocate_address), //330 (0x14A) bind_func(sys_mmapper_free_address), //331 (0x14B) @@ -290,57 +303,121 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_mmapper_change_address_access_right), //336 (0x150) bind_func(sys_mmapper_search_and_map), //337 (0x151) null_func,//bind_func(sys_mmapper_get_shared_memory_attribute) //338 (0x152) - null_func,//bind_func() //339 (0x153) - null_func,//bind_func() //340 (0x154) + null_func,//bind_func(sys_...) //339 (0x153) + null_func,//bind_func(sys_...) //340 (0x154) bind_func(sys_memory_container_create), //341 (0x155) bind_func(sys_memory_container_destroy), //342 (0x156) bind_func(sys_memory_container_get_size), //343 (0x157) null_func,//bind_func(sys_memory_budget_set) //344 (0x158) - null_func,//bind_func() //345 (0x159) - null_func,//bind_func() //346 (0x15A) - null_func, // + null_func,//bind_func(sys_memory_...) //345 (0x159) + null_func,//bind_func(sys_memory_...) //346 (0x15A) + null_func, //347 (0x15B) UNS bind_func(sys_memory_allocate), //348 (0x15C) bind_func(sys_memory_free), //349 (0x15D) bind_func(sys_memory_allocate_from_container), //350 (0x15E) bind_func(sys_memory_get_page_attribute), //351 (0x15F) bind_func(sys_memory_get_user_memory_size), //352 (0x160) null_func,//bind_func(sys_memory_get_user_memory_stat) //353 (0x161) - null_func,//bind_func() //354 (0x162) - null_func,//bind_func() //355 (0x163) + null_func,//bind_func(sys_memory_...) //354 (0x162) + null_func,//bind_func(sys_memory_...) //355 (0x163) null_func,//bind_func(sys_memory_allocate_colored) //356 (0x164) - null_func,//bind_func() //357 (0x165) - null_func,//bind_func() //358 (0x166) - null_func,//bind_func() //359 (0x167) - null_func,//bind_func() //360 (0x168) + null_func,//bind_func(sys_memory_...) //357 (0x165) + null_func,//bind_func(sys_memory_...) //358 (0x166) + null_func,//bind_func(sys_memory_...) //359 (0x167) + null_func,//bind_func(sys_memory_...) //360 (0x168) null_func,//bind_func(sys_memory_allocate_from_container_colored) //361 (0x169) null_func,//bind_func(sys_mmapper_allocate_memory_from_container) //362 (0x16A) - null_func,//bind_func() //363 (0x16B) - null_func,//bind_func() //364 (0x16C) + null_func,//bind_func(sys_mmapper_...) //363 (0x16B) + null_func,//bind_func(sys_mmapper_...) //364 (0x16C) + null_func, //365 (0x16D) UNS + null_func, //366 (0x16E) UNS + null_func,//bind_func(sys_uart_initialize) //367 (0x16F) ROOT + null_func,//bind_func(sys_uart_receive) //368 (0x170) ROOT + null_func,//bind_func(sys_uart_send) //369 (0x171) ROOT + null_func,//bind_func(sys_uart_get_params) //370 (0x172) ROOT + null_func, //371 (0x173) UNS + null_func,//bind_func(sys_game_watchdog_start) //372 (0x174) + null_func,//bind_func(sys_game_watchdog_stop) //373 (0x175) + null_func,//bind_func(sys_game_watchdog_clear) //374 (0x176) + null_func,//bind_func(sys_game_set_system_sw_version) //375 (0x177) ROOT + null_func,//bind_func(sys_game_get_system_sw_version) //376 (0x178) ROOT + null_func,//bind_func(sys_sm_set_shop_mode) //377 (0x179) ROOT + null_func,//bind_func(sys_sm_get_ext_event2) //378 (0x17A) ROOT + null_func,//bind_func(sys_sm_shutdown) //379 (0x17B) ROOT + null_func,//bind_func(sys_sm_get_params) //380 (0x17C) DBG + null_func,//bind_func(sys_sm_get_inter_lpar_parameter) //381 (0x17D) ROOT + null_func,//bind_func(sys_sm_) //382 (0x17E) ROOT + null_func,//bind_func(sys_game_get_temperature) //383 (0x17F) ROOT + null_func,//bind_func(sys_sm_get_tzpb) //384 (0x180) ROOT + null_func,//bind_func(sys_sm_request_led) //385 (0x181) ROOT + null_func,//bind_func(sys_sm_control_led) //386 (0x182) ROOT + null_func,//bind_func(sys_sm_get_platform_info) //387 (0x183) DBG + null_func,//bind_func(sys_sm_ring_buzzer) //388 (0x184) ROOT + null_func,//bind_func(sys_sm_set_fan_policy) //389 (0x185) PM + null_func,//bind_func(sys_sm_request_error_log) //390 (0x186) ROOT + null_func,//bind_func(sys_sm_request_be_count) //391 (0x187) ROOT + null_func,//bind_func(sys_sm_ring_buzzer) //392 (0x188) ROOT + null_func,//bind_func(sys_sm_get_hw_config) //393 (0x189) ROOT + null_func,//bind_func(sys_sm_request_scversion) //394 (0x18A) ROOT + null_func,//bind_func(sys_sm_request_system_event_log) //395 (0x18B) PM + null_func,//bind_func(sys_sm_set_rtc_alarm) //396 (0x18C) ROOT + null_func,//bind_func(sys_sm_get_rtc_alarm) //397 (0x18D) ROOT + null_func,//bind_func(sys_console_write) //398 (0x18E) ROOT + null_func, //399 (0x18F) UNS + null_func,//bind_func(sys_sm_...) //400 (0x190) PM + null_func,//bind_func(sys_sm_...) //401 (0x191) ROOT + bind_func(sys_tty_read), //402 (0x192) + bind_func(sys_tty_write), //403 (0x193) + null_func,//bind_func(sys_...) //404 (0x194) ROOT + null_func,//bind_func(sys_...) //405 (0x195) PM + null_func,//bind_func(sys_...) //406 (0x196) PM + null_func,//bind_func(sys_...) //407 (0x197) PM + null_func,//bind_func(sys_sm_get_tzpb) //408 (0x198) PM + null_func,//bind_func(sys_sm_get_fan_policy) //409 (0x199) PM + null_func,//bind_func(sys_game_board_storage_read) //410 (0x19A) + null_func,//bind_func(sys_game_board_storage_write) //411 (0x19B) + null_func,//bind_func(sys_game_get_rtc_status) //412 (0x19C) + null_func,//bind_func(sys_...) //413 (0x19D) ROOT + null_func,//bind_func(sys_...) //414 (0x19E) ROOT + null_func,//bind_func(sys_...) //415 (0x19F) ROOT + null_func, null_func, null_func, null_func, //419 UNS + null_func, null_func, null_func, null_func, null_func, //424 UNS + null_func, null_func, null_func, null_func, null_func, //429 UNS + null_func, null_func, null_func, null_func, null_func, //434 UNS + null_func, null_func, null_func, null_func, null_func, //439 UNS + null_func, null_func, null_func, null_func, null_func, //444 UNS + null_func, null_func, null_func, null_func, null_func, //449 UNS - null_func, null_func, null_func, null_func, null_func, //369 - null_func, null_func, null_func, null_func, null_func, //374 - null_func, null_func, null_func, null_func, null_func, //379 - null_func, null_func, null_func, null_func, null_func, //384 - null_func, null_func, null_func, null_func, null_func, //389 - null_func, null_func, null_func, null_func, null_func, //394 - null_func, null_func, null_func, null_func, null_func, //399 - null_func, null_func, bind_func(sys_tty_read), bind_func(sys_tty_write), null_func, //404 - null_func, null_func, null_func, null_func, null_func, //409 - null_func, null_func, null_func, null_func, null_func, //414 - null_func, null_func, null_func, null_func, null_func, //419 - null_func, null_func, null_func, null_func, null_func, //424 - null_func, null_func, null_func, null_func, null_func, //429 - null_func, null_func, null_func, null_func, null_func, //434 - null_func, null_func, null_func, null_func, null_func, //439 - null_func, null_func, null_func, null_func, null_func, //444 - null_func, null_func, null_func, null_func, null_func, //449 - null_func, null_func, null_func, null_func, null_func, //454 - null_func, null_func, null_func, null_func, null_func, //459 - null_func, null_func, null_func, null_func, null_func, //464 - null_func, null_func, null_func, null_func, null_func, //469 - null_func, null_func, null_func, null_func, null_func, //474 - null_func, null_func, null_func, null_func, null_func, //479 + null_func,//bind_func(sys_overlay_load_module) //450 (0x1C2) + null_func,//bind_func(sys_overlay_unload_module) //451 (0x1C3) + null_func,//bind_func(sys_overlay_get_module_list) //452 (0x1C4) + null_func,//bind_func(sys_overlay_get_module_info) //453 (0x1C5) + null_func,//bind_func(sys_overlay_load_module_by_fd) //454 (0x1C6) + null_func,//bind_func(sys_overlay_get_module_info2) //455 (0x1C7) + null_func,//bind_func(sys_overlay_get_sdk_version) //456 (0x1C8) + null_func,//bind_func(sys_overlay_get_module_dbg_info) //457 (0x1C9) + null_func,//bind_func(sys_overlay_get_module_dbg_info) //458 (0x1CA) + null_func, //459 (0x1CB) UNS + null_func,//bind_func(sys_prx_dbg_get_module_id_list) //460 (0x1CC) ROOT + null_func,//bind_func(sys_prx_get_module_id_by_address) //461 (0x1CD) + null_func, //462 (0x1CE) UNS + null_func,//bind_func(sys_prx_load_module_by_fd) //463 (0x1CF) + null_func,//bind_func(sys_prx_load_module_on_memcontainer_by_fd) //464 (0x1D0) + null_func,//bind_func(sys_prx_load_module_list) //465 (0x1D1) + null_func,//bind_func(sys_prx_load_module_list_on_memcontainer) //466 (0x1D2) + null_func,//bind_func(sys_prx_get_ppu_guid) //467 (0x1D3) + null_func,//bind_func(sys_...) //468 (0x1D4) ROOT + null_func, //469 (0x1D5) UNS + null_func,//bind_func(sys_...) //470 (0x1D6) ROOT + null_func,//bind_func(sys_...) //471 (0x1D7) ROOT + null_func,//bind_func(sys_...) //472 (0x1D8) ROOT + null_func,//bind_func(sys_...) //473 (0x1D9) + null_func,//bind_func(sys_...) //474 (0x1DA) + null_func,//bind_func(sys_...) //475 (0x1DB) ROOT + null_func,//bind_func(sys_...) //476 (0x1DC) ROOT + + null_func, null_func, null_func, //477-479 UNS null_func,//bind_func(sys_prx_load_module), //480 (0x1E0) null_func,//bind_func(sys_prx_start_module), //481 (0x1E1) @@ -353,50 +430,172 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_prx_link_library), //488 (0x1E8) bind_func(sys_prx_unlink_library), //489 (0x1E9) bind_func(sys_prx_query_library), //490 (0x1EA) - null_func, //491 (0x1EB) - null_func, //492 (0x1EC) - null_func,//sys_prx_dbg_get_module_info //493 (0x1ED) + null_func, //491 (0x1EB) UNS + null_func,//bind_func(sys_...) //492 (0x1EC) DBG + null_func,//bind_func(sys_prx_dbg_get_module_info) //493 (0x1ED) DBG null_func,//bind_func(sys_prx_get_module_list), //494 (0x1EE) null_func,//bind_func(sys_prx_get_module_info), //495 (0x1EF) null_func,//bind_func(sys_prx_get_module_id_by_name), //496 (0x1F0) null_func,//bind_func(sys_prx_load_module_on_memcontainer),//497 (0x1F1) bind_func(sys_prx_start), //498 (0x1F2) bind_func(sys_prx_stop), //499 (0x1F3) + null_func,//bind_func(sys_hid_manager_open) //500 (0x1F4) + null_func,//bind_func(sys_hid_manager_close) //501 (0x1F5) + null_func,//bind_func(sys_hid_manager_read) //502 (0x1F6) ROOT + null_func,//bind_func(sys_hid_manager_ioctl) //503 (0x1F7) + null_func,//bind_func(sys_hid_manager_map_logical_id_to_port_id) //504 (0x1F8) ROOT + null_func,//bind_func(sys_hid_manager_unmap_logical_id_to_port_id) //505 (0x1F9) ROOT + null_func,//bind_func(sys_hid_manager_add_hot_key_observer) //506 (0x1FA) ROOT + null_func,//bind_func(sys_hid_manager_remove_hot_key_observer) //507 (0x1FB) ROOT + null_func,//bind_func(sys_hid_manager_grab_focus) //508 (0x1FC) ROOT + null_func,//bind_func(sys_hid_manager_release_focus) //509 (0x1FD) ROOT + null_func,//bind_func(sys_hid_manager_...) //510 (0x1FE) + null_func,//bind_func(sys_hid_manager_set_...) //511 (0x1FF) ROOT + null_func,//bind_func(sys_hid_manager_...) //512 (0x200) ROOT + null_func,//bind_func(sys_hid_manager_...) //513 (0x201) + null_func,//bind_func(sys_hid_manager_...) //514 (0x202) + null_func, //515 (0x203) UNS + null_func,//bind_func(sys_config_open) //516 (0x204) + null_func,//bind_func(sys_config_close) //517 (0x205) + null_func,//bind_func(sys_config_get_service_event) //518 (0x206) + null_func,//bind_func(sys_config_add_service_listener) //519 (0x207) + null_func,//bind_func(sys_config_remove_service_listener) //520 (0x208) + null_func,//bind_func(sys_config_register_service) //521 (0x209) + null_func,//bind_func(sys_config_unregister_service) //522 (0x20A) + null_func,//bind_func(sys_config_io_event) //523 (0x20B) + null_func,//bind_func(sys_config_...) //524 (0x20C) + null_func,//bind_func(sys_config_...) //525 (0x20D) + null_func, //526 (0x20E) UNS + null_func, //527 (0x20F) UNS + null_func, //528 (0x210) UNS + null_func, //529 (0x211) UNS + null_func,//bind_func(sys_usbd_initialize) //530 (0x212) + null_func,//bind_func(sys_usbd_finalize) //531 (0x213) + null_func,//bind_func(sys_usbd_get_device_list) //532 (0x214) + null_func,//bind_func(sys_usbd_get_descriptor_size) //533 (0x215) + null_func,//bind_func(sys_usbd_get_descriptor) //534 (0x216) + null_func,//bind_func(sys_usbd_register_ldd) //535 (0x217) + null_func,//bind_func(sys_usbd_unregister_ldd) //536 (0x218) + null_func,//bind_func(sys_usbd_open_pipe) //537 (0x219) + null_func,//bind_func(sys_usbd_open_default_pipe) //538 (0x21A) + null_func,//bind_func(sys_usbd_close_pipe) //539 (0x21B) + null_func,//bind_func(sys_usbd_receive_event) //540 (0x21C) + null_func,//bind_func(sys_usbd_detect_event) //541 (0x21D) + null_func,//bind_func(sys_usbd_attach) //542 (0x21E) + null_func,//bind_func(sys_usbd_transfer_data) //543 (0x21F) + null_func,//bind_func(sys_usbd_isochronous_transfer_data) //544 (0x220) + null_func,//bind_func(sys_usbd_get_transfer_status) //545 (0x221) + null_func,//bind_func(sys_usbd_get_isochronous_transfer_status) //546 (0x222) + null_func,//bind_func(sys_usbd_get_device_location) //547 (0x223) + null_func,//bind_func(sys_usbd_send_event) //548 (0x224) + null_func,//bind_func(sys_ubsd_...) //549 (0x225) + null_func,//bind_func(sys_usbd_allocate_memory) //550 (0x226) + null_func,//bind_func(sys_usbd_free_memory) //551 (0x227) + null_func,//bind_func(sys_ubsd_...) //552 (0x228) + null_func,//bind_func(sys_ubsd_...) //553 (0x229) + null_func,//bind_func(sys_ubsd_...) //554 (0x22A) + null_func,//bind_func(sys_ubsd_...) //555 (0x22B) + null_func,//bind_func(sys_usbd_get_device_speed) //556 (0x22C) + null_func,//bind_func(sys_ubsd_...) //557 (0x22D) + null_func,//bind_func(sys_ubsd_...) //558 (0x22E) + null_func,//bind_func(sys_usbd_register_extra_ldd) //559 (0x22F) + null_func,//bind_func(sys_...) //560 (0x230) ROOT + null_func,//bind_func(sys_...) //561 (0x231) ROOT + null_func,//bind_func(sys_...) //562 (0x232) ROOT + null_func,//bind_func(sys_...) //563 (0x233) + null_func,//bind_func(sys_...) //564 (0x234) + null_func,//bind_func(sys_...) //565 (0x235) + null_func,//bind_func(sys_...) //566 (0x236) + null_func,//bind_func(sys_...) //567 (0x237) + null_func,//bind_func(sys_...) //568 (0x238) + null_func,//bind_func(sys_...) //569 (0x239) + null_func,//bind_func(sys_...) //570 (0x23A) + null_func,//bind_func(sys_pad_ldd_unregister_controller) //571 (0x23B) + null_func,//bind_func(sys_pad_ldd_data_insert) //572 (0x23C) + null_func,//bind_func(sys_pad_dbg_ldd_set_data_insert_mode) //573 (0x23D) + null_func,//bind_func(sys_pad_ldd_register_controller) //574 (0x23E) + null_func,//bind_func(sys_pad_ldd_get_port_no) //575 (0x23F) + null_func, //576 (0x240) UNS + null_func,//bind_func(sys_pad_manager_...) //577 (0x241) ROOT PM + null_func,//bind_func(sys_bluetooth_...) //578 (0x242) + null_func,//bind_func(sys_bluetooth_...) //579 (0x243) + null_func,//bind_func(sys_bluetooth_...) //580 (0x244) ROOT + null_func,//bind_func(sys_bluetooth_...) //581 (0x245) ROOT + null_func,//bind_func(sys_bluetooth_...) //582 (0x246) ROOT + null_func,//bind_func(sys_bluetooth_...) //583 (0x247) ROOT + null_func,//bind_func(sys_bluetooth_...) //584 (0x248) ROOT + null_func,//bind_func(sys_bluetooth_...) //585 (0x249) + null_func,//bind_func(sys_bluetooth_...) //586 (0x24A) + null_func,//bind_func(sys_bluetooth_...) //587 (0x24B) ROOT + null_func,//bind_func(sys_bluetooth_...) //588 (0x24C) + null_func,//bind_func(sys_bluetooth_...) //589 (0x24D) + null_func,//bind_func(sys_bluetooth_...) //590 (0x24E) ROOT + null_func,//bind_func(sys_bluetooth_...) //591 (0x24F) + null_func,//bind_func(sys_bluetooth_...) //592 (0x250) + null_func,//bind_func(sys_bluetooth_...) //593 (0x251) ROOT + null_func,//bind_func(sys_bluetooth_...) //594 (0x252) + null_func,//bind_func(sys_bluetooth_...) //595 (0x253) + null_func,//bind_func(sys_bluetooth_...) //596 (0x254) + null_func,//bind_func(sys_bluetooth_...) //597 (0x255) + null_func,//bind_func(sys_bluetooth_...) //598 (0x256) ROOT + null_func,//bind_func(sys_bluetooth_...) //599 (0x257) ROOT + null_func,//bind_func(sys_storage_open) //600 (0x258) ROOT + null_func,//bind_func(sys_storage_close) //601 (0x259) + null_func,//bind_func(sys_storage_read) //602 (0x25A) + null_func,//bind_func(sys_storage_write) //603 (0x25B) + null_func,//bind_func(sys_storage_send_device_command) //604 (0x25C) + null_func,//bind_func(sys_storage_async_configure) //605 (0x25D) + null_func,//bind_func(sys_storage_async_read) //606 (0x25E) + null_func,//bind_func(sys_storage_async_write) //607 (0x25F) + null_func,//bind_func(sys_storage_async_cancel) //608 (0x260) + null_func,//bind_func(sys_storage_get_device_info) //609 (0x261) ROOT + null_func,//bind_func(sys_storage_get_device_config) //610 (0x262) ROOT + null_func,//bind_func(sys_storage_report_devices) //611 (0x263) ROOT + null_func,//bind_func(sys_storage_configure_medium_event) //612 (0x264) ROOT + null_func,//bind_func(sys_storage_set_medium_polling_interval) //613 (0x265) + null_func,//bind_func(sys_storage_create_region) //614 (0x266) + null_func,//bind_func(sys_storage_delete_region) //615 (0x267) + null_func,//bind_func(sys_storage_execute_device_command) //616 (0x268) + null_func,//bind_func(sys_storage_check_region_acl) //617 (0x269) + null_func,//bind_func(sys_storage_set_region_acl) //618 (0x26A) + null_func,//bind_func(sys_storage_async_send_device_command) //619 (0x26B) + null_func,//bind_func(sys_...) //620 (0x26C) ROOT + null_func,//bind_func(sys_gamepad_ycon_if) //621 (0x26D) + null_func,//bind_func(sys_storage_get_region_offset) //622 (0x26E) + null_func,//bind_func(sys_storage_set_emulated_speed) //623 (0x26F) + null_func,//bind_func(sys_io_buffer_create) //624 (0x270) + null_func,//bind_func(sys_io_buffer_destroy) //625 (0x271) + null_func,//bind_func(sys_io_buffer_allocate) //626 (0x272) + null_func,//bind_func(sys_io_buffer_free) //627 (0x273) + null_func, //628 (0x274) UNS + null_func, //629 (0x275) UNS + null_func,//bind_func(sys_gpio_set) //630 (0x276) + null_func,//bind_func(sys_gpio_get) //631 (0x277) + null_func, //632 (0x278) UNS + null_func,//bind_func(sys_fsw_connect_event) //633 (0x279) + null_func,//bind_func(sys_fsw_disconnect_event) //634 (0x27A) + null_func,//bind_func(sys_btsetting_if) //635 (0x27B) + null_func,//bind_func(sys_...) //636 (0x27C) + null_func,//bind_func(sys_...) //637 (0x27D) + null_func,//bind_func(sys_...) //638 (0x27E) - null_func, null_func, null_func, null_func, null_func, //504 - null_func, null_func, null_func, null_func, null_func, //509 - null_func, null_func, null_func, null_func, null_func, //514 - null_func, null_func, null_func, null_func, null_func, //519 - null_func, null_func, null_func, null_func, null_func, //524 - null_func, null_func, null_func, null_func, null_func, //529 - null_func, null_func, null_func, null_func, null_func, //534 - null_func, null_func, null_func, null_func, null_func, //539 - null_func, null_func, null_func, null_func, null_func, //544 - null_func, null_func, null_func, null_func, null_func, //549 - null_func, null_func, null_func, null_func, null_func, //554 - null_func, null_func, null_func, null_func, null_func, //559 - null_func, null_func, null_func, null_func, null_func, //564 - null_func, null_func, null_func, null_func, null_func, //569 - null_func, null_func, null_func, null_func, null_func, //574 - null_func, null_func, null_func, null_func, null_func, //579 - null_func, null_func, null_func, null_func, null_func, //584 - null_func, null_func, null_func, null_func, null_func, //589 - null_func, null_func, null_func, null_func, null_func, //594 - null_func, null_func, null_func, null_func, null_func, //599 - null_func, null_func, null_func, null_func, null_func, //604 - null_func, null_func, null_func, null_func, null_func, //609 - null_func, null_func, null_func, null_func, null_func, //614 - null_func, null_func, null_func, null_func, null_func, //619 - null_func, null_func, null_func, null_func, null_func, //624 - null_func, null_func, null_func, null_func, null_func, //629 - null_func, null_func, null_func, null_func, null_func, //634 - null_func, null_func, null_func, null_func, null_func, //639 - null_func, null_func, null_func, null_func, null_func, //644 - null_func, null_func, null_func, null_func, null_func, //649 - null_func, null_func, null_func, null_func, null_func, //654 - null_func, null_func, null_func, null_func, null_func, //659 - null_func, null_func, null_func, null_func, null_func, //664 - null_func, //665 + null_func, //639 DEPRECATED + null_func, null_func, null_func, null_func, null_func, //644 DEPRECATED + null_func, null_func, null_func, null_func, null_func, //649 DEPRECATED + + null_func,//bind_func(sys_rsxaudio_initialize) //650 (0x28A) + null_func,//bind_func(sys_rsxaudio_finalize) //651 (0x28B) + null_func,//bind_func(sys_rsxaudio_import_shared_memory) //652 (0x28C) + null_func,//bind_func(sys_rsxaudio_unimport_shared_memory) //653 (0x28D) + null_func,//bind_func(sys_rsxaudio_create_connection) //654 (0x28E) + null_func,//bind_func(sys_rsxaudio_close_connection) //655 (0x28F) + null_func,//bind_func(sys_rsxaudio_prepare_process) //656 (0x290) + null_func,//bind_func(sys_rsxaudio_start_process) //657 (0x291) + null_func,//bind_func(sys_rsxaudio_) //658 (0x292) + null_func,//bind_func(sys_rsxaudio_) //659 (0x293) + + null_func, null_func, null_func, null_func, null_func, //664 UNS + null_func, //665 UNS bind_func(sys_rsx_device_open), //666 (0x29A) bind_func(sys_rsx_device_close), //667 (0x29B) @@ -410,33 +609,71 @@ static func_caller* sc_table[kSyscallTableLength] = bind_func(sys_rsx_device_map), //675 (0x2A3) bind_func(sys_rsx_device_unmap), //676 (0x2A4) bind_func(sys_rsx_attribute), //677 (0x2A5) - null_func, //678 (0x2A6) - null_func, //679 (0x2A7) ROOT + null_func,//bind_func(sys_...) //678 (0x2A6) + null_func,//bind_func(sys_...) //679 (0x2A7) ROOT + null_func,//bind_func(sys_...) //680 (0x2A8) ROOT + null_func,//bind_func(sys_...) //681 (0x2A9) ROOT + null_func,//bind_func(sys_...) //682 (0x2AA) ROOT + null_func,//bind_func(sys_...) //683 (0x2AB) ROOT + null_func,//bind_func(sys_...) //684 (0x2AC) ROOT + null_func,//bind_func(sys_...) //685 (0x2AD) ROOT + null_func,//bind_func(sys_...) //686 (0x2AE) ROOT + null_func,//bind_func(sys_...) //687 (0x2AF) ROOT + null_func,//bind_func(sys_...) //688 (0x2B0) ROOT + null_func,//bind_func(sys_...) //689 (0x2B1) ROOT + null_func,//bind_func(sys_...) //690 (0x2B2) ROOT + null_func,//bind_func(sys_...) //691 (0x2B3) ROOT + null_func,//bind_func(sys_...) //692 (0x2B4) ROOT + null_func,//bind_func(sys_...) //693 (0x2B5) ROOT + null_func,//bind_func(sys_...) //694 (0x2B6) DEPRECATED + null_func,//bind_func(sys_...) //695 (0x2B7) DEPRECATED + null_func,//bind_func(sys_...) //696 (0x2B8) ROOT + null_func,//bind_func(sys_...) //697 (0x2B9) UNS + null_func,//bind_func(sys_...) //698 (0x2BA) UNS + null_func,//bind_func(sys_bdemu_send_command) //699 (0x2BB) + null_func,//bind_func(sys_net_bnet_accept) //700 (0x2BC) + null_func,//bind_func(sys_net_bnet_bind) //701 (0x2BD) + null_func,//bind_func(sys_net_bnet_connect) //702 (0x2BE) + null_func,//bind_func(sys_net_bnet_getpeername) //703 (0x2BF) + null_func,//bind_func(sys_net_bnet_getsockname) //704 (0x2C0) + null_func,//bind_func(sys_net_bnet_getsockopt) //705 (0x2C1) + null_func,//bind_func(sys_net_bnet_listen) //706 (0x2C2) + null_func,//bind_func(sys_net_bnet_recvfrom) //707 (0x2C3) + null_func,//bind_func(sys_net_bnet_recvmsg) //708 (0x2C4) + null_func,//bind_func(sys_net_bnet_sendmsg) //709 (0x2C5) + null_func,//bind_func(sys_net_bnet_sendto) //710 (0x2C6) + null_func,//bind_func(sys_net_bnet_setsockop) //711 (0x2C7) + null_func,//bind_func(sys_net_bnet_shutdown) //712 (0x2C8) + null_func,//bind_func(sys_net_bnet_socket) //713 (0x2C9) + null_func,//bind_func(sys_net_bnet_close) //714 (0x2CA) + null_func,//bind_func(sys_net_bnet_poll) //715 (0x2CB) + null_func,//bind_func(sys_net_bnet_select) //716 (0x2CC) + null_func,//bind_func(sys_net_open_dump) //717 (0x2CD) + null_func,//bind_func(sys_net_read_dump) //718 (0x2CE) + null_func,//bind_func(sys_net_close_dump) //719 (0x2CF) + null_func,//bind_func(sys_net_write_dump) //720 (0x2D0) + null_func,//bind_func(sys_net_abort) //721 (0x2D1) + null_func,//bind_func(sys_net_infoctl) //722 (0x2D2) + null_func,//bind_func(sys_net_control) //723 (0x2D3) + null_func,//bind_func(sys_net_bnet_ioctl) //724 (0x2D4) + null_func,//bind_func(sys_net_bnet_sysctl) //725 (0x2D5) + null_func,//bind_func(sys_net_eurus_post_command) //726 (0x2D6) - null_func, null_func, null_func, null_func, null_func, //684 - null_func, null_func, null_func, null_func, null_func, //689 - null_func, null_func, null_func, null_func, null_func, //694 - null_func, null_func, null_func, null_func, null_func, //699 - null_func, null_func, null_func, null_func, null_func, //704 - null_func, null_func, null_func, null_func, null_func, //709 - null_func, null_func, null_func, null_func, null_func, //714 - null_func, null_func, null_func, null_func, null_func, //719 - null_func, null_func, null_func, null_func, null_func, //724 - null_func, null_func, null_func, null_func, null_func, //729 - null_func, null_func, null_func, null_func, null_func, //734 - null_func, null_func, null_func, null_func, null_func, //739 - null_func, null_func, null_func, null_func, null_func, //744 - null_func, null_func, null_func, null_func, null_func, //749 - null_func, null_func, null_func, null_func, null_func, //754 - null_func, null_func, null_func, null_func, null_func, //759 - null_func, null_func, null_func, null_func, null_func, //764 - null_func, null_func, null_func, null_func, null_func, //769 - null_func, null_func, null_func, null_func, null_func, //774 - null_func, null_func, null_func, null_func, null_func, //779 - null_func, null_func, null_func, null_func, null_func, //784 - null_func, null_func, null_func, null_func, null_func, //789 - null_func, null_func, null_func, null_func, null_func, //794 - null_func, null_func, null_func, null_func, null_func, //799 + null_func, null_func, null_func, //729 UNS + null_func, null_func, null_func, null_func, null_func, //734 UNS + null_func, null_func, null_func, null_func, null_func, //739 UNS + null_func, null_func, null_func, null_func, null_func, //744 UNS + null_func, null_func, null_func, null_func, null_func, //749 UNS + null_func, null_func, null_func, null_func, null_func, //754 UNS + null_func, null_func, null_func, null_func, null_func, //759 UNS + null_func, null_func, null_func, null_func, null_func, //764 UNS + null_func, null_func, null_func, null_func, null_func, //769 UNS + null_func, null_func, null_func, null_func, null_func, //774 UNS + null_func, null_func, null_func, null_func, null_func, //779 UNS + null_func, null_func, null_func, null_func, null_func, //784 UNS + null_func, null_func, null_func, null_func, null_func, //789 UNS + null_func, null_func, null_func, null_func, null_func, //794 UNS + null_func, null_func, null_func, null_func, null_func, //799 UNS null_func,//bind_func(sys_fs_test), //800 (0x320) bind_func(cellFsOpen), //801 (0x321) @@ -487,42 +724,148 @@ static func_caller* sc_table[kSyscallTableLength] = null_func,//bind_func(sys_fs_mapped_free), //846 (0x34E) null_func,//bind_func(sys_fs_truncate2), //847 (0x34F) - null_func, null_func, //849 - null_func, null_func, null_func, null_func, null_func, //854 - null_func, null_func, null_func, null_func, null_func, //859 - null_func, null_func, null_func, null_func, null_func, //864 - null_func, null_func, null_func, null_func, null_func, //869 - null_func, null_func, null_func, null_func, null_func, //874 - null_func, null_func, null_func, null_func, null_func, //879 - null_func, null_func, null_func, null_func, null_func, //884 - null_func, null_func, null_func, null_func, null_func, //889 - null_func, null_func, null_func, null_func, null_func, //894 - null_func, null_func, null_func, null_func, null_func, //899 - null_func, null_func, null_func, null_func, null_func, //904 - null_func, null_func, null_func, null_func, null_func, //909 - null_func, null_func, null_func, null_func, null_func, //914 - null_func, null_func, null_func, null_func, null_func, //919 - null_func, null_func, null_func, null_func, null_func, //924 - null_func, null_func, null_func, null_func, null_func, //929 - null_func, null_func, null_func, null_func, null_func, //934 - null_func, null_func, null_func, null_func, null_func, //939 - null_func, null_func, null_func, null_func, null_func, //944 - null_func, null_func, null_func, null_func, null_func, //949 - null_func, null_func, null_func, null_func, null_func, //954 - null_func, null_func, null_func, null_func, null_func, //959 - null_func, null_func, null_func, null_func, null_func, //964 - null_func, null_func, null_func, null_func, null_func, //969 - null_func, null_func, null_func, null_func, null_func, //974 - null_func, null_func, null_func, null_func, null_func, //979 - null_func, null_func, null_func, null_func, null_func, //984 - null_func, null_func, null_func, null_func, null_func, //989 - null_func, null_func, null_func, null_func, null_func, //994 - null_func, null_func, null_func, null_func, null_func, //999 - null_func, null_func, null_func, null_func, null_func, //1004 - null_func, null_func, null_func, null_func, null_func, //1009 - null_func, null_func, null_func, null_func, null_func, //1014 - null_func, null_func, null_func, null_func, null_func, //1019 - null_func, null_func, null_func, bind_func(cellGcmCallback), //1023 + null_func, null_func, //849 UNS + null_func, null_func, null_func, null_func, null_func, //854 UNS + null_func, null_func, null_func, null_func, null_func, //859 UNS + + null_func,//bind_func(syscall_sys_ss_get_cache_of_analog_sunset_flag), //860 (0x35C) AUTHID + null_func,//bind_func(syscall_...) //861 ROOT + null_func,//bind_func(syscall_...) //862 ROOT + null_func,//bind_func(syscall_...) //863 ROOT + null_func,//bind_func(syscall_...) //864 DBG + null_func,//bind_func(sys_ss_random_number_generator), //865 (0x361) ROOT AUTHID + null_func,//bind_func(sys_...) //866 ROOT + null_func,//bind_func(sys_...) //867 ROOT + null_func,//bind_func(sys_...) //868 ROOT / DBG AUTHID + null_func,//bind_func(sys_...) //869 ROOT + null_func,//bind_func(sys_ss_get_console_id), //870 (0x366) + null_func,//bind_func(sys_ss_access_control_engine), //871 (0x367) DBG + null_func,//bind_func(sys_ss_get_open_psid), //872 (0x368) + null_func,//bind_func(sys_ss_get_cache_of_product_mode), //873 (0x369) + null_func,//bind_func(sys_ss_get_cache_of_flash_ext_flag), //874 (0x36A) + null_func,//bind_func(sys_ss_get_boot_device) //875 (0x36B) + null_func,//bind_func(sys_ss_disc_access_control) //876 (0x36C) + null_func,//bind_func(sys_ss_~utoken_if) //877 (0x36D) ROOT + null_func,//bind_func(sys_ss_ad_sign) //878 (0x36E) + null_func,//bind_func(sys_ss_media_id) //879 (0x36F) + null_func,//bind_func(sys_deci3_open) //880 (0x370) + null_func,//bind_func(sys_deci3_create_event_path) //881 (0x371) + null_func,//bind_func(sys_deci3_close) //882 (0x372) + null_func,//bind_func(sys_deci3_send) //883 (0x373) + null_func,//bind_func(sys_deci3_receive) //884 (0x374) + null_func,//bind_func(sys_deci3_open2) //885 (0x375) + null_func, //886 (0x376) UNS + null_func, //887 (0x377) UNS + null_func, //888 (0x378) UNS + null_func,//bind_func(sys_...) //889 (0x379) ROOT + null_func,//bind_func(sys_deci3_initialize) //890 (0x37A) + null_func,//bind_func(sys_deci3_terminate) //891 (0x37B) + null_func,//bind_func(sys_deci3_debug_mode) //892 (0x37C) + null_func,//bind_func(sys_deci3_show_status) //893 (0x37D) + null_func,//bind_func(sys_deci3_echo_test) //894 (0x37E) + null_func,//bind_func(sys_deci3_send_dcmp_packet) //895 (0x37F) + null_func,//bind_func(sys_deci3_dump_cp_register) //896 (0x380) + null_func,//bind_func(sys_deci3_dump_cp_buffer) //897 (0x381) + null_func, //898 (0x382) UNS + null_func,//bind_func(sys_deci3_test) //899 (0x383) + null_func,//bind_func(sys_dbg_stop_processes) //900 (0x384) + null_func,//bind_func(sys_dbg_continue_processes) //901 (0x385) + null_func,//bind_func(sys_dbg_stop_threads) //902 (0x386) + null_func,//bind_func(sys_dbg_continue_threads) //903 (0x387) + null_func,//bind_func(sys_dbg_read_process_memory) //904 (0x388) + null_func,//bind_func(sys_dbg_write_process_memory) //905 (0x389) + null_func,//bind_func(sys_dbg_read_thread_register) //906 (0x38A) + null_func,//bind_func(sys_dbg_write_thread_register) //907 (0x38B) + null_func,//bind_func(sys_dbg_get_process_list) //908 (0x38C) + null_func,//bind_func(sys_dbg_get_thread_list) //909 (0x38D) + null_func,//bind_func(sys_dbg_get_thread_info) //910 (0x38E) + null_func,//bind_func(sys_dbg_spu_thread_read_from_ls) //911 (0x38F) + null_func,//bind_func(sys_dbg_spu_thread_write_to_ls) //912 (0x390) + null_func,//bind_func(sys_dbg_kill_process) //913 (0x391) + null_func,//bind_func(sys_dbg_get_process_info) //914 (0x392) + null_func,//bind_func(sys_dbg_set_run_control_bit_to_spu) //915 (0x393) + null_func,//bind_func(sys_dbg_spu_thread_get_exception_cause) //916 (0x394) + null_func,//bind_func(sys_dbg_create_kernel_event_queue) //917 (0x395) + null_func,//bind_func(sys_dbg_read_kernel_event_queue) //918 (0x396) + null_func,//bind_func(sys_dbg_destroy_kernel_event_queue) //919 (0x397) + null_func,//bind_func(sys_dbg_get_process_event_ctrl_flag) //920 (0x398) + null_func,//bind_func(sys_dbg_set_process_event_cntl_flag) //921 (0x399) + null_func,//bind_func(sys_dbg_get_spu_thread_group_event_cntl_flag) //922 (0x39A) + null_func,//bind_func(sys_dbg_set_spu_thread_group_event_cntl_flag) //923 (0x39B) + null_func,//bind_func(sys_...) //924 (0x39C) + null_func,//bind_func(sys_dbg_get_raw_spu_list) //925 (0x39D) + null_func,//bind_func(sys_...) //926 (0x39E) + null_func,//bind_func(sys_...) //927 (0x3A0) + null_func,//bind_func(sys_...) //928 (0x3A1) + null_func,//bind_func(sys_...) //929 (0x3A2) + null_func,//bind_func(sys_...) //930 (0x3A3) + null_func,//bind_func(sys_...) //931 (0x3A4) + null_func,//bind_func(sys_dbg_get_mutex_list) //932 (0x3A4) + null_func,//bind_func(sys_dbg_get_mutex_information) //933 (0x3A5) + null_func,//bind_func(sys_dbg_get_cond_list) //934 (0x3A6) + null_func,//bind_func(sys_dbg_get_cond_information) //935 (0x3A7) + null_func,//bind_func(sys_dbg_get_rwlock_list) //936 (0x3A8) + null_func,//bind_func(sys_dbg_get_rwlock_information) //937 (0x3A9) + null_func,//bind_func(sys_dbg_get_lwmutex_list) //938 (0x3AA) + null_func,//bind_func(sys_dbg_get_address_from_dabr) //939 (0x3AB) + null_func,//bind_func(sys_dbg_set_address_to_dabr) //940 (0x3AC) + null_func,//bind_func(sys_dbg_get_lwmutex_information) //941 (0x3AD) + null_func,//bind_func(sys_dbg_get_event_queue_list) //942 (0x3AE) + null_func,//bind_func(sys_dbg_get_event_queue_information) //943 (0x3AF) + null_func,//bind_func(sys_dbg_initialize_ppu_exception_handler) //944 (0x3B0) + null_func,//bind_func(sys_dbg_finalize_ppu_exception_handler) //945 (0x3B1) DBG + null_func,//bind_func(sys_dbg_get_semaphore_list) //946 (0x3B2) + null_func,//bind_func(sys_dbg_get_semaphore_information) //947 (0x3B3) + null_func,//bind_func(sys_dbg_get_kernel_thread_list) //948 (0x3B4) + null_func,//bind_func(sys_dbg_get_kernel_thread_info) //949 (0x3B5) + null_func,//bind_func(sys_dbg_get_lwcond_list) //950 (0x3B6) + null_func,//bind_func(sys_dbg_get_lwcond_information) //951 (0x3B7) + null_func,//bind_func(sys_dbg_create_scratch_data_area_ext) //952 (0x3B8) + null_func,//bind_func(sys_dbg_vm_get_page_information) //953 (0x3B9) + null_func,//bind_func(sys_dbg_vm_get_info) //954 (0x3BA) + null_func,//bind_func(sys_dbg_enable_floating_point_enabled_exception) //955 (0x3BB) + null_func,//bind_func(sys_dbg_disable_floating_point_enabled_exception) //956 (0x3BC) + null_func,//bind_func(sys_dbg_...) //957 (0x3BD) DBG + null_func, //958 (0x3BE) UNS + null_func,//bind_func(sys_dbg_...) //959 (0x3BF) + null_func,//bind_func(sys_dbg_perfomance_monitor) //960 (0x3C0) + null_func,//bind_func(sys_dbg_...) //961 (0x3C1) + null_func,//bind_func(sys_dbg_...) //962 (0x3C2) + null_func,//bind_func(sys_dbg_...) //963 (0x3C3) + null_func,//bind_func(sys_dbg_...) //964 (0x3C4) + null_func,//bind_func(sys_dbg_...) //965 (0x3C5) + null_func,//bind_func(sys_dbg_...) //966 (0x3C6) + null_func,//bind_func(sys_dbg_...) //967 (0x3C7) + null_func,//bind_func(sys_dbg_...) //968 (0x3C8) + null_func,//bind_func(sys_dbg_...) //969 (0x3C9) + null_func,//bind_func(sys_dbg_get_event_flag_list) //970 (0x3CA) + null_func,//bind_func(sys_dbg_get_event_flag_information) //971 (0x3CB) + null_func,//bind_func(sys_dbg_...) //972 (0x3CC) + null_func,//bind_func(sys_dbg_...) //973 (0x3CD) + null_func,//bind_func(sys_dbg_...) //974 (0x3CE) + null_func,//bind_func(sys_dbg_read_spu_thread_context2) //975 (0x3CF) + null_func,//bind_func(sys_dbg_...) //976 (0x3D0) + null_func,//bind_func(sys_dbg_...) //977 (0x3D1) + null_func,//bind_func(sys_dbg_...) //978 (0x3D2) ROOT + null_func,//bind_func(sys_dbg_...) //979 (0x3D3) + null_func,//bind_func(sys_dbg_...) //980 (0x3D4) + null_func,//bind_func(sys_dbg_...) //981 (0x3D5) ROOT + null_func,//bind_func(sys_dbg_...) //982 (0x3D6) + null_func,//bind_func(sys_dbg_...) //983 (0x3D7) + null_func,//bind_func(sys_dbg_...) //984 (0x3D8) + null_func,//bind_func(sys_dbg_get_console_type) //985 (0x3D9) ROOT + null_func,//bind_func(sys_dbg_...) //986 (0x3DA) ROOT DBG + null_func,//bind_func(sys_dbg_...) //987 (0x3DB) ROOT + null_func,//bind_func(sys_dbg_..._ppu_exception_handler) //988 (0x3DC) + null_func,//bind_func(sys_dbg_...) //989 (0x3DD) + + null_func, null_func, null_func, null_func, null_func, //994 UNS + null_func, null_func, null_func, null_func, null_func, //999 UNS + null_func, null_func, null_func, null_func, null_func, //1004 UNS + null_func, null_func, null_func, null_func, null_func, //1009 UNS + null_func, null_func, null_func, null_func, null_func, //1014 UNS + null_func, null_func, null_func, null_func, null_func, //1019 UNS + null_func, null_func, null_func, bind_func(cellGcmCallback), //1023 UNS }; /** HACK: Used to delete func_caller objects that get allocated and stored in sc_table (above). diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index cfb31964fc..0b5741fae2 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -66,4 +66,4 @@ typedef int64_t s64; #include "Utilities/IdManager.h" #define _PRGNAME_ "RPCS3" -#define _PRGVER_ "0.0.0.4" +#define _PRGVER_ "0.0.0.5"