Skip to content

Commit

Permalink
misc: redesign to support emulation station
Browse files Browse the repository at this point in the history
  • Loading branch information
jsm174 committed Nov 9, 2023
1 parent 80d57cb commit 3cb5159
Show file tree
Hide file tree
Showing 15 changed files with 7,536 additions and 9,825 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
mkdir tmp
cp build/vpxds tmp
cp vpxds.ini tmp
cp -r assets tmp
cp -r scripts/batocera tmp
- uses: actions/upload-artifact@v3
with:
Expand Down
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(vpxds)

set(CMAKE_CXX_STANDARD 20)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

find_package(PkgConfig REQUIRED)
find_package(X11 REQUIRED)

Expand All @@ -20,8 +22,11 @@ add_executable(vpxds
VPXDisplayServer.cpp
inc/mongoose/mongoose.c
inc/mongoose/mongoose.h
inc/tinyxml2/tinyxml2.cpp
inc/tinyxml2/tinyxml2.h
)

target_link_libraries(vpxds ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${X11_LIBRARIES})
target_link_libraries(vpxds ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${X11_LIBRARIES})


add_custom_command(TARGET vpxds POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/assets" "$<TARGET_FILE_DIR:vpxds>/assets"
)
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,34 @@ The settings for these windows, such as enabling and positioning, are controlled

```ini
[Settings]

ESURL=

TableWidth=1080
TableHeight=1920

CachePath=/userdata/roms/vpinball/vpxds

Backglass=1
BackglassX=1080
BackglassY=0
BackglassWidth=1024
BackglassHeight=768

DMD=1
DMDX=2104
DMDY=0
DMDWidth=1360
DMDHeight=768
CachePath=/userdata/roms/vpinball/backglasses
```


When a game is selected in EmulationStation it executes `game-selected` scripts.

I have custom `game-selected.sh` scripts [here](https://github.com/jsm174/vpxds/blob/master/scripts/batocera/emulationstation/scripts/game-selected) that send messages to the `vpxds` app and changes the backglass and dmd images if they exist.

If you are using `directb2s` files, you can use the `b2s` command:

```bash
curl -S "http://127.0.0.1:8111/b2s?vpx=/userdata/roms/vpinball/<table>.vpx" > /dev/null 2>&1
```

This opens the `directb2s` file, fetches the backglass image, and saves it to the `CachePath` path specified in `vpxds.ini`.

If you want to use your own custom images, you can use the `update` command:
I have custom `game-selected.sh` scripts [here](https://github.com/jsm174/vpxds/blob/master/scripts/batocera/emulationstation/scripts/game-selected) that send messages to the `vpxds` app and changes the backglass and dmd images if they exist:

```bash
curl -S "http://127.0.0.1:8111/update?display=backglass&image=/userdata/roms/vpinball/<table>-backglass.png" > /dev/null 2>&1
curl -S "http://127.0.0.1:8111/update?display=dmd&image=/userdata/roms/vpinball/<table>-dmd.png" > /dev/null 2>&1
curl -S "http://127.0.0.1:8111/update?display=backglass&path=/userdata/roms/vpinball/<table>.vpx" > /dev/null 2>&1
curl -S "http://127.0.0.1:8111/update?display=dmd&path=/userdata/roms/vpinball/<table>.vpx" > /dev/null 2>&1
```

For more information on custom EmulationStation scripts, refer to this [wiki](https://wiki.batocera.org/launch_a_script#emulationstation_scripting).
Expand Down
Loading

0 comments on commit 3cb5159

Please sign in to comment.