Skip to content

Commit

Permalink
Merge pull request #616 from uyjulian/spu2_stuff_fix
Browse files Browse the repository at this point in the history
SPU2 related additions fix
  • Loading branch information
fjtrujy authored May 17, 2024
2 parents 0b1040c + 7236eac commit 318d023
Show file tree
Hide file tree
Showing 330 changed files with 19,158 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Rules.make
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(subdir_release): dummy
# Directory-level parallelism has been disabled due to issues with
# multiple Make instances running inside a directory at once
# and causing output file corruption
.NOTPARALLEL: $(subdir_list) $(subdir_clean) $(subdir_release)
.NOTPARALLEL:: $(subdir_list) $(subdir_clean) $(subdir_release)
endif

all: $(subdir_list)
Expand Down
5 changes: 5 additions & 0 deletions ee/Rules.bin.make
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ $(PS2SDKSRC)/ee/rpc/cdvd/lib/libcdvd.a:

$(PS2SDKSRC)/ee/libcglue/lib/libcglue.a:
$(MAKEREC) $(PS2SDKSRC)/ee/libcglue

.NOTPARALLEL:: \
$(PS2SDKSRC)/ee/kernel/lib/libkernel.a \
$(PS2SDKSRC)/ee/rpc/cdvd/lib/libcdvd.a \
$(PS2SDKSRC)/ee/libcglue/lib/libcglue.a
endif
12 changes: 10 additions & 2 deletions ee/Rules.make
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ EE_CXX_COMPILE = $(EE_CXX) $(EE_CXXFLAGS)
# Command for ensuring the output directory for the rule exists.
DIR_GUARD = @$(MKDIR) -p $(@D)

MAKE_CURPID := $(shell printf '%s' $$PPID)

PS2SDK_CRT0 = $(PS2SDKSRC)/ee/startup/obj/crt0.o

$(EE_OBJS_DIR)%.o: $(EE_SRC_DIR)%.c
Expand All @@ -101,6 +103,8 @@ $(EE_OBJS_DIR)%.o: $(EE_SRC_DIR)%.s
$(DIR_GUARD)
$(EE_AS) $(EE_ASFLAGS) $< -o $@

.INTERMEDIATE:: $(EE_LIB)_tmp$(MAKE_CURPID)

$(EE_BIN): $(EE_OBJS) $(EE_LIB_ARCHIVES) $(EE_ADDITIONAL_DEPS) $(PS2SDK_CRT0)
$(DIR_GUARD)
$(EE_CC) -T$(EE_LINKFILE) -Wl,-Map,$(EE_BIN_MAPFILE) $(EE_OPTFLAGS) \
Expand All @@ -111,9 +115,13 @@ $(EE_ERL) : $(EE_OBJS)
$(EE_CC) -nostdlib -o $(EE_ERL) $(EE_OBJS) $(EE_CFLAGS) $(EE_LDFLAGS) -Wl,-r -Wl,-d
$(EE_STRIP) --strip-unneeded -R .mdebug.eabi64 -R .reginfo -R .comment $(EE_ERL)

$(EE_LIB): $(EE_OBJS) $(EE_LIB:%.a=%.erl)
$(EE_LIB)_tmp$(MAKE_CURPID): $(EE_OBJS) $(EE_LIB:%.a=%.erl)
$(DIR_GUARD)
$(EE_AR) cru $@ $(EE_OBJS)

$(EE_LIB): $(EE_LIB)_tmp$(MAKE_CURPID)
$(DIR_GUARD)
$(EE_AR) cru $(EE_LIB) $(EE_OBJS)
mv $< $@

$(EE_LIB:%.a=%.erl): $(EE_OBJS)
$(DIR_GUARD)
Expand Down
4 changes: 4 additions & 0 deletions ee/elf-loader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ $(EE_OBJS_DIR)loader.o: $(EE_OBJS_DIR)loader.c

clean::
$(MAKEREC) src/loader clean

.NOTPARALLEL:: \
$(PS2SDKSRC)/tools/bin2c/bin/bin2c \
src/loader/bin/loader.elf
4 changes: 4 additions & 0 deletions ee/iopreboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ $(EE_OBJS_DIR)imgdrv_irx.c: $(EE_SRC_DIR)imgdrv/irx/imgdrv.irx $(PS2SDKSRC)/tool

clean::
$(MAKEREC) $(EE_SRC_DIR)imgdrv clean

.NOTPARALLEL:: \
$(PS2SDKSRC)/tools/bin2c/bin/bin2c \
$(EE_SRC_DIR)imgdrv/irx/imgdrv.irx
7 changes: 7 additions & 0 deletions ee/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,10 @@ clean::
$(MAKEREC) $(EE_SRC_DIR)tlbsrc clean
$(MAKEREC) $(EE_SRC_DIR)srcfile clean
$(MAKEREC) $(EE_SRC_DIR)eenull clean

.NOTPARALLEL:: \
$(PS2SDKSRC)/tools/bin2c/bin/bin2c \
$(EE_SRC_DIR)osdsrc/bin/osdsrc.bin \
$(EE_SRC_DIR)tlbsrc/bin/tlbsrc.bin \
$(EE_SRC_DIR)srcfile/bin/srcfile.bin \
$(EE_SRC_DIR)eenull/bin/eenull.bin
3 changes: 3 additions & 0 deletions ee/network/tcpip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,6 @@ endif
$(EE_OBJS_DIR)udp.o: $(LWIP)/src/core/udp.c
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@

.NOTPARALLEL:: \
$(LWIP)

10 changes: 8 additions & 2 deletions iop/Rules.make
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ IOP_C_COMPILE = $(IOP_CC) $(IOP_CFLAGS)
# Command for ensuring the output directory for the rule exists.
DIR_GUARD = @$(MKDIR) -p $(@D)

MAKE_CURPID := $(shell printf '%s' $$PPID)

$(IOP_OBJS_DIR)%.o: $(IOP_SRC_DIR)%.c
$(DIR_GUARD)
$(IOP_C_COMPILE) -c $< -o $@
Expand All @@ -91,7 +93,7 @@ $(IOP_OBJS_DIR)%.o: $(IOP_SRC_DIR)%.s
$(DIR_GUARD)
$(IOP_AS) $(IOP_ASFLAGS) $< -o $@

.INTERMEDIATE: $(IOP_OBJS_DIR)build-imports.c $(IOP_OBJS_DIR)build-exports.c
.INTERMEDIATE:: $(IOP_LIB)_tmp$(MAKE_CURPID) $(IOP_OBJS_DIR)build-imports.c $(IOP_OBJS_DIR)build-exports.c

$(IOP_OBJS_DIR)template-imports.h:
$(DIR_GUARD)
Expand Down Expand Up @@ -123,6 +125,10 @@ $(IOP_BIN): $(IOP_OBJS) $(IOP_LIB_ARCHIVES) $(IOP_ADDITIONAL_DEPS)
$(DIR_GUARD)
$(IOP_C_COMPILE) $(IOP_OPTFLAGS) -o $(IOP_BIN) $(IOP_OBJS) $(IOP_LDFLAGS) $(IOP_LIB_ARCHIVES) $(IOP_LIBS)

$(IOP_LIB): $(IOP_OBJS)
$(IOP_LIB)_tmp$(MAKE_CURPID): $(IOP_OBJS)
$(DIR_GUARD)
$(IOP_AR) cru $@ $(IOP_OBJS)

$(IOP_LIB): $(IOP_LIB)_tmp$(MAKE_CURPID)
$(DIR_GUARD)
mv $< $@
3 changes: 3 additions & 0 deletions iop/fs/bdm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ include $(PS2SDKSRC)/iop/Rules.release

$(PS2SDKSRC)/iop/fs/libbdm/lib/libbdm.a:
$(MAKEREC) $(PS2SDKSRC)/iop/fs/libbdm

.NOTPARALLEL:: \
$(PS2SDKSRC)/iop/fs/libbdm/lib/libbdm.a
10 changes: 9 additions & 1 deletion iop/sound/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

SUBDIRS = libsd ahx audsrv ps2snd
SUBDIRS = \
ahx \
audsrv \
clearspu \
libsd \
libsnd2 \
libspu2 \
ps2snd \
rspu2drv

include $(PS2SDKSRC)/Defs.make
include $(PS2SDKSRC)/Rules.make
16 changes: 16 additions & 0 deletions iop/sound/clearspu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# _____ ___ ____ ___ ____
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

IOP_OBJS = \
clearspu.o \
imports.o

include $(PS2SDKSRC)/Defs.make
include $(PS2SDKSRC)/iop/Rules.bin.make
include $(PS2SDKSRC)/iop/Rules.make
include $(PS2SDKSRC)/iop/Rules.release
15 changes: 15 additions & 0 deletions iop/sound/clearspu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Clear SPU module

This module clears the SPU2 to a known state.

## Configurations

There are multiple configurations of this library, allowing the choice of
balancing between size, speed, and features.

* `clearspu` -> The recommended version.

## How to use this module in your program

In order to use this module in your program, use `LoadModule` or \
`LoadModuleBuffer` with no arguments.
Loading

0 comments on commit 318d023

Please sign in to comment.