Atari 5200: New version of Atari800 (Beta): two triggers (Moon Patrol!!!), hat start and exit buttons
-
I'm assuming that I could move these to different folders now and they would still launch with the configuration I set for them.
As long as Emulation Station can find and list the files for the system in question, all of the inherent runcommand features will carry over.
Would you, or future.child have an idea about creating a file that would internalize the configurations for the 5200/800 games rather than putting them in the "/opt/retropie/all/emulators.cfg" file?
An additional runcommand variable that could dynamically use a per-game configuration file would seem ideal, but nothing like that currently exists. I do something similar to what you're looking to do with AdvanceMAME to where the ROM directory location in the configuration file is dynamically changed using
sed
depending on where the ROM is launched from. I imagine you could adapt the same idea to dynamically change other settings in the Atari800 config file depending on the ROM name.For reference, my launch command is:
advmame-rompath = "/opt/retropie/configs/mame-advmame/advmame-rompath.sh %ROM%"
and as you see there, it in turn launches this script:
#!/bin/bash path1="/home/pi/RetroPie/roms/mame-advmame/roms/ADVMAME\ ROMs:/home/pi/RetroPie/roms/arcade/advmame" path2=$(dirname "$1") basename=$(basename "$1" .zip) sed -i "s+.*dir_rom.*+dir_rom $path2+" /opt/retropie/configs/mame-advmame/advmame.rc /opt/retropie/emulators/advmame/bin/advmame $basename ; sed -i "s+.*dir_rom.*+dir_rom $path1+" /opt/retropie/configs/mame-advmame/advmame.rc
-
@mediamogul It's going to take me a while to wrap my head around that, but thanks for the info. I'm a Linux Dummy 100%, so I really don't know what that all is. Maybe future.child can figure out a way to dummy proof this process for me.
In any event, I do believe we need to keep this out of that other emulators.cfg file, otherwise the 5200/800 emulator is going to make that a mess with all of these controller configs having a different launch value.
-
@future.child Hey man. I finished the Official 5200 releases and all of the games I plan to make configs for that were homebrew and prototypes. I'm starting on the Atari 800 to 5200 cart conversions I have, but I don't know how far I'll get on that tonight.
I had some questions for you that I didn't want to see buried under conversations here, so I put them in a separate tab in the spreadsheet for you to see. Looking forward to what we're going to make with this man. I think it's going to be awesome. :)
Here's the spreadsheet again so you don't have to look for the link: https://docs.google.com/spreadsheets/d/1VhS4f3RFCzkPeOpyVYaWno3-Ls0EjJnj_I9WjKfvnuI/edit#gid=110763209
EDIT: FYI.... I was wrong. If you move the roms from their folder to another folder you lose the alternate launch if you made one. That's also going to make things a pain in the rear when it comes to making configs. It looks like that identifier alphanumeric mess that is created for the game must not only refer to the rom itself but also the exact location it was launched from.
I'm referring to the file: /opt/retropie/configs/all/emulators.cfg
And this garbage inside of it after you launch alternate configurations:
ade42d4c91f82b6d2c68187a44420a610 = "lr-armsnes" ab79ba68f0bb293f98de08920439b7fc3 = "lr-mame2003" a2a349512be8f7c1c9c4449a010ae337a = "lr-fbalpha" a29620dd54f931ff653a35142e94348cc = "lr-mame2003" ab26fe5f98d3893fc5da7fcebad131493 = "lr-mame2003" a3e6d51fe429f8c609d7c6bd331b43812 = "lr-fbalpha" ab7a3c6209326e3979d3197c697ad1c3c = "lr-fbalpha" abdc0d3f26fa30be265846d2c76e8c458 = "lr-beetle-lynx" ab1e8faba6f907f3153f5ae0c849d49ca = "lr-beetle-lynx" a16822aadacd80d132104a2a94fa94ac0 = "lr-beetle-lynx" ac885e02326e8a2ed8a04f88ef5107edd = "lr-beetle-lynx" a92fa8e44f583f8c3a1a243354f92e880 = "atari800" a728a3abf386eb84b653c98a5d0ccde0d = "atari5200" ae78dae3d2dde5fa33fd77738ca7bdb4a = "atari800" ab345529127676780018416c85ef60426 = "atari800" acd0bc5cb04700a362657aaf8275016d1 = "Centipede" aaa39765ab7c27f346fd0c40bf1a25145 = "SuperBreakout" a9512da1769625ec55f4250a1553670bc = "atari5200" a256ea564743fd73b62647b233cf1c3b2 = "RealSportsTennis" af87b8b2129811211ab603ffa406bb807 = "CastleCrisis" adf1fa698d274505862dc13a9ef11ed4e = "MissileCommand" a46d7eb4a8d6b23d831069d4ccdb061a7 = "Galaxian" af0d99257c4c0e462d055608ef0c39462 = "Pengo" abce23453b461bfc94b43ed6588529649 = "PolePosition"
-
@Used2BeRX I do not have write permissions to the sheet, so i ill answer here:
Could we map RESET as well as PAUSE?
Reset is implemented already (SELECT + #), pause will arrive later today.Loading configs without messing with all\emulators.cfg ?
It could be done mediamogul's way by calling a script which, based on the %ROM% variable, chooses (or edits) the config-file and launches the emulator with it.
This method requires the presence of roms with predictable names, but so does the all\emulators.cfg approach.B.t.w. The "garbage" in the all/emulators.cfg file is a hash value, presumably based on at least the full rom path and name.
-
@future.child You already have the Atari 5200 joystick RESET button mapped? I didn't see it. There was a PAUSE, START and RESET button at the top of the controller.
I really don't know anything about scripting, so I wouldn't be able to do anything about the launcher on my own.
-
@Used2BeRX No i meant the reset function was present as hotkey combination.
I did just now upload a new version which has both pause and reset buttons mappable (Atari 5200 only).same installation, new config parameters:
SDL_JOY_0_A52_PAUSE=17 <-- button id SDL_JOY_0_A52_RESET=18 <-- button id
I'm still looking into the asterix/hash issue, i do have one or two leads on this i have to follow up.
Castle Crisis / Kaboom! ; Analog sensitivity is still w.i.p. but it will take some time.
Wizard of Wor ; Do you need 2nd axis for this rom and isn't the behavior as expected ? -
@future.child You don't need the 2nd axis for Wizard of Wor. It's a two player simultaneous game.
What's happening is the code that allows you to control Robotron and Space Dungeon makes you control both the 1st player on the Right side of the screen and the 2nd player on the Left side of the screen. I don't know why 1 player is on the right and 2 player is on the left. When you start a 1 player game, the right joystick controls the 1st player because of the way the game is I guess, but you cannot shoot with that player. You have to start a two player game so you can control the 2nd player with the left axis and fire with it.
It doesn't really hurt you to have 2 players, it's just weird to have to play 2 players on the game when only one joystick is plugged in. I haven't tried to plug both of them in to see what happens.
-
@Used2BeRX What happens when you set JOY_0_SECOND_AXIS_ENABLED = FALSE ?
This should revert the joystick handling to original.Edit : I just figured why Hash and Asterix did not work in pole position. (Edit2: Kangaroo as well)
You have to reset first with the A5200 reset button on the controller.
Then they work as intended (apparently the A5200 reset is different from a regular reset).Also any unused buttons in the config file should be mapped to a non existing number on the controller (i use 30) or the hardcoded defaults will kick in which results in unpredictable button output.
-
@future.child I figured out my sound issue. It does that on my Samsung monitor (with built in speakers) but not on mt TV in living room. Don't quite understand why this issue is only with Atari 800 emulator. Strange. I'll look closer into raspi-config. Perhaps theres some settings for HDMI that can fix this.
-
@future.child said in Atari 5200: New version of Atari800 (Beta): two triggers (Moon Patrol!!!), hat start and exit buttons:
@Used2BeRX What happens when you set JOY_0_SECOND_AXIS_ENABLED = FALSE ?
This should revert the joystick handling to original.Edit : I just figured why Hash and Asterix did not work in pole position. (Edit2: Kangaroo as well)
You have to reset first with the A5200 reset button on the controller.
Then they work as intended (apparently the A5200 reset is different from a regular reset).Also any unused buttons in the config file should be mapped to a non existing number on the controller (i use 30) or the hardcoded defaults will kick in which results in unpredictable button output.
Without trying it I couldn't even guess what would happen with Wizard of Wor by doing that. I don't know if you've ever played the game before but the behavior is definitely strange. I don't know if I'm properly explaining it, so it would probably be beneficial if you looked at it yourself and see what I mean. I'll let you know when I get a chance to check it.
So you're saying that every time you load Kangaroo and Pole Position you have to hit reset first? Not a huge deal if there's nothing that can be done about that. Good thing we added the reset button, huh?
Thanks for the tip on the unused buttons. That was a question that I forgot to ask you on the spreadsheet. I'm sure there were more. I'll let you know when I remember them.
-
@future.child So I got around to trying disabling the 2nd joystick for Wizard of Wor, and it more or less went down how I expected it to. "Player 1" on the right side is now unresponsive when you start the 1 player game (although it will walk up until it hits a wall immediately, and upon every new life). Otherwise the game behaves exactly the same. You have to start the 2nd player to actually be able to play the left character with a single joystick.
I just looked on youtube and verified that 1 player does control the character on the right side of the board when it's operating correct. You can check out a video of how it's supposed to play here.
I'll let you know which games don't pause that are supposed to. I thought it wasn't working in BBSB, but that's actually an option in the options menu that you have to turn on.
EDIT: This isn't really a huge bug, so unless something else comes up of it I wouldn't bother looking into it, but I have "JOY_0_SECOND_AXIS_ENABLED=0" by default now. I was testing BallBlazer just now and the 2nd player just moves to the N/W unti it backs itself into a corner. (This is similer to how you would only fire to the N/W in Robotron a while back before you made a fix). This would also explain why the "Right Character" in Wizard of Wor now just moves on its own as well.
This ONLY happens when 1 controller is plugged in. It is not an issue when 2 controllers are plugged in.
Not sure what's going on here but thought any input might give you some ideas.
I'm going to continue to make configurations. I figure at this point if you're going to make any emulator fixes that they shouldn't effect the configs themselves.
I'm going to test out how the 2 player operations work in the games to see if we need any adds for button mapping on them or if they all just work fine as they are.
-
@Used2BeRX I'm going to wait on making more configs until I hear back from you. We've got two bugs now that relate to the 2nd player. I'm going to use Countermeasure as an example, but it looks like this happens all the time. You only notice it on games that have 2 Trigger functions, whether they are 1 player or 2 player.
BUG1: When you have 2 controllers plugged in, you cannot fire the cannon (in countermeasure and Choplifter). Unplugging the 2nd controller and restarting the game fixes this.
BUG 2: 2nd controller (on all games) every button does the function assigned to TRIGGER 1/Controller 1.
Most 1 or 2 player games you don't notice these bugs even if you have the 2nd player controller in because most games only have one trigger function.
1 player games with two functions are still playable now, but you can't have the 2nd player controller plugged in.
2 player games with two trigger functions are not playable at all.
-
@Used2BeRX
Bug1/2:
When you do have two controllers plugged in, do you use the same ports and plug in joystick 1 first ?
The emulator assigns the first controller it sees as joystick 1, jfroco presumably created his python script with this in mind, as it uses the emulationstation joystick numbering to determine which is joystick 1 and 2. -
@future-child Been wrestling with this for a few days now, and not succeeding. I've got your version of atari800 installed, and the option/select/start buttons work great. I can play games using the arrow keys.
But my control panel is one of those weird Xin Mo clones where the axes don't quite work right. I followed a workaround which suggested to just attach the joystick to four open button connections instead. This works great in every other emu I've tried (which, granted, they are all either libretro ones or MAME).
But I cannot see a way to get this to work with atari800. Putting in button codes like so does not work, because the cfg expects keycodes:
SDL_JOY_0_LEFT=8 SDL_JOY_0_RIGHT=10 SDL_JOY_0_UP=11 SDL_JOY_0_DOWN=9 SDL_JOY_0_TRIGGER=0
EmulationStation sees those keycodes as a DPad in every other emu. I am running the atari5200.py script to map things, but apparently the autoconfig doesn't work because they aren't an axis, maybe?
Any ideas? Can the emu be updated to support buttons as joystick directions?
If there isn't an easy solution, I may have to delve into the mysteries of xboxdrv...
-
@rkoster The SDL_JOY_0_LEFT, RIGHT, UP and DOWN variables are used for keyboard to joystick input (scan codes may be found here).
So unless your controller sends keyboard scan codes, axis data or HAT values it will not work.
Button support for directional input may happen in the future, but i never seen joysticks sending neither HAT nor axis data.If your controller does send HAT (D-PAD), you have to set JOY_0_SECOND_AXIS_ENABLED = FALSE and possibly JOY_SPEED_ADJUST=11.
Also make sure you have the latest version (and config parameters) as there have been some changes/fixes lately.
-
@future.child Yeah, that was what I suspected.
The issue is that the controller I have is a Xin Mo clone, the 3H Dual Arcade, and there is some sort of strange driver issue whereby left and up directions do not register. There's a way to recompile the kernel and add support for it (see https://retropie.org.uk/forum/topic/7832/fix-up-left-joystick-direction-for-tht-2p-arcade-controller-with-device-id-0x75e1), but it didn't work for me when I tried it, and hosed things badly enough that I ended up having to start over.
So the workaround that is suggested online is to simply wire up the joystick directions to some of the excess buttons. Worked fine in all other emus, just not in atari800. :(
Basically, I need the equivalent of joy2key for the Pi. xboxdrv seems like the closest thing I can find. Unless there's a way to send keystrokes from buttons buried somewhere in the Retropie controlelr config. (Seems like there must be, come to think of it).
Or else try the kernel upgrade again, which is the "right" solution, of course.
Thanks for investigating!
-
@rkoster Is there a reason for not using joy2key ? afaik it is available for retropie.
-
@future.child said in Atari 5200: New version of Atari800 (Beta): two triggers (Moon Patrol!!!), hat start and exit buttons:
@Used2BeRX
Bug1/2:
When you do have two controllers plugged in, do you use the same ports and plug in joystick 1 first ?
The emulator assigns the first controller it sees as joystick 1, jfroco presumably created his python script with this in mind, as it uses the emulationstation joystick numbering to determine which is joystick 1 and 2.In case my ban wasn't an accident and it doesn't get lifted please continue to contact me through this doc until we find a better solution: https://docs.google.com/document/d/18cfXi3eO7Gj1piWbzans8zS5CQ2ATaUrxeM0jmdzal8/edit?usp=sharing What we're doing is too valuable to stop because somebody didn't like something I posted and didn't just remove it. I have no idea why I was banned and they didn't give me any reason. At this point I'm thinking it's just an accident.
About your question. I always use the same port on a Hub that's attached to the Pi for the 1st player joystick. That never changes. Early on in our testing I had them reversed but they weren't working right at all when the 2nd player was plugged in (I don't remember exactly what was wrong and I didn't bother writing it down anywhere).
We have made some changes since then. I can try to do it the other way again and see what happens.
EDIT: I did some digging around and I found another off-brand PS3/4 controller. The one I was using before for 2nd player was an "Afterglow XBox 360" controller. That was causing some of the problems. I know the controller is good because it works perfectly for PC applications, but the Pi Zero I have doesn't seem to like it. When I plug just that controller in by itself I can't even control the emulationstation menus with it.
So, now that I'm using 2 identical off-brand PS3/4 controllers, here's where we're at...
BUG 1: This one is strange. In countermeasure I'm able to fire the cannon, some of the time. Whether or not it's going to fire seems completely up in the air. When I unplug the 2nd joystick and play 1 player this is not an issue at all.
Even though Choplifter is a 1 player game, it's showing the same behavior. Sometimes I can fire, sometimes I can't. I'm not sure, but it seems like if I use the stick for movement at all it automatically keeps me from firing. If I waggle the D-Pad around a bit it seems to fire again.
BUG 1: Still an issue. Every button on the 2nd player joystick that was mapped to anything on the 1st player joystick only does one action. For instance, if I'm playing Berzerk, I can fire the gun by pressing CROSS, SQUARE, SELECT, START or HOME buttons. This alone wouldn't be any major issue, but any game that requires two different trigger functions like Moon Patrol or Countermeasure won't work because only one of the trigger functions are available to you.
-
Offtopic:
@mediamogul @herb_fargus Sorry to bother, but i could not find a pm function for this.
Do you guys have an idea why @Used2BeRX has been banned ?
He doesn't, and i can't think of any reason (admittedly based on this thread alone) as well.Back on topic: I spent the day playing with different approaches on improving the joystick sensitivity problem.
The problem lies in mapping the physical controller input (-32767 to 32767, 0 is center) to atari's input (0 to 228, 114 is center).A lookup table doesn't work as it throws timing way off, and the table would be ginormous.
A math function seems the best approach, i have two formulas which in theory should do it.
f(x)=114+0.0020997955127507414x+1.29351713e-12x^3
f(x)=114+0.000591444990459655x+2.66474736e-12x^3
But when added to the code i get very weird results, perhaps someone with greater math and coding skills can have a look.Also i am starting to believe that modern day controllers are just to sensitive.
There is a 40 degrees range of motion for 65535 values, opposed to the original controller's 60 degrees for 228 values.
Plus the original controller had a larger handle allowing for a larger range of travel than modern thumbsticks.So for now i am leaving the sensitivity part as lowered priority for now and advise to configure mouse as trackball (or as paddle for Kaboom! ).
In this regard kat5200 does seem to be the better emulator for 5200. -
@future.child It should just be
analogpos / 287.42982 + 114
287.42982 is the ratio of 65534 to 228.
Worked out:
Control min max range Analog -32767 32767 65534 Atari 0 228 228
One unit = 65534 / 228 = 287.42982
Analogpos Value -32767 0 32767 228 0 114 16384 171.00174
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.