Skip to content

Commit b5bcd20

Browse files
committed
enforce high memory install mode, map nsz file types
1 parent 6c7b26c commit b5bcd20

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Goldleaf/Source/nsp/nsp_Installer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
extern set::Settings gsets;
3434

35+
3536
namespace nsp
3637
{
3738
Installer::Installer(pu::String Path, fs::Explorer *Exp, Storage Location) : nspentry(Exp, Path), storage(static_cast<FsStorageId>(Location))
@@ -46,6 +47,7 @@ namespace nsp
4647
Result Installer::PrepareInstallation()
4748
{
4849
Result rc = err::Make(err::ErrorDescription::InvalidNSP);
50+
4951
if(nspentry.IsOk())
5052
{
5153
rc = 0;

Goldleaf/Source/ui/ui_InstallLayout.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ namespace ui
4242

4343
void InstallLayout::StartInstall(pu::String Path, fs::Explorer *Exp, Storage Location, bool OmitConfirmation)
4444
{
45+
if(envGetHeapOverrideSize() < 900 * 1000 * 1000)
46+
{
47+
mainapp->CreateShowDialog("Insufficient Memory", "Due to unoptimized code, GoldBricks requires more memory to run. Please run this application using title override or a NSP forwarder.", { set::GetDictionaryEntry(234) }, true);
48+
return;
49+
}
50+
4551
nsp::Installer inst(Path, Exp, Location);
4652

4753
auto rc = inst.PrepareInstallation();

Goldleaf/Source/ui/ui_PartitionBrowserLayout.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ namespace ui
102102
else
103103
{
104104
pu::String ext = fs::GetExtension(itm);
105-
if(ext == "nsp") mitm->SetIcon(gsets.PathForResource("/FileSystem/NSP.png"));
105+
if(ext == "nsp" || ext == "nsz") mitm->SetIcon(gsets.PathForResource("/FileSystem/NSP.png"));
106106
else if(ext == "nro") mitm->SetIcon(gsets.PathForResource("/FileSystem/NRO.png"));
107107
else if(ext == "tik") mitm->SetIcon(gsets.PathForResource("/FileSystem/TIK.png"));
108108
else if(ext == "cert") mitm->SetIcon(gsets.PathForResource("/FileSystem/CERT.png"));
@@ -178,7 +178,7 @@ namespace ui
178178
{
179179
pu::String ext = fs::GetExtension(itm);
180180
pu::String msg = set::GetDictionaryEntry(52) + " ";
181-
if(ext == "nsp") msg += set::GetDictionaryEntry(53);
181+
if(ext == "nsp" || ext == "nsz") msg += set::GetDictionaryEntry(53);
182182
else if(ext == "nro") msg += set::GetDictionaryEntry(54);
183183
else if(ext == "tik") msg += set::GetDictionaryEntry(55);
184184
else if(ext == "nxtheme") msg += set::GetDictionaryEntry(56);
@@ -190,7 +190,7 @@ namespace ui
190190
std::vector<pu::String> vopts;
191191
u32 copt = 5;
192192
bool ibin = this->gexp->IsFileBinary(fullitm);
193-
if(ext == "nsp")
193+
if(ext == "nsp" || ext == "nsz")
194194
{
195195
vopts.push_back(set::GetDictionaryEntry(65));
196196
copt = 6;
@@ -241,7 +241,7 @@ namespace ui
241241
int sopt = mainapp->CreateShowDialog(set::GetDictionaryEntry(76), msg, vopts, true);
242242
if(sopt < 0) return;
243243
int osopt = sopt;
244-
if(ext == "nsp")
244+
if(ext == "nsp" || ext == "nsz")
245245
{
246246
switch(sopt)
247247
{
@@ -485,7 +485,7 @@ namespace ui
485485
for(u32 i = 0; i < files.size(); i++)
486486
{
487487
auto path = fullitm + "/" + files[i];
488-
if(fs::GetExtension(path) == "nsp") nsps.push_back(files[i]);
488+
if(fs::GetExtension(path) == "nsp" || fs::GetExtension(path) == "nsz") nsps.push_back(files[i]);
489489
}
490490
std::vector<pu::String> extraopts = { set::GetDictionaryEntry(281) };
491491
if(!nsps.empty()) extraopts.push_back(set::GetDictionaryEntry(282));

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Unfortunately this code might contain brick code, as the original author--XorTro
1010

1111
<img src="brick.png" alt="bricked" />
1212

13+
# High Memory Requirement
14+
15+
Due to unoptimized code, there is not much memory left to add NSZ support. Therefore title installs will require that GoldBricks be ran in high memory more via title override or a piracy NSP forwarder.
16+
1317
<img src="Screenshot-gleaf.jpg" alt="drawing" width="400"/> <img src="Screenshot-quark.png" alt="drawing" width="300"/>
1418

1519
> Having any issues? Check [this help document](docs/FAQ.md) for help!

0 commit comments

Comments
 (0)