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@396 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
1103dd42a9
commit
73d360afce
@ -38,123 +38,124 @@
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const s32 s_GxHeapSize = 0x800000;
|
const s32 s_GxHeapSize = 0x800000;
|
||||||
uptr s_GxHeap;
|
uptr s_GxHeap;
|
||||||
|
|
||||||
demo::RenderSystemDrawing s_RenderSystem;
|
demo::RenderSystemDrawing s_RenderSystem;
|
||||||
ScrollBuffer s_scrollBufferInstance;
|
ScrollBuffer s_scrollBufferInstance;
|
||||||
ScrollBuffer *s_scrollBuffer;
|
ScrollBuffer *s_scrollBuffer;
|
||||||
|
|
||||||
char s_updaterBuffer[1<<20] NN_ATTRIBUTE_ALIGN(4096);
|
char s_updaterBuffer[1 << 20] NN_ATTRIBUTE_ALIGN(4096);
|
||||||
|
|
||||||
// デモの初期化
|
// デモの初期化
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
// NuiShellの初期化 (CUPに必須)
|
// NuiShellの初期化 (CUPに必須)
|
||||||
NN_UTIL_PANIC_IF_FAILED(nn::ns::CTR::InitializeForShell());
|
NN_UTIL_PANIC_IF_FAILED(nn::ns::CTR::InitializeForShell());
|
||||||
|
|
||||||
// ndmの初期化
|
// ndmの初期化
|
||||||
nn::ndm::Initialize();
|
nn::ndm::Initialize();
|
||||||
|
|
||||||
// 全デーモンの自律動作をacの自動接続も含めて止める
|
// 全デーモンの自律動作をacの自動接続も含めて止める
|
||||||
nn::ndm::SuspendScheduler();
|
nn::ndm::SuspendScheduler();
|
||||||
|
|
||||||
// amの初期化
|
// amの初期化
|
||||||
nn::am::InitializeForSystemMenu();
|
nn::am::InitializeForSystemMenu();
|
||||||
|
|
||||||
// fsの初期化 (カード確認用)
|
// fsの初期化 (カード確認用)
|
||||||
nn::fs::Initialize();
|
nn::fs::Initialize();
|
||||||
|
|
||||||
// appletの初期化
|
// appletの初期化
|
||||||
//nn::applet::InitializeForSystem( nn::applet::PHOME_MENU_APPLET_ID, nn::applet::TYPE_SYS );
|
//nn::applet::InitializeForSystem( nn::applet::PHOME_MENU_APPLET_ID, nn::applet::TYPE_SYS );
|
||||||
//nn::applet::Initialize( nn::applet::TEST2_APPLET_ID);
|
//nn::applet::Initialize( nn::applet::TEST2_APPLET_ID);
|
||||||
//nn::applet::SetAppletMode();
|
//nn::applet::SetAppletMode();
|
||||||
nn::applet::Enable();
|
nn::applet::Enable();
|
||||||
|
|
||||||
nn::cfg::Initialize();
|
nn::cfg::Initialize();
|
||||||
|
|
||||||
// デバイスメモリの設定
|
// デバイスメモリの設定
|
||||||
const s32 DEVICE_MEMORY_SIZE = 32 * 1024 * 1024;
|
const s32 DEVICE_MEMORY_SIZE = 32 * 1024 * 1024;
|
||||||
NN_UTIL_PANIC_IF_FAILED(nn::os::SetDeviceMemorySize(DEVICE_MEMORY_SIZE));
|
NN_UTIL_PANIC_IF_FAILED(nn::os::SetDeviceMemorySize(DEVICE_MEMORY_SIZE));
|
||||||
|
|
||||||
// ヒープの初期化
|
// ヒープの初期化
|
||||||
InitializeHeap();
|
InitializeHeap();
|
||||||
|
|
||||||
// 描画インスタンスの初期化
|
// 描画インスタンスの初期化
|
||||||
s_GxHeap = reinterpret_cast<uptr>(ForceAllocate(s_GxHeapSize));s_RenderSystem
|
s_GxHeap = reinterpret_cast<uptr>(ForceAllocate(s_GxHeapSize));
|
||||||
.Initialize(s_GxHeap, s_GxHeapSize);
|
s_RenderSystem.Initialize(s_GxHeap, s_GxHeapSize);
|
||||||
|
|
||||||
// 描画インスタンスの初期化
|
// 描画インスタンスの初期化
|
||||||
s_scrollBufferInstance.Initialize(&s_RenderSystem);
|
s_scrollBufferInstance.Initialize(&s_RenderSystem);
|
||||||
s_scrollBuffer=&s_scrollBufferInstance;
|
s_scrollBuffer = &s_scrollBufferInstance;
|
||||||
|
|
||||||
// GPU利用宣言
|
// GPU利用宣言
|
||||||
nn::applet::AssignGpuRight();
|
nn::applet::AssignGpuRight();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 消費時間取得用関数群
|
// 消費時間取得用関数群
|
||||||
s64 s_StartTick;
|
s64 s_StartTick;
|
||||||
void SetTick()
|
void SetTick()
|
||||||
{
|
{
|
||||||
s_StartTick=nn::os::Tick::GetSystemCurrent();
|
s_StartTick = nn::os::Tick::GetSystemCurrent();
|
||||||
}
|
}
|
||||||
s64 GetConsumedMillisec()
|
s64 GetConsumedMillisec()
|
||||||
{
|
{
|
||||||
s64 endTick=nn::os::Tick::GetSystemCurrent();
|
s64 endTick = nn::os::Tick::GetSystemCurrent();
|
||||||
nn::os::Tick consumed(endTick-s_StartTick);
|
nn::os::Tick consumed(endTick - s_StartTick);
|
||||||
return ((nn::fnd::TimeSpan)consumed).GetMilliSeconds();
|
return ((nn::fnd::TimeSpan) consumed).GetMilliSeconds();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 動いていることを知らせるための、くるくる画面表示取得用メソッド
|
// 動いていることを知らせるための、くるくる画面表示取得用メソッド
|
||||||
const char s_progress[]="-\\|/";
|
const char s_progress[] = "-\\|/";
|
||||||
s32 s_progressIndex = 0;
|
s32 s_progressIndex = 0;
|
||||||
char GetProgressChar()
|
char GetProgressChar()
|
||||||
{
|
{
|
||||||
s_progressIndex=(s_progressIndex+1)%(sizeof(s_progress)-1);
|
s_progressIndex = (s_progressIndex + 1) % (sizeof(s_progress) - 1);
|
||||||
return s_progress[s_progressIndex];
|
return s_progress[s_progressIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
nn::Result UpdateSequence(bool *isHandledError, bool* needUpdate)
|
nn::Result UpdateSequence(bool *isHandledError, bool* needUpdate)
|
||||||
{
|
{
|
||||||
nn::Result result;
|
nn::Result result;
|
||||||
nn::Result lastResult=nn::ResultSuccess();
|
nn::Result lastResult = nn::ResultSuccess();
|
||||||
|
|
||||||
/********************* CUPの初期化 *******************/
|
/********************* CUPの初期化 *******************/
|
||||||
s_scrollBuffer->AppendText("Initializing Cup Library")->Render();
|
s_scrollBuffer->AppendText("Initializing Cup Library")->Render();
|
||||||
SetTick(); // 初期化開始前の時間をセット
|
SetTick(); // 初期化開始前の時間をセット
|
||||||
result=nn::cup::CTR::Initialize(s_updaterBuffer,sizeof(s_updaterBuffer));
|
result = nn::cup::CTR::Initialize(s_updaterBuffer, sizeof(s_updaterBuffer));
|
||||||
if (result == nn::cup::CTR::ResultUpdatePartitionNotFound())
|
if (result == nn::cup::CTR::ResultUpdatePartitionNotFound())
|
||||||
{
|
{
|
||||||
s_scrollBuffer->AppendText(" - Update Partition Not Found (%lldmsec)", GetConsumedMillisec())->Render();
|
s_scrollBuffer->AppendText(" - Update Partition Not Found (%lldmsec)", GetConsumedMillisec())->Render();
|
||||||
s_scrollBuffer->AppendText("")->Render();
|
s_scrollBuffer->AppendText("")->Render();
|
||||||
*isHandledError=true;
|
*isHandledError = true;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (result == nn::cup::CTR::ResultUpdateNotRequired())
|
if (result == nn::cup::CTR::ResultUpdateNotRequired())
|
||||||
{
|
{
|
||||||
s_scrollBuffer->AppendText(" - Already Updated (%lldmsec)", GetConsumedMillisec())->Render();
|
s_scrollBuffer->AppendText(" - Already Updated (%lldmsec)", GetConsumedMillisec())->Render();
|
||||||
s_scrollBuffer->AppendText("")->Render();
|
s_scrollBuffer->AppendText("")->Render();
|
||||||
*isHandledError=true;
|
*isHandledError = true;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (result == nn::cup::CTR::ResultInvalidUpdatePartitionFormat())
|
if (result == nn::cup::CTR::ResultInvalidUpdatePartitionFormat())
|
||||||
{
|
{
|
||||||
s_scrollBuffer->AppendText(" - Invalid Update Partition (%lldmsec)", GetConsumedMillisec())->Render();
|
s_scrollBuffer->AppendText(" - Invalid Update Partition (%lldmsec)", GetConsumedMillisec())->Render();
|
||||||
s_scrollBuffer->AppendText("")->Render();
|
|
||||||
*isHandledError=true;
|
|
||||||
return result;
|
|
||||||
}NN_UTIL_RETURN_IF_FAILED(result);
|
|
||||||
|
|
||||||
s_scrollBuffer->AppendText(" - Need Update (%lldmsec)", GetConsumedMillisec())->Render();
|
|
||||||
*needUpdate = true;
|
|
||||||
s_scrollBuffer->AppendText("")->Render();
|
s_scrollBuffer->AppendText("")->Render();
|
||||||
|
*isHandledError = true;
|
||||||
// Initializeに成功した場合のみ、再びInitializeするためにFinalizeが必要
|
return result;
|
||||||
SetTick();
|
|
||||||
s_scrollBuffer->AppendText("Finalizing Cup Library")->Render();
|
|
||||||
NN_UTIL_RETURN_IF_FAILED(nn::cup::CTR::Finalize());
|
|
||||||
|
|
||||||
return lastResult;
|
|
||||||
}
|
}
|
||||||
|
NN_UTIL_RETURN_IF_FAILED(result);
|
||||||
|
|
||||||
|
s_scrollBuffer->AppendText(" - Need Update (%lldmsec)", GetConsumedMillisec())->Render();
|
||||||
|
*needUpdate = true;
|
||||||
|
s_scrollBuffer->AppendText("")->Render();
|
||||||
|
|
||||||
|
// Initializeに成功した場合のみ、再びInitializeするためにFinalizeが必要
|
||||||
|
SetTick();
|
||||||
|
s_scrollBuffer->AppendText("Finalizing Cup Library")->Render();
|
||||||
|
NN_UTIL_RETURN_IF_FAILED(nn::cup::CTR::Finalize());
|
||||||
|
|
||||||
|
return lastResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nn::Result ExecuteCup(ScrollBuffer* scrollBuf, bool* needUpdte)
|
nn::Result ExecuteCup(ScrollBuffer* scrollBuf, bool* needUpdte)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user