diff --git a/Source/Project64-plugin-spec/Video.h b/Source/Project64-plugin-spec/Video.h index 54db4ec1c..f525c789b 100644 --- a/Source/Project64-plugin-spec/Video.h +++ b/Source/Project64-plugin-spec/Video.h @@ -7,12 +7,12 @@ extern "C" { typedef struct { - void * hWnd; - void * hStatusBar; + void * hWnd; // Render window + void * hStatusBar; // If render window does not have a status bar then this is NULL int32_t Reserved; - uint8_t * HEADER; + uint8_t * HEADER; // This is the ROM header (first 40h bytes of the ROM) uint8_t * RDRAM; uint8_t * DMEM; uint8_t * IMEM; @@ -89,13 +89,23 @@ Output: none */ EXPORT void CALL DrawScreen(void); +/* +Function: DrawStatus +Purpose: This function displays a status string on the screen, +optionally right-aligned. +Input: lpString - pointer to the status string to display +RightAlign - nonzero to right-align the string, +zero for left alignment +Output: none +*/ +EXPORT void CALL DrawStatus(const char * lpString, int32_t RightAlign); + /* Function: InitiateGFX Purpose: This function is called when the DLL is started to give -information from the emulator that the n64 graphics +information from the emulator that the N64 graphics uses. This is not called from the emulation thread. -Input: Gfx_Info is passed to this function which is defined -above. +Input: GFX_INFO is passed to this function which is defined above. Output: TRUE on success FALSE on failure to initialise @@ -119,6 +129,18 @@ Output: none */ EXPORT void CALL MoveScreen(int xpos, int ypos); +/* +Function: OnRomBrowserMenuItem +Purpose: Callback when the ROM Browser menu supplied by the +caller is invoked +Input: MenuID - ID of the selected menu item +hParent - handle to the parent window +HEADER - pointer to the ROM header +Output: none +*/ +EXPORT void(CALL * OnRomBrowserMenuItem)(int32_t MenuID, void * hParent, uint8_t * HEADER); +EXPORT void *(CALL * GetRomBrowserMenu)(void); // Items should have an ID between 4101 and 4200 + /* Function: ProcessDList Purpose: This function is called when there is a Dlist to be @@ -140,18 +162,26 @@ EXPORT void CALL ProcessRDPList(void); /* Function: ShowCFB Purpose: Useally once Dlists are started being displayed, cfb is -ignored. This function tells the dll to start displaying +ignored. This function tells the DLL to start displaying them again. Input: none Output: none */ EXPORT void CALL ShowCFB(void); +/* +Function: SoftReset +Purpose: This function is called to notify the plugin that a +soft reset has occurred. +Input: none +Output: none +*/ +EXPORT void CALL SoftReset(void); + /* Function: UpdateScreen Purpose: This function is called in response to a vsync of the -screen were the VI bit in MI_INTR_REG has already been -set +screen were the VI bit in MI_INTR_REG has already been set Input: none Output: none */ @@ -159,7 +189,7 @@ EXPORT void CALL UpdateScreen(void); /* Function: ViStatusChanged -Purpose: This function is called to notify the dll that the +Purpose: This function is called to notify the DLL that the ViStatus registers value has been changed. Input: none Output: none @@ -168,13 +198,86 @@ EXPORT void CALL ViStatusChanged(void); /* Function: ViWidthChanged -Purpose: This function is called to notify the dll that the +Purpose: This function is called to notify the DLL that the ViWidth registers value has been changed. Input: none Output: none */ EXPORT void CALL ViWidthChanged(void); +typedef struct +{ + long left, top, right, bottom; +} rectangle; // equivalent: RECT + +typedef struct +{ + void * hdc; + int32_t fErase; + rectangle rcPaint; + int32_t fRestore; + int32_t fIncUpdate; + uint8_t rgbReserved[32]; +} window_paint; // equivalent: PAINTSTRUCT + +typedef struct +{ + // Menu + // Items should have an ID between 5101 and 5200 + void * hGFXMenu; + void (*ProcessMenuItem)(int32_t ID); + + // Breakpoints + int32_t UseBPoints; + char BPPanelName[20]; + void (*Add_BPoint)(void); + void (*CreateBPPanel)(void * hDlg, rectangle rcBox); + void (*HideBPPanel)(void); + void (*PaintBPPanel)(window_paint ps); + void (*ShowBPPanel)(void); + void (*RefreshBpoints)(void * hList); + void (*RemoveBpoint)(void * hList, int index); + void (*RemoveAllBpoint)(void); + + // GFX command window + void (*Enter_GFX_Commands_Window)(void); +} GFXDEBUG_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_GFX_Commands_Window)(void); + void (*Enter_Memory_Window)(void); +} DEBUG_INFO; + +/* +Function: InitiateDebugger +Purpose: This function is called when the DLL is started to be +given information from the emulator that the N64 GFX +interface needs to intergrate the debugger with the +rest of the emulator. +Input: DEBUG_INFO is passed to this function which is defined +above. +Output: none +*/ +EXPORT void CALL InitiateDebugger(DEBUG_INFO DebugInfo); + +/* +Function: GetDebugInfo +Purpose: This function allows the emulator to gather information +about the debug capabilities of the DLL by filling in +the DEBUG_INFO structure. +Input: a pointer to a GFXDEBUG_INFO stucture that needs to be +filled by the function. (see def above) +Output: none +*/ +EXPORT void CALL GetDebugInfo(GFXDEBUG_INFO * GFXDebugInfo); + #ifdef ANDROID /* Function: SurfaceCreated