Decompiled Application::run and Application::Application
This commit is contained in:
parent
862273029d
commit
3641f2f542
12 changed files with 109 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
|||
80006620,80006684,,,,,,,,,,,,,,,,,,,,,,,,,sdk/rvl/os/__ppc_eabi_init.o
|
||||
,,,,,,80174ad8,80174af8,,,,,,,,,,,,,80556b70,80556b71,,,,,donut/Main.o
|
||||
,,,,,,,,,,,,,,,,,,,,8055d120,8055d12c,,,,,donut/app/AppImpl.o
|
||||
,,,,,,80176268,80176464,,,,,,,,,,,,,8055d130,8055d134,,,,,donut/app/Application.o
|
||||
,,,,,,801776bc,8017793c,,,,,,,80452cf7,80452d18,,,,,8055d13c,8055d141,,,,,donut/app/EntryPoint.o
|
||||
,,,,,,8017bbdc,8017bd88,,,,,,,,,,,,,,,,,,,donut/app/System.o
|
||||
,,,,,,,,,,,,,,,,,,,,8055d1b0,8055d1b4,,,,,donut/g3d/Root.o
|
||||
|
|
|
|
@ -21,6 +21,7 @@ Address,SymbolName
|
|||
80022ba0,OSLockMutex
|
||||
80022c80,OSUnlockMutex
|
||||
80023820,OSResetSystem
|
||||
800244a0,CheckPointerIsValid__Q33hel6common13ScopedPtrUtilFPCv
|
||||
80028530,__init_user
|
||||
800285a0,exit
|
||||
8002c840,VIInit
|
||||
|
@ -38,9 +39,11 @@ Address,SymbolName
|
|||
800dd3e0,__ct__Q33hel6common34PointerWrapper<Q23mem10IAllocator>Fv
|
||||
800f16b0,G3dInit__Q24nw4r3g3dFb
|
||||
801007e0,startAddress__Q23mem8MemBlockCFv
|
||||
80174de0,__ct__Q23app7AppImplFRQ23app6System
|
||||
801754f4,run__Q23app7AppImplFbbb
|
||||
80175004,__dt__Q33hel6common43ExplicitSingleton<Q26freeze13FreezeManager>Fv
|
||||
80175004,__dt__Q33hel6common38ExplicitSingleton<Q23app11Application>Fv
|
||||
80175b68,__dt__Q33hel6common11NonCopyableFv
|
||||
80176268,Run__Q23app11ApplicationFRQ23app6Systembbb
|
||||
8018a900,__ct__Q26freeze13FreezeManagerFPUcPUc
|
||||
80196404,__dt__Q23gfx13RenderSettingFv
|
||||
80196468,rmode__Q23gfx13RenderSettingCFv
|
||||
|
|
|
25
donut/app/Application.cpp
Normal file
25
donut/app/Application.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <app/Application.hpp>
|
||||
|
||||
using namespace hel::common;
|
||||
|
||||
namespace app {
|
||||
void Application::Run(System &system, bool debug, bool hbm_reset,
|
||||
bool wiisystem_reset) {
|
||||
Application app(system, debug, hbm_reset, wiisystem_reset);
|
||||
}
|
||||
|
||||
Application::Application(System &system, bool debug, bool hbm_reset,
|
||||
bool wiisystem_reset)
|
||||
: impl_(new AppImpl(system)) {
|
||||
object_ = this;
|
||||
impl_->run(debug, hbm_reset, wiisystem_reset);
|
||||
}
|
||||
|
||||
Application::~Application() { object_ = 0; }
|
||||
} // namespace app
|
||||
|
||||
namespace hel {
|
||||
namespace common {
|
||||
app::Application *ExplicitSingleton<app::Application>::object_;
|
||||
} // namespace common
|
||||
} // namespace hel
|
|
@ -54,7 +54,7 @@ void *operator new[](u32 size, IAllocator &alloc) {
|
|||
return t_operatorNew(size, alloc);
|
||||
}
|
||||
|
||||
USED void *operator new(u32 size) { return t_operatorNew(size); }
|
||||
void *operator new(u32 size) { return t_operatorNew(size); }
|
||||
|
||||
void *operator new[](u32 size) { return t_operatorNew(size); }
|
||||
|
||||
|
|
17
include/app/AppImpl.hpp
Normal file
17
include/app/AppImpl.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <app/System.hpp>
|
||||
#include <gfx/IDrawer.hpp>
|
||||
#include <hel/common/ProtectedSingleton.hpp>
|
||||
|
||||
namespace app {
|
||||
struct AppImpl : gfx::IDrawer, hel::common::ProtectedSingleton<AppImpl> {
|
||||
int unk[15090];
|
||||
|
||||
AppImpl(System &system);
|
||||
virtual ~AppImpl();
|
||||
virtual void drawerExecDraw();
|
||||
|
||||
void run(bool debug, bool hbm_reset, bool wiisystem_reset);
|
||||
};
|
||||
} // namespace app
|
|
@ -1,9 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <app/AppImpl.hpp>
|
||||
#include <app/System.hpp>
|
||||
#include <hel/common/ExplicitSingleton.hpp>
|
||||
#include <hel/common/ScopedPtr.hpp>
|
||||
|
||||
namespace app {
|
||||
struct Application {
|
||||
struct Application : hel::common::ExplicitSingleton<Application> {
|
||||
hel::common::ScopedPtr<AppImpl> impl_;
|
||||
|
||||
Application(System &system, bool debug, bool hbm_reset, bool wiisystem_reset);
|
||||
~Application();
|
||||
|
||||
static void Run(System &, bool, bool, bool);
|
||||
};
|
||||
} // namespace app
|
|
@ -2,8 +2,10 @@
|
|||
#define AT(pos) : pos
|
||||
#define SECTION(sect) __declspec(section sect)
|
||||
#define USED __attribute__((used))
|
||||
#define NOINLINE __attribute__((never_inline))
|
||||
#else
|
||||
#define AT(pos)
|
||||
#define SECTION(sect)
|
||||
#define USED
|
||||
#define NOINLINE
|
||||
#endif
|
8
include/gfx/IDrawer.hpp
Normal file
8
include/gfx/IDrawer.hpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
namespace gfx {
|
||||
struct IDrawer {
|
||||
virtual ~IDrawer() {}
|
||||
virtual void drawerExecDraw() = 0;
|
||||
};
|
||||
} // namespace gfx
|
12
include/hel/common/ProtectedSingleton.hpp
Normal file
12
include/hel/common/ProtectedSingleton.hpp
Normal file
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <hel/common/NonCopyable.hpp>
|
||||
|
||||
namespace hel {
|
||||
namespace common {
|
||||
template <class T> struct ProtectedSingleton : NonCopyable {
|
||||
static T *ptr_;
|
||||
virtual ~ProtectedSingleton();
|
||||
};
|
||||
} // namespace common
|
||||
} // namespace hel
|
26
include/hel/common/ScopedPtr.hpp
Normal file
26
include/hel/common/ScopedPtr.hpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
#include <defines.h>
|
||||
#include <hel/common/NonCopyable.hpp>
|
||||
|
||||
namespace hel {
|
||||
namespace common {
|
||||
|
||||
struct ScopedPtrUtil {
|
||||
static void CheckPointerIsValid(const void *);
|
||||
};
|
||||
|
||||
template <class T> struct ScopedPtr : NonCopyable {
|
||||
T *ptr_;
|
||||
inline ScopedPtr(T *ptr) : ptr_(ptr) {}
|
||||
~ScopedPtr() {
|
||||
T *tmp = ptr_;
|
||||
ptr_ = 0;
|
||||
delete tmp;
|
||||
}
|
||||
NOINLINE T *operator->() const {
|
||||
ScopedPtrUtil::CheckPointerIsValid(ptr_);
|
||||
return ptr_;
|
||||
}
|
||||
};
|
||||
} // namespace common
|
||||
} // namespace hel
|
|
@ -1,7 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <hel/common/ExplicitSingleton.hpp>
|
||||
|
||||
namespace snd {
|
||||
struct SoundManager {
|
||||
struct SoundManager : hel::common::ExplicitSingleton<SoundManager> {
|
||||
int unknown[188];
|
||||
SoundManager();
|
||||
~SoundManager();
|
||||
|
|
|
@ -22,6 +22,7 @@ const SOURCES: &[(&str, &str)] = &[
|
|||
("sdk/rvl/os/__ppc_eabi_init.c", "sdk"),
|
||||
("donut/Main.cpp", "donut"),
|
||||
("donut/app/AppImpl.cpp", "donut"),
|
||||
("donut/app/Application.cpp", "donut"),
|
||||
("donut/app/EntryPoint.cpp", "donut"),
|
||||
("donut/app/System.cpp", "donut"),
|
||||
("donut/g3d/Root.cpp", "donut"),
|
||||
|
|
Loading…
Add table
Reference in a new issue