Jump to content
IGNORED

Atari Lynx II - Raspberry Pi Install


cowdog360

Recommended Posts

  • 4 months later...

Just read this entire thread.

 

This is SO going to be my next project.

 

Ah.....finally a portable A8 .....I hope emulation is good on Raspberry Pi, saw a few videos and it looks pretty damn good.

 

I'd prefer to use a Lynx I though but the button situation is a lot harder on that one.....will need isolating all the buttons on the PCB (by scraping tracks) and wiring them up. But it's doable for sure :D

Link to comment
Share on other sites

I actually thought of doing another one with a Lynx I shell as well. Same idea, but cutting out the lens more for a larger LCD. Actually, it would almost be better just to fill in the original button area and mount 4 buttons from an SNES controller. Do a little bondo work and paint it all nice.

Link to comment
Share on other sites

Mmmm, I guess that would be one step too far for me. My goal for this would be playing old arcade games under MAME and A8 stuff. Everything else is bonus. Most of the arcade and all of the A8 stuff will have enough with the available buttons.....although I think you used the backlight button for something on the Lynx 2 pi ?

Link to comment
Share on other sites

Sorry to spoil your nice designs. For emulating games on the big screen nothing beats HDMI and pure processing power.

 

My favourite enclosure is the Flirc-case. It has aluminum cooling for Raspberry Pi 3.

flirccase3.jpg

 

Naturally it runs also Kodi and the blue ribbon cable is for cart manufacturing purposes.

 

flirccase4.jpg

 

The PiZero Arcade is good for Atari Lynx emulation. For emulating more capable stuff the PiZero stutters.

 

Edited by karri
Link to comment
Share on other sites

Not interested in emulation on "big screen". prefer to run original hardware (A8) in that situation with a good CRT.

 

Or play on real arcade machines :)

 

My deepest wish is a 100% hardware portable A8 on FPGA, but since that's not available a pi in a Lynx is a very good compromise :)

Link to comment
Share on other sites

  • 2 weeks later...

Here is my RetroPie wiring and button mapping. The nice thing is to map the characters to the pins in such a way that navigation in the RetroPie menus also works using the same buttons.

 

post-2099-0-69332700-1476939076_thumb.png

 

This also leaves the pins free for my Lynx cart interface and ComLynx port. There may even be such a LynxHAT available after a while...

Edited by karri
  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Hi, I recently learned about Retropie and got a pi3 and got it all running out of a case, plugged into my big TV, and immediately thought - this would be awesome in a portable. And since I used to have Lynxs back in the day, I knew the case was pretty chunky. I was delighted to find people had already done that! So I've been researching, watching youtube videos, and figuring out which components I need to buy. My goal is to create a portable I can play, or plug an HDMI cable into and connect it to the TV, and plug a controller in the USB port and play it the way I play it now.

 

Cowdog360 your write up has been really helpful. Did you ever complete your version to run on AA batteries?

Link to comment
Share on other sites

  • 1 month later...

This is an interesting project.

I have also a dead Lynx II that I was tihnking of Raspifying. I got myself a Pi Zero and this TFT module that plugs straight over Pi: http://www.ebay.com/itm/161643938962

 

Cheap...

 

June 26 2016,update to V6.0. Refresh rate is faster than V5.0, 6frame/s min.

 

 

Is it not a bit too slow? I used the analog pins and a similar Car rear view monitor. The price was about the same. But the speed on the analog one is same as on HDMI as it uses the GPU.

Link to comment
Share on other sites

  • 3 years later...

lets see if i can revive this topic as i am in need of some help.

 

big cudos for the lynx 2 project, i am trying to build one myself but i am stuck with the ribbon cable.

it seems the signal between the ribbon pads is not strong enough on my lynx 2 i think, when connecting to ground and connecting + pressing the buttons i do not get a clean signal, yes it sets a little value but no beeping betwen the connections, not strait on the ribbon and not with the connector.

when i put the the wires to a usb controller board it works, but i would like to get it working on the gpio.

the only buttons not responding are ON and OFF on the controller.

also, wich cable drives the LED ? ( i have cut out the board connector )

retrogame config driver is installed and this is how i wired it .

 

LEFT       4  # Joypad left
RIGHT     19  # Joypad right
UP        16  # Joypad up
DOWN      26  # Joypad down
LEFTCTRL  14  # 'A' button
LEFTALT   15  # 'B' button
Z         20  # 'X' button
X         18  # 'Y' button
SPACE      5  # 'Select' button
ENTER      6  # 'Start' button
A         12  # Left shoulder button
S         13  # Right shoulder button
ESC       17  # Exit ROM; PiTFT Button 1

 

controls get undetected. is there a way i could fix this ? am i missing something ? or maybe i cannot connect it strait away and i need a resistor or something ? 

