Add network output compatible with MAME.#303
Conversation
|
Need more time to look at this but bool m_running; Why do you have the sleep there? Shouldn't need it. Also what happens if the thread has already exited? I forget, will join() bork? Maybe need to check if it's joinable first? unsigned int m_maxClients = 10; Add const to this! |
|
I’d like to take a look later this week as well before this merges. |
9bcf7cc to
702906b
Compare
|
Take your time, this is not urgent, I'm playing with local builds since some weeks. @dukeeeey |
|
Last comments :) Looking good const unsigned int NET_OUTPUTS_DEFAULT_TCP_PORT = 8000; I'd put those inside a class? Class is also a namespace rather than global Why are these lower case to start? :) |
702906b to
8968f3d
Compare
This I didn't get fully, you meant something like this?
Company coding guide 😆 fixed it to uppercase. |
|
Code looks good |
There was a problem hiding this comment.
Looks good but I have one request, if possible: I have never used an application that listens for these outputs. Would it be possible to write a Python script that listens for them and prints them out? We have a scripts directory. This would be great for testing.
Ideally, the Python script wouldn't depend on any external packages for now. I assume you would just vibe code that but I have Python code for UDP listeners and TCP servers and clients if you want me to point you to some references.
8968f3d to
dc7fb80
Compare
I've had a test script from development, pimped it a bit and stored it in the Scripts folder. The script waits for UDP broadcast and continuously tries to connect to the TCP interface. Messages are logged with their content to the console. |
dc7fb80 to
4cbe3bd
Compare
|
This doesn't compile for me: |
|
Wait... this requires NET_BOARD=1 to pull in SDL_net. Do we just get rid of NET_BOARD altogether and always compile the net code? Can't see why not. |
|
Another change required:
|
Should I remove NET_BOARD completely with this PR or change this PR so SDL_net is included and start another PR for removing NET_BOARD? Removing it this this PR might make it huge, but fine for me. Just want to avoid that this PR is rejected due to it's size 😆 Edit: Hm, while browsing the code I've noticed also occurrences of NET_BOARD in regards to SDL_net in Makefile and .inc files. So maybe it's best to really remove it with this PR. Or another PR upfront to this one. Opinions @trzy @dukeeeey ? |
|
My opinion is that we should always just build the net board stuff. So I would remove it and make it so it functions as if that was set to 1 everywhere.Sent from my iPhoneOn Mar 26, 2026, at 5:01 PM, Tobias Breckle ***@***.***> wrote:tbreckle left a comment (trzy/Supermodel#303)
Wait... this requires NET_BOARD=1 to pull in SDL_net. Do we just get rid of NET_BOARD altogether and always compile the net code? Can't see why not.
Should I remove NET_BOARD completely with this PR or change this PR so SDL_net is included and start another PR for removing NET_BOARD? Removing it this this PR might make it huge, but fine for me. Just want to avoid that this PR is rejected due to it's size 😆
Edit: Hm, while browsing the code I've noticed also occurrences of NET_BOARD in regards to SDL_net in Makefile and .inc files. So maybe it's best to really remove it with this PR. Or another PR upfront to this one. Opinions @trzy @dukeeeey ?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
| cpu->AddRegion(0x90000000, 0x9000000B, false, false, "Real3D VROM Texture Port"); | ||
| cpu->AddRegion(0x94000000, 0x940FFFFF, false, false, "Real3D Texture FIFO"); | ||
| cpu->AddRegion(0x98000000, 0x980FFFFF, false, false, "Real3D Polygon RAM"); | ||
| #ifndef NET_BOARD |
There was a problem hiding this comment.
@trzy
How to properly handle this case? Is Step 1.x meaning 1.0 or really 1.0 and 1.5? If so there's an overlap of the net board shared RAM of the line below.
I tried to figure it out on my own but am stuck.
The model3.cpp states it slightly different but also with an overlap:
* 98000000-980FFFFF Real3D Polygon RAM
* C0000000-C000FFFF Netboard Shared RAM (Step 1.5+)
* C0010000-C00101FF Netboard Registers (Step 1.5+)
* C0020000-C002FFFF Netboard Program RAM (Step 1.5+)
* C0000000-C00000FF SCSI (Step 1.x)
* C1000000-C10000FF SCSI (Step 1.x) (Lost World expects it here)
* C2000000-C20000FF Real3D DMA (Step 2.x)
Do we require per game / hw stepping / hw feature conditions here?
There was a problem hiding this comment.
Does something like below make sense (needs some more tweaking for lostwsga but shows the idea)?
if (!model3->GetGame().netboard_present)
{
// Netboard not present, so SCSI is at 0xC0000000.
cpu->AddRegion(0xC0000000, 0xC00000FF, false, false, "SCSI (Step 1.x)");
}
else
{
// Netboard present, so SCSI is at 0xF9000000 and 0xC0000000+ is used for netboard RAM.
cpu->AddRegion(0xC0000000, 0xC000FFFF, false, false, "Netboard Shared RAM (Step 1.5+)");
cpu->AddRegion(0xC0020000, 0xC002FFFF, false, false, "Netboard Program RAM (Step 1.5+)");
}
if (model3->GetGame().name == "lostwsga" || model3->GetGame().name == "lostwsgo")
{
cpu->AddRegion(0xC1000000, 0xC10000FF, false, false, "SCSI (Step 1.x) (Lost World expects it here)");
}
|
I don’t think there should be game-specific code like this. My understanding is that SCSI appears at 0xCxxxxxxx and when net board is present, it is at 0xC00xxxxx (so SCSI is not visible there anymore on systems with net board).I think you should always see SCSI at 0xC1xxxxxx on Step 1.x, so no point in only doing that only for Lost World. It should always be mapped there, right?Sent from my iPhoneOn Mar 27, 2026, at 6:54 AM, Tobias Breckle ***@***.***> wrote:
@tbreckle commented on this pull request.
In Src/Debugger/SupermodelDebugger.cpp:
@@ -78,13 +76,8 @@ namespace Debugger
cpu->AddRegion(0x90000000, 0x9000000B, false, false, "Real3D VROM Texture Port");
cpu->AddRegion(0x94000000, 0x940FFFFF, false, false, "Real3D Texture FIFO");
cpu->AddRegion(0x98000000, 0x980FFFFF, false, false, "Real3D Polygon RAM");
-#ifndef NET_BOARD
Does something like below make sense (needs some more tweaking for lostwsga but shows the idea)?
if (!model3->GetGame().netboard_present)
{
// Netboard not present, so SCSI is at 0xC0000000.
cpu->AddRegion(0xC0000000, 0xC00000FF, false, false, "SCSI (Step 1.x)");
}
else
{
// Netboard present, so SCSI is at 0xF9000000 and 0xC0000000+ is used for netboard RAM.
cpu->AddRegion(0xC0000000, 0xC000FFFF, false, false, "Netboard Shared RAM (Step 1.5+)");
cpu->AddRegion(0xC0020000, 0xC002FFFF, false, false, "Netboard Program RAM (Step 1.5+)");
}
if (model3->GetGame().name == "lostwsga" || model3->GetGame().name == "lostwsgo")
{
cpu->AddRegion(0xC1000000, 0xC10000FF, false, false, "SCSI (Step 1.x) (Lost World expects it here)");
}
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This pull request adds a new network-based output system to the SDL build, allowing output messages to be sent over TCP and UDP for integration with tools like MAMEHooker.
This is meant as a successor of the following PR: #253
Successfully tested with Daytona 2, LA Machineguns, Lost World, SW Trilogy.
So far tests only on Linux, waiting for the build system to produce a Windows build.Tested on Windows with Hook Of The Reaper and QMameHooker / custom scripts / Wireshark on Linux.
Updating docs will follow before leaving draft state.Docs updated.
PR summary (Copilot):
Network Output System Integration:
NetOutputs.cppandNetOutputs.himplementing theCNetOutputsclass, which sends output messages over TCP and UDP in a MAMEHooker-compatible format. This includes client registration, data transmission, and UDP broadcast for discovery. [1] [2]Main.cppto support selecting the "net" output system via configuration, including instantiation, initialization, and configuration of TCP/UDP ports and line endings. [1] [2]Configuration Enhancements:
OutputsWithLF(line ending),OutputsTCPPort, andOutputsUDPBroadcastPortto control network output behavior.Build System and Project File Updates:
NetOutputs.cppin the SDL source file list for building.NetOutputs.hto the Visual Studio project and filter files, ensuring proper inclusion in the build environment. [1] [2] [3]