mirror of
https://github.com/zeldaret/ss
synced 2026-07-09 14:15:23 -04:00
match ctor
This commit is contained in:
@@ -40899,7 +40899,7 @@ lbl_80576798 = .sbss:0x80576798; // type:object size:0x4 data:4byte
|
||||
lbl_8057679C = .sbss:0x8057679C; // type:object size:0xC
|
||||
sInstance__Q23EGG17CoreControllerMgr = .sbss:0x805767A8; // type:object size:0x4 data:4byte
|
||||
sStaticDisposer__Q33EGG17CoreControllerMgr11T__Disposer = .sbss:0x805767AC; // type:object size:0x4 data:4byte
|
||||
CoreControllerFactory__3EGG = .sbss:0x805767B0; // type:object size:0x4 data:4byte
|
||||
sCoreControllerFactory__Q23EGG17CoreControllerMgr = .sbss:0x805767B0; // type:object size:0x4 data:4byte
|
||||
sConnectCallback__Q23EGG17CoreControllerMgr = .sbss:0x805767B4; // type:object size:0x4 data:4byte
|
||||
sUseBuiltinWpadAllocator__Q23EGG17CoreControllerMgr = .sbss:0x805767B8; // type:object size:0x1 data:byte
|
||||
sWPADAllocator__3EGG = .sbss:0x805767BC; // type:object size:0x4 data:4byte
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
namespace EGG {
|
||||
|
||||
class ControllerRumbleMgr;
|
||||
class CoreController;
|
||||
|
||||
// To Be Filled out
|
||||
enum eCoreDevType {};
|
||||
|
||||
typedef void (*ConnectCallback)(int args[]);
|
||||
typedef class CoreController* (*ControllerFactory)();
|
||||
|
||||
class CoreStatus {
|
||||
public:
|
||||
@@ -118,7 +120,8 @@ public:
|
||||
|
||||
public:
|
||||
/* 0x0014 */ TBuffer<CoreController *> mControllers;
|
||||
/* 0x0020 */ u8 field_0x20[0x10a4 - 0x0020];
|
||||
/* 0x0020 */ u8 field_0x20[0x10a0 - 0x0020];
|
||||
/* 0x10A0 */ u32 field_0x10A0;
|
||||
/* 0x10A4 */ TBuffer<eCoreDevType> mDevTypes;
|
||||
/* 0x10b0 */ u8 field_0x10B0[0x10e0 - 0x10b0];
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "egg/core/eggController.h"
|
||||
#include "egg/core/eggAllocator.h"
|
||||
#include "egg/core/eggExpHeap.h"
|
||||
#include "egg/core/eggSystem.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "rvl/VI.h"
|
||||
|
||||
@@ -8,7 +10,7 @@ namespace EGG {
|
||||
|
||||
CoreControllerMgr *CoreControllerMgr::sInstance;
|
||||
CoreControllerMgr::T__Disposer *CoreControllerMgr::T__Disposer::sStaticDisposer;
|
||||
void *CoreControllerFactory; // TODO
|
||||
ControllerFactory CoreControllerMgr::sCoreControllerFactory;
|
||||
ConnectCallback CoreControllerMgr::sConnectCallback;
|
||||
// This controls whether EggController registers an allocator within the WPAD driver
|
||||
bool CoreControllerMgr::sUseBuiltinWpadAllocator;
|
||||
@@ -190,22 +192,46 @@ extern "C" void fn_803DB1E0(s32 channel, bool arg);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" long lbl_80574EE8;
|
||||
// TODO headers
|
||||
extern "C" void fn_803D9400(void *a, void *b);
|
||||
extern "C" void fn_803F2040(void *a, int b);
|
||||
extern "C" void fn_803F26B0(int a, void *b);
|
||||
|
||||
/* 0x80499D10 */ CoreControllerMgr::CoreControllerMgr() {
|
||||
const int idxes[] = {0, 1, 2, 3};
|
||||
if (sUseBuiltinWpadAllocator == false) {
|
||||
// TODO I just want the string in .data already
|
||||
// TODO_Allocator = (void*)"EGG::CoreControllerMgr";
|
||||
// TODO create heap, register allocator thunks
|
||||
Heap *heap = ExpHeap::create(lbl_80574EE8, BaseSystem::mConfigData->mRootHeapMem2, 0);
|
||||
heap->mName = "EGG::CoreControllerMgr";
|
||||
sWPADAllocator = new Allocator(heap, 0x20);
|
||||
fn_803D9400(allocThunk, deleteThunk);
|
||||
}
|
||||
// init KPAD
|
||||
fn_803F2040(field_0x20, 0x40);
|
||||
beginFrame();
|
||||
endFrame();
|
||||
VIWaitForRetrace();
|
||||
|
||||
// TODO there's likely an allocate call here but it shifts the
|
||||
// inline buffer methods up in the TU :(
|
||||
// mControllers.allocate(4, 0);
|
||||
// TODO moar
|
||||
for (int i = 0; i < 4; i++) {
|
||||
fn_803F26B0(idxes[i], connectCallback);
|
||||
}
|
||||
|
||||
// TODO these allocate calls cause the relevant inline buffer functions to be moved
|
||||
// from the bottom of the TU to after this ctor. How to fix?
|
||||
mControllers.allocate(4, 0);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (sCoreControllerFactory != nullptr) {
|
||||
mControllers(i) = (sCoreControllerFactory)();
|
||||
} else {
|
||||
mControllers(i) = new CoreController();
|
||||
}
|
||||
}
|
||||
|
||||
mDevTypes.allocate(4, 0);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
mControllers(i)->mChannelID = idxes[i];
|
||||
mDevTypes(i) = (eCoreDevType)0xfd;
|
||||
}
|
||||
field_0x10A0 = 0;
|
||||
}
|
||||
|
||||
/* 0x8049A130 */ void CoreControllerMgr::beginFrame() {
|
||||
|
||||
Reference in New Issue
Block a user