mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-19 14:47:49 -04:00
game: Remove temporary CLI arg shim in gk
(#2532)
This commit is contained in:
parent
47d85f896e
commit
a264b6539b
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -57,6 +57,7 @@ texture_replacements/*
|
|||
|
||||
# generated cmake files
|
||||
svnrev.h
|
||||
common/versions/revision.h
|
||||
ci-artifacts/
|
||||
out/build/
|
||||
__pycache__/
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
function(write_revision_h)
|
||||
find_package(Git)
|
||||
set(GIT_SHORT_SHA "")
|
||||
set(GIT_TAG "")
|
||||
if(NOT GIT_FOUND)
|
||||
MESSAGE(STATUS "write_revision_h(): git was not found")
|
||||
endif()
|
||||
MESSAGE(STATUS "write_revision_h(): ${CMAKE_SOURCE_DIR}")
|
||||
if (GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
MESSAGE(STATUS "Git found, using it to get revision info")
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
OUTPUT_VARIABLE GIT_SHORT_SHA
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD
|
||||
OUTPUT_VARIABLE GIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
endif()
|
||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/versions/revision.h "#define BUILT_TAG \"${GIT_TAG}\"\n#define BUILT_SHA \"${GIT_SHORT_SHA}\"\n")
|
||||
endfunction()
|
||||
|
||||
write_revision_h()
|
||||
|
||||
add_library(common
|
||||
versions.cpp
|
||||
versions/versions.cpp
|
||||
audio/audio_formats.cpp
|
||||
cross_os_debug/xdbg.cpp
|
||||
cross_sockets/XSocket.cpp
|
||||
|
@ -53,7 +76,7 @@ add_library(common
|
|||
util/print_float.cpp
|
||||
util/FrameLimiter.cpp
|
||||
util/unicode_util.cpp
|
||||
util/term_util.cpp)
|
||||
util/term_util.cpp )
|
||||
|
||||
target_link_libraries(common fmt lzokay replxx libzstd_static)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
constexpr s32 BINTEGER_OFFSET = 0;
|
||||
constexpr s32 PAIR_OFFSET = 2;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "config.h"
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/json.hpp"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "ReplClient.h"
|
||||
|
||||
#include "common/cross_sockets/XSocket.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "ReplServer.h"
|
||||
|
||||
#include "common/cross_sockets/XSocket.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "common/util/FileUtil.h"
|
||||
#include "common/util/json_util.h"
|
||||
#include "common/util/string_util.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/fmt/color.h"
|
||||
#include "third-party/fmt/core.h"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
/*!
|
||||
* @file symbols.h
|
||||
|
@ -171,4 +171,4 @@ constexpr int empty_pair_offset_from_s7(GameVersion version) {
|
|||
// minus 1 for the symbol table pointer's offset.
|
||||
return jak2_symbols::S7_OFF_FIX_SYM_EMPTY_PAIR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
namespace fs = ghc::filesystem;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <cstring>
|
||||
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
void assert_string_empty_after(const char* str, int size);
|
||||
std::string get_object_file_name(const std::string& original_name, u8* data, int size);
|
||||
std::string get_object_file_name(const std::string& original_name, u8* data, int size);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "versions.h"
|
||||
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/versions/revision.h"
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
#include "third-party/fmt/format.h"
|
||||
|
@ -30,6 +31,27 @@ std::string version_to_game_name(GameVersion v) {
|
|||
}
|
||||
}
|
||||
|
||||
std::string version_to_game_name_external(GameVersion v) {
|
||||
switch (v) {
|
||||
case GameVersion::Jak1:
|
||||
return "Jak 1";
|
||||
case GameVersion::Jak2:
|
||||
return "Jak 2";
|
||||
default:
|
||||
ASSERT_MSG(false, fmt::format("no game_name for version: {} found", fmt::underlying(v)));
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> valid_game_version_names() {
|
||||
return {game_version_names[GameVersion::Jak1], game_version_names[GameVersion::Jak2]};
|
||||
}
|
||||
|
||||
std::string build_revision() {
|
||||
if (BUILT_TAG != "") {
|
||||
return BUILT_TAG;
|
||||
}
|
||||
if (BUILT_SHA != "") {
|
||||
return BUILT_SHA;
|
||||
}
|
||||
return "Unknown Revision";
|
||||
}
|
|
@ -56,4 +56,7 @@ constexpr PerGameVersion<const char*> game_version_names = {"jak1", "jak2"};
|
|||
GameVersion game_name_to_version(const std::string& name);
|
||||
bool valid_game_version(const std::string& name);
|
||||
std::string version_to_game_name(GameVersion v);
|
||||
std::string version_to_game_name_external(GameVersion v);
|
||||
std::vector<std::string> valid_game_version_names();
|
||||
|
||||
std::string build_revision();
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
namespace decompiler {
|
||||
class Function;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "decompiler/Disasm/Register.h"
|
||||
#include "decompiler/data/game_text.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "common/common_types.h"
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
namespace decompiler {
|
||||
class StrFileReader {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "common/texture/texture_conversion.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "decompiler/ObjectFile/ObjectFileDB.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "common/math/Vector.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "decompiler/level_extractor/common_formats.h"
|
||||
#include "decompiler/util/goal_data_reader.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "common/common_types.h"
|
||||
#include "common/dma/gs.h"
|
||||
#include "common/math/Vector.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "decompiler/util/goal_data_reader.h"
|
||||
|
||||
|
@ -219,4 +219,4 @@ struct MercCtrl {
|
|||
void debug_print_blerc();
|
||||
std::string print();
|
||||
};
|
||||
} // namespace decompiler
|
||||
} // namespace decompiler
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "common/util/os.h"
|
||||
#include "common/util/set_util.h"
|
||||
#include "common/util/unicode_util.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "ObjectFile/ObjectFileDB.h"
|
||||
#include "decompiler/data/TextureDB.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "common/goos/Object.h"
|
||||
#include "common/type_system/TypeSpec.h"
|
||||
#include "common/type_system/TypeSystem.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "decompiler/Disasm/DecompilerLabel.h"
|
||||
#include "decompiler/IR2/LabelDB.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include "common/goal_constants.h"
|
||||
#include "common/type_system/TypeSpec.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
namespace decompiler {
|
||||
|
||||
|
@ -16,4 +16,4 @@ constexpr PerGameVersion<int> SYMBOL_TO_STRING_MEM_OFFSET_DECOMP = {8167 * 8,
|
|||
jak2::SYM_TO_STRING_OFFSET};
|
||||
|
||||
constexpr PerGameVersion<int> OFFSET_OF_NEXT_STATE_STORE = {72, 64};
|
||||
} // namespace decompiler
|
||||
} // namespace decompiler
|
||||
|
|
|
@ -182,37 +182,6 @@ set(RUNTIME_SOURCE
|
|||
tools/subtitles/subtitle_editor.cpp
|
||||
tools/filter_menu/filter_menu.cpp)
|
||||
|
||||
find_package(Git)
|
||||
|
||||
function(write_svnrev_h)
|
||||
set(GIT_VERSION "")
|
||||
set(GIT_SHORT_SHA "")
|
||||
set(GIT_TAG "")
|
||||
if (GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
OUTPUT_VARIABLE GIT_SHORT_SHA
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD
|
||||
OUTPUT_VARIABLE GIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
else()
|
||||
set(GIT_VERSION "unk. rev.")
|
||||
endif()
|
||||
if(GIT_TAG)
|
||||
set(GIT_VERSION ${GIT_TAG})
|
||||
elseif(GIT_SHORT_SHA)
|
||||
string(SUBSTRING ${GIT_SHORT_SHA} 0 6 GIT_SHORT_SHA)
|
||||
set(GIT_VERSION "rev. ${GIT_SHORT_SHA}")
|
||||
else()
|
||||
set(GIT_VERSION "unk. rev.")
|
||||
endif()
|
||||
|
||||
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/kernel/svnrev.h "#define GIT_VERSION \"${GIT_VERSION}\"\n")
|
||||
endfunction()
|
||||
|
||||
write_svnrev_h()
|
||||
|
||||
add_subdirectory(sound)
|
||||
|
||||
# we build the runtime as a static library.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
constexpr PerGameVersion<int> DGO_RPC_ID(0xdeb4, 0xfab3);
|
||||
constexpr int DGO_RPC_CHANNEL = 3;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/listener_common.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
//! Supported languages.
|
||||
enum class Language {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Types used for the Loader Remote Procedure Call between the EE and the IOP
|
||||
*/
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
constexpr PerGameVersion<int> LOADER_RPC_ID(0xdeb2, 0xfab1);
|
||||
constexpr int LOADER_RPC_CHANNEL = 1;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Types used for the play Remote Procedure Call between the EE and the IOP.
|
||||
* Note that PLAY and PLAYER are different.
|
||||
*/
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
constexpr PerGameVersion<int> PLAY_RPC_ID(0xdeb6, 0xfab5);
|
||||
constexpr int PLAY_RPC_CHANNEL = 5;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Types used for the player Remote Procedure Call between the EE and the IOP.
|
||||
* Note that PLAY and PLAYER are different.
|
||||
*/
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
constexpr PerGameVersion<int> PLAYER_RPC_ID(0xdeb1, 0xfab0);
|
||||
constexpr int PLAYER_RPC_CHANNEL = 0;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
constexpr PerGameVersion<int> RAMDISK_RPC_ID(0xdeb3, 0xfab2);
|
||||
constexpr int RAMDISK_RPC_CHANNEL = 2;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/common/overlord_common.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/discord-rpc/include/discord_rpc.h"
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "game/common/file_paths.h"
|
||||
#include "game/kernel/common/kscheme.h"
|
||||
#include "game/kernel/svnrev.h"
|
||||
#include "game/runtime.h"
|
||||
#include "game/system/newpad.h"
|
||||
#include "pipelines/opengl.h"
|
||||
|
@ -312,9 +311,13 @@ u32 Init(GameVersion version) {
|
|||
if (g_main_thread_id != std::this_thread::get_id()) {
|
||||
lg::error("Ran Gfx::Init outside main thread. Init display elsewhere?");
|
||||
} else {
|
||||
Display::InitMainDisplay(640, 480,
|
||||
fmt::format("OpenGOAL - Work in Progress - {}", GIT_VERSION).c_str(),
|
||||
g_settings, version);
|
||||
std::string title = "OpenGOAL";
|
||||
if (g_game_version == GameVersion::Jak2) {
|
||||
title += " - Work in Progress";
|
||||
}
|
||||
title +=
|
||||
fmt::format(" - {} - {}", version_to_game_name_external(g_game_version), build_revision());
|
||||
Display::InitMainDisplay(640, 480, title.c_str(), g_settings, version);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/kernel/common/kboot.h"
|
||||
#include "game/system/newpad.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/graphics/opengl_renderer/BucketRenderer.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
class Shader {
|
||||
public:
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "game/graphics/gfx.h"
|
||||
#include "game/kernel/svnrev.h"
|
||||
|
||||
#include "third-party/imgui/imgui.h"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "common/common_types.h"
|
||||
#include "common/util/Serializer.h"
|
||||
#include "common/util/SmallVector.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/graphics/texture/TextureConverter.h"
|
||||
|
||||
|
@ -383,4 +383,4 @@ class TexturePool {
|
|||
u32 m_tpage_dir_size = 0;
|
||||
|
||||
std::mutex m_mutex;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/kernel/common/fileio.h"
|
||||
#include "game/kernel/common/kmalloc.h"
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "game/kernel/jak1/klisten.h"
|
||||
#include "game/kernel/jak1/kscheme.h"
|
||||
#include "game/kernel/jak1/ksound.h"
|
||||
#include "game/kernel/svnrev.h"
|
||||
#include "game/sce/deci2.h"
|
||||
#include "game/sce/libcdvd_ee.h"
|
||||
#include "game/sce/libdma.h"
|
||||
|
@ -653,7 +652,7 @@ void InitMachine_PCPort() {
|
|||
make_string_from_c(user_dir_path.string().c_str());
|
||||
auto settings_path = file_util::get_user_settings_dir(g_game_version);
|
||||
intern_from_c("*pc-settings-folder*")->value = make_string_from_c(settings_path.string().c_str());
|
||||
intern_from_c("*pc-settings-built-sha*")->value = make_string_from_c(GIT_VERSION);
|
||||
intern_from_c("*pc-settings-built-sha*")->value = make_string_from_c(build_revision().c_str());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/kernel/common/fileio.h"
|
||||
#include "game/kernel/common/kmalloc.h"
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "game/kernel/jak2/kmalloc.h"
|
||||
#include "game/kernel/jak2/kscheme.h"
|
||||
#include "game/kernel/jak2/ksound.h"
|
||||
#include "game/kernel/svnrev.h"
|
||||
#include "game/sce/libdma.h"
|
||||
#include "game/sce/libgraph.h"
|
||||
#include "game/sce/sif_ee.h"
|
||||
|
@ -691,7 +690,7 @@ void InitMachine_PCPort() {
|
|||
auto settings_path = file_util::get_user_settings_dir(g_game_version);
|
||||
intern_from_c("*pc-settings-folder*")->value() =
|
||||
make_string_from_c(settings_path.string().c_str());
|
||||
intern_from_c("*pc-settings-built-sha*")->value() = make_string_from_c(GIT_VERSION);
|
||||
intern_from_c("*pc-settings-built-sha*")->value() = make_string_from_c(build_revision().c_str());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "common/util/FileUtil.h"
|
||||
#include "common/util/os.h"
|
||||
#include "common/util/unicode_util.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/common/game_common_types.h"
|
||||
|
||||
|
@ -81,60 +81,8 @@ std::string game_arg_documentation() {
|
|||
int main(int argc, char** argv) {
|
||||
ArgumentGuard u8_guard(argc, argv);
|
||||
|
||||
// TODO - this is a temporary shim to convert the old arg format
|
||||
// into the new
|
||||
//
|
||||
// This is needed to avoid a coupled release with the launcher and
|
||||
// can be removed after one release cycle
|
||||
//
|
||||
// Normal users launch gk with _no_ args
|
||||
//
|
||||
// Only handling args the launcher provides, all others can be changed
|
||||
// in this repo at the time of merge.
|
||||
std::vector<const char*> adjusted_argv_vals;
|
||||
std::vector<const char*> adjusted_argv_vals_passthru;
|
||||
for (int i = 0; i < argc; i++) {
|
||||
const auto& val = std::string(argv[i]);
|
||||
// Handle all args that aren't passed through
|
||||
if (val == "-proj-path") {
|
||||
adjusted_argv_vals.push_back("--proj-path");
|
||||
i++;
|
||||
if (i > argc) {
|
||||
return 1;
|
||||
}
|
||||
adjusted_argv_vals.push_back(argv[i]);
|
||||
} else if (val == "--") {
|
||||
// if we hit a '--' then break out, args will be matched but they are already in the new
|
||||
// format
|
||||
break;
|
||||
} else if (val == "-boot") {
|
||||
// now handle all the ones that get passed to the game
|
||||
adjusted_argv_vals_passthru.push_back("-boot");
|
||||
} else if (val == "-fakeiso") {
|
||||
adjusted_argv_vals_passthru.push_back("-fakeiso");
|
||||
} else if (val == "-debug") {
|
||||
adjusted_argv_vals_passthru.push_back("-debug");
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<const char*> new_argv;
|
||||
if (!adjusted_argv_vals.empty() || !adjusted_argv_vals_passthru.empty()) {
|
||||
new_argv.push_back(argv[0]);
|
||||
for (const auto& arg : adjusted_argv_vals) {
|
||||
new_argv.push_back(arg);
|
||||
}
|
||||
if (!adjusted_argv_vals_passthru.empty()) {
|
||||
new_argv.push_back("--");
|
||||
for (const auto& arg : adjusted_argv_vals_passthru) {
|
||||
new_argv.push_back(arg);
|
||||
}
|
||||
}
|
||||
argv = (char**)new_argv.data();
|
||||
argc = new_argv.size();
|
||||
}
|
||||
// --- END temporary shim
|
||||
|
||||
// CLI flags
|
||||
bool show_version = false;
|
||||
std::string game_name = "jak1";
|
||||
bool verbose_logging = false;
|
||||
bool disable_avx2 = false;
|
||||
|
@ -144,6 +92,7 @@ int main(int argc, char** argv) {
|
|||
fs::path project_path_override;
|
||||
std::vector<std::string> game_args;
|
||||
CLI::App app{"OpenGOAL Game Runtime"};
|
||||
app.add_flag("--version", show_version, "Display the built revision");
|
||||
app.add_option("-g,--game", game_name, "The game name: 'jak1' or 'jak2'");
|
||||
app.add_flag("-v,--verbose", verbose_logging, "Enable verbose logging on stdout");
|
||||
app.add_flag(
|
||||
|
@ -160,6 +109,11 @@ int main(int argc, char** argv) {
|
|||
app.allow_extras();
|
||||
CLI11_PARSE(app, argc, argv);
|
||||
|
||||
if (show_version) {
|
||||
lg::print(build_revision());
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Create struct with all non-kmachine handled args to pass to the runtime
|
||||
GameLaunchOptions game_options;
|
||||
game_options.disable_debug_vm = disable_debug_vm;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/common/game_common_types.h"
|
||||
#include "game/common/loader_rpc_types.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "common/goal_constants.h"
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/discord.h"
|
||||
#include "game/graphics/gfx.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <thread>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "game/common/game_common_types.h"
|
||||
#include "game/kernel/common/kboot.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "Deci2Server.h"
|
||||
|
||||
#include "common/cross_sockets/XSocket.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
#include "common/listener_common.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "FileInfo.h"
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/data_compiler/DataObjectGenerator.h"
|
||||
|
||||
|
@ -29,4 +29,4 @@ FileInfo make_file_info_for_level(const std::string& file_name) {
|
|||
info.tool_debug = "Created by OpenGOAL buildlevel";
|
||||
info.mdb_file_name = "Unknown";
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "Env.h"
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/emitter/ObjectGenerator.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "common/cross_os_debug/xdbg.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/listener/MemoryMap.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "common/goal_constants.h"
|
||||
#include "common/type_system/TypeSystem.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/debugger/DebugInfo.h"
|
||||
|
||||
|
@ -636,4 +636,4 @@ ObjectGeneratorStats ObjectGenerator::get_stats() const {
|
|||
void ObjectGenerator::count_eliminated_move() {
|
||||
m_stats.moves_eliminated++;
|
||||
}
|
||||
} // namespace emitter
|
||||
} // namespace emitter
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "Instruction.h"
|
||||
#include "ObjectFileData.h"
|
||||
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/debugger/DebugInfo.h"
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "common/cross_sockets/XSocket.h"
|
||||
#include "common/util/Assert.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
#include "common/log/log.h"
|
||||
|
||||
#include "Listener.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "common/cross_os_debug/xdbg.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
#include "common/listener_common.h"
|
||||
|
||||
#include "goalc/debugger/Debugger.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "common/util/diff.h"
|
||||
#include "common/util/string_util.h"
|
||||
#include "common/util/unicode_util.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/compiler/Compiler.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "common/log/log.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "goalc/compiler/Compiler.h"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "common/util/BinaryWriter.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/util/unicode_util.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
#include "third-party/json.hpp"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "common/util/DgoReader.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/util/unicode_util.h"
|
||||
#include "common/versions.h"
|
||||
#include "common/versions/versions.h"
|
||||
|
||||
namespace {
|
||||
int run(int argc, char** argv) {
|
||||
|
|
Loading…
Reference in a new issue