Skip to content

Commit

Permalink
megaton (#18)
Browse files Browse the repository at this point in the history
* remove exlaunch

* update botw-symbols

* use libmegaton

* update check section
  • Loading branch information
Pistonight authored Nov 10, 2024
1 parent bbf4532 commit 1408a4f
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 34 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 1 addition & 14 deletions Megaton.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@ title-id = 0x01007ef00011e000

# make configuration
[build]
entry = "exl_module_init"
sources = [
"src",
"libs/exlaunch/source",
"libs/botw-symbols/src",
]
includes = [
"src",
"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",
]
Expand All @@ -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",
Expand All @@ -56,10 +47,6 @@ c = [
]

[check]
ignore = [
".data",
".text",
]
symbols = [
"libs/botw-symbols/symbols/160/main.syms",
"libs/botw-symbols/symbols/160/rtld.syms",
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion libs/exlaunch
Submodule exlaunch deleted from bd92c8
2 changes: 1 addition & 1 deletion src/core/controller.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <megaton/prelude.h>

#include <exl/types.h>
#include <toolkit/io/data_reader.hpp>
#include <toolkit/io/data_writer.hpp>
#include <toolkit/mem/string.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/core/reporter.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <megaton/prelude.h>

#include <algorithm>
#include <exl/types.h>
#include <toolkit/mem/string.hpp>

namespace botw::savs {
Expand Down
2 changes: 1 addition & 1 deletion src/core/state.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <megaton/prelude.h>

#include <exl/types.h>
#include <toolkit/io/data_reader.hpp>
#include <toolkit/io/data_writer.hpp>
#include <toolkit/pmdm.hpp>
Expand Down
5 changes: 2 additions & 3 deletions src/core/time.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#pragma once

#include <exl/types.h>
#include <megaton/prelude.h>

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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/worker.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include <megaton/prelude.h>

#include "core/controller.hpp"
#include "core/state.hpp"
#include <exl/types.h>

namespace botw::savs {

Expand Down
2 changes: 1 addition & 1 deletion src/impl/raw_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* from the research.
*/
#pragma once
#include <exl/types.h>
#include <megaton/prelude.h>
#include <toolkit/mem/mem_ptr.hpp>
#include <toolkit/mem/safe_ptr.hpp>

Expand Down
7 changes: 2 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <exl/lib.hpp>
#include <megaton/prelude.h>
#include <nn/fs.h>
#include <toolkit/equipment.hpp>
#include <toolkit/msg/info.hpp>
Expand All @@ -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();
Expand All @@ -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); }

0 comments on commit 1408a4f

Please sign in to comment.