mirror of https://github.com/PCSX2/pcsx2.git
LilyPad: Add support for Pop'N Music Controller
This commit is contained in:
parent
f5d71352ca
commit
8c5c4608d2
|
@ -30,6 +30,14 @@
|
||||||
// Needed to know if raw input is available. It requires XP or higher.
|
// Needed to know if raw input is available. It requires XP or higher.
|
||||||
#include "RawInput.h"
|
#include "RawInput.h"
|
||||||
|
|
||||||
|
//max len 24 wchar_t
|
||||||
|
const wchar_t *padTypes[] = {
|
||||||
|
L"Unplugged",
|
||||||
|
L"Dualshock 2",
|
||||||
|
L"Guitar" ,
|
||||||
|
L"Pop'n Music controller"
|
||||||
|
};
|
||||||
|
|
||||||
// Hacks or configurations which PCSX2 needs with a specific value
|
// Hacks or configurations which PCSX2 needs with a specific value
|
||||||
void PCSX2_overrideConfig(GeneralConfig& config_in_out) {
|
void PCSX2_overrideConfig(GeneralConfig& config_in_out) {
|
||||||
config_in_out.disableScreenSaver = 0; // Not required - handled internally by PCSX2
|
config_in_out.disableScreenSaver = 0; // Not required - handled internally by PCSX2
|
||||||
|
@ -1710,10 +1718,13 @@ void UpdatePadPages() {
|
||||||
psp.pfnDlgProc = DialogProc;
|
psp.pfnDlgProc = DialogProc;
|
||||||
psp.lParam = port | (slot<<1);
|
psp.lParam = port | (slot<<1);
|
||||||
psp.pszTitle = title;
|
psp.pszTitle = title;
|
||||||
if (config.padConfigs[port][slot].type != GuitarPad)
|
if (config.padConfigs[port][slot].type == GuitarPad)
|
||||||
psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG);
|
|
||||||
else
|
|
||||||
psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG_GUITAR);
|
psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG_GUITAR);
|
||||||
|
else if (config.padConfigs[port][slot].type == PopnPad)
|
||||||
|
psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG_POPN);
|
||||||
|
else
|
||||||
|
psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFIG);
|
||||||
|
|
||||||
pages[count] = CreatePropertySheetPage(&psp);
|
pages[count] = CreatePropertySheetPage(&psp);
|
||||||
if (pages[count]) count++;
|
if (pages[count]) count++;
|
||||||
}
|
}
|
||||||
|
@ -1753,10 +1764,10 @@ void UpdatePadList(HWND hWnd) {
|
||||||
int slot;
|
int slot;
|
||||||
int port;
|
int port;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
wchar_t *padTypes[] = {L"Unplugged", L"Dualshock 2", L"Guitar"};
|
|
||||||
for (port=0; port<2; port++) {
|
for (port=0; port<2; port++) {
|
||||||
for (slot = 0; slot<4; slot++) {
|
for (slot = 0; slot<4; slot++) {
|
||||||
wchar_t text[20];
|
wchar_t text[25];
|
||||||
if (!GetPadString(text, port, slot)) continue;
|
if (!GetPadString(text, port, slot)) continue;
|
||||||
LVITEM item;
|
LVITEM item;
|
||||||
item.iItem = index;
|
item.iItem = index;
|
||||||
|
@ -1771,8 +1782,8 @@ void UpdatePadList(HWND hWnd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
item.iSubItem = 1;
|
item.iSubItem = 1;
|
||||||
if (2 < (unsigned int)config.padConfigs[port][slot].type) config.padConfigs[port][slot].type = Dualshock2Pad;
|
if (numPadTypes - 1 < (unsigned int)config.padConfigs[port][slot].type) config.padConfigs[port][slot].type = Dualshock2Pad;
|
||||||
item.pszText = padTypes[config.padConfigs[port][slot].type];
|
wcsncpy(item.pszText, padTypes[config.padConfigs[port][slot].type], 25);
|
||||||
//if (!slot && !config.padConfigs[port][slot].type)
|
//if (!slot && !config.padConfigs[port][slot].type)
|
||||||
// item.pszText = L"Unplugged (Kinda)";
|
// item.pszText = L"Unplugged (Kinda)";
|
||||||
|
|
||||||
|
@ -1833,9 +1844,9 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
|
||||||
selected = 0;
|
selected = 0;
|
||||||
ListView_SetExtendedListViewStyleEx(hWndList, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER);
|
ListView_SetExtendedListViewStyleEx(hWndList, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER);
|
||||||
SendMessage(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
|
SendMessage(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
|
||||||
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Unplugged");
|
for (int i = 0; i < numPadTypes; i++)
|
||||||
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Dualshock 2");
|
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) padTypes[i]);
|
||||||
SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Guitar");
|
|
||||||
|
|
||||||
if (ps2e) {
|
if (ps2e) {
|
||||||
// This disabled some widgets which are not required for PCSX2.
|
// This disabled some widgets which are not required for PCSX2.
|
||||||
|
|
|
@ -23,9 +23,13 @@ extern u8 ps2e;
|
||||||
enum PadType {
|
enum PadType {
|
||||||
DisabledPad,
|
DisabledPad,
|
||||||
Dualshock2Pad,
|
Dualshock2Pad,
|
||||||
GuitarPad
|
GuitarPad,
|
||||||
|
PopnPad
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int numPadTypes= 4;
|
||||||
|
extern const wchar_t *padTypes[numPadTypes];
|
||||||
|
|
||||||
struct PadConfig {
|
struct PadConfig {
|
||||||
PadType type;
|
PadType type;
|
||||||
u8 autoAnalog;
|
u8 autoAnalog;
|
||||||
|
|
|
@ -1212,6 +1212,11 @@ u8 CALLBACK PADpoll(u8 value) {
|
||||||
b1 -= ((sum->sticks[0].horiz > 0) << 5);
|
b1 -= ((sum->sticks[0].horiz > 0) << 5);
|
||||||
b1 -= ((sum->sticks[0].vert > 0) << 6);
|
b1 -= ((sum->sticks[0].vert > 0) << 6);
|
||||||
b1 -= ((sum->sticks[0].horiz < 0) << 7);
|
b1 -= ((sum->sticks[0].horiz < 0) << 7);
|
||||||
|
|
||||||
|
//Left, Right and Down are always pressed.
|
||||||
|
if (config.padConfigs[query.port][query.slot].type == PopnPad)
|
||||||
|
b1=b1 & 0x1f;
|
||||||
|
|
||||||
query.response[3] = b1;
|
query.response[3] = b1;
|
||||||
query.response[4] = b2;
|
query.response[4] = b2;
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,11 @@
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// English (U.S.) resources
|
// English (United States) resources
|
||||||
|
|
||||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
#ifdef _WIN32
|
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
#pragma code_page(1252)
|
#pragma code_page(1252)
|
||||||
#endif //_WIN32
|
|
||||||
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -138,6 +136,74 @@ BEGIN
|
||||||
PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,291,64,14
|
PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,291,64,14
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDD_CONFIG_POPN DIALOGEX 0, 0, 424, 318
|
||||||
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
|
||||||
|
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
CONTROL "",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_VSCROLL | WS_TABSTOP,7,7,183,285,WS_EX_CLIENTEDGE
|
||||||
|
PUSHBUTTON "Delete Selected",ID_DELETE,7,296,59,15
|
||||||
|
PUSHBUTTON "Clear All",ID_CLEAR,71,296,56,15
|
||||||
|
PUSHBUTTON "Ignore Key",ID_IGNORE,132,296,58,15
|
||||||
|
PUSHBUTTON "Select", ID_SELECT,262,22,43,15
|
||||||
|
PUSHBUTTON "Start", ID_START,306,22,43,15
|
||||||
|
PUSHBUTTON "White L",ID_TRIANGLE,196,66,43,15
|
||||||
|
PUSHBUTTON "Yellow L",ID_CIRCLE,218,48,43,15
|
||||||
|
PUSHBUTTON "Green L",ID_R1,240,66,43,15
|
||||||
|
PUSHBUTTON "Blue L",ID_CROSS,262,48,43,15
|
||||||
|
PUSHBUTTON "Red",ID_L1,284,66,43,15
|
||||||
|
PUSHBUTTON "Blue R",ID_SQUARE,306,48,43,15
|
||||||
|
PUSHBUTTON "Green R",ID_R2,328,66,43,15
|
||||||
|
PUSHBUTTON "Yellow R",ID_DPAD_UP,350,48,43,15
|
||||||
|
PUSHBUTTON "White R",ID_L2,372,66,43,15
|
||||||
|
GROUPBOX "",ID_FF,195,6,222,248
|
||||||
|
COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
|
CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17
|
||||||
|
CONTROL "Axis 1",IDC_FF_AXIS1_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,60,91,10
|
||||||
|
CONTROL "Flip",IDC_FF_AXIS1_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,60,35,10
|
||||||
|
EDITTEXT IDC_FF_AXIS1_SCALE,375,60,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
CONTROL "",IDC_FF_AXIS2,"msctls_trackbar32",WS_TABSTOP,199,76,214,17
|
||||||
|
CONTROL "Axis 2",IDC_FF_AXIS2_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,96,91,10
|
||||||
|
CONTROL "Flip",IDC_FF_AXIS2_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,96,35,10
|
||||||
|
EDITTEXT IDC_FF_AXIS2_SCALE,375,96,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
CONTROL "",IDC_FF_AXIS3,"msctls_trackbar32",WS_TABSTOP,199,112,214,17
|
||||||
|
CONTROL "Axis 3",IDC_FF_AXIS3_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,132,91,10
|
||||||
|
CONTROL "Flip",IDC_FF_AXIS3_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,132,35,10
|
||||||
|
EDITTEXT IDC_FF_AXIS3_SCALE,375,132,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
CONTROL "",IDC_FF_AXIS4,"msctls_trackbar32",WS_TABSTOP,199,148,214,17
|
||||||
|
CONTROL "Axis 4",IDC_FF_AXIS4_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,168,91,10
|
||||||
|
CONTROL "Flip",IDC_FF_AXIS4_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,168,35,10
|
||||||
|
EDITTEXT IDC_FF_AXIS4_SCALE,375,168,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
CONTROL "",IDC_FF_AXIS5,"msctls_trackbar32",WS_TABSTOP,199,184,214,17
|
||||||
|
CONTROL "Axis 5",IDC_FF_AXIS5_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,204,91,10
|
||||||
|
CONTROL "Flip",IDC_FF_AXIS5_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,204,35,10
|
||||||
|
EDITTEXT IDC_FF_AXIS5_SCALE,375,204,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
CONTROL "",IDC_FF_AXIS6,"msctls_trackbar32",WS_TABSTOP,199,220,214,17
|
||||||
|
CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,240,91,10
|
||||||
|
CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10
|
||||||
|
EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
PUSHBUTTON "Test",ID_TEST,196,260,59,15
|
||||||
|
PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15
|
||||||
|
GROUPBOX "Configure Binding",ID_SENSITIVITY,195,186,222,70
|
||||||
|
EDITTEXT IDC_AXIS_DEVICE1,202,199,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||||
|
COMBOBOX IDC_AXIS_DIRECTION,276,197,70,47,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
|
EDITTEXT IDC_AXIS_CONTROL1,349,199,65,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||||
|
LTEXT "Sensitivity",IDC_LABEL_SENSITIVITY,202,215,42,8
|
||||||
|
CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,225,34,10
|
||||||
|
CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,240,215,131,17
|
||||||
|
EDITTEXT IDC_AXIS_SENSITIVITY1,377,213,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,385,224,27,10
|
||||||
|
LTEXT "Dead Zone",IDC_LABEL_DEADZONE,202,240,42,8
|
||||||
|
CONTROL "",IDC_SLIDER_DEADZONE,"msctls_trackbar32",WS_TABSTOP,240,236,131,17
|
||||||
|
EDITTEXT IDC_AXIS_DEADZONE,377,239,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING
|
||||||
|
PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15
|
||||||
|
PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15
|
||||||
|
PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15
|
||||||
|
GROUPBOX "Add Force Feedback Effect",IDC_STATIC,262,260,155,51
|
||||||
|
COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
|
PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14
|
||||||
|
PUSHBUTTON "Small Motor",ID_SMALL_MOTOR,347,291,64,14
|
||||||
|
END
|
||||||
|
|
||||||
IDD_CONFIG_GUITAR DIALOGEX 0, 0, 424, 318
|
IDD_CONFIG_GUITAR DIALOGEX 0, 0, 424, 318
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||||
|
@ -293,6 +359,14 @@ BEGIN
|
||||||
BOTTOMMARGIN, 311
|
BOTTOMMARGIN, 311
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDD_CONFIG_POPN, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 417
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 311
|
||||||
|
END
|
||||||
|
|
||||||
IDD_CONFIG_GUITAR, DIALOG
|
IDD_CONFIG_GUITAR, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 7
|
LEFTMARGIN, 7
|
||||||
|
@ -327,13 +401,15 @@ BEGIN
|
||||||
END
|
END
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// DATA
|
// RCDATA
|
||||||
//
|
//
|
||||||
|
|
||||||
IDR_INI1 RCDATA "Default.ini"
|
IDR_INI1 RCDATA "Default.ini"
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Icon
|
// Icon
|
||||||
|
@ -342,7 +418,8 @@ IDR_INI1 RCDATA "Default.ini"
|
||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_FROG ICON "frog.ico"
|
IDI_FROG ICON "frog.ico"
|
||||||
#endif // English (U.S.) resources
|
|
||||||
|
#endif // English (United States) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
@ -356,4 +433,3 @@ IDI_FROG ICON "frog.ico"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#endif // not APSTUDIO_INVOKED
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#define IDC_ESCAPE_FULLSCREEN_HACK 109
|
#define IDC_ESCAPE_FULLSCREEN_HACK 109
|
||||||
#define IDD_DIAG 110
|
#define IDD_DIAG 110
|
||||||
#define IDR_INI1 111
|
#define IDR_INI1 111
|
||||||
|
#define IDD_CONFIG_POPN 112
|
||||||
#define IDC_CLOSE_HACK1 1099
|
#define IDC_CLOSE_HACK1 1099
|
||||||
#define IDC_KB_DISABLE 1100
|
#define IDC_KB_DISABLE 1100
|
||||||
#define IDC_KB_DI 1101
|
#define IDC_KB_DI 1101
|
||||||
|
@ -146,7 +147,7 @@
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 112
|
#define _APS_NEXT_RESOURCE_VALUE 113
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1133
|
#define _APS_NEXT_CONTROL_VALUE 1133
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
|
Loading…
Reference in New Issue