mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
nJoy:
- Added some kind of rumble support (windows only, using direct input). - Only usable for player one. - Not customizable, fixed rumble strength. - Due to some Dolphin bugs you need to initialize rumble support manually. How to use: - Disable the 'render to main window' in the video plugin (opengl or d3d). - Start the game and wait a few seconds. - When the game is running, press the 'half press' button once. - Rumble support should now be enabled (if your joypad supports it). - Confirmed to work with Crazy Taxi. Dolphin bug: When void PAD_Initialize(SPADInitialize _PADInitialize) is called, the render window does not excist yet. Therefor the value _PADInitialize.hWnd is incorrect. In order to initalize rumble support, it is required to set the CooperativeLevel to "DISCL_EXCLUSIVE | DISCL_FOREGROUND". But without a proper hWnd this will fail. So the trick I used here is, let the game start and create a window (and a hWnd). After that I set the CooperativeLevel. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@126 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -34,9 +34,11 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <tchar.h>
|
||||
#include <math.h>
|
||||
#include <dinput.h> // used for rumble
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
@ -65,6 +67,11 @@
|
||||
#ifdef _WIN32
|
||||
#pragma comment(lib, "SDL.lib")
|
||||
#pragma comment(lib, "comctl32.lib")
|
||||
|
||||
// Required for the rumble part
|
||||
#pragma comment(lib, "dxguid.lib")
|
||||
#pragma comment(lib, "dinput8.lib")
|
||||
#pragma comment(lib, "winmm.lib")
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -78,6 +85,14 @@
|
||||
#define RELYEAR "2008"
|
||||
#define THANKYOU "`plot`, Absolute0, Aprentice, Bositman, Brice, ChaosCode, CKemu, CoDeX, Dave2001, dn, drk||Raziel, Florin, Gent, Gigaherz, Hacktarux, JegHegy, Linker, Linuzappz, Martin64, Muad, Knuckles, Raziel, Refraction, Rudy_x, Shadowprince, Snake785, Saqib, vEX, yaz0r, Zilmar, Zenogais and ZeZu."
|
||||
|
||||
#ifdef _WIN32
|
||||
// Rumble stuff :D!
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Structures
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
struct CONTROLLER_STATE{ // GC PAD INFO/STATE
|
||||
int buttons[8]; // Amount of buttons (A B X Y Z, L-Trigger R-Trigger Start) might need to change the triggers buttons
|
||||
int dpad; // 1 HAT (8 directions + neutral)
|
||||
@ -143,6 +158,7 @@ enum
|
||||
CTL_D_PAD_LEFT,
|
||||
CTL_D_PAD_RIGHT
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Custom Functions
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
Reference in New Issue
Block a user