mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
parent
bf58112c1d
commit
ed257e9216
@ -619,8 +619,8 @@ bool ShowRtcSetterPrompt(void* time, const char *format, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
str_width = GetDrawStringWidth(str);
|
str_width = GetDrawStringWidth(str);
|
||||||
str_height = GetDrawStringHeight(str) + (3*10);
|
str_height = GetDrawStringHeight(str) + (4*10);
|
||||||
if (str_width < (17 * FONT_WIDTH)) str_width = 17 * FONT_WIDTH;
|
if (str_width < (19 * FONT_WIDTH)) str_width = 19 * FONT_WIDTH;
|
||||||
x = (str_width >= SCREEN_WIDTH_MAIN) ? 0 : (SCREEN_WIDTH_MAIN - str_width) / 2;
|
x = (str_width >= SCREEN_WIDTH_MAIN) ? 0 : (SCREEN_WIDTH_MAIN - str_width) / 2;
|
||||||
y = (str_height >= SCREEN_HEIGHT) ? 0 : (SCREEN_HEIGHT - str_height) / 2;
|
y = (str_height >= SCREEN_HEIGHT) ? 0 : (SCREEN_HEIGHT - str_height) / 2;
|
||||||
|
|
||||||
@ -630,14 +630,15 @@ bool ShowRtcSetterPrompt(void* time, const char *format, ...) {
|
|||||||
int cursor = 0;
|
int cursor = 0;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
static const int val_max[] = { 23, 59, 59, 31, 12, 99 };
|
static const int val_max[] = { 99, 12, 31, 23, 59, 59 };
|
||||||
static const int val_min[] = { 0, 0, 0, 1, 1, 0 };
|
static const int val_min[] = { 0, 1, 1, 0, 0, 0 };
|
||||||
u8* bcd = &(((u8*)dstime)[(cursor<3) ? (2-cursor) : (cursor+1)]);
|
u8* bcd = &(((u8*)dstime)[(cursor<3) ? (6-cursor) : (6-1-cursor)]);
|
||||||
int val = BCD2NUM(*bcd);
|
int val = BCD2NUM(*bcd);
|
||||||
int max = val_max[cursor];
|
int max = val_max[cursor];
|
||||||
int min = val_min[cursor];
|
int min = val_min[cursor];
|
||||||
DrawStringF(MAIN_SCREEN, x, y + str_height - 18, COLOR_STD_FONT, COLOR_STD_BG, "%02lX:%02lX:%02lX %02lX/%02lX/%02lX\n%-*.*s^^%-*.*s",
|
DrawStringF(MAIN_SCREEN, x, y + str_height - 28, COLOR_STD_FONT, COLOR_STD_BG, "YYYY-MM-DD hh:mm:ss");
|
||||||
(u32) dstime->bcd_h, (u32) dstime->bcd_m, (u32) dstime->bcd_s, (u32) dstime->bcd_D, (u32) dstime->bcd_M, (u32) dstime->bcd_Y,
|
DrawStringF(MAIN_SCREEN, x, y + str_height - 18, COLOR_STD_FONT, COLOR_STD_BG, "20%02lX-%02lX-%02lX %02lX:%02lX:%02lX\n %-*.*s^^%-*.*s",
|
||||||
|
(u32) dstime->bcd_Y, (u32) dstime->bcd_M, (u32) dstime->bcd_D, (u32) dstime->bcd_h, (u32) dstime->bcd_m, (u32) dstime->bcd_s,
|
||||||
cursor * 3, cursor * 3, "", 17 - 2 - (cursor * 3), 17 - 2 - (cursor * 3), "");
|
cursor * 3, cursor * 3, "", 17 - 2 - (cursor * 3), 17 - 2 - (cursor * 3), "");
|
||||||
|
|
||||||
// user input
|
// user input
|
||||||
|
@ -132,8 +132,8 @@ void GetTimeString(char* timestr, bool forced_update) {
|
|||||||
get_dstime(&dstime);
|
get_dstime(&dstime);
|
||||||
timer = timer_start();
|
timer = timer_start();
|
||||||
}
|
}
|
||||||
if (timestr) snprintf(timestr, 31, "%02lX/%02lX/%02lX %02lX:%02lX",
|
if (timestr) snprintf(timestr, 31, "20%02lX-%02lX-%02lX %02lX:%02lX",
|
||||||
(u32) dstime.bcd_D, (u32) dstime.bcd_M, (u32) dstime.bcd_Y, (u32) dstime.bcd_h, (u32) dstime.bcd_m);
|
(u32) dstime.bcd_Y, (u32) dstime.bcd_M, (u32) dstime.bcd_D, (u32) dstime.bcd_h, (u32) dstime.bcd_m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* clipboard, u32 curr_pane) {
|
void DrawUserInterface(const char* curr_path, DirEntry* curr_entry, DirStruct* clipboard, u32 curr_pane) {
|
||||||
@ -1480,7 +1480,7 @@ u32 HomeMoreMenu(char* current_path, DirStruct* current_dir, DirStruct* clipboar
|
|||||||
if (multi > 0) optionstr[multi - 1] = "Switch EmuNAND";
|
if (multi > 0) optionstr[multi - 1] = "Switch EmuNAND";
|
||||||
if (bsupport > 0) optionstr[bsupport - 1] = "Build support files";
|
if (bsupport > 0) optionstr[bsupport - 1] = "Build support files";
|
||||||
if (hsrestore > 0) optionstr[hsrestore - 1] = "Restore H&S";
|
if (hsrestore > 0) optionstr[hsrestore - 1] = "Restore H&S";
|
||||||
if (clock > 0) optionstr[clock - 1] = "Set RTC clock";
|
if (clock > 0) optionstr[clock - 1] = "Set RTC date&time";
|
||||||
if (scripts > 0) optionstr[scripts - 1] = "Scripts...";
|
if (scripts > 0) optionstr[scripts - 1] = "Scripts...";
|
||||||
|
|
||||||
int user_select = ShowSelectPrompt(n_opt, optionstr, promptstr);
|
int user_select = ShowSelectPrompt(n_opt, optionstr, promptstr);
|
||||||
@ -1565,11 +1565,11 @@ u32 HomeMoreMenu(char* current_path, DirStruct* current_dir, DirStruct* clipboar
|
|||||||
} else if (user_select == clock) { // RTC clock setter
|
} else if (user_select == clock) { // RTC clock setter
|
||||||
DsTime dstime;
|
DsTime dstime;
|
||||||
get_dstime(&dstime);
|
get_dstime(&dstime);
|
||||||
if (ShowRtcSetterPrompt(&dstime, "Set RTC time/date")) {
|
if (ShowRtcSetterPrompt(&dstime, "Set RTC date&time:")) {
|
||||||
char timestr[32];
|
char timestr[32];
|
||||||
set_dstime(&dstime);
|
set_dstime(&dstime);
|
||||||
GetTimeString(timestr, true);
|
GetTimeString(timestr, true);
|
||||||
ShowPrompt(false, "New RTC time/date is:\n%s\n \nHint: HOMEMENU time needs\nmanual adjustment after\nsetting the RTC.",
|
ShowPrompt(false, "New RTC date&time is:\n%s\n \nHint: HOMEMENU time needs\nmanual adjustment after\nsetting the RTC.",
|
||||||
timestr);
|
timestr);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user