-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use rune mgr to save/restore runes (#21)
- Loading branch information
1 parent
928945d
commit 32f2bfa
Showing
9 changed files
with
79 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <toolkit/scoped_lock.hpp> | ||
|
||
#include "rune.hpp" | ||
|
||
extern "C" { | ||
|
||
// 0x02C9A668 | ||
extern botw::savs::RuneMgr* botw_savs__RuneMgr; | ||
} | ||
|
||
namespace botw::savs { | ||
|
||
RuneMgr* RuneMgr::get_instance() { return botw_savs__RuneMgr; } | ||
|
||
void RuneMgr::set_current(u32 rune_type) { | ||
toolkit::ScopedLock lock(&item_cs.mCriticalSectionInner); | ||
this->rune_type = rune_type; | ||
} | ||
|
||
u32 RuneMgr::get_current() { | ||
toolkit::ScopedLock lock(&item_cs.mCriticalSectionInner); | ||
return this->rune_type; | ||
} | ||
|
||
} // namespace botw::savs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include <thread/seadCriticalSection.h> | ||
|
||
// TODO: upstream to decomp | ||
// | ||
namespace botw::savs { | ||
|
||
class RuneMgr { | ||
public: | ||
static RuneMgr* get_instance(); | ||
|
||
void set_current(u32 rune_type); | ||
u32 get_current(); | ||
|
||
char _x0[0x200]; | ||
sead::CriticalSection item_cs; | ||
u32 rune_type; | ||
}; | ||
|
||
static_assert(offsetof(RuneMgr, rune_type) == 0x240, ""); | ||
|
||
} // namespace botw::savs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PROVIDE_HIDDEN(botw_savs__RuneMgr = 0x02C9A668 - 0x3483000); |