diff --git a/Utilities/Interval.h b/Utilities/Interval.h index bc8009c743..120edcb073 100644 --- a/Utilities/Interval.h +++ b/Utilities/Interval.h @@ -1,42 +1,32 @@ #pragma once -template -struct BaseInterval +template struct range_t { - static const uint64_t zero = 0ull; - static const uint64_t notz = 0xffffffffffffffffull; + T1 _min; // first value + T2 _max; // second value +}; - T m_min, m_max; +template constexpr range_t, std::decay_t> make_range(T1&& _min, T2&& _max) +{ + return{ std::forward(_min), std::forward(_max) }; +} - static BaseInterval make(T min_value, T max_value) - { - BaseInterval res = { min_value, max_value }; - return res; - } +template constexpr bool operator <(const range_t& range, const T& value) +{ + return range._min < value && range._max < value; +} - static BaseInterval make() - { - return make((T&)zero, (T&)notz); - } +template constexpr bool operator <(const T& value, const range_t& range) +{ + return value < range._min && value < range._max; +} - bool getconst(T& result) - { - if (m_min == m_max) - { - result = m_min; - return true; - } - else - { - return false; - } - } +template constexpr bool operator ==(const range_t& range, const T& value) +{ + return !(value < range._min) && !(range._max < value); +} - bool isindef() - { - if (T == float) - { - - } - } -}; \ No newline at end of file +template constexpr bool operator ==(const T& value, const range_t& range) +{ + return !(value < range._min) && !(range._max < value); +} diff --git a/rpcs3/Emu/SysCalls/ModuleManager.cpp b/rpcs3/Emu/SysCalls/ModuleManager.cpp index a6a2d4b487..06b3a66917 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.cpp +++ b/rpcs3/Emu/SysCalls/ModuleManager.cpp @@ -2,116 +2,116 @@ #include "Modules.h" #include "ModuleManager.h" -extern Module cellAdec; -extern Module cellAtrac; -extern Module cellAtracMulti; -extern Module cellAudio; -extern Module cellAvconfExt; -extern Module cellBGDL; -extern Module cellCamera; -extern Module cellCelp8Enc; -extern Module cellCelpEnc; -extern Module cellDaisy; -extern Module cellDmux; -extern Module cellFiber; -extern Module cellFont; -extern Module cellFontFT; -extern Module cellFs; -extern Module cellGame; -extern Module cellGameExec; -extern Module cellGcmSys; -extern Module cellGem; -extern Module cellGifDec; -extern Module cellHttp; -extern Module cellHttps; -extern Module cellHttpUtil; -extern Module cellImeJp; -extern Module cellJpgDec; -extern Module cellJpgEnc; -extern Module cellKey2char; -extern Module cellL10n; -extern Module cellMic; -extern Module cellMusic; -extern Module cellMusicDecode; -extern Module cellMusicExport; -extern Module cellNetCtl; -extern Module cellOskDialog; -extern Module cellOvis; -extern Module cellPamf; -extern Module cellPhotoDecode; -extern Module cellPhotoExport; -extern Module cellPhotoImportUtil; -extern Module cellPngDec; -extern Module cellPngEnc; -extern Module cellPrint; -extern Module cellRec; -extern Module cellRemotePlay; -extern Module cellResc; -extern Module cellRtc; -extern Module cellRudp; -extern Module cellSail; -extern Module cellSailRec; -extern Module cellSaveData; -extern Module cellMinisSaveData; -extern Module cellScreenshot; -extern Module cellSearch; -extern Module cellSheap; -extern Module cellSpudll; -extern Module cellSpurs; -extern Module cellSpursJq; -extern Module cellSsl; -extern Module cellSubdisplay; -extern Module cellSync; -extern Module cellSync2; -extern Module cellSysconf; -extern Module cellSysmodule; -extern Module cellSysutil; -extern Module cellSysutilAp; -extern Module cellSysutilAvc; -extern Module cellSysutilAvc2; -extern Module cellSysutilMisc; -extern Module cellUsbd; -extern Module cellUsbPspcm; -extern Module cellUserInfo; -extern Module cellVdec; -extern Module cellVideoExport; -extern Module cellVideoUpload; -extern Module cellVoice; -extern Module cellVpost; -extern Module libmixer; -extern Module libsnd3; -extern Module libsynth2; -extern Module sceNp; -extern Module sceNp2; -extern Module sceNpClans; -extern Module sceNpCommerce2; -extern Module sceNpSns; -extern Module sceNpTrophy; -extern Module sceNpTus; -extern Module sceNpUtil; -extern Module sys_io; -extern Module libnet; -extern Module sysPrxForUser; -extern Module sys_libc; -extern Module sys_lv2dbg; +extern Module<> cellAdec; +extern Module<> cellAtrac; +extern Module<> cellAtracMulti; +extern Module<> cellAudio; +extern Module<> cellAvconfExt; +extern Module<> cellBGDL; +extern Module<> cellCamera; +extern Module<> cellCelp8Enc; +extern Module<> cellCelpEnc; +extern Module<> cellDaisy; +extern Module<> cellDmux; +extern Module<> cellFiber; +extern Module<> cellFont; +extern Module<> cellFontFT; +extern Module<> cellFs; +extern Module<> cellGame; +extern Module<> cellGameExec; +extern Module<> cellGcmSys; +extern Module<> cellGem; +extern Module<> cellGifDec; +extern Module<> cellHttp; +extern Module<> cellHttps; +extern Module<> cellHttpUtil; +extern Module<> cellImeJp; +extern Module<> cellJpgDec; +extern Module<> cellJpgEnc; +extern Module<> cellKey2char; +extern Module<> cellL10n; +extern Module<> cellMic; +extern Module<> cellMusic; +extern Module<> cellMusicDecode; +extern Module<> cellMusicExport; +extern Module<> cellNetCtl; +extern Module<> cellOskDialog; +extern Module<> cellOvis; +extern Module<> cellPamf; +extern Module<> cellPhotoDecode; +extern Module<> cellPhotoExport; +extern Module<> cellPhotoImportUtil; +extern Module<> cellPngDec; +extern Module<> cellPngEnc; +extern Module<> cellPrint; +extern Module<> cellRec; +extern Module<> cellRemotePlay; +extern Module<> cellResc; +extern Module<> cellRtc; +extern Module<> cellRudp; +extern Module<> cellSail; +extern Module<> cellSailRec; +extern Module<> cellSaveData; +extern Module<> cellMinisSaveData; +extern Module<> cellScreenshot; +extern Module<> cellSearch; +extern Module<> cellSheap; +extern Module<> cellSpudll; +extern Module<> cellSpurs; +extern Module<> cellSpursJq; +extern Module<> cellSsl; +extern Module<> cellSubdisplay; +extern Module<> cellSync; +extern Module cellSync2; +extern Module<> cellSysconf; +extern Module<> cellSysmodule; +extern Module<> cellSysutil; +extern Module<> cellSysutilAp; +extern Module<> cellSysutilAvc; +extern Module<> cellSysutilAvc2; +extern Module<> cellSysutilMisc; +extern Module<> cellUsbd; +extern Module<> cellUsbPspcm; +extern Module<> cellUserInfo; +extern Module<> cellVdec; +extern Module<> cellVideoExport; +extern Module<> cellVideoUpload; +extern Module<> cellVoice; +extern Module<> cellVpost; +extern Module<> libmixer; +extern Module<> libsnd3; +extern Module<> libsynth2; +extern Module<> sceNp; +extern Module<> sceNp2; +extern Module<> sceNpClans; +extern Module<> sceNpCommerce2; +extern Module<> sceNpSns; +extern Module<> sceNpTrophy; +extern Module<> sceNpTus; +extern Module<> sceNpUtil; +extern Module<> sys_io; +extern Module<> libnet; +extern Module<> sysPrxForUser; +extern Module<> sys_libc; +extern Module<> sys_lv2dbg; struct ModuleInfo { const s32 id; // -1 if the module doesn't have corresponding CELL_SYSMODULE_* id const char* const name; - Module* const module; + Module<>* const module; explicit operator bool() const { return module != nullptr; } - operator Module*() const + operator Module<>*() const { return module; } - Module* operator ->() const + Module<>* operator ->() const { return module; } @@ -243,7 +243,7 @@ void ModuleManager::Init() clear_ppu_functions(); - std::unordered_set processed; + std::unordered_set*> processed; for (auto& module : g_module_list) { @@ -272,7 +272,7 @@ void ModuleManager::Close() return; } - std::unordered_set processed; + std::unordered_set*> processed; for (auto& module : g_module_list) { @@ -285,7 +285,25 @@ void ModuleManager::Close() m_init = false; } -Module* ModuleManager::GetModuleByName(const char* name) +void ModuleManager::Alloc() +{ + if (!m_init) + { + return; + } + + std::unordered_set*> processed; + + for (auto& module : g_module_list) + { + if (module && module->on_alloc && processed.emplace(module).second) + { + module->on_alloc(); + } + } +} + +Module<>* ModuleManager::GetModuleByName(const char* name) { for (auto& module : g_module_list) { @@ -298,7 +316,7 @@ Module* ModuleManager::GetModuleByName(const char* name) return nullptr; } -Module* ModuleManager::GetModuleById(u16 id) +Module<>* ModuleManager::GetModuleById(u16 id) { for (auto& module : g_module_list) { diff --git a/rpcs3/Emu/SysCalls/ModuleManager.h b/rpcs3/Emu/SysCalls/ModuleManager.h index 45a4c7d69c..593f278b3a 100644 --- a/rpcs3/Emu/SysCalls/ModuleManager.h +++ b/rpcs3/Emu/SysCalls/ModuleManager.h @@ -1,6 +1,6 @@ #pragma once -class Module; +template class Module; class ModuleManager { @@ -12,8 +12,9 @@ public: void Init(); void Close(); + void Alloc(); - static Module* GetModuleByName(const char* name); - static Module* GetModuleById(u16 id); + static Module* GetModuleByName(const char* name); + static Module* GetModuleById(u16 id); static bool CheckModuleId(u16 id); }; diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index 51c2959214..2e09e1a813 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -11,6 +11,7 @@ std::vector g_ppu_func_list; std::vector g_ppu_func_subs; +std::vector g_ps3_var_list; u32 add_ppu_func(ModuleFunc func) { @@ -25,21 +26,52 @@ u32 add_ppu_func(ModuleFunc func) if (f.id == func.id) { // if NIDs overlap or if the same function is added twice - throw EXCEPTION("NID already exists: 0x%08x (%s)", f.id, f.name); + throw EXCEPTION("FNID already exists: 0x%08x (%s)", f.id, f.name); } } - g_ppu_func_list.push_back(func); + g_ppu_func_list.emplace_back(std::move(func)); return (u32)g_ppu_func_list.size() - 1; } +void add_variable(u32 nid, Module<>* module, const char* name, u32(*addr)()) +{ + if (g_ps3_var_list.empty()) + { + g_ps3_var_list.reserve(0x4000); // as g_ppu_func_list + } + + for (auto& v : g_ps3_var_list) + { + if (v.id == nid) + { + throw EXCEPTION("VNID already exists: 0x%08x (%s)", nid, name); + } + } + + g_ps3_var_list.emplace_back(ModuleVariable{ nid, module, name, addr }); +} + +ModuleVariable* get_variable_by_nid(u32 nid) +{ + for (auto& v : g_ps3_var_list) + { + if (v.id == nid) + { + return &v; + } + } + + return nullptr; +} + u32 add_ppu_func_sub(StaticFunc func) { g_ppu_func_subs.emplace_back(func); return func.index; } -u32 add_ppu_func_sub(const std::initializer_list& ops, const char* name, Module* module, ppu_func_caller func) +u32 add_ppu_func_sub(const std::initializer_list& ops, const char* name, Module<>* module, ppu_func_caller func) { StaticFunc sf; sf.index = add_ppu_func(ModuleFunc(get_function_id(name), 0, module, name, func)); @@ -198,6 +230,7 @@ void clear_ppu_functions() { g_ppu_func_list.clear(); g_ppu_func_subs.clear(); + g_ps3_var_list.clear(); } u32 get_function_id(const char* name) @@ -497,18 +530,18 @@ bool patch_ppu_import(u32 addr, u32 index) return false; } -Module::Module(const char* name, void(*init)()) +Module<>::Module(const char* name, void(*init)()) : m_is_loaded(false) , m_name(name) , m_init(init) { } -Module::~Module() +Module<>::~Module() { } -void Module::Init() +void Module<>::Init() { on_load = nullptr; on_unload = nullptr; @@ -518,7 +551,7 @@ void Module::Init() m_init(); } -void Module::Load() +void Module<>::Load() { if (IsLoaded()) { @@ -533,7 +566,7 @@ void Module::Load() SetLoaded(true); } -void Module::Unload() +void Module<>::Unload() { if (!IsLoaded()) { @@ -548,22 +581,22 @@ void Module::Unload() SetLoaded(false); } -void Module::SetLoaded(bool loaded) +void Module<>::SetLoaded(bool loaded) { m_is_loaded = loaded; } -bool Module::IsLoaded() const +bool Module<>::IsLoaded() const { return m_is_loaded; } -const std::string& Module::GetName() const +const std::string& Module<>::GetName() const { return m_name; } -void Module::SetName(const std::string& name) +void Module<>::SetName(const std::string& name) { m_name = name; } diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index 4d1191dab7..8c71731e64 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -7,7 +7,7 @@ namespace vm { using namespace ps3; } -class Module; +template class Module; // flags set in ModuleFunc enum : u32 @@ -30,7 +30,7 @@ struct ModuleFunc { u32 id; u32 flags; - Module* module; + Module<>* module; const char* name; ppu_func_caller func; vm::ptr lle_func; @@ -39,7 +39,7 @@ struct ModuleFunc { } - ModuleFunc(u32 id, u32 flags, Module* module, const char* name, ppu_func_caller func, vm::ptr lle_func = vm::null) + ModuleFunc(u32 id, u32 flags, Module<>* module, const char* name, ppu_func_caller func, vm::ptr lle_func = vm::null) : id(id) , flags(flags) , module(module) @@ -50,6 +50,14 @@ struct ModuleFunc } }; +struct ModuleVariable +{ + u32 id; + Module<>* module; + const char* name; + u32(*retrieve_addr)(); +}; + enum : u32 { SPET_MASKED_OPCODE, @@ -76,15 +84,19 @@ struct StaticFunc std::unordered_map labels; }; -class Module : public LogBase +template<> class Module : public LogBase { + friend class ModuleManager; + std::string m_name; bool m_is_loaded; void(*m_init)(); - Module() = delete; +protected: + std::function on_alloc; public: + Module() = delete; Module(const char* name, void(*init)()); Module(Module& other) = delete; @@ -111,15 +123,42 @@ public: void SetName(const std::string& name); }; +// Module<> with an instance of specified type in PS3 memory +template class Module : public Module +{ + u32 m_addr; + +public: + Module(const char* name, void(*init)()) + : Module(name, init) + { + on_alloc = [this] + { + static_assert(std::is_trivially_destructible::value, "Module<> instance must be trivially destructible"); + //static_assert(std::is_trivially_copy_assignable::value, "Module<> instance must be trivially copy-assignable"); + + // Allocate module instance and call the default constructor + new(vm::get_ptr(m_addr = vm::alloc(sizeof(T), vm::main)))T{}; + }; + } + + T* operator ->() const + { + return vm::get_ptr(m_addr); + } +}; + u32 add_ppu_func(ModuleFunc func); +void add_variable(u32 nid, Module<>* module, const char* name, u32(*addr)()); ModuleFunc* get_ppu_func_by_nid(u32 nid, u32* out_index = nullptr); ModuleFunc* get_ppu_func_by_index(u32 index); +ModuleVariable* get_variable_by_nid(u32 nid); void execute_ppu_func_by_index(PPUThread& CPU, u32 id); void clear_ppu_functions(); u32 get_function_id(const char* name); u32 add_ppu_func_sub(StaticFunc sf); -u32 add_ppu_func_sub(const std::initializer_list& ops, const char* name, Module* module, ppu_func_caller func); +u32 add_ppu_func_sub(const std::initializer_list& ops, const char* name, Module<>* module, ppu_func_caller func); void hook_ppu_funcs(vm::ptr base, u32 size); @@ -147,13 +186,17 @@ template(ppu, __VA_ARGS__) #define REG_FNID(module, nid, func, ...) (ppu_func_by_func::index = add_ppu_func(ModuleFunc(nid, { __VA_ARGS__ }, &module, #func, BIND_FUNC(func)))) #define REG_FUNC(module, func, ...) REG_FNID(module, get_function_id(#func), func, __VA_ARGS__) +#define REG_VNID(module, nid, var) add_variable(nid, &module, #var, []{ return vm::get_addr(&module->var); }) + +#define REG_VARIABLE(module, var) REG_VNID(module, get_function_id(#var), var) + #define REG_SUB(module, ns, name, ...) add_ppu_func_sub({ __VA_ARGS__ }, #name, &module, BIND_FUNC(ns::name)) #define SP_OP(type, op, sup) []() { s32 XXX = 0; SearchPatternEntry res = { (type), (op), 0, (sup) }; XXX = -1; res.mask = (op) ^ ~res.data; return res; }() diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index eb771ac211..de33e70020 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -16,7 +16,7 @@ extern "C" #include "cellPamf.h" #include "cellAdec.h" -extern Module cellAdec; +extern Module<> cellAdec; AudioDecoder::AudioDecoder(s32 type, u32 addr, u32 size, vm::ptr func, u32 arg) : type(type) @@ -863,7 +863,7 @@ s32 cellAdecGetPcmItem(u32 handle, vm::pptr pcmItem) return CELL_OK; } -Module cellAdec("cellAdec", []() +Module<> cellAdec("cellAdec", []() { REG_FUNC(cellAdec, cellAdecQueryAttr); REG_FUNC(cellAdec, cellAdecOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp b/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp index 590ba0145b..9230874c66 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAtrac.cpp @@ -194,7 +194,7 @@ s32 cellAtracGetInternalErrorInfo(vm::ptr pHandle, vm::ptr return CELL_OK; } -Module cellAtrac("cellAtrac", []() +Module<> cellAtrac("cellAtrac", []() { REG_FUNC(cellAtrac, cellAtracSetDataAndGetMemSize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellAtrac.h b/rpcs3/Emu/SysCalls/Modules/cellAtrac.h index 53a5058d5d..391c838959 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAtrac.h +++ b/rpcs3/Emu/SysCalls/Modules/cellAtrac.h @@ -58,4 +58,4 @@ struct CellAtracExtRes u8 priority[8]; }; -extern Module cellAtrac; +extern Module<> cellAtrac; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.cpp b/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.cpp index cc3bc9a2e5..5eccf4839a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.cpp @@ -202,7 +202,7 @@ s32 cellAtracMultiGetInternalErrorInfo(vm::ptr pHandle, vm return CELL_OK; } -Module cellAtracMulti("cellAtrac", []() +Module<> cellAtracMulti("cellAtrac", []() { REG_FUNC(cellAtracMulti, cellAtracMultiSetDataAndGetMemSize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.h b/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.h index a3bf5a04d5..d2807ae34c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.h +++ b/rpcs3/Emu/SysCalls/Modules/cellAtracMulti.h @@ -59,4 +59,4 @@ struct CellAtracMultiExtRes u8 priority[8]; }; -extern Module cellAtracMulti; +extern Module<> cellAtracMulti; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp index b3becabf3e..2abd3091c5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp @@ -14,7 +14,7 @@ #include "cellAudio.h" -extern Module cellAudio; +extern Module<> cellAudio; extern u64 get_system_time(); @@ -1001,7 +1001,7 @@ s32 cellAudioUnsetPersonalDevice(s32 iPersonalStream) return CELL_OK; } -Module cellAudio("cellAudio", []() +Module<> cellAudio("cellAudio", []() { g_audio.state.store(AUDIO_STATE_NOT_INITIALIZED); g_audio.buffer = 0; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp index ea1b47e6a8..bc58d4d983 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAudioOut.cpp @@ -4,7 +4,7 @@ #include "cellAudioOut.h" -extern Module cellSysutil; +extern Module<> cellSysutil; s32 cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp b/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp index 3ae0c8b64c..b4ff9a2d66 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAvconfExt.cpp @@ -7,7 +7,7 @@ #include "cellAudioOut.h" #include "cellVideoOut.h" -extern Module cellAvconfExt; +extern Module<> cellAvconfExt; f32 g_gamma; @@ -137,7 +137,7 @@ s32 cellVideoOutGetScreenSize(u32 videoOut, vm::ptr screenSize) } -Module cellAvconfExt("cellAvconfExt", []() +Module<> cellAvconfExt("cellAvconfExt", []() { g_gamma = 1.0f; diff --git a/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp b/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp index ff7bf62f4f..b57d7befa1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellBgdl.cpp @@ -3,7 +3,7 @@ #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" -extern Module cellBGDL; +extern Module<> cellBGDL; // Return Codes enum @@ -40,7 +40,7 @@ s32 cellBGDLGetMode() return CELL_OK; } -Module cellBGDL("cellBGDL", []() +Module<> cellBGDL("cellBGDL", []() { REG_FUNC(cellBGDL, cellBGDLGetInfo); REG_FUNC(cellBGDL, cellBGDLGetInfo2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp index b7b3dd4cad..e745a4e990 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCamera.cpp @@ -7,7 +7,7 @@ #include "cellCamera.h" -extern Module cellCamera; +extern Module<> cellCamera; static const char* get_camera_attr_name(s32 value) { @@ -371,7 +371,7 @@ s32 cellCameraRemoveNotifyEventQueue2(u64 key) return CELL_OK; } -Module cellCamera("cellCamera", []() +Module<> cellCamera("cellCamera", []() { REG_FUNC(cellCamera, cellCameraInit); REG_FUNC(cellCamera, cellCameraEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp b/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp index 676eeaa3a7..b5e29f813a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCelp8Enc.cpp @@ -3,7 +3,7 @@ #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" -extern Module cellCelp8Enc; +extern Module<> cellCelp8Enc; // Return Codes enum @@ -70,7 +70,7 @@ s32 cellCelp8EncGetAu() return CELL_OK; } -Module cellCelp8Enc("cellCelp8Enc", []() +Module<> cellCelp8Enc("cellCelp8Enc", []() { REG_FUNC(cellCelp8Enc, cellCelp8EncQueryAttr); REG_FUNC(cellCelp8Enc, cellCelp8EncOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp index 60041821a8..2f2dd2c9ef 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellCelpEnc.cpp @@ -3,7 +3,7 @@ #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" -extern Module cellCelpEnc; +extern Module<> cellCelpEnc; // Return Codes enum @@ -70,7 +70,7 @@ s32 cellCelpEncGetAu() return CELL_OK; } -Module cellCelpEnc("cellCelpEnc", []() +Module<> cellCelpEnc("cellCelpEnc", []() { REG_FUNC(cellCelpEnc, cellCelpEncQueryAttr); REG_FUNC(cellCelpEnc, cellCelpEncOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellDaisy.cpp b/rpcs3/Emu/SysCalls/Modules/cellDaisy.cpp index 22cfb40b8f..8556089ea2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDaisy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDaisy.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellDaisy; +extern Module<> cellDaisy; s32 _ZN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE() { @@ -265,7 +265,7 @@ s32 _QN4cell5Daisy22ScatterGatherInterlock7releaseEv() } -Module cellDaisy("cellDaisy", []() +Module<> cellDaisy("cellDaisy", []() { REG_FUNC(cellDaisy, _ZN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE); REG_FUNC(cellDaisy, _ZN4cell5Daisy21LFQueue2GetPopPointerEPNS0_8LFQueue2EPij); diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp index 490b1b5e2a..c9f108c5d4 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp @@ -7,7 +7,7 @@ #include "cellPamf.h" #include "cellDmux.h" -extern Module cellDmux; +extern Module<> cellDmux; PesHeader::PesHeader(DemuxerStream& stream) : pts(CODEC_TS_INVALID) @@ -1178,7 +1178,7 @@ s32 cellDmuxFlushEs(u32 esHandle) return CELL_OK; } -Module cellDmux("cellDmux", []() +Module<> cellDmux("cellDmux", []() { REG_FUNC(cellDmux, cellDmuxQueryAttr); REG_FUNC(cellDmux, cellDmuxQueryAttr2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp b/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp index 10c603b756..345db211f3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFiber.cpp @@ -5,7 +5,7 @@ #include "cellFiber.h" -extern Module cellFiber; +extern Module<> cellFiber; s32 _cellFiberPpuInitialize() { @@ -291,7 +291,7 @@ s32 cellFiberPpuUtilWorkerControlInitializeWithAttribute() return CELL_OK; } -Module cellFiber("cellFiber", []() +Module<> cellFiber("cellFiber", []() { REG_FUNC(cellFiber, _cellFiberPpuInitialize, MFF_NO_RETURN); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp index 296d06b6ec..52f1f1feb8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp @@ -6,7 +6,7 @@ #include "Emu/FS/vfsFile.h" #include "cellFont.h" -extern Module cellFont; +extern Module<> cellFont; // Functions s32 cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr config) @@ -741,7 +741,7 @@ s32 cellFontGraphicsGetLineRGBA() } -Module cellFont("cellFont", []() +Module<> cellFont("cellFont", []() { REG_FUNC(cellFont, cellFontSetFontsetOpenMode); REG_FUNC(cellFont, cellFontSetFontOpenMode); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp b/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp index e5b5048999..74b64035e9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFontFT.cpp @@ -4,7 +4,7 @@ #include "cellFontFT.h" -extern Module cellFontFT; +extern Module<> cellFontFT; s32 cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, vm::ptr config, vm::pptr lib) { @@ -27,7 +27,7 @@ s32 cellFontFTGetInitializedRevisionFlags() return CELL_OK; } -Module cellFontFT("cellFontFT", []() +Module<> cellFontFT("cellFontFT", []() { REG_FUNC(cellFontFT, cellFontInitLibraryFreeTypeWithRevision); REG_FUNC(cellFontFT, cellFontFTGetRevisionFlags); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp index 3d9f4ee8f9..83d96244d0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp @@ -12,7 +12,7 @@ #include "Emu/SysCalls/lv2/sys_fs.h" #include "cellFs.h" -extern Module cellFs; +extern Module<> cellFs; s32 cellFsOpen(vm::cptr path, s32 flags, vm::ptr fd, vm::cptr arg, u64 size) { @@ -1051,7 +1051,7 @@ s32 cellFsUnregisterL10nCallbacks() } -Module cellFs("cellFs", []() +Module<> cellFs("cellFs", []() { g_fs_aio_id = 1; diff --git a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp index ca3e7e2308..83b1a38be6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGame.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGame.cpp @@ -11,7 +11,7 @@ #include "cellSysutil.h" #include "cellGame.h" -extern Module cellGame; +extern Module<> cellGame; // Specified as second content_permission_t constructor argument to inform temporary directory static struct temporary_content_dir_tag_t{} const temporary_content_dir_tag{}; @@ -706,7 +706,7 @@ s32 cellGameUnregisterDiscChangeCallback() void cellSysutil_GameData_init() { - extern Module cellSysutil; + extern Module<> cellSysutil; REG_FUNC(cellSysutil, cellHddGameCheck); REG_FUNC(cellSysutil, cellHddGameCheck2); @@ -728,7 +728,7 @@ void cellSysutil_GameData_init() REG_FUNC(cellSysutil, cellGameUnregisterDiscChangeCallback); } -Module cellGame("cellGame", []() +Module<> cellGame("cellGame", []() { REG_FUNC(cellGame, cellGameBootCheck); REG_FUNC(cellGame, cellGamePatchCheck); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp b/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp index 5b23200638..491d4e735d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp @@ -4,7 +4,7 @@ #include "cellGame.h" -extern Module cellGameExec; +extern Module<> cellGameExec; s32 cellGameSetExitParam() { @@ -45,7 +45,7 @@ s32 cellGameGetBootGameInfo(vm::ptr type, vm::ptr dirName, vm::ptr cellGameExec("cellGameExec", []() { REG_FUNC(cellGameExec, cellGameSetExitParam); REG_FUNC(cellGameExec, cellGameGetHomeDataExportPath); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 6fc5512ba5..a4823d0594 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -11,7 +11,7 @@ //#include "Emu/SysCalls/lv2/sys_process.h" #include "cellGcmSys.h" -extern Module cellGcmSys; +extern Module<> cellGcmSys; const u32 tiled_pitches[] = { 0x00000000, 0x00000200, 0x00000300, 0x00000400, @@ -1297,7 +1297,7 @@ s32 cellGcmCallback(vm::ptr context, u32 count) //---------------------------------------------------------------------------- -Module cellGcmSys("cellGcmSys", []() +Module<> cellGcmSys("cellGcmSys", []() { current_config.ioAddress = 0; current_config.localAddress = 0; diff --git a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp index b2a9061227..d2e44789ee 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGem.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGem.cpp @@ -5,7 +5,7 @@ #include "cellGem.h" -extern Module cellGem; +extern Module<> cellGem; struct gem_t { @@ -273,7 +273,7 @@ s32 cellGemWriteExternalPort() return CELL_OK; } -Module cellGem("cellGem", []() +Module<> cellGem("cellGem", []() { REG_FUNC(cellGem, cellGemCalibrate); REG_FUNC(cellGem, cellGemClearStatusFlags); diff --git a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp index 16789985a3..97aed89649 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp @@ -16,7 +16,7 @@ extern "C" #include "cellGifDec.h" -extern Module cellGifDec; +extern Module<> cellGifDec; // cellGifDec aliases (only for cellGifDec.cpp) using PPMainHandle = vm::pptr; @@ -303,7 +303,7 @@ s32 cellGifDecDestroy(PMainHandle mainHandle) return CELL_OK; } -Module cellGifDec("cellGifDec", []() +Module<> cellGifDec("cellGifDec", []() { REG_FUNC(cellGifDec, cellGifDecCreate); REG_FUNC(cellGifDec, cellGifDecExtCreate); diff --git a/rpcs3/Emu/SysCalls/Modules/cellHttp.cpp b/rpcs3/Emu/SysCalls/Modules/cellHttp.cpp index 4af23b0f4d..ee6a48fcbc 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellHttp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellHttp.cpp @@ -2,8 +2,8 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellHttp; -extern Module cellHttps; +extern Module<> cellHttp; +extern Module<> cellHttps; s32 cellHttpInit() { @@ -599,7 +599,7 @@ s32 cellHttpClientSetSslIdDestroyCallback() return CELL_OK; } -Module cellHttp("cellHttp", []() +Module<> cellHttp("cellHttp", []() { REG_FUNC(cellHttp, cellHttpInit); REG_FUNC(cellHttp, cellHttpEnd); @@ -713,7 +713,7 @@ Module cellHttp("cellHttp", []() REG_FUNC(cellHttp, cellHttpClientSetSslIdDestroyCallback); }); -Module cellHttps("cellHttps", []() +Module<> cellHttps("cellHttps", []() { // cellHttps doesn't have functions (cellHttpsInit belongs to cellHttp, for example) }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp b/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp index a61c787e78..4625593b15 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellHttpUtil.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellHttpUtil; +extern Module<> cellHttpUtil; s32 cellHttpUtilParseUri() { @@ -124,7 +124,7 @@ s32 cellHttpUtilBase64Decoder() return CELL_OK; } -Module cellHttpUtil("cellHttpUtil", []() +Module<> cellHttpUtil("cellHttpUtil", []() { REG_FUNC(cellHttpUtil, cellHttpUtilParseUri); REG_FUNC(cellHttpUtil, cellHttpUtilParseUriPath); diff --git a/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp b/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp index 21f1cebe4e..d1959b36c9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellImejp.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellImeJp; +extern Module<> cellImeJp; // Return Codes enum @@ -262,7 +262,7 @@ s32 cellImeJpConfirmPrediction() return CELL_OK; } -Module cellImeJp("cellImeJp", []() +Module<> cellImeJp("cellImeJp", []() { REG_FUNC(cellImeJp, cellImeJpOpen); REG_FUNC(cellImeJp, cellImeJpOpen2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp index 3e7a1e55fd..b7800f2f30 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp @@ -15,7 +15,7 @@ extern "C" #include "cellJpgDec.h" -extern Module cellJpgDec; +extern Module<> cellJpgDec; s32 cellJpgDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam) { @@ -359,7 +359,7 @@ s32 cellJpgDecExtSetParameter() } -Module cellJpgDec("cellJpgDec", []() +Module<> cellJpgDec("cellJpgDec", []() { REG_FUNC(cellJpgDec, cellJpgDecCreate); REG_FUNC(cellJpgDec, cellJpgDecExtCreate); diff --git a/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp index c4352982af..2b91af18b4 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellJpgEnc.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellJpgEnc; +extern Module<> cellJpgEnc; // Error Codes enum @@ -75,7 +75,7 @@ s32 cellJpgEncReset() return CELL_OK; } -Module cellJpgEnc("cellJpgEnc", []() +Module<> cellJpgEnc("cellJpgEnc", []() { REG_FUNC(cellJpgEnc, cellJpgEncQueryAttr); REG_FUNC(cellJpgEnc, cellJpgEncOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellKb.cpp b/rpcs3/Emu/SysCalls/Modules/cellKb.cpp index 99595c16b6..bd55bef6f6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellKb.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellKb.cpp @@ -6,7 +6,7 @@ #include "Emu/Io/Keyboard.h" #include "cellKb.h" -extern Module sys_io; +extern Module<> sys_io; s32 cellKbInit(u32 max_connect) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp b/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp index 9b7ab46554..72979257f6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellKey2char.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellKey2char; +extern Module<> cellKey2char; // Return Codes enum @@ -46,7 +46,7 @@ s32 cellKey2CharSetArrangement() return CELL_OK; } -Module cellKey2char("cellKey2char", []() +Module<> cellKey2char("cellKey2char", []() { REG_FUNC(cellKey2char, cellKey2CharOpen); REG_FUNC(cellKey2char, cellKey2CharClose); diff --git a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp index 12a38d26c2..fe3f69383a 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp @@ -10,7 +10,7 @@ #include "cellL10n.h" -extern Module cellL10n; +extern Module<> cellL10n; // Translate code id to code name. some codepage may has another name. // If this makes your compilation fail, try replace the string code with one in "iconv -l" @@ -1163,7 +1163,8 @@ s32 UTF8stoUCS2s() throw EXCEPTION(""); } -Module cellL10n("cellL10n", []() + +Module<> cellL10n("cellL10n", []() { REG_FUNC(cellL10n, UCS2toEUCJP); REG_FUNC(cellL10n, l10n_convert); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp index 83ff0fae6e..541db53ade 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMic.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMic.cpp @@ -5,7 +5,7 @@ #include "cellMic.h" -extern Module cellMic; +extern Module<> cellMic; s32 cellMicInit() { @@ -260,7 +260,7 @@ s32 cellMicGetDeviceIdentifier() return CELL_OK; } -Module cellMic("cellMic", []() +Module<> cellMic("cellMic", []() { REG_FUNC(cellMic, cellMicInit); REG_FUNC(cellMic, cellMicEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp b/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp index 6fa25276ab..ca06448886 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp @@ -6,7 +6,7 @@ #include "Emu/Io/Mouse.h" #include "cellMouse.h" -extern Module sys_io; +extern Module<> sys_io; s32 cellMouseInit(u32 max_connect) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp index 088c9147cb..1a120d1934 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMsgDialog.cpp @@ -7,7 +7,7 @@ #include "cellSysutil.h" #include "cellMsgDialog.h" -extern Module cellSysutil; +extern Module<> cellSysutil; extern u64 get_system_time(); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp index bd5993b56c..8ef53bc23d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusic.cpp @@ -7,7 +7,7 @@ #include "cellMusic.h" -extern Module cellMusic; +extern Module<> cellMusic; struct music2_t { @@ -149,7 +149,7 @@ s32 cellMusicGetVolume2() } -Module cellMusic("cellMusic", []() +Module<> cellMusic("cellMusic", []() { REG_FUNC(cellMusic, cellMusicGetSelectionContext); REG_FUNC(cellMusic, cellMusicSetSelectionContext2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp index f0fbb5dcd7..0d86d8c1d5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusicDecode.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellMusicDecode; +extern Module<> cellMusicDecode; // Return Codes enum @@ -145,7 +145,7 @@ s32 cellMusicDecodeGetContentsId2() } -Module cellMusicDecode("cellMusicDecode", []() +Module<> cellMusicDecode("cellMusicDecode", []() { REG_FUNC(cellMusicDecode, cellMusicDecodeInitialize); REG_FUNC(cellMusicDecode, cellMusicDecodeInitializeSystemWorkload); diff --git a/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp index 571a4a5e88..690188e000 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMusicExport.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellMusicExport; +extern Module<> cellMusicExport; // Return Codes enum @@ -51,7 +51,7 @@ s32 cellMusicExportProgress() return CELL_OK; } -Module cellMusicExport("cellMusicExport", []() +Module<> cellMusicExport("cellMusicExport", []() { REG_FUNC(cellMusicExport, cellMusicExportInitialize); REG_FUNC(cellMusicExport, cellMusicExportInitialize2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp index 37d75b17b9..0fc1313127 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellNetCtl.cpp @@ -28,7 +28,7 @@ #include #endif -extern Module cellNetCtl; +extern Module<> cellNetCtl; s32 cellNetCtlInit() { @@ -423,7 +423,7 @@ s32 cellGameUpdateCheckStartWithoutDialogAsyncEx() } -Module cellNetCtl("cellNetCtl", []() +Module<> cellNetCtl("cellNetCtl", []() { REG_FUNC(cellNetCtl, cellNetCtlInit); REG_FUNC(cellNetCtl, cellNetCtlTerm); diff --git a/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp b/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp index 1a0ead6313..6a83bd544e 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellOskDialog.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellOskDialog; +extern Module<> cellOskDialog; s32 cellOskDialogLoadAsync() { @@ -153,7 +153,7 @@ s32 cellOskDialogExtRegisterForceFinishCallback() void cellSysutil_OskDialog_init() { - extern Module cellSysutil; + extern Module<> cellSysutil; // cellOskDialog functions: REG_FUNC(cellSysutil, cellOskDialogLoadAsync); @@ -171,7 +171,7 @@ void cellSysutil_OskDialog_init() REG_FUNC(cellSysutil, cellOskDialogGetInputText); } -Module cellOskDialog("cellOskDialog", []() +Module<> cellOskDialog("cellOskDialog", []() { // cellOskDialogExt functions: REG_FUNC(cellOskDialog, cellOskDialogExtInputDeviceUnlock); diff --git a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp index 500c053db2..ca2814c1d8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellOvis.cpp @@ -4,7 +4,7 @@ namespace vm { using namespace ps3; } -extern Module cellOvis; +extern Module<> cellOvis; // Return Codes enum @@ -38,7 +38,7 @@ s32 cellOvisInvalidateOverlappedSegments() return CELL_OK; } -Module cellOvis("cellOvis", []() +Module<> cellOvis("cellOvis", []() { REG_FUNC(cellOvis, cellOvisGetOverlayTableSize); REG_FUNC(cellOvis, cellOvisInitializeOverlayTable); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPad.cpp b/rpcs3/Emu/SysCalls/Modules/cellPad.cpp index 263f6a988f..8d76b05def 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPad.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPad.cpp @@ -6,7 +6,7 @@ #include "Emu/Io/Pad.h" #include "cellPad.h" -extern Module sys_io; +extern Module<> sys_io; s32 cellPadInit(u32 max_connect) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp b/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp index b954f0ad0b..bfac839b10 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPamf.cpp @@ -5,7 +5,7 @@ #include "cellPamf.h" -extern Module cellPamf; +extern Module<> cellPamf; s32 pamfStreamTypeToEsFilterId(u8 type, u8 ch, CellCodecEsFilterId& pEsFilterId) { @@ -733,7 +733,7 @@ s32 cellPamfEpIteratorMove(vm::ptr pIt, s32 steps, vm::ptr cellPamf("cellPamf", []() { REG_FUNC(cellPamf, cellPamfGetHeaderSize); REG_FUNC(cellPamf, cellPamfGetHeaderSize2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp index f0eb743eb0..8ede8c8388 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoDecode.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellPhotoDecode; +extern Module<> cellPhotoDecode; // Return Codes enum @@ -56,7 +56,7 @@ s32 cellPhotoDecodeFromFile() return CELL_OK; } -Module cellPhotoDecode("cellPhotoDecode", []() +Module<> cellPhotoDecode("cellPhotoDecode", []() { REG_FUNC(cellPhotoDecode, cellPhotoDecodeInitialize); REG_FUNC(cellPhotoDecode, cellPhotoDecodeInitialize2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp index 998a24b51e..00b88fabc3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoExport.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellPhotoExport; +extern Module<> cellPhotoExport; // Return Codes enum @@ -75,7 +75,7 @@ s32 cellPhotoExportProgress() return CELL_OK; } -Module cellPhotoExport("cellPhotoExport", []() +Module<> cellPhotoExport("cellPhotoExport", []() { REG_FUNC(cellPhotoExport, cellPhotoInitialize); REG_FUNC(cellPhotoExport, cellPhotoFinalize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp b/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp index eaa9f3fe73..cb4bddb8fb 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPhotoImport.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellPhotoImportUtil; +extern Module<> cellPhotoImportUtil; // Return Codes enum @@ -53,7 +53,7 @@ s32 cellPhotoImport2() return CELL_OK; } -Module cellPhotoImportUtil("cellPhotoImport", []() +Module<> cellPhotoImportUtil("cellPhotoImport", []() { REG_FUNC(cellPhotoImportUtil, cellPhotoImport); REG_FUNC(cellPhotoImportUtil, cellPhotoImport2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp index dd059415e2..c3e54231bf 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp @@ -15,7 +15,7 @@ extern "C" #include "cellPngDec.h" -extern Module cellPngDec; +extern Module<> cellPngDec; // cellPngDec aliases (only for cellPngDec.cpp) using PPMainHandle = vm::pptr; @@ -571,7 +571,7 @@ s32 cellPngDecGetTextChunk(PMainHandle mainHandle, PSubHandle subHandle, vm::ptr return CELL_OK; } -Module cellPngDec("cellPngDec", []() +Module<> cellPngDec("cellPngDec", []() { REG_FUNC(cellPngDec, cellPngDecGetUnknownChunks); REG_FUNC(cellPngDec, cellPngDecClose); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp index d65ed8a933..5317ed0143 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngEnc.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellPngEnc; +extern Module<> cellPngEnc; // Error Codes enum @@ -69,7 +69,7 @@ s32 cellPngEncReset() return CELL_OK; } -Module cellPngEnc("cellPngEnc", []() +Module<> cellPngEnc("cellPngEnc", []() { REG_FUNC(cellPngEnc, cellPngEncQueryAttr); REG_FUNC(cellPngEnc, cellPngEncOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp b/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp index 707cf908a5..c64f0ea728 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPrint.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellPrint; +extern Module<> cellPrint; // Error Codes enum @@ -101,7 +101,7 @@ s32 cellPrintSendBand() return CELL_OK; } -Module cellPrint("cellPrint", []() +Module<> cellPrint("cellPrint", []() { REG_FUNC(cellPrint, cellSysutilPrintInit); REG_FUNC(cellPrint, cellSysutilPrintShutdown); diff --git a/rpcs3/Emu/SysCalls/Modules/cellRec.cpp b/rpcs3/Emu/SysCalls/Modules/cellRec.cpp index 8886c882fa..4a53e6f145 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRec.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellRec; +extern Module<> cellRec; s32 cellRecOpen() { @@ -40,7 +40,7 @@ s32 cellRecSetInfo() } -Module cellRec("cellRec", []() +Module<> cellRec("cellRec", []() { REG_FUNC(cellRec, cellRecOpen); REG_FUNC(cellRec, cellRecClose); diff --git a/rpcs3/Emu/SysCalls/Modules/cellRemotePlay.cpp b/rpcs3/Emu/SysCalls/Modules/cellRemotePlay.cpp index 024327e61d..ffc5abb825 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRemotePlay.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRemotePlay.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellRemotePlay; +extern Module<> cellRemotePlay; s32 cellRemotePlayGetStatus() { @@ -45,7 +45,7 @@ s32 cellRemotePlayBreak() } -Module cellRemotePlay("cellRemotePlay", []() +Module<> cellRemotePlay("cellRemotePlay", []() { REG_FUNC(cellRemotePlay, cellRemotePlayGetStatus); REG_FUNC(cellRemotePlay, cellRemotePlaySetComparativeVolume); diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index 682b8ef00f..6b898758fe 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -9,7 +9,7 @@ #include "Emu/RSX/GSRender.h" #include "cellResc.h" -extern Module cellResc; +extern Module<> cellResc; extern s32 cellVideoOutConfigure(u32 videoOut, vm::ptr config, vm::ptr option, u32 waitForEvent); extern s32 cellGcmSetFlipMode(u32 mode); @@ -564,7 +564,7 @@ void SetupSurfaces(vm::ptr& cntxt) r.m_surface_clip_y = 0; } -// Module Functions +// Module<> Functions s32 cellRescInit(vm::ptr initConfig) { cellResc.Warning("cellRescInit(initConfig=*0x%x)", initConfig); @@ -1247,7 +1247,7 @@ s32 cellRescCreateInterlaceTable(u32 ea_addr, float srcH, CellRescTableElement d } -Module cellResc("cellResc", []() +Module<> cellResc("cellResc", []() { s_rescInternalInstance = new CCellRescInternal(); diff --git a/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp b/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp index 278dc0a40a..c7345653c7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRtc.cpp @@ -5,7 +5,7 @@ #include "Utilities/rTime.h" #include "cellRtc.h" -extern Module cellRtc; +extern Module<> cellRtc; s64 convertToUNIXTime(u16 seconds, u16 minutes, u16 hours, u16 days, s32 years) { @@ -445,7 +445,7 @@ s32 cellRtcCompareTick(vm::ptr pTick0, vm::ptr pTick1) else return CELL_OK; } -Module cellRtc("cellRtc", []() +Module<> cellRtc("cellRtc", []() { REG_FUNC(cellRtc, cellRtcGetCurrentTick); REG_FUNC(cellRtc, cellRtcGetCurrentClock); diff --git a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp index f5c4301965..bf7db19e23 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellRudp.cpp @@ -6,7 +6,7 @@ #include "cellRudp.h" -extern Module cellRudp; +extern Module<> cellRudp; struct rudp_t { @@ -239,7 +239,7 @@ s32 cellRudpProcessEvents() return CELL_OK; } -Module cellRudp("cellRudp", []() +Module<> cellRudp("cellRudp", []() { REG_FUNC(cellRudp, cellRudpInit); REG_FUNC(cellRudp, cellRudpEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp index c532f8626c..96824026a8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp @@ -8,7 +8,7 @@ #include "cellSail.h" #include "cellPamf.h" -extern Module cellSail; +extern Module<> cellSail; void playerBoot(vm::ptr pSelf, u64 userParam) { @@ -1042,7 +1042,7 @@ s32 cellSailPlayerUnregisterSource() return CELL_OK; } -Module cellSail("cellSail", []() +Module<> cellSail("cellSail", []() { REG_FUNC(cellSail, cellSailMemAllocatorInitialize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp b/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp index 242e57079e..2777d8d0c9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSailRec.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSailRec; +extern Module<> cellSailRec; // Error Codes enum @@ -255,7 +255,7 @@ s32 cellSailRecorderDumpImage() return CELL_OK; } -Module cellSailRec("cellSailRec", []() +Module<> cellSailRec("cellSailRec", []() { REG_FUNC(cellSailRec, cellSailProfileSetEsAudioParameter); REG_FUNC(cellSailRec, cellSailProfileSetEsVideoParameter); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp index c43c6d55da..31245de1d9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.cpp @@ -10,7 +10,9 @@ #include "Loader/PSF.h" #include "cellSaveData.h" -extern Module cellSysutil; +extern Module<> cellSysutil; +extern Module<> cellSaveData; +extern Module<> cellMinisSaveData; std::unique_ptr g_savedata_dialog; @@ -958,7 +960,7 @@ void cellSysutil_SaveData_init() REG_FUNC(cellSysutil, cellSaveDataAutoSave); } -Module cellSaveData("cellSaveData", []() +Module<> cellSaveData("cellSaveData", []() { // libsysutil_savedata functions: REG_FUNC(cellSaveData, cellSaveDataUserGetListItem); @@ -975,7 +977,7 @@ Module cellSaveData("cellSaveData", []() REG_FUNC(cellSaveData, cellSaveDataListImport); }); -Module cellMinisSaveData("cellMinisSaveData", []() +Module<> cellMinisSaveData("cellMinisSaveData", []() { // libsysutil_savedata_psp functions: //REG_FUNC(cellMinisSaveData, cellMinisSaveDataDelete); // 0x6eb168b3 diff --git a/rpcs3/Emu/SysCalls/Modules/cellSaveData.h b/rpcs3/Emu/SysCalls/Modules/cellSaveData.h index 9101d75c0d..5db4323b06 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSaveData.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSaveData.h @@ -298,5 +298,3 @@ struct SaveDataDialogInstance virtual s32 ShowSaveDataList(std::vector& save_entries, s32 focused, vm::ptr listSet) = 0; }; - -extern class Module cellSaveData; diff --git a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp index 8087423951..95b8e15a40 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellScreenshot.cpp @@ -4,7 +4,7 @@ #include "Emu/SysCalls/Modules.h" #include "cellScreenshot.h" -extern Module cellScreenshot; +extern Module<> cellScreenshot; s32 cellScreenShotSetParameter() //const CellScreenShotSetParam *param { @@ -30,7 +30,7 @@ s32 cellScreenShotDisable() return CELL_OK; } -Module cellScreenshot("cellScreenshot", []() +Module<> cellScreenshot("cellScreenshot", []() { REG_FUNC(cellScreenshot, cellScreenShotSetParameter); REG_FUNC(cellScreenshot, cellScreenShotSetOverlayImage); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp index 62293ba559..291b470d9c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSearch.cpp @@ -4,7 +4,7 @@ #include "Emu/SysCalls/Modules.h" #include "cellSearch.h" -extern Module cellSearch; +extern Module<> cellSearch; s32 cellSearchInitialize(CellSearchMode mode, u32 container, vm::ptr func, vm::ptr userData) { @@ -130,7 +130,7 @@ s32 cellSearchEnd() return CELL_OK; } -Module cellSearch("cellSearch", []() +Module<> cellSearch("cellSearch", []() { REG_FUNC(cellSearch, cellSearchInitialize); REG_FUNC(cellSearch, cellSearchFinalize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp b/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp index 98599ba76d..b8bd086ac8 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSheap.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSheap; +extern Module<> cellSheap; // Return Codes enum @@ -121,7 +121,7 @@ s32 cellKeySheapQueueDelete() return CELL_OK; } -Module cellSheap("cellSheap", []() +Module<> cellSheap("cellSheap", []() { REG_FUNC(cellSheap, cellSheapInitialize); REG_FUNC(cellSheap, cellSheapAllocate); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpudll.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpudll.cpp index 3ac245ae77..026b5be393 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpudll.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpudll.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSpudll; +extern Module<> cellSpudll; s32 cellSpudllGetImageSize(vm::ptr psize, vm::cptr so_elf, vm::cptr config) { @@ -14,7 +14,7 @@ s32 cellSpudllHandleConfigSetDefaultValues(vm::ptr cellSpudll("cellSpudll", []() { REG_FUNC(cellSpudll, cellSpudllGetImageSize); REG_FUNC(cellSpudll, cellSpudllHandleConfigSetDefaultValues); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index 1c706c7756..b2a20633f2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -22,7 +22,7 @@ // Externs //---------------------------------------------------------------------------- -extern Module cellSpurs; +extern Module<> cellSpurs; //---------------------------------------------------------------------------- // Function prototypes @@ -4205,7 +4205,7 @@ s32 cellSpursSemaphoreGetTasksetAddress() return CELL_OK; } -Module cellSpurs("cellSpurs", []() +Module<> cellSpurs("cellSpurs", []() { // Core REG_FUNC(cellSpurs, cellSpursInitialize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpursJq.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpursJq.cpp index 195d42154b..1a943ebccc 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpursJq.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpursJq.cpp @@ -10,7 +10,7 @@ #include "cellSpurs.h" #include "cellSpursJq.h" -extern Module cellSpursJq; +extern Module<> cellSpursJq; s32 cellSpursJobQueueAttributeInitialize() { @@ -390,7 +390,7 @@ s32 cellSpursJobQueueUnsetExceptionEventHandler() return CELL_OK; } -Module cellSpursJq("cellSpursJq", []() +Module<> cellSpursJq("cellSpursJq", []() { REG_FUNC(cellSpursJq, cellSpursJobQueueAttributeInitialize); REG_FUNC(cellSpursJq, cellSpursJobQueueAttributeSetMaxGrab); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpursSpu.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpursSpu.cpp index b615987270..2d313cda24 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpursSpu.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpursSpu.cpp @@ -15,7 +15,7 @@ // Externs //---------------------------------------------------------------------------- -extern Module cellSpurs; +extern Module<> cellSpurs; //---------------------------------------------------------------------------- // Function prototypes diff --git a/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp b/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp index dc39b2fb7a..eaac5d7760 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSsl.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSsl; +extern Module<> cellSsl; s32 cellSslInit() { @@ -88,7 +88,7 @@ s32 cellSslCertGetMd5Fingerprint() return CELL_OK; } -Module cellSsl("cellSsl", []() +Module<> cellSsl("cellSsl", []() { REG_FUNC(cellSsl, cellSslInit); REG_FUNC(cellSsl, cellSslEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellStorage.cpp b/rpcs3/Emu/SysCalls/Modules/cellStorage.cpp index 90a49f9f81..07ce05e6a5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellStorage.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellStorage.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSysutil; +extern Module<> cellSysutil; s32 cellStorageDataImportMove() { diff --git a/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp b/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp index 569fca2bf7..a3ad66d2f7 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSubdisplay.cpp @@ -4,7 +4,7 @@ #include "cellSubdisplay.h" -extern Module cellSubdisplay; +extern Module<> cellSubdisplay; s32 cellSubDisplayInit() { @@ -74,7 +74,7 @@ s32 cellSubDisplayGetPeerList() return CELL_OK; } -Module cellSubdisplay("cellSubdisplay", []() +Module<> cellSubdisplay("cellSubdisplay", []() { REG_FUNC(cellSubdisplay, cellSubDisplayInit); REG_FUNC(cellSubdisplay, cellSubDisplayEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp index 8fc1d4cb71..3faae111ae 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync.cpp @@ -9,7 +9,7 @@ #include "Emu/Event.h" #include "cellSync.h" -extern Module cellSync; +extern Module<> cellSync; s32 cellSyncMutexInitialize(vm::ptr mutex) { @@ -1594,7 +1594,7 @@ s32 _cellSyncLFQueueDetachLv2EventQueue(vm::ptr spus, u32 num, vm::ptr cellSync("cellSync", []() { // setup error handler cellSync.on_error = [](s64 value, ModuleFunc* func) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp b/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp index c5ebc8911c..4f5f4efeeb 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSync2.cpp @@ -5,7 +5,17 @@ #include "cellSync2.h" -extern Module cellSync2; +struct Sync2Instance +{ + CellSync2CallerThreadType gCellSync2CallerThreadTypePpuThread; + CellSync2Notifier gCellSync2NotifierPpuThread; + CellSync2CallerThreadType gCellSync2CallerThreadTypePpuFiber; + CellSync2Notifier gCellSync2NotifierPpuFiber; + CellSync2Notifier gCellSync2NotifierSpursTask; + CellSync2Notifier gCellSync2NotifierSpursJobQueueJob; +}; + +extern Module cellSync2; s32 _cellSync2MutexAttributeInitialize(vm::ptr attr, u32 sdkVersion) { @@ -249,14 +259,14 @@ s32 cellSync2QueueGetDepth() return CELL_OK; } -Module cellSync2("cellSync2", []() +Module cellSync2("cellSync2", []() { - //REG_VARIABLE(cellSync2, gCellSync2CallerThreadTypePpuThread); - //REG_VARIABLE(cellSync2, gCellSync2NotifierPpuThread); - //REG_VARIABLE(cellSync2, gCellSync2CallerThreadTypePpuFiber); - //REG_VARIABLE(cellSync2, gCellSync2NotifierPpuFiber); - //REG_VARIABLE(cellSync2, gCellSync2NotifierSpursTask); - //REG_VARIABLE(cellSync2, gCellSync2NotifierSpursJobQueueJob); + REG_VARIABLE(cellSync2, gCellSync2CallerThreadTypePpuThread); + REG_VARIABLE(cellSync2, gCellSync2NotifierPpuThread); + REG_VARIABLE(cellSync2, gCellSync2CallerThreadTypePpuFiber); + REG_VARIABLE(cellSync2, gCellSync2NotifierPpuFiber); + REG_VARIABLE(cellSync2, gCellSync2NotifierSpursTask); + REG_VARIABLE(cellSync2, gCellSync2NotifierSpursJobQueueJob); REG_FUNC(cellSync2, _cellSync2MutexAttributeInitialize); REG_FUNC(cellSync2, cellSync2MutexEstimateBufferSize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSync2.h b/rpcs3/Emu/SysCalls/Modules/cellSync2.h index 50538dc570..01a430df45 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSync2.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSync2.h @@ -77,3 +77,21 @@ struct CellSync2QueueAttribute }; CHECK_SIZE(CellSync2QueueAttribute, 128); + +struct CellSync2CallerThreadType +{ + be_t threadTypeId; + vm::bptr self; + vm::bptr waitSignal; + vm::bptr, s32, u64, u64)> allocateSignalReceiver; + vm::bptr freeSignalReceiver; + be_t spinWaitNanoSec; + be_t callbackArg; +}; + +struct CellSync2Notifier +{ + be_t threadTypeId; + vm::bptr sendSignal; + be_t callbackArg; +}; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp index 7988c5312a..9a3a55f788 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysconf.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSysconf; +extern Module<> cellSysconf; s32 cellSysconfAbort() { @@ -21,13 +21,13 @@ s32 cellSysconfBtGetDeviceList() void cellSysutil_Sysconf_init() { - extern Module cellSysutil; + extern Module<> cellSysutil; REG_FUNC(cellSysutil, cellSysconfAbort); REG_FUNC(cellSysutil, cellSysconfOpen); } -Module cellSysconf("cellSysconf", []() +Module<> cellSysconf("cellSysconf", []() { REG_FUNC(cellSysconf, cellSysconfBtGetDeviceList); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp index db958914f9..cf7b86c5a9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysmodule.cpp @@ -4,7 +4,7 @@ #include "Emu/SysCalls/ModuleManager.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSysmodule; +extern Module<> cellSysmodule; enum { @@ -156,7 +156,7 @@ s32 cellSysmoduleLoadModule(u16 id) return CELL_SYSMODULE_ERROR_UNKNOWN; } - if (Module* m = Emu.GetModuleManager().GetModuleById(id)) + if (Module<>* m = Emu.GetModuleManager().GetModuleById(id)) { // CELL_SYSMODULE_ERROR_DUPLICATED shouldn't be returned m->Load(); @@ -174,7 +174,7 @@ s32 cellSysmoduleUnloadModule(u16 id) return CELL_SYSMODULE_ERROR_UNKNOWN; } - if (Module* m = Emu.GetModuleManager().GetModuleById(id)) + if (Module<>* m = Emu.GetModuleManager().GetModuleById(id)) { if (!m->IsLoaded()) { @@ -197,7 +197,7 @@ s32 cellSysmoduleIsLoaded(u16 id) return CELL_SYSMODULE_ERROR_UNKNOWN; } - if (Module* m = Emu.GetModuleManager().GetModuleById(id)) + if (Module<>* m = Emu.GetModuleManager().GetModuleById(id)) { if (!m->IsLoaded()) { @@ -209,7 +209,7 @@ s32 cellSysmoduleIsLoaded(u16 id) return CELL_SYSMODULE_LOADED; } -Module cellSysmodule("cellSysmodule", []() +Module<> cellSysmodule("cellSysmodule", []() { REG_FUNC(cellSysmodule, cellSysmoduleInitialize); REG_FUNC(cellSysmodule, cellSysmoduleFinalize); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index bfd41f5d7d..9003a933ec 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -9,7 +9,7 @@ #include "Emu/FS/VFS.h" #include "cellSysutil.h" -extern Module cellSysutil; +extern Module<> cellSysutil; std::unique_ptr g_sysutil; @@ -352,7 +352,7 @@ extern void cellSysutil_WebBrowser_init(); extern void cellSysutil_AudioOut_init(); extern void cellSysutil_VideoOut_init(); -Module cellSysutil("cellSysutil", []() +Module<> cellSysutil("cellSysutil", []() { g_sysutil = std::make_unique(); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutilAp.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutilAp.cpp index a5277ffb39..bf1db48272 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutilAp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutilAp.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSysutilAp; +extern Module<> cellSysutilAp; // Return Codes enum @@ -35,7 +35,7 @@ s32 cellSysutilApOff() return CELL_OK; } -Module cellSysutilAp("cellSysutilAp", []() +Module<> cellSysutilAp("cellSysutilAp", []() { REG_FUNC(cellSysutilAp, cellSysutilApGetRequiredMemSize); REG_FUNC(cellSysutilAp, cellSysutilApOn); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp index 7e25b01051..b6d132419b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSysutilAvc; +extern Module<> cellSysutilAvc; s32 cellSysutilAvcByeRequest() { @@ -218,7 +218,7 @@ s32 cellSysutilAvcExtGetWindowShowStatus() void cellSysutil_SysutilAvc_init() { - extern Module cellSysutil; + extern Module<> cellSysutil; REG_FUNC(cellSysutil, cellSysutilAvcByeRequest); REG_FUNC(cellSysutil, cellSysutilAvcCancelByeRequest); @@ -242,7 +242,7 @@ void cellSysutil_SysutilAvc_init() REG_FUNC(cellSysutil, cellSysutilAvcUnloadAsync); } -Module cellSysutilAvc("cellSysutilAvc", []() +Module<> cellSysutilAvc("cellSysutilAvc", []() { REG_FUNC(cellSysutilAvc, cellSysutilAvcExtInitOptionParam); REG_FUNC(cellSysutilAvc, cellSysutilAvcExtSetHideNamePlate); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc2.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc2.cpp index 57c3661b74..f1df9939e1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutilAvc2.cpp @@ -7,7 +7,7 @@ #include "sceNp2.h" #include "cellSysutilAvc2.h" -extern Module cellSysutilAvc2; +extern Module<> cellSysutilAvc2; s32 cellSysutilAvc2GetPlayerInfo() { @@ -334,7 +334,7 @@ s32 cellSysutilAvc2GetWindowPosition() } -Module cellSysutilAvc2("cellSysutilAvc2", []() +Module<> cellSysutilAvc2("cellSysutilAvc2", []() { REG_FUNC(cellSysutilAvc2, cellSysutilAvc2GetPlayerInfo); REG_FUNC(cellSysutilAvc2, cellSysutilAvc2JoinChat); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutilMisc.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutilMisc.cpp index 3800b104a0..fead88412d 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutilMisc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutilMisc.cpp @@ -3,7 +3,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellSysutilMisc; +extern Module<> cellSysutilMisc; // License areas enum @@ -33,7 +33,7 @@ s32 cellSysutilGetLicenseArea() } } -Module cellSysutilMisc("cellSysutilMisc", []() +Module<> cellSysutilMisc("cellSysutilMisc", []() { REG_FUNC(cellSysutilMisc, cellSysutilGetLicenseArea); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp index decd6f680f..11b2226ee6 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbd.cpp @@ -4,7 +4,7 @@ #include "Emu/SysCalls/Modules.h" #include "cellUsbd.h" -extern Module cellUsbd; +extern Module<> cellUsbd; s32 cellUsbdInit() { @@ -152,7 +152,7 @@ s32 cellUsbdFreeMemory() return CELL_OK; } -Module cellUsbd("cellUsbd", []() +Module<> cellUsbd("cellUsbd", []() { REG_FUNC(cellUsbd, cellUsbdInit); REG_FUNC(cellUsbd, cellUsbdEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp b/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp index c69e0cb85e..30a9fe71d1 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUsbpspcm.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellUsbPspcm; +extern Module<> cellUsbPspcm; // Return Codes enum @@ -183,7 +183,7 @@ s32 cellUsbPspcmCancelWaitData() return CELL_OK; } -Module cellUsbPspcm("cellUsbPspcm", []() +Module<> cellUsbPspcm("cellUsbPspcm", []() { REG_FUNC(cellUsbPspcm, cellUsbPspcmInit); REG_FUNC(cellUsbPspcm, cellUsbPspcmEnd); diff --git a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp index dce57c8774..4907dca4ab 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp @@ -7,7 +7,7 @@ #include "Emu/FS/vfsFileBase.h" #include "cellUserInfo.h" -extern Module cellUserInfo; +extern Module<> cellUserInfo; s32 cellUserInfoGetStat(u32 id, vm::ptr stat) { @@ -73,7 +73,7 @@ s32 cellUserInfoGetList(vm::ptr listNum, vm::ptr list return CELL_OK; } -Module cellUserInfo("cellUserInfo", []() +Module<> cellUserInfo("cellUserInfo", []() { REG_FUNC(cellUserInfo, cellUserInfoGetStat); REG_FUNC(cellUserInfo, cellUserInfoSelectUser_ListType); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index c9bf9ad670..fae09d4056 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -17,7 +17,7 @@ extern "C" #include "cellPamf.h" #include "cellVdec.h" -extern Module cellVdec; +extern Module<> cellVdec; VideoDecoder::VideoDecoder(s32 type, u32 profile, u32 addr, u32 size, vm::ptr func, u32 arg) : type(type) @@ -948,7 +948,7 @@ s32 cellVdecSetFrameRate(u32 handle, CellVdecFrameRate frc) return CELL_OK; } -Module cellVdec("cellVdec", []() +Module<> cellVdec("cellVdec", []() { //REG_VARIABLE(cellVdec, _cell_vdec_prx_ver); // 0x085a7ecb diff --git a/rpcs3/Emu/SysCalls/Modules/cellVideoExport.cpp b/rpcs3/Emu/SysCalls/Modules/cellVideoExport.cpp index b87d560c82..c70757f56f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVideoExport.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVideoExport.cpp @@ -2,7 +2,7 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellVideoExport; +extern Module<> cellVideoExport; s32 cellVideoExportProgress() { @@ -35,7 +35,7 @@ s32 cellVideoExportFinalize() } -Module cellVideoExport("cellVideoExport", []() +Module<> cellVideoExport("cellVideoExport", []() { REG_FUNC(cellVideoExport, cellVideoExportProgress); REG_FUNC(cellVideoExport, cellVideoExportInitialize2); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp index f1e7329f65..decb36196b 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp @@ -7,7 +7,7 @@ #include "Emu/RSX/GSManager.h" #include "cellVideoOut.h" -extern Module cellSysutil; +extern Module<> cellSysutil; s32 cellVideoOutGetState(u32 videoOut, u32 deviceIndex, vm::ptr state) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellVideoUpload.cpp b/rpcs3/Emu/SysCalls/Modules/cellVideoUpload.cpp index 3bf7b3ce30..a6d7c3862c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVideoUpload.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVideoUpload.cpp @@ -2,14 +2,14 @@ #include "Emu/Memory/Memory.h" #include "Emu/SysCalls/Modules.h" -extern Module cellVideoUpload; +extern Module<> cellVideoUpload; s32 cellVideoUploadInitialize() { throw EXCEPTION(""); } -Module cellVideoUpload("cellVideoUpload", []() +Module<> cellVideoUpload("cellVideoUpload", []() { REG_FUNC(cellVideoUpload, cellVideoUploadInitialize); }); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp index 0195052edd..5083aa6823 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVoice.cpp @@ -3,7 +3,7 @@ #include "Emu/System.h" #include "Emu/SysCalls/Modules.h" -extern Module cellVoice; +extern Module<> cellVoice; // Error Codes enum @@ -237,7 +237,7 @@ s32 cellVoiceDebugTopology() return CELL_OK; } -Module cellVoice("cellVoice", []() +Module<> cellVoice("cellVoice", []() { REG_FUNC(cellVoice, cellVoiceConnectIPortToOPort); REG_FUNC(cellVoice, cellVoiceCreateNotifyEventQueue); diff --git a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp index dfb1135275..9989b12ff5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVpost.cpp @@ -11,7 +11,7 @@ extern "C" #include "cellVpost.h" -extern Module cellVpost; +extern Module<> cellVpost; s32 cellVpostQueryAttr(vm::cptr cfgParam, vm::ptr attr) { @@ -137,7 +137,7 @@ s32 cellVpostExec(u32 handle, vm::cptr inPicBuff, vm::cptr cellVpost("cellVpost", []() { REG_FUNC(cellVpost, cellVpostQueryAttr); REG_FUNC(cellVpost, cellVpostOpen); diff --git a/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp b/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp index 1b429b7419..04cfebfa8c 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellWebBrowser.cpp @@ -4,7 +4,7 @@ #include "cellWebBrowser.h" -extern Module cellSysutil; +extern Module<> cellSysutil; s32 cellWebBrowserActivate() { diff --git a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp index 8748d2440c..f2e9f82a3a 100644 --- a/rpcs3/Emu/SysCalls/Modules/libmixer.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libmixer.cpp @@ -9,7 +9,7 @@ #include "cellAudio.h" #include "libmixer.h" -extern Module libmixer; +extern Module<> libmixer; SurMixerConfig g_surmx; @@ -614,7 +614,7 @@ float cellSurMixerUtilNoteToRatio(u8 refNote, u8 note) throw EXCEPTION(""); } -Module libmixer("libmixer", []() +Module<> libmixer("libmixer", []() { g_surmx.audio_port = ~0; diff --git a/rpcs3/Emu/SysCalls/Modules/libsnd3.cpp b/rpcs3/Emu/SysCalls/Modules/libsnd3.cpp index c3c23c74a6..74e5f84fbe 100644 --- a/rpcs3/Emu/SysCalls/Modules/libsnd3.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libsnd3.cpp @@ -290,7 +290,7 @@ s32 cellSnd3SMFGetKeyOnID(u32 smfID, u32 midiChannel, vm::ptr keyOnID) } -Module libsnd3("libsnd3", []() +Module<> libsnd3("libsnd3", []() { REG_SUB(libsnd3,, cellSnd3Init); REG_SUB(libsnd3,, cellSnd3Exit); diff --git a/rpcs3/Emu/SysCalls/Modules/libsnd3.h b/rpcs3/Emu/SysCalls/Modules/libsnd3.h index 80d8dc8c82..978d8b9a77 100644 --- a/rpcs3/Emu/SysCalls/Modules/libsnd3.h +++ b/rpcs3/Emu/SysCalls/Modules/libsnd3.h @@ -52,4 +52,4 @@ struct CellSnd3RequestQueueCtx be_t rearQueueSize; }; -extern Module libsnd3; +extern Module<> libsnd3; diff --git a/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp b/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp index 86b91edda6..4e3b651588 100644 --- a/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/libsynth2.cpp @@ -104,7 +104,7 @@ u16 cellSoundSynth2Pitch2Note(u16 center_note, u16 center_fine, u16 pitch) } -Module libsynth2("libsynth2", []() +Module<> libsynth2("libsynth2", []() { REG_SUB(libsynth2,, cellSoundSynth2Config); REG_SUB(libsynth2,, cellSoundSynth2Init); diff --git a/rpcs3/Emu/SysCalls/Modules/libsynth2.h b/rpcs3/Emu/SysCalls/Modules/libsynth2.h index 2ebdebda49..6b972ad7cf 100644 --- a/rpcs3/Emu/SysCalls/Modules/libsynth2.h +++ b/rpcs3/Emu/SysCalls/Modules/libsynth2.h @@ -18,4 +18,4 @@ struct CellSoundSynth2EffectAttr be_t feedback; }; -extern Module libsynth2; +extern Module<> libsynth2; diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp index c926c7c38f..5accb8e0d6 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp.cpp @@ -11,7 +11,7 @@ #include "Crypto/unedat.h" #include "sceNp.h" -extern Module sceNp; +extern Module<> sceNp; s32 sceNpInit(u32 poolsize, vm::ptr poolptr) { @@ -1521,7 +1521,7 @@ s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxm } -Module sceNp("sceNp", []() +Module<> sceNp("sceNp", []() { REG_FUNC(sceNp, sceNpInit); REG_FUNC(sceNp, sceNpTerm); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp b/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp index baffd4f9c4..197bde3c1b 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNp2.cpp @@ -5,7 +5,7 @@ #include "sceNp.h" #include "sceNp2.h" -extern Module sceNp2; +extern Module<> sceNp2; s32 sceNp2Init(u32 poolsize, vm::ptr poolptr) { @@ -384,7 +384,7 @@ s32 sceNpMatching2RegisterRoomMessageCallback() } -Module sceNp2("sceNp2", []() +Module<> sceNp2("sceNp2", []() { REG_FUNC(sceNp2, sceNpMatching2DestroyContext); REG_FUNC(sceNp2, sceNpMatching2LeaveLobby); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp index e046f3403e..09ee7a4b0d 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpClans.cpp @@ -6,7 +6,7 @@ #include "sceNp.h" #include "sceNpClans.h" -extern Module sceNpClans; +extern Module<> sceNpClans; s32 sceNpClansInit(vm::ptr commId, vm::ptr passphrase, vm::ptr pool, vm::ptr poolSize, u32 flags) { @@ -255,7 +255,7 @@ s32 sceNpClansRemoveChallenge() return CELL_OK; } -Module sceNpClans("sceNpClans", []() +Module<> sceNpClans("sceNpClans", []() { REG_FUNC(sceNpClans, sceNpClansInit); REG_FUNC(sceNpClans, sceNpClansTerm); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp index 06623bf0f4..0ae6ecf839 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpCommerce2.cpp @@ -4,7 +4,7 @@ #include "sceNpCommerce2.h" -extern Module sceNpCommerce2; +extern Module<> sceNpCommerce2; s32 sceNpCommerce2ExecuteStoreBrowse() { @@ -315,7 +315,7 @@ s32 sceNpCommerce2DoServiceListFinishAsync() throw EXCEPTION(""); } -Module sceNpCommerce2("sceNpCommerce2", []() +Module<> sceNpCommerce2("sceNpCommerce2", []() { REG_FUNC(sceNpCommerce2, sceNpCommerce2ExecuteStoreBrowse); REG_FUNC(sceNpCommerce2, sceNpCommerce2GetStoreBrowseUserdata); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp index ec50fc3a4e..5ebfbbc0b7 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpSns.cpp @@ -3,7 +3,7 @@ #include "sceNpSns.h" -extern Module sceNpSns; +extern Module<> sceNpSns; s32 sceNpSnsFbInit(vm::ptr params) { @@ -66,7 +66,7 @@ s32 sceNpSnsFbLoadThrottle() } -Module sceNpSns("sceNpSns", []() +Module<> sceNpSns("sceNpSns", []() { REG_FUNC(sceNpSns, sceNpSnsFbInit); REG_FUNC(sceNpSns, sceNpSnsFbTerm); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp index 489d5fa94d..976d578b2b 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp @@ -14,7 +14,7 @@ #include "sceNp.h" #include "sceNpTrophy.h" -extern Module sceNpTrophy; +extern Module<> sceNpTrophy; struct trophy_context_t { @@ -455,7 +455,7 @@ s32 sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::ptr sceNpTrophy("sceNpTrophy", []() { REG_FUNC(sceNpTrophy, sceNpTrophyGetGameProgress); REG_FUNC(sceNpTrophy, sceNpTrophyRegisterContext); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp index 10abfcbd4a..6bd4f62ac0 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTus.cpp @@ -5,7 +5,7 @@ #include "sceNp.h" #include "sceNpTus.h" -extern Module sceNpTus; +extern Module<> sceNpTus; s32 sceNpTusInit() { @@ -333,7 +333,7 @@ s32 sceNpTusDeleteMultiSlotDataVUserAsync() return CELL_OK; } -Module sceNpTus("sceNpTus", []() +Module<> sceNpTus("sceNpTus", []() { REG_FUNC(sceNpTus, sceNpTusInit); REG_FUNC(sceNpTus, sceNpTusTerm); diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp index fa8802bff2..a0ad31b011 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpUtil.cpp @@ -5,7 +5,7 @@ #include "sceNp.h" #include "sceNpUtil.h" -extern Module sceNpUtil; +extern Module<> sceNpUtil; s32 sceNpUtilBandwidthTestInitStart(u32 prio, size_t stack) { @@ -31,7 +31,7 @@ s32 sceNpUtilBandwidthTestAbort() return CELL_OK; } -Module sceNpUtil("sceNpUtil", []() +Module<> sceNpUtil("sceNpUtil", []() { REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestInitStart); REG_FUNC(sceNpUtil, sceNpUtilBandwidthTestShutdown); diff --git a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp index 94b59b2ce1..effa8325e7 100644 --- a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp @@ -8,7 +8,7 @@ #include "Emu/SysCalls/lv2/sys_process.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; extern u64 get_system_time(); @@ -167,7 +167,7 @@ extern void sysPrxForUser_sys_spu_init(); extern void sysPrxForUser_sys_game_init(); extern void sysPrxForUser_sys_libc_init(); -Module sysPrxForUser("sysPrxForUser", []() +Module<> sysPrxForUser("sysPrxForUser", []() { g_tls_start = 0; for (auto& v : g_tls_owners) diff --git a/rpcs3/Emu/SysCalls/Modules/sys_game.cpp b/rpcs3/Emu/SysCalls/Modules/sys_game.cpp index aed67378f2..e165e8e135 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_game.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_game.cpp @@ -6,7 +6,7 @@ #include "Emu/FS/VFS.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; void sys_game_process_exitspawn(vm::cptr path, u32 argv_addr, u32 envp_addr, u32 data_addr, u32 data_size, u32 prio, u64 flags) { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_heap.cpp b/rpcs3/Emu/SysCalls/Modules/sys_heap.cpp index a9b6ddbbf9..b3e0aafd3a 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_heap.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_heap.cpp @@ -6,7 +6,7 @@ #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; struct HeapInfo { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_io.cpp b/rpcs3/Emu/SysCalls/Modules/sys_io.cpp index dd7f0afd00..eb7888f151 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_io.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_io.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/SysCalls/Modules.h" -extern Module sys_io; +extern Module<> sys_io; extern void cellPad_init(); extern void cellKb_init(); @@ -39,7 +39,7 @@ s32 sys_config_unregister_service() } -Module sys_io("sys_io", []() +Module<> sys_io("sys_io", []() { cellPad_init(); cellKb_init(); diff --git a/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp b/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp index 6264fc697f..7911927c62 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_libc.cpp @@ -5,7 +5,7 @@ #include "Emu/SysCalls/Modules.h" #include "Emu/Cell/PPUInstrTable.h" -extern Module sys_libc; +extern Module<> sys_libc; std::string ps3_fmt(PPUThread& context, vm::cptr fmt, u32 g_count, u32 f_count, u32 v_count) { @@ -160,7 +160,7 @@ namespace sys_libc_func } } -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; vm::ptr _sys_memset(vm::ptr dst, s32 value, u32 size) { @@ -413,7 +413,7 @@ void sysPrxForUser_sys_libc_init() REG_FUNC(sysPrxForUser, _sys_qsort); } -Module sys_libc("sys_libc", []() +Module<> sys_libc("sys_libc", []() { using namespace PPU_instr; diff --git a/rpcs3/Emu/SysCalls/Modules/sys_lv2dbg.cpp b/rpcs3/Emu/SysCalls/Modules/sys_lv2dbg.cpp index 708d4e913f..c2c0fbf4bf 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_lv2dbg.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_lv2dbg.cpp @@ -6,7 +6,7 @@ #include "sys_lv2dbg.h" -extern Module sys_lv2dbg; +extern Module<> sys_lv2dbg; s32 sys_dbg_read_ppu_thread_context(u64 id, vm::ptr ppu_context) { @@ -190,7 +190,7 @@ s32 sys_dbg_set_mask_to_ppu_exception_handler(u64 mask, u64 flags) throw EXCEPTION(""); } -Module sys_lv2dbg("sys_lv2dbg", [] +Module<> sys_lv2dbg("sys_lv2dbg", [] { REG_FUNC(sys_lv2dbg, sys_dbg_read_ppu_thread_context); REG_FUNC(sys_lv2dbg, sys_dbg_read_spu_thread_context); diff --git a/rpcs3/Emu/SysCalls/Modules/sys_lwcond_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_lwcond_.cpp index 3bf05a08a1..79c30c6ed2 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_lwcond_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_lwcond_.cpp @@ -9,7 +9,7 @@ #include "Emu/SysCalls/lv2/sys_lwcond.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; s32 sys_lwcond_create(vm::ptr lwcond, vm::ptr lwmutex, vm::ptr attr) { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp index a9d9acf416..85ba7abeb0 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_lwmutex_.cpp @@ -8,7 +8,7 @@ #include "Emu/SysCalls/lv2/sys_lwmutex.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; s32 sys_lwmutex_create(vm::ptr lwmutex, vm::ptr attr) { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_mempool.cpp b/rpcs3/Emu/SysCalls/Modules/sys_mempool.cpp index cb5c512a60..143df2f46b 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_mempool.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_mempool.cpp @@ -6,7 +6,7 @@ #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; using sys_mempool_t = u32; diff --git a/rpcs3/Emu/SysCalls/Modules/sys_mmapper_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_mmapper_.cpp index 89c2fce1fe..5a2c59c300 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_mmapper_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_mmapper_.cpp @@ -6,7 +6,7 @@ #include "Emu/SysCalls/lv2/sys_mmapper.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; void sysPrxForUser_sys_mmapper_init() { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp index 0be717ad6d..32dd47d4c2 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp @@ -15,7 +15,7 @@ #include #endif -extern Module libnet; +extern Module<> libnet; // We map host sockets to sequential IDs to return as FDs because syscalls using // socketselect(), etc. expect socket FDs to be under 1024. @@ -616,7 +616,7 @@ namespace sys_net // define additional macro for specific namespace #define REG_FUNC_(name) add_ppu_func(ModuleFunc(get_function_id(#name), 0, &libnet, #name, BIND_FUNC(sys_net::name))) -Module libnet("sys_net", []() +Module<> libnet("sys_net", []() { REG_FUNC_(accept); REG_FUNC_(bind); diff --git a/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp index 46cc660b7b..2ac8abdac7 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_ppu_thread_.cpp @@ -6,7 +6,7 @@ #include "Emu/SysCalls/lv2/sys_ppu_thread.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; s32 sys_ppu_thread_create(PPUThread& ppu, vm::ptr thread_id, u32 entry, u64 arg, s32 prio, u32 stacksize, u64 flags, vm::cptr threadname) { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_prx_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_prx_.cpp index 0682649026..28b0ea046e 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_prx_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_prx_.cpp @@ -6,7 +6,7 @@ #include "Emu/SysCalls/lv2/sys_prx.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; s64 sys_prx_exitspawn_with_level() { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp b/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp index f1c7b85166..cc80543c9b 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_spinlock.cpp @@ -5,7 +5,7 @@ #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; void sys_spinlock_initialize(vm::ptr> lock) { diff --git a/rpcs3/Emu/SysCalls/Modules/sys_spu_.cpp b/rpcs3/Emu/SysCalls/Modules/sys_spu_.cpp index 2521f38b3f..fb6edbac4c 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_spu_.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_spu_.cpp @@ -9,7 +9,7 @@ #include "Crypto/unself.h" #include "sysPrxForUser.h" -extern Module sysPrxForUser; +extern Module<> sysPrxForUser; extern u64 get_system_time(); diff --git a/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp b/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp index 085e9816cb..72b8157e8b 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp @@ -53,7 +53,7 @@ s32 prx_load_module(std::string path, u64 flags, vm::ptr* module = Emu.GetModuleManager().GetModuleByName(module_.first.c_str()); if (!module) { diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index a4e67748e5..544a227eba 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -129,8 +129,6 @@ void Emulator::Load() { m_status = Ready; - GetModuleManager().Init(); - if (!fs::is_file(m_path)) { m_status = Stopped; diff --git a/rpcs3/Loader/ELF64.cpp b/rpcs3/Loader/ELF64.cpp index dce872cdd7..5d4661e961 100644 --- a/rpcs3/Loader/ELF64.cpp +++ b/rpcs3/Loader/ELF64.cpp @@ -309,6 +309,7 @@ namespace loader //store elf to memory vm::ps3::init(); + Emu.GetModuleManager().Init(); error_code res = alloc_memory(0); if (res != ok) @@ -418,7 +419,7 @@ namespace loader continue; } - Module* module = Emu.GetModuleManager().GetModuleByName(m.first.c_str()); + Module<>* module = Emu.GetModuleManager().GetModuleByName(m.first.c_str()); if (!module) { @@ -506,6 +507,8 @@ namespace loader ppu_thr_stop_data[1] = BLR(); Emu.SetCPUThreadStop(ppu_thr_stop_data.addr()); + Emu.GetModuleManager().Alloc(); + static const int branch_size = 8 * 4; auto make_branch = [](vm::ptr& ptr, u32 addr) @@ -687,7 +690,7 @@ namespace loader { const std::string module_name = stub->s_modulename.get_ptr(); - Module* module = Emu.GetModuleManager().GetModuleByName(module_name.c_str()); + Module<>* module = Emu.GetModuleManager().GetModuleByName(module_name.c_str()); if (!module) {