[PR #2135] [MERGED] CLI: Add argument to pass an argument to the game #2509

Closed
opened 2026-02-27 22:00:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2135
Author: @kalaposfos13
Created: 1/12/2025
Status: Merged
Merged: 1/18/2025
Merged by: @roamic

Base: mainHead: game-args


📝 Commits (9)

  • cd5728f Add CLI argument to pass an argument to the game
  • b328641 clang
  • 439db02 Replace -ga with --; increase max argument count to 32; and add logging
  • 39c87f4 Fix off-by-one error
  • 4aad194 Fix -g flag with --; and avoid overindexing if -- is set but no arguments are added
  • 711b119 Merge remote-tracking branch 'origin/main' into game-args
  • adaeb7c Remove left-in text from --help
  • 0063fcb Review comments
  • e6412af clang

📊 Changes

6 files changed (+61 additions, -9 deletions)

View changed files

📝 src/core/linker.cpp (+8 -2)
📝 src/core/linker.h (+2 -2)
📝 src/emulator.cpp (+11 -2)
📝 src/emulator.h (+1 -1)
📝 src/main.cpp (+20 -1)
📝 src/qt_gui/main.cpp (+19 -1)

📄 Description

Syntax: shadps4 <options> <game> -- <game arg 1> <game arg 2> ...
Works for both SDL and Qt versions, but there's no GUI for it.
You can pass up to 32 arguments to a game (untested)
Tested with Knack 2 (needs only one argument): ./build/shadps4 CUSA08014 -- "-w=10 -cursoroff -region=a -2160p"


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2135 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 1/12/2025 **Status:** ✅ Merged **Merged:** 1/18/2025 **Merged by:** [@roamic](https://github.com/roamic) **Base:** `main` ← **Head:** `game-args` --- ### 📝 Commits (9) - [`cd5728f`](https://github.com/shadps4-emu/shadPS4/commit/cd5728f97e0e6550ace9a69ce39b3b85b21fe123) Add CLI argument to pass an argument to the game - [`b328641`](https://github.com/shadps4-emu/shadPS4/commit/b328641f814aa95a1c6ac352a6cd4c4c191eca46) clang - [`439db02`](https://github.com/shadps4-emu/shadPS4/commit/439db029d3c9ce872d54b82154889379d90fdb63) Replace -ga with --; increase max argument count to 32; and add logging - [`39c87f4`](https://github.com/shadps4-emu/shadPS4/commit/39c87f4d2b48ee8160d4a3cdd26450e0d4a4c8eb) Fix off-by-one error - [`4aad194`](https://github.com/shadps4-emu/shadPS4/commit/4aad1940a0865895a861a23d61d09009e722a9c3) Fix -g flag with --; and avoid overindexing if -- is set but no arguments are added - [`711b119`](https://github.com/shadps4-emu/shadPS4/commit/711b1190baf0f5806e5e63f311828364cb5e6886) Merge remote-tracking branch 'origin/main' into game-args - [`adaeb7c`](https://github.com/shadps4-emu/shadPS4/commit/adaeb7ca6d456fcdf3b3db1169e2d4464f2edc3e) Remove left-in text from --help - [`0063fcb`](https://github.com/shadps4-emu/shadPS4/commit/0063fcbc032135a1e2b26a2cbb64f32e9b5bcf03) Review comments - [`e6412af`](https://github.com/shadps4-emu/shadPS4/commit/e6412af4ad5e920751335791086d64b971eaa3ea) clang ### 📊 Changes **6 files changed** (+61 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/core/linker.cpp` (+8 -2) 📝 `src/core/linker.h` (+2 -2) 📝 `src/emulator.cpp` (+11 -2) 📝 `src/emulator.h` (+1 -1) 📝 `src/main.cpp` (+20 -1) 📝 `src/qt_gui/main.cpp` (+19 -1) </details> ### 📄 Description Syntax: `shadps4 <options> <game> -- <game arg 1> <game arg 2> ...` Works for both SDL and Qt versions, but there's no GUI for it. You can pass up to 32 arguments to a game (untested) Tested with Knack 2 (needs only one argument): `./build/shadps4 CUSA08014 -- "-w=10 -cursoroff -region=a -2160p"` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2509
No description provided.