Change ModuleManager::init function.

First step to help refactor Module management.
Add every module in the static ModuleInfo list. Module without id are assigned
to 0xffff.
The init function is called after constructor and take a pointer to Module
as an input.
This pointer is used to set the Module's global pointer in its file.
This commit is contained in:
Arkaran99 2014-09-13 22:00:17 +02:00
parent 7dafb164e8
commit 3caff5a107
46 changed files with 321 additions and 461 deletions

View file

@ -8,8 +8,6 @@
#include "Emu/Event.h"
#include "cellSync.h"
//void cellSync_init();
//Module cellSync("cellSync", cellSync_init);
Module *cellSync = nullptr;
#ifdef PRX_DEBUG
@ -2166,8 +2164,10 @@ s32 _cellSyncLFQueueDetachLv2EventQueue(vm::ptr<be_t<u32>> spus, u32 num, vm::pt
return syncLFQueueDetachLv2EventQueue(spus, num, queue);
}
void cellSync_init()
void cellSync_init(Module *pxThis)
{
cellSync = pxThis;
cellSync->AddFunc(0xa9072dee, cellSyncMutexInitialize);
cellSync->AddFunc(0x1bb675c2, cellSyncMutexLock);
cellSync->AddFunc(0xd06918c4, cellSyncMutexTryLock);