Network code

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Network code

Postby Ian » Tue Jan 30, 2018 8:44 am

Do the clients sync to v-sync or something during the network bootup part?
Ian
 
Posts: 1536
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Boomslangnz » Tue Jan 30, 2018 10:56 pm

yeah Nuexzz sent me a save state which gets past the warning screen

but setting both to Master doesn't work really lol

although the network instances are communicating the entire time

I also tried setting 1 as master and the other as slave and using the save state on Master

Master goes into attract mode and slave keeps at connecting screen and supermodel keeps communicating for a few seconds before freezing up once slave fails

https://www.sendspace.com/file/h1rmjt
Boomslangnz
 
Posts: 134
Joined: Mon Jul 23, 2012 10:35 pm

Re: Network code

Postby Spindizzi » Wed Jan 31, 2018 2:34 am

there is certainly a sync that must be done during the exchange of the first network frame to align the master and slave at the timings (vsync based that should perhaps pause, slow down or speed up the client ??) , but I have no idea how it should happen and then we cheat a bit by synchronizing on the first frame received. So we're not in normal operation at all (otherwise everything would work, :roll: )

Wow, quelle bidouille! (in french) oups, what a hack, lol
Can't be working since master and slave have a unique id and have different bytes set. In addition, the savestate is not implemented for the net version (no net memory save / restore). But I agree, it had to be trying :lol:
Spindizzi
 
Posts: 122
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Network code

Postby Jiterdomer » Wed Jan 31, 2018 4:05 am

Good job (bon travail), monsieur! I wish you and nuexzz would work together.
Feel the heartbeat of my machine through this tight seat. I feel every motion of my machine
Image
User avatar
Jiterdomer
 
Posts: 495
Joined: Mon Sep 26, 2011 6:37 pm
Location: Los Angeles, CA

Re: Network code

Postby SailorSat » Wed Jan 31, 2018 3:28 pm

Model-1 and Model-2 both have a code block that checks for 120 VINTs, then counts the nodes (sending 'K' 'a' 'z' 0 <id> <total nodes>) and afterwards does some kind of network sync (150 VINTs on Model-1) before going "ingame".

I suspect Model-3 would be doing the same.

*EDIT*
take a look at http://files.arianchen.de/model1/epr-15112.html for the Model-1 firmware explained
SailorSat
 
Posts: 33
Joined: Mon Jun 06, 2016 4:26 am

Re: Network code

Postby Spindizzi » Thu Feb 01, 2018 3:00 am

Super, a network pro goes into the dance :D
very interesting document!
I recognize some elements, there is a lot of similarity (ioreg, commram, operation flow)
I do not know if you have already watched the operation on model3, but you risk to navigate in known world 8-)

Another thing, to fix dirt with 3 and 4 players, I had to use what I thought was the machine number: commram [0x0002] (aka shared ram)
ie: dirt with master slave1 salve2 I've got
M sends 0x02 0xff 0x03 0x03 0x03 0x03
S1 sends 0x02 0xff 0x03 0x03 0x02 0x02
S2 sends 0x02 0xff 0x03 0x03 0x01 0x01
commram [0x0002] = num of machines
commram [0x0003] = num of master slave machine (sat not include) ??
commram [0x0004] = id
commram [0x0005] = packet destination?
Spindizzi
 
Posts: 122
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Network code

Postby SailorSat » Thu Feb 01, 2018 5:57 am

I haven't peeked too far into model-3 yet.
Currently in the process of documenting the Model-2 firmware (actually there are two).

Once I got that I might try the Model-3 Firmware, although I have next to no expertise on mc68k assembly :)

As for Satelite/Relay Nodes:
For Model-1 there can be any number of relay/satelite nodes, they don't get a Node ID and don't count up the node count either.
For Model-2 this feature seems to be missing - Sega Rally "Live Cam"-nodes get an active node id and the total node count goes up.
SailorSat
 
Posts: 33
Joined: Mon Jun 06, 2016 4:26 am

Re: Network code

Postby Ian » Mon Feb 05, 2018 9:29 am

Spindizzi,
I could log the traffic in Nik's supermodel network version if that would help?
I already had a small look at the network traffic. Assuming his code is not inserting other data into the stream I figured out a little of the protocol
0xFF is used to mark the end of data packets. Probably the first byte is used to identify the packet type. I see one of the bytes that is used to mark the node ID.
Ian
 
Posts: 1536
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Spindizzi » Mon Feb 05, 2018 10:58 am

I think we are no need to worry about data packet protocol. model3 just sends a big packet containing slots inside and sets the data received in right place. slot = 1 block of datas for 1 machine. Address and size of packets/slots are predetermined for each games in the start of commram [8 to 0xf]
The log could be useful to verify what is transfered and may be where is it placed in commram but it would be a giant amount a datas. Not sure it could really help, but I would like to study that
is Nik's version working with all games or only daytona2/daytona2pe?
Spindizzi
 
Posts: 122
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Network code

Postby Ian » Mon Feb 05, 2018 11:02 am

I haven't done much testing with it
But it works with scud (but the car's orientation is broken). Like in multiplayer cars face backwards and inverted. Probably some endian swappage or something
I haven't tested daytona yet but I think it works with that
Harley will work with it, but it hangs on the player selection screen. It doesn't get any further.
Ian
 
Posts: 1536
Joined: Tue Feb 23, 2016 9:23 am

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 7 guests