Merge branch 'master' into d3d12

This commit is contained in:
Triang3l 2018-11-26 20:45:52 +03:00
commit b56f8f9c7c
7 changed files with 110 additions and 7 deletions

View File

@ -43,6 +43,8 @@ project("xenia-app")
"WinMain", -- Use WinMain instead of main. "WinMain", -- Use WinMain instead of main.
}) })
defines({ defines({
"XBYAK_NO_OP_NAMES",
"XBYAK_ENABLE_OMITTED_OPERAND",
}) })
includedirs({ includedirs({
project_root.."/third_party/gflags/src", project_root.."/third_party/gflags/src",

View File

@ -40,6 +40,8 @@
#include "xenia/hid/xinput/xinput_hid.h" #include "xenia/hid/xinput/xinput_hid.h"
#endif // XE_PLATFORM_WIN32 #endif // XE_PLATFORM_WIN32
#include "third_party/xbyak/xbyak/xbyak_util.h"
DEFINE_string(apu, "any", "Audio system. Use: [any, nop, xaudio2]"); DEFINE_string(apu, "any", "Audio system. Use: [any, nop, xaudio2]");
DEFINE_string(gpu, "any", "Graphics system. Use: [any, vulkan, null]"); DEFINE_string(gpu, "any", "Graphics system. Use: [any, vulkan, null]");
DEFINE_string(hid, "any", "Input system. Use: [any, nop, winkey, xinput]"); DEFINE_string(hid, "any", "Input system. Use: [any, nop, winkey, xinput]");
@ -153,6 +155,14 @@ int xenia_main(const std::vector<std::wstring>& args) {
Profiler::Initialize(); Profiler::Initialize();
Profiler::ThreadEnter("main"); Profiler::ThreadEnter("main");
Xbyak::util::Cpu cpu;
if (!cpu.has(Xbyak::util::Cpu::tAVX)) {
xe::FatalError(
"Your CPU does not support AVX, which is required by Xenia. See the "
"FAQ for system requirements at https://xenia.jp");
return -1;
}
// Figure out where content should go. // Figure out where content should go.
std::wstring content_root; std::wstring content_root;
if (!FLAGS_content_root.empty()) { if (!FLAGS_content_root.empty()) {

View File

@ -82,8 +82,8 @@ X64Emitter::X64Emitter(X64Backend* backend, XbyakAllocator* allocator)
if (!cpu_.has(Xbyak::util::Cpu::tAVX)) { if (!cpu_.has(Xbyak::util::Cpu::tAVX)) {
xe::FatalError( xe::FatalError(
"Your CPU is too old to support Xenia. See the FAQ for system " "Your CPU does not support AVX, which is required by Xenia. See the "
"requirements at https://xenia.jp"); "FAQ for system requirements at https://xenia.jp");
return; return;
} }
} }

View File

@ -10,6 +10,7 @@
#include "xenia/kernel/xam/app_manager.h" #include "xenia/kernel/xam/app_manager.h"
#include "xenia/kernel/kernel_state.h" #include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/xam/apps/unknown_fe_app.h"
#include "xenia/kernel/xam/apps/xgi_app.h" #include "xenia/kernel/xam/apps/xgi_app.h"
#include "xenia/kernel/xam/apps/xlivebase_app.h" #include "xenia/kernel/xam/apps/xlivebase_app.h"
#include "xenia/kernel/xam/apps/xmp_app.h" #include "xenia/kernel/xam/apps/xmp_app.h"
@ -24,9 +25,10 @@ App::App(KernelState* kernel_state, uint32_t app_id)
app_id_(app_id) {} app_id_(app_id) {}
void AppManager::RegisterApps(KernelState* kernel_state, AppManager* manager) { void AppManager::RegisterApps(KernelState* kernel_state, AppManager* manager) {
manager->RegisterApp(std::make_unique<apps::XmpApp>(kernel_state));
manager->RegisterApp(std::make_unique<apps::XgiApp>(kernel_state)); manager->RegisterApp(std::make_unique<apps::XgiApp>(kernel_state));
manager->RegisterApp(std::make_unique<apps::XLiveBaseApp>(kernel_state)); manager->RegisterApp(std::make_unique<apps::XLiveBaseApp>(kernel_state));
manager->RegisterApp(std::make_unique<apps::XmpApp>(kernel_state)); manager->RegisterApp(std::make_unique<apps::UnknownFEApp>(kernel_state));
} }
void AppManager::RegisterApp(std::unique_ptr<App> app) { void AppManager::RegisterApp(std::unique_ptr<App> app) {

View File

@ -0,0 +1,55 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/kernel/xam/apps/unknown_fe_app.h"
#include "xenia/base/logging.h"
#include "xenia/base/threading.h"
namespace xe {
namespace kernel {
namespace xam {
namespace apps {
UnknownFEApp::UnknownFEApp(KernelState* kernel_state)
: App(kernel_state, 0xFE) {}
X_RESULT UnknownFEApp::DispatchMessageSync(uint32_t message,
uint32_t buffer_ptr,
uint32_t buffer_length) {
// NOTE: buffer_length may be zero or valid.
auto buffer = memory_->TranslateVirtual(buffer_ptr);
switch (message) {
case 0x00020021: {
struct message_data {
char unk_00[64];
xe::be<uint32_t> unk_40; // KeGetCurrentProcessType() < 1 ? 1 : 0
xe::be<uint32_t> unk_44; // ? output_ptr ?
xe::be<uint32_t> unk_48; // ? overlapped_ptr ?
}* data = reinterpret_cast<message_data*>(buffer);
assert_true(buffer_length == sizeof(message_data));
auto unk = memory_->TranslateVirtual<xe::be<uint32_t>*>(data->unk_44);
*unk = 0;
XELOGD("UnknownFEApp(0x00020021)('%s', %.8X, %.8X, %.8X)", data->unk_00,
(uint32_t)data->unk_40, (uint32_t)data->unk_44,
(uint32_t)data->unk_48);
return X_ERROR_SUCCESS;
}
}
XELOGE(
"Unimplemented 0xFE message app=%.8X, msg=%.8X, arg1=%.8X, "
"arg2=%.8X",
app_id(), message, buffer_ptr, buffer_length);
return X_STATUS_UNSUCCESSFUL;
}
} // namespace apps
} // namespace xam
} // namespace kernel
} // namespace xe

View File

@ -0,0 +1,34 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_XAM_APPS_UNKNOWN_FE_APP_H_
#define XENIA_KERNEL_XAM_APPS_UNKNOWN_FE_APP_H_
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/xam/app_manager.h"
namespace xe {
namespace kernel {
namespace xam {
namespace apps {
class UnknownFEApp : public App {
public:
explicit UnknownFEApp(KernelState* kernel_state);
X_RESULT DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
uint32_t buffer_length) override;
};
} // namespace apps
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_APPS_UNKNOWN_FE_APP_H_

View File

@ -23,7 +23,7 @@ dword_result_t XMsgInProcessCall(dword_t app, dword_t message, dword_t arg1,
auto result = kernel_state()->app_manager()->DispatchMessageSync(app, message, auto result = kernel_state()->app_manager()->DispatchMessageSync(app, message,
arg1, arg2); arg1, arg2);
if (result == X_ERROR_NOT_FOUND) { if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgInProcessCall: app %.8X undefined", app); XELOGE("XMsgInProcessCall: app %.8X undefined", (uint32_t)app);
} }
return result; return result;
} }
@ -34,7 +34,7 @@ dword_result_t XMsgSystemProcessCall(dword_t app, dword_t message,
auto result = kernel_state()->app_manager()->DispatchMessageAsync( auto result = kernel_state()->app_manager()->DispatchMessageAsync(
app, message, buffer, buffer_length); app, message, buffer, buffer_length);
if (result == X_ERROR_NOT_FOUND) { if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgSystemProcessCall: app %.8X undefined", app); XELOGE("XMsgSystemProcessCall: app %.8X undefined", (uint32_t)app);
} }
return result; return result;
} }
@ -46,7 +46,7 @@ dword_result_t XMsgStartIORequest(dword_t app, dword_t message,
auto result = kernel_state()->app_manager()->DispatchMessageAsync( auto result = kernel_state()->app_manager()->DispatchMessageAsync(
app, message, buffer, buffer_length); app, message, buffer, buffer_length);
if (result == X_ERROR_NOT_FOUND) { if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgStartIORequest: app %.8X undefined", app); XELOGE("XMsgStartIORequest: app %.8X undefined", (uint32_t)app);
} }
if (overlapped_ptr) { if (overlapped_ptr) {
kernel_state()->CompleteOverlappedImmediate(overlapped_ptr, result); kernel_state()->CompleteOverlappedImmediate(overlapped_ptr, result);
@ -63,7 +63,7 @@ dword_result_t XMsgStartIORequestEx(dword_t app, dword_t message,
auto result = kernel_state()->app_manager()->DispatchMessageAsync( auto result = kernel_state()->app_manager()->DispatchMessageAsync(
app, message, buffer, buffer_length); app, message, buffer, buffer_length);
if (result == X_ERROR_NOT_FOUND) { if (result == X_ERROR_NOT_FOUND) {
XELOGE("XMsgStartIORequestEx: app %.8X undefined", app); XELOGE("XMsgStartIORequestEx: app %.8X undefined", (uint32_t)app);
} }
if (overlapped_ptr) { if (overlapped_ptr) {
kernel_state()->CompleteOverlappedImmediate(overlapped_ptr, result); kernel_state()->CompleteOverlappedImmediate(overlapped_ptr, result);