diff --git a/common/goos/Interpreter.cpp b/common/goos/Interpreter.cpp index 446704be11c..1a1426c3b96 100644 --- a/common/goos/Interpreter.cpp +++ b/common/goos/Interpreter.cpp @@ -35,7 +35,6 @@ Interpreter::Interpreter(const std::string& username) { // set user profile name auto user = SymbolObject::make_new(reader.symbolTable, username); define_var_in_env(global_environment, user, "*user*"); - define_var_in_env(goal_env, user, "*user*"); // setup maps special_forms = { diff --git a/common/repl/util.cpp b/common/repl/util.cpp index 5219aa7e110..6f4c373fc96 100644 --- a/common/repl/util.cpp +++ b/common/repl/util.cpp @@ -207,7 +207,7 @@ std::string find_repl_username() { } } - return "#f"; + return "unknown"; } fs::path get_startup_file_path(const std::string& username, const GameVersion game_version) { diff --git a/game/kernel/jak2/kboot.cpp b/game/kernel/jak2/kboot.cpp index dabca477402..1b7fabff3d5 100644 --- a/game/kernel/jak2/kboot.cpp +++ b/game/kernel/jak2/kboot.cpp @@ -5,6 +5,7 @@ #include #include "common/goal_constants.h" +#include "common/repl/util.h" #include "common/util/Timer.h" #include "game/common/game_common_types.h" @@ -26,7 +27,11 @@ char DebugBootArtGroup[64]; void kboot_init_globals() { memset(DebugBootUser, 0, sizeof(DebugBootUser)); memset(DebugBootArtGroup, 0, sizeof(DebugBootArtGroup)); - strcpy(DebugBootUser, "unknown"); + // strcpy(DebugBootUser, "unknown"); + // CHANGED : let's just try to find the username automatically by default! + // the default is still "unknown" + auto username = REPL::find_repl_username(); + strcpy(DebugBootUser, username.c_str()); } void KernelCheckAndDispatch(); diff --git a/game/main.cpp b/game/main.cpp index e59ac4f9f9a..449529b59e8 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -70,11 +70,12 @@ std::string game_arg_documentation() { output += " -level [name] Used to inform the game to boot a specific level the default level is `#f`\n"; // Jak 1 Related output += fmt::format(fmt::emphasis::bold | fmt::fg(fmt::color::orange), "Jak 1:\n"); - output += " -demo Used to pass the message `demo` to the gkernel in the DebugBootMessage (instead of play)\n"; + output += " -demo Boot the game in demo mode\n"; // Jak 2 only output += fmt::format(fmt::emphasis::bold | fmt::fg(fmt::color::purple), "Jak 2:\n"); - output += " -kiosk A demo mode, TODO on specifics\n"; - output += " -preview A demo mode, TODO on specifics\n"; + output += " -demo Boot the game in demo mode\n"; + output += " -kiosk Boot the game in kiosk demo mode\n"; + output += " -preview Boot the game in preview demo mode\n"; output += " -debug-boot Used to boot the game in retail mode, but with debug segments\n"; output += " -user [name] Specify the debugging username, the default is `unknown`\n"; output += " -art [name] Specify the art-group name to set `DebugBootArtGroup`, there is no default\n"; diff --git a/game/runtime.cpp b/game/runtime.cpp index 145030b7e89..2eff8afda3a 100644 --- a/game/runtime.cpp +++ b/game/runtime.cpp @@ -116,7 +116,7 @@ void deci2_runner(SystemThreadInterface& iface) { // then allow the server to accept connections bool server_ok = server.init_server(); if (!server_ok) { - lg::error("[DECI2] failed to initialize, REPL will not work.\n"); + lg::error("[DECI2] failed to initialize, REPL will not work."); } lg::debug("[DECI2] Waiting for listener..."); @@ -434,8 +434,8 @@ RuntimeExitStatus exec_runtime(GameLaunchOptions game_options, int argc, const c try { Gfx::Loop([]() { return MasterExit == RuntimeExitStatus::RUNNING; }); } catch (std::exception& e) { - lg::error("Exception thrown from graphics loop: {}\n", e.what()); - lg::error("Everything will crash now. good luck\n"); + lg::error("Exception thrown from graphics loop: {}", e.what()); + lg::error("Everything will crash now. good luck"); throw; } } diff --git a/game/sce/sif_ee.cpp b/game/sce/sif_ee.cpp index 562787c4fc3..2aefe4742ae 100644 --- a/game/sce/sif_ee.cpp +++ b/game/sce/sif_ee.cpp @@ -110,6 +110,7 @@ s32 sceOpen(const char* filename, s32 flag) { default: { // either append or truncate + file_util::create_dir_if_needed_for_file(name); if (flag & SCE_TRUNC) { fp = file_util::open_file(name.c_str(), "w"); } else { diff --git a/goal_src/goal-lib.gc b/goal_src/goal-lib.gc index b7111c27a68..545e1514d55 100644 --- a/goal_src/goal-lib.gc +++ b/goal_src/goal-lib.gc @@ -1020,10 +1020,6 @@ ;;;; user stuf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmacro get-user () - `(quote ,*user*) - ) - (defmacro user? (&rest users) (cond ((null? users) #f) diff --git a/goal_src/jak1/kernel-defs.gc b/goal_src/jak1/kernel-defs.gc index 3ccab0f391f..7f4d06af58e 100644 --- a/goal_src/jak1/kernel-defs.gc +++ b/goal_src/jak1/kernel-defs.gc @@ -401,6 +401,9 @@ (define-extern pc-prof (function string pc-prof-event none)) +(defmacro get-user () + `(quote ,*user*) + ) (defconstant *user* (get-user)) (define-extern pc-filter-debug-string? (function string float symbol))