mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Unify --debugger=PORT for both the app and headless builds
The headless build's own --debugger=PORT never actually worked on
Windows: headless/Headless.cpp never called net::Init() (WSAStartup),
so socket binding silently failed ("Unable to listen on any port
(debugger - webserver)"). Fixed by calling net::Init()/net::Shutdown()
there, gated on --debugger being passed since headless has no other use
for networking.
With that confirmed working, move parsing into the shared
Core/CmdLine.cpp auto-param table as a single --debugger=PORT option
(0 = pick automatically) available on both CmdLineMode::Application and
CmdLineMode::Headless, replacing the previous app-only boolean
--debugger flag and headless's separate ad hoc argv scan for it.
Behavior differs deliberately by build, same as before:
- App: just starts the debugger, game boots and runs normally.
- Headless: also forces coreParameter.startBreak = true (break before
anything runs), as it always has. Headless re-applies iRemoteISOPort
after its own g_Config.RestoreDefaults() call, which runs after
ApplyToConfig() and would otherwise wipe the requested port.
Verified live: headless now binds the requested port and responds to
cpu.status/game.status; the app build binds the requested port and
runs the game normally (not paused).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDNwPPuidmNxQGRJxBuRL6
This commit is contained in:
1 parent
cf873b8c6b
commit
7e5dca0309
3 files changed
+21
-11
No files matched your search
+5
-3
@@ -139,7 +139,6 @@ static const CommandLineParam g_autoParams[] = {
|
||||
{POFF(startScreen), CmdParamType::String, "start-screen", '\0', "Start on a specific screen (e.g. 'gamesettings', 'touchscreentest')", CmdLineMode::Application},
|
||||
{POFF(escapeExit), CmdParamType::Bool, "escape-exit", '\0', "Escape key exits the application", CmdLineMode::Application},
|
||||
{POFF(pauseMenuExit), CmdParamType::Bool, "pause-menu-exit", '\0', "Change \"Exit to menu\" in pause menu to \"Exit\"", CmdLineMode::Application},
|
||||
{POFF(enableDebugger), CmdParamType::Bool, "debugger", '\0', "Enable the WebSocket debugger on startup (see docs/WebSocketDebugger.md)", CmdLineMode::Application},
|
||||
{POFF(appendConfig), CmdParamType::String, "appendconfig", '\0', "Merge config FILE into the current configuration"},
|
||||
{POFF(root), CmdParamType::String, "root", 'r', "Mount root directory"},
|
||||
{POFF(stateToLoad), CmdParamType::String, "state", '\0', "Load state from specified file"},
|
||||
@@ -151,6 +150,7 @@ static const CommandLineParam g_autoParams[] = {
|
||||
{POFF(screenshotFilenameSave), CmdParamType::String, "screenshot-save", '\0', "Save screenshot to specified path"},
|
||||
{POFF(timeout), CmdParamType::Double, "timeout", '\0', "Set the timeout value"},
|
||||
{POFF(resolutionScale), CmdParamType::Int, "resolution-scale", '\0', "Set the resolution scale factor"},
|
||||
{POFF(debuggerPort), CmdParamType::Int, "debugger", '\0', "Enable the WebSocket debugger on this port (0 = pick automatically); see docs/WebSocketDebugger.md"},
|
||||
// TODO: At some point we should maybe simply expose all config settings to be set directly from the command line automatically?
|
||||
};
|
||||
|
||||
@@ -396,8 +396,10 @@ void CommandLineOptions::ApplyToConfig() const {
|
||||
g_Config.bPauseMenuExitsEmulator = pauseMenuExit.value();
|
||||
}
|
||||
|
||||
if (enableDebugger.has_value()) {
|
||||
g_Config.bRemoteDebuggerOnStartup = enableDebugger.value();
|
||||
if (debuggerPort.has_value()) {
|
||||
g_Config.iRemoteISOPort = debuggerPort.value();
|
||||
g_Config.DoNotSaveSetting(&g_Config.iRemoteISOPort);
|
||||
g_Config.bRemoteDebuggerOnStartup = true;
|
||||
g_Config.DoNotSaveSetting(&g_Config.bRemoteDebuggerOnStartup);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user