Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: MameHooker does not show any devices  (Read 903 times)

0 Members and 1 Guest are viewing this topic.

Nixxou

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:Today at 02:38:15 pm
  • I want to build my own arcade controls!
MameHooker does not show any devices
« on: January 11, 2024, 05:16:10 am »
Hi. I got an issue with MameHooker, when i do "Show supported devices" it show an empty list :
Force Feedback Devices
-------------------------

I tested with both my FFB Wheel (a Thrustmaster TX) and a wired xbox 360 controller.
If i go to Test and try to make my xinput device vibrate, it works.


Also, i'm wondering, on the about page, i read : "Mame Hooker is Part of the Mame InterOp Project and is Open-source for personal use."
Where can i find the source ? I don't see it anywhere.
I would like to try to modify the program to make it works with my Siden gun.

Nixxou

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:Today at 02:38:15 pm
  • I want to build my own arcade controls!
Re: MameHooker does not show any devices
« Reply #1 on: January 15, 2024, 01:10:39 am »
Ok, so without other options, i got an idea to make some custom action, i can alter the PacDrive dll to, instead of  it's original design, send udp command on the PacSetLEDState.
Better than nothing i guess, but i would still be interested to get a look and understand why the app fail to list my controller devices.

Code: [Select]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>

typedef struct {
SOCKET sockfd;
struct sockaddr_in broadcast_addr;
} UdpBroadcastSocket;

UdpBroadcastSocket udpSocket;

int initUdpBroadcastSocket(UdpBroadcastSocket* udpSocket, const char* broadcastAddress, int port) {
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
perror("Erreur lors de l'initialisation de Winsock");
return -1;
}

udpSocket->sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (udpSocket->sockfd == INVALID_SOCKET) {
perror("Erreur lors de la création de la socket");
WSACleanup();
return -1;
}

memset(&udpSocket->broadcast_addr, 0, sizeof(udpSocket->broadcast_addr));
udpSocket->broadcast_addr.sin_family = AF_INET;
udpSocket->broadcast_addr.sin_port = htons(port);

// Utilisation de inet_addr pour convertir l'adresse IP
udpSocket->broadcast_addr.sin_addr.s_addr = inet_addr(broadcastAddress);
if (udpSocket->broadcast_addr.sin_addr.s_addr == INADDR_NONE) {
perror("Adresse IP incorrecte");
closesocket(udpSocket->sockfd);
WSACleanup();
return -1;
}

return 0;
}

int sendUdpBroadcastData(UdpBroadcastSocket* udpSocket, const void* data, size_t dataSize) {
if (sendto(udpSocket->sockfd, (const char*)data, (int)dataSize, 0, (struct sockaddr*)&udpSocket->broadcast_addr, sizeof(udpSocket->broadcast_addr)) == SOCKET_ERROR) {
perror("Erreur lors de l'envoi des données en broadcast");
return -1;
}

return 0;
}

void closeUdpBroadcastSocket(UdpBroadcastSocket* udpSocket) {
closesocket(udpSocket->sockfd);
WSACleanup();
}

PACDRIVE_API INT __stdcall PacInitialize()
{
struct _GUID hidGuid;
SP_DEVICE_INTERFACE_DATA deviceInterfaceData;
struct { DWORD cbSize; WCHAR DevicePath[256]; } FunctionClassDeviceData;
INT success;
DWORD hidDevice;
HANDLE pnPHandle;
ULONG bytesReturned;
DWORD dwThrdParam = 1;

const char* nomFichier = "test.txt";
FILE* fichier = fopen(nomFichier, "w");
if (fichier != NULL) {
fprintf(fichier, "%s\n", "PacInitialize");
fclose(fichier);
}


if (initUdpBroadcastSocket(&udpSocket, "127.0.0.1", 12345) == -1) {
return EXIT_FAILURE;
}


return 1;
}

PACDRIVE_API BOOL __stdcall PacSetLEDState(INT id, INT port, BOOL state)
{
/*
const char* nomFichier = "test.txt";
FILE* fichier = fopen(nomFichier, "w");
if (fichier != NULL) {
fprintf(fichier, "%s : %d %d %d\n", "PacSetLEDState Final", id, port, (int)state);
fclose(fichier);
}
*/

int value = port;
sendUdpBroadcastData(&udpSocket, &value, sizeof(value));


return true;
}


Nixxou

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:Today at 02:38:15 pm
  • I want to build my own arcade controls!
Re: MameHooker does not show any devices
« Reply #2 on: March 12, 2024, 01:57:01 pm »
Well, no answer ? Anyone.

Meanwhile, if you need to make Mamehooker outputs works with your Sinden gun, you can use that :
https://github.com/nixxou/PacDriveSDK/releases/tag/V0.1

Lousky2

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:Yesterday at 05:05:16 pm
  • I want to build my own arcade controls!
Re: MameHooker does not show any devices
« Reply #3 on: April 02, 2024, 05:30:17 pm »
Hi Nixxou,

I have the solution (I think) because a had the same problem with my Xbox 360 pad, in my case, i need to add a DLL for resolved this.

You need to add dx8vb.dll, but for this you need to follow this tutorial :

4.)  You require 'dx8vb.dll' which is the direct X 8 library. This is included in the DXNT.CAB file. IF you google 'DirectX End-User Runtimes' and grab those packages, it should be included. Once you have this zip file, unzip it somewhere. My mistake was dragging the .dlls into the system 32 folder on my windows 7 machine. When I restarted days later I had corrupt drivers and couldn't boot back into my machine until I swapped harddrives and removed them. Don't let that scare you. you can simply install them outside of system 32 folder.
- Open the start menu
- Search for powershell and open it. should be blue command window
- Type in these commands:
cd yourfolder\dxnt
regsvr32 "dx8vb.dll"

source : https://forum.arcadecontrols.com/index.php/topic,130784.msg1696325.html#msg1696325