7 Commits

Author SHA1 Message Date
24810a48ad Make sure that the buffer text is copied into is properly null-terminated 2017-09-29 21:56:44 -04:00
Dylan G
5d2119344a Getting ever closer to fixing the SMDH bug 2017-09-30 02:10:33 +01:00
Dylan G
492ea13ef6 Fixing a bad fix of mine '_>' 2017-09-30 02:00:00 +01:00
Helloman892
f99f744000 fixed theme extdata corruption when installing shuffle themes after
scanning a qr code
2017-09-16 17:48:47 +01:00
4fb10029bb Merge branch 'master' of github.com:3dsfug/Anemone3DS 2017-09-11 09:49:03 -04:00
7644974705 Add check for WiFi when scanning with QR code 2017-09-11 09:48:52 -04:00
Dylan G
b7379af2f3 added trello link 2017-09-10 14:57:26 +01:00
6 changed files with 31 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
![# Anemone3DS](https://github.com/astronautlevel2/Anemone3DS/blob/master/meta/banner.png) ![# Anemone3DS](https://github.com/astronautlevel2/Anemone3DS/blob/master/meta/banner.png)
A Theme and Splashscreen Manager for the Nintendo3DS, written in C. A Theme and Splashscreen Manager for the Nintendo 3DS, written in C.\
To-do list here: https://trello.com/b/F1YSa1VK
# Dependencies # Dependencies
* zlib, which can be retrieved from the [3ds_portlibs](https://github.com/devkitPro/3ds_portlibs). * zlib, which can be retrieved from the [3ds_portlibs](https://github.com/devkitPro/3ds_portlibs).

View File

@@ -48,6 +48,7 @@ static const int THEMES_PER_SCREEN = 4;
bool homebrew; bool homebrew;
bool splash_mode; bool splash_mode;
int shuffle_theme_count;
enum TextureID { enum TextureID {
TEXTURE_FONT_RESERVED = 0, //used by pp2d for the font TEXTURE_FONT_RESERVED = 0, //used by pp2d for the font

View File

@@ -30,9 +30,9 @@
#include "common.h" #include "common.h"
typedef struct { typedef struct {
u16 name[0x40]; u16 name[0x41];
u16 desc[0x80]; u16 desc[0x81];
u16 author[0x40]; u16 author[0x41];
u32 placeholder_color; u32 placeholder_color;
ssize_t icon_id; ssize_t icon_id;

View File

@@ -187,15 +187,15 @@ void draw_theme_interface(Theme_s * themes_list, int theme_count, int selected_t
{ {
draw_base_interface(); draw_base_interface();
pp2d_draw_text_center(GFX_TOP, 4, 0.5, 0.5, COLOR_WHITE, "Theme mode"); pp2d_draw_text_center(GFX_TOP, 4, 0.5, 0.5, COLOR_WHITE, "Theme mode");
wchar_t title[0x40] = {0}; wchar_t title[0x41] = {0};
utf16_to_utf32((u32*)title, current_theme.name, 0x40); utf16_to_utf32((u32*)title, current_theme.name, 0x40);
pp2d_draw_wtext_wrap(20, 30, 0.7, 0.7, COLOR_WHITE, 380, title); pp2d_draw_wtext_wrap(20, 30, 0.7, 0.7, COLOR_WHITE, 380, title);
wchar_t author[0x40] = {0}; wchar_t author[0x41] = {0};
utf16_to_utf32((u32*)author, current_theme.author, 0x40); utf16_to_utf32((u32*)author, current_theme.author, 0x40);
pp2d_draw_text(20, 50, 0.5, 0.5, COLOR_WHITE, "By: "); pp2d_draw_text(20, 50, 0.5, 0.5, COLOR_WHITE, "By: ");
pp2d_draw_wtext_wrap(44, 50, 0.5, 0.5, COLOR_WHITE, 380, author); pp2d_draw_wtext_wrap(44, 50, 0.5, 0.5, COLOR_WHITE, 380, author);
wchar_t description[0xa6] = {0}; wchar_t description[0x81] = {0};
utf16_to_utf32((u32*)description, current_theme.desc, 0xb0); utf16_to_utf32((u32*)description, current_theme.desc, 0x80);
pp2d_draw_wtext_wrap(20, 65, 0.5, 0.5, COLOR_WHITE, 363, description); 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(20, 150, 0.6, 0.6, COLOR_WHITE, L"\uE046 Install Shuffle Theme");

View File

@@ -39,6 +39,7 @@ int init_services(void)
{ {
cfguInit(); cfguInit();
ptmuInit(); ptmuInit();
acInit();
httpcInit(0); httpcInit(0);
archive_result = open_archives(); archive_result = open_archives();
homebrew = true; homebrew = true;
@@ -62,6 +63,7 @@ int exit_services(void)
cfguExit(); cfguExit();
ptmuExit(); ptmuExit();
httpcExit(); httpcExit();
acExit();
return 0; return 0;
} }
@@ -94,7 +96,7 @@ int main(void)
int selected_splash = 0; int selected_splash = 0;
int selected_theme = 0; int selected_theme = 0;
int previously_selected = 0; int previously_selected = 0;
int shuffle_theme_count = 0; shuffle_theme_count = 0;
bool preview_mode = false; bool preview_mode = false;
while(aptMainLoop()) while(aptMainLoop())
@@ -137,10 +139,18 @@ int main(void)
if (preview_mode) { if (preview_mode) {
continue; continue;
} else { } else {
u32 out;
ACU_GetWifiStatus(&out);
if (out)
{
qr_mode = !qr_mode; qr_mode = !qr_mode;
if (qr_mode) init_qr(); if (qr_mode) init_qr();
else exit_qr(); else exit_qr();
continue; continue;
} else {
throw_error("Please connect to Wi-Fi before scanning QR", WARNING);
continue;
}
} }
} }
@@ -200,7 +210,11 @@ int main(void)
draw_theme_install(SINGLE_INSTALL); draw_theme_install(SINGLE_INSTALL);
single_install(*current_theme); single_install(*current_theme);
} }
//these two are here just so I don't forget how to implement them - HM //these are here just so I don't forget how to implement them - HM
//if (current_theme->in_shuffle) {
// shuffle_theme_count--;
// current_theme->in_shuffle = false;
//}
//del_theme(current_theme->path); //del_theme(current_theme->path);
//get_themes(&themes_list, &theme_count); //get_themes(&themes_list, &theme_count);
} }

View File

@@ -152,6 +152,7 @@ static void parse_smdh(Theme_s *theme, ssize_t textureID, u16 *dir_name)
Result get_themes(Theme_s **themes_list, int *theme_count) Result get_themes(Theme_s **themes_list, int *theme_count)
{ {
shuffle_theme_count = 0;
Result res = 0; Result res = 0;
Handle dir_handle; Handle dir_handle;
res = FSUSER_OpenDirectory(&dir_handle, ArchiveSD, fsMakePath(PATH_ASCII, THEMES_PATH)); res = FSUSER_OpenDirectory(&dir_handle, ArchiveSD, fsMakePath(PATH_ASCII, THEMES_PATH));