Jump to content
IGNORED

A tweaked version of Handy to test Comlynx homebrew and some code examples


Nop90

Recommended Posts

  • 1 month later...
On 12/31/2019 at 7:48 PM, karri said:

Sure. I will spend some time on this tomorrow. As you are using cc65 I can just write a test suite for the library.

Any update?

 

I found that when the prolem happens the UART sets the RXoverun error bit.

 

 

Link to comment
Share on other sites

  • 1 month later...

@karri I found another problem with the serial driver when used for making comlynx games: sending and receiving seems to be unbalanced and if the master sends almost all the game data to the slaves, the slaves gets a music slowdown (probably because the serial interrupt interferres with the HBL and VBL interrupts).

 

This is a pity because for every other aspects the driver works really fine.

 

 

Link to comment
Share on other sites

I am not suprised.

 

We could remove all the "sei" and "cli" commands. I did in On Duty to get sampled screams to work without slowdown.

 

The good thing is that it speeds up everything... Until you run out of stack and get a crash.

 

Link to comment
Share on other sites

I found a trivial but effective workaround: if the slave sends some fake data so that received and transmitted data in a frame are the same amount, the music remains in sync. It's a waste of bandwidth, but as long as the game speed doesn't suffer for it, it's acceptable.

 

With this fix Biniax2 should be ready for the release. 

Link to comment
Share on other sites

32 minutes ago, Nop90 said:

I found a trivial but effective workaround: if the slave sends some fake data so that received and transmitted data in a frame are the same amount, the music

I am pretty sure commercial ComLynx games do it like this. Always send the same amount of data. Makes it also easier to calculate WCET.

Link to comment
Share on other sites

I agree, and did not realize that was not happening in Biniax during my testing (sorry nop90!). All Lynx games should transmit a packet every cycle whether or not there is meaningful data.

 

This is the same way Doom networking was set up on the original source code: you establish the order at init time, then during a game everyone listens to the traffic until it is their turn to transmit. Very simple but effective for a closed network.

Link to comment
Share on other sites

54 minutes ago, Songbird said:

I agree, and did not realize that was not happening in Biniax during my testing (sorry nop90!). All Lynx games should transmit a packet every cycle whether or not there is meaningful data.

 

This is the same way Doom networking was set up on the original source code: you establish the order at init time, then during a game everyone listens to the traffic until it is their turn to transmit. Very simple but effective for a closed network.

My protocol works the same, but client and server packets was of different sizes (the server sends the whole game state every cycle, the client sends only the keyboard values).

 

Adding dummy data to the client packet solved the problem.

 

With more than 2 players this is a big waste of bandwidth, so a better approach could be that at every frame the game logic is computed by a different element of the chain. this way after a complete round every node has the same amount of transmitted and received data.

 

I'll implement this solution in Lawnmower, where I plan to make connect up to 4 players.

Link to comment
Share on other sites

Most games could get by with just send key presses. Maybe in some games where random data appears (next row of blocks), you'd have to send either a seed or the actual data to the 2nd player, but I agree that keeping the packets the same size probably makes it all much smoother.

 

In general I'd suggest sending as few bytes as possible, and relying on both Lynxes to compute the same results, instead of one Lynx sending large amounts of data to the other Lynx(es) in the chain.

 

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...