Save Errors

Tag Debug Func of ui7
This commit is contained in:
tobid7 2024-02-28 21:01:04 +01:00
parent 6e8f3f0f8b
commit 04c56a98d5
3 changed files with 15 additions and 0 deletions

View File

@ -5,8 +5,20 @@
#include <renderd7/internal_db.hpp>
#include <renderd7/renderd7.hpp>
void rd7i_save_report(const std::string& msg) {
auto ts = RenderD7::GetTimeStr();
std::ofstream f("sdmc:/RenderD7/Reports/report_" + ts + ".txt");
f << "RenderD7 Error [" << rd7i_app_name << ", " << ts << "]" << std::endl;
f << "Error Message: " << std::endl;
f << msg << std::endl;
f << "SysInfo: " << std::endl;
f << "- Citra -> " << (rd7i_is_citra ? "true" : "false") << std::endl;
f.close();
}
namespace RenderD7 {
void Error(const std::string& msg) {
rd7i_save_report(msg);
/*if (rd7i_graphics_on) {
C3D_FrameEnd(0);
while (aptMainLoop()) {
@ -31,6 +43,7 @@ void Error(const std::string& msg) {
gfxInitDefault();
consoleInit(GFX_TOP, NULL);
printf("RENDERD7 - ERROR MANAGER\n\n%s\n", msg.c_str());
printf("Report Saved in\nsdmc:/RenderD7/Reports\n");
printf("Press Start to Exit\n");
while (aptMainLoop()) {
hidScanInput();

View File

@ -85,6 +85,7 @@ struct UI7OBJ {
type = i1;
s = rd7i_current_screen;
}
// Killer Function
void Debug() {
RenderD7::OnScreen(s ? Top : Bottom);
auto clr = UI7CtxDebugCol(type);

View File

@ -124,6 +124,7 @@ void rd7i_init_config() {
rd7i_config_path = "sdmc:/RenderD7/Apps/";
rd7i_config_path += rd7i_app_name;
std::filesystem::create_directories(rd7i_config_path.c_str());
std::filesystem::create_directories("sdmc:/RenderD7/Reports");
bool renew = false;
if (RenderD7::FS::FileExist(rd7i_config_path + "/config.rc7")) {