From f34a5f5512c28bfb75e7cc9b446cde2a8258bbff Mon Sep 17 00:00:00 2001 From: XorTroll Date: Sun, 20 Oct 2019 21:08:14 +0200 Subject: [PATCH] So many changes --- Common/Include/am/am_QCommunications.hpp | 3 +- Common/Include/q_Include.hpp | 4 + LibraryAppletQHbTarget/Makefile | 2 +- .../Include/ui/ui_MenuLayout.hpp | 12 +- LibraryAppletQMenu/Makefile | 2 +- LibraryAppletQMenu/RomFs/Logo.png | Bin 1974 -> 7531 bytes .../RomFs/default/ui/ToggleClick.png | Bin 5746 -> 4427 bytes LibraryAppletQMenu/Source/Main.cpp | 20 +-- .../Source/ui/ui_MenuLayout.cpp | 128 ++++++++++-------- .../Source/ui/ui_QMenuApplication.cpp | 7 +- LibraryAppletQMenu/Source/ui/ui_SideMenu.cpp | 2 +- Makefile | 2 + .../ViewerMainForm.Designer.cs | 11 +- SystemAppletQDaemon/Makefile | 2 +- SystemAppletQDaemon/Source/Main.cpp | 8 +- SystemApplicationQHbTarget/Makefile | 2 +- 16 files changed, 116 insertions(+), 89 deletions(-) diff --git a/Common/Include/am/am_QCommunications.hpp b/Common/Include/am/am_QCommunications.hpp index e9df108..06c2a5d 100644 --- a/Common/Include/am/am_QCommunications.hpp +++ b/Common/Include/am/am_QCommunications.hpp @@ -9,8 +9,7 @@ namespace am { Invalid, StartupScreen, - MenuNormal, - MenuHomebrewMode, + Menu, MenuApplicationSuspended, MenuLaunchFailure }; diff --git a/Common/Include/q_Include.hpp b/Common/Include/q_Include.hpp index 5730d9b..832b89d 100644 --- a/Common/Include/q_Include.hpp +++ b/Common/Include/q_Include.hpp @@ -27,6 +27,10 @@ using JSON = nlohmann::json; #define Q_ENTRIES_PATH Q_BASE_SD_DIR "/entries" #define Q_THEMES_PATH Q_BASE_SD_DIR "/themes" +#ifndef Q_VERSION +#error Project's version isn't defined. +#endif + // Thanks SciresM #define R_TRY(res_expr) \ ({ \ diff --git a/LibraryAppletQHbTarget/Makefile b/LibraryAppletQHbTarget/Makefile index 99afdab..a19bf6b 100644 --- a/LibraryAppletQHbTarget/Makefile +++ b/LibraryAppletQHbTarget/Makefile @@ -32,7 +32,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -Wl,-wrap,apmInitialize CFLAGS := -g -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) -CFLAGS += $(INCLUDE) -D__SWITCH__ +CFLAGS += $(INCLUDE) -D__SWITCH__ -DQ_VERSION=\"$(Q_VERSION)\" CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17 diff --git a/LibraryAppletQMenu/Include/ui/ui_MenuLayout.hpp b/LibraryAppletQMenu/Include/ui/ui_MenuLayout.hpp index 10b3c6f..40019ea 100644 --- a/LibraryAppletQMenu/Include/ui/ui_MenuLayout.hpp +++ b/LibraryAppletQMenu/Include/ui/ui_MenuLayout.hpp @@ -12,18 +12,22 @@ namespace ui class MenuLayout : public pu::ui::Layout { public: - MenuLayout(void *raw, u8 min_alpha, bool hb_mode); + MenuLayout(void *raw, u8 min_alpha); ~MenuLayout(); PU_SMART_CTOR(MenuLayout) void menu_Click(u64 down, u32 index); void menu_OnSelected(u32 index); - void toggle_Click(); + void menuToggle_Click(); + void logo_Click(); + void settings_Click(); + void themes_Click(); void MoveFolder(std::string name, bool fade); void OnInput(u64 down, u64 up, u64 held, pu::ui::Touch pos); bool HandleFolderChange(cfg::TitleRecord &rec); void HandleCloseSuspended(); + void HandleHomebrewLaunch(cfg::TitleRecord &rec); private: void *susptr; bool last_hasconn; @@ -35,13 +39,15 @@ namespace ui pu::ui::elm::TextBlock::Ref timeText; pu::ui::elm::TextBlock::Ref batteryText; pu::ui::elm::Image::Ref batteryIcon; + ClickableImage::Ref settings; + ClickableImage::Ref themes; SideMenu::Ref itemsMenu; RawData::Ref bgSuspendedRaw; pu::ui::elm::TextBlock::Ref itemName; pu::ui::elm::TextBlock::Ref itemAuthor; pu::ui::elm::TextBlock::Ref itemVersion; pu::ui::elm::Image::Ref bannerImage; - ClickableImage::Ref menuToggleClickable; + ClickableImage::Ref menuToggle; std::string curfolder; std::chrono::steady_clock::time_point tp; bool warnshown; diff --git a/LibraryAppletQMenu/Makefile b/LibraryAppletQMenu/Makefile index 0fc90af..592c20e 100644 --- a/LibraryAppletQMenu/Makefile +++ b/LibraryAppletQMenu/Makefile @@ -32,7 +32,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -Wl,-wrap,apmInitialize CFLAGS := -g -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) -CFLAGS += $(INCLUDE) -D__SWITCH__ +CFLAGS += $(INCLUDE) -D__SWITCH__ -DQ_VERSION=\"$(Q_VERSION)\" CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17 diff --git a/LibraryAppletQMenu/RomFs/Logo.png b/LibraryAppletQMenu/RomFs/Logo.png index 8ea5d0a425cc6fb206158c13b8a7b01d90994dc6..2058bbb9425fbf32c7c93fb6088aa5f3beaa9160 100644 GIT binary patch literal 7531 zcmc(EXHb*P_x7Ctq4$o2j`Siby#xdyfb<%wiu9sLZ%IH9Q0X8=2qlPs^xgxaA}Aec z3iwFx9RdOVJiqyU`_KF3op$!=x22eT3xpr+3yQn`<2Y{MHO2R{uYn%M3j`ec@py~ei12rdm zYykiifNQFo1=(-?rkpZ2sD@%@n})2f<_|s|Biata=UXZQs~S!a z9+R*hiJe49t(#P7I`)BJL(;fT%68Rbo5J;4qtQpRgQ<7)MqN^zbwcXCc$uFwiai6t zM8j@R`=yUto3O$k2+*gO4+*|Wy<;4P;-!*9GB;hnnfSHjpAg z74dFI_lZ1rGcOP>`#43*-VGp&hz&-4VS zQ~h#@!749}WCSSzi#@3ntoB8AYhtWLt=T9U+%iLyj!6a3`CKKHqn=`r(Hn1=mJ5lT z6}00+I~q^q@rk$tN&U!n&-(q1CrW(r+EQZfbj`D3EcV7=lv!9uT40qx$7^j({K!D; zS6v?AQ^DQ|PaA0yJnh>bci6Z?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BV)-PPpH!__%$vt)u0tWcLdsgYA ze@Uodc@w`$#v^brDCG?sWK9SQY-`pKWn>TyA1;v*h~K|ogxtPObmWNsGBb55(U~*s zM%j--__4vUSrY|LFqsB|yO{pw#Za%53RO;nR zozd*trBq6a&S(k>#EX}g>l2!a3Z3vowv#re5=PZVzbyThAJWrham@}&_QeZ{Y$8N^ z;)Dz`uuRjwy}n5UXXcFp*6@o?hY)!uo-Dy&H^8T6K1k3ev8Yy7ChJWjM#zd`e~T9S z24BDfV%6VqS6=k3hqAK`qOt#}E&w$UYg?xc#kopb$QR*FqP>ZR;!( z4yzhR6$@eu2DPHGF+0(~GsPtqL~p}R7%H1TvHuB9?R^5LgkABD-Z&ERm9QQ81HIU4 z#;5NA{B7*Ab0rqIFJU`|;$e{)dpLMIYs_zg$qgp*A;U#C_!Dd)`=GGx>22-4#g2FU z8;|c=6^vjDLt)t!v78BPgK^3Sh_n5{wuglV7CR4CupL8Tb0_wX^k>7s1#>%`3tx+d r7))01uXuPGgpKj9c-|*45h3~?!Qq>aI|EEK00000NkvXXu0mjf$DE*j diff --git a/LibraryAppletQMenu/RomFs/default/ui/ToggleClick.png b/LibraryAppletQMenu/RomFs/default/ui/ToggleClick.png index d9bf11e3ee34fc992e37f366960486738965e07b..fcb9998aec3c9c7067965628b576741d7271868e 100644 GIT binary patch delta 4407 zcmV-75y8Q#T6BmRa9JD z4gpt76ckt(4n+`103kp^LJk7CPuTbWx+fVXJ$KJcdiZ`-Z~E)b(cjGUzu))XcYky% z@)ag?9KVia8^qR+truG|TN+y!n?w?9)U)NV6|o&>JH)o1Z7VGrTFzVD(O1AGGsJl} z+Z49pY*MHai6ZRnZ0p%RV=+VIx}cAMO=fu7`E29aq-Z4)`#{WJvMpgDZxu(pz&ime z!ZopBE0IXt0|H*;jgUPPu+mh1nSbqGu`iKGykQmFlb$rK-50RQ4AH*H)<*10BoaNi zz&3|P3^BWm>jE~J5!=4XHdpLRBobe+l_(il}G{$GzcwfqTPg6x{5wgb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9)7SkSGWh%e85= z0ZrsI8QxmOQ3ciXtWNx(NYTnl%KH{HG};cJ=0$0ofQSj(P5Ww^>$AC_fnqy#qMn)( zFMy_#EogH&!)Z@jG}-{*H-FgQbzce(YR=nj+~DucIDP~T9IvPMRMAu7`G3CQ==Ki6 zwh9_7xB8ui#vegikhn3&F(y_7PXlbTUo`{%1r30mUVWa)i4uE;;s{VM(fg{^_fKkQ z+)NCVw4@uiVvsZ5Bta{1^pAc#4KG&}Gyqolvl2E;CuK*V5z*rO&irMLEUKq8S!>)J zK+3Zd`PIXmlj8-Yhi=Ah(|@%Gb*W=Hu1!vq@K$f!O9IQ~PV$p8?5eZutuxkC0tj~+Dm_BUUR771EmY6AashWZLepu|SP0S?sAg>_VkodTh2BlR?H z46wu?+(a|#9)kLW;WyzXTGU5-Amx{i>Ag?3uS+Wgt&klq%uC|O$5jc++psk>eh*3= zTO|b>fiiBeggz@CF@P ag7|-+CKRsfOAEaK0000Show(); else qapp->ShowWithFadeIn(); } - } - delete[] app_buf; - qmenu::Exit(); + delete[] app_buf; + qmenu::Exit(); + } return 0; } \ No newline at end of file diff --git a/LibraryAppletQMenu/Source/ui/ui_MenuLayout.cpp b/LibraryAppletQMenu/Source/ui/ui_MenuLayout.cpp index 6a94316..e2d50a9 100644 --- a/LibraryAppletQMenu/Source/ui/ui_MenuLayout.cpp +++ b/LibraryAppletQMenu/Source/ui/ui_MenuLayout.cpp @@ -14,7 +14,7 @@ extern cfg::ProcessedTheme theme; namespace ui { - MenuLayout::MenuLayout(void *raw, u8 min_alpha, bool hb_mode) + MenuLayout::MenuLayout(void *raw, u8 min_alpha) { this->susptr = raw; this->mode = 0; @@ -26,7 +26,7 @@ namespace ui this->last_charge = false; this->warnshown = false; this->minalpha = min_alpha; - this->homebrew_mode = hb_mode; + this->homebrew_mode = false; pu::ui::Color textclr = pu::ui::Color::FromHex(qapp->GetUIConfigValue("text_color", "#e1e1e1ff")); @@ -36,6 +36,9 @@ namespace ui this->topMenuImage = pu::ui::elm::Image::New(40, 35, cfg::ProcessedThemeResource(theme, "ui/TopMenu.png")); this->Add(this->topMenuImage); this->logo = ClickableImage::New(610, 13 + 35, "romfs:/Logo.png"); + this->logo->SetWidth(60); + this->logo->SetHeight(60); + this->logo->SetOnClick(std::bind(&MenuLayout::logo_Click, this)); this->Add(this->logo); this->connIcon = pu::ui::elm::Image::New(80, 53, cfg::ProcessedThemeResource(theme, "ui/NoConnectionIcon.png")); this->Add(this->connIcon); @@ -51,10 +54,18 @@ namespace ui this->batteryIcon = pu::ui::elm::Image::New(700, 80, cfg::ProcessedThemeResource(theme, "ui/BatteryNormalIcon.png")); this->Add(this->batteryIcon); - this->menuToggleClickable = ClickableImage::New(0, 200, cfg::ProcessedThemeResource(theme, "ui/ToggleClick.png")); - this->menuToggleClickable->SetOnClick(std::bind(&MenuLayout::toggle_Click, this)); - this->menuToggleClickable->SetHorizontalAlign(pu::ui::elm::HorizontalAlign::Center); - this->Add(this->menuToggleClickable); + this->settings = ClickableImage::New(880, 53, cfg::ProcessedThemeResource(theme, "ui/SettingsIcon.png")); + this->settings->SetOnClick(std::bind(&MenuLayout::settings_Click, this)); + this->Add(this->settings); + + this->themes = ClickableImage::New(950, 53, cfg::ProcessedThemeResource(theme, "ui/ThemesIcon.png")); + this->themes->SetOnClick(std::bind(&MenuLayout::themes_Click, this)); + this->Add(this->themes); + + this->menuToggle = ClickableImage::New(0, 200, cfg::ProcessedThemeResource(theme, "ui/ToggleClick.png")); + this->menuToggle->SetOnClick(std::bind(&MenuLayout::menuToggle_Click, this)); + this->menuToggle->SetHorizontalAlign(pu::ui::elm::HorizontalAlign::Center); + this->Add(this->menuToggle); this->bannerImage = pu::ui::elm::Image::New(0, 585, cfg::ProcessedThemeResource(theme, "ui/BannerInstalled.png")); this->Add(this->bannerImage); @@ -122,17 +133,7 @@ namespace ui if(this->homebrew_mode) { auto hb = homebrew[realidx]; - if(down & KEY_A) - { - am::QMenuCommandWriter writer(am::QDaemonMessage::LaunchHomebrewLibApplet); - writer.Write(hb.nro_target); - writer.FinishWrite(); - - pu::audio::Play(this->sfxTitleLaunch); - qapp->StopPlayBGM(); - qapp->CloseWithFadeOut(); - return; - } + if(down & KEY_A) this->HandleHomebrewLaunch(hb); else if(down & KEY_X) { auto sopt = qapp->CreateShowDialog("Add to menu", "Would you like to add this homebrew to the main menu?", { "Yes", "Cancel" }, true); @@ -158,42 +159,7 @@ namespace ui { if(!qapp->IsSuspended()) { - if((cfg::TitleType)title.title_type == cfg::TitleType::Homebrew) - { - int sopt = qapp->CreateShowDialog("Homebrew launch", "How would you like to launch this homebrew?\n\nNOTE: Launching as application might involve BAN RISK, so use it at your own risk!", { "Applet", "Application", "Cancel" }, true); - if(sopt == 0) - { - am::QMenuCommandWriter writer(am::QDaemonMessage::LaunchHomebrewLibApplet); - writer.Write(title.nro_target); - writer.FinishWrite(); - - pu::audio::Play(this->sfxTitleLaunch); - qapp->StopPlayBGM(); - qapp->CloseWithFadeOut(); - return; - } - else if(sopt == 1) - { - am::QMenuCommandWriter writer(am::QDaemonMessage::LaunchHomebrewApplication); - writer.Write(title.nro_target); - writer.FinishWrite(); - - am::QMenuCommandResultReader reader; - if(reader && R_SUCCEEDED(reader.GetReadResult())) - { - pu::audio::Play(this->sfxTitleLaunch); - qapp->StopPlayBGM(); - qapp->CloseWithFadeOut(); - return; - } - else - { - auto rc = reader.GetReadResult(); - qapp->CreateShowDialog("Title launch", "An error ocurred attempting to launch the title:\n" + util::FormatResultDisplay(rc) + " (" + util::FormatResultHex(rc) + ")", { "Ok" }, true); - } - reader.FinishRead(); - } - } + if((cfg::TitleType)title.title_type == cfg::TitleType::Homebrew) this->HandleHomebrewLaunch(title); else { am::QMenuCommandWriter writer(am::QDaemonMessage::LaunchApplication); @@ -321,7 +287,7 @@ namespace ui { auto foldr = list.folders[realidx - folder.titles.size()]; this->bannerImage->SetImage(cfg::ProcessedThemeResource(theme, "ui/BannerFolder.png")); - this->itemAuthor->SetVisible(false); + this->itemAuthor->SetText(std::to_string(foldr.titles.size()) + " entries"); this->itemVersion->SetVisible(false); this->itemName->SetText(foldr.name); } @@ -561,13 +527,28 @@ namespace ui } } - void MenuLayout::toggle_Click() + void MenuLayout::menuToggle_Click() { pu::audio::Play(this->sfxMenuToggle); this->homebrew_mode = !this->homebrew_mode; this->MoveFolder("", true); } + void MenuLayout::logo_Click() + { + qapp->CreateShowDialog("About {qlaunch-reimpl}", "{qlaunch-reimpl} v" + std::string(Q_VERSION) + "\n\n- Custom, open source, fully-featured HOME menu replacement.", { "Ok" }, true, "romfs:/Logo.png"); + } + + void MenuLayout::settings_Click() + { + qapp->CreateShowDialog("Settings", "Settings", {"Ok"}, true); + } + + void MenuLayout::themes_Click() + { + qapp->CreateShowDialog("Themes", "Themes", {"Ok"}, true); + } + bool MenuLayout::HandleFolderChange(cfg::TitleRecord &rec) { bool changedone = false; @@ -609,4 +590,41 @@ namespace ui this->bgSuspendedRaw->SetAlphaFactor(0); } } + + void MenuLayout::HandleHomebrewLaunch(cfg::TitleRecord &rec) + { + int sopt = qapp->CreateShowDialog("Homebrew launch", "How would you like to launch this homebrew?\n\nNOTE: Launching as application might involve BAN RISK, so use it at your own risk!", { "Applet", "Application", "Cancel" }, true); + if(sopt == 0) + { + am::QMenuCommandWriter writer(am::QDaemonMessage::LaunchHomebrewLibApplet); + writer.Write(rec.nro_target); + writer.FinishWrite(); + + pu::audio::Play(this->sfxTitleLaunch); + qapp->StopPlayBGM(); + qapp->CloseWithFadeOut(); + return; + } + else if(sopt == 1) + { + am::QMenuCommandWriter writer(am::QDaemonMessage::LaunchHomebrewApplication); + writer.Write(rec.nro_target); + writer.FinishWrite(); + + am::QMenuCommandResultReader reader; + if(reader && R_SUCCEEDED(reader.GetReadResult())) + { + pu::audio::Play(this->sfxTitleLaunch); + qapp->StopPlayBGM(); + qapp->CloseWithFadeOut(); + return; + } + else + { + auto rc = reader.GetReadResult(); + qapp->CreateShowDialog("Title launch", "An error ocurred attempting to launch the title:\n" + util::FormatResultDisplay(rc) + " (" + util::FormatResultHex(rc) + ")", { "Ok" }, true); + } + reader.FinishRead(); + } + } } \ No newline at end of file diff --git a/LibraryAppletQMenu/Source/ui/ui_QMenuApplication.cpp b/LibraryAppletQMenu/Source/ui/ui_QMenuApplication.cpp index 8c3aa13..ce59468 100644 --- a/LibraryAppletQMenu/Source/ui/ui_QMenuApplication.cpp +++ b/LibraryAppletQMenu/Source/ui/ui_QMenuApplication.cpp @@ -38,14 +38,11 @@ namespace ui this->bgm = pu::audio::Open(cfg::ProcessedThemeResource(theme, "sound/BGM.mp3")); this->startupLayout = StartupLayout::New(); - bool hb = false; - if(this->stmode == am::QMenuStartMode::MenuHomebrewMode) hb = true; - this->menuLayout = MenuLayout::New(app_buf, 80, hb); + this->menuLayout = MenuLayout::New(app_buf, 80); switch(this->stmode) { - case am::QMenuStartMode::MenuNormal: - case am::QMenuStartMode::MenuHomebrewMode: + case am::QMenuStartMode::Menu: case am::QMenuStartMode::MenuApplicationSuspended: case am::QMenuStartMode::MenuLaunchFailure: this->LoadMenu(); diff --git a/LibraryAppletQMenu/Source/ui/ui_SideMenu.cpp b/LibraryAppletQMenu/Source/ui/ui_SideMenu.cpp index a0b64c9..68ccad7 100644 --- a/LibraryAppletQMenu/Source/ui/ui_SideMenu.cpp +++ b/LibraryAppletQMenu/Source/ui/ui_SideMenu.cpp @@ -107,7 +107,7 @@ namespace ui { for(u32 i = 0; i < this->ricons.size(); i++) { - if((Touch.X >= basex) && (Touch.X < (basex + ItemSize)) && (Touch.Y >= basey) && (Touch.Y < (basey + ItemSize))) + if((Touch.X >= basex) && (Touch.X < (basex + (s32)ItemSize)) && (Touch.Y >= basey) && (Touch.Y < (basey + (s32)ItemSize))) { if((this->baseiconidx + i) == selitm) (this->onselect)(KEY_A, this->selitm); else diff --git a/Makefile b/Makefile index 6db4ac7..1ba9a8d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ +export Q_VERSION := dev + .PHONY: all clean all: diff --git a/QForegroundViewer/QForegroundViewer/ViewerMainForm.Designer.cs b/QForegroundViewer/QForegroundViewer/ViewerMainForm.Designer.cs index f3e5003..771803d 100644 --- a/QForegroundViewer/QForegroundViewer/ViewerMainForm.Designer.cs +++ b/QForegroundViewer/QForegroundViewer/ViewerMainForm.Designer.cs @@ -38,16 +38,19 @@ // CaptureBox // this.CaptureBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.CaptureBox.Location = new System.Drawing.Point(12, 12); + this.CaptureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.CaptureBox.Location = new System.Drawing.Point(0, 0); + this.CaptureBox.Margin = new System.Windows.Forms.Padding(0); this.CaptureBox.Name = "CaptureBox"; - this.CaptureBox.Size = new System.Drawing.Size(1280, 720); + this.CaptureBox.Size = new System.Drawing.Size(812, 331); + this.CaptureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.CaptureBox.TabIndex = 0; this.CaptureBox.TabStop = false; // // groupBox1 // this.groupBox1.Controls.Add(this.ScreenshotButton); - this.groupBox1.Location = new System.Drawing.Point(1305, 12); + this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(200, 282); this.groupBox1.TabIndex = 1; @@ -68,7 +71,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1517, 741); + this.ClientSize = new System.Drawing.Size(812, 331); this.Controls.Add(this.groupBox1); this.Controls.Add(this.CaptureBox); this.Name = "ViewerMainForm"; diff --git a/SystemAppletQDaemon/Makefile b/SystemAppletQDaemon/Makefile index 82f43d3..4ff1ad9 100644 --- a/SystemAppletQDaemon/Makefile +++ b/SystemAppletQDaemon/Makefile @@ -32,7 +32,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -Wl,-wrap,apmInitialize CFLAGS := -g -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) -CFLAGS += $(INCLUDE) -D__SWITCH__ +CFLAGS += $(INCLUDE) -D__SWITCH__ -DQ_VERSION=\"$(Q_VERSION)\" CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17 diff --git a/SystemAppletQDaemon/Source/Main.cpp b/SystemAppletQDaemon/Source/Main.cpp index f41dd12..dc3d307 100644 --- a/SystemAppletQDaemon/Source/Main.cpp +++ b/SystemAppletQDaemon/Source/Main.cpp @@ -78,7 +78,7 @@ void HandleHomeButton() if(am::LibraryAppletIsActive() && !am::LibraryAppletIsQMenu()) { am::LibraryAppletTerminate(); - am::QDaemon_LaunchQMenu(am::QMenuStartMode::MenuHomebrewMode); + am::QDaemon_LaunchQMenu(am::QMenuStartMode::Menu); return; } if(am::ApplicationIsActive()) @@ -340,7 +340,7 @@ namespace qdaemon void ForegroundMain(void *arg) { - u8 *demo = new u8[1280 * 720 * 4](); + u8 *demo = new (std::align_val_t(0x1000)) u8[1280 * 720 * 4](); usbCommsInitialize(); while(true) @@ -446,10 +446,8 @@ int main() switch(am::LibraryAppletGetId()) { case am::QHbTargetAppletId: - am::QDaemon_LaunchQMenu(am::QMenuStartMode::MenuHomebrewMode); - break; case AppletId_web: - am::QDaemon_LaunchQMenu(am::QMenuStartMode::MenuNormal); + am::QDaemon_LaunchQMenu(am::QMenuStartMode::Menu); break; default: break; diff --git a/SystemApplicationQHbTarget/Makefile b/SystemApplicationQHbTarget/Makefile index 99afdab..a19bf6b 100644 --- a/SystemApplicationQHbTarget/Makefile +++ b/SystemApplicationQHbTarget/Makefile @@ -32,7 +32,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -Wl,-wrap,apmInitialize CFLAGS := -g -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) -CFLAGS += $(INCLUDE) -D__SWITCH__ +CFLAGS += $(INCLUDE) -D__SWITCH__ -DQ_VERSION=\"$(Q_VERSION)\" CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17