2008-12-08 04:46:09 +00:00
|
|
|
//__________________________________________________________________________________________________
|
|
|
|
// Common video plugin spec, version #1.0 maintained by F|RES
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _VIDEO_H_INCLUDED__
|
|
|
|
#define _VIDEO_H_INCLUDED__
|
|
|
|
|
|
|
|
#include "Thread.h"
|
|
|
|
#include "PluginSpecs.h"
|
|
|
|
|
|
|
|
#include "ExportProlog.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef void (*TSetPEToken)(const unsigned short _token, const int _bSetTokenAcknowledge);
|
|
|
|
typedef void (*TSetPEFinish)(void);
|
|
|
|
typedef unsigned char* (*TGetMemoryPointer)(const unsigned int _iAddress);
|
2008-12-12 17:59:33 +00:00
|
|
|
typedef void (*TVideoLog)(const char* _pMessage, int _bBreak);
|
2008-12-08 04:46:09 +00:00
|
|
|
typedef void (*TSysMessage)(const char *fmt, ...);
|
2008-12-12 17:59:33 +00:00
|
|
|
typedef void (*TRequestWindowSize)(int _iWidth, int _iHeight, bool _bFullscreen);
|
2008-12-08 04:46:09 +00:00
|
|
|
typedef void (*TCopiedToXFB)(void);
|
2008-12-11 15:12:17 +00:00
|
|
|
typedef unsigned int (*TPeekMessages)(void);
|
2008-12-08 04:46:09 +00:00
|
|
|
typedef void (*TUpdateInterrupts)(void);
|
|
|
|
typedef void (*TUpdateFPSDisplay)(const char* text); // sets the window title
|
2008-12-12 17:59:33 +00:00
|
|
|
typedef void (*TKeyPressed)(int keycode, bool shift, bool control); // sets the window title
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
// fifo registers
|
|
|
|
volatile u32 CPBase;
|
|
|
|
volatile u32 CPEnd;
|
|
|
|
u32 CPHiWatermark;
|
|
|
|
u32 CPLoWatermark;
|
|
|
|
volatile u32 CPReadWriteDistance;
|
|
|
|
volatile u32 CPWritePointer;
|
|
|
|
volatile u32 CPReadPointer;
|
|
|
|
volatile u32 CPBreakpoint;
|
|
|
|
|
|
|
|
// Super Monkey Ball Adventure require this.
|
|
|
|
// Because the read&check-PEToken-loop stays in its JITed block I suppose.
|
|
|
|
// So no possiblity to ack the Token irq by the scheduler until some sort of PPC watchdog do its mess.
|
|
|
|
volatile u16 PEToken;
|
|
|
|
|
2008-12-12 17:59:33 +00:00
|
|
|
volatile u32 bFF_GPReadEnable;
|
|
|
|
volatile u32 bFF_BPEnable;
|
|
|
|
volatile u32 bFF_GPLinkEnable;
|
|
|
|
volatile u32 bFF_Breakpoint;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2008-12-12 17:59:33 +00:00
|
|
|
volatile u32 CPCmdIdle;
|
|
|
|
volatile u32 CPReadIdle;
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// for GP watchdog hack
|
|
|
|
volatile u32 Fake_GPWDToken; // cicular incrementer
|
|
|
|
} SCPFifoStruct;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
void *pWindowHandle;
|
|
|
|
|
|
|
|
TSetPEToken pSetPEToken;
|
|
|
|
TSetPEFinish pSetPEFinish;
|
|
|
|
TGetMemoryPointer pGetMemoryPointer;
|
|
|
|
TVideoLog pLog;
|
|
|
|
TSysMessage pSysMessage;
|
|
|
|
TRequestWindowSize pRequestWindowSize;
|
|
|
|
TCopiedToXFB pCopiedToXFB;
|
|
|
|
TPeekMessages pPeekMessages;
|
|
|
|
TUpdateInterrupts pUpdateInterrupts;
|
|
|
|
TUpdateFPSDisplay pUpdateFPSDisplay;
|
|
|
|
TKeyPressed pKeyPress;
|
|
|
|
|
|
|
|
SCPFifoStruct *pCPFifo;
|
|
|
|
void *pMemoryBase;
|
|
|
|
bool bWii;
|
2009-01-27 20:59:27 +00:00
|
|
|
bool bUseDualCore;
|
2009-06-28 20:04:07 +00:00
|
|
|
|
|
|
|
unsigned short *pBBox; // points to four shorts: left, top, right, bottom
|
|
|
|
// TODO:
|
|
|
|
bool *pBBoxActive; // we guess that after a bbox reset, we only need to track bbox size until the corresponding read.
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
} SVideoInitialize;
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// I N T E R F A C E ////////////////////////////////////////////////////////////////////////////////
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// 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);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
2009-02-20 22:04:52 +00:00
|
|
|
// Function: Video_SendFifoData
|
|
|
|
// Purpose: This function is called to submit fifo data directly - only single core mode calls this.
|
|
|
|
// input: u8 *_uData, u32 len - a block of fifo data.
|
2008-12-08 04:46:09 +00:00
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_SendFifoData(u8* _uData, u32 len);
|
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_UpdateXFB
|
2009-02-20 22:04:52 +00:00
|
|
|
// TODO: This DOC IS BROKEN!
|
|
|
|
// Purpose: This function is called when you have to flip the yuv2
|
2008-12-08 04:46:09 +00:00
|
|
|
// 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
|
|
|
|
//
|
2009-06-29 07:30:48 +00:00
|
|
|
EXPORT void CALL Video_UpdateXFB(u32 _dwXFBAddr, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset, bool scheduling);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_Screenshot
|
|
|
|
// input: Filename
|
|
|
|
// output: TRUE if all was okay
|
|
|
|
//
|
2009-02-27 03:56:34 +00:00
|
|
|
EXPORT void CALL Video_Screenshot(const char *_szFilename);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_EnterLoop
|
2009-02-20 22:04:52 +00:00
|
|
|
// Purpose: Enters the video fifo dispatch loop. This is only used in Dual Core mode.
|
2008-12-08 04:46:09 +00:00
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_EnterLoop(void);
|
|
|
|
|
2009-02-20 22:04:52 +00:00
|
|
|
// __________________________________________________________________________________________________
|
|
|
|
// Function: Video_ExitLoop
|
|
|
|
// Purpose: Exits the video dispatch loop. This is only used in Dual Core mode.
|
|
|
|
// input: none
|
|
|
|
// output: none
|
|
|
|
//
|
|
|
|
EXPORT void CALL Video_ExitLoop(void);
|
|
|
|
|
2008-12-08 04:46:09 +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);
|
|
|
|
|
|
|
|
#include "ExportEpilog.h"
|
|
|
|
#endif
|