Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: wrybread on October 14, 2020, 03:32:21 PM

Title: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 03:32:21 PM
There's a couple of SNES roms I'd like to add to my system, and I'm using ZSNES. That works on my other cabinet, which has a horizontal monitor. But this one has a vertical monitor...

I found the -v parameter, which sets the video mode. However it changes the screen resolution on my system in general, so when I exit the game my monitor resolution has changed.

I'm wondering if anyone knows a way around this?

Or is there some other SNES emulator people recommend?
Title: Re: Good emulator for SNES and AM?
Post by: progets on October 14, 2020, 03:44:14 PM
Take a look at the AM plug-ins ResFix and/or RotationControl. They might help.
Title: Re: Good emulator for SNES and AM?
Post by: bionictoothpick on October 14, 2020, 04:53:22 PM
Have you used retroarch?
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 04:55:47 PM
I haven't used Retroarch. Isn't it a front end, like Attract Mode?

If so that wouldn't work, I'm trying to use it from within Attract Mode.

Or am i wrong about that?
Title: Re: Good emulator for SNES and AM?
Post by: bionictoothpick on October 14, 2020, 05:10:20 PM
No, it has a frontend, but you'll never see it if you use retroarch with attractmode.

Also very powerful if you want to take the time to learn some of its abilities for overlays and such.


Basically you download it, use the interface to install a "core" for snes emulation.

Then edit your emulator cfg to use retroarch...

Something like this:

executable           c:\RetroArch\retroarch.exe
args                 -L cores\snes9x_libretro.dll "[romfilename]"
rompath              ..\..\..\Games\Super Nintendo Entertainment System\
romext               .zip;.7z;.fig;.smc
system               Super Nintendo Entertainment System
info_source          thegamesdb.net
artwork    fanart          ../../am/scraper/snes/fanart
artwork    flyer           ../../am/scraper/SNES/flyer
artwork    marquee         ../../am/scraper/SNES/marquee
artwork    snap            ../../am/scraper/SNES/snap
artwork    wheel           ../../am/scraper/SNES/wheel

Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 08:22:44 PM
Well I haven't been successful with Retroarch yet. I'm on Linux, and here's the contents of my retroarch.cfg file:

Code: [Select]
executable           retroarch

# this line sets the "core". For example the snes9x core.
#args                   -L /usr/lib/x86_64-linux-gnu/libretro/nestopia_libretro.so "[romfilename]"
args                   -f -v -L /usr/lib/x86_64-linux-gnu/libretro/snes9x_libretro.so "[romfilename]"
 
rompath              $HOME/.attract/nintendo/roms/
romext               .zip;.7z;.fig;.smc
system               Super Nintendo Entertainment System

#info_source          listxml
info_source          thegamesdb.net

artwork    cabinet         $HOME/.attract/mame/cabinets
artwork    flyer           
artwork    marquee         $HOME/.attract/mame/marquees
artwork    snap            $HOME/.attract/mame/videos;$HOME/.attract/mame/snap
artwork    wheel           

I ran retroarch and manged to install a few "cores", including one for the SNES. There are a few. I was then able to manually load a ROM.

But I haven't been able to run a ROM from commandline. Here's the command that Attract is running when I launch a ROM:

Code: [Select]
retroarch -L /usr/lib/x86_64-linux-gnu/libretro/nestopia_libretro.so "/home/wrybread/.attract/nintendo/roms/The Legend of Zelda.smc"

That fails silently though.

I don't imagine anyone has any tips?

Edited to add: aha, adding the -v (verbose) option to the commandline gets some details about the failure:

Code: [Select]
wrybread@wrycade:~$ retroarch -v -L /usr/lib/x86_64-linux-gnu/libretro/nestopia_libretro.so "/home/wrybread/.attract/nintendo/roms/The Legend of Zelda.smc"
[INFO] RetroArch 1.9.0 (Git 5e551dd92b)
[INFO] [Overrides]: Redirecting save file to "/home/wrybread/.config/retroarch/saves/The Legend of Zelda.srm".
[INFO] [Overrides]: Redirecting save state to "/home/wrybread/.config/retroarch/states/The Legend of Zelda.state".
[INFO] === Build =======================================
[INFO] CPU Model Name: Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
[INFO] Capabilities:  MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX AVX2
[INFO] Built: Aug 10 2020
[INFO] Version: 1.9.0
[INFO] Git: 5e551dd92b
[INFO] =================================================
[INFO] [CORE]: Loading dynamic libretro core from: "/usr/lib/x86_64-linux-gnu/libretro/nestopia_libretro.so"
[INFO] [Overrides]: No core-specific overrides found at /home/wrybread/.config/retroarch/config/Nestopia/Nestopia.cfg.
[INFO] [Overrides]: No content-dir-specific overrides found at /home/wrybread/.config/retroarch/config/Nestopia/roms.cfg.
[INFO] [Overrides]: No game-specific overrides found at /home/wrybread/.config/retroarch/config/Nestopia/The Legend of Zelda.cfg.
[INFO] [Environ]: SET_VARIABLES.
[INFO] [Remaps]: remap directory: /home/wrybread/.config/retroarch/config/remaps
[INFO] [Overrides]: Redirecting save file to "/home/wrybread/.config/retroarch/saves/The Legend of Zelda.srm".
[INFO] [Overrides]: Redirecting save state to "/home/wrybread/.config/retroarch/states/The Legend of Zelda.state".
[INFO] [Environ]: GET_LOG_INTERFACE.
[INFO] [Environ]: PERFORMANCE_LEVEL: 6.
[INFO] [CONTENT LOAD]: Loading content file: /home/wrybread/.attract/nintendo/roms/The Legend of Zelda.smc.
[INFO] Did not find a valid content patch.
[INFO] [Environ]: SET_INPUT_DESCRIPTORS:
[INFO] [Environ]: SYSTEM_DIRECTORY: "/home/wrybread/.config/retroarch/system".
[libretro INFO] Custom palette path: /home/wrybread/.config/retroarch/system/custom.pal
[libretro WARN] custom.pal not found in system directory.
[libretro INFO] NstDatabase.xml path: /home/wrybread/.config/retroarch/system/NstDatabase.xml
[libretro WARN] NstDatabase.xml required to detect region and some mappers.
[INFO] [Environ]: SET_PIXEL_FORMAT: XRGB8888.
[INFO] [Environ]: GET_SAVE_DIRECTORY.
[INFO] SET_GEOMETRY: 256x224, aspect: 1.306.
[ERROR] [CONTENT LOAD]: Failed to load content
[INFO] Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[INFO] [CORE]: Unloading core..
[INFO] [CORE]: Unloading core symbols..
[INFO] [Core Options]: Saved core options file to "/home/wrybread/.config/retroarch/config/Nestopia/Nestopia.opt"
[INFO] [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.

Maybe I'm just not running the right core... What core do people recommend for SNES?
Title: Re: Good emulator for SNES and AM?
Post by: progets on October 14, 2020, 08:41:27 PM
That core is for NES. Try snes9x. You can read about the cores here https://docs.libretro.com/library/snes9x/
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 09:11:30 PM
Thank you! I needed to change the arg line to:

args                   -f -v -L /usr/lib/x86_64-linux-gnu/libretro/snes9x_libretro.so "[romfilename]"

I edited my answer above for the next person who comes this way.

Running now, and looks fantastic.

I don't imagine you have any advice for how to edit the key assignment? I ran a game and hit F1 and hit Controls, but nothing I do seems to make any difference. Also looking for how to set my joystick button as the exit key.

Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 09:28:43 PM
Nevermind the above, got it all working, phew. Not the easiest program to figure out but looks really good.

Now if I could only figure out which button in Retroarch is the jump button in Mario Brothers I'll be all set... More diving into menus.
Title: Re: Good emulator for SNES and AM?
Post by: progets on October 14, 2020, 09:40:54 PM
The best/smartest thing to do is to get the correct retroarch "autoconfig" file designed for your joystick/controller/etc. If one doesn't exit you can make one pretty easy. Take a look in the /retroarch/autoconfig folders to see if you can find a match or run "Makefile" from that directory to create your own. This give you the most flexibility to use many different controllers without having to make changes. It also leaves all the original retroarch settings in place.

You can also use the RetroArch GUI/FE to configure the inputs.
Settings-->Input-->Input Hotkey Binds
Settings-->Input-->Input User 1 Binds
Settings-->Input-->Input User 2 Binds

You can also manual modify your controls in the retroarch.cfg file with a text editor.

P.S. If you do decide to use the retroarch GUI, make sure the you set retroarch to save configuration changes before making changes (and maybe turn it back off when your done to avoid accidental changes). Also, the hotkeys are where you set the game exit.
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 09:54:10 PM
Phew, why so complicated? I had to give up on it once I realized there was no way (I think) to unmap a key if you make a mistake in the gui, other than editing the config file. It 's like a parody of a bad user interface and design. At least that's my thinking now, maybe I'll feel better about it after some sleep.

Title: Re: Good emulator for SNES and AM?
Post by: progets on October 14, 2020, 10:01:33 PM
There are so many settings and changes you can make in RA which makes it extremely powerful but also makes it complex. That's why the autoconfig files are the way to go. I recommend making as few changes as possible until you understand how it works. It might be tough at first but understand that RA can emulate almost anything and once you have one system setup you can very quickly and easily setup any other system. A lot of people use it as their only emulator since the settings can be global or per core. I love that my controls for the games, save states, rewind, pause, etc. are the same whether I'm using SNES, NES, Genesis, SMS, etc.
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 10:11:16 PM
I don't think my issues with it have to do with it's complexity, just it's clunkiness. Mapping keys is hilariously terrible. And the fact that there's no way to remove a key assignment after pressing the wrong key other than closing the utility and editing the config file says a lot.

I can't use an autoconfig since I'm using a joystick encoder in an arcade cabinet, not an off the shelf joystick, so my button assignments are all non standard.

I'll give it another try tomorrow. I have a feeling editing the config file directly will make things much easier.
Title: Re: Good emulator for SNES and AM?
Post by: progets on October 14, 2020, 10:25:24 PM
Read about your options here https://docs.libretro.com/guides/joypad-autoconfiguration/

You can make your own autoconfig file. Just use jstest to figure out what each button is and then create the text file that defines what they do.
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 14, 2020, 10:27:44 PM
Is there an advantage to doing that versus just editing the config file directly?
Title: Re: Good emulator for SNES and AM?
Post by: progets on October 14, 2020, 11:41:30 PM
Yes, I think so. My arcade cabinet was built years ago with a different FE on x86. By having the autoconfig file in RA I have put in different boards running different OSes over the years but my autoconfig file always works (in some cases with very small tweaks) across Window and Linux as well as x86 vs. x64 vs. Raspberry Pi. Over the years new features get added to RA which won't be in old versions of the retroach.cfg so copying it isn't the best idea and it won't work across different OSes since video and audio setting will likely be different.

This benefit is decreased significantly if the controllers will never be changed, which I now understand is likely your case. It is also decreased even less if you never plan to try another OS.

I should also mention that I've been using RA for over five years and when I started with it, I deleted the entire install and started fresh many times. More than one redo was because I did the arcade encoder setup in an less than desirable way. I learned from my mistakes and wouldn't call myself an expert but let's say the once confusing RA now makes a lots of sense and it's easy for me navigate/configure/change.

P.S. In the first year using RA I learned that you could simply delete the retroach.cfg file and it would create a new one. This doesn't always fix your "won't run" problem but it usually does. Renaming it to compare to the old one is probably a better idea. I rarely make changes to RA running in my cab if I'm not changing the OS.
Title: Re: Good emulator for SNES and AM?
Post by: akafox on October 25, 2020, 03:59:29 PM
@wrybread
gonna tell you you don't have to use retroarch. you can use snes9x or bsnes on linux for snes games.

Now that being said I do like retroarch very much. So much I don't use any stand alone emulators anymore (well except for ps2 and psp...well I do..but not as often) yes even mame. Why? because it just works. Mame cores allow me to run games that my system can not run with standard mame.

However, I HATED retroarch at first because it was much more difficult to use..at least at first. Retroarch is not straight froward when you are used to your emulators just working as they have always done. Not to mention the customization of retroarch! it's overwhelming! but honestly you will never need to use many of them or if you do it may be once or twice. Once you get used to it and once you have tweaked it, it will stay solid.

One good thing about it is the libretro cores are constantly updated and worked on but the emulators themselves are not or as often. With retroarch you get final burn neo and some other emulators for linux "natively" whereas if you used the emulator itself you would have to use wine because the emulators are windows only.

Just give retroarch time to get to know it. you don't have to learn it in a day. It took me a year or so so cozy up with it. Truth be told I STILL use some stand alone emulators from time to time. It's not about what "everyone uses". It's about what works best for you and your machine.

As a linux user I have to tell you. to install new emulators (called cores) in retroarch through the gui. You MUST change the default path to a place you have permission to write to. Also installing the cores from the repository will not get you all the cores...nor will it give you the newest cores. So you can change the default core path (start retroarch gui and then go to settings → directory → core) to a location you are allowed to write to. Then go to load core..then 'Download A Core'. Choose the cores you want (or you can download them all from the webpage using uget or wget). RA will download them and unzip them to the directory you set. Now you have one of two options. You can 1. Leave that directory set and work from there. or 2. (which I suggest) is to manually copy the cores into the default directory as root and also change the core directory back to the default. (see you can download and unzip any core you want to the default directory but you don't have write permissions so actually retroarch downloads and unzips..but you get no core out of it.)


If you learn retroarch (retroarch is the gui (the desktop) for libretro cores (the programs) sorta speak)) then you'll have a better understanding how it all works.)

As for your controller issue no reason to get bummed or do it the hard way. If you messed up setting up on of the controllers just go back the the button/direction and fix it. For example:

 I plug in my USB PS2 controller...load retroarch and go to settings -> input -> controller port 1 → bind all and as i go through I screw up and make the down button left instead *FACEPAWS!* I continue to go through the buttons manually like normal. When I finish I have one of two options using my keyboard I can: 1. Select reset to default controls (thus clearing the controller I just set up) and set them again or 2. Go to the button/direction I screwed up and press the enter button and press the correct direction/button on my controller. All fixed! no need to delete your entire retroarch config. (hint if you are using a snes controller or such then you can just let the setting "time out" thus no buttons are set to the action.)

If you need detailed help you can look at the retropie setup page and it will help get you started quickly. Just know that your paths WILL NOT BE THE SAME. All the controller set up and bios info and such is all good info there to help get you started.

(You can send me a PM and I will walk you through if you need help. This thread is for Attract mode issues NOT emulator problems. That is why I had Ray set up and emulator thread for help and such. Although you can see how hard we stick to the rules around here with that  ;) )
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 28, 2020, 02:18:16 AM
Thanks for all the great tips. Especially the one about not trying to learn this program in a day! Slowing down has definitely helped.

I'm setting this up on my other cabinet and trying to do it correctly, as opposed to the bare minimum to get Super Mario World running passably, ha.

I'm wondering what the correct way to map my control panel is. This cabinet is a standup cabinet with a Mortal Kombat control panel that looks like the attached.

Under the hood, each player's buttons and joystick is a single joystick encoder. So for example player 1's joystick and 5 buttons are the first joystick encoder, and player 2's joystick and 5 buttons are the other one.

For now I'm using the SNES9X core.

I don't imagine anyone has any advice about how to map my control panel for SNES? I've got the exit button mapped (thanks progets).

To make matters slightly worse I don't actually have much experience with SNES.
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 28, 2020, 04:24:05 PM
I posted to the Retroarch forum, probably a better place for this:

https://forums.libretro.com/t/possible-to-map-an-input-from-another-joystick-encoder/30635

That forum is hilarious by the way. Took a ridiculous amount of time to figure out how to post. Turns out they prevent new users from posting until they've read 10 postings. They say so in the FAQ, but of course everyone reads the FAQ for new forums they join...

An endless thread of complaints about the policy:

https://forums.libretro.com/t/how-can-i-create-a-new-topic/8416

Anyway, Retroarch sure is interesting.  Making progress in it is a lot like making progress in a video game.
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on October 31, 2020, 01:04:52 PM
Thanks again for the advice to stick with Retroarch. Now that I wrapped my head around Retroarch I don't even know what the problem was, ha. One thing that really helped is using it through Teamviewer, as opposed to sitting at a cocktail cabinet straining to see.

Once I got it working it was super easy to install other emulators. So now I'm using it for NES, SNES, Odyssey2, Colecovision and Atari 2600. Each just works.

In case it's useful to anyone, attached are my Attract Mode emulator files for bluemsx (Colecovision), ecwolf (Odyssey2), nestopia (NES), snex9x (SNES), and stella (Atari 2600), in case they're useful to anyone. Inside  each are my installation notes (which bios files to install, etc).
Title: Re: Good emulator for SNES and AM?
Post by: mahuti on November 07, 2020, 07:38:31 AM
The most difficult thing about Retroarch for me to understand was that it is built around Gamepads. I've been doing emulation stuff since the late 90's, so in my experience everything was designed for a keyboard (or keyboard encoder.). RetroArch is built around gamepads, and multiple controllers. For my cabinets... it was a disaster as it was literally impossible to map across two gamepad encoders (without doing some kind of wacky udev rule or something) which ould normally map fine in MAME.

It's really simple if one uses a gamepad. If one uses say... two encoders in a cabinet, one for controls and one for coin inputs and administrative interfaces, it starts getting really complex. And exiting with 1 button is needlessly complicated... it's so, so stupid to be honest. That said, over the years It's become one of the tools in my bag, but these days I don't want to use it on a cabinet, just a living room console. I'd prefer to just manually configure everything in a cabinet... but in a cabinet I've decided I'd rather just stick with arcade games anyway.
Title: Re: Good emulator for SNES and AM?
Post by: wrybread on November 07, 2020, 07:56:11 AM
That makes a lot of sense. And my experience (cabinets, since the 90s) and main use (mame) is the same as yours. But I do have one section of my cabinet for the best few games from each classic console. Fun to fire up Colecovision or NES or whatever when a friend who had that growing up is visiting and watch the memories come flooding back. And Retroarch sure is good for that, once I got past the learning curve. And once I learned to stop expecting it to behave like a normal emulator.

And yeah it was pretty mind boggling that I couldn't map controls from my second joystick encoder to player 1 controls. For example not being able to map Player 2 start to the global start button... The game pad theory makes a lot of sense, but really I think there's some design decisions that really get in that program's way. There's a lot of cases of form over function. Ultimately I can't complain, because with a little retooling (re-wiring a few buttons to use the first joystick encoder) I got great results from it. Ok maybe I can complain a little, ha.