# New Features #

- Installable via cmake
- Dont run makerom and makebanner in 3dsx mode
This commit is contained in:
2024-03-09 13:44:22 +01:00
parent c7083ac77e
commit d464128d78
5 changed files with 100 additions and 59 deletions

View File

@ -494,12 +494,15 @@ void CompileProject(NpiProject &prj, std::string dir_)
int reqres = system(command.c_str());
if (reqres != 0)
any_errors = true;
command = "bannertool makebanner -i \"app/banner.png\" -a "
"\"app/BannerAudio.wav\" -o \"build/banner.bin\"";
std::cout << CCBLUE << "[+] Creating Banner..." << CCRESET << std::endl;
reqres = system(command.c_str());
std::cout << (reqres == 0 ? CCGREEN : CCRED)
<< (reqres == 0 ? "[+] " : "[-] ") << "Banner" << std::endl;
if (prj.ctr_type)
{
command = "bannertool makebanner -i \"app/banner.png\" -a "
"\"app/BannerAudio.wav\" -o \"build/banner.bin\"";
std::cout << CCBLUE << "[+] Creating Banner..." << CCRESET << std::endl;
reqres = system(command.c_str());
std::cout << (reqres == 0 ? CCGREEN : CCRED)
<< (reqres == 0 ? "[+] " : "[-] ") << "Banner" << std::endl;
}
command = "bannertool makesmdh -i \"app/icon.png\" -s \"" + prj.name +
"\" -l \"Description\" -p \"" + prj.author +
"\" -o \"build/icon.bin\"";
@ -516,20 +519,23 @@ void CompileProject(NpiProject &prj, std::string dir_)
std::cout << (reqres == 0 ? CCGREEN : CCRED)
<< (reqres == 0 ? "[+] " : "[-] ") << prj.name + ".3dsx "
<< std::endl;
command =
"makerom -f cia -target t -exefslogo -o " + dir_ + "/" + prj.name +
".cia -elf " + dir_ + "/" + prj.name + ".elf " + " -rsf " + dir_ + "/" +
prj.rsf_path + " -banner " + dir_ + "/build/banner.bin" + " -icon " +
dir_ + "/build/icon.bin" + " -logo " + dir_ + "/" + prj.logo_lz11_path +
" -DAPP_ROMFS=" + dir_ + "/" + prj.dir_romfs + " -major " +
std::to_string(prj.vmajor) + " -minor " + std::to_string(prj.vminor) +
" -micro " + std::to_string(prj.vbuild) +
" -DAPP_VERSION_MAJOR=" + std::to_string(prj.vmajor);
std::cout << CCBLUE << "[+] Creating Cia..." << CCRESET << std::endl;
reqres = system(command.c_str());
std::cout << (reqres == 0 ? CCGREEN : CCRED)
<< (reqres == 0 ? "[+] " : "[-] ") << prj.name + ".cia "
<< std::endl;
if (prj.ctr_type)
{
command =
"makerom -f cia -target t -exefslogo -o " + dir_ + "/" + prj.name +
".cia -elf " + dir_ + "/" + prj.name + ".elf " + " -rsf " + dir_ + "/" +
prj.rsf_path + " -banner " + dir_ + "/build/banner.bin" + " -icon " +
dir_ + "/build/icon.bin" + " -logo " + dir_ + "/" + prj.logo_lz11_path +
" -DAPP_ROMFS=" + dir_ + "/" + prj.dir_romfs + " -major " +
std::to_string(prj.vmajor) + " -minor " + std::to_string(prj.vminor) +
" -micro " + std::to_string(prj.vbuild) +
" -DAPP_VERSION_MAJOR=" + std::to_string(prj.vmajor);
std::cout << CCBLUE << "[+] Creating Cia..." << CCRESET << std::endl;
reqres = system(command.c_str());
std::cout << (reqres == 0 ? CCGREEN : CCRED)
<< (reqres == 0 ? "[+] " : "[-] ") << prj.name + ".cia "
<< std::endl;
}
}
if (any_errors)
@ -588,9 +594,16 @@ namespace helper
js["vmajor"] = prj.vmajor;
js["vminor"] = prj.vminor;
js["vbuild"] = prj.vbuild;
js["unique_id"] = prj.unique_id;
js["prod_code"] = prj.prod;
if (prj.ctr_type)
{
js["unique_id"] = prj.unique_id;
js["prod_code"] = prj.prod;
}
js["platform"] = prj.platform;
if (prj.platform == "3ds")
{
js["cia"] = prj.ctr_type;
}
nlohmann::json source_dirs;
Vec2Json(prj.source_dirs, source_dirs, prj);
@ -609,10 +622,13 @@ namespace helper
js["lib_dirs"] = lib_dirs;
js["icon_path"] = prj.icon_path;
js["banner_path"] = prj.banner_path;
js["banner_a_path"] = prj.banner_a_path;
js["rsf_path"] = prj.rsf_path;
js["logo_lz11_path"] = prj.logo_lz11_path;
if (prj.ctr_type)
{
js["banner_path"] = prj.banner_path;
js["banner_a_path"] = prj.banner_a_path;
js["rsf_path"] = prj.rsf_path;
js["logo_lz11_path"] = prj.logo_lz11_path;
}
js["dir_gfx"] = prj.dir_gfx;
js["dir_gfxbuild"] = prj.dir_gfxbuild;
@ -678,16 +694,31 @@ namespace helper
auto __vmajor = js_catch<int>(js, "vmajor");
auto __vminor = js_catch<int>(js, "vminor");
auto __vbuild = js_catch<int>(js, "vbuild");
auto __description = js_catch<std::string>(js, "description");
auto __unique_id = js_catch<std::string>(js, "unique_id");
auto __prod = js_catch<std::string>(js, "prod_code");
auto __platform = js_catch<std::string>(js, "platform");
auto __ctr_type = js_catch<bool>(js, "cia");
auto __description = js_catch<std::string>(js, "description");
std::pair<std::string, bool> __unique_id;
std::pair<std::string, bool> __prod;
if (__ctr_type.first)
{
__unique_id = js_catch<std::string>(js, "unique_id");
__prod = js_catch<std::string>(js, "prod_code");
}
std::pair<std::string, bool> __banner_path;
std::pair<std::string, bool> __banner_a_path;
std::pair<std::string, bool> __rsf_path;
std::pair<std::string, bool> __logo_lz11_path;
auto __icon_path = js_catch<std::string>(js, "icon_path");
auto __banner_path = js_catch<std::string>(js, "banner_path");
auto __banner_a_path = js_catch<std::string>(js, "banner_a_path");
auto __rsf_path = js_catch<std::string>(js, "rsf_path");
auto __logo_lz11_path = js_catch<std::string>(js, "logo_lz11_path");
if (__ctr_type.first)
{
__banner_path = js_catch<std::string>(js, "banner_path");
__banner_a_path = js_catch<std::string>(js, "banner_a_path");
__rsf_path = js_catch<std::string>(js, "rsf_path");
__logo_lz11_path = js_catch<std::string>(js, "logo_lz11_path");
}
auto __dir_gfx = js_catch<std::string>(js, "dir_gfx");
auto __dir_gfxbuild = js_catch<std::string>(js, "dir_gfxbuild");
auto __dir_romfs = js_catch<std::string>(js, "dir_romfs");
@ -706,6 +737,7 @@ namespace helper
prj.unique_id = __unique_id.first;
prj.prod = __prod.first;
prj.platform = __platform.first;
prj.ctr_type = __ctr_type.first;
prj.icon_path = __icon_path.first;
prj.banner_path = __banner_path.first;

View File

@ -188,7 +188,7 @@ void ProcessArgs(int argc, char *argv[])
}
// Generate Default build.json
NpiProject npr;
Prj_InitDefault(npr);
Prj_InitDefault(npr, (type_ == 1));
helper::GenerateTemplateFile(dst_dir + "/build.json", npr);
}
else if (std::string(argv[1]) == "generate-assist")
@ -276,10 +276,13 @@ void ProcessArgs(int argc, char *argv[])
}
// Create build.json
NpiProject npr;
Prj_InitDefault(npr);
Prj_InitDefault(npr, (type_ == 1));
npr.name = prj_name;
npr.prod = prodcode;
npr.unique_id = unique_id;
if (npr.ctr_type)
{
npr.prod = prodcode;
npr.unique_id = unique_id;
}
helper::GenerateTemplateFile(dst_dir + "/build.json", npr);
}