diff --git a/CHANGELOG.md b/CHANGELOG.md index 955ca99e0..ae3de5011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Quality: Usability: - touchHLE now supports real accelerometer input on devices with a built-in accelerometer, such as phones and tablets. This is only used if no game controller is connected. (@hikari-no-yume) +- The options help text is now available as a file (`OPTIONS_HELP.txt`), so you don't have to use the command line to get a list of options. (@hikari-no-yume) Other: diff --git a/OPTIONS_HELP.txt b/OPTIONS_HELP.txt new file mode 100644 index 000000000..fa0368382 --- /dev/null +++ b/OPTIONS_HELP.txt @@ -0,0 +1,82 @@ +View options: + --landscape-left + --landscape-right + Changes the orientation the virtual device will have at startup. + The default is portrait. + + --landscape-left means rotate 90° counterclockwise from portrait. + --landscape-right means rotate 90° clockwise from portrait. + + Usually apps that require landscape mode will tell touchHLE about this, + and it will automatically rotate the window, but some apps neglect to + do this. These options may be useful in that case. + + --scale-hack=... + Set a scaling factor for the window. touchHLE will attempt to run the + app with an increased internal resolution. This is a hack and there's + no guarantee it will work correctly for all apps. + + The default is no scale hack, which is equivalent to a value of 1 (i.e. + a scale of 1×). + + This is a natural number that is at least 1. + +Game controller options: + --deadzone=... + Configures the size of the \"dead zone\" for analog stick inputs. + + The default value is 0.1, which means that 10% of the stick's range on + the X and Y axes around the center position will be collapsed into a + single point, so that movements in that range are ignored. + + This is a floating-point (decimal) number between 0 and 1. + + --x-tilt-range=... + --y-tilt-range=... + Set the simulated rotation range of the device on its X or Y axis. + + By default, an analog stick's axis is mapped to a rotation range of 60° + (30° in either direction). If you wanted a range of 90° on the X axis, + you could use --x-tilt-range=90. + + Note that the device's X axis is mapped to the analog stick's Y axis + and vice-versa, because tilting the device to the left means rotating + it on its Y axis, and so on. + + This is a floating-point (decimal) number of degrees, without a degree + symbol. It may be negative. + + --x-tilt-offset=... + --y-tilt-offset=... + Offset the simulated angle of the device on its X or Y axis. + + By default, the device is simulated as being level with the ground when + the stick is in the center/neutral position. This option is intended for + games that use a different angle relative to the ground as their neutral + position. For example, if a game expects you to hold the device in a + landscape orientation, with a 45° angle to the ground, you might use + --y-tilt-offset=45. + + Note that the device's X axis is mapped to the analog stick's Y axis + and vice-versa, because tilting the device to the left means rotating + it on its Y axis, and so on. + + This is a floating-point (decimal) number of degrees, without a degree + symbol. It may be negative. + +Debugging options: + --disable-direct-memory-access + Force dynarmic to always access guest memory via the memory access + callbacks, rather than using the fast direct access path (page tables). + + --gdb=... + Starts touchHLE in debugging mode, listening for GDB remote serial + protocol connections over TCP on the specified host and port. + + You can then connect to touchHLE with GDB and make use of its features + to inspect memory and registers, set up software breakpoints, and + continue or step execution. + + The host and port should be separated by a colon. The host can be a + host name or an IP address. IPv6 addresses should be enclosed in square + brackets, e.g. --gdb=[::1]:9001 for IPv6 loopback device port 9001. diff --git a/README.md b/README.md index 75814407d..3962c51dc 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,7 @@ You'll then need an app that you can run (check [the list of supported apps](APP There's no graphical user interface right now. If you're a Windows user and unfamiliar with the command line, these instructions may be helpful: * The easiest and fastest thing to do is to drag and drop the app's `.ipa` file or `.app` folder onto `touchHLE.exe`. -* To configure the options, edit the `touchHLE_options.txt` file. To get a list of options: - 1. Hold the Shift key and right-click on the empty space in the folder window. - 2. Click “Open with PowerShell”. - 3. Type `.\touchHLE.exe --help` and press Enter. +* To configure the options, edit the `touchHLE_options.txt` file. To get a list of options, look in the `OPTIONS_HELP.txt` file. * You can also run apps directly from the command line: 1. Move the `.ipa` file or `.app` bundle to the same folder as `touchHLE.exe`. 2. Hold the Shift key and right-click on the empty space in the folder window. diff --git a/release-scripts/prepare-release.sh b/release-scripts/prepare-release.sh index 1fc14db08..769af37db 100755 --- a/release-scripts/prepare-release.sh +++ b/release-scripts/prepare-release.sh @@ -20,5 +20,6 @@ pandoc -s ../CHANGELOG.md -o new_release/CHANGELOG.html cp -r gpl-3.0.txt new_release/COPYING +cp ../OPTIONS_HELP.txt new_release/ cp ../touchHLE_default_options.txt new_release/ cp ../touchHLE_options.txt new_release/ diff --git a/src/options.rs b/src/options.rs index 7c2f8f81d..df08e6b14 100644 --- a/src/options.rs +++ b/src/options.rs @@ -11,90 +11,8 @@ use std::io::{BufRead, BufReader}; use std::net::{SocketAddr, ToSocketAddrs}; use std::num::NonZeroU32; -pub const DOCUMENTATION: &str = "\ -View options: - --landscape-left - --landscape-right - Changes the orientation the virtual device will have at startup. - The default is portrait. - - --landscape-left means rotate 90° counterclockwise from portrait. - --landscape-right means rotate 90° clockwise from portrait. - - Usually apps that require landscape mode will tell touchHLE about this, - and it will automatically rotate the window, but some apps neglect to - do this. These options may be useful in that case. - - --scale-hack=... - Set a scaling factor for the window. touchHLE will attempt to run the - app with an increased internal resolution. This is a hack and there's - no guarantee it will work correctly for all apps. - - The default is no scale hack, which is equivalent to a value of 1 (i.e. - a scale of 1×). - - This is a natural number that is at least 1. - -Game controller options: - --deadzone=... - Configures the size of the \"dead zone\" for analog stick inputs. - - The default value is 0.1, which means that 10% of the stick's range on - the X and Y axes around the center position will be collapsed into a - single point, so that movements in that range are ignored. - - This is a floating-point (decimal) number between 0 and 1. - - --x-tilt-range=... - --y-tilt-range=... - Set the simulated rotation range of the device on its X or Y axis. - - By default, an analog stick's axis is mapped to a rotation range of 60° - (30° in either direction). If you wanted a range of 90° on the X axis, - you could use --x-tilt-range=90. - - Note that the device's X axis is mapped to the analog stick's Y axis - and vice-versa, because tilting the device to the left means rotating - it on its Y axis, and so on. - - This is a floating-point (decimal) number of degrees, without a degree - symbol. It may be negative. - - --x-tilt-offset=... - --y-tilt-offset=... - Offset the simulated angle of the device on its X or Y axis. - - By default, the device is simulated as being level with the ground when - the stick is in the center/neutral position. This option is intended for - games that use a different angle relative to the ground as their neutral - position. For example, if a game expects you to hold the device in a - landscape orientation, with a 45° angle to the ground, you might use - --y-tilt-offset=45. - - Note that the device's X axis is mapped to the analog stick's Y axis - and vice-versa, because tilting the device to the left means rotating - it on its Y axis, and so on. - - This is a floating-point (decimal) number of degrees, without a degree - symbol. It may be negative. - -Debugging options: - --disable-direct-memory-access - Force dynarmic to always access guest memory via the memory access - callbacks, rather than using the fast direct access path (page tables). - - --gdb=... - Starts touchHLE in debugging mode, listening for GDB remote serial - protocol connections over TCP on the specified host and port. - - You can then connect to touchHLE with GDB and make use of its features - to inspect memory and registers, set up software breakpoints, and - continue or step execution. - - The host and port should be separated by a colon. The host can be a - host name or an IP address. IPv6 addresses should be enclosed in square - brackets, e.g. --gdb=[::1]:9001 for IPv6 loopback device port 9001. -"; +pub const DOCUMENTATION: &str = + include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/OPTIONS_HELP.txt")); /// Struct containing all user-configurable options. pub struct Options { diff --git a/touchHLE_default_options.txt b/touchHLE_default_options.txt index 8a188c898..1cd45816c 100644 --- a/touchHLE_default_options.txt +++ b/touchHLE_default_options.txt @@ -14,7 +14,8 @@ # line per app. A line should consist of the identifier for an app, followed by # a colon (:), followed by the options to apply. To find out an app's # identifier, you can run it in touchHLE and look at the “App bundle info” -# output. To get a list of possible options, run touchHLE with the --help flag. +# output. To get a list of possible options, see OPTIONS_HELP.txt or run +# touchHLE with the --help flag. # # Text on a line following a hash sign (#) is treated as a comment and ignored. # Empty lines are also ignored. diff --git a/touchHLE_options.txt b/touchHLE_options.txt index e77731054..8f3431244 100644 --- a/touchHLE_options.txt +++ b/touchHLE_options.txt @@ -8,7 +8,8 @@ # line per app. A line should consist of the identifier for an app, followed by # a colon (:), followed by the options to apply. To find out an app's # identifier, you can run it in touchHLE and look at the “App bundle info” -# output. To get a list of possible options, run touchHLE with the --help flag. +# output. To get a list of possible options, see OPTIONS_HELP.txt or run +# touchHLE with the --help flag. # # Text on a line following a hash sign (#) is treated as a comment and ignored. # Empty lines are also ignored.