From d206d555ebeacfde0b85ad000272ed09fd3aaf31 Mon Sep 17 00:00:00 2001 From: MisterSheeple <27652712+MisterSheeple@users.noreply.github.com> Date: Tue, 14 Nov 2023 05:57:18 -0500 Subject: [PATCH 1/5] Update Dockerfile to Ubuntu 22.04 as 18.04 is EOL + Clean up unused packages in Dockerfile (#538) * Update Dockerfile to Ubuntu 22.04 also: - Update packages for Dockerfile and instructions * Add missing package for hexdump * Make usage message consistent --- Dockerfile | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index e4f13f6d..587cb06b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,17 @@ -FROM ubuntu:18.04 as build +FROM ubuntu:22.04 as build RUN apt-get update && \ apt-get install -y \ - binutils-mips-linux-gnu \ - bsdmainutils \ + bsdextrautils \ build-essential \ - libaudiofile-dev \ - python3 \ - wget \ git \ libglew-dev \ - libsdl2-dev + libsdl2-dev \ + python3 -RUN wget \ - https://github.com/n64decomp/qemu-irix/releases/download/v2.11-deb/qemu-irix-2.11.0-2169-g32ab296eef_amd64.deb \ - -O qemu.deb && \ - echo 8170f37cf03a08cc2d7c1c58f10d650ea0d158f711f6916da9364f6d8c85f741 qemu.deb | sha256sum --check && \ - dpkg -i qemu.deb && \ - rm qemu.deb +RUN mkdir /sm64ex +WORKDIR /sm64ex +ENV PATH="/sm64ex/tools:${PATH}" -RUN mkdir /sm64 -WORKDIR /sm64 -ENV PATH="/sm64/tools:${PATH}" - -CMD echo 'usage: docker run --rm --mount type=bind,source="$(pwd)",destination=/sm64 sm64 make VERSION=${VERSION:-us} -j4\n' \ - 'see https://github.com/n64decomp/sm64/blob/master/README.md for advanced usage' +CMD echo 'Usage: docker run --rm -v ${PWD}:/sm64ex sm64ex make BETTERCAMERA=1 EXTERNAL_DATA=1 -j4\n' \ + 'See https://github.com/sm64pc/sm64ex/wiki/Compiling-on-Docker for more information' From 578536ea31fd1c392f14d90e379bfaf883bc5207 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 19 Dec 2023 00:54:07 +0100 Subject: [PATCH 2/5] some Makefile fixes how the fuck did this work before? --- Makefile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9e971e41..287ad961 100644 --- a/Makefile +++ b/Makefile @@ -738,11 +738,11 @@ res: $(BASEPACK_PATH) $(BASEPACK_LST): $(EXE) @mkdir -p $(BUILD_DIR)/$(BASEDIR) @touch $(BASEPACK_LST) - @echo "$(BUILD_DIR)/sound/bank_sets sound/bank_sets" >> $(BASEPACK_LST) + @echo "$(BUILD_DIR)/sound/bank_sets sound/bank_sets" > $(BASEPACK_LST) @echo "$(BUILD_DIR)/sound/sequences.bin sound/sequences.bin" >> $(BASEPACK_LST) @echo "$(BUILD_DIR)/sound/sound_data.ctl sound/sound_data.ctl" >> $(BASEPACK_LST) @echo "$(BUILD_DIR)/sound/sound_data.tbl sound/sound_data.tbl" >> $(BASEPACK_LST) - @$(foreach f, $(wildcard $(SKYTILE_DIR)/*), echo $(f) gfx/$(f:$(BUILD_DIR)/%=%) >> $(BASEPACK_LST);) + @cd $(BUILD_DIR) ; find textures/skybox_tiles -name \*.png -exec echo "$(BUILD_DIR)/{} gfx/{}" >> basepack.lst \; @find actors -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \; @find levels -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \; @find textures -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \; @@ -769,9 +769,13 @@ test: $(ROM) load: $(ROM) $(LOADER) $(LOADER_FLAGS) $< +ifneq ($(RPC_LIBS),) + $(BUILD_DIR)/$(RPC_LIBS): @$(CP) -f $(RPC_LIBS) $(BUILD_DIR) +endif + libultra: $(BUILD_DIR)/libultra.a $(BUILD_DIR)/asm/boot.o: $(IPL3_RAW_FILES) @@ -905,18 +909,18 @@ $(ENDIAN_BITWIDTH): tools/determine-endian-bitwidth.c @rm $@.dummy1 @rm $@.dummy2 -$(SOUND_BIN_DIR)/sound_data.ctl: sound/sound_banks/ $(SOUND_BANK_FILES) $(SOUND_SAMPLE_AIFCS) $(ENDIAN_BITWIDTH) - $(PYTHON) tools/assemble_sound.py $(BUILD_DIR)/sound/samples/ sound/sound_banks/ $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH)) +$(SOUND_BIN_DIR)/sound_data.ctl: sound/sound_banks $(SOUND_BANK_FILES) $(SOUND_SAMPLE_AIFCS) $(ENDIAN_BITWIDTH) + $(PYTHON) tools/assemble_sound.py $(BUILD_DIR)/sound/samples sound/sound_banks $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH)) $(SOUND_BIN_DIR)/sound_data.tbl: $(SOUND_BIN_DIR)/sound_data.ctl @true ifeq ($(VERSION),sh) -$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences/ sound/sequences/jp/ $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH) - $(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH)) +$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences sound/sequences/jp $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH) + $(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH)) else -$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences/ sound/sequences/$(VERSION)/ $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH) - $(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH)) +$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences sound/sequences/$(VERSION) $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH) + $(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH)) endif $(SOUND_BIN_DIR)/bank_sets: $(SOUND_BIN_DIR)/sequences.bin @@ -1026,7 +1030,7 @@ $(BUILD_DIR)/%.o: %.s -$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(BUILD_DIR)/$(RPC_LIBS) +$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LD) -L $(BUILD_DIR) -o $@ $(O_FILES) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LDFLAGS) .PHONY: all clean distclean default diff test load libultra res From 8000f6bb3d13f2ed44a4dd4f8491d082df492c22 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 19 Dec 2023 01:22:12 +0100 Subject: [PATCH 3/5] fix #514 --- src/pc/gfx/gfx_opengl_legacy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pc/gfx/gfx_opengl_legacy.c b/src/pc/gfx/gfx_opengl_legacy.c index 2e3f1216..ac8f2da2 100644 --- a/src/pc/gfx/gfx_opengl_legacy.c +++ b/src/pc/gfx/gfx_opengl_legacy.c @@ -146,10 +146,10 @@ static inline GLenum texenv_set_texture_color(struct ShaderProgram *prg) { switch (prg->shader_id) { case 0x0000038D: // mario's eyes - case 0x01045A00: // peach letter case 0x01200A00: // intro copyright fade in mode = GL_DECAL; break; + case 0x01045A00: // peach letter, explosions case 0x00000551: // goddard mode = GL_BLEND; break; @@ -264,6 +264,9 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad struct ShaderProgram *prg = &shader_program_pool[shader_program_pool_size++]; + printf("new shader 0x%08x\n", shader_id); + fflush(stdout); + prg->shader_id = shader_id; prg->cc = ccf; prg->num_inputs = ccf.num_inputs; From e35f2ba8ef4e28f84e8df644932c1ee524436d55 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 19 Dec 2023 01:22:53 +0100 Subject: [PATCH 4/5] remove debug prints from gfx_opengl_legacy.c --- src/pc/gfx/gfx_opengl_legacy.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pc/gfx/gfx_opengl_legacy.c b/src/pc/gfx/gfx_opengl_legacy.c index ac8f2da2..2afcfcd9 100644 --- a/src/pc/gfx/gfx_opengl_legacy.c +++ b/src/pc/gfx/gfx_opengl_legacy.c @@ -264,9 +264,6 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad struct ShaderProgram *prg = &shader_program_pool[shader_program_pool_size++]; - printf("new shader 0x%08x\n", shader_id); - fflush(stdout); - prg->shader_id = shader_id; prg->cc = ccf; prg->num_inputs = ccf.num_inputs; From 951389ca84a65e56f04834306be5cba8614db283 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 19 Dec 2023 01:55:41 +0100 Subject: [PATCH 5/5] allow mouse buttons when BETTERCAMERA is disabled (fix #496) --- src/pc/controller/controller_sdl1.c | 7 ++++--- src/pc/controller/controller_sdl2.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pc/controller/controller_sdl1.c b/src/pc/controller/controller_sdl1.c index 37316674..927cb730 100644 --- a/src/pc/controller/controller_sdl1.c +++ b/src/pc/controller/controller_sdl1.c @@ -123,9 +123,10 @@ static void controller_sdl_init(void) { #ifdef BETTERCAMERA if (newcam_mouse == 1) SDL_WM_GrabInput(SDL_GRAB_ON); - SDL_GetRelativeMouseState(&mouse_x, &mouse_y); #endif + SDL_GetRelativeMouseState(&mouse_x, &mouse_y); + controller_sdl_bind(); init_ok = true; @@ -152,7 +153,8 @@ static void controller_sdl_read(OSContPad *pad) { SDL_WM_GrabInput(SDL_GRAB_ON); else SDL_WM_GrabInput(SDL_GRAB_OFF); - +#endif + u32 mouse = SDL_GetRelativeMouseState(&mouse_x, &mouse_y); for (u32 i = 0; i < num_mouse_binds; ++i) @@ -162,7 +164,6 @@ static void controller_sdl_read(OSContPad *pad) { // remember buttons that changed from 0 to 1 last_mouse = (mouse_buttons ^ mouse) & mouse; mouse_buttons = mouse; -#endif if (!sdl_joy) return; diff --git a/src/pc/controller/controller_sdl2.c b/src/pc/controller/controller_sdl2.c index c7e9c7c7..2001e7fe 100644 --- a/src/pc/controller/controller_sdl2.c +++ b/src/pc/controller/controller_sdl2.c @@ -112,9 +112,10 @@ static void controller_sdl_init(void) { #ifdef BETTERCAMERA if (newcam_mouse == 1) SDL_SetRelativeMouseMode(SDL_TRUE); - SDL_GetRelativeMouseState(&mouse_x, &mouse_y); #endif + SDL_GetRelativeMouseState(&mouse_x, &mouse_y); + controller_sdl_bind(); init_ok = true; @@ -156,7 +157,8 @@ static void controller_sdl_read(OSContPad *pad) { SDL_SetRelativeMouseMode(SDL_TRUE); else SDL_SetRelativeMouseMode(SDL_FALSE); - +#endif + u32 mouse = SDL_GetRelativeMouseState(&mouse_x, &mouse_y); for (u32 i = 0; i < num_mouse_binds; ++i) @@ -166,7 +168,6 @@ static void controller_sdl_read(OSContPad *pad) { // remember buttons that changed from 0 to 1 last_mouse = (mouse_buttons ^ mouse) & mouse; mouse_buttons = mouse; -#endif SDL_GameControllerUpdate();