From 3ef569abfdcafe5847d68706ead84648c5871a5d Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 4 Oct 2019 23:43:42 +1000 Subject: [PATCH] Add aiLabel to setup's command_pointers array --- Makefile | 2 ++ ld/setup.ld | 12 +++++++++++- src/game/game.c | 1 + src/include/game.h | 8 ++++++++ src/setup.c | 3 ++- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/include/game.h diff --git a/Makefile b/Makefile index d38f53da3..92c1a877d 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,8 @@ $(B_DIR)/setup.elf: $(B_DIR)/setup.o $(B_DIR)/ucode/setup.bin: $(B_DIR)/setup.elf mkdir -p $(B_DIR)/ucode $(TOOLCHAIN)-objcopy $< $@ -O binary + dd if="$@" of="$@.tmp" bs=200256 count=1 + mv "$@.tmp" "$@" ################################################################################ # Rarezip diff --git a/ld/setup.ld b/ld/setup.ld index ba3237428..6b653fbf1 100644 --- a/ld/setup.ld +++ b/ld/setup.ld @@ -3,10 +3,20 @@ OUTPUT_ARCH (mips) SECTIONS { - .data 0x80059fe0 : AT(0x0000) { + .setup 0x80059fe0 : AT(0x0000) { build/ntsc-final/setup.o (.data); } + .game 0x7f000000 : AT(SIZEOF(.setup)) { + build/ntsc-final/game.o (.text); + build/ntsc-final/game.o (.data); + } + + .gvars 0x80099fc0 : AT(SIZEOF(.setup) + SIZEOF(.game)) { + build/ntsc-final/gvars.o (.text); + build/ntsc-final/gvars.o (.data); + } + /DISCARD/ : { * (.MIPS.abiflags); * (.options); diff --git a/src/game/game.c b/src/game/game.c index d85ccf7d9..1d6be4a61 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -1,6 +1,7 @@ #include "ultra64.h" #include "src/include/constants.h" #include "src/include/gvars.h" +#include "src/include/game.h" GLOBAL_ASM( glabel func0f000000 diff --git a/src/include/game.h b/src/include/game.h new file mode 100644 index 000000000..617f096b2 --- /dev/null +++ b/src/include/game.h @@ -0,0 +1,8 @@ +#ifndef _IN_GAME_H +#define _IN_GAME_H +#include +#include "src/include/constants.h" + +bool aiLabel(void); + +#endif diff --git a/src/setup.c b/src/setup.c index de2fc4a45..8e8d81c60 100644 --- a/src/setup.c +++ b/src/setup.c @@ -1,4 +1,5 @@ #include +#include "src/include/game.h" #include "src/include/setup.h" #include "src/include/stagesetup.h" #include "src/include/types.h" @@ -13948,7 +13949,7 @@ u32 var0000e4ac = 0x00000000; u32 command_pointers[] = { /*0x0000*/ 0x7f04dbc0, /*0x0001*/ 0x7f04dbfc, - /*0x0002*/ 0x7f04dc3c, + /*0x0002*/ aiLabel, /*0x0003*/ 0x7f04dc58, /*0x0004*/ 0x7f04e0a8, /*0x0005*/ 0x7f04dd08,