From 7f4f90b1ea877ad30b695d2e1a79d22a465ce9b4 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 24 Nov 2018 20:50:30 -0600 Subject: [PATCH 1/2] Emit mspack debug messages to Xenia. --- third_party/mspack.lua | 7 +++++-- third_party/mspack/logging.cc | 10 ++++++++++ third_party/mspack/lzxd.c | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 third_party/mspack/logging.cc diff --git a/third_party/mspack.lua b/third_party/mspack.lua index 85b6bc08f..c1d1b44a5 100644 --- a/third_party/mspack.lua +++ b/third_party/mspack.lua @@ -2,8 +2,10 @@ group("third_party") project("mspack") uuid("0881692A-75A1-4E7B-87D8-BB9108CEDEA4") kind("StaticLib") - language("C") - + language("C++") + links({ + "xenia-base", + }) defines({ "_LIB", "HAVE_CONFIG_H", @@ -16,6 +18,7 @@ project("mspack") "mspack", }) files({ + "mspack/logging.cc", "mspack/lzx.h", "mspack/lzxd.c", "mspack/mspack.h", diff --git a/third_party/mspack/logging.cc b/third_party/mspack/logging.cc new file mode 100644 index 000000000..ae70478d0 --- /dev/null +++ b/third_party/mspack/logging.cc @@ -0,0 +1,10 @@ +#include "xenia/base/logging.h" + +extern "C" void xenia_log(const char* fmt, ...) { + char buffer[128]; + va_list args; + va_start(args, fmt); + vsnprintf(buffer, sizeof(buffer), fmt, args); + va_end(args); + XELOGW("mspack: %s", buffer); +} diff --git a/third_party/mspack/lzxd.c b/third_party/mspack/lzxd.c index 6cc33df08..548366409 100644 --- a/third_party/mspack/lzxd.c +++ b/third_party/mspack/lzxd.c @@ -15,6 +15,11 @@ #include #include +extern void xenia_log(const char*, ...); + +#undef D +#define D(x) do { xenia_log x; } while (0); + /* Microsoft's LZX document (in cab-sdk.exe) and their implementation * of the com.ms.util.cab Java package do not concur. * From 20315850dba1be29c81e58562b389866c8c13b75 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 24 Nov 2018 20:53:45 -0600 Subject: [PATCH 2/2] [Kernel] Stub XamFeatureEnabled. --- src/xenia/kernel/xam/xam_info.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xenia/kernel/xam/xam_info.cc b/src/xenia/kernel/xam/xam_info.cc index 3065211b1..fd722a68c 100644 --- a/src/xenia/kernel/xam/xam_info.cc +++ b/src/xenia/kernel/xam/xam_info.cc @@ -28,6 +28,9 @@ namespace xam { constexpr uint32_t X_LANGUAGE_ENGLISH = 1; constexpr uint32_t X_LANGUAGE_JAPANESE = 2; +dword_result_t XamFeatureEnabled(dword_t unk) { return 0; } +DECLARE_XAM_EXPORT1(XamFeatureEnabled, kNone, kStub); + // Empty stub schema binary. uint8_t schema_bin[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,