RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Atari 5200: New version of Atari800 (Beta): two triggers (Moon Patrol!!!), hat start and exit buttons

    Scheduled Pinned Locked Moved Ideas and Development
    409 Posts 26 Posters 177.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jfroco
      last edited by jfroco

      UPDATE2

      • Script to autoconfigure the buttons using Retroarch configuration
      • Ability to define joysticks numbers
      • You can configure second axis ID

      UPDATE

      Repository: https://github.com/jfroco/atari800-rpi

      Features

      This is a port of Atari800 with focus on emulating Atarin 5200 that adds:

      • Full Joystick support for RetroPie
      • Menu navigation using joystick
      • Joystick Button configuration: trigger1, trigger 2 (Moon Patrol and H.E.R.O.!), asterisk and hash.
      • Supports hat and axis for joysticks
      • Use second analog stick in first as second player stick: Robotron and Space Dungeon!!!

      (Only player1)

      Hotkeys:

      SELECT + START to exit emulator
      SELECT + * (X): Emulator Menu
      SELECT + # (Y): Reset

      Use joystick to navigate the emulator MENU plus Trigger 1 (A) to accept and Trigger 2 (B) to go back.

      Hint: If the emulator asks for Cart type select one of these using joystick + trigger 1:

      • Two chip 16 KB 5200 cartridge <- for 16KB roms (games)
      • Standard 32 KB 5200 cartridge <- for 32KB roms (games)
      • Bounty Bob 40 KB 5200 cartridge <- for the great Bounty Bob strikes back! game

      Installation:

      New parameters in /home/pi/.atari800.cfg :

      SDL_JOY_0_SELECT=8 <-- button ID
      SDL_JOY_0_START=9 <-- button ID
      SDL_JOY_0_TRIGGER1=1 <-- button ID
      SDL_JOY_0_TRIGGER2=2 <-- button ID
      SDL_JOY_0_ASTERISK=0 <-- button ID
      SDL_JOY_0_HASH=3 <-- button ID

      See sample.cfg

      Use jstest application to get the button IDs for your joystick.

      Compiled and tested on RETROPIE 3.6 using a RPI2:

      cd src
      autoreconf -v
      ./configure --target=rpi
      make clean
      make
      

      Replace atari800 in /opt/retropie/emulators/atari800/bin/ with the new generated executable

      Check emulators.cfg for recommended configuration

      Compiled version:

      cd /opt/retropie/emulators/atari800/bin/
      sudo cp atari800 atari800.original
      sudo wget https://github.com/jfroco/atari800-rpi/blob/master/atari800?raw=true -O atari800
      sudo chmod +x atari800

      Original Post

      I was trying the Atari 5200 emulator in RetroPie, and one thing that bugged me was that the second button (trigger) of the gamepad is the shift key... not a joystick button...so I couldn't play my favorite Atari 5200 game: Moon Patrol!!! (it uses two buttons: fire and jump), another thing was that my Hori PS3 mini fighting stick didn't work as the stick is registered as a hat not axis... and the last thing... I had to use the keyboard to start (F4) a game and to leave the game (F9)...

      So... I pick my Language C book and after a couple of hours I added all this features to a new version of Atari800...

      1.- New config file

      Edit your /home/pi/.atari800.cfg to add this new parameters:

      SDL_JOY_USE_HAT=1 <= If you want to use a stick with hat instead of axis
      SDL_JOY_0_SELECT=8 <= button id for Select (use jstest to get the button id)
      SDL_JOY_0_START=9 <= button id for Start (use jstest to get the button id)
      SDL_JOY_0_TRIGGER1=2 <= button id for Trigger1 (use jstest to get the button id)
      SDL_JOY_0_TRIGGER2=1 <= button id for Trigger2 (use jstest to get the button id)

      Press SELECT+START to exit the emulator (go back to EmulationStation)

      2.- Replace executable

      Replace old executable with new one :
      ** This is not valid anymore **
      cd /opt/retropie/emulators/atari800/bin/
      sudo mv atari800 atari800.original
      sudo wget https://dl.dropboxusercontent.com/u/4281970/atari800/src/bin/atari800
      sudo chmod +x atari800

      3.- Change the cart-type

      I recommend using 32KB roms (games) and set the cart-type in emulators.cfg

      Edit /opt/retropie/configs/atari5200/emulators.cfg

      Use this line:
      atari800="/opt/retropie/emulators/atari800/bin/atari800 -5200 -cart-type 4 -cart %ROM%"

      If the cart is the wrong type you will have to select the right one.

      This is a beta version so I really need your feedback...

      To do:
      Map # and % to gamepad buttons
      Implement second player
      Analog controls? => Not sure yet..

      1 Reply Last reply Reply Quote 4
      • D
        dabone
        last edited by

        Any chance of you share the source instead, I also use a linux pc along with my pi.

        Later,
        dabone

        1 Reply Last reply Reply Quote 0
        • J
          jfroco
          last edited by

          Hi

          Of course...

          https://github.com/jfroco/atari800-rpi/

          Best regards

          1 Reply Last reply Reply Quote 0
          • mediamogulM
            mediamogul Global Moderator
            last edited by

            This is fantastic! Thank you.

            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

            1 Reply Last reply Reply Quote 0
            • D
              dabone
              last edited by

              I had issues compiling your code under ubuntu.

              You have used C++ comments of // in a c project.

              C needs the /* to begin a comment and */ to end it.

              After I changed the comments in input.c, it compiled.

              J 1 Reply Last reply Reply Quote 0
              • BuZzB
                BuZz administrators
                last edited by

                Rather than forking it - if your changes would benefit other platforms it would be a good idea to feed any patches upstream - the emulator is still in development.

                To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                1 Reply Last reply Reply Quote 1
                • D
                  dabone
                  last edited by

                  I'd like to see definable joysticks.
                  I have custom compiled versions on my pi, because I have 2 xbox 360 contollers, and also 2 db9 joysticks.
                  I also have 1 other standard joystick, that is mapped as /dev/js0.
                  So for the atari800 emulator, I use joysticks 1 & 2 for xbox wireless, and 3 & 4 for original atari controllers.

                  (Now if I can remember where I made that change in the source...)

                  Later,
                  dabone

                  1 Reply Last reply Reply Quote 0
                  • J
                    jfroco @dabone
                    last edited by jfroco

                    Update in the original post....

                    • Full Joystick support for RetroPie
                    • Menu navigation using joystick
                    • Joystick Button configuration: trigger1, trigger 2 (Moon Patrol and H.E.R.O.!), asterisk and hash.
                    • Supports hat and axis for joysticks
                    • Use second analog stick in first as second player stick: Robotron and Space Dungeon!!!

                    @dabone Thank you. I replaced all // comments
                    @BuZz I would love to do, I'll try to do it next week

                    1 Reply Last reply Reply Quote 3
                    • J
                      jfroco
                      last edited by

                      Update 2...

                      • Script to autoconfigure the buttons using Retroarch configuration
                      • Ability to define joysticks numbers
                      • You can configure second axis ID

                      Autoconfiguration

                      You can auto-configure the first joystick to use the current joystick in EmulationStation/Retroarch:

                      cd /opt/retropie/emulators/atari800/bin/
                      sudo wget https://github.com/jfroco/atari800-rpi/blob/master/atari5200.py?raw=true -O atari5200.py
                      sudo chmod +x atari5200.py
                      

                      Now edit your /opt/retropie/configs/atari5200/emulators.cfg, it should look like this:

                      atari800="/opt/retropie/emulators/atari800/bin/atari5200.py; /opt/retropie/emulators/atari800/bin/atari800 -5200 -cart-type 4 -cart %ROM%"
                      default="atari800"
                      

                      Now everytime you start a game, the atari5200.py script will configure the atari800 emulator joystick for you, respecting current EmulationStation button configuration.

                      See emulator.cfg in https://github.com/jfroco/atari800-rpi

                      mediamogulM 1 Reply Last reply Reply Quote 5
                      • mediamogulM
                        mediamogul Global Moderator @jfroco
                        last edited by

                        @jfroco

                        This just keeps getting better. Great work on all this.

                        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                        1 Reply Last reply Reply Quote 0
                        • future.childF
                          future.child
                          last edited by

                          For what it's worth, i have made a few changes to the jfroco version.
                          This version handles button support for the option, start and select keys found in the 800 / XL emulator.

                          The Binary may be found here : https://github.com/futurechild/atari800-rpi/raw/master/atari800
                          There is a new parameter in atari800.cfg : SDL_JOY_0_OPTION=4 <-- button ID

                          L JLsoftJ 2 Replies Last reply Reply Quote 1
                          • L
                            lakindc @future.child
                            last edited by

                            @future.child I Installed the futurechild vesion and it works great. . .Except the screen is smaller. . .Is this a setting somewhere??

                            future.childF 1 Reply Last reply Reply Quote 0
                            • future.childF
                              future.child @lakindc
                              last edited by

                              @lakindc I remember having this problem too but am unsure what i did so solve it.
                              I currently have 4:3 fullscreen emulator with a black bar left and right to fit my 16:9 screen.

                              Could you have a look at "video mode settings" in the menu under "Display settings" inside the emulator ?
                              Fullscreen should be set to "No" and i have resolution set to "640x480".

                              These are my current settings in the atari800.cfg file :
                              DEFAULT_TV_MODE=PAL
                              COLOURS_PAL_GAMMA=0.3
                              ARTIFACT_NTSC=NONE
                              ARTIFACT_PAL=NONE
                              ARTIFACT_NTSC_MODE=0
                              VIDEO_FILTERING=1
                              VIDEO_ZOOM=1.00

                              You can also check if the video mode is correct in the launcher (when launching the emulator you should get a message "press a button to configure"), mine is set to 1920x1080 @ 50 Hz 16:9.

                              1 Reply Last reply Reply Quote 0
                              • V
                                Veramacor
                                last edited by

                                Hello all,

                                I've downloaded @future-child 's version and It works except for the fact I cannot seem to figure out my button mapping situation. I'm using a Wi u controller that works great with emulationstation.

                                I am using the emulator for Atari 800 (not xl/xe) emulation, not for 5200 games as is on this thread. But its the same emulator so I wouldn't see a problem

                                Here is my atari800.cfg file pertaining to button mapping:

                                SDL_JOY_0_ENABLED=1
                                SDL_JOY_0_LEFT=260
                                SDL_JOY_0_RIGHT=262
                                SDL_JOY_0_UP=264
                                SDL_JOY_0_DOWN=261
                                SDL_JOY_0_TRIGGER=305
                                SDL_JOY_1_ENABLED=0
                                SDL_JOY_1_LEFT=97
                                SDL_JOY_1_RIGHT=100
                                SDL_JOY_1_UP=119
                                SDL_JOY_1_DOWN=115
                                SDL_JOY_1_TRIGGER=306
                                SDL_JOY_0_SELECT=8
                                SDL_JOY_0_START=9
                                SDL_JOY_0_TRIGGER1=2
                                SDL_JOY_0_TRIGGER2=1
                                SDL_JOY_0_ASTERISK=3
                                SDL_JOY_0_HASH=0
                                SDL_JOY_0_SECOND_AXIS=2
                                SDL_JOY_0_INDEX=0
                                SDL_JOY_1_INDEX=1

                                My 'Start' button works like you hit the 'H' button which pauses emulation. very strange . I went thru button configuration twice so I'm prettiy sure I have all the buttons defined within emulation station.

                                The new version of atari800 does let me exit out of a game (no more F9!) but, I cannot start a game without 'F4'

                                Does anyone have a working atari800.cfg file I can use?

                                A side note - I have to use ATARIOSB.ROM as my games will crash (Galahad and the Holy Grail) if I don't use the early Atari800 ROM. XL/XE crashes the game after killing the 3rd knight every time :(

                                Thanks for any help you guys can give (newbie)

                                V 1 Reply Last reply Reply Quote 0
                                • V
                                  Veramacor @Veramacor
                                  last edited by

                                  OK, I copied the file from @future-child github directly and I'm not running with the start!

                                  1st problem solved.

                                  Now I am seeing The small screen issue too. if @lakindc , if you can tell me how you fixed that issue think I am in in business!

                                  All except for 'SELECT' and 'OPTION' buttons

                                  Thanks for letting me bounce my head around

                                  1 Reply Last reply Reply Quote 0
                                  • V
                                    Veramacor
                                    last edited by

                                    Ok Optioni/Select buttons were good all the while. I used jstest /dev/input/js0 to discover that

                                    SDL_JOY_0_OPTION=4 is mapped to the Left Shoulder button

                                    Last Post from me - I will stop thinking out loud on the forum! Just looking for the small screen size resolution

                                    and I am golden

                                    1 Reply Last reply Reply Quote 0
                                    • V
                                      Veramacor
                                      last edited by

                                      I LIED and I'm sorry for that. I figured it out. SO I will post for those who are going to use this wonderful version of atari800:

                                      VIDEOMODE_WINDOW_WIDTH=336
                                      VIDEOMODE_WINDOW_HEIGHT=240
                                      VIDEOMODE_FULLSCREEN_WIDTH=640
                                      VIDEOMODE_FULLSCREEN_HEIGHT=480
                                      VIDEOMODE_WINDOWED=0

                                      The Key setting is the last line is set to:
                                      VIDEOMODE_WINDOWED=1

                                      And Indeed It makes sense as :
                                      VIDEOMODE_WINDOW_WIDTH=336
                                      VIDEOMODE_WINDOW_HEIGHT=240

                                      becomes the new screen size.

                                      Hey guys - thanks for all your help! Special thanks to both @jfroco and @future-child for their efforts!

                                      1 Reply Last reply Reply Quote 0
                                      • future.childF
                                        future.child
                                        last edited by

                                        Thanks @Veramacor , This video issue has been in the back of my mind since @lakindc's post but was unsure of it's cause.
                                        I have updated my sample.cfg to include these videomode settings.

                                        1 Reply Last reply Reply Quote 0
                                        • Used2BeRXU
                                          Used2BeRX
                                          last edited by Used2BeRX

                                          If you use a program called Altirra and load your 5200 roms, you can then save them with a header that will designate how the Pi emulator should load the game. Then if you remove the part of the emulators.cfg file that references cart type 4 and load the games normally they will all load without that screen asking you what type of cart the game is. :)

                                          I would share mine, but without even reading the rules here I'm sure that's not allowed. It's really easy once you figure it out, and it doesn't take all that long since the 5200 library is so small.

                                          I could post instructions on how to do this if anyone is interested.

                                          W 1 Reply Last reply Reply Quote 0
                                          • Used2BeRXU
                                            Used2BeRX
                                            last edited by

                                            Could somebody explain to me how the Robotron controls are supposed to work? I've got everything else working now, but the Robotron controls do not function for Robotron or Space Dungeon. Thanks!

                                            future.childF 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.