Skip to content

Commit

Permalink
Fix N3DS issue + add EULA version setting (credits to @SciresM)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryuzaki-MrL committed Mar 26, 2017
1 parent fec319a commit aacbde5
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Current Features:
- Clear game notes: clear all of your game notes.
- Replace eShop BGM: replaces the current eShop music with a custom one.
- Restore eShop BGM: restores the default current eShop music.
- Change accepted EULA version: useful for allowing out-of-region online play (when set to FF.FF).

Future Features:
- Misc. features seen on dev unit software.
Expand Down
2 changes: 1 addition & 1 deletion make_all.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
make
makerom -f cia -rsf meta/Cthulhu.rsf -elf Cthulhu.elf -icon meta/Cthulhu.icn -banner meta/Cthulhu.bnr -logo meta/logo.bcma.lz -o Cthulhu.cia
makerom -f cia -rsf meta/Cthulhu.rsf -elf CacheTool.elf -icon meta/Cthulhu.icn -banner meta/Cthulhu.bnr -logo meta/logo.bcma.lz -o Cthulhu.cia
2 changes: 1 addition & 1 deletion meta/Cthulhu.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ AccessControlInfo:
SpecialMemoryArrange : true

# New3DS Exclusive Process Settings
SystemModeExt : 178MB # Legacy(Default)/124MB/178MB Legacy:Use Old3DS SystemMode
SystemModeExt : Legacy # Legacy(Default)/124MB/178MB Legacy:Use Old3DS SystemMode
CpuSpeed : 804MHz # 256MHz(Default)/804MHz
EnableL2Cache : true # false(default)/true
CanAccessCore2 : false
Expand Down
8 changes: 8 additions & 0 deletions meta/Cthulhu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<targets selectable="false">
<title mediatype="0">0004001000020000</title>
<title mediatype="0">0004001000021000</title>
<title mediatype="0">0004001000022000</title>
<title mediatype="0">0004001000026000</title>
<title mediatype="0">0004001000027000</title>
<title mediatype="0">0004001000028000</title>
</targets>
52 changes: 49 additions & 3 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define MAX_OPTIONS_PER_SUBMENU 10

#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_MINOR 3
#define VERSION_MICRO 0

bool dobackup = true;
Expand Down Expand Up @@ -1271,6 +1271,50 @@ void replaceEShopBGM() {
waitKey();
}

void changeAcceptedEULAVersion() {
Result res;
u8 eulaData[4];
u8 index = 0;
res = CFGU_GetConfigInfoBlk2(4, 0xD0000, eulaData);

printf("Fetching EULA data... %s %#lx.\n", R_FAILED(res) ? "ERROR" : "OK", res);
if (R_FAILED(res)) {
promptError("Change Accepted EULA Version", "Failed to get EULA data.");
return;
}
consoleClear();

while(aptMainLoop()) {
printf("\x1b[0;0HPress LEFT, RIGHT or SELECT to select byte.\n");
printf("Press UP or DOWN to modify selected byte.\n");
printf("Press X for 0x0000 and Y for 0xFFFF.\n");
printf("Press A or B to save and return.\n\n");
printf("Current accepted EULA version: \x1b[%sm%02X\x1b[0m.\x1b[%sm%02X\x1b[0m\n", (index==1) ? "30;47" : "0", eulaData[1], (index==0) ? "30;47" : "0", eulaData[0]);

hidScanInput();
u32 kDown = hidKeysDown();

if (kDown & KEY_LEFT || kDown & KEY_RIGHT || kDown & KEY_SELECT) index ^= 1;
if (kDown & KEY_UP) eulaData[index]--;
if (kDown & KEY_DOWN) eulaData[index]++;

if (kDown & KEY_Y) *((u16*)eulaData) = 0xFFFF;
if (kDown & KEY_X) *((u16*)eulaData) = 0x0000;

if ((kDown & KEY_A || kDown & KEY_B) && promptConfirm("Change Accepted EULA Version", "Exit now?")) {
if (promptConfirm("Change Accepted EULA Version", "Save Changes?")) {
res = CFG_SetConfigInfoBlk8(4, 0xD0000, eulaData);
printf("Setting new EULA version... %s %#lx.\n", R_FAILED(res) ? "ERROR" : "OK", res);
res = CFG_UpdateConfigNANDSavegame();
printf("Updating Config savegame... %s %#lx.\n", R_FAILED(res) ? "ERROR" : "OK", res);
} break;
}
}

printf("Press any key to continue.\n");
waitKey();
}

void goBerserk() {
if (!promptConfirm("Go Berserk and Clear Everything", "CLEAR ALL LOGS AND CACHED ICON DATA?")) return;
if (!promptConfirm("Go Berserk and Clear Everything", "ARE YOU REALLY SURE?")) return;
Expand Down Expand Up @@ -1311,7 +1355,7 @@ int main() {
hidScanInput();
u32 kHeld = hidKeysHeld();

u8 menucount[SUBMENU_COUNT] = {6, 4, 3, 4, 4, 5, 3};
u8 menucount[SUBMENU_COUNT] = {6, 4, 3, 4, 4, 5, 4};
const char* menuentries[SUBMENU_COUNT][MAX_OPTIONS_PER_SUBMENU] =
{
{
Expand Down Expand Up @@ -1356,7 +1400,8 @@ int main() {
{
"Clear Game Notes.",
"Reset eShop BGM.",
"Replace eShop BGM."
"Replace eShop BGM.",
"Change accepted EULA version."
}
};

Expand Down Expand Up @@ -1426,6 +1471,7 @@ int main() {
case 60: if (promptConfirm("Clear Game Notes", "Delete all of your game notes?")) clearGameNotes(); break;
case 61: if (promptConfirm("Reset eShop BGM", "Restore the original Nintendo eShop music?")) resetEShopBGM(); break;
case 62: if (promptConfirm("Replace eShop BGM", "Replace the current Nintendo eShop music?")) replaceEShopBGM(); break;
case 63: consoleClear(); changeAcceptedEULAVersion(); break;

default: consoleClear(); submenu = 0; break;
}
Expand Down

0 comments on commit aacbde5

Please sign in to comment.