-
Notifications
You must be signed in to change notification settings - Fork 55
Add network output, based on MAME's network output system #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
trzy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good feature but substantial rework needed. I don't like the Windows-specific nature of this. I think it's unnecessary: UDP should be done via SDL2_net, not Winsock, and threading should be done with std::thread, not the Windows API.
Also, make sure to add the Supermodel file header to each source file.
| struct Packet | ||
| { | ||
|
|
||
| static const UINT32 BUFFER_SIZE_UDP = 1460; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we convert tabs to spaces everywhere? I think we are using a 4-character tab stop.
| #include <vector> | ||
| #include <thread> | ||
|
|
||
| namespace SMUDP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this namespace at all?
|
|
||
| #pragma comment(lib, "ws2_32.lib") | ||
|
|
||
| WinSockWrap::WinSockWrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is Winsock needed? SDL2_net has UDP, to my knowledge. This should be platform-agnostic, similar to the netplay TCP code, no?
| #endif | ||
| config.Set("Outputs", "none"); | ||
| config.Set("DumpTextures", false); | ||
| config.Set("NetOutputsWithLF", "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can probably drop the Net prefix here and just group these below "Outputs".
| #endif | ||
| config.Set("Outputs", "none"); | ||
| config.Set("DumpTextures", false); | ||
| config.Set("NetOutputsWithLF", "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OutputsWithLF should probably be a bool rather than int?
| // Will do SendUdpBroadcastWithId(); | ||
| } | ||
|
|
||
| LRESULT CNetOutputs::CreateServerThread() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor to eliminate all Windows dependencies here. std::thread can be used. No need for any Windows functions or types like LRESULT, DWORD, etc.
| <ClCompile Include="..\Src\Network\SimNetBoard.cpp" /> | ||
| <ClCompile Include="..\Src\Network\TCPReceive.cpp" /> | ||
| <ClCompile Include="..\Src\Network\TCPSend.cpp" /> | ||
| <ClCompile Include="..\Src\Network\TCPSendAsync.cpp" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update Rules.inc in Makefiles.
|
All the network stuff is copy/paste from much earlier versions of supermodel before the networking code really worked. They shouldn't be needed I don't think for the mame outptut stuff. Tbh not even sure what it is / for. |
I've never used this feature but Nik hooked up the original output system to work with something called MameHooker (heh). It's for the various lights on the cabinets, for those who want to emulate those or implement them on custom cabs. |
|
The main thing is that the current outputs system is constrained to Windows but this one could actually be platform-independent. Better to do that. |
|
All the network code is what I wrote for spindizzi when we trying to get networking working. It wasn't required for the mame output stuff. In the end i rewrote the network code for SDL. |
|
@dukeeeey That's something I have done a long time ago for my own usage (forcefeedback software), maybe a few years ago, and forgot about it until somebody ask me an update today. When I will have spare time I will check your code review. Thank for spending time reviewing it. |
|
The only files you need are netoutputs.cpp / h. I am pretty sure the rest isn't needed. |
|
Hello, I am Darren, also known as 6Bolt, the coder of Hook Of The Reaper program. Github link below. https://github.com/6Bolt/Hook-Of-The-Reaper Hook Of The Reaper is an alternative to the aging MameHooker. Since it is a newer program, I didn't want to do the windows to windows communication. I get the output signals from TCP port 8000, on the localhost. This is supported by MAME, DemulShooter, and now nixxou's 3 light gun Emulator builds. HOTR has taken over MameHooker in the light gun community. I have your SuperModel v0.3.1-26-g95968f3, which supported the network output. I have the needed DefaultLG game files on my website. These are similar to MameHooker ini game files, but work for any DefaultLG light gun, with no modification. To enable it , I had to put 'outputs = net' in the Supermodel.ini file. Link to game files below. https://hotr.6bolt.com/pmwiki.php/GameFiles/SuperModel Looking at the current code, the Src/OSD/Windows/NetOutputs.h/cpp is not there anymore. Was it moved to a different location? Or was Net Outputs removed? If not, how do you enable it? As light gun players are now wanting to play the light gun games with HOTR. |
|
I believe NetOutputs.cpp was part of a PR that was not approved as it needed considerable refactoring. We would like a solution that is not Windows dependent if it is using TCP sockets. There is already socket code in Supermodel for netplay using SDL, which is cross-platform. If you’d like to add a TCP based output system, that would be great, but it should not contain any Windows-specific code (unless there is a very good reason). Sent from my iPhoneOn Jul 9, 2025, at 5:51 PM, Darren ***@***.***> wrote:6Bolt left a comment (trzy/Supermodel#253)
Hello, I am Darren, also known as 6Bolt, the coder of Hook Of The Reaper program. Github link below.
https://github.com/6Bolt/Hook-Of-The-Reaper
Hook Of The Reaper is an alternative to the aging MameHooker. Since it is a newer program, I didn't want to do the windows to windows communication. I get the output signals from TCP port 8000, on the localhost. This is supported by MAME, DemulShooter, and now nixxou's 3 light gun Emulator builds. HOTR has taken over MameHooker in the light gun community.
I have your SuperModel v0.3.1-26-g95968f3, which supported the network output. I have the needed DefaultLG game files on my website. These are similar to MameHooker ini game files, but work for any DefaultLG light gun, with no modification. To enable it , I had to put 'outputs = net' in the Supermodel.ini file. Link to game files below.
https://hotr.6bolt.com/pmwiki.php/GameFiles/SuperModel
Looking at the current code, the Src/OSD/Windows/NetOutputs.h/cpp is not there anymore. Was it moved to a different location? Or was Net Outputs removed? If not, how do you enable it? As light gun players are now wanting to play the light gun games with HOTR.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
|
OK, I understand. I only use Windows stuff, only when I have too. I have converted nixxou's MameOutputSender program from windows to windows communications to network TCP communications. This is used on his light gun builds for Dolphin, Duck Station, and PCSX2. Currently I am busy with the Hook Of The Reaper project. When that is completed, I could get it done. But that would be 6-9 months from now. |
Add TCP server socket 8000 and UDP (broadcast) 8001 for network outputs.