Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ jobs:
path: |
release/*

# - name: last week changelog
# run: |
# git --no-pager log --pretty=format:"- %h:%as %>(18)%an: %s" --since="Last Week">CHANGELOG
# echo CHANGELOG=$(cat CHANGELOG) >> $GITHUB_ENV
# echo ${{ env.CHANGELOG }}

- uses: ClementTsang/[email protected]
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
Expand All @@ -104,8 +117,9 @@ jobs:
files: |
PS2BBL.7z
body: |
"![dl](https://img.shields.io/github/downloads/israpps/PlayStation2-Basic-BootLoader/latest/total?style=for-the-badge&logo=github) "
![dl](https://img.shields.io/github/downloads/israpps/PlayStation2-Basic-BootLoader/latest/total?style=for-the-badge&logo=github)
[![info](https://img.shields.io/badge/not%20sure%20what%20to%20download%3F-Click%20Here-000000?style=for-the-badge&logo=github)](https://israpps.github.io/PlayStation2-Basic-BootLoader/Downloads/)
${{ env.CHANGELOG }}

- name: notify on discord
if: github.ref == 'refs/heads/main'
Expand Down Expand Up @@ -177,6 +191,19 @@ jobs:
path: |
release/PS2BBL_OpenTuna_Installer.ELF

# - name: last week changelog
# run: |
# git --no-pager log --pretty=format:"- %h:%as %>(18)%an: %s" --since="Last Week">CHANGELOG
# echo CHANGELOG=$(cat CHANGELOG) >> $GITHUB_ENV
# echo ${{ env.CHANGELOG }}

- uses: ClementTsang/[email protected]
with:
delete_release: true
tag_name: opentuna
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
Expand All @@ -190,3 +217,4 @@ jobs:
body: |
![dl](https://img.shields.io/github/downloads/israpps/PlayStation2-Basic-BootLoader/latest/total?style=for-the-badge&logo=github)
[![info](https://img.shields.io/badge/not%20sure%20what%20to%20download%3F-Click%20Here-000000?style=for-the-badge&logo=github)](https://israpps.github.io/PlayStation2-Basic-BootLoader/Downloads/)
${{ env.CHANGELOG }}
51 changes: 36 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,39 @@ export HEADER


# ---{BUILD CFG}--- #
HAS_EMBED_IRX = 1 # whether to embed or not non vital IRX (wich will be loaded from memcard files)
HAS_EMBED_IRX ?= 1# whether to embed or not non vital IRX (wich will be loaded from memcard files)
DEBUG ?= 0
PSX ?= 0 # PSX DESR support
HDD ?= 0 #wether to add internal HDD support
MX4SIO ?= 0
PROHBIT_DVD_0100 ?= 0 # prohibit the DVD Players v1.00 and v1.01 from being booted.
XCDVD_READKEY ?= 0 # Enable the newer sceCdReadKey checks, which are only supported by a newer CDVDMAN module.
UDPTTY ?= 0 # printf over UDP
PPCTTY ?= 0 # printf over PowerPC UART
PRINTF ?= NONE

HOMEBREW_IRX ?= 0 # if we need homebrew SIO2MAN, MCMAN, MCSERV & PADMAN embedded, else, builtin console drivers are used
FILEXIO_NEED ?= 0 # if we need filexio and imanx loaded for other features (HDD, mx4sio, etc)
DEV9_NEED ?= 0 # if we need DEV9 loaded for other features (HDD, UDPTTY, etc)
PS1 ?= 0
PS2 ?= 0
DVDPLAYER ?= 0
OSDHISTORY ?= 0


# Related to binary size reduction (it disables some features, please be sure you won't disable something you need)
# ---{DEBUG CFG}--- #
UDPTTY ?= 0 # printf over UDP
PPCTTY ?= 0 # printf over PowerPC UART
PRINTF ?= NONE

# ---{SIZE REDUCTION}--- #
KERNEL_NOPATCH = 1
NEWLIB_NANO = 1
DUMMY_TIMEZONE = 1

# ---{ VERSIONING }--- #

VERSION = 1
SUBVERSION = 2
PATCHLEVEL = 0
STATUS = Beta

# ---{ EXECUTABLES }--- #

BINDIR ?= bin/
BASENAME ?= PS2BBL
EE_BIN = $(BINDIR)$(BASENAME).ELF
Expand All @@ -49,18 +53,15 @@ KELFTYPE ?= MC
EE_BIN_ENCRYPTED = $(BINDIR)$(BASENAME)_$(KELFTYPE).KELF

# ---{ OBJECTS & STUFF }--- #

EE_OBJS_DIR = obj/
EE_SRC_DIR = src/
EE_ASM_DIR = asm/

EE_OBJS = main.o \
util.o elf.o timer.o ps2.o ps1.o dvdplayer.o \
modelname.o libcdvd_add.o OSDHistory.o OSDInit.o OSDConfig.o \
EE_OBJS = main.o util.o elf.o timer.o modelname.o \
libcdvd_add.o OSDInit.o OSDConfig.o \
$(EMBEDDED_STUFF) \
$(IOP_OBJS)

EMBEDDED_STUFF = icon_sys_A.o icon_sys_J.o icon_sys_C.o

EE_CFLAGS = -Wall
EE_CFLAGS += -fdata-sections -ffunction-sections -DREPORT_FATAL_ERRORS
Expand All @@ -71,7 +72,6 @@ EE_INCS += -Iinclude -I$(PS2SDK)/ports/include
EE_CFLAGS += -DVERSION=\"$(VERSION)\" -DSUBVERSION=\"$(SUBVERSION)\" -DPATCHLEVEL=\"$(PATCHLEVEL)\" -DSTATUS=\"$(STATUS)\"

# ---{ CONDITIONS }--- #

ifneq ($(VERBOSE), 1)
.SILENT:
endif
Expand Down Expand Up @@ -139,12 +139,33 @@ else
EE_OBJS += sio2man_irx.o
endif

ifneq ($(HAS_EMBED_IRX), 1)
ifeq ($(HAS_EMBED_IRX), 1)
$(info --- USB drivers will be embedded)
EE_OBJS += usbd_irx.o bdm_irx.o bdmfs_fatfs_irx.o usbmass_bd_irx.o
EE_CFLAGS += -DHAS_EMBEDDED_IRX
endif

ifeq ($(PS1), 1)
EE_OBJS += ps1.o
EE_CFLAGS += -DF_PS1
endif

ifeq ($(PS2), 1)
EE_OBJS += ps2.o
EE_CFLAGS += -DF_PS2
endif

ifeq ($(DVDPLAYER), 1)
EE_OBJS += dvdplayer.o
EE_CFLAGS += -DF_DVDPLAYER
endif

ifeq ($(OSDHISTORY), 1)
EE_OBJS += OSDHistory.o
EE_CFLAGS += -DF_OSD_HISTORY
EMBEDDED_STUFF += icon_sys_A.o icon_sys_J.o icon_sys_C.o
endif

ifeq ($(HDD), 1)
$(info --- compiling with HDD support)
EE_LIBS += -lpoweroff
Expand Down
8 changes: 6 additions & 2 deletions include/OSDHistory.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef OSDHISTORY_H
#define OSDHISTORY_H
#ifdef F_OSD_HISTORY
#define MAX_HISTORY_ENTRIES 21

/* If the record is valid, the launch count will be >0.
Expand Down Expand Up @@ -58,5 +59,8 @@ void UpdatePlayHistory(const char *name);
// Low-level functions. Use them for writing your own functions (i.e. writing your own boot animation).
int LoadHistoryFile(int port);
int SaveHistoryFile(int port);

#endif
#define GOSDHISTORY(x...) x
#else
#define GOSDHISTORY(x...)
#endif
#endif
9 changes: 7 additions & 2 deletions include/dvdplayer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifdef F_DVDPLAYER
/** @brief initialize DVDPlayer
*
*
* @returns 0 on success, non-zero on error.
* @warning It is normal for this to fail on consoles that have no DVD ROM chip (i.e. DEX or the SCPH-10000/SCPH-15000).
*/
Expand All @@ -16,3 +16,8 @@ int DVDPlayerBoot(void);
* @returns a human-readable version number for the DVD Player.
*/
const char *DVDPlayerGetVersion(void);

#define GDVDPLAYER(x...) x//DVDPlayer Guard
#else
#define GDVDPLAYER(x...)//DVDPlayer Guard
#endif
6 changes: 5 additions & 1 deletion include/ps1.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#ifdef F_PS1
/**
* @brief Initialize the PlayStation driver in ROM
* @returns 0 on success.
Expand All @@ -16,3 +16,7 @@ int PS1DRVBoot(void);
* @returns a human-readable version number for the PlayStation driver.
*/
const char *PS1DRVGetVersion(void);
#define GPS1DISC(x...) x
#else
#define GPS1DISC(x...)
#endif
6 changes: 5 additions & 1 deletion include/ps2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

#ifdef F_PS2
/**
* @brief Boots the inserted PlayStation 2 game disc
* @param skip_PS2LOGO wheter to load the game main executable via rom0:PS2LOGO or run it directly
Expand All @@ -11,3 +11,7 @@ int PS2DiscBoot(int skip_PS2LOGO);
* @note You can use this if an unexpected error occurs while booting the software that the user wants to use.
*/
void BootError(void);
#define GPS2DISC(x...) x
#else
#define GPS2DISC(x...)
#endif
37 changes: 23 additions & 14 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ int main(int argc, char *argv[])
DPRINTF("init ROMVER, model name ps1dvr and dvdplayer ver\n");
OSDInitROMVER(); // Initialize ROM version (must be done first).
ModelNameInit(); // Initialize model name
PS1DRVInit(); // Initialize PlayStation Driver (PS1DRV)
DVDPlayerInit(); // Initialize ROM DVD player. It is normal for this to fail on consoles that have no DVD ROM chip (i.e. DEX or the SCPH-10000/SCPH-15000).
GPS1DISC(PS1DRVInit()); // Initialize PlayStation Driver (PS1DRV)
GDVDPLAYER(DVDPlayerInit()); // Initialize ROM DVD player. It is normal for this to fail on consoles that have no DVD ROM chip (i.e. DEX or the SCPH-10000/SCPH-15000).

