You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
HackerSM64 v2.0.0
* buffers: refresh 15 and revert to base decomp * behavior script * color helper functions * extended bounds * egeo_layout * fixed model ids * camera conf improved * message panel ucode small * graph node * level script * mathutil updates * mathutil updates (allow unused funcs) * behaviors a - beta_fish * Add librtc and fix some data declarations * Move GRUCODE define to proper location in makefile * Refresh 15 * extra * Make ROM name smaller and change messages printed on build a bit * Fix console (lol) * Update UNF to latest master * Make ucode load from .o's (and also fix Super3D) * Fix crash with rumble + custom mario model * graph node and mathutil * removed behaviors * Ldtob documentation * _Putfld labeling * area * behavior actions * camera * debug updates * bubbles * envfx snow * farcall helpers * game init * geo misc * hud * only check if VC on render init * ingame menu * revert goddard to base decomp * insn disasm * interaction documentation * level geo * level update defines * macro special objects formatting changes * main.h documentation * map parser documentation & formatting * airborne documentation * mario actions automatic documentation * mario actions cutscene documentation * mario actions moving documentation and options * mario actions object documentation and options * mario stationary documentation * mario submerged documentation * mario misc documentation * mario step: ledge grab fixes and documentation * mario documentation * memory.h documentation * moving textures * object behaviors * object collision * fix flamethrower bug * object helpers * object list processor documentation * paintings * platform displacement * print / printf * puppycam absf * puppyprint updates and formatting changes * rendering graph node performance optimizations * rumble opt and doc * hqvm back to ultrasm64 * save file documentation and unlock defines * s2d engine * reset various files to ultrasm64 * file select * intro geo documentation * screen transition documentation * segment2.h * shadow overhaul * skybox refactor * sound init: clean up define usage + documentation * spawn object optimizations and documentation * spawn sound cleanup * sram to ultrasm64 * star select cleanup * title screen cleanup * dialogs / text * rename stomp smoke * stomp smoke -> small water splash * updated README * compilation flags * optimized file positions + support function/data sections * surface collision performance improvements * surface load optimizations * camera conf documentation * Allow easier command for opening puppyprint debug * Rearranged framebuffers & fixed puppyprint console printing * Fix shadow scaling and shifting * Fix SILHOUETTE, OBJECTS_REJ, and ucode loading, also clean up render phase system a bit. * Fixed build with BETTER_HANGING off * Clean up OBJECTS_REJ ifdefs * Fix duplicate comment & graph render layers/flags bitmask * Fixed build with BETTER_HANGING off * Fix Fast64 importing by reverting sSegmentTable change * Readded missing functions that caused build errors with Mario head enabled * Fixed clang compilation issues * Add INTER mode for geo_update_layer_transparency * Fix build warnings * bugfix: miscalculation in obj_turn_toward_object * Some puppytech fixes * Further Puppycamera fixes * Fix BUGFIX_DIALOG_TIME_STOP Fixes #136 * Fix sliding platform bparams * Add LEGACY_SHADOW_IDS define for Fast64 compatibility * Apply suggested changes * Better find_in_bounds_yaw_wdw_bob_thi ifdef * Fix build warnings for unused functions * Fixed stale reference bug from obj_mark_for_deletion change * Fixed incorrect digit for 100s #145 * Change groundpound-fix define and functionality to just disable bonking * Fixed puppyroll #134 * Adjust height value for terrain angle to kick in * fixed hi score flashing * Remove menudata backup (#131) Not considered important enough to keep * Fix fread() build warning * Add COURSE_NUM_TO_INDEX to save_file_get_star_flags check in bhv_unagi_init * Fix approach_s16 return value * Use boolean defines for oCapDoScaleVertically * Make the door lock a part of the key door model to eliminate z-fighting, also reduce z fighting on numbered doors with AUTO_LOD enabled. * Move flames to LAYER_TRANSPARENT_INTER * Resolved some compiler warnings and added FALL_THROUGH define (#168) * Address some more compiler warnings with different define toggles * Remove unnecessary fallthrough attribute * fixed geo_process_billboard floating point exception * Allow water to face any direction * Initialize focOffset so that BBH doesn't crash * Removed superfluous RDP commands when switching microcodes which would override scissor * Set OBJ_FLAG_DONT_CALC_COLL_DIST on bhvUkikiCage * Fix rumble build * Fixed UNLOCK_FPS strobing * Update src/game/object_helpers.c Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com> * Update src/game/object_helpers.c Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com> * Fix LEGACY_SHADOW_IDS id conflict * Use the vanilla default value for rotating fire bars if bparam2 is 0 * START_LEVEL safeguard * Fix some drawing distance issues caused by AUTO_COLLISION_DISTANCE * Fix rumble build * Fixed spline poll code using the wrong values for keyframes * Update readme with better credits Better credits for individual contributors * add arthur * added falco and moose * add fazana * le funny typo * added S2DEX engine to credits * silhouette + axo + ratio * remove specific callouts + add auto col distance * Update data/behavior_data.c Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com> * Update data/behavior_data.c Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com> * Update data/behavior_data.c Co-authored-by: thecozies <79979276+thecozies@users.noreply.github.com> * Revert formatting changes to match vanilla decomp * Re-implement Y buffer for find_ceil * Re-implement POWER_STARS_HEAL for normal Power Stars * Start level comment & exit course comment/collapse * utilize reonucam technique for FAST_VERTICAL_CAMERA_MOVEMENT * Fix "MAX_REFERENCED_WALLS" typo * Allow stop_and_set_height_to_floor to work at any height if Mario is teleporting (#213) * Revert stop_and_set_height_to_floor to vanilla Fixes #208 * Fixed sAudioEnabled so that it disables audio CPU processing as well * Fixed puppyprint debug RDP us calculations * Renamed sAudioEnabled to gAudioEnabled * Replaced mtxf_to_mtx_asm with an equivalent implementation that supports WORLD_SCALE * Moved extended bounds and world scale configuration to a new config_world.h file * Default all objects to non-rej (#227) Fixes #221 (Default all objects to non-rej) * Fix #221 * Fix VISUAL_DEBUG breaking/crashing when OBJECTS_REJ is disabled (#211) * Fix VISUAL_DEBUG breaking/crashing when OBJECTS_REJ is disabled * Change vtl decrement in visual_surface_display from 6 to 3 Fixes #207 * Make area in SL igloo wider to prevent a softlock (#233) Fixes #210 * Fix coin formation coins being deleted if they spawn in the middle of a floor, also fix TTM slide coin position (#232) Fixes #201 * Make UNLOCK_ALL apply to more things * Fix wrong ifdef/ifndef in bhv_invisible_objects_under_bridge_init * Change chain chomp load/unload distances depending on number of segments (#237) Fixes #192 * added WATER_PLUNGE_UPWARP define * Add reonucam patch (#239) * added reonucam patch Fixes #218 * Fix how shadows handle water/transparency/height (#228) * Fix how shadows handle water/transparency/height * Change shadow check for flying carpets from a level specific check to a oPlatformOnTrackType check Fixes #179 * added reonucam credit * delete unnecesary patches * Apply suggested changes * murdered more patches * UNLOCK_ALL unlocks the cap boxes * UNLOCK_ALL unlocks cap boxes (slightly more epic edition) * revert ceil buffer * Renamed HD_INTRO_TEXTURES define, separated intro floombas * prevent double definition of floombas * actually prevent floomba redefinition * Develop/refactor default defines (#242) * Changed default config options * Added build dir to includePaths for pngs * disable NO_SLEEP by default * Disable puppyprint by default Sorry fazana 😔 * fix typos * add comment about BETTER_REVERB console perf * disable blue coin switch retry by default * Update config_audio.h Co-authored-by: Reonu <danileon95@gmail.com> Co-authored-by: Mr-Wiseguy <68165316+Mr-Wiseguy@users.noreply.github.com> * revert air step line to vanilla to fix bitfs scaling platform issue (#247) Fixes #200 * Fix stuttering on thin slopes (#248) * Fix stuttering on thin slopes * Revert vec3f_find_ceil calls to vanilla * Rename vec3f_find_ceil to find_mario_ceil * Update src/engine/surface_collision.h Fixes #249 * Swap static and dynamic surface checks back to vanilla order (#253) * Swap static and dynamic surface checks back to vanilla order * re-enable DISABLE_ALL config Fixes #251 #252 * Fixed save and quitting while in widescreen (#257) * Fixed save and quitting while in widescreen * use define for the level * all my homies hate ifdefs * skip wall offsets < 0 (#255) Fixes #255 * #264: Document non-stop stars' issues (#267) * #264: Document non-stop stars' issues * Update include/config/config_game.h * nonstop vanilla comment * derive margin_radius from radius after capping at 200 (#266) Fixes #259 * Config cleanup/refactor (#269) * Moved puppyprint define to graphics / rearranged some debug defines for ease of access * Moved compatibility safeguards to config_safeguards.h * spacing and comment formatting * #272 Move GFX_POOL_SIZE to config_graphics.h * disable EASIER_DIALOG_TRIGGER by default * prevent redefining warnings * small ifdef typo * changed ifndef to undefs Fixes #262 Fixes #272 * Improved movement config documentation related to turning around (#271) Fixes #270 * rename CUSTOM_DEBUG, add comments (#275) * Update README.md (#277) * v2.0.0 Co-authored-by: CrashOveride95 <crashoveride953@gmail.com> Co-authored-by: Arceveti <73617174+Arceveti@users.noreply.github.com> Co-authored-by: n64 <n64> Co-authored-by: Fazana <52551480+FazanaJ@users.noreply.github.com> Co-authored-by: Mr-Wiseguy <mrwiseguyromhacking@gmail.com> Co-authored-by: aglab2 <aglab3@gmail.com> Co-authored-by: gheskett <gheskett@gmail.com> Co-authored-by: Reonu <danileon95@gmail.com> Co-authored-by: Axollyon <20480418+Axollyon@users.noreply.github.com> Co-authored-by: Mr-Wiseguy <68165316+Mr-Wiseguy@users.noreply.github.com>
This commit is contained in:
217
Makefile
217
Makefile
@@ -67,25 +67,6 @@ endif
|
||||
|
||||
DEFINES += NO_ERRNO_H=1 NO_GZIP=1
|
||||
|
||||
COMPRESS ?= rnc1
|
||||
$(eval $(call validate-option,COMPRESS,mio0 yay0 gzip rnc1 rnc2 uncomp))
|
||||
ifeq ($(COMPRESS),gzip)
|
||||
DEFINES += GZIP=1
|
||||
else ifeq ($(COMPRESS),rnc1)
|
||||
DEFINES += RNC1=1
|
||||
else ifeq ($(COMPRESS),rnc2)
|
||||
DEFINES += RNC2=1
|
||||
else ifeq ($(COMPRESS),yay0)
|
||||
DEFINES += YAY0=1
|
||||
else ifeq ($(COMPRESS),mio0)
|
||||
DEFINES += MIO0=1
|
||||
else ifeq ($(COMPRESS),uncomp)
|
||||
DEFINES += UNCOMPRESSED=1
|
||||
endif
|
||||
|
||||
GZIPVER ?= std
|
||||
$(eval $(call validate-option,GZIPVER,std libdef))
|
||||
|
||||
# VERSION - selects the version of the game to build
|
||||
# jp - builds the 1996 Japanese version
|
||||
# us - builds the 1996 North American version
|
||||
@@ -95,22 +76,18 @@ VERSION ?= us
|
||||
$(eval $(call validate-option,VERSION,jp us eu sh))
|
||||
|
||||
ifeq ($(VERSION),jp)
|
||||
DEFINES += VERSION_JP=1
|
||||
GRUCODE ?= f3dzex
|
||||
DEFINES += VERSION_JP=1
|
||||
else ifeq ($(VERSION),us)
|
||||
DEFINES += VERSION_US=1
|
||||
GRUCODE ?= f3dzex
|
||||
DEFINES += VERSION_US=1
|
||||
else ifeq ($(VERSION),eu)
|
||||
DEFINES += VERSION_EU=1
|
||||
GRUCODE ?= f3dzex
|
||||
DEFINES += VERSION_EU=1
|
||||
else ifeq ($(VERSION),sh)
|
||||
DEFINES += VERSION_SH=1
|
||||
GRUCODE ?= f3dzex
|
||||
DEFINES += VERSION_SH=1
|
||||
endif
|
||||
|
||||
DEBUG_MAP_STACKTRACE_FLAG := -D DEBUG_MAP_STACKTRACE
|
||||
|
||||
TARGET := sm64.$(VERSION)
|
||||
TARGET := sm64
|
||||
|
||||
|
||||
# GRUCODE - selects which RSP microcode to use.
|
||||
@@ -119,6 +96,7 @@ TARGET := sm64.$(VERSION)
|
||||
# l3dex2 - F3DEX2 version that only renders in wireframe
|
||||
# f3dzex - newer, experimental microcode used in Animal Crossing
|
||||
# super3d - extremely experimental version of Fast3D lacking many features for speed
|
||||
GRUCODE ?= f3dzex
|
||||
$(eval $(call validate-option,GRUCODE,f3dex f3dex2 f3dex2pl f3dzex super3d l3dex2))
|
||||
|
||||
ifeq ($(GRUCODE),f3dex) # Fast3DEX
|
||||
@@ -150,15 +128,78 @@ endif
|
||||
|
||||
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Optimization flags #
|
||||
#==============================================================================#
|
||||
|
||||
# Default non-gcc opt flags
|
||||
DEFAULT_OPT_FLAGS = -Ofast
|
||||
|
||||
# Main opt flags
|
||||
GCC_MAIN_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=10 \
|
||||
--param max-unrolled-insns=10 \
|
||||
-finline-limit=1 \
|
||||
-freorder-blocks-algorithm=simple \
|
||||
-ffunction-sections \
|
||||
-fdata-sections
|
||||
|
||||
# Surface Collision
|
||||
GCC_COLLISION_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=100 \
|
||||
--param max-unrolled-insns=100 \
|
||||
-finline-limit=0 \
|
||||
-fno-inline \
|
||||
-freorder-blocks-algorithm=simple \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-falign-functions=32
|
||||
|
||||
# Math Util
|
||||
GCC_MATH_UTIL_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
-fno-unroll-loops \
|
||||
-fno-peel-loops \
|
||||
--param case-values-threshold=20 \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-falign-functions=32
|
||||
# - setting any sort of -finline-limit has shown to worsen performance with math_util.c,
|
||||
# lower values were the worst, the higher you go - the closer performance gets to not setting it at all
|
||||
|
||||
# Rendering graph node
|
||||
GCC_GRAPH_NODE_OPT_FLAGS = \
|
||||
-Ofast \
|
||||
--param case-values-threshold=20 \
|
||||
--param max-completely-peeled-insns=100 \
|
||||
--param max-unrolled-insns=100 \
|
||||
-finline-limit=0 \
|
||||
-freorder-blocks-algorithm=simple \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-falign-functions=32
|
||||
#==============================================================================#
|
||||
|
||||
ifeq ($(COMPILER),gcc)
|
||||
NON_MATCHING := 1
|
||||
MIPSISET := -mips3
|
||||
OPT_FLAGS := -Ofast
|
||||
OPT_FLAGS := $(GCC_MAIN_OPT_FLAGS)
|
||||
COLLISION_OPT_FLAGS = $(GCC_COLLISION_OPT_FLAGS)
|
||||
MATH_UTIL_OPT_FLAGS = $(GCC_MATH_UTIL_OPT_FLAGS)
|
||||
GRAPH_NODE_OPT_FLAGS = $(GCC_GRAPH_NODE_OPT_FLAGS)
|
||||
else ifeq ($(COMPILER),clang)
|
||||
NON_MATCHING := 1
|
||||
# clang doesn't support ABI 'o32' for 'mips3'
|
||||
MIPSISET := -mips2
|
||||
OPT_FLAGS := -Ofast
|
||||
OPT_FLAGS := $(DEFAULT_OPT_FLAGS)
|
||||
COLLISION_OPT_FLAGS = $(DEFAULT_OPT_FLAGS)
|
||||
MATH_UTIL_OPT_FLAGS = $(DEFAULT_OPT_FLAGS)
|
||||
GRAPH_NODE_OPT_FLAGS = $(DEFAULT_OPT_FLAGS)
|
||||
endif
|
||||
|
||||
|
||||
@@ -174,25 +215,14 @@ endif
|
||||
|
||||
ifeq ($(NON_MATCHING),1)
|
||||
DEFINES += NON_MATCHING=1 AVOID_UB=1
|
||||
COMPARE := 0
|
||||
endif
|
||||
|
||||
|
||||
# COMPARE - whether to verify the SHA-1 hash of the ROM after building
|
||||
# 1 - verifies the SHA-1 hash of the selected version of the game
|
||||
# 0 - does not verify the hash
|
||||
COMPARE ?= 0
|
||||
$(eval $(call validate-option,COMPARE,0 1))
|
||||
|
||||
TARGET_STRING := sm64.$(VERSION).$(CONSOLE).$(GRUCODE)
|
||||
# If non-default settings were chosen, disable COMPARE
|
||||
ifeq ($(filter $(TARGET_STRING), sm64.jp.f3d_old sm64.us.f3d_old sm64.eu.f3d_new sm64.sh.f3d_new),)
|
||||
COMPARE := 0
|
||||
endif
|
||||
TARGET_STRING := sm64
|
||||
|
||||
# UNF - whether to use UNFLoader flashcart library
|
||||
# 1 - includes code in ROM
|
||||
# 0 - does not
|
||||
# 0 - does not
|
||||
UNF ?= 0
|
||||
$(eval $(call validate-option,UNF,0 1))
|
||||
ifeq ($(UNF),1)
|
||||
@@ -204,7 +234,7 @@ endif
|
||||
# ISVPRINT - whether to fake IS-Viewer presence,
|
||||
# allowing for usage of CEN64 (and possibly Project64) to print messages to terminal.
|
||||
# 1 - includes code in ROM
|
||||
# 0 - does not
|
||||
# 0 - does not
|
||||
ISVPRINT ?= 0
|
||||
$(eval $(call validate-option,ISVPRINT,0 1))
|
||||
ifeq ($(ISVPRINT),1)
|
||||
@@ -222,7 +252,7 @@ endif
|
||||
|
||||
# HVQM - whether to use HVQM fmv library
|
||||
# 1 - includes code in ROM
|
||||
# 0 - does not
|
||||
# 0 - does not
|
||||
HVQM ?= 0
|
||||
$(eval $(call validate-option,HVQM,0 1))
|
||||
ifeq ($(HVQM),1)
|
||||
@@ -230,9 +260,34 @@ ifeq ($(HVQM),1)
|
||||
SRC_DIRS += src/hvqm
|
||||
endif
|
||||
|
||||
BUILD_DIR_BASE := build
|
||||
# BUILD_DIR is the location where all build artifacts are placed
|
||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_$(CONSOLE)
|
||||
|
||||
COMPRESS ?= rnc1
|
||||
$(eval $(call validate-option,COMPRESS,mio0 yay0 gzip rnc1 rnc2 uncomp))
|
||||
ifeq ($(COMPRESS),gzip)
|
||||
DEFINES += GZIP=1
|
||||
LIBZRULE := $(BUILD_DIR)/libz.a
|
||||
LIBZLINK := -lz
|
||||
else ifeq ($(COMPRESS),rnc1)
|
||||
DEFINES += RNC1=1
|
||||
else ifeq ($(COMPRESS),rnc2)
|
||||
DEFINES += RNC2=1
|
||||
else ifeq ($(COMPRESS),yay0)
|
||||
DEFINES += YAY0=1
|
||||
else ifeq ($(COMPRESS),mio0)
|
||||
DEFINES += MIO0=1
|
||||
else ifeq ($(COMPRESS),uncomp)
|
||||
DEFINES += UNCOMPRESSED=1
|
||||
endif
|
||||
|
||||
GZIPVER ?= std
|
||||
$(eval $(call validate-option,GZIPVER,std libdef))
|
||||
|
||||
# GODDARD - whether to use libgoddard (Mario Head)
|
||||
# 1 - includes code in ROM
|
||||
# 0 - does not
|
||||
# 0 - does not
|
||||
GODDARD ?= 0
|
||||
$(eval $(call validate-option,GODDARD,0 1))
|
||||
ifeq ($(GODDARD),1)
|
||||
@@ -248,27 +303,6 @@ endif
|
||||
# Whether to colorize build messages
|
||||
COLOR ?= 1
|
||||
|
||||
# display selected options unless 'make clean' or 'make distclean' is run
|
||||
ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||
$(info ==== Build Options ====)
|
||||
$(info Version: $(VERSION))
|
||||
$(info Microcode: $(GRUCODE))
|
||||
$(info Console: $(CONSOLE))
|
||||
$(info Target: $(TARGET))
|
||||
ifeq ($(COMPARE),1)
|
||||
$(info Compare ROM: yes)
|
||||
else
|
||||
$(info Compare ROM: no)
|
||||
endif
|
||||
ifeq ($(NON_MATCHING),1)
|
||||
$(info Build Matching: no)
|
||||
else
|
||||
$(info Build Matching: yes)
|
||||
endif
|
||||
$(info =======================)
|
||||
endif
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Universal Dependencies #
|
||||
#==============================================================================#
|
||||
@@ -314,7 +348,7 @@ endif
|
||||
|
||||
BUILD_DIR_BASE := build
|
||||
# BUILD_DIR is the location where all build artifacts are placed
|
||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)
|
||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_$(CONSOLE)
|
||||
ROM := $(BUILD_DIR)/$(TARGET_STRING).z64
|
||||
ELF := $(BUILD_DIR)/$(TARGET_STRING).elf
|
||||
LIBZ := $(BUILD_DIR)/libz.a
|
||||
@@ -430,9 +464,11 @@ DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
|
||||
# C compiler options
|
||||
CFLAGS = -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) $(MIPSISET) $(DEF_INC_CFLAGS)
|
||||
ifeq ($(COMPILER),gcc)
|
||||
CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-missing-braces
|
||||
CFLAGS += -mno-shared -march=vr4300 -mfix4300 -mabi=32 -mhard-float -mdivide-breaks -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
|
||||
CFLAGS += -Wno-missing-braces
|
||||
else ifeq ($(COMPILER),clang)
|
||||
CFLAGS += -target mips -mabi=32 -G 0 -mhard-float -fomit-frame-pointer -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra -Wno-missing-braces -fno-jump-tables
|
||||
CFLAGS += -mfpxx -target mips -mabi=32 -G 0 -mhard-float -fomit-frame-pointer -fno-stack-protector -fno-common -I include -I src/ -I $(BUILD_DIR)/include -fno-PIC -mno-abicalls -fno-strict-aliasing -fno-inline-functions -ffreestanding -fwrapv -Wall -Wextra
|
||||
CFLAGS += -Wno-missing-braces
|
||||
else
|
||||
CFLAGS += -non_shared -Wab,-r4300_mul -Xcpluscomm -Xfullwarn -signed -32
|
||||
endif
|
||||
@@ -475,7 +511,7 @@ else
|
||||
RSPASM := $(TOOLS_DIR)/armips
|
||||
endif
|
||||
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
|
||||
EMULATOR = ~/Downloads/mupen64plus/mupen64plus-gui
|
||||
EMULATOR = mupen64plus
|
||||
EMU_FLAGS =
|
||||
LOADER = loader64
|
||||
LOADER_FLAGS = -vwf
|
||||
@@ -488,7 +524,7 @@ RED := \033[0;31m
|
||||
GREEN := \033[0;32m
|
||||
BLUE := \033[0;34m
|
||||
YELLOW := \033[0;33m
|
||||
BLINK := \033[33;5m
|
||||
BLINK := \033[32;5m
|
||||
endif
|
||||
|
||||
# For non-IDO, use objcopy instead of extract_data_for_mio
|
||||
@@ -506,13 +542,12 @@ endef
|
||||
#==============================================================================#
|
||||
|
||||
all: $(ROM)
|
||||
ifeq ($(COMPARE),1)
|
||||
@$(PRINT) "$(GREEN)Checking if ROM matches.. $(NO_COL)\n"
|
||||
@$(SHA1SUM) --quiet -c $(TARGET).sha1 && $(PRINT) "$(TARGET): $(GREEN)OK$(NO_COL)\n" || ($(PRINT) "$(YELLOW)Building the ROM file has succeeded, but does not match the original ROM.\nThis is expected, and not an error, if you are making modifications.\nTo silence this message, use 'make COMPARE=0.' $(NO_COL)\n" && false)
|
||||
else
|
||||
@$(SHA1SUM) $(ROM)
|
||||
@$(PRINT) "${GREEN}Build succeeded.$(NO_COL)\n"
|
||||
endif
|
||||
@$(PRINT) "${BLINK}Build succeeded.\n$(NO_COL)"
|
||||
@$(PRINT) "==== Build Options ====$(NO_COL)\n"
|
||||
@$(PRINT) "${GREEN}Version: $(BLUE)$(VERSION)$(NO_COL)\n"
|
||||
@$(PRINT) "${GREEN}Microcode: $(BLUE)$(GRUCODE)$(NO_COL)\n"
|
||||
@$(PRINT) "${GREEN}Console: $(BLUE)$(CONSOLE)$(NO_COL)\n"
|
||||
|
||||
clean:
|
||||
$(RM) -r $(BUILD_DIR_BASE)
|
||||
@@ -525,6 +560,10 @@ distclean: clean
|
||||
test: $(ROM)
|
||||
$(EMULATOR) $(EMU_FLAGS) $<
|
||||
|
||||
test-pj64: $(ROM)
|
||||
wine ~/Desktop/new64/Project64.exe $<
|
||||
# someone2639
|
||||
|
||||
load: $(ROM)
|
||||
$(LOADER) $(LOADER_FLAGS) $<
|
||||
|
||||
@@ -534,7 +573,7 @@ libultra: $(BUILD_DIR)/libultra.a
|
||||
$(BUILD_DIR)/asm/boot.o: $(IPL3_RAW_FILES)
|
||||
$(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
|
||||
$(BUILD_DIR)/src/game/version.o: $(BUILD_DIR)/src/game/version_data.h
|
||||
$(BUILD_DIR)/lib/rsp.o: $(BUILD_DIR)/rsp/rspboot.bin $(BUILD_DIR)/rsp/audio.bin
|
||||
$(BUILD_DIR)/lib/aspMain.o: $(BUILD_DIR)/rsp/audio.bin
|
||||
$(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(SOUND_BIN_DIR)/sequences.bin $(SOUND_BIN_DIR)/bank_sets
|
||||
$(BUILD_DIR)/levels/scripts.o: $(BUILD_DIR)/include/level_headers.h
|
||||
|
||||
@@ -576,9 +615,17 @@ $(BUILD_DIR)/src/usb/usb.o: OPT_FLAGS := -O0
|
||||
$(BUILD_DIR)/src/usb/usb.o: CFLAGS += -Wno-unused-variable -Wno-sign-compare -Wno-unused-function
|
||||
$(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := -O0
|
||||
$(BUILD_DIR)/src/usb/debug.o: CFLAGS += -Wno-unused-parameter -Wno-maybe-uninitialized
|
||||
$(BUILD_DIR)/src/audio/*.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
$(BUILD_DIR)/src/engine/math_util.o: OPT_FLAGS := -Ofast -fno-unroll-loops -fno-peel-loops --param case-values-threshold=20
|
||||
$(BUILD_DIR)/src/game/rendering_graph_node.o: OPT_FLAGS := -Ofast --param case-values-threshold=20
|
||||
# File specific opt flags
|
||||
$(BUILD_DIR)/src/audio/*.o: OPT_FLAGS := -Os -fno-jump-tables
|
||||
|
||||
$(BUILD_DIR)/src/engine/surface_collision.o: OPT_FLAGS := $(COLLISION_OPT_FLAGS)
|
||||
$(BUILD_DIR)/src/engine/math_util.o: OPT_FLAGS := $(MATH_UTIL_OPT_FLAGS)
|
||||
$(BUILD_DIR)/src/game/rendering_graph_node.o: OPT_FLAGS := $(GRAPH_NODE_OPT_FLAGS)
|
||||
|
||||
# $(info OPT_FLAGS: $(OPT_FLAGS))
|
||||
# $(info COLLISION_OPT_FLAGS: $(COLLISION_OPT_FLAGS))
|
||||
# $(info MATH_UTIL_OPT_FLAGS: $(MATH_UTIL_OPT_FLAGS))
|
||||
# $(info GRAPH_NODE_OPT_FLAGS: $(GRAPH_NODE_OPT_FLAGS))
|
||||
|
||||
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) asm/debug $(GODDARD_SRC_DIRS) $(LIBZ_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
|
||||
|
||||
@@ -589,7 +636,7 @@ $(BUILD_DIR)/include/text_strings.h: $(BUILD_DIR)/include/text_menu_strings.h
|
||||
$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/game/puppycam2.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/game/puppycam2.o: $(BUILD_DIR)/include/text_strings.h
|
||||
|
||||
|
||||
|
||||
@@ -805,7 +852,7 @@ $(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
|
||||
# Link SM64 ELF file
|
||||
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libz.a $(BUILD_DIR)/libgoddard.a
|
||||
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc
|
||||
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc -lrtc
|
||||
|
||||
# Build ROM
|
||||
$(ROM): $(ELF)
|
||||
@@ -814,7 +861,7 @@ ifeq ($(CONSOLE),n64)
|
||||
$(V)$(OBJCOPY) --pad-to=0x101000 --gap-fill=0xFF $< $@ -O binary
|
||||
else ifeq ($(CONSOLE),bb)
|
||||
$(V)$(OBJCOPY) --gap-fill=0x00 $< $@ -O binary
|
||||
$(V)dd if=$@ of=tmp bs=16K conv=sync
|
||||
$(V)dd if=$@ of=tmp bs=16K conv=sync status=none
|
||||
$(V)mv tmp $@
|
||||
endif
|
||||
$(V)$(N64CKSUM) $@
|
||||
|
||||
Reference in New Issue
Block a user