Page 16 of 23

Re: Network code

PostPosted: Tue Jan 30, 2018 8:44 am
by Ian
Do the clients sync to v-sync or something during the network bootup part?

Re: Network code

PostPosted: Tue Jan 30, 2018 10:56 pm
by Boomslangnz
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

Re: Network code

PostPosted: Wed Jan 31, 2018 2:34 am
by Spindizzi
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:

Re: Network code

PostPosted: Wed Jan 31, 2018 4:05 am
by Jiterdomer
Good job (bon travail), monsieur! I wish you and nuexzz would work together.

Re: Network code

PostPosted: Wed Jan 31, 2018 3:28 pm
by SailorSat
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

Re: Network code

PostPosted: Thu Feb 01, 2018 3:00 am
by Spindizzi
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?

Re: Network code

PostPosted: Thu Feb 01, 2018 5:57 am
by SailorSat
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.

Re: Network code

PostPosted: Mon Feb 05, 2018 9:29 am
by Ian
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.

Re: Network code

PostPosted: Mon Feb 05, 2018 10:58 am
by Spindizzi
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?

Re: Network code

PostPosted: Mon Feb 05, 2018 11:02 am
by Ian
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.