2013-04-17 22:43:11 -04:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Core
|
|
|
|
|
|
|
|
// The external interface to the emulator core. Plus some extras.
|
|
|
|
// This is another part of the emu that needs cleaning - Core.cpp really has
|
|
|
|
// too much random junk inside.
|
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
#include <string>
|
2014-02-19 13:09:14 -05:00
|
|
|
#include <vector>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "Core/CoreParameter.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-07-08 15:58:25 +02:00
|
|
|
// TODO: ugly, remove
|
|
|
|
extern bool g_aspect_wide;
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
namespace Core
|
|
|
|
{
|
2011-01-31 01:28:32 +00:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
// Get core parameters
|
|
|
|
// TODO: kill, use SConfig instead
|
|
|
|
extern SCoreStartupParameter g_CoreStartupParameter;
|
|
|
|
|
2014-04-30 12:50:29 +02:00
|
|
|
bool GetIsFramelimiterTempDisabled();
|
|
|
|
void SetIsFramelimiterTempDisabled(bool disable);
|
2013-03-18 20:41:45 -04:00
|
|
|
|
2011-01-31 01:28:32 +00:00
|
|
|
void Callback_VideoCopiedToXFB(bool video_update);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
enum EState
|
|
|
|
{
|
2013-04-16 23:14:36 -04:00
|
|
|
CORE_UNINITIALIZED,
|
|
|
|
CORE_PAUSE,
|
|
|
|
CORE_RUN,
|
2011-03-15 23:09:12 +00:00
|
|
|
CORE_STOPPING
|
|
|
|
};
|
2009-01-18 01:45:53 +00:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
bool Init();
|
|
|
|
void Stop();
|
2014-06-20 02:43:57 +02:00
|
|
|
void Shutdown();
|
2010-06-06 03:52:11 +00:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
std::string StopMessage(bool, std::string);
|
2010-07-16 14:14:57 +00:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
bool IsRunning();
|
2011-12-30 20:16:12 -08:00
|
|
|
bool IsRunningAndStarted(); // is running and the cpu loop has been entered
|
2011-03-15 23:09:12 +00:00
|
|
|
bool IsRunningInCurrentThread(); // this tells us whether we are running in the cpu thread.
|
|
|
|
bool IsCPUThread(); // this tells us whether we are the cpu thread.
|
2011-12-30 20:16:12 -08:00
|
|
|
bool IsGPUThread();
|
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
void SetState(EState _State);
|
|
|
|
EState GetState();
|
2009-02-22 21:16:12 +00:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
void SaveScreenShot();
|
|
|
|
|
|
|
|
void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
|
|
|
|
|
|
|
void* GetWindowHandle();
|
2013-04-16 23:14:36 -04:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
void StartTrace(bool write);
|
|
|
|
|
|
|
|
// This displays messages in a user-visible way.
|
2014-03-12 15:33:41 -04:00
|
|
|
void DisplayMessage(const std::string& message, int time_in_ms);
|
2013-10-29 01:23:17 -04:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
std::string GetStateFileName();
|
|
|
|
void SetStateFileName(std::string val);
|
2013-04-16 23:14:36 -04:00
|
|
|
|
2011-03-15 23:09:12 +00:00
|
|
|
int SyncTrace();
|
|
|
|
void SetBlockStart(u32 addr);
|
|
|
|
void StopTrace();
|
|
|
|
|
|
|
|
bool ShouldSkipFrame(int skipped);
|
|
|
|
void VideoThrottle();
|
2011-12-14 04:03:05 -08:00
|
|
|
void RequestRefreshInfo();
|
2011-03-15 23:09:12 +00:00
|
|
|
|
2013-01-16 22:52:01 -05:00
|
|
|
void UpdateTitle();
|
|
|
|
|
2011-12-30 20:16:12 -08:00
|
|
|
// waits until all systems are paused and fully idle, and acquires a lock on that state.
|
|
|
|
// or, if doLock is false, releases a lock on that state and optionally unpauses.
|
|
|
|
// calls must be balanced (once with doLock true, then once with doLock false) but may be recursive.
|
|
|
|
// the return value of the first call should be passed in as the second argument of the second call.
|
|
|
|
bool PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
|
|
|
|
2014-06-20 02:43:57 +02:00
|
|
|
// for calling back into UI code without introducing a dependency on it in core
|
|
|
|
typedef void(*StoppedCallbackFunc)(void);
|
|
|
|
void SetOnStoppedCallback(StoppedCallbackFunc callback);
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
} // namespace
|