would you be so kind to help me ?

 

i would like to keep the lynx 2 as original as possible on the outside and just use it as an 8bit 2 button only console and maybe get it to switch from left to righthand mode ( if possible )

wire setup has hcanged since the picture, all connections make good contact withe the connector cable, but even measuring on the flat cable does not give me a signal sound.

it is not an spi screen, its with hdmi .

IMG_20200709_191516.jpg

IMG_20200709_195952.jpg

Edited by Stijn Van Orshaegen
Link to comment
Share on other sites

The Lynx buttons are reversed from standard Retro Pie. So you need to change the sources a bit and compile your own version.

 

When you press the button the signal goes to "1" - not "0" as is required by the Adafruit drivers.

 

Fortunately the change is very simple to do. You just invert the rule for a press in the source. I can dig up my version and post the source. Here is my modified driver that works in the video below.

 

The Pi pins are not 5V compliant. I solved it by soldering resistors to lower the voltage.

Adafruit-Retrohame.zip

 

  • Like 1
Link to comment
Share on other sites

7 hours ago, karri said:

The Lynx buttons are reversed from standard Retro Pie. So you need to change the sources a bit and compile your own version.

 

When you press the button the signal goes to "1" - not "0" as is required by the Adafruit drivers.

 

Fortunately the change is very simple to do. You just invert the rule for a press in the source. I can dig up my version and post the source. Here is my modified driver that works in the video below.

 

The Pi pins are not 5V compliant. I solved it by soldering resistors to lower the voltage.

Adafruit-Retrohame.zip 53.25 kB · 0 downloads

 

ok ,thank you.

i forgot to mention that i have absolutely no experience in compiling... i downloaded a retropie version that has the retrogame preinstalled and i have used it already in my raspberry pi gameboy that i made some time ago.

any chance to point me to the "how to"? i kan putty to the pi, but really understanding the system is another thing...

i have a box of all kinds of resistors so what value did you use and where did youy solder it to ?

so i'm in the pi with ssh, but how do i install your source ?

Edited by Stijn Van Orshaegen
Link to comment
Share on other sites

11 hours ago, Stijn Van Orshaegen said:

ok ,thank you.

i forgot to mention that i have absolutely no experience in compiling... i downloaded a retropie version that has the retrogame preinstalled and i have used it already in my raspberry pi gameboy that i made some time ago.

any chance to point me to the "how to"? i kan putty to the pi, but really understanding the system is another thing...

i have a box of all kinds of resistors so what value did you use and where did youy solder it to ?

so i'm in the pi with ssh, but how do i install your source ?

Having an ssh connection is a good thing. We start by checking that your pins work. In order to go this you need some test program. Here is a Python program that listens to GPIO buttons and prints when they get pressed.

 

You need to install gpiozero to your RetroPie Lynx.

 

sudo apt install python-gpiozero

 

Then you need to copy the file here to the lynx

 

scp lynxpins.py pi@your.ip.address:

 

lynxpins.py

 

In the file you can see that I map certain functions to certain pins like
left = Button(27)

 

Later in the code I can check if the pin is pressed like:

 

if left_is_pressed:

    do something.

 

Here you may notice that Lynx pins are all "pressed" by default and when you really press the button it is actually released.

class btns():
    def __init__(self):
        self.left = Button(27)
        self.right = Button(22)
        self.up = Button(4)
        self.down = Button(17)
        self.A = Button(5)
        self.B = Button(16)
        self.pause = Button(20)
        self.opt1 = Button(21)
        self.opt2 = Button(19)
        self.esc = Button(6)

    def all(self):
        if self.left.is_pressed:
            pass
        else:
            print('left')
        if self.right.is_pressed:
            pass
        else:
            print('right')

You can now run the code over ssh and press the buttons to see if they work.

 

python lynxpins.py

 

Once this part works and we have all the pins mapped we can go to the next step.

 

If the pins do not work we may have to see that the voltages of the button pins are ok. It should be almost 3V when you press the button and 0V when you don't.

 

  • Like 1
Link to comment
Share on other sites

40 minutes ago, karri said:

Having an ssh connection is a good thing. We start by checking that your pins work. In order to go this you need some test program. Here is a Python program that listens to GPIO buttons and prints when they get pressed.

 

You need to install gpiozero to your RetroPie Lynx.

 


sudo apt install python-gpiozero

 

Then you need to copy the file here to the lynx

 


scp lynxpins.py pi@your.ip.address:

 

lynxpins.py 1.35 kB · 1 download

 

In the file you can see that I map certain functions to certain pins like
left = Button(27)

 

Later in the code I can check if the pin is pressed like:

 

if left_is_pressed:

    do something.

 

Here you may notice that Lynx pins are all "pressed" by default and when you really press the button it is actually released.


