2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2015-11-10 05:21:49 +00:00
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
2012-12-19 09:30:18 +00:00
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#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,
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
SysEvent_Profile_StartStop,
|
|
|
|
SysEvent_Profile_ResetLogs,
|
|
|
|
SysEvent_Profile_GenerateLogs,
|
2010-06-04 06:25:07 +00:00
|
|
|
};
|
|
|
|
|
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:
|
2016-09-24 20:46:19 +00:00
|
|
|
CSystemEvents(); // Disable default constructor
|
|
|
|
CSystemEvents(const CSystemEvents&); // Disable copy constructor
|
|
|
|
CSystemEvents& operator=(const CSystemEvents&); // Disable assignment
|
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
|
|
|
|
2016-09-24 20:46:19 +00:00
|
|
|
CN64System * m_System;
|
|
|
|
CPlugins * m_Plugins;
|
|
|
|
EventList m_Events;
|
2015-12-06 09:59:58 +00:00
|
|
|
int32_t m_bDoSomething;
|
2016-09-24 20:46:19 +00:00
|
|
|
CriticalSection m_CS;
|
2015-01-31 19:27:27 +00:00
|
|
|
};
|