├── .gitignore ├── .gitmodules ├── .vscode └── c_cpp_properties.json ├── LICENSE ├── Makefile ├── README.md ├── generate_symbols.toml ├── include ├── dummy_headers │ ├── assets │ │ ├── code │ │ │ └── sub_s │ │ │ │ └── sub_s.h │ │ ├── objects │ │ │ └── object_fall2 │ │ │ │ └── object_fall2.h │ │ └── text │ │ │ ├── message_data.h │ │ │ └── message_data_staff.h │ ├── code │ │ └── sub_s │ │ │ └── sub_s.h │ └── objects │ │ ├── gameplay_keep │ │ └── gameplay_keep.h │ │ ├── object_boss03 │ │ └── object_boss03.h │ │ ├── object_boss04 │ │ └── object_boss04.h │ │ └── object_ha │ │ └── object_ha.h ├── modding.h ├── recompconfig.h ├── recompdata.h ├── recompui.h ├── recompui_event_structs.h ├── recomputils.h ├── rt64_extended_gbi.h └── z64recomp_api.h ├── mod.ld ├── mod.toml ├── offline_build └── mod_recomp.h ├── overlays.us.rev1.txt └── src └── always_spin_attack.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | *.elf 4 | *.bin 5 | *.exe 6 | *.dll 7 | *.lib 8 | *.pdb 9 | *.exp 10 | ./funcs.h 11 | patches.map 12 | build/ 13 | .vscode/settings.json 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Zelda64RecompSyms"] 2 | path = Zelda64RecompSyms 3 | url = https://github.com/Zelda64Recomp/Zelda64RecompSyms 4 | [submodule "mm-decomp"] 5 | path = mm-decomp 6 | url = https://github.com/zeldaret/mm 7 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Mod", 5 | "includePath": [ 6 | "${workspaceFolder}/include", 7 | "${workspaceFolder}/include/dummy_headers", 8 | "${workspaceFolder}/mm-decomp/include", 9 | "${workspaceFolder}/mm-decomp/src", 10 | "${workspaceFolder}/mm-decomp/extracted/n64-us" 11 | ], 12 | "defines": [ 13 | "F3DEX_GBI_2", 14 | "_LANGUAGE_C", 15 | "MIPS" 16 | ], 17 | "compilerPath": "clang", 18 | "cStandard": "c99", 19 | "intelliSenseMode": "clang-x86" 20 | } 21 | ], 22 | "version": 4 23 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BUILD_DIR := build 2 | 3 | # Allow the user to specify the compiler and linker on macOS 4 | # as Apple Clang does not support MIPS architecture 5 | ifeq ($(OS),Windows_NT) 6 | CC := clang 7 | LD := ld.lld 8 | else ifneq ($(shell uname),Darwin) 9 | CC := clang 10 | LD := ld.lld 11 | else 12 | CC ?= clang 13 | LD ?= ld.lld 14 | endif 15 | 16 | TARGET := $(BUILD_DIR)/mod.elf 17 | 18 | LDSCRIPT := mod.ld 19 | CFLAGS := -target mips -mips2 -mabi=32 -O2 -G0 -mno-abicalls -mno-odd-spreg -mno-check-zero-division \ 20 | -fomit-frame-pointer -ffast-math -fno-unsafe-math-optimizations -fno-builtin-memset \ 21 | -Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable \ 22 | -Wno-missing-braces -Wno-unsupported-floating-point-opt -Werror=section 23 | CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -DF3DEX_GBI_2 -DF3DEX_GBI_PL -DGBI_DOWHILE -I include -I include/dummy_headers \ 24 | -I mm-decomp/include -I mm-decomp/src -I mm-decomp/extracted/n64-us -I mm-decomp/include/libc 25 | LDFLAGS := -nostdlib -T $(LDSCRIPT) -Map $(BUILD_DIR)/mod.map --unresolved-symbols=ignore-all --emit-relocs -e 0 --no-nmagic 26 | 27 | C_SRCS := $(wildcard src/*.c) 28 | C_OBJS := $(addprefix $(BUILD_DIR)/, $(C_SRCS:.c=.o)) 29 | C_DEPS := $(addprefix $(BUILD_DIR)/, $(C_SRCS:.c=.d)) 30 | 31 | $(TARGET): $(C_OBJS) $(LDSCRIPT) | $(BUILD_DIR) 32 | $(LD) $(C_OBJS) $(LDFLAGS) -o $@ 33 | 34 | $(BUILD_DIR) $(BUILD_DIR)/src: 35 | ifeq ($(OS),Windows_NT) 36 | mkdir $(subst /,\,$@) 37 | else 38 | mkdir -p $@ 39 | endif 40 | 41 | $(C_OBJS): $(BUILD_DIR)/%.o : %.c | $(BUILD_DIR) $(BUILD_DIR)/src 42 | $(CC) $(CFLAGS) $(CPPFLAGS) $< -MMD -MF $(@:.o=.d) -c -o $@ 43 | 44 | clean: 45 | rm -rf $(BUILD_DIR) 46 | 47 | -include $(C_DEPS) 48 | 49 | .PHONY: clean 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Majora's Mask: Recompiled Mod Template 2 | 3 | This is an example mod for Majora's Mask: Recompiled that can be used as a template for creating mods. It has a basic build system, headers, sample code, and a mod config toml. 4 | 5 | Example code for using the recompui API to build ingame UI can be found in the `ui-example` branch. 6 | 7 | ### Writing mods 8 | See [this document](https://hackmd.io/fMDiGEJ9TBSjomuZZOgzNg) for an explanation of the modding framework, including how to write function patches and perform interop between different mods. 9 | 10 | ### Tools 11 | You'll need to install `clang` and `make` to build this template. 12 | * On Windows, using [chocolatey](https://chocolatey.org/) to install both is recommended. The packages are `llvm` and `make` respectively. 13 | * The LLVM 19.1.0 [llvm-project](https://github.com/llvm/llvm-project) release binary, which is also what chocolatey provides, does not support MIPS correctly. The solution is to install 18.1.8 instead, which can be done in chocolatey by specifying `--version 18.1.8` or by downloading the 18.1.8 release directly. 14 | * On Linux, these can both be installed using your distro's package manager. 15 | * On MacOS, these can both be installed using Homebrew. Apple clang won't work, as you need a mips target for building the mod code. 16 | 17 | On Linux and MacOS, you'll need to also ensure that you have the `zip` utility installed. 18 | 19 | You'll also need to grab a build of the `RecompModTool` utility from the releases of [N64Recomp](https://github.com/N64Recomp/N64Recomp). You can also build it yourself from that repo if desired. 20 | 21 | ### Building 22 | * First, run `make` (with an optional job count) to build the mod code itself. 23 | * Next, run the `RecompModTool` utility with `mod.toml` as the first argument and the build dir (`build` in the case of this template) as the second argument. 24 | * This will produce your mod's `.nrm` file in the build folder. 25 | * If you're on MacOS, you may need to specify the path to the `clang` and `ld.lld` binaries using the `CC` and `LD` environment variables, respectively. 26 | 27 | ### Updating the Majora's Mask Decompilation Submodule 28 | Mods can also be made with newer versions of the Majora's Mask decompilation instead of the commit targeted by this repo's submodule. 29 | To update the commit of the decompilation that you're targeting, follow these steps: 30 | * Build the [N64Recomp](https://github.com/N64Recomp/N64Recomp) repo and copy the N64Recomp executable to the root of this repository. 31 | * Build the version of the Majora's Mask decompilation that you want to update to and copy the resulting .elf file to the root of this repository. 32 | * Update the `mm-decomp` submodule in your clone of this repo to point to the commit you built in the previous step. 33 | * Run `N64Recomp generate_symbols.toml --dump-context` 34 | * Rename `dump.toml` and `data_dump.toml` to `mm.us.rev1.syms.toml` and `mm.us.rev1.datasyms.toml` respectively. 35 | * Place both files in the `Zelda64RecompSyms` folder. 36 | * Try building. 37 | * If it succeeds, you're done. 38 | * If it fails due to a missing header, create an empty header file in the `include/dummy_headers` folder, with the same path. 39 | * For example, if it complains that `assets/objects/object_cow/object_cow.h` is missing, create an empty `include/dummy_headers/objects/object_cow.h` file. 40 | * If RecompModTool fails due to a function "being marked as a patch but not existing in the original ROM", it's likely that function you're patching was renamed in the Majora's Mask decompilation. 41 | * Find the relevant function in the map file for the old decomp commit, then go to that address in the new map file, and update the reference to this function in your code with the new name. 42 | -------------------------------------------------------------------------------- /generate_symbols.toml: -------------------------------------------------------------------------------- 1 | # Config file for Majora's Mask NTSC 1.0 Recompilation. 2 | 3 | [input] 4 | entrypoint = 0x80080000 5 | # Paths are relative to the location of this config file. 6 | output_func_path = "RecompiledFuncs" 7 | relocatable_sections_path = "overlays.us.rev1.txt" 8 | elf_path = "mm-n64-us.elf" 9 | -------------------------------------------------------------------------------- /include/dummy_headers/assets/code/sub_s/sub_s.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zelda64Recomp/MMRecompModTemplate/124249dc35271d20a80c9906adf44bf409e216fc/include/dummy_headers/assets/code/sub_s/sub_s.h -------------------------------------------------------------------------------- /include/dummy_headers/assets/objects/object_fall2/object_fall2.h: -------------------------------------------------------------------------------- 1 | // Required to include MM decomp headers without having built the repo 2 | 3 | #ifndef OBJECT_FALL2_H 4 | #define OBJECT_FALL2_H 1 5 | 6 | extern Vtx object_fall2Vtx_000000[]; 7 | extern Gfx gOpenMouthMoonDL[]; 8 | extern u64 gOpenMouthMoonFarSideTLUT[]; 9 | extern u64 gOpenMouthMoonFaceTLUT[]; 10 | extern u64 gOpenMouthMoonEyesTex[]; 11 | extern u64 gOpenMouthMoonFarSideTex[]; 12 | extern u64 gOpenMouthMoonFaceTex[]; 13 | extern u64 gOpenMouthMoonTeethTex[]; 14 | extern u8 object_fall2_Blob_005EF4[]; 15 | extern Vtx object_fall2_Vtx_005F10[]; 16 | extern Gfx object_fall2_DL_006E00[]; 17 | extern Gfx object_fall2_DL_006EF0[]; 18 | extern Gfx object_fall2_DL_006FF8[]; 19 | extern Gfx object_fall2_DL_007100[]; 20 | extern Gfx object_fall2_DL_007208[]; 21 | extern Gfx object_fall2_DL_007310[]; 22 | extern Gfx object_fall2_DL_007418[]; 23 | extern Gfx object_fall2_DL_007520[]; 24 | extern Gfx object_fall2_DL_007628[]; 25 | extern Gfx object_fall2_DL_007730[]; 26 | extern u64 object_fall2_Tex_007838[]; 27 | extern u64 object_fall2_Tex_008038[]; 28 | extern AnimatedMatTexScrollParams object_fall2_Matanimheader_008840TexScrollParams_008838[]; 29 | extern AnimatedMaterial object_fall2_Matanimheader_008840[]; 30 | extern u8 object_fall2_Blob_008898[]; 31 | #endif 32 | -------------------------------------------------------------------------------- /include/dummy_headers/assets/text/message_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zelda64Recomp/MMRecompModTemplate/124249dc35271d20a80c9906adf44bf409e216fc/include/dummy_headers/assets/text/message_data.h -------------------------------------------------------------------------------- /include/dummy_headers/assets/text/message_data_staff.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zelda64Recomp/MMRecompModTemplate/124249dc35271d20a80c9906adf44bf409e216fc/include/dummy_headers/assets/text/message_data_staff.h -------------------------------------------------------------------------------- /include/dummy_headers/code/sub_s/sub_s.h: -------------------------------------------------------------------------------- 1 | // Required to include MM decomp headers without having built the repo 2 | 3 | #ifndef SUB_S_H 4 | #define SUB_S_H 1 5 | 6 | extern Vtx codeVtx_120260[]; 7 | extern Gfx gShadowMaterialDL[]; 8 | extern Gfx gShadowModelDL[]; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/dummy_headers/objects/gameplay_keep/gameplay_keep.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zelda64Recomp/MMRecompModTemplate/124249dc35271d20a80c9906adf44bf409e216fc/include/dummy_headers/objects/gameplay_keep/gameplay_keep.h -------------------------------------------------------------------------------- /include/dummy_headers/objects/object_boss03/object_boss03.h: -------------------------------------------------------------------------------- 1 | // Required to include MM decomp headers without having built the repo 2 | 3 | #ifndef OBJECT_BOSS03_H 4 | #define OBJECT_BOSS03_H 1 5 | 6 | typedef enum GyorgLimb { 7 | /* 0x00 */ GYORG_LIMB_NONE, 8 | /* 0x01 */ GYORG_LIMB_ROOT, 9 | /* 0x02 */ GYORG_LIMB_HEAD, 10 | /* 0x03 */ GYORG_LIMB_BODY_ROOT, 11 | /* 0x04 */ GYORG_LIMB_UPPER_TRUNK, 12 | /* 0x05 */ GYORG_LIMB_LOWER_TRUNK, 13 | /* 0x06 */ GYORG_LIMB_TAIL, 14 | /* 0x07 */ GYORG_LIMB_RIGHT_FIN_ROOT, 15 | /* 0x08 */ GYORG_LIMB_UPPER_RIGHT_FIN, 16 | /* 0x09 */ GYORG_LIMB_LOWER_RIGHT_FIN, 17 | /* 0x0A */ GYORG_LIMB_LEFT_FIN_ROOT, 18 | /* 0x0B */ GYORG_LIMB_UPPER_LEFT_FIN, 19 | /* 0x0C */ GYORG_LIMB_LOWER_LEFT_FIN, 20 | /* 0x0D */ GYORG_LIMB_JAW_ROOT, 21 | /* 0x0E */ GYORG_LIMB_JAW, 22 | /* 0x0F */ GYORG_LIMB_MAX 23 | } GyorgLimb; 24 | 25 | typedef enum GyorgSmallFishLimb { 26 | /* 0x00 */ GYORG_SMALL_FISH_LIMB_NONE, 27 | /* 0x01 */ GYORG_SMALL_FISH_LIMB_ROOT, 28 | /* 0x02 */ GYORG_SMALL_FISH_LIMB_BODY_ROOT, 29 | /* 0x03 */ GYORG_SMALL_FISH_LIMB_TRUNK_ROOT, 30 | /* 0x04 */ GYORG_SMALL_FISH_LIMB_TAIL_FIN, 31 | /* 0x05 */ GYORG_SMALL_FISH_LIMB_TRUNK, 32 | /* 0x06 */ GYORG_SMALL_FISH_LIMB_LEFT_FIN, 33 | /* 0x07 */ GYORG_SMALL_FISH_LIMB_DORSAL_FIN, 34 | /* 0x08 */ GYORG_SMALL_FISH_LIMB_RIGHT_FIN, 35 | /* 0x09 */ GYORG_SMALL_FISH_LIMB_HEAD, 36 | /* 0x0A */ GYORG_SMALL_FISH_LIMB_MAX 37 | } GyorgSmallFishLimb; 38 | 39 | extern s16 sGyorgIdleAnimFrameData[]; 40 | extern JointIndex sGyorgIdleAnimJointIndices[]; 41 | extern AnimationHeader gGyorgIdleAnim; 42 | extern u64 gGyorgUnusedMajorasWrathWhipTex[]; 43 | extern Vtx object_boss03Vtx_0001A0[]; 44 | extern Gfx gGyorgUnusedMajorasWrathWhipDL1[]; 45 | extern Gfx gGyorgUnusedMajorasWrathWhipDL2[]; 46 | extern Gfx gGyorgUnusedMajorasWrathWhipDL3[]; 47 | extern Vtx object_boss03Vtx_0002D8[]; 48 | extern Gfx gGyorgHeadDL[]; 49 | extern Gfx gGyorgJawDL[]; 50 | extern Gfx gGyorgUpperLeftFinDL[]; 51 | extern Gfx gGyorgLowerLeftFinDL[]; 52 | extern Gfx gGyorgUpperRightFinDL[]; 53 | extern Gfx gGyorgLowerRightFinDL[]; 54 | extern Gfx gGyorgUpperTrunkDL[]; 55 | extern Gfx gGyorgLowerTrunkDL[]; 56 | extern Gfx gGyorgTailDL[]; 57 | extern AnimatedMaterial gGyorgUnused5388TexAnim[]; 58 | extern u64 gGyorgFinsSpikesAndJawTLUT[]; 59 | extern u64 gGyorgSidesTLUT[]; 60 | extern u64 gGyorgMouthAndSpikeBacksideTLUT[]; 61 | extern u64 gGyorgBellyAndFinFleshTLUT[]; 62 | extern u64 gGyorgEyeTex[]; 63 | extern u64 gGyorgFinsSpikesAndJawTex[]; 64 | extern u64 gGyorgSidesTex[]; 65 | extern u64 gGyorgMouthAndSpikeBacksideTex[]; 66 | extern u64 gGyorgBellyAndFinFleshTex[]; 67 | extern u64 gGyorgHornsTeethAndClawsTex[]; 68 | extern Vtx object_boss03Vtx_007E10[]; 69 | extern Gfx gGyorgBubbleMaterialDL[]; 70 | extern Gfx gGyorgBubbleModelDL[]; 71 | extern u64 gGyorgTitleCardTex[]; 72 | extern StandardLimb gGyorgRootLimb; 73 | extern StandardLimb gGyorgHeadLimb; 74 | extern StandardLimb gGyorgBodyRootLimb; 75 | extern StandardLimb gGyorgUpperTrunkLimb; 76 | extern StandardLimb gGyorgLowerTrunkLimb; 77 | extern StandardLimb gGyorgTailLimb; 78 | extern StandardLimb gGyorgRightFinRootLimb; 79 | extern StandardLimb gGyorgUpperRightFinLimb; 80 | extern StandardLimb gGyorgLowerRightFinLimb; 81 | extern StandardLimb gGyorgLeftFinRootLimb; 82 | extern StandardLimb gGyorgUpperLeftFinLimb; 83 | extern StandardLimb gGyorgLowerLeftFinLimb; 84 | extern StandardLimb gGyorgJawRootLimb; 85 | extern StandardLimb gGyorgJawLimb; 86 | extern void* gGyorgSkelLimbs[]; 87 | extern FlexSkeletonHeader gGyorgSkel; 88 | extern s16 sGyorgFloppingAnimFrameData[]; 89 | extern JointIndex sGyorgFloppingAnimJointIndices[]; 90 | extern AnimationHeader gGyorgFloppingAnim; 91 | extern s16 sGyorgJumpingAnimFrameData[]; 92 | extern JointIndex sGyorgJumpingAnimJointIndices[]; 93 | extern AnimationHeader gGyorgJumpingAnim; 94 | extern s16 sGyorgStunnedAnimFrameData[]; 95 | extern JointIndex sGyorgStunnedAnimJointIndices[]; 96 | extern AnimationHeader gGyorgStunnedAnim; 97 | extern s16 sGyorgBackingUpAnimFrameData[]; 98 | extern JointIndex sGyorgBackingUpAnimJointIndices[]; 99 | extern AnimationHeader gGyorgBackingUpAnim; 100 | extern s16 sGyorgFastSwimmingAnimFrameData[]; 101 | extern JointIndex sGyorgFastSwimmingAnimJointIndices[]; 102 | extern AnimationHeader gGyorgFastSwimmingAnim; 103 | extern s16 sGyorgGentleSwimmingAnimFrameData[]; 104 | extern JointIndex sGyorgGentleSwimmingAnimJointIndices[]; 105 | extern AnimationHeader gGyorgGentleSwimmingAnim; 106 | extern s16 sGyorgTailSweepAnimFrameData[]; 107 | extern JointIndex sGyorgTailSweepAnimJointIndices[]; 108 | extern AnimationHeader gGyorgTailSweepAnim; 109 | extern s16 sGyorgCrawlingAnimFrameData[]; 110 | extern JointIndex sGyorgCrawlingAnimJointIndices[]; 111 | extern AnimationHeader gGyorgCrawlingAnim; 112 | extern Vtx object_boss03Vtx_00A6E0[]; 113 | extern Gfx gGyorgSeaweedPiece1DL[]; 114 | extern Gfx gGyorgSeaweedPiece2DL[]; 115 | extern Gfx gGyorgSeaweedPiece3DL[]; 116 | extern Gfx gGyorgSeaweedPiece4DL[]; 117 | extern Gfx gGyorgSeaweedPiece5DL[]; 118 | extern Gfx gGyorgSeaweedTopDL[]; 119 | extern u64 gGyorgSeaweedTopTLUT[]; 120 | extern u64 gGyorgSeaweedTLUT[]; 121 | extern u64 gGyorgSeaweedTopTex[]; 122 | extern u64 gGyorgSeaweedTex[]; 123 | extern AnimatedMaterial gGyorgUnusedBB00TexAnim[]; 124 | extern Vtx object_boss03Vtx_00BB10[]; 125 | extern Gfx gUnusedGyorgSmallFishHeadDL[]; 126 | extern Gfx gUnusedGyorgSmallFishTrunkDL[]; 127 | extern Gfx gUnusedGyorgSmallFishRightFinDL[]; 128 | extern Gfx gUnusedGyorgSmallFishDorsalFinDL[]; 129 | extern Gfx gUnusedGyorgSmallFishLeftFinDL[]; 130 | extern Gfx gUnusedGyorgSmallFishTailFinDL[]; 131 | extern u64 gUnusedGyorgSmallFishTLUT[]; 132 | extern u64 gUnusedGyorgSmallFishTex[]; 133 | extern Vtx object_boss03Vtx_00CA50[]; 134 | extern Gfx gGyorgSmallFishHeadDL[]; 135 | extern Gfx gGyorgSmallFishTrunkDL[]; 136 | extern Gfx gGyorgSmallFishRightFinDL[]; 137 | extern Gfx gGyorgSmallFishDorsalFinDL[]; 138 | extern Gfx gGyorgSmallFishLeftFinDL[]; 139 | extern Gfx gGyorgSmallFishTailFinDL[]; 140 | extern u64 gGyorgSmallFishTLUT[]; 141 | extern u64 gGyorgSmallFishTex[]; 142 | extern StandardLimb gGyorgSmallFishRootLimb; 143 | extern StandardLimb gGyorgSmallFishBodyRootLimb; 144 | extern StandardLimb gGyorgSmallFishTrunkRootLimb; 145 | extern StandardLimb gGyorgSmallFishTailFinLimb; 146 | extern StandardLimb gGyorgSmallFishTrunkLimb; 147 | extern StandardLimb gGyorgSmallFishLeftFinLimb; 148 | extern StandardLimb gGyorgSmallFishDorsalFinLimb; 149 | extern StandardLimb gGyorgSmallFishRightFinLimb; 150 | extern StandardLimb gGyorgSmallFishHeadLimb; 151 | extern void* gGyorgSmallFishSkelLimbs[]; 152 | extern FlexSkeletonHeader gGyorgSmallFishSkel; 153 | extern s16 sGyorgSmallFishSwimAnimFrameData[]; 154 | extern JointIndex sGyorgSmallFishSwimAnimJointIndices[]; 155 | extern AnimationHeader gGyorgSmallFishSwimAnim; 156 | #endif 157 | -------------------------------------------------------------------------------- /include/dummy_headers/objects/object_boss04/object_boss04.h: -------------------------------------------------------------------------------- 1 | // Required to include MM decomp headers without having built the repo 2 | 3 | #ifndef OBJECT_BOSS04_H 4 | #define OBJECT_BOSS04_H 1 5 | 6 | typedef enum WartLimb { 7 | /* 0x00 */ WART_LIMB_NONE, 8 | /* 0x01 */ WART_LIMB_ROOT, 9 | /* 0x02 */ WART_LIMB_BODY, 10 | /* 0x03 */ WART_LIMB_EYE_ROOT, 11 | /* 0x04 */ WART_LIMB_EYE, 12 | /* 0x05 */ WART_LIMB_TOP_EYELID_ROOT, 13 | /* 0x06 */ WART_LIMB_TOP_EYELID, 14 | /* 0x07 */ WART_LIMB_BOTTOM_EYELID_ROOT, 15 | /* 0x08 */ WART_LIMB_BOTTOM_EYELID, 16 | /* 0x09 */ WART_LIMB_MAX 17 | } WartLimb; 18 | 19 | extern s16 sWartIdleAnimFrameData[]; 20 | extern JointIndex sWartIdleAnimJointIndices[]; 21 | extern AnimationHeader gWartIdleAnim; 22 | extern Vtx object_boss04Vtx_000060[]; 23 | extern Gfx gWartShellDL[]; 24 | extern Gfx gWartBottomEyelidDL[]; 25 | extern Gfx gWartTopEyelidDL[]; 26 | extern Gfx gWartEyeDL[]; 27 | extern u64 gWartShellTLUT[]; 28 | extern u64 gWartRidgesTLUT[]; 29 | extern u64 gWartShellTex[]; 30 | extern u64 gWartRidgesTex[]; 31 | extern u64 gWartEyeTex[]; 32 | extern Vtx object_boss04Vtx_0033A8[]; 33 | extern Gfx gWartBubbleOpaqueMaterialDL[]; 34 | extern Gfx gWartBubbleMaterialDL[]; 35 | extern Gfx gWartBubbleModelDL[]; 36 | extern u64 gWartBubbleTex[]; 37 | extern Vtx object_boss04Vtx_003CE0[]; 38 | extern u64 gWartShadowTex[]; 39 | extern Gfx gWartShadowMaterialDL[]; 40 | extern Gfx gWartShadowModelDL[]; 41 | extern StandardLimb gWartRootLimb; 42 | extern StandardLimb gWartBodyLimb; 43 | extern StandardLimb gWartEyeRootLimb; 44 | extern StandardLimb gWartEyeLimb; 45 | extern StandardLimb gWartTopEyelidRootLimb; 46 | extern StandardLimb gWartTopEyelidLimb; 47 | extern StandardLimb gWartBottomEyelidRootLimb; 48 | extern StandardLimb gWartBottomEyelidLimb; 49 | extern void* gWartSkelLimbs[]; 50 | extern FlexSkeletonHeader gWartSkel; 51 | #endif 52 | -------------------------------------------------------------------------------- /include/dummy_headers/objects/object_ha/object_ha.h: -------------------------------------------------------------------------------- 1 | // Required to include MM decomp headers without having built the repo 2 | 3 | #ifndef OBJECT_HA_H 4 | #define OBJECT_HA_H 1 5 | 6 | typedef enum DonkeyBanditLimb { 7 | /* 0x00 */ HORSE_BANDIT_LIMB_NONE, 8 | /* 0x01 */ HORSE_BANDIT_LIMB_ROOT, 9 | /* 0x02 */ HORSE_BANDIT_LIMB_PELVIS, 10 | /* 0x03 */ HORSE_BANDIT_LIMB_TORSO, 11 | /* 0x04 */ HORSE_BANDIT_LIMB_LEFT_FRONT_LEG_ROOT, 12 | /* 0x05 */ HORSE_BANDIT_LIMB_LEFT_FRONT_FOREARM, 13 | /* 0x06 */ HORSE_BANDIT_LIMB_LEFT_FRONT_CANNON, 14 | /* 0x07 */ HORSE_BANDIT_LIMB_LEFT_FRONT_FOOT, 15 | /* 0x08 */ HORSE_BANDIT_LIMB_LOWER_NECK, 16 | /* 0x09 */ HORSE_BANDIT_LIMB_UPPER_NECK, 17 | /* 0x0A */ HORSE_BANDIT_LIMB_HEAD, 18 | /* 0x0B */ HORSE_BANDIT_LIMB_RIGHT_FRONT_LEG_ROOT, 19 | /* 0x0C */ HORSE_BANDIT_LIMB_RIGHT_FRONT_FOREARM, 20 | /* 0x0D */ HORSE_BANDIT_LIMB_RIGHT_FRONT_CANNON, 21 | /* 0x0E */ HORSE_BANDIT_LIMB_RIGHT_FRONT_FOOT, 22 | /* 0x0F */ HORSE_BANDIT_LIMB_TAIL_DOCK, 23 | /* 0x10 */ HORSE_BANDIT_LIMB_TAIL_MIDDLE, 24 | /* 0x11 */ HORSE_BANDIT_LIMB_TAIL_END, 25 | /* 0x12 */ HORSE_BANDIT_LIMB_LEFT_HIND_THIGH, 26 | /* 0x13 */ HORSE_BANDIT_LIMB_LEFT_HIND_STIFLE, 27 | /* 0x14 */ HORSE_BANDIT_LIMB_LEFT_HIND_CANNON, 28 | /* 0x15 */ HORSE_BANDIT_LIMB_LEFT_HIND_FOOT, 29 | /* 0x16 */ HORSE_BANDIT_LIMB_RIGHT_HIND_THIGH, 30 | /* 0x17 */ HORSE_BANDIT_LIMB_RIGHT_HIND_STIFLE, 31 | /* 0x18 */ HORSE_BANDIT_LIMB_RIGHT_HIND_CANNON, 32 | /* 0x19 */ HORSE_BANDIT_LIMB_RIGHT_HIND_FOOT, 33 | /* 0x1A */ HORSE_BANDIT_LIMB_MAX 34 | } DonkeyBanditLimb; 35 | 36 | typedef enum DonkeyLimb { 37 | /* 0x00 */ DONKEY_LIMB_NONE, 38 | /* 0x01 */ DONKEY_LIMB_ROOT, 39 | /* 0x02 */ DONKEY_LIMB_PELVIS, 40 | /* 0x03 */ DONKEY_LIMB_TORSO, 41 | /* 0x04 */ DONKEY_LIMB_LEFT_FRONT_LEG_ROOT, 42 | /* 0x05 */ DONKEY_LIMB_LEFT_FRONT_FOREARM, 43 | /* 0x06 */ DONKEY_LIMB_LEFT_FRONT_CANNON, 44 | /* 0x07 */ DONKEY_LIMB_LEFT_FRONT_FOOT, 45 | /* 0x08 */ DONKEY_LIMB_LOWER_NECK, 46 | /* 0x09 */ DONKEY_LIMB_UPPER_NECK, 47 | /* 0x0A */ DONKEY_LIMB_HEAD, 48 | /* 0x0B */ DONKEY_LIMB_RIGHT_FRONT_LEG_ROOT, 49 | /* 0x0C */ DONKEY_LIMB_RIGHT_FRONT_FOREARM, 50 | /* 0x0D */ DONKEY_LIMB_RIGHT_FRONT_CANNON, 51 | /* 0x0E */ DONKEY_LIMB_RIGHT_FRONT_FOOT, 52 | /* 0x0F */ DONKEY_LIMB_TAIL_DOCK, 53 | /* 0x10 */ DONKEY_LIMB_TAIL_MIDDLE, 54 | /* 0x11 */ DONKEY_LIMB_TAIL_END, 55 | /* 0x12 */ DONKEY_LIMB_LEFT_HIND_THIGH, 56 | /* 0x13 */ DONKEY_LIMB_LEFT_HIND_STIFLE, 57 | /* 0x14 */ DONKEY_LIMB_LEFT_HIND_CANNON, 58 | /* 0x15 */ DONKEY_LIMB_LEFT_HIND_FOOT, 59 | /* 0x16 */ DONKEY_LIMB_RIGHT_HIND_THIGH, 60 | /* 0x17 */ DONKEY_LIMB_RIGHT_HIND_STIFLE, 61 | /* 0x18 */ DONKEY_LIMB_RIGHT_HIND_CANNON, 62 | /* 0x19 */ DONKEY_LIMB_RIGHT_HIND_FOOT, 63 | /* 0x1A */ DONKEY_LIMB_MAX 64 | } DonkeyLimb; 65 | 66 | extern s16 sHorseUnusedAnimFrameData[]; 67 | extern JointIndex sHorseUnusedAnimJointIndices[]; 68 | extern AnimationHeader gHorseUnusedAnim; 69 | extern Vtx object_haVtx_0000E0[]; 70 | extern Gfx gHorseBanditRightHindFootDL[]; 71 | extern Gfx gHorseBanditRightHindCannonDL[]; 72 | extern Gfx gHorseBanditRightHindStifleDL[]; 73 | extern Gfx gHorseBanditRightHindThighDL[]; 74 | extern Gfx gHorseBanditLeftHindFootDL[]; 75 | extern Gfx gHorseBanditLeftHindCannonDL[]; 76 | extern Gfx gHorseBanditLeftHindStifleDL[]; 77 | extern Gfx gHorseBanditLeftHindThighDL[]; 78 | extern Gfx gHorseBanditTailEndDL[]; 79 | extern Gfx gHorseBanditTailMiddleDL[]; 80 | extern Gfx gHorseBanditTailDockDL[]; 81 | extern Gfx gHorseBanditPelvisDL[]; 82 | extern Gfx gHorseBanditRightFrontFootDL[]; 83 | extern Gfx gHorseBanditRightFrontCannonDL[]; 84 | extern Gfx gHorseBanditRightFrontForearmDL[]; 85 | extern Gfx gHorseBanditRightFrontLegRootDL[]; 86 | extern Gfx gHorseBanditHeadDL[]; 87 | extern Gfx gHorseBanditUpperNeckDL[]; 88 | extern Gfx gHorseBanditLowerNeckDL[]; 89 | extern Gfx gHorseBanditLeftFrontFootDL[]; 90 | extern Gfx gHorseBanditLeftFrontCannonDL[]; 91 | extern Gfx gHorseBanditLeftFrontForearmDL[]; 92 | extern Gfx gHorseBanditLeftFrontLegRootDL[]; 93 | extern Gfx gHorseBanditTorsoDL[]; 94 | extern u64 gHorseBanditTLUT[]; 95 | extern u64 gHorseBanditMaskTex[]; 96 | extern u64 gHorseBanditSpottedDetailTex[]; 97 | extern u64 gHorseBanditEyebrowTex[]; 98 | extern u64 gHorseBanditTeethTex[]; 99 | extern u64 gHorseBanditTailAndFeetTex[]; 100 | extern u64 gHorseBanditEyeTex[]; 101 | extern u64 gHorseBanditMouthTex[]; 102 | extern u64 gHorseBanditSpottedSkinTex[]; 103 | extern u64 gHorseBanditTasselTex[]; 104 | extern u64 gHorseBanditSaddleSideTex[]; 105 | extern u64 gHorseBanditSaddleTopTex[]; 106 | extern u64 gHorseBanditSaddleBackTex[]; 107 | extern StandardLimb gHorseBanditRootLimb; 108 | extern StandardLimb gHorseBanditPelvisLimb; 109 | extern StandardLimb gHorseBanditTorsoLimb; 110 | extern StandardLimb gHorseBanditLeftFrontLegRootLimb; 111 | extern StandardLimb gHorseBanditLeftFrontForearmLimb; 112 | extern StandardLimb gHorseBanditLeftFrontCannonLimb; 113 | extern StandardLimb gHorseBanditLeftFrontFootLimb; 114 | extern StandardLimb gHorseBanditLowerNeckLimb; 115 | extern StandardLimb gHorseBanditUpperNeckLimb; 116 | extern StandardLimb gHorseBanditHeadLimb; 117 | extern StandardLimb gHorseBanditRightFrontLegRootLimb; 118 | extern StandardLimb gHorseBanditRightFrontForearmLimb; 119 | extern StandardLimb gHorseBanditRightFrontCannonLimb; 120 | extern StandardLimb gHorseBanditRightFrontFootLimb; 121 | extern StandardLimb gHorseBanditTailDockLimb; 122 | extern StandardLimb gHorseBanditTailMiddleLimb; 123 | extern StandardLimb gHorseBanditTailEndLimb; 124 | extern StandardLimb gHorseBanditLeftHindThighLimb; 125 | extern StandardLimb gHorseBanditLeftHindStifleLimb; 126 | extern StandardLimb gHorseBanditLeftHindCannonLimb; 127 | extern StandardLimb gHorseBanditLeftHindFootLimb; 128 | extern StandardLimb gHorseBanditRightHindThighLimb; 129 | extern StandardLimb gHorseBanditRightHindStifleLimb; 130 | extern StandardLimb gHorseBanditRightHindCannonLimb; 131 | extern StandardLimb gHorseBanditRightHindFootLimb; 132 | extern void* gHorseBanditSkelLimbs[]; 133 | extern FlexSkeletonHeader gHorseBanditSkel; 134 | extern s16 sHorseGallopAnimFrameData[]; 135 | extern JointIndex sHorseGallopAnimJointIndices[]; 136 | extern AnimationHeader gHorseGallopAnim; 137 | extern s16 sHorseJumpLowAnimFrameData[]; 138 | extern JointIndex sHorseJumpLowAnimJointIndices[]; 139 | extern AnimationHeader gHorseJumpLowAnim; 140 | extern s16 sHorseJumpHighAnimFrameData[]; 141 | extern JointIndex sHorseJumpHighAnimJointIndices[]; 142 | extern AnimationHeader gHorseJumpHighAnim; 143 | extern s16 sHorseTrotAnimFrameData[]; 144 | extern JointIndex sHorseTrotAnimJointIndices[]; 145 | extern AnimationHeader gHorseTrotAnim; 146 | extern s16 sHorseWhinnyAnimFrameData[]; 147 | extern JointIndex sHorseWhinnyAnimJointIndices[]; 148 | extern AnimationHeader gHorseWhinnyAnim; 149 | extern s16 sHorseStopAnimFrameData[]; 150 | extern JointIndex sHorseStopAnimJointIndices[]; 151 | extern AnimationHeader gHorseStopAnim; 152 | extern s16 sHorseIdleAnimFrameData[]; 153 | extern JointIndex sHorseIdleAnimJointIndices[]; 154 | extern AnimationHeader gHorseIdleAnim; 155 | extern s16 sHorseShakeHeadAnimFrameData[]; 156 | extern JointIndex sHorseShakeHeadAnimJointIndices[]; 157 | extern AnimationHeader gHorseShakeHeadAnim; 158 | extern s16 sHorseWalkAnimFrameData[]; 159 | extern JointIndex sHorseWalkAnimJointIndices[]; 160 | extern AnimationHeader gHorseWalkAnim; 161 | extern Vtx object_haVtx_00D660[]; 162 | extern Gfx gDonkeyRightHindFootDL[]; 163 | extern Gfx gDonkeyRightHindCannonDL[]; 164 | extern Gfx gDonkeyRightHindStifleDL[]; 165 | extern Gfx gDonkeyRightHindThighDL[]; 166 | extern Gfx gDonkeyLeftHindFootDL[]; 167 | extern Gfx gDonkeyLeftHindCannonDL[]; 168 | extern Gfx gDonkeyLeftHindStifleDL[]; 169 | extern Gfx gDonkeyLeftHindThighDL[]; 170 | extern Gfx gDonkeyTailEndDL[]; 171 | extern Gfx gDonkeyTailMiddleDL[]; 172 | extern Gfx gDonkeyTailDockDL[]; 173 | extern Gfx gDonkeyPelvisDL[]; 174 | extern Gfx gDonkeyRightFrontFootDL[]; 175 | extern Gfx gDonkeyRightFrontCannonDL[]; 176 | extern Gfx gDonkeyRightFrontForearmDL[]; 177 | extern Gfx gDonkeyRightFrontLegRootDL[]; 178 | extern Gfx gDonkeyHeadDL[]; 179 | extern Gfx gDonkeyUpperNeckDL[]; 180 | extern Gfx gDonkeyLowerNeckDL[]; 181 | extern Gfx gDonkeyLeftFrontFootDL[]; 182 | extern Gfx gDonkeyLeftFrontCannonDL[]; 183 | extern Gfx gDonkeyLeftFrontForearmDL[]; 184 | extern Gfx gDonkeyLeftFrontLegRootDL[]; 185 | extern Gfx gDonkeyTorsoDL[]; 186 | extern u64 gDonkeyTLUT[]; 187 | extern u64 gDonkeyMouthTex[]; 188 | extern u64 gDonkeyHeadTex[]; 189 | extern u64 gDonkeyEyeTex[]; 190 | extern u64 gDonkeyManeTex[]; 191 | extern u64 gDonkeySkinTex[]; 192 | extern u64 gDonkeyHarnessTex[]; 193 | extern u64 gDonkeyTailAndFeetTex[]; 194 | extern StandardLimb gDonkeyRootLimb; 195 | extern StandardLimb gDonkeyPelvisLimb; 196 | extern StandardLimb gDonkeyTorsoLimb; 197 | extern StandardLimb gDonkeyLeftFrontLegRootLimb; 198 | extern StandardLimb gDonkeyLeftFrontForearmLimb; 199 | extern StandardLimb gDonkeyLeftFrontCannonLimb; 200 | extern StandardLimb gDonkeyLeftFrontFootLimb; 201 | extern StandardLimb gDonkeyLowerNeckLimb; 202 | extern StandardLimb gDonkeyUpperNeckLimb; 203 | extern StandardLimb gDonkeyHeadLimb; 204 | extern StandardLimb gDonkeyRightFrontLegRootLimb; 205 | extern StandardLimb gDonkeyRightFrontForearmLimb; 206 | extern StandardLimb gDonkeyRightFrontCannonLimb; 207 | extern StandardLimb gDonkeyRightFrontFootLimb; 208 | extern StandardLimb gDonkeyTailDockLimb; 209 | extern StandardLimb gDonkeyTailMiddleLimb; 210 | extern StandardLimb gDonkeyTailEndLimb; 211 | extern StandardLimb gDonkeyLeftHindThighLimb; 212 | extern StandardLimb gDonkeyLeftHindStifleLimb; 213 | extern StandardLimb gDonkeyLeftHindCannonLimb; 214 | extern StandardLimb gDonkeyLeftHindFootLimb; 215 | extern StandardLimb gDonkeyRightHindThighLimb; 216 | extern StandardLimb gDonkeyRightHindStifleLimb; 217 | extern StandardLimb gDonkeyRightHindCannonLimb; 218 | extern StandardLimb gDonkeyRightHindFootLimb; 219 | extern void* gDonkeySkelLimbs[]; 220 | extern FlexSkeletonHeader gDonkeySkel; 221 | #endif 222 | -------------------------------------------------------------------------------- /include/modding.h: -------------------------------------------------------------------------------- 1 | #ifndef __MODDING_H__ 2 | #define __MODDING_H__ 3 | 4 | // Do not edit these defines. They use special section names that the recomp mod tool recognizes for specific modding functionality. 5 | 6 | #define RECOMP_IMPORT(mod, func) \ 7 | _Pragma("GCC diagnostic push") \ 8 | _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \ 9 | _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \ 10 | __attribute__((noinline, weak, used, section(".recomp_import." mod))) func {} \ 11 | _Pragma("GCC diagnostic pop") 12 | 13 | #define RECOMP_EXPORT __attribute__((section(".recomp_export"))) 14 | 15 | #define RECOMP_PATCH __attribute__((section(".recomp_patch"))) 16 | 17 | #define RECOMP_FORCE_PATCH __attribute__((section(".recomp_force_patch"))) 18 | 19 | #define RECOMP_DECLARE_EVENT(func) \ 20 | _Pragma("GCC diagnostic push") \ 21 | _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \ 22 | __attribute__((noinline, weak, used, section(".recomp_event"))) void func {} \ 23 | _Pragma("GCC diagnostic pop") 24 | 25 | #define RECOMP_CALLBACK(mod, event) __attribute__((section(".recomp_callback." mod ":" #event))) 26 | 27 | #define RECOMP_HOOK(func) __attribute__((section(".recomp_hook." func))) 28 | 29 | #define RECOMP_HOOK_RETURN(func) __attribute__((section(".recomp_hook_return." func))) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/recompconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECOMPCONFIG_H__ 2 | #define __RECOMPCONFIG_H__ 3 | 4 | #include "modding.h" 5 | 6 | // Reads a config value of the specified type and name for the mod that called these functions. 7 | // These correspond to the config schema provided in the mod's manifest. 8 | RECOMP_IMPORT("*", unsigned long recomp_get_config_u32(const char* key)); 9 | RECOMP_IMPORT("*", double recomp_get_config_double(const char* key)); 10 | RECOMP_IMPORT("*", char* recomp_get_config_string(const char* key)); 11 | 12 | // Frees a value returned by `recomp_get_config_string`. MUST be called to prevent a memory leak. 13 | RECOMP_IMPORT("*", void recomp_free_config_string(char* str)); 14 | 15 | // Gets the version of the mod that called this function. Writes the mod's version numbers into the provided pointers. 16 | RECOMP_IMPORT("*", void recomp_get_mod_version(unsigned long* major, unsigned long* minor, unsigned long* patch)); 17 | 18 | // Swaps to using a different file. The new save file will be located at `/.bin` in the normal saves folder. 19 | // Don't include `.bin` in the provided filename. 20 | // Be careful calling this function during normal gameplay as the game won't be aware that any currently loaded save data is outdated. 21 | RECOMP_IMPORT("*", void recomp_change_save_file(const char* filename)); 22 | 23 | // Returns a UTF-8 encoded zero-terminated string containing the absolute path to the current save file. 24 | // The return type is an unsigned char pointer to indicate the UTF-8 encoding. 25 | // `recomp_free` (found in `recomputils.h`) MUST be called on the return value of this when the value is no longer in use to prevent a memory leak. 26 | RECOMP_IMPORT("*", unsigned char* recomp_get_save_file_path()); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/recompdata.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECOMPDATA_H__ 2 | #define __RECOMPDATA_H__ 3 | 4 | #include "modding.h" 5 | 6 | // This file contains imports for utility data collection types. 7 | // hashmaps: Maps arbitrary unique numeric keys to elements. 8 | // Amortized O(1) performance for insertion, lookup, and deletion. 9 | // hashsets: Tracks a collection of unique numeric keys. 10 | // Amortized O(1) performance for insertion, lookup, and deletion. 11 | // slotmaps: Like hashmaps, but the keys are generated instead of provided. 12 | // Amortized O(1) performance for insertion, lookup, and deletion. More performant than hashmaps. 13 | 14 | // Hashmaps and slotmaps types are available that hold either 32-bit elements or data elements of a fixed element size. 15 | 16 | typedef unsigned long collection_key_t; 17 | 18 | ///////////////////////// 19 | // u32 -> u32 hashmaps // 20 | ///////////////////////// 21 | 22 | typedef unsigned long U32ValueHashmapHandle; 23 | 24 | // Creates a hashmap that maps u32 keys to u32 values. 25 | // Returns the handle for that hashmap. 26 | RECOMP_IMPORT("*", U32ValueHashmapHandle recomputil_create_u32_value_hashmap()); 27 | 28 | // Destroys a u32 -> u32 hashmap. 29 | RECOMP_IMPORT("*", void recomputil_destroy_u32_value_hashmap(U32ValueHashmapHandle handle)); 30 | 31 | // Checks if a u32 -> u32 hashmap contains the given key. 32 | // Returns 1 if the key exists in the map, otherwise returns 0. 33 | RECOMP_IMPORT("*", int recomputil_u32_value_hashmap_contains(U32ValueHashmapHandle handle, collection_key_t key)); 34 | 35 | // Inserts a value into a u32 -> u32 hashmap. The value is always assigned even if the key already exists. 36 | // Returns 1 if the key was created (i.e. did not exist in the map), otherwise returns 0. 37 | RECOMP_IMPORT("*", int recomputil_u32_value_hashmap_insert(U32ValueHashmapHandle handle, collection_key_t key, unsigned long value)); 38 | 39 | // Attempts to retrieve a value from a u32 -> u32 hashmap. 40 | // Returns 1 if the key exists in the map and writes the element's value to *out, otherwise returns 0 and does not modify the contents in *out. 41 | RECOMP_IMPORT("*", int recomputil_u32_value_hashmap_get(U32ValueHashmapHandle handle, collection_key_t key, unsigned long* out)); 42 | 43 | // Erases a key from a u32 -> u32 hashmap. Does nothing if the key doesn't exist in the hashmap. 44 | // Returns 1 if the key was erased (i.e. it existed in the map), otherwise returns 0. 45 | RECOMP_IMPORT("*", int recomputil_u32_value_hashmap_erase(U32ValueHashmapHandle handle, collection_key_t key)); 46 | 47 | // Gets the size of a u32 -> u32 hashmap. 48 | // Returns the number of elements in the map. 49 | RECOMP_IMPORT("*", unsigned long recomputil_u32_value_hashmap_size(U32ValueHashmapHandle handle)); 50 | 51 | ////////////////////////// 52 | // u32 -> data hashmaps // 53 | ////////////////////////// 54 | 55 | typedef unsigned long U32MemoryHashmapHandle; 56 | 57 | // Creates a hashmap that maps u32 keys to data of a given element size. 58 | // Returns the handle for that hashmap. 59 | RECOMP_IMPORT("*", U32MemoryHashmapHandle recomputil_create_u32_memory_hashmap(unsigned long element_size)); 60 | 61 | // Destroys a u32 -> data hashmap. 62 | RECOMP_IMPORT("*", void recomputil_destroy_u32_memory_hashmap(U32MemoryHashmapHandle handle)); 63 | 64 | // Checks if a u32 -> data hashmap contains the given key. 65 | // Returns 1 if the key exists in the map, otherwise returns 0. 66 | RECOMP_IMPORT("*", int recomputil_u32_memory_hashmap_contains(U32MemoryHashmapHandle handle, collection_key_t key)); 67 | 68 | // Creates an element in a u32 -> data hashmap with the given key. Does nothing if the key already exists. 69 | // Returns 1 if the element was created (i.e. the key did not already existed), otherwise returns 0. 70 | RECOMP_IMPORT("*", int recomputil_u32_memory_hashmap_create(U32MemoryHashmapHandle handle, collection_key_t key)); 71 | 72 | // Attempts to retrieve a value from a u32 -> data hashmap. 73 | // Returns the element's pointer if the key exists in the map, otherwise returns null. 74 | RECOMP_IMPORT("*", void* recomputil_u32_memory_hashmap_get(U32MemoryHashmapHandle handle, collection_key_t key)); 75 | 76 | // Erases a key from a u32 -> data hashmap. Does nothing if the key doesn't exist in the hashmap. 77 | // Returns 1 if the key was erased (i.e. it existed in the map), otherwise returns 0. 78 | RECOMP_IMPORT("*", int recomputil_u32_memory_hashmap_erase(U32MemoryHashmapHandle handle, collection_key_t key)); 79 | 80 | // Gets the size of a u32 -> data hashmap. 81 | // Returns the number of elements in the map. 82 | RECOMP_IMPORT("*", unsigned long recomputil_u32_memory_hashmap_size(U32MemoryHashmapHandle handle)); 83 | 84 | ////////////////// 85 | // u32 hashsets // 86 | ////////////////// 87 | 88 | typedef unsigned long U32HashsetHandle; 89 | 90 | // Creates a hashset of u32 keys. 91 | // Returns the handle for that hashset. 92 | RECOMP_IMPORT("*", U32HashsetHandle recomputil_create_u32_hashset()); 93 | 94 | // Destroys a u32 hashset. 95 | RECOMP_IMPORT("*", void recomputil_destroy_u32_hashset(U32HashsetHandle handle)); 96 | 97 | // Checks if a u32 hashset contains the given key. 98 | // Returns 1 if the key exists in the set, otherwise returns 0. 99 | RECOMP_IMPORT("*", int recomputil_u32_hashset_contains(U32HashsetHandle handle, collection_key_t key)); 100 | 101 | // Inserts a key into a u32 hashset. 102 | // Returns 1 if the key was inserted (i.e. it did not exist in the set), otherwise returns 0. 103 | RECOMP_IMPORT("*", int recomputil_u32_hashset_insert(U32HashsetHandle handle, collection_key_t key)); 104 | 105 | // Erases a key from a u32 hashset. 106 | // Returns 1 if the key was erased (i.e. it exited in the set), otherwise returns 0. 107 | RECOMP_IMPORT("*", int recomputil_u32_hashset_erase(U32HashsetHandle handle, collection_key_t key)); 108 | 109 | // Gets the size of a u32 hashset. 110 | // Returns the number of elements in the set. 111 | RECOMP_IMPORT("*", unsigned long recomputil_u32_hashset_size(U32HashsetHandle handle)); 112 | 113 | ////////////////// 114 | // u32 slotmaps // 115 | ////////////////// 116 | 117 | typedef unsigned long U32SlotmapHandle; 118 | 119 | // Creates a slotmap with u32 elements. 120 | // Returns the handle for that slotmap. 121 | RECOMP_IMPORT("*", U32SlotmapHandle recomputil_create_u32_slotmap()); 122 | 123 | // Destroys a u32 slotmap. 124 | RECOMP_IMPORT("*", void recomputil_destroy_u32_slotmap(U32SlotmapHandle handle)); 125 | 126 | // Checks if a u32 slotmap contains the given key. 127 | // Returns 1 if the key exists in the map, otherwise returns 0. 128 | RECOMP_IMPORT("*", int recomputil_u32_slotmap_contains(U32SlotmapHandle handle, collection_key_t key)); 129 | 130 | // Creates an element in a u32 slotmap. 131 | // Returns the created element's key. 132 | RECOMP_IMPORT("*", collection_key_t recomputil_u32_slotmap_create(U32SlotmapHandle handle)); 133 | 134 | // Attempts to retrieve a value from a u32 slotmap. 135 | // Returns 1 if the key exists in the map and writes the element's value to *out, otherwise returns 0 and does not modify the contents in *out. 136 | RECOMP_IMPORT("*", int recomputil_u32_slotmap_get(U32SlotmapHandle handle, collection_key_t key, unsigned long* out)); 137 | 138 | // Attempts to set a value in a u32 slotmap. The value is not assigned if the key does not exist. 139 | // Returns 1 if the key existed, otherwise returns 0. 140 | RECOMP_IMPORT("*", int recomputil_u32_slotmap_set(U32SlotmapHandle handle, collection_key_t key, unsigned long value)); 141 | 142 | // Erases a key from a u32 slotmap. 143 | // Returns 1 if the key was erased (i.e. it exited in the map), otherwise returns 0. 144 | RECOMP_IMPORT("*", int recomputil_u32_slotmap_erase(U32SlotmapHandle handle, collection_key_t key)); 145 | 146 | // Gets the size of a u32 slotmap. 147 | // Returns the number of elements in the map. 148 | RECOMP_IMPORT("*", unsigned long recomputil_u32_slotmap_size(U32SlotmapHandle handle)); 149 | 150 | /////////////////// 151 | // data slotmaps // 152 | /////////////////// 153 | 154 | typedef unsigned long MemorySlotmapHandle; 155 | 156 | // Creates a slotmap with data elements of a given element size. 157 | // Returns the handle for that slotmap. 158 | RECOMP_IMPORT("*", MemorySlotmapHandle recomputil_create_memory_slotmap(unsigned long element_size)); 159 | 160 | // Destroys a memory slotmap. 161 | RECOMP_IMPORT("*", void recomputil_destroy_memory_slotmap(MemorySlotmapHandle handle)); 162 | 163 | // Checks if a memory slotmap contains the given key. 164 | // Returns 1 if the key exists in the map, otherwise returns 0. 165 | RECOMP_IMPORT("*", int recomputil_memory_slotmap_contains(MemorySlotmapHandle handle, collection_key_t key)); 166 | 167 | // Creates an element in a memory slotmap. 168 | // Returns the created element's key. 169 | RECOMP_IMPORT("*", collection_key_t recomputil_memory_slotmap_create(MemorySlotmapHandle handle)); 170 | 171 | // Attempts to retrieve an element from a u32 slotmap. 172 | // Returns 1 if the key exists in the map and writes the element's pointer to *out, otherwise returns 0 and does not modify the contents in *out. 173 | RECOMP_IMPORT("*", int recomputil_memory_slotmap_get(MemorySlotmapHandle handle, collection_key_t key, void** out)); 174 | 175 | // Erases a key from a memory slotmap. 176 | // Returns 1 if the key was erased (i.e. it exited in the map), otherwise returns 0. 177 | RECOMP_IMPORT("*", int recomputil_memory_slotmap_erase(MemorySlotmapHandle handle, collection_key_t key)); 178 | 179 | // Gets the size of a memory slotmap. 180 | // Returns the number of elements in the map. 181 | RECOMP_IMPORT("*", unsigned long recomputil_memory_slotmap_size(MemorySlotmapHandle handle)); 182 | 183 | #endif 184 | -------------------------------------------------------------------------------- /include/recompui.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECOMPUI_H__ 2 | #define __RECOMPUI_H__ 3 | 4 | #include "modding.h" 5 | #include "recompui_event_structs.h" 6 | 7 | typedef unsigned long RecompuiContext; 8 | typedef unsigned long RecompuiResource; 9 | typedef unsigned long RecompuiTextureHandle; 10 | 11 | // Height of the window in DP units. This is fixed regardless of window size and aspect ratio. 12 | #define RECOMPUI_TOTAL_HEIGHT 1080.0f 13 | 14 | typedef enum { 15 | CURSOR_NONE, 16 | CURSOR_POINTER 17 | } RecompuiCursor; 18 | 19 | typedef enum { 20 | DISPLAY_NONE, 21 | DISPLAY_BLOCK, 22 | DISPLAY_INLINE, 23 | DISPLAY_INLINE_BLOCK, 24 | DISPLAY_FLOW_ROOT, 25 | DISPLAY_FLEX, 26 | DISPLAY_INLINE_FLEX, 27 | DISPLAY_TABLE, 28 | DISPLAY_INLINE_TABLE, 29 | DISPLAY_TABLE_ROW, 30 | DISPLAY_TABLE_ROW_GROUP, 31 | DISPLAY_TABLE_COLUMN, 32 | DISPLAY_TABLE_COLUMN_GROUP, 33 | DISPLAY_TABLE_CELL 34 | } RecompuiDisplay; 35 | 36 | typedef enum { 37 | VISIBILITY_VISIBLE, 38 | VISIBILITY_HIDDEN 39 | } RecompuiVisibility; 40 | 41 | typedef enum { 42 | POSITION_ABSOLUTE, 43 | POSITION_RELATIVE 44 | } RecompuiPosition; 45 | 46 | typedef enum { 47 | JUSTIFY_CONTENT_FLEX_START, 48 | JUSTIFY_CONTENT_FLEX_END, 49 | JUSTIFY_CONTENT_CENTER, 50 | JUSTIFY_CONTENT_SPACE_BETWEEN, 51 | JUSTIFY_CONTENT_SPACE_AROUND, 52 | JUSTIFY_CONTENT_SPACE_EVENLY 53 | } RecompuiJustifyContent; 54 | 55 | typedef enum { 56 | FLEX_DIRECTION_ROW, 57 | FLEX_DIRECTION_COLUMN, 58 | FLEX_DIRECTION_ROW_REVERSE, 59 | FLEX_DIRECTION_COLUMN_REVERSE 60 | } RecompuiFlexDirection; 61 | 62 | typedef enum { 63 | ALIGN_ITEMS_FLEX_START, 64 | ALIGN_ITEMS_FLEX_END, 65 | ALIGN_ITEMS_CENTER, 66 | ALIGN_ITEMS_BASELINE, 67 | ALIGN_ITEMS_STRETCH 68 | } RecompuiAlignItems; 69 | 70 | typedef enum { 71 | OVERFLOW_VISIBLE, 72 | OVERFLOW_HIDDEN, 73 | OVERFLOW_AUTO, 74 | OVERFLOW_SCROLL 75 | } RecompuiOverflow; 76 | 77 | typedef enum { 78 | UNIT_PX, 79 | UNIT_DP, 80 | UNIT_PERCENT 81 | } RecompuiUnit; 82 | 83 | typedef enum { 84 | FONT_STYLE_NORMAL, 85 | FONT_STYLE_ITALIC 86 | } RecompuiFontStyle; 87 | 88 | typedef enum { 89 | TEXT_ALIGN_LEFT, 90 | TEXT_ALIGN_RIGHT, 91 | TEXT_ALIGN_CENTER, 92 | TEXT_ALIGN_JUSTIFY 93 | } RecompuiTextAlign; 94 | 95 | typedef enum { 96 | TEXT_TRANSFORM_NONE, 97 | TEXT_TRANSFORM_CAPITALIZE, 98 | TEXT_TRANSFORM_UPPERCASE, 99 | TEXT_TRANSFORM_LOWERCASE 100 | } RecompuiTextTransform; 101 | 102 | typedef enum { 103 | DRAG_NONE, 104 | DRAG_DRAG, 105 | DRAG_DRAG_DROP, 106 | DRAG_BLOCK, 107 | DRAG_CLONE 108 | } RecompuiDrag; 109 | 110 | typedef enum { 111 | TAB_INDEX_NONE, 112 | TAB_INDEX_AUTO 113 | } RecompuiTabIndex; 114 | 115 | typedef enum { 116 | BUTTONSTYLE_PRIMARY, 117 | BUTTONSTYLE_SECONDARY, 118 | } RecompuiButtonStyle; 119 | 120 | typedef enum { 121 | LABELSTYLE_ANNOTATION, 122 | LABELSTYLE_SMALL, 123 | LABELSTYLE_NORMAL, 124 | LABELSTYLE_LARGE 125 | } RecompuiLabelStyle; 126 | 127 | typedef enum { 128 | SLIDERTYPE_NUMBER, 129 | SLIDERTYPE_PERCENT, 130 | SLIDERTYPE_INTEGER 131 | } RecompuiSliderType; 132 | 133 | typedef enum { 134 | NAVDIRECTION_UP, 135 | NAVDIRECTION_RIGHT, 136 | NAVDIRECTION_DOWN, 137 | NAVDIRECTION_LEFT, 138 | } RecompuiNavDirection; 139 | 140 | typedef struct { 141 | unsigned long type; 142 | float duration; 143 | } RecompuiAnimation; 144 | 145 | typedef struct { 146 | unsigned char r; 147 | unsigned char g; 148 | unsigned char b; 149 | unsigned char a; 150 | } RecompuiColor; 151 | 152 | #define RECOMPUI_NULL_CONTEXT (0xFFFFFFFFUL) 153 | #define RECOMPUI_NULL_RESOURCE (0xFFFFFFFFUL) 154 | 155 | // Contexts 156 | RECOMP_IMPORT("*", RecompuiContext recompui_create_context()); 157 | RECOMP_IMPORT("*", void recompui_open_context(RecompuiContext context)); 158 | RECOMP_IMPORT("*", void recompui_close_context(RecompuiContext context)); 159 | RECOMP_IMPORT("*", RecompuiResource recompui_context_root(RecompuiContext context)); 160 | RECOMP_IMPORT("*", void recompui_show_context(RecompuiContext context)); 161 | RECOMP_IMPORT("*", void recompui_hide_context(RecompuiContext context)); 162 | RECOMP_IMPORT("*", void recompui_set_context_captures_input(RecompuiContext context, int captures_input)); 163 | RECOMP_IMPORT("*", void recompui_set_context_captures_mouse(RecompuiContext context, int captures_mouse)); 164 | 165 | // Resources 166 | RECOMP_IMPORT("*", RecompuiResource recompui_create_style(RecompuiContext context)); 167 | RECOMP_IMPORT("*", RecompuiResource recompui_create_element(RecompuiContext context, RecompuiResource parent)); 168 | RECOMP_IMPORT("*", RecompuiResource recompui_destroy_element(RecompuiResource parent, RecompuiResource element)); 169 | RECOMP_IMPORT("*", RecompuiResource recompui_create_button(RecompuiContext context, RecompuiResource parent, const char* text, RecompuiButtonStyle style)); 170 | RECOMP_IMPORT("*", RecompuiResource recompui_create_label(RecompuiContext context, RecompuiResource parent, const char* text, RecompuiLabelStyle label_style)); 171 | RECOMP_IMPORT("*", RecompuiResource recompui_create_textinput(RecompuiContext context, RecompuiResource parent)); 172 | RECOMP_IMPORT("*", RecompuiResource recompui_create_passwordinput(RecompuiContext context, RecompuiResource parent)); 173 | RECOMP_IMPORT("*", RecompuiResource recompui_create_labelradio(RecompuiContext context, RecompuiResource parent, 174 | const char** options, unsigned long num_options)); 175 | RECOMP_IMPORT("*", RecompuiResource recompui_create_slider(RecompuiContext context, RecompuiResource parent, 176 | RecompuiSliderType type, float min_value, float max_value, float step, float initial_value)); 177 | RECOMP_IMPORT("*", RecompuiResource recompui_create_imageview(RecompuiContext context, RecompuiResource parent, RecompuiTextureHandle texture)); 178 | 179 | // Position and Layout 180 | RECOMP_IMPORT("*", void recompui_set_visibility(RecompuiResource id, RecompuiVisibility visibility)); 181 | RECOMP_IMPORT("*", void recompui_set_position(RecompuiResource id, RecompuiPosition position)); 182 | RECOMP_IMPORT("*", void recompui_set_left(RecompuiResource id, float left, RecompuiUnit unit)); 183 | RECOMP_IMPORT("*", void recompui_set_top(RecompuiResource id, float top, RecompuiUnit unit)); 184 | RECOMP_IMPORT("*", void recompui_set_right(RecompuiResource id, float right, RecompuiUnit unit)); 185 | RECOMP_IMPORT("*", void recompui_set_bottom(RecompuiResource id, float bottom, RecompuiUnit unit)); 186 | 187 | // Sizing 188 | RECOMP_IMPORT("*", void recompui_set_width(RecompuiResource id, float width, RecompuiUnit unit)); 189 | RECOMP_IMPORT("*", void recompui_set_width_auto(RecompuiResource id)); 190 | RECOMP_IMPORT("*", void recompui_set_height(RecompuiResource id, float height, RecompuiUnit unit)); 191 | RECOMP_IMPORT("*", void recompui_set_height_auto(RecompuiResource id)); 192 | RECOMP_IMPORT("*", void recompui_set_min_width(RecompuiResource id, float width, RecompuiUnit unit)); 193 | RECOMP_IMPORT("*", void recompui_set_min_height(RecompuiResource id, float height, RecompuiUnit unit)); 194 | RECOMP_IMPORT("*", void recompui_set_max_width(RecompuiResource id, float width, RecompuiUnit unit)); 195 | RECOMP_IMPORT("*", void recompui_set_max_height(RecompuiResource id, float height, RecompuiUnit unit)); 196 | 197 | // Padding 198 | RECOMP_IMPORT("*", void recompui_set_padding(RecompuiResource id, float padding, RecompuiUnit unit)); 199 | RECOMP_IMPORT("*", void recompui_set_padding_left(RecompuiResource id, float padding, RecompuiUnit unit)); 200 | RECOMP_IMPORT("*", void recompui_set_padding_top(RecompuiResource id, float padding, RecompuiUnit unit)); 201 | RECOMP_IMPORT("*", void recompui_set_padding_right(RecompuiResource id, float padding, RecompuiUnit unit)); 202 | RECOMP_IMPORT("*", void recompui_set_padding_bottom(RecompuiResource id, float padding, RecompuiUnit unit)); 203 | 204 | // Margins 205 | RECOMP_IMPORT("*", void recompui_set_margin(RecompuiResource id, float margin, RecompuiUnit unit)); 206 | RECOMP_IMPORT("*", void recompui_set_margin_left(RecompuiResource id, float margin, RecompuiUnit unit)); 207 | RECOMP_IMPORT("*", void recompui_set_margin_top(RecompuiResource id, float margin, RecompuiUnit unit)); 208 | RECOMP_IMPORT("*", void recompui_set_margin_right(RecompuiResource id, float margin, RecompuiUnit unit)); 209 | RECOMP_IMPORT("*", void recompui_set_margin_bottom(RecompuiResource id, float margin, RecompuiUnit unit)); 210 | RECOMP_IMPORT("*", void recompui_set_margin_auto(RecompuiResource id)); 211 | RECOMP_IMPORT("*", void recompui_set_margin_left_auto(RecompuiResource id)); 212 | RECOMP_IMPORT("*", void recompui_set_margin_top_auto(RecompuiResource id)); 213 | RECOMP_IMPORT("*", void recompui_set_margin_right_auto(RecompuiResource id)); 214 | RECOMP_IMPORT("*", void recompui_set_margin_bottom_auto(RecompuiResource id)); 215 | 216 | // Borders 217 | RECOMP_IMPORT("*", void recompui_set_border_width(RecompuiResource id, float width, RecompuiUnit unit)); 218 | RECOMP_IMPORT("*", void recompui_set_border_left_width(RecompuiResource id, float width, RecompuiUnit unit)); 219 | RECOMP_IMPORT("*", void recompui_set_border_top_width(RecompuiResource id, float width, RecompuiUnit unit)); 220 | RECOMP_IMPORT("*", void recompui_set_border_right_width(RecompuiResource id, float width, RecompuiUnit unit)); 221 | RECOMP_IMPORT("*", void recompui_set_border_bottom_width(RecompuiResource id, float width, RecompuiUnit unit)); 222 | RECOMP_IMPORT("*", void recompui_set_border_radius(RecompuiResource id, float radius, RecompuiUnit unit)); 223 | RECOMP_IMPORT("*", void recompui_set_border_top_left_radius(RecompuiResource id, float radius, RecompuiUnit unit)); 224 | RECOMP_IMPORT("*", void recompui_set_border_top_right_radius(RecompuiResource id, float radius, RecompuiUnit unit)); 225 | RECOMP_IMPORT("*", void recompui_set_border_bottom_left_radius(RecompuiResource id, float radius, RecompuiUnit unit)); 226 | RECOMP_IMPORT("*", void recompui_set_border_bottom_right_radius(RecompuiResource id, float radius, RecompuiUnit unit)); 227 | 228 | // Colors 229 | RECOMP_IMPORT("*", void recompui_set_background_color(RecompuiResource id, const RecompuiColor* color)); 230 | RECOMP_IMPORT("*", void recompui_set_border_color(RecompuiResource id, const RecompuiColor* color)); 231 | RECOMP_IMPORT("*", void recompui_set_border_left_color(RecompuiResource id, const RecompuiColor* color)); 232 | RECOMP_IMPORT("*", void recompui_set_border_top_color(RecompuiResource id, const RecompuiColor* color)); 233 | RECOMP_IMPORT("*", void recompui_set_border_right_color(RecompuiResource id, const RecompuiColor* color)); 234 | RECOMP_IMPORT("*", void recompui_set_border_bottom_color(RecompuiResource id, const RecompuiColor* color)); 235 | RECOMP_IMPORT("*", void recompui_set_color(RecompuiResource id, const RecompuiColor* color)); 236 | 237 | // Cursor and Display 238 | RECOMP_IMPORT("*", void recompui_set_cursor(RecompuiResource id, RecompuiCursor cursor)); 239 | RECOMP_IMPORT("*", void recompui_set_opacity(RecompuiResource id, float opacity)); 240 | RECOMP_IMPORT("*", void recompui_set_display(RecompuiResource id, RecompuiDisplay display)); 241 | 242 | // Flexbox 243 | RECOMP_IMPORT("*", void recompui_set_justify_content(RecompuiResource id, RecompuiJustifyContent justify_content)); 244 | RECOMP_IMPORT("*", void recompui_set_flex_grow(RecompuiResource id, float grow)); 245 | RECOMP_IMPORT("*", void recompui_set_flex_shrink(RecompuiResource id, float shrink)); 246 | RECOMP_IMPORT("*", void recompui_set_flex_basis_auto(RecompuiResource id)); 247 | RECOMP_IMPORT("*", void recompui_set_flex_basis(RecompuiResource id, float basis, RecompuiUnit unit)); 248 | RECOMP_IMPORT("*", void recompui_set_flex_direction(RecompuiResource id, RecompuiFlexDirection flex_direction)); 249 | RECOMP_IMPORT("*", void recompui_set_align_items(RecompuiResource id, RecompuiAlignItems align_items)); 250 | 251 | // Overflow 252 | RECOMP_IMPORT("*", void recompui_set_overflow(RecompuiResource id, RecompuiOverflow overflow)); 253 | RECOMP_IMPORT("*", void recompui_set_overflow_x(RecompuiResource id, RecompuiOverflow overflow)); 254 | RECOMP_IMPORT("*", void recompui_set_overflow_y(RecompuiResource id, RecompuiOverflow overflow)); 255 | 256 | // Text and Fonts 257 | RECOMP_IMPORT("*", void recompui_set_text(RecompuiResource id, const char* text)); 258 | RECOMP_IMPORT("*", void recompui_set_font_size(RecompuiResource id, float size, RecompuiUnit unit)); 259 | RECOMP_IMPORT("*", void recompui_set_letter_spacing(RecompuiResource id, float spacing, RecompuiUnit unit)); 260 | RECOMP_IMPORT("*", void recompui_set_line_height(RecompuiResource id, float height, RecompuiUnit unit)); 261 | RECOMP_IMPORT("*", void recompui_set_font_style(RecompuiResource id, RecompuiFontStyle style)); 262 | RECOMP_IMPORT("*", void recompui_set_font_weight(RecompuiResource id, unsigned long weight)); 263 | RECOMP_IMPORT("*", void recompui_set_text_align(RecompuiResource id, RecompuiTextAlign text_align)); 264 | 265 | // Gaps 266 | RECOMP_IMPORT("*", void recompui_set_gap(RecompuiResource id, float size, RecompuiUnit unit)); 267 | RECOMP_IMPORT("*", void recompui_set_row_gap(RecompuiResource id, float size, RecompuiUnit unit)); 268 | RECOMP_IMPORT("*", void recompui_set_column_gap(RecompuiResource id, float size, RecompuiUnit unit)); 269 | 270 | // Drag and Focus 271 | RECOMP_IMPORT("*", void recompui_set_drag(RecompuiResource id, RecompuiDrag drag)); 272 | RECOMP_IMPORT("*", void recompui_set_tab_index(RecompuiResource id, RecompuiTabIndex focus)); 273 | 274 | // Values 275 | RECOMP_IMPORT("*", unsigned long recompui_get_input_value_u32(RecompuiResource id)); 276 | RECOMP_IMPORT("*", float recompui_get_input_value_float(RecompuiResource id)); 277 | // !! You must call `recomp_free` on the return value of `recompui_get_input_text` when you're finished with it! 278 | RECOMP_IMPORT("*", char* recompui_get_input_text(RecompuiResource id)); 279 | RECOMP_IMPORT("*", void recompui_set_input_value_u32(RecompuiResource id, unsigned long val)); 280 | RECOMP_IMPORT("*", void recompui_set_input_value_float(RecompuiResource id, float val)); 281 | RECOMP_IMPORT("*", void recompui_set_input_text(RecompuiResource id, const char* text)); 282 | 283 | // Navigation 284 | RECOMP_IMPORT("*", void recompui_set_nav_auto(RecompuiResource id, RecompuiNavDirection direction)); 285 | RECOMP_IMPORT("*", void recompui_set_nav_none(RecompuiResource id, RecompuiNavDirection direction)); 286 | RECOMP_IMPORT("*", void recompui_set_nav(RecompuiResource id, RecompuiNavDirection direction, RecompuiResource target_id)); 287 | 288 | // Images 289 | RECOMP_IMPORT("*", RecompuiTextureHandle recompui_create_texture_rgba32(void* data, unsigned long width, unsigned long height)); 290 | RECOMP_IMPORT("*", void recompui_destroy_texture(RecompuiTextureHandle texture)); 291 | RECOMP_IMPORT("*", void recompui_set_imageview_texture(RecompuiResource id, RecompuiTextureHandle texture)); 292 | 293 | // Callbacks 294 | typedef void RecompuiEventHandler(RecompuiResource resource, const RecompuiEventData* event, void* userdata); 295 | RECOMP_IMPORT("*", void recompui_register_callback(RecompuiResource id, RecompuiEventHandler* handler, void* userdata)); 296 | 297 | #endif 298 | -------------------------------------------------------------------------------- /include/recompui_event_structs.h: -------------------------------------------------------------------------------- 1 | #ifndef __UI_FUNCS_H__ 2 | #define __UI_FUNCS_H__ 3 | 4 | // These two enums must be kept in sync with src/ui/elements/ui_types.h! 5 | typedef enum { 6 | UI_EVENT_NONE, 7 | UI_EVENT_CLICK, 8 | UI_EVENT_FOCUS, 9 | UI_EVENT_HOVER, 10 | UI_EVENT_ENABLE, 11 | UI_EVENT_DRAG, 12 | UI_EVENT_RESERVED1, // Would be UI_EVENT_TEXT but text events aren't available in mods currently 13 | UI_EVENT_RESERVED2, // Would be UI_EVENT_UPDATE but manual updats aren't available in mods currently 14 | UI_EVENT_COUNT 15 | } RecompuiEventType; 16 | 17 | typedef enum { 18 | UI_DRAG_NONE, 19 | UI_DRAG_START, 20 | UI_DRAG_MOVE, 21 | UI_DRAG_END 22 | } RecompuiDragPhase; 23 | 24 | typedef struct { 25 | RecompuiEventType type; 26 | union { 27 | struct { 28 | float x; 29 | float y; 30 | } click; 31 | 32 | struct { 33 | int active; 34 | } focus; 35 | 36 | struct { 37 | int active; 38 | } hover; 39 | 40 | struct { 41 | int active; 42 | } enable; 43 | 44 | struct { 45 | float x; 46 | float y; 47 | RecompuiDragPhase phase; 48 | } drag; 49 | } data; 50 | } RecompuiEventData; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/recomputils.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECOMPUTILS_H__ 2 | #define __RECOMPUTILS_H__ 3 | 4 | #include "modding.h" 5 | 6 | RECOMP_IMPORT("*", void* recomp_alloc(unsigned long size)); 7 | RECOMP_IMPORT("*", void recomp_free(void* memory)); 8 | RECOMP_IMPORT("*", int recomp_printf(const char* fmt, ...)); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/rt64_extended_gbi.h: -------------------------------------------------------------------------------- 1 | // 2 | // RT64 3 | // 4 | 5 | #ifndef RT64_EXTENDED_GBI 6 | #define RT64_EXTENDED_GBI 7 | 8 | // G_SPNOOP on F3D and F3DEX2. 9 | #ifdef F3DEX_GBI_2 10 | # define RT64_HOOK_OPCODE 0xE0 11 | #else 12 | # define RT64_HOOK_OPCODE 0x00 13 | #endif 14 | 15 | #define RT64_HOOK_OP_GETVERSION 0x0 16 | #define RT64_HOOK_OP_ENABLE 0x1 17 | #define RT64_HOOK_OP_DISABLE 0x2 18 | #define RT64_HOOK_OP_DL 0x3 19 | #define RT64_HOOK_OP_BRANCH 0x4 20 | 21 | // 0x5254 for ASCII "RT" followed by 0x64. 22 | #define RT64_HOOK_MAGIC_NUMBER 0x525464 23 | 24 | #ifndef RT64_EXTENDED_OPCODE 25 | // TODO: Define defaults here based on the GBI. 26 | # define RT64_EXTENDED_OPCODE 0x64 27 | #endif 28 | 29 | #define G_EX_VERSION 0x1 30 | 31 | #define G_EX_NOOP 0x000000 32 | #define G_EX_PRINT 0x000001 33 | #define G_EX_TEXRECT_V1 0x000002 34 | #define G_EX_FILLRECT_V1 0x000003 35 | #define G_EX_SETVIEWPORT_V1 0x000004 36 | #define G_EX_SETSCISSOR_V1 0x000005 37 | #define G_EX_SETRECTALIGN_V1 0x000006 38 | #define G_EX_SETVIEWPORTALIGN_V1 0x000007 39 | #define G_EX_SETSCISSORALIGN_V1 0x000008 40 | #define G_EX_SETREFRESHRATE_V1 0x000009 41 | #define G_EX_VERTEXZTEST_V1 0x00000A 42 | #define G_EX_ENDVERTEXZTEST_V1 0x00000B 43 | #define G_EX_MATRIXGROUP_V1 0x00000C 44 | #define G_EX_POPMATRIXGROUP_V1 0x00000D 45 | #define G_EX_FORCEUPSCALE2D_V1 0x00000E 46 | #define G_EX_FORCETRUEBILERP_V1 0x00000F 47 | #define G_EX_FORCESCALELOD_V1 0x000010 48 | #define G_EX_FORCEBRANCH_V1 0x000011 49 | #define G_EX_SETRENDERTORAM_V1 0x000012 50 | #define G_EX_EDITGROUPBYADDRESS_V1 0x000013 51 | #define G_EX_VERTEX_V1 0x000014 52 | #define G_EX_PUSHVIEWPORT_V1 0x000015 53 | #define G_EX_POPVIEWPORT_V1 0x000016 54 | #define G_EX_PUSHSCISSOR_V1 0x000017 55 | #define G_EX_POPSCISSOR_V1 0x000018 56 | #define G_EX_PUSHOTHERMODE_V1 0x000019 57 | #define G_EX_POPOTHERMODE_V1 0x00001A 58 | #define G_EX_PUSHCOMBINE_V1 0x00001B 59 | #define G_EX_POPCOMBINE_V1 0x00001C 60 | #define G_EX_PUSHPROJMATRIX_V1 0x00001D 61 | #define G_EX_POPPROJMATRIX_V1 0x00001E 62 | #define G_EX_PUSHENVCOLOR_V1 0x00001F 63 | #define G_EX_POPENVCOLOR_V1 0x000020 64 | #define G_EX_PUSHBLENDCOLOR_V1 0x000021 65 | #define G_EX_POPBLENDCOLOR_V1 0x000022 66 | #define G_EX_PUSHFOGCOLOR_V1 0x000023 67 | #define G_EX_POPFOGCOLOR_V1 0x000024 68 | #define G_EX_PUSHFILLCOLOR_V1 0x000025 69 | #define G_EX_POPFILLCOLOR_V1 0x000026 70 | #define G_EX_PUSHPRIMCOLOR_V1 0x000027 71 | #define G_EX_POPPRIMCOLOR_V1 0x000028 72 | #define G_EX_PUSHGEOMETRYMODE_V1 0x000029 73 | #define G_EX_POPGEOMETRYMODE_V1 0x00002A 74 | #define G_EX_SETDITHERNOISESTRENGTH_V1 0x00002B 75 | #define G_EX_SETRDRAMEXTENDED_V1 0x00002C 76 | #define G_EX_MAX 0x00002D 77 | 78 | #define G_EX_ORIGIN_NONE 0x800 79 | #define G_EX_ORIGIN_LEFT 0x0 80 | #define G_EX_ORIGIN_CENTER 0x200 81 | #define G_EX_ORIGIN_RIGHT 0x400 82 | 83 | #define G_EX_NOPUSH 0x0 84 | #define G_EX_PUSH 0x1 85 | 86 | #define G_EX_ID_IGNORE 0x0 87 | #define G_EX_ID_AUTO 0xFFFFFFFF 88 | 89 | #define G_EX_COMPONENT_SKIP 0x0 90 | #define G_EX_COMPONENT_INTERPOLATE 0x1 91 | #define G_EX_COMPONENT_AUTO 0x2 92 | 93 | #define G_EX_INTERPOLATE_SIMPLE 0x0 94 | #define G_EX_INTERPOLATE_DECOMPOSE 0x1 95 | 96 | #define G_EX_ORDER_LINEAR 0x0 97 | #define G_EX_ORDER_AUTO 0x1 98 | 99 | #define G_EX_EDIT_NONE 0x0 100 | #define G_EX_EDIT_ALLOW 0x1 101 | 102 | #define G_EX_BILERP_NONE 0x0 103 | #define G_EX_BILERP_ONLY 0x1 104 | #define G_EX_BILERP_ALL 0x2 105 | 106 | // Represents the 8-byte commands in the F3D microcode family 107 | typedef union { 108 | struct { 109 | unsigned word0; 110 | unsigned word1; 111 | } values; 112 | unsigned long long dummy; // Force to 8-byte alignment 113 | } GfxCommand; 114 | 115 | typedef struct { 116 | short ob[3]; 117 | unsigned short flag; 118 | short tc[2]; 119 | unsigned char cn[4]; 120 | short obp[3]; 121 | } VertexEXColor; 122 | 123 | typedef struct { 124 | short ob[3]; 125 | unsigned short flag; 126 | short tc[2]; 127 | signed char n[3]; 128 | unsigned char a; 129 | short obp[3]; 130 | } VertexEXNormal; 131 | 132 | typedef union { 133 | VertexEXColor v; 134 | VertexEXNormal n; 135 | long long alignment[3]; 136 | } VertexEX; 137 | 138 | #define PARAM(value, bits, shift) \ 139 | ((unsigned) (((unsigned)(value) & ((1U << (bits)) - 1U)) << (shift))) 140 | 141 | #define DOWHILE(code) \ 142 | do { code } while (0) 143 | 144 | #define G_EX_WRITECOMMAND(cmd, _word0, _word1) \ 145 | { \ 146 | cmd->values.word0 = _word0; \ 147 | cmd->values.word1 = _word1; \ 148 | } 149 | 150 | #define G_EX_COMMAND1(cmd, _word0, _word1) \ 151 | DOWHILE( \ 152 | GfxCommand *_cmd = (GfxCommand*)(cmd); \ 153 | G_EX_WRITECOMMAND((_cmd + 0), _word0, _word1) \ 154 | ) 155 | 156 | #define G_EX_COMMAND2(cmd, _word0, _word1, _word2, _word3) \ 157 | DOWHILE( \ 158 | GfxCommand *_cmd = (GfxCommand*)(cmd); \ 159 | (void)(cmd); \ 160 | G_EX_WRITECOMMAND((_cmd + 0), _word0, _word1) \ 161 | G_EX_WRITECOMMAND((_cmd + 1), _word2, _word3) \ 162 | ) 163 | 164 | #define G_EX_COMMAND3(cmd, _word0, _word1, _word2, _word3, _word4, _word5) \ 165 | DOWHILE( \ 166 | GfxCommand *_cmd = (GfxCommand*)(cmd); \ 167 | (void)(cmd); \ 168 | (void)(cmd); \ 169 | G_EX_WRITECOMMAND((_cmd + 0), _word0, _word1) \ 170 | G_EX_WRITECOMMAND((_cmd + 1), _word2, _word3) \ 171 | G_EX_WRITECOMMAND((_cmd + 2), _word4, _word5) \ 172 | ) 173 | 174 | #define G_EX_COMMAND4(cmd, _word0, _word1, _word2, _word3, _word4, _word5, _word6, _word7) \ 175 | DOWHILE( \ 176 | GfxCommand *_cmd = (GfxCommand*)(cmd); \ 177 | (void)(cmd); \ 178 | (void)(cmd); \ 179 | (void)(cmd); \ 180 | G_EX_WRITECOMMAND(cmd_, _word0, _word1) \ 181 | G_EX_WRITECOMMAND(cmd_, _word2, _word3) \ 182 | G_EX_WRITECOMMAND(cmd_, _word4, _word5) \ 183 | G_EX_WRITECOMMAND(cmd_, _word6, _word7) \ 184 | ) 185 | 186 | #define gEXGetVersion(cmd, ret) \ 187 | G_EX_COMMAND1(cmd, \ 188 | PARAM(RT64_HOOK_OPCODE, 8, 24) | PARAM(RT64_HOOK_MAGIC_NUMBER, 24, 0), \ 189 | PARAM(RT64_HOOK_OP_GETVERSION, 4, 28) | PARAM(ret, 28, 0)) 190 | 191 | #define gEXEnable(cmd) \ 192 | G_EX_COMMAND1(cmd, \ 193 | PARAM(RT64_HOOK_OPCODE, 8, 24) | PARAM(RT64_HOOK_MAGIC_NUMBER, 24, 0), \ 194 | PARAM(RT64_HOOK_OP_ENABLE, 4, 28) | PARAM(RT64_EXTENDED_OPCODE, 8, 0)) 195 | 196 | #define gEXDisable(cmd) \ 197 | G_EX_COMMAND1(cmd, \ 198 | PARAM(RT64_HOOK_OPCODE, 8, 24) | PARAM(RT64_HOOK_MAGIC_NUMBER, 24, 0), \ 199 | PARAM(RT64_HOOK_OP_DISABLE, 4, 28)) 200 | 201 | #define gEXBranchList(cmd, dlist) \ 202 | G_EX_COMMAND1(cmd, \ 203 | PARAM(RT64_HOOK_OPCODE, 8, 24) | PARAM(RT64_HOOK_MAGIC_NUMBER, 24, 0), \ 204 | PARAM(RT64_HOOK_OP_BRANCH, 4, 28) | PARAM(dlist, 28, 0)) 205 | 206 | #define gEXDisplayList(cmd, dlist) \ 207 | G_EX_COMMAND1(cmd, \ 208 | PARAM(RT64_HOOK_OPCODE, 8, 24) | PARAM(RT64_HOOK_MAGIC_NUMBER, 24, 0), \ 209 | PARAM(RT64_HOOK_OP_DL, 4, 28) | PARAM(dlist, 28, 0)) 210 | 211 | #define gEXNoOp(cmd) \ 212 | G_EX_COMMAND1(cmd, \ 213 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_NOOP, 24, 0), \ 214 | 0) 215 | 216 | #define gEXPrint(cmd) \ 217 | G_EX_COMMAND1(cmd, \ 218 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PRINT, 24, 0), \ 219 | 0) 220 | 221 | #define gEXTextureRectangle(cmd, lorigin, rorigin, ulx, uly, lrx, lry, tile, s, t, dsdx, dtdy) \ 222 | G_EX_COMMAND3(cmd, \ 223 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_TEXRECT_V1, 24, 0), \ 224 | PARAM(tile, 3, 0) | PARAM(lorigin, 12, 3) | PARAM(rorigin, 12, 15) | PARAM(0, 5, 27), \ 225 | \ 226 | PARAM(ulx, 16, 16) | PARAM(uly, 16, 0), \ 227 | PARAM(lrx, 16, 16) | PARAM(lry, 16, 0), \ 228 | \ 229 | PARAM(s, 16, 16) | PARAM(t, 16, 0), \ 230 | PARAM(dsdx, 16, 16) | PARAM(dtdy, 16, 0) \ 231 | ) 232 | 233 | #define gEXViewport(cmd, origin, vp) \ 234 | G_EX_COMMAND2(cmd, \ 235 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETVIEWPORT_V1, 24, 0), \ 236 | PARAM(origin, 12, 0), \ 237 | \ 238 | 0, \ 239 | (unsigned)vp \ 240 | ) 241 | 242 | #define gEXSetScissor(cmd, mode, lorigin, rorigin, ulx, uly, lrx, lry) \ 243 | G_EX_COMMAND2(cmd, \ 244 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETSCISSOR_V1, 24, 0), \ 245 | PARAM(mode, 2, 0) | PARAM(lorigin, 12, 2) | PARAM(rorigin, 12, 14), \ 246 | \ 247 | PARAM((ulx) * 4, 16, 16) | PARAM((uly) * 4, 16, 0), \ 248 | PARAM((lrx) * 4, 16, 16) | PARAM((lry) * 4, 16, 0) \ 249 | ) 250 | 251 | #define gEXSetRectAlign(cmd, lorigin, rorigin, ulxOffset, ulyOffset, lrxOffset, lryOffset) \ 252 | G_EX_COMMAND2(cmd, \ 253 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETRECTALIGN_V1, 24, 0), \ 254 | PARAM(lorigin, 12, 0) | PARAM(rorigin, 12, 12), \ 255 | \ 256 | PARAM((ulxOffset), 16, 16) | PARAM((ulyOffset), 16, 0), \ 257 | PARAM((lrxOffset), 16, 16) | PARAM((lryOffset), 16, 0) \ 258 | ) 259 | 260 | #define gEXSetViewportAlign(cmd, origin, xOffset, yOffset) \ 261 | G_EX_COMMAND2(cmd, \ 262 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETVIEWPORTALIGN_V1, 24, 0), \ 263 | PARAM(origin, 12, 0), \ 264 | \ 265 | PARAM((xOffset), 16, 16) | PARAM((yOffset), 16, 0), \ 266 | 0 \ 267 | ) 268 | 269 | #define gEXSetScissorAlign(cmd, lorigin, rorigin, ulxOffset, ulyOffset, lrxOffset, lryOffset, ulxBound, ulyBound, lrxBound, lryBound) \ 270 | G_EX_COMMAND3(cmd, \ 271 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETSCISSORALIGN_V1, 24, 0), \ 272 | PARAM(lorigin, 12, 0) | PARAM(rorigin, 12, 12), \ 273 | \ 274 | PARAM((ulxOffset) * 4, 16, 16) | PARAM((ulyOffset) * 4, 16, 0), \ 275 | PARAM((lrxOffset) * 4, 16, 16) | PARAM((lryOffset) * 4, 16, 0), \ 276 | \ 277 | PARAM((ulxBound) * 4, 16, 16) | PARAM((ulyBound) * 4, 16, 0), \ 278 | PARAM((lrxBound) * 4, 16, 16) | PARAM((lryBound) * 4, 16, 0) \ 279 | ) 280 | 281 | #define gEXSetRefreshRate(cmd, refresh_rate) \ 282 | G_EX_COMMAND1(cmd, \ 283 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETREFRESHRATE_V1, 24, 0), \ 284 | PARAM(refresh_rate, 16, 0) \ 285 | ) 286 | 287 | #define gEXVertexZTest(cmd, vertex_index) \ 288 | G_EX_COMMAND1(cmd, \ 289 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_VERTEXZTEST_V1, 24, 0), \ 290 | PARAM(vertex_index, 8, 0) \ 291 | ) 292 | 293 | #define gEXEndVertexZTest(cmd) \ 294 | G_EX_COMMAND1(cmd, \ 295 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_ENDVERTEXZTEST_V1, 24, 0), \ 296 | 0 \ 297 | ) 298 | 299 | #define gEXMatrixGroup(cmd, id, mode, push, proj, pos, rot, scale, skew, persp, vert, tile, order, edit) \ 300 | G_EX_COMMAND2(cmd, \ 301 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_MATRIXGROUP_V1, 24, 0), \ 302 | id, \ 303 | PARAM(push, 1, 0) | PARAM((proj) != 0, 1, 1) | PARAM(mode, 1, 2) | PARAM(pos, 2, 3) | PARAM(rot, 2, 5) | PARAM(scale, 2, 7) | PARAM(skew, 2, 9) | PARAM(persp, 2, 11) | PARAM(vert, 2, 13) | PARAM(tile, 2, 15) | PARAM(order, 2, 17) | PARAM(edit, 1, 19), \ 304 | 0 \ 305 | ) 306 | 307 | #define gEXMatrixGroupSimple(cmd, id, push, proj, pos, rot, persp, vert, tile, order, edit) \ 308 | gEXMatrixGroup(cmd, id, G_EX_INTERPOLATE_SIMPLE, push, proj, pos, rot, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, persp, vert, tile, order, edit) 309 | 310 | #define gEXMatrixGroupDecomposed(cmd, id, push, proj, pos, rot, scale, skew, persp, vert, tile, order, edit) \ 311 | gEXMatrixGroup(cmd, id, G_EX_INTERPOLATE_DECOMPOSE, push, proj, pos, rot, scale, skew, persp, vert, tile, order, edit) 312 | 313 | #define gEXMatrixGroupNoInterpolate(cmd, push, proj, edit) \ 314 | gEXMatrixGroup(cmd, G_EX_ID_IGNORE, G_EX_INTERPOLATE_SIMPLE, push, proj, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_ORDER_LINEAR, edit) 315 | 316 | #define gEXPopMatrixGroup(cmd, proj) \ 317 | G_EX_COMMAND1(cmd, \ 318 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPMATRIXGROUP_V1, 24, 0), \ 319 | PARAM(1, 8, 0) | PARAM(proj, 1, 8) \ 320 | ) 321 | 322 | #define gEXPopMatrixGroupN(cmd, proj, count) \ 323 | G_EX_COMMAND1(cmd, \ 324 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPMATRIXGROUP_V1, 24, 0), \ 325 | PARAM(count, 8, 0) | PARAM(proj, 1, 8) \ 326 | ) 327 | 328 | #define gEXForceUpscale2D(cmd, force) \ 329 | G_EX_COMMAND1(cmd, \ 330 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_FORCEUPSCALE2D_V1, 24, 0), \ 331 | PARAM(force, 1, 0) \ 332 | ) 333 | 334 | #define gEXForceTrueBilerp(cmd, mode) \ 335 | G_EX_COMMAND1(cmd, \ 336 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_FORCETRUEBILERP_V1, 24, 0), \ 337 | PARAM(mode, 2, 0) \ 338 | ) 339 | 340 | #define gEXForceScaleLOD(cmd, force) \ 341 | G_EX_COMMAND1(cmd, \ 342 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_FORCESCALELOD_V1, 24, 0), \ 343 | PARAM(force, 1, 0) \ 344 | ) 345 | 346 | #define gEXForceBranch(cmd, force) \ 347 | G_EX_COMMAND1(cmd, \ 348 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_FORCEBRANCH_V1, 24, 0), \ 349 | PARAM(force, 1, 0) \ 350 | ) 351 | 352 | #define gEXSetRenderToRAM(cmd, render) \ 353 | G_EX_COMMAND1(cmd, \ 354 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETRENDERTORAM_V1, 24, 0), \ 355 | PARAM(render, 1, 0) \ 356 | ) 357 | 358 | #define gEXEditGroupByAddress(cmd, address, mode, push, proj, pos, rot, scale, skew, persp, vert, tile, order) \ 359 | G_EX_COMMAND2(cmd, \ 360 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_EDITGROUPBYADDRESS_V1, 24, 0), \ 361 | (unsigned)(address), \ 362 | PARAM(push, 1, 0) | PARAM((proj) != 0, 1, 1) | PARAM(mode, 1, 2) | PARAM(pos, 2, 3) | PARAM(rot, 2, 5) | PARAM(scale, 2, 7) | PARAM(skew, 2, 9) | PARAM(persp, 2, 11) | PARAM(vert, 2, 13) | PARAM(tile, 2, 15) | PARAM(order, 2, 17) | PARAM(G_EX_EDIT_ALLOW, 1, 18), \ 363 | 0 \ 364 | ) 365 | 366 | #define gEXVertexV1(cmd, vtx, count, v0) \ 367 | G_EX_COMMAND2(cmd, \ 368 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_VERTEX_V1, 24, 0), \ 369 | PARAM((v0)+(n), 7, 1) | PARAM(n, 8, 12), \ 370 | 0, \ 371 | (unsigned)(vtx) \ 372 | ) 373 | 374 | #define gEXPushViewport(cmd) \ 375 | G_EX_COMMAND1(cmd, \ 376 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHVIEWPORT_V1, 24, 0), \ 377 | 0 \ 378 | ) 379 | 380 | #define gEXPopViewport(cmd) \ 381 | G_EX_COMMAND1(cmd, \ 382 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPVIEWPORT_V1, 24, 0), \ 383 | 0 \ 384 | ) 385 | 386 | #define gEXPushScissor(cmd) \ 387 | G_EX_COMMAND1(cmd, \ 388 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHSCISSOR_V1, 24, 0), \ 389 | 0 \ 390 | ) 391 | 392 | #define gEXPopScissor(cmd) \ 393 | G_EX_COMMAND1(cmd, \ 394 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPSCISSOR_V1, 24, 0), \ 395 | 0 \ 396 | ) 397 | 398 | #define gEXPushOtherMode(cmd) \ 399 | G_EX_COMMAND1(cmd, \ 400 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHOTHERMODE_V1, 24, 0), \ 401 | 0 \ 402 | ) 403 | 404 | #define gEXPopOtherMode(cmd) \ 405 | G_EX_COMMAND1(cmd, \ 406 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPOTHERMODE_V1, 24, 0), \ 407 | 0 \ 408 | ) 409 | 410 | #define gEXPushCombineMode(cmd) \ 411 | G_EX_COMMAND1(cmd, \ 412 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHCOMBINE_V1, 24, 0), \ 413 | 0 \ 414 | ) 415 | 416 | #define gEXPopCombineMode(cmd) \ 417 | G_EX_COMMAND1(cmd, \ 418 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPCOMBINE_V1, 24, 0), \ 419 | 0 \ 420 | ) 421 | 422 | #define gEXPushProjectionMatrix(cmd) \ 423 | G_EX_COMMAND1(cmd, \ 424 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHPROJMATRIX_V1, 24, 0), \ 425 | 0 \ 426 | ) 427 | 428 | #define gEXPopProjectionMatrix(cmd) \ 429 | G_EX_COMMAND1(cmd, \ 430 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPPROJMATRIX_V1, 24, 0), \ 431 | 0 \ 432 | ) 433 | 434 | #define gEXPushEnvColor(cmd) \ 435 | G_EX_COMMAND1(cmd, \ 436 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHENVCOLOR_V1, 24, 0), \ 437 | 0 \ 438 | ) 439 | 440 | #define gEXPopEnvColor(cmd) \ 441 | G_EX_COMMAND1(cmd, \ 442 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPENVCOLOR_V1, 24, 0), \ 443 | 0 \ 444 | ) 445 | 446 | #define gEXPushBlendColor(cmd) \ 447 | G_EX_COMMAND1(cmd, \ 448 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHBLENDCOLOR_V1, 24, 0), \ 449 | 0 \ 450 | ) 451 | 452 | #define gEXPopBlendColor(cmd) \ 453 | G_EX_COMMAND1(cmd, \ 454 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPBLENDCOLOR_V1, 24, 0), \ 455 | 0 \ 456 | ) 457 | 458 | #define gEXPushFogColor(cmd) \ 459 | G_EX_COMMAND1(cmd, \ 460 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHFOGCOLOR_V1, 24, 0), \ 461 | 0 \ 462 | ) 463 | 464 | #define gEXPopFogColor(cmd) \ 465 | G_EX_COMMAND1(cmd, \ 466 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPFOGCOLOR_V1, 24, 0), \ 467 | 0 \ 468 | ) 469 | 470 | #define gEXPushFillColor(cmd) \ 471 | G_EX_COMMAND1(cmd, \ 472 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHFILLCOLOR_V1, 24, 0), \ 473 | 0 \ 474 | ) 475 | 476 | #define gEXPopFillColor(cmd) \ 477 | G_EX_COMMAND1(cmd, \ 478 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPFILLCOLOR_V1, 24, 0), \ 479 | 0 \ 480 | ) 481 | 482 | #define gEXPushPrimColor(cmd) \ 483 | G_EX_COMMAND1(cmd, \ 484 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHPRIMCOLOR_V1, 24, 0), \ 485 | 0 \ 486 | ) 487 | 488 | #define gEXPopPrimColor(cmd) \ 489 | G_EX_COMMAND1(cmd, \ 490 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPPRIMCOLOR_V1, 24, 0), \ 491 | 0 \ 492 | ) 493 | 494 | #define gEXPushGeometryMode(cmd) \ 495 | G_EX_COMMAND1(cmd, \ 496 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_PUSHGEOMETRYMODE_V1, 24, 0), \ 497 | 0 \ 498 | ) 499 | 500 | #define gEXPopGeometryMode(cmd) \ 501 | G_EX_COMMAND1(cmd, \ 502 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_POPGEOMETRYMODE_V1, 24, 0), \ 503 | 0 \ 504 | ) 505 | 506 | #define gEXSetDitherNoiseStrength(cmd, value) \ 507 | G_EX_COMMAND1(cmd, \ 508 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETDITHERNOISESTRENGTH_V1, 24, 0), \ 509 | PARAM((value) * 1024, 16, 0) \ 510 | ) 511 | 512 | #define gEXSetRDRAMExtended(cmd, isExtended) \ 513 | G_EX_COMMAND1(cmd, \ 514 | PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETRDRAMEXTENDED_V1, 24, 0), \ 515 | PARAM(isExtended, 1, 0) \ 516 | ) 517 | 518 | #endif // RT64_EXTENDED_GBI 519 | -------------------------------------------------------------------------------- /include/z64recomp_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __Z64RECOMP_API_H__ 2 | #define __Z64RECOMP_API_H__ 3 | 4 | #include "z64actor.h" 5 | #include "modding.h" 6 | 7 | typedef u32 ActorExtensionId; 8 | 9 | // Registers an actor data extension of a given size that applies to a single type of actor specified by `actor_id`. 10 | // Returns a handle that can be passed to `z64recomp_get_extended_actor_data` along with an Actor* to get the data. 11 | // This must be called before any actors have spawned. It is recommended to call this from a `recomp_on_init` callback. 12 | RECOMP_IMPORT("*", ActorExtensionId z64recomp_extend_actor(s16 actor_id, u32 size)); 13 | 14 | // Registers an actor data extension of the given size that applies to all actors in the game. 15 | // Returns a handle that can be passed to `z64recomp_get_extended_actor_data` along with an Actor* to get the data. 16 | // This must be called before any actors have spawned. It is recommended to call this from a `recomp_on_init` callback. 17 | RECOMP_IMPORT("*", ActorExtensionId z64recomp_extend_actor_all(u32 size)); 18 | 19 | // Returns a pointer to the extended actor data associated with a given extension for the provided Actor*. 20 | RECOMP_IMPORT("*", void* z64recomp_get_extended_actor_data(Actor* actor, ActorExtensionId extension)); 21 | 22 | // Returns the spawn index for a given actor in the current scene. This is an incremental value that starts at 0 when a scene 23 | // is loaded and counts up by one for every actor spawned. 24 | // Note that this may not be deterministic for scene spawn list actors, as other mods could potentially spawn additional actors 25 | // before the scene's spawn list is processed. 26 | RECOMP_IMPORT("*", u32 z64recomp_get_actor_spawn_index(Actor* actor)); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /mod.ld: -------------------------------------------------------------------------------- 1 | RAMBASE = 0x81000000; 2 | 3 | MEMORY { 4 | extram(ARWX) : ORIGIN = RAMBASE, LENGTH = 64M 5 | } 6 | 7 | SECTIONS { 8 | /* All of the sections needed will get passed through to output sections automatically. */ 9 | /* Therefore, all that's needed in the sections command is the discards. */ 10 | 11 | /DISCARD/ : { *(.got) *(.MIPS.abiflags) *(.reginfo) *(.pdr) *(.comment) } 12 | } 13 | -------------------------------------------------------------------------------- /mod.toml: -------------------------------------------------------------------------------- 1 | # Config file for an example Majora's Mask: Recompiled mod. 2 | 3 | # Fields that end up in the mod's manifest. 4 | [manifest] 5 | 6 | # Unique ID of this mod. Pick something long enough that it'll never be the same as any other mod. 7 | # The name displayed in the mod management menu is separate from this so this doesn't need to be human readable. 8 | id = "mm_recomp_mod_template" 9 | 10 | # Version of this mod. 11 | version = "1.0.0" 12 | 13 | # The name that will show up for this mod in the mod menu. This should be human readable. 14 | display_name = "Always Spin Attack" 15 | 16 | # The description that will show up when this mod is displayed in the mod menu. This should be human readable. 17 | description = """ 18 | This is an example mod for Majora's Mask: Recompiled that can be used as a template for creating mods. \ 19 | When this mod is enabled, you will always perform a quickspin when swinging your sword. 20 | 21 | For more details, see https://github.com/Zelda64Recomp/MMRecompModTemplate.""" 22 | 23 | # A short description that will show up in this mod's entry in the mod list. This should be human readable and kept short 24 | # to prevent it from being cut off due to the limited space. 25 | short_description = "Always perform a quickspin when swinging your sword." 26 | 27 | # Authors of this mod. 28 | authors = [ "Your name here" ] 29 | 30 | # ID of the target recomp game. 31 | game_id = "mm" 32 | 33 | # Minimum version of the target recomp (e.g. Zelda 64: Recompiled) that this mod can run on. 34 | minimum_recomp_version = "1.2.0" 35 | 36 | # Dependency mods. Each entry is the mod's ID and then an optional minimum version of the dependency mod. 37 | dependencies = [ 38 | # Example dependency: 39 | # "modname:1.0.0" 40 | ] 41 | 42 | # Native libraries (e.g. DLLs) and the functions they export. 43 | native_libraries = [ 44 | # Example native library: 45 | # { name = "my_native_library", funcs = ["my_native_library_function"] } 46 | ] 47 | 48 | # Inputs to the mod tool. 49 | [inputs] 50 | 51 | # Input elf file to generate a mod from. 52 | elf_path = "build/mod.elf" 53 | 54 | # Output mod filename. 55 | mod_filename = "mm_recomp_mod_template" 56 | 57 | # Reference symbol files. 58 | func_reference_syms_file = "Zelda64RecompSyms/mm.us.rev1.syms.toml" 59 | data_reference_syms_files = [ "Zelda64RecompSyms/mm.us.rev1.datasyms.toml", "Zelda64RecompSyms/mm.us.rev1.datasyms_static.toml" ] 60 | 61 | # Additional files to include in the mod. 62 | additional_files = [ ] 63 | 64 | [[manifest.config_options]] 65 | id = "enum_option" 66 | name = "Enum Option" 67 | description = "Test enum config option" 68 | type = "Enum" 69 | options = [ "First", "Second" ] 70 | default = "First" 71 | 72 | [[manifest.config_options]] 73 | id = "number_option" 74 | name = "Number Option" 75 | description = "Test number config option." 76 | type = "Number" 77 | min = 0 78 | max = 10 79 | step = 0.1 80 | precision = 1 81 | percent = false 82 | default = 1 83 | 84 | [[manifest.config_options]] 85 | id = "string_option" 86 | name = "String Option" 87 | description = "Test string config option." 88 | type = "String" 89 | default = "Lorem Ipsum" 90 | -------------------------------------------------------------------------------- /offline_build/mod_recomp.h: -------------------------------------------------------------------------------- 1 | #ifndef __MOD_RECOMP_H__ 2 | #define __MOD_RECOMP_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #if defined(_WIN32) 10 | #define RECOMP_EXPORT __declspec(dllexport) 11 | #else 12 | #define RECOMP_EXPORT __attribute__((visibility("default"))) 13 | #endif 14 | 15 | // Compiler definition to disable inter-procedural optimization, allowing multiple functions to be in a single file without breaking interposition. 16 | #if defined(_MSC_VER) && !defined(__clang__) 17 | // MSVC's __declspec(noinline) seems to disable inter-procedural optimization entirely, so it's all that's needed. 18 | #define RECOMP_FUNC RECOMP_EXPORT __declspec(noinline) 19 | #elif defined(__clang__) 20 | // Clang has no dedicated IPO attribute, so we use a combination of other attributes to give the desired behavior. 21 | // The inline keyword allows multiple definitions during linking, and extern forces clang to emit an externally visible definition. 22 | // Weak forces Clang to not perform any IPO as the symbol can be interposed, which prevents actual inlining due to the inline keyword. 23 | // Add noinline on for good measure, which doesn't conflict with the inline keyword as they have different meanings. 24 | #define RECOMP_FUNC RECOMP_EXPORT extern inline __attribute__((weak,noinline)) 25 | #elif defined(__GNUC__) 26 | // Use GCC's attribute for disabling inter-procedural optimizations. 27 | #define RECOMP_FUNC RECOMP_EXPORT __attribute__((noipa)) 28 | #else 29 | #error "No RECOMP_FUNC definition for this compiler" 30 | #endif 31 | 32 | typedef uint64_t gpr; 33 | 34 | #define SIGNED(val) \ 35 | ((int64_t)(val)) 36 | 37 | #define ADD32(a, b) \ 38 | ((gpr)(int32_t)((a) + (b))) 39 | 40 | #define SUB32(a, b) \ 41 | ((gpr)(int32_t)((a) - (b))) 42 | 43 | #define MEM_W(offset, reg) \ 44 | (*(int32_t*)(rdram + ((((reg) + (offset))) - 0xFFFFFFFF80000000))) 45 | 46 | #define MEM_H(offset, reg) \ 47 | (*(int16_t*)(rdram + ((((reg) + (offset)) ^ 2) - 0xFFFFFFFF80000000))) 48 | 49 | #define MEM_B(offset, reg) \ 50 | (*(int8_t*)(rdram + ((((reg) + (offset)) ^ 3) - 0xFFFFFFFF80000000))) 51 | 52 | #define MEM_HU(offset, reg) \ 53 | (*(uint16_t*)(rdram + ((((reg) + (offset)) ^ 2) - 0xFFFFFFFF80000000))) 54 | 55 | #define MEM_BU(offset, reg) \ 56 | (*(uint8_t*)(rdram + ((((reg) + (offset)) ^ 3) - 0xFFFFFFFF80000000))) 57 | 58 | #define SD(val, offset, reg) { \ 59 | *(uint32_t*)(rdram + ((((reg) + (offset) + 4)) - 0xFFFFFFFF80000000)) = (uint32_t)((gpr)(val) >> 0); \ 60 | *(uint32_t*)(rdram + ((((reg) + (offset) + 0)) - 0xFFFFFFFF80000000)) = (uint32_t)((gpr)(val) >> 32); \ 61 | } 62 | 63 | static inline uint64_t load_doubleword(uint8_t* rdram, gpr reg, gpr offset) { 64 | uint64_t ret = 0; 65 | uint64_t lo = (uint64_t)(uint32_t)MEM_W(reg, offset + 4); 66 | uint64_t hi = (uint64_t)(uint32_t)MEM_W(reg, offset + 0); 67 | ret = (lo << 0) | (hi << 32); 68 | return ret; 69 | } 70 | 71 | #define LD(offset, reg) \ 72 | load_doubleword(rdram, offset, reg) 73 | 74 | static inline gpr do_lwl(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) { 75 | // Calculate the overall address 76 | gpr address = (offset + reg); 77 | 78 | // Load the aligned word 79 | gpr word_address = address & ~0x3; 80 | uint32_t loaded_value = MEM_W(0, word_address); 81 | 82 | // Mask the existing value and shift the loaded value appropriately 83 | gpr misalignment = address & 0x3; 84 | gpr masked_value = initial_value & ~(0xFFFFFFFFu << (misalignment * 8)); 85 | loaded_value <<= (misalignment * 8); 86 | 87 | // Cast to int32_t to sign extend first 88 | return (gpr)(int32_t)(masked_value | loaded_value); 89 | } 90 | 91 | static inline gpr do_lwr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) { 92 | // Calculate the overall address 93 | gpr address = (offset + reg); 94 | 95 | // Load the aligned word 96 | gpr word_address = address & ~0x3; 97 | uint32_t loaded_value = MEM_W(0, word_address); 98 | 99 | // Mask the existing value and shift the loaded value appropriately 100 | gpr misalignment = address & 0x3; 101 | gpr masked_value = initial_value & ~(0xFFFFFFFFu >> (24 - misalignment * 8)); 102 | loaded_value >>= (24 - misalignment * 8); 103 | 104 | // Cast to int32_t to sign extend first 105 | return (gpr)(int32_t)(masked_value | loaded_value); 106 | } 107 | 108 | static inline void do_swl(uint8_t* rdram, gpr offset, gpr reg, gpr val) { 109 | // Calculate the overall address 110 | gpr address = (offset + reg); 111 | 112 | // Get the initial value of the aligned word 113 | gpr word_address = address & ~0x3; 114 | uint32_t initial_value = MEM_W(0, word_address); 115 | 116 | // Mask the initial value and shift the input value appropriately 117 | gpr misalignment = address & 0x3; 118 | uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu >> (misalignment * 8)); 119 | uint32_t shifted_input_value = ((uint32_t)val) >> (misalignment * 8); 120 | MEM_W(0, word_address) = masked_initial_value | shifted_input_value; 121 | } 122 | 123 | static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) { 124 | // Calculate the overall address 125 | gpr address = (offset + reg); 126 | 127 | // Get the initial value of the aligned word 128 | gpr word_address = address & ~0x3; 129 | uint32_t initial_value = MEM_W(0, word_address); 130 | 131 | // Mask the initial value and shift the input value appropriately 132 | gpr misalignment = address & 0x3; 133 | uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu << (24 - misalignment * 8)); 134 | uint32_t shifted_input_value = ((uint32_t)val) << (24 - misalignment * 8); 135 | MEM_W(0, word_address) = masked_initial_value | shifted_input_value; 136 | } 137 | 138 | #define S32(val) \ 139 | ((int32_t)(val)) 140 | 141 | #define U32(val) \ 142 | ((uint32_t)(val)) 143 | 144 | #define S64(val) \ 145 | ((int64_t)(val)) 146 | 147 | #define U64(val) \ 148 | ((uint64_t)(val)) 149 | 150 | #define MUL_S(val1, val2) \ 151 | ((val1) * (val2)) 152 | 153 | #define MUL_D(val1, val2) \ 154 | ((val1) * (val2)) 155 | 156 | #define DIV_S(val1, val2) \ 157 | ((val1) / (val2)) 158 | 159 | #define DIV_D(val1, val2) \ 160 | ((val1) / (val2)) 161 | 162 | #define CVT_S_W(val) \ 163 | ((float)((int32_t)(val))) 164 | 165 | #define CVT_D_W(val) \ 166 | ((double)((int32_t)(val))) 167 | 168 | #define CVT_D_S(val) \ 169 | ((double)(val)) 170 | 171 | #define CVT_S_D(val) \ 172 | ((float)(val)) 173 | 174 | #define TRUNC_W_S(val) \ 175 | ((int32_t)(val)) 176 | 177 | #define TRUNC_W_D(val) \ 178 | ((int32_t)(val)) 179 | 180 | #define TRUNC_L_S(val) \ 181 | ((int64_t)(val)) 182 | 183 | #define TRUNC_L_D(val) \ 184 | ((int64_t)(val)) 185 | 186 | #define DEFAULT_ROUNDING_MODE 0 187 | 188 | static inline int32_t do_cvt_w_s(float val, unsigned int rounding_mode) { 189 | switch (rounding_mode) { 190 | case 0: // round to nearest value 191 | return (int32_t)lroundf(val); 192 | case 1: // round to zero (truncate) 193 | return (int32_t)val; 194 | case 2: // round to positive infinity (ceil) 195 | return (int32_t)ceilf(val); 196 | case 3: // round to negative infinity (floor) 197 | return (int32_t)floorf(val); 198 | } 199 | assert(0); 200 | return 0; 201 | } 202 | 203 | #define CVT_W_S(val) \ 204 | do_cvt_w_s(val, rounding_mode) 205 | 206 | static inline int32_t do_cvt_w_d(double val, unsigned int rounding_mode) { 207 | switch (rounding_mode) { 208 | case 0: // round to nearest value 209 | return (int32_t)lround(val); 210 | case 1: // round to zero (truncate) 211 | return (int32_t)val; 212 | case 2: // round to positive infinity (ceil) 213 | return (int32_t)ceil(val); 214 | case 3: // round to negative infinity (floor) 215 | return (int32_t)floor(val); 216 | } 217 | assert(0); 218 | return 0; 219 | } 220 | 221 | #define CVT_W_D(val) \ 222 | do_cvt_w_d(val, rounding_mode) 223 | 224 | #define NAN_CHECK(val) \ 225 | assert(val == val) 226 | 227 | //#define NAN_CHECK(val) 228 | 229 | typedef union { 230 | double d; 231 | struct { 232 | float fl; 233 | float fh; 234 | }; 235 | struct { 236 | uint32_t u32l; 237 | uint32_t u32h; 238 | }; 239 | uint64_t u64; 240 | } fpr; 241 | 242 | typedef struct { 243 | gpr r0, r1, r2, r3, r4, r5, r6, r7, 244 | r8, r9, r10, r11, r12, r13, r14, r15, 245 | r16, r17, r18, r19, r20, r21, r22, r23, 246 | r24, r25, r26, r27, r28, r29, r30, r31; 247 | fpr f0, f1, f2, f3, f4, f5, f6, f7, 248 | f8, f9, f10, f11, f12, f13, f14, f15, 249 | f16, f17, f18, f19, f20, f21, f22, f23, 250 | f24, f25, f26, f27, f28, f29, f30, f31; 251 | uint64_t hi, lo; 252 | uint32_t* f_odd; 253 | uint32_t status_reg; 254 | uint8_t mips3_float_mode; 255 | } recomp_context; 256 | 257 | // Checks if the target is an even float register or that mips3 float mode is enabled 258 | #define CHECK_FR(ctx, idx) \ 259 | assert(((idx) & 1) == 0 || (ctx)->mips3_float_mode) 260 | 261 | #ifdef __cplusplus 262 | extern "C" { 263 | #endif 264 | 265 | typedef void (recomp_func_t)(uint8_t* rdram, recomp_context* ctx); 266 | 267 | extern RECOMP_EXPORT recomp_func_t* (*get_function)(int32_t vram); 268 | extern RECOMP_EXPORT void (*cop0_status_write)(recomp_context* ctx, gpr value); 269 | extern RECOMP_EXPORT gpr (*cop0_status_read)(recomp_context* ctx); 270 | extern RECOMP_EXPORT void (*switch_error)(const char* func, uint32_t vram, uint32_t jtbl); 271 | extern RECOMP_EXPORT void (*do_break)(uint32_t vram); 272 | 273 | #define LOOKUP_FUNC(val) \ 274 | get_function((int32_t)(val)) 275 | 276 | extern RECOMP_EXPORT int32_t* reference_section_addresses; 277 | extern RECOMP_EXPORT int32_t section_addresses[]; 278 | 279 | #define LO16(x) \ 280 | ((x) & 0xFFFF) 281 | 282 | #define HI16(x) \ 283 | (((x) >> 16) + (((x) >> 15) & 1)) 284 | 285 | #define RELOC_HI16(section_index, offset) \ 286 | HI16(section_addresses[section_index] + (offset)) 287 | 288 | #define RELOC_LO16(section_index, offset) \ 289 | LO16(section_addresses[section_index] + (offset)) 290 | 291 | #define REF_RELOC_HI16(section_index, offset) \ 292 | HI16(reference_section_addresses[section_index] + (offset)) 293 | 294 | #define REF_RELOC_LO16(section_index, offset) \ 295 | LO16(reference_section_addresses[section_index] + (offset)) 296 | 297 | void recomp_syscall_handler(uint8_t* rdram, recomp_context* ctx, int32_t instruction_vram); 298 | 299 | void pause_self(uint8_t *rdram); 300 | 301 | #ifdef __cplusplus 302 | } 303 | #endif 304 | 305 | #endif 306 | -------------------------------------------------------------------------------- /overlays.us.rev1.txt: -------------------------------------------------------------------------------- 1 | ..ovl_title 2 | ..ovl_select 3 | ..ovl_opening 4 | ..ovl_file_choose 5 | ..ovl_daytelop 6 | ..ovl_kaleido_scope 7 | ..ovl_player_actor 8 | ..ovl_En_Test 9 | ..ovl_En_GirlA 10 | ..ovl_En_Part 11 | ..ovl_En_Light 12 | ..ovl_En_Door 13 | ..ovl_En_Box 14 | ..ovl_En_Pametfrog 15 | ..ovl_En_Okuta 16 | ..ovl_En_Bom 17 | ..ovl_En_Wallmas 18 | ..ovl_En_Dodongo 19 | ..ovl_En_Firefly 20 | ..ovl_En_Horse 21 | ..ovl_En_Arrow 22 | ..ovl_En_Elf 23 | ..ovl_En_Niw 24 | ..ovl_En_Tite 25 | ..ovl_En_Peehat 26 | ..ovl_En_Holl 27 | ..ovl_En_Dinofos 28 | ..ovl_En_Hata 29 | ..ovl_En_Zl1 30 | ..ovl_En_Viewer 31 | ..ovl_En_Bubble 32 | ..ovl_Door_Shutter 33 | ..ovl_En_Boom 34 | ..ovl_En_Torch2 35 | ..ovl_En_Minifrog 36 | ..ovl_En_St 37 | ..ovl_Obj_Wturn 38 | ..ovl_En_River_Sound 39 | ..ovl_En_Ossan 40 | ..ovl_En_Famos 41 | ..ovl_En_Bombf 42 | ..ovl_En_Am 43 | ..ovl_En_Dekubaba 44 | ..ovl_En_M_Fire1 45 | ..ovl_En_M_Thunder 46 | ..ovl_Bg_Breakwall 47 | ..ovl_Door_Warp1 48 | ..ovl_Obj_Syokudai 49 | ..ovl_Item_B_Heart 50 | ..ovl_En_Dekunuts 51 | ..ovl_En_Bbfall 52 | ..ovl_Arms_Hook 53 | ..ovl_En_Bb 54 | ..ovl_Bg_Keikoku_Spr 55 | ..ovl_En_Wood02 56 | ..ovl_En_Death 57 | ..ovl_En_Minideath 58 | ..ovl_En_Vm 59 | ..ovl_Demo_Effect 60 | ..ovl_Demo_Kankyo 61 | ..ovl_En_Floormas 62 | ..ovl_En_Rd 63 | ..ovl_Bg_F40_Flift 64 | ..ovl_Obj_Mure 65 | ..ovl_En_Sw 66 | ..ovl_Object_Kankyo 67 | ..ovl_En_Horse_Link_Child 68 | ..ovl_Door_Ana 69 | ..ovl_En_Encount1 70 | ..ovl_Demo_Tre_Lgt 71 | ..ovl_En_Encount2 72 | ..ovl_En_Fire_Rock 73 | ..ovl_Bg_Ctower_Rot 74 | ..ovl_Mir_Ray 75 | ..ovl_En_Sb 76 | ..ovl_En_Bigslime 77 | ..ovl_En_Karebaba 78 | ..ovl_En_In 79 | ..ovl_En_Bom_Chu 80 | ..ovl_En_Horse_Game_Check 81 | ..ovl_En_Rr 82 | ..ovl_En_Fr 83 | ..ovl_En_Fishing 84 | ..ovl_Obj_Oshihiki 85 | ..ovl_Eff_Dust 86 | ..ovl_Bg_Umajump 87 | ..ovl_En_Insect 88 | ..ovl_En_Butte 89 | ..ovl_En_Fish 90 | ..ovl_Item_Etcetera 91 | ..ovl_Arrow_Fire 92 | ..ovl_Arrow_Ice 93 | ..ovl_Arrow_Light 94 | ..ovl_Obj_Kibako 95 | ..ovl_Obj_Tsubo 96 | ..ovl_En_Ik 97 | ..ovl_Demo_Shd 98 | ..ovl_En_Dns 99 | ..ovl_Elf_Msg 100 | ..ovl_En_Honotrap 101 | ..ovl_En_Tubo_Trap 102 | ..ovl_Obj_Ice_Poly 103 | ..ovl_En_Fz 104 | ..ovl_En_Kusa 105 | ..ovl_Obj_Bean 106 | ..ovl_Obj_Bombiwa 107 | ..ovl_Obj_Switch 108 | ..ovl_Obj_Lift 109 | ..ovl_Obj_Hsblock 110 | ..ovl_En_Okarina_Tag 111 | ..ovl_En_Goroiwa 112 | ..ovl_En_Daiku 113 | ..ovl_En_Nwc 114 | ..ovl_Item_Inbox 115 | ..ovl_En_Ge1 116 | ..ovl_Obj_Blockstop 117 | ..ovl_En_Sda 118 | ..ovl_En_Clear_Tag 119 | ..ovl_En_Gm 120 | ..ovl_En_Ms 121 | ..ovl_En_Hs 122 | ..ovl_Bg_Ingate 123 | ..ovl_En_Kanban 124 | ..ovl_En_Attack_Niw 125 | ..ovl_En_Mk 126 | ..ovl_En_Owl 127 | ..ovl_En_Ishi 128 | ..ovl_Obj_Hana 129 | ..ovl_Obj_Lightswitch 130 | ..ovl_Obj_Mure2 131 | ..ovl_En_Fu 132 | ..ovl_En_Stream 133 | ..ovl_En_Mm 134 | ..ovl_En_Weather_Tag 135 | ..ovl_En_Ani 136 | ..ovl_En_Js 137 | ..ovl_En_Okarina_Effect 138 | ..ovl_En_Mag 139 | ..ovl_Elf_Msg2 140 | ..ovl_Bg_F40_Swlift 141 | ..ovl_En_Kakasi 142 | ..ovl_Obj_Makeoshihiki 143 | ..ovl_Oceff_Spot 144 | ..ovl_En_Torch 145 | ..ovl_Shot_Sun 146 | ..ovl_Obj_Roomtimer 147 | ..ovl_En_Ssh 148 | ..ovl_Oceff_Wipe 149 | ..ovl_Effect_Ss_Dust 150 | ..ovl_Effect_Ss_Kirakira 151 | ..ovl_Effect_Ss_Bomb2 152 | ..ovl_Effect_Ss_Blast 153 | ..ovl_Effect_Ss_G_Spk 154 | ..ovl_Effect_Ss_D_Fire 155 | ..ovl_Effect_Ss_Bubble 156 | ..ovl_Effect_Ss_G_Ripple 157 | ..ovl_Effect_Ss_G_Splash 158 | ..ovl_Effect_Ss_G_Fire 159 | ..ovl_Effect_Ss_Lightning 160 | ..ovl_Effect_Ss_Dt_Bubble 161 | ..ovl_Effect_Ss_Hahen 162 | ..ovl_Effect_Ss_Stick 163 | ..ovl_Effect_Ss_Sibuki 164 | ..ovl_Effect_Ss_Stone1 165 | ..ovl_Effect_Ss_Hitmark 166 | ..ovl_Effect_Ss_Fhg_Flash 167 | ..ovl_Effect_Ss_K_Fire 168 | ..ovl_Effect_Ss_Solder_Srch_Ball 169 | ..ovl_Effect_Ss_Kakera 170 | ..ovl_Effect_Ss_Ice_Piece 171 | ..ovl_Effect_Ss_En_Ice 172 | ..ovl_Effect_Ss_Fire_Tail 173 | ..ovl_Effect_Ss_En_Fire 174 | ..ovl_Effect_Ss_Extra 175 | ..ovl_Effect_Ss_Dead_Db 176 | ..ovl_Effect_Ss_Dead_Dd 177 | ..ovl_Effect_Ss_Dead_Ds 178 | ..ovl_Oceff_Storm 179 | ..ovl_Obj_Demo 180 | ..ovl_En_Minislime 181 | ..ovl_En_Nutsball 182 | ..ovl_Oceff_Wipe2 183 | ..ovl_Oceff_Wipe3 184 | ..ovl_En_Dg 185 | ..ovl_En_Si 186 | ..ovl_Obj_Comb 187 | ..ovl_Obj_Kibako2 188 | ..ovl_En_Hs2 189 | ..ovl_Obj_Mure3 190 | ..ovl_En_Tg 191 | ..ovl_En_Wf 192 | ..ovl_En_Skb 193 | ..ovl_En_Gs 194 | ..ovl_Obj_Sound 195 | ..ovl_En_Crow 196 | ..ovl_En_Cow 197 | ..ovl_Oceff_Wipe4 198 | ..ovl_En_Zo 199 | ..ovl_Effect_Ss_Ice_Smoke 200 | ..ovl_Obj_Makekinsuta 201 | ..ovl_En_Ge3 202 | ..ovl_Obj_Hamishi 203 | ..ovl_En_Zl4 204 | ..ovl_En_Mm2 205 | ..ovl_Door_Spiral 206 | ..ovl_Obj_Pzlblock 207 | ..ovl_Obj_Toge 208 | ..ovl_Obj_Armos 209 | ..ovl_Obj_Boyo 210 | ..ovl_En_Grasshopper 211 | ..ovl_Obj_Grass 212 | ..ovl_Obj_Grass_Carry 213 | ..ovl_Obj_Grass_Unit 214 | ..ovl_Bg_Fire_Wall 215 | ..ovl_En_Bu 216 | ..ovl_En_Encount3 217 | ..ovl_En_Jso 218 | ..ovl_Obj_Chikuwa 219 | ..ovl_En_Knight 220 | ..ovl_En_Warp_tag 221 | ..ovl_En_Aob_01 222 | ..ovl_En_Boj_01 223 | ..ovl_En_Boj_02 224 | ..ovl_En_Boj_03 225 | ..ovl_En_Encount4 226 | ..ovl_En_Bom_Bowl_Man 227 | ..ovl_En_Syateki_Man 228 | ..ovl_Bg_Icicle 229 | ..ovl_En_Syateki_Crow 230 | ..ovl_En_Boj_04 231 | ..ovl_En_Cne_01 232 | ..ovl_En_Bba_01 233 | ..ovl_En_Bji_01 234 | ..ovl_Bg_Spdweb 235 | ..ovl_En_Mt_tag 236 | ..ovl_Boss_01 237 | ..ovl_Boss_02 238 | ..ovl_Boss_03 239 | ..ovl_Boss_04 240 | ..ovl_Boss_05 241 | ..ovl_Boss_06 242 | ..ovl_Boss_07 243 | ..ovl_Bg_Dy_Yoseizo 244 | ..ovl_En_Boj_05 245 | ..ovl_En_Sob1 246 | ..ovl_En_Go 247 | ..ovl_En_Raf 248 | ..ovl_Obj_Funen 249 | ..ovl_Obj_Raillift 250 | ..ovl_Bg_Numa_Hana 251 | ..ovl_Obj_Flowerpot 252 | ..ovl_Obj_Spinyroll 253 | ..ovl_Dm_Hina 254 | ..ovl_En_Syateki_Wf 255 | ..ovl_Obj_Skateblock 256 | ..ovl_Effect_En_Ice_Block 257 | ..ovl_Obj_Iceblock 258 | ..ovl_En_Bigpamet 259 | ..ovl_Bg_Dblue_Movebg 260 | ..ovl_En_Syateki_Dekunuts 261 | ..ovl_Elf_Msg3 262 | ..ovl_En_Fg 263 | ..ovl_Dm_Ravine 264 | ..ovl_Dm_Sa 265 | ..ovl_En_Slime 266 | ..ovl_En_Pr 267 | ..ovl_Obj_Toudai 268 | ..ovl_Obj_Entotu 269 | ..ovl_Obj_Bell 270 | ..ovl_En_Syateki_Okuta 271 | ..ovl_Obj_Shutter 272 | ..ovl_Dm_Zl 273 | ..ovl_En_Ru 274 | ..ovl_En_Elfgrp 275 | ..ovl_Dm_Tsg 276 | ..ovl_En_Baguo 277 | ..ovl_Obj_Vspinyroll 278 | ..ovl_Obj_Smork 279 | ..ovl_En_Test2 280 | ..ovl_En_Test3 281 | ..ovl_En_Test4 282 | ..ovl_En_Bat 283 | ..ovl_En_Sekihi 284 | ..ovl_En_Wiz 285 | ..ovl_En_Wiz_Brock 286 | ..ovl_En_Wiz_Fire 287 | ..ovl_Eff_Change 288 | ..ovl_Dm_Statue 289 | ..ovl_Obj_Fireshield 290 | ..ovl_Bg_Ladder 291 | ..ovl_En_Mkk 292 | ..ovl_Demo_Getitem 293 | ..ovl_En_Dnb 294 | ..ovl_En_Dnh 295 | ..ovl_En_Dnk 296 | ..ovl_En_Dnq 297 | ..ovl_Bg_Keikoku_Saku 298 | ..ovl_Obj_Hugebombiwa 299 | ..ovl_En_Firefly2 300 | ..ovl_En_Rat 301 | ..ovl_En_Water_Effect 302 | ..ovl_En_Kusa2 303 | ..ovl_Bg_Spout_Fire 304 | ..ovl_En_Dy_Extra 305 | ..ovl_En_Bal 306 | ..ovl_En_Ginko_Man 307 | ..ovl_En_Warp_Uzu 308 | ..ovl_Obj_Driftice 309 | ..ovl_En_Look_Nuts 310 | ..ovl_En_Mushi2 311 | ..ovl_En_Fall 312 | ..ovl_En_Mm3 313 | ..ovl_Bg_Crace_Movebg 314 | ..ovl_En_Dno 315 | ..ovl_En_Pr2 316 | ..ovl_En_Prz 317 | ..ovl_En_Jso2 318 | ..ovl_Obj_Etcetera 319 | ..ovl_En_Egol 320 | ..ovl_Obj_Mine 321 | ..ovl_Obj_Purify 322 | ..ovl_En_Tru 323 | ..ovl_En_Trt 324 | ..ovl_En_Test5 325 | ..ovl_En_Test6 326 | ..ovl_En_Az 327 | ..ovl_En_Estone 328 | ..ovl_Bg_Hakugin_Post 329 | ..ovl_Dm_Opstage 330 | ..ovl_Dm_Stk 331 | ..ovl_Dm_Char00 332 | ..ovl_Dm_Char01 333 | ..ovl_Dm_Char02 334 | ..ovl_Dm_Char03 335 | ..ovl_Dm_Char04 336 | ..ovl_Dm_Char05 337 | ..ovl_Dm_Char06 338 | ..ovl_Dm_Char07 339 | ..ovl_Dm_Char08 340 | ..ovl_Dm_Char09 341 | ..ovl_Obj_Tokeidai 342 | ..ovl_En_Mnk 343 | ..ovl_En_Egblock 344 | ..ovl_En_Guard_Nuts 345 | ..ovl_Bg_Hakugin_Bombwall 346 | ..ovl_Obj_Tokei_Tobira 347 | ..ovl_Bg_Hakugin_Elvpole 348 | ..ovl_En_Ma4 349 | ..ovl_En_Twig 350 | ..ovl_En_Po_Fusen 351 | ..ovl_En_Door_Etc 352 | ..ovl_En_Bigokuta 353 | ..ovl_Bg_Icefloe 354 | ..ovl_fbdemo_triforce 355 | ..ovl_fbdemo_wipe1 356 | ..ovl_fbdemo_wipe3 357 | ..ovl_fbdemo_wipe4 358 | ..ovl_fbdemo_wipe5 359 | ..ovl_Effect_Ss_Sbn 360 | ..ovl_Obj_Ocarinalift 361 | ..ovl_En_Time_Tag 362 | ..ovl_Bg_Open_Shutter 363 | ..ovl_Bg_Open_Spot 364 | ..ovl_Bg_Fu_Kaiten 365 | ..ovl_Obj_Aqua 366 | ..ovl_En_Elforg 367 | ..ovl_En_Elfbub 368 | ..ovl_En_Fu_Mato 369 | ..ovl_En_Fu_Kago 370 | ..ovl_En_Osn 371 | ..ovl_Bg_Ctower_Gear 372 | ..ovl_En_Trt2 373 | ..ovl_Obj_Tokei_Step 374 | ..ovl_Bg_Lotus 375 | ..ovl_En_Kame 376 | ..ovl_Obj_Takaraya_Wall 377 | ..ovl_Bg_Fu_Mizu 378 | ..ovl_En_Sellnuts 379 | ..ovl_Bg_Dkjail_Ivy 380 | ..ovl_Obj_Visiblock 381 | ..ovl_En_Takaraya 382 | ..ovl_En_Tsn 383 | ..ovl_En_Ds2n 384 | ..ovl_En_Fsn 385 | ..ovl_En_Shn 386 | ..ovl_En_Stop_heishi 387 | ..ovl_Obj_Bigicicle 388 | ..ovl_En_Lift_Nuts 389 | ..ovl_En_Tk 390 | ..ovl_Bg_Market_Step 391 | ..ovl_Obj_Lupygamelift 392 | ..ovl_En_Test7 393 | ..ovl_Obj_Lightblock 394 | ..ovl_Mir_Ray2 395 | ..ovl_En_Wdhand 396 | ..ovl_En_Gamelupy 397 | ..ovl_Bg_Danpei_Movebg 398 | ..ovl_En_Snowwd 399 | ..ovl_En_Pm 400 | ..ovl_En_Gakufu 401 | ..ovl_Elf_Msg4 402 | ..ovl_Elf_Msg5 403 | ..ovl_En_Col_Man 404 | ..ovl_En_Talk_Gibud 405 | ..ovl_En_Giant 406 | ..ovl_Obj_Snowball 407 | ..ovl_Boss_Hakugin 408 | ..ovl_En_Gb2 409 | ..ovl_En_Onpuman 410 | ..ovl_Bg_Tobira01 411 | ..ovl_En_Tag_Obj 412 | ..ovl_Obj_Dhouse 413 | ..ovl_Obj_Hakaisi 414 | ..ovl_Bg_Hakugin_Switch 415 | ..ovl_En_Snowman 416 | ..ovl_TG_Sw 417 | ..ovl_En_Po_Sisters 418 | ..ovl_En_Pp 419 | ..ovl_En_Hakurock 420 | ..ovl_En_Hanabi 421 | ..ovl_Obj_Dowsing 422 | ..ovl_Obj_Wind 423 | ..ovl_En_Racedog 424 | ..ovl_En_Kendo_Js 425 | ..ovl_Bg_Botihasira 426 | ..ovl_En_Fish2 427 | ..ovl_En_Pst 428 | ..ovl_En_Poh 429 | ..ovl_Obj_Spidertent 430 | ..ovl_En_Zoraegg 431 | ..ovl_En_Kbt 432 | ..ovl_En_Gg 433 | ..ovl_En_Maruta 434 | ..ovl_Obj_Snowball2 435 | ..ovl_En_Gg2 436 | ..ovl_Obj_Ghaka 437 | ..ovl_En_Dnp 438 | ..ovl_En_Dai 439 | ..ovl_Bg_Goron_Oyu 440 | ..ovl_En_Kgy 441 | ..ovl_En_Invadepoh 442 | ..ovl_En_Gk 443 | ..ovl_En_An 444 | ..ovl_En_Bee 445 | ..ovl_En_Ot 446 | ..ovl_En_Dragon 447 | ..ovl_Obj_Dora 448 | ..ovl_En_Bigpo 449 | ..ovl_Obj_Kendo_Kanban 450 | ..ovl_Obj_Hariko 451 | ..ovl_En_Sth 452 | ..ovl_Bg_Sinkai_Kabe 453 | ..ovl_Bg_Haka_Curtain 454 | ..ovl_Bg_Kin2_Bombwall 455 | ..ovl_Bg_Kin2_Fence 456 | ..ovl_Bg_Kin2_Picture 457 | ..ovl_Bg_Kin2_Shelf 458 | ..ovl_En_Rail_Skb 459 | ..ovl_En_Jg 460 | ..ovl_En_Tru_Mt 461 | ..ovl_Obj_Um 462 | ..ovl_En_Neo_Reeba 463 | ..ovl_Bg_Mbar_Chair 464 | ..ovl_Bg_Ikana_Block 465 | ..ovl_Bg_Ikana_Mirror 466 | ..ovl_Bg_Ikana_Rotaryroom 467 | ..ovl_Bg_Dblue_Balance 468 | ..ovl_Bg_Dblue_Waterfall 469 | ..ovl_En_Kaizoku 470 | ..ovl_En_Ge2 471 | ..ovl_En_Ma_Yts 472 | ..ovl_En_Ma_Yto 473 | ..ovl_Obj_Tokei_Turret 474 | ..ovl_Bg_Dblue_Elevator 475 | ..ovl_Obj_Warpstone 476 | ..ovl_En_Zog 477 | ..ovl_Obj_Rotlift 478 | ..ovl_Obj_Jg_Gakki 479 | ..ovl_Bg_Inibs_Movebg 480 | ..ovl_En_Zot 481 | ..ovl_Obj_Tree 482 | ..ovl_Obj_Y2lift 483 | ..ovl_Obj_Y2shutter 484 | ..ovl_Obj_Boat 485 | ..ovl_Obj_Taru 486 | ..ovl_Obj_Hunsui 487 | ..ovl_En_Jc_Mato 488 | ..ovl_Mir_Ray3 489 | ..ovl_En_Zob 490 | ..ovl_Elf_Msg6 491 | ..ovl_Obj_Nozoki 492 | ..ovl_En_Toto 493 | ..ovl_En_Railgibud 494 | ..ovl_En_Baba 495 | ..ovl_En_Suttari 496 | ..ovl_En_Zod 497 | ..ovl_En_Kujiya 498 | ..ovl_En_Geg 499 | ..ovl_Obj_Kinoko 500 | ..ovl_Obj_Yasi 501 | ..ovl_En_Tanron1 502 | ..ovl_En_Tanron2 503 | ..ovl_En_Tanron3 504 | ..ovl_Obj_Chan 505 | ..ovl_En_Zos 506 | ..ovl_En_S_Goro 507 | ..ovl_En_Nb 508 | ..ovl_En_Ja 509 | ..ovl_Bg_F40_Block 510 | ..ovl_Bg_F40_Switch 511 | ..ovl_En_Po_Composer 512 | ..ovl_En_Guruguru 513 | ..ovl_Oceff_Wipe5 514 | ..ovl_En_Stone_heishi 515 | ..ovl_Oceff_Wipe6 516 | ..ovl_En_Scopenuts 517 | ..ovl_En_Scopecrow 518 | ..ovl_Oceff_Wipe7 519 | ..ovl_Eff_Kamejima_Wave 520 | ..ovl_En_Hg 521 | ..ovl_En_Hgo 522 | ..ovl_En_Zov 523 | ..ovl_En_Ah 524 | ..ovl_Obj_Hgdoor 525 | ..ovl_Bg_Ikana_Bombwall 526 | ..ovl_Bg_Ikana_Ray 527 | ..ovl_Bg_Ikana_Shutter 528 | ..ovl_Bg_Haka_Bombwall 529 | ..ovl_Bg_Haka_Tomb 530 | ..ovl_En_Sc_Ruppe 531 | ..ovl_Bg_Iknv_Doukutu 532 | ..ovl_Bg_Iknv_Obj 533 | ..ovl_En_Pamera 534 | ..ovl_Obj_HsStump 535 | ..ovl_En_Hidden_Nuts 536 | ..ovl_En_Zow 537 | ..ovl_En_Talk 538 | ..ovl_En_Al 539 | ..ovl_En_Tab 540 | ..ovl_En_Nimotsu 541 | ..ovl_En_Hit_Tag 542 | ..ovl_En_Ruppecrow 543 | ..ovl_En_Tanron4 544 | ..ovl_En_Tanron5 545 | ..ovl_En_Tanron6 546 | ..ovl_En_Daiku2 547 | ..ovl_En_Muto 548 | ..ovl_En_Baisen 549 | ..ovl_En_Heishi 550 | ..ovl_En_Demo_heishi 551 | ..ovl_En_Dt 552 | ..ovl_En_Cha 553 | ..ovl_Obj_Dinner 554 | ..ovl_Eff_Lastday 555 | ..ovl_Bg_Ikana_Dharma 556 | ..ovl_En_Akindonuts 557 | ..ovl_Eff_Stk 558 | ..ovl_En_Ig 559 | ..ovl_En_Rg 560 | ..ovl_En_Osk 561 | ..ovl_En_Sth2 562 | ..ovl_En_Yb 563 | ..ovl_En_Rz 564 | ..ovl_En_Scopecoin 565 | ..ovl_En_Bjt 566 | ..ovl_En_Bomjima 567 | ..ovl_En_Bomjimb 568 | ..ovl_En_Bombers 569 | ..ovl_En_Bombers2 570 | ..ovl_En_Bombal 571 | ..ovl_Obj_Moon_Stone 572 | ..ovl_Obj_Mu_Pict 573 | ..ovl_Bg_Ikninside 574 | ..ovl_Eff_Zoraband 575 | ..ovl_Obj_Kepn_Koya 576 | ..ovl_Obj_Usiyane 577 | ..ovl_En_Nnh 578 | ..ovl_Obj_Kzsaku 579 | ..ovl_Obj_Milk_Bin 580 | ..ovl_En_Kitan 581 | ..ovl_Bg_Astr_Bombwall 582 | ..ovl_Bg_Iknin_Susceil 583 | ..ovl_En_Bsb 584 | ..ovl_En_Recepgirl 585 | ..ovl_En_Thiefbird 586 | ..ovl_En_Jgame_Tsn 587 | ..ovl_Obj_Jgame_Light 588 | ..ovl_Obj_Yado 589 | ..ovl_Demo_Syoten 590 | ..ovl_Demo_Moonend 591 | ..ovl_Bg_Lbfshot 592 | ..ovl_Bg_Last_Bwall 593 | ..ovl_En_And 594 | ..ovl_En_Invadepoh_Demo 595 | ..ovl_Obj_Danpeilift 596 | ..ovl_En_Fall2 597 | ..ovl_Dm_Al 598 | ..ovl_Dm_An 599 | ..ovl_Dm_Ah 600 | ..ovl_Dm_Nb 601 | ..ovl_En_Drs 602 | ..ovl_En_Ending_Hero 603 | ..ovl_Dm_Bal 604 | ..ovl_En_Paper 605 | ..ovl_En_Hint_Skb 606 | ..ovl_Dm_Tag 607 | ..ovl_En_Bh 608 | ..ovl_En_Ending_Hero2 609 | ..ovl_En_Ending_Hero3 610 | ..ovl_En_Ending_Hero4 611 | ..ovl_En_Ending_Hero5 612 | ..ovl_En_Ending_Hero6 613 | ..ovl_Dm_Gm 614 | ..ovl_Obj_Swprize 615 | ..ovl_En_Invisible_Ruppe 616 | ..ovl_Obj_Ending 617 | ..ovl_En_Rsn 618 | -------------------------------------------------------------------------------- /src/always_spin_attack.c: -------------------------------------------------------------------------------- 1 | #include "modding.h" 2 | #include "global.h" 3 | #include "recomputils.h" 4 | #include "recompconfig.h" 5 | 6 | // Patches a function in the base game that's used to check if the player should quickspin. 7 | RECOMP_PATCH s32 Player_CanSpinAttack(Player* this) { 8 | recomp_printf("enum_option: %d\n", recomp_get_config_u32("enum_option")); 9 | recomp_printf("number_option: %d\n", recomp_get_config_double("number_option")); 10 | char* string_option = recomp_get_config_string("string_option"); 11 | if (string_option != NULL) { 12 | recomp_printf("string_option: %s\n", string_option); 13 | recomp_free_config_string(string_option); 14 | } 15 | 16 | // Always spin attack. 17 | return true; 18 | } 19 | 20 | 21 | --------------------------------------------------------------------------------