Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
1.1.2 small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
D3fau4 committed Dec 11, 2020
1 parent 909a050 commit 655060e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion NightFall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include $(DEVKITPRO)/libnx/switch_rules
TARGET := $(notdir $(CURDIR))
APP_TITLE := NightFall
APP_AUTHOR := D3fau4
APP_VERSION := 1.1.1
APP_VERSION := 1.1.2
ICON := resources/icon/NightFall.jpg
BUILD := build
SOURCES := source source/amssu source/sm source/spl source/hid source/FS source/net source/psm source/UI
Expand Down
2 changes: 1 addition & 1 deletion NightFall/include/spl/spl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ SOFTWARE.*/

namespace spl {
char *GetHardwareType(void);
bool HasRCMbug(void);
bool HasRCMbugPatched(void);
bool HasEmummc(void);
}
12 changes: 8 additions & 4 deletions NightFall/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ void CheckJson()
void CheckHardware()
{
/*Check if is Ipatched/Mariko */
if (spl::GetHardwareType() == "Mariko" || spl::HasRCMbug())
if (spl::GetHardwareType() == "Iowa" || spl::GetHardwareType() == "Hoag" || spl::GetHardwareType() == "Calcio" || spl::HasRCMbugPatched())
{
brls::Logger::error("The software was closed because only works in non-patched/mariko");
brls::Logger::error("Mariko or patched unit detected");
is_patched = true;
}
else
Expand All @@ -154,6 +154,7 @@ void CheckHardware()
{
brls::Logger::debug("Have Emummc");
HasEmummc = true;
is_patched = false;
}
else
{
Expand Down Expand Up @@ -250,12 +251,15 @@ int main(int argc, char *argv[])
onlineupdate = false;
}

brls::Logger::debug(j["Firmwver"].get<std::string>());
brls::Logger::debug(ver.display_version);

brls::ListItem *UpdateOnlineItem = new brls::ListItem("main/tabs/Firmware/update/title"_i18n.c_str(), firmwarever);
UpdateOnlineItem->getClickEvent()->subscribe([](brls::View *view) {
//download
brls::StagedAppletFrame *stagedFrame = new brls::StagedAppletFrame();
stagedFrame->setTitle("main/tabs/Firmware/update/title"_i18n.c_str());
if (onlineupdate == true && is_patched == false && HasEmummc == true && psm::GetBatteryState() > 15)
if (onlineupdate == true && is_patched == false && psm::GetBatteryState() >= 15)
{
Network::Net net = Network::Net();
std::string download = Conf["URL"].get<std::string>() + j["intfw"].get<std::string>();
Expand All @@ -272,7 +276,7 @@ int main(int argc, char *argv[])
{
stagedFrame->addStage(new UpToDate(stagedFrame, "main/tabs/Firmware/update/update_lowbattery"_i18n.c_str()));
}
if (is_patched == false)
else if (is_patched == false)
{
stagedFrame->addStage(new UpToDate(stagedFrame, "main/tabs/Firmware/update/update_uptodate"_i18n.c_str()));
}
Expand Down
20 changes: 14 additions & 6 deletions NightFall/source/spl/spl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,33 @@ namespace spl
Result ret = 0;
u64 hardware_type = 4;
char *hardware[] = {
"Icosa",
"Copper",
"Hoag",
"Mariko",
"Icosa", // Erista normal
"Copper", // Erista prototype
"Hoag", // Mariko lite
"Iowa", // Mariko retail
"Calcio", // Mariko prototype
"Unknown"};

if (R_FAILED(ret = splGetConfig(SplConfigItem_HardwareType, &hardware_type)))
{
return hardware[4];
}
else

return hardware[hardware_type];
}

bool HasRCMbug(void)
bool HasRCMbugPatched(void)
{
Result ret = 0;
u64 has_rcm_bug_patch;
if (R_SUCCEEDED(ret = splGetConfig(static_cast<SplConfigItem>(ExosphereHasRcmBugPatch), &has_rcm_bug_patch)))
{
return has_rcm_bug_patch;
}
else
{
return has_rcm_bug_patch;
}
}

bool HasEmummc(void)
Expand All @@ -66,5 +70,9 @@ namespace spl
{
return IsEmummc;
}
else
{
return IsEmummc;
}
}
} // namespace spl

0 comments on commit 655060e

Please sign in to comment.