Path: blob/master/libmupen64plus/mupen64plus-video-jabo/jabo_api.h
2 views
/**********************************************************************************1Common gfx plugin spec, version #1.3 maintained by zilmar ([email protected])2MODIFIED: Turned function prototypes into function pointer typedefs34All questions or suggestions should go through the mailing list.5http://www.egroups.com/group/Plugin64-Dev6***********************************************************************************78Notes:9------1011Setting the approprate bits in the MI_INTR_REG and calling CheckInterrupts which12are both passed to the DLL in InitiateGFX will generate an Interrupt from with in13the plugin.1415The Setting of the RSP flags and generating an SP interrupt should not be done in16the plugin1718**********************************************************************************/19#ifndef _GFX_H_INCLUDED__20#define _GFX_H_INCLUDED__2122#if defined(__cplusplus)23extern "C" {24#endif2526/* Plugin types */27#define PLUGIN_TYPE_GFX 22829//#define EXPORT __declspec(dllexport)30//#define CALL _cdecl3132/***** Structures *****/33typedef struct {34WORD Version; /* Set to 0x0103 */35WORD Type; /* Set to PLUGIN_TYPE_GFX */36char Name[100]; /* Name of the DLL */3738/* If DLL supports memory these memory options then set them to TRUE or FALSE39if it does not support it */40BOOL NormalMemory; /* a normal BYTE array */41BOOL MemoryBswaped; /* a normal BYTE array where the memory has been pre42bswap on a dword (32 bits) boundry */43} PLUGIN_INFO;4445typedef struct {46HWND hWnd; /* Render window */47HWND hStatusBar; /* if render window does not have a status bar then this is NULL */4849BOOL MemoryBswaped; // If this is set to TRUE, then the memory has been pre50// bswap on a dword (32 bits) boundry51// eg. the first 8 bytes are stored like this:52// 4 3 2 1 8 7 6 55354BYTE * HEADER; // This is the rom header (first 40h bytes of the rom55// This will be in the same memory format as the rest of the memory.56BYTE * RDRAM;57BYTE * DMEM;58BYTE * IMEM;5960DWORD * MI_INTR_REG;6162DWORD * DPC_START_REG;63DWORD * DPC_END_REG;64DWORD * DPC_CURRENT_REG;65DWORD * DPC_STATUS_REG;66DWORD * DPC_CLOCK_REG;67DWORD * DPC_BUFBUSY_REG;68DWORD * DPC_PIPEBUSY_REG;69DWORD * DPC_TMEM_REG;7071DWORD * VI_STATUS_REG;72DWORD * VI_ORIGIN_REG;73DWORD * VI_WIDTH_REG;74DWORD * VI_INTR_REG;75DWORD * VI_V_CURRENT_LINE_REG;76DWORD * VI_TIMING_REG;77DWORD * VI_V_SYNC_REG;78DWORD * VI_H_SYNC_REG;79DWORD * VI_LEAP_REG;80DWORD * VI_H_START_REG;81DWORD * VI_V_START_REG;82DWORD * VI_V_BURST_REG;83DWORD * VI_X_SCALE_REG;84DWORD * VI_Y_SCALE_REG;8586void (*CheckInterrupts)( void );87} GFX_INFO;8889/******************************************************************90Function: CaptureScreen91Purpose: This function dumps the current frame to a file92input: pointer to the directory to save the file to93output: none94*******************************************************************/95//EXPORT void CALL CaptureScreen ( char * Directory );96typedef void (*ptr_CaptureScreen)(char *);9798/******************************************************************99Function: ChangeWindow100Purpose: to change the window between fullscreen and window101mode. If the window was in fullscreen this should102change the screen to window mode and vice vesa.103input: none104output: none105*******************************************************************/106//EXPORT void CALL ChangeWindow (void);107typedef void (*ptr_ChangeWindow)(void);108109/******************************************************************110Function: CloseDLL111Purpose: This function is called when the emulator is closing112down allowing the dll to de-initialise.113input: none114output: none115*******************************************************************/116//EXPORT void CALL CloseDLL (void);117typedef void (*ptr_CloseDLL)(void);118119/******************************************************************120Function: DllAbout121Purpose: This function is optional function that is provided122to give further information about the DLL.123input: a handle to the window that calls this function124output: none125*******************************************************************/126//EXPORT void CALL DllAbout ( HWND hParent );127typedef void (*ptr_DllAbout)(HWND hParent);128129/******************************************************************130Function: DllConfig131Purpose: This function is optional function that is provided132to allow the user to configure the dll133input: a handle to the window that calls this function134output: none135*******************************************************************/136//EXPORT void CALL DllConfig ( HWND hParent );137typedef void (*ptr_DllConfig)(HWND hParent);138139/******************************************************************140Function: DllTest141Purpose: This function is optional function that is provided142to allow the user to test the dll143input: a handle to the window that calls this function144output: none145*******************************************************************/146// IGNORE147//EXPORT void CALL DllTest ( HWND hParent );148149/******************************************************************150Function: DrawScreen151Purpose: This function is called when the emulator receives a152WM_PAINT message. This allows the gfx to fit in when153it is being used in the desktop.154input: none155output: none156*******************************************************************/157//EXPORT void CALL DrawScreen (void);158typedef void (*ptr_DrawScreen)(void);159160/******************************************************************161Function: GetDllInfo162Purpose: This function allows the emulator to gather information163about the dll by filling in the PluginInfo structure.164input: a pointer to a PLUGIN_INFO stucture that needs to be165filled by the function. (see def above)166output: none167*******************************************************************/168//EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo );169typedef void (*ptr_GetDllInfo)(PLUGIN_INFO * PluginInfo);170171/******************************************************************172Function: InitiateGFX173Purpose: This function is called when the DLL is started to give174information from the emulator that the n64 graphics175uses. This is not called from the emulation thread.176Input: Gfx_Info is passed to this function which is defined177above.178Output: TRUE on success179FALSE on failure to initialise180181** note on interrupts **:182To generate an interrupt set the appropriate bit in MI_INTR_REG183and then call the function CheckInterrupts to tell the emulator184that there is a waiting interrupt.185*******************************************************************/186//EXPORT BOOL CALL InitiateGFX (GFX_INFO Gfx_Info);187typedef void (*ptr_InitiateGFX)(GFX_INFO Gfx_Info);188189/******************************************************************190Function: MoveScreen191Purpose: This function is called in response to the emulator192receiving a WM_MOVE passing the xpos and ypos passed193from that message.194input: xpos - the x-coordinate of the upper-left corner of the195client area of the window.196ypos - y-coordinate of the upper-left corner of the197client area of the window.198output: none199*******************************************************************/200// INGORE201//EXPORT void CALL MoveScreen (int xpos, int ypos);202typedef void (*ptr_MoveScreen)(int xpos, int ypos);203204/******************************************************************205Function: ProcessDList206Purpose: This function is called when there is a Dlist to be207processed. (High level GFX list)208input: none209output: none210*******************************************************************/211//EXPORT void CALL ProcessDList(void);212typedef void (*ptr_ProcessDList)(void);213214/******************************************************************215Function: ProcessRDPList216Purpose: This function is called when there is a Dlist to be217processed. (Low level GFX list)218input: none219output: none220*******************************************************************/221//EXPORT void CALL ProcessRDPList(void);222typedef void (*ptr_ProcessRDPList)(void);223224/******************************************************************225Function: RomClosed226Purpose: This function is called when a rom is closed.227input: none228output: none229*******************************************************************/230//EXPORT void CALL RomClosed (void);231typedef void (*ptr_RomClosed)(void);232233/******************************************************************234Function: RomOpen235Purpose: This function is called when a rom is open. (from the236emulation thread)237input: none238output: none239*******************************************************************/240//EXPORT void CALL RomOpen (void);241typedef void (*ptr_RomOpen)(void);242243/******************************************************************244Function: ShowCFB245Purpose: Useally once Dlists are started being displayed, cfb is246ignored. This function tells the dll to start displaying247them again.248input: none249output: none250*******************************************************************/251//EXPORT void CALL ShowCFB (void);252typedef void (*ptr_ShowCFB)(void);253254/******************************************************************255Function: UpdateScreen256Purpose: This function is called in response to a vsync of the257screen were the VI bit in MI_INTR_REG has already been258set259input: none260output: none261*******************************************************************/262//EXPORT void CALL UpdateScreen (void);263typedef void (*ptr_UpdateScreen)(void);264265/******************************************************************266Function: ViStatusChanged267Purpose: This function is called to notify the dll that the268ViStatus registers value has been changed.269input: none270output: none271*******************************************************************/272//EXPORT void CALL ViStatusChanged (void);273typedef void (*ptr_ViStatusChanged)(void);274275/******************************************************************276Function: ViWidthChanged277Purpose: This function is called to notify the dll that the278ViWidth registers value has been changed.279input: none280output: none281*******************************************************************/282//EXPORT void CALL ViWidthChanged (void);283typedef void (*ptr_ViWidthChanged)(void);284285/******************************************************************286Function: ReadScreen287Purpose: Capture the current screen288Input: none289Output: dest - 24-bit RGB data290width - width of image291height - height of image292******************************************************************/293//EXPORT void CALL ReadScreen (void **dest, long *width, long *height);294typedef void (*ptr_ReadScreen)(void **dest, long *width, long *height);295296#if defined(__cplusplus)297}298299#endif300#endif301302303