Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: Nixxou 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.
-
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.
#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;
}
-
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
-
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