game: cleanup gk's CLI documentation (#2189)

An attempt to cleanup the last CLI interface we have left to cleanup. 
- `gk` args now follow the typical convention ie. `--proj-path` instead
of `-proj-path`.
- args that are passed through to the rest of the application / the
game's runtime use the typical convention of following a `--`
- I'm thinking some args shouldn't be handled at this level ie
(`-nodisplay`, `-vm`, `-novm` or `-jak2`) These could be better
documented as legitimate flags and passed in via a nice struct. They
don't seem to be used in `InitParams` but I'll triple check.

There's a temporary shim here so there is no coupled release with the
launcher (right now it executes `gk` with a few args). So I just change
the old args into the new format. After one release cycle, I can change
it in the launcher and delete it here.

I am unsure if this will break the bash shellscript usages -- not sure
which args were usually passed into `$@`


![image](https://user-images.githubusercontent.com/13153231/222035309-b6601719-cdc9-40ee-b36e-e4b135d3f128.png)
This commit is contained in:
Tyler Wilding
2023-03-09 20:02:25 -05:00
committed by GitHub
parent 0db9b288e4
commit 2f6bfd2e64
18 changed files with 203 additions and 117 deletions
+4 -15
View File
@@ -310,25 +310,14 @@ void dmac_runner(SystemThreadInterface& iface) {
* Main function to launch the runtime.
* GOAL kernel arguments are currently ignored.
*/
RuntimeExitStatus exec_runtime(int argc, char** argv) {
RuntimeExitStatus exec_runtime(GameLaunchOptions game_options, int argc, char** argv) {
g_argc = argc;
g_argv = argv;
g_main_thread_id = std::this_thread::get_id();
// parse opengoal arguments
g_game_version = GameVersion::Jak1;
bool enable_display = true;
for (int i = 1; i < argc; i++) {
if (std::string("-nodisplay") == argv[i]) { // disable video display
enable_display = false;
} else if (std::string("-vm") == argv[i]) { // enable debug ps2 VM
VM::use = true;
} else if (std::string("-novm") == argv[i]) { // disable debug ps2 VM
VM::use = false;
} else if (std::string("-jak2") == argv[i]) {
g_game_version = GameVersion::Jak2;
}
}
bool enable_display = !game_options.disable_display;
VM::use = !game_options.disable_debug_vm;
g_game_version = game_options.game_version;
// set up discord stuff
gStartTime = time(nullptr);