From 3a64cf64e069703abe6dda8a73fc08e0b42f9b70 Mon Sep 17 00:00:00 2001 From: gibbed Date: Tue, 23 Oct 2018 16:43:31 -0500 Subject: [PATCH] [Kernel] Stub HidReadKeys. --- src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc | 40 ++++++++++++++++++++ src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc | 1 + src/xenia/kernel/xboxkrnl/xboxkrnl_private.h | 2 + 3 files changed, 43 insertions(+) create mode 100644 src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc new file mode 100644 index 000000000..bf63b923b --- /dev/null +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc @@ -0,0 +1,40 @@ +/** + ****************************************************************************** + * Xenia : Xbox 360 Emulator Research Project * + ****************************************************************************** + * Copyright 2013 Ben Vanik. All rights reserved. * + * Released under the BSD license - see LICENSE in the root for more details. * + ****************************************************************************** + */ + +#include "xenia/base/logging.h" +#include "xenia/kernel/kernel_state.h" +#include "xenia/kernel/util/shim_utils.h" +#include "xenia/kernel/xboxkrnl/xboxkrnl_private.h" +#include "xenia/xbox.h" + +namespace xe { +namespace kernel { +namespace xboxkrnl { + +dword_result_t HidReadKeys(dword_t unk1, unknown_t unk2, unknown_t unk3) { + /* TODO(gibbed): + * Games check for the following errors: + * 0xC000009D - translated to 0x48F - ERROR_DEVICE_NOT_CONNECTED + * 0x103 - translated to 0x10D2 - ERROR_EMPTY + * Other errors appear to be ignored? + * + * unk1 is 0 + * unk2 is a pointer to &unk3[2], possibly a 6-byte vuffer + * unk3 is a pointer to a 20-byte buffer + */ + return 0xC000009D; +} +DECLARE_XBOXKRNL_EXPORT(HidReadKeys, ExportTag::kStub); + +void RegisterHidExports(xe::cpu::ExportResolver* export_resolver, + KernelState* kernel_state) {} + +} // namespace xboxkrnl +} // namespace kernel +} // namespace xe diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc index 0410bc0fd..706c58ca8 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_module.cc @@ -86,6 +86,7 @@ XboxkrnlModule::XboxkrnlModule(Emulator* emulator, KernelState* kernel_state) RegisterDebugExports(export_resolver_, kernel_state_); RegisterErrorExports(export_resolver_, kernel_state_); RegisterHalExports(export_resolver_, kernel_state_); + RegisterHidExports(export_resolver_, kernel_state_); RegisterIoExports(export_resolver_, kernel_state_); RegisterMemoryExports(export_resolver_, kernel_state_); RegisterMiscExports(export_resolver_, kernel_state_); diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_private.h b/src/xenia/kernel/xboxkrnl/xboxkrnl_private.h index feb95649c..b198892e0 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_private.h +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_private.h @@ -33,6 +33,8 @@ void RegisterErrorExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state); void RegisterHalExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state); +void RegisterHidExports(xe::cpu::ExportResolver* export_resolver, + KernelState* kernel_state); void RegisterIoExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state); void RegisterMemoryExports(xe::cpu::ExportResolver* export_resolver,