mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 05:32:47 +00:00
Scripting: Add textview command
This commit is contained in:
parent
0906b4e6d8
commit
a04c2beb3c
@ -113,6 +113,7 @@ typedef enum {
|
|||||||
CMD_ID_APPLYIPS,
|
CMD_ID_APPLYIPS,
|
||||||
CMD_ID_APPLYBPS,
|
CMD_ID_APPLYBPS,
|
||||||
CMD_ID_APPLYBPM,
|
CMD_ID_APPLYBPM,
|
||||||
|
CMD_ID_TEXTVIEW,
|
||||||
CMD_ID_ISDIR,
|
CMD_ID_ISDIR,
|
||||||
CMD_ID_EXIST,
|
CMD_ID_EXIST,
|
||||||
CMD_ID_BOOT,
|
CMD_ID_BOOT,
|
||||||
@ -184,6 +185,7 @@ Gm9ScriptCmd cmd_list[] = {
|
|||||||
{ CMD_ID_APPLYIPS, "applyips", 3, 0 },
|
{ CMD_ID_APPLYIPS, "applyips", 3, 0 },
|
||||||
{ CMD_ID_APPLYBPS, "applybps", 3, 0 },
|
{ CMD_ID_APPLYBPS, "applybps", 3, 0 },
|
||||||
{ CMD_ID_APPLYBPM, "applybpm", 3, 0 },
|
{ CMD_ID_APPLYBPM, "applybpm", 3, 0 },
|
||||||
|
{ CMD_ID_TEXTVIEW, "textview", 1, 0 },
|
||||||
{ CMD_ID_ISDIR , "isdir" , 1, 0 },
|
{ CMD_ID_ISDIR , "isdir" , 1, 0 },
|
||||||
{ CMD_ID_EXIST , "exist" , 1, 0 },
|
{ CMD_ID_EXIST , "exist" , 1, 0 },
|
||||||
{ CMD_ID_BOOT , "boot" , 1, 0 },
|
{ CMD_ID_BOOT , "boot" , 1, 0 },
|
||||||
@ -1355,6 +1357,10 @@ bool run_cmd(cmd_id id, u32 flags, char** argv, char* err_str) {
|
|||||||
ret = (ApplyBPMPatch(argv[0], argv[1], argv[2]) == 0);
|
ret = (ApplyBPMPatch(argv[0], argv[1], argv[2]) == 0);
|
||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "apply BPM failed");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "apply BPM failed");
|
||||||
}
|
}
|
||||||
|
else if (id == CMD_ID_TEXTVIEW) {
|
||||||
|
ret = FileTextViewer(argv[0], false);
|
||||||
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "textviewer failed");
|
||||||
|
}
|
||||||
else if (id == CMD_ID_ISDIR) {
|
else if (id == CMD_ID_ISDIR) {
|
||||||
DIR fdir;
|
DIR fdir;
|
||||||
if (fvx_opendir(&fdir, argv[0]) == FR_OK) {
|
if (fvx_opendir(&fdir, argv[0]) == FR_OK) {
|
||||||
|
@ -303,6 +303,10 @@ verify S:/firm1.bin
|
|||||||
# to produce a directory containing patched files (argument 3).
|
# to produce a directory containing patched files (argument 3).
|
||||||
# applybpm 0:/example/patch.bpm 0:/data/originalfolder 0:/game/moddedfolder
|
# applybpm 0:/example/patch.bpm 0:/data/originalfolder 0:/game/moddedfolder
|
||||||
|
|
||||||
|
# 'textview' COMMAND
|
||||||
|
# This will show a text file on screen, in a dedicated text viewer. Size restrictions apply (max 1MiB)
|
||||||
|
# textview 0:/sometext.txt
|
||||||
|
|
||||||
# 'boot' COMMAND
|
# 'boot' COMMAND
|
||||||
# Use this command to chainload a compatible FIRM
|
# Use this command to chainload a compatible FIRM
|
||||||
# boot 0:/boot.firm
|
# boot 0:/boot.firm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user