Skip to content

Commit 9c9e7b7

Browse files
authored
Add network output compatible with MAME. (#303)
* Add network output compatible with MAME. * Removes NET_BOARD build variables and always builds net board support.
1 parent d6dec3d commit 9c9e7b7

22 files changed

Lines changed: 1125 additions & 191 deletions

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
6464
- name: Build Supermodel
6565
run: |
66-
make -f Makefiles/${{ matrix.makefile }} release NET_BOARD=1 OPT="${OPT_INPUT:-"-O3"}" GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} SILENT=
66+
make -f Makefiles/${{ matrix.makefile }} release OPT="${OPT_INPUT:-"-O3"}" GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} SILENT=
6767
6868
- name: Validate build
6969
run: |
@@ -78,7 +78,7 @@ jobs:
7878
7979
- name: Create package
8080
run: |
81-
make -f Makefiles/${{ matrix.makefile }} pkg NET_BOARD=1 GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} SILENT=
81+
make -f Makefiles/${{ matrix.makefile }} pkg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} SILENT=
8282
8383
- name: Find and upload package
8484
run: |

Docs/README.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,52 @@ All settings are case sensitive.
15311531

15321532
----------------
15331533

1534+
Name: Outputs
1535+
1536+
Argument: String.
1537+
1538+
Description: Manages MAME Hooker compatible outputs.
1539+
Valid options are:
1540+
- none - default, disables outputs.
1541+
- win - Use Windows messages (only on Windows).
1542+
- net - Use network messages.
1543+
1544+
See OutputsWithLF, OutputsTCPPort and
1545+
OutputsUDPBroadcastPort settings when using 'net' option.
1546+
Can only be set in the 'Global' section.
1547+
1548+
----------------
1549+
1550+
Name: OutputsWithLF
1551+
1552+
Argument: Boolean value (true or false).
1553+
1554+
Description: When using 'net' option for 'Outputs', this setting determines whether
1555+
messages are terminated with a line feed character. The
1556+
default is false. Can only be set in 'Global' section.
1557+
1558+
----------------
1559+
1560+
Name: OutputsTCPPort
1561+
1562+
Argument: Integer value.
1563+
1564+
Description: When using 'net' option for 'Outputs', this setting determines the
1565+
TCP port to use for network messages. Can only be set in 'Global'
1566+
section.
1567+
1568+
----------------
1569+
1570+
Name: OutputsUDPBroadcastPort
1571+
1572+
Argument: Integer value.
1573+
1574+
Description: When using 'net' option for 'Outputs', this setting determines the
1575+
UDP broadcast port to use for network messages. Can only be set
1576+
in 'Global' section.
1577+
1578+
----------------
1579+
15341580
Names: InputStart1
15351581
InputStart2
15361582
InputCoin1

Makefiles/Makefile.OSX

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ LD = clang
6464
#
6565

6666
SDL_CFLAGS =
67-
SDL_LIBS = -framework SDL2 -framework OpenGL -framework GLUT -framework Cocoa
68-
ifeq ($(strip $(NET_BOARD)),1)
69-
SDL_LIBS += -framework SDL2_net
70-
endif
67+
SDL_LIBS = -framework SDL2 -framework SDL2_net -framework OpenGL -framework GLUT -framework Cocoa
7168

7269
#
7370
# macOS-specific

Makefiles/Makefile.UNIX

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ LD = gcc
6464

6565
SDL2_CFLAGS = `sdl2-config --cflags`
6666
SDL2_LIBS = `sdl2-config --libs`
67-
ifeq ($(strip $(NET_BOARD)),1)
68-
SDL2_LIBS += -lSDL2_net
69-
endif
67+
SDL2_LIBS += -lSDL2_net
7068

7169
#
7270
# UNIX-specific

Makefiles/Makefile.Win32

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ else
9595
SDL2_LIBS = $(shell sdl2-config --static-libs | sed 's/-mwindows//g')
9696
SDL2_CFLAGS = $(shell sdl2-config --cflags)
9797
endif
98-
ifeq ($(strip $(NET_BOARD)),1)
99-
SDL2_LIBS += -lSDL2_net -liphlpapi
100-
endif
98+
SDL2_LIBS += -lSDL2_net -liphlpapi
10199

102100
#
103101
# MinGW/Windows-specific

Makefiles/Options.inc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ ifneq ($(filter $(strip $(EXTRA_DEBUG)),0 1),$(strip $(EXTRA_DEBUG)))
5151
override EXTRA_DEBUG =
5252
endif
5353

54-
#
55-
# Enable support for Model3 Net Board emulation
56-
#
57-
NET_BOARD =
58-
ifneq ($(filter $(strip $(NET_BOARD)),0 1),$(strip $(NET_BOARD)))
59-
override NET_BOARD =
60-
endif
61-
6254
#
6355
# Include console-based debugger in emulator ('yes' or 'no')
6456
#

Makefiles/Rules.inc

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ ifeq ($(strip $(EXTRA_DEBUG)),1)
5252
SUPERMODEL_BUILD_FLAGS += -DDEBUG
5353
endif
5454

55-
# If Net Board support is enabled, need to define NET_BOARD
56-
ifeq ($(strip $(NET_BOARD)),1)
57-
SUPERMODEL_BUILD_FLAGS += -DNET_BOARD
58-
endif
59-
6055
# If built-in debugger enabled, need to define SUPERMODEL_DEBUGGER
6156
ifeq ($(strip $(ENABLE_DEBUGGER)),1)
6257
SUPERMODEL_BUILD_FLAGS += -DSUPERMODEL_DEBUGGER
@@ -176,16 +171,13 @@ SRC_FILES = \
176171
Src/Pkgs/imgui/imgui_tables.cpp \
177172
Src/Pkgs/imgui/imgui_widgets.cpp \
178173
Src/ROMSet.cpp \
174+
Src/OSD/SDL/NetOutputs.cpp \
175+
Src/Network/TCPReceive.cpp \
176+
Src/Network/TCPSend.cpp \
177+
Src/Network/NetBoard.cpp \
178+
Src/Network/SimNetBoard.cpp \
179179
$(PLATFORM_SRC_FILES)
180180

181-
ifeq ($(strip $(NET_BOARD)),1)
182-
SRC_FILES += \
183-
Src/Network/TCPReceive.cpp \
184-
Src/Network/TCPSend.cpp \
185-
Src/Network/NetBoard.cpp \
186-
Src/Network/SimNetBoard.cpp
187-
endif
188-
189181
ifeq ($(strip $(ENABLE_DEBUGGER)),1)
190182
SRC_FILES += \
191183
Src/Debugger/Debugger.cpp \

README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,12 @@ pacman -S mingw64/mingw-w64-x86_64-SDL2_net
5050

5151
At this point, you can continue using either the MSYS2 shell or Windows Command Prompt but ensure that both ```gcc``` and ```mingw32-make``` are in your path. In MSYS2, the location of these binaries will be ```/mingw64/bin``` and for Command Prompt, assuming MSYS2 was installed in the default location, add ```C:\msys64\mingw64\bin``` to your Windows ```PATH``` variable.
5252

53-
To build Supermodel without network support, use:
53+
To build Supermodel use (Network support built in by default now, no need to specify anymore):
5454

5555
```
5656
mingw32-make -f Makefiles/Makefile.Win32
5757
```
5858

59-
For network support:
60-
61-
```
62-
mingw32-make -f Makefiles/Makefile.Win32 NET_BOARD=1
63-
```
64-
6559
### Linux
6660

6761
Ensure SDL2 is installed. Most package managers ought to have this available. For example, on Ubuntu, it should be sufficient to run:
@@ -78,12 +72,6 @@ And then build Supermodel:
7872
make -f Makefiles/Makefile.UNIX
7973
```
8074

81-
For network support:
82-
83-
```
84-
make -f Makefiles/Makefile.UNIX NET_BOARD=1
85-
```
86-
8775
### macOS
8876

8977
Ensure Apple's Xcode Command Line Tools are installed:
@@ -106,12 +94,6 @@ And then build Supermodel:
10694
make -f Makefiles/Makefile.OSX
10795
```
10896

109-
For network support:
110-
111-
```
112-
make -f Makefiles/Makefile.OSX NET_BOARD=1
113-
```
114-
11597
### Note: running on macOS
11698
If you try and run a macOS binary that was downloaded from the internet and/or built on a different machine, you need to grant macOS permission to execute the binary (just 1-time):
11799

0 commit comments

Comments
 (0)