Store crc change to u32
Should build fixed
This commit is contained in:
parent
09e9488de8
commit
de6d747cf0
7 changed files with 25 additions and 28 deletions
|
@ -1147,7 +1147,6 @@ 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());
|
||||
|
@ -1174,14 +1173,14 @@ 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, crc %s", head->modname, ver, head->devkitversion, crcstring.c_str());
|
||||
INFO_LOG(SCEMODULE, "Loading module %s with version %04x, devkit %08x, crc %x", head->modname, ver, head->devkitversion, crc);
|
||||
reportedModule = true;
|
||||
|
||||
if (!strcmp(head->modname, "sceMpeg_library")) {
|
||||
__MpegLoadModule(ver, crcstring);
|
||||
__MpegLoadModule(ver, crc);
|
||||
}
|
||||
if (!strcmp(head->modname, "scePsmfP_library") || !strcmp(head->modname, "scePsmfPlayer")) {
|
||||
__PsmfPlayerLoadModule(head->devkitversion, crcstring);
|
||||
__PsmfPlayerLoadModule(head->devkitversion, crc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1614,10 +1613,10 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
|
|||
INFO_LOG(SCEMODULE, "Loading module %s with version %04x, devkit %08x", modinfo->name, modinfo->moduleVersion, devkitVersion);
|
||||
|
||||
if (!strcmp(modinfo->name, "sceMpeg_library")) {
|
||||
__MpegLoadModule(modinfo->moduleVersion, crcstring);
|
||||
__MpegLoadModule(modinfo->moduleVersion, crc);
|
||||
}
|
||||
if (!strcmp(modinfo->name, "scePsmfP_library") || !strcmp(modinfo->name, "scePsmfPlayer")) {
|
||||
__PsmfPlayerLoadModule(devkitVersion, crcstring);
|
||||
__PsmfPlayerLoadModule(devkitVersion, crc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ struct MpegContext {
|
|||
|
||||
static bool isMpegInit;
|
||||
static int mpegLibVersion = 0;
|
||||
static std::string mpegLibCrcstring = "null";
|
||||
static u32 mpegLibCrc = 0;
|
||||
static u32 streamIdGen;
|
||||
static int actionPostPut;
|
||||
static std::map<u32, MpegContext *> mpegMap;
|
||||
|
@ -424,10 +424,10 @@ void __MpegDoState(PointerWrap &p) {
|
|||
Do(p, ringbufferPutPacketsAdded);
|
||||
}
|
||||
if (s < 4) {
|
||||
mpegLibCrcstring = "null";
|
||||
mpegLibCrc = 0;
|
||||
}
|
||||
else {
|
||||
Do(p, mpegLibCrcstring);
|
||||
Do(p, mpegLibCrc);
|
||||
}
|
||||
|
||||
Do(p, streamIdGen);
|
||||
|
@ -448,9 +448,9 @@ void __MpegShutdown() {
|
|||
mpegMap.clear();
|
||||
}
|
||||
|
||||
void __MpegLoadModule(int version,std::string crcstr) {
|
||||
void __MpegLoadModule(int version,u32 crc) {
|
||||
mpegLibVersion = version;
|
||||
mpegLibCrcstring = crcstr;
|
||||
mpegLibCrc = crc;
|
||||
}
|
||||
|
||||
static u32 sceMpegInit() {
|
||||
|
@ -459,7 +459,7 @@ static u32 sceMpegInit() {
|
|||
// TODO: Need to properly hook module load/unload for this to work right.
|
||||
//return ERROR_MPEG_ALREADY_INIT;
|
||||
} else {
|
||||
INFO_LOG(ME, "sceMpegInit(), mpegLibVersion 0x%0x, mpegLibcrc %s", mpegLibVersion, mpegLibCrcstring.c_str());
|
||||
INFO_LOG(ME, "sceMpegInit(), mpegLibVersion 0x%0x, mpegLibcrc %x", mpegLibVersion, mpegLibCrc);
|
||||
}
|
||||
isMpegInit = true;
|
||||
return hleDelayResult(0, "mpeg init", 750);
|
||||
|
|
|
@ -79,7 +79,7 @@ void __MpegInit();
|
|||
void __MpegDoState(PointerWrap &p);
|
||||
void __MpegShutdown();
|
||||
|
||||
void __MpegLoadModule(int version,std::string crcstr);
|
||||
void __MpegLoadModule(int version,u32 crc);
|
||||
|
||||
void Register_sceMpeg();
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static const int audioSamplesBytes = audioSamples * 4;
|
|||
static int videoPixelMode = GE_CMODE_32BIT_ABGR8888;
|
||||
static int videoLoopStatus = PSMF_PLAYER_CONFIG_NO_LOOP;
|
||||
static int psmfPlayerLibVersion = 0;
|
||||
static std::string psmfPlayerLibcrcstring = "null";
|
||||
static u32 psmfPlayerLibcrc = 0;
|
||||
|
||||
int eventPsmfPlayerStatusChange = -1;
|
||||
|
||||
|
@ -697,9 +697,9 @@ void __PsmfInit() {
|
|||
eventPsmfPlayerStatusChange = CoreTiming::RegisterEvent("PsmfPlayerStatusChange", &__PsmfPlayerStatusChange);
|
||||
}
|
||||
|
||||
void __PsmfPlayerLoadModule(int devkitVersion, std::string crcstr) {
|
||||
void __PsmfPlayerLoadModule(int devkitVersion, u32 crc) {
|
||||
psmfPlayerLibVersion = devkitVersion;
|
||||
psmfPlayerLibcrcstring = crcstr;
|
||||
psmfPlayerLibcrc = crc;
|
||||
}
|
||||
|
||||
void __PsmfDoState(PointerWrap &p) {
|
||||
|
@ -725,9 +725,9 @@ void __PsmfPlayerDoState(PointerWrap &p) {
|
|||
}
|
||||
CoreTiming::RestoreRegisterEvent(eventPsmfPlayerStatusChange, "PsmfPlayerStatusChangeEvent", &__PsmfPlayerStatusChange);
|
||||
if (s < 3) {
|
||||
psmfPlayerLibcrcstring = "null";
|
||||
psmfPlayerLibcrc = 0;
|
||||
} else {
|
||||
Do(p, psmfPlayerLibcrcstring);
|
||||
Do(p, psmfPlayerLibcrc);
|
||||
}
|
||||
if (s < 2) {
|
||||
// Assume the latest, which is what we were emulating before.
|
||||
|
@ -1164,7 +1164,7 @@ static int scePsmfPlayerCreate(u32 psmfPlayer, u32 dataPtr) {
|
|||
|
||||
int delayUs = 20000;
|
||||
DelayPsmfStateChange(psmfPlayer, PSMF_PLAYER_STATUS_INIT, delayUs);
|
||||
INFO_LOG(ME, "psmfplayer create, psmfPlayerLibVersion 0x%0x, psmfPlayerLibcrcstring %s", psmfPlayerLibVersion, psmfPlayerLibcrcstring.c_str());
|
||||
INFO_LOG(ME, "psmfplayer create, psmfPlayerLibVersion 0x%0x, psmfPlayerLibcrc %x", psmfPlayerLibVersion, psmfPlayerLibcrc);
|
||||
return hleDelayResult(0, "player create", delayUs);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ void Register_scePsmf();
|
|||
void Register_scePsmfPlayer();
|
||||
|
||||
void __PsmfInit();
|
||||
void __PsmfPlayerLoadModule(int devkitVersion,std::string crcstr);
|
||||
void __PsmfPlayerLoadModule(int devkitVersion,u32 crc);
|
||||
void __PsmfDoState(PointerWrap &p);
|
||||
void __PsmfPlayerDoState(PointerWrap &p);
|
||||
void __PsmfShutdown();
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "UI/MainScreen.h"
|
||||
#include "UI/BackgroundAudio.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include <sstream>
|
||||
|
||||
GameScreen::GameScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {
|
||||
g_BackgroundAudio.SetGame(gamePath);
|
||||
|
@ -56,11 +55,12 @@ GameScreen::~GameScreen() {
|
|||
}
|
||||
}
|
||||
|
||||
const char* int2hexstr(const int a) {
|
||||
std::stringstream stream;
|
||||
stream << std::hex << a;
|
||||
auto s = stream.str();
|
||||
return s.c_str();
|
||||
template <typename I> 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;
|
||||
}
|
||||
|
||||
void GameScreen::update() {
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
// Uses GameInfoCache heavily to implement the functionality.
|
||||
// Should possibly merge this with the PauseScreen.
|
||||
|
||||
const char* int2hexstr(const int a);
|
||||
|
||||
class GameScreen : public UIDialogScreenWithGameBackground {
|
||||
public:
|
||||
GameScreen(const Path &gamePath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue