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

My DS2 Pad Tests #25

Open
venice1200 opened this issue Dec 21, 2024 · 58 comments · Fixed by #26
Open

My DS2 Pad Tests #25

venice1200 opened this issue Dec 21, 2024 · 58 comments · Fixed by #26
Labels
documentation Improvements or additions to documentation

Comments

@venice1200
Copy link
Contributor

venice1200 commented Dec 21, 2024

Hi @vossstef,
I build my DS2 Adapter for the Spare Pin Header of the MiSTeryNano Midi Shield today and did some tests with a modified Core v1.5 to be able to use the Spare Header Pins.

IMG_1556_kl

Adapter for Spare Pin Header J8 (SPH) on the MiSTeryNano Shield and the Playstation Dualshock 2 Controller

Playstation Connector Pinout
 _____________
 |987 654 321|
 \___________/

Spare Pin Header Location and Pinout

       USB-C   
      |     |  ------
      |  T  |  |7531| <= SPH
Sub-D |  A  |  |8642|
      |  N  |  ------
      |  G  |
      |     |  2x MIDI
      |     |
       HDMI
	   
Adapter Connection
PS/DS Pin - SPH Pin (FPGA Pin) 
-----------------------------------------
  DAT   1 - 3 (P77)   MISO 
  CMD   2 - 2 (P74)   MOSI
        3 - nc        Rumble Voltage
        4 - 6         GND
        5 - 7         VCC/3,3v
  ATN   6 - 4 (P31)   CS
  CLK   7 - 1 (P73)   MCLK
  IRQ   8 - nc
  ACK   9 - nc

nc = not connected

Here are my Findings using the DS2 with my Adapter.

DS2 Pad Analog Mode (LED) On or Off (doesn't matter)
Testing with H.E.R.O two Button Version (NTSC)
Direction Buttons OK
Left Analog Stick not working
Select & Start Ok
Circle/A = Button 1 (HERO Fire)
Cross/B = Right Direction (!)
After pressing the Button the Direction Buttons are no longer working (Paddle Mode?)
I need to press Circle/A to get the Direction Buttons working again
Traingle/X = Left Direction (!)
After pressing the Button the Direction Buttons are no longer working (Paddle Mode?)
I need to press Circle/A to get the Direction Buttons working again
Square/Y = Button 2 (HERO Bomb)
Shoulder Buttons no function
Same with HERO (OneButton) PAL Version

DS2 Pad Analog Mode On
Testing Super Breakout
Select & Start Ok
Slider Game Direction with Left Analog Stick (Left/Right) Ok
Circle/A = After pressing the Button the left Analog Stick is no longer working
I need to press Cross/B or Triangle/X or Square/Y to get the left Analog Stick working again
Cross/B = Button 1 (Start Ball)
Triangle/X = no function
Square/Y = no function

Testing Video Olympics
Game Direction with Left Analog Stick (Up/Down) Ok
Need to invert Paddle direction

If you press the wrong button the Pad stops responding which is inconvenient (the same happens with an USB Pad).
Maybe a two button combination will be better for paddle activation/deactivation.

The first Button is Circle in Joystick Mode and Cross in Paddle Mode?

Btw, Mouse 🖱️ as Paddle works fine 👍

Happy X-Mas 🎄

@vossstef
Copy link
Owner

@venice1200,
if you don't mind would like to add your cable build instructions incl picture for other users. Is that o.k ?

Many thanks for your valuable feedback and would like to improve the design over the next weeks.

I pretty much copied the mister core but let certain input switchmode function (joy, paddle, mouse) for the time being away and of course the key mapping might be different...

Feel free to have a look at the readme.md https://github.com/MiSTer-devel/Atari2600_MiSTer
and https://github.com/MiSTer-devel/Atari7800_MiSTer to understand what i ported and about game control.

Initially i thought that porting of that small core is simple but ended up with a rather long lasting exhausting excersise and A7800 ROM autodetect and the video stabilizer blocks finally made the core working. Game Input control was right from the beginning a nightmare...

@vossstef vossstef self-assigned this Dec 21, 2024
@vossstef vossstef added bug Something isn't working documentation Improvements or additions to documentation labels Dec 21, 2024
@venice1200
Copy link
Contributor Author

I am happy to help.

You can use anything I post for the documentation.

I used your code and added some modified files for supporting the Spare Pin Header for DS2.
If you like I can fork your repo, add my changes and send a pull request.

Nothing of the original work is changed.

@vossstef
Copy link
Owner

vossstef commented Dec 22, 2024

Hi @venice1200,
i need to include the Shield Board pinheader as a selectable game input option in all the designs. Meaning present 'Joystick to DIP' in use and alternatively Shield pinheader for DS2. Would be great if you could create an extra jumper cable build instruction page (.md and graphics as .svg inkscape) with all needed deatils how to construct and purchase the needed parts. Also an edited TN20k drawing where new pinheader signals are shows will help too. I was yesterday evening browsing aliexpress to find your jumper cable but didn't found exact match but many parts that could be re-used to construct such a thing.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 22, 2024

Let me see what I can do for you (us).

I use an old (and maybe defective) Playstation Controller extension cable.
I was in luck as the female connector and the connected part of the cable was Ok.

I crimped the Pins onto the cables. Beta test Ok.

But I am waiting for female connector parts from Ali and I am going to create a PCB for this connector with a 10 Pin header to use 10-Pin flat cables and connectors for an easy 1:1 connection to the Pin Header of the MiSTery Nano Board.

I will provide my cst later.

Aloha

@vossstef
Copy link
Owner

.cst will use to update OSD and core that you immediately have a new input selection apart from further needed finetuning in the controller keymaps.
Big Thanks !

@venice1200
Copy link
Contributor Author

.cst attached.

a2600_top_tn20k_ds2sph.zip

@vossstef vossstef linked a pull request Dec 23, 2024 that will close this issue
@venice1200
Copy link
Contributor Author

venice1200 commented Dec 23, 2024

First try..

grafik

@vossstef
Copy link
Owner

Hi @venice1200 ,
PCB looks Great !

You will find the design changes here: https://github.com/vossstef/A2600Nano/tree/ds2_4_misteryboard20k
Pls. select in existing OSD "DS2 #2 Joy" as input port for the pinheader. I didn't tested as i don't have a cable yet but ordered a Y-Adapter from Ali that i could disintegrate.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 23, 2024

That works 👍
With DS2 #2 i get my DS2 Pad working in the same way as in my previuos test above.

Hi @venice1200 , PCB looks Great !

You will find the design changes here: https://github.com/vossstef/A2600Nano/tree/ds2_4_misteryboard20k Pls. select in existing OSD "DS2 #2 Joy" as input port for the pinheader. I didn't tested as i don't have a cable yet but ordered a Y-Adapter from Ali that i could disintegrate.

If the femal connectors arrive I will double check the PCB and order some of them.

@venice1200
Copy link
Contributor Author

Btw, is is now possible to use two DS2 Controller with the MiSTery Board?

No.1 using the original Pins
No.2 using the Spare Header

@vossstef
Copy link
Owner

Btw, is is now possible to use two DS2 Controller with the MiSTery Board?

No.1 using the original Pins No.2 using the Spare Header

Yes both interfaces can be active at the same time. There is for the Joy to DIP interface no header but you could solder adhoc somw wires. Good point and i will meantion that in the readme too. Thought that coud could add via pull an extra document with the build instructions linked from readme.

@vossstef vossstef reopened this Dec 23, 2024
@vossstef
Copy link
Owner

i merged the changes and cable doc to be added via pull

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 24, 2024

Ok!
I will add pictures to „.assets“, correct?

Any chance to get the left DS2 Analog Stick working for normal (non paddle) games?

@vossstef
Copy link
Owner

@venice1200 , yes pictures to .assets.
Will have a look into that and experimenting with strict setting in input control for Joy and Paddle mode.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 24, 2024

DS Adapter Site
https://github.com/venice1200/A2600Nano/blob/main/shield_ds_cable.md

I am happy to send the pull request

Happy X-Mas

@vossstef
Copy link
Owner

Just send MR!
Looks great !!!

Also a Happy X-Mas 😀

@vossstef
Copy link
Owner

vossstef commented Dec 24, 2024

@venice1200 merge done and i have a small X-Mas gift for you 😀

I implemented a strict input selection for digital Joystick and Paddle. Hope that all your points are fixed now.
Btw. my DS2 device behaves that left stick and Dpad are both simultaniously active at the same time.

https://github.com/vossstef/A2600Nano/tree/strict_input

In the root you will find an changed XML file for OSD control that have to be copied to the sdcard.
Pls. let me know...

and now it's finally X-Mas ✨

@venice1200
Copy link
Contributor Author

...Btw. my DS2 device behaves that left stick and Dpad are both simultaniously active at the same time.

Using which Version of the Core?
With v1.2 to v1.4 I got the left stick only working in paddle mode.

In the root you will find an changed XML file for OSD control

The atari2600.xml file?
Is this something I had to copy also for the older Version?

Many Thx

@vossstef
Copy link
Owner

vossstef commented Dec 25, 2024

@venice1200 You have to copy the .XML file to your sd card. i stored a changed copy in the branch. pls. recompile the tn20k project in the branch (strict input) and Flash to your tn20k.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 25, 2024

I copied the atari2600.xml file to the SD Card and compiled the "strict" Code using the 1.9.10 Education Version.
Using the 2 Buttton 60Hz Version of HERO again for testing two buttons.
Set Pad 1 to "DS2 #2 Joyst" Controller.
The Pad is not set to analog mode.
I start the game with F11 or Start at thew PAD.
Ledt stick not working at all.
Immediatly I press left or right to start the movment of HERO and the figure touch's the ground
a bomp is dropped without any button presses!
Circle works as Trigger #1 (Laser)

The 1 Button PAL HERO Version works as expected.

Super Breakout PAL
Set Pad 1 to "DS2 #2 Paddl" Controller.
I start the game with F11 or Start at thew PAD.
The Pad is set to analog mode.
Ball release with Cross but no Paddle Movement with Left Stick.

Maybe I should try a version compiled by you.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 25, 2024

I use an Playstation Dualshock Controller SCPH-10010.
Tested two pads with the same type and the same result.
I compile the code using the bat file but reduced it to Tang Nano 20k.

Build log
nano20k_build.txt

@vossstef
Copy link
Owner

I use an Playstation Dualshock Controller SCPH-10010.
Tested two devices with the same type and the same result.

i only have two different clones and they behave like that the stick is at the same time active than Dpad. Will try to find info about your model over the next days.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 25, 2024

Oh, if Iuse my USB Pad (Logitech Rumblepad 2) I have the same issue running the 2 Button Hero Version.
A bomb is dropped after the figure drops the ground.

I use an Playstation Dualshock Controller SCPH-10010.
Tested two devices with the same type and the same result.

i only have two different clones and they behave like that the stick is at the same time active than Dpad. Will try to find info about your model over the next days.

Is it possible that the Analog Stick is only active in analog mode?

Some interssting sites...
https://hackaday.io/project/170365-blueretro/log/186471-playstation-playstation-2-spi-interface
https://forums.libretro.com/t/how-to-set-up-a-sony-dualshock-2-controller-correctly/44019
https://en.wikipedia.org/wiki/Dual_Analog_Controller
https://psx-spx.consoledev.net/controllersandmemorycards/#controllers-analog-buttons-dualshock2 (search for "Analog Mode Note")

I will test my DS2 Controller with my MiSTer PSX SNAC Adaper to see if the Sticks are doing something in digital mode as I found different Information.
Some say the stick does absolutly nothing in digital mode, other say the stick behave like a digital stick.

Test Done:
At least the Menu of the MiSTer PSX does nothing when I move the left stick in digital mode.

I can send you one of my controllers!?

@vossstef
Copy link
Owner

@venice1200 i am working for some while on a DS configuration command to switch in between digital and analog mode. This work is not finished yet. I need to understand the documentation further. Both to me known controller interface blocks just read and don't support device configuration methods.

The 2nd Button topic (didn't know of 2nd button support at all) i should be able to fix over the next few days.

@vossstef
Copy link
Owner

@venice1200 thanks !
it looks that in principle ok but Trigger mixed up in between USB and DS2...

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 28, 2024

...and also mixed triggers between joystick and paddle mode.

Any idea why the DS2 left stick has no function since "strict branch" as it was already working in Paddle Games.
Maybe something wrong with the XML?

Many Thanks for your really cool cores!

Btw, DS2 connectors have arrived from Ali and PCBs are ordered.

//Edit
Whats your plan using DS2?
My Opinion, activate the Analog Mode by default and the user can use either the D-Pad or the Left Stick in Joystick Games and the Left Stick in Paddle Games.

@vossstef
Copy link
Owner

vossstef commented Dec 28, 2024

@venice1200
got simulation environment running and i just pushed changes into the branch for automatic configuration of the D2 via OSD control. Paddle mode of the DS2 is now automatically set and locked!!!(user can't toggle to analog and need to use OSD) if a port is set to paddle mode. Reverted if port is set to digital mode.

I checked :
Super Breakout with DS#2 Paddle, DS2 Analog Mode on (LED on)

DS2 stick movement for analog control is working as before but you have to press once (activate) one of the dedicated paddle trigger keys X or Y . The core is presently only switching to paddle mode if one of the dedicated paddle keys is pressed.

There are two Keys dedicated to digital Triggers A + B and two dedicated keys for paddle analog trigger X +Y (of course only single Trigger per paddle. The Stick is serving as 1st X direction and 2nd paddle Y direction. Therfore the two keys.

Now i removed also the nasty activation press...

Don't know.... Is the left stick maybe working now in digital mode after setting paddle mode and back to digital ????
Pls. let me know

As i can send DS2 configuration information need to know what command might be activating your left stick in digital mode...

@venice1200
Copy link
Contributor Author

As far as I know, if the pad is not in analog mode, the sticks have no function at all.

@vossstef
Copy link
Owner

As far as I know, if the pad is not in analog mode, the sticks have no function at all.
will at least fix now that Rumblepad Keys are identical to DS2...

Think Dualshock2: Set ReplyProtocol command
https://psx-spx.consoledev.net/controllersandmemorycards/#controllers-analog-buttons-dualshock2
should allow to use Dpad and Sticks at the same time. analog XY data need to be converted into digital position with thresholds like in the µC fw. maybe i will find time to try out.

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 29, 2024

Found something similar, but Config Mode?!

Config Mode - Command 42h "B" - Read Buttons AND analog inputs

Same as command 42h in normal mode, but with forced analog response (ie. analog inputs and L3/R3 buttons are returned even in Digital Mode with LED=Off).

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 29, 2024

Hi @vossstef,
building the latest version, haven't chnaged the XML on the card.

HERO 2 Button
Immedialtly after starting HERO with DS#2 active the Analog Mode LED switched to on.
D-PAD works as expected, buttons OK (Circle & Cross), no Left Stick Movement.

Super Breakout
Breakout still doesn't work for me.
DS#2 Paddle alone doesn't activate the Analog Mode. Start & Select working.
But if I switch "Joyport 2" in the Menu to None and back to Mouse the Analog Mode is activated!?

trim.CE4A92CF-BAC1-4618-94E3-6BB164750D21.MOV

If the DS2 Pad is connected at startup the analog mode is also activated.
Maybe because of "Joyport 2" is set to Mouse by default?
Do I need to replace the XML with the one from the current build?

@vossstef
Copy link
Owner

@venice1200 XML can stay as before in this special branch.
I need over they day try to reproduce your findings.

@venice1200
Copy link
Contributor Author

No Hurry 😄

@vossstef
Copy link
Owner

vossstef commented Dec 29, 2024

@venice1200 i pushed corrections for TN20k and TM138k Pro.
USB Rumblepad keys are also fixed and shall be identical to DS2 now.

In order to find the problems had to use my 138k Pro where two DS2 Interfaces are wired... Hope my cable arriges over the next days to upgrade my misteryshield.

Pls. let me know how the updates does...

Big thanks already!
Think this will improve the core significantly and many small glitches in the input control fixed.

It's likely an interim state until i get DPad and left stick in digital mode to work at the same time but for that i will need more time.

@venice1200
Copy link
Contributor Author

Touchdown.

Super Breakout:
DS2 Analog Mode is correctly activated by choosing DS#2 Paddle as Joystick.
Movement using Left DS2 Analog Stick works fine.
Trigger 1 is Triangle/X
Rumblepad:
Buttons 9 & 10 for Select and Start, Trigger 1 is Button 4/X, Movement Ok.

2 Button Hero:
Rumblepad and DS2 Buttons are both using now Buttons A&B as Trigger Buttons.
Movement with DS2 uses the D-Pad.
Movement with Rumblepad can be switched from Left Stick (Mode LED off) to D-Pad (Mode LED on).
Select and Start are Ok.

Retro Stick not tested.

Side-Effect:
If you switch through the Joystick modes the game is restarted if DS#2 Paddle is chosen.

Great Work!

@vossstef
Copy link
Owner

vossstef commented Dec 30, 2024

A big thanks for all the effort in testing!

@venice1200
Copy link
Contributor Author

venice1200 commented Dec 30, 2024

You are welcome 😄

Some Ideas!
What do you think about a button configuration on SD?

A file were you can override the default setup and choose your preferred buttons for the Triggers.
I personally prefer the DS2 Buttons
Cross as Trigger 1
Square as Trigger 2

And please, if possible, add some keyboard keys for:
switching the difficulties
swap paddle direction

But these are things for the wishlist.

@vossstef
Copy link
Owner

vossstef commented Dec 30, 2024

@venice1200
i had to add a fix for USB Gamepads/ Joystick. It will mean 1st Trigger can be BTN_A or BTN_Y.
Also fixed the game restart if DS# Paddle is selected.
Release done and files stored.

@venice1200
Copy link
Contributor Author

Testing now...

@venice1200
Copy link
Contributor Author

Works fine as expected, no issues found.
Game restart via DS# Paddle is gone.

All the best for '25 🚀

@vossstef vossstef removed their assignment Jan 1, 2025
@venice1200
Copy link
Contributor Author

Happy New Year 🚀

@vossstef
Copy link
Owner

vossstef commented Jan 4, 2025

Happy New Year 🚀
Also a happy New year!
sorry didn't found time to look into the ds topic further yet.

@vossstef
Copy link
Owner

vossstef commented Jan 7, 2025

@venice1200 did you designed the PCBA in KiCAD ?
If so could you pls. share the symbol + footprint for the DS2 connector. Thx !

@venice1200
Copy link
Contributor Author

Hi @vossstef,
if everything is Ok with the breakout, i am still waiting for the PCBs, I would add the KiCad Project to the Adapter Documentation.

@vossstef
Copy link
Owner

vossstef commented Jan 7, 2025

@venice1200 i just need for larger CAD design the DS2 connector and wondering where to find this very special connector footprint...

@venice1200
Copy link
Contributor Author

I got the base connector layout from the MiSTers PSX Snac Adapter from here

https://github.com/blue212/SNAC-PSX/tree/main

I modified it a bit (changed numbering order and margins) for my needs.

I can upload my data not before Friday as i am not at home.
But the PCBs have arrived germany and I think i can get them before weekend.
And if the footprint matches i can upload my tiny project.

@venice1200
Copy link
Contributor Author

venice1200 commented Jan 11, 2025

Hi, Adapter is built and successful tested.
mistery_shield_ds2_adapter_build

I uploaded gerber and kicad files and opened an PR.
The Kicad Zip includes the fingerprint for the DS2 Connector.

The only problem is if you connect the connection cable to a normal pinheader at the MiStery Shield.
It works but there is normally not enough space.
IMG_1611

A 90 degrees pin header works much better.
IMG_1615

If you like I can provide you and Till with PCB's and PS2 Connectors.

@vossstef
Copy link
Owner

Hi @venice1200 , looks great and will merge now.
Many thanks !
I will reuse your DS2 foorprint to another PCBA design.
Your documentation will also re-use for the c64 core if you don't mind.

@venice1200
Copy link
Contributor Author

venice1200 commented Jan 12, 2025

Hi @vossstef

I will reuse your DS2 foorprint to another PCBA design.

The Pin footprint is Ok, but I think my "connector footprint" is a bit too small.

Your documentation will also re-use for the c64 core if you don't mind.

No Problem!
Maybe its enough to link it?

Cheers

@vossstef
Copy link
Owner

Hi @venice1200, i rearranged into a dedicated folder as there is another larger PCBA board coming in the future...
pls. create a pull if you want to change / correct something.
Thx !

@venice1200
Copy link
Contributor Author

Is the planned board for the Tang Nano?

@vossstef
Copy link
Owner

Is the planned board for the Tang Nano?

It will be a TN20k carrier for Pi Pico WLAN and include in addition a 5 port USB HUB and DS2 connector pads when MIDI i/o not needed.

@vossstef vossstef removed the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants