From 208449584895d139e19a4da42f2e53856bf3b2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Israelson?= <57065102+israpps@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:21:19 -0300 Subject: [PATCH 1/2] [CI]: changelog workaround and tag cleanup? --- .github/workflows/CI.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f18b0f3..40b9a3e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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/delete-tag-and-release@v0.3.1 + 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 @@ -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' @@ -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/delete-tag-and-release@v0.3.1 + 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 @@ -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 }} From 2137fd282b529e206990d8a8fbccfe0f44c4e438 Mon Sep 17 00:00:00 2001 From: Matias Israelson <57065102+israpps@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:04:30 -0300 Subject: [PATCH 2/2] size reduction test --- Makefile | 51 +++++++++++++++++++++++++++++++------------- include/OSDHistory.h | 8 +++++-- include/dvdplayer.h | 9 ++++++-- include/ps1.h | 6 +++++- include/ps2.h | 6 +++++- src/main.c | 37 ++++++++++++++++++++------------ 6 files changed, 82 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 2150bd3..f07ac78 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/include/OSDHistory.h b/include/OSDHistory.h index c7320da..bf2ff93 100644 --- a/include/OSDHistory.h +++ b/include/OSDHistory.h @@ -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. @@ -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 \ No newline at end of file +#define GOSDHISTORY(x...) x +#else +#define GOSDHISTORY(x...) +#endif +#endif diff --git a/include/dvdplayer.h b/include/dvdplayer.h index 54898e6..09b973b 100644 --- a/include/dvdplayer.h +++ b/include/dvdplayer.h @@ -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). */ @@ -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 diff --git a/include/ps1.h b/include/ps1.h index 28c7d15..afac441 100644 --- a/include/ps1.h +++ b/include/ps1.h @@ -1,4 +1,4 @@ - +#ifdef F_PS1 /** * @brief Initialize the PlayStation driver in ROM * @returns 0 on success. @@ -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 diff --git a/include/ps2.h b/include/ps2.h index 2227a80..794c0d5 100644 --- a/include/ps2.h +++ b/include/ps2.h @@ -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 @@ -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 diff --git a/src/main.c b/src/main.c index 518fc0f..fdaae2a 100644 --- a/src/main.c +++ b/src/main.c @@ -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. @@ -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; @@ -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) @@ -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(); @@ -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) @@ -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) @@ -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); @@ -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) @@ -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); @@ -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. @@ -885,6 +891,7 @@ int dischandler() Play history is automatically updated. */ DVDPlayerBoot(); break; + ) } return 0; } @@ -1052,6 +1059,8 @@ void _libcglue_timezone_update() } #endif +void _libcglue_rtc_update() {} + #if defined(KERNEL_NOPATCH) DISABLE_PATCHED_FUNCTIONS(); #endif