2024-05-17 06:35:01 -07:00
MAKEFLAGS += --no-builtin-rules --no-print-directory
2020-03-17 00:31:30 -04:00
2022-05-01 00:03:22 +01:00
# Ensure the build fails if a piped command fails
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
2020-07-19 21:42:05 +02:00
# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value'
2024-01-31 17:51:33 +01:00
# currently, GCC is the only supported compiler
COMPILER := gcc
2024-01-05 14:27:19 -08:00
# Target game version. Currently only the following version is supported:
2024-06-24 23:37:48 +02:00
# gc-eu GameCube Europe/PAL
2024-05-10 18:21:07 +02:00
# gc-eu-mq GameCube Europe/PAL Master Quest
2024-01-31 17:51:33 +01:00
# gc-eu-mq-dbg GameCube Europe/PAL Master Quest Debug
2024-02-04 12:30:03 +01:00
# hackeroot-mq HackerOoT, based on gc-eu-mq-dbg (default)
2024-01-31 17:51:33 +01:00
#
2024-01-28 09:09:03 -08:00
# The following versions are work-in-progress and not yet matching:
2024-06-26 03:22:26 -07:00
# gc-us GameCube US
2024-01-31 17:51:33 +01:00
#
2024-02-04 12:30:03 +01:00
# Note: choosing hackeroot-mq will enable HackerOoT features,
2024-01-31 17:51:33 +01:00
# if another version is chosen, this repo will be like
# zeldaret/main decomp but without the disassembly, decompilation
# and matching tools, including the IDO compiler
2024-02-04 12:30:03 +01:00
VERSION := hackeroot-mq
2024-01-31 17:51:33 +01:00
# Enable optimization flags to use GDB on Ares
ARES_GDB := 1
# Toggle release or debug mode. 1=Release, 0=Debug
# Note: currently only used for HackerOoT
RELEASE := 0
2024-02-04 01:45:13 +01:00
# Valid compression algorithms are 'yaz', 'lzo' and 'aplib'
2024-02-04 12:16:55 +01:00
COMPRESSION ?= yaz
2024-02-04 01:45:13 +01:00
COMPRESSION_TYPE ?= $( shell echo $( COMPRESSION) | tr '[:lower:]' '[:upper:]' )
2024-01-24 15:00:10 -03:00
# Number of threads to extract and compress with
N_THREADS := $( shell nproc)
2024-02-01 21:08:45 +01:00
# Check code syntax with host compiler
RUN_CC_CHECK := 1
2022-02-19 16:50:56 -05:00
CFLAGS ?=
CPPFLAGS ?=
2024-05-08 11:58:56 +02:00
CFLAGS_IDO ?=
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES ?=
2024-05-08 11:58:56 +02:00
TARGET ?=
i f e q ( $( TARGET ) , w a d )
CFLAGS := -DCONSOLE_WIIVC -fno-reorder-blocks -fno-optimize-sibling-calls
CPPFLAGS := -DCONSOLE_WIIVC
e l s e i f e q ( $( TARGET ) , i s o )
CFLAGS := -DCONSOLE_GC -fno-reorder-blocks -fno-optimize-sibling-calls
CPPFLAGS := -DCONSOLE_GC
e n d i f
2022-02-19 16:50:56 -05:00
i f e q ( $( COMPILER ) , g c c )
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DCOMPILER_GCC -DNON_MATCHING -DAVOID_UB -std= gnu11
2024-01-31 17:51:33 +01:00
e l s e
$( error Unsupported compiler. Please use gcc as the COMPILER variable.)
2022-02-19 16:50:56 -05:00
e n d i f
2020-07-19 21:42:05 +02:00
2022-01-19 18:57:39 -05:00
# Set prefix to mips binutils binaries (mips-linux-gnu-ld => 'mips-linux-gnu-') - Change at your own risk!
# In nearly all cases, not having 'mips-linux-gnu-*' binaries on the PATH is indicative of missing dependencies
2024-04-17 02:46:52 +02:00
# Returns the path to the command $(1) if exists. Otherwise returns an empty string.
find-command = $( shell which $( 1) 2>/dev/null)
2024-04-22 19:55:44 +02:00
i f n e q ( $( call find -command ,mips -n 64-ld ) , )
2024-04-17 02:46:52 +02:00
MIPS_BINUTILS_PREFIX := mips-n64-
e l s e i f n e q ( $( call find -command ,mips 64-ld ) , )
MIPS_BINUTILS_PREFIX := mips64-
e l s e i f n e q ( $( call find -command ,mips -linux -gnu -ld ) , )
MIPS_BINUTILS_PREFIX := mips-linux-gnu-
e l s e i f n e q ( $( call find -command ,mips 64-linux -gnu -ld ) , )
MIPS_BINUTILS_PREFIX := mips64-linux-gnu-
e l s e i f n e q ( $( call find -command ,mips -ld ) , )
MIPS_BINUTILS_PREFIX := mips-
2024-04-22 19:55:44 +02:00
e l s e i f n e q ( $( call find -command ,mips 64-elf -ld ) , )
MIPS_BINUTILS_PREFIX := mips64-elf-
2024-04-17 02:46:52 +02:00
e l s e
$( error Unable to detect a suitable MIPS toolchain installed)
e n d i f
2022-01-19 18:57:39 -05:00
2024-01-05 14:27:19 -08:00
# Version-specific settings
2024-06-26 03:22:26 -07:00
i f e q ( $( VERSION ) , g c - u s )
DEBUG := 0
2024-07-03 03:42:52 +01:00
CPP_DEFINES += -DTEXT_LANGUAGE= TEXT_LANG_US_JP
2024-06-26 03:22:26 -07:00
e l s e i f e q ( $( VERSION ) , g c - e u )
2024-05-10 18:21:07 +02:00
DEBUG := 0
2024-07-03 03:42:52 +01:00
CPP_DEFINES += -DTEXT_LANGUAGE= TEXT_LANG_EU
2024-05-10 18:21:07 +02:00
HACKEROOT := 0
e l s e i f e q ( $( VERSION ) , g c - e u - m q )
2024-01-29 07:36:41 -08:00
DEBUG := 0
2024-07-03 03:42:52 +01:00
CPP_DEFINES += -DTEXT_LANGUAGE= TEXT_LANG_EU -DOOT_MQ
2024-01-31 17:51:33 +01:00
HACKEROOT := 0
2024-01-28 09:09:03 -08:00
e l s e i f e q ( $( VERSION ) , g c - e u - m q - d b g )
2024-01-29 07:36:41 -08:00
DEBUG := 1
2024-07-03 03:42:52 +01:00
CPP_DEFINES += -DTEXT_LANGUAGE= TEXT_LANG_EU -DOOT_MQ
2024-01-31 17:51:33 +01:00
HACKEROOT := 0
2024-02-04 12:30:03 +01:00
e l s e i f e q ( $( VERSION ) , h a c k e r o o t - m q )
2024-07-18 01:10:34 +01:00
DEBUG := 1
2024-07-03 15:33:23 +02:00
CPP_DEFINES += -DTEXT_LANGUAGE= TEXT_LANG_EU -DOOT_MQ
2024-01-31 17:51:33 +01:00
HACKEROOT := 1
2024-01-05 14:27:19 -08:00
e l s e
$( error Unsupported version $ ( VERSION ) )
e n d i f
2020-03-17 00:31:30 -04:00
PROJECT_DIR := $( dir $( realpath $( firstword $( MAKEFILE_LIST) ) ) )
2024-01-05 14:27:19 -08:00
BUILD_DIR := build/$( VERSION)
2024-01-28 09:09:03 -08:00
EXPECTED_DIR := expected/$( BUILD_DIR)
2024-02-04 19:59:09 -08:00
BASEROM_DIR := baseroms/$( VERSION)
2024-03-02 04:09:57 +01:00
EXTRACTED_DIR := extracted/$( VERSION)
2024-01-24 16:39:13 -08:00
VENV := .venv
2020-03-17 00:31:30 -04:00
2020-09-21 03:00:28 -04:00
MAKE = make
2024-03-29 08:03:28 -07:00
CPPFLAGS += -P -xc -fno-dollars-in-identifiers
2020-09-21 03:00:28 -04:00
2024-01-31 17:51:33 +01:00
# Set PACKAGE_VERSION define for printing commit hash
i f e q ( $( origin PACKAGE_VERSION ) , u n d e f i n e d )
PACKAGE_VERSION := $( shell git log -1 --pretty= %h | tr -d '\n' )
ifeq ( '$(PACKAGE_VERSION)' , '' )
PACKAGE_VERSION = Unknown version
endif
e n d i f
2024-02-04 12:30:03 +01:00
i f e q ( $( VERSION ) , h a c k e r o o t - m q )
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DENABLE_HACKEROOT= 1
2024-01-31 17:51:33 +01:00
OPTFLAGS := -Os
ifeq ( $( RELEASE) ,1)
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DRELEASE_ROM= 1 -DOOT_DEBUG= 0
2024-05-08 11:58:56 +02:00
CFLAGS_IDO += -DOOT_DEBUG= 0
2024-01-31 17:51:33 +01:00
else
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DRELEASE_ROM= 0 -DOOT_DEBUG= 1
2024-01-31 17:51:33 +01:00
endif
2024-01-29 09:20:54 -08:00
e l s e
2024-01-31 17:51:33 +01:00
ifeq ( $( DEBUG) ,1)
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DOOT_DEBUG= 1
2024-01-31 17:51:33 +01:00
OPTFLAGS := -O2
else
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DNDEBUG -DOOT_DEBUG= 0
2024-01-31 17:51:33 +01:00
OPTFLAGS := -O2 -g3
endif
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CPP_DEFINES += -DENABLE_HACKEROOT= 0
2024-01-31 17:51:33 +01:00
e n d i f
# Override optimization flags if using GDB
i f e q ( $( ARES_GDB ) , 1 )
OPTFLAGS := -Og -ggdb3
2024-01-29 09:20:54 -08:00
e n d i f
2024-01-31 17:51:33 +01:00
# Define author and package version for every OoT version
# Note: this won't be used if not using HackerOoT
2024-04-22 19:55:44 +02:00
CFLAGS += -DPACKAGE_VERSION= '$(PACKAGE_VERSION)' -DCOMPRESS_$( COMPRESSION_TYPE) = 1
CPPFLAGS += -DPACKAGE_VERSION= '$(PACKAGE_VERSION)' -DCOMPRESS_$( COMPRESSION_TYPE) = 1
2024-05-08 11:58:56 +02:00
CFLAGS_IDO += -DPACKAGE_VERSION= '$(PACKAGE_VERSION)' -DCOMPRESS_$( COMPRESSION_TYPE) = 1
2024-01-31 17:51:33 +01:00
OPTFLAGS += -ffast-math -fno-unsafe-math-optimizations
2020-09-21 03:00:28 -04:00
i f e q ( $( OS ) , W i n d o w s _ N T )
2021-01-20 20:46:25 +01:00
DETECTED_OS = windows
2020-09-21 03:00:28 -04:00
e l s e
UNAME_S := $( shell uname -s)
ifeq ( $( UNAME_S) ,Linux)
DETECTED_OS = linux
endif
ifeq ( $( UNAME_S) ,Darwin)
DETECTED_OS = macos
MAKE = gmake
endif
e n d i f
2024-04-20 02:23:18 +02:00
# Verbose toggle
V := @
i f e q ( V E R B O S E , 1 )
V =
e n d i f
# Colors
NO_COL := \0 33[ 0m
GREEN := \0 33[ 0; 32m
BLUE := \0 33[ 0; 36m
YELLOW := \0 33[ 0; 33m
2024-04-20 02:28:11 +02:00
BLINK := \0 33[ 32; 5m
2024-04-20 02:23:18 +02:00
PRINT := printf
# Generic print function for make rules
d e f i n e p r i n t
$( V) echo -e " $( GREEN) $( 1) $( YELLOW) $( 2) $( GREEN) -> $( BLUE) $( 3) $( NO_COL) "
e n d e f
2020-03-17 00:31:30 -04:00
#### Tools ####
2022-01-19 18:57:39 -05:00
i f n e q ( $( shell type $ ( MIPS_BINUTILS_PREFIX ) ld >/dev /null 2>/dev /null ; echo $ $ ?) , 0 )
2023-03-20 15:07:18 +00:00
$( error Unable to find $( MIPS_BINUTILS_PREFIX) ld. Please install or build MIPS binutils, commonly mips-linux-gnu. ( or set MIPS_BINUTILS_PREFIX if your MIPS binutils install uses another prefix) )
2020-03-17 00:31:30 -04:00
e n d i f
2022-02-19 16:50:56 -05:00
# Detect compiler and set variables appropriately.
i f e q ( $( COMPILER ) , g c c )
CC := $( MIPS_BINUTILS_PREFIX) gcc
e l s e
2024-01-31 17:51:33 +01:00
$( error Unsupported compiler . Please use gcc as the COMPILER variable .)
2020-03-17 00:31:30 -04:00
e n d i f
2024-01-09 18:49:12 +01:00
AS := $( MIPS_BINUTILS_PREFIX) as
LD := $( MIPS_BINUTILS_PREFIX) ld
OBJCOPY := $( MIPS_BINUTILS_PREFIX) objcopy
OBJDUMP := $( MIPS_BINUTILS_PREFIX) objdump
2024-01-24 15:00:10 -03:00
NM := $( MIPS_BINUTILS_PREFIX) nm
2024-01-09 18:49:12 +01:00
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
N64_EMULATOR ?=
2020-03-17 00:31:30 -04:00
2024-03-02 04:09:57 +01:00
INC := -Iinclude -Iinclude/libc -Isrc -I$( BUILD_DIR) -I. -I$( EXTRACTED_DIR)
2021-09-18 09:07:51 -03:00
2020-03-23 23:15:45 +01:00
# Check code syntax with host compiler
2022-06-16 02:15:44 +02:00
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces
2024-07-04 19:48:16 +01:00
CHECK_WARNINGS += -Werror= implicit-function-declaration -Werror= incompatible-pointer-types -Werror= int-conversion
2020-03-17 00:31:30 -04:00
2024-03-29 08:03:28 -07:00
# The `cpp` command behaves differently on macOS (it behaves as if
# `-traditional-cpp` was passed) so we use `gcc -E` instead.
CPP := gcc -E
2020-03-17 00:31:30 -04:00
MKLDSCRIPT := tools/mkldscript
2021-11-30 23:29:09 +00:00
MKDMADATA := tools/mkdmadata
2020-03-17 00:31:30 -04:00
ELF2ROM := tools/elf2rom
2021-01-01 23:24:29 -05:00
ZAPD := tools/ZAPD/ZAPD.out
2022-02-06 19:40:26 +00:00
FADO := tools/fado/fado.elf
2024-01-24 16:39:13 -08:00
PYTHON ?= $( VENV) /bin/python3
2024-02-04 13:04:13 +01:00
FLIPS := tools/Flips/flips
2024-05-08 11:58:56 +02:00
GZINJECT := tools/gzinject/gzinject
CC_IDO := tools/ido_recomp/linux/5.3/cc
2020-03-17 00:31:30 -04:00
2024-01-05 14:27:19 -08:00
# Command to replace path variables in the spec file. We can't use the C
# preprocessor for this because it won't substitute inside string literals.
SPEC_REPLACE_VARS := sed -e 's|$$(BUILD_DIR)|$(BUILD_DIR)|g'
Merge decomp/main (#141)
* Match retail BSS ordering (#1927)
* Match retail BSS ordering
* Revert moving some global variables to headers
* Adjust block numbers after header changes
* Fix debug build
* Overlay bss ordering
* Fix BSS ordering after header changes
* gc-eu-mq OK
* Implement preprocessor for #pragma increment_block_number
* Transfer usage comment from reencode.sh
* Use temporary directory instead of temporary file
* Move ColChkMassType back
* Player: Document "WaitForPutAway" (#1936)
* document put away delay
* functions.txt
* add a note on delaying indefinitely
* format
* typo
* delay -> wait for put away
* revert unintended formatting change
* add comment to struct member
* format
* fix functions.txt
* Set up gc-eu and match all code (#1938)
* Set up gc-eu and match all code
* Format
* Mark gc-eu-mq as WIP until it builds OK
* Move original/MQ map mark data to separate files
* Add #includes to .inc.c files to help out VS Code
* Use #if in spec instead of .inc.c files
* Delete disassembly data for gc-eu-mq (#1942)
* Player Docs: "sUpperBodyIsBusy" (#1944)
* document upperbodybusy
* change wording for comment and rename upperanimblendweight
* format
* review
* Fix miscategorized scenes (#1946)
* Fix miscategorized scenes
* Sort includes
* Player Docs: Action Interrupt (#1947)
* document action interrupt
* format
* new function comment
* format
* add a note about items
* format
* Add gc-eu-mq to CI (#1943)
* Add gc-eu-mq to CI
* Give up on scripting
* Revert quotes changes
* Player Docs: Name some high level update calls (#1593)
* name some low hanging fruit
* revert burn and shock, doing in seperate pr
* add some function comments
* yaw func
* adjust comment
* some review
* unname UpdateZTarget
* Player_DetectRumbleSecrets
* fix dive do action name
* Player Docs: Control stick buffers (#1945)
* name vars and add enum
* name some spin attack stuff
* fix right and left
* forward/backward
* format
* fix retail bss
* sControlStickWorldYaw
* Force string.o to be in boot for gcc builds (#1948)
In retail builds, memcpy is linked in code, not boot, but GCC likes to call memcpy when copying structs so currently GCC builds immediately crash in __osInitialize_common.
* Rename yDistToWater -> depthInWater (#1950)
* Rename yDistToWater -> yDistUnderWater
* yDistUnderWater -> depthInWater
* Check baserom hash before decompression (#1952)
* Remove Cygwin support (#1951)
* Document pause page switching (#1550)
* Document pause page switching
* document initial scroll left setup, when opening the pause menu
* `PAUSE_MAIN_STATE_1` -> `PAUSE_MAIN_STATE_SWITCHING_PAGE`
* try a diagram of the pages layout in world space as a comment
* expand `nextPageMode` comment
* touch up pause camera header comments
* expand comment on irrelevant init `mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE`
* expand doc on `sKaleidoSetup*` data
* expand docs on `gPageSwitchNextButtonStatus`
* add some doc on `sPageSwitch*` arrays
* SwitchPage -> PageSwitch
* add `PAGE_SWITCH_NSTEPS`
* `SWITCH_PAGE_*_PT` -> `PAGE_SWITCH_PT_*`
* peepoArtist
---------
Co-authored-by: fig02 <fig02srl@gmail.com>
* Fix LensMode Enum Names (#1954)
* Change linker script so gGameOverTimer can be in z_game_over.c (#1939)
* Change linker script so gGameOverTimer can be in z_game_over.c
* gGameOverTimer -> sGameOverTimer
* include_data_only_with_rodata -> include_data_only_within_rodata
* fix build issues
* Check buffers segment in check_ordering.py (#1960)
* Delete unused yaz0tool (#1959)
* Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology
* more docs
* format
* cleanups
* MoveActor -> ActorMove
* missed a couple
* hopefully the last changes
* comment explaining the group change
* some review
* dragorn review
* remove accidental file
* fix matching issue, now use while loop
* Experiment: remove global.h dependency from sys_math, sys_math3d, z_lib (#1956)
* split sys_math, sys_math3d, z_lib from global.h
* suggestions
* forgot this
* more math stuff
* nit fix
* re-add ichain.h
* resolve tharo's comments
* Fix check_ordering.py checking for shifted/nonmatching-besides-relocs (#1961)
* Run CC_CHECK with the correct CPP defines (#1963)
* Run CC_CHECK with the correct CPP defines
* Add "CPP_DEFINES ?="
---------
Co-authored-by: cadmic <cadmic24@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
2024-06-22 22:36:26 +02:00
CFLAGS += $( CPP_DEFINES)
CPPFLAGS += $( CPP_DEFINES)
CFLAGS_IDO += $( CPP_DEFINES)
2024-06-24 22:14:03 +02:00
# TODO PL and DOWHILE should be disabled for non-gamecube
GBI_DEFINES := -DF3DEX_GBI_2 -DF3DEX_GBI_PL -DGBI_DOWHILE
i f e q ( $( DEBUG ) , 1 )
GBI_DEFINES += -DGBI_DEBUG
e n d i f
CFLAGS += $( GBI_DEFINES)
2022-05-01 23:14:44 +01:00
ASFLAGS := -march= vr4300 -32 -no-pad-sections -Iinclude
2020-03-17 00:31:30 -04:00
2022-02-19 16:50:56 -05:00
i f e q ( $( COMPILER ) , g c c )
2024-02-29 20:11:54 +00:00
CFLAGS += -G 0 -nostdinc $( INC) -march= vr4300 -mfix4300 -mabi= 32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $( CHECK_WARNINGS) -funsigned-char
2022-02-19 16:50:56 -05:00
MIPS_VERSION := -mips3
2024-02-01 21:08:45 +01:00
RUN_CC_CHECK := 0
2020-03-17 00:31:30 -04:00
e n d i f
2022-05-20 07:27:54 +01:00
OBJDUMP_FLAGS := -d -r -z -Mreg-names= 32
2020-03-17 00:31:30 -04:00
#### Files ####
# ROM image
2024-02-04 12:30:03 +01:00
i f e q ( $( VERSION ) , h a c k e r o o t - m q )
ROM := $( BUILD_DIR) /$( VERSION) .z64
e l s e
ROM := $( BUILD_DIR) /oot-$( VERSION) .z64
e n d i f
2024-02-06 03:18:50 +01:00
ROMC := $( ROM:.z64= -compressed-$( COMPRESSION) .z64)
2024-02-03 17:40:34 +01:00
WAD := $( ROM:.z64= .wad)
2024-05-08 11:58:56 +02:00
ISO := $( ROM:.z64= .iso)
2024-02-04 13:04:13 +01:00
BPS := $( ROM:.z64= .bps)
2024-02-02 13:34:20 -08:00
ELF := $( ROM:.z64= .elf)
MAP := $( ROM:.z64= .map)
LDSCRIPT := $( ROM:.z64= .ld)
2024-05-08 11:58:56 +02:00
DMA_CONFIG_FILE := dma_config.txt
2020-03-17 00:31:30 -04:00
# description of ROM segments
SPEC := spec
2024-02-04 13:04:13 +01:00
# Baserom to use when creating BPS patches
BASEROM_PATCH ?= baseroms/$( VERSION) /baserom.z64
2024-01-31 17:51:33 +01:00
i f e q ( $( COMPILER ) , g c c )
2020-05-01 03:49:35 +02:00
SRC_DIRS := $( shell find src -type d)
2022-02-19 16:50:56 -05:00
e n d i f
2024-06-24 06:22:39 -07:00
# create extracted directories
$( shell mkdir -p $ ( EXTRACTED_DIR ) $ ( EXTRACTED_DIR ) /assets $ ( EXTRACTED_DIR ) /text )
2024-06-24 23:37:48 +02:00
# create extracted directories
$( shell mkdir -p $ ( EXTRACTED_DIR ) $ ( EXTRACTED_DIR ) /assets $ ( EXTRACTED_DIR ) /text )
2024-06-24 06:22:39 -07:00
ASSET_BIN_DIRS := $( shell find $( EXTRACTED_DIR) /assets -type d)
2020-12-26 06:39:52 -05:00
ASSET_FILES_BIN := $( foreach dir,$( ASSET_BIN_DIRS) ,$( wildcard $( dir) /*.bin) )
2024-06-24 06:22:39 -07:00
ASSET_FILES_OUT := $( foreach f,$( ASSET_FILES_BIN:.bin= .bin.inc.c) ,$( f:$( EXTRACTED_DIR) /%= $( BUILD_DIR) /%) ) \
2024-01-05 14:27:19 -08:00
$( foreach f,$( wildcard assets/text/*.c) ,$( BUILD_DIR) /$( f:.c= .o) )
2020-12-26 06:39:52 -05:00
2022-06-03 21:33:18 +01:00
UNDECOMPILED_DATA_DIRS := $( shell find data -type d)
2024-03-04 16:06:26 -08:00
BASEROM_BIN_FILES := $( wildcard $( EXTRACTED_DIR) /baserom/*)
2024-01-28 09:09:03 -08:00
2020-05-01 03:49:35 +02:00
# source files
2024-06-24 06:22:39 -07:00
SRC_C_FILES := $( filter-out %.inc.c,$( foreach dir,$( SRC_DIRS) ,$( wildcard $( dir) /*.c) ) )
ASSET_C_FILES := $( filter-out %.inc.c,$( foreach dir,$( ASSET_BIN_DIRS) ,$( wildcard $( dir) /*.c) ) )
2022-06-03 21:33:18 +01:00
S_FILES := $( foreach dir,$( SRC_DIRS) $( UNDECOMPILED_DATA_DIRS) ,$( wildcard $( dir) /*.s) )
2024-01-05 14:27:19 -08:00
O_FILES := $( foreach f,$( S_FILES:.s= .o) ,$( BUILD_DIR) /$f ) \
2024-06-24 06:22:39 -07:00
$( foreach f,$( SRC_C_FILES:.c= .o) ,$( BUILD_DIR) /$f ) \
$( foreach f,$( ASSET_C_FILES:.c= .o) ,$( f:$( EXTRACTED_DIR) /%= $( BUILD_DIR) /%) ) \
2024-01-24 15:00:10 -03:00
$( foreach f,$( BASEROM_BIN_FILES) ,$( BUILD_DIR) /baserom/$( notdir $f ) .o)
2024-05-17 06:35:01 -07:00
UCODE_PATCHES := $( wildcard F3DEX3/*.bps)
UCODE_FILES := $( foreach f,$( UCODE_PATCHES:.bps= ) ,$f )
UCODE_O_FILES := $( foreach f,$( UCODE_FILES) ,$( BUILD_DIR) /$f .o)
2020-12-26 06:39:52 -05:00
2024-01-05 14:27:19 -08:00
OVL_RELOC_FILES := $( shell $( CPP) $( CPPFLAGS) $( SPEC) | $( SPEC_REPLACE_VARS) | grep -o '[^"]*_reloc.o' )
2022-02-06 19:40:26 +00:00
2021-05-02 22:21:27 +02:00
# Automatic dependency files
2022-02-06 19:40:26 +00:00
# (Only asm_processor dependencies and reloc dependencies are handled for now)
DEP_FILES := $( O_FILES:.o= .asmproc.d) $( OVL_RELOC_FILES:.o= .d)
2021-05-02 22:21:27 +02:00
2021-05-15 14:14:51 -04:00
TEXTURE_FILES_PNG := $( foreach dir,$( ASSET_BIN_DIRS) ,$( wildcard $( dir) /*.png) )
2021-04-02 19:07:29 -03:00
TEXTURE_FILES_JPG := $( foreach dir,$( ASSET_BIN_DIRS) ,$( wildcard $( dir) /*.jpg) )
2024-06-24 06:22:39 -07:00
TEXTURE_FILES_OUT := $( foreach f,$( TEXTURE_FILES_PNG:.png= .inc.c) ,$( f:$( EXTRACTED_DIR) /%= $( BUILD_DIR) /%) ) \
$( foreach f,$( TEXTURE_FILES_JPG:.jpg= .jpg.inc.c) ,$( f:$( EXTRACTED_DIR) /%= $( BUILD_DIR) /%) )
2020-03-17 00:31:30 -04:00
# create build directories
2024-06-24 06:22:39 -07:00
$(shell mkdir -p $(BUILD_DIR)/baserom $(BUILD_DIR)/assets/text $(foreach dir,$(SRC_DIRS) $(UNDECOMPILED_DATA_DIRS),$(BUILD_DIR)/$(dir)) $(foreach dir,$(ASSET_BIN_DIRS),$(dir : $( EXTRACTED_DIR ) /%=$( BUILD_DIR ) /%)))
2020-03-17 00:31:30 -04:00
2024-01-31 17:51:33 +01:00
i f e q ( $( COMPILER ) , g c c )
2024-02-29 20:11:54 +00:00
# Note that if adding additional assets directories for modding reasons these flags must also be used there
2024-03-05 16:35:42 +01:00
$( BUILD_DIR) /assets/%.o: CFLAGS += -fno-zero-initialized-in-bss -fno-toplevel-reorder
$( BUILD_DIR) /src/%.o: CFLAGS += -fexec-charset= utf-8
2024-01-31 17:51:33 +01:00
$( BUILD_DIR) /src/libultra/libc/ll.o: OPTFLAGS := -Ofast
2024-03-05 16:35:42 +01:00
$( BUILD_DIR) /src/overlays/%.o: CFLAGS += -fno-merge-constants -mno-explicit-relocs -mno-split-addresses
2024-01-05 14:27:19 -08:00
2024-01-31 17:51:33 +01:00
$( BUILD_DIR) /src/overlays/actors/ovl_Item_Shield/%.o: OPTFLAGS := -O2
$( BUILD_DIR) /src/overlays/actors/ovl_En_Part/%.o: OPTFLAGS := -O2
$( BUILD_DIR) /src/overlays/actors/ovl_Item_B_Heart/%.o: OPTFLAGS := -O0
$( BUILD_DIR) /src/overlays/actors/ovl_Bg_Mori_Hineri/%.o: OPTFLAGS := -O0
2024-05-08 11:58:56 +02:00
# library overrides for Gamecube
i f e q ( $( TARGET ) , i s o )
MIPS_VERSION_IDO := -mips2
CFLAGS_IDO += -G 0 -non_shared -fullwarn -verbose -Xcpluscomm $( INC) -Wab,-r4300_mul -woff 516,609,649,838,712
$( BUILD_DIR) /src/libultra/io/viswapbuf.o: OPTFLAGS := -O2
$( BUILD_DIR) /src/libultra/io/viswapbuf.o: MIPS_VERSION := $( MIPS_VERSION_IDO)
$( BUILD_DIR) /src/libultra/io/viswapbuf.o: CFLAGS := $( CFLAGS_IDO)
$( BUILD_DIR) /src/libultra/io/viswapbuf.o: CC := $( CC_IDO)
$( BUILD_DIR) /src/libultra/gu/sinf.o: OPTFLAGS := -O2
$( BUILD_DIR) /src/libultra/gu/sinf.o: MIPS_VERSION := $( MIPS_VERSION_IDO)
$( BUILD_DIR) /src/libultra/gu/sinf.o: CFLAGS := $( CFLAGS_IDO)
$( BUILD_DIR) /src/libultra/gu/sinf.o: CC := $( CC_IDO)
$( BUILD_DIR) /src/libultra/gu/cosf.o: OPTFLAGS := -O2
$( BUILD_DIR) /src/libultra/gu/cosf.o: MIPS_VERSION := $( MIPS_VERSION_IDO)
$( BUILD_DIR) /src/libultra/gu/cosf.o: CFLAGS := $( CFLAGS_IDO)
$( BUILD_DIR) /src/libultra/gu/cosf.o: CC := $( CC_IDO)
$( BUILD_DIR) /src/libultra/gu/perspective.o: OPTFLAGS := -O2
$( BUILD_DIR) /src/libultra/gu/perspective.o: MIPS_VERSION := $( MIPS_VERSION_IDO)
$( BUILD_DIR) /src/libultra/gu/perspective.o: CFLAGS := $( CFLAGS_IDO)
$( BUILD_DIR) /src/libultra/gu/perspective.o: CC := $( CC_IDO)
$( BUILD_DIR) /src/libultra/os/getmemsize.o: OPTFLAGS := -O1
$( BUILD_DIR) /src/libultra/os/getmemsize.o: MIPS_VERSION := $( MIPS_VERSION_IDO)
$( BUILD_DIR) /src/libultra/os/getmemsize.o: CFLAGS := $( CFLAGS_IDO)
$( BUILD_DIR) /src/libultra/os/getmemsize.o: CC := $( CC_IDO)
$( BUILD_DIR) /src/libultra/os/aisetnextbuf.o: OPTFLAGS := -O1
$( BUILD_DIR) /src/libultra/os/aisetnextbuf.o: MIPS_VERSION := $( MIPS_VERSION_IDO)
$( BUILD_DIR) /src/libultra/os/aisetnextbuf.o: CFLAGS := $( CFLAGS_IDO)
$( BUILD_DIR) /src/libultra/os/aisetnextbuf.o: CC := $( CC_IDO)
e n d i f
2022-02-19 16:50:56 -05:00
e n d i f
2020-04-16 20:08:23 +02:00
2020-03-17 00:31:30 -04:00
#### Main Targets ###
2024-04-18 19:37:37 +02:00
all : rom
2024-01-24 16:39:13 -08:00
2024-04-18 19:37:37 +02:00
rom :
2024-04-21 19:59:53 +02:00
$( call print,Building the rom...)
2024-06-24 23:37:48 +02:00
$( V) python3 tools/mod_assets.py --oot-version $( VERSION)
2024-04-21 19:59:53 +02:00
$( V) $( MAKE) $( ROM)
2024-01-24 15:00:10 -03:00
2024-02-06 03:18:50 +01:00
compress :
2024-04-20 02:23:18 +02:00
$( call print,Compressing the rom...)
2024-02-06 03:18:50 +01:00
# make sure z_std_dma.c and spec are up-to-date
2024-04-20 02:23:18 +02:00
$( V) $( shell touch spec)
$( V) $( shell touch src/boot/z_std_dma.c)
$( V) $( MAKE) $( ROMC)
$( call print,Success!)
2024-01-31 17:51:33 +01:00
wad :
2024-04-20 02:23:18 +02:00
$( call print,Patching WAD...)
2024-02-04 01:45:13 +01:00
i f e q ( "$(wildcard baseroms/$(VERSION)/common-key.bin)" , "" )
2024-01-31 17:51:33 +01:00
$( error Please provide the common-key.bin file.)
2020-07-19 21:42:05 +02:00
e n d i f
2024-05-08 11:58:56 +02:00
$( V) $( MAKE) compress TARGET = wad
$( V) $( GZINJECT) -a inject -r 1 -k baseroms/$( VERSION) /common-key.bin -w baseroms/$( VERSION) /basewad.wad -m $( ROMC) -o $( WAD) -t "HackerOoT" -i NHOE -p tools/gzinject/patches/NACE.gzi -p tools/gzinject/patches/gz_default_remap.gzi
2024-04-20 02:23:18 +02:00
$( V) $( RM) -r wadextract/
$( call print,Success!)
2020-03-17 00:31:30 -04:00
2024-05-08 11:58:56 +02:00
iso :
$( V) $( MAKE) compress TARGET = iso
$( call print,Patching ISO...)
$( V) $( PYTHON) tools/gc_utility.py -v $( VERSION) -c $( COMPRESSION)
$( V) $( GZINJECT) -a extract -s baseroms/$( VERSION) /baseiso.iso
$( V) cp $( BUILD_DIR) /$( DMA_CONFIG_FILE) isoextract/zlj_f.tgc/$( DMA_CONFIG_FILE)
$( V) cp $( ROMC) isoextract/zlj_f.tgc/zlj_f.n64
$( V) $( RM) -r isoextract/S_*.tgc/ isoextract/zlj_f.tgc/*.thp
$( V) $( FLIPS) --apply tools/gamecube.bps isoextract/zlj_f.tgc/main.dol isoextract/zlj_f.tgc/main.dol
$( V) $( GZINJECT) -a pack -s $( ISO)
$( V) $( RM) -r isoextract/
$( call print,Success!)
2020-03-17 00:31:30 -04:00
clean :
2024-04-20 02:23:18 +02:00
$( V) $( RM) -r $( BUILD_DIR)
$( call print,Success!)
2020-03-17 00:31:30 -04:00
2021-05-17 13:50:19 -04:00
assetclean :
2024-04-20 02:23:18 +02:00
$( V) $( RM) -r $( EXTRACTED_DIR)
$( call print,Success!)
2021-05-17 13:50:19 -04:00
2024-06-24 23:37:48 +02:00
distclean :
2024-04-20 02:23:18 +02:00
$( V) $( RM) -r extracted/
$( V) $( RM) -r build/
$( V) $( MAKE) -C tools distclean
2024-05-17 06:35:01 -07:00
$( V) $( RM) -r F3DEX3/*.code F3DEX3/*.data
2024-04-20 02:23:18 +02:00
$( call print,Success!)
2021-03-14 13:07:46 -03:00
2024-01-24 16:39:13 -08:00
venv :
2024-01-27 16:40:29 -08:00
# Create the virtual environment if it doesn't exist.
# Delete the virtual environment directory if creation fails.
2024-04-20 02:23:18 +02:00
$( call print,Preparing the virtual environment...)
$( V) test -d $( VENV) || python3 -m venv $( VENV) || { rm -rf $( VENV) ; false; }
$( V) $( PYTHON) -m pip install -U pip
$( V) $( PYTHON) -m pip install -U -r requirements.txt
$( call print,Success!)
2024-01-24 16:39:13 -08:00
setup : venv
2024-04-20 02:23:18 +02:00
$( call print,Setup in progress...)
$( V) $( MAKE) -C tools
$( call print,Tools: Done!)
$( V) $( PYTHON) tools/decompress_baserom.py $( VERSION)
$( call print,Decompressing baserom: Done!)
2024-06-24 22:14:03 +02:00
$( V) $( PYTHON) tools/extract_baserom.py $( BASEROM_DIR) /baserom-decompressed.z64 --oot-version $( VERSION) -o $( EXTRACTED_DIR) /baserom
2024-07-03 15:33:23 +02:00
$( V) $( PYTHON) tools/msgdis.py $( VERSION)
2024-06-24 23:37:48 +02:00
$( V) $( PYTHON) extract_assets.py -v $( VERSION) -j$( N_THREADS)
2024-04-20 02:23:18 +02:00
$( call print,Extracting files: Done!)
2024-04-16 14:49:57 +02:00
i f e q ( $( VERSION ) , h a c k e r o o t - m q )
2024-04-16 14:45:30 +02:00
# TODO: proper fix (for .s files)
cp baseroms/hackeroot-mq/baserom-decompressed.z64 baseroms/gc-eu-mq-dbg/baserom-decompressed.z64
e n d i f
2020-03-17 00:31:30 -04:00
2024-04-21 19:59:53 +02:00
run : rom
2024-01-09 18:49:12 +01:00
i f e q ( $( N 64_EMULATOR ) , )
$( error Emulator path not set. Set N64_EMULATOR in the Makefile or define it as an environment variable)
2023-08-28 18:48:52 -04:00
e n d i f
2024-04-21 19:59:53 +02:00
$( N64_EMULATOR) $( ROM)
2020-12-21 16:14:25 -08:00
2024-02-04 13:04:13 +01:00
patch :
2024-04-20 02:23:18 +02:00
$( call print,Creating BPS patch...)
$( V) $( FLIPS) --create --bps $( BASEROM_PATCH) $( ROM) $( BPS)
$( call print,Success!)
2022-02-06 19:40:26 +00:00
2024-05-17 06:35:01 -07:00
create_f3dex3_patches : F 3DEX 3/f 3dzex 2.code F 3DEX 3/f 3dzex 2.data
$( call print,Creating F3DEX3 patches...)
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW.code F3DEX3/F3DEX3_BrW.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW.data F3DEX3/F3DEX3_BrW.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_PA.code F3DEX3/F3DEX3_BrW_PA.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_PA.data F3DEX3/F3DEX3_BrW_PA.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_PB.code F3DEX3/F3DEX3_BrW_PB.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_PB.data F3DEX3/F3DEX3_BrW_PB.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_PC.code F3DEX3/F3DEX3_BrW_PC.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_PC.data F3DEX3/F3DEX3_BrW_PC.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_NOC.code F3DEX3/F3DEX3_BrW_NOC.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_NOC.data F3DEX3/F3DEX3_BrW_NOC.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_NOC_PA.code F3DEX3/F3DEX3_BrW_NOC_PA.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_NOC_PA.data F3DEX3/F3DEX3_BrW_NOC_PA.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_NOC_PB.code F3DEX3/F3DEX3_BrW_NOC_PB.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_NOC_PB.data F3DEX3/F3DEX3_BrW_NOC_PB.data.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.code F3DEX3/F3DEX3_BrW_NOC_PC.code F3DEX3/F3DEX3_BrW_NOC_PC.code.bps
$( V) $( FLIPS) --create --bps F3DEX3/f3dzex2.data F3DEX3/F3DEX3_BrW_NOC_PC.data F3DEX3/F3DEX3_BrW_NOC_PC.data.bps
2024-04-20 02:23:18 +02:00
$( call print,Success!)
2024-02-04 14:29:13 +01:00
2024-04-22 19:55:44 +02:00
verify :
$( V) $( MAKE) clean
$( V) $( MAKE) rom
@md5sum $( ROM)
2024-05-17 06:35:01 -07:00
.PHONY : all rom compress clean assetclean distclean venv setup run wad iso patch create_f 3dex 3_patches verify
2024-01-24 15:00:10 -03:00
.DEFAULT_GOAL := rom
2020-12-21 16:14:25 -08:00
2020-03-17 00:31:30 -04:00
#### Various Recipes ####
2022-02-06 19:40:26 +00:00
$(ROM) : $( ELF )
2024-04-20 02:23:18 +02:00
$( V) $( ELF2ROM) -cic 6105 $< $@
@$( PRINT) " ${ BLINK } Build succeeded.\n $( NO_COL) "
@$( PRINT) " ==== Build Options ==== $( NO_COL) \n "
@$( PRINT) " ${ GREEN } OoT Version: $( BLUE) $( VERSION) $( NO_COL) \n "
@$( PRINT) " ${ GREEN } Code Version: $( BLUE) $( PACKAGE_VERSION) $( NO_COL) \n "
2022-02-06 19:40:26 +00:00
2024-01-24 15:00:10 -03:00
$(ROMC) : $( ROM ) $( ELF ) $( BUILD_DIR ) /compress_ranges .txt
2024-02-04 01:45:13 +01:00
i f e q ( $( COMPRESSION ) , y a z )
2024-04-23 17:58:27 +02:00
$( V) $( PYTHON) tools/compress.py --in $( ROM) --out $@ --dmadata-start ` ./tools/dmadata_start.sh $( NM) $( ELF) ` --compress ` cat $( BUILD_DIR) /compress_ranges.txt` --threads $( N_THREADS)
2024-02-04 01:45:13 +01:00
e l s e
2024-04-20 02:23:18 +02:00
$( V) $( PYTHON) tools/z64compress_wrapper.py --codec $( COMPRESSION) --cache $( BUILD_DIR) /cache --threads $( N_THREADS) $< $@ $( ELF) $( BUILD_DIR) /$( SPEC)
2024-02-04 01:45:13 +01:00
e n d i f
2024-04-20 02:23:18 +02:00
$( V) $( PYTHON) -m ipl3checksum sum --cic 6105 --update $@
2024-01-24 15:00:10 -03:00
2024-05-17 06:35:01 -07:00
$(ELF) : $( TEXTURE_FILES_OUT ) $( ASSET_FILES_OUT ) $( O_FILES ) $( OVL_RELOC_FILES ) $( UCODE_O_FILES ) $( LDSCRIPT ) $( BUILD_DIR ) /undefined_syms .txt
2024-05-28 20:32:06 +01:00
$( call print,Linking:,,$@ )
2024-04-20 02:23:18 +02:00
$( V) $( LD) -T $( LDSCRIPT) -T $( BUILD_DIR) /undefined_syms.txt --no-check-sections --accept-unknown-input-arch --emit-relocs -Map $( MAP) -o $@
2022-02-06 19:40:26 +00:00
2023-02-26 17:26:07 +01:00
## Order-only prerequisites
2022-02-06 19:40:26 +00:00
# These ensure e.g. the O_FILES are built before the OVL_RELOC_FILES.
# The intermediate phony targets avoid quadratically-many dependencies between the targets and prerequisites.
o_files : $( O_FILES )
$(OVL_RELOC_FILES) : | o_files
asset_files : $( TEXTURE_FILES_OUT ) $( ASSET_FILES_OUT )
$(O_FILES) : | asset_files
.PHONY : o_files asset_files
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/$(SPEC) : $( SPEC )
2024-05-17 06:35:01 -07:00
$( call print,Preprocessing:,$<,$@ )
2024-04-20 02:23:18 +02:00
$( V) $( CPP) $( CPPFLAGS) $< | $( SPEC_REPLACE_VARS) > $@
2022-02-06 19:40:26 +00:00
2024-02-02 13:34:20 -08:00
$(LDSCRIPT) : $( BUILD_DIR ) /$( SPEC )
2024-05-17 06:35:01 -07:00
$( call print,Creating linker script:,$<,$@ )
2024-04-20 02:23:18 +02:00
$( V) $( MKLDSCRIPT) $< $@
2022-02-06 19:40:26 +00:00
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/undefined_syms.txt : undefined_syms .txt
2024-05-17 06:35:01 -07:00
$( call print,Preprocessing:,$<,$@ )
2024-04-20 02:23:18 +02:00
$( V) $( CPP) $( CPPFLAGS) $< > $@
2022-02-06 19:40:26 +00:00
2024-03-04 16:06:26 -08:00
$(BUILD_DIR)/baserom/%.o : $( EXTRACTED_DIR ) /baserom /%
2024-05-17 06:35:01 -07:00
$( call print,Wrapping binary to ELF:,$<,$@ )
$( V) $( OBJCOPY) -I binary -O elf32-big $< $@
$(BUILD_DIR)/F3DEX3/%.o : F 3DEX 3/%
$( call print,Wrapping binary to ELF:,$<,$@ )
$( V) mkdir -p $( BUILD_DIR) /F3DEX3
2024-04-20 02:23:18 +02:00
$( V) $( OBJCOPY) -I binary -O elf32-big $< $@
2020-03-17 00:31:30 -04:00
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/data/%.o : data /%.s
2024-05-17 06:35:01 -07:00
$( call print,Assembling:,$<,$@ )
2024-04-20 02:23:18 +02:00
$( V) $( AS) $( ASFLAGS) $< -o $@
2020-03-17 00:31:30 -04:00
2024-07-03 03:42:52 +01:00
$(BUILD_DIR)/assets/text/%.enc.jpn.h : assets /text /%.h $( EXTRACTED_DIR ) /text /%.h assets /text /charmap .txt
2024-05-17 06:35:01 -07:00
$( call print,Encoding:,$<,$@ )
2024-07-03 15:33:23 +02:00
$( V) $( CPP) $( CPPFLAGS) -I$( EXTRACTED_DIR) $< | $( PYTHON) tools/msgenc.py --encoding jpn --charmap assets/text/charmap.txt - $@
2024-07-03 03:42:52 +01:00
$(BUILD_DIR)/assets/text/%.enc.nes.h : assets /text /%.h $( EXTRACTED_DIR ) /text /%.h assets /text /charmap .txt
2024-07-03 15:33:23 +02:00
$( call print,Encoding:,$<,$@ )
$( V) $( CPP) $( CPPFLAGS) -I$( EXTRACTED_DIR) $< | $( PYTHON) tools/msgenc.py --encoding nes --charmap assets/text/charmap.txt - $@
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy
* Fix merge
* Some more progress
* Fix merge
* More z_message_PAL
* Small progress
* More small progress
* message_data_static files OK
* Prepare z_message_tables
* Matched another function, small updates
* Attempt to use asm-processor static-symbols branch
* Refactor text id declarations
* Begin large text codes parser function
* Fix merge
* Refactor done
* Build OK, add color and highscore names
* Remove encoded text headers and automatically encode during build
* Fix kanfont
* Various cleanups
* DISP macros
* Another match aside data
* Further progress
* Small improvements
* Deduplicate magic values for text control codes, small improvements
* Tiny progress
* Minor cleanups
* Clean up z_message_PAL comment
* Progress on large functions
* Further progress on large functions
* Changes to mkldscript to link .data in the .rodata section
* data OK
* Few improvements
* Use gDPLoadTextureBlock macros where appropriate
* rm z_message_tables, progress on large functions
* 2 more matches
* Improvements
* Small progress
* More progress on big function
* progress
* match func_80107980
* match Message_Update
* match func_8010BED8
* done
* Progress on remaining large functions
* Small progress on largest function
* Another match, extract text and move to assets, improve text build system
* Small nonmatchings improvements
* docs wip
* Largest function maybe equivalent
* Fix merge
* Document do_action values, largest function is almost instruction-matching
* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice
* Fix merge
* one match
* Last function is instruction-matching
* Fix
* Improvements thanks to engineer124
* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup
* More variables labeled, use text state enum everywhere
* More labels and names
* Fix
* Actor_IsTalking -> Actor_TalkRequested
* Match func_8010C39C and remove unused asm
* More docs
* Mostly ocarina related docs
* All msgModes named
* Fix assetclean
* Cleanup
* Extraction fixes and headers
* Suggestions
* Review suggestions
* Change text extraction again, only extract if the headers do not already exist
* Fix
* Use ast for charmap, fix assetclean for real this time
* Review suggestions
* BGM ids and ran formatter
* Review comments
* rename include_readonly to include_data_with_rodata
* Remove leading 0s in number directives
* Review suggestions for message_data_static
* textbox pos enum comments, rename several enum names from Message to TextBox
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
2023-10-20 18:14:52 +01:00
# Dependencies for files including message data headers
# TODO remove when full header dependencies are used.
2024-07-03 03:42:52 +01:00
$(BUILD_DIR)/assets/text/jpn_message_data_static.o : $( BUILD_DIR ) /assets /text /message_data .enc .jpn .h
$(BUILD_DIR)/assets/text/nes_message_data_static.o : $( BUILD_DIR ) /assets /text /message_data .enc .nes .h
$(BUILD_DIR)/assets/text/ger_message_data_static.o : $( BUILD_DIR ) /assets /text /message_data .enc .nes .h
$(BUILD_DIR)/assets/text/fra_message_data_static.o : $( BUILD_DIR ) /assets /text /message_data .enc .nes .h
$(BUILD_DIR)/assets/text/staff_message_data_static.o : $( BUILD_DIR ) /assets /text /message_data_staff .enc .nes .h
$(BUILD_DIR)/src/code/z_message_PAL.o : assets /text /message_data .h assets /text /message_data_staff .h
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy
* Fix merge
* Some more progress
* Fix merge
* More z_message_PAL
* Small progress
* More small progress
* message_data_static files OK
* Prepare z_message_tables
* Matched another function, small updates
* Attempt to use asm-processor static-symbols branch
* Refactor text id declarations
* Begin large text codes parser function
* Fix merge
* Refactor done
* Build OK, add color and highscore names
* Remove encoded text headers and automatically encode during build
* Fix kanfont
* Various cleanups
* DISP macros
* Another match aside data
* Further progress
* Small improvements
* Deduplicate magic values for text control codes, small improvements
* Tiny progress
* Minor cleanups
* Clean up z_message_PAL comment
* Progress on large functions
* Further progress on large functions
* Changes to mkldscript to link .data in the .rodata section
* data OK
* Few improvements
* Use gDPLoadTextureBlock macros where appropriate
* rm z_message_tables, progress on large functions
* 2 more matches
* Improvements
* Small progress
* More progress on big function
* progress
* match func_80107980
* match Message_Update
* match func_8010BED8
* done
* Progress on remaining large functions
* Small progress on largest function
* Another match, extract text and move to assets, improve text build system
* Small nonmatchings improvements
* docs wip
* Largest function maybe equivalent
* Fix merge
* Document do_action values, largest function is almost instruction-matching
* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice
* Fix merge
* one match
* Last function is instruction-matching
* Fix
* Improvements thanks to engineer124
* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup
* More variables labeled, use text state enum everywhere
* More labels and names
* Fix
* Actor_IsTalking -> Actor_TalkRequested
* Match func_8010C39C and remove unused asm
* More docs
* Mostly ocarina related docs
* All msgModes named
* Fix assetclean
* Cleanup
* Extraction fixes and headers
* Suggestions
* Review suggestions
* Change text extraction again, only extract if the headers do not already exist
* Fix
* Use ast for charmap, fix assetclean for real this time
* Review suggestions
* BGM ids and ran formatter
* Review comments
* rename include_readonly to include_data_with_rodata
* Remove leading 0s in number directives
* Review suggestions for message_data_static
* textbox pos enum comments, rename several enum names from Message to TextBox
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
2024-06-24 23:37:48 +02:00
$(BUILD_DIR)/assets/text/%.o : assets /text /%.c
$( call print,Compiling:,$<,$@ )
$( V) $( CC) -c $( CFLAGS) $( MIPS_VERSION) $( OPTFLAGS) -o $@ $<
2024-07-03 15:33:23 +02:00
$( V) $( OBJCOPY) -O binary -j.rodata $@ $@ .bin
2024-06-24 23:37:48 +02:00
$(BUILD_DIR)/assets/%.o : $( EXTRACTED_DIR ) /assets /%.c
2024-04-20 02:23:18 +02:00
$( call print,Compiling:,$<,$@ )
$( V) $( CC) -c $( CFLAGS) $( MIPS_VERSION) $( OPTFLAGS) -o $@ $<
$( V) $( OBJCOPY) -O binary $@ $@ .bin
2020-03-17 00:31:30 -04:00
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/src/%.o : src /%.s
2024-04-20 02:23:18 +02:00
$( call print,Compiling:,$<,$@ )
$( V) $( CPP) $( CPPFLAGS) -Iinclude $< | $( AS) $( ASFLAGS) -o $@
2022-06-03 21:33:18 +01:00
2024-01-24 15:00:10 -03:00
$(BUILD_DIR)/dmadata_table_spec.h $(BUILD_DIR)/compress_ranges.txt : $( BUILD_DIR ) /$( SPEC )
2024-04-20 02:23:18 +02:00
$( V) $( MKDMADATA) $< $( BUILD_DIR) /dmadata_table_spec.h $( BUILD_DIR) /compress_ranges.txt
2021-11-30 23:29:09 +00:00
2023-10-20 18:14:52 +01:00
# Dependencies for files that may include the dmadata header automatically generated from the spec file
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/src/boot/z_std_dma.o : $( BUILD_DIR ) /dmadata_table_spec .h
$(BUILD_DIR)/src/dmadata/dmadata.o : $( BUILD_DIR ) /dmadata_table_spec .h
2021-11-30 23:29:09 +00:00
2023-10-20 18:14:52 +01:00
# Dependencies for files including from include/tables/
# TODO remove when full header dependencies are used.
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/src/code/graph.o : include /tables /gamestate_table .h
$(BUILD_DIR)/src/code/object_table.o : include /tables /object_table .h
$(BUILD_DIR)/src/code/z_actor.o : include /tables /actor_table .h # so uses of ACTOR_ID_MAX update when the table length changes
$(BUILD_DIR)/src/code/z_actor_dlftbls.o : include /tables /actor_table .h
$(BUILD_DIR)/src/code/z_effect_soft_sprite_dlftbls.o : include /tables /effect_ss_table .h
$(BUILD_DIR)/src/code/z_game_dlftbls.o : include /tables /gamestate_table .h
$(BUILD_DIR)/src/code/z_scene_table.o : include /tables /scene_table .h include /tables /entrance_table .h
$(BUILD_DIR)/src/%.o : src /%.c
2024-02-01 21:08:45 +01:00
i f n e q ( $( RUN_CC_CHECK ) , 0 )
2024-04-20 02:23:18 +02:00
$( V) $( CC_CHECK) $<
2024-02-01 21:08:45 +01:00
e n d i f
2024-04-20 02:23:18 +02:00
$( call print,Compiling:,$<,$@ )
$( V) $( CC) -c $( CFLAGS) $( MIPS_VERSION) $( OPTFLAGS) -o $@ $<
$( V) @$( OBJDUMP) $( OBJDUMP_FLAGS) $@ > $( @:.o= .s)
2020-03-17 00:31:30 -04:00
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/src/libultra/libc/ll.o : src /libultra /libc /ll .c
2024-02-01 21:08:45 +01:00
i f n e q ( $( RUN_CC_CHECK ) , 0 )
2024-04-20 02:23:18 +02:00
$( V) $( CC_CHECK) $<
2024-02-01 21:08:45 +01:00
e n d i f
2024-04-20 02:23:18 +02:00
$( call print,Compiling:,$<,$@ )
$( V) $( CC) -c $( CFLAGS) $( MIPS_VERSION) $( OPTFLAGS) -o $@ $<
$( V) $( PYTHON) tools/set_o32abi_bit.py $@
$( V) @$( OBJDUMP) $( OBJDUMP_FLAGS) $@ > $( @:.o= .s)
2021-01-31 11:27:50 -07:00
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/src/libultra/libc/llcvt.o : src /libultra /libc /llcvt .c
2024-02-01 21:08:45 +01:00
i f n e q ( $( RUN_CC_CHECK ) , 0 )
2024-04-20 02:23:18 +02:00
$( V) $( CC_CHECK) $<
2024-02-01 21:08:45 +01:00
e n d i f
2024-04-20 02:23:18 +02:00
$( call print,Compiling:,$<,$@ )
$( V) $( CC) -c $( CFLAGS) $( MIPS_VERSION) $( OPTFLAGS) -o $@ $<
$( V) $( PYTHON) tools/set_o32abi_bit.py $@
$( V) @$( OBJDUMP) $( OBJDUMP_FLAGS) $@ > $( @:.o= .s)
2020-05-27 00:48:07 -07:00
2024-01-05 14:27:19 -08:00
$(BUILD_DIR)/src/overlays/%_reloc.o : $( BUILD_DIR ) /$( SPEC )
2024-04-20 02:23:18 +02:00
$( call print,Generating Relocation:,$<,$@ )
$( V) $( FADO) $$ ( tools/reloc_prereq $< $( notdir $* ) ) -n $( notdir $* ) -o $( @:.o= .s) -M $( @:.o= .d)
$( V) $( AS) $( ASFLAGS) $( @:.o= .s) -o $@
2022-02-06 19:40:26 +00:00
2024-06-24 23:37:48 +02:00
$(BUILD_DIR)/assets/%.inc.c : $( EXTRACTED_DIR ) /assets /%.png
2024-04-20 02:23:18 +02:00
$( V) $( ZAPD) btex -eh -tt $( subst .,,$( suffix $* ) ) -i $< -o $@
2020-03-17 00:31:30 -04:00
2024-06-24 23:37:48 +02:00
$(BUILD_DIR)/assets/%.bin.inc.c : $( EXTRACTED_DIR ) /assets /%.bin
2024-04-20 02:23:18 +02:00
$( V) $( ZAPD) bblb -eh -i $< -o $@
2021-04-02 19:07:29 -03:00
2024-06-24 23:37:48 +02:00
$(BUILD_DIR)/assets/%.jpg.inc.c : $( EXTRACTED_DIR ) /assets /%.jpg
2024-04-20 02:23:18 +02:00
$( V) $( ZAPD) bren -eh -i $< -o $@
2021-05-02 22:21:27 +02:00
2024-05-17 06:35:01 -07:00
F3DEX3/f3dzex2.code :
$( V) $( PYTHON) tools/data_extractor.py --start 0xBCD0F0 --size 0x1630 --input $( BASEROM_DIR) /baserom-decompressed.z64 --output $@
F3DEX3/f3dzex2.data :
$( V) $( PYTHON) tools/data_extractor.py --start 0xBCE720 --size 0x420 --input $( BASEROM_DIR) /baserom-decompressed.z64 --output $@
F3DEX3/F3DEX3%.code : F 3DEX 3/F 3DEX 3%.code .bps F 3DEX 3/f 3dzex 2.code
$( V) $( FLIPS) --apply F3DEX3/F3DEX3$* .code.bps F3DEX3/f3dzex2.code $@
F3DEX3/F3DEX3%.data : F 3DEX 3/F 3DEX 3%.data .bps F 3DEX 3/f 3dzex 2.data
$( V) $( FLIPS) --apply F3DEX3/F3DEX3$* .data.bps F3DEX3/f3dzex2.data $@
.PRECIOUS : $( UCODE_FILES )
2021-05-02 22:21:27 +02:00
- i n c l u d e $( DEP_FILES )
2024-01-24 15:00:10 -03:00
# Print target for debugging
print-% : ; $( info $ * is a $ ( flavor $ *) variable set to [$ ( $ *) ]) @true