From a4056abd3ca2028e8e2cd45b0201157da9d13963 Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Sat, 12 Apr 2025 05:17:26 +0100 Subject: [PATCH] Split RSP files (#1806) --- Makefile | 4 +++ rsp/aspMain.s | 18 ++++++++++++ rsp/gspF3DZEX2.NoN.PosLight.fifo.s | 17 ++++++++++++ rsp/gspS2DEX2.fifo.s | 18 ++++++++++++ rsp/njpgdspMain.s | 18 ++++++++++++ {src/boot => rsp}/rspboot.s | 0 spec/spec | 7 +++-- src/code/rspcode.s | 44 ------------------------------ 8 files changed, 80 insertions(+), 46 deletions(-) create mode 100644 rsp/aspMain.s create mode 100644 rsp/gspF3DZEX2.NoN.PosLight.fifo.s create mode 100644 rsp/gspS2DEX2.fifo.s create mode 100644 rsp/njpgdspMain.s rename {src/boot => rsp}/rspboot.s (100%) delete mode 100644 src/code/rspcode.s diff --git a/Makefile b/Makefile index d7b2765994..81710a94a3 100644 --- a/Makefile +++ b/Makefile @@ -267,6 +267,7 @@ else SRC_DIRS := $(shell find src -type d) endif +RSP_DIRS := $(shell find rsp -type d) ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*") $(shell find data -type d) ifneq ($(wildcard $(EXTRACTED_DIR)/assets/audio),) @@ -363,11 +364,13 @@ C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS_C_FILES),$(wildcard S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s)) \ $(shell grep -F "\$$(BUILD_DIR)/asm" $(SPEC) | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.s/') \ $(shell grep -F "\$$(BUILD_DIR)/data" $(SPEC) | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.s/') +RSP_FILES := $(foreach dir,$(RSP_DIRS),$(wildcard $(dir)/*.s)) SCHEDULE_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.schl)) BASEROM_FILES := $(shell grep -F "\$$(BUILD_DIR)/baserom" $(SPEC) | sed 's/.*$$(BUILD_DIR)\/// ; s/\.o\".*//') ARCHIVES_O := $(shell grep -F ".yar.o" $(SPEC) | sed 's/.*include "// ; s/.*$$(BUILD_DIR)\/// ; s/\.o\".*/.o/') O_FILES := $(foreach f,$(S_FILES:.s=.o),$(BUILD_DIR)/$f) \ $(foreach f,$(C_FILES:.c=.o),$(BUILD_DIR)/$f) \ + $(foreach f,$(RSP_FILES:.s=.o),$(BUILD_DIR)/$f) \ $(foreach f,$(ASSET_C_FILES_EXTRACTED:.c=.o),$(f:$(EXTRACTED_DIR)/%=$(BUILD_DIR)/%)) \ $(foreach f,$(ASSET_C_FILES_COMMITTED:.c=.o),$(BUILD_DIR)/$f) \ $(foreach f,$(BASEROM_FILES),$(BUILD_DIR)/$f.o) \ @@ -391,6 +394,7 @@ OTHER_DIRS := assets/text baserom dmadata $(shell find linker_scripts -type d) # create build directories $(shell mkdir -p $(foreach dir, \ + $(RSP_DIRS) \ $(SRC_DIRS) \ $(ASM_DIRS) \ $(OTHER_DIRS), \ diff --git a/rsp/aspMain.s b/rsp/aspMain.s new file mode 100644 index 0000000000..c6946c8c1e --- /dev/null +++ b/rsp/aspMain.s @@ -0,0 +1,18 @@ +.include "macro.inc" + +.section .text + +.balign 16 + +glabel aspMainTextStart + .incbin "incbin/aspMainText" +endlabel aspMainTextStart +dlabel aspMainTextEnd + +.section .rodata + +.balign 16 + +dlabel aspMainDataStart + .incbin "incbin/aspMainData" +dlabel aspMainDataEnd diff --git a/rsp/gspF3DZEX2.NoN.PosLight.fifo.s b/rsp/gspF3DZEX2.NoN.PosLight.fifo.s new file mode 100644 index 0000000000..1d0d1106e0 --- /dev/null +++ b/rsp/gspF3DZEX2.NoN.PosLight.fifo.s @@ -0,0 +1,17 @@ +.include "macro.inc" + +.section .rodata + +.balign 16 + +dlabel gspF3DZEX2_NoN_PosLight_fifoTextStart + .incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoText" +dlabel gspF3DZEX2_NoN_PosLight_fifoTextEnd + +.section .rodata + +.balign 16 + +dlabel gspF3DZEX2_NoN_PosLight_fifoDataStart + .incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoData" +dlabel gspF3DZEX2_NoN_PosLight_fifoDataEnd diff --git a/rsp/gspS2DEX2.fifo.s b/rsp/gspS2DEX2.fifo.s new file mode 100644 index 0000000000..d619f63da8 --- /dev/null +++ b/rsp/gspS2DEX2.fifo.s @@ -0,0 +1,18 @@ +.include "macro.inc" + +.section .text + +.balign 16 + +glabel gspS2DEX2_fifoTextStart + .incbin "incbin/gspS2DEX2_fifoText" +endlabel gspS2DEX2_fifoTextStart +dlabel gspS2DEX2_fifoTextEnd + +.section .rodata + +.balign 16 + +dlabel gspS2DEX2_fifoDataStart + .incbin "incbin/gspS2DEX2_fifoData" +dlabel gspS2DEX2_fifoDataEnd diff --git a/rsp/njpgdspMain.s b/rsp/njpgdspMain.s new file mode 100644 index 0000000000..294444cd88 --- /dev/null +++ b/rsp/njpgdspMain.s @@ -0,0 +1,18 @@ +.include "macro.inc" + +.section .text + +.balign 16 + +glabel njpgdspMainTextStart + .incbin "incbin/njpgdspMainText" +endlabel njpgdspMainTextStart +dlabel njpgdspMainTextEnd + +.section .rodata + +.balign 16 + +dlabel njpgdspMainDataStart + .incbin "incbin/njpgdspMainData" +dlabel njpgdspMainDataEnd diff --git a/src/boot/rspboot.s b/rsp/rspboot.s similarity index 100% rename from src/boot/rspboot.s rename to rsp/rspboot.s diff --git a/spec/spec b/spec/spec index e8cd722fc1..79fd43a88c 100644 --- a/spec/spec +++ b/spec/spec @@ -243,7 +243,7 @@ beginseg include "$(BUILD_DIR)/src/boot/libc/strcpy.o" include "$(BUILD_DIR)/src/boot/libc/memmove.o" include "$(BUILD_DIR)/src/boot/build.o" - include "$(BUILD_DIR)/src/boot/rspboot.o" + include "$(BUILD_DIR)/rsp/rspboot.o" #ifdef COMPILER_GCC include "$(BUILD_DIR)/src/gcc_fix/missing_gcc_functions.o" @@ -780,7 +780,10 @@ beginseg include "$(BUILD_DIR)/assets/audio/sequence_font_table.o" include "$(BUILD_DIR)/src/audio/tables/sequence_table.o" include "$(BUILD_DIR)/src/audio/tables/samplebank_table.o" - include "$(BUILD_DIR)/src/code/rspcode.o" + include "$(BUILD_DIR)/rsp/aspMain.o" + include "$(BUILD_DIR)/rsp/gspF3DZEX2.NoN.PosLight.fifo.o" + include "$(BUILD_DIR)/rsp/gspS2DEX2.fifo.o" + include "$(BUILD_DIR)/rsp/njpgdspMain.o" endseg // The game expects all the segments after the `code` segment and before the first overlay to be `NOLOAD` ones diff --git a/src/code/rspcode.s b/src/code/rspcode.s deleted file mode 100644 index e7e53298f2..0000000000 --- a/src/code/rspcode.s +++ /dev/null @@ -1,44 +0,0 @@ -.include "macro.inc" - -.section .text - -.balign 16 - -glabel aspMainTextStart - .incbin "incbin/aspMainText" -endlabel aspMainTextStart -dlabel aspMainTextEnd - -glabel gspS2DEX2_fifoTextStart - .incbin "incbin/gspS2DEX2_fifoText" -endlabel gspS2DEX2_fifoTextStart -dlabel gspS2DEX2_fifoTextEnd - -glabel njpgdspMainTextStart - .incbin "incbin/njpgdspMainText" -endlabel njpgdspMainTextStart -dlabel njpgdspMainTextEnd - -.section .rodata - -.balign 16 - -dlabel aspMainDataStart - .incbin "incbin/aspMainData" -dlabel aspMainDataEnd - -dlabel gspF3DZEX2_NoN_PosLight_fifoTextStart - .incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoText" -dlabel gspF3DZEX2_NoN_PosLight_fifoTextEnd - -dlabel gspF3DZEX2_NoN_PosLight_fifoDataStart - .incbin "incbin/gspF3DZEX2_NoN_PosLight_fifoData" -dlabel gspF3DZEX2_NoN_PosLight_fifoDataEnd - -dlabel gspS2DEX2_fifoDataStart - .incbin "incbin/gspS2DEX2_fifoData" -dlabel gspS2DEX2_fifoDataEnd - -dlabel njpgdspMainDataStart - .incbin "incbin/njpgdspMainData" -dlabel njpgdspMainDataEnd