diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index a32604e928..5029e22ade 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -67,6 +67,7 @@ #include "GPU/GPU.h" #include "GPU/GPUInterface.h" #include "GPU/GPUState.h" +#include "UI/GameScreen.h" enum { PSP_THREAD_ATTR_KERNEL = 0x00001000, @@ -1144,6 +1145,9 @@ static int gzipDecompress(u8 *OutBuffer, int OutBufferLength, u8 *InBuffer) { } static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 loadAddress, bool fromTop, std::string *error_string, u32 *magic, u32 &error) { + u32 crc = crc32(0, Z_NULL, 0); + crc = crc32(crc, ptr, elfSize); + const std::string crcstring = int2hexstr(crc); PSPModule *module = new PSPModule(); kernelObjects.Create(module); loadedModules.insert(module->GetUID()); @@ -1170,7 +1174,7 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load if (IsHLEVersionedModule(head->modname)) { int ver = (head->module_ver_hi << 8) | head->module_ver_lo; - INFO_LOG(SCEMODULE, "Loading module %s with version %04x, devkit %08x", head->modname, ver, head->devkitversion); + INFO_LOG(SCEMODULE, "Loading module %s with version %04x, devkit %08x, crc %s", head->modname, ver, head->devkitversion, crcstring.c_str()); reportedModule = true; if (!strcmp(head->modname, "sceMpeg_library")) { diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index edf519f46b..114b6e7a35 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -44,6 +44,7 @@ #include "UI/MainScreen.h" #include "UI/BackgroundAudio.h" #include "Core/Reporting.h" +#include GameScreen::GameScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) { g_BackgroundAudio.SetGame(gamePath); @@ -55,12 +56,10 @@ GameScreen::~GameScreen() { } } -template std::string int2hexstr(I w, size_t hex_len = sizeof(I) << 1) { - static const char* digits = "0123456789ABCDEF"; - std::string rc(hex_len, '0'); - for (size_t i = 0, j = (hex_len - 1) * 4; i < hex_len; ++i, j -= 4) - rc[i] = digits[(w >> j) & 0x0f]; - return rc; +std::string int2hexstr(const int a) { + std::stringstream stream; + stream << std::hex << a; + return stream.str(); } void GameScreen::update() { diff --git a/UI/GameScreen.h b/UI/GameScreen.h index cff0c48366..1018acbf10 100644 --- a/UI/GameScreen.h +++ b/UI/GameScreen.h @@ -29,6 +29,8 @@ // Uses GameInfoCache heavily to implement the functionality. // Should possibly merge this with the PauseScreen. +std::string int2hexstr(const int a); + class GameScreen : public UIDialogScreenWithGameBackground { public: GameScreen(const Path &gamePath);