Skip to content

Commit 4f88d2d

Browse files
committed
[app-isoldr] Added GPIO usage option in settings.
1 parent d798fec commit 4f88d2d

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

applications/iso_loader/app.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<app extensions=".iso .cso .cdi .gdi" icon="images/icon.png" name="ISO Loader" version="0.8.3">
2+
<app extensions=".iso .cso .cdi .gdi" icon="images/icon.png" name="ISO Loader" version="0.8.4">
33
<resources>
44
<module src="../../modules/minilzo.klf" />
55
<module src="../../modules/isofs.klf" />
@@ -630,7 +630,12 @@
630630
<label align="left" color="#000000" font="arial" height="20" text="Enable screenshots (START + A + B)" x="9%" />
631631
</input>
632632
</panel>
633-
<panel height="150" width="86%" x="12%" y="105">
633+
<panel height="30" width="86%" x="12%" y="105">
634+
<input height="25" name="gpio-checkbox" type="checkbox">
635+
<label align="left" color="#000000" font="arial" height="20" text="Use GPIO-0 as IGR button" x="9%" />
636+
</input>
637+
</panel>
638+
<panel height="150" width="86%" x="12%" y="135">
634639
<label align="left" color="#31799F" font="arial" height="25" width="100%" text="VMU emulation:" />
635640
<input font="arial" fontcolor="#000000" height="22" name="vmu-number" size="20" type="text" value="001" width="40" />
636641
<input height="25" y="50" name="vmu-checkbox" onclick="export:isoLoader_toggleVMU()" type="checkbox">

applications/iso_loader/modules/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ KOS_CFLAGS += -I./
1414

1515
VER_MAJOR = 0
1616
VER_MINOR = 8
17-
VER_MICRO = 3
17+
VER_MICRO = 4
1818

1919
all: rm-elf
2020

applications/iso_loader/modules/module.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static struct {
9898
GUI_Widget *screenshot;
9999
GUI_Widget *alt_boot;
100100
GUI_Widget *alt_read;
101+
GUI_Widget *use_gpio;
101102

102103
GUI_Widget *device;
103104
GUI_Widget *fw_browser;
@@ -599,6 +600,10 @@ void isoLoader_MakeShortcut(GUI_Widget *widget) {
599600
strcat(cmd, boot_file);
600601
}
601602

603+
if(GUI_WidgetGetState(self.use_gpio)) {
604+
strcat(cmd, " --gpio");
605+
}
606+
602607
fprintf(fd, "%s\n", cmd);
603608
fprintf(fd, "console --show\n");
604609
fclose(fd);
@@ -1290,6 +1295,10 @@ void isoLoader_Run(GUI_Widget *widget) {
12901295
isoldr_set_boot_file(self.isoldr, filepath, ALT_BOOT_FILE);
12911296
}
12921297

1298+
if(GUI_WidgetGetState(self.use_gpio)) {
1299+
self.isoldr->use_gpio = 1;
1300+
}
1301+
12931302
isoldr_exec(self.isoldr, addr);
12941303

12951304
/* If we there, then something wrong... */
@@ -1564,6 +1573,7 @@ void isoLoader_DefaultPreset() {
15641573
GUI_WidgetSetState(self.low, 0);
15651574
isoLoader_toggleVMU(self.vmu_disabled);
15661575
GUI_WidgetSetState(self.screenshot, 0);
1576+
GUI_WidgetSetState(self.use_gpio, 0);
15671577

15681578
GUI_WidgetSetState(self.os_chk[BIN_TYPE_AUTO], 1);
15691579
isoLoader_toggleOS(self.os_chk[BIN_TYPE_AUTO]);
@@ -1723,13 +1733,13 @@ int isoLoader_SavePreset(GUI_Widget *widget) {
17231733
snprintf(result, sizeof(result),
17241734
"title = %s\ndevice = %s\ndma = %d\nasync = %d\ncdda = %08lx\n"
17251735
"irq = %d\nlow = %d\nheap = %08lx\nfastboot = %d\ntype = %d\nmode = %d\nmemory = %s\n"
1726-
"vmu = %d\nscrhotkey = %lx\naltread = %d\n"
1736+
"vmu = %d\nscrhotkey = %lx\naltread = %d\ngpio = %d\n"
17271737
"pa1 = %08lx\npv1 = %08lx\npa2 = %08lx\npv2 = %08lx\n",
17281738
title, GUI_TextEntryGetText(self.device), GUI_WidgetGetState(self.dma), async,
17291739
cdda_mode, GUI_WidgetGetState(self.irq), GUI_WidgetGetState(self.low), heap,
17301740
GUI_WidgetGetState(self.fastboot), type, mode, memory,
17311741
vmu_num, (uint32)(GUI_WidgetGetState(self.screenshot) ? SCREENSHOT_HOTKEY : 0),
1732-
GUI_WidgetGetState(self.alt_read),
1742+
GUI_WidgetGetState(self.alt_read), GUI_WidgetGetState(self.use_gpio),
17331743
self.pa[0], self.pv[0], self.pa[1], self.pv[1]);
17341744

17351745
if(GUI_WidgetGetState(self.alt_boot)) {
@@ -1767,7 +1777,7 @@ int isoLoader_LoadPreset(GUI_Widget *widget) {
17671777
return -1;
17681778
}
17691779

1770-
int use_dma = 0, emu_async = 16, use_irq = 0, alt_read = 0;
1780+
int use_dma = 0, emu_async = 16, use_irq = 0, alt_read = 0, use_gpio = 0;
17711781
int fastboot = 0, low = 0, emu_vmu = 0, scr_hotkey = 0;
17721782
int boot_mode = BOOT_MODE_DIRECT;
17731783
int bin_type = BIN_TYPE_AUTO;
@@ -1792,6 +1802,7 @@ int isoLoader_LoadPreset(GUI_Widget *widget) {
17921802
{ "low", CONF_INT, (void *) &low },
17931803
{ "vmu", CONF_INT, (void *) &emu_vmu },
17941804
{ "scrhotkey",CONF_INT, (void *) &scr_hotkey },
1805+
{ "gpio", CONF_INT, (void *) &use_gpio },
17951806
{ "heap", CONF_STR, (void *) &heap_memory},
17961807
{ "memory", CONF_STR, (void *) memory },
17971808
{ "async", CONF_INT, (void *) &emu_async },
@@ -1837,6 +1848,7 @@ int isoLoader_LoadPreset(GUI_Widget *widget) {
18371848
GUI_WidgetSetState(self.irq, use_irq);
18381849
GUI_WidgetSetState(self.screenshot, scr_hotkey ? 1 : 0);
18391850
GUI_WidgetSetState(self.low, low);
1851+
GUI_WidgetSetState(self.use_gpio, use_gpio);
18401852

18411853
if (emu_vmu) {
18421854
char num[8], fn[32];
@@ -2068,6 +2080,7 @@ void isoLoader_Init(App_t *app) {
20682080
self.vmu_priv_1mb = APP_GET_WIDGET("vmu-priv-1mb-checkbox");
20692081
self.screenshot = APP_GET_WIDGET("screenshot-checkbox");
20702082
self.alt_boot = APP_GET_WIDGET("alt-boot-checkbox");
2083+
self.use_gpio = APP_GET_WIDGET("gpio-checkbox");
20712084

20722085
self.options_panel = APP_GET_WIDGET("options-panel");
20732086
self.wpa[0] = APP_GET_WIDGET("pa1-text");

0 commit comments

Comments
 (0)