From dfe1bd17843fae6ad800d47c497b35c6be9a39db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Israelson?= <57065102+israpps@users.noreply.github.com> Date: Sat, 15 Jul 2023 18:05:13 -0300 Subject: [PATCH] some Fixes (#22) * identify debug on banner * less chatty on ELF loading * tidy gitignore * better EE_SIO [skip actions] * also tell found app for auto apps * fix debug printf when searching AUTO apps * OpenTuna pack: dont bundle wLE with DS3/4 support * revert cf8f802 & add wait time before loading ELF wait time only applied if PS2BBL has debugging enabled fixes #21 * change artifact name for non master branch CI * Revert "change artifact name for non master branch CI" This reverts commit cd11562a78e9b9fe2cf26173fef4d7bb3b822c08. --- .github/workflows/CI.yml | 2 +- .gitignore | 7 ------- Makefile | 1 + include/banner.h | 6 +++++- include/debugprintf.h | 3 ++- src/elf.c | 31 ++++++++++++++++++------------- src/main.c | 2 ++ src/sioprintf.c | 12 ++++++++++++ 8 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 src/sioprintf.c diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71d8eca..558a986 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -124,7 +124,7 @@ jobs: - name: update bundled software run: | - wget https://github.com/israpps/wLaunchELF_ISR/releases/download/latest/BOOT-EXFAT-DS34.ELF -O Funtuna-Fork/installer/INSTALLER_CONTENTS/BOOT/ULE.ELF + wget https://github.com/israpps/wLaunchELF_ISR/releases/download/latest/BOOT-EXFAT.ELF -O Funtuna-Fork/installer/INSTALLER_CONTENTS/BOOT/ULE.ELF - name: compile run: | diff --git a/.gitignore b/.gitignore index 65bfe52..1dacedc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,14 +3,9 @@ # Object files *.o -*.ko *.obj *.a -# embedded stuff -*_irx.c -*_irx.s - #PS2 executables *.elf *.kelf @@ -18,10 +13,8 @@ # IOP Executable *.irx -*.s # folders where object files and embedded stuff is dumped -src/ asm/ #other non desired files diff --git a/Makefile b/Makefile index 5459059..949d151 100644 --- a/Makefile +++ b/Makefile @@ -175,6 +175,7 @@ else ifeq ($(PRINTF), EE_SIO) $(info --- EESIO Printf enabled) EE_CFLAGS += -DEE_SIO_DEBUG EE_LIBS += -lsiocookie + EE_OBJS += sioprintf.o else ifeq ($(PRINTF), PRINTF) $(info --- Common Printf enabled) EE_CFLAGS += -DCOMMON_PRINTF diff --git a/include/banner.h b/include/banner.h index 1df7171..70e9483 100644 --- a/include/banner.h +++ b/include/banner.h @@ -19,7 +19,11 @@ const char* BANNER = "\t\t |____| /_______ /\\_______ \\ |______ /|______ /_______ \\\n" "\t\t \\/ \\/ \\/ \\/ \\/\n" #endif - "\t\t\tv" VERSION "-" SUBVERSION "-" PATCHLEVEL " - " STATUS "\n" + "\t\t\tv" VERSION "-" SUBVERSION "-" PATCHLEVEL " - " STATUS +#ifdef DEBUG +" - DEBUG" +#endif + "\n" "\n"; #define BANNER_FOOTER \ "\t\t PlayStation2 Basic BootLoader - By Matias Israelson\n" \ diff --git a/include/debugprintf.h b/include/debugprintf.h index 4b5b42b..10b5abe 100644 --- a/include/debugprintf.h +++ b/include/debugprintf.h @@ -2,9 +2,10 @@ #define DEBUG_PRINTF #ifdef EE_SIO_DEBUG +void sio_printf(const char *fmt, ...); #include #define DPRINTF_INIT() ee_sio_start(38400, 0, 0, 0, 0, 1); - #define DPRINTF(x...) fprintf(EE_SIO, x) + #define DPRINTF(x...) sio_printf( x) #elif COMMON_PRINTF #define DPRINTF(x...) printf(x) #elif SCR_PRINT diff --git a/src/elf.c b/src/elf.c index 505171d..aa7960a 100644 --- a/src/elf.c +++ b/src/elf.c @@ -3,25 +3,30 @@ #include #include #include -#include #include #include #include "debugprintf.h" #define MAX_PATH 1025 +#ifdef DEBUG +#define DBGWAIT(T) sleep(T) +#else +#define DBGWAIT(T) +#endif void RunLoaderElf(const char *filename, const char *party) { - DPRINTF("\tLOADING [%s]\n", filename); -#ifndef NO_DPRINTF - if (party != NULL) - DPRINTF("%s\tparty is %s\n", __func__, party); -#endif -#ifdef SCR_PRINT - sleep(5); - DPRINTF(".\n"); -#endif - - DPRINTF("LoadELFFromFileWithPartition(%s, %s, 0, NULL);\n", filename, party); - LoadELFFromFileWithPartition(filename, party, 0, NULL); + DPRINTF("%s\n", __FUNCTION__); + if (party == NULL) + { + DPRINTF("LoadELFFromFile(%s, 0, NULL)\n", filename); + DBGWAIT(2); + LoadELFFromFile(filename, 0, NULL); + } + else + { + DPRINTF("LoadELFFromFileWithPartition(%s, %s, 0, NULL);\n", filename, party); + DBGWAIT(2); + LoadELFFromFileWithPartition(filename, party, 0, NULL); + } } diff --git a/src/main.c b/src/main.c index d1a997a..3917983 100644 --- a/src/main.c +++ b/src/main.c @@ -477,6 +477,8 @@ int main(int argc, char *argv[]) scr_clear(); for (j = 0; j < 3; j++) { if (exist(CheckPath(GLOBCFG.KEYPATHS[0][j]))) { + scr_setfontcolor(0x00ff00); + scr_printf("\tLoading %s\n", GLOBCFG.KEYPATHS[0][j]); if (!is_PCMCIA) PadDeinitPads(); RunLoaderElf(CheckPath(GLOBCFG.KEYPATHS[0][j]), MPART); diff --git a/src/sioprintf.c b/src/sioprintf.c new file mode 100644 index 0000000..1b8b1f3 --- /dev/null +++ b/src/sioprintf.c @@ -0,0 +1,12 @@ +#include +#include +#include +void sio_printf(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + char str[256]; + vsnprintf(str, sizeof(str), fmt, args); + sio_putsn(str); + va_end(args); +}