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

[Feature Request]: Sammy Pachi Slot USB Descriptors #5339

Closed
seta-san opened this issue Jan 14, 2022 · 6 comments
Closed

[Feature Request]: Sammy Pachi Slot USB Descriptors #5339

seta-san opened this issue Jan 14, 2022 · 6 comments

Comments

@seta-san
Copy link
Contributor

Description

game mode
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0a7b
idProduct 0xd001
bcdDevice 1.00
iManufacturer 1 Sammy CORPORATION
iProduct 2 Sammy Pach-slot
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0022
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 400mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
** UNRECOGNIZED: 04 03 09 04

Reason

needed for
#4763

Examples

none

@seta-san
Copy link
Contributor Author

demo/attract mode.

Bus 001 Device 010: ID 0a7b:d001 Sammy CORPORATION Sammy Pach-slot
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0a7b
idProduct 0xd001
bcdDevice 1.00
iManufacturer 1 Sammy CORPORATION
iProduct 2 Sammy Pach-slot
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0022
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 400mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
** UNRECOGNIZED: 04 03 09 04

@F0bes F0bes added the USB label Jan 14, 2022
@seta-san seta-san changed the title [Feature Request]: Sammy Pachi Slot Uusb Descriptors [Feature Request]: Sammy Pachi Slot USB Descriptors Jan 15, 2022
@seta-san
Copy link
Contributor Author

seta-san commented Feb 2, 2022

https://www.youtube.com/watch?v=Q_AHdq1D3mE&ab_channel=Seta-San

there is a switch on the back to choose between "game" and "demo". Demo puts it into an attract mode i'm showing here.

@seta-san
Copy link
Contributor Author

this really shouldn't be emulated. unless you actually have the physical device it loses all of it's purpose in trying to simulate an a more authentic slot machine feel. i'm okay with this being given a won't fix label and closed.

@seta-san seta-san closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
@Florin9doi
Copy link
Contributor

Florin9doi commented Aug 18, 2024

Please try to find which command controls each LED using the following script. You'll need to update the path to libusb-1.0.dll and to load the WinUSB driver with Zadig.

leds.py

#!/usr/bin/env python

'''
LEDs:
 _______________________________________
|    (_)    B1[ ] B2[ ] B3[ ]    (_)    |
| L01 [ ]                       R01 [ ] |
| L02 [ ]                       R02 [ ] |
| L03 [ ]                       R03 [ ] |
| L04 [ ]                       R04 [ ] |
| L05 [ ]                       R05 [ ] |
| L06 [ ]                       R06 [ ] |
| L07 [ ]                       R07 [ ] |
| L08 [ ]                       R08 [ ] |
| L09 [ ]                       R09 [ ] |
| L10 [ ]                       R10 [ ] |
| L11 [ ]                       R11 [ ] |
| L12 [ ]                       R12 [ ] |
|_______________________________________|

Output:
step 1
bRequest = 01, wValue = 00, wIndex = 00: L1? L12? R1? R12?
bRequest = 02, wValue = 00, wIndex = 00: L2? L11? R2? R11?
bRequest = 04, wValue = 00, wIndex = 00: ...
bRequest = 08, wValue = 00, wIndex = 00: ...
bRequest = 10, wValue = 00, wIndex = 00: ...
bRequest = 20, wValue = 00, wIndex = 00: ...
bRequest = 40, wValue = 00, wIndex = 00: ...
bRequest = 80, wValue = 00, wIndex = 00: ...
step 2
bRequest = 00, wValue = 01, wIndex = 00: ...
bRequest = 00, wValue = 02, wIndex = 00: ...
bRequest = 00, wValue = 04, wIndex = 00: ...
bRequest = 00, wValue = 08, wIndex = 00: ...
bRequest = 00, wValue = 10, wIndex = 00: ...
bRequest = 00, wValue = 20, wIndex = 00: ...
bRequest = 00, wValue = 40, wIndex = 00: ...
bRequest = 00, wValue = 80, wIndex = 00: ...
step 3
bRequest = 00, wValue = 00, wIndex = 00: off
bRequest = 00, wValue = 00, wIndex = 01: B3_red?
bRequest = 00, wValue = 00, wIndex = 02: B3_blue?
bRequest = 00, wValue = 00, wIndex = 03: ?
bRequest = 00, wValue = 00, wIndex = 04: B2_red?
bRequest = 00, wValue = 00, wIndex = 05: B2_red/B3_red?
bRequest = 00, wValue = 00, wIndex = 06: B2_red/B3_blue?
bRequest = 00, wValue = 00, wIndex = 07: ?
bRequest = 00, wValue = 00, wIndex = 08: B2_blue?
bRequest = 00, wValue = 00, wIndex = 09: B2_blue/B3_red?
bRequest = 00, wValue = 00, wIndex = 0a: B2_blue/B3_blue?
bRequest = 00, wValue = 00, wIndex = 0b: ?
'''

try:
    import usb.core
    import usb.util
    import usb.backend.libusb1
except:
    raise("usb module not found : pip install pyusb")

backend = usb.backend.libusb1.get_backend(find_library=lambda x: "C:\\Users\\userX\\Desktop\\libusb-1.0.dll")

dev = usb.core.find(idVendor=0x0a7b, idProduct=0xd001)

if dev is None:
    raise ValueError('Device not found')

dev.set_configuration()

print(f"step 1")
for i in range(0, 8):
    req = 1 << i
    val = 0
    idx = 0
    dev.ctrl_transfer(bmRequestType = 0x40, bRequest = req, wValue = val, wIndex = idx)
    input(f"bRequest = {req:02x}, wValue = {val:02x}, wIndex = {idx:02x} - check the LEDs then press enter")

print(f"step 2")
for i in range(0, 8):
    req = 0
    val = 1 << i
    idx = 0
    dev.ctrl_transfer(bmRequestType = 0x40, bRequest = req, wValue = val, wIndex = idx)
    input(f"bRequest = {req:02x}, wValue = {val:02x}, wIndex = {idx:02x} - check the LEDs then press enter")

print(f"step 3")
for i in range(0, 12):
    req = 0
    val = 0
    idx = i
    dev.ctrl_transfer(bmRequestType = 0x40, bRequest = req, wValue = val, wIndex = idx)
    input(f"bRequest = {req:02x}, wValue = {val:02x}, wIndex = {idx:02x} - check the LEDs then press enter")

@seta-san
Copy link
Contributor Author

I don’t have the device anymore. I needed to sell it for money and space before my baby was born.

@Florin9doi
Copy link
Contributor

Florin9doi commented Aug 30, 2024

Fun fact: wTotalLength is wrongly configured 😂. For 1x config + 1x interface + 1x ep it should be 9+9+7=25. The difference of 9 is likely a missing HID descriptor they have removed after copy-pasting the config descriptor from a different device, without fixing wTotalLength 😂. As result, the request overflows and returns the first string: ** UNRECOGNIZED: 04 03 09 04. What a mess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants