Skip to content

Commit

Permalink
some Fixes (#22)
Browse files Browse the repository at this point in the history
* 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 cd11562.
  • Loading branch information
israpps committed Jul 15, 2023
1 parent c0a5c58 commit dfe1bd1
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,18 @@

# Object files
*.o
*.ko
*.obj
*.a

# embedded stuff
*_irx.c
*_irx.s

#PS2 executables
*.elf
*.kelf
!release/PS2BBL/*.elf

# IOP Executable
*.irx
*.s

# folders where object files and embedded stuff is dumped
src/
asm/

#other non desired files
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion include/banner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
3 changes: 2 additions & 1 deletion include/debugprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#define DEBUG_PRINTF

#ifdef EE_SIO_DEBUG
void sio_printf(const char *fmt, ...);
#include <SIOCookie.h>
#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
Expand Down
31 changes: 18 additions & 13 deletions src/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@
#include <fcntl.h>
#include <unistd.h>
#include <tamtypes.h>
#include <sifrpc.h>
#include <kernel.h>
#include <elf-loader.h>
#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);
}
}
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions src/sioprintf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdio.h>
#include <sio.h>
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);
}

0 comments on commit dfe1bd1

Please sign in to comment.