From 1520ab7555a904be6ed64e12d0be6982bbb53ffa Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 2 Jul 2017 22:52:49 +0200 Subject: [PATCH 1/3] Update ISSUE_TEMPLATE.md 7.1 => 8.1 --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 3740a5f..cc21807 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -26,7 +26,7 @@ **Luma3DS version:** -[e.g. 7.1 stable or if using nightly/hourly specify the commit like this https://github.com/AuroraWright/Luma3DS/commit/9570e6cbeca53128433abbf5e3473cb8a07fe69e] +[e.g. 8.1 stable or if using nightly/hourly specify the commit like this https://github.com/AuroraWright/Luma3DS/commit/9570e6cbeca53128433abbf5e3473cb8a07fe69e] From 5d2a7315d55c6a914ab59263c894edefd654c667 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Mon, 3 Jul 2017 19:28:34 +0200 Subject: [PATCH 2/3] Fix SetWifiEnabled --- k11_extension/include/svc/SetWifiEnabled.h | 2 +- k11_extension/source/svc/SetWifiEnabled.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/k11_extension/include/svc/SetWifiEnabled.h b/k11_extension/include/svc/SetWifiEnabled.h index c7d31e1..ab5bdd5 100644 --- a/k11_extension/include/svc/SetWifiEnabled.h +++ b/k11_extension/include/svc/SetWifiEnabled.h @@ -30,4 +30,4 @@ #include "kernel.h" #include "svc.h" -void SetWifiEnabled(bool enable); +Result SetWifiEnabled(bool enable); diff --git a/k11_extension/source/svc/SetWifiEnabled.c b/k11_extension/source/svc/SetWifiEnabled.c index 59596d7..38ff0a2 100644 --- a/k11_extension/source/svc/SetWifiEnabled.c +++ b/k11_extension/source/svc/SetWifiEnabled.c @@ -26,10 +26,12 @@ #include "svc/SetWifiEnabled.h" -void SetWifiEnabled(bool enable) +Result SetWifiEnabled(bool enable) { if(enable) CFG11_WIFICNT |= 1; else CFG11_WIFICNT &= ~1; + + return 0; } From f2861058bac57468657da2199fadd9c01b848b71 Mon Sep 17 00:00:00 2001 From: LiquidFenrir Date: Tue, 4 Jul 2017 18:35:55 +0200 Subject: [PATCH 3/3] add wireless toggling in rosalina https://github.com/AuroraWright/Luma3DS/issues/619#issuecomment-309239178 ligne 353: CFG11_WIFICNT, nothing includes it in rosalina so I hardcoded it here ligne 363: could also use svc 0x5A (SetWifiEnabled) but not sure how --- sysmodules/rosalina/include/draw.h | 1 + .../rosalina/include/menus/miscellaneous.h | 1 + .../rosalina/source/menus/miscellaneous.c | 36 ++++++++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/sysmodules/rosalina/include/draw.h b/sysmodules/rosalina/include/draw.h index 24afccc..3ae0198 100644 --- a/sysmodules/rosalina/include/draw.h +++ b/sysmodules/rosalina/include/draw.h @@ -63,6 +63,7 @@ #define COLOR_TITLE RGB565(0x00, 0x26, 0x1F) #define COLOR_WHITE RGB565(0x1F, 0x3F, 0x1F) #define COLOR_RED RGB565(0x1F, 0x00, 0x00) +#define COLOR_GREEN RGB565(0x00, 0x1F, 0x00) #define COLOR_BLACK RGB565(0x00, 0x00, 0x00) #define DRAW_MAX_FORMATTED_STRING_SIZE 512 diff --git a/sysmodules/rosalina/include/menus/miscellaneous.h b/sysmodules/rosalina/include/menus/miscellaneous.h index f5bebb6..c628c65 100644 --- a/sysmodules/rosalina/include/menus/miscellaneous.h +++ b/sysmodules/rosalina/include/menus/miscellaneous.h @@ -35,5 +35,6 @@ void MiscellaneousMenu_SwitchBoot3dsxTargetTitle(void); void MiscellaneousMenu_ChangeMenuCombo(void); void MiscellaneousMenu_SaveSettings(void); void MiscellaneousMenu_InputRedirection(void); +void MiscellaneousMenu_ToggleWireless(void); void MiscellaneousMenu_PowerOff(void); void MiscellaneousMenu_Reboot(void); diff --git a/sysmodules/rosalina/source/menus/miscellaneous.c b/sysmodules/rosalina/source/menus/miscellaneous.c index 7073382..797046d 100644 --- a/sysmodules/rosalina/source/menus/miscellaneous.c +++ b/sysmodules/rosalina/source/menus/miscellaneous.c @@ -37,12 +37,13 @@ Menu miscellaneousMenu = { "Miscellaneous options menu", - .nbItems = 6, + .nbItems = 7, { { "Switch the hb. title to the current app.", METHOD, .method = &MiscellaneousMenu_SwitchBoot3dsxTargetTitle }, { "Change the menu combo", METHOD, .method = MiscellaneousMenu_ChangeMenuCombo }, { "Save settings", METHOD, .method = &MiscellaneousMenu_SaveSettings }, { "Start InputRedirection", METHOD, .method = &MiscellaneousMenu_InputRedirection }, + { "Toggle Wireless", METHOD, .method = &MiscellaneousMenu_ToggleWireless }, { "Power off", METHOD, .method = &MiscellaneousMenu_PowerOff }, { "Reboot", METHOD, .method = &MiscellaneousMenu_Reboot }, } @@ -335,6 +336,39 @@ void MiscellaneousMenu_InputRedirection(void) while(!(waitInput() & BUTTON_B) && !terminationRequest); } +void MiscellaneousMenu_ToggleWireless(void) +{ + Draw_Lock(); + Draw_ClearFramebuffer(); + Draw_FlushFramebuffer(); + Draw_Unlock(); + + do + { + Draw_Lock(); + Draw_DrawString(10, 10, COLOR_TITLE, "Miscellaneous options menu"); + Draw_DrawString(10, 30, COLOR_WHITE, "Press A to toggle, press B to go back."); + Draw_DrawString(10, 40, COLOR_WHITE, "Current status:"); + + u8 wireless = (*(vu8 *)((0x10140000 | (1u << 31)) + 0x180)); + Draw_DrawString(100, 40, (wireless ? COLOR_GREEN : COLOR_RED), (wireless ? " ON " : " OFF")); + Draw_FlushFramebuffer(); + Draw_Unlock(); + + u32 pressed = waitInputWithTimeout(1000); + + if(pressed & BUTTON_A) + { + nwmExtInit(); + NWMEXT_ControlWirelessEnabled(!wireless); + nwmExtExit(); + } + else if(pressed & BUTTON_B) + return; + } + while(!terminationRequest); +} + void MiscellaneousMenu_Reboot(void) { Draw_Lock();