Fixes #5779 with new PSPScreenShotDiag class

This commit is contained in:
raven02 2014-04-28 21:54:52 +08:00
parent a5b27b659c
commit 8ed82f3d25
10 changed files with 148 additions and 32 deletions

View file

@ -981,6 +981,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/Dialog/PSPPlaceholderDialog.h
Core/Dialog/PSPSaveDialog.cpp
Core/Dialog/PSPSaveDialog.h
Core/Dialog/PSPScreenshotDialog.cpp
Core/Dialog/PSPScreenshotDialog.h
Core/Dialog/SavedataParam.cpp
Core/Dialog/SavedataParam.h
Core/ELF/ElfReader.cpp

View file

@ -9,6 +9,7 @@ set(SRCS
Dialog/PSPOskDialog.cpp
Dialog/PSPGamedataInstallDialog.cpp
Dialog/PSPNetconfDialog.cpp
Dialog/PSPScreenshotDialog.cpp
MIPS/MIPS.cpp
MIPS/MIPSAnalyst.cpp
MIPS/MIPSCodeUtils.cpp

View file

@ -183,6 +183,7 @@
<ClCompile Include="Dialog\PSPOskDialog.cpp" />
<ClCompile Include="Dialog\PSPPlaceholderDialog.cpp" />
<ClCompile Include="Dialog\PSPSaveDialog.cpp" />
<ClCompile Include="Dialog\PSPScreenshotDialog.cpp" />
<ClCompile Include="Dialog\SavedataParam.cpp" />
<ClCompile Include="ELF\ElfReader.cpp" />
<ClCompile Include="ELF\ParamSFO.cpp" />
@ -453,6 +454,7 @@
<ClInclude Include="Dialog\PSPOskDialog.h" />
<ClInclude Include="Dialog\PSPPlaceholderDialog.h" />
<ClInclude Include="Dialog\PSPSaveDialog.h" />
<ClInclude Include="Dialog\PSPScreenshotDialog.h" />
<ClInclude Include="Dialog\SavedataParam.h" />
<ClInclude Include="ELF\ElfReader.h" />
<ClInclude Include="ELF\ElfTypes.h" />
@ -636,4 +638,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -348,6 +348,9 @@
<ClCompile Include="Dialog\PSPOskDialog.cpp">
<Filter>Dialog</Filter>
</ClCompile>
<ClCompile Include="Dialog\PSPScreenshotDialog.cpp">
<Filter>Dialog</Filter>
</ClCompile>
<ClCompile Include="HW\SasAudio.cpp">
<Filter>HW</Filter>
</ClCompile>
@ -810,6 +813,9 @@
<ClInclude Include="Dialog\PSPOskDialog.h">
<Filter>Dialog</Filter>
</ClInclude>
<ClInclude Include="Dialog\PSPScreenshotDialog.h">
<Filter>Dialog</Filter>
</ClInclude>
<ClInclude Include="HW\SasAudio.h">
<Filter>HW</Filter>
</ClInclude>
@ -967,4 +973,4 @@
<None Include="..\android\jni\Android.mk" />
<None Include="GameLogNotes.txt" />
</ItemGroup>
</Project>
</Project>

View file

@ -33,35 +33,13 @@ int PSPPlaceholderDialog::Init()
int PSPPlaceholderDialog::Update(int animSpeed)
{
//__UtilityUpdate();
if (status == SCE_UTILITY_STATUS_INITIALIZE)
{
if (status == SCE_UTILITY_STATUS_INITIALIZE) {
status = SCE_UTILITY_STATUS_RUNNING;
}
else if (status == SCE_UTILITY_STATUS_RUNNING)
{
//Check with JPCSPTrace log of Dream Club Portable
//But break Project Divx extand and Kenka Banchou Bros when take screenshot
//They are not call sceUtilityScreenshotContStart;
//status = SCE_UTILITY_STATUS_SCREENSHOT_UNKNOWN;
} else if (status == SCE_UTILITY_STATUS_RUNNING) {
status = SCE_UTILITY_STATUS_FINISHED;
}
else if (status == SCE_UTILITY_STATUS_FINISHED)
{
} else if (status == SCE_UTILITY_STATUS_FINISHED) {
status = SCE_UTILITY_STATUS_SHUTDOWN;
}
return 0;
}
int PSPPlaceholderDialog::ContStart()
{
// base on JPCSP http://code.google.com/p/jpcsp/source/detail?r=3381
// be initialized with sceUtilityScreenshotInitStart and the startupType
// parameter has to be PSP_UTILITY_SCREENSHOT_TYPE_CONT_AUTO, otherwise, an
// error is returned.
if (status != SCE_UTILITY_STATUS_SCREENSHOT_UNKNOWN)
return SCE_ERROR_UTILITY_INVALID_STATUS;
// Check with JPCSPTrace log of Dream Club Portable
status = SCE_UTILITY_STATUS_FINISHED;
return 0;
}

View file

@ -26,7 +26,5 @@ public:
virtual int Init();
virtual int Update(int animSpeed);
virtual int ContStart();
};

View file

@ -0,0 +1,92 @@
// 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 "PSPScreenshotDialog.h"
#include "Core/MemMap.h"
#include "ChunkFile.h"
enum SceUtilityScreenshotType
{
SCE_UTILITY_SCREENSHOT_TYPE_GUI = 0,
SCE_UTILITY_SCREENSHOT_TYPE_AUTO = 1,
SCE_UTILITY_SCREENSHOT_TYPE_SAVE = 2,
SCE_UTILITY_SCREENSHOT_TYPE_VIEW = 3,
SCE_UTILITY_SCREENSHOT_TYPE_CONT_FINISH = 4,
SCE_UTILITY_SCREENSHOT_TYPE_CONT_AUTO = 5,
};
PSPScreenshotDialog::PSPScreenshotDialog() : PSPDialog() {
}
PSPScreenshotDialog::~PSPScreenshotDialog() {
}
int PSPScreenshotDialog::Init(int paramAddr)
{
// Already running
if (status != SCE_UTILITY_STATUS_NONE && status != SCE_UTILITY_STATUS_SHUTDOWN) {
return SCE_ERROR_UTILITY_INVALID_STATUS;
}
mode = Memory::Read_U32(paramAddr);
status = SCE_UTILITY_STATUS_INITIALIZE;
return 0;
}
int PSPScreenshotDialog::Update(int animSpeed)
{
PSPDialog::DialogStatus retval = status;
if (UseAutoStatus()) {
if (status == SCE_UTILITY_STATUS_INITIALIZE) {
status = SCE_UTILITY_STATUS_RUNNING;
} else if (status == SCE_UTILITY_STATUS_RUNNING) {
if ((mode & 0x7) == SCE_UTILITY_SCREENSHOT_TYPE_CONT_AUTO || (mode & 0x7) == SCE_UTILITY_SCREENSHOT_TYPE_CONT_FINISH) {
// When screenshot cont. mode is specified , sceUtilityScreenshotContStart will be called in next call.
status = SCE_UTILITY_STATUS_SCREENSHOT_UNKNOWN;
} else {
status = SCE_UTILITY_STATUS_FINISHED;
}
} else if (status == SCE_UTILITY_STATUS_FINISHED) {
status = SCE_UTILITY_STATUS_SHUTDOWN;
}
}
return retval;
}
int PSPScreenshotDialog::ContStart()
{
// Based on JPCSP http://code.google.com/p/jpcsp/source/detail?r=3381
if (status != SCE_UTILITY_STATUS_SCREENSHOT_UNKNOWN)
return SCE_ERROR_UTILITY_INVALID_STATUS;
// Check with JPCSPTrace log of Dream Club Portable
status = SCE_UTILITY_STATUS_FINISHED;
return 0;
}
void PSPScreenshotDialog::DoState(PointerWrap &p) {
PSPDialog::DoState(p);
auto s = p.Section("PSPScreenshotDialog", 0, 1);
if (!s)
return;
p.Do(mode);
}

View file

@ -0,0 +1,35 @@
// 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"
class PSPScreenshotDialog : public PSPDialog {
public:
PSPScreenshotDialog();
virtual ~PSPScreenshotDialog();
virtual int Init(int paramAddr);
virtual int Update(int animSpeed);
virtual int ContStart();
virtual void DoState(PointerWrap &p);
protected:
int mode;
};

View file

@ -39,6 +39,7 @@
#include "Core/Dialog/PSPOskDialog.h"
#include "Core/Dialog/PSPGamedataInstallDialog.h"
#include "Core/Dialog/PSPNetconfDialog.h"
#include "Core/Dialog/PSPScreenshotDialog.h"
#define PSP_AV_MODULE_AVCODEC 0
#define PSP_AV_MODULE_SASCORE 1
@ -74,7 +75,7 @@ static PSPSaveDialog saveDialog;
static PSPMsgDialog msgDialog;
static PSPOskDialog oskDialog;
static PSPNetconfDialog netDialog;
static PSPPlaceholderDialog screenshotDialog;
static PSPScreenshotDialog screenshotDialog;
static PSPGamedataInstallDialog gamedataInstallDialog;
static std::set<int> currentlyLoadedModules;
@ -444,7 +445,7 @@ u32 sceUtilityScreenshotInitStart(u32 paramAddr)
currentDialogType = UTILITY_DIALOG_SCREENSHOT;
currentDialogActive = true;
u32 retval = screenshotDialog.Init();
u32 retval = screenshotDialog.Init(paramAddr);
WARN_LOG_REPORT(SCEUTILITY, "%08x=sceUtilityScreenshotInitStart(%08x)", retval, paramAddr);
return retval;
}

View file

@ -191,6 +191,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Core/Dialog/PSPMsgDialog.cpp \
$(SRC)/Core/Dialog/PSPNetconfDialog.cpp \
$(SRC)/Core/Dialog/PSPOskDialog.cpp \
$(SRC)/Core/Dialog/PSPScreenshotDialog.cpp \
$(SRC)/Core/Dialog/PSPPlaceholderDialog.cpp \
$(SRC)/Core/Dialog/PSPSaveDialog.cpp \
$(SRC)/Core/Dialog/SavedataParam.cpp \