slot2:
- added new games to auto-selection list; winport: - added customizing the keys for Taito Paddle Controller; - now don't need reset DS when you change the slot2 device;
This commit is contained in:
parent
a57bf33472
commit
b4e1286dd3
|
@ -2743,14 +2743,6 @@ static void NDS_applyFinalInput()
|
|||
((input.buttons.X ? 1 : 0) << 3)|
|
||||
((input.buttons.W ? 1 : 0) << 2)|
|
||||
((input.buttons.E ? 1 : 0) << 1);
|
||||
|
||||
//these values are arbitrarily chosen to make arkanoid paddle control act similarly to its dpad controls
|
||||
if(input.buttons.R)
|
||||
nds.paddle += 5;
|
||||
else if(input.buttons.L)
|
||||
nds.paddle -= 5;
|
||||
|
||||
// TODO: low power IRQ
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,6 +63,12 @@ public:
|
|||
if ((memcmp(gameInfo.header.gameCode, "BEP", 3) == 0)) selection = NDS_SLOT2_EASYPIANO; // Easy Piano (EUR)(USA)
|
||||
else
|
||||
if ((memcmp(gameInfo.header.gameCode, "YAA", 3) == 0)) selection = NDS_SLOT2_PADDLE; // Arkanoid DS
|
||||
else
|
||||
if ((memcmp(gameInfo.header.gameCode, "CB6", 3) == 0)) selection = NDS_SLOT2_PADDLE; // Space Bust-A-Move
|
||||
else
|
||||
if ((memcmp(gameInfo.header.gameCode, "YXX", 3) == 0)) selection = NDS_SLOT2_PADDLE; // Space Invaders Extreme
|
||||
else
|
||||
if ((memcmp(gameInfo.header.gameCode, "CV8", 3) == 0)) selection = NDS_SLOT2_PADDLE; // Space Invaders Extreme 2
|
||||
else
|
||||
if (gameInfo.isHomebrew())
|
||||
selection = NDS_SLOT2_PASSME;
|
||||
|
|
|
@ -56,14 +56,14 @@ private:
|
|||
public:
|
||||
virtual Slot2Info const* info()
|
||||
{
|
||||
static Slot2InfoSimple info("Paddle", "Paddle", 0x07);
|
||||
static Slot2InfoSimple info("Paddle Controller", "Taito Paddle Controller", 0x07);
|
||||
return &info;
|
||||
}
|
||||
|
||||
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val)
|
||||
{
|
||||
if (addr < 0x0A000000) return; // ???
|
||||
calibrate();
|
||||
if (addr < 0x0A000000)
|
||||
calibrate();
|
||||
}
|
||||
virtual void writeWord(u8 PROCNUM, u32 addr, u16 val)
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ public:
|
|||
|
||||
virtual u8 readByte(u8 PROCNUM, u32 addr)
|
||||
{
|
||||
//printf("paddle: read 08 at 0x%08X\n", adr);
|
||||
//printf("paddle: read 08 at 0x%08X\n", addr);
|
||||
if (!Validate(PROCNUM, (addr < 0x0A000000)))
|
||||
return 0xFF;
|
||||
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
}
|
||||
virtual u16 readWord(u8 PROCNUM, u32 addr)
|
||||
{
|
||||
//printf("paddle : read 16 at 0x%08X\n", adr);
|
||||
//printf("paddle: read 16 at 0x%08X\n", addr);
|
||||
if (!Validate(PROCNUM, (addr < 0x0A000000)))
|
||||
return 0xFFFF;
|
||||
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
}
|
||||
virtual u32 readLong(u8 PROCNUM, u32 addr)
|
||||
{
|
||||
//printf("paddle: read 32 at 0x%08X\n", adr);
|
||||
//printf("paddle: read 32 at 0x%08X\n", addr);
|
||||
if (!Validate(PROCNUM, (addr < 0x0A000000)))
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ HWND OKbutton = NULL;
|
|||
bool _OKbutton = false;
|
||||
SGuitar tmp_Guitar;
|
||||
SPiano tmp_Piano;
|
||||
bool needReset = true;
|
||||
SPaddle tmp_Paddle;
|
||||
|
||||
//these are the remembered preset values for directory and filename
|
||||
//they are named very verbosely to distinguish them from the currently-configured values in addons.cpp
|
||||
|
@ -217,13 +217,43 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
|
|||
|
||||
INT_PTR CALLBACK GbaSlotPaddle(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
|
||||
{
|
||||
int which = 0;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
_OKbutton = TRUE;
|
||||
SendDlgItemMessage(dialog,IDC_PINC,WM_USER+44,tmp_Paddle.INC,0);
|
||||
SendDlgItemMessage(dialog,IDC_PDEC,WM_USER+44,tmp_Paddle.DEC,0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_USER+46:
|
||||
SendDlgItemMessage(dialog,IDC_PINC,WM_USER+44,tmp_Paddle.INC,0);
|
||||
SendDlgItemMessage(dialog,IDC_PDEC,WM_USER+44,tmp_Paddle.DEC,0);
|
||||
return TRUE;
|
||||
|
||||
case WM_USER+43:
|
||||
//MessageBox(hDlg,"USER+43 CAUGHT","moo",MB_OK);
|
||||
which = GetDlgCtrlID((HWND)lparam);
|
||||
switch(which)
|
||||
{
|
||||
case IDC_PINC:
|
||||
tmp_Paddle.INC = wparam;
|
||||
|
||||
break;
|
||||
case IDC_PDEC:
|
||||
tmp_Paddle.DEC = wparam;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
SendDlgItemMessage(dialog,IDC_PINC,WM_USER+44,tmp_Paddle.INC,0);
|
||||
SendDlgItemMessage(dialog,IDC_PDEC,WM_USER+44,tmp_Paddle.DEC,0);
|
||||
PostMessage(dialog,WM_NEXTDLGCTL,0,0);
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -307,10 +337,6 @@ INT_PTR CALLBACK GbaSlotGuitarGrip(HWND dialog, UINT msg,WPARAM wparam,LPARAM lp
|
|||
SendDlgItemMessage(dialog,IDC_GRED,WM_USER+44,tmp_Guitar.RED,0);
|
||||
SendDlgItemMessage(dialog,IDC_GYELLOW,WM_USER+44,tmp_Guitar.YELLOW,0);
|
||||
SendDlgItemMessage(dialog,IDC_GBLUE,WM_USER+44,tmp_Guitar.BLUE,0);
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -376,10 +402,6 @@ INT_PTR CALLBACK GbaSlotPiano(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
|
|||
SendDlgItemMessage(dialog,IDC_PIANO_AS,WM_USER+44,tmp_Piano.AS,0);
|
||||
SendDlgItemMessage(dialog,IDC_PIANO_B,WM_USER+44,tmp_Piano.B,0);
|
||||
SendDlgItemMessage(dialog,IDC_PIANO_HIC,WM_USER+44,tmp_Piano.HIC,0);
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -449,7 +471,7 @@ u32 GBAslot_IDDs[NDS_SLOT2_COUNT] = {
|
|||
IDD_GBASLOT_GUITARGRIP,
|
||||
IDD_GBASLOT_NONE, //expmem
|
||||
IDD_GBASLOT_PIANO,
|
||||
IDD_GBASLOT_NONE, //paddle
|
||||
IDD_GBASLOT_PADDLE, //paddle
|
||||
IDD_GBASLOT_NONE, //PassME
|
||||
};
|
||||
|
||||
|
@ -496,18 +518,8 @@ BOOL CALLBACK GbaSlotBox_Proc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
|
|||
{
|
||||
case IDOK:
|
||||
{
|
||||
int Msg = IDYES;
|
||||
if (romloaded && (needReset || (temp_type!=slot2_GetCurrentType())) )
|
||||
{
|
||||
Msg = MessageBox(dialog,
|
||||
"After change GBA slot pak game will reset!\nAre you sure to continue?", "DeSmuME",
|
||||
MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2);
|
||||
}
|
||||
if (Msg == IDYES)
|
||||
{
|
||||
if (wndConfig) DestroyWindow(wndConfig);
|
||||
EndDialog(dialog, TRUE);
|
||||
}
|
||||
if (wndConfig) DestroyWindow(wndConfig);
|
||||
EndDialog(dialog, TRUE);
|
||||
}
|
||||
return TRUE;
|
||||
case IDCANCEL:
|
||||
|
@ -551,9 +563,9 @@ void GBAslotDialog(HWND hwnd)
|
|||
strcpy(tmp_gbagame_filename, GBAgameName);
|
||||
memcpy(&tmp_Guitar, &Guitar, sizeof(Guitar));
|
||||
memcpy(&tmp_Piano, &Piano, sizeof(Piano));
|
||||
memcpy(&tmp_Paddle, &Paddle, sizeof(Paddle));
|
||||
tmp_CFlashMode = CFlash_Mode;
|
||||
_OKbutton = false;
|
||||
needReset = true;
|
||||
|
||||
u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_GBASLOT), hwnd, (DLGPROC) GbaSlotBox_Proc);
|
||||
if (res)
|
||||
|
@ -561,14 +573,9 @@ void GBAslotDialog(HWND hwnd)
|
|||
switch (temp_type)
|
||||
{
|
||||
case NDS_SLOT2_NONE:
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
break;
|
||||
|
||||
case NDS_SLOT2_AUTO:
|
||||
needReset = false;
|
||||
break;
|
||||
|
||||
case NDS_SLOT2_CFLASH:
|
||||
|
@ -581,41 +588,27 @@ void GBAslotDialog(HWND hwnd)
|
|||
WritePrivateProfileString("Slot2.CFlash","filename",tmp_cflash_filename,IniName);
|
||||
|
||||
WIN_InstallCFlash();
|
||||
|
||||
needReset = true;
|
||||
break;
|
||||
case NDS_SLOT2_RUMBLEPAK:
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
break;
|
||||
case NDS_SLOT2_PADDLE:
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
memcpy(&Paddle, &tmp_Paddle, sizeof(tmp_Paddle));
|
||||
WritePrivateProfileInt("Slot2.Paddle","DEC",Paddle.DEC,IniName);
|
||||
WritePrivateProfileInt("Slot2.Paddle","INC",Paddle.INC,IniName);
|
||||
break;
|
||||
case NDS_SLOT2_GBACART:
|
||||
strcpy(GBAgameName, tmp_gbagame_filename);
|
||||
WritePrivateProfileString("Slot2.GBAgame","filename",GBAgameName,IniName);
|
||||
needReset = true;
|
||||
break;
|
||||
case NDS_SLOT2_GUITARGRIP:
|
||||
memcpy(&Guitar, &tmp_Guitar, sizeof(tmp_Guitar));
|
||||
Guitar.Enabled = true;
|
||||
WritePrivateProfileInt("Slot2.GuitarGrip","green",Guitar.GREEN,IniName);
|
||||
WritePrivateProfileInt("Slot2.GuitarGrip","red",Guitar.RED,IniName);
|
||||
WritePrivateProfileInt("Slot2.GuitarGrip","yellow",Guitar.YELLOW,IniName);
|
||||
WritePrivateProfileInt("Slot2.GuitarGrip","blue",Guitar.BLUE,IniName);
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
break;
|
||||
case NDS_SLOT2_EASYPIANO:
|
||||
memcpy(&Piano, &tmp_Piano, sizeof(tmp_Piano));
|
||||
Piano.Enabled = true;
|
||||
WritePrivateProfileInt("Slot2.Piano","C",Piano.C,IniName);
|
||||
WritePrivateProfileInt("Slot2.Piano","CS",Piano.CS,IniName);
|
||||
WritePrivateProfileInt("Slot2.Piano","D",Piano.D,IniName);
|
||||
|
@ -629,10 +622,6 @@ void GBAslotDialog(HWND hwnd)
|
|||
WritePrivateProfileInt("Slot2.Piano","AS",Piano.AS,IniName);
|
||||
WritePrivateProfileInt("Slot2.Piano","B",Piano.B,IniName);
|
||||
WritePrivateProfileInt("Slot2.Piano","HIC",Piano.HIC,IniName);
|
||||
if (temp_type != slot2_GetCurrentType())
|
||||
needReset = true;
|
||||
else
|
||||
needReset = false;
|
||||
break;
|
||||
case NDS_SLOT2_EXPMEMORY:
|
||||
break;
|
||||
|
@ -641,17 +630,14 @@ void GBAslotDialog(HWND hwnd)
|
|||
default:
|
||||
return;
|
||||
}
|
||||
if (temp_type != NDS_SLOT2_GUITARGRIP)
|
||||
Guitar.Enabled = false;
|
||||
if (temp_type != NDS_SLOT2_EASYPIANO)
|
||||
Piano.Enabled = false;
|
||||
|
||||
slot2_Change((NDS_SLOT2_TYPE)temp_type);
|
||||
|
||||
WritePrivateProfileInt("Slot2", "id", slot2_List[(u8)slot2_GetCurrentType()]->info()->id(), IniName);
|
||||
|
||||
if (romloaded && needReset)
|
||||
NDS_Reset();
|
||||
return;
|
||||
|
||||
Guitar.Enabled = (slot2_GetCurrentType() == NDS_SLOT2_GUITARGRIP)?true:false;
|
||||
Piano.Enabled = (slot2_GetCurrentType() == NDS_SLOT2_EASYPIANO)?true:false;
|
||||
Paddle.Enabled = (slot2_GetCurrentType() == NDS_SLOT2_PADDLE)?true:false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -211,10 +211,12 @@
|
|||
static TCHAR szClassName[] = _T("InputCustom");
|
||||
static TCHAR szHotkeysClassName[] = _T("InputCustomHot");
|
||||
static TCHAR szGuitarClassName[] = _T("InputCustomGuitar");
|
||||
static TCHAR szPaddleClassName[] = _T("InputCustomPaddle");
|
||||
|
||||
static LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK HotInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK GuitarInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK PaddleInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
SJoyState Joystick [16];
|
||||
SJoyState JoystickF [16];
|
||||
|
@ -259,6 +261,9 @@ SGuitar DefaultGuitar = { false, 'E', 'R', 'T', 'Y' };
|
|||
SPiano Piano;
|
||||
SPiano DefaultPiano = { false, 'Z', 'S', 'X', 'D', 'C', 'V', 'G', 'B', 'H', 'N', 'J', 'M', VK_OEM_COMMA };
|
||||
|
||||
SPaddle Paddle;
|
||||
SPaddle DefaultPaddle = { false, 'K', 'L' };
|
||||
|
||||
bool allowUpAndDown = false;
|
||||
bool allowBackgroundInput = false;
|
||||
|
||||
|
@ -380,6 +385,15 @@ static void ReadPianoControl(const char* name, WORD& output)
|
|||
}
|
||||
}
|
||||
|
||||
static void ReadPaddleControl(const char* name, WORD& output)
|
||||
{
|
||||
UINT temp;
|
||||
temp = GetPrivateProfileInt("Slot2.Paddle",name,-1,IniName);
|
||||
if(temp != -1) {
|
||||
output = temp;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadHotkeyConfig()
|
||||
{
|
||||
SCustomKey *key = &CustomKeys.key(0);
|
||||
|
@ -434,6 +448,14 @@ static void LoadPianoConfig()
|
|||
#undef DO
|
||||
}
|
||||
|
||||
static void LoadPaddleConfig()
|
||||
{
|
||||
memcpy(&Paddle, &DefaultPaddle, sizeof(Paddle));
|
||||
|
||||
ReadPaddleControl("DEC", Paddle.DEC);
|
||||
ReadPaddleControl("INC", Paddle.INC);
|
||||
}
|
||||
|
||||
|
||||
static void LoadInputConfig()
|
||||
{
|
||||
|
@ -1258,6 +1280,22 @@ static void InitCustomControls()
|
|||
wc.hIconSm = 0;
|
||||
|
||||
|
||||
RegisterClassEx(&wc);
|
||||
|
||||
wc.cbSize = sizeof(wc);
|
||||
wc.lpszClassName = szPaddleClassName;
|
||||
wc.hInstance = GetModuleHandle(0);
|
||||
wc.lpfnWndProc = PaddleInputCustomWndProc;
|
||||
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wc.hIcon = 0;
|
||||
wc.lpszMenuName = 0;
|
||||
wc.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
|
||||
wc.style = 0;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = sizeof(InputCust *);
|
||||
wc.hIconSm = 0;
|
||||
|
||||
|
||||
RegisterClassEx(&wc);
|
||||
}
|
||||
|
||||
|
@ -1602,6 +1640,148 @@ static LRESULT CALLBACK GuitarInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wPa
|
|||
return DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK PaddleInputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
// retrieve the custom structure POINTER for THIS window
|
||||
InputCust *icp = GetInputCustom(hwnd);
|
||||
HWND pappy = (HWND__ *)GetWindowLongPtr(hwnd,GWLP_HWNDPARENT);
|
||||
funky= hwnd;
|
||||
|
||||
static HWND selectedItem = NULL;
|
||||
|
||||
char temp[100];
|
||||
COLORREF col;
|
||||
switch(msg)
|
||||
{
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS;
|
||||
break;
|
||||
|
||||
|
||||
case WM_NCCREATE:
|
||||
|
||||
// Allocate a new CustCtrl structure for this window.
|
||||
icp = (InputCust *) malloc( sizeof(InputCust) );
|
||||
|
||||
// Failed to allocate, stop window creation.
|
||||
if(icp == NULL) return FALSE;
|
||||
|
||||
// Initialize the CustCtrl structure.
|
||||
icp->hwnd = hwnd;
|
||||
icp->crForeGnd = GetSysColor(COLOR_WINDOWTEXT);
|
||||
icp->crBackGnd = GetSysColor(COLOR_WINDOW);
|
||||
icp->hFont = (HFONT__ *) GetStockObject(DEFAULT_GUI_FONT);
|
||||
|
||||
// Assign the window text specified in the call to CreateWindow.
|
||||
SetWindowText(hwnd, ((CREATESTRUCT *)lParam)->lpszName);
|
||||
|
||||
// Attach custom structure to this window.
|
||||
SetInputCustom(hwnd, icp);
|
||||
|
||||
InvalidateRect(icp->hwnd, NULL, FALSE);
|
||||
UpdateWindow(icp->hwnd);
|
||||
|
||||
selectedItem = NULL;
|
||||
|
||||
SetTimer(hwnd,777,125,NULL);
|
||||
|
||||
// Continue with window creation.
|
||||
return TRUE;
|
||||
|
||||
// Clean up when the window is destroyed.
|
||||
case WM_NCDESTROY:
|
||||
free(icp);
|
||||
break;
|
||||
case WM_PAINT:
|
||||
return InputCustom_OnPaint(icp,wParam,lParam);
|
||||
break;
|
||||
case WM_ERASEBKGND:
|
||||
return 1;
|
||||
case WM_USER+45:
|
||||
case WM_KEYDOWN:
|
||||
TranslateKey(wParam,temp);
|
||||
col = CheckButtonKey(wParam);
|
||||
|
||||
icp->crForeGnd = ((~col) & 0x00ffffff);
|
||||
icp->crBackGnd = col;
|
||||
SetWindowText(hwnd,temp);
|
||||
InvalidateRect(icp->hwnd, NULL, FALSE);
|
||||
UpdateWindow(icp->hwnd);
|
||||
SendMessage(pappy,WM_USER+43,wParam,(LPARAM)hwnd);
|
||||
|
||||
break;
|
||||
case WM_USER+44:
|
||||
|
||||
TranslateKey(wParam,temp);
|
||||
if(IsWindowEnabled(hwnd))
|
||||
{
|
||||
col = CheckButtonKey(wParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
col = RGB( 192,192,192);
|
||||
}
|
||||
icp->crForeGnd = ((~col) & 0x00ffffff);
|
||||
icp->crBackGnd = col;
|
||||
SetWindowText(hwnd,temp);
|
||||
InvalidateRect(icp->hwnd, NULL, FALSE);
|
||||
UpdateWindow(icp->hwnd);
|
||||
|
||||
break;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
{
|
||||
selectedItem = hwnd;
|
||||
col = RGB( 0,255,0);
|
||||
icp->crForeGnd = ((~col) & 0x00ffffff);
|
||||
icp->crBackGnd = col;
|
||||
InvalidateRect(icp->hwnd, NULL, FALSE);
|
||||
UpdateWindow(icp->hwnd);
|
||||
// tid = wParam;
|
||||
|
||||
break;
|
||||
}
|
||||
case WM_KILLFOCUS:
|
||||
{
|
||||
selectedItem = NULL;
|
||||
SendMessage(pappy,WM_USER+46,wParam,(LPARAM)hwnd); // refresh fields on deselect
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_TIMER:
|
||||
if(hwnd == selectedItem)
|
||||
{
|
||||
FunkyJoyStickTimer();
|
||||
}
|
||||
SetTimer(hwnd,777,125,NULL);
|
||||
break;
|
||||
case WM_LBUTTONDOWN:
|
||||
SetFocus(hwnd);
|
||||
break;
|
||||
case WM_ENABLE:
|
||||
COLORREF col;
|
||||
if(wParam)
|
||||
{
|
||||
col = RGB( 255,255,255);
|
||||
icp->crForeGnd = ((~col) & 0x00ffffff);
|
||||
icp->crBackGnd = col;
|
||||
}
|
||||
else
|
||||
{
|
||||
col = RGB( 192,192,192);
|
||||
icp->crForeGnd = ((~col) & 0x00ffffff);
|
||||
icp->crBackGnd = col;
|
||||
}
|
||||
InvalidateRect(icp->hwnd, NULL, FALSE);
|
||||
UpdateWindow(icp->hwnd);
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return DefWindowProc(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
static void TranslateKeyWithModifiers(int wParam, int modifiers, char * outStr)
|
||||
{
|
||||
|
||||
|
@ -2497,6 +2677,7 @@ void input_init()
|
|||
LoadHotkeyConfig();
|
||||
LoadGuitarConfig();
|
||||
LoadPianoConfig();
|
||||
LoadPaddleConfig();
|
||||
|
||||
di_init();
|
||||
FeedbackON = input_feedback;
|
||||
|
@ -2613,6 +2794,14 @@ void input_acquire()
|
|||
bool hic=!S9xGetState(Piano.HIC);
|
||||
piano_setKey(c,cs,d,ds,e,f,fs,g,gs,a,as,b,hic);
|
||||
}
|
||||
|
||||
if (Paddle.Enabled)
|
||||
{
|
||||
bool dec = !S9xGetState(Paddle.DEC);
|
||||
bool inc = !S9xGetState(Paddle.INC);
|
||||
if (inc) nds.paddle += 5;
|
||||
if (dec) nds.paddle -= 5;
|
||||
}
|
||||
}
|
||||
|
||||
// only runs once per frame (always after input_acquire has been called at least once).
|
||||
|
|
|
@ -145,8 +145,15 @@ struct SPiano {
|
|||
WORD C,CS,D,DS,E,F,FS,G,GS,A,AS,B,HIC;
|
||||
};
|
||||
|
||||
struct SPaddle {
|
||||
BOOL Enabled;
|
||||
WORD DEC;
|
||||
WORD INC;
|
||||
};
|
||||
|
||||
extern SGuitar Guitar;
|
||||
extern SPiano Piano;
|
||||
extern SPaddle Paddle;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3132,9 +3132,6 @@ int _main()
|
|||
|
||||
input_init();
|
||||
|
||||
if (slot2_GetCurrentType() == NDS_SLOT2_GUITARGRIP) Guitar.Enabled = true;
|
||||
if (slot2_GetCurrentType() == NDS_SLOT2_EASYPIANO) Piano.Enabled = true;
|
||||
|
||||
LOG("Init NDS\n");
|
||||
|
||||
GInfo_Init();
|
||||
|
@ -3236,6 +3233,9 @@ int _main()
|
|||
|
||||
slot2_Change((NDS_SLOT2_TYPE)slot2_device_type);
|
||||
|
||||
Guitar.Enabled = (slot2_device_type == NDS_SLOT2_GUITARGRIP)?true:false;
|
||||
Piano.Enabled = (slot2_device_type == NDS_SLOT2_EASYPIANO)?true:false;
|
||||
Paddle.Enabled = (slot2_device_type == NDS_SLOT2_PADDLE)?true:false;
|
||||
|
||||
CommonSettings.wifi.mode = GetPrivateProfileInt("Wifi", "Mode", 0, IniName);
|
||||
CommonSettings.wifi.infraBridgeAdapter = GetPrivateProfileInt("Wifi", "BridgeAdapter", 0, IniName);
|
||||
|
|
|
@ -453,10 +453,12 @@
|
|||
#define IDC_IMP_INFO_FILE 1057
|
||||
#define IDC_FILES_TREE 1057
|
||||
#define IDC_PROGRESS_BAR 1057
|
||||
#define IDC_PINC 1057
|
||||
#define IDC_BADD_CB 1058
|
||||
#define IDC_IMP_INFO_ADVANSCENE 1058
|
||||
#define IDC_FILE_INFO 1058
|
||||
#define IDC_MESSAGE 1058
|
||||
#define IDC_PDEC 1058
|
||||
#define IDC_IMP_MANUAL_SIZE 1059
|
||||
#define IDC_BREMOVE 1060
|
||||
#define IDC_FILE_QVIEW 1060
|
||||
|
@ -854,6 +856,7 @@
|
|||
#define IDD_SLOT1_NONE 10011
|
||||
#define IDD_SLOT1_R4 10012
|
||||
#define IDD_SLOT1_DEBUG 10013
|
||||
#define IDD_GBASLOT_PADDLE 10014
|
||||
#define IDM_FILE_STOPAVI 40000
|
||||
#define IDM_SCREENSEP_NONE 40000
|
||||
#define IDM_FILE_STOPWAV 40001
|
||||
|
@ -1049,7 +1052,7 @@
|
|||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 128
|
||||
#define _APS_NEXT_COMMAND_VALUE 40111
|
||||
#define _APS_NEXT_CONTROL_VALUE 1057
|
||||
#define _APS_NEXT_CONTROL_VALUE 1059
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTI
|
|||
CAPTION "NITRO File System"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "",IDC_FILES_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP | 0x800,7,7,359,294
|
||||
CONTROL "",IDC_FILES_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_INFOTIP | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,359,294
|
||||
PUSHBUTTON "Close",IDCANCEL,316,320,50,14
|
||||
EDITTEXT IDC_FILE_INFO,8,322,306,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
|
||||
LTEXT "Static",IDC_FILE_QVIEW,7,303,359,15,NOT WS_GROUP
|
||||
|
@ -1393,7 +1393,7 @@ IDD_SLOT1_R4 DIALOGEX 7, 64, 302, 89
|
|||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "Directory to scan:",IDC_R4_FOLDER,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,9,22,35,10
|
||||
CONTROL "Directory to scan:",IDC_R4_FOLDER,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,9,22,35,10
|
||||
CONTROL "use path of the loaded ROM (not the same as ""ROM path"" in path configuration)",IDC_R4_ROM,
|
||||
"Button",BS_AUTORADIOBUTTON,9,53,272,10
|
||||
PUSHBUTTON "Browse...",IDC_BROWSE,245,33,50,14
|
||||
|
@ -1480,6 +1480,17 @@ BEGIN
|
|||
LTEXT "Static",IDC_MESSAGE,7,7,264,15,NOT WS_GROUP
|
||||
END
|
||||
|
||||
IDD_GBASLOT_PADDLE DIALOGEX 7, 48, 302, 109
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL " ",IDC_PINC,"InputCustomGuitar",WS_TABSTOP,129,24,71,12,WS_EX_CLIENTEDGE
|
||||
CONTROL " ",IDC_PDEC,"InputCustomGuitar",WS_TABSTOP,129,38,71,12,WS_EX_CLIENTEDGE
|
||||
RTEXT "Increase",-1,80,27,46,8
|
||||
LTEXT "Paddle",-1,137,8,53,15
|
||||
RTEXT "Decrease",-1,81,40,44,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue