2013-04-17 22:43:11 -04:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 22:43:11 -04:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-09-07 20:06:58 -05:00
|
|
|
#include "Common/CommonTypes.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
namespace Common {
|
|
|
|
class Event;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CCPU
|
|
|
|
{
|
|
|
|
public:
|
2013-10-29 01:23:17 -04:00
|
|
|
// init
|
2010-01-19 19:28:27 +00:00
|
|
|
static void Init(int cpu_core);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// shutdown
|
|
|
|
static void Shutdown();
|
|
|
|
|
|
|
|
// starts the CPU
|
|
|
|
static void Run();
|
|
|
|
|
|
|
|
// causes shutdown
|
2013-10-29 01:23:17 -04:00
|
|
|
static void Stop();
|
2008-12-08 04:46:09 +00:00
|
|
|
// Reset
|
|
|
|
static void Reset();
|
|
|
|
|
|
|
|
// StepOpcode (Steps one Opcode)
|
2014-03-09 21:14:26 +01:00
|
|
|
static void StepOpcode(Common::Event *event = nullptr);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// one step only
|
|
|
|
static void SingleStep();
|
|
|
|
|
|
|
|
// Enable or Disable Stepping
|
2013-10-29 01:23:17 -04:00
|
|
|
static void EnableStepping(const bool _bStepping);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-02-17 23:07:10 +00:00
|
|
|
// break, same as EnableStepping(true).
|
|
|
|
static void Break();
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
// is stepping ?
|
|
|
|
static bool IsStepping();
|
2011-12-30 20:16:12 -08:00
|
|
|
|
|
|
|
// waits until is stepping and is ready for a command (paused and fully idle), and acquires a lock on that state.
|
|
|
|
// or, if doLock is false, releases a lock on that state and optionally re-disables stepping.
|
|
|
|
// calls must be balanced and non-recursive (once with doLock true, then once with doLock false).
|
|
|
|
// intended (but not required) to be called from another thread,
|
|
|
|
// e.g. when the GUI thread wants to make sure everything is paused so that it can create a savestate.
|
2014-11-13 21:28:27 -05:00
|
|
|
// the return value is whether the CPU was unpaused before the call.
|
2011-12-30 20:16:12 -08:00
|
|
|
static bool PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|