mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
Merge branch 'patch-1' of https://github.com/shenweip/ppsspp into shenweip-patch-1
This commit is contained in:
commit
52e4a7cf5d
@ -763,6 +763,8 @@ add_library(${CoreLibName} ${CoreLinkType}
|
||||
Core/Debugger/SymbolMap.h
|
||||
Core/Dialog/PSPDialog.cpp
|
||||
Core/Dialog/PSPDialog.h
|
||||
Core/Dialog/PSPGamedataInstallDialog.cpp
|
||||
Core/Dialog/PSPGamedataInstallDialog.h
|
||||
Core/Dialog/PSPMsgDialog.cpp
|
||||
Core/Dialog/PSPMsgDialog.h
|
||||
Core/Dialog/PSPOskDialog.cpp
|
||||
|
@ -7,6 +7,7 @@ set(SRCS
|
||||
Dialog/PSPSaveDialog.cpp
|
||||
Dialog/SavedataParam.cpp
|
||||
Dialog/PSPOskDialog.cpp
|
||||
Dialog/PSPGamedataInstallDialog.cpp
|
||||
MIPS/MIPS.cpp
|
||||
MIPS/MIPSAnalyst.cpp
|
||||
MIPS/MIPSCodeUtils.cpp
|
||||
|
@ -172,6 +172,7 @@
|
||||
<ClCompile Include="Cwcheat.cpp" />
|
||||
<ClCompile Include="Debugger\Breakpoints.cpp" />
|
||||
<ClCompile Include="Debugger\SymbolMap.cpp" />
|
||||
<ClCompile Include="Dialog\PSPGamedataInstallDialog.cpp" />
|
||||
<ClCompile Include="Dialog\PSPDialog.cpp" />
|
||||
<ClCompile Include="Dialog\PSPMsgDialog.cpp" />
|
||||
<ClCompile Include="Dialog\PSPOskDialog.cpp" />
|
||||
@ -409,6 +410,7 @@
|
||||
<ClInclude Include="Debugger\Breakpoints.h" />
|
||||
<ClInclude Include="Debugger\DebugInterface.h" />
|
||||
<ClInclude Include="Debugger\SymbolMap.h" />
|
||||
<ClInclude Include="Dialog\PSPGamedataInstallDialog.h" />
|
||||
<ClInclude Include="Dialog\PSPDialog.h" />
|
||||
<ClInclude Include="Dialog\PSPMsgDialog.h" />
|
||||
<ClInclude Include="Dialog\PSPOskDialog.h" />
|
||||
|
@ -493,6 +493,9 @@
|
||||
<ClCompile Include="HLE\sceNetAdhoc.cpp">
|
||||
<Filter>HLE\Libraries</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Dialog\PSPGamedataInstallDialog.cpp">
|
||||
<Filter>Dialog</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ELF\ElfReader.h">
|
||||
@ -906,6 +909,9 @@
|
||||
<ClInclude Include="HLE\sceNetAdhoc.h">
|
||||
<Filter>HLE\Libraries</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Dialog\PSPGamedataInstallDialog.h">
|
||||
<Filter>Dialog</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CMakeLists.txt" />
|
||||
|
61
Core/Dialog/PSPGamedataInstallDialog.cpp
Normal file
61
Core/Dialog/PSPGamedataInstallDialog.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
// Copyright (c) 2012- PPSSPP Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "PSPGamedataInstallDialog.h"
|
||||
#include "ChunkFile.h"
|
||||
#include "../Core/MemMap.h"
|
||||
|
||||
PSPGamedataInstallDialog::PSPGamedataInstallDialog() {
|
||||
}
|
||||
|
||||
PSPGamedataInstallDialog::~PSPGamedataInstallDialog() {
|
||||
}
|
||||
|
||||
int PSPGamedataInstallDialog::Init(u32 paramAddr)
|
||||
{
|
||||
// Already running
|
||||
if (status != SCE_UTILITY_STATUS_NONE && status != SCE_UTILITY_STATUS_SHUTDOWN)
|
||||
return SCE_ERROR_UTILITY_INVALID_STATUS;
|
||||
|
||||
int size = Memory::Read_U32(paramAddr);
|
||||
memset(&request, 0, sizeof(request));
|
||||
// Only copy the right size to support different request format
|
||||
Memory::Memcpy(&request, paramAddr, size);
|
||||
|
||||
status = SCE_UTILITY_STATUS_INITIALIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PSPGamedataInstallDialog::Abort()
|
||||
{
|
||||
return PSPDialog::Shutdown();
|
||||
}
|
||||
|
||||
int PSPGamedataInstallDialog::Shutdown(bool force)
|
||||
{
|
||||
if (status != SCE_UTILITY_STATUS_FINISHED && !force)
|
||||
return SCE_ERROR_UTILITY_INVALID_STATUS;
|
||||
|
||||
return PSPDialog::Shutdown();
|
||||
}
|
||||
|
||||
void PSPGamedataInstallDialog::DoState(PointerWrap &p) {
|
||||
PSPDialog::DoState(p);
|
||||
p.Do(request);
|
||||
p.DoMarker("PSPGamedataInstallDialog");
|
||||
}
|
54
Core/Dialog/PSPGamedataInstallDialog.h
Normal file
54
Core/Dialog/PSPGamedataInstallDialog.h
Normal file
@ -0,0 +1,54 @@
|
||||
// Copyright (c) 2012- PPSSPP Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Core/Dialog/PSPDialog.h"
|
||||
|
||||
struct SceUtilityGamedataInstallParam
|
||||
{
|
||||
pspUtilityDialogCommon common;
|
||||
u32 unknown1;
|
||||
char gameName[13];
|
||||
char ignore1[3];
|
||||
char dataName[20];
|
||||
char gamedataParamsGameTitle[128];
|
||||
char gamedataParamsDataTitle[128];
|
||||
char gamedataParamsData[1024];
|
||||
u8 unknown2;
|
||||
char ignore2[7];
|
||||
u32 unknownResult1;
|
||||
u32 unknownResult2;
|
||||
char ignore[48];
|
||||
};
|
||||
|
||||
class PSPGamedataInstallDialog: public PSPDialog {
|
||||
public:
|
||||
PSPGamedataInstallDialog();
|
||||
virtual ~PSPGamedataInstallDialog();
|
||||
|
||||
virtual int Init(u32 paramAddr);
|
||||
//virtual int Update();
|
||||
virtual int Shutdown(bool force = false);
|
||||
virtual void DoState(PointerWrap &p);
|
||||
|
||||
int Abort();
|
||||
|
||||
|
||||
private:
|
||||
SceUtilityGamedataInstallParam request;
|
||||
};
|
@ -31,6 +31,7 @@
|
||||
#include "../Dialog/PSPMsgDialog.h"
|
||||
#include "../Dialog/PSPPlaceholderDialog.h"
|
||||
#include "../Dialog/PSPOskDialog.h"
|
||||
#include "../Dialog/PSPGamedataInstallDialog.h"
|
||||
|
||||
const int SCE_ERROR_MODULE_BAD_ID = 0x80111101;
|
||||
const int SCE_ERROR_MODULE_ALREADY_LOADED = 0x80111102;
|
||||
@ -45,6 +46,7 @@ enum UtilityDialogType {
|
||||
UTILITY_DIALOG_NET,
|
||||
UTILITY_DIALOG_SCREENSHOT,
|
||||
UTILITY_DIALOG_GAMESHARING,
|
||||
UTILITY_DIALOG_GAMEDATAINSTALL,
|
||||
};
|
||||
|
||||
// Only a single dialog is allowed at a time.
|
||||
@ -55,6 +57,7 @@ static PSPMsgDialog msgDialog;
|
||||
static PSPOskDialog oskDialog;
|
||||
static PSPPlaceholderDialog netDialog;
|
||||
static PSPPlaceholderDialog screenshotDialog;
|
||||
static PSPGamedataInstallDialog gamedataInstallDialog;
|
||||
|
||||
static std::set<int> currentlyLoadedModules;
|
||||
|
||||
@ -79,6 +82,7 @@ void __UtilityDoState(PointerWrap &p)
|
||||
oskDialog.DoState(p);
|
||||
netDialog.DoState(p);
|
||||
screenshotDialog.DoState(p);
|
||||
gamedataInstallDialog.DoState(p);
|
||||
p.Do(currentlyLoadedModules);
|
||||
}
|
||||
|
||||
@ -89,6 +93,7 @@ void __UtilityShutdown()
|
||||
oskDialog.Shutdown(true);
|
||||
netDialog.Shutdown(true);
|
||||
screenshotDialog.Shutdown(true);
|
||||
gamedataInstallDialog.Shutdown(true);
|
||||
}
|
||||
|
||||
int __UtilityGetStatus()
|
||||
@ -440,16 +445,61 @@ int sceUtilityScreenshotGetStatus()
|
||||
return retval;
|
||||
}
|
||||
|
||||
void sceUtilityGamedataInstallInitStart(u32 unknown)
|
||||
int sceUtilityGamedataInstallInitStart(u32 paramsAddr)
|
||||
{
|
||||
ERROR_LOG_REPORT(SCEUTILITY, "UNIMPL sceUtilityGamedataInstallInitStart(%i)", unknown);
|
||||
if (currentDialogActive && currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
||||
{
|
||||
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallInitStart(%08x): wrong dialog type", paramsAddr);
|
||||
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
||||
}
|
||||
DEBUG_LOG(SCEUTILITY, "sceUtilityGamedataInstallInitStart(%08x)", paramsAddr);
|
||||
currentDialogType = UTILITY_DIALOG_GAMEDATAINSTALL;
|
||||
currentDialogActive = true;
|
||||
return gamedataInstallDialog.Init(paramsAddr);
|
||||
}
|
||||
|
||||
int sceUtilityGamedataInstallShutdownStart() {
|
||||
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
||||
{
|
||||
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallShutdownStart(): wrong dialog type");
|
||||
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
||||
}
|
||||
currentDialogActive = false;
|
||||
|
||||
DEBUG_LOG(SCEUTILITY, "sceUtilityGamedataInstallShutdownStart()");
|
||||
return gamedataInstallDialog.Shutdown();
|
||||
}
|
||||
|
||||
int sceUtilityGamedataInstallUpdate(int speed) {
|
||||
ERROR_LOG(SCEUTILITY, "UNIMPL sceUtilityGamedataInstallUpdate(%08x)", speed);
|
||||
gamedataInstallDialog.Abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceUtilityGamedataInstallGetStatus()
|
||||
{
|
||||
u32 retval = __UtilityGetStatus();
|
||||
ERROR_LOG(SCEUTILITY, "UNIMPL %i=sceUtilityGamedataInstallGetStatus()", retval);
|
||||
return retval;
|
||||
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
||||
{
|
||||
WARN_LOG(SCEUTILITY, "sceUtilityGamedataInstallGetStatus(): wrong dialog type");
|
||||
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
||||
}
|
||||
|
||||
int status = gamedataInstallDialog.GetStatus();
|
||||
DEBUG_LOG(SCEUTILITY, "%08x=sceUtilityGamedataInstallGetStatus()", status);
|
||||
return status;
|
||||
}
|
||||
|
||||
int sceUtilityGamedataInstallAbort()
|
||||
{
|
||||
if (currentDialogType != UTILITY_DIALOG_GAMEDATAINSTALL)
|
||||
{
|
||||
WARN_LOG(SCEUTILITY, "sceUtilityMsgDialogShutdownStart(): wrong dialog type");
|
||||
return SCE_ERROR_UTILITY_WRONG_TYPE;
|
||||
}
|
||||
currentDialogActive = false;
|
||||
|
||||
DEBUG_LOG(SCEUTILITY, "sceUtilityGamedataInstallDialogAbort");
|
||||
return gamedataInstallDialog.Abort();
|
||||
}
|
||||
|
||||
//TODO: should save to config file
|
||||
@ -687,11 +737,11 @@ const HLEFunction sceUtility[] =
|
||||
{0x0D5BC6D2, 0, "sceUtilityLoadUsbModule"},
|
||||
{0xF64910F0, 0, "sceUtilityUnloadUsbModule"},
|
||||
|
||||
{0x24AC31EB, &WrapV_U<sceUtilityGamedataInstallInitStart>, "sceUtilityGamedataInstallInitStart"},
|
||||
{0x32E32DCB, 0, "sceUtilityGamedataInstallShutdownStart"},
|
||||
{0x4AECD179, 0, "sceUtilityGamedataInstallUpdate"},
|
||||
{0x24AC31EB, &WrapI_U<sceUtilityGamedataInstallInitStart>, "sceUtilityGamedataInstallInitStart"},
|
||||
{0x32E32DCB, &WrapI_V<sceUtilityGamedataInstallShutdownStart>, "sceUtilityGamedataInstallShutdownStart"},
|
||||
{0x4AECD179, &WrapI_I<sceUtilityGamedataInstallUpdate>, "sceUtilityGamedataInstallUpdate"},
|
||||
{0xB57E95D9, &WrapI_V<sceUtilityGamedataInstallGetStatus>, "sceUtilityGamedataInstallGetStatus"},
|
||||
{0x180F7B62, 0, "sceUtilityGamedataInstallAbort"},
|
||||
{0x180F7B62, &WrapI_V<sceUtilityGamedataInstallAbort>, "sceUtilityGamedataInstallAbort"},
|
||||
|
||||
{0x16D02AF0, 0, "sceUtilityNpSigninInitStart"},
|
||||
{0xE19C97D6, 0, "sceUtilityNpSigninShutdownStart"},
|
||||
|
@ -239,6 +239,7 @@ LOCAL_SRC_FILES := \
|
||||
$(SRC)/Core/Debugger/Breakpoints.cpp \
|
||||
$(SRC)/Core/Debugger/SymbolMap.cpp \
|
||||
$(SRC)/Core/Dialog/PSPDialog.cpp \
|
||||
$(SRC)/Core/Dialog/PSPGamedataInstallDialog.cpp \
|
||||
$(SRC)/Core/Dialog/PSPMsgDialog.cpp \
|
||||
$(SRC)/Core/Dialog/PSPOskDialog.cpp \
|
||||
$(SRC)/Core/Dialog/PSPPlaceholderDialog.cpp \
|
||||
|
Loading…
x
Reference in New Issue
Block a user