if (OSDConfigLoad() != 0) // Load OSD configuration
{ // OSD configuration not initialized. Defaults loaded.
Expand Down Expand Up @@ -279,7 +279,7 @@ int main(int argc, char *argv[])
GLOBCFG.KEYPATHS[x][j] = CheckPath(DEFPATH[3 * x + j]);
sleep(1);
}

#ifdef F_OSD_HISTORY
int R = 0x80, G = 0x80, B = 0x80;
if (GLOBCFG.OSDHISTORY_READ && (GLOBCFG.LOGO_DISP > 1)) {
j = 1;
Expand Down Expand Up @@ -313,6 +313,7 @@ int main(int argc, char *argv[])
DPRINTF("can't find any osd history for banner color\n");
}
}
#endif
// Stores last key during DELAY msec
scr_clear();
if (GLOBCFG.LOGO_DISP > 1)
Expand All @@ -322,12 +323,13 @@ int main(int argc, char *argv[])
scr_printf(BANNER_FOOTER);
if (GLOBCFG.LOGO_DISP > 0) {
scr_printf("\n\n\tModel:\t\t%s\n"
"\tPlayStation Driver:\t%s\n"
"\tDVD Player:\t%s\n"
GPS1DISC("\tPlayStation Driver:\t%s\n")
GDVDPLAYER("\tDVD Player:\t%s\n")
"\tConfig source:\t%s\n",
ModelNameGet(),
PS1DRVGetVersion(),
DVDPlayerGetVersion(),
GPS1DISC(PS1DRVGetVersion(),)
GDVDPLAYER(DVDPlayerGetVersion(),)

SOURCES[config_source]);
#ifndef NO_TEMP_DISP
PrintTemperature();
Expand Down Expand Up @@ -488,7 +490,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(bdm_irx, size_bdm_irx, 0, NULL, &RET);
#else
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/BDM.IRX"), 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/SYS-CONF/BDM.IRX"), 0, NULL, &RET);
#endif
DPRINTF(" [BDM]: ret=%d, ID=%d\n", RET, ID);
if (ID < 0 || RET == 1)
Expand All @@ -497,7 +499,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(bdmfs_fatfs_irx, size_bdmfs_fatfs_irx, 0, NULL, &RET);
#else
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/BDMFS_FATFS.IRX"), 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/SYS-CONF/BDMFS_FATFS.IRX"), 0, NULL, &RET);
#endif
DPRINTF(" [BDMFS_FATFS]: ret=%d, ID=%d\n", RET, ID);
if (ID < 0 || RET == 1)
Expand All @@ -506,7 +508,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(usbd_irx, size_usbd_irx, 0, NULL, &RET);
#else
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/USBD.IRX"), 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/SYS-CONF/USBD.IRX"), 0, NULL, &RET);
#endif
delay(3);
DPRINTF(" [USBD]: ret=%d, ID=%d\n", RET, ID);
Expand All @@ -516,7 +518,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(usbmass_bd_irx, size_usbmass_bd_irx, 0, NULL, &RET);
#else
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/USBMASS_BD.IRX"), 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/SYS-CONF/USBMASS_BD.IRX"), 0, NULL, &RET);
#endif
DPRINTF(" [USBMASS_BD]: ret=%d, ID=%d\n", RET, ID);
if (ID < 0 || RET == 1)
Expand Down Expand Up @@ -837,13 +839,14 @@ int dischandler()
scr_printf("Audio Disc (not supported by this program)\n");
scr_setfontcolor(0xffffff);
break;

