Common: Move host communication enum to Host.h
Given this is actually a part of the Host interface, this should be placed with it. While we're at it, turn it into an enum class so that we don't dump its contained values into the surrounding scope. We can also make Host_Message take the enum type itself directly instead of taking a general int value. After this, it'll be trivial to divide out the rest of Common.h and remove the header from the repository entirely
This commit is contained in:
1 parent
bda668925a
commit
4288bfe0f9
13 files changed
+38
-38
No files matched your search
@@ -291,7 +291,7 @@ static void CPUSetInitialExecutionState()
|
||||
SetState(SConfig::GetInstance().bBootToPause ? State::Paused : State::Running);
|
||||
Host_UpdateDisasmDialog();
|
||||
Host_UpdateMainFrame();
|
||||
Host_Message(WM_USER_CREATE);
|
||||
Host_Message(HostMessageID::WMUserCreate);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -924,7 +924,7 @@ void QueueHostJob(std::function<void()> job, bool run_during_stop)
|
||||
}
|
||||
// If the the queue was empty then kick the Host to come and get this job.
|
||||
if (send_message)
|
||||
Host_Message(WM_USER_JOB_DISPATCH);
|
||||
Host_Message(HostMessageID::WMUserJobDispatch);
|
||||
}
|
||||
|
||||
void HostDispatchJobs()
|
||||
|
||||
@@ -100,7 +100,7 @@ void UpdateWantDeterminism(bool initial = false);
|
||||
void QueueHostJob(std::function<void()> job, bool run_during_stop = false);
|
||||
|
||||
// Should be called periodically by the Host to run pending jobs.
|
||||
// WM_USER_JOB_DISPATCH will be sent when something is added to the queue.
|
||||
// WMUserJobDispatch will be sent when something is added to the queue.
|
||||
void HostDispatchJobs();
|
||||
|
||||
void DoFrameStep();
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
{
|
||||
case CPU::State::PowerDown:
|
||||
CPU::Break();
|
||||
Host_Message(WM_USER_STOP);
|
||||
Host_Message(HostMessageID::WMUserStop);
|
||||
break;
|
||||
|
||||
case CPU::State::Stepping:
|
||||
|
||||
@@ -25,7 +25,7 @@ void HBReload()
|
||||
{
|
||||
// There isn't much we can do. Just stop cleanly.
|
||||
CPU::Break();
|
||||
Host_Message(WM_USER_STOP);
|
||||
Host_Message(HostMessageID::WMUserStop);
|
||||
}
|
||||
|
||||
void GeckoCodeHandlerICacheFlush()
|
||||
|
||||
+14
-5
@@ -8,25 +8,34 @@
|
||||
|
||||
// Host - defines an interface for the emulator core to communicate back to the
|
||||
// OS-specific layer
|
||||
|
||||
//
|
||||
// The emulator core is abstracted from the OS using 2 interfaces:
|
||||
// Common and Host.
|
||||
|
||||
//
|
||||
// Common simply provides OS-neutral implementations of things like threads, mutexes,
|
||||
// INI file manipulation, memory mapping, etc.
|
||||
|
||||
//
|
||||
// Host is an abstract interface for communicating things back to the host. The emulator
|
||||
// core is treated as a library, not as a main program, because it is far easier to
|
||||
// write GUI interfaces that control things than to squash GUI into some model that wasn't
|
||||
// designed for it.
|
||||
|
||||
//
|
||||
// The host can be just a command line app that opens a window, or a full blown debugger
|
||||
// interface.
|
||||
|
||||
enum class HostMessageID
|
||||
{
|
||||
// Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
|
||||
WMUserStop = 10,
|
||||
WMUserCreate,
|
||||
WMUserSetCursor,
|
||||
WMUserJobDispatch,
|
||||
};
|
||||
|
||||
bool Host_UINeedsControllerState();
|
||||
bool Host_RendererHasFocus();
|
||||
bool Host_RendererIsFullscreen();
|
||||
void Host_Message(int Id);
|
||||
void Host_Message(HostMessageID id);
|
||||
void Host_NotifyMapLoaded();
|
||||
void Host_RefreshDSPDebuggerWindow();
|
||||
void Host_RequestRenderWindowSize(int width, int height);
|
||||
|
||||
Reference in new issue
Block a user