diff --git a/retail/arm9/include/configuration.h b/retail/arm9/include/configuration.h index 66318acc6..5e7258cd1 100644 --- a/retail/arm9/include/configuration.h +++ b/retail/arm9/include/configuration.h @@ -37,8 +37,8 @@ typedef struct configuration { u32 apPatchSize; u32 cheatSize; u32 musicsSize; - u32 dataToPreloadAddr[2]; - u32 dataToPreloadSize[2]; + u32 dataToPreloadAddr[3]; + u32 dataToPreloadSize[3]; // u32 dataToPreloadFrame; u8 language; char* guiLanguage; diff --git a/retail/arm9/source/conf_sd.cpp b/retail/arm9/source/conf_sd.cpp index 78ca133ef..9617c9488 100644 --- a/retail/arm9/source/conf_sd.cpp +++ b/retail/arm9/source/conf_sd.cpp @@ -196,8 +196,8 @@ static void loadPreLoadSettings(configuration* conf, const char* pckPath, const } if (offset > 0) { - if (size > 0x10) { - size = 0x10; + if (size > 0x18) { + size = 0x18; } fseek(file, offset, SEEK_SET); u32 *buffer = new u32[size/4]; diff --git a/retail/arm9/source/nds_loader_arm9.c b/retail/arm9/source/nds_loader_arm9.c index 78f26f98b..e234c9afd 100644 --- a/retail/arm9/source/nds_loader_arm9.c +++ b/retail/arm9/source/nds_loader_arm9.c @@ -270,10 +270,10 @@ int runNds(u32 cluster, u32 saveCluster, u32 donorTwlCluster, /* u32 gbaCluster, loader->saveSize = conf->saveSize; // loader->gbaRomSize = conf->gbaRomSize; // loader->gbaSaveSize = conf->gbaSaveSize; - loader->dataToPreloadAddr[0] = conf->dataToPreloadAddr[0]; - loader->dataToPreloadSize[0] = conf->dataToPreloadSize[0]; - loader->dataToPreloadAddr[1] = conf->dataToPreloadAddr[1]; - loader->dataToPreloadSize[1] = conf->dataToPreloadSize[1]; + for (int i = 0; i < 3; i++) { + loader->dataToPreloadAddr[i] = conf->dataToPreloadAddr[i]; + loader->dataToPreloadSize[i] = conf->dataToPreloadSize[i]; + } loader->wideCheatFileCluster = wideCheatCluster; loader->wideCheatSize = conf->wideCheatSize; loader->apPatchFileCluster = apPatchCluster; diff --git a/retail/bootloader/source/arm7/load_crt0.s b/retail/bootloader/source/arm7/load_crt0.s index 11b7c43d2..97c3a428c 100644 --- a/retail/bootloader/source/arm7/load_crt0.s +++ b/retail/bootloader/source/arm7/load_crt0.s @@ -123,9 +123,11 @@ saveSize: dataToPreloadAddr: .word 0x00000000 .word 0x00000000 + .word 0x00000000 dataToPreloadSize: .word 0x00000000 .word 0x00000000 + .word 0x00000000 @dataToPreloadFrame: @ .word 0x00000000 wideCheatFileCluster: diff --git a/retail/bootloaderi/source/arm7/hook_arm9.c b/retail/bootloaderi/source/arm7/hook_arm9.c index 39fe4306c..2d272e48b 100644 --- a/retail/bootloaderi/source/arm7/hook_arm9.c +++ b/retail/bootloaderi/source/arm7/hook_arm9.c @@ -213,8 +213,8 @@ int hookNdsRetailArm9( extern u32 baseFatOff; extern u32 baseFatSize; extern u32 romPaddingSize; - extern u32 dataToPreloadAddr[2]; - extern u32 dataToPreloadSize[2]; + extern u32 dataToPreloadAddr[3]; + extern u32 dataToPreloadSize[3]; // extern u32 dataToPreloadFrame; extern bool romLocationAdjust(const tNDSHeader* ndsHeader, const bool laterSdk, const bool isSdk5, const bool dsiBios, u32* romLocation); extern u32 dataToPreloadFullSize(void); @@ -343,7 +343,7 @@ int hookNdsRetailArm9( romLocationAdjust(ndsHeader, laterSdk, (ce9->valueBits & b_isSdk5), (ce9->valueBits & b_dsiBios), &ce9->cacheAddress); ce9->cacheSlots--; } - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 3; i++) { ce9->romPartSrc[i] = dataToPreloadAddr[i]; ce9->romPartSize[i] = dataToPreloadSize[i]; } diff --git a/retail/bootloaderi/source/arm7/load_crt0.s b/retail/bootloaderi/source/arm7/load_crt0.s index 11b7c43d2..97c3a428c 100644 --- a/retail/bootloaderi/source/arm7/load_crt0.s +++ b/retail/bootloaderi/source/arm7/load_crt0.s @@ -123,9 +123,11 @@ saveSize: dataToPreloadAddr: .word 0x00000000 .word 0x00000000 + .word 0x00000000 dataToPreloadSize: .word 0x00000000 .word 0x00000000 + .word 0x00000000 @dataToPreloadFrame: @ .word 0x00000000 wideCheatFileCluster: diff --git a/retail/bootloaderi/source/arm7/main.arm7.c b/retail/bootloaderi/source/arm7/main.arm7.c index cf63832ae..8595b8ffe 100644 --- a/retail/bootloaderi/source/arm7/main.arm7.c +++ b/retail/bootloaderi/source/arm7/main.arm7.c @@ -105,8 +105,8 @@ extern u32 romSize; extern u32 saveSize; // extern u32 gbaRomSize; // extern u32 gbaSaveSize; -extern u32 dataToPreloadAddr[2]; -extern u32 dataToPreloadSize[2]; +extern u32 dataToPreloadAddr[3]; +extern u32 dataToPreloadSize[3]; // extern u32 dataToPreloadFrame; extern u32 wideCheatFileCluster; extern u32 wideCheatSize; @@ -1019,15 +1019,15 @@ static void my_readUserSettings(tNDSHeader* ndsHeader) { } u32 dataToPreloadFullSize(void) { - u32 dataToPreloadSizeAlign[2] = {dataToPreloadSize[0], dataToPreloadSize[1]}; - for (int i = 0; i < 2; i++) { + u32 dataToPreloadSizeAlign[3] = {dataToPreloadSize[0], dataToPreloadSize[1], dataToPreloadSize[2]}; + for (int i = 0; i < 3; i++) { if (!dataToPreloadSize[i]) break; while ((dataToPreloadSizeAlign[i] % 0x4000) != 0) { dataToPreloadSizeAlign[i]++; } } - return dataToPreloadSizeAlign[0] + dataToPreloadSizeAlign[1]; + return dataToPreloadSizeAlign[0] + dataToPreloadSizeAlign[1] + dataToPreloadSizeAlign[2]; } bool dataToPreloadFound(const tNDSHeader* ndsHeader) { @@ -1174,8 +1174,8 @@ static void buildRomMap(const tNDSHeader* ndsHeader, const module_params_t* modu // Load ROM into RAM const u32 romLocation = ROMinRAM ? getRomLocation(ndsHeader, !laterSdk, isSdk5(moduleParams), dsiBios) : getRomPartLocation(ndsHeader, !laterSdk, isSdk5(moduleParams), dsiBios); - u32 romOffset[2] = {(ROMinRAM ? 0 : dataToPreloadAddr[0]), (ROMinRAM ? 0 : dataToPreloadAddr[1])}; - s32 romSizeEdit[2] = {(ROMinRAM ? baseRomSize : dataToPreloadSize[0]), (ROMinRAM ? baseRomSize : dataToPreloadSize[1])}; + u32 romOffset[3] = {(ROMinRAM ? 0 : dataToPreloadAddr[0]), (ROMinRAM ? 0 : dataToPreloadAddr[1]), (ROMinRAM ? 0 : dataToPreloadAddr[2])}; + s32 romSizeEdit[3] = {(ROMinRAM ? baseRomSize : dataToPreloadSize[0]), (ROMinRAM ? baseRomSize : dataToPreloadSize[1]), (ROMinRAM ? baseRomSize : dataToPreloadSize[2])}; int iCount = 1; if (ROMinRAM) { if (usesCloneboot) { @@ -1206,6 +1206,9 @@ static void buildRomMap(const tNDSHeader* ndsHeader, const module_params_t* modu if (dataToPreloadSize[1]) { iCount++; } + if (dataToPreloadSize[2]) { + iCount++; + } } /* dbg_printf("romOffset[0]: "); diff --git a/retail/cardenginei/arm9/source/cardDma.thumb.c b/retail/cardenginei/arm9/source/cardDma.thumb.c index 9431315c3..23d56520d 100644 --- a/retail/cardenginei/arm9/source/cardDma.thumb.c +++ b/retail/cardenginei/arm9/source/cardDma.thumb.c @@ -383,7 +383,7 @@ void cardSetDma(u32 * params) { //int romPartNo = 0; if (!(ce9->valueBits & ROMinRAM)) { #ifndef TWLSDK - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 3; i++) { if (ce9->romPartSize[i] == 0) { break; } diff --git a/retail/cardenginei/arm9/source/card_engine_header.s b/retail/cardenginei/arm9/source/card_engine_header.s index 344ea3d6b..42878b184 100644 --- a/retail/cardenginei/arm9/source/card_engine_header.s +++ b/retail/cardenginei/arm9/source/card_engine_header.s @@ -65,9 +65,11 @@ cacheBlockSize: romPartSrc: .word 0x00000000 .word 0x00000000 + .word 0x00000000 romPartSize: .word 0x00000000 .word 0x00000000 + .word 0x00000000 #ifndef TWLSDK romMapLines: .word 0x00000000 diff --git a/retail/cardenginei/arm9/source/cardengine.c b/retail/cardenginei/arm9/source/cardengine.c index 19503fb9a..5b7ed29aa 100644 --- a/retail/cardenginei/arm9/source/cardengine.c +++ b/retail/cardenginei/arm9/source/cardengine.c @@ -837,7 +837,7 @@ void cardRead(u32* cacheStruct, u8* dst0, u32 src0, u32 len0) { //int romPartNo = 0; if (!(ce9->valueBits & ROMinRAM)) { #ifndef TWLSDK - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 3; i++) { if (ce9->romPartSize[i] == 0) { break; } diff --git a/retail/common/include/cardengine_header_arm9.h b/retail/common/include/cardengine_header_arm9.h index 88b91cb5c..3844e17a1 100644 --- a/retail/common/include/cardengine_header_arm9.h +++ b/retail/common/include/cardengine_header_arm9.h @@ -121,8 +121,8 @@ typedef struct cardengineArm9 { u32 cacheAddress; u16 cacheSlots; u16 cacheBlockSize; - u32 romPartSrc[2]; - u32 romPartSize[2]; + u32 romPartSrc[3]; + u32 romPartSize[3]; u32 romMapLines; u32 romMap[8][3]; // 0: ROM part start, 1: ROM part start in RAM, 2: ROM part end in RAM } cardengineArm9; diff --git a/retail/common/include/load_crt0.h b/retail/common/include/load_crt0.h index a4cfa0731..e79a67253 100644 --- a/retail/common/include/load_crt0.h +++ b/retail/common/include/load_crt0.h @@ -26,8 +26,8 @@ typedef struct loadCrt0 { u32 saveSize; // u32 gbaRomSize; // u32 gbaSaveSize; - u32 dataToPreloadAddr[2]; - u32 dataToPreloadSize[2]; + u32 dataToPreloadAddr[3]; + u32 dataToPreloadSize[3]; // u32 dataToPreloadFrame; u32 wideCheatFileCluster; u32 wideCheatSize; diff --git a/retail/preLoadSettings/Title list.txt b/retail/preLoadSettings/Title list.txt index bd6696b0e..9c8afc57c 100644 --- a/retail/preLoadSettings/Title list.txt +++ b/retail/preLoadSettings/Title list.txt @@ -112,6 +112,9 @@ Super Mario 64 DS (Europe) (ASMP) (DSi) Super Mario 64 DS (Japan) (ASMJ) (DSi) Super Mario 64 DS (Korea) (ASMK) (DSi) Shenyou Maliou DS (China) (ASMC) (DSi) +Tomodachi Collection (Japan) (CCUJ) (DSi/3DS) +Tomodachi Collection (Japan) (Rev 1) (CCUJ) (DSi/3DS) +Tomodachi Collection (English translation) (CCUJ-8554) (DSi/3DS) TrackMania DS (USA) (CTRE) (3DS) TrackMania DS (Europe) (CTRP) (3DS) TrackMania Turbo (USA) (B2TE) (3DS) @@ -219,5 +222,9 @@ Style Savvy (DSi/3DS): Super Mario 64 DS (DSi): - Everything except the level data +Tomodachi Collection (DSi/3DS): +- DSi: Most commonly used data: Cmn, Mdl, and Msg data +- 3DS: All commonly used data: Cmn, Mdl, Msg, Scn, and sound data (latter excluding credits music) + Yoshi Touch & Go (DSi): - Everything except the `area` folder diff --git a/retail/preLoadSettings/files-3ds/CCUJ-61DC.bin b/retail/preLoadSettings/files-3ds/CCUJ-61DC.bin new file mode 100644 index 000000000..5ce2e1bbe Binary files /dev/null and b/retail/preLoadSettings/files-3ds/CCUJ-61DC.bin differ diff --git a/retail/preLoadSettings/files-3ds/CCUJ-8554.bin b/retail/preLoadSettings/files-3ds/CCUJ-8554.bin new file mode 100644 index 000000000..47cf09313 Binary files /dev/null and b/retail/preLoadSettings/files-3ds/CCUJ-8554.bin differ diff --git a/retail/preLoadSettings/files-3ds/CCUJ-9B26.bin b/retail/preLoadSettings/files-3ds/CCUJ-9B26.bin new file mode 100644 index 000000000..47cf09313 Binary files /dev/null and b/retail/preLoadSettings/files-3ds/CCUJ-9B26.bin differ diff --git a/retail/preLoadSettings/files-dsi/CCUJ-61DC.bin b/retail/preLoadSettings/files-dsi/CCUJ-61DC.bin new file mode 100644 index 000000000..6d7d4ed62 Binary files /dev/null and b/retail/preLoadSettings/files-dsi/CCUJ-61DC.bin differ diff --git a/retail/preLoadSettings/files-dsi/CCUJ-8554.bin b/retail/preLoadSettings/files-dsi/CCUJ-8554.bin new file mode 100644 index 000000000..d85dcb0eb Binary files /dev/null and b/retail/preLoadSettings/files-dsi/CCUJ-8554.bin differ diff --git a/retail/preLoadSettings/files-dsi/CCUJ-9B26.bin b/retail/preLoadSettings/files-dsi/CCUJ-9B26.bin new file mode 100644 index 000000000..d85dcb0eb Binary files /dev/null and b/retail/preLoadSettings/files-dsi/CCUJ-9B26.bin differ