GDVDPLAYER(
case SCECdDVDV:
scr_setfontcolor(0x00ff00);
scr_printf("DVD Video\n");
scr_setfontcolor(0xffffff);
ValidDiscInserted = 1;
break;
)
default:
scr_setfontcolor(0x0000ff);
scr_printf("Unknown (%d)\n", DiscType);
Expand All @@ -860,19 +863,22 @@ int dischandler()
// Now that a valid disc is inserted, do something.
// CleanUp() will be called, to deinitialize RPCs. SIFRPC will be deinitialized by the respective disc-handlers.
switch (DiscType) {
GPS1DISC(
case SCECdPSCD:
case SCECdPSCDDA:
// Boot PlayStation disc
PS1DRVBoot();
break;

)
GPS2DISC(
case SCECdPS2CD:
case SCECdPS2CDDA:
case SCECdPS2DVD:
// Boot PlayStation 2 disc
PS2DiscBoot(GLOBCFG.SKIPLOGO);
break;

)
GDVDPLAYER(
case SCECdDVDV:
/* If the user chose to disable the DVD Player progressive scan setting,
it is disabled here because Sony probably wanted the setting to only bind if the user played a DVD.
Expand All @@ -885,6 +891,7 @@ int dischandler()
Play history is automatically updated. */
DVDPlayerBoot();
break;
)
}
return 0;
}
Expand Down Expand Up @@ -1052,6 +1059,8 @@ void _libcglue_timezone_update()
}
#endif

void _libcglue_rtc_update() {}

#if defined(KERNEL_NOPATCH)
DISABLE_PATCHED_FUNCTIONS();
#endif
Expand Down