[Plugin Specs] reverted contr 1.1 for backward-compatibility
No plugins for Windows (that can run on Project64) currently use the 1.1 controller plugin specifications, and the ones that do use it (for Linux) use the publicly released spec which did not have the pointer version in the late-modified spec. We don't want to let plugin wars roam between the emulators' implementations.
This commit is contained in:
parent
b617c4db1d
commit
e11c0b2c22
|
@ -60,6 +60,9 @@ bool CControl_Plugin::LoadFunctions(void)
|
|||
|
||||
bool CControl_Plugin::Initiate(CN64System * System, CMainGui * RenderWindow)
|
||||
{
|
||||
CONTROL_INFO ControlInfo;
|
||||
uint8_t Buffer[100];
|
||||
|
||||
for (int32_t i = 0; i < 4; i++)
|
||||
{
|
||||
m_PluginControllers[i].Present = FALSE;
|
||||
|
@ -67,6 +70,15 @@ bool CControl_Plugin::Initiate(CN64System * System, CMainGui * RenderWindow)
|
|||
m_PluginControllers[i].Plugin = PLUGIN_NONE;
|
||||
}
|
||||
|
||||
if (m_PluginInfo.Version >= 0x0101)
|
||||
{
|
||||
ControlInfo.Controls = m_PluginControllers;
|
||||
ControlInfo.HEADER = (System == NULL ? Buffer : g_Rom->GetRomAddress());
|
||||
ControlInfo.hinst = GetModuleHandle(NULL);
|
||||
ControlInfo.hMainWindow = (HWND)RenderWindow->m_hMainWindow;
|
||||
ControlInfo.MemoryBswaped = TRUE;
|
||||
}
|
||||
|
||||
// Test Plugin version
|
||||
if (m_PluginInfo.Version == 0x0100)
|
||||
{
|
||||
|
@ -74,26 +86,28 @@ bool CControl_Plugin::Initiate(CN64System * System, CMainGui * RenderWindow)
|
|||
void(__cdecl *InitiateControllers_1_0)(HWND hMainWindow, CONTROL Controls[4]);
|
||||
InitiateControllers_1_0 = (void(__cdecl *)(HWND, CONTROL *))GetProcAddress((HMODULE)m_hDll, "InitiateControllers");
|
||||
if (InitiateControllers_1_0 == NULL) { return false; }
|
||||
InitiateControllers_1_0((HWND)RenderWindow->m_hMainWindow,m_PluginControllers);
|
||||
|
||||
InitiateControllers_1_0((HWND)RenderWindow->m_hMainWindow, m_PluginControllers);
|
||||
m_Initialized = true;
|
||||
}
|
||||
else if (m_PluginInfo.Version >= 0x0101)
|
||||
else if (m_PluginInfo.Version == 0x0101)
|
||||
{
|
||||
//Get Function from DLL
|
||||
void(__cdecl *InitiateControllers_1_1)(CONTROL_INFO * ControlInfo);
|
||||
InitiateControllers_1_1 = (void(__cdecl *)(CONTROL_INFO *))GetProcAddress((HMODULE)m_hDll, "InitiateControllers");
|
||||
void(__cdecl *InitiateControllers_1_1)(CONTROL_INFO ControlInfo);
|
||||
InitiateControllers_1_1 = (void(__cdecl *)(CONTROL_INFO))GetProcAddress((HMODULE)m_hDll, "InitiateControllers");
|
||||
if (InitiateControllers_1_1 == NULL) { return false; }
|
||||
|
||||
CONTROL_INFO ControlInfo;
|
||||
uint8_t Buffer[100];
|
||||
InitiateControllers_1_1(ControlInfo);
|
||||
m_Initialized = true;
|
||||
}
|
||||
else if (m_PluginInfo.Version >= 0x0102)
|
||||
{
|
||||
//Get Function from DLL
|
||||
void(__cdecl *InitiateControllers_1_2)(CONTROL_INFO * ControlInfo);
|
||||
InitiateControllers_1_2 = (void(__cdecl *)(CONTROL_INFO *))GetProcAddress((HMODULE)m_hDll, "InitiateControllers");
|
||||
if (InitiateControllers_1_2 == NULL) { return false; }
|
||||
|
||||
ControlInfo.Controls = m_PluginControllers;
|
||||
ControlInfo.HEADER = (System == NULL ? Buffer : g_Rom->GetRomAddress());
|
||||
ControlInfo.hinst = GetModuleHandle(NULL);
|
||||
ControlInfo.hMainWindow = (HWND)RenderWindow->m_hMainWindow;
|
||||
ControlInfo.MemoryBswaped = TRUE;
|
||||
|
||||
InitiateControllers_1_1(&ControlInfo);
|
||||
InitiateControllers_1_2(&ControlInfo);
|
||||
m_Initialized = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue