From 1408a4f03719342d8ff9864e1f7e161acb2ff7a5 Mon Sep 17 00:00:00 2001 From: Michael Zhao <44533763+Pistonight@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:46:05 -0800 Subject: [PATCH] megaton (#18) * remove exlaunch * update botw-symbols * use libmegaton * update check section --- .gitmodules | 4 ---- Megaton.toml | 15 +-------------- Taskfile.yml | 2 +- libs/botw-symbols | 2 +- libs/exlaunch | 1 - src/core/controller.hpp | 2 +- src/core/reporter.hpp | 2 +- src/core/state.hpp | 2 +- src/core/time.hpp | 5 ++--- src/core/worker.hpp | 2 +- src/impl/raw_ptr.hpp | 2 +- src/main.cpp | 7 ++----- 12 files changed, 12 insertions(+), 34 deletions(-) delete mode 160000 libs/exlaunch diff --git a/.gitmodules b/.gitmodules index 8ce1d0d..1dc0fd3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,7 +14,3 @@ path = libs/sead url = https://github.com/open-ead/sead branch = master -[submodule "exlaunch"] - path = libs/exlaunch - url = https://github.com/Pistonight/exlaunch - branch = dev diff --git a/Megaton.toml b/Megaton.toml index b1b7e02..c498db9 100644 --- a/Megaton.toml +++ b/Megaton.toml @@ -4,10 +4,8 @@ title-id = 0x01007ef00011e000 # make configuration [build] -entry = "exl_module_init" sources = [ "src", - "libs/exlaunch/source", "libs/botw-symbols/src", ] includes = [ @@ -15,13 +13,11 @@ includes = [ "libs/botw/src", "libs/botw/lib/agl/include", "libs/botw/lib/gsys/include", - "libs/botw-symbols/src", - "libs/exlaunch/source", + "libs/botw-symbols/include", "libs/sead/include", "libs/nnheaders/include", ] ldscripts = [ - "libs/exlaunch/misc/link.ld", "libs/botw-symbols/ld/ld160.ld", "libs/botw-symbols/ld/toolkit160.ld", ] @@ -32,11 +28,6 @@ c = [ "-DNNSDK", "-DSWITCH", "-D__SWITCH__", - "-DEXL_DEBUG", - "-DEXL_LOAD_KIND_ENUM=2", - "-DEXL_LOAD_KIND=Module", - "-DEXL_PROGRAM_ID=0x01007ef00011e000", - "-DEXL_MODULE_NAME=\"botwsavs\"", "-DNN_SDK_MAJOR=7", "-DNN_SDK_MINOR=3", "-DNN_SDK_PATCH=2", @@ -56,10 +47,6 @@ c = [ ] [check] -ignore = [ - ".data", - ".text", -] symbols = [ "libs/botw-symbols/symbols/160/main.syms", "libs/botw-symbols/symbols/160/rtld.syms", diff --git a/Taskfile.yml b/Taskfile.yml index ff9018d..cb88311 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -17,7 +17,7 @@ tasks: aliases: [b] desc: Build the mod cmds: - - megaton -p debug + - megaton build -p debug check: desc: Check code for errors diff --git a/libs/botw-symbols b/libs/botw-symbols index ad47183..b7e8b80 160000 --- a/libs/botw-symbols +++ b/libs/botw-symbols @@ -1 +1 @@ -Subproject commit ad47183887ac78cabe138e2169d6bc3e4e8c017c +Subproject commit b7e8b80683933843c07d1f33e21a5fba2afcb246 diff --git a/libs/exlaunch b/libs/exlaunch deleted file mode 160000 index bd92c85..0000000 --- a/libs/exlaunch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bd92c85f2a6168841b7d7ce5e335b52974a0a049 diff --git a/src/core/controller.hpp b/src/core/controller.hpp index 1a11626..f6df08e 100644 --- a/src/core/controller.hpp +++ b/src/core/controller.hpp @@ -1,6 +1,6 @@ #pragma once +#include -#include #include #include #include diff --git a/src/core/reporter.hpp b/src/core/reporter.hpp index 1c0bee8..6cbfd31 100644 --- a/src/core/reporter.hpp +++ b/src/core/reporter.hpp @@ -1,7 +1,7 @@ #pragma once +#include #include -#include #include namespace botw::savs { diff --git a/src/core/state.hpp b/src/core/state.hpp index a6b171a..4b96a1d 100644 --- a/src/core/state.hpp +++ b/src/core/state.hpp @@ -1,6 +1,6 @@ #pragma once +#include -#include #include #include #include diff --git a/src/core/time.hpp b/src/core/time.hpp index 03d933f..f8e57d3 100644 --- a/src/core/time.hpp +++ b/src/core/time.hpp @@ -1,10 +1,9 @@ #pragma once - -#include +#include namespace botw::savs::time { -inline float ticks_to_secs_f32(u32 ticks) { +inline f32 ticks_to_secs_f32(u32 ticks) { // 1 tick = 3 frames // 1s = 30 frames = 10 ticks return ticks / 10.0F; diff --git a/src/core/worker.hpp b/src/core/worker.hpp index c814354..e7ffaca 100644 --- a/src/core/worker.hpp +++ b/src/core/worker.hpp @@ -1,8 +1,8 @@ #pragma once +#include #include "core/controller.hpp" #include "core/state.hpp" -#include namespace botw::savs { diff --git a/src/impl/raw_ptr.hpp b/src/impl/raw_ptr.hpp index d4ea222..88c159c 100644 --- a/src/impl/raw_ptr.hpp +++ b/src/impl/raw_ptr.hpp @@ -5,7 +5,7 @@ * from the research. */ #pragma once -#include +#include #include #include diff --git a/src/main.cpp b/src/main.cpp index 1ca4352..593f987 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -7,8 +7,7 @@ #include "core/worker.hpp" -extern "C" void exl_main(void* x0, void* x1) { - exl::hook::Initialize(); +extern "C" void megaton_main() { nn::fs::MountSdCardForDebug("sd"); botw::msg::info::init(); @@ -18,5 +17,3 @@ extern "C" void exl_main(void* x0, void* x1) { botw::savs::start_worker_thread(); } - -extern "C" NORETURN void exl_exception_entry() { EXL_ABORT(0x420); }