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@439 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
992505fc50
commit
74ee219364
@ -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;
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user