Skip to content
This repository was archived by the owner on Jun 30, 2020. It is now read-only.

Commit 8f9464f

Browse files
committed
Initial release
1 parent a18c59e commit 8f9464f

179 files changed

Lines changed: 43409 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# TODO (Khangaroo): Make this process a lot less hacky (no, export did not work)
2+
# See MakefileNSO
3+
4+
.PHONY: all clean skyline skyline_patch send
5+
6+
CROSSVER ?= 111
7+
IP ?= 192.168.1.8
8+
9+
all: skyline skyline_patch send
10+
11+
skyline:
12+
$(MAKE) all -f MakefileNSO CROSSVER=$(CROSSVER)
13+
14+
skyline_patch: patches/*.slpatch patches/configs/$(CROSSVER).config patches/maps/$(CROSSVER)/*.map \
15+
build$(CROSSVER)/$(shell basename $(CURDIR))$(CROSSVER).map scripts/genPatch.py
16+
@rm -f aldebaran_patch_$(CROSSVER)/*.ips
17+
python3 scripts/genPatch.py $(CROSSVER)
18+
19+
send: all
20+
python3 scripts/sendPatch.py $(IP) $(CROSSVER)
21+
22+
clean:
23+
$(MAKE) clean -f MakefileNSO
24+
@rm -fr aldebaran_patch_*

MakefileNSO

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
#---------------------------------------------------------------------------------
2+
# Starlight-specific
3+
# CROSSVER is the target version of SSBU, but without the decimal points
4+
# This can be changed by compiling for a different version (e.g. make 600)
5+
# (used for C defines, filenames, etc)
6+
# LINKERSCRIPTS is the directory where the function addresses for Splatoon 2 are
7+
# stored
8+
# Each script is stored as syms$(CROSSVER).ld
9+
# (used for mapping SSBU functions to the proper address)
10+
#---------------------------------------------------------------------------------
11+
12+
LINKERSCRIPTS := linkerscripts
13+
14+
#---------------------------------------------------------------------------------
15+
#.SUFFIXES:
16+
#---------------------------------------------------------------------------------
17+
18+
ifeq ($(strip $(DEVKITPRO)),)
19+
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
20+
endif
21+
22+
TOPDIR ?= $(CURDIR)
23+
include $(DEVKITPRO)/libnx/switch_rules
24+
25+
#---------------------------------------------------------------------------------
26+
# TARGET is the name of the output
27+
# BUILD is the directory where object files & intermediate files will be placed
28+
# SOURCES is a list of directories containing source code
29+
# DATA is a list of directories containing data files
30+
# INCLUDES is a list of directories containing header files
31+
#---------------------------------------------------------------------------------
32+
TARGET ?= $(notdir $(CURDIR))$(CROSSVER)
33+
BUILD ?= build$(CROSSVER)
34+
SOURCES := source \
35+
source/skyline \
36+
source/skyline/nx \
37+
source/skyline/nx/arm \
38+
source/skyline/nx/kernel \
39+
source/skyline/nx/runtime \
40+
source/skyline/nx/sf \
41+
source/skyline/inlinehook \
42+
source/skyline/logger \
43+
source/skyline/utils \
44+
source/skyline/arc \
45+
source/skyline/plugin
46+
DATA := data
47+
INCLUDES := include
48+
49+
#---------------------------------------------------------------------------------
50+
# options for code generation
51+
#---------------------------------------------------------------------------------
52+
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec
53+
54+
CFLAGS := -g -Wall -ffunction-sections \
55+
$(ARCH) $(DEFINES)
56+
57+
CFLAGS += $(INCLUDE) -D__SWITCH__ -DCROSSVER=$(CROSSVER)
58+
59+
CXXFLAGS := $(CFLAGS) -fno-rtti -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables -enable-libstdcxx-allocator=new -fpermissive
60+
61+
ASFLAGS := -g $(ARCH)
62+
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
63+
64+
65+
LIBS := -lgcc -lstdc++ -u malloc
66+
67+
#---------------------------------------------------------------------------------
68+
# list of directories containing libraries, this must be the top level containing
69+
# include and lib
70+
#---------------------------------------------------------------------------------
71+
LIBDIRS := $(PORTLIBS) $(LIBNX)
72+
73+
#---------------------------------------------------------------------------------
74+
# no real need to edit anything past this point unless you need to add additional
75+
# rules for different file extensions
76+
#---------------------------------------------------------------------------------
77+
ifneq ($(BUILD),$(notdir $(CURDIR)))
78+
#---------------------------------------------------------------------------------
79+
80+
export OUTPUT := $(CURDIR)/$(TARGET)
81+
export TOPDIR := $(CURDIR)
82+
83+
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
84+
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
85+
86+
export DEPSDIR ?= $(CURDIR)/$(BUILD)
87+
88+
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
89+
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
90+
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
91+
92+
#---------------------------------------------------------------------------------
93+
# use CXX for linking C++ projects, CC for standard C
94+
#---------------------------------------------------------------------------------
95+
ifeq ($(strip $(CPPFILES)),)
96+
#---------------------------------------------------------------------------------
97+
export LD := $(CC)
98+
#---------------------------------------------------------------------------------
99+
else
100+
#---------------------------------------------------------------------------------
101+
export LD := $(CXX)
102+
#---------------------------------------------------------------------------------
103+
endif
104+
#---------------------------------------------------------------------------------
105+
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
106+
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
107+
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
108+
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
109+
110+
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
111+
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
112+
-I$(CURDIR)/$(BUILD)
113+
114+
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
115+
116+
ifeq ($(strip $(ICON)),)
117+
icons := $(wildcard *.jpg)
118+
ifneq (,$(findstring $(TARGET).jpg,$(icons)))
119+
export APP_ICON := $(TOPDIR)/$(TARGET).jpg
120+
else
121+
ifneq (,$(findstring icon.jpg,$(icons)))
122+
export APP_ICON := $(TOPDIR)/icon.jpg
123+
endif
124+
endif
125+
else
126+
export APP_ICON := $(TOPDIR)/$(ICON)
127+
endif
128+
129+
ifeq ($(strip $(NO_ICON)),)
130+
export NROFLAGS += --icon=$(APP_ICON)
131+
endif
132+
133+
ifeq ($(strip $(NO_NACP)),)
134+
export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp
135+
endif
136+
137+
.PHONY: $(BUILD) clean all
138+
139+
#---------------------------------------------------------------------------------
140+
141+
all: $(BUILD)
142+
143+
$(BUILD):
144+
@echo "${SOURCES}"
145+
@echo "${CPPFILES}"
146+
@[ -d $@ ] || mkdir -p $@
147+
@cp $(LINKERSCRIPTS)/syms$(CROSSVER).ld $(LINKERSCRIPTS)/symstemp.ld # This is required because you can't pass a variable to the .specs
148+
$(MAKE) -C $(BUILD) -f $(CURDIR)/MakefileNSO
149+
@rm -f $(LINKERSCRIPTS)/symstemp.ld
150+
151+
#---------------------------------------------------------------------------------
152+
clean:
153+
@echo clean ...
154+
@rm -fr build* *.nso *.elf
155+
156+
157+
#---------------------------------------------------------------------------------
158+
else
159+
.PHONY: all
160+
161+
DEPENDS := $(OFILES:.o=.d)
162+
163+
#---------------------------------------------------------------------------------
164+
# main targets
165+
#---------------------------------------------------------------------------------
166+
%.nso: %.elf
167+
@elf2nso $< $@
168+
@echo built ... $(notdir $@)
169+
170+
%.nro: %.elf
171+
@elf2nro $< $@ $(NROFLAGS)
172+
@echo built ... $(notdir $@)
173+
174+
#---------------------------------------------------------------------------------
175+
all : $(OUTPUT).nso
176+
177+
$(OUTPUT).elf : $(OFILES)
178+
179+
180+
$(OFILES_SRC) : $(HFILES_BIN)
181+
182+
#---------------------------------------------------------------------------------
183+
# you need a rule like this for each extension you use as binary data
184+
#---------------------------------------------------------------------------------
185+
%.bin.o %_bin.h : %.bin
186+
#---------------------------------------------------------------------------------
187+
@echo $(notdir $<)
188+
@$(bin2o)
189+
190+
-include $(DEPENDS)
191+
192+
#---------------------------------------------------------------------------------------
193+
endif
194+
#---------------------------------------------------------------------------------------

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
# Aldebaran
2-
????
1+
# Aldebaran, based on [Skyline](https://github.com/shadowninja108/Skyline)
2+
An environment for linking, runtime hooking and code patching in Fire Emblem Three Houses. Fork of Skyline, a modding framework for Super Smash Bros Ultimate.
3+
4+
# Why the rename?
5+
To make sure people make the distinction between the original Skyline and the FETH fork. Also serves to make a distinction with Starfall, the previous modding environment based on Starlight.
6+
7+
# Current limitations
8+
- Consider this WIP and rushed
9+
- TCP logging needs to be configurable
10+
11+
# How to install
12+
- Put the content of the archive at the root of your SD
13+
- Put the files you want to replace in sd:/Aldebaran/forge/, with the entry ID as the name in decimal and no extension. (Like Starfall)
14+
15+
# Maintainers (Aldebaran)
16+
- [Raytwo](https://github.com/Raytwo)
17+
18+
# Contributors (Skyline)
19+
This project is derived from OdysseyReversed and Starlight
20+
- [3096](https://github.com/3096)
21+
- [khang06](https://github.com/khang06)
22+
- [OatmealDome](https://github.com/OatmealDome)
23+
- [Random0666](https://github.com/random0666)
24+
- [shadowninja108](https://github.com/shadowninja108)
25+
- [shibbo](https://github.com/shibbo) - Repo derived from their work on OdysseyReversed
26+
- [Thog](https://github.com/Thog) - Expertise in how rtld is implemented
27+
- [jakibaki ](https://github.com/jakibaki) - Advice with numerous things, including runtime hooking
28+
29+
# Credits
30+
- devkitA64
31+
- libnx - switch build rules

exported.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
global:
3+
__custom_init;
4+
__custom_fini;
5+
_init;
6+
7+
8+
local: *;
9+
};

0 commit comments

Comments
 (0)