project64/Source/Project64-core/Plugins/RSPPlugin.h

93 lines
2.7 KiB
C
Raw Normal View History

2016-01-27 09:11:59 +00:00
#pragma once
2023-09-21 04:55:07 +00:00
#include <Common/SyncEvent.h>
#include <Common/Thread.h>
2016-01-27 09:11:59 +00:00
#include <Project64-core/Plugins/PluginBase.h>
2023-09-21 04:55:07 +00:00
#include <Project64-core/Settings/DebugSettings.h>
#include <Project64-core/Settings/GameSettings.h>
#include <Project64-core/Settings/N64SystemSettings.h>
2016-01-27 09:11:59 +00:00
2023-09-21 04:55:07 +00:00
class CRSP_Plugin :
public CPlugin,
protected CN64SystemSettings,
protected CGameSettings
2016-01-27 09:11:59 +00:00
{
2022-10-10 00:22:17 +00:00
typedef struct
{
// Menu
// Items should have an ID between 5001 and 5100
2016-01-27 09:11:59 +00:00
void * hRSPMenu;
2022-10-10 00:22:17 +00:00
void(CALL * ProcessMenuItem)(int32_t ID);
2016-01-27 09:11:59 +00:00
// Breakpoints
2016-01-27 09:11:59 +00:00
int32_t UseBPoints;
char BPPanelName[20];
2022-10-10 00:22:17 +00:00
void(CALL * Add_BPoint)(void);
void(CALL * CreateBPPanel)(void);
void(CALL * HideBPPanel)(void);
void(CALL * PaintBPPanel)(void);
void(CALL * ShowBPPanel)(void);
void(CALL * RefreshBpoints)(void * hList);
void(CALL * RemoveBpoint)(void * hList, int32_t index);
void(CALL * RemoveAllBpoint)(void);
2016-01-27 09:11:59 +00:00
// RSP command window
2022-10-10 00:22:17 +00:00
void(CALL * Enter_RSP_Commands_Window)(void);
2016-01-27 09:11:59 +00:00
} RSPDEBUG_INFO;
2022-10-10 00:22:17 +00:00
typedef struct
{
void(CALL * UpdateBreakPoints)(void);
void(CALL * UpdateMemory)(void);
void(CALL * UpdateR4300iRegisters)(void);
void(CALL * Enter_BPoint_Window)(void);
void(CALL * Enter_R4300i_Commands_Window)(void);
void(CALL * Enter_R4300i_Register_Window)(void);
void(CALL * Enter_RSP_Commands_Window)(void);
void(CALL * Enter_Memory_Window)(void);
2016-01-27 09:11:59 +00:00
} DEBUG_INFO;
public:
CRSP_Plugin(void);
~CRSP_Plugin();
2023-09-21 04:55:07 +00:00
void RomOpened(RenderWindow * Render);
void RomClose(RenderWindow * Render);
2016-01-27 09:11:59 +00:00
bool Initiate(CPlugins * Plugins, CN64System * System);
2023-09-21 04:55:07 +00:00
void EnableDebugging(int32_t Enable);
void RunRSP(void);
2016-01-27 09:11:59 +00:00
2023-09-21 04:55:07 +00:00
void * GetDebugMenu(void);
2016-01-27 09:11:59 +00:00
void ProcessMenuItem(int32_t id);
void PauseRSPThread(void);
void ResumeRSPThread(void);
2016-01-27 09:11:59 +00:00
private:
2022-10-10 00:22:17 +00:00
CRSP_Plugin(const CRSP_Plugin &);
CRSP_Plugin & operator=(const CRSP_Plugin &);
2016-01-27 09:11:59 +00:00
2023-09-21 04:55:07 +00:00
PLUGIN_TYPE type();
int32_t GetDefaultSettingStartRange() const;
int32_t GetSettingStartRange() const;
uint32_t RspThread(void);
static uint32_t stRspThread(void * lpThreadParameter);
2016-01-27 09:11:59 +00:00
bool LoadFunctions(void);
void UnloadPluginDetails(void);
2023-09-21 04:55:07 +00:00
void(CALL * m_EnableDebugging)(int32_t Enable);
void(CALL * m_GetDebugInfo)(RSPDEBUG_INFO * GFXDebugInfo);
void(CALL * m_InitiateDebugger)(DEBUG_INFO DebugInfo);
uint32_t(CALL * m_DoRspCycles)(uint32_t);
CPlugins * m_Plugins;
CN64System * m_System;
uint32_t m_AlistCount, m_DlistCount, m_UnknownCount;
SyncEvent m_RunEvent;
CThread m_Thread;
2016-01-27 09:11:59 +00:00
RSPDEBUG_INFO m_RSPDebug;
2022-10-10 00:22:17 +00:00
uint32_t m_CycleCount;
2023-09-21 04:55:07 +00:00
bool m_RomOpened;
2016-01-27 09:11:59 +00:00
};