diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 1596ebe618..9b20f85817 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -1011,12 +1011,12 @@ const HLEFunction UtilsForKernel[] = { {0X6C6887EE, nullptr, "UtilsForKernel_6C6887EE", '?', "" }, {0X91E4F6A7, nullptr, "sceKernelLibcClock", '?', "" }, {0X27CC57F0, nullptr, "sceKernelLibcTime", '?', "" }, - {0X79D1C3FA, nullptr, "sceKernelDcacheWritebackAll", '?', "" }, - {0X3EE30821, nullptr, "sceKernelDcacheWritebackRange", '?', "" }, - {0X34B9FA9E, nullptr, "sceKernelDcacheWritebackInvalidateRange", '?', "" }, - {0XB435DEC5, nullptr, "sceKernelDcacheWritebackInvalidateAll", '?', "" }, - {0XBFA98062, nullptr, "sceKernelDcacheInvalidateRange", '?', "" }, - {0X920F104A, nullptr, "sceKernelIcacheInvalidateAll", '?', "" }, + {0X79D1C3FA, &WrapI_V, "sceKernelDcacheWritebackAll", '?', "" }, + {0X3EE30821, &WrapI_UI, "sceKernelDcacheWritebackRange", '?', "" }, + {0X34B9FA9E, &WrapI_UI, "sceKernelDcacheWritebackInvalidateRange", '?', "" }, + {0XB435DEC5, &WrapI_V, "sceKernelDcacheWritebackInvalidateAll", '?', "" }, + {0XBFA98062, &WrapI_UI, "sceKernelDcacheInvalidateRange", '?', "" }, + {0X920F104A, &WrapU_V, "sceKernelIcacheInvalidateAll", '?', "" }, {0XE860E75E, nullptr, "sceKernelUtilsMt19937Init", '?', "" }, {0X06FB8A63, nullptr, "sceKernelUtilsMt19937UInt", '?', "" }, }; diff --git a/Core/HLE/sceMp3.cpp b/Core/HLE/sceMp3.cpp index 5614ce2d1e..aee379647d 100644 --- a/Core/HLE/sceMp3.cpp +++ b/Core/HLE/sceMp3.cpp @@ -138,14 +138,14 @@ public: }; }; -std::map mp3Map; +std::map g_mp3Map; static const int mp3DecodeDelay = 2400; static bool resourceInited = false; static AuCtx *getMp3Ctx(u32 mp3) { - if (mp3Map.find(mp3) == mp3Map.end()) + if (g_mp3Map.find(mp3) == g_mp3Map.end()) return NULL; - return mp3Map[mp3]; + return g_mp3Map[mp3]; } void __Mp3Init() { @@ -153,10 +153,10 @@ void __Mp3Init() { } void __Mp3Shutdown() { - for (auto it = mp3Map.begin(), end = mp3Map.end(); it != end; ++it) { + for (auto it = g_mp3Map.begin(), end = g_mp3Map.end(); it != end; ++it) { delete it->second; } - mp3Map.clear(); + g_mp3Map.clear(); } void __Mp3DoState(PointerWrap &p) { @@ -165,7 +165,7 @@ void __Mp3DoState(PointerWrap &p) { return; if (s >= 2) { - Do(p, mp3Map); + Do(p, g_mp3Map); } else { std::map mp3Map_old; Do(p, mp3Map_old); // read old map @@ -190,7 +190,7 @@ void __Mp3DoState(PointerWrap &p) { mp3->SetReadPos(mp3_old->readPosition); mp3->decoder = CreateAudioDecoder(PSP_CODEC_MP3); - mp3Map[id] = mp3; + g_mp3Map[id] = mp3; } } @@ -253,7 +253,7 @@ static u32 sceMp3ReserveMp3Handle(u32 mp3Addr) { if (!resourceInited) { return hleLogError(Log::ME, SCE_MP3_ERROR_NO_RESOURCE_AVAIL, "sceMp3InitResource must be called first"); } - if (mp3Map.size() >= MP3_MAX_HANDLES) { + if (g_mp3Map.size() >= MP3_MAX_HANDLES) { return hleLogError(Log::ME, SCE_MP3_ERROR_NO_RESOURCE_AVAIL, "no free handles"); } if (mp3Addr != 0 && !Memory::IsValidRange(mp3Addr, 32)) { @@ -297,8 +297,8 @@ static u32 sceMp3ReserveMp3Handle(u32 mp3Addr) { Au->SetReadPos(Au->startPos); Au->decoder = CreateAudioDecoder(PSP_CODEC_MP3); - int handle = (int)mp3Map.size(); - mp3Map[handle] = Au; + int handle = (int)g_mp3Map.size(); + g_mp3Map[handle] = Au; return hleLogDebug(Log::ME, handle); } @@ -318,10 +318,10 @@ static int sceMp3TermResource() { } // Free any handles that are still open. - for (auto au : mp3Map) { + for (auto au : g_mp3Map) { delete au.second; } - mp3Map.clear(); + g_mp3Map.clear(); resourceInited = false; return hleDelayResult(hleLogDebug(Log::ME, 0), "mp3 resource term", 100); @@ -625,7 +625,7 @@ static int sceMp3ReleaseMp3Handle(u32 mp3) { AuCtx *ctx = getMp3Ctx(mp3); if (ctx) { delete ctx; - mp3Map.erase(mp3); + g_mp3Map.erase(mp3); return hleLogDebug(Log::ME, 0); } else if (mp3 >= MP3_MAX_HANDLES) { return hleLogError(Log::ME, SCE_MP3_ERROR_INVALID_HANDLE, "invalid handle"); @@ -699,11 +699,11 @@ static u32 sceMp3LowLevelInit(u32 mp3, u32 unk) { ctx->decoder = CreateAudioDecoder(PSP_CODEC_MP3); // close the audio if mp3 already exists. - if (mp3Map.find(mp3) != mp3Map.end()) { - delete mp3Map[mp3]; - mp3Map.erase(mp3); + if (g_mp3Map.find(mp3) != g_mp3Map.end()) { + delete g_mp3Map[mp3]; + g_mp3Map.erase(mp3); } - mp3Map[mp3] = ctx; + g_mp3Map[mp3] = ctx; // Indicate that we've run low level init by setting version to 1. ctx->Version = 1; diff --git a/Core/HLE/sceMp3.h b/Core/HLE/sceMp3.h index 5127b57187..5c0bd975d3 100644 --- a/Core/HLE/sceMp3.h +++ b/Core/HLE/sceMp3.h @@ -29,4 +29,4 @@ void __Mp3Init(); void __Mp3Shutdown(); void __Mp3DoState(PointerWrap &p); -extern std::map mp3Map; +extern std::map g_mp3Map; diff --git a/UI/ImDebugger/ImDebugger.cpp b/UI/ImDebugger/ImDebugger.cpp index 1716a3dfa7..980e56ba5c 100644 --- a/UI/ImDebugger/ImDebugger.cpp +++ b/UI/ImDebugger/ImDebugger.cpp @@ -1232,13 +1232,13 @@ void DrawMediaDecodersView(ImConfig &cfg, ImControl &control) { } } - if (ImGui::CollapsingHeaderWithCount("sceMp3", (int)mp3Map.size(), ImGuiTreeNodeFlags_DefaultOpen)) { + if (ImGui::CollapsingHeaderWithCount("sceMp3", (int)g_mp3Map.size(), ImGuiTreeNodeFlags_DefaultOpen)) { if (ImGui::BeginTable("mp3", 3, ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersH)) { ImGui::TableSetupColumn("Handle", ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("Channels", ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("ReadPos", ImGuiTableColumnFlags_WidthFixed); - for (auto &iter : mp3Map) { + for (auto &iter : g_mp3Map) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::PushID(iter.first); @@ -1260,8 +1260,8 @@ void DrawMediaDecodersView(ImConfig &cfg, ImControl &control) { ImGui::EndTable(); } - auto iter = mp3Map.find(cfg.selectedMp3Ctx); - if (iter != mp3Map.end() && ImGui::CollapsingHeader("MP3 %d", iter->first)) { + auto iter = g_mp3Map.find(cfg.selectedMp3Ctx); + if (iter != g_mp3Map.end() && ImGui::CollapsingHeader("MP3 %d", iter->first)) { ImGui::Text("MP3 Context %d", iter->first); if (iter->second) { AuCtx *ctx = iter->second; @@ -1301,8 +1301,8 @@ void DrawMediaDecodersView(ImConfig &cfg, ImControl &control) { ImGui::EndTable(); } - auto iter = mp3Map.find(cfg.selectedAacCtx); - if (iter != mp3Map.end() && ImGui::CollapsingHeader("AAC %d", iter->first)) { + auto iter = g_mp3Map.find(cfg.selectedAacCtx); + if (iter != g_mp3Map.end() && ImGui::CollapsingHeader("AAC %d", iter->first)) { ImGui::Text("AAC Context %d", iter->first); if (iter->second) { AuCtx *ctx = iter->second;