mirror of
https://github.com/jkdansereau/goldeneye-pc-port.git
synced 2026-10-23 15:52:42 +02:00
sync. run make forceextractassets to re extract everythig to c files properly
This commit is contained in:
1 parent
e565375ed4
commit
9fbe1fd5a8
1291 files changed
+131225
-67809
No files matched your search
@@ -17,7 +17,7 @@ COMPARE := 1
|
||||
include include/make/VT100Codes.make
|
||||
include include/make/Gui.make
|
||||
|
||||
# set tooolchain based on current OS
|
||||
# set toolchain based on current OS
|
||||
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
|
||||
TOOLCHAIN := mips-linux-gnu-
|
||||
else ifeq ($(shell type mips64-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
|
||||
@@ -149,7 +149,7 @@ GAMEOBJECTS := $(foreach file,$(GAMEFILES_S),$(BUILD_DIR)/$(file:.s=.o)) \
|
||||
$(foreach file,$(GAMEFILES_C),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
|
||||
ASSET_DATAFILES := assets/GlobalImageTable.c assets/animationtable_data.c assets/animationtable_entries.c assets/font_dl.c assets/font_chardataj.c assets/font_chardatae.c assets/rarewarelogo.c
|
||||
ASSET_DATAFILES := assets/oddtextures.c assets/animationtable_data.c assets/animationtable_entries.c assets/font_dl.c assets/font_chardataj.c assets/font_chardatae.c assets/rarewarelogo.c
|
||||
ASSET_DATAOBJECTS := $(foreach file,$(ASSET_DATAFILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
ROMFILES2 := assets/romfiles2.s
|
||||
@@ -170,7 +170,7 @@ OBSEG_FILES := assets/obseg/ob_seg.s
|
||||
OBSEG_OBJECTS := $(BUILD_DIR)/assets/obseg/ob_seg.o
|
||||
OBSEG_RZ := $(BG_SEG_FILES) $(CHR_RZ_FILES) $(GUN_RZ_FILES) $(PROP_RZ_FILES) $(STAN_RZ_FILES) $(BRIEF_RZ_FILES) $(SETUP_RZ_FILES) $(TEXT_RZ_FILES)
|
||||
|
||||
IMAGE_BINS := $(foreach dir,assets/images/split,$(wildcard $(dir)/*.bin))
|
||||
IMAGE_BINS := assets/images/combined/combined.bin
|
||||
IMAGE_OBJS := $(foreach file,$(IMAGE_BINS),$(BUILD_DIR)/$(file:.bin=.o))
|
||||
|
||||
RZFILES := inflate/inflate.c
|
||||
@@ -209,7 +209,7 @@ LD_SCRIPT := $(BUILD_DIR)/ge007.$(OUTCODE).ld
|
||||
LDFLAGS := -T $(LD_SCRIPT) -Map $(BUILD_DIR)/ge007.$(OUTCODE).map --no-warn-mismatch
|
||||
|
||||
AS := $(TOOLCHAIN)as
|
||||
ASFLAGS := -march=vr4300 -mabi=32 $(INCLUDE) $(ASMDEFS)
|
||||
ASFLAGS := -march=vr4300 -mabi=32 $(INCLUDE) $(ASMDEFS)
|
||||
# Use the system installed armips if available. Otherwise use the one provided with this repository.
|
||||
ifneq (,$(shell which armips 2>/dev/null))
|
||||
ARMIPS := armips
|
||||
@@ -234,20 +234,20 @@ OBJCOPY := $(TOOLCHAIN)objcopy
|
||||
|
||||
## Build Recipes ##
|
||||
|
||||
# Dont delete intermediate files from these targets on make completion.
|
||||
# Don't delete intermediate files from these targets on make completion.
|
||||
.SECONDARY:
|
||||
$(APPELF) $(APPROM) $(APPBIN) $(ULTRAOBJECTS) $(BUILD_DIR)/ge007.$(OUTCODE).map \
|
||||
$(HEADEROBJECTS) $(BOOTOBJECTS) $(CODEOBJECTS) $(GAMEOBJECTS) $(RZOBJECTS) \
|
||||
$(OBSEG_OBJECTS) $(OBSEG_RZ) $(ROMOBJECTS) $(RAMROM_OBJECTS) $(FONTOBJECTS) $(MUSIC_OBJECTS) $(IMAGE_OBJS) $(MUSIC_RZ_FILES)
|
||||
|
||||
# Dont delete these intermediate targets on make cancelation.
|
||||
# Don't delete these intermediate targets on make cancellation.
|
||||
.PRECIOUS: %.bin %.o
|
||||
|
||||
# Run the following targets sequentialy in this order (unnamed targets will still run in parallel)
|
||||
# Run the following targets sequentially in this order (unnamed targets will still run in parallel)
|
||||
.NOTPARALLEL: print_info create_directories $(APPROM) checksum
|
||||
|
||||
# Phony Recipes - These targets are not files, Get Make to do something
|
||||
.PHONY: print_info create_directories build_tools prerequisites checksum all_p1 all default commonclean setupclean stanclean dataclean libultraclean codeclean clean nuke help cmdbuidler test context extractassets textures
|
||||
.PHONY: print_info create_directories build_tools prerequisites checksum all_p1 all default commonclean setupclean stanclean dataclean libultraclean codeclean clean nuke help cmdbuidler test context extractassets forceextractassets textures convert_props convert_chrs convert_guns extract_u extract_e extract_j force_extract_u force_extract_e force_extract_j extract_rsp
|
||||
|
||||
|
||||
# this file references variables defined above: BUILD_DIR, CFLAGWARNING, INCLUDE, LCDEFS
|
||||
@@ -269,7 +269,15 @@ $(BUILD_DIR)/src/%.o: src/%.s
|
||||
$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
#Build Images
|
||||
$(BUILD_DIR)/assets/images/split/%.o: assets/images/split/%.bin
|
||||
# Generate imagelist by syncing imagelist.u.csv (ROM offsets/sizes) with images.def (names)
|
||||
$(BUILD_DIR)/imagelist.csv: imagelist.u.csv assets/images.def
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
python3 scripts/make/sync_imagelist_with_def.py $@
|
||||
|
||||
assets/images/combined/combined.bin: $(BUILD_DIR)/imagelist.csv
|
||||
scripts/make/combine_images_named.sh $(BUILD_DIR)/imagelist.csv assets/images/combined
|
||||
|
||||
$(BUILD_DIR)/assets/images/combined/%.o: assets/images/combined/combined.bin
|
||||
$(LD) -r -b binary $< -o $@
|
||||
|
||||
|
||||
@@ -352,6 +360,8 @@ build_tools:
|
||||
|
||||
prerequisites: print_info create_directories build_tools extractassets
|
||||
|
||||
combine_images: assets/images/combined/combined.bin
|
||||
|
||||
checksum: $(APPROM)
|
||||
ifeq ($(COMPARE), 1)
|
||||
scripts/make/checksum.sh "$(SHA1SUM)" "$(OUTCODE)" "$(BUILD_DIR)"
|
||||
@@ -372,6 +382,7 @@ stanclean: commonclean
|
||||
|
||||
dataclean: commonclean stanclean setupclean
|
||||
rm -f $(OBSEG_OBJECTS) $(OBSEG_RZ) $(ROMOBJECTS) $(RAMROM_OBJECTS) $(FONTOBJECTS) $(MUSIC_OBJECTS) $(IMAGE_OBJS) $(MUSIC_RZ_FILES)
|
||||
rm -f $(BUILD_DIR)/imagelist.csv
|
||||
|
||||
libultraclean: commonclean
|
||||
rm -f $(ULTRAOBJECTS)
|
||||
@@ -437,7 +448,9 @@ endif
|
||||
@rm build/ctx.c build/ctx2.h || exit 0
|
||||
@echo You can find it in Build [build/ctx.h].
|
||||
|
||||
extractassets: extract_u extract_e extract_j
|
||||
extractassets: extract_u extract_e extract_j convert_props convert_chrs convert_guns
|
||||
|
||||
forceextractassets: force_extract_u force_extract_e force_extract_j convert_props convert_chrs convert_guns
|
||||
|
||||
extract_u:
|
||||
@if [ ! -f assets/obseg/ob__ob_end.seg ]; then \
|
||||
@@ -451,6 +464,14 @@ extract_u:
|
||||
echo "Assets for u already extracted."; \
|
||||
fi
|
||||
|
||||
force_extract_u:
|
||||
@echo "Force extracting assets for u..."; \
|
||||
if [ -f baserom.u.z64 ]; then \
|
||||
scripts/extract_baserom.u.sh; \
|
||||
else \
|
||||
echo "Error: baserom.u.z64 not found."; \
|
||||
fi
|
||||
|
||||
extract_e:
|
||||
@if [ ! -f assets/obseg/text/e/LwaxP.bin ]; then \
|
||||
echo "Extracting assets for e..."; \
|
||||
@@ -463,6 +484,14 @@ extract_e:
|
||||
echo "Assets for e already extracted."; \
|
||||
fi
|
||||
|
||||
force_extract_e:
|
||||
@echo "Force extracting assets for e..."; \
|
||||
if [ -f baserom.e.z64 ]; then \
|
||||
scripts/extract_diff.e.sh; \
|
||||
else \
|
||||
echo "Error: baserom.e.z64 not found."; \
|
||||
fi
|
||||
|
||||
extract_j:
|
||||
@if [ ! -f assets/obseg/text/j/LstatJ.bin ]; then \
|
||||
echo "Extracting assets for j..."; \
|
||||
@@ -475,6 +504,14 @@ extract_j:
|
||||
echo "Assets for j already extracted."; \
|
||||
fi
|
||||
|
||||
force_extract_j:
|
||||
@echo "Force extracting assets for j..."; \
|
||||
if [ -f baserom.j.z64 ]; then \
|
||||
scripts/extract_diff.j.sh; \
|
||||
else \
|
||||
echo "Error: baserom.j.z64 not found."; \
|
||||
fi
|
||||
|
||||
extract_rsp:
|
||||
@if [ ! -f build/u/rsp/rspboot.bin ]; then \
|
||||
echo "Extracting rsp assets..."; \
|
||||
@@ -487,6 +524,51 @@ extract_rsp:
|
||||
echo "RSP assets for already extracted."; \
|
||||
fi
|
||||
|
||||
convert_props:
|
||||
@echo "Converting prop binaries to Model.c..."
|
||||
@bin_count=$$(ls assets/obseg/prop/P*Z.bin 2>/dev/null | wc -l); \
|
||||
if [ $$bin_count -gt 0 ]; then \
|
||||
echo "Found $$bin_count prop binaries to convert..."; \
|
||||
python3 scripts/generate_prop_model_c.py --force --cleanup || true; \
|
||||
else \
|
||||
c_count=$$(find assets/obseg/prop -maxdepth 2 -name "Model.c" 2>/dev/null | wc -l); \
|
||||
if [ $$c_count -gt 0 ]; then \
|
||||
echo "Props already converted ($$c_count Model.c files found)."; \
|
||||
else \
|
||||
echo "No prop binaries found to convert."; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
convert_chrs:
|
||||
@echo "Converting chr binaries to Model.c..."
|
||||
@bin_count=$$(ls assets/obseg/chr/C*Z.bin 2>/dev/null | wc -l); \
|
||||
if [ $$bin_count -gt 0 ]; then \
|
||||
echo "Found $$bin_count chr binaries to convert..."; \
|
||||
python3 scripts/generate_chr_c.py --force --cleanup || true; \
|
||||
else \
|
||||
c_count=$$(find assets/obseg/chr -maxdepth 2 -name "Model.c" 2>/dev/null | wc -l); \
|
||||
if [ $$c_count -gt 0 ]; then \
|
||||
echo "Chrs already converted ($$c_count Model.c files found)."; \
|
||||
else \
|
||||
echo "No chr binaries found to convert."; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
convert_guns:
|
||||
@echo "Converting gun binaries to Model.c..."
|
||||
@bin_count=$$(ls assets/obseg/gun/G*Z.bin 2>/dev/null | wc -l); \
|
||||
if [ $$bin_count -gt 0 ]; then \
|
||||
echo "Found $$bin_count gun binaries to convert..."; \
|
||||
python3 scripts/generate_gun_c.py --force --cleanup || true; \
|
||||
else \
|
||||
c_count=$$(find assets/obseg/gun -maxdepth 2 -name "Model.c" 2>/dev/null | wc -l); \
|
||||
if [ $$c_count -gt 0 ]; then \
|
||||
echo "Guns already converted ($$c_count Model.c files found)."; \
|
||||
else \
|
||||
echo "No gun binaries found to convert."; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
textures: tools/mktex/build/tex2png
|
||||
@echo "Processing textures..."
|
||||
mkdir -p assets/images/out
|
||||
@@ -497,4 +579,4 @@ tools/mktex/build/tex2png:
|
||||
@if [ ! -f tools/mktex/build/tex2png ]; then \
|
||||
echo "Building tex2png..."; \
|
||||
cd tools/mktex && $(MAKE); \
|
||||
fi
|
||||
fi
|
||||
Reference in new issue
Block a user