-
Notifications
You must be signed in to change notification settings - Fork 18
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
[FEATURE REQUEST] SNAC support #173
Comments
This sounds amazing! Would this also support the twin sticks for Virtual On? |
Hi thanks for adding snac support. Your rewrite is better than what I had. I left the issue open in case I needed to talk to you about it. There's a couple things with snac that may be missing that I noticed. Another thing missing is when Stunner is used A0 isn't getting written to OREG. I noticed that the start button on stunner wasn't working when trying a lightgun game, something that I had working before. I determined this was because the game isn't detecting stunner because of the missing A0. One problem though with the same code, when testing other games like Area 51 or House of the Dead the gun wasn't detected because start wouldn't work. I tried a hack of line 799 - OREG_DATA <= 8'hF0; and changed that to A0. That was enough for stunner to start working in Area 51 and HOTD. Here's is the code so you can see how I did it main...blue212:Saturn_MiSTer:stunner One weird thing I noticed House of the Dead booted to a black screen but I was able to either reload or reset a few times and it would load and work. |
Thanks for the notes. About the Stunner. I don't have a Stunner. It is very hard to add support for a device you don't have. If you have a Stunner, you can add support for it in the core. |
There's already an open issue regarding the 3D pad not working when set to digital mode, but I wanted to note that here since this thread is a more cohesive log of the issues in SNAC implementation |
I'm awaiting a delivery with the original 3D Pad. When I get it, I'll try to figure out the problem. |
https://nfggames.com/forum2/index.php?topic=5055.0 Just found this⬆️ Seems like it could be of use troubleshooting the issue with the 3D pad |
Hi I wrote code to add SNAC support to the saturn core. This would let people use an adapter with the USER port and use Saturn or Gensesis/MD(software must support them) controllers.
It currently supports both control modes - SMPC and SH-2 direct modes. I did uncomment and use IOSEL and it does work correctly, it determines which control mode is used(SMPC or SH2).
SH2 mode is only used in a few homebrews and lightgun games when the Stunner is detected. This mode is similar to Gen/MD since the software controls the polling and reading of the controls.
SMPC mode seems to rely on that chip to poll and read controls and put the right values into OREG. All 3 modes are supported in SMPC mode(THTR, TH, 3 line).
I used a counter to time setting the select signals(TH, TR) and reading the controls. This may not be how the original chip did it. I couldn't figure out where the select signals came from in this mode, in SH-2 direct mode it they would be PDR1O, PDR2O in the core.
Every frame I check if anything is connected and identify and read the controllers. All controllers are auto detected.
Every peripheral will work except the multitaps. The Sega genesis segatap and the Saturn multitaps. They don't work with current code, they use 3 line mode and I had special checks for them to make them work but removed the code to simplify and minimize it.
The digital pads, 3d pad, steering wheel, mouse, mission sticks etc have been tested and all work.
There's enough io for snac to act as one port. It is coded to be act as port 1 and usb controller 1 as port 2 when SNAC is turned on in OSD.
I had a joyswap function where snac coould be switched to port 2 but commented out most of it. I removed the joyswap code in the OREG section to simplify and try to save space.
Feel free to use any of this code you like, it's ok if you want to rework, rename, optimize, or simplify any of it, just please don't change to pinout in saturn.sv because that would break existing adapters. I over commented the code in the hopes you could figure out what I was trying to do. If you want to use the code as is I can do a pull request.
I used the homebrew "Pseudo Saturn Kai" to view the OREG. it has a "smpc pad test". hit a L or R sholder button then press UDLR then z to unlock the "extra stuff" menu, then choose "smpc pad test".
If you do use it I would like you to look into how the lightgun sensor works if you get a chance. Currently with lightgun games the Stunner is detected and trigger and start button work but the sensor doesn't trigger the right thing in the core so aiming doesn't work.
I think EXLE1 or 2 needs to be used so bit 6 - the sensor (TH) can be used to trigger stuff. When it goes low and EXLE(EXternal Latch Enable - it is in SMPC) is high I think that signal causes a pad interrupt (IRQL in SCU) and/or latches HV (EXLAT in VDP2).
But I'm unsure how that works exactly.
Here is the code.
blue212@2312428
Great job on this and the other cores btw.
The text was updated successfully, but these errors were encountered: