Fix booting FIRMs from scripts

This commit is contained in:
d0k3 2019-06-30 23:47:17 +02:00
parent 9a7ff738be
commit e7e800d44f
2 changed files with 8 additions and 0 deletions

View File

@ -2644,6 +2644,11 @@ u32 ScriptRunner(int entrypoint) {
InitExtFS();
CalibrateTouchFromFlash(); // !!! this may need some further checking
// brightness from file?
s32 brightness = -1;
if (LoadSupportFile("gm9bright.cfg", &brightness, 0x4))
SetScreenBrightness(brightness);
while (CheckButton(BOOTPAUSE_KEY)); // don't continue while these keys are held
while (timer_msec( timer ) < 500); // show splash for at least 0.5 sec

View File

@ -16,6 +16,7 @@
#include "png.h"
#include "ips.h"
#include "bps.h"
#include "pxi.h"
#define _MAX_ARGS 4
@ -1407,6 +1408,8 @@ bool run_cmd(cmd_id id, u32 flags, char** argv, char* err_str) {
snprintf(fixpath, 256, "%s%s", (*argv[0] == '0') ? "sdmc" : "nand", argv[0] + 1);
else strncpy(fixpath, argv[0], 256);
fixpath[255] = '\0';
PXI_DoCMD(PXI_SET_VMODE, (u32[]){1}, 1);
PXI_DoCMD(PXI_LEGACY_MODE, NULL, 0);
BootFirm((FirmHeader*)(void*)firm, fixpath);
while(1);
} else if (err_str) snprintf(err_str, _ERR_STR_LEN, "not a bootable firm");