[Project64] More line endings ?
This commit is contained in:
parent
a228a9d1f9
commit
26cb3c98c3
File diff suppressed because it is too large
Load Diff
|
@ -1,158 +1,158 @@
|
|||
/*
|
||||
* RSP Compiler plug in for Project64 (A Nintendo 64 emulator).
|
||||
*
|
||||
* (c) Copyright 2001 jabo (jabo@emulation64.com) and
|
||||
* zilmar (zilmar@emulation64.com)
|
||||
*
|
||||
* pj64 homepage: www.pj64.net
|
||||
*
|
||||
* Permission to use, copy, modify and distribute Project64 in both binary and
|
||||
* source form, for non-commercial purposes, is hereby granted without fee,
|
||||
* providing that this license information and copyright notice appear with
|
||||
* all copies and any derived work.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event shall the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Project64 is freeware for PERSONAL USE only. Commercial users should
|
||||
* seek permission of the copyright holders first. Commercial use includes
|
||||
* charging money for Project64 or software derived from Project64.
|
||||
*
|
||||
* The copyright holders request that bug fixes and improvements to the code
|
||||
* should be forwarded to them so if they want them.
|
||||
*
|
||||
*/
|
||||
|
||||
/************************* OpCode functions *************************/
|
||||
void Compile_SPECIAL ( void );
|
||||
void Compile_REGIMM ( void );
|
||||
void Compile_J ( void );
|
||||
void Compile_JAL ( void );
|
||||
void Compile_BEQ ( void );
|
||||
void Compile_BNE ( void );
|
||||
void Compile_BLEZ ( void );
|
||||
void Compile_BGTZ ( void );
|
||||
void Compile_ADDI ( void );
|
||||
void Compile_ADDIU ( void );
|
||||
void Compile_SLTI ( void );
|
||||
void Compile_SLTIU ( void );
|
||||
void Compile_ANDI ( void );
|
||||
void Compile_ORI ( void );
|
||||
void Compile_XORI ( void );
|
||||
void Compile_LUI ( void );
|
||||
void Compile_COP0 ( void );
|
||||
void Compile_COP2 ( void );
|
||||
void Compile_LB ( void );
|
||||
void Compile_LH ( void );
|
||||
void Compile_LW ( void );
|
||||
void Compile_LBU ( void );
|
||||
void Compile_LHU ( void );
|
||||
void Compile_SB ( void );
|
||||
void Compile_SH ( void );
|
||||
void Compile_SW ( void );
|
||||
void Compile_LC2 ( void );
|
||||
void Compile_SC2 ( void );
|
||||
/********************** R4300i OpCodes: Special **********************/
|
||||
void Compile_Special_SLL ( void );
|
||||
void Compile_Special_SRL ( void );
|
||||
void Compile_Special_SRA ( void );
|
||||
void Compile_Special_SLLV ( void );
|
||||
void Compile_Special_SRLV ( void );
|
||||
void Compile_Special_SRAV ( void );
|
||||
void Compile_Special_JR ( void );
|
||||
void Compile_Special_JALR ( void );
|
||||
void Compile_Special_BREAK ( void );
|
||||
void Compile_Special_ADD ( void );
|
||||
void Compile_Special_ADDU ( void );
|
||||
void Compile_Special_SUB ( void );
|
||||
void Compile_Special_SUBU ( void );
|
||||
void Compile_Special_AND ( void );
|
||||
void Compile_Special_OR ( void );
|
||||
void Compile_Special_XOR ( void );
|
||||
void Compile_Special_NOR ( void );
|
||||
void Compile_Special_SLT ( void );
|
||||
void Compile_Special_SLTU ( void );
|
||||
/********************** R4300i OpCodes: RegImm **********************/
|
||||
void Compile_RegImm_BLTZ ( void );
|
||||
void Compile_RegImm_BGEZ ( void );
|
||||
void Compile_RegImm_BLTZAL ( void );
|
||||
void Compile_RegImm_BGEZAL ( void );
|
||||
/************************** Cop0 functions *************************/
|
||||
void Compile_Cop0_MF ( void );
|
||||
void Compile_Cop0_MT ( void );
|
||||
/************************** Cop2 functions *************************/
|
||||
void Compile_Cop2_MF ( void );
|
||||
void Compile_Cop2_CF ( void );
|
||||
void Compile_Cop2_MT ( void );
|
||||
void Compile_Cop2_CT ( void );
|
||||
void Compile_COP2_VECTOR ( void );
|
||||
/************************** Vect functions **************************/
|
||||
void Compile_Vector_VMULF ( void );
|
||||
void Compile_Vector_VMULU ( void );
|
||||
void Compile_Vector_VMUDL ( void );
|
||||
void Compile_Vector_VMUDM ( void );
|
||||
void Compile_Vector_VMUDN ( void );
|
||||
void Compile_Vector_VMUDH ( void );
|
||||
void Compile_Vector_VMACF ( void );
|
||||
void Compile_Vector_VMACU ( void );
|
||||
void Compile_Vector_VMACQ ( void );
|
||||
void Compile_Vector_VMADL ( void );
|
||||
void Compile_Vector_VMADM ( void );
|
||||
void Compile_Vector_VMADN ( void );
|
||||
void Compile_Vector_VMADH ( void );
|
||||
void Compile_Vector_VADD ( void );
|
||||
void Compile_Vector_VSUB ( void );
|
||||
void Compile_Vector_VABS ( void );
|
||||
void Compile_Vector_VADDC ( void );
|
||||
void Compile_Vector_VSUBC ( void );
|
||||
void Compile_Vector_VSAW ( void );
|
||||
void Compile_Vector_VLT ( void );
|
||||
void Compile_Vector_VEQ ( void );
|
||||
void Compile_Vector_VNE ( void );
|
||||
void Compile_Vector_VGE ( void );
|
||||
void Compile_Vector_VCL ( void );
|
||||
void Compile_Vector_VCH ( void );
|
||||
void Compile_Vector_VCR ( void );
|
||||
void Compile_Vector_VMRG ( void );
|
||||
void Compile_Vector_VAND ( void );
|
||||
void Compile_Vector_VNAND ( void );
|
||||
void Compile_Vector_VOR ( void );
|
||||
void Compile_Vector_VNOR ( void );
|
||||
void Compile_Vector_VXOR ( void );
|
||||
void Compile_Vector_VNXOR ( void );
|
||||
void Compile_Vector_VRCP ( void );
|
||||
void Compile_Vector_VRCPL ( void );
|
||||
void Compile_Vector_VRCPH ( void );
|
||||
void Compile_Vector_VMOV ( void );
|
||||
void Compile_Vector_VRSQ ( void );
|
||||
void Compile_Vector_VRSQL ( void );
|
||||
void Compile_Vector_VRSQH ( void );
|
||||
void Compile_Vector_VNOOP ( void );
|
||||
/************************** lc2 functions **************************/
|
||||
void Compile_Opcode_LBV ( void );
|
||||
void Compile_Opcode_LSV ( void );
|
||||
void Compile_Opcode_LLV ( void );
|
||||
void Compile_Opcode_LDV ( void );
|
||||
void Compile_Opcode_LQV ( void );
|
||||
void Compile_Opcode_LRV ( void );
|
||||
void Compile_Opcode_LPV ( void );
|
||||
void Compile_Opcode_LUV ( void );
|
||||
void Compile_Opcode_LHV ( void );
|
||||
void Compile_Opcode_LFV ( void );
|
||||
void Compile_Opcode_LTV ( void );
|
||||
/************************** sc2 functions **************************/
|
||||
void Compile_Opcode_SBV ( void );
|
||||
void Compile_Opcode_SSV ( void );
|
||||
void Compile_Opcode_SLV ( void );
|
||||
void Compile_Opcode_SDV ( void );
|
||||
void Compile_Opcode_SQV ( void );
|
||||
void Compile_Opcode_SRV ( void );
|
||||
void Compile_Opcode_SPV ( void );
|
||||
void Compile_Opcode_SUV ( void );
|
||||
void Compile_Opcode_SHV ( void );
|
||||
void Compile_Opcode_SFV ( void );
|
||||
void Compile_Opcode_SWV ( void );
|
||||
void Compile_Opcode_STV ( void );
|
||||
/************************** Other functions **************************/
|
||||
void Compile_UnknownOpcode (void);
|
||||
/*
|
||||
* RSP Compiler plug in for Project64 (A Nintendo 64 emulator).
|
||||
*
|
||||
* (c) Copyright 2001 jabo (jabo@emulation64.com) and
|
||||
* zilmar (zilmar@emulation64.com)
|
||||
*
|
||||
* pj64 homepage: www.pj64.net
|
||||
*
|
||||
* Permission to use, copy, modify and distribute Project64 in both binary and
|
||||
* source form, for non-commercial purposes, is hereby granted without fee,
|
||||
* providing that this license information and copyright notice appear with
|
||||
* all copies and any derived work.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event shall the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Project64 is freeware for PERSONAL USE only. Commercial users should
|
||||
* seek permission of the copyright holders first. Commercial use includes
|
||||
* charging money for Project64 or software derived from Project64.
|
||||
*
|
||||
* The copyright holders request that bug fixes and improvements to the code
|
||||
* should be forwarded to them so if they want them.
|
||||
*
|
||||
*/
|
||||
|
||||
/************************* OpCode functions *************************/
|
||||
void Compile_SPECIAL ( void );
|
||||
void Compile_REGIMM ( void );
|
||||
void Compile_J ( void );
|
||||
void Compile_JAL ( void );
|
||||
void Compile_BEQ ( void );
|
||||
void Compile_BNE ( void );
|
||||
void Compile_BLEZ ( void );
|
||||
void Compile_BGTZ ( void );
|
||||
void Compile_ADDI ( void );
|
||||
void Compile_ADDIU ( void );
|
||||
void Compile_SLTI ( void );
|
||||
void Compile_SLTIU ( void );
|
||||
void Compile_ANDI ( void );
|
||||
void Compile_ORI ( void );
|
||||
void Compile_XORI ( void );
|
||||
void Compile_LUI ( void );
|
||||
void Compile_COP0 ( void );
|
||||
void Compile_COP2 ( void );
|
||||
void Compile_LB ( void );
|
||||
void Compile_LH ( void );
|
||||
void Compile_LW ( void );
|
||||
void Compile_LBU ( void );
|
||||
void Compile_LHU ( void );
|
||||
void Compile_SB ( void );
|
||||
void Compile_SH ( void );
|
||||
void Compile_SW ( void );
|
||||
void Compile_LC2 ( void );
|
||||
void Compile_SC2 ( void );
|
||||
/********************** R4300i OpCodes: Special **********************/
|
||||
void Compile_Special_SLL ( void );
|
||||
void Compile_Special_SRL ( void );
|
||||
void Compile_Special_SRA ( void );
|
||||
void Compile_Special_SLLV ( void );
|
||||
void Compile_Special_SRLV ( void );
|
||||
void Compile_Special_SRAV ( void );
|
||||
void Compile_Special_JR ( void );
|
||||
void Compile_Special_JALR ( void );
|
||||
void Compile_Special_BREAK ( void );
|
||||
void Compile_Special_ADD ( void );
|
||||
void Compile_Special_ADDU ( void );
|
||||
void Compile_Special_SUB ( void );
|
||||
void Compile_Special_SUBU ( void );
|
||||
void Compile_Special_AND ( void );
|
||||
void Compile_Special_OR ( void );
|
||||
void Compile_Special_XOR ( void );
|
||||
void Compile_Special_NOR ( void );
|
||||
void Compile_Special_SLT ( void );
|
||||
void Compile_Special_SLTU ( void );
|
||||
/********************** R4300i OpCodes: RegImm **********************/
|
||||
void Compile_RegImm_BLTZ ( void );
|
||||
void Compile_RegImm_BGEZ ( void );
|
||||
void Compile_RegImm_BLTZAL ( void );
|
||||
void Compile_RegImm_BGEZAL ( void );
|
||||
/************************** Cop0 functions *************************/
|
||||
void Compile_Cop0_MF ( void );
|
||||
void Compile_Cop0_MT ( void );
|
||||
/************************** Cop2 functions *************************/
|
||||
void Compile_Cop2_MF ( void );
|
||||
void Compile_Cop2_CF ( void );
|
||||
void Compile_Cop2_MT ( void );
|
||||
void Compile_Cop2_CT ( void );
|
||||
void Compile_COP2_VECTOR ( void );
|
||||
/************************** Vect functions **************************/
|
||||
void Compile_Vector_VMULF ( void );
|
||||
void Compile_Vector_VMULU ( void );
|
||||
void Compile_Vector_VMUDL ( void );
|
||||
void Compile_Vector_VMUDM ( void );
|
||||
void Compile_Vector_VMUDN ( void );
|
||||
void Compile_Vector_VMUDH ( void );
|
||||
void Compile_Vector_VMACF ( void );
|
||||
void Compile_Vector_VMACU ( void );
|
||||
void Compile_Vector_VMACQ ( void );
|
||||
void Compile_Vector_VMADL ( void );
|
||||
void Compile_Vector_VMADM ( void );
|
||||
void Compile_Vector_VMADN ( void );
|
||||
void Compile_Vector_VMADH ( void );
|
||||
void Compile_Vector_VADD ( void );
|
||||
void Compile_Vector_VSUB ( void );
|
||||
void Compile_Vector_VABS ( void );
|
||||
void Compile_Vector_VADDC ( void );
|
||||
void Compile_Vector_VSUBC ( void );
|
||||
void Compile_Vector_VSAW ( void );
|
||||
void Compile_Vector_VLT ( void );
|
||||
void Compile_Vector_VEQ ( void );
|
||||
void Compile_Vector_VNE ( void );
|
||||
void Compile_Vector_VGE ( void );
|
||||
void Compile_Vector_VCL ( void );
|
||||
void Compile_Vector_VCH ( void );
|
||||
void Compile_Vector_VCR ( void );
|
||||
void Compile_Vector_VMRG ( void );
|
||||
void Compile_Vector_VAND ( void );
|
||||
void Compile_Vector_VNAND ( void );
|
||||
void Compile_Vector_VOR ( void );
|
||||
void Compile_Vector_VNOR ( void );
|
||||
void Compile_Vector_VXOR ( void );
|
||||
void Compile_Vector_VNXOR ( void );
|
||||
void Compile_Vector_VRCP ( void );
|
||||
void Compile_Vector_VRCPL ( void );
|
||||
void Compile_Vector_VRCPH ( void );
|
||||
void Compile_Vector_VMOV ( void );
|
||||
void Compile_Vector_VRSQ ( void );
|
||||
void Compile_Vector_VRSQL ( void );
|
||||
void Compile_Vector_VRSQH ( void );
|
||||
void Compile_Vector_VNOOP ( void );
|
||||
/************************** lc2 functions **************************/
|
||||
void Compile_Opcode_LBV ( void );
|
||||
void Compile_Opcode_LSV ( void );
|
||||
void Compile_Opcode_LLV ( void );
|
||||
void Compile_Opcode_LDV ( void );
|
||||
void Compile_Opcode_LQV ( void );
|
||||
void Compile_Opcode_LRV ( void );
|
||||
void Compile_Opcode_LPV ( void );
|
||||
void Compile_Opcode_LUV ( void );
|
||||
void Compile_Opcode_LHV ( void );
|
||||
void Compile_Opcode_LFV ( void );
|
||||
void Compile_Opcode_LTV ( void );
|
||||
/************************** sc2 functions **************************/
|
||||
void Compile_Opcode_SBV ( void );
|
||||
void Compile_Opcode_SSV ( void );
|
||||
void Compile_Opcode_SLV ( void );
|
||||
void Compile_Opcode_SDV ( void );
|
||||
void Compile_Opcode_SQV ( void );
|
||||
void Compile_Opcode_SRV ( void );
|
||||
void Compile_Opcode_SPV ( void );
|
||||
void Compile_Opcode_SUV ( void );
|
||||
void Compile_Opcode_SHV ( void );
|
||||
void Compile_Opcode_SFV ( void );
|
||||
void Compile_Opcode_SWV ( void );
|
||||
void Compile_Opcode_STV ( void );
|
||||
/************************** Other functions **************************/
|
||||
void Compile_UnknownOpcode (void);
|
||||
|
|
|
@ -1,248 +1,248 @@
|
|||
/**********************************************************************************
|
||||
Common Controller plugin spec, version #1.1 maintained by
|
||||
zilmar (zilmar@emulation64.com)
|
||||
|
||||
All questions or suggestions should go through the emutalk plugin forum.
|
||||
http://www.emutalk.net/cgi-bin/ikonboard/ikonboard.cgi?s=3bd272222f66ffff;act=SF;f=20
|
||||
**********************************************************************************/
|
||||
#ifndef _CONTR_H_INCLUDED__
|
||||
#define _CONTR_H_INCLUDED__
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Note: BOOL, BYTE, WORD, DWORD, TRUE, FALSE are defined in windows.h */
|
||||
|
||||
#define PLUGIN_TYPE_CONTROLLER 4
|
||||
|
||||
#ifndef SPECS_VERSION
|
||||
#define SPECS_VERSION 0x0101
|
||||
#endif
|
||||
|
||||
/*** Conteroller plugin's ****/
|
||||
#define PLUGIN_NONE 1
|
||||
#define PLUGIN_MEMPAK 2
|
||||
// not implemeted for non raw data
|
||||
#define PLUGIN_RUMBLE_PAK 3
|
||||
// not implemeted for non raw data
|
||||
#define PLUGIN_TRANSFER_PAK 4
|
||||
// the controller plugin is passed in raw data
|
||||
#define PLUGIN_RAW 5
|
||||
|
||||
/*********************************************************************************
|
||||
Note about Conteroller plugin's:
|
||||
the rumble pak needs a function for the force feed back joystick and tranfer pak
|
||||
probaly needs a function for the plugin to be able to select the GB rom and
|
||||
eeprom... maybe this should be done by the emu instead of the plugin, but I think
|
||||
it probaly should be done by the plugin. I will see about adding these functions
|
||||
in the next spec
|
||||
**********************************************************************************/
|
||||
|
||||
#define EXPORT __declspec(dllexport)
|
||||
#define CALL _cdecl
|
||||
|
||||
/***** Structures *****/
|
||||
typedef struct
|
||||
{
|
||||
WORD Version; /* Should be set to 0x0101 */
|
||||
WORD Type; /* Set to PLUGIN_TYPE_CONTROLLER */
|
||||
char Name[100]; /* Name of the DLL */
|
||||
BOOL Reserved1;
|
||||
BOOL Reserved2;
|
||||
} PLUGIN_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOL Present;
|
||||
BOOL RawData;
|
||||
int Plugin;
|
||||
} CONTROL;
|
||||
|
||||
typedef union
|
||||
{
|
||||
DWORD Value;
|
||||
struct
|
||||
{
|
||||
unsigned R_DPAD : 1;
|
||||
unsigned L_DPAD : 1;
|
||||
unsigned D_DPAD : 1;
|
||||
unsigned U_DPAD : 1;
|
||||
unsigned START_BUTTON : 1;
|
||||
unsigned Z_TRIG : 1;
|
||||
unsigned B_BUTTON : 1;
|
||||
unsigned A_BUTTON : 1;
|
||||
|
||||
unsigned R_CBUTTON : 1;
|
||||
unsigned L_CBUTTON : 1;
|
||||
unsigned D_CBUTTON : 1;
|
||||
unsigned U_CBUTTON : 1;
|
||||
unsigned R_TRIG : 1;
|
||||
unsigned L_TRIG : 1;
|
||||
unsigned Reserved1 : 1;
|
||||
unsigned Reserved2 : 1;
|
||||
|
||||
signed Y_AXIS : 8;
|
||||
|
||||
signed X_AXIS : 8;
|
||||
};
|
||||
} BUTTONS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HWND hMainWindow;
|
||||
HINSTANCE hinst;
|
||||
|
||||
BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
||||
// bswap on a dword (32 bits) boundry, only effects header.
|
||||
// eg. the first 8 bytes are stored like this:
|
||||
// 4 3 2 1 8 7 6 5
|
||||
BYTE * HEADER; // This is the rom header (first 40h bytes of the rom)
|
||||
CONTROL *Controls; // A pointer to an array of 4 controllers .. eg:
|
||||
// CONTROL Controls[4];
|
||||
} CONTROL_INFO;
|
||||
|
||||
/******************************************************************
|
||||
Function: CloseDLL
|
||||
Purpose: This function is called when the emulator is closing
|
||||
down allowing the dll to de-initialise.
|
||||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL CloseDLL(void);
|
||||
|
||||
/******************************************************************
|
||||
Function: ControllerCommand
|
||||
Purpose: To process the raw data that has just been sent to a
|
||||
specific controller.
|
||||
input: - Controller Number (0 to 3) and -1 signalling end of
|
||||
processing the pif ram.
|
||||
- Pointer of data to be processed.
|
||||
output: none
|
||||
|
||||
note: This function is only needed if the DLL is allowing raw
|
||||
data, or the plugin is set to raw
|
||||
|
||||
the data that is being processed looks like this:
|
||||
initilize controller: 01 03 00 FF FF FF
|
||||
read controller: 01 04 01 FF FF FF FF
|
||||
*******************************************************************/
|
||||
EXPORT void CALL ControllerCommand(int Control, BYTE * Command);
|
||||
|
||||
/******************************************************************
|
||||
Function: DllAbout
|
||||
Purpose: This function is optional function that is provided
|
||||
to give further information about the DLL.
|
||||
input: a handle to the window that calls this function
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL DllAbout(HWND hParent);
|
||||
|
||||
/******************************************************************
|
||||
Function: DllConfig
|
||||
Purpose: This function is optional function that is provided
|
||||
to allow the user to configure the dll
|
||||
input: a handle to the window that calls this function
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL DllConfig(HWND hParent);
|
||||
|
||||
/******************************************************************
|
||||
Function: DllTest
|
||||
Purpose: This function is optional function that is provided
|
||||
to allow the user to test the dll
|
||||
input: a handle to the window that calls this function
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL DllTest(HWND hParent);
|
||||
|
||||
/******************************************************************
|
||||
Function: GetDllInfo
|
||||
Purpose: This function allows the emulator to gather information
|
||||
about the dll by filling in the PluginInfo structure.
|
||||
input: a pointer to a PLUGIN_INFO stucture that needs to be
|
||||
filled by the function. (see def above)
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo);
|
||||
|
||||
/******************************************************************
|
||||
Function: GetKeys
|
||||
Purpose: To get the current state of the controllers buttons.
|
||||
input: - Controller Number (0 to 3)
|
||||
- A pointer to a BUTTONS structure to be filled with
|
||||
the controller state.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL GetKeys(int Control, BUTTONS * Keys);
|
||||
|
||||
/******************************************************************
|
||||
Function: InitiateControllers
|
||||
Purpose: This function initialises how each of the controllers
|
||||
should be handled.
|
||||
input: - The handle to the main window.
|
||||
- A controller structure that needs to be filled for
|
||||
the emulator to know how to handle each controller.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
#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
|
||||
Purpose: To process the raw data in the pif ram that is about to
|
||||
be read.
|
||||
input: - Controller Number (0 to 3) and -1 signalling end of
|
||||
processing the pif ram.
|
||||
- Pointer of data to be processed.
|
||||
output: none
|
||||
note: This function is only needed if the DLL is allowing raw
|
||||
data.
|
||||
*******************************************************************/
|
||||
EXPORT void CALL ReadController(int Control, BYTE * Command);
|
||||
|
||||
/******************************************************************
|
||||
Function: RomClosed
|
||||
Purpose: This function is called when a rom is closed.
|
||||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL RomClosed(void);
|
||||
|
||||
/******************************************************************
|
||||
Function: RomOpen
|
||||
Purpose: This function is called when a rom is open. (from the
|
||||
emulation thread)
|
||||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL RomOpen(void);
|
||||
|
||||
/******************************************************************
|
||||
Function: WM_KeyDown
|
||||
Purpose: To pass the WM_KeyDown message from the emulator to the
|
||||
plugin.
|
||||
input: wParam and lParam of the WM_KEYDOWN message.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL WM_KeyDown(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/******************************************************************
|
||||
Function: WM_KeyUp
|
||||
Purpose: To pass the WM_KEYUP message from the emulator to the
|
||||
plugin.
|
||||
input: wParam and lParam of the WM_KEYDOWN message.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL WM_KeyUp(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/**********************************************************************************
|
||||
Common Controller plugin spec, version #1.1 maintained by
|
||||
zilmar (zilmar@emulation64.com)
|
||||
|
||||
All questions or suggestions should go through the emutalk plugin forum.
|
||||
http://www.emutalk.net/cgi-bin/ikonboard/ikonboard.cgi?s=3bd272222f66ffff;act=SF;f=20
|
||||
**********************************************************************************/
|
||||
#ifndef _CONTR_H_INCLUDED__
|
||||
#define _CONTR_H_INCLUDED__
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Note: BOOL, BYTE, WORD, DWORD, TRUE, FALSE are defined in windows.h */
|
||||
|
||||
#define PLUGIN_TYPE_CONTROLLER 4
|
||||
|
||||
#ifndef SPECS_VERSION
|
||||
#define SPECS_VERSION 0x0101
|
||||
#endif
|
||||
|
||||
/*** Conteroller plugin's ****/
|
||||
#define PLUGIN_NONE 1
|
||||
#define PLUGIN_MEMPAK 2
|
||||
// not implemeted for non raw data
|
||||
#define PLUGIN_RUMBLE_PAK 3
|
||||
// not implemeted for non raw data
|
||||
#define PLUGIN_TRANSFER_PAK 4
|
||||
// the controller plugin is passed in raw data
|
||||
#define PLUGIN_RAW 5
|
||||
|
||||
/*********************************************************************************
|
||||
Note about Conteroller plugin's:
|
||||
the rumble pak needs a function for the force feed back joystick and tranfer pak
|
||||
probaly needs a function for the plugin to be able to select the GB rom and
|
||||
eeprom... maybe this should be done by the emu instead of the plugin, but I think
|
||||
it probaly should be done by the plugin. I will see about adding these functions
|
||||
in the next spec
|
||||
**********************************************************************************/
|
||||
|
||||
#define EXPORT __declspec(dllexport)
|
||||
#define CALL _cdecl
|
||||
|
||||
/***** Structures *****/
|
||||
typedef struct
|
||||
{
|
||||
WORD Version; /* Should be set to 0x0101 */
|
||||
WORD Type; /* Set to PLUGIN_TYPE_CONTROLLER */
|
||||
char Name[100]; /* Name of the DLL */
|
||||
BOOL Reserved1;
|
||||
BOOL Reserved2;
|
||||
} PLUGIN_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOL Present;
|
||||
BOOL RawData;
|
||||
int Plugin;
|
||||
} CONTROL;
|
||||
|
||||
typedef union
|
||||
{
|
||||
DWORD Value;
|
||||
struct
|
||||
{
|
||||
unsigned R_DPAD : 1;
|
||||
unsigned L_DPAD : 1;
|
||||
unsigned D_DPAD : 1;
|
||||
unsigned U_DPAD : 1;
|
||||
unsigned START_BUTTON : 1;
|
||||
unsigned Z_TRIG : 1;
|
||||
unsigned B_BUTTON : 1;
|
||||
unsigned A_BUTTON : 1;
|
||||
|
||||
unsigned R_CBUTTON : 1;
|
||||
unsigned L_CBUTTON : 1;
|
||||
unsigned D_CBUTTON : 1;
|
||||
unsigned U_CBUTTON : 1;
|
||||
unsigned R_TRIG : 1;
|
||||
unsigned L_TRIG : 1;
|
||||
unsigned Reserved1 : 1;
|
||||
unsigned Reserved2 : 1;
|
||||
|
||||
signed Y_AXIS : 8;
|
||||
|
||||
signed X_AXIS : 8;
|
||||
};
|
||||
} BUTTONS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HWND hMainWindow;
|
||||
HINSTANCE hinst;
|
||||
|
||||
BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre
|
||||
// bswap on a dword (32 bits) boundry, only effects header.
|
||||
// eg. the first 8 bytes are stored like this:
|
||||
// 4 3 2 1 8 7 6 5
|
||||
BYTE * HEADER; // This is the rom header (first 40h bytes of the rom)
|
||||
CONTROL *Controls; // A pointer to an array of 4 controllers .. eg:
|
||||
// CONTROL Controls[4];
|
||||
} CONTROL_INFO;
|
||||
|
||||
/******************************************************************
|
||||
Function: CloseDLL
|
||||
Purpose: This function is called when the emulator is closing
|
||||
down allowing the dll to de-initialise.
|
||||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL CloseDLL(void);
|
||||
|
||||
/******************************************************************
|
||||
Function: ControllerCommand
|
||||
Purpose: To process the raw data that has just been sent to a
|
||||
specific controller.
|
||||
input: - Controller Number (0 to 3) and -1 signalling end of
|
||||
processing the pif ram.
|
||||
- Pointer of data to be processed.
|
||||
output: none
|
||||
|
||||
note: This function is only needed if the DLL is allowing raw
|
||||
data, or the plugin is set to raw
|
||||
|
||||
the data that is being processed looks like this:
|
||||
initilize controller: 01 03 00 FF FF FF
|
||||
read controller: 01 04 01 FF FF FF FF
|
||||
*******************************************************************/
|
||||
EXPORT void CALL ControllerCommand(int Control, BYTE * Command);
|
||||
|
||||
/******************************************************************
|
||||
Function: DllAbout
|
||||
Purpose: This function is optional function that is provided
|
||||
to give further information about the DLL.
|
||||
input: a handle to the window that calls this function
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL DllAbout(HWND hParent);
|
||||
|
||||
/******************************************************************
|
||||
Function: DllConfig
|
||||
Purpose: This function is optional function that is provided
|
||||
to allow the user to configure the dll
|
||||
input: a handle to the window that calls this function
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL DllConfig(HWND hParent);
|
||||
|
||||
/******************************************************************
|
||||
Function: DllTest
|
||||
Purpose: This function is optional function that is provided
|
||||
to allow the user to test the dll
|
||||
input: a handle to the window that calls this function
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL DllTest(HWND hParent);
|
||||
|
||||
/******************************************************************
|
||||
Function: GetDllInfo
|
||||
Purpose: This function allows the emulator to gather information
|
||||
about the dll by filling in the PluginInfo structure.
|
||||
input: a pointer to a PLUGIN_INFO stucture that needs to be
|
||||
filled by the function. (see def above)
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo);
|
||||
|
||||
/******************************************************************
|
||||
Function: GetKeys
|
||||
Purpose: To get the current state of the controllers buttons.
|
||||
input: - Controller Number (0 to 3)
|
||||
- A pointer to a BUTTONS structure to be filled with
|
||||
the controller state.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL GetKeys(int Control, BUTTONS * Keys);
|
||||
|
||||
/******************************************************************
|
||||
Function: InitiateControllers
|
||||
Purpose: This function initialises how each of the controllers
|
||||
should be handled.
|
||||
input: - The handle to the main window.
|
||||
- A controller structure that needs to be filled for
|
||||
the emulator to know how to handle each controller.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
#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
|
||||
Purpose: To process the raw data in the pif ram that is about to
|
||||
be read.
|
||||
input: - Controller Number (0 to 3) and -1 signalling end of
|
||||
processing the pif ram.
|
||||
- Pointer of data to be processed.
|
||||
output: none
|
||||
note: This function is only needed if the DLL is allowing raw
|
||||
data.
|
||||
*******************************************************************/
|
||||
EXPORT void CALL ReadController(int Control, BYTE * Command);
|
||||
|
||||
/******************************************************************
|
||||
Function: RomClosed
|
||||
Purpose: This function is called when a rom is closed.
|
||||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL RomClosed(void);
|
||||
|
||||
/******************************************************************
|
||||
Function: RomOpen
|
||||
Purpose: This function is called when a rom is open. (from the
|
||||
emulation thread)
|
||||
input: none
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL RomOpen(void);
|
||||
|
||||
/******************************************************************
|
||||
Function: WM_KeyDown
|
||||
Purpose: To pass the WM_KeyDown message from the emulator to the
|
||||
plugin.
|
||||
input: wParam and lParam of the WM_KEYDOWN message.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL WM_KeyDown(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/******************************************************************
|
||||
Function: WM_KeyUp
|
||||
Purpose: To pass the WM_KEYUP message from the emulator to the
|
||||
plugin.
|
||||
input: wParam and lParam of the WM_KEYDOWN message.
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL WM_KeyUp(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue