summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Vanik <ben.vanik@gmail.com>2014-12-19 16:50:27 -0800
committerBen Vanik <ben.vanik@gmail.com>2014-12-19 16:50:27 -0800
commitde9b6bdc8f39b89f8ac482e29d5e200884762bbf (patch)
treecf8bdc7e92dbbd3693241d705b9ef54f87d52397 /tools
parent9460f737e9f4faec640a2336e661cb9a8875e910 (diff)
Moving xenia-run to just be xenia.
Diffstat (limited to 'tools')
-rw-r--r--tools/tools.gypi1
-rw-r--r--tools/xenia-run/xenia-run.cc74
-rw-r--r--tools/xenia-run/xenia-run.gypi27
3 files changed, 0 insertions, 102 deletions
diff --git a/tools/tools.gypi b/tools/tools.gypi
index 685b8164b..7632461e1 100644
--- a/tools/tools.gypi
+++ b/tools/tools.gypi
@@ -1,6 +1,5 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'includes': [
- 'xenia-run/xenia-run.gypi',
],
}
diff --git a/tools/xenia-run/xenia-run.cc b/tools/xenia-run/xenia-run.cc
deleted file mode 100644
index 55dc11e64..000000000
--- a/tools/xenia-run/xenia-run.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- ******************************************************************************
- * 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 <gflags/gflags.h>
-#include <poly/main.h>
-#include <xenia/emulator.h>
-#include <xenia/kernel/kernel.h>
-
-using namespace xe;
-
-DEFINE_string(target, "", "Specifies the target .xex or .iso to execute.");
-
-int xenia_run(std::vector<std::wstring>& args) {
- Profiler::Initialize();
- Profiler::ThreadEnter("main");
-
- // Grab path from the flag or unnamed argument.
- if (!FLAGS_target.size() && args.size() < 2) {
- google::ShowUsageWithFlags("xenia-run");
- PFATAL("Pass a file to launch.");
- return 1;
- }
- std::wstring path;
- if (FLAGS_target.size()) {
- // Passed as a named argument.
- // TODO(benvanik): find something better than gflags that supports unicode.
- path = poly::to_wstring(FLAGS_target);
- } else {
- // Passed as an unnamed argument.
- path = args[1];
- }
- // Normalize the path and make absolute.
- std::wstring abs_path = poly::to_absolute_path(path);
-
- // Create the emulator.
- auto emulator = std::make_unique<Emulator>(L"");
- X_STATUS result = emulator->Setup();
- if (XFAILED(result)) {
- XELOGE("Failed to setup emulator: %.8X", result);
- return 1;
- }
-
- // Launch based on file type.
- // This is a silly guess based on file extension.
- auto file_system_type = emulator->file_system()->InferType(abs_path);
- switch (file_system_type) {
- case kernel::fs::FileSystemType::STFS_TITLE:
- result = emulator->LaunchSTFSTitle(abs_path);
- break;
- case kernel::fs::FileSystemType::XEX_FILE:
- result = emulator->LaunchXexFile(abs_path);
- break;
- case kernel::fs::FileSystemType::DISC_IMAGE:
- result = emulator->LaunchDiscImage(abs_path);
- break;
- }
- if (XFAILED(result)) {
- XELOGE("Failed to launch target: %.8X", result);
- return 1;
- }
-
- emulator.reset();
- Profiler::Dump();
- Profiler::Shutdown();
- return 0;
-}
-
-DEFINE_ENTRY_POINT(L"xenia-run", L"xenia-run some.xex", xenia_run);
diff --git a/tools/xenia-run/xenia-run.gypi b/tools/xenia-run/xenia-run.gypi
deleted file mode 100644
index 2d2702ac7..000000000
--- a/tools/xenia-run/xenia-run.gypi
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2013 Ben Vanik. All Rights Reserved.
-{
- 'targets': [
- {
- 'target_name': 'xenia-run',
- 'type': 'executable',
-
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'SubSystem': '2'
- },
- },
-
- 'dependencies': [
- 'xenia',
- ],
-
- 'include_dirs': [
- '.',
- ],
-
- 'sources': [
- 'xenia-run.cc',
- ],
- },
- ],
-}