class btns():
    def __init__(self):
        self.left = Button(27)
        self.right = Button(22)
        self.up = Button(4)
        self.down = Button(17)
        self.A = Button(5)
        self.B = Button(16)
        self.pause = Button(20)
        self.opt1 = Button(21)
        self.opt2 = Button(19)
        self.esc = Button(6)

    def all(self):
        if self.left.is_pressed:
            pass
        else:
            print('left')
        if self.right.is_pressed:
            pass
        else:
            print('right')

You can now run the code over ssh and press the buttons to see if they work.

 


python lynxpins.py

 

Once this part works and we have all the pins mapped we can go to the next step.

 

If the pins do not work we may have to see that the voltages of the button pins are ok. It should be almost 0V when you press the button and 3V when you don't.

 

i cannot install the gpiozero, i get, E: Unable to locate package python-gpiozero

 

is it ok to just sftp the lynxpins.py to the home folder? i cannot get it to find it at my ip... keeps searching...

Link to comment
Share on other sites

9 minutes ago, Stijn Van Orshaegen said:

i cannot install the gpiozero, i get, E: Unable to locate package python-gpiozero

 

is it ok to just sftp the lynxpins.py to the home folder? i cannot get it to find it at my ip... keeps searching...

How do you ssh into the Pi?

 

Do you have network connection from the Pi?

 

If you do then can you find gpiozero like

 

sudo apt update
sudo apt-cache search gpiozero

 

 

Link to comment
Share on other sites

53 minutes ago, karri said:

How do you ssh into the Pi?

 

Do you have network connection from the Pi?

 

If you do then can you find gpiozero like

 


sudo apt update
sudo apt-cache search gpiozero

 

 

i use putty to connect to the pi, i am wired directly to my router and it says the system is up to date.

could is be the gpiozero is offline ? search comes up empty.

 

did a test at this adress and that it finds it.

curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh >retrogame.sh

 

i did not install this again, just to see if it finds it )

 

i'm just going to do a fresh install of retropie, install the retrogame manually this time and not from a premade image. then will try your steps again

Edited by Stijn Van Orshaegen
Link to comment
Share on other sites

1 hour ago, Stijn Van Orshaegen said:

i use putty to connect to the pi, i am wired directly to my router and it says the system is up to date.

could is be the gpiozero is offline ? search comes up empty.

 

did a test at this adress and that it finds it.

curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh >retrogame.sh

 

i did not install this again, just to see if it finds it )

 

i'm just going to do a fresh install of retropie, install the retrogame manually this time and not from a premade image. then will try your steps again

I also have a recent version of RetroPie for Pi3.

 

In my /etc/apt/sources.list I have just one line

 

deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

 

It is enough to find it

 

ii  python3-gpiozero                 1.5.1                               all          Simple API for controlling devices attached to a Pi's GPIO pins.


 

I seem to be running python3 by default in Buster.

 

 

Link to comment
Share on other sites

50 minutes ago, karri said:

I also have a recent version of RetroPie for Pi3.

 

In my /etc/apt/sources.list I have just one line

 


deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

 

It is enough to find it

 


ii  python3-gpiozero                 1.5.1                               all          Simple API for controlling devices attached to a Pi's GPIO pins.


 

I seem to be running python3 by default in Buster.

 

 

buttons are constantly pressed without pressing the buttons( it keeps rotating all buttons and slows down when i press ), so i think i need to install your source code to switch 1 with 0

Edited by Stijn Van Orshaegen
Link to comment
Share on other sites

Ok. You have more buttons than me. So you need to edit the file retrogame.c and add buttons in the table. After that give command "make" to compile it. Then type

 

sudo cp retrogame /usr/local/bin

My zip file that I posted before already has the polarity hack.

 

You just need to add lines to the table to add more buttons to your Lynx.

 

struct {
        int pin;
        int key;
} io[] = {
//        Input    Output (from /usr/include/linux/input.h)
        { 27,      KEY_LEFT     },
        { 22,      KEY_RIGHT    },
        {  4,      KEY_UP       },
        { 17,      KEY_DOWN     },
        {  5,      KEY_Z        },
        { 16,      KEY_X        },
        { 20,      KEY_ENTER    },
        { 21,      KEY_B        },
        { 19,      KEY_SPACE    },
        {  6,      KEY_ESC      }
};


 

  • Like 1
Link to comment
Share on other sites

1 hour ago, karri said:

Ok. You have more buttons than me. So you need to edit the file retrogame.c and add buttons in the table. After that give command "make" to compile it. Then type

 


sudo cp retrogame /usr/local/bin

My zip file that I posted before already has the polarity hack.

 

You just need to add lines to the table to add more buttons to your Lynx.

 


struct {
        int pin;
        int key;
} io[] = {
//        Input    Output (from /usr/include/linux/input.h)
        { 27,      KEY_LEFT     },
        { 22,      KEY_RIGHT    },
        {  4,      KEY_UP       },
        { 17,      KEY_DOWN     },
        {  5,      KEY_Z        },
        { 16,      KEY_X        },
        { 20,      KEY_ENTER    },
        { 21,      KEY_B        },
        { 19,      KEY_SPACE    },
        {  6,      KEY_ESC      }
};


 

ok  big thank you for sticking with me for this, but this where i get lost and don't see the woods trough the trees anymore...

english is not my main language and somehow i fail to look up the tutorial for this.

i understand the buttons and that i need to add keys, i can also then change the keys with the numbers that i already soldered to the points , right ? or is it easier to just use your key setup and add ?

how do i use the make ( is it the makefile ? ) command and how do i get it on the raspberry pi ?

 

so for now i just added KEY A and i think that makes us even and i am, ready to test, the worst that can happen is wrong buttons.

 

#define GND -1
struct {
    int pin;
    int key;
} io[] = {
//      Input    Output (from /usr/include/linux/input.h)
    { 27,      KEY_LEFT     },
    { 22,      KEY_RIGHT    },
    {  4,      KEY_UP       },
    { 17,      KEY_DOWN     },
    {  5,      KEY_Z        },
    { 16,      KEY_X        },
    { 20,      KEY_ENTER    },
    { 21,      KEY_B        },
    { 19,      KEY_SPACE    },
    { 26,      KEY_A        },
    {  6,      KEY_ESC      }
};

 

 

Edited by Stijn Van Orshaegen
Link to comment
Share on other sites

All these should be run on the Raspberry.

 

You need to have an network cable from the Pi to your router.

 

Type

ip-addr

karkak@desktop:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether a0:48:1c:a0:5f:da brd ff:ff:ff:ff:ff:ff
    inet 10.88.0.1/16 brd 10.88.255.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::a248:1cff:fea0:5fda/64 scope link 
       valid_lft forever preferred_lft forever
 

to see if you are connected. Look for some IP address given by your router.

 

Then you should also have a route to the World. Type

 

netstat -nr

karkak@desktop:~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.88.0.146     0.0.0.0         UG        0 0          0 eno1
10.55.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eth1
10.88.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eno1
 

Do you have a path to the World? 0.0.0.0 means World, the Gateway address 10.88.0.146 is your router.

 

The last thing is to see if you have DNS service (find web sites by name).

 

karkak@desktop:~$ cat /etc/resolv.conf
nameserver 1.1.1.1
nameserver 8.8.8.8
 

If this is the case you should be able to install packages to the Pi.

 

If you do not have the command make you need to install a package for allowing you to compile stuff.

 

sudo apt install build-essential

 

This should bring in compilers, make and friends.

 

After that just type

 

cd Adafruit-Retrogame
make

This should invoke the gcc compiler and leave a fresh new binary called

 

retrogame

 

 

 

 

Link to comment
Share on other sites

51 minutes ago, karri said:

All these should be run on the Raspberry.

 

You need to have an network cable from the Pi to your router.

 

Type


ip-addr

karkak@desktop:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether a0:48:1c:a0:5f:da brd ff:ff:ff:ff:ff:ff
    inet 10.88.0.1/16 brd 10.88.255.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::a248:1cff:fea0:5fda/64 scope link 
       valid_lft forever preferred_lft forever
 

to see if you are connected. Look for some IP address given by your router.

 

Then you should also have a route to the World. Type

 


netstat -nr

karkak@desktop:~$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.88.0.146     0.0.0.0         UG        0 0          0 eno1
10.55.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eth1
10.88.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eno1
 

Do you have a path to the World? 0.0.0.0 means World, the Gateway address 10.88.0.146 is your router.

 

The last thing is to see if you have DNS service (find web sites by name).

 

karkak@desktop:~$ cat /etc/resolv.conf
nameserver 1.1.1.1
nameserver 8.8.8.8
 

If this is the case you should be able to install packages to the Pi.

 

If you do not have the command make you need to install a package for allowing you to compile stuff.

 


sudo apt install build-essential

 

This should bring in compilers, make and friends.

 

After that just type

 


cd Adafruit-Retrogame
make

This should invoke the gcc compiler and leave a fresh new binary called

 

retrogame

 

 

 

 

this is what i get :

 

pi@retropie:~ $ cd Adafruit-Retrogame
pi@retropie:~/Adafruit-Retrogame $ make
gcc -Wall -O3 -fomit-frame-pointer -funroll-loops -s retrogame.c -o retrogame
strip retrogame
pi@retropie:~/Adafruit-Retrogame $

 

Link to comment
Share on other sites

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...