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@711 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
7261f7d155
commit
028bc99c35
@ -53,6 +53,7 @@ namespace {
|
|||||||
const char* const NAND_TWL_ARCHIVE_NAME = "twln:";
|
const char* const NAND_TWL_ARCHIVE_NAME = "twln:";
|
||||||
const char* const NAND_TWL_KENJ_SAVE_DATA_PATHNAME = "twln:/title/00030004/4b454e4a/data/Public.sav";
|
const char* const NAND_TWL_KENJ_SAVE_DATA_PATHNAME = "twln:/title/00030004/4b454e4a/data/Public.sav";
|
||||||
const nn::ProgramId NAND_TWL_KENJ_PROGRAM_ID = 0x000480044b454e4aULL;
|
const nn::ProgramId NAND_TWL_KENJ_PROGRAM_ID = 0x000480044b454e4aULL;
|
||||||
|
const nn::ProgramId NAND_TWL_KCVJ_PROGRAM_ID = 0x000480044B43564AULL;
|
||||||
|
|
||||||
// 乱数生成クラス
|
// 乱数生成クラス
|
||||||
// 線形合同法を用いて乱数を生成する。
|
// 線形合同法を用いて乱数を生成する。
|
||||||
@ -89,6 +90,7 @@ namespace {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nn::Result DeleteKENJ(void);
|
nn::Result DeleteKENJ(void);
|
||||||
|
bool KCVJExists();
|
||||||
|
|
||||||
const size_t ERASE_THREAD_STACK_SIZE = 0x1000;
|
const size_t ERASE_THREAD_STACK_SIZE = 0x1000;
|
||||||
nn::os::Thread s_EraseThread;
|
nn::os::Thread s_EraseThread;
|
||||||
@ -101,6 +103,7 @@ namespace {
|
|||||||
bool s_IsSaveDataCleanSuccess = false;
|
bool s_IsSaveDataCleanSuccess = false;
|
||||||
bool s_IsAppDeleteSuccess = false;
|
bool s_IsAppDeleteSuccess = false;
|
||||||
bool s_IsCreditCardExist = false;
|
bool s_IsCreditCardExist = false;
|
||||||
|
bool s_IsKCVJExist = false;
|
||||||
nn::Result s_KENJResult = nn::ResultSuccess();
|
nn::Result s_KENJResult = nn::ResultSuccess();
|
||||||
nn::Result s_CreditCardResult = nn::ResultSuccess();
|
nn::Result s_CreditCardResult = nn::ResultSuccess();
|
||||||
|
|
||||||
@ -125,6 +128,10 @@ namespace {
|
|||||||
s_IsCreditCardExist = true;
|
s_IsCreditCardExist = true;
|
||||||
s_CreditCardResult = nn::nim::Shop::DeleteCreditCardOnSystemSaveData();
|
s_CreditCardResult = nn::nim::Shop::DeleteCreditCardOnSystemSaveData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 洞窟物語(KCVJ)の存在を確認する
|
||||||
|
s_IsKCVJExist = KCVJExists();
|
||||||
|
|
||||||
s_IsFinish = true;
|
s_IsFinish = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,6 +239,20 @@ namespace {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool KCVJExists()
|
||||||
|
{
|
||||||
|
// アプリが存在するかどうか確かめる
|
||||||
|
nn::am::ProgramInfo info;
|
||||||
|
nn::Result result = nn::am::GetProgramInfos(&info, nn::fs::MEDIA_TYPE_NAND, &NAND_TWL_KCVJ_PROGRAM_ID, 1);
|
||||||
|
if(result == nn::am::ResultNotFound())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DrawResultText()
|
void DrawResultText()
|
||||||
{
|
{
|
||||||
@ -243,6 +264,7 @@ namespace {
|
|||||||
s_RenderSystem.DrawText(10.0f, 60.0f, "Initialcode : KENJ");
|
s_RenderSystem.DrawText(10.0f, 60.0f, "Initialcode : KENJ");
|
||||||
|
|
||||||
s_RenderSystem.DrawText(10.0f, 180.0f, "Credit Card :");
|
s_RenderSystem.DrawText(10.0f, 180.0f, "Credit Card :");
|
||||||
|
s_RenderSystem.DrawText(10.0f, 200.0f, "KCVJ :");
|
||||||
|
|
||||||
if( s_KENJResult.IsSuccess() )
|
if( s_KENJResult.IsSuccess() )
|
||||||
{
|
{
|
||||||
@ -336,12 +358,24 @@ namespace {
|
|||||||
s_RenderSystem.DrawText(130.0f, 180.0f, "data not found");
|
s_RenderSystem.DrawText(130.0f, 180.0f, "data not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(s_IsKCVJExist)
|
||||||
|
{
|
||||||
|
s_RenderSystem.SetColor( RED );
|
||||||
|
s_RenderSystem.DrawText(130.0f, 200.0f, "application found");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s_RenderSystem.SetColor( YELLOW );
|
||||||
|
s_RenderSystem.DrawText(130.0f, 200.0f, "application not found");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawKENJResultUpper(const f32 red, const f32 green, const f32 blue)
|
void DrawKENJResultUpper(const f32 red, const f32 green, const f32 blue)
|
||||||
{
|
{
|
||||||
s_RenderSystem.SetColor(red, green, blue);
|
s_RenderSystem.SetColor(red, green, blue);
|
||||||
s_RenderSystem.FillRectangle(0, 0, NN_GX_DISPLAY0_HEIGHT, NN_GX_DISPLAY0_WIDTH / 2);
|
s_RenderSystem.FillRectangle(0, 0, NN_GX_DISPLAY0_HEIGHT, NN_GX_DISPLAY0_WIDTH / 3);
|
||||||
s_RenderSystem.SetColor(BLACK);
|
s_RenderSystem.SetColor(BLACK);
|
||||||
s_RenderSystem.DrawText(0, 0, "KENJ Result");
|
s_RenderSystem.DrawText(0, 0, "KENJ Result");
|
||||||
}
|
}
|
||||||
@ -349,9 +383,17 @@ namespace {
|
|||||||
void DrawCreditCardResultUpper(const f32 red, const f32 green, const f32 blue)
|
void DrawCreditCardResultUpper(const f32 red, const f32 green, const f32 blue)
|
||||||
{
|
{
|
||||||
s_RenderSystem.SetColor(red, green, blue);
|
s_RenderSystem.SetColor(red, green, blue);
|
||||||
s_RenderSystem.FillRectangle(0, NN_GX_DISPLAY0_WIDTH / 2, NN_GX_DISPLAY0_HEIGHT, NN_GX_DISPLAY0_WIDTH / 2);
|
s_RenderSystem.FillRectangle(0, NN_GX_DISPLAY0_WIDTH / 3, NN_GX_DISPLAY0_HEIGHT, NN_GX_DISPLAY0_WIDTH / 3);
|
||||||
s_RenderSystem.SetColor(BLACK);
|
s_RenderSystem.SetColor(BLACK);
|
||||||
s_RenderSystem.DrawText(0, NN_GX_DISPLAY0_WIDTH / 2, "Credit Card Result");
|
s_RenderSystem.DrawText(0, NN_GX_DISPLAY0_WIDTH / 3, "Credit Card Result");
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrawKCVJResultUpper(const f32 red, const f32 green, const f32 blue)
|
||||||
|
{
|
||||||
|
s_RenderSystem.SetColor(red, green, blue);
|
||||||
|
s_RenderSystem.FillRectangle(0, NN_GX_DISPLAY0_WIDTH / 3 * 2, NN_GX_DISPLAY0_HEIGHT, NN_GX_DISPLAY0_WIDTH / 3);
|
||||||
|
s_RenderSystem.SetColor(BLACK);
|
||||||
|
s_RenderSystem.DrawText(0, NN_GX_DISPLAY0_WIDTH / 3 * 2, "KCVJ Result");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -442,6 +484,16 @@ extern "C" void nnMain(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 洞窟物語の結果
|
||||||
|
if(s_IsKCVJExist)
|
||||||
|
{
|
||||||
|
DrawKCVJResultUpper(RED);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DrawKCVJResultUpper(YELLOW);
|
||||||
|
}
|
||||||
|
|
||||||
// バッファへ
|
// バッファへ
|
||||||
s_RenderSystem.SwapBuffers();
|
s_RenderSystem.SwapBuffers();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user