Skip to content

Commit

Permalink
Merge pull request #53 from israpps/sysconf
Browse files Browse the repository at this point in the history
Sysconf
[skip actions]
  • Loading branch information
israpps committed Oct 14, 2024
2 parents 2ee1f75 + 70ef311 commit b249ae6
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 59 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
apk add build-base git p7zip
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git fetch --prune --unshallow
Expand Down Expand Up @@ -95,13 +95,25 @@ jobs:
- name: Create release
if: github.ref == 'refs/heads/main'
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v2
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Latest development build"
prerelease: true
generate_release_notes: true
tag_name: "latest"
name: "Latest development build"
files: |
PS2BBL.7z
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/)
- name: notify on discord
if: github.ref == 'refs/heads/main'
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_FEED }}
content: "## PS2BBL has been updated!\nread the changelog here: https://github.com/israpps/PlayStation2-Basic-BootLoader/releases/tag/latest\n### [Download Page](https://israpps.github.io/PlayStation2-Basic-BootLoader/Downloads/)"


opentuna:
runs-on: ubuntu-latest
Expand All @@ -127,7 +139,7 @@ jobs:
- name: update binaries
run: |
cp PS2BBL/PS2/COMPRESSED_PS2BBL.ELF Funtuna-Fork/installer/INSTALLER_CONTENTS/BOOT/BOOT.ELF
cp PS2BBL/PS2BBL/CONFIG.INI Funtuna-Fork/installer/INSTALLER_CONTENTS/PS2BBL/CONFIG.INI
cp PS2BBL/SYS-CONF/PS2BBL.INI Funtuna-Fork/installer/INSTALLER_CONTENTS/SYS-CONF/PS2BBL.INI
- name: update bundled software
run: |
Expand Down Expand Up @@ -155,22 +167,26 @@ jobs:
echo "If you bought this software you have been SCAMMED.">>release/CREDITS.TXT
echo "https://github.com/israpps/PlayStation2-Basic-BootLoader">>release/CREDITS.TXT
cp -r release/ $TARGET/
7z a -t7z PS2BBL_OpenTuna_Installer.7z $TARGET/*
7z a -t7z PS2BBL_OpenTuna_Installer.7z $TARGET/*
- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: PS2BBL
name: PS2BBL_OPENTUNA
path: |
release/PS2BBL_OpenTuna_Installer.ELF
- name: Create release
if: github.ref == 'refs/heads/main'
uses: marvinpinto/action-automatic-releases@latest
uses: softprops/action-gh-release@v2
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "opentuna"
title: "Latest PS2BBL + OpenTuna"
prerelease: true
generate_release_notes: true
tag_name: "opentuna"
name: "Latest PS2BBL + OpenTuna"
files: |
PS2BBL_OpenTuna_Installer.7z
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/)
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#PS2 executables
*.elf
*.kelf
!release/PS2BBL/*.elf
!release/SYS-CONF/*.elf

# IOP Executable
*.irx
Expand Down
6 changes: 3 additions & 3 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ enum
} CONFIG_SOURCES_ID;

char *CONFIG_PATHS[SOURCE_COUNT] = {
"mc0:/PS2BBL/CONFIG.INI",
"mc1:/PS2BBL/CONFIG.INI",
"mc0:/SYS-CONF/PS2BBL.INI",
"mc1:/SYS-CONF/PS2BBL.INI",
"mass:/PS2BBL/CONFIG.INI",
#ifdef MX4SIO
"massX:/PS2BBL/CONFIG.INI",
Expand All @@ -36,7 +36,7 @@ char *CONFIG_PATHS[SOURCE_COUNT] = {
"xfrom:/PS2BBL/CONFIG.INI",
#endif
#ifdef PSX
"mc?:/PS2BBL/XCONFIG.INI",
"mc?:/SYS-CONF/PSXBBL.INI",
#endif
"CONFIG.INI",
"",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(bdm_irx, size_bdm_irx, 0, NULL, &RET);
#else
ID = loadIRXFile("mc?:/PS2BBL/BDM.IRX", 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/BDM.IRX"), 0, NULL, &RET);
#endif
DPRINTF(" [BDM]: ret=%d, ID=%d\n", RET, ID);
if (ID < 0 || RET == 1)
Expand All @@ -497,7 +497,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(bdmfs_fatfs_irx, size_bdmfs_fatfs_irx, 0, NULL, &RET);
#else
ID = loadIRXFile("mc?:/PS2BBL/BDMFS_FATFS.IRX", 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/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 +506,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(usbd_irx, size_usbd_irx, 0, NULL, &RET);
#else
ID = loadIRXFile("mc?:/PS2BBL/USBD.IRX", 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/USBD.IRX"), 0, NULL, &RET);
#endif
delay(3);
DPRINTF(" [USBD]: ret=%d, ID=%d\n", RET, ID);
Expand All @@ -516,7 +516,7 @@ int LoadUSBIRX(void)
#ifdef HAS_EMBEDDED_IRX
ID = SifExecModuleBuffer(usbmass_bd_irx, size_usbmass_bd_irx, 0, NULL, &RET);
#else
ID = loadIRXFile("mc?:/PS2BBL/USBMASS_BD.IRX", 0, NULL, &RET);
ID = SifLoadStartModule(CheckPath("mc?:/PS2BBL/USBMASS_BD.IRX"), 0, NULL, &RET);
#endif
DPRINTF(" [USBMASS_BD]: ret=%d, ID=%d\n", RET, ID);
if (ID < 0 || RET == 1)
Expand Down
40 changes: 1 addition & 39 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,6 @@ void delay(int count)
}
}

#ifdef F_loadIRXFile
int loadIRXFile(char *path, u32 arg_len, const char *args, int *mod_res)
{
FILE *fp;
unsigned char *IRX;
int IRX_SIZE, RET = -1;
if (!strncmp(path, "mc?", 3)) {
path[2] = '0';
if (!exist(path)) {
path[2] = '1';
if (!exist(path))
return -1;
}
} else {
if (!exist(path))
return -1;
}
fp = fopen(path, "r");
fseek(fp, 0, SEEK_END);
IRX_SIZE = ftell(fp);
fseek(fp, 0, SEEK_SET);
IRX = (unsigned char *)malloc(IRX_SIZE);
if (IRX == NULL) {
fclose(fp);
return -2;
}

if (fread(IRX, 1, IRX_SIZE, fp) == IRX_SIZE) {
RET = SifExecModuleBuffer(IRX, IRX_SIZE, arg_len, args, mod_res);
} else {
RET = -3;
}
fclose(fp);
if (IRX != NULL)
free(IRX);
return RET;
}
#endif

int get_CNF_string(char **CNF_p_p,
char **name_p_p,
Expand Down Expand Up @@ -224,4 +186,4 @@ int getMountInfo(char *path, char *mountString, char *mountPoint, char *newCWD)

return 1;
}
#endif
#endif

0 comments on commit b249ae6

Please sign in to comment.