From 98e56ee2e35170bf703cc4c62e289dfb8ae7a294 Mon Sep 17 00:00:00 2001 From: Wolfywolfy Date: Sun, 29 Sep 2024 14:01:27 -0300 Subject: [PATCH 1/2] Update to latest PS2SDK. --- .github/workflows/compilation.yml | 2 +- ee/src/sjpcm_rpc.c | 3 +- iop/Makefile | 14 ++++-- iop/Rules.make | 74 ------------------------------- iop/Rules.release | 38 ---------------- iop/src/hw.S | 13 ++++++ iop/src/hw.h | 20 +++++++++ iop/src/sjpcm_irx.c | 5 +-- 8 files changed, 47 insertions(+), 122 deletions(-) delete mode 100644 iop/Rules.make delete mode 100644 iop/Rules.release create mode 100644 iop/src/hw.h diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index e405b0c..d01a519 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -7,7 +7,7 @@ on: jobs: build: runs-on: ubuntu-latest - container: ps2dev/ps2dev:v1.0 + container: ps2dev/ps2dev:latest # instead of "ps2dev/ps2dev:latest" you can use different tags, for example for old projects you can use "ps2dev/ps2dev:v1.0" steps: - name: Install dependencies diff --git a/ee/src/sjpcm_rpc.c b/ee/src/sjpcm_rpc.c index 070dcfe..daa6766 100644 --- a/ee/src/sjpcm_rpc.c +++ b/ee/src/sjpcm_rpc.c @@ -48,13 +48,12 @@ void SjPCM_Puts(char *format, ...) { static char buff[4096]; va_list args; - int rv; if (!sjpcm_inited) return; va_start(args, format); - rv = vsnprintf(buff, 4096, format, args); + vsnprintf(buff, 4096, format, args); memcpy((char *)(&sbuff[0]), buff, 252); SifCallRpc(&cd0, SJPCM_PUTS, 0, (void *)(&sbuff[0]), 252, (void *)(&sbuff[0]), 252, 0, 0); diff --git a/iop/Makefile b/iop/Makefile index 4685f05..e097936 100644 --- a/iop/Makefile +++ b/iop/Makefile @@ -15,7 +15,6 @@ IOP_SRC_DIR = src/ IOP_BIN = $(IOP_BIN_DIR)isjpcm.irx IOP_OBJS = hw.o sjpcm_irx.o spu2.o imports.o -IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%) IOP_CFLAGS += -fno-builtin-printf # IOP_CFLAGS += -DISJPCM @@ -27,6 +26,15 @@ all: $(IOP_OBJS_DIR) $(IOP_BIN_DIR) $(IOP_BIN) builtin builtin: bin2c $(IOP_BIN) $(IOP_BIN_DIR)isjpcmIrx.c isjpcmIrx +$(IOP_OBJS_DIR): + $(MKDIR) -p $(IOP_OBJS_DIR) + +$(IOP_BIN_DIR): + $(MKDIR) -p $(IOP_BIN_DIR) + +$(IOP_LIB_DIR): + $(MKDIR) -p $(IOP_LIB_DIR) + clean: rm -f -r $(IOP_OBJS_DIR) $(IOP_BIN_DIR) @@ -35,5 +43,5 @@ install: cp $(IOP_BIN) $(DESTDIR)$(PS2DEV)/isjpcm/bin include $(PS2SDK)/Defs.make -# include $(PS2SDK)/samples/Makefile.iopglobal -include ./Rules.make +include $(PS2SDK)/samples/Makefile.iopglobal + diff --git a/iop/Rules.make b/iop/Rules.make deleted file mode 100644 index b6ab6ed..0000000 --- a/iop/Rules.make +++ /dev/null @@ -1,74 +0,0 @@ -# _____ ___ ____ ___ ____ -# ____| | ____| | | |____| -# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. -#----------------------------------------------------------------------- -# Copyright 2001-2004, ps2dev - http://www.ps2dev.org -# Licenced under Academic Free License version 2.0 -# Review ps2sdk README & LICENSE files for further details. -# - -IOP_CC_VERSION := $(shell $(IOP_CC) --version 2>&1 | sed -n 's/^.*(GCC) //p') - -# include dir -IOP_INCS := $(IOP_INCS) -Iinclude - -# C compiler flags -IOP_CFLAGS := -D_IOP -fno-builtin -O2 -G0 -Wall $(IOP_INCS) $(IOP_CFLAGS) -# -fno-builtin is required to prevent the GCC built-in functions from being included, -# for finer-grained control over what goes into each IRX. -# -msoft-float is to "remind" GCC/Binutils that the soft-float ABI is to be used. This is due to a bug, which -# results in the ABI not being passed correctly to binutils and iop-as defaults to the hard-float ABI instead. -# -mno-explicit-relocs is required to work around the fact that GCC is now known to -# output multiple LO relocs after one HI reloc (which the IOP kernel cannot deal with). -ifneq ($(IOP_CC_VERSION),3.2.2) -ifneq ($(IOP_CC_VERSION),3.2.3) -IOP_CFLAGS += -msoft-float -mno-explicit-relocs -IOP_IETABLE_CFLAGS := -fno-toplevel-reorder -endif -endif - -# Linker flags -IOP_LDFLAGS := -nostdlib -s $(IOP_LDFLAGS) - -# Assembler flags -IOP_ASFLAGS := $(ASFLAGS_TARGET) -msoft-float -EL -G0 $(IOP_ASFLAGS) - -# Externally defined variables: IOP_BIN, IOP_OBJS, IOP_LIB - -$(IOP_OBJS_DIR)%.o : $(IOP_SRC_DIR)%.c - $(IOP_CC) $(IOP_CFLAGS) -c $< -o $@ - -$(IOP_OBJS_DIR)%.o : $(IOP_SRC_DIR)%.S - $(IOP_CC) $(IOP_CFLAGS) $(IOP_INCS) -c $< -o $@ - -$(IOP_OBJS_DIR)%.o : $(IOP_SRC_DIR)%.s - $(IOP_AS) $(IOP_ASFLAGS) $< -o $@ - -# A rule to build imports.lst. -$(IOP_OBJS_DIR)%.o : $(IOP_SRC_DIR)%.lst - $(ECHO) "#include \"irx_imports.h\"" > $(IOP_OBJS_DIR)build-imports.c - cat $< >> $(IOP_OBJS_DIR)build-imports.c - $(IOP_CC) $(IOP_CFLAGS) $(IOP_IETABLE_CFLAGS) -I$(IOP_SRC_DIR) -c $(IOP_OBJS_DIR)build-imports.c -o $@ - -rm -f $(IOP_OBJS_DIR)build-imports.c - -# A rule to build exports.tab. -$(IOP_OBJS_DIR)%.o : $(IOP_SRC_DIR)%.tab - $(ECHO) "#include \"irx.h\"" > $(IOP_OBJS_DIR)build-exports.c - cat $< >> $(IOP_OBJS_DIR)build-exports.c - $(IOP_CC) $(IOP_CFLAGS) $(IOP_IETABLE_CFLAGS) -I$(IOP_SRC_DIR) -c $(IOP_OBJS_DIR)build-exports.c -o $@ - -rm -f $(IOP_OBJS_DIR)build-exports.c - -$(IOP_OBJS_DIR): - $(MKDIR) -p $(IOP_OBJS_DIR) - -$(IOP_BIN_DIR): - $(MKDIR) -p $(IOP_BIN_DIR) - -$(IOP_LIB_DIR): - $(MKDIR) -p $(IOP_LIB_DIR) - -$(IOP_BIN) : $(IOP_OBJS) - $(IOP_CC) $(IOP_CFLAGS) -o $(IOP_BIN) $(IOP_OBJS) $(IOP_LDFLAGS) $(IOP_LIBS) - -$(IOP_LIB) : $(IOP_OBJS) - $(IOP_AR) cru $(IOP_LIB) $(IOP_OBJS) diff --git a/iop/Rules.release b/iop/Rules.release deleted file mode 100644 index fdf7273..0000000 --- a/iop/Rules.release +++ /dev/null @@ -1,38 +0,0 @@ -# _____ ___ ____ ___ ____ -# ____| | ____| | | |____| -# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. -#----------------------------------------------------------------------- -# Copyright 2001-2004, ps2dev - http://www.ps2dev.org -# Licenced under Academic Free License version 2.0 -# Review ps2sdk README & LICENSE files for further details. -# -# $Id: Rules.release 977 2005-04-11 12:30:04Z pixel $ - - -RELEASE_IOP_DIRS = iop/ iop/include/ iop/irx/ iop/lib -RELEASE_IOP_DIRS := $(RELEASE_IOP_DIRS:%=$(PS2SDK)/%) - -$(RELEASE_IOP_DIRS): - mkdir $(RELEASE_IOP_DIRS) - -release: all $(RELEASE_IOP_DIRS) - @if test $(IOP_BIN) ; then \ - echo Installing $(IOP_BIN) to $(PS2SDK)/iop/irx ; \ - cp -f $(IOP_BIN) $(PS2SDK)/iop/irx/ ; \ - fi; - @if test $(IOP_LIB) ; then \ - echo Installing $(IOP_LIB) to $(PS2SDK)/iop/lib ; \ - cp -f $(IOP_LIB) $(PS2SDK)/iop/lib/ ; \ - fi; - @if test -d include ; then \ - for file in include/*; do \ - if test -f $$file ; then \ - echo Installing $$file to $(PS2SDK)/iop/include ; \ - cp -f $$file $(PS2SDK)/iop/include ; \ - fi \ - done; \ - fi; - -release-clean: - rm -f $(PS2SDK)/iop/include/*.* - rm -f $(PS2SDK)/iop/lib/*.* diff --git a/iop/src/hw.S b/iop/src/hw.S index 05a966f..7c4f0d0 100644 --- a/iop/src/hw.S +++ b/iop/src/hw.S @@ -1,4 +1,16 @@ +/* +# _____ ___ ____ ___ ____ +# ____| | ____| | | |____| +# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. +#----------------------------------------------------------------------- +# Copyright 2001-2004, ps2dev - http://www.ps2dev.org +# Licenced under Academic Free License version 2.0 +# Review ps2sdk README & LICENSE files for further details. +*/ + + .text +.set push .set noreorder .globl wmemcpy @@ -21,3 +33,4 @@ wmemcopy_end: nop .end wmemcpy +.set pop \ No newline at end of file diff --git a/iop/src/hw.h b/iop/src/hw.h new file mode 100644 index 0000000..c693da6 --- /dev/null +++ b/iop/src/hw.h @@ -0,0 +1,20 @@ +/* +# _____ ___ ____ ___ ____ +# ____| | ____| | | |____| +# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. +#----------------------------------------------------------------------- +# Copyright 2005, ps2dev - http://www.ps2dev.org +# Licenced under GNU Library General Public License version 2 +*/ + +/** + * @file + * word-copy helper + */ + +#ifndef __WMEMCPY_INCLUDED__ +#define __WMEMCPY_INCLUDED__ + +void wmemcpy(void *dest, const void *src, int numwords); + +#endif \ No newline at end of file diff --git a/iop/src/sjpcm_irx.c b/iop/src/sjpcm_irx.c index 4d0bde1..c8a7465 100644 --- a/iop/src/sjpcm_irx.c +++ b/iop/src/sjpcm_irx.c @@ -27,6 +27,7 @@ */ #include "irx_imports.h" +#include "hw.h" #if defined(LIBSD) && defined(ISJPCM) #error You must either define LIBSD or ISJPCM, not both at once. @@ -103,10 +104,6 @@ void *SjPCM_SetNumBlocks(unsigned int *sbuff); void *SjPCM_SetThreshold(unsigned int *sbuff); void *SjPCM_Quit(); -extern void wmemcpy(void *dest, void *src, int numwords); - - - static unsigned int buffer[0x80]; int memoryAllocated = 0; From b24cc85bca411aeef589b52e8e8b3e2d88d5535b Mon Sep 17 00:00:00 2001 From: Wolfywolfy Date: Sun, 29 Sep 2024 14:28:00 -0300 Subject: [PATCH 2/2] Switch to gcr.io --- .github/workflows/compilation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index d01a519..1c13da4 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -7,7 +7,7 @@ on: jobs: build: runs-on: ubuntu-latest - container: ps2dev/ps2dev:latest + container: ghcr.io/ps2homebrew/ps2homebrew:main # instead of "ps2dev/ps2dev:latest" you can use different tags, for example for old projects you can use "ps2dev/ps2dev:v1.0" steps: - name: Install dependencies @@ -15,6 +15,7 @@ jobs: apk add build-base git zip - uses: actions/checkout@v2 - run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" git fetch --prune --unshallow - name: Compile project run: |