2008-07-12 17:40:22 +00:00
|
|
|
//__________________________________________________________________________________________________
|
|
|
|
// Common video plugin spec, version #1.0 maintained by F|RES
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _VIDEO_H_INCLUDED__
|
|
|
|
#define _VIDEO_H_INCLUDED__
|
|
|
|
|
2008-10-02 10:43:32 +00:00
|
|
|
#include "Thread.h"
|
2008-07-12 17:40:22 +00:00
|
|
|
#include "PluginSpecs.h"
|
|
|
|
|
2008-08-27 01:42:11 +00:00
|
|
|
#include "ExportProlog.h"
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-10-02 10:43:32 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
typedef void (*TSetPEToken)(const unsigned short _token, const int _bSetTokenAcknowledge);
|
|
|
|
typedef void (*TSetPEFinish)(void);
|
|
|
|
typedef unsigned char* (*TGetMemoryPointer)(const unsigned int _iAddress);
|
|
|
|
typedef void (*TVideoLog)(const char* _pMessage, BOOL _bBreak);
|
2008-09-10 01:01:28 +00:00
|
|
|
typedef void (*TSysMessage)(const char *fmt, ...);
|
2008-07-12 17:40:22 +00:00
|
|
|
typedef void (*TRequestWindowSize)(int _iWidth, int _iHeight, BOOL _bFullscreen);
|
|
|
|
typedef void (*TCopiedToXFB)(void);
|
|
|
|
typedef BOOL (*TPeekMessages)(void);
|
|
|
|
typedef void (*TUpdateInterrupts)(void);
|
|
|
|
typedef void (*TUpdateFPSDisplay)(const char* text); // sets the window title
|
2008-08-30 22:06:53 +00:00
|
|
|
typedef void (*TKeyPressed)(int keycode, BOOL shift, BOOL control); // sets the window title
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
// fifo registers
|
2008-09-01 22:48:56 +00:00
|
|
|
volatile u32 CPBase;
|
|
|
|
volatile u32 CPEnd;
|
|
|
|
u32 CPHiWatermark;
|
|
|
|
u32 CPLoWatermark;
|
2008-11-15 21:54:46 +00:00
|
|
|
volatile u32 CPReadWriteDistance;
|
2008-09-01 22:48:56 +00:00
|
|
|
volatile u32 CPWritePointer;
|
|
|
|
volatile u32 CPReadPointer;
|
|
|
|
volatile u32 CPBreakpoint;
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-10-30 18:13:13 +00:00
|
|
|
volatile BOOL bFF_GPReadEnable;
|
|
|
|
volatile BOOL bFF_BPEnable;
|
|
|
|
volatile BOOL bFF_GPLinkEnable;
|
|
|
|
volatile BOOL bFF_Breakpoint;
|
2008-11-14 22:33:48 +00:00
|
|
|
|
|
|
|
// for GP watchdog hack
|
|
|
|
volatile BOOL Fake_GPWDInterrupt;
|
|
|
|
volatile u32 Fake_GPWDToken; // cicular incrementer
|
2008-07-12 17:40:22 +00:00
|
|
|
} SCPFifoStruct;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
void *pWindowHandle;
|
|
|
|
|
|
|
|
TSetPEToken pSetPEToken;
|
|
|
|
TSetPEFinish pSetPEFinish;
|
|
|
|
TGetMemoryPointer pGetMemoryPointer;
|
|
|
|
TVideoLog pLog;
|
2008-09-10 01:01:28 +00:00
|
|
|
TSysMessage pSysMessage;
|
2008-07-12 17:40:22 +00:00
|
|
|
TRequestWindowSize pRequestWindowSize;
|
|
|
|
TCopiedToXFB pCopiedToXFB;
|
|
|
|
TPeekMessages pPeekMessages;
|
|
|
|
TUpdateInterrupts pUpdateInterrupts;
|
|
|
|
TUpdateFPSDisplay pUpdateFPSDisplay;
|
2008-08-30 22:06:53 +00:00
|
|
|
TKeyPressed pKeyPress;
|
2008-07-12 17:40:22 +00:00
|
|
|
|
2008-08-30 22:06:53 +00:00
|
|
|
SCPFifoStruct *pCPFifo;
|
2008-07-12 17:40:22 +00:00
|
|
|
unsigned char *pVIRegs;
|
|
|
|
void *pMemoryBase;
|
2008-10-29 22:50:52 +00:00
|
|
|
bool bWii;
|
2008-07-12 17:40:22 +00:00
|
|
|
} SVideoInitialize;
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// I N T E R F A C E ////////////////////////////////////////////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// 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 structure that needs to be
|
|
|
|
// filled by the function. (see def above)
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
//
|
|
|
|
#ifndef _WIN32
|
|
|
|
#define _CDECLCALL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
EXPORT void CALL GetDllInfo(PLUGIN_INFO* _pPluginInfo);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// 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);
|
|
|
|
|
2008-10-09 18:47:53 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: DllDebugger
|
|
|
|
// Purpose: Open the debugger
|
|
|
|
// input: a handle to the window that calls this function
|
|
|
|
// output: none
|
|
|
|
//
|
2008-11-16 20:09:13 +00:00
|
|
|
EXPORT void CALL DllDebugger(HWND _hParent, bool Show);
|
2008-10-09 18:47:53 +00:00
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_Initialize
|
|
|
|
// Purpose:
|
|
|
|
// input: SVideoInitialize* - pointer because window data will be passed back
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_Initialize(SVideoInitialize* _pvideoInitialize);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_Prepare
|
|
|
|
// Purpose: This function is called from the EmuThread before the
|
|
|
|
// emulation has started. It is just for threadsensitive
|
|
|
|
// APIs like OpenGL.
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_Prepare(void);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_Shutdown
|
|
|
|
// Purpose: This function is called when the emulator is shutting down
|
|
|
|
// a game allowing the dll to de-initialise.
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_Shutdown(void);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_ExecuteFifoBuffer
|
|
|
|
// Purpose: This function is called if data is inside the fifo-buffer
|
|
|
|
// input: a data-byte (i know we have to optimize this ;-))
|
|
|
|
// output: none
|
|
|
|
//
|
2008-11-14 22:33:48 +00:00
|
|
|
EXPORT void CALL Video_SendFifoData(u8* _uData, u32 len);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_UpdateXFB
|
|
|
|
// Purpose: This fucntion is called when you have to flip the yuv2
|
|
|
|
// video-buffer. You should ignore this function after you
|
|
|
|
// got the first EFB to XFB copy.
|
|
|
|
// input: pointer to the XFB, width and height of the XFB
|
|
|
|
// output: none
|
|
|
|
//
|
2008-10-15 14:07:03 +00:00
|
|
|
EXPORT void CALL Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset);
|
2008-07-12 17:40:22 +00:00
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_Screenshot
|
|
|
|
// Purpose: This fucntion is called when you want to do a screenshot
|
|
|
|
// input: Filename
|
|
|
|
// output: TRUE if all was okay
|
|
|
|
//
|
|
|
|
EXPORT BOOL CALL Video_Screenshot(TCHAR* _szFilename);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
2008-08-10 21:34:22 +00:00
|
|
|
// Function: Video_EnterLoop
|
|
|
|
// Purpose: FIXME!
|
|
|
|
// input: none
|
|
|
|
// output: none
|
2008-07-12 17:40:22 +00:00
|
|
|
//
|
|
|
|
EXPORT void CALL Video_EnterLoop(void);
|
|
|
|
|
2008-08-10 21:34:22 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_AddMessage
|
|
|
|
// Purpose: Adds a message to the display queue, to be shown forthe specified time
|
|
|
|
// input: pointer to the null-terminated string, time in milliseconds
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_AddMessage(const char* pstr, unsigned int milliseconds);
|
|
|
|
|
2008-08-26 23:40:18 +00:00
|
|
|
// __________________________________________________________________________________________________
|
2008-08-28 07:58:04 +00:00
|
|
|
// Function: Video_DoState
|
2008-08-30 12:11:25 +00:00
|
|
|
// Purpose: Saves/Loads the current video data state (depends on mode parameter)
|
|
|
|
// input/output: ptr
|
|
|
|
// input: mode
|
2008-08-26 23:40:18 +00:00
|
|
|
//
|
2008-08-30 12:11:25 +00:00
|
|
|
EXPORT void CALL Video_DoState(unsigned char **ptr, int mode);
|
2008-08-26 23:40:18 +00:00
|
|
|
|
2008-10-02 17:03:24 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_Stop
|
|
|
|
// Purpose: Stop the video plugin before shutdown
|
|
|
|
// input/output:
|
|
|
|
// input:
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_Stop();
|
|
|
|
|
2008-08-27 01:42:11 +00:00
|
|
|
#include "ExportEpilog.h"
|
2008-07-12 17:40:22 +00:00
|
|
|
#endif
|