mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-06-29 19:52:18 -04:00
Merge branch 'main' into frameinterpolation
This commit is contained in:
@@ -2,6 +2,7 @@ name: clang-format Suggest
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
formatting-check:
|
||||
if: 0
|
||||
permissions: # needed in forks? https://github.com/parkerbxyz/suggest-changes/issues/33
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
@@ -2,6 +2,7 @@ name: clang-format Check
|
||||
on: [push]
|
||||
jobs:
|
||||
formatting-check:
|
||||
if: 0
|
||||
name: Formatting Check
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
branches: ["main"]
|
||||
jobs:
|
||||
formatting-check:
|
||||
if: 0
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
run: brew install sdl2 libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-cmake -j
|
||||
- name: Create Package
|
||||
run: |
|
||||
@@ -26,4 +26,4 @@ jobs:
|
||||
with:
|
||||
name: spaghetti-mac-x64
|
||||
path: spaghetti-release
|
||||
retention-days: 1
|
||||
retention-days: 1
|
||||
|
||||
@@ -2,6 +2,7 @@ name: GenerateBuilds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -84,7 +85,7 @@ jobs:
|
||||
run: brew install sdl2 sdl2_net libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-cmake --config Release -j3
|
||||
- name: Download spaghetti.o2r
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -226,4 +227,4 @@ jobs:
|
||||
Spaghettify.nro
|
||||
config.yml
|
||||
assets
|
||||
gamecontrollerdb.txt
|
||||
gamecontrollerdb.txt
|
||||
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
FROM ubuntu:24.04 as build
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y \
|
||||
binutils-mips-linux-gnu \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
libaudiofile-dev \
|
||||
libcapstone-dev \
|
||||
pkg-config \
|
||||
python3 \
|
||||
zlib1g-dev
|
||||
|
||||
RUN mkdir /mk64
|
||||
WORKDIR /mk64
|
||||
|
||||
CMD echo 'Usage: docker run --rm -v ${PWD}:/mk64 mk64 make\n'\
|
||||
'See https://github.com/n64decomp/mk64/blob/master/README.md for more information'
|
||||
@@ -1,783 +0,0 @@
|
||||
# Makefile to rebuild MK64 split image
|
||||
|
||||
include util.mk
|
||||
|
||||
include safe_gcc.mk
|
||||
|
||||
# Default target
|
||||
default: all
|
||||
|
||||
# Preprocessor definitions
|
||||
DEFINES :=
|
||||
|
||||
#==============================================================================#
|
||||
# Build Options #
|
||||
#==============================================================================#
|
||||
|
||||
# Configure the build options with 'make SETTING=value' (ex. make VERSION=eu).
|
||||
# Run 'make clean' prior to changing versions.
|
||||
|
||||
# Build for the N64 (turn this off for ports)
|
||||
TARGET_N64 ?= 1
|
||||
|
||||
# COMPILER - selects the C compiler to use
|
||||
# ido - uses the SGI IRIS Development Option compiler, which is used to build
|
||||
# an original matching N64 ROM
|
||||
# gcc - uses the GNU C Compiler
|
||||
COMPILER ?= ido
|
||||
$(eval $(call validate-option,COMPILER,ido gcc))
|
||||
|
||||
# Add debug tools with 'make DEBUG=1' and modify the macros in include/debug.h
|
||||
# Adds crash screen enhancement and activates debug mode
|
||||
# Run make clean first
|
||||
DEBUG ?= 0
|
||||
|
||||
# Compile with GCC
|
||||
GCC ?= 0
|
||||
|
||||
# VERSION - selects the version of the game to build
|
||||
# us - builds the 1997 North American version
|
||||
# eu - builds the 1997 1.1 PAL version
|
||||
VERSION ?= us
|
||||
$(eval $(call validate-option,VERSION,us eu-1.0 eu-final))
|
||||
|
||||
ifeq ($(VERSION),us)
|
||||
DEFINES += VERSION_US=1
|
||||
GRUCODE ?= f3dex_old
|
||||
else ifeq ($(VERSION),eu-1.0)
|
||||
DEFINES += VERSION_EU=1 VERSION_EU_1_0=1
|
||||
GRUCODE ?= f3dex_old
|
||||
else ifeq ($(VERSION),eu-final)
|
||||
DEFINES += VERSION_EU=1 VERSION_EU_1_1=1
|
||||
GRUCODE ?= f3dex_old
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
DEFINES += DEBUG=1
|
||||
COMPARE ?= 0
|
||||
endif
|
||||
|
||||
TARGET := mk64.$(VERSION)
|
||||
|
||||
BASEROM := baserom.$(VERSION).z64
|
||||
|
||||
|
||||
|
||||
# GRUCODE - selects which RSP microcode to use.
|
||||
# f3dex_old - default, version 0.95. An early version of F3DEX.
|
||||
# f3dex - latest version of F3DEX, used on iQue and Lodgenet.
|
||||
# f3dex2 - F3DEX2, currently unsupported.
|
||||
# Note that 3/4 player mode uses F3DLX
|
||||
$(eval $(call validate-option,GRUCODE,f3dex_old f3dex f3dex2))
|
||||
|
||||
ifeq ($(GRUCODE),f3dex_old) # Fast3DEX 0.95
|
||||
DEFINES += F3DEX_GBI=1 F3D_OLD=1
|
||||
else ifeq ($(GRUCODE),f3dex) # Fast3DEX 1.23
|
||||
DEFINES += F3DEX_GBI=1 F3DEX_GBI_SHARED=1
|
||||
else ifeq ($(GRUCODE),f3dex2) # Fast3DEX2
|
||||
DEFINES += F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER),ido)
|
||||
MIPSISET := -mips2
|
||||
else ifeq ($(COMPILER),gcc)
|
||||
DEFINES += AVOID_UB=1 NON_MATCHING=1
|
||||
NON_MATCHING := 1
|
||||
VERSION_ASFLAGS := --defsym AVOID_UB=1
|
||||
MIPSISET := -mips3
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# NON_MATCHING - whether to build a matching, identical copy of the ROM
|
||||
# 1 - enable some alternate, more portable code that does not produce a matching ROM
|
||||
# 0 - build a matching ROM
|
||||
NON_MATCHING ?= 0
|
||||
$(eval $(call validate-option,NON_MATCHING,0 1))
|
||||
|
||||
ifeq ($(TARGET_N64),0)
|
||||
NON_MATCHING := 1
|
||||
endif
|
||||
|
||||
ifeq ($(NON_MATCHING),1)
|
||||
DEFINES += NON_MATCHING=1 AVOID_UB=1
|
||||
VERSION_ASFLAGS := --defsym AVOID_UB=1
|
||||
COMPARE := 0
|
||||
endif
|
||||
|
||||
# GCC define is to link gcc's std lib.
|
||||
ifeq ($(GCC), 1)
|
||||
DEFINES += AVOID_UB=1 GCC=1
|
||||
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 ?= 1
|
||||
$(eval $(call validate-option,COMPARE,0 1))
|
||||
|
||||
|
||||
|
||||
# Whether to hide commands or not
|
||||
VERBOSE ?= 0
|
||||
ifeq ($(VERBOSE),0)
|
||||
V := @
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# Whether to colorize build messages
|
||||
COLOR ?= 1
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
DETECTED_OS=windows
|
||||
# Set Windows temporary directory to its environment variable
|
||||
export TMPDIR=$(TEMP)
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
DETECTED_OS=linux
|
||||
else ifeq ($(UNAME_S),Darwin)
|
||||
DETECTED_OS=macos
|
||||
endif
|
||||
endif
|
||||
|
||||
# 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 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 #
|
||||
#==============================================================================#
|
||||
|
||||
TOOLS_DIR := tools
|
||||
|
||||
# (This is a bit hacky, but a lot of rules implicitly depend
|
||||
# on tools and assets, and we use directory globs further down
|
||||
# in the makefile that we want should cover assets.)
|
||||
ifeq ($(DETECTED_OS),windows)
|
||||
# because python3 is a command to trigger windows store, and python on windows it's just called python
|
||||
ifneq ($(PYTHON),)
|
||||
else ifneq ($(call find-command,python),)
|
||||
PYTHON := python
|
||||
else ifneq ($(call find-command,python3),)
|
||||
PYTHON := python3
|
||||
endif
|
||||
else
|
||||
PYTHON ?= python3
|
||||
endif
|
||||
|
||||
DUMMY != $(PYTHON) --version || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Unable to find python)
|
||||
endif
|
||||
|
||||
ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),)
|
||||
# Make tools if out of date
|
||||
DUMMY != make -C $(TOOLS_DIR)
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to build tools)
|
||||
endif
|
||||
$(info Building ROM...)
|
||||
|
||||
# Make sure assets exist
|
||||
NOEXTRACT ?= 0
|
||||
ifeq ($(NOEXTRACT),0)
|
||||
DUMMY != $(PYTHON) extract_assets.py $(VERSION) >&2 || echo FAIL
|
||||
ifeq ($(DUMMY),FAIL)
|
||||
$(error Failed to extract assets)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Target Executable and Sources #
|
||||
#==============================================================================#
|
||||
|
||||
BUILD_DIR_BASE := build
|
||||
# BUILD_DIR is location where all build artifacts are placed
|
||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)
|
||||
ROM := $(BUILD_DIR)/$(TARGET).z64
|
||||
ELF := $(BUILD_DIR)/$(TARGET).elf
|
||||
LD_SCRIPT := mk64.ld
|
||||
ASSET_DIR := assets
|
||||
BIN_DIR := bin
|
||||
DATA_DIR := data
|
||||
INCLUDE_DIRS := include
|
||||
|
||||
# Directories containing source files
|
||||
SRC_ASSETS_DIR := assets/code/ceremony_data assets/code/startup_logo assets/code/data_800E45C0 assets/code/data_segment2 assets/code/data_800E8700 assets/code/common_data
|
||||
SRC_DIRS := src src/data src/buffers src/racing src/ending src/audio src/debug src/os src/os/math courses assets/code/ceremony_data assets/code/startup_logo $(SRC_ASSETS_DIR)
|
||||
ASM_DIRS := asm asm/os asm/unused $(DATA_DIR) $(DATA_DIR)/sound_data $(DATA_DIR)/karts
|
||||
|
||||
|
||||
# Directories containing course source and data files
|
||||
COURSE_DIRS := $(shell find courses -mindepth 1 -type d)
|
||||
TEXTURES_DIR = textures
|
||||
TEXTURE_DIRS := textures/common
|
||||
|
||||
ALL_DIRS = $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(COURSE_DIRS) include $(ASM_DIRS) $(TEXTURES_DIR)/raw \
|
||||
$(TEXTURES_DIR)/standalone $(TEXTURES_DIR)/startup_logo $(TEXTURES_DIR)/crash_screen $(TEXTURES_DIR)/trophy $(TEXTURES_DIR)/courses \
|
||||
$(TEXTURE_DIRS) $(TEXTURE_DIRS)/tlut $(BIN_DIR)) assets/course_metadata
|
||||
|
||||
# file dependencies generated by splitter
|
||||
MAKEFILE_SPLIT = Makefile.split
|
||||
include $(MAKEFILE_SPLIT)
|
||||
|
||||
# These are files that need to be encoded into EUC-JP in order for the ROM to match
|
||||
# We filter them out from the regular C_FILES since we don't need nor want the
|
||||
# UTF-8 versions getting compiled
|
||||
EUC_JP_FILES := src/ending/credits.c src/code_80005FD0.c src/menu_items.c
|
||||
C_FILES := $(filter-out %.inc.c,$(filter-out $(EUC_JP_FILES),$(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))))
|
||||
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
|
||||
# Include source files in courses/course_name/files.c but exclude .inc.c files.
|
||||
COURSE_FILES := $(foreach dir,$(COURSE_DIRS),$(filter-out %.inc.c,$(wildcard $(dir)/*.c)))
|
||||
|
||||
|
||||
# Object files
|
||||
O_FILES := \
|
||||
$(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
|
||||
$(foreach file,$(COURSE_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
|
||||
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
|
||||
$(EUC_JP_FILES:%.c=$(BUILD_DIR)/%.jp.o)
|
||||
|
||||
# Automatic dependency files
|
||||
DEP_FILES := $(O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
|
||||
|
||||
# Files with GLOBAL_ASM blocks
|
||||
GLOBAL_ASM_C_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/*.c)
|
||||
GLOBAL_ASM_OS_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/os/*.c)
|
||||
GLOBAL_ASM_AUDIO_C_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/audio/*.c)
|
||||
GLOBAL_ASM_RACING_C_FILES != grep -rl 'GLOBAL_ASM(' $(wildcard src/racing/*.c)
|
||||
GLOBAL_ASM_O_FILES = $(foreach file,$(GLOBAL_ASM_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
GLOBAL_ASM_OS_O_FILES = $(foreach file,$(GLOBAL_ASM_OS_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
GLOBAL_ASM_AUDIO_O_FILES = $(foreach file,$(GLOBAL_ASM_AUDIO_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
GLOBAL_ASM_RACING_O_FILES = $(foreach file,$(GLOBAL_ASM_RACING_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
ifneq ($(BLENDER),)
|
||||
else ifneq ($(call find-command,blender),)
|
||||
BLENDER := blender
|
||||
else ifeq ($(DETECTED_OS), windows)
|
||||
BLENDER := "C:\Program Files\Blender Foundation\Blender 3.6\blender.exe"
|
||||
endif
|
||||
|
||||
MODELS_JSON := $(call rwildcard,models,*.json)
|
||||
MODELS_PROC := $(MODELS_JSON:%.json=%)
|
||||
|
||||
models/%: models/%.json
|
||||
$(PYTHON) tools/blender/extract_models.py $(BLENDER) $<
|
||||
|
||||
#==============================================================================#
|
||||
# Compiler Options #
|
||||
#==============================================================================#
|
||||
|
||||
# detect prefix for MIPS toolchain
|
||||
ifneq ($(CROSS),)
|
||||
else ifneq ($(call find-command,mips64-elf-ld),)
|
||||
CROSS := mips64-elf-
|
||||
# else ifneq ($(call find-command,mips-n64-ld),)
|
||||
# CROSS := mips-n64-
|
||||
else ifneq ($(call find-command,mips64-ld),)
|
||||
CROSS := mips64-
|
||||
else ifneq ($(call find-command,mips-linux-gnu-ld),)
|
||||
CROSS := mips-linux-gnu-
|
||||
else ifneq ($(call find-command,mips64-linux-gnu-ld),)
|
||||
CROSS := mips64-linux-gnu-
|
||||
else ifneq ($(call find-command,mips-ld),)
|
||||
CROSS := mips-
|
||||
else
|
||||
$(error Unable to detect a suitable MIPS toolchain installed)
|
||||
endif
|
||||
|
||||
AS := $(CROSS)as
|
||||
ifeq ($(COMPILER),gcc)
|
||||
CC := $(CROSS)gcc
|
||||
else
|
||||
IDO_ROOT := $(TOOLS_DIR)/ido-recomp/$(DETECTED_OS)
|
||||
CC := $(IDO_ROOT)/cc
|
||||
endif
|
||||
LD := $(CROSS)ld
|
||||
AR := $(CROSS)ar
|
||||
OBJDUMP := $(CROSS)objdump
|
||||
OBJCOPY := $(CROSS)objcopy
|
||||
|
||||
OPT_FLAGS := -O2
|
||||
|
||||
ifeq ($(TARGET_N64),1)
|
||||
TARGET_CFLAGS := -nostdinc -DTARGET_N64 -D_LANGUAGE_C
|
||||
CC_CFLAGS := -fno-builtin
|
||||
endif
|
||||
|
||||
INCLUDE_DIRS := include $(BUILD_DIR) $(BUILD_DIR)/include src src/racing src/ending .
|
||||
ifeq ($(TARGET_N64),1)
|
||||
INCLUDE_DIRS += include/libc
|
||||
endif
|
||||
|
||||
C_DEFINES := $(foreach d,$(DEFINES),-D$(d))
|
||||
DEF_INC_CFLAGS := $(foreach i,$(INCLUDE_DIRS),-I$(i)) $(C_DEFINES)
|
||||
|
||||
# Prefer clang as C preprocessor if installed on the system
|
||||
ifneq (,$(call find-command,clang))
|
||||
CPP := clang
|
||||
CPPFLAGS := -E -P -x c -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
else ifneq (,$(call find-command,cpp))
|
||||
CPP := cpp
|
||||
CPPFLAGS := -P -Wno-trigraphs $(DEF_INC_CFLAGS)
|
||||
else
|
||||
$(error Unable to find cpp or clang)
|
||||
endif
|
||||
|
||||
# Check code syntax with host compiler
|
||||
CC_CHECK ?= gcc
|
||||
CC_CHECK_CFLAGS := -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) -std=gnu90 -Wall -Wempty-body -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(DEF_INC_CFLAGS)
|
||||
|
||||
# C compiler options
|
||||
HIDE_WARNINGS := -woff 838,649
|
||||
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
|
||||
else
|
||||
CFLAGS += $(HIDE_WARNINGS) -non_shared -Wab,-r4300_mul -Xcpluscomm -fullwarn -signed -32
|
||||
endif
|
||||
|
||||
ASFLAGS = -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) $(foreach d,$(DEFINES),--defsym $(d))
|
||||
|
||||
# Fills end of rom
|
||||
OBJCOPYFLAGS = --pad-to=0xC00000 --gap-fill=0xFF
|
||||
|
||||
LDFLAGS = -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/$(TARGET).map --no-check-sections
|
||||
|
||||
# Ensure that gcc treats the code as 32-bit
|
||||
CC_CHECK += -m32
|
||||
|
||||
# Prevent a crash with -sopt
|
||||
export LANG := C
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Miscellaneous Tools #
|
||||
#==============================================================================#
|
||||
|
||||
MIO0TOOL := $(TOOLS_DIR)/mio0
|
||||
N64CKSUM := $(TOOLS_DIR)/n64cksum
|
||||
N64GRAPHICS := $(TOOLS_DIR)/n64graphics
|
||||
DLPACKER := $(TOOLS_DIR)/displaylist_packer
|
||||
BIN2C := $(PYTHON) $(TOOLS_DIR)/bin2c.py
|
||||
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
|
||||
ASSET_EXTRACT := $(PYTHON) $(TOOLS_DIR)/new_extract_assets.py
|
||||
LINKONLY_GENERATOR := $(PYTHON) $(TOOLS_DIR)/linkonly_generator.py
|
||||
TORCH := ./torch/cmake-build-release/torch
|
||||
EMULATOR = mupen64plus
|
||||
EMU_FLAGS = --noosd
|
||||
LOADER = loader64
|
||||
LOADER_FLAGS = -vwf
|
||||
SHA1SUM ?= sha1sum
|
||||
FALSE ?= false
|
||||
PRINT ?= printf
|
||||
TOUCH ?= touch
|
||||
|
||||
ifeq ($(COLOR),1)
|
||||
NO_COL := \033[0m
|
||||
RED := \033[0;31m
|
||||
GREEN := \033[0;32m
|
||||
BLUE := \033[0;34m
|
||||
YELLOW := \033[0;33m
|
||||
BLINK := \033[33;5m
|
||||
endif
|
||||
|
||||
# Use Objcopy instead of extract_data_for_mio
|
||||
ifeq ($(COMPILER),gcc)
|
||||
EXTRACT_DATA_FOR_MIO := $(OBJCOPY) -O binary --only-section=.data
|
||||
endif
|
||||
|
||||
# Common build print status function
|
||||
define print
|
||||
@$(PRINT) "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)\n"
|
||||
endef
|
||||
|
||||
# Override commmands for GCC Safe Files
|
||||
ifeq ($(GCC),1)
|
||||
$(BUILD_DIR)/src/main.o: OPT_FLAGS := -g
|
||||
$(BUILD_DIR)/src/racing/skybox_and_splitscreen.o: OPT_FLAGS := -g
|
||||
$(BUILD_DIR)/src/racing/render_courses.o: OPT_FLAGS := -g
|
||||
$(SAFE_C_FILES): OPT_FLAGS := -O3
|
||||
$(SAFE_C_FILES): CC := $(CROSS)gcc
|
||||
$(SAFE_C_FILES): MIPSISET := -mips3
|
||||
$(SAFE_C_FILES): CFLAGS := -G 0 $(OPT_FLAGS) $(TARGET_CFLAGS) $(MIPSISET) $(DEF_INC_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 -ffast-math -fno-unsafe-math-optimizations
|
||||
$(SAFE_C_FILES): CC_CHECK := gcc -m32
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Main Targets #
|
||||
#==============================================================================#
|
||||
|
||||
all: $(ROM)
|
||||
ifeq ($(COMPARE),1)
|
||||
@$(PRINT) "$(GREEN)Checking if ROM matches.. $(NO_COL)\n"
|
||||
@$(SHA1SUM) -c $(TARGET).sha1 > $(NULL_OUT) && $(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))
|
||||
endif
|
||||
|
||||
assets:
|
||||
@echo "Extracting torch assets..."
|
||||
$(V)$(TORCH) code $(BASEROM)
|
||||
$(V)$(TORCH) header $(BASEROM)
|
||||
$(V)$(TORCH) modding export $(BASEROM)
|
||||
|
||||
doc:
|
||||
$(V)$(PYTHON) $(TOOLS_DIR)/doxygen_symbol_gen.py
|
||||
doxygen
|
||||
@$(PRINT) "$(GREEN)Documentation generated in docs/html$(NO_COL)\n"
|
||||
@$(PRINT) "$(GREEN)Results can be viewed by opening docs/html/index.html in a web browser$(NO_COL)\n"
|
||||
|
||||
format:
|
||||
@$(PYTHON) $(TOOLS_DIR)/format.py -j $(N_THREADS)
|
||||
|
||||
clean:
|
||||
$(RM) -r $(BUILD_DIR)
|
||||
|
||||
model_extract: $(MODELS_PROC)
|
||||
|
||||
fast64_blender:
|
||||
$(BLENDER) --python tools/blender/fast64_run.py
|
||||
|
||||
distclean: distclean_assets
|
||||
$(RM) -r $(BUILD_DIR_BASE)
|
||||
$(PYTHON) extract_assets.py --clean
|
||||
make -C $(TOOLS_DIR) clean
|
||||
|
||||
distclean_assets: ;
|
||||
|
||||
test: $(ROM)
|
||||
$(EMULATOR) $(EMU_FLAGS) $<
|
||||
|
||||
load: $(ROM)
|
||||
$(LOADER) $(LOADER_FLAGS) $<
|
||||
|
||||
# Make sure build directory exists before compiling anything
|
||||
DUMMY != mkdir -p $(ALL_DIRS)
|
||||
|
||||
#==============================================================================#
|
||||
# Texture Generation #
|
||||
#==============================================================================#
|
||||
|
||||
# RGBA32, RGBA16, IA16, IA8, IA4, IA1, I8, I4
|
||||
$(BUILD_DIR)/%: %.png
|
||||
@$(PRINT) "$(GREEN)Converting: $(BLUE) $< -> $@$(NO_COL)\n"
|
||||
$(V)$(N64GRAPHICS) -i $@ -g $< -f $(lastword $(subst ., ,$@))
|
||||
|
||||
$(BUILD_DIR)/textures/%.mio0: $(BUILD_DIR)/textures/%
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
ASSET_INCLUDES := $(shell find $(ASSET_DIR)/include -type f -name "*.mk")
|
||||
|
||||
$(foreach inc,$(ASSET_INCLUDES),$(eval include $(inc)))
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Compressed Segment Generation #
|
||||
#==============================================================================#
|
||||
|
||||
$(BUILD_DIR)/%.mio0: %.bin
|
||||
@$(PRINT) "$(GREEN)Compressing binary files: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
$(BUILD_DIR)/%.mio0.o: $(BUILD_DIR)/%.mio0.s
|
||||
@$(PRINT) "$(GREEN)Compiling mio0: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD_DIR)/%.mio0.s: $(BUILD_DIR)/%.mio0
|
||||
$(call print,Generating mio0 asm:,$<,$@)
|
||||
$(V)$(PRINT) ".section .data\n\n.balign 4\n\n.incbin \"$<\"\n" > $@
|
||||
|
||||
$(BUILD_DIR)/src/crash_screen.o: src/crash_screen.c
|
||||
@$(PRINT) "$(GREEN)Compiling Crash Screen: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(N64GRAPHICS) -i $(BUILD_DIR)/textures/crash_screen/crash_screen_font.ia1.inc.c -g textures/crash_screen/crash_screen_font.ia1.png -f ia1 -s u8
|
||||
@$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
|
||||
$(V)$(CC) -c $(CFLAGS) -o $@ $<
|
||||
$(V)$(PYTHON) $(TOOLS_DIR)/set_o32abi_bit.py $@
|
||||
|
||||
#==============================================================================#
|
||||
# Common Textures Segment Generation #
|
||||
#==============================================================================#
|
||||
|
||||
TEXTURE_FILES := $(foreach dir,$(TEXTURE_DIRS),$(subst .png, , $(wildcard $(dir)/*)))
|
||||
|
||||
TEXTURE_FILES_TLUT := $(foreach dir,$(TEXTURE_DIRS)/tlut,$(subst .png, , $(wildcard $(dir)/*)))
|
||||
|
||||
|
||||
$(TEXTURE_FILES):
|
||||
@$(PRINT) "$(GREEN)Converting: $(BLUE) $< -> $@$(NO_COL)\n"
|
||||
$(V)$(N64GRAPHICS) -i $(BUILD_DIR)/$@.inc.c -g $@.png -f $(lastword $(subst ., ,$@)) -s u8
|
||||
|
||||
# TLUT
|
||||
$(TEXTURE_FILES_TLUT):
|
||||
@$(PRINT) "$(GREEN)Converting: $(BLUE) $< -> $@$(NO_COL)\n"
|
||||
$(V)$(N64GRAPHICS) -i $(BUILD_DIR)/$@.inc.c -g $@.png -f $(lastword $(subst ., ,$@)) -s u8 -c $(lastword $(subst ., ,$(subst .$(lastword $(subst ., ,$(TEXTURE_FILES_TLUT))), ,$(TEXTURE_FILES_TLUT)))) -p $(BUILD_DIR)/$@.tlut.inc.c
|
||||
|
||||
# common textures
|
||||
$(BUILD_DIR)/assets/code/common_data/common_data.o: assets/code/common_data/common_data.c $(TEXTURE_FILES) $(TEXTURE_FILES_TLUT)
|
||||
@$(PRINT) "$(GREEN)Compiling Common Textures: $(BLUE)$@ $(NO_COL)\n"
|
||||
@$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
|
||||
$(V)$(CC) -c $(CFLAGS) -o $@ $<
|
||||
$(V)$(PYTHON) $(TOOLS_DIR)/set_o32abi_bit.py $@
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Course Packed Displaylists Generation #
|
||||
#==============================================================================#
|
||||
|
||||
|
||||
%/course_textures.linkonly.c %/course_textures.linkonly.h: %/course_offsets.c
|
||||
$(V)$(LINKONLY_GENERATOR) $(lastword $(subst /, ,$*))
|
||||
|
||||
# Its unclear why this is necessary. Everything I undesrtand about `make` says that just
|
||||
# `$(BUILD_DIR)/%/course_displaylists.inc.o: %/course_textures.linkonly.h`
|
||||
# Should work identical to this. But in practice it doesn't :(
|
||||
COURSE_DISPLAYLIST_OFILES := $(foreach dir,$(COURSE_DIRS),$(BUILD_DIR)/$(dir)/course_displaylists.inc.o)
|
||||
$(COURSE_DISPLAYLIST_OFILES): $(BUILD_DIR)/%/course_displaylists.inc.o: %/course_textures.linkonly.h
|
||||
|
||||
%/course_textures.linkonly.elf: %/course_textures.linkonly.o
|
||||
$(V)$(LD) -t -e 0 -Ttext=05000000 -Map $@.map -o $@ $< --no-check-sections
|
||||
|
||||
%/course_displaylists.inc.elf: %/course_displaylists.inc.o %/course_textures.linkonly.elf
|
||||
$(V)$(LD) -t -e 0 -Ttext=07000000 -Map $@.map -R $*/course_textures.linkonly.elf -o $@ $< --no-check-sections
|
||||
|
||||
%/course_displaylists.inc.bin: %/course_displaylists.inc.elf
|
||||
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
|
||||
|
||||
# Displaylists are packed using a custom format
|
||||
%/course_displaylists_packed.inc.bin: %/course_displaylists.inc.bin
|
||||
@$(PRINT) "$(GREEN)Compressing Course Displaylists: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(DLPACKER) $< $@
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Course Geography Generation #
|
||||
#==============================================================================#
|
||||
|
||||
COURSE_GEOGRAPHY_TARGETS := $(foreach dir,$(COURSE_DIRS),$(BUILD_DIR)/$(dir)/course_geography.mio0.o)
|
||||
|
||||
%/course_vertices.inc.elf: %/course_vertices.inc.o
|
||||
$(V)$(LD) -t -e 0 -Ttext=0F000000 -Map $@.map -o $@ $< --no-check-sections
|
||||
|
||||
%/course_vertices.inc.bin: %/course_vertices.inc.elf
|
||||
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
|
||||
|
||||
%/course_vertices.inc.mio0: %/course_vertices.inc.bin
|
||||
@$(PRINT) "$(GREEN)Compressing Course Geography: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
# Course vertices and displaylists are included together due to no alignment between the two files.
|
||||
%/course_geography.mio0.s: %/course_vertices.inc.mio0 %/course_displaylists_packed.inc.bin
|
||||
$(V)$(PRINT) ".include \"macros.inc\"\n\n.section .data\n\n.balign 4\n\nglabel d_course_$(lastword $(subst /, ,$*))_vertex\n\n.incbin \"$(@D)/course_vertices.inc.mio0\"\n\n.balign 4\n\nglabel d_course_$(lastword $(subst /, ,$*))_packed\n\n.incbin \"$(@D)/course_displaylists_packed.inc.bin\"\n\n.balign 0x10\n" > $@
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Course Data Generation #
|
||||
#==============================================================================#
|
||||
|
||||
COURSE_DATA_ELFS := $(foreach dir,$(COURSE_DIRS),$(BUILD_DIR)/$(dir)/course_data.elf)
|
||||
LDFLAGS += $(foreach elf,$(COURSE_DATA_ELFS),-R $(elf))
|
||||
|
||||
COURSE_DATA_TARGETS := $(foreach dir,$(COURSE_DIRS),$(BUILD_DIR)/$(dir)/course_data.mio0.o)
|
||||
|
||||
COURSE_DISPLAYLIST_OFILES := $(foreach dir,$(COURSE_DIRS),$(BUILD_DIR)/$(dir)/course_data.o)
|
||||
$(COURSE_DISPLAYLIST_OFILES): $(BUILD_DIR)/%/course_data.o: %/course_textures.linkonly.h
|
||||
|
||||
%/course_data.elf: %/course_data.o %/course_displaylists.inc.elf
|
||||
$(V)$(LD) -t -e 0 -Ttext=06000000 -Map $@.map -R $*/course_displaylists.inc.elf -o $@ $< --no-check-sections
|
||||
|
||||
%/course_data.bin: %/course_data.elf
|
||||
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
|
||||
|
||||
%/course_data.mio0: %/course_data.bin
|
||||
@$(PRINT) "$(GREEN)Compressing Course Data: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
%/course_data.mio0.s: %/course_data.mio0
|
||||
$(V)$(PRINT) ".include \"macros.inc\"\n\n.section .data\n\n.balign 4\n\n.incbin \"$<\"\n\n" > $@
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Source Code Generation #
|
||||
#==============================================================================#
|
||||
$(BUILD_DIR)/%.jp.c: %.c
|
||||
$(call print,Encoding:,$<,$@)
|
||||
$(V)iconv -t EUC-JP -f UTF-8 $< > $@
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
$(call print,Compiling:,$<,$@)
|
||||
$(V)$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
|
||||
$(V)$(CC) -c $(CFLAGS) -o $@ $<
|
||||
$(V)$(PYTHON) $(TOOLS_DIR)/set_o32abi_bit.py $@
|
||||
|
||||
$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.c
|
||||
$(call print,Compiling:,$<,$@)
|
||||
$(V)$(CC_CHECK) $(CC_CHECK_CFLAGS) -MMD -MP -MT $@ -MF $(BUILD_DIR)/$*.d $<
|
||||
$(V)$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
$(BUILD_DIR)/%.o: %.s $(MIO0_FILES) $(RAW_TEXTURE_FILES)
|
||||
$(V)$(AS) $(ASFLAGS) -o $@ $<
|
||||
|
||||
$(EUC_JP_FILES:%.c=$(BUILD_DIR)/%.jp.o): CC := $(PYTHON) $(TOOLS_DIR)/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
$(GLOBAL_ASM_O_FILES): CC := $(PYTHON) $(TOOLS_DIR)/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
$(GLOBAL_ASM_OS_O_FILES): CC := $(PYTHON) $(TOOLS_DIR)/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
$(GLOBAL_ASM_AUDIO_O_FILES): CC := $(PYTHON) $(TOOLS_DIR)/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
$(GLOBAL_ASM_RACING_O_FILES): CC := $(PYTHON) $(TOOLS_DIR)/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
#==============================================================================#
|
||||
# Libultra Definitions #
|
||||
#==============================================================================#
|
||||
|
||||
$(BUILD_DIR)/src/os/%.o: OPT_FLAGS :=
|
||||
$(BUILD_DIR)/src/os/math/%.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/src/os/math/ll%.o: OPT_FLAGS :=
|
||||
$(BUILD_DIR)/src/os/math/ll%.o: MIPSISET := -mips3
|
||||
$(BUILD_DIR)/src/os/ldiv.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/src/os/string.o: OPT_FLAGS := -O2
|
||||
$(BUILD_DIR)/src/os/gu%.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/src/os/al%.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/src/os/__osLeoInterrupt.o: OPT_FLAGS := -O1
|
||||
$(BUILD_DIR)/src/os/_Printf.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/src/os/_Litob.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/src/os/_Ldtob.o: OPT_FLAGS := -O3
|
||||
$(BUILD_DIR)/src/os/osSyncPrintf.o: OPT_FLAGS := -O3
|
||||
|
||||
# Alternate compiler flags needed for matching
|
||||
ifeq ($(COMPILER),ido)
|
||||
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2 -use_readwrite_const
|
||||
$(BUILD_DIR)/src/audio/port_eu.o: OPT_FLAGS := -O2 -framepointer
|
||||
$(BUILD_DIR)/src/audio/external.o: OPT_FLAGS := -O2 -framepointer
|
||||
endif
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Compile Trophy and Podium Models #
|
||||
#==============================================================================#
|
||||
|
||||
LDFLAGS += -R $(BUILD_DIR)/assets/code/ceremony_data/ceremony_data.elf
|
||||
|
||||
%/ceremony_data.elf: %/ceremony_data.o
|
||||
$(V)$(LD) -t -e 0 -Ttext=0B000000 -Map $@.map -o $@ $< --no-check-sections
|
||||
|
||||
%/ceremony_data.bin: %/ceremony_data.elf
|
||||
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
|
||||
|
||||
%/ceremony_data.mio0: %/ceremony_data.bin
|
||||
@$(PRINT) "$(GREEN)Compressing Trophy Model: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
%/ceremony_data.mio0.s: %/ceremony_data.mio0
|
||||
$(V)$(PRINT) ".include \"macros.inc\"\n\n.data\n\n.balign 4\n\nglabel ceremony_data\n\n.incbin \"$<\"\n\n.balign 16\nglabel ceremonyData_end\n" > $@
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Compile Startup Logo #
|
||||
#==============================================================================#
|
||||
|
||||
LDFLAGS += -R $(BUILD_DIR)/assets/code/startup_logo/startup_logo.elf
|
||||
|
||||
%/startup_logo.elf: %/startup_logo.o
|
||||
$(V)$(LD) -t -e 0 -Ttext=06000000 -Map $@.map -o $@ $< --no-check-sections
|
||||
|
||||
%/startup_logo.bin: %/startup_logo.elf
|
||||
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
|
||||
|
||||
%/startup_logo.mio0: %/startup_logo.bin
|
||||
@$(PRINT) "$(GREEN)Compressing Startup Logo Model: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
%/startup_logo.mio0.s: %/startup_logo.mio0
|
||||
$(V)$(PRINT) ".include \"macros.inc\"\n\n.data\n\n.balign 4\n\nglabel startup_logo\n\n.incbin \"$<\"\n\n.balign 16\n\nglabel startupLogo_end\n" > $@
|
||||
|
||||
#==============================================================================#
|
||||
# Compile Common Textures #
|
||||
#==============================================================================#
|
||||
|
||||
LDFLAGS += -R $(BUILD_DIR)/assets/code/common_data/common_data.elf
|
||||
|
||||
%/common_data.elf: %/common_data.o
|
||||
$(V)$(LD) -t -e 0 -Ttext=0D000000 -Map $@.map -o $@ $< --no-check-sections
|
||||
|
||||
%/common_data.bin: %/common_data.elf
|
||||
$(V)$(EXTRACT_DATA_FOR_MIO) $< $@
|
||||
|
||||
%/common_data.mio0: %/common_data.bin
|
||||
@$(PRINT) "$(GREEN)Compressing Common Textures: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(MIO0TOOL) -c $< $@
|
||||
|
||||
%/common_data.mio0.s: %/common_data.mio0
|
||||
$(V)$(PRINT) ".include \"macros.inc\"\n\n.section .data\n\n.balign 4\n\n.incbin \"$<\"\n\n" > $@
|
||||
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
# Finalize and Link #
|
||||
#==============================================================================#
|
||||
|
||||
# Run linker script through the C preprocessor
|
||||
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT)
|
||||
$(call print,Preprocessing linker script:,$<,$@)
|
||||
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF $@.d -o $@ $<
|
||||
|
||||
# Link MK64 ELF file
|
||||
$(ELF): $(O_FILES) $(COURSE_DATA_TARGETS) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/assets/code/startup_logo/startup_logo.mio0.o $(BUILD_DIR)/assets/code/ceremony_data/ceremony_data.mio0.o $(BUILD_DIR)/assets/code/common_data/common_data.mio0.o $(COURSE_GEOGRAPHY_TARGETS) undefined_syms.txt
|
||||
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(LD) $(LDFLAGS) -o $@
|
||||
|
||||
# Build ROM
|
||||
$(ROM): $(ELF)
|
||||
$(call print,Building ROM:,$<,$@)
|
||||
$(V)$(OBJCOPY) $(OBJCOPYFLAGS) $< $(@:.z64=.bin) -O binary
|
||||
$(V)$(N64CKSUM) $(@:.z64=.bin) $@
|
||||
$(V)$(PYTHON) $(TOOLS_DIR)/doxygen_symbol_gen.py
|
||||
|
||||
$(BUILD_DIR)/$(TARGET).hex: $(TARGET).z64
|
||||
$(V)xxd $< > $@
|
||||
|
||||
$(BUILD_DIR)/$(TARGET).objdump: $(ELF)
|
||||
$(V)$(OBJDUMP) -D $< > $@
|
||||
|
||||
|
||||
.PHONY: all clean distclean distclean_assets default diff test load assets
|
||||
# with no prerequisites, .SECONDARY causes no intermediate target to be removed
|
||||
.SECONDARY:
|
||||
|
||||
# Remove built-in rules, to improve performance
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
-include $(DEP_FILES)
|
||||
|
||||
|
||||
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
|
||||
@@ -1,5 +0,0 @@
|
||||
STANDALONE_TEXTURE_MIO0_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.mio0,$(wildcard $(TEXTURES_DIR)/standalone/*.png)))
|
||||
|
||||
RAW_TEXTURE_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%,$(wildcard $(TEXTURES_DIR)/raw/*.png)))
|
||||
|
||||
MIO0_FILES := $(STANDALONE_TEXTURE_MIO0_FILES)
|
||||
-121
@@ -1,121 +0,0 @@
|
||||
#include "courses/all_course_data.h"
|
||||
#include "courses/all_course_packed.h"
|
||||
#include "include/actor_types.h"
|
||||
#include "include/bomb_kart.h"
|
||||
#include "include/common_structs.h"
|
||||
#include "include/config.h"
|
||||
#include "include/course_offsets.h"
|
||||
#include "include/decode.h"
|
||||
#include "include/defines.h"
|
||||
#include "include/kart_attributes.h"
|
||||
#include "include/libc/math.h"
|
||||
#include "include/libc/stdarg.h"
|
||||
#include "include/libc/stddef.h"
|
||||
#include "include/libc/stdio.h"
|
||||
#include "include/libc/stdlib.h"
|
||||
#include "include/libc/string.h"
|
||||
#include "include/macros.h"
|
||||
#include "include/objects.h"
|
||||
#include "include/PR/abi.h"
|
||||
#include "include/PR/gbi.h"
|
||||
#include "include/PR/gs2dex.h"
|
||||
#include "include/PR/gu.h"
|
||||
#include "include/PR/libaudio.h"
|
||||
#include "include/PR/libultra.h"
|
||||
#include "include/PR/mbi.h"
|
||||
#include "include/PR/os.h"
|
||||
#include "include/PR/os_ai.h"
|
||||
#include "include/PR/os_cache.h"
|
||||
#include "include/PR/os_cont.h"
|
||||
#include "include/PR/os_eeprom.h"
|
||||
#include "include/PR/os_exception.h"
|
||||
#include "include/PR/os_internal.h"
|
||||
#include "include/PR/os_libc.h"
|
||||
#include "include/PR/os_message.h"
|
||||
#include "include/PR/os_misc.h"
|
||||
#include "include/PR/os_pi.h"
|
||||
#include "include/PR/os_rdp.h"
|
||||
#include "include/PR/os_thread.h"
|
||||
#include "include/PR/os_time.h"
|
||||
#include "include/PR/os_tlb.h"
|
||||
#include "include/PR/os_vi.h"
|
||||
#include "include/PR/R4300.h"
|
||||
#include "include/PR/rcp.h"
|
||||
#include "include/PR/sptask.h"
|
||||
#include "include/PR/ucode.h"
|
||||
#include "include/PR/ultratypes.h"
|
||||
#include "include/save_data.h"
|
||||
#include "include/segments.h"
|
||||
#include "include/sounds.h"
|
||||
#include "include/types.h"
|
||||
#include "include/ultra64.h"
|
||||
#include "include/vehicles.h"
|
||||
#include "include/waypoints.h"
|
||||
#include "src/audio/data.h"
|
||||
#include "src/audio/effects.h"
|
||||
#include "src/audio/external.h"
|
||||
#include "src/audio/heap.h"
|
||||
#include "src/audio/internal.h"
|
||||
#include "src/audio/load.h"
|
||||
#include "src/audio/playback.h"
|
||||
#include "src/audio/port_eu.h"
|
||||
#include "src/audio/seqplayer.h"
|
||||
#include "src/audio/synthesis.h"
|
||||
#include "src/buffers.h"
|
||||
#include "src/camera.h"
|
||||
#include "src/camera_junk.h"
|
||||
#include "src/code_800029B0.h"
|
||||
#include "src/animation.h"
|
||||
#include "src/code_80005FD0.h"
|
||||
#include "src/code_8003DC40.h"
|
||||
#include "src/code_80057C60.h"
|
||||
#include "src/code_8006E9C0.h"
|
||||
#include "src/update_objects.h"
|
||||
#include "src/code_80086E70.h"
|
||||
#include "src/code_80091440.h"
|
||||
#include "src/menu_items.h"
|
||||
#include "src/code_800AF9B0.h"
|
||||
#include <assets/common_data.h>
|
||||
#include <assets/data_800E8700.h>
|
||||
#include "src/data/some_data.h"
|
||||
#include "src/data/path_spawn_metadata.h"
|
||||
#include "src/buffers/trig_tables.h"
|
||||
#include "src/data_segment2.h"
|
||||
#include "src/effects.h"
|
||||
#include "src/ending/ceremony_and_credits.h"
|
||||
#include "src/ending/code_80280000.h"
|
||||
#include "src/ending/code_80281780.h"
|
||||
#include "src/ending/code_80281C40.h"
|
||||
#include "src/ending/credits.h"
|
||||
#include "src/ending/podium_ceremony_actors.h"
|
||||
#include "src/render_objects.h"
|
||||
#include "src/kart_dma.h"
|
||||
#include "src/main.h"
|
||||
#include "src/math_util_2.h"
|
||||
#include "src/menus.h"
|
||||
#include "src/os/bstring.h"
|
||||
#include "src/os/controller.h"
|
||||
#include "src/os/hardware.h"
|
||||
#include "src/os/libaudio_internal.h"
|
||||
#include "src/os/libultra_internal.h"
|
||||
#include "src/os/new_func.h"
|
||||
#include "src/os/osAi.h"
|
||||
#include "src/os/osContInternal.h"
|
||||
#include "src/os/osint.h"
|
||||
#include "src/os/piint.h"
|
||||
#include "src/os/printf.h"
|
||||
#include "src/player_controller.h"
|
||||
#include "src/profiler.h"
|
||||
#include "src/racing/actors.h"
|
||||
#include "src/racing/actors_extended.h"
|
||||
#include "src/racing/collision.h"
|
||||
#include "src/racing/math_util.h"
|
||||
#include "src/racing/memory.h"
|
||||
#include "src/racing/race_logic.h"
|
||||
#include "src/racing/render_courses.h"
|
||||
#include "src/racing/skybox_and_splitscreen.h"
|
||||
#include "src/render_player.h"
|
||||
#include "src/save.h"
|
||||
#include "src/spawn_players.h"
|
||||
#include "src/staff_ghosts.h"
|
||||
#include "src/textures.h"
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# note, this quick hack only works with five arguments.
|
||||
# if you're trying to use six arguments, you need to add another `$6` etc.
|
||||
|
||||
python3 tools/asm-differ/diff.py $1 $2 $3 $4 $5 $6 $7 $8
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
def add_custom_arguments(parser):
|
||||
group = parser.add_mutually_exclusive_group(required=False)
|
||||
group.add_argument('-u', dest='lang', action='store_const', const='us',
|
||||
help="Set version to US.")
|
||||
group.add_argument('-eu10', dest='lang', action='store_const', const='eu-1.0',
|
||||
help="Set version to EU.")
|
||||
group.add_argument('-eu11', dest='lang', action='store_const', const='eu-final',
|
||||
help="Set version to EU.")
|
||||
|
||||
def apply(config, args):
|
||||
lang = args.lang or 'us'
|
||||
config['mapfile'] = f'build/{lang}/mk64.{lang}.map'
|
||||
config['myimg'] = f'build/{lang}/mk64.{lang}.z64'
|
||||
config['baseimg'] = f'baserom.{lang}.z64'
|
||||
config['makeflags'] = [f'VERSION={lang}']
|
||||
config['source_directories'] = ['.']
|
||||
-313
@@ -1,313 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import os.path
|
||||
import argparse
|
||||
from subprocess import check_call
|
||||
import re
|
||||
|
||||
# TODO: -S argument for shifted ROMs
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="find the first difference(s) between the compiled ROM and the baserom"
|
||||
)
|
||||
versionGroup = parser.add_mutually_exclusive_group()
|
||||
versionGroup.add_argument(
|
||||
"-u",
|
||||
"--us",
|
||||
help="use United States version",
|
||||
action="store_const",
|
||||
const="us",
|
||||
dest="version",
|
||||
)
|
||||
versionGroup.add_argument(
|
||||
"-e",
|
||||
"--eu10",
|
||||
help="use European (1.0) version",
|
||||
action="store_const",
|
||||
const="eu-1.0",
|
||||
dest="version",
|
||||
)
|
||||
versionGroup.add_argument(
|
||||
"-E",
|
||||
"--eu11",
|
||||
help="use European (1.1) version",
|
||||
action="store_const",
|
||||
const="eu-final",
|
||||
dest="version",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-m", "--make", help="run make before finding difference(s)", action="store_true"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--count",
|
||||
type=int,
|
||||
default=1,
|
||||
help="find up to this many instruction difference(s)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-n", "--by-name", type=str, default="", help="perform a symbol or address lookup"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d", "--diff", action="store_true", help="run ./diff.py on the result"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
diff_count = args.count
|
||||
|
||||
version = args.version
|
||||
|
||||
if version is None:
|
||||
version = "us"
|
||||
best = 0
|
||||
for ver in ["us"]:
|
||||
try:
|
||||
mtime = os.path.getmtime(f"build/{ver}/mk64.{ver}.z64")
|
||||
if mtime > best:
|
||||
best = mtime
|
||||
version = ver
|
||||
except Exception:
|
||||
pass
|
||||
print("Assuming version " + version)
|
||||
|
||||
if args.make:
|
||||
check_call(["make", "-j4", "VERSION=" + version, "COMPARE=0"])
|
||||
|
||||
baseimg = f"baserom.{version}.z64"
|
||||
basemap = f"mk64.{version}.map"
|
||||
|
||||
myimg = f"build/{version}/mk64.{version}.z64"
|
||||
mymap = f"build/{version}/{basemap}"
|
||||
|
||||
if os.path.isfile("expected/" + mymap):
|
||||
basemap = "expected/" + mymap
|
||||
|
||||
required_files = [baseimg, myimg, mymap]
|
||||
if not os.path.isfile(baseimg):
|
||||
print(baseimg + " must exist.")
|
||||
exit(1)
|
||||
if not os.path.isfile(myimg) or not os.path.isfile(mymap):
|
||||
print(
|
||||
myimg
|
||||
+ " and "
|
||||
+ mymap
|
||||
+ " must exist. Try rerunning with --make to build them."
|
||||
)
|
||||
exit(1)
|
||||
|
||||
mybin = open(myimg, "rb").read()
|
||||
basebin = open(baseimg, "rb").read()
|
||||
|
||||
if len(mybin) != len(basebin):
|
||||
print("Modified ROM has different size...")
|
||||
exit(1)
|
||||
|
||||
if mybin == basebin:
|
||||
print("No differences!")
|
||||
exit(0)
|
||||
|
||||
|
||||
def search_map(rom_addr):
|
||||
ram_offset = None
|
||||
last_ram = 0
|
||||
last_rom = 0
|
||||
last_fn = "<start of rom>"
|
||||
last_file = "<no file>"
|
||||
prev_line = ""
|
||||
with open(mymap) as f:
|
||||
for line in f:
|
||||
if "load address" in line:
|
||||
# Example: ".boot 0x0000000004000000 0x1000 load address 0x0000000000000000"
|
||||
if "noload" in line or "noload" in prev_line:
|
||||
ram_offset = None
|
||||
continue
|
||||
hex_number = re.findall(r"0x[0-9a-fA-F]+", line)
|
||||
ram = int(hex_number[0], 0) # int(line[16 : 16 + 18], 0)
|
||||
rom = int(hex_number[2], 0)# int(line[59 : 59 + 18], 0)
|
||||
ram_offset = ram - rom
|
||||
continue
|
||||
prev_line = line
|
||||
|
||||
if (
|
||||
ram_offset is None
|
||||
or "=" in line
|
||||
or "*fill*" in line
|
||||
or " 0x" not in line
|
||||
):
|
||||
continue
|
||||
hex_number = re.findall(r"0x[0-9a-fA-F]+", line)
|
||||
ram = int(hex_number[0], 0) # int(line[16 : 16 + 18], 0)
|
||||
rom = ram - ram_offset
|
||||
fn = line.split()[-1]
|
||||
if fn.startswith("0x"):
|
||||
ram_offset = None
|
||||
continue
|
||||
if rom > rom_addr or (rom_addr & 0x80000000 and ram > rom_addr):
|
||||
return f"in {last_fn} (ram 0x{last_ram:08x}, rom 0x{last_rom:06x}, {last_file})"
|
||||
last_ram = ram
|
||||
last_rom = rom
|
||||
last_fn = fn
|
||||
if "/" in fn:
|
||||
last_file = fn
|
||||
return "at end of rom?"
|
||||
|
||||
|
||||
def parse_map(fname):
|
||||
ram_offset = None
|
||||
cur_file = "<no file>"
|
||||
syms = {}
|
||||
prev_sym = None
|
||||
prev_line = ""
|
||||
with open(fname) as f:
|
||||
for line in f:
|
||||
if "load address" in line:
|
||||
if "noload" in line or "noload" in prev_line:
|
||||
ram_offset = None
|
||||
continue
|
||||
ram = int(line[16 : 16 + 18], 0)
|
||||
rom = int(line[59 : 59 + 18], 0)
|
||||
ram_offset = ram - rom
|
||||
continue
|
||||
prev_line = line
|
||||
|
||||
if (
|
||||
ram_offset is None
|
||||
or "=" in line
|
||||
or "*fill*" in line
|
||||
or " 0x" not in line
|
||||
):
|
||||
continue
|
||||
ram = int(line[16 : 16 + 18], 0)
|
||||
rom = ram - ram_offset
|
||||
fn = line.split()[-1]
|
||||
if "0x" in fn:
|
||||
ram_offset = None
|
||||
elif "/" in fn:
|
||||
cur_file = fn
|
||||
else:
|
||||
syms[fn] = (rom, cur_file, prev_sym, ram)
|
||||
prev_sym = fn
|
||||
return syms
|
||||
|
||||
|
||||
def map_diff():
|
||||
map1 = parse_map(mymap)
|
||||
map2 = parse_map(basemap)
|
||||
min_ram = None
|
||||
found = None
|
||||
for sym, addr in map1.items():
|
||||
if sym not in map2:
|
||||
continue
|
||||
if addr[0] != map2[sym][0]:
|
||||
if min_ram is None or addr[0] < min_ram:
|
||||
min_ram = addr[0]
|
||||
found = (sym, addr[1], addr[2])
|
||||
if min_ram is None:
|
||||
return False
|
||||
else:
|
||||
print()
|
||||
print(
|
||||
f"Map appears to have shifted just before {found[0]} ({found[1]}) -- in {found[2]}?"
|
||||
)
|
||||
if found[2] is not None and found[2] not in map2:
|
||||
print()
|
||||
print(
|
||||
f"(Base map file {basemap} out of date due to renamed symbols, so result may be imprecise.)"
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
def hexbytes(bs):
|
||||
return ":".join("{:02x}".format(c) for c in bs)
|
||||
|
||||
|
||||
# For convenience, allow `./first-diff.py <ROM addr | RAM addr | function name>`
|
||||
# to do a symbol <-> address lookup. This should really be split out into a
|
||||
# separate script...
|
||||
if args.by_name:
|
||||
try:
|
||||
addr = int(args.by_name, 0)
|
||||
print(args.by_name, "is", search_map(addr))
|
||||
except ValueError:
|
||||
m = parse_map(mymap)
|
||||
try:
|
||||
print(
|
||||
args.by_name,
|
||||
"is at position",
|
||||
hex(m[args.by_name][0]),
|
||||
"in ROM,",
|
||||
hex(m[args.by_name][3]),
|
||||
"in RAM",
|
||||
)
|
||||
except KeyError:
|
||||
print("function", args.by_name, "not found")
|
||||
exit()
|
||||
|
||||
found_instr_diff = []
|
||||
map_search_diff = []
|
||||
diffs = 0
|
||||
shift_cap = 1000
|
||||
for i in range(24, len(mybin), 4):
|
||||
# (mybin[i:i+4] != basebin[i:i+4], but that's slightly slower in CPython...)
|
||||
if diffs <= shift_cap and (
|
||||
mybin[i] != basebin[i]
|
||||
or mybin[i + 1] != basebin[i + 1]
|
||||
or mybin[i + 2] != basebin[i + 2]
|
||||
or mybin[i + 3] != basebin[i + 3]
|
||||
):
|
||||
if diffs == 0:
|
||||
print(f"First difference at ROM addr {hex(i)}, {search_map(i)}")
|
||||
print(
|
||||
f"Bytes: {hexbytes(mybin[i : i + 4])} vs {hexbytes(basebin[i : i + 4])}"
|
||||
)
|
||||
diffs += 1
|
||||
if (
|
||||
len(found_instr_diff) < diff_count
|
||||
and mybin[i] >> 2 != basebin[i] >> 2
|
||||
and not search_map(i) in map_search_diff
|
||||
):
|
||||
found_instr_diff.append(i)
|
||||
map_search_diff.append(search_map(i))
|
||||
if diffs == 0:
|
||||
print("No differences!")
|
||||
exit(0)
|
||||
definite_shift = diffs > shift_cap
|
||||
if not definite_shift:
|
||||
if (diffs > 1):
|
||||
print(str(diffs) + " differing words.")
|
||||
else:
|
||||
print(str(diffs) + " differing word.")
|
||||
|
||||
if diffs > 100:
|
||||
if len(found_instr_diff) > 0:
|
||||
for i in found_instr_diff:
|
||||
print(f"Instruction difference at ROM addr {hex(i)}, {search_map(i)}")
|
||||
print(
|
||||
f"Bytes: {hexbytes(mybin[i : i + 4])} vs {hexbytes(basebin[i : i + 4])}"
|
||||
)
|
||||
if not os.path.isfile(basemap):
|
||||
if definite_shift:
|
||||
print("Tons of differences, must be a shifted ROM.")
|
||||
print(
|
||||
"To find ROM shifts, copy a clean .map file to "
|
||||
+ basemap
|
||||
+ " and rerun this script."
|
||||
)
|
||||
exit(1)
|
||||
|
||||
if not map_diff():
|
||||
print(f"No ROM shift{' (!?)' if definite_shift else ''}")
|
||||
if args.diff:
|
||||
diff_args = input("Call ./diff.py with which arguments? ") or "--"
|
||||
if diff_args[0] != "-":
|
||||
diff_args = "-" + diff_args
|
||||
if "w" in diff_args and args.make:
|
||||
diff_args += "m" # To avoid warnings when passing -w, also pass -m as long as -m was passed to first-diff itself
|
||||
|
||||
check_call(
|
||||
[
|
||||
"python3",
|
||||
"diff.py",
|
||||
f"-{version[0]}",
|
||||
diff_args,
|
||||
search_map(found_instr_diff[0]).split()[1],
|
||||
]
|
||||
)
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# m2c_helper.sh
|
||||
# Utility to aid in the generation of m2c output for specific functions
|
||||
#
|
||||
# example usages:
|
||||
# m2c_helper.sh menu_items func_800AAC18
|
||||
# m2c_helper.sh audio/load audio_init
|
||||
#
|
||||
# Be sure to set DISASSEMBLY_FILE to a filename you are comfortable with.
|
||||
# Defaulted to function_disassembly.c
|
||||
#
|
||||
# It's expected that the utility will be ran twice for any given function.
|
||||
# The first run will create a context file specific to the target function
|
||||
# The second run will create the full m2c output for the function,
|
||||
# assuming the appropriate function specific context file found.
|
||||
#
|
||||
# 99.9% of the time you will only use the function specific context file to give names
|
||||
# to the function arguments. Even then, you don't HAVE to do that. The file can be
|
||||
# empty if you want.
|
||||
# As long as its contents are acceptable to m2c, do whatever you want to it.
|
||||
#
|
||||
# It may take a while for either run to complete as including all binary data
|
||||
# from .incbin directives is a bit slow
|
||||
#
|
||||
|
||||
# Parent directory for all the non-matching function assembly files
|
||||
ASM_DIR="asm/non_matchings"
|
||||
# Parent directory that function specific contexts will be placed/found in
|
||||
CONTEXT_DIR="contexts"
|
||||
|
||||
# Expand the data/**.s glob into an array.
|
||||
DATA_FILES=(data/**.s)
|
||||
# Un-array the file list
|
||||
DATA_FILES="${DATA_FILES[@]}"
|
||||
DATA_FILES_EXCLUDE="data/rsp.s"
|
||||
# Use bash variable expansion to remove each file-to-exclude from the DATA_FILES string
|
||||
for file in $DATA_FILES_EXCLUDE; do
|
||||
DATA_FILES="${DATA_FILES//$file/}"
|
||||
done
|
||||
|
||||
# Context for all the non-function-specific stuff (type definitions, function prototypes, etc.)
|
||||
COMMON_CONTEXT="ctx.c"
|
||||
# Extra options when generating the function specific context
|
||||
CONTEXT_M2C_OPTS="--stack-structs --zfill-constants"
|
||||
# Extra options when generating the function disassembly
|
||||
DISASSEMBLY_M2C_OPTS="--zfill-constants"
|
||||
# Directories to search when a .incbin line is encountered in a data file
|
||||
INCBIN_OPTS="--incbin-dir ./expected/build/us --incbin-dir ./"
|
||||
# File that the final disassembly output will be placed. Can be named whatever you want
|
||||
DISASSEMBLY_FILE="function_disassembly.c"
|
||||
|
||||
# Directory where the m2c program can be found
|
||||
M2C_DIR="../mips_to_c"
|
||||
# Collect the SHA1 sum of the commit m2c is checked out too
|
||||
pushd "${M2C_DIR}" > /dev/null
|
||||
M2C_SHA="$(git rev-parse HEAD)"
|
||||
popd > /dev/null
|
||||
|
||||
directory="$1"
|
||||
function="$2"
|
||||
|
||||
make_function_context () {
|
||||
echo "$(${M2C_DIR}/m2c.py \
|
||||
${ASM_DIR}/${directory}/${function}.s \
|
||||
${DATA_FILES} \
|
||||
${INCBIN_OPTS} \
|
||||
${CONTEXT_M2C_OPTS} \
|
||||
--context ${COMMON_CONTEXT})" > "${CONTEXT_DIR}/${directory}/${function}.c" 2>&1
|
||||
}
|
||||
|
||||
make_function_disassembly () {
|
||||
echo "#ifdef MIPS_TO_C";
|
||||
echo "//generated by m2c commit ${M2C_SHA} on $(date +%b-%d-%Y)";
|
||||
${M2C_DIR}/m2c.py \
|
||||
${ASM_DIR}/${directory}/${function}.s \
|
||||
${DATA_FILES} \
|
||||
${INCBIN_OPTS} \
|
||||
${DISASSEMBLY_M2C_OPTS} \
|
||||
--context ${COMMON_CONTEXT} --context ${CONTEXT_DIR}/${directory}/${function}.c
|
||||
echo "#else";
|
||||
echo "GLOBAL_ASM(\"${ASM_DIR}/${directory}/${function}.s\")";
|
||||
echo "#endif"
|
||||
}
|
||||
|
||||
# If there isn't already a sub-dir for the specified directory, create one
|
||||
if [[ ! -d "${CONTEXT_DIR}/${directory}" ]]; then
|
||||
mkdir -p "${CONTEXT_DIR}/${directory}"
|
||||
fi
|
||||
|
||||
# If there is a function specific context file, create the full disassembly
|
||||
# Otherwise, create the function specific context file
|
||||
if [[ -f "${CONTEXT_DIR}/${directory}/${function}.c" ]]; then
|
||||
echo "$(make_function_disassembly ${directory} ${function})" > "${DISASSEMBLY_FILE}" 2>&1
|
||||
else
|
||||
make_function_context ${directory} ${function}
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
a729039453210b84f17019dda3f248d5888f7690 build/eu-1.0/mk64.eu-1.0.z64
|
||||
@@ -1 +0,0 @@
|
||||
f6b5f519dd57ea59e9f013cc64816e9d273b2329 build/eu-final/mk64.eu-final.z64
|
||||
@@ -1,682 +0,0 @@
|
||||
/* Mario Kart 64 (U) linker script
|
||||
* generated by n64split v0.4a - N64 ROM splitter */
|
||||
|
||||
OUTPUT_ARCH (mips)
|
||||
|
||||
#define LINKER_MAIN 0x80000400
|
||||
|
||||
#define LINKER_ENDING 0x80280000
|
||||
|
||||
#define LINKER_RACING 0x8028DF00
|
||||
|
||||
// End of Jumper pak memory
|
||||
#define RDRAM_END 0x807FFFFF
|
||||
|
||||
#define BEGIN_SEG(name, addr) \
|
||||
_##name##SegmentStart = ADDR(.name); \
|
||||
_##name##SegmentRomStart = __romPos; \
|
||||
.name addr : AT(__romPos)
|
||||
|
||||
#define END_SEG(name) \
|
||||
_##name##SegmentEnd = ADDR(.name) + SIZEOF(.name); \
|
||||
_##name##SegmentRomEnd = __romPos + SIZEOF(.name); \
|
||||
_##name##SegmentSize = SIZEOF(.name); \
|
||||
__romPos += SIZEOF(.name);
|
||||
|
||||
#define BEGIN_NOLOAD(name) \
|
||||
_##name##SegmentNoloadStart = ADDR(.name.noload); \
|
||||
.name.noload (NOLOAD) :
|
||||
|
||||
#define END_NOLOAD(name) \
|
||||
_##name##SegmentNoloadEnd = ADDR(.name.noload) + SIZEOF(.name.noload);
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
__romPos = 0;
|
||||
|
||||
BEGIN_SEG(boot, 0xA4000000)
|
||||
{
|
||||
BUILD_DIR/asm/rom_header.o(.text);
|
||||
BUILD_DIR/asm/boot.o(.text);
|
||||
}
|
||||
END_SEG(boot)
|
||||
|
||||
/* 0x80000400 001000-0D9B70 [D8B70] */
|
||||
BEGIN_SEG(main, LINKER_MAIN) SUBALIGN(0x10)
|
||||
{
|
||||
BUILD_DIR/asm/entry.o(.text);
|
||||
BUILD_DIR/src/main.o(.text*);
|
||||
BUILD_DIR/src/code_800029B0.o(.text*);
|
||||
BUILD_DIR/src/profiler.o(.text*);
|
||||
BUILD_DIR/src/crash_screen.o(.text*);
|
||||
BUILD_DIR/src/animation.o(.text*);
|
||||
BUILD_DIR/src/staff_ghosts.o(.text*);
|
||||
BUILD_DIR/asm/unused_overflow_check.o(.text);
|
||||
BUILD_DIR/src/code_80005FD0.jp.o(.text*);
|
||||
BUILD_DIR/src/camera.o(.text*);
|
||||
BUILD_DIR/src/render_player.o(.text*);
|
||||
BUILD_DIR/src/kart_dma.o(.text*);
|
||||
BUILD_DIR/src/player_controller.o(.text*);
|
||||
BUILD_DIR/src/spawn_players.o(.text*);
|
||||
BUILD_DIR/src/code_8003DC40.o(.text*);
|
||||
BUILD_DIR/asm/unused_mio0_decode.o(.text);
|
||||
BUILD_DIR/asm/mio0_decode.o(.text);
|
||||
BUILD_DIR/asm/tkmk00_decode.o(.text);
|
||||
BUILD_DIR/src/gbiMacro.o(.text*);
|
||||
BUILD_DIR/src/math_util_2.o(.text*);
|
||||
BUILD_DIR/src/render_objects.o(.text*);
|
||||
BUILD_DIR/src/code_80057C60.o(.text*);
|
||||
BUILD_DIR/src/code_8006E9C0.o(.text*);
|
||||
BUILD_DIR/src/update_objects.o(.text*);
|
||||
BUILD_DIR/src/code_80086E70.o(.text*);
|
||||
BUILD_DIR/src/effects.o(.text*);
|
||||
BUILD_DIR/src/code_80091440.o(.text*);
|
||||
BUILD_DIR/src/code_80091750.jp.o(.text*);
|
||||
BUILD_DIR/src/code_800AF9B0.o(.text*);
|
||||
BUILD_DIR/src/menus.o(.text*);
|
||||
BUILD_DIR/src/save.o(.text*);
|
||||
BUILD_DIR/src/audio/synthesis.o(.text*);
|
||||
BUILD_DIR/src/audio/heap.o(.text*);
|
||||
BUILD_DIR/src/audio/load.o(.text*);
|
||||
BUILD_DIR/src/audio/playback.o(.text*);
|
||||
BUILD_DIR/src/audio/effects.o(.text*);
|
||||
BUILD_DIR/src/audio/seqplayer.o(.text*);
|
||||
BUILD_DIR/src/audio/external.o(.text*);
|
||||
BUILD_DIR/src/audio/port_eu.o(.text*);
|
||||
#if DEBUG
|
||||
BUILD_DIR/src/os/osCartRomInit.o(.text*);
|
||||
BUILD_DIR/src/debug/crash_screen_enhancement.o(.text*);
|
||||
BUILD_DIR/src/debug/debug.o(.text*);
|
||||
BUILD_DIR/src/os/sprintf.o(.text*);
|
||||
BUILD_DIR/src/os/is_debug.o(.text*);
|
||||
#endif
|
||||
BUILD_DIR/src/os/osCreateThread.o(.text);
|
||||
#ifdef VERSION_EU
|
||||
. += 0x40;
|
||||
#endif
|
||||
BUILD_DIR/src/os/osInitialize.o(.text*);
|
||||
BUILD_DIR/src/os/osStartThread.o(.text*);
|
||||
BUILD_DIR/src/os/osCreateViManager.o(.text*);
|
||||
BUILD_DIR/asm/os/parameters.o(.text);
|
||||
BUILD_DIR/src/os/osViSetMode.o(.text*);
|
||||
BUILD_DIR/src/os/osViBlack.o(.text*);
|
||||
BUILD_DIR/src/os/osViSetSpecialFeatures.o(.text*);
|
||||
BUILD_DIR/src/os/osCreatePiManager.o(.text*);
|
||||
BUILD_DIR/src/os/osSetThreadPri.o(.text*);
|
||||
BUILD_DIR/src/os/osCreateMesgQueue.o(.text*);
|
||||
BUILD_DIR/src/os/osViSetEvent.o(.text*);
|
||||
BUILD_DIR/src/os/osSetEventMesg.o(.text*);
|
||||
BUILD_DIR/src/os/osSpTaskLoadGo.o(.text*);
|
||||
BUILD_DIR/src/os/osContInit.o(.text*);
|
||||
BUILD_DIR/src/os/osContStartReadData.o(.text*);
|
||||
BUILD_DIR/src/os/osRecvMesg.o(.text*);
|
||||
BUILD_DIR/asm/os/osWritebackDCacheAll.o(.text);
|
||||
BUILD_DIR/src/os/osSendMesg.o(.text*);
|
||||
BUILD_DIR/src/os/osViSwapBuffer.o(.text*);
|
||||
BUILD_DIR/asm/os/bzero.o(.text);
|
||||
BUILD_DIR/asm/os/osInvalICache.o(.text);
|
||||
BUILD_DIR/asm/os/osInvalDCache.o(.text);
|
||||
BUILD_DIR/src/os/osPiStartDma.o(.text*);
|
||||
BUILD_DIR/src/os/osSpTaskYield.o(.text*);
|
||||
BUILD_DIR/src/os/osSpTaskYielded.o(.text*);
|
||||
BUILD_DIR/src/os/osGetTime.o(.text*);
|
||||
BUILD_DIR/src/os/math/llmuldiv.o(.text*);
|
||||
#if GCC
|
||||
BUILD_DIR/asm/os/llmuldiv_gcc.o(.text);
|
||||
#endif
|
||||
BUILD_DIR/src/os/__osGetCurrFaultedThread.o(.text*);
|
||||
BUILD_DIR/asm/os/sqrtf.o(.text);
|
||||
BUILD_DIR/src/os/guOrthoF.o(.text*);
|
||||
BUILD_DIR/src/os/osSetTime.o(.text*);
|
||||
BUILD_DIR/src/os/osEepromProbe.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsIsPlug.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsInit.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsNumFiles.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsFileState.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsFreeBlocks.o(.text*);
|
||||
BUILD_DIR/src/os/guRotateF.o(.text*);
|
||||
BUILD_DIR/src/os/guScaleF.o(.text*);
|
||||
BUILD_DIR/src/os/guPerspectiveF.o(.text*);
|
||||
BUILD_DIR/src/os/guLookAtF.o(.text*);
|
||||
BUILD_DIR/src/os/guTranslateF.o(.text*);
|
||||
BUILD_DIR/src/os/osSyncPrintf.o(.text*);
|
||||
BUILD_DIR/src/os/guMtxCatL.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsSearchFile.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsDeleteFile.o(.text*);
|
||||
BUILD_DIR/src/os/osEepromLongWrite.o(.text*);
|
||||
BUILD_DIR/src/os/osEepromLongRead.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsReadWriteFile.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsAllocateFile.o(.text*);
|
||||
BUILD_DIR/src/os/osAiSetFrequency.o(.text*);
|
||||
BUILD_DIR/src/os/osAiGetLength.o(.text*);
|
||||
BUILD_DIR/src/os/osAiSetNextBuffer.o(.text*);
|
||||
BUILD_DIR/asm/os/osGetCount.o(.text);
|
||||
BUILD_DIR/asm/os/__osException.o(.text);
|
||||
BUILD_DIR/asm/os/__osDisableInt.o(.text);
|
||||
BUILD_DIR/asm/os/__osRestoreInt.o(.text);
|
||||
BUILD_DIR/src/os/__osDequeueThread.o(.text*);
|
||||
BUILD_DIR/asm/os/__osSetSR.o(.text);
|
||||
BUILD_DIR/asm/os/__osGetSR.o(.text);
|
||||
BUILD_DIR/asm/os/__osSetFpcCsr.o(.text);
|
||||
BUILD_DIR/src/os/__osSiRawReadIo.o(.text*);
|
||||
BUILD_DIR/src/os/__osSiRawWriteIo.o(.text*);
|
||||
BUILD_DIR/asm/os/osWritebackDCache.o(.text);
|
||||
BUILD_DIR/asm/os/osMapTLBRdb.o(.text);
|
||||
BUILD_DIR/src/os/osPiRawReadIo.o(.text*);
|
||||
BUILD_DIR/src/os/__osSetHWIntrRoutine.o(.text*);
|
||||
BUILD_DIR/src/os/__osLeoInterrupt.o(.text*);
|
||||
BUILD_DIR/src/os/osTimer.o(.text*);
|
||||
BUILD_DIR/src/os/osGetThreadPri.o(.text*);
|
||||
BUILD_DIR/src/os/__osViInit.o(.text*);
|
||||
BUILD_DIR/src/os/__osViGetCurrentContext.o(.text*);
|
||||
BUILD_DIR/src/os/__osViSwapContext.o(.text*);
|
||||
BUILD_DIR/src/os/__osPiCreateAccessQueue.o(.text*);
|
||||
BUILD_DIR/src/os/osPiRawStartDma.o(.text*);
|
||||
BUILD_DIR/src/os/osEPiRawStartDma.o(.text*);
|
||||
BUILD_DIR/src/os/__osDevMgrMain.o(.text*);
|
||||
BUILD_DIR/asm/os/bcopy.o(.text);
|
||||
BUILD_DIR/src/os/osVirtualToPhysical.o(.text*);
|
||||
BUILD_DIR/src/os/__osSpSetStatus.o(.text*);
|
||||
BUILD_DIR/src/os/__osSpSetPc.o(.text*);
|
||||
BUILD_DIR/src/os/__osSpRawStartDma.o(.text*);
|
||||
BUILD_DIR/src/os/__osSpDeviceBusy.o(.text*);
|
||||
BUILD_DIR/src/os/osSetTimer.o(.text*);
|
||||
BUILD_DIR/src/os/__osSiRawStartDma.o(.text*);
|
||||
BUILD_DIR/src/os/__osSiCreateAccessQueue.o(.text*);
|
||||
BUILD_DIR/src/os/osJamMesg.o(.text*);
|
||||
BUILD_DIR/src/os/osPiGetCmdQueue.o(.text*);
|
||||
BUILD_DIR/src/os/__osSpGetStatus.o(.text*);
|
||||
BUILD_DIR/src/os/guMtxF2L.o(.text*);
|
||||
BUILD_DIR/src/os/osEepromWrite.o(.text*);
|
||||
BUILD_DIR/src/os/contpfs.o(.text*);
|
||||
BUILD_DIR/src/os/osPfsChecker.o(.text*);
|
||||
BUILD_DIR/src/os/contramread.o(.text*);
|
||||
BUILD_DIR/src/os/guNormalize.o(.text*);
|
||||
BUILD_DIR/src/os/math/sinf.o(.text*);
|
||||
BUILD_DIR/src/os/math/cosf.o(.text*);
|
||||
BUILD_DIR/src/os/_Printf.o(.text*);
|
||||
BUILD_DIR/src/os/guMtxCatF.o(.text*);
|
||||
BUILD_DIR/src/os/contramwrite.o(.text*);
|
||||
BUILD_DIR/src/os/osEepromRead.o(.text*);
|
||||
BUILD_DIR/src/os/__osAiDeviceBusy.o(.text*);
|
||||
BUILD_DIR/asm/os/osSetIntMask.o(.text);
|
||||
BUILD_DIR/src/os/osDestroyThread.o(.text*);
|
||||
BUILD_DIR/src/os/__osSiDeviceBusy.o(.text*);
|
||||
BUILD_DIR/src/os/osLeoDiskInit.o(.text*);
|
||||
BUILD_DIR/asm/os/__osSetCompare.o(.text);
|
||||
BUILD_DIR/src/os/__osResetGlobalIntMask.o(.text*);
|
||||
BUILD_DIR/src/os/__osEPiRawWriteIo.o(.text*);
|
||||
BUILD_DIR/src/os/osYieldThread.o(.text*);
|
||||
BUILD_DIR/asm/os/__osProbeTLB.o(.text);
|
||||
BUILD_DIR/src/os/crc.o(.text*);
|
||||
BUILD_DIR/src/os/string.o(.text*);
|
||||
BUILD_DIR/src/os/_Litob.o(.text*);
|
||||
BUILD_DIR/src/os/_Ldtob.o(.text*);
|
||||
BUILD_DIR/src/os/ldiv.o(.text*);
|
||||
BUILD_DIR/data/rsp.o(.text);
|
||||
BUILD_DIR/src/main.o(.data*);
|
||||
BUILD_DIR/src/code_800029B0.o(.data*);
|
||||
BUILD_DIR/src/profiler.o(.data*);
|
||||
BUILD_DIR/src/crash_screen.o(.data*);
|
||||
BUILD_DIR/src/staff_ghosts.o(.data*);
|
||||
BUILD_DIR/src/data/path_spawn_metadata.o(.data*);
|
||||
BUILD_DIR/src/camera.o(.data*);
|
||||
BUILD_DIR/src/render_player.o(.data*);
|
||||
BUILD_DIR/src/kart_dma.o(.data*);
|
||||
BUILD_DIR/src/data/kart_attributes.o(.data*);
|
||||
BUILD_DIR/src/player_controller.o(.data*);
|
||||
BUILD_DIR/src/spawn_players.o(.data*);
|
||||
BUILD_DIR/src/update_objects.o(.data*);
|
||||
BUILD_DIR/assets/code/data_800E45C0/data_800E45C0.o(.data*);
|
||||
BUILD_DIR/src/code_80057C60.o(.data*);
|
||||
BUILD_DIR/src/data/some_data.o(.data*);
|
||||
BUILD_DIR/src/effects.o(.data*);
|
||||
BUILD_DIR/src/code_80091440.o(.data*);
|
||||
BUILD_DIR/src/code_80091750.jp.o(.data*);
|
||||
BUILD_DIR/src/code_800AF9B0.o(.data*);
|
||||
BUILD_DIR/src/menus.o(.data*);
|
||||
BUILD_DIR/src/save.o(.data*);
|
||||
BUILD_DIR/assets/code/data_800E8700/data_800E8700.o(.data*);
|
||||
BUILD_DIR/src/audio/synthesis.o(.data*);
|
||||
BUILD_DIR/src/audio/heap.o(.data*);
|
||||
BUILD_DIR/src/audio/load.o(.data*);
|
||||
BUILD_DIR/src/audio/playback.o(.data*);
|
||||
BUILD_DIR/src/audio/effects.o(.data*);
|
||||
#if DEBUG
|
||||
BUILD_DIR/src/debug/crash_screen_enhancement.o(.data*);
|
||||
BUILD_DIR/src/debug/debug.o(.data*);
|
||||
BUILD_DIR/src/os/sprintf.o(.data*);
|
||||
#endif
|
||||
BUILD_DIR/src/audio/seqplayer.o(.data*);
|
||||
BUILD_DIR/src/audio/external.o(.data*);
|
||||
BUILD_DIR/src/audio/port_eu.o(.data*);
|
||||
BUILD_DIR/src/audio/audio_session_presets.o(.data*);
|
||||
BUILD_DIR/src/os/osInitialize.o(.data*);
|
||||
BUILD_DIR/src/os/osCreateViManager.o(.data*);
|
||||
BUILD_DIR/src/os/osViTable.o(.data*);
|
||||
BUILD_DIR/src/os/osCreatePiManager.o(.data*);
|
||||
BUILD_DIR/src/os/osContInit.o(.data*);
|
||||
BUILD_DIR/src/os/osAiSetNextBuffer.o(.data*);
|
||||
BUILD_DIR/src/os/__osSetHWIntrRoutine.o(.data*);
|
||||
BUILD_DIR/src/os/__osDequeueThread.o(.data*);
|
||||
BUILD_DIR/src/os/osTimer.o(.data*);
|
||||
BUILD_DIR/src/os/__osViInit.o(.data*);
|
||||
BUILD_DIR/src/os/__osPiCreateAccessQueue.o(.data*);
|
||||
BUILD_DIR/src/os/__osSiCreateAccessQueue.o(.data*);
|
||||
BUILD_DIR/src/os/_Printf.o(.data*);
|
||||
BUILD_DIR/src/os/osViData.o(.data*);
|
||||
BUILD_DIR/src/os/_Litob.o(.data*);
|
||||
BUILD_DIR/src/main.o(.rodata*);
|
||||
BUILD_DIR/src/animation.o(.rodata*);
|
||||
BUILD_DIR/src/code_800029B0.o(.rodata*);
|
||||
BUILD_DIR/src/code_80005FD0.jp.o(.rodata*);
|
||||
BUILD_DIR/src/camera.o(.rodata*);
|
||||
BUILD_DIR/src/render_player.o(.rodata*);
|
||||
BUILD_DIR/src/player_controller.o(.rodata*);
|
||||
BUILD_DIR/src/spawn_players.o(.rodata*);
|
||||
BUILD_DIR/src/code_8003DC40.o(.rodata*);
|
||||
BUILD_DIR/src/gbiMacro.o(.rodata*);
|
||||
BUILD_DIR/src/math_util_2.o(.rodata*);
|
||||
BUILD_DIR/src/render_objects.o(.rodata*);
|
||||
BUILD_DIR/src/code_80057C60.o(.rodata*);
|
||||
BUILD_DIR/src/code_8006E9C0.o(.rodata*);
|
||||
BUILD_DIR/src/update_objects.o(.rodata*);
|
||||
BUILD_DIR/src/code_80086E70.o(.rodata*);
|
||||
BUILD_DIR/src/effects.o(.rodata*);
|
||||
BUILD_DIR/src/code_80091440.o(.rodata*);
|
||||
BUILD_DIR/src/code_80091750.jp.o(.rodata*);
|
||||
BUILD_DIR/src/code_800AF9B0.o(.rodata*);
|
||||
BUILD_DIR/src/menus.o(.rodata*);
|
||||
BUILD_DIR/src/save.o(.rodata*);
|
||||
BUILD_DIR/src/audio/heap.o(.rodata*);
|
||||
BUILD_DIR/src/audio/load.o(.rodata*);
|
||||
BUILD_DIR/src/audio/playback.o(.rodata*);
|
||||
BUILD_DIR/src/audio/effects.o(.rodata*);
|
||||
BUILD_DIR/src/audio/seqplayer.o(.rodata*);
|
||||
BUILD_DIR/src/audio/external.o(.rodata*);
|
||||
BUILD_DIR/src/audio/port_eu.o(.rodata*);
|
||||
#if DEBUG
|
||||
BUILD_DIR/src/debug/crash_screen_enhancement.o(.rodata*);
|
||||
BUILD_DIR/src/debug/debug.o(.rodata*);
|
||||
BUILD_DIR/src/os/sprintf.o(.rodata*);
|
||||
#endif
|
||||
BUILD_DIR/src/os/guOrthoF.o(.rodata*);
|
||||
BUILD_DIR/src/os/guRotateF.o(.rodata*);
|
||||
BUILD_DIR/src/os/guScaleF.o(.rodata*);
|
||||
BUILD_DIR/src/os/guPerspectiveF.o(.rodata*);
|
||||
BUILD_DIR/src/os/guLookAtF.o(.rodata*);
|
||||
BUILD_DIR/src/os/osAiSetFrequency.o(.rodata*);
|
||||
BUILD_DIR/asm/os/__osException.o(.rodata*);
|
||||
BUILD_DIR/src/os/__osViSwapContext.o(.rodata*);
|
||||
BUILD_DIR/src/os/__osDevMgrMain.o(.rodata*);
|
||||
BUILD_DIR/src/os/guMtxF2L.o(.rodata*);
|
||||
BUILD_DIR/src/os/guNormalize.o(.rodata*);
|
||||
BUILD_DIR/src/os/math/sinf.o(.rodata*);
|
||||
BUILD_DIR/src/os/math/cosf.o(.rodata*);
|
||||
BUILD_DIR/src/os/_Printf.o(.rodata*);
|
||||
BUILD_DIR/asm/os/osSetIntMask.o(.rodata);
|
||||
BUILD_DIR/src/os/_Ldtob.o(.rodata*);
|
||||
BUILD_DIR/data/rsp.o(.data*);
|
||||
BUILD_DIR/src/audio/data.o(.data*);
|
||||
}
|
||||
END_SEG(main)
|
||||
|
||||
BEGIN_NOLOAD(main) {
|
||||
BUILD_DIR/src/main.o(.bss*);
|
||||
BUILD_DIR/src/code_800029B0.o(.bss*);
|
||||
BUILD_DIR/src/profiler.o(.bss*);
|
||||
BUILD_DIR/src/crash_screen.o(.bss*);
|
||||
BUILD_DIR/src/animation.o(.bss*);
|
||||
BUILD_DIR/src/staff_ghosts.o(.bss*);
|
||||
BUILD_DIR/src/code_80005FD0.jp.o(.bss*);
|
||||
BUILD_DIR/src/camera.o(.bss*);
|
||||
BUILD_DIR/src/render_player.o(.bss*);
|
||||
BUILD_DIR/src/spawn_players.o(.bss*);
|
||||
BUILD_DIR/src/code_80057C60.o(.bss*);
|
||||
BUILD_DIR/src/code_80057C60_var.o(.bss*);
|
||||
BUILD_DIR/src/effects.o(.bss*);
|
||||
BUILD_DIR/src/code_80091750.jp.o(.bss*);
|
||||
BUILD_DIR/src/code_800AF9B0.o(.bss*);
|
||||
BUILD_DIR/src/menus.o(.bss*);
|
||||
#if DEBUG
|
||||
BUILD_DIR/src/os/osCartRomInit.o(.bss*);
|
||||
BUILD_DIR/src/debug/crash_screen_enhancement.o(.bss*);
|
||||
BUILD_DIR/src/debug/debug.o(.bss*);
|
||||
BUILD_DIR/src/os/is_debug.o(.bss*);
|
||||
BUILD_DIR/src/os/sprintf.o(.bss*);
|
||||
#endif
|
||||
BUILD_DIR/src/audio/external.o(.bss*);
|
||||
BUILD_DIR/src/audio/port_eu.o(.bss*);
|
||||
BUILD_DIR/src/os/osInitialize.o(.bss*);
|
||||
BUILD_DIR/src/os/osCreateViManager.o(.bss*);
|
||||
BUILD_DIR/src/os/osCreatePiManager.o(.bss*);
|
||||
BUILD_DIR/src/os/osSetEventMesg.o(.bss*);
|
||||
BUILD_DIR/src/os/osSpTaskLoadGo.o(.bss*);
|
||||
BUILD_DIR/src/os/osContStartReadData.o(.bss*);
|
||||
BUILD_DIR/src/os/osContInit.o(.bss*);
|
||||
BUILD_DIR/src/os/osPfsIsPlug.o(.bss*);
|
||||
BUILD_DIR/src/os/guRotateF.o(.bss*);
|
||||
BUILD_DIR/src/os/__osLeoInterrupt.o(.bss*);
|
||||
BUILD_DIR/src/os/osTimer.o(.bss*);
|
||||
BUILD_DIR/src/os/__osPiCreateAccessQueue.o(.bss*);
|
||||
BUILD_DIR/src/os/__osSiCreateAccessQueue.o(.bss*);
|
||||
BUILD_DIR/src/os/osEepromWrite.o(.bss*);
|
||||
BUILD_DIR/asm/os/__osException.o(.bss);
|
||||
BUILD_DIR/src/os/osLeoDiskInit.o(.bss*);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_NOLOAD(main)
|
||||
|
||||
/* Checks that segments are not overlapping into the memory pool but is not strictly necessary */
|
||||
BEGIN_NOLOAD(memoryPool)
|
||||
{
|
||||
BUILD_DIR/src/buffers/memory_pool.o(.bss*);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_NOLOAD(memoryPool)
|
||||
|
||||
/* 0x8028DF00 0F7510-123640 [2C130] */
|
||||
BEGIN_SEG(racing, LINKER_RACING)
|
||||
{
|
||||
BUILD_DIR/src/racing/race_logic.o(.text*);
|
||||
BUILD_DIR/src/racing/render_courses.o(.text*);
|
||||
BUILD_DIR/src/racing/actors.o(.text*);
|
||||
BUILD_DIR/src/racing/skybox_and_splitscreen.o(.text*);
|
||||
BUILD_DIR/src/racing/memory.o(.text*);
|
||||
BUILD_DIR/src/racing/collision.o(.text*);
|
||||
BUILD_DIR/src/racing/actors_extended.o(.text*);
|
||||
BUILD_DIR/src/racing/math_util.o(.text*);
|
||||
BUILD_DIR/src/racing/race_logic.o(.data*);
|
||||
BUILD_DIR/src/racing/render_courses.o(.data*);
|
||||
BUILD_DIR/src/racing/actors.o(.data*);
|
||||
BUILD_DIR/src/racing/skybox_and_splitscreen.o(.data*);
|
||||
BUILD_DIR/src/racing/memory.o(.data*);
|
||||
BUILD_DIR/courses/courseTable.o(.data*);
|
||||
BUILD_DIR/src/racing/actors_extended.o(.data*);
|
||||
BUILD_DIR/src/racing/math_util.o(.data*);
|
||||
BUILD_DIR/src/racing/race_logic.o(.rodata*);
|
||||
BUILD_DIR/src/racing/render_courses.o(.rodata*);
|
||||
BUILD_DIR/src/racing/actors.o(.rodata*);
|
||||
BUILD_DIR/src/racing/skybox_and_splitscreen.o(.rodata*);
|
||||
BUILD_DIR/src/racing/memory.o(.rodata*);
|
||||
BUILD_DIR/src/racing/collision.o(.rodata*);
|
||||
BUILD_DIR/src/racing/actors_extended.o(.rodata*);
|
||||
BUILD_DIR/src/racing/math_util.o(.rodata*);
|
||||
}
|
||||
END_SEG(racing)
|
||||
|
||||
BEGIN_NOLOAD(racing)
|
||||
{
|
||||
BUILD_DIR/src/racing/race_logic.o(.bss*);
|
||||
BUILD_DIR/src/racing/actors.o(.bss*);
|
||||
BUILD_DIR/src/racing/memory.o(.bss*);
|
||||
BUILD_DIR/src/buffers/random.o(.bss*);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_NOLOAD(racing)
|
||||
|
||||
BEGIN_NOLOAD(buffers)
|
||||
{
|
||||
BUILD_DIR/src/buffers/trig_tables_bss.o(.bss*);
|
||||
BUILD_DIR/src/buffers/buffers.o(.bss*);
|
||||
BUILD_DIR/src/buffers/gfx_output_buffer.o(.bss*);
|
||||
BUILD_DIR/src/audio/synthesis.o(.bss*);
|
||||
BUILD_DIR/src/audio/heap.o(.bss*);
|
||||
BUILD_DIR/src/audio/load.o(.bss*);
|
||||
BUILD_DIR/src/audio/data.o(.bss*);
|
||||
BUILD_DIR/src/buffers/audio_heap.o(.bss*);
|
||||
. = ALIGN(0x8);
|
||||
}
|
||||
END_NOLOAD(buffers)
|
||||
|
||||
/* 0x80280000 123640-12AAE0 [74A0] */
|
||||
BEGIN_SEG(ending, LINKER_ENDING)
|
||||
{
|
||||
BUILD_DIR/src/ending/code_80280000.o(.text*);
|
||||
BUILD_DIR/src/ending/podium_ceremony_actors.o(.text*);
|
||||
BUILD_DIR/src/ending/camera_junk.o(.text*);
|
||||
BUILD_DIR/src/ending/code_80281780.o(.text*);
|
||||
BUILD_DIR/src/ending/code_80281C40.o(.text*);
|
||||
BUILD_DIR/src/ending/ceremony_and_credits.o(.text*);
|
||||
BUILD_DIR/src/ending/podium_ceremony_actors.o(.data*);
|
||||
BUILD_DIR/src/ending/code_80281780.o(.data*);
|
||||
BUILD_DIR/src/ending/dl_unk_80284EE0.o(.data*);
|
||||
BUILD_DIR/src/ending/credits.jp.o(.data*);
|
||||
BUILD_DIR/src/ending/ceremony_and_credits.o(.data*);
|
||||
BUILD_DIR/src/ending/code_80280000.o(.rodata*);
|
||||
BUILD_DIR/src/ending/podium_ceremony_actors.o(.rodata*);
|
||||
BUILD_DIR/src/ending/camera_junk.o(.rodata*);
|
||||
BUILD_DIR/src/ending/code_80281780.o(.rodata*);
|
||||
BUILD_DIR/src/ending/code_80281C40.o(.rodata*);
|
||||
BUILD_DIR/src/ending/credits.jp.o(.rodata*);
|
||||
BUILD_DIR/src/ending/ceremony_and_credits.o(.rodata*);
|
||||
}
|
||||
END_SEG(ending)
|
||||
|
||||
BEGIN_NOLOAD(ending) {
|
||||
BUILD_DIR/src/ending/code_80280000.o(.bss*);
|
||||
BUILD_DIR/src/ending/podium_ceremony_actors.o(.bss*);
|
||||
BUILD_DIR/src/ending/code_80281C40.o(.bss*);
|
||||
BUILD_DIR/src/ending/ceremony_and_credits.o(.bss*);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_NOLOAD(ending)
|
||||
|
||||
/* 0x801978D0 12AAE0-132B50 [8070] */
|
||||
/* texture tables and DLs, set as segment 0x02 */
|
||||
BEGIN_SEG(data_segment2, 0x02000000)
|
||||
{
|
||||
BUILD_DIR/src/data/textures.o(.data);
|
||||
BUILD_DIR/src/data/data_segment2.o(.data);
|
||||
}
|
||||
END_SEG(data_segment2)
|
||||
|
||||
/* 0x02000000 132B50-145470 [12920] (copied to 0x8027B5E0) */
|
||||
/* common textures, decompressed and set as segment 0x0D */
|
||||
BEGIN_SEG(common_textures, 0x0D000000)
|
||||
{
|
||||
BUILD_DIR/assets/code/common_data/common_data.mio0.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(common_textures)
|
||||
|
||||
/* 0x0F000000 145470-63E278 [4F8E08] */
|
||||
/* compressed kart textures and palettes */
|
||||
BEGIN_SEG(kart_textures, 0x0F000000) SUBALIGN(0x10)
|
||||
{
|
||||
BUILD_DIR/data/karts/luigi_kart.o(.data);
|
||||
BUILD_DIR/data/karts/mario_kart.o(.data);
|
||||
BUILD_DIR/data/karts/yoshi_kart.o(.data);
|
||||
BUILD_DIR/data/karts/peach_kart.o(.data);
|
||||
BUILD_DIR/data/karts/wario_kart.o(.data);
|
||||
BUILD_DIR/data/karts/toad_kart.o(.data);
|
||||
BUILD_DIR/data/karts/donkeykong_kart.o(.data);
|
||||
BUILD_DIR/data/karts/bowser_kart.o(.data);
|
||||
BUILD_DIR/courses/staff_ghost_data.o(.data);
|
||||
}
|
||||
END_SEG(kart_textures)
|
||||
|
||||
/* 0x0F000000: 641F70-724220 */
|
||||
BEGIN_SEG(other_textures, 0x0F000000)
|
||||
{
|
||||
BUILD_DIR/data/other_textures.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(other_textures)
|
||||
|
||||
/* 0x802BA370 724220-729A30 [0x5810] */
|
||||
BEGIN_SEG(trigTables, _buffersSegmentNoloadStart)
|
||||
{
|
||||
BUILD_DIR/src/buffers/trig_tables.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(trigTables)
|
||||
|
||||
/* 0x0A000000 729A30-7E684F [BCE20] */
|
||||
BEGIN_SEG(textures_0a, 0x0A000000)
|
||||
{
|
||||
BUILD_DIR/data/course_player_selection.o(.data);
|
||||
BUILD_DIR/data/texture_data_2.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(textures_0a)
|
||||
|
||||
/* 0x0B000000 7FA3C0-821D10 [27950] */
|
||||
BEGIN_SEG(textures_0b, 0x0B000000)
|
||||
{
|
||||
BUILD_DIR/data/texture_tkmk00.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(textures_0b)
|
||||
|
||||
/* TODO: 0x825800 -> 0x8028B230 (0x100) ...
|
||||
0x828400 -> 0x8028DE30 (0xD0) */
|
||||
BEGIN_SEG(ceremonyData, 0x0B000000)
|
||||
{
|
||||
BUILD_DIR/assets/code/ceremony_data/ceremony_data.mio0.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(ceremonyData)
|
||||
|
||||
BEGIN_SEG(startupLogo, 0x06000000)
|
||||
{
|
||||
BUILD_DIR/assets/code/startup_logo/startup_logo.mio0.o(.data);
|
||||
. = ALIGN(0x10);
|
||||
}
|
||||
END_SEG(startupLogo)
|
||||
|
||||
|
||||
/* Segment Six Course Data (Displaylists, models, textures, course paths, etc.) */
|
||||
|
||||
#define COURSE_DATA_SEG(dir, name) \
|
||||
BEGIN_SEG(name##_mio0, 0x06000000) \
|
||||
{ \
|
||||
BUILD_DIR/courses/dir/course_data.mio0.o(.data); \
|
||||
. = ALIGN(0x10); \
|
||||
} \
|
||||
END_SEG(name##_mio0)
|
||||
|
||||
COURSE_DATA_SEG(mario_raceway,course_mario_raceway_dl)
|
||||
COURSE_DATA_SEG(choco_mountain,course_choco_mountain_dl)
|
||||
COURSE_DATA_SEG(bowsers_castle,course_bowsers_castle_dl)
|
||||
COURSE_DATA_SEG(banshee_boardwalk,course_banshee_boardwalk_dl)
|
||||
COURSE_DATA_SEG(yoshi_valley,course_yoshi_valley_dl)
|
||||
COURSE_DATA_SEG(frappe_snowland,course_frappe_snowland_dl)
|
||||
COURSE_DATA_SEG(koopa_troopa_beach,course_koopa_troopa_beach_dl)
|
||||
COURSE_DATA_SEG(royal_raceway,course_royal_raceway_dl)
|
||||
COURSE_DATA_SEG(luigi_raceway,course_luigi_raceway_dl)
|
||||
COURSE_DATA_SEG(moo_moo_farm,course_moo_moo_farm_dl)
|
||||
COURSE_DATA_SEG(toads_turnpike,course_toads_turnpike_dl)
|
||||
COURSE_DATA_SEG(kalimari_desert,course_kalimari_desert_dl)
|
||||
COURSE_DATA_SEG(sherbet_land,course_sherbet_land_dl)
|
||||
COURSE_DATA_SEG(rainbow_road,course_rainbow_road_dl)
|
||||
COURSE_DATA_SEG(wario_stadium,course_wario_stadium_dl)
|
||||
COURSE_DATA_SEG(block_fort,course_block_fort_dl)
|
||||
COURSE_DATA_SEG(skyscraper,course_skyscraper_dl)
|
||||
COURSE_DATA_SEG(double_deck,course_double_deck_dl)
|
||||
COURSE_DATA_SEG(dks_jungle_parkway,course_dks_jungle_parkway_dl)
|
||||
COURSE_DATA_SEG(big_donut,course_big_donut_dl)
|
||||
|
||||
#define COURSE_OFFSETS_SEG(dir, name) \
|
||||
BEGIN_SEG(name, 0x09000000) \
|
||||
{ \
|
||||
BUILD_DIR/courses/dir/course_offsets.o(.data*); \
|
||||
BUILD_DIR/courses/dir/course_offsets.o(.rodata*); \
|
||||
. = ALIGN(0x10); \
|
||||
} \
|
||||
END_SEG(name)
|
||||
|
||||
COURSE_OFFSETS_SEG(mario_raceway,course_mario_raceway_offsets)
|
||||
COURSE_OFFSETS_SEG(choco_mountain,course_choco_mountain_offsets)
|
||||
COURSE_OFFSETS_SEG(bowsers_castle,course_bowsers_castle_offsets)
|
||||
COURSE_OFFSETS_SEG(banshee_boardwalk,course_banshee_boardwalk_offsets)
|
||||
COURSE_OFFSETS_SEG(yoshi_valley,course_yoshi_valley_offsets)
|
||||
COURSE_OFFSETS_SEG(frappe_snowland,course_frappe_snowland_offsets)
|
||||
COURSE_OFFSETS_SEG(koopa_troopa_beach,course_koopa_troopa_beach_offsets)
|
||||
COURSE_OFFSETS_SEG(royal_raceway,course_royal_raceway_offsets)
|
||||
COURSE_OFFSETS_SEG(luigi_raceway,course_luigi_raceway_offsets)
|
||||
COURSE_OFFSETS_SEG(moo_moo_farm,course_moo_moo_farm_offsets)
|
||||
COURSE_OFFSETS_SEG(toads_turnpike,course_toads_turnpike_offsets)
|
||||
COURSE_OFFSETS_SEG(kalimari_desert,course_kalimari_desert_offsets)
|
||||
COURSE_OFFSETS_SEG(sherbet_land,course_sherbet_land_offsets)
|
||||
COURSE_OFFSETS_SEG(rainbow_road,course_rainbow_road_offsets)
|
||||
COURSE_OFFSETS_SEG(wario_stadium,course_wario_stadium_offsets)
|
||||
COURSE_OFFSETS_SEG(block_fort,course_block_fort_offsets)
|
||||
COURSE_OFFSETS_SEG(skyscraper,course_skyscraper_offsets)
|
||||
COURSE_OFFSETS_SEG(double_deck,course_double_deck_offsets)
|
||||
COURSE_OFFSETS_SEG(dks_jungle_parkway,course_dks_jungle_parkway_offsets)
|
||||
COURSE_OFFSETS_SEG(big_donut,course_big_donut_offsets)
|
||||
|
||||
/* Segment 0xF Course Geography (0x4 uncompressed) and Segment 0x7 Packed Displaylists */
|
||||
|
||||
#define COURSE_VERT_SEG(dir, name) \
|
||||
BEGIN_SEG(name, 0x0F000000) \
|
||||
{ \
|
||||
BUILD_DIR/courses/dir/course_geography.mio0.o(.data); \
|
||||
. = ALIGN(0x10); \
|
||||
} \
|
||||
END_SEG(name)
|
||||
|
||||
COURSE_VERT_SEG(mario_raceway,mario_raceway_vertex)
|
||||
COURSE_VERT_SEG(choco_mountain,choco_mountain_vertex)
|
||||
COURSE_VERT_SEG(bowsers_castle,bowsers_castle_vertex)
|
||||
COURSE_VERT_SEG(banshee_boardwalk,banshee_boardwalk_vertex)
|
||||
COURSE_VERT_SEG(yoshi_valley,yoshi_valley_vertex)
|
||||
COURSE_VERT_SEG(frappe_snowland,frappe_snowland_vertex)
|
||||
COURSE_VERT_SEG(koopa_troopa_beach,koopa_troopa_beach_vertex)
|
||||
COURSE_VERT_SEG(royal_raceway,royal_raceway_vertex)
|
||||
COURSE_VERT_SEG(luigi_raceway,luigi_raceway_vertex)
|
||||
COURSE_VERT_SEG(moo_moo_farm,moo_moo_farm_vertex)
|
||||
COURSE_VERT_SEG(toads_turnpike,toads_turnpike_vertex)
|
||||
COURSE_VERT_SEG(kalimari_desert,kalimari_desert_vertex)
|
||||
COURSE_VERT_SEG(sherbet_land,sherbet_land_vertex)
|
||||
COURSE_VERT_SEG(rainbow_road,rainbow_road_vertex)
|
||||
COURSE_VERT_SEG(wario_stadium,wario_stadium_vertex)
|
||||
COURSE_VERT_SEG(block_fort,block_fort_vertex)
|
||||
COURSE_VERT_SEG(skyscraper,skyscraper_vertex)
|
||||
COURSE_VERT_SEG(double_deck,double_deck_vertex)
|
||||
COURSE_VERT_SEG(dks_jungle_parkway,dks_jungle_parkway_vertex)
|
||||
COURSE_VERT_SEG(big_donut,big_donut_vertex)
|
||||
|
||||
BEGIN_SEG(audio_banks, 0x0)
|
||||
{
|
||||
BUILD_DIR/data/sound_data/audiobanks.o(.data);
|
||||
}
|
||||
END_SEG(audio_banks)
|
||||
BEGIN_SEG(audio_tables, 0x13840)
|
||||
{
|
||||
BUILD_DIR/data/sound_data/audiotables.o(.data);
|
||||
}
|
||||
END_SEG(audio_tables)
|
||||
BEGIN_SEG(sequences, 0x25FD00)
|
||||
{
|
||||
#ifdef VERSION_EU
|
||||
BUILD_DIR/data/sound_data/sequences_eu.o(.data);
|
||||
#else
|
||||
BUILD_DIR/data/sound_data/sequences.o(.data);
|
||||
#endif
|
||||
}
|
||||
END_SEG(sequences)
|
||||
BEGIN_SEG(instrument_sets, 0x282E80)
|
||||
{
|
||||
#ifdef VERSION_EU
|
||||
. += 0x20;
|
||||
#endif
|
||||
BUILD_DIR/data/sound_data/instrument_sets.o(.data);
|
||||
}
|
||||
END_SEG(instrument_sets)
|
||||
|
||||
/* Discard everything not specifically mentioned above. */
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(*);
|
||||
}
|
||||
|
||||
ASSERT((_mainSegmentNoloadEnd <= _memoryPoolSegmentNoloadStart), "Error: Main segment extended into the memory pool.")
|
||||
ASSERT((_memoryPoolSegmentNoloadEnd <= _endingSegmentStart), "Error: Memory pool extended into the ending segment.")
|
||||
ASSERT((_endingSegmentNoloadEnd <= _racingSegmentStart), "Error: Ending segment extended into the racing segment")
|
||||
ASSERT((_endingSegmentNoloadEnd <= _racingSegmentStart), "Error: Ending segment extended into the racing segment.")
|
||||
ASSERT((_racingSegmentNoloadEnd <= _buffersSegmentNoloadStart), "Error: Racing segment extended into the buffers segment.")
|
||||
ASSERT((_buffersSegmentNoloadEnd <= RDRAM_END), "Error: Buffers segment extended past 8MB of memory")
|
||||
ASSERT((_buffersSegmentNoloadEnd <= RDRAM_END), "Error: Buffers segment extended into trig tables segment.")
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
579c48e211ae952530ffc8738709f078d5dd215e build/us/mk64.us.z64
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# note, this quick hack only works with three arguments.
|
||||
# if you're trying to use four arguments, you need to add another `$4` etc.
|
||||
|
||||
python3 tools/decomp-permuter/permuter.py $1 $2 $3
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Optional configuration file for import.py. Put it in the root or in tools/
|
||||
# of the repo you are importing from.
|
||||
|
||||
compiler_type = "ido"
|
||||
|
||||
[decompme.compilers]
|
||||
"tools/ido-recomp/linux/cc" = "ido5.3"
|
||||
|
||||
[preserve_macros]
|
||||
"gs?DP.*" = "void"
|
||||
"gs?SP.*" = "void"
|
||||
"G_.*" = "int"
|
||||
"VIRTUAL_.*" = "unsigned int"
|
||||
"PHYSICAL_.*" = "unsigned int"
|
||||
"TIME_TRIAL_.*" = "int"
|
||||
"TEXT_.*" = "int"
|
||||
"OS_.*" = "int"
|
||||
"SEGMENT_.*" = "int"
|
||||
"ACTOR_.*" = "int"
|
||||
"A_[A-Z]+" = "int"
|
||||
"a[A-Za-z]+" = "void"
|
||||
"_SHIFT[LR]" = "void"
|
||||
"ALIGN.*" = "int"
|
||||
"aClearBuffer" = "void"
|
||||
"aEnvSetup1" = "void"
|
||||
"aEnvSetup2" = "void"
|
||||
"aEnvMixer" = "void"
|
||||
+10
-10
@@ -21,10 +21,10 @@ void convert_to_fixed_point_matrix_animation(Mtx* dest, Mat4 src) {
|
||||
guMtxF2L(src, dest);
|
||||
#else
|
||||
s32 asFixedPoint;
|
||||
register s32 i;
|
||||
register s16* a3 = (s16*) dest; // all integer parts stored in first 16 bytes
|
||||
register s16* t0 = (s16*) dest + 16; // all fraction parts stored in last 16 bytes
|
||||
register f32* t1 = (f32*) src;
|
||||
s32 i;
|
||||
s16* a3 = (s16*) dest; // all integer parts stored in first 16 bytes
|
||||
s16* t0 = (s16*) dest + 16; // all fraction parts stored in last 16 bytes
|
||||
f32* t1 = (f32*) src;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
asFixedPoint = *t1++ * (1 << 16); //! float-to-integer conversion responsible for PU crashes
|
||||
@@ -35,14 +35,14 @@ void convert_to_fixed_point_matrix_animation(Mtx* dest, Mat4 src) {
|
||||
}
|
||||
|
||||
void mtxf_translate_rotate2(Mat4 dest, Vec3f pos, Vec3s angle) {
|
||||
register f32 sx = sins(angle[0]);
|
||||
register f32 cx = coss(angle[0]);
|
||||
f32 sx = sins(angle[0]);
|
||||
f32 cx = coss(angle[0]);
|
||||
|
||||
register f32 sy = sins(angle[1]);
|
||||
register f32 cy = coss(angle[1]);
|
||||
f32 sy = sins(angle[1]);
|
||||
f32 cy = coss(angle[1]);
|
||||
|
||||
register f32 sz = sins(angle[2]);
|
||||
register f32 cz = coss(angle[2]);
|
||||
f32 sz = sins(angle[2]);
|
||||
f32 cz = coss(angle[2]);
|
||||
|
||||
dest[0][0] = cy * cz;
|
||||
dest[0][1] = cy * sz;
|
||||
|
||||
@@ -339,7 +339,7 @@ void WarioStadium::Render(struct UnkStruct_800DC5EC* arg0) {
|
||||
prevFrame = 0;
|
||||
}
|
||||
currentScreenSection++;
|
||||
if (currentScreenSection > 5) {
|
||||
if (currentScreenSection >= 6) {
|
||||
currentScreenSection = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
#include "SpaghettiGui.h"
|
||||
#include <libultraship/src/window/gui/Gui.h>
|
||||
#include <libultraship/src/window/Window.h>
|
||||
#ifdef __SWITCH__
|
||||
#include "ConfigVersion.h"
|
||||
#else
|
||||
#include "Config.h"
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <SDL_hints.h>
|
||||
|
||||
@@ -35,30 +35,30 @@ void FB_CreateFramebuffers(void) {
|
||||
* sure f3dex2 is loaded before this function is called.
|
||||
*/
|
||||
void FB_CopyToFramebuffer(Gfx** gfxP, s32 fb_src, s32 fb_dest, u8 oncePerFrame, u8* hasCopied) {
|
||||
// Gfx* gfx = *gfxP;
|
||||
Gfx* gfx = *gfxP;
|
||||
|
||||
// gSPMatrix(gfx++, &gIdentityMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPMatrix(gfx++, &gIdentityMatrix, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
// gDPSetOtherMode(gfx++,
|
||||
// G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
// G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
// G_AC_NONE | G_ZS_PRIM | G_RM_OPA_SURF | G_RM_OPA_SURF2);
|
||||
gDPSetOtherMode(gfx++,
|
||||
G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PRIM | G_RM_OPA_SURF | G_RM_OPA_SURF2);
|
||||
|
||||
// gSPClearGeometryMode(gfx++, G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
|
||||
// gSPSetGeometryMode(gfx++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH);
|
||||
gSPClearGeometryMode(gfx++, G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR);
|
||||
gSPSetGeometryMode(gfx++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH);
|
||||
|
||||
// gDPSetBlendColor(gfx++, 255, 255, 255, 8);
|
||||
// gDPSetPrimDepth(gfx++, 0xFFFF, 0xFFFF);
|
||||
gDPSetBlendColor(gfx++, 255, 255, 255, 8);
|
||||
gDPSetPrimDepth(gfx++, 0xFFFF, 0xFFFF);
|
||||
|
||||
// gDPSetEnvColor(gfx++, 255, 255, 255, 255);
|
||||
// gDPSetCombineLERP(gfx++, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0,
|
||||
// ENVIRONMENT);
|
||||
gDPSetEnvColor(gfx++, 255, 255, 255, 255);
|
||||
gDPSetCombineLERP(gfx++, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0,
|
||||
ENVIRONMENT);
|
||||
|
||||
// gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
|
||||
// gDPCopyFB(gfx++, fb_dest, fb_src, oncePerFrame, hasCopied);
|
||||
gDPCopyFB(gfx++, fb_dest, fb_src, oncePerFrame, hasCopied);
|
||||
|
||||
// *gfxP = gfx;
|
||||
*gfxP = gfx;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
Submodule torch updated: 9d508fc94c...8e56ea0294
@@ -1,48 +0,0 @@
|
||||
/* libultra OS symbols */
|
||||
|
||||
/* boot and osException symbols */
|
||||
/* most of these should be in hardware.h */
|
||||
|
||||
/* exceptions */
|
||||
|
||||
EXCEPTION_TLB_MISS = 0x80000000;
|
||||
|
||||
/* SP */
|
||||
|
||||
SP_DMEM = 0xA4000000;
|
||||
SP_DMEM_UNK0 = 0xA40004C0;
|
||||
SP_DMEM_UNK1 = 0xA4000774;
|
||||
SP_IMEM = 0xA4001000;
|
||||
|
||||
/* Unknown */
|
||||
|
||||
D_B0000008 = 0xB0000008;
|
||||
D_B0000010 = 0xB0000010;
|
||||
D_B0000014 = 0xB0000014;
|
||||
D_C0000000 = 0xC0000000;
|
||||
D_C0000008 = 0xC0000008;
|
||||
D_C000000C = 0xC000000C;
|
||||
|
||||
D_000FFF00 = 0x000FFF00;
|
||||
|
||||
D_03004000 = 0x03004000;
|
||||
D_03004800 = 0x03004800;
|
||||
D_03005000 = 0x03005000;
|
||||
D_03005800 = 0x03005800;
|
||||
D_03006000 = 0x03006000;
|
||||
D_03006800 = 0x03006800;
|
||||
D_03007000 = 0x03007000;
|
||||
D_03007800 = 0x03007800;
|
||||
D_03008000 = 0x03008000;
|
||||
D_03008800 = 0x03008800;
|
||||
|
||||
D_05FF8DB8 = 0x05FF8DB8;
|
||||
|
||||
D_0B002A00 = 0x0B002A00;
|
||||
|
||||
D_A5000508 = 0xA5000508;
|
||||
D_A5000510 = 0xA5000510;
|
||||
D_E6FFFFFC = 0xE6FFFFFC;
|
||||
D_FA00000C = 0xFA00000C;
|
||||
D_FA000010 = 0xFA000010;
|
||||
D_FA000018 = 0xFA000018;
|
||||
@@ -1,24 +0,0 @@
|
||||
# util.mk - Miscellaneous utility functions for use in Makefiles
|
||||
|
||||
# Throws an error if the value of the variable named by $(1) is not in the list given by $(2)
|
||||
define validate-option
|
||||
# value must be part of the list
|
||||
ifeq ($$(filter $($(1)),$(2)),)
|
||||
$$(error Value of $(1) must be one of the following: $(2))
|
||||
endif
|
||||
# value must be a single word (no whitespace)
|
||||
ifneq ($$(words $($(1))),1)
|
||||
$$(error Value of $(1) must be one of the following: $(2))
|
||||
endif
|
||||
endef
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
NULL_OUT := nul
|
||||
else
|
||||
NULL_OUT = /dev/null
|
||||
endif
|
||||
# Returns the path to the command $(1) if exists. Otherwise returns an empty string.
|
||||
find-command = $(shell which $(1) 2> $(NULL_OUT))
|
||||
|
||||
# recursive wildcard
|
||||
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
|
||||
Reference in New Issue
Block a user