セーブデータのチェック用スレッドでスタックオーバーフローしないように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@439 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2011-09-30 09:12:14 +00:00
parent 992505fc50
commit 74ee219364
2 changed files with 26 additions and 1 deletions

View File

@ -26,7 +26,7 @@ namespace ConsoleBackup
namespace
{
const size_t CHECKER_STACK_SIZE = 0x1000;
const size_t CHECKER_STACK_SIZE = 0x4000;
nn::os::Thread s_CheckerThread;
nn::os::StackBuffer<CHECKER_STACK_SIZE> s_CheckerThreadStackSize;
nn::Result s_CheckerResult;

View File

@ -56,6 +56,29 @@ bool s_PlayedFailSound = false;
} // namespace <unnamed>
void PutAliveMessage(::std::vector<std::string>& operationMessage, const char* str)
{
std::string message = std::string(str);
static u8 i = 0;
if (i < 0xff / 4)
{
operationMessage.push_back(message + std::string(" /"));
}
else if (i < 0xff * 2 / 4)
{
operationMessage.push_back(message + std::string(" |"));
}
else if (i < 0xff * 3 / 4)
{
operationMessage.push_back(message + std::string(" \\"));
}
else
{
operationMessage.push_back(message + std::string(" -"));
}
i += 4;
}
bool NeedsAcAdapter(common::HardwareStateManager& manager)
{
return manager.IsBatteryLower() && !manager.IsAdapterConnected();
@ -164,6 +187,8 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
init = false;
}
PutAliveMessage(operationMessage, "Checking SaveData");
if (IsCheckSaveDataFinished())
{
FinalizeSaveDataCheck();