Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
674fa9d9bf | ||
|
|
897dc52424 | ||
|
|
379cea8db1 | ||
|
|
e46783a3c4 | ||
|
|
3fd4548d64 | ||
|
|
34ede05b93 | ||
|
|
80b9aa9cdb | ||
|
|
33cce81914 | ||
|
|
424fffd35f | ||
|
|
5b067cfac0 | ||
|
|
539e95253c | ||
|
|
a77b29da92 | ||
|
|
dcac5401c1 | ||
|
|
1467b1f72b | ||
|
|
9199936215 | ||
|
|
91fa4fa412 | ||
|
|
1c6ae493d5 | ||
|
|
4eb969e84d | ||
|
|
70a40fae44 | ||
|
|
3d17509229 | ||
|
|
a38508c30f | ||
|
|
0ddb35d3d7 | ||
|
|
e03d150840 | ||
|
|
4607885fe6 | ||
|
|
d3a8f79958 | ||
|
|
a08c032ccc | ||
|
|
bdaa8b52cc | ||
|
|
8dc7f54f7e |
4
Makefile
@@ -53,7 +53,9 @@ CFLAGS := -g -Wall -Wextra -mword-relocations \
|
||||
-ffunction-sections \
|
||||
$(ARCH)
|
||||
|
||||
CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D_GNU_SOURCE
|
||||
revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/')
|
||||
|
||||
CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D_GNU_SOURCE -DVERSION="\"$(revision)\""
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ A Theme and Splashscreen Manager for the Nintendo3DS, written in C.
|
||||
* zlib, which can be retrieved from the [3ds_portlibs](https://github.com/devkitPro/3ds_portlibs).
|
||||
* [makerom](https://github.com/profi200/Project_CTR) and [bannertool](https://github.com/Steveice10/buildtools), which can be retrieved from [SteveIce10's](https://github.com/Steveice10) buildtools repo. These must be added to your PATH.
|
||||
* [pp2d](https://github.com/BernardoGiordano/pp2d), which is included in the repo if you do a git clone --recursive.
|
||||
* Git needs to be on your PATH, if building in a non-*nix environment.
|
||||
# Building
|
||||
First of all, make sure devkitPRO is properly installed and added to the PATH.
|
||||
After that, open the directory you want to clone the repo into, and type: `git clone https://github.com/astronautlevel2/Anemone3DS/ --recursive`.
|
||||
|
||||
@@ -40,7 +40,10 @@
|
||||
#define SHUFFLE_INSTALL 1
|
||||
#define BGM_INSTALL 2
|
||||
#define UNINSTALL 3
|
||||
#define DOWNLOADING 3
|
||||
|
||||
#define ERROR 0
|
||||
#define WARNING 1
|
||||
static const int THEMES_PER_SCREEN = 4;
|
||||
|
||||
enum TextureID {
|
||||
|
||||
@@ -37,8 +37,8 @@ void exit_screens(void);
|
||||
void draw_base_interface(void);
|
||||
void draw_qr(void);
|
||||
void draw_theme_install(int install_type);
|
||||
void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode);
|
||||
void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode, int shuffle_theme_count);
|
||||
void draw_splash_install(int install_type);
|
||||
void draw_splash_interface(Splash_s *splashes_list, int splash_count, int selected_splash, bool preview_mode);
|
||||
|
||||
void throw_error(char* error, int error_type);
|
||||
#endif
|
||||
@@ -39,7 +39,7 @@ Result close_archives(void);
|
||||
u64 file_to_buf(FS_Path path, FS_Archive archive, char** buf);
|
||||
u32 zip_file_to_buf(char *file_name, u16 *zip_path, char **buf);
|
||||
|
||||
u32 buf_to_file(u32 size, char *path, FS_Archive archive, char *buf);
|
||||
Result buf_to_file(u32 size, char *path, FS_Archive archive, char *buf);
|
||||
void remake_file(char *path, FS_Archive archive, u32 size);
|
||||
|
||||
#endif
|
||||
BIN
meta/banner.png
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
BIN
meta/icon.png
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
BIN
romfs/arrow.png
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 271 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 272 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 466 B |
@@ -96,7 +96,7 @@ Result http_get(char *url, char *path)
|
||||
ret = httpcSetKeepAlive(&context, HTTPC_KEEPALIVE_ENABLED);
|
||||
ret = httpcAddRequestHeaderField(&context, "User-Agent", "Anemone3DS/1.1.0");
|
||||
ret = httpcAddRequestHeaderField(&context, "Connection", "Keep-Alive");
|
||||
|
||||
draw_theme_install(DOWNLOADING);
|
||||
ret = httpcBeginRequest(&context);
|
||||
if (ret != 0)
|
||||
{
|
||||
@@ -158,9 +158,9 @@ Result http_get(char *url, char *path)
|
||||
filename = strtok(NULL, "\"");
|
||||
|
||||
char *illegal_characters = "\"?;:/\\+";
|
||||
for (ssize_t i = 0; i < strlen(filename); i++)
|
||||
for (size_t i = 0; i < strlen(filename); i++)
|
||||
{
|
||||
for (ssize_t n = 0; n < strlen(illegal_characters); n++)
|
||||
for (size_t n = 0; n < strlen(illegal_characters); n++)
|
||||
{
|
||||
if (filename[i] == illegal_characters[n])
|
||||
{
|
||||
|
||||
@@ -37,6 +37,8 @@ enum Colors {
|
||||
COLOR_WHITE = RGBA8(255, 255, 255, 255),
|
||||
COLOR_CURSOR = RGBA8(200, 200, 200, 255),
|
||||
COLOR_BLACK = RGBA8(0, 0, 0, 255),
|
||||
COLOR_RED = RGBA8(200, 0, 0, 255),
|
||||
COLOR_YELLOW = RGBA8(239, 220, 11, 255),
|
||||
};
|
||||
|
||||
void init_screens(void)
|
||||
@@ -139,22 +141,37 @@ void draw_base_interface(void)
|
||||
pp2d_draw_on(GFX_BOTTOM);
|
||||
pp2d_draw_rectangle(0, 0, 320, 24, COLOR_ACCENT);
|
||||
pp2d_draw_rectangle(0, 216, 320, 24, COLOR_ACCENT);
|
||||
pp2d_draw_text(7, 219, 0.6, 0.6, COLOR_WHITE, VERSION);
|
||||
pp2d_draw_on(GFX_TOP);
|
||||
}
|
||||
|
||||
void throw_error(char* error, int error_type) {
|
||||
draw_base_interface();
|
||||
switch (error_type) {
|
||||
case ERROR:
|
||||
pp2d_draw_text(70, 120, 0.8, 0.8, COLOR_RED, error);
|
||||
break;
|
||||
case WARNING:
|
||||
pp2d_draw_text(70, 120, 0.8, 0.8, COLOR_YELLOW, error);
|
||||
break;
|
||||
}
|
||||
pp2d_end_draw();
|
||||
}
|
||||
void draw_theme_install(int install_type)
|
||||
{
|
||||
draw_base_interface();
|
||||
switch(install_type)
|
||||
{
|
||||
case 0:
|
||||
pp2d_draw_text(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a single theme...");
|
||||
pp2d_draw_text_center(GFX_TOP, 120, 0.8, 0.8, COLOR_WHITE, "Installing a single theme...");
|
||||
break;
|
||||
case 1:
|
||||
pp2d_draw_text(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a shuffle theme...");
|
||||
pp2d_draw_text_center(GFX_TOP, 120, 0.8, 0.8, COLOR_WHITE, "Installing a shuffle theme...");
|
||||
break;
|
||||
case 2:
|
||||
pp2d_draw_text(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing BGM...");
|
||||
pp2d_draw_text_center(GFX_TOP, 120, 0.8, 0.8, COLOR_WHITE, "Installing BGM...");
|
||||
break;
|
||||
case 3:
|
||||
pp2d_draw_text_center(GFX_TOP, 120, 0.8, 0.8, COLOR_WHITE, "Downloading...");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -162,7 +179,7 @@ void draw_theme_install(int install_type)
|
||||
pp2d_end_draw();
|
||||
}
|
||||
|
||||
void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode)
|
||||
void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_theme, bool preview_mode, int shuffle_theme_count)
|
||||
{
|
||||
|
||||
if (themes_list == NULL)
|
||||
@@ -191,14 +208,14 @@ void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_t
|
||||
pp2d_draw_text_center(GFX_TOP, 4, 0.5, 0.5, COLOR_WHITE, "Theme mode");
|
||||
wchar_t title[0x40] = {0};
|
||||
utf16_to_utf32((u32*)title, current_theme.name, 0x40);
|
||||
pp2d_draw_wtext(20, 30, 0.7, 0.7, COLOR_WHITE, title);
|
||||
pp2d_draw_wtext_wrap(20, 30, 0.7, 0.7, COLOR_WHITE, 380, title);
|
||||
wchar_t author[0x40] = {0};
|
||||
utf16_to_utf32((u32*)author, current_theme.author, 0x40);
|
||||
pp2d_draw_text(20, 50, 0.5, 0.5, COLOR_WHITE, "By: ");
|
||||
pp2d_draw_wtext(44, 50, 0.5, 0.5, COLOR_WHITE, author);
|
||||
wchar_t description[0x80] = {0};
|
||||
utf16_to_utf32((u32*)description, current_theme.desc, 0x80);
|
||||
pp2d_draw_wtext(20, 65, 0.5, 0.5, COLOR_WHITE, description);
|
||||
pp2d_draw_wtext_wrap(44, 50, 0.5, 0.5, COLOR_WHITE, 380, author);
|
||||
wchar_t description[0xa6] = {0};
|
||||
utf16_to_utf32((u32*)description, current_theme.desc, 0xb0);
|
||||
pp2d_draw_wtext_wrap(20, 65, 0.5, 0.5, COLOR_WHITE, 363, description);
|
||||
|
||||
pp2d_draw_wtext(20, 150, 0.6, 0.6, COLOR_WHITE, L"\uE046 Install Shuffle Theme");
|
||||
pp2d_draw_wtext(200, 150, 0.6, 0.6, COLOR_WHITE, L"\uE004 Switch to Splashes");
|
||||
@@ -209,6 +226,8 @@ void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_t
|
||||
pp2d_draw_wtext(130, 120, 0.6, 0.6, COLOR_WHITE, L"\uE005 Scan QRCode");
|
||||
pp2d_draw_on(GFX_BOTTOM);
|
||||
|
||||
pp2d_draw_textf(7, 3, 0.6, 0.6, COLOR_WHITE, "Selected: %i/10", shuffle_theme_count);
|
||||
|
||||
// Scroll the menu up or down if the selected theme is out of its bounds
|
||||
//----------------------------------------------------------------
|
||||
for (int i = 0; i < theme_count; i++) {
|
||||
@@ -269,10 +288,10 @@ void draw_splash_install(int install_type)
|
||||
switch (install_type)
|
||||
{
|
||||
case SINGLE_INSTALL:
|
||||
pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Installing a splash...");
|
||||
pp2d_draw_text_center(GFX_TOP, 110, 0.7, 0.7, COLOR_WHITE, "Installing a splash...");
|
||||
break;
|
||||
case UNINSTALL:
|
||||
pp2d_draw_textf(20, 30, 0.7, 0.7, COLOR_WHITE, "Uninstalling a splash...");
|
||||
pp2d_draw_text_center(GFX_TOP, 110, 0.7, 0.7, COLOR_WHITE, "Uninstalling a splash...");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -151,17 +151,16 @@ u32 zip_file_to_buf(char *file_name, u16 *zip_path, char **buf)
|
||||
}
|
||||
}
|
||||
|
||||
u32 buf_to_file(u32 size, char *path, FS_Archive archive, char *buf)
|
||||
Result buf_to_file(u32 size, char *path, FS_Archive archive, char *buf)
|
||||
{
|
||||
Handle handle;
|
||||
u32 bytes = 0;
|
||||
Result res = FSUSER_OpenFile(&handle, archive, fsMakePath(PATH_ASCII, path), FS_OPEN_WRITE, 0);
|
||||
if (R_FAILED(res)) return res;
|
||||
res = FSFILE_Write(handle, &bytes, 0, buf, size, FS_WRITE_FLUSH);
|
||||
res = FSFILE_Write(handle, NULL, 0, buf, size, FS_WRITE_FLUSH);
|
||||
if (R_FAILED(res)) return res;
|
||||
res = FSFILE_Close(handle);
|
||||
if (R_FAILED(res)) return res;
|
||||
return bytes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void remake_file(char *path, FS_Archive archive, u32 size)
|
||||
|
||||
@@ -107,7 +107,7 @@ int main(void)
|
||||
draw_qr();
|
||||
} else if (!splash_mode)
|
||||
{
|
||||
draw_theme_interface(themes_list, theme_count, selected_theme, preview_mode);
|
||||
draw_theme_interface(themes_list, theme_count, selected_theme, preview_mode, shuffle_theme_count);
|
||||
} else {
|
||||
draw_splash_interface(splashes_list, splash_count, selected_splash, preview_mode);
|
||||
}
|
||||
@@ -217,6 +217,7 @@ int main(void)
|
||||
{
|
||||
draw_theme_install(SHUFFLE_INSTALL);
|
||||
shuffle_install(themes_list, theme_count);
|
||||
shuffle_theme_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -302,6 +303,32 @@ int main(void)
|
||||
selected_theme = 0;
|
||||
}
|
||||
}
|
||||
else if (kDown & KEY_CPAD_LEFT)
|
||||
{
|
||||
svcSleepThread(100000000);
|
||||
|
||||
if (splash_mode)
|
||||
{
|
||||
selected_splash -= 4;
|
||||
if (selected_splash < 0) selected_splash = 0;
|
||||
} else {
|
||||
selected_theme -= 4;
|
||||
if (selected_theme < 0) selected_theme = 0;
|
||||
}
|
||||
}
|
||||
else if (kDown & KEY_CPAD_RIGHT)
|
||||
{
|
||||
svcSleepThread(100000000);
|
||||
|
||||
if (splash_mode)
|
||||
{
|
||||
selected_splash += 4;
|
||||
if (selected_splash >= splash_count) selected_splash = splash_count-1;
|
||||
} else {
|
||||
selected_theme += 4;
|
||||
if (selected_theme >= theme_count) selected_theme = theme_count-1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!splash_mode && selected_theme != previously_selected)
|
||||
{
|
||||
|
||||
@@ -68,14 +68,14 @@ Result get_splashes(Splash_s** splashes_list, int *splash_count)
|
||||
u32 bytes = file_to_buf(fsMakePath(PATH_UTF16, top_path), ArchiveSD, &temp_buf);
|
||||
if (!bytes)
|
||||
{
|
||||
memset(top_path, 0, 0x106);
|
||||
memset(top_path, 0, 0x106 * sizeof(u16));
|
||||
}
|
||||
free(temp_buf);
|
||||
temp_buf = NULL;
|
||||
bytes = file_to_buf(fsMakePath(PATH_UTF16, bottom_path), ArchiveSD, &temp_buf);
|
||||
if (!bytes)
|
||||
{
|
||||
memset(bottom_path, 0, 0x106);
|
||||
memset(bottom_path, 0, 0x106 * sizeof(u16));
|
||||
}
|
||||
free(temp_buf);
|
||||
memcpy(current_splash->name, entry.name, 0x106);
|
||||
|
||||
@@ -230,9 +230,11 @@ Result bgm_install(Theme_s bgm_to_install)
|
||||
memset(&savedata_buf[0x13b8], 0, 8);
|
||||
savedata_buf[0x13bd] = 3;
|
||||
savedata_buf[0x13b8] = 0xff;
|
||||
u32 size = buf_to_file(savedata_size, "/SaveData.dat", ArchiveHomeExt, savedata_buf);
|
||||
Result result = buf_to_file(savedata_size, "/SaveData.dat", ArchiveHomeExt, savedata_buf);
|
||||
free(savedata_buf);
|
||||
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
if (bgm_to_install.is_zip) // Same as above but this time with bgm
|
||||
{
|
||||
music_size = zip_file_to_buf("bgm.bcstm", bgm_to_install.path, &music);
|
||||
@@ -245,7 +247,6 @@ Result bgm_install(Theme_s bgm_to_install)
|
||||
|
||||
if (music_size == 0)
|
||||
{
|
||||
free(music);
|
||||
music = calloc(1, 3371008);
|
||||
} else if (music_size > 3371008) {
|
||||
free(music);
|
||||
@@ -253,10 +254,10 @@ Result bgm_install(Theme_s bgm_to_install)
|
||||
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE);
|
||||
}
|
||||
|
||||
size = buf_to_file(music_size, "/BgmCache.bin", ArchiveThemeExt, music);
|
||||
result = buf_to_file(music_size == 0 ? 3371008 : music_size, "/BgmCache.bin", ArchiveThemeExt, music);
|
||||
free(music);
|
||||
|
||||
if (size == 0) return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
file_to_buf(fsMakePath(PATH_ASCII, "/ThemeManage.bin"), ArchiveThemeExt, &thememanage_buf);
|
||||
thememanage_buf[0x00] = 1;
|
||||
@@ -280,9 +281,11 @@ Result bgm_install(Theme_s bgm_to_install)
|
||||
memset(&thememanage_buf[0x340], 0, 4);
|
||||
memset(&thememanage_buf[0x360], 0, 4);
|
||||
memset(&thememanage_buf[0x368], 0, 4);
|
||||
size = buf_to_file(0x800, "/ThemeManage.bin", ArchiveThemeExt, thememanage_buf);
|
||||
result = buf_to_file(0x800, "/ThemeManage.bin", ArchiveThemeExt, thememanage_buf);
|
||||
free(thememanage_buf);
|
||||
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -302,9 +305,11 @@ Result single_install(Theme_s theme_to_install)
|
||||
memset(&savedata_buf[0x13b8], 0, 8);
|
||||
savedata_buf[0x13bd] = 3;
|
||||
savedata_buf[0x13b8] = 0xff;
|
||||
u32 size = buf_to_file(savedata_size, "/SaveData.dat", ArchiveHomeExt, savedata_buf);
|
||||
Result result = buf_to_file(savedata_size, "/SaveData.dat", ArchiveHomeExt, savedata_buf);
|
||||
free(savedata_buf);
|
||||
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
// Open body cache file. Test if theme is zipped
|
||||
if (theme_to_install.is_zip)
|
||||
{
|
||||
@@ -325,10 +330,10 @@ Result single_install(Theme_s theme_to_install)
|
||||
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
|
||||
}
|
||||
|
||||
size = buf_to_file(body_size, "/BodyCache.bin", ArchiveThemeExt, body); // Write body data to file
|
||||
result = buf_to_file(body_size, "/BodyCache.bin", ArchiveThemeExt, body); // Write body data to file
|
||||
free(body);
|
||||
|
||||
if (size == 0) return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
if (theme_to_install.is_zip) // Same as above but this time with bgm
|
||||
{
|
||||
@@ -342,7 +347,6 @@ Result single_install(Theme_s theme_to_install)
|
||||
|
||||
if (music_size == 0)
|
||||
{
|
||||
free(music);
|
||||
music = calloc(1, 3371008);
|
||||
} else if (music_size > 3371008) {
|
||||
free(music);
|
||||
@@ -350,10 +354,10 @@ Result single_install(Theme_s theme_to_install)
|
||||
return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE);
|
||||
}
|
||||
|
||||
size = buf_to_file(music_size, "/BgmCache.bin", ArchiveThemeExt, music);
|
||||
result = buf_to_file(music_size == 0 ? 3371008 : music_size, "/BgmCache.bin", ArchiveThemeExt, music);
|
||||
free(music);
|
||||
|
||||
if (size == 0) return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_NOT_FOUND);
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
file_to_buf(fsMakePath(PATH_ASCII, "/ThemeManage.bin"), ArchiveThemeExt, &thememanage_buf);
|
||||
thememanage_buf[0x00] = 1;
|
||||
@@ -379,9 +383,11 @@ Result single_install(Theme_s theme_to_install)
|
||||
memset(&thememanage_buf[0x340], 0, 4);
|
||||
memset(&thememanage_buf[0x360], 0, 4);
|
||||
memset(&thememanage_buf[0x368], 0, 4);
|
||||
size = buf_to_file(0x800, "/ThemeManage.bin", ArchiveThemeExt, thememanage_buf);
|
||||
result = buf_to_file(0x800, "/ThemeManage.bin", ArchiveThemeExt, thememanage_buf);
|
||||
free(thememanage_buf);
|
||||
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -393,10 +399,11 @@ Result shuffle_install(Theme_s *themes_list, int theme_count)
|
||||
u32 bgm_sizes[10] = {0};
|
||||
for (int i = 0; i < theme_count; i++)
|
||||
{
|
||||
if (count > 9) return MAKERESULT(RL_USAGE, RS_INVALIDARG, RM_COMMON, RD_INVALID_SELECTION);
|
||||
if (count > 10) return MAKERESULT(RL_USAGE, RS_INVALIDARG, RM_COMMON, RD_INVALID_SELECTION);
|
||||
if (themes_list[i].in_shuffle)
|
||||
{
|
||||
shuffle_themes[count++] = &themes_list[i];
|
||||
themes_list[i].in_shuffle = false;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < count; i++)
|
||||
@@ -426,9 +433,11 @@ Result shuffle_install(Theme_s *themes_list, int theme_count)
|
||||
}
|
||||
}
|
||||
|
||||
buf_to_file(size, "/SaveData.dat", ArchiveHomeExt, savedata_buf);
|
||||
Result result = buf_to_file(size, "/SaveData.dat", ArchiveHomeExt, savedata_buf);
|
||||
free(savedata_buf);
|
||||
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
remake_file("/BodyCache_rd.bin", ArchiveThemeExt, 0x150000 * 10); // Enough space for 10 theme files
|
||||
Handle body_cache_handle;
|
||||
FSUSER_OpenFile(&body_cache_handle, ArchiveThemeExt, fsMakePath(PATH_ASCII, "/BodyCache_rd.bin"), FS_OPEN_WRITE, 0);
|
||||
@@ -525,8 +534,10 @@ Result shuffle_install(Theme_s *themes_list, int theme_count)
|
||||
*bgmsizeloc = bgm_sizes[i];
|
||||
}
|
||||
|
||||
buf_to_file(0x800, "/ThemeManage.bin", ArchiveThemeExt, thememanage_buf);
|
||||
result = buf_to_file(0x800, "/ThemeManage.bin", ArchiveThemeExt, thememanage_buf);
|
||||
free(thememanage_buf);
|
||||
|
||||
if (!R_SUCCEEDED(result)) return result;
|
||||
|
||||
return MAKERESULT(RL_SUCCESS, RS_SUCCESS, RM_COMMON, RD_SUCCESS);
|
||||
}
|
||||
|
||||