[HID] Pass 'is active' callback to input drivers.

This commit is contained in:
gibbed
2020-11-27 05:20:17 -06:00
committed by Rick Gibbed
parent f8e6ac4108
commit dd25e69e66
8 changed files with 39 additions and 13 deletions

View File

@@ -19,6 +19,10 @@ namespace xe {
namespace kernel {
namespace xam {
std::atomic<int> xam_dialogs_shown_ = {0};
bool xeXamIsUIActive() { return xam_dialogs_shown_ > 0; }
XamModule::XamModule(Emulator* emulator, KernelState* kernel_state)
: KernelModule(kernel_state, "xe:\\xam.xex"), loader_data_() {
RegisterExportTable(export_resolver_);

View File

@@ -21,6 +21,8 @@ namespace xe {
namespace kernel {
namespace xam {
bool xeXamIsUIActive();
class XamModule : public KernelModule {
public:
XamModule(Emulator* emulator, KernelState* kernel_state);

View File

@@ -18,6 +18,8 @@ namespace xe {
namespace kernel {
namespace xam {
bool xeXamIsUIActive();
xe::cpu::Export* RegisterExport_xam(xe::cpu::Export* export_entry);
// Registration functions, one per file.

View File

@@ -41,7 +41,7 @@ namespace xam {
// We deliberately delay the XN_SYS_UI = false notification to give games time
// to create a listener (if they're insane enough do this).
std::atomic<int> xam_dialogs_shown_ = {0};
extern std::atomic<int> xam_dialogs_shown_;
class XamDialog : public xe::ui::ImGuiDialog {
public:
@@ -192,7 +192,7 @@ X_RESULT xeXamDispatchHeadlessEx(
}
}
dword_result_t XamIsUIActive() { return xam_dialogs_shown_ > 0 ? 1 : 0; }
dword_result_t XamIsUIActive() { return xeXamIsUIActive(); }
DECLARE_XAM_EXPORT2(XamIsUIActive, kUI, kImplemented, kHighFrequency);
class MessageBoxDialog : public XamDialog {