2016-02-14 06:03:35 +00:00
|
|
|
#pragma once
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Common/stdtypes.h>
|
2016-02-13 20:14:44 +00:00
|
|
|
#include "Types.h"
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#define EXPORT __declspec(dllexport)
|
|
|
|
#define CALL _cdecl
|
|
|
|
#else
|
|
|
|
#define EXPORT __attribute__((visibility("default")))
|
|
|
|
#define CALL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/************ Profiling **************/
|
|
|
|
#define Default_ProfilingOn FALSE
|
|
|
|
#define Default_IndvidualBlock FALSE
|
|
|
|
#define Default_ShowErrors FALSE
|
|
|
|
#define Default_AudioHle FALSE
|
|
|
|
|
|
|
|
#define PLUGIN_TYPE_RSP 1
|
|
|
|
#define PLUGIN_TYPE_GFX 2
|
|
|
|
#define PLUGIN_TYPE_AUDIO 3
|
|
|
|
#define PLUGIN_TYPE_CONTROLLER 4
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint16_t Version; /* Should be set to 0x0101 */
|
|
|
|
uint16_t Type; /* Set to PLUGIN_TYPE_RSP */
|
|
|
|
char Name[100]; /* Name of the DLL */
|
|
|
|
|
|
|
|
/* If DLL supports memory these memory options then set them to TRUE or FALSE
|
|
|
|
if it does not support it */
|
|
|
|
int NormalMemory; /* a normal BYTE array */
|
|
|
|
int MemoryBswaped; /* a normal BYTE array where the memory has been pre
|
|
|
|
bswap on a dword (32 bits) boundry */
|
|
|
|
} PLUGIN_INFO;
|
|
|
|
|
|
|
|
typedef struct {
|
2016-02-11 08:18:00 +00:00
|
|
|
void * hInst;
|
2016-01-27 09:11:59 +00:00
|
|
|
int MemoryBswaped; /* If this is set to TRUE, then the memory has been pre
|
|
|
|
bswap on a dword (32 bits) boundry */
|
2016-10-02 23:57:07 +00:00
|
|
|
uint8_t * HEADER;
|
2016-01-27 09:11:59 +00:00
|
|
|
uint8_t * RDRAM;
|
|
|
|
uint8_t * DMEM;
|
|
|
|
uint8_t * IMEM;
|
|
|
|
|
|
|
|
uint32_t * MI_INTR_REG;
|
|
|
|
|
|
|
|
uint32_t * SP_MEM_ADDR_REG;
|
|
|
|
uint32_t * SP_DRAM_ADDR_REG;
|
|
|
|
uint32_t * SP_RD_LEN_REG;
|
|
|
|
uint32_t * SP_WR_LEN_REG;
|
|
|
|
uint32_t * SP_STATUS_REG;
|
|
|
|
uint32_t * SP_DMA_FULL_REG;
|
|
|
|
uint32_t * SP_DMA_BUSY_REG;
|
|
|
|
uint32_t * SP_PC_REG;
|
|
|
|
uint32_t * SP_SEMAPHORE_REG;
|
|
|
|
|
|
|
|
uint32_t * DPC_START_REG;
|
|
|
|
uint32_t * DPC_END_REG;
|
|
|
|
uint32_t * DPC_CURRENT_REG;
|
|
|
|
uint32_t * DPC_STATUS_REG;
|
|
|
|
uint32_t * DPC_CLOCK_REG;
|
|
|
|
uint32_t * DPC_BUFBUSY_REG;
|
|
|
|
uint32_t * DPC_PIPEBUSY_REG;
|
|
|
|
uint32_t * DPC_TMEM_REG;
|
|
|
|
|
|
|
|
void (*CheckInterrupts)( void );
|
|
|
|
void (*ProcessDList)( void );
|
|
|
|
void (*ProcessAList)( void );
|
|
|
|
void (*ProcessRdpList)( void );
|
|
|
|
void (*ShowCFB)( void );
|
|
|
|
} RSP_INFO;
|
|
|
|
|
2016-02-13 20:14:44 +00:00
|
|
|
typedef struct {
|
|
|
|
long left, top, right, bottom;
|
|
|
|
} rectangle; /* <windows.h> equivalent: RECT */
|
|
|
|
typedef struct {
|
|
|
|
void * hdc;
|
|
|
|
Boolean fErase;
|
|
|
|
rectangle rcPaint;
|
|
|
|
Boolean fRestore;
|
|
|
|
Boolean fIncUpdate;
|
|
|
|
uint8_t rgbReserved[32];
|
|
|
|
} window_paint; /* <windows.h> equivalent: PAINTSTRUCT */
|
|
|
|
|
2016-01-27 09:11:59 +00:00
|
|
|
typedef struct {
|
|
|
|
/* Menu */
|
|
|
|
/* Items should have an ID between 5001 and 5100 */
|
2016-02-11 08:18:00 +00:00
|
|
|
void * hRSPMenu;
|
2016-01-27 09:11:59 +00:00
|
|
|
void (*ProcessMenuItem) ( int ID );
|
|
|
|
|
|
|
|
/* Break Points */
|
|
|
|
int UseBPoints;
|
|
|
|
char BPPanelName[20];
|
|
|
|
void (*Add_BPoint) ( void );
|
2016-02-13 20:14:44 +00:00
|
|
|
void (*CreateBPPanel) (void * hDlg, rectangle rcBox);
|
2016-01-27 09:11:59 +00:00
|
|
|
void (*HideBPPanel) ( void );
|
2016-02-13 20:14:44 +00:00
|
|
|
void (*PaintBPPanel) (window_paint ps);
|
2016-01-27 09:11:59 +00:00
|
|
|
void (*ShowBPPanel) ( void );
|
2016-02-11 08:18:00 +00:00
|
|
|
void (*RefreshBpoints)(void * hList);
|
|
|
|
void (*RemoveBpoint) (void * hList, int index);
|
2016-01-27 09:11:59 +00:00
|
|
|
void (*RemoveAllBpoint) ( void );
|
|
|
|
|
|
|
|
/* RSP command Window */
|
|
|
|
void (*Enter_RSP_Commands_Window) ( void );
|
|
|
|
} RSPDEBUG_INFO;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
void (*UpdateBreakPoints)( void );
|
|
|
|
void (*UpdateMemory)( void );
|
|
|
|
void (*UpdateR4300iRegisters)( void );
|
|
|
|
void (*Enter_BPoint_Window)( void );
|
|
|
|
void (*Enter_R4300i_Commands_Window)( void );
|
|
|
|
void (*Enter_R4300i_Register_Window)( void );
|
|
|
|
void (*Enter_RSP_Commands_Window) ( void );
|
|
|
|
void (*Enter_Memory_Window)( void );
|
|
|
|
} DEBUG_INFO;
|
|
|
|
|
|
|
|
EXPORT void CloseDLL(void);
|
2016-02-11 08:18:00 +00:00
|
|
|
EXPORT void DllAbout(void * hParent);
|
2016-02-11 08:23:15 +00:00
|
|
|
EXPORT uint32_t DoRspCycles(uint32_t Cycles);
|
2016-01-27 09:11:59 +00:00
|
|
|
EXPORT void GetDllInfo(PLUGIN_INFO * PluginInfo);
|
|
|
|
EXPORT void GetRspDebugInfo(RSPDEBUG_INFO * DebugInfo);
|
2016-02-11 08:23:15 +00:00
|
|
|
EXPORT void InitiateRSP(RSP_INFO Rsp_Info, uint32_t * CycleCount);
|
2016-01-27 09:11:59 +00:00
|
|
|
EXPORT void InitiateRSPDebugger(DEBUG_INFO Debug_Info);
|
|
|
|
EXPORT void RomOpen(void);
|
|
|
|
EXPORT void RomClosed(void);
|
2016-02-11 08:18:00 +00:00
|
|
|
EXPORT void DllConfig(void * hWnd);
|
2016-02-11 08:25:33 +00:00
|
|
|
EXPORT void EnableDebugging(int Enabled);
|
2016-01-27 09:11:59 +00:00
|
|
|
EXPORT void PluginLoaded(void);
|
|
|
|
|
2016-02-11 08:23:15 +00:00
|
|
|
uint32_t AsciiToHex(char * HexValue);
|
2016-02-13 19:58:42 +00:00
|
|
|
void DisplayError(char * Message, ...);
|
2016-02-11 08:23:15 +00:00
|
|
|
int GetStoredWinPos(char * WinName, uint32_t * X, uint32_t * Y);
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
#define InterpreterCPU 0
|
|
|
|
#define RecompilerCPU 1
|
|
|
|
|
|
|
|
extern int DebuggingEnabled, Profiling, IndvidualBlock, ShowErrors, BreakOnStart, LogRDP, LogX86Code;
|
2016-02-11 08:23:15 +00:00
|
|
|
extern uint32_t CPUCore;
|
2016-01-27 09:11:59 +00:00
|
|
|
extern DEBUG_INFO DebugInfo;
|
|
|
|
extern RSP_INFO RSPInfo;
|
2016-02-11 08:18:00 +00:00
|
|
|
extern void * hinstDLL;
|
2016-01-27 09:11:59 +00:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|