2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2021-07-04 11:09:46 +00:00
|
|
|
#include <memory>
|
2014-03-12 19:33:41 +00:00
|
|
|
#include <string>
|
2020-12-27 22:11:22 +00:00
|
|
|
#include <vector>
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2021-07-04 11:09:46 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
2008-07-12 17:40:22 +00:00
|
|
|
// Host - defines an interface for the emulator core to communicate back to the
|
|
|
|
// OS-specific layer
|
2018-05-28 17:03:29 +00:00
|
|
|
//
|
2008-07-12 17:40:22 +00:00
|
|
|
// The emulator core is abstracted from the OS using 2 interfaces:
|
|
|
|
// Common and Host.
|
2018-05-28 17:03:29 +00:00
|
|
|
//
|
2008-07-12 17:40:22 +00:00
|
|
|
// Common simply provides OS-neutral implementations of things like threads, mutexes,
|
|
|
|
// INI file manipulation, memory mapping, etc.
|
2018-05-28 17:03:29 +00:00
|
|
|
//
|
2008-07-12 17:40:22 +00:00
|
|
|
// 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.
|
2018-05-28 17:03:29 +00:00
|
|
|
//
|
2008-07-12 17:40:22 +00:00
|
|
|
// The host can be just a command line app that opens a window, or a full blown debugger
|
|
|
|
// interface.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2021-07-04 11:09:46 +00:00
|
|
|
namespace HW::GBA
|
|
|
|
{
|
|
|
|
class Core;
|
|
|
|
} // namespace HW::GBA
|
|
|
|
|
|
|
|
class GBAHostInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~GBAHostInterface() = default;
|
|
|
|
virtual void GameChanged() = 0;
|
|
|
|
virtual void FrameEnded(const std::vector<u32>& video_buffer) = 0;
|
|
|
|
};
|
|
|
|
|
2018-05-28 17:03:29 +00:00
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2020-12-27 22:11:22 +00:00
|
|
|
std::vector<std::string> Host_GetPreferredLocales();
|
2019-03-18 16:30:33 +00:00
|
|
|
bool Host_UIBlocksControllerState();
|
2011-01-30 16:40:38 +00:00
|
|
|
bool Host_RendererHasFocus();
|
2021-05-09 10:28:04 +00:00
|
|
|
bool Host_RendererHasFullFocus();
|
2015-01-04 16:09:56 +00:00
|
|
|
bool Host_RendererIsFullscreen();
|
2020-12-27 22:11:22 +00:00
|
|
|
|
2018-05-28 17:03:29 +00:00
|
|
|
void Host_Message(HostMessageID id);
|
2008-07-12 17:40:22 +00:00
|
|
|
void Host_NotifyMapLoaded();
|
2011-01-31 14:25:50 +00:00
|
|
|
void Host_RefreshDSPDebuggerWindow();
|
2011-01-25 03:30:12 +00:00
|
|
|
void Host_RequestRenderWindowSize(int width, int height);
|
2011-01-30 16:40:38 +00:00
|
|
|
void Host_UpdateDisasmDialog();
|
|
|
|
void Host_UpdateMainFrame();
|
2014-03-12 19:33:41 +00:00
|
|
|
void Host_UpdateTitle(const std::string& title);
|
2016-11-10 16:55:21 +00:00
|
|
|
void Host_YieldToUI();
|
2019-02-14 02:31:31 +00:00
|
|
|
void Host_TitleChanged();
|
2021-07-04 11:09:46 +00:00
|
|
|
|
2022-08-03 04:46:11 +00:00
|
|
|
void Host_UpdateDiscordClientID(const std::string& client_id = {});
|
|
|
|
bool Host_UpdateDiscordPresenceRaw(const std::string& details = {}, const std::string& state = {},
|
|
|
|
const std::string& large_image_key = {},
|
|
|
|
const std::string& large_image_text = {},
|
|
|
|
const std::string& small_image_key = {},
|
|
|
|
const std::string& small_image_text = {},
|
|
|
|
const int64_t start_timestamp = 0,
|
|
|
|
const int64_t end_timestamp = 0, const int party_size = 0,
|
|
|
|
const int party_max = 0);
|
|
|
|
|
2021-07-04 11:09:46 +00:00
|
|
|
std::unique_ptr<GBAHostInterface> Host_CreateGBAHost(std::weak_ptr<HW::GBA::Core> core);
|