Merge pull request #126 from igor725/wiki-fix-2

Update wiki info and json schemas
This commit is contained in:
SysRay 2024-04-24 21:58:26 +02:00 committed by GitHub
commit da7432af6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 97 additions and 64 deletions

View File

@ -6,9 +6,11 @@
"type": "string"
},
"device": {
"description": "The name of your sound output device e.g. \"Speakers (Realtek(R) Audio)\".",
"type": "string"
},
"volume": {
"description": "Master volume for every emulator's sound output.",
"type": "number",
"minimum": 0.0,
"maximum": 1.0

View File

@ -1,85 +1,112 @@
{
"type": "object",
"additionalProperties": false,
"definitions": {
"button": {
"type": "string",
"description": "This gamepad button will be pressed when you press the speified button on the keyboard.\n\"gamepad_key\": \"keyboard_key\"\n\nYou can find keyboard key names there: <https://wiki.libsdl.org/SDL2/SDL_Scancode>."
},
"deadzone": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number",
"minimum": 0.0,
"maximum": 0.9
},
"y": {
"type": "number",
"minimum": 0.0,
"maximum": 0.9
}
},
"required": [
"x",
"y"
]
}
},
"properties": {
"$schema": {
"type": "string"
},
"keybinds": {
"type": "object",
"description": "Information about keybinds for gamepad emulation, hover your cursor on any key inside this object to get more info.",
"additionalProperties": false,
"properties": {
"circle": {
"type": "string"
"$ref": "#/definitions/button"
},
"cross": {
"type": "string"
"$ref": "#/definitions/button"
},
"dpad_down": {
"type": "string"
"$ref": "#/definitions/button"
},
"dpad_left": {
"type": "string"
"$ref": "#/definitions/button"
},
"dpad_right": {
"type": "string"
"$ref": "#/definitions/button"
},
"dpad_up": {
"type": "string"
"$ref": "#/definitions/button"
},
"l1": {
"type": "string"
"$ref": "#/definitions/button"
},
"l2": {
"type": "string"
"$ref": "#/definitions/button"
},
"l3": {
"type": "string"
"$ref": "#/definitions/button"
},
"lx+": {
"type": "string"
"$ref": "#/definitions/button"
},
"lx-": {
"type": "string"
"$ref": "#/definitions/button"
},
"ly+": {
"type": "string"
"$ref": "#/definitions/button"
},
"ly-": {
"type": "string"
"$ref": "#/definitions/button"
},
"options": {
"type": "string"
"$ref": "#/definitions/button"
},
"r1": {
"type": "string"
"$ref": "#/definitions/button"
},
"r2": {
"type": "string"
"$ref": "#/definitions/button"
},
"r3": {
"type": "string"
"$ref": "#/definitions/button"
},
"rx+": {
"type": "string"
"$ref": "#/definitions/button"
},
"rx-": {
"type": "string"
"$ref": "#/definitions/button"
},
"ry+": {
"type": "string"
"$ref": "#/definitions/button"
},
"ry-": {
"type": "string"
"$ref": "#/definitions/button"
},
"square": {
"type": "string"
"$ref": "#/definitions/button"
},
"touchpad": {
"type": "string"
"$ref": "#/definitions/button"
},
"triangle": {
"type": "string"
"$ref": "#/definitions/button"
}
},
"required": [
@ -111,38 +138,24 @@
},
"pads": {
"type": "array",
"description": "This array contains information about connected pads.",
"minItems": 4,
"maxItems": 4,
"items": {
"type": "object",
"description": "The pad information itself.",
"additionalProperties": false,
"properties": {
"deadzones": {
"type": "object",
"description": "Dead zones are WIP, not working for now.",
"additionalProperties": false,
"properties": {
"left_stick": {
"type": "object",
"additionalProperties": false,
"properties": {
"x": {
"type": "number",
"minimum": 0.0,
"maximum": 0.9
},
"y": {
"type": "number",
"minimum": 0.0,
"maximum": 0.9
}
},
"required": [
"x",
"y"
]
"$ref": "#/definitions/deadzone"
},
"right_stick": {
"$ref": "#/properties/pads/items/properties/deadzones/properties/left_stick"
"$ref": "#/definitions/deadzone"
}
},
"required": [
@ -152,6 +165,7 @@
},
"type": {
"type": "string",
"description": "Backend for this gamepad. Possible values:\n* for SDL: sdl; aliases: gamepad\n* for XInput: xinput; aliases: xbox\n* for gamepad emulation: keyboard; aliases: kb, kbd.",
"enum": [
"gamepad",
"sdl",

View File

@ -6,19 +6,23 @@
"type": "string"
},
"netEnabled": {
"type": "boolean"
"type": "boolean",
"description": "Network subsystem state, it is not recomended to enable network, it may cause your emulator to crash."
},
"netMAC": {
"type": "string",
"description": "You should specify your host adapter MAC address here. This adapter will be used for network connection to game's servers. This option is ignored if \"netEnabled\" set to `false`.\n\n00:00:00:00:00:00 means \"first available adapter with IPv4 address\".",
"pattern": "(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$"
},
"onlineUsers": {
"type": "integer",
"description": "This option specifies the number of logged in users. The maximum number of users is 4. Every user must have their own configured gamepad (see controls.json).",
"minimum": 1,
"maximum": 4
},
"profiles": {
"type": "array",
"description": "This array contains information about all the console users. The specified name and lightbar color will be sent to the game on request.",
"minItems": 4,
"maxItems": 4,
"items": {
@ -27,6 +31,7 @@
"properties": {
"color": {
"type": "string",
"description": "The user color, probably unused.",
"enum": [
"blue",
"red",
@ -36,6 +41,7 @@
},
"name": {
"type": "string",
"description": "The displayed user name, the game may draw it somewhere.",
"minLength": 3,
"maxLength": 16
}
@ -48,11 +54,13 @@
},
"systemlang": {
"type": "integer",
"description": "The game language, defaults to EnglishUS. Game must support it.\n Languages list: <https://github.com/SysRay/psOff_public/wiki/Config-files#generaljson>.",
"minimum": 0,
"maximum": 29
},
"userIndex": {
"type": "number",
"description": "Index of the user who launched the game, should be less than \"onlineUsers\" or equal.",
"minimum": 1,
"maximum": 4
}

View File

@ -6,24 +6,30 @@
"type": "string"
},
"display": {
"type": "number"
"type": "number",
"description": "The display index where emulator windows will be shown."
},
"fullscreen": {
"type": "boolean"
"type": "boolean",
"description": "Wether emulator will run in fullscreen mode or not."
},
"width": {
"type": "number",
"description": "The emulator window width, ignored in fullscreen mode.",
"minimum": 400
},
"height": {
"type": "number",
"description": "The emulator window height, ignored in fullscreen mode.",
"minimum": 225
},
"xpos": {
"type": "number"
"type": "number",
"description": "The emulator window horizontal position."
},
"ypos": {
"type": "number"
"type": "number",
"description": "The emulator window vertical position."
}
},
"required": [

View File

@ -7,6 +7,7 @@
},
"sink": {
"type": "string",
"description": "Logging output.",
"enum": [
"Null",
"Auto",
@ -19,6 +20,7 @@
},
"verbosity": {
"type": "integer",
"description": "Verbosity level of logger.\nPossible values:\n0 - Trace\n1 - Debug\n2 - Warning\n3 - Error\n4 - Critical\n5 - None",
"minimum": 0,
"maximum": 5
}

View File

@ -2,38 +2,39 @@
**TL;DR**: If you know yml code, then just check out the [GitHub action workflow](https://github.com/SysRay/psOff_public/blob/main/.github/workflows/build.yml)
* Step 1:
Setting up the environment
### Step 1: Setting up the environment
First things first, you need to download [Git](https://git-scm.com/download/win), [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) or its [Build Tools package](https://aka.ms/vs/17/release/vs_BuildTools.exe), both are fine. The last thing you need is [VulkanSDK](https://vulkan.lunarg.com/sdk/home), on this site you should click on _VulkanSDK-x.x.xxx.x-Installer.exe_ link, then just run the said installer and install it without any changes in its options.
- Step 1.2: Visual Studio installation
#### Step 1.2: Visual Studio installation
When you click on the installer's exe you'll see a window with a bunch of checkboxes. You need to check Desktop development with C++ on the left pane, and then C++ Clang tools for Windows on the right pane, now you all set! Just click the install button and wait for the process to finish.
* Step 2: Clone the psOff repo
### Step 2: Clone the psOff repo
Open any folder you want (I personally prefer %USERPROFILE%\Documents\GitHub) then hold Shift and click RMB on the empty space in this folder. In the new context menu, click "Open in Terminal". Type in the following command:
`git.exe clone --recurse-submodules https://github.com/SysRay/psOff_public.git`
* Step 3: Building the emulator
### Step 3: Building the emulator
- Step 3.1: Configure the project
Type this into your terminal window:
#### Step 3.1: Configure the project
Type this into your terminal window:
`cmake.exe -S. -B_build/_Release -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_build/_Install -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe`
wait 'til it finishes. There shouldn't be any errors.
- Step 3.2: Build the project
And now type this:
#### Step 3.2: Build the project
And now type this:
`cmake.exe --build _build/_Release -j4` This process could take a while. If you see any red text, then you probably missed something. Ask for help on out discord server.
- Step 3.3: Copying libs
### Step 4: Installing
Finally, type this command:
`cmake.exe --install _build/_Release`
Its execution usually takes under 2 or 3 seconds
- Step 3.4: Obtaining executable
If you believe that you did everything right, then all you have to do is get the executable binary somewhere. You can use the [latest GitHub release](https://github.com/SysRay/psOff_public/releases) for this purpose and hope that it will run with the libraries you just built. When you download the archive with the latest release, open it and copy emulator.exe from it to your emulator folder to the following path: psOff_public/_build/_Install.
Done! Now you can try to modify the emulator's code and see how it works.
Done! Now you can try to modify the emulator's code and see how it works. Just open `_build/_Install/` folder and you'll see `emulator.exe` there.
---
author: [igor](https://github.com/igor725)
---
---

View File

@ -2,7 +2,7 @@
Config json-files are created on first start of the emulator and can be found under "./Config". It's enough to call `emulator.exe --h`.
Versioning is todo, copying old config files may therefore break it.
Our configuration engine automatically fixes your config files when you upgrade to a newer version of psOff-libs. All outdated keys will be deleted automatically and the new ones will be added with the default vaue. The corresponding messages will be displayed in the terminal window.
## controls.json : Gamepad layout