[N-Rage] fixed non-compliance to official 1.1 specs
This commit is contained in:
parent
e11c0b2c22
commit
3172a3d1d4
Source/nragev20
|
@ -16,6 +16,10 @@ extern "C" {
|
||||||
|
|
||||||
#define PLUGIN_TYPE_CONTROLLER 4
|
#define PLUGIN_TYPE_CONTROLLER 4
|
||||||
|
|
||||||
|
#ifndef SPECS_VERSION
|
||||||
|
#define SPECS_VERSION 0x0101
|
||||||
|
#endif
|
||||||
|
|
||||||
/*** Conteroller plugin's ****/
|
/*** Conteroller plugin's ****/
|
||||||
#define PLUGIN_NONE 1
|
#define PLUGIN_NONE 1
|
||||||
#define PLUGIN_MEMPAK 2
|
#define PLUGIN_MEMPAK 2
|
||||||
|
@ -181,7 +185,14 @@ extern "C" {
|
||||||
the emulator to know how to handle each controller.
|
the emulator to know how to handle each controller.
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL InitiateControllers(CONTROL_INFO * ControlInfo);
|
#if (SPECS_VERSION < 0x0101)
|
||||||
|
EXPORT void CALL InitiateControllers(void * hMainWindow, CONTROL Controls[4]);
|
||||||
|
#elif (SPECS_VERSION == 0x0101)
|
||||||
|
EXPORT void CALL InitiateControllers(CONTROL_INFO ControlInfo);
|
||||||
|
/* Typo in the official specs, but it works! */
|
||||||
|
#else
|
||||||
|
EXPORT void CALL InitiateControllers(CONTROL_INFO * ControlInfo);
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Function: ReadController
|
Function: ReadController
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
// ProtoTypes //
|
// ProtoTypes //
|
||||||
bool prepareHeap();
|
bool prepareHeap();
|
||||||
void FillControls(CONTROL Controls[]);
|
void FillControls(CONTROL * Controls);
|
||||||
void InitiatePaks( bool bInitialize );
|
void InitiatePaks( bool bInitialize );
|
||||||
void DoShortcut( int iPlayer, int iShortcut );
|
void DoShortcut( int iPlayer, int iShortcut );
|
||||||
DWORD WINAPI MsgThreadFunction( LPVOID lpParam );
|
DWORD WINAPI MsgThreadFunction( LPVOID lpParam );
|
||||||
|
@ -156,7 +156,7 @@ EXPORT void CALL GetDllInfo ( PLUGIN_INFO* PluginInfo )
|
||||||
sprintf(PluginInfo->Name,"N-Rage For PJ64: %s",VER_FILE_VERSION_STR);
|
sprintf(PluginInfo->Name,"N-Rage For PJ64: %s",VER_FILE_VERSION_STR);
|
||||||
#endif
|
#endif
|
||||||
PluginInfo->Type = PLUGIN_TYPE_CONTROLLER;
|
PluginInfo->Type = PLUGIN_TYPE_CONTROLLER;
|
||||||
PluginInfo->Version = 0x0101;
|
PluginInfo->Version = SPECS_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
@ -311,15 +311,36 @@ EXPORT void CALL DllTest ( HWND hParent )
|
||||||
the emulator to know how to handle each controller.
|
the emulator to know how to handle each controller.
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
EXPORT void CALL InitiateControllers (CONTROL_INFO * ControlInfo)
|
EXPORT void CALL InitiateControllers(
|
||||||
|
#if (SPECS_VERSION < 0x0101)
|
||||||
|
void * hMainWindow, CONTROL Controls[4]
|
||||||
|
#elif (SPECS_VERSION == 0x0101)
|
||||||
|
CONTROL_INFO ControlInfo
|
||||||
|
#else
|
||||||
|
CONTROL_INFO * ControlInfo
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
DebugWriteA("CALLED: InitiateControllers\n");
|
DebugWriteA("CALLED: InitiateControllers\n");
|
||||||
if( !prepareHeap())
|
if( !prepareHeap())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_strEmuInfo.hMainWindow = ControlInfo->hMainWindow;
|
#if (SPECS_VERSION < 0x0101)
|
||||||
// g_strEmuInfo.MemoryBswaped = ControlInfo->MemoryBswaped;
|
g_strEmuInfo.controllers = &Controls[0];
|
||||||
// g_strEmuInfo.HEADER = ControlInfo->HEADER;
|
g_strEmuInfo.hMainWindow = hMainWindow;
|
||||||
|
// g_strEmuInfo.MemoryBswaped = TRUE; // Or FALSE. Really does not matter.
|
||||||
|
// g_strEmuInfo.HEADER = NULL;
|
||||||
|
#elif (SPECS_VERSION == 0x0101)
|
||||||
|
g_strEmuInfo.controllers = ControlInfo.Controls;
|
||||||
|
g_strEmuInfo.hMainWindow = ControlInfo.hMainWindow;
|
||||||
|
// g_strEmuInfo.MemoryBswaped = ControlInfo.MemoryBswaped;
|
||||||
|
// g_strEmuInfo.HEADER = ControlInfo.HEADER;
|
||||||
|
#else
|
||||||
|
g_strEmuInfo.controllers = ControlInfo->Controls;
|
||||||
|
g_strEmuInfo.hMainWindow = ControlInfo->hMainWindow;
|
||||||
|
// g_strEmuInfo.MemoryBswaped = ControlInfo->MemoryBswaped;
|
||||||
|
// g_strEmuInfo.HEADER = ControlInfo->HEADER;
|
||||||
|
#endif
|
||||||
// UNDONE: Instead of just storing the header, figure out what ROM we're running and save that information somewhere
|
// UNDONE: Instead of just storing the header, figure out what ROM we're running and save that information somewhere
|
||||||
|
|
||||||
// The emulator expects us to tell what controllers are plugged in and what their paks are at this point.
|
// The emulator expects us to tell what controllers are plugged in and what their paks are at this point.
|
||||||
|
@ -430,8 +451,7 @@ EXPORT void CALL InitiateControllers (CONTROL_INFO * ControlInfo)
|
||||||
|
|
||||||
LeaveCriticalSection( &g_critical );
|
LeaveCriticalSection( &g_critical );
|
||||||
|
|
||||||
FillControls(ControlInfo->Controls);
|
FillControls(g_strEmuInfo.controllers);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} // end InitiateControllers
|
} // end InitiateControllers
|
||||||
|
|
||||||
|
@ -884,7 +904,7 @@ void InitiatePaks( bool bInitialize )
|
||||||
// Unfortunately the spec doesn't work that way. Fixed the func and changed the func name to something that makes more sense.
|
// Unfortunately the spec doesn't work that way. Fixed the func and changed the func name to something that makes more sense.
|
||||||
// FillControls takes a Controls array from InitiateControllers and fills it with what we know about whether
|
// FillControls takes a Controls array from InitiateControllers and fills it with what we know about whether
|
||||||
// a controller is plugged in, accepting raw data, and what type of pak is plugged in.
|
// a controller is plugged in, accepting raw data, and what type of pak is plugged in.
|
||||||
void FillControls(CONTROL Controls[4])
|
void FillControls(CONTROL * Controls)
|
||||||
{
|
{
|
||||||
for( int i = 4-1; i >= 0; i-- )
|
for( int i = 4-1; i >= 0; i-- )
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,14 @@ typedef struct _EMULATOR_INFO
|
||||||
LANGID Language;
|
LANGID Language;
|
||||||
bool fDisplayShortPop; // do we display shortcut message popups?
|
bool fDisplayShortPop; // do we display shortcut message popups?
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 2015.11.09 cxd4
|
||||||
|
* Added to keep the real address of the CONTROL array stored.
|
||||||
|
*
|
||||||
|
* This became necessary due to conflicts between specs #1.0, #1.1 and #1.2.
|
||||||
|
*/
|
||||||
|
CONTROL * controllers;
|
||||||
|
|
||||||
// BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
// BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
||||||
// bswap on a dword (32 bits) boundry, only effects header.
|
// bswap on a dword (32 bits) boundry, only effects header.
|
||||||
// eg. the first 8 bytes are stored like this:
|
// eg. the first 8 bytes are stored like this:
|
||||||
|
|
Loading…
Reference in New Issue