2012-12-19 09:30:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
2015-12-19 23:57:27 +00:00
|
|
|
#include <Common/CriticalSection.h>
|
2015-12-06 09:59:58 +00:00
|
|
|
|
2015-03-29 17:19:28 +00:00
|
|
|
enum SystemEvent
|
|
|
|
{
|
2015-11-07 03:32:23 +00:00
|
|
|
SysEvent_ExecuteInterrupt,
|
|
|
|
SysEvent_GSButtonPressed,
|
|
|
|
SysEvent_ResetCPU_Soft,
|
|
|
|
SysEvent_ResetCPU_SoftDone,
|
|
|
|
SysEvent_ResetCPU_Hard,
|
|
|
|
SysEvent_CloseCPU,
|
|
|
|
SysEvent_PauseCPU_FromMenu,
|
|
|
|
SysEvent_PauseCPU_AppLostActive,
|
|
|
|
SysEvent_PauseCPU_AppLostActiveDelay,
|
|
|
|
SysEvent_PauseCPU_AppLostFocus,
|
|
|
|
SysEvent_PauseCPU_SaveGame,
|
|
|
|
SysEvent_PauseCPU_LoadGame,
|
|
|
|
SysEvent_PauseCPU_DumpMemory,
|
|
|
|
SysEvent_PauseCPU_SearchMemory,
|
|
|
|
SysEvent_PauseCPU_Settings,
|
|
|
|
SysEvent_PauseCPU_Cheats,
|
2018-04-14 12:23:28 +00:00
|
|
|
SysEvent_PauseCPU_ChangingBPs,
|
2021-01-17 03:17:58 +00:00
|
|
|
SysEvent_PauseCPU_Enhancement,
|
2015-11-07 03:32:23 +00:00
|
|
|
SysEvent_ResumeCPU_FromMenu,
|
|
|
|
SysEvent_ResumeCPU_AppGainedActive,
|
|
|
|
SysEvent_ResumeCPU_AppGainedFocus,
|
|
|
|
SysEvent_ResumeCPU_SaveGame,
|
|
|
|
SysEvent_ResumeCPU_LoadGame,
|
|
|
|
SysEvent_ResumeCPU_DumpMemory,
|
|
|
|
SysEvent_ResumeCPU_SearchMemory,
|
|
|
|
SysEvent_ResumeCPU_Settings,
|
|
|
|
SysEvent_ResumeCPU_Cheats,
|
2018-04-14 12:23:28 +00:00
|
|
|
SysEvent_ResumeCPU_ChangingBPs,
|
2021-01-17 03:17:58 +00:00
|
|
|
SysEvent_ResumeCPU_Enhancement,
|
2015-11-07 03:32:23 +00:00
|
|
|
SysEvent_ChangingFullScreen,
|
|
|
|
SysEvent_ChangePlugins,
|
|
|
|
SysEvent_SaveMachineState,
|
|
|
|
SysEvent_LoadMachineState,
|
|
|
|
SysEvent_Interrupt_SP,
|
|
|
|
SysEvent_Interrupt_SI,
|
|
|
|
SysEvent_Interrupt_AI,
|
|
|
|
SysEvent_Interrupt_VI,
|
|
|
|
SysEvent_Interrupt_PI,
|
|
|
|
SysEvent_Interrupt_DP,
|
2016-10-02 21:46:05 +00:00
|
|
|
SysEvent_ResetFunctionTimes,
|
|
|
|
SysEvent_DumpFunctionTimes,
|
2018-01-20 23:18:52 +00:00
|
|
|
SysEvent_ResetRecompilerCode,
|
2010-06-04 06:25:07 +00:00
|
|
|
};
|
|
|
|
|
2017-04-27 22:23:15 +00:00
|
|
|
const char * SystemEventName(SystemEvent event);
|
|
|
|
|
2015-12-06 09:59:58 +00:00
|
|
|
class CN64System;
|
|
|
|
class CPlugins;
|
|
|
|
|
2010-06-04 06:25:07 +00:00
|
|
|
class CSystemEvents
|
|
|
|
{
|
2016-09-24 20:46:19 +00:00
|
|
|
typedef std::vector<SystemEvent> EventList;
|
2010-06-04 06:25:07 +00:00
|
|
|
|
|
|
|
protected:
|
2016-09-24 20:46:19 +00:00
|
|
|
CSystemEvents(CN64System * System, CPlugins * Plugins);
|
|
|
|
virtual ~CSystemEvents();
|
2010-06-04 06:25:07 +00:00
|
|
|
|
|
|
|
public:
|
2016-09-24 20:46:19 +00:00
|
|
|
void ExecuteEvents();
|
|
|
|
void QueueEvent(SystemEvent action);
|
2010-06-04 06:25:07 +00:00
|
|
|
|
2015-12-06 09:59:58 +00:00
|
|
|
const int32_t & DoSomething() const
|
2016-09-24 20:46:19 +00:00
|
|
|
{
|
|
|
|
return m_bDoSomething;
|
|
|
|
}
|
2010-06-04 06:25:07 +00:00
|
|
|
|
|
|
|
private:
|
2021-04-13 00:07:11 +00:00
|
|
|
CSystemEvents();
|
2022-10-10 00:22:17 +00:00
|
|
|
CSystemEvents(const CSystemEvents &);
|
|
|
|
CSystemEvents & operator=(const CSystemEvents &);
|
2012-12-18 23:55:05 +00:00
|
|
|
|
2016-09-24 20:46:19 +00:00
|
|
|
void ChangePluginFunc();
|
2010-06-04 06:25:07 +00:00
|
|
|
|
2022-10-10 00:22:17 +00:00
|
|
|
CN64System * m_System;
|
|
|
|
CPlugins * m_Plugins;
|
|
|
|
EventList m_Events;
|
|
|
|
int32_t m_bDoSomething;
|
2016-09-24 20:46:19 +00:00
|
|
|
CriticalSection m_CS;
|
2015-01-31 19:27:27 +00:00
|
|
|
};
|