mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
プレイ履歴を個別に書き戻して修理ツールの履歴を残さないように
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@24 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
ffe18679f3
commit
822ecb5fc0
@ -44,6 +44,7 @@
|
||||
#include "CommonLogger.h"
|
||||
#include "SDMountManager.h"
|
||||
#include "HeapManager.h"
|
||||
#include "PlayHistoryManager.h"
|
||||
|
||||
// svnリビジョン埋め込み用
|
||||
#include "version.h"
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "FileTransfer.h"
|
||||
#include "common_Types.h"
|
||||
#include "Aes_define.h"
|
||||
#include "PlayHistoryManager.h"
|
||||
|
||||
namespace ConsoleBackup
|
||||
{
|
||||
@ -443,6 +444,14 @@ void FinalizeExportThread()
|
||||
s_ExportThread.Finalize();
|
||||
}
|
||||
|
||||
void WritePlayHistory()
|
||||
{
|
||||
common::PlayHistoryManager historyManager;
|
||||
|
||||
COMMON_LOGGER("Export PlayHistory\n");
|
||||
historyManager.Export();
|
||||
}
|
||||
|
||||
void ExportData()
|
||||
{
|
||||
static bool init = true;
|
||||
@ -473,6 +482,9 @@ void ExportData()
|
||||
// TWLサウンド領域のデータをSDに書き出す
|
||||
WriteTwlSoundData();
|
||||
|
||||
// プレイ履歴をSDに書き出す
|
||||
WritePlayHistory();
|
||||
|
||||
// RTCをSDに書き出す
|
||||
WriteMcuRtcData();
|
||||
|
||||
|
||||
@ -40,6 +40,7 @@ SOURCES[] =
|
||||
../common/LogConsole.cpp
|
||||
../common/CommonLogger.cpp
|
||||
../common/SdMountManager.cpp
|
||||
../common/PlayHistoryManager.cpp
|
||||
|
||||
CTR_BANNER_SPEC = $(TARGET_PROGRAM).bsf
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ typedef enum RestoreState
|
||||
RESTORE_DONE, // 書き込み完了
|
||||
REBOOTING, // 再起動を行う
|
||||
ERASE, // 削除処理を行う
|
||||
HISTORY_RECOVER, // プレイ履歴の書き戻しを行う
|
||||
TIME_ADJUST, // 時計あわせを行う
|
||||
WAIT_SD_EJECT, // SDカードぬき待ち
|
||||
ALL_DONE, // すべて完了
|
||||
@ -505,10 +506,31 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
case ERASE:
|
||||
{
|
||||
Cleanup();
|
||||
s_RestoreState = TIME_ADJUST;
|
||||
s_RestoreState = HISTORY_RECOVER;
|
||||
}
|
||||
break;
|
||||
|
||||
// 削除処理
|
||||
case HISTORY_RECOVER:
|
||||
{
|
||||
static bool init = true;
|
||||
if (init)
|
||||
{
|
||||
// ptmのセーブデータ移行後に時計を無効化する
|
||||
nn::ptm::CTR::InvalidateSystemTime();
|
||||
|
||||
// ptmのセーブデータ移行後にプレイ履歴を移行する
|
||||
ImportPlayHistory();
|
||||
init = false;
|
||||
}
|
||||
|
||||
if(IsImportFinished())
|
||||
{
|
||||
s_RestoreState = TIME_ADJUST;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 時計あわせ
|
||||
case TIME_ADJUST:
|
||||
{
|
||||
@ -516,8 +538,6 @@ void ControlState(::std::vector<std::string>& operationMessage, bool& nextStep,
|
||||
if(init)
|
||||
{
|
||||
COMMON_LOGGER("Adjust Time\n");
|
||||
// ptmのセーブデータ移行後に時計を無効化する
|
||||
nn::ptm::CTR::InvalidateSystemTime();
|
||||
AdjustTime();
|
||||
init = false;
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
#include "common_Types.h"
|
||||
#include "Aes_define.h"
|
||||
#include "configLoader.h"
|
||||
#include "PlayHistoryManager.h"
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
@ -1172,6 +1173,19 @@ void ClearFileReadReslt()
|
||||
s_ReadSerialNumber = false;
|
||||
}
|
||||
|
||||
void ImportPlayHistoryThreadFunc()
|
||||
{
|
||||
common::PlayHistoryManager historyManager;
|
||||
|
||||
COMMON_LOGGER("Import PlayHistory\n");
|
||||
historyManager.Import();
|
||||
}
|
||||
|
||||
void ImportPlayHistory()
|
||||
{
|
||||
s_ImportThread.Start(ImportPlayHistoryThreadFunc, s_ImportThreadStack);
|
||||
}
|
||||
|
||||
void ImportData()
|
||||
{
|
||||
static bool init = true;
|
||||
|
||||
@ -66,6 +66,9 @@ void ImportMcuRtc();
|
||||
void InitializeFileSystem();
|
||||
|
||||
void ClearFileReadReslt();
|
||||
|
||||
// プレイ履歴を読み込みます。ptmのセーブデータ移行後に呼び出す必要があります
|
||||
void ImportPlayHistory();
|
||||
}
|
||||
|
||||
#endif /* IMPORTER_H_ */
|
||||
|
||||
@ -43,6 +43,7 @@ SOURCES[] =
|
||||
../common/CommonLogger.cpp
|
||||
../common/SdMountManager.cpp
|
||||
../common/configLoader.cpp
|
||||
../common/PlayHistoryManager.cpp
|
||||
|
||||
CTR_BANNER_SPEC = $(TARGET_PROGRAM).bsf
|
||||
|
||||
|
||||
@ -47,6 +47,8 @@ const wchar_t* const WRITE_FINISHED_PATHNAME = L"sdmc:/CTR_Console_Repair/WriteF
|
||||
const wchar_t* const UPDATE_CHECK_PATHNAME = L"sdmc:/CTR_Console_Repair/UpdateFinished";
|
||||
const wchar_t* const INITIALIZED_CHECK_PATHNAME = L"sdmc:/CTR_Console_Repair/ConsoleInitialized";
|
||||
const wchar_t* const RTC_SYNC_CHECK_PATHNAME = L"sdmc:/CTR_Console_Repair/RtcSyncFinished";
|
||||
const wchar_t* const PLAYHISTORY_PATHNAME = L"sdmc:/CTR_Console_Repair/playhistory.bin";
|
||||
const wchar_t* const PLAYHISTORY_COUNT_PATHNAME = L"sdmc:/CTR_Console_Repair/playhistoryCount.bin";
|
||||
|
||||
enum TWL_PATHNAME
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user