Merge branch 'master' into linux_windowing

This commit is contained in:
Triang3l
2021-08-26 22:58:14 +03:00
813 changed files with 429062 additions and 250262 deletions

View File

@@ -24,6 +24,7 @@
#include "xenia/ui/file_picker.h"
#include "xenia/ui/imgui_dialog.h"
#include "xenia/ui/imgui_drawer.h"
#include "xenia/ui/virtual_key.h"
// Autogenerated by `xb premake`.
#include "build/version.h"
@@ -53,7 +54,12 @@ EmulatorWindow::EmulatorWindow(Emulator* emulator)
" CHECKED"
#endif
#endif
" (" XE_BUILD_BRANCH "/" XE_BUILD_COMMIT_SHORT "/" XE_BUILD_DATE
" ("
#ifdef XE_BUILD_IS_PR
"PR#" XE_BUILD_PR_NUMBER " " XE_BUILD_PR_REPO
" " XE_BUILD_PR_BRANCH "@" XE_BUILD_PR_COMMIT_SHORT " against "
#endif
XE_BUILD_BRANCH "@" XE_BUILD_COMMIT_SHORT " on " XE_BUILD_DATE
")";
}
@@ -93,49 +99,49 @@ bool EmulatorWindow::Initialize() {
window_->on_key_down.AddListener([this](KeyEvent* e) {
bool handled = true;
switch (e->key_code()) {
case 0x4F: { // o
switch (e->virtual_key()) {
case ui::VirtualKey::kO: {
if (e->is_ctrl_pressed()) {
FileOpen();
}
} break;
case 0x6A: { // numpad *
case ui::VirtualKey::kMultiply: {
CpuTimeScalarReset();
} break;
case 0x6D: { // numpad minus
case ui::VirtualKey::kSubtract: {
CpuTimeScalarSetHalf();
} break;
case 0x6B: { // numpad plus
case ui::VirtualKey::kAdd: {
CpuTimeScalarSetDouble();
} break;
case 0x72: { // F3
case ui::VirtualKey::kF3: {
Profiler::ToggleDisplay();
} break;
case 0x73: { // VK_F4
case ui::VirtualKey::kF4: {
GpuTraceFrame();
} break;
case 0x74: { // VK_F5
case ui::VirtualKey::kF5: {
GpuClearCaches();
} break;
case 0x76: { // VK_F7
case ui::VirtualKey::kF7: {
// Save to file
// TODO: Choose path based on user input, or from options
// TODO: Spawn a new thread to do this.
emulator()->SaveToFile("test.sav");
} break;
case 0x77: { // VK_F8
case ui::VirtualKey::kF8: {
// Restore from file
// TODO: Choose path from user
// TODO: Spawn a new thread to do this.
emulator()->RestoreFromFile("test.sav");
} break;
case 0x7A: { // VK_F11
case ui::VirtualKey::kF11: {
ToggleFullscreen();
} break;
case 0x1B: { // VK_ESCAPE
// Allow users to escape fullscreen (but not enter it).
case ui::VirtualKey::kEscape: {
// Allow users to escape fullscreen (but not enter it).
if (window_->is_fullscreen()) {
window_->ToggleFullscreen(false);
} else {
@@ -143,18 +149,18 @@ bool EmulatorWindow::Initialize() {
}
} break;
case 0x13: { // VK_PAUSE
case ui::VirtualKey::kPause: {
CpuBreakIntoDebugger();
} break;
case 0x03: { // VK_CANCEL
case ui::VirtualKey::kCancel: {
CpuBreakIntoHostDebugger();
} break;
case 0x70: { // VK_F1
case ui::VirtualKey::kF1: {
ShowHelpWebsite();
} break;
case 0x71: { // VK_F2
case ui::VirtualKey::kF2: {
ShowCommitID();
} break;
@@ -425,8 +431,13 @@ void EmulatorWindow::ToggleFullscreen() {
void EmulatorWindow::ShowHelpWebsite() { LaunchWebBrowser("https://xenia.jp"); }
void EmulatorWindow::ShowCommitID() {
#ifdef XE_BUILD_IS_PR
LaunchWebBrowser(
"https://github.com/xenia-project/xenia/pull/" XE_BUILD_PR_NUMBER);
#else
LaunchWebBrowser(
"https://github.com/xenia-project/xenia/commit/" XE_BUILD_COMMIT "/");
#endif
}
void EmulatorWindow::UpdateTitle() {

View File

@@ -43,7 +43,6 @@ project("xenia-app")
"mspack",
"snappy",
"spirv-tools",
"volk",
"xxhash",
})
defines({

View File

@@ -329,6 +329,22 @@ int xenia_main(const std::vector<std::string>& args) {
emulator->file_system()->RegisterSymbolicLink("cache1:", "\\CACHE1");
}
}
// Some (older?) games try accessing cache:\ too
// NOTE: this must be registered _after_ the cache0/cache1 devices, due to
// substring/start_with logic inside VirtualFileSystem::ResolvePath, else
// accesses to those devices will go here instead
auto cache_device =
std::make_unique<xe::vfs::HostPathDevice>("\\CACHE", "cache", false);
if (!cache_device->Initialize()) {
XELOGE("Unable to scan cache path");
} else {
if (!emulator->file_system()->RegisterDevice(std::move(cache_device))) {
XELOGE("Unable to register cache path");
} else {
emulator->file_system()->RegisterSymbolicLink("cache:", "\\CACHE");
}
}
}
// Set a debug handler.