Dialog: Use dialog type header more consistently.

This commit is contained in:
Unknown W. Brackets 2021-02-27 13:43:12 -08:00
parent 52c5f4bf95
commit 88fe2e9863
18 changed files with 114 additions and 166 deletions

View File

@ -31,7 +31,7 @@
#define FADE_TIME 1.0
const float FONT_SCALE = 0.55f;
PSPDialog::PSPDialog(int type) : dialogType_(type) {
PSPDialog::PSPDialog(UtilityDialogType type) : dialogType_(type) {
}
PSPDialog::~PSPDialog() {

View File

@ -17,11 +17,11 @@
#pragma once
#include "Common/Render/TextureAtlas.h"
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Common/Render/TextureAtlas.h"
#include "Common/Swap.h"
#include "Core/HLE/sceUtility.h"
#include "Core/Util/PPGeDraw.h"
class PointerWrap;
@ -53,7 +53,7 @@ struct pspUtilityDialogCommon
class PSPDialog
{
public:
PSPDialog(int type);
PSPDialog(UtilityDialogType type);
virtual ~PSPDialog();
virtual int Update(int animSpeed) = 0;
@ -80,7 +80,7 @@ public:
};
DialogStatus GetStatus();
int DialogType() { return dialogType_; }
UtilityDialogType DialogType() { return dialogType_; }
void StartDraw();
void EndDraw();
@ -129,6 +129,6 @@ protected:
private:
DialogStatus status = SCE_UTILITY_STATUS_NONE;
int dialogType_;
UtilityDialogType dialogType_;
bool volatileLocked_ = false;
};

View File

@ -55,7 +55,7 @@ namespace
}
}
PSPGamedataInstallDialog::PSPGamedataInstallDialog(int type) : PSPDialog(type) {
PSPGamedataInstallDialog::PSPGamedataInstallDialog(UtilityDialogType type) : PSPDialog(type) {
}
PSPGamedataInstallDialog::~PSPGamedataInstallDialog() {

View File

@ -35,7 +35,7 @@ struct SceUtilityGamedataInstallParam {
class PSPGamedataInstallDialog: public PSPDialog {
public:
PSPGamedataInstallDialog(int type);
PSPGamedataInstallDialog(UtilityDialogType type);
virtual ~PSPGamedataInstallDialog();
virtual int Init(u32 paramAddr);

View File

@ -35,7 +35,7 @@ static const float FONT_SCALE = 0.65f;
const static int MSG_INIT_DELAY_US = 300000;
const static int MSG_SHUTDOWN_DELAY_US = 26000;
PSPMsgDialog::PSPMsgDialog(int type) : PSPDialog(type) {
PSPMsgDialog::PSPMsgDialog(UtilityDialogType type) : PSPDialog(type) {
}
PSPMsgDialog::~PSPMsgDialog() {

View File

@ -58,7 +58,7 @@ struct pspMessageDialog
class PSPMsgDialog: public PSPDialog {
public:
PSPMsgDialog(int type);
PSPMsgDialog(UtilityDialogType type);
virtual ~PSPMsgDialog();
virtual int Init(unsigned int paramAddr);

View File

@ -54,7 +54,7 @@ struct ScanInfos {
} PACK;
PSPNetconfDialog::PSPNetconfDialog(int type) : PSPDialog(type) {
PSPNetconfDialog::PSPNetconfDialog(UtilityDialogType type) : PSPDialog(type) {
}
PSPNetconfDialog::~PSPNetconfDialog() {

View File

@ -37,7 +37,7 @@ struct SceUtilityNetconfParam {
class PSPNetconfDialog: public PSPDialog {
public:
PSPNetconfDialog(int type);
PSPNetconfDialog(UtilityDialogType type);
virtual ~PSPNetconfDialog();
virtual int Init(u32 paramAddr);

View File

@ -156,7 +156,7 @@ int allowedInputFlagsMap[OSK_KEYBOARD_COUNT] = {
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_UPPERCASE | PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_SYMBOL,
};
PSPOskDialog::PSPOskDialog(int type) : PSPDialog(type) {
PSPOskDialog::PSPOskDialog(UtilityDialogType type) : PSPDialog(type) {
// This can break all kinds of stuff, changing the decimal point in sprintf for example.
// Not sure what the intended effect is so commented out for now.
// setlocale(LC_ALL, "");

View File

@ -213,7 +213,7 @@ enum class PSPOskNativeStatus {
class PSPOskDialog: public PSPDialog {
public:
PSPOskDialog(int type);
PSPOskDialog(UtilityDialogType type);
virtual ~PSPOskDialog();
virtual int Init(u32 oskPtr);

View File

@ -17,7 +17,7 @@
#include "PSPPlaceholderDialog.h"
PSPPlaceholderDialog::PSPPlaceholderDialog(int type) : PSPDialog(type) {
PSPPlaceholderDialog::PSPPlaceholderDialog(UtilityDialogType type) : PSPDialog(type) {
}

View File

@ -21,7 +21,7 @@
class PSPPlaceholderDialog: public PSPDialog {
public:
PSPPlaceholderDialog(int type);
PSPPlaceholderDialog(UtilityDialogType type);
virtual ~PSPPlaceholderDialog();
virtual int Init();

View File

@ -56,7 +56,7 @@ const static int SAVEDATA_DIALOG_SIZE_V2 = 1500;
const static int SAVEDATA_DIALOG_SIZE_V3 = 1536;
PSPSaveDialog::PSPSaveDialog(int type) : PSPDialog(type) {
PSPSaveDialog::PSPSaveDialog(UtilityDialogType type) : PSPDialog(type) {
param.SetPspParam(0);
}

View File

@ -71,7 +71,7 @@
class PSPSaveDialog: public PSPDialog {
public:
PSPSaveDialog(int type);
PSPSaveDialog(UtilityDialogType type);
virtual ~PSPSaveDialog();
virtual int Init(int paramAddr);

View File

@ -52,7 +52,7 @@ struct SceUtilityScreenshotParams {
// TODO
};
PSPScreenshotDialog::PSPScreenshotDialog(int type) : PSPDialog(type) {
PSPScreenshotDialog::PSPScreenshotDialog(UtilityDialogType type) : PSPDialog(type) {
}
PSPScreenshotDialog::~PSPScreenshotDialog() {

View File

@ -24,7 +24,7 @@ struct SceUtilityScreenshotParams;
class PSPScreenshotDialog : public PSPDialog {
public:
PSPScreenshotDialog(int type);
PSPScreenshotDialog(UtilityDialogType type);
virtual ~PSPScreenshotDialog();
virtual int Init(u32 paramAddr);

View File

@ -120,26 +120,15 @@ static const ModuleLoadInfo moduleLoadInfo[] = {
ModuleLoadInfo(0x0601, 0x00000000),
};
enum UtilityDialogType {
UTILITY_DIALOG_NONE,
UTILITY_DIALOG_SAVEDATA,
UTILITY_DIALOG_MSG,
UTILITY_DIALOG_OSK,
UTILITY_DIALOG_NET,
UTILITY_DIALOG_SCREENSHOT,
UTILITY_DIALOG_GAMESHARING,
UTILITY_DIALOG_GAMEDATAINSTALL,
};
// Only a single dialog is allowed at a time.
static UtilityDialogType currentDialogType;
bool currentDialogActive;
static PSPSaveDialog saveDialog(UTILITY_DIALOG_SAVEDATA);
static PSPMsgDialog msgDialog(UTILITY_DIALOG_MSG);
static PSPOskDialog oskDialog(UTILITY_DIALOG_OSK);
static PSPNetconfDialog netDialog(UTILITY_DIALOG_NET);
static PSPScreenshotDialog screenshotDialog(UTILITY_DIALOG_SCREENSHOT);
static PSPGamedataInstallDialog gamedataInstallDialog(UTILITY_DIALOG_GAMEDATAINSTALL);
static PSPSaveDialog saveDialog(UtilityDialogType::SAVEDATA);
static PSPMsgDialog msgDialog(UtilityDialogType::MSG);
static PSPOskDialog oskDialog(UtilityDialogType::OSK);
static PSPNetconfDialog netDialog(UtilityDialogType::NET);
static PSPScreenshotDialog screenshotDialog(UtilityDialogType::SCREENSHOT);
static PSPGamedataInstallDialog gamedataInstallDialog(UtilityDialogType::GAMEDATAINSTALL);
static int oldStatus = 100; //random value
static std::map<int, u32> currentlyLoadedModules;
@ -179,7 +168,7 @@ static void UtilityVolatileUnlock(u64 userdata, int cyclesLate) {
}
void __UtilityInit() {
currentDialogType = UTILITY_DIALOG_NONE;
currentDialogType = UtilityDialogType::NONE;
DeactivateDialog();
SavedataParam::Init();
currentlyLoadedModules.clear();
@ -249,7 +238,7 @@ void __UtilityShutdown() {
}
}
void UtilityDialogShutdown(int type, int delayUs, int priority) {
void UtilityDialogShutdown(UtilityDialogType type, int delayUs, int priority) {
// Break it up so better-priority rescheduling happens.
// The windows aren't this regular, but close.
int partDelay = delayUs / 4;
@ -264,7 +253,7 @@ void UtilityDialogShutdown(int type, int delayUs, int priority) {
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_S0, 0),
(u32_le)MIPS_MAKE_SYSCALL("sceUtility", "__UtilityWorkUs"),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_ZERO, type),
(u32_le)MIPS_MAKE_ORI(MIPS_REG_A0, MIPS_REG_ZERO, (int)type),
(u32_le)MIPS_MAKE_JR_RA(),
(u32_le)MIPS_MAKE_SYSCALL("sceUtility", "__UtilityFinishDialog"),
};
@ -284,50 +273,46 @@ static int UtilityWorkUs(int us) {
}
static int UtilityFinishDialog(int type) {
switch (type) {
case UTILITY_DIALOG_NONE:
switch ((UtilityDialogType)type) {
case UtilityDialogType::NONE:
break;
case UTILITY_DIALOG_SAVEDATA:
case UtilityDialogType::SAVEDATA:
return hleLogSuccessI(SCEUTILITY, saveDialog.FinishShutdown());
case UTILITY_DIALOG_MSG:
case UtilityDialogType::MSG:
return hleLogSuccessI(SCEUTILITY, msgDialog.FinishShutdown());
case UTILITY_DIALOG_OSK:
case UtilityDialogType::OSK:
return hleLogSuccessI(SCEUTILITY, oskDialog.FinishShutdown());
case UTILITY_DIALOG_NET:
case UtilityDialogType::NET:
return hleLogSuccessI(SCEUTILITY, netDialog.FinishShutdown());
case UTILITY_DIALOG_SCREENSHOT:
case UtilityDialogType::SCREENSHOT:
return hleLogSuccessI(SCEUTILITY, screenshotDialog.FinishShutdown());
case UTILITY_DIALOG_GAMESHARING:
case UtilityDialogType::GAMESHARING:
return hleLogError(SCEUTILITY, -1, "unimplemented");
case UTILITY_DIALOG_GAMEDATAINSTALL:
case UtilityDialogType::GAMEDATAINSTALL:
return hleLogSuccessI(SCEUTILITY, gamedataInstallDialog.FinishShutdown());
}
return hleLogError(SCEUTILITY, 0, "invalid dialog type?");
}
static int sceUtilitySavedataInitStart(u32 paramAddr)
{
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_SAVEDATA)
{
if (PSP_CoreParameter().compat.flags().YugiohSaveFix)
{
static int sceUtilitySavedataInitStart(u32 paramAddr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::SAVEDATA) {
if (PSP_CoreParameter().compat.flags().YugiohSaveFix) {
WARN_LOG(SCEUTILITY, "Yugioh Savedata Correction");
}
else {
} else {
WARN_LOG(SCEUTILITY, "sceUtilitySavedataInitStart(%08x): wrong dialog type", paramAddr);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
}
oldStatus = 100;
ActivateDialog(UTILITY_DIALOG_SAVEDATA);
ActivateDialog(UtilityDialogType::SAVEDATA);
int ret = saveDialog.Init(paramAddr);
DEBUG_LOG(SCEUTILITY,"%08x=sceUtilitySavedataInitStart(%08x)",ret,paramAddr);
return ret;
}
static int sceUtilitySavedataShutdownStart() {
if (currentDialogType != UTILITY_DIALOG_SAVEDATA)
if (currentDialogType != UtilityDialogType::SAVEDATA)
return hleLogWarning(SCEUTILITY, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
DeactivateDialog();
@ -336,10 +321,8 @@ static int sceUtilitySavedataShutdownStart() {
return hleLogSuccessX(SCEUTILITY, ret);
}
static int sceUtilitySavedataGetStatus()
{
if (currentDialogType != UTILITY_DIALOG_SAVEDATA)
{
static int sceUtilitySavedataGetStatus() {
if (currentDialogType != UtilityDialogType::SAVEDATA) {
DEBUG_LOG(SCEUTILITY, "sceUtilitySavedataGetStatus(): wrong dialog type");
hleEatCycles(200);
return SCE_ERROR_UTILITY_WRONG_TYPE;
@ -355,10 +338,8 @@ static int sceUtilitySavedataGetStatus()
return status;
}
static int sceUtilitySavedataUpdate(int animSpeed)
{
if (currentDialogType != UTILITY_DIALOG_SAVEDATA)
{
static int sceUtilitySavedataUpdate(int animSpeed) {
if (currentDialogType != UtilityDialogType::SAVEDATA) {
WARN_LOG(SCEUTILITY, "sceUtilitySavedataUpdate(%i): wrong dialog type", animSpeed);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -453,26 +434,21 @@ static u32 sceUtilityUnloadModule(u32 module) {
return hleDelayResult(hleLogSuccessInfoI(SCEUTILITY, 0), "utility module unloaded", 400);
}
static int sceUtilityMsgDialogInitStart(u32 paramAddr)
{
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_MSG)
{
static int sceUtilityMsgDialogInitStart(u32 paramAddr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::MSG) {
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogInitStart(%08x): wrong dialog type", paramAddr);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
oldStatus = 100;
currentDialogType = UTILITY_DIALOG_MSG;
currentDialogActive = true;
ActivateDialog(UtilityDialogType::MSG);
int ret = msgDialog.Init(paramAddr);
INFO_LOG(SCEUTILITY, "%08x=sceUtilityMsgDialogInitStart(%08x)", ret, paramAddr);
return ret;
}
static int sceUtilityMsgDialogShutdownStart()
{
if (currentDialogType != UTILITY_DIALOG_MSG)
{
static int sceUtilityMsgDialogShutdownStart() {
if (currentDialogType != UtilityDialogType::MSG) {
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogShutdownStart(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -483,10 +459,8 @@ static int sceUtilityMsgDialogShutdownStart()
return ret;
}
static int sceUtilityMsgDialogUpdate(int animSpeed)
{
if (currentDialogType != UTILITY_DIALOG_MSG)
{
static int sceUtilityMsgDialogUpdate(int animSpeed) {
if (currentDialogType != UtilityDialogType::MSG) {
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogUpdate(%i): wrong dialog type", animSpeed);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -498,10 +472,8 @@ static int sceUtilityMsgDialogUpdate(int animSpeed)
return ret;
}
static int sceUtilityMsgDialogGetStatus()
{
if (currentDialogType != UTILITY_DIALOG_MSG)
{
static int sceUtilityMsgDialogGetStatus() {
if (currentDialogType != UtilityDialogType::MSG) {
DEBUG_LOG(SCEUTILITY, "sceUtilityMsgDialogGetStatus(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -515,10 +487,8 @@ static int sceUtilityMsgDialogGetStatus()
return status;
}
static int sceUtilityMsgDialogAbort()
{
if (currentDialogType != UTILITY_DIALOG_MSG)
{
static int sceUtilityMsgDialogAbort() {
if (currentDialogType != UtilityDialogType::MSG) {
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogAbort(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -530,24 +500,21 @@ static int sceUtilityMsgDialogAbort()
// On screen keyboard
static int sceUtilityOskInitStart(u32 oskPtr)
{
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_OSK)
{
static int sceUtilityOskInitStart(u32 oskPtr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::OSK) {
WARN_LOG(SCEUTILITY, "sceUtilityOskInitStart(%08x): wrong dialog type", oskPtr);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
oldStatus = 100;
ActivateDialog(UTILITY_DIALOG_OSK);
ActivateDialog(UtilityDialogType::OSK);
int ret = oskDialog.Init(oskPtr);
INFO_LOG(SCEUTILITY, "%08x=sceUtilityOskInitStart(%08x)", ret, oskPtr);
return ret;
}
static int sceUtilityOskShutdownStart()
{
if (currentDialogType != UTILITY_DIALOG_OSK)
static int sceUtilityOskShutdownStart() {
if (currentDialogType != UtilityDialogType::OSK)
{
WARN_LOG(SCEUTILITY, "sceUtilityOskShutdownStart(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
@ -559,10 +526,8 @@ static int sceUtilityOskShutdownStart()
return ret;
}
static int sceUtilityOskUpdate(int animSpeed)
{
if (currentDialogType != UTILITY_DIALOG_OSK)
{
static int sceUtilityOskUpdate(int animSpeed) {
if (currentDialogType != UtilityDialogType::OSK) {
WARN_LOG(SCEUTILITY, "sceUtilityOskUpdate(%i): wrong dialog type", animSpeed);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -572,10 +537,8 @@ static int sceUtilityOskUpdate(int animSpeed)
return ret;
}
static int sceUtilityOskGetStatus()
{
if (currentDialogType != UTILITY_DIALOG_OSK)
{
static int sceUtilityOskGetStatus() {
if (currentDialogType != UtilityDialogType::OSK) {
DEBUG_LOG(SCEUTILITY, "sceUtilityOskGetStatus(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -591,17 +554,17 @@ static int sceUtilityOskGetStatus()
static int sceUtilityNetconfInitStart(u32 paramsAddr) {
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_NET) {
if (currentDialogActive && currentDialogType != UtilityDialogType::NET) {
return hleLogWarning(SCEUTILITY, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
}
oldStatus = 100;
ActivateDialog(UTILITY_DIALOG_NET);
ActivateDialog(UtilityDialogType::NET);
return hleLogSuccessInfoI(SCEUTILITY, netDialog.Init(paramsAddr));
}
static int sceUtilityNetconfShutdownStart() {
if (currentDialogType != UTILITY_DIALOG_NET) {
if (currentDialogType != UtilityDialogType::NET) {
return hleLogWarning(SCEUTILITY, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
}
@ -610,7 +573,7 @@ static int sceUtilityNetconfShutdownStart() {
}
static int sceUtilityNetconfUpdate(int animSpeed) {
if (currentDialogType != UTILITY_DIALOG_NET) {
if (currentDialogType != UtilityDialogType::NET) {
return hleLogWarning(SCEUTILITY, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
}
@ -618,7 +581,7 @@ static int sceUtilityNetconfUpdate(int animSpeed) {
}
static int sceUtilityNetconfGetStatus() {
if (currentDialogType != UTILITY_DIALOG_NET) {
if (currentDialogType != UtilityDialogType::NET) {
// Spam in Danball Senki BOOST.
return hleLogDebug(SCEUTILITY, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
}
@ -643,25 +606,21 @@ static int sceUtilityCheckNetParam(int id)
//TODO: Implement all sceUtilityScreenshot* for real, it doesn't seem to be complex
//but it requires more investigation
static int sceUtilityScreenshotInitStart(u32 paramAddr)
{
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_SCREENSHOT)
{
static int sceUtilityScreenshotInitStart(u32 paramAddr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::SCREENSHOT) {
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotInitStart(%08x): wrong dialog type", paramAddr);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
oldStatus = 100;
ActivateDialog(UTILITY_DIALOG_SCREENSHOT);
ActivateDialog(UtilityDialogType::SCREENSHOT);
u32 retval = screenshotDialog.Init(paramAddr);
WARN_LOG_REPORT(SCEUTILITY, "%08x=sceUtilityScreenshotInitStart(%08x)", retval, paramAddr);
return retval;
}
static int sceUtilityScreenshotShutdownStart()
{
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
{
static int sceUtilityScreenshotShutdownStart() {
if (currentDialogType != UtilityDialogType::SCREENSHOT) {
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotShutdownStart(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -672,10 +631,8 @@ static int sceUtilityScreenshotShutdownStart()
return ret;
}
static int sceUtilityScreenshotUpdate(u32 animSpeed)
{
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
{
static int sceUtilityScreenshotUpdate(u32 animSpeed) {
if (currentDialogType != UtilityDialogType::SCREENSHOT) {
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotUpdate(%i): wrong dialog type", animSpeed);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -685,10 +642,8 @@ static int sceUtilityScreenshotUpdate(u32 animSpeed)
return ret;
}
static int sceUtilityScreenshotGetStatus()
{
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
{
static int sceUtilityScreenshotGetStatus() {
if (currentDialogType != UtilityDialogType::SCREENSHOT) {
DEBUG_LOG(SCEUTILITY, "sceUtilityScreenshotGetStatus(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -702,10 +657,8 @@ static int sceUtilityScreenshotGetStatus()
return status;
}
static int sceUtilityScreenshotContStart(u32 paramAddr)
{
if (currentDialogType != UTILITY_DIALOG_SCREENSHOT)
{
static int sceUtilityScreenshotContStart(u32 paramAddr) {
if (currentDialogType != UtilityDialogType::SCREENSHOT) {
WARN_LOG(SCEUTILITY, "sceUtilityScreenshotContStart(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -715,23 +668,20 @@ static int sceUtilityScreenshotContStart(u32 paramAddr)
return ret;
}
static int sceUtilityGamedataInstallInitStart(u32 paramsAddr)
{
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
{
static int sceUtilityGamedataInstallInitStart(u32 paramsAddr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::GAMEDATAINSTALL) {
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallInitStart(%08x): wrong dialog type", paramsAddr);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
ActivateDialog(UTILITY_DIALOG_GAMEDATAINSTALL);
ActivateDialog(UtilityDialogType::GAMEDATAINSTALL);
int ret = gamedataInstallDialog.Init(paramsAddr);
INFO_LOG(SCEUTILITY, "%08x=sceUtilityGamedataInstallInitStart(%08x)",ret,paramsAddr);
return ret;
}
static int sceUtilityGamedataInstallShutdownStart() {
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
{
if (currentDialogType != UtilityDialogType::GAMEDATAINSTALL) {
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallShutdownStart(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -742,8 +692,7 @@ static int sceUtilityGamedataInstallShutdownStart() {
}
static int sceUtilityGamedataInstallUpdate(int animSpeed) {
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
{
if (currentDialogType != UtilityDialogType::GAMEDATAINSTALL) {
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallUpdate(%i): wrong dialog type", animSpeed);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -753,10 +702,8 @@ static int sceUtilityGamedataInstallUpdate(int animSpeed) {
return ret;
}
static int sceUtilityGamedataInstallGetStatus()
{
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
{
static int sceUtilityGamedataInstallGetStatus() {
if (currentDialogType != UtilityDialogType::GAMEDATAINSTALL) {
// This is called incorrectly all the time by some games. So let's not bother warning.
// WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallGetStatus(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
@ -768,10 +715,8 @@ static int sceUtilityGamedataInstallGetStatus()
return status;
}
static int sceUtilityGamedataInstallAbort()
{
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
{
static int sceUtilityGamedataInstallAbort() {
if (currentDialogType != UtilityDialogType::GAMEDATAINSTALL) {
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallAbort(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -933,10 +878,8 @@ static int sceUtilityStoreCheckoutGetStatus()
return 0;
}
static int sceUtilityGameSharingShutdownStart()
{
if (currentDialogType != UTILITY_DIALOG_GAMESHARING)
{
static int sceUtilityGameSharingShutdownStart() {
if (currentDialogType != UtilityDialogType::GAMESHARING) {
WARN_LOG(SCEUTILITY, "sceUtilityGameSharingShutdownStart(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -946,23 +889,19 @@ static int sceUtilityGameSharingShutdownStart()
return 0;
}
static int sceUtilityGameSharingInitStart(u32 paramsPtr)
{
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_GAMESHARING)
{
static int sceUtilityGameSharingInitStart(u32 paramsPtr) {
if (currentDialogActive && currentDialogType != UtilityDialogType::GAMESHARING) {
WARN_LOG(SCEUTILITY, "sceUtilityGameSharingInitStart(%08x)", paramsPtr);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
ActivateDialog(UTILITY_DIALOG_GAMESHARING);
ActivateDialog(UtilityDialogType::GAMESHARING);
ERROR_LOG_REPORT(SCEUTILITY, "UNIMPL sceUtilityGameSharingInitStart(%08x)", paramsPtr);
return 0;
}
static int sceUtilityGameSharingUpdate(int animSpeed)
{
if (currentDialogType != UTILITY_DIALOG_GAMESHARING)
{
static int sceUtilityGameSharingUpdate(int animSpeed) {
if (currentDialogType != UtilityDialogType::GAMESHARING) {
WARN_LOG(SCEUTILITY, "sceUtilityGameSharingUpdate(%i): wrong dialog type", animSpeed);
return SCE_ERROR_UTILITY_WRONG_TYPE;
}
@ -971,10 +910,8 @@ static int sceUtilityGameSharingUpdate(int animSpeed)
return 0;
}
static int sceUtilityGameSharingGetStatus()
{
if (currentDialogType != UTILITY_DIALOG_GAMESHARING)
{
static int sceUtilityGameSharingGetStatus() {
if (currentDialogType != UtilityDialogType::GAMESHARING) {
DEBUG_LOG(SCEUTILITY, "sceUtilityGameSharingGetStatus(): wrong dialog type");
return SCE_ERROR_UTILITY_WRONG_TYPE;
}

View File

@ -79,10 +79,21 @@ class PointerWrap;
#define PSP_SYSTEMPARAM_BUTTON_CIRCLE 0
#define PSP_SYSTEMPARAM_BUTTON_CROSS 1
enum class UtilityDialogType {
NONE,
SAVEDATA,
MSG,
OSK,
NET,
SCREENSHOT,
GAMESHARING,
GAMEDATAINSTALL,
};
void __UtilityInit();
void __UtilityDoState(PointerWrap &p);
void __UtilityShutdown();
void UtilityDialogShutdown(int type, int delayUs, int priority);
void UtilityDialogShutdown(UtilityDialogType type, int delayUs, int priority);
void Register_sceUtility();