SuperMarioOdysseyOnline/MakefileNSO
Amethyst-szs 7fa8c659e1
new: custom boot screen before main menu
- Show "SMOO made by CraftyBoss" for about 5 seconds
- Then show "Freeze-Tag & Sardines made by Amethyst-szs" for about 5 seconds.
- This does only overlay the game starting normally and does not slow down the process additionally.

---

Changes compared to the original cherry-picked version:
- Put all into the speedboot namespace instead of only a few things.
- Don't load into the game, but stay in the main menu
  - (Because of issues with new save files)
- Added text: "Made by CraftyBoss"
- Added text: "& Sardines"
- Speed up transition animation between the two screens
  - (Because it is now shown for a shorter total time)

Instead of directly (speed)booting into the game like in the original cherry-picked commit, this stays in the main menu.
The original behavior can be restored by setting `speedbootAutoload` to `true` inside `BootHooks.cpp`.

This is to prevent issues with new empty save files.
They normally don't get to the main menu but to an extra menu that now is invisible behind the custom boot screen.
The game doesn't load automatically then but the player needs to blindly navigate the invisible menu to start the game.
Till Cap Kingdom is fully loaded only the custom boot screen is visible (e.g. during the first cutscene video).

(cherry picked from commit c1eac0852eb839560dbc2ccafe373176c9911684)

Co-authored-by: Robin C. Ladiges <rcl.git@blackpinguin.de>
2024-10-27 00:44:02 +02:00

192 lines
7.1 KiB
Text

#---------------------------------------------------------------------------------
# Starlight-specific
# SMOVER is the target version of Super Mario Odyssey, but without the decimal points
# This can be changed by compiling for a different version (e.g. make 100)
# (used for C defines, filenames, etc)
# (used for user-facing stuff)
# LINKERSCRIPTS is the directory where the function addresses for Super Mario Odyssey are
# stored
# Each script is stored as syms$(SMOVER).ld
# (used for mapping Super Mario Odyssey functions to the proper address)
#---------------------------------------------------------------------------------
LINKERSCRIPTS := linkerscripts
#---------------------------------------------------------------------------------
#.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
#---------------------------------------------------------------------------------
TARGET ?= $(notdir $(CURDIR))$(SMOVER)
BUILD ?= build$(SMOVER)
SOURCES := \
source/sead/time \
source/sead \
source/puppets \
source/speedboot \
source/server/hns \
source/server/sardines \
source/server/freeze-tag \
source/server/gamemode \
source/server/gamemode/modifiers \
source/server \
source/layouts \
source/states \
source/cameras \
source/nx \
source
SOURCES += source/al/execute
DATA := data
INCLUDES := include include/sead
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec
CFLAGS := -g -Wall -ffunction-sections \
$(ARCH) $(DEFINES)
CFLAGS += $(INCLUDE) -D__SWITCH__ -DSMOVER=$(SMOVER) -O3 -DNNSDK -DSWITCH -DBUILDVERSTR=$(BUILDVERSTR) -DBUILDVER=$(BUILDVER) -DDEBUGLOG=$(DEBUGLOG) -DSERVERIP=$(SERVERIP) -DEMU=$(EMU)
CXXFLAGS := $(CFLAGS) -Wno-invalid-offsetof -Wno-volatile -fno-rtti -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -std=gnu++20
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=../switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) -Wl,--version-script=$(TOPDIR)/exported.txt -Wl,-init=__custom_init -Wl,-fini=__custom_fini -nostdlib
LIBS :=
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR ?= $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
ifeq ($(strip $(ICON)),)
icons := $(wildcard *.jpg)
ifneq (,$(findstring $(TARGET).jpg,$(icons)))
export APP_ICON := $(TOPDIR)/$(TARGET).jpg
else
ifneq (,$(findstring icon.jpg,$(icons)))
export APP_ICON := $(TOPDIR)/icon.jpg
endif
endif
else
export APP_ICON := $(TOPDIR)/$(ICON)
endif
ifeq ($(strip $(NO_ICON)),)
export NROFLAGS += --icon=$(APP_ICON)
endif
ifeq ($(strip $(NO_NACP)),)
export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp
endif
.PHONY: $(BUILD) clean all
#---------------------------------------------------------------------------------
all: $(BUILD)
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@cp $(LINKERSCRIPTS)/syms$(SMOVER).ld $(LINKERSCRIPTS)/symstemp.ld # This is required because you can't pass a variable to the .specs
$(MAKE) -C $(BUILD) -f $(CURDIR)/MakefileNSO
@rm -f $(LINKERSCRIPTS)/symstemp.ld
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr build* *.nso *.elf
#---------------------------------------------------------------------------------
else
.PHONY: all
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
%.nso: %.elf
@elf2nso $< $@
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
all : $(OUTPUT).nso
$(OUTPUT).elf : $(OFILES)
$(OFILES_SRC) : $(HFILES_BIN)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------