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

Support PS3 Guitar Hero instruments (Guitar, Drums, Turntable) #28

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sanjay900
Copy link
Contributor

I maintain a project for letting people build their own guitar hero and rock band instruments from arduinos, and I have had a few people request that i support using them to play guitar hero on wii.

Currently I have tested guitar hero, and i will test drums and turntable later. I need to grab an actual ps3 guitar and test with that as well, to see if the tilt logic works there.

@sanjay900 sanjay900 marked this pull request as draft March 12, 2023 05:19
@sanjay900 sanjay900 changed the title WIP: Support PS3 Guitar Hero instruments (Guitar, Drums, Turntable) Support PS3 Guitar Hero instruments (Guitar, Drums, Turntable) Mar 12, 2023
@sanjay900
Copy link
Contributor Author

I also noted a couple of bugs and fixed them up here too, namely, vid and pid were swapped and there was an extra s.

@xerpi
Copy link
Owner

xerpi commented Mar 16, 2023

The code looks incredibly nice, thank you very much!
The MR is still a Draft, right?

By the way, do you mind creating a separate MR for the bug fixes so that we can land them immediately?

@sanjay900
Copy link
Contributor Author

sanjay900 commented Mar 16, 2023

Sure thing, ill get on that now. #29

Out of curiousity, do you know why a game needs to be restarted to pick the controller up? It seems like theres some sort code in here to detect new controllers being plugged into the wii, but that doesn't seem to be working?

Main reason this is in draft is i have not yet tested the turntable or drums, and i need to do some testing with an actual PS3 controller to work out if the tilt stuff works correctly or not, ill have to go find my old PS3 guitar pcbs, as i've put arduinos in most of my guitars.

I did also have some issues with my guitars just disconnecting in the middle of playing songs, and i'm not really sure what was causing that either

@xerpi
Copy link
Owner

xerpi commented Mar 16, 2023

Sure thing, ill get on that now. #29

Out of curiousity, do you know why a game needs to be restarted to pick the controller up? It seems like theres some sort code in here to detect new controllers being plugged into the wii, but that doesn't seem to be working?

Main reason this is in draft is i have not yet tested the turntable or drums, and i need to do some testing with an actual PS3 controller to work out if the tilt stuff works correctly or not, ill have to go find my old PS3 guitar pcbs, as i've put arduinos in most of my guitars.

I did also have some issues with my guitars just disconnecting in the middle of playing songs, and i'm not really sure what was causing that either

Are you trying with a PS3 controller? I think they have problems with reconnects.
IIRC it should work with PS4 controllers.

@sanjay900
Copy link
Contributor Author

sanjay900 commented Mar 16, 2023

Its my own controller, but it does emulate a PS3 controller. Any ideas why? I can implement things differently on my end if needed? I unfortunately don't own any PS4 controllers to test.

Also, have you got instructions for IOS58? I could only ever get IOS57 working myself.

@sanjay900
Copy link
Contributor Author

sanjay900 commented Mar 23, 2023

@xerpi
Is there an easy way to get the debug output from a wii, or do i need a gecko for that or something?
Never written any wii code before this lol

Ive also now grabbed myself a copy of DJ hero so ill test drums and dj soon hopefully and get things rolling

@xerpi
Copy link
Owner

xerpi commented Mar 23, 2023

A Gecko is by far the best way, especially when debugging from the ARM cores (like Fakemote).

@sanjay900
Copy link
Contributor Author

sanjay900 commented Mar 31, 2023

Interesting
Hotplug works with beta53 + IOS58, but then my games don't seem to start with IOS58

Ah now beta53 + IOS57 seems to be working, and has working hotplug!

@sanjay900
Copy link
Contributor Author

sanjay900 commented Mar 31, 2023

@xerpi can you think of anything that the Wii would be doing differently between the standard Wii menu and a Wii menu using ios57+fakemote? For some odd reason, my Arduino guitars work wonderfully but with fakemote loaded, an official guitar adapter seems to lock up and it's LEDs stop blinking, while without fakemote loaded it doesn't do this. can you think of any requests that might be being sent differently when fakemote is loaded (I even tried commenting out all the PS3 specific controll requests to no avail)

The only real difference i can think of is internally the real adapters use a usb hub while my stuff is direct but i then tried using my stuff through a hub and that still seemed to work.

@EddietheTroopers
Copy link

I have a PS3 guitar, but i not have the dongle, how can i makes that?

@sanjay900
Copy link
Contributor Author

sanjay900 commented May 25, 2023

I have a PS3 guitar, but i not have the dongle, how can i makes that?

@EddietheTroopers
https://sanjay900.github.io/guitar-configurator/guides/direct.html
if you follow this, you can convert your PS3 guitar into a wired one.
You can pick modes to have it emulate PS3 or wii RB guitars, and if you put it in PS3 mode then you can use it with this.
You can also use it on PS2 as well, using OPL

@xerpi
Copy link
Owner

xerpi commented Oct 14, 2023

Do you mind doing a rebase over main?

@sanjay900
Copy link
Contributor Author

Yeah, i can do in a moment, i was just playing around with some ideas on how to potentially get actual instruments working, so ill rebase after i finish that

@sanjay900
Copy link
Contributor Author

sanjay900 commented Oct 14, 2023

Would it be difficult to support hid4? It seems that the guitar hero and rock band instruments actually initialize with IOS56, and the rock band games did use IOS56.

@xerpi
Copy link
Owner

xerpi commented Oct 14, 2023

Yeah, i can do in a moment, i was just playing around with some ideas on how to potentially get actual instruments working, so ill rebase after i finish that

Ok, perfect!

I was also thinking about splitting the ds3, drum, guitar, etc drivers into different files, and maybe put all the USB drivers into a separate directory, something like:

  • usb_drivers/
    • sony_ds3.c
    • sony_ds4.c
    • sony_gh_guitar.c

@sanjay900
Copy link
Contributor Author

That seems like a good idea, i can do that after rebasing.

@xerpi
Copy link
Owner

xerpi commented Oct 14, 2023

Would it be difficult to support hid4? It seems that the guitar hero and rock band instruments actually initialize with IOS56, and the rock band games did use IOS56.

I think it should be possible. Then at runtime we can detect the IOS and use hid v4 or hid v5 accordingly.

@sanjay900
Copy link
Contributor Author

Would it be difficult to support hid4? It seems that the guitar hero and rock band instruments actually initialize with IOS56, and the rock band games did use IOS56.

I think it should be possible. Then at runtime we can detect the IOS and use hid v4 or hid v5 accordingly.

I don't even think you have to do that, i think you can just rely on the GETVERSION IOCTL

@sanjay900
Copy link
Contributor Author

sanjay900 commented Oct 15, 2023

Yeah, i can do in a moment, i was just playing around with some ideas on how to potentially get actual instruments working, so ill rebase after i finish that

Ok, perfect!

I was also thinking about splitting the ds3, drum, guitar, etc drivers into different files, and maybe put all the USB drivers into a separate directory, something like:

* `usb_drivers/`
  
  * `sony_ds3.c`
  * `sony_ds4.c`
  * `sony_gh_guitar.c`

Alright, i've rebased, and split the drivers into separate files.

I've also implemented HIDv4 as well, though i suspect there might be better ways to implement some bits of it, I just was struggling to wrap my head around the way HIDv4 uses virtual pointers, and without a USB gecko I couldn't really easily debug it. I can confirm however that with HIDv4 (and IOS56), the official guitar hero controller does actually work now.

@xerpi
Copy link
Owner

xerpi commented Oct 15, 2023

Yeah, i can do in a moment, i was just playing around with some ideas on how to potentially get actual instruments working, so ill rebase after i finish that

Ok, perfect!
I was also thinking about splitting the ds3, drum, guitar, etc drivers into different files, and maybe put all the USB drivers into a separate directory, something like:

* `usb_drivers/`
  
  * `sony_ds3.c`
  * `sony_ds4.c`
  * `sony_gh_guitar.c`

Alright, i've rebased, and split the drivers into separate files.

I've also implemented HIDv4 as well, though i suspect there might be better ways to implement some bits of it, I just was struggling to wrap my head around the way HIDv4 uses virtual pointers, and without a USB gecko I couldn't really easily debug it. I can confirm however that with HIDv4 (and IOS56), the official guitar hero controller does actually work now.

Looks pretty good overall!
What's the problem with virtual pointers? I see that you had to use a global buffer v4_data instead of passing device->usb_async_resp directly.

@sanjay900
Copy link
Contributor Author

Yeah, i can do in a moment, i was just playing around with some ideas on how to potentially get actual instruments working, so ill rebase after i finish that

Ok, perfect!
I was also thinking about splitting the ds3, drum, guitar, etc drivers into different files, and maybe put all the USB drivers into a separate directory, something like:

* `usb_drivers/`
  
  * `sony_ds3.c`
  * `sony_ds4.c`
  * `sony_gh_guitar.c`

Alright, i've rebased, and split the drivers into separate files.
I've also implemented HIDv4 as well, though i suspect there might be better ways to implement some bits of it, I just was struggling to wrap my head around the way HIDv4 uses virtual pointers, and without a USB gecko I couldn't really easily debug it. I can confirm however that with HIDv4 (and IOS56), the official guitar hero controller does actually work now.

Looks pretty good overall! What's the problem with virtual pointers? I see that you had to use a global buffer v4_data instead of passing device->usb_async_resp directly.

Yeah it just wasn't working until I made that change, Ive got not idea why. Would you have any ideas as to why that was necessary?

@xerpi
Copy link
Owner

xerpi commented Oct 15, 2023

Yeah, i can do in a moment, i was just playing around with some ideas on how to potentially get actual instruments working, so ill rebase after i finish that

Ok, perfect!
I was also thinking about splitting the ds3, drum, guitar, etc drivers into different files, and maybe put all the USB drivers into a separate directory, something like:

* `usb_drivers/`
  
  * `sony_ds3.c`
  * `sony_ds4.c`
  * `sony_gh_guitar.c`

Alright, i've rebased, and split the drivers into separate files.
I've also implemented HIDv4 as well, though i suspect there might be better ways to implement some bits of it, I just was struggling to wrap my head around the way HIDv4 uses virtual pointers, and without a USB gecko I couldn't really easily debug it. I can confirm however that with HIDv4 (and IOS56), the official guitar hero controller does actually work now.

Looks pretty good overall! What's the problem with virtual pointers? I see that you had to use a global buffer v4_data instead of passing device->usb_async_resp directly.

Yeah it just wasn't working until I made that change, Ive got not idea why. Would you have any ideas as to why that was necessary?

I thought it might be the alignment, but usb_async_resp is properly aligned to 32 bytes: https://github.com/xerpi/fakemote/blob/main/include/usb_hid.h#L30
Btw I have added you on Discord.

@xerpi xerpi force-pushed the main branch 15 times, most recently from 368515c to bc9588e Compare October 20, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants