Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Catalina Support #586

Open
MichaelBuckley opened this issue Oct 7, 2019 · 69 comments
Open

macOS Catalina Support #586

MichaelBuckley opened this issue Oct 7, 2019 · 69 comments

Comments

@MichaelBuckley
Copy link
Collaborator

@MichaelBuckley MichaelBuckley commented Oct 7, 2019

Apple released macOS 10.15 Catalina today, and Snes9x does not run on it.

Earlier this year, I volunteered to update Snes9x for Catalina, but I severely underestimated the amount of work this would require. Every part of the code except the audio code has required large changes, and I have not had enough free time to finish the work before Catalina's launch.

I still plan to finish the work, but it will take time. I plan to release a version with the ability to load games/freeze states, and play with keyboard/joypad as soon as I can. It still may be a few weeks before this release is done. After that, I hope to add multicart, video options, video recording, cheats, and music box back as time allows. I'll prioritize features requested by users if we get any.

Snes9x isn't the only emulator in this boat. Dolphin recently released a statement warning users to delay upgrading to macOS 10.15. https://twitter.com/Dolphin_Emu/status/1180072169339883520

If users ask about the status of Snes9x on Catalina, you can point them to this Github issue.

@pmaddox76

This comment has been minimized.

Copy link

@pmaddox76 pmaddox76 commented Oct 11, 2019

Thank you Michael for your time and effort. It is appreciated.

@viniciusmaltauro

This comment has been minimized.

Copy link

@viniciusmaltauro viniciusmaltauro commented Oct 14, 2019

Thanks for doing that Michael! I'm an user and I'm looking forward for the update.

@sgreadly

This comment has been minimized.

Copy link

@sgreadly sgreadly commented Nov 4, 2019

Just wanted to say thanks too! Looking forward to a 64bit release I'm happy to test for you ^_^

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Nov 5, 2019

@pmaddox76, @viniciusmaltauro, @sgreadly, @viniciusmaltauro, @bryan-lunt, @daaku, @abderrahmane-tj, @sgreadly, @benvp, @marconett, @kethinov, @rchristi, and @johannes87

Thank you all for the encouragement. I have keyboard support, joypad support, and freeze/defrosting working, but I don't yet have UI hooked up properly for them. I'm hoping to get that done in the next week, maybe two weeks, then I'll release a build. The control configuration UI won't be pretty, but it will work, and I think it's more important to release something working.

Notably, it won't yet support any other Snes9x features, nor (probably) mouse, Super Scope and Justifier controls.

One thing that could really help me is hearing from people who use Snes9x on Mac about why they use it instead of (or in addition to) other emulators. It would really help me to prioritize what gets implemented next.

@bryan-lunt

This comment has been minimized.

Copy link

@bryan-lunt bryan-lunt commented Nov 5, 2019

There are other emulators?

@bearoso

This comment has been minimized.

Copy link
Collaborator

@bearoso bearoso commented Nov 5, 2019

Yes, OpenEmu and Retroarch can run the Snes9x and bsnes cores, and I think bsnes has a partly working standalone client.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Nov 5, 2019

The last time I checked, the bsnes Mac UI wasn't working properly, but it's a nightly build, so that may have changed. Higan nightlies have worked for me, but they take considerably more CPU power than Snes9x. https://cirrus-ci.com/github/byuu/higan/master

@viniciusmaltauro

This comment has been minimized.

Copy link

@viniciusmaltauro viniciusmaltauro commented Nov 5, 2019

@kethinov

This comment has been minimized.

Copy link
Contributor

@kethinov kethinov commented Nov 5, 2019

Notably, it won't yet support any other Snes9x features, nor (probably) mouse, Super Scope and Justifier controls.

I'm pretty sure mouse support is already broken. I tried to run Mario Paint a month or two ago and it didn't work on the Mac version at all for me.

One thing that could really help me is hearing from people who use Snes9x on Mac about why they use it instead of (or in addition to) other emulators. It would really help me to prioritize what gets implemented next.

I use it to playtest the numerous ROM hacks I've been working on for Secret of Mana since my primary computer right now is a Mac.

Obviously Geiger's Windows version with the SNES debugger is something I have to bust out in a Windows VM every now and then to do any serious reverse engineering, but the Windows version is understandably a bit janky in a VM, so I only really use it for debugging. For actual playtesting, I prefer the buttery smooth performance of the Mac version.

@sgreadly

This comment has been minimized.

Copy link

@sgreadly sgreadly commented Nov 5, 2019

I wasn't aware of alternatives, but then again I didn't go out looking for any. To me, snes9x is a choice due to the excellent support, development, and loyalty over the years (since Linux days too). It worked, was easy to use, and lightweight.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Nov 5, 2019

Obviously Geiger's Windows version with the SNES debugger is something I have to bust out in a Windows VM every now and then to do any serious reverse engineering, but the Windows version is understandably a bit janky in a VM, so I only really use it for debugging. For actual playtesting, I prefer the buttery smooth performance of the Mac version.

I originally decided to check out the Snes9x source code because I wanted to see about adding a debugger to the Mac version, to assist in homebrew development. I can't promise I'll get there, since the Cocoa rewrite is taking much longer than I expected, but maybe someday.

I know there's been talk about a cross-platform UI in some of the other github issues. Maybe if that effort gets off the ground, and it has a debugger, my time would be better spent in the long-term helping with the Mac side of it.

@marconett

This comment has been minimized.

Copy link
Contributor

@marconett marconett commented Nov 5, 2019

One thing that could really help me is hearing from people who use Snes9x on Mac about why they use it instead of (or in addition to) other emulators. It would really help me to prioritize what gets implemented next.

For me it's just that bsnes and higan eat through my macbook battery when playing while traveling, so I prefer snes9x when I'm on the go.

@johannes87

This comment has been minimized.

Copy link

@johannes87 johannes87 commented Nov 9, 2019

One thing that could really help me is hearing from people who use Snes9x on Mac about why they use it instead of (or in addition to) other emulators. It would really help me to prioritize what gets implemented next.

For me it's just that bsnes and higan eat through my macbook battery when playing while traveling, so I prefer snes9x when I'm on the go.

I also feel that Snes9x uses less computing resources. My CPU temparature is lower and my fan keeps quieter in comparison to bsnes. Haven't tried higan.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Nov 12, 2019

Snes9x.app.zip

Here's a barebones build which works on 10.12 through 10.15. The code for this has all been uploaded to a branch called mac-minimal-changes in my GitHub fork. Please test it out. If no major problems are found, I'll submit a merge request.

A few important notes:

  • Support files (freezes and etc.) now need to live in ~/Library/Application Support/Snes9x. Catalina throws up too many warning dialogs if they live elsewhere. If your prefs were set to store those files in /Applications or next to your ROM files, you'll need to move your files.
  • The freeze/defrost screen does not scale with the window, and looks small on retina machines.
  • The freeze thumbnail bug where it would take a screenshot of the freeze screen still exists, but I know how to fix it in future releases.
  • The only video options right now are Smooth and Blocky. Because Apple has deprecated OpenGL, I need to rewrite all the rendering code, so it seemed liek a waste of effort to get the other filters working in OpenGL again.
  • The default keybindings now match the Windows port of Snes9x, but it will import your old keybindings.
  • Joypad settings are not imported, because the old joypad settings didn't allow you to reverse joypad axes. To help with this, the port will try to fill in reasonable defaults when you configure your joypads.
  • Mouse/Super Scope/Justifier don't work. Multitap should work.
  • The few games that output 239 lines will get 15 lines cut off.
  • Very few settings, and no other features are present.

Please reply to this issue with direct feedback on this build. I'll ahve a blog post in the next few days about the process of porting, and what the plan is going forward.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Nov 12, 2019

Oh, one more thing. When you first launch on 10.15, it'll throw up a dialog asking for permission for the app to access your keyboard. I'm not sure what's causing that, but I think it might be required for joypad support. I promise the app isn't doing anything evil. It's safe to grant the app keyboard permissions.

@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Nov 29, 2019

Its working properly now on Catalina . What version is it now ? Starting with v1.0 again ? Not v1.61 ? Confusion.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Nov 29, 2019

@azoreseuropa It is between versions. There is some code that has changed since 1.61, so it did not feel right calling it 1.61. However, 1.62 (or whatever the next release will be) is not finished yet. Therefore, I did not set a version number, and macOS is displaying it as 1.0 because it lacks a version.

When the next version is released, I will be happy to produce a build with that version number and deal with Apple's notarization process. There may be more intermediate Mac builds before then.

@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Nov 29, 2019

@TEETSmaGEETS

This comment has been minimized.

Copy link

@TEETSmaGEETS TEETSmaGEETS commented Dec 2, 2019

Thanks for all your work! This is working but is really choppy for some reason. Anyone else having this issue?

@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Dec 2, 2019

@TEETSmaGEETS

This comment has been minimized.

Copy link

@TEETSmaGEETS TEETSmaGEETS commented Dec 2, 2019

The video is stuttering, like freezing momentarily and then continuing repeatedly. The built in Frame rate display doesn't show any frame rate drops though. Have tried on several roms.

@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Dec 2, 2019

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Dec 2, 2019

It's definitely possible that the updated rendering code is slower for some games or on some hardware. I haven't had the ability to test on very many games, and have only tested on a 2014 Mac Mini and a 2015 MacBook Pro.

Knowing which games and which hardware are suffering from the studdering would be helpful for diagnosing the problem and fixing it. It would also be helpful to know how much CPU Snes9x is taking on your machine using Activity Monitor. Thanks in advance for any details you can provide.

@misatosangel

This comment has been minimized.

Copy link

@misatosangel misatosangel commented Dec 2, 2019

Sadly this crashes as soon as a Rom is loaded here. Running catalina (10.15.1) on a 2017 15" MBP. The app runs and the preferences screen works. Open Rom dialogue comes up and then after select it just vanishes. Doesn't seem to matter what Rom, tried several.

Starting from the terminal gives the following output:
% ./Snes9x.app/Contents/MacOS/Snes9x

Interval: 16ms, Frames: 512
Interval: 16ms, Frames: 512
Map_SDD1LoROMMap
TextureRange: enable
AUGraph started.
Illegal instruction

Machine details:

Model Identifier:       MacBookPro14,3
Processor Name:         Quad-Core Intel Core i7
Processor Speed:        3.1 GHz
Number of Processors:   1
Total Number of Cores:  4
L2 Cache (per Core):    256 KB
L3 Cache:               8 MB
Hyper-Threading:        Enabled
Memory:                 16 GB
Boot ROM Version:       202.0.0.0.0
SMC Version (system):   2.45f1
@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Dec 2, 2019

@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Dec 2, 2019

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Dec 2, 2019

@misatosangel Two things stand out from those logs. The first is the line Map_SDD1LoROMMap. That indicates that the emulator is using the S-DD1 mapper, which I believe is only used in Star Ocean and Street Figher Alpha 2. Can you confirm that you were loading one of those games? If not, it may mean there's something in the code that's misidentifying the game.

Second, is the line Illegal Instruction. I usually see that only when running on older hardware or an older than the minimum requirements. However, you're using a newer OS with newer hardware than the machine on which it was compiled. Could you please zip up the crash logs and attach them to this ticket? You can find instructions for getting to the crash logs here, just replace Day One with Snes9x.

@azoreseuropa

This comment has been minimized.

Copy link

@azoreseuropa azoreseuropa commented Dec 2, 2019

@misatosangel

This comment has been minimized.

Copy link

@misatosangel misatosangel commented Dec 2, 2019

Can you confirm that you were loading one of those games?

Not sure which Rom I tried that time it probably was Alpha 2.

However, they all fail, trying some others just now (Chrono Trigger, Megaman 7) . Only difference is that the line in question is replaced by Map_HiROMMap, which makes sense.

Here's the last crash log zip'd for you.
Snes9x_2019-12-02-194953_rin.crash.zip

(I should add that all the Roms in question work fine on the old 32bit Snes9x)

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 5, 2020

Snes9x.app.zip

Happy New Year. For those of you who need a notarized build, I have attached one to this comment. This build also fixes a crash that could occur when switching ROMs.

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 7, 2020

When I go to "Preferences" my USB game controllers do not appear, the only option is "Keyboard". In previous versions I would configure the controllers via "Config" on the main menu.

I checked to make sure my MacBook was still recognizing the two USB game controllers and it was. I also tried granting Snes9x full access to my keyboard which seems a bit unsafe and unnecessary however even with this access although my generic USB controllers were recognized and listed under "Keyboard" I was still unable to configure them.

Any suggestions on how to get this post-Catalina Snes9x to recognize my controllers and allow me to configure them? Preferably without having to grant full access to my keyboard in all applications. Thanks

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 7, 2020

Snes9x.app.zip

@dailun Another user just reported a similar problem with a fix. I have attached a build with that fix to the top of this post.

I do believe you have to grant Snes9x full access to your keyboard for gamepads to work. Catalina comes with a new gamepad API that doesn't require keyboard access, but it only works with Xbox, PlayStations and Mfi controllers. I promise that Snes9x isn't doing anything with your keyboard except using it to control games, and the source code is open so you can confirm that.

If you need help enabling keyboard access for Snes9x, Apple has a help article. https://support.apple.com/guide/mac-help/control-access-to-input-monitoring-on-mac-mchl4cedafb6/mac

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 8, 2020

Thanks for the help but unfortunately I am still unable to configure the controllers. After I enable keyboard access they appear under "Keyboard" in the dropdown box however I am still unable to assign the buttons on my two "Generic USB Joysticks".

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 8, 2020

@dailun You should be able to click into any of those text fields and hit a button on the joystick to assign it, but the fact that it's showing up as "Generic USB Joystick" means it might not be able to find the buttons.

Could you try creating mappings for these joysticks using http://generalarcade.com/gamepadtool/ and pasting them in a comment in this ticket? I'll be able to add those mappings to a build, which should hopefully allow them to be used.

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 9, 2020

I skipped over a lot of the buttons and just made sure I had registered the buttons needed on a Super Nintendo controller.

Searching gamepads...
Found 2 gamepad(s):
"Generic USB Joystick", 03000000790000000600000007010000 (mapping available)
"Generic USB Joystick", 03000000790000000600000007010000 (mapping available)
Mapping string: '03000000790000000600000007010000,Generic USB Joystick 2,platform:Mac OS X,a:b2,b:b1,x:b3,y:b0,back:b8,guide:b9,leftshoulder:b4,rightshoulder:b5,dpup:-a1,dpdown:+a1,dpleft:-a0,dpright:+a0,'
Searching gamepads...
Found 2 gamepad(s):
"Generic USB Joystick", 03000000790000000600000007010000 (mapping available)
"Generic USB Joystick", 03000000790000000600000007010000 (mapping available)

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 10, 2020

Snes9x.app.zip

@dailun Based on that information, it looks like you're using a DragonRise Inc. PC Twin Shock Gamepad. I did some research and it looks like it reports its button mapping in a different format than any other gamepad I have to test on, so I'm not confident that this build (linked above) will fix the issue.

However, this build will also log gamepad information to a file in your home folder called snes-gamepad.txt. It will log so much information that it will probably slow down the emulation on your machine.

Please run this build, select your gamepad in the preferences, press some buttons, quit Snes9x, zip up that file, and attach it to this ticket. I should hopefully have all the information I need to support that controller.

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 10, 2020

I have attached a photo of the controller along with the file you asked for however when I tried registering the inputs there was still no response. If there was only a way to make the pre-Catalina controller configuration work on this new build because before it worked great.

snes-gamepad.txt.zip

Oker game controller

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 11, 2020

Snes9x.app.zip

I believe this build will solve your input issue. It will still create the log file, so let me know if this works for you and I'll produce a build without all the logging.

Unfortunately, I can't really go back to the old code. A lot of it was tied directly into the old UI, and some of it had design limitations. For example, it was impossible to reverse axes using the old code, and it was also impossible to use https://github.com/gabomdq/SDL_GameControllerDB to provide reasonable defaults for the most commonly-used controllers. I figured that as long as I was rewriting a lot of the code anyway, I might as well solve those issues, so the code will be more useful for most users. Rewriting from Carbon to Cocoa seemed like the best time to introduce any risky changes. The new code is less tested, and it is a bit more complicated, so there was always a chance it would break some controllers. I'm sorry it happened to you, but I'm thankful that the information you provided me should solve what I hope are the last remaining issues with the code.

For those curious as to what broke, the old code recieved cookies from the gamepads and allowed the user to configure what each cookie did. The new code reads the HID report from the controller, which reports what each cookie actually is. For example, it could tell you that the cookie 13 mapped to the start button.

Each element in the HID report can have one or more children elements. For example, the left stick element might have children elements for the X axis, the Y axis, and the stick's button. This gamepad's HID report listed all the buttons as chidren of the left stick's X axis. There's technically nothing in the HID standard that disallows this, but I never thought a stick axis would have child elements, especially not elements completely unrelated to the stick.

Previously, my code was not checking for children on axes, buttons, or D-pads. I fixed it to always check for children on every element.

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 11, 2020

Although snes9x did not have input monitoring privileges in the settings I was able to configure the controller in the snes9x preferences. This is progress because before it wouldn't register any of the buttons I pushed while trying to configure the controller. However when I tried to use my newly configured controller in a game it would still not work. Even after I granted input monitoring privileges in my MacBook settings I was still unable to use the controllers. I have attached the updated snes-gamepad.txt file in hopes it has some additional information you can use to correct the problem for me and other users who use similar game controllers. Thanks a lot for all your work on this project and attention to this particular issue.

snes-gamepad.txt.zip

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 11, 2020

@dailun Looking at the log, I'm seeing a lot of Device not assigned to a player lines. In the preferences window, the selected gamepad is the only gamepad that the emulator will accept for that player. If you switch the player back to Keyboard in the preferences window, the emulator won't accept any gamepad inputs for that player. If you have two gamepads connected, you might want to disconnect one before launching Snes9x. You'll also need to close the preferences window for the emulator to recieve inputs. Please let me know if any of these solve the issue for you.

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 11, 2020

The Keyboard is not selected in the preferences window, the Generic USB joystick is selected and all the snes buttons have been assigned. The controller started working when I unplugged one of the controllers and started the game with only one controller plugged in. However Snes9x kept crashing before I could get far enough into a game to see if the second controller would work when I plugged it in. The software crashes within a minute of me hitting the start button.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 11, 2020

@dailun If you have any crash reports, I may be able to fix the crashes. There are instructions on how to collect the crash reports here. https://macreports.com/crash-reports-how-to-use-them-to-troubleshoot-why-your-mac-crashed/

@gtalusan

This comment has been minimized.

Copy link
Contributor

@gtalusan gtalusan commented Jan 11, 2020

@MichaelBuckley check this out... reproduced using the last build you posted the other day:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib             	0x00007fff67b13ba4 flockfile + 18
1   libsystem_c.dylib             	0x00007fff67b16c50 fwrite + 66
2   com.snes9x.macos.snes9x-framework	0x000000010782b75f gamepadAction(void*, int, void*, __IOHIDValue*) + 136
3   com.apple.framework.IOKit     	0x00007fff32dce6ee __IOHIDDeviceInputElementValueCallback + 217
4   com.apple.CoreFoundation      	0x00007fff2ff7964e __CFDictionaryApplyFunction_block_invoke + 22
5   com.apple.CoreFoundation      	0x00007fff2ff3e756 CFBasicHashApply + 124
6   com.apple.CoreFoundation      	0x00007fff2ff2f0a8 CFDictionaryApplyFunction + 128
7   com.apple.framework.IOKit     	0x00007fff32dd28f6 __IOHIDQueueValueAvailableCallback + 70
8   com.apple.iokit.IOHIDLib      	0x000000010bb3007d 0x10bb2c000 + 16509
9   com.apple.CoreFoundation      	0x00007fff2ffa5a7b __CFMachPortPerform + 288
10  com.apple.CoreFoundation      	0x00007fff2ff770bf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
11  com.apple.CoreFoundation      	0x00007fff2ff7700f __CFRunLoopDoSource1 + 541
12  com.apple.CoreFoundation      	0x00007fff2ff75c7c __CFRunLoopRun + 2612
13  com.apple.CoreFoundation      	0x00007fff2ff74bd3 CFRunLoopRunSpecific + 499
14  com.apple.HIToolbox           	0x00007fff2eaca65d RunCurrentEventLoopInMode + 292
15  com.apple.HIToolbox           	0x00007fff2eaca39d ReceiveNextEventCommon + 600
16  com.apple.HIToolbox           	0x00007fff2eaca127 _BlockUntilNextEventMatchingListInModeWithFilter + 64
17  com.apple.AppKit              	0x00007fff2d14eeb4 _DPSNextEvent + 990
18  com.apple.AppKit              	0x00007fff2d14d690 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
19  com.apple.AppKit              	0x00007fff2d13f3ae -[NSApplication run] + 658
20  com.apple.AppKit              	0x00007fff2d111775 NSApplicationMain + 777
21  libdyld.dylib                 	0x00007fff67a8c7fd start + 1
@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 11, 2020

Snes9x.app.zip

Ha, I should have expected that it was the logging causing the problem. Thanks, @gtalusan. @dailun, this build removes the logging, which should fix the crashing.. You should delete your snes-gamepad.txt file, since it might be large.

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 12, 2020

I have removed the snes-gamepad.txt file and the system no longer crashes. However when I start Snes9x with two controllers plugged in I am unable to use either of them even though they are both listed and set up as the controllers for player 1 and player 2. When I start Snes9x with one controller I can use that controller however when I plug in the second controller it doesn't recognize it. Do you have any suggestions that would enable me to play a two player game? Thanks

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 13, 2020

@dailun I've been working on that problem when I can ever since you confirmed that removing the second controller allows the first to work. The problem doesn't seem to be in the gamepad specific code, but I haven't been able to find the underlying problem yet. It will probably be at least a few days before I have a fix.

@gtalusan

This comment has been minimized.

Copy link
Contributor

@gtalusan gtalusan commented Jan 13, 2020

The gamepads don't get assigned to players if there's more than 1 gamepad.

This quickly fixed it for me, but it ignores any saved preferences per player.

diff --git a/macosx/mac-joypad.mm b/macosx/mac-joypad.mm
index feca209..2f9dcfc 100755
--- a/macosx/mac-joypad.mm
+++ b/macosx/mac-joypad.mm
@@ -748,10 +748,11 @@ void SetUpHID (void)
             AddDevice((__bridge IOHIDDeviceRef)device);
         }
 
-        if (orderedDevices.count == 1)
+        int8 playerNum = 0;
+        for (auto it = allDevices.begin(); it != allDevices.end(); ++it)
         {
-            const struct JoypadDevice &deviceStruct = *(allDevices.begin());
-            SetPlayerForJoypad(0, deviceStruct.vendorID, deviceStruct.productID, deviceStruct.index, NULL);
+            const struct JoypadDevice &deviceStruct = *it;
+            SetPlayerForJoypad(playerNum++, deviceStruct.vendorID, deviceStruct.productID, deviceStruct.index, NULL);
         }
     }
     else
@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 13, 2020

I found that too, but it's not the only issue. Something's going terribly wrong when I report the 2P button presses to the cross-platform Snes9x code. It has to be something the Mac code is doing wrong (since it works on Windows) but I haven't tracked it down yet. I also need to fix configuring the keyboard for multiple players.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 16, 2020

Snes9x.app.zip

@dailun Give this build a shot. I don't have 2 of the same model of controller to test with, but I believe I was able to use the debugger to trick snes9x into beleiving that 2 different controllers were the same model.

@kethinov

This comment has been minimized.

Copy link
Contributor

@kethinov kethinov commented Jan 16, 2020

There is some kind of accuracy issue. Take a look how the text renders in Secret of Mana.

Secret of Mana (U)  ! _noheader 000

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 17, 2020

Snes9x.app.zip

@kethinov Thanks for the report. Here's a build that re-enables the high-resolution graphics that Secret of Mana requires. It also contains the gamepad hat switch fixes contributed by gtalusan.

@kethinov

This comment has been minimized.

Copy link
Contributor

@kethinov kethinov commented Jan 17, 2020

Works great!

@dailun

This comment has been minimized.

Copy link

@dailun dailun commented Jan 18, 2020

I checked the build you recommended. Now both controllers work however there is a problem with the up button. In Donkey Kong Country 2 I am now unable to continuously climb rope. Now when you press up you will climb up a little bit and then stop. If you release the button and then press and hold it again you will climb up a little more and then stop, however you are unable to continuously climb up with one push and hold of the up button on the directional pad.

@gtalusan

This comment has been minimized.

Copy link
Contributor

@gtalusan gtalusan commented Jan 18, 2020

@dailun I tried three different gamepads and they work fine for me -- I played up until level 2 of DKC 2 to the first rope scene. Do you have a link to a store where I can buy my own copy of the gamepad you have?

@kethinov

This comment has been minimized.

Copy link
Contributor

@kethinov kethinov commented Jan 18, 2020

Another issue: altering the turbo rate (e.g. increasing it to 15) doesn't save upon quitting the app and restarting it.

Also is there a way to do turbo fire and to adjust the rate of fire yet? I looked around and didn't see an option for that yet.

@MichaelBuckley

This comment has been minimized.

Copy link
Collaborator Author

@MichaelBuckley MichaelBuckley commented Jan 19, 2020

@gtalusan I can reproduce the up behavior on one of my test controllers. I would hold off on buying anything for now.

@kethinov Thanks for the report on the turbo rate. Autofire is on the to-do list. I haven't had time to start work on any of it yet, however. See the list at the bottom of https://buckleyisms.com/blog/snes9x-on-macos-catalina/

@kethinov

This comment has been minimized.

Copy link
Contributor

@kethinov kethinov commented Jan 19, 2020

Another bug: Assigning a file extension to open with the SNES9x app doesn't work. When you double click a ROM, it opens the SNES9x app, but it doesn't run the ROM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.