Jump to content


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

Comlynx Homebrew Emulator

5 replies to this topic

#1 Nop90 OFFLINE  


    Chopper Commander

  • 143 posts
  • Location:Italy

Posted Sat May 11, 2019 3:57 PM

Developing comlynx support for Atari Lynx homebrew could seems a difficult task, but I discovered that it's easy.


I think that the real reasons for so few homebrew with comlynx support are that there aren't so many examples of code available, and comlynx is not well suported on emulators, making difficoult to test the code.


Sage's version of handy should support comlynx emulation over UDP, but using two PC is not the best solution while testing, and on my PCs I wasn't able to make it work (it crashes trying to connect).


Since I'm developig a game that uses a 2 players mode, and I have to wait long time before to have an SD cart or an EEPROM cart programmer PI hat, I decided to modify Sage's version of the emulator to run two instances of the emulator core in the same application, than crosslinked the TX and RX comlynx interfaces of the two cores to have a comlynx test enviroment that can run on a single PC and without relying on network protocols.


I made a quick and dirty tweak of the code, so don't expect an advanced version of handy. It's buggy, plays sound from both emulators core (so better disable sound) and can't emulate commercial games comlynx connection. But it works very well as a testing tools for developers.


It's possible to swap betwen the two cores with CTRL+N or from the emulator menu. The active core outputs to the screen and gets the keyboard input, the other one runs silently in background. This means that it's not possible to use the two cores at the same time.


Attached you can find a build for windows and a zip with the modified sources. When I have time I'll add the sources to my github and post the link here.


To encourage other developers to start using the comlynx feature in their games (this can give more chances to win in the atarigamers game competition of this summer ) I'm sharing here two code examples of comlynx use.


The first one is a simple piece of code from karri already posted on the forum (http://atariage.com/...r/#entry1888745) that doesn't seem to have attracted the attention of the other developers. I slightly modified karri's code and attached it here (testcon.zip).


In this example some sample text is sent over the comlynx connection at the A key press and printed on the screen of the other endpoint. The B key clears the buffer. The direction keys move an Hello world text, so that placing it in different position can help to identify the two running instances.


The second example is a simple but complete game, an implementation of Tic Tac Toe using a 2 player mode over comlynx.


The game uses a simple handshake protocol to start the connection that defines the two players ID (I took the handshake protocol from the comlynx code example of Championship Rally posted here  http://atariage.com/...pionship-rally/) and a simple communication protocol derived from a more complex one I'm developing for another game of mine.


Here are some screeshots of the game:


tictactoe1.png   tictactoe2.png   tictactoe3.png


The game code is mine (wrote it in an hour), this means two things:

- It's public domain (do whatever you want with it, you can also develop from it a full game with muisic, gfx and and AI for 1P mode, but hurry up before I do it first)

- It can contain bugs.


I really hope to see a lot of new homebrew games with comlynx support in the next future.


Happy coding



Note: The code axamples posted here aren't tested on real lynx yet. Please let me know if they work as expected.

Attached Files

Edited by Nop90, Sat May 11, 2019 4:03 PM.

#2 Cyprian_K OFFLINE  


    Chopper Commander

  • 142 posts

Posted Sat May 11, 2019 6:05 PM

Great idea, congrats
Will check it later

Edited by Cyprian_K, Sat May 11, 2019 6:06 PM.

#3 42bs OFFLINE  



  • 324 posts
  • Location:Germany/Southest West

Posted Sat May 11, 2019 11:29 PM

Checked it with T-Tris and SIMIS. Both seem to stuck in the rendezvous code.

Do you echo the data sent also back? (I can't see where you changed the code, so I cannot judge.)

#4 Nop90 OFFLINE  


    Chopper Commander

  • Topic Starter
  • 143 posts
  • Location:Italy

Posted Sun May 12, 2019 12:30 AM

The echo is already in the original code and didn't change it. the CC65 serial example from karri (that is the base from my code examples) use it to check the transmission, so I suppose it's ok.


Let's wait that someone checks if the tic tac toe game works on two real lynx.


About T-Tris and SIMIS, do they use the redeye protocol? Since all the commercial games that use it  don't work on handy, this could be the reason.

#5 42bs OFFLINE  



  • 324 posts
  • Location:Germany/Southest West

Posted Sun May 12, 2019 2:30 AM

It's my own (BLL) protocol. I need to check a simple example.

#6 sage OFFLINE  



  • 997 posts
  • Location:Germany

Posted Sun May 12, 2019 6:34 AM

About T-Tris and SIMIS, do they use the redeye protocol? Since all the commercial games that use it  don't work on handy, this could be the reason.


There is not really "one" red eye protocol.


There are games which rely on the EPYX code. and other are not. Malibu for example uses something completely different.

Also tagged with one or more of these keywords: Comlynx, Homebrew, Emulator

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users