win32: route all the old hardcoded accelerators through the hotkey system

This commit is contained in:
zeromus 2009-02-11 04:23:52 +00:00
parent 4247b76b47
commit cfdc18fa53
8 changed files with 1299 additions and 1375 deletions

View File

@ -1083,7 +1083,6 @@ unsigned short gfx3d_glGetVecRes(unsigned int index)
} }
#ifdef USE_GEOMETRY_FIFO_EMULATION #ifdef USE_GEOMETRY_FIFO_EMULATION
extern void NDS_Pause();
void gfx3d_execute(u8 cmd, u32 param) void gfx3d_execute(u8 cmd, u32 param)
{ {

Binary file not shown.

View File

@ -24,39 +24,54 @@
#include <windows.h> #include <windows.h>
#include <tchar.h> #include <tchar.h>
#include <string>
enum HotkeyPage { enum HotkeyPage {
HOTKEY_PAGE_TOOLS=0, HOTKEY_PAGE_MAIN=0,
HOTKEY_PAGE_PLACEHOLDER=1, HOTKEY_PAGE_STATE,
HOTKEY_PAGE_STATE_SLOTS,
NUM_HOTKEY_PAGE, NUM_HOTKEY_PAGE,
}; };
static LPCTSTR hotkeyPageTitle[] = { static LPCTSTR hotkeyPageTitle[] = {
_T("Tools"), _T("Main"),
_T("Placeholder"), _T("Savestates"),
_T("Savestate Slots"),
_T("NUM_HOTKEY_PAGE"), _T("NUM_HOTKEY_PAGE"),
}; };
struct SCustomKey { struct SCustomKey
typedef void (*THandler) (void); {
typedef void (*THandler) (int param);
WORD key; WORD key;
WORD modifiers; WORD modifiers;
THandler handleKeyDown; THandler handleKeyDown;
THandler handleKeyUp; THandler handleKeyUp;
HotkeyPage page; HotkeyPage page;
LPCTSTR name; std::wstring name;
const char* code; const char* code;
int param;
//HotkeyTiming timing; //HotkeyTiming timing;
}; };
union SCustomKeys { struct SCustomKeys
struct { {
SCustomKey Save[10];
SCustomKey Load[10];
SCustomKey Slot[10];
SCustomKey QuickSave, QuickLoad;
SCustomKey Pause, FrameAdvance;
SCustomKey PrintScreen; SCustomKey PrintScreen;
SCustomKey LastItem; // dummy, must be last SCustomKey LastItem; // dummy, must be last
};
SCustomKey key[]; //--methods--
SCustomKey &key(int i) { return ((SCustomKey*)this)[i]; }
SCustomKey const &key(int i) const { return ((SCustomKey*)this)[i]; }
}; };
//SCustomKey key[];
extern SCustomKeys CustomKeys; extern SCustomKeys CustomKeys;
@ -66,7 +81,11 @@ void InitCustomKeys (SCustomKeys *keys);
int GetModifiers(int key); int GetModifiers(int key);
//HOTKEY HANDLERS //HOTKEY HANDLERS
void HK_PrintScreen(); void HK_PrintScreen(int);
void HK_StateSaveSlot(int);
void HK_StateLoadSlot(int);
void HK_StateSetSlot(int);
void HK_Pause(int);
#endif //HOTKEY_H_INCLUDED #endif //HOTKEY_H_INCLUDED

View File

@ -346,7 +346,7 @@ static void ReadHotkey(const char* name, WORD& output)
static void LoadHotkeyConfig() static void LoadHotkeyConfig()
{ {
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
while (!IsLastCustomKey(key)) { while (!IsLastCustomKey(key)) {
ReadHotkey(key->code,key->key); ReadHotkey(key->code,key->key);
@ -358,7 +358,7 @@ static void LoadHotkeyConfig()
static void SaveHotkeyConfig() static void SaveHotkeyConfig()
{ {
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
while (!IsLastCustomKey(key)) { while (!IsLastCustomKey(key)) {
WritePrivateProfileInt("Hotkeys",(char*)key->code,key->key,IniName); WritePrivateProfileInt("Hotkeys",(char*)key->code,key->key,IniName);
@ -1011,7 +1011,7 @@ int GetNumHotKeysAssignedTo (WORD Key, int modifiers)
|| (k->key == VK_MENU && modifiers & CUSTKEY_ALT_MASK) \ || (k->key == VK_MENU && modifiers & CUSTKEY_ALT_MASK) \
|| (k->key == VK_CONTROL && modifiers & CUSTKEY_CTRL_MASK))) || (k->key == VK_CONTROL && modifiers & CUSTKEY_CTRL_MASK)))
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
while (!IsLastCustomKey(key)) { while (!IsLastCustomKey(key)) {
if (MATCHES_KEY(key)) { if (MATCHES_KEY(key)) {
count++; count++;
@ -2199,13 +2199,13 @@ void input_process()
static void set_hotkeyinfo(HWND hDlg) static void set_hotkeyinfo(HWND hDlg)
{ {
HotkeyPage page = (HotkeyPage) SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); HotkeyPage page = (HotkeyPage) SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0);
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
int i = 0; int i = 0;
while (!IsLastCustomKey(key) && i < NUM_HOTKEY_CONTROLS) { while (!IsLastCustomKey(key) && i < NUM_HOTKEY_CONTROLS) {
if (page == key->page) { if (page == key->page) {
SendDlgItemMessage(hDlg, IDC_HOTKEY_Table[i], WM_USER+44, key->key, key->modifiers); SendDlgItemMessage(hDlg, IDC_HOTKEY_Table[i], WM_USER+44, key->key, key->modifiers);
SetDlgItemText(hDlg, IDC_LABEL_HK_Table[i], key->name); SetDlgItemTextW(hDlg, IDC_LABEL_HK_Table[i], key->name.c_str());
ShowWindow(GetDlgItem(hDlg, IDC_HOTKEY_Table[i]), SW_SHOW); ShowWindow(GetDlgItem(hDlg, IDC_HOTKEY_Table[i]), SW_SHOW);
i++; i++;
} }
@ -2284,19 +2284,19 @@ switch(msg)
int modifiers = GetModifiers(wParam); int modifiers = GetModifiers(wParam);
page = (HotkeyPage) SendDlgItemMessage(hDlg, IDC_HKCOMBO, CB_GETCURSEL, 0, 0); page = (HotkeyPage) SendDlgItemMessage(hDlg, IDC_HKCOMBO, CB_GETCURSEL, 0, 0);
TCHAR text[256]; wchar_t text[256];
which = GetDlgCtrlID((HWND)lParam); which = GetDlgCtrlID((HWND)lParam);
for (i = 0; i < NUM_HOTKEY_CONTROLS; i++) { for (i = 0; i < NUM_HOTKEY_CONTROLS; i++) {
if (which == IDC_HOTKEY_Table[i]) if (which == IDC_HOTKEY_Table[i])
break; break;
} }
GetDlgItemText(hDlg, IDC_LABEL_HK_Table[i], text, COUNT(text)); GetDlgItemTextW(hDlg, IDC_LABEL_HK_Table[i], text, COUNT(text));
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
while (!IsLastCustomKey(key)) { while (!IsLastCustomKey(key)) {
if (page == key->page) { if (page == key->page) {
if (lstrcmp(text, key->name) == 0) { if(text == key->name) {
key->key = wParam; key->key = wParam;
key->modifiers = modifiers; key->modifiers = modifiers;
break; break;

View File

@ -38,9 +38,6 @@ InputCust * GetInputCustom(HWND hwnd);
#define CUSTKEY_CTRL_MASK 0x02 #define CUSTKEY_CTRL_MASK 0x02
#define CUSTKEY_SHIFT_MASK 0x04 #define CUSTKEY_SHIFT_MASK 0x04
struct SJoypad { struct SJoypad {
BOOL Enabled; BOOL Enabled;
WORD Left; WORD Left;
@ -111,6 +108,8 @@ extern SJoypad ToggleJoypadStorage[8];
//extern SCustomKeys CustomKeys; //extern SCustomKeys CustomKeys;
extern SJoypad TurboToggleJoypadStorage[8]; extern SJoypad TurboToggleJoypadStorage[8];
void RunInputConfig();
void RunHotkeyConfig();
#endif #endif

View File

@ -1,24 +1,24 @@
/* Copyright (C) 2006 yopyop /* Copyright (C) 2006 yopyop
yopyop156@ifrance.com yopyop156@ifrance.com
yopyop156.ifrance.com yopyop156.ifrance.com
Copyright 2006 Theo Berkau Copyright 2006 Theo Berkau
This file is part of DeSmuME This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
DeSmuME is distributed in the hope that it will be useful, DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "windriver.h" #include "windriver.h"
#include <algorithm> #include <algorithm>
@ -188,17 +188,17 @@ int sndbuffersize=735*4;
int sndvolume=100; int sndvolume=100;
SoundInterface_struct *SNDCoreList[] = { SoundInterface_struct *SNDCoreList[] = {
&SNDDummy, &SNDDummy,
&SNDFile, &SNDFile,
&SNDDIRECTX, &SNDDIRECTX,
NULL NULL
}; };
GPU3DInterface *core3DList[] = { GPU3DInterface *core3DList[] = {
&gpu3DNull, &gpu3DNull,
&gpu3Dgl, &gpu3Dgl,
&gpu3DRasterize, &gpu3DRasterize,
NULL NULL
}; };
int autoframeskipenab=1; int autoframeskipenab=1;
@ -955,34 +955,7 @@ void NDS_UnPause()
} }
} }
void StateSaveSlot(int num)
{
if (!paused)
{
NDS_Pause();
savestate_slot(num); //Savestate
NDS_UnPause();
}
else
savestate_slot(num); //Savestate
lastSaveState = num; //Set last savestate used
SaveStateMessages(num, 0); //Display state loaded message
}
void StateLoadSlot(int num)
{
BOOL wasPaused = paused;
NDS_Pause();
loadstate_slot(num); //Loadstate
lastSaveState = num; //Set last savestate used
SaveStateMessages(num, 1); //Display state loaded message
if(!wasPaused)
NDS_UnPause();
else
Display();
}
#ifdef EXPERIMENTAL_GBASLOT #ifdef EXPERIMENTAL_GBASLOT
BOOL LoadROM(char * filename) BOOL LoadROM(char * filename)
@ -1010,8 +983,8 @@ BOOL LoadROM(char * filename, const char *cflash_disk_image)
} }
/* /*
* The thread handling functions needed by the GDB stub code. * The thread handling functions needed by the GDB stub code.
*/ */
void * void *
createThread_gdb( void (APIENTRY *thread_function)( void *data), createThread_gdb( void (APIENTRY *thread_function)( void *data),
void *thread_data) { void *thread_data) {
@ -1608,7 +1581,7 @@ void SetRotate(HWND hwnd, int rot)
IDirectDraw7_CreateSurface(lpDDraw, &ddsd, &lpBackSurface, NULL); IDirectDraw7_CreateSurface(lpDDraw, &ddsd, &lpBackSurface, NULL);
} }
// SetWindowClientSize(hwnd, GPU_width, GPU_height); // SetWindowClientSize(hwnd, GPU_width, GPU_height);
MainWindow->checkMenu(IDC_ROTATE0, MF_BYCOMMAND | ((GPU_rotation==0)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE0, MF_BYCOMMAND | ((GPU_rotation==0)?MF_CHECKED:MF_UNCHECKED));
MainWindow->checkMenu(IDC_ROTATE90, MF_BYCOMMAND | ((GPU_rotation==90)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE90, MF_BYCOMMAND | ((GPU_rotation==90)?MF_CHECKED:MF_UNCHECKED));
MainWindow->checkMenu(IDC_ROTATE180, MF_BYCOMMAND | ((GPU_rotation==180)?MF_CHECKED:MF_UNCHECKED)); MainWindow->checkMenu(IDC_ROTATE180, MF_BYCOMMAND | ((GPU_rotation==180)?MF_CHECKED:MF_UNCHECKED));
@ -1785,11 +1758,11 @@ int GetModifiers(int key)
int HandleKeyUp(WPARAM wParam, LPARAM lParam, int modifiers) int HandleKeyUp(WPARAM wParam, LPARAM lParam, int modifiers)
{ {
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
while (!IsLastCustomKey(key)) { while (!IsLastCustomKey(key)) {
if (wParam == key->key && modifiers == key->modifiers && key->handleKeyUp) { if (wParam == key->key && modifiers == key->modifiers && key->handleKeyUp) {
key->handleKeyUp(); key->handleKeyUp(key->param);
} }
key++; key++;
} }
@ -1805,10 +1778,10 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam, int modifiers)
if(!(wParam == 0 || wParam == VK_ESCAPE)) // if it's the 'disabled' key, it's never pressed as a hotkey if(!(wParam == 0 || wParam == VK_ESCAPE)) // if it's the 'disabled' key, it's never pressed as a hotkey
{ {
SCustomKey *key = CustomKeys.key; SCustomKey *key = &CustomKeys.key(0);
while (!IsLastCustomKey(key)) { while (!IsLastCustomKey(key)) {
if (wParam == key->key && modifiers == key->modifiers && key->handleKeyDown) { if (wParam == key->key && modifiers == key->modifiers && key->handleKeyDown) {
key->handleKeyDown(); key->handleKeyDown(key->param);
hitHotKey = true; hitHotKey = true;
} }
key++; key++;
@ -1822,8 +1795,31 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam, int modifiers)
return 1; return 1;
} }
void Pause()
{
if (emu_paused) NDS_UnPause();
else NDS_Pause();
emu_paused ^= 1;
MainWindow->checkMenu(IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
}
void RunConfig(int num) void FrameAdvance()
{
frameAdvance = true;
execute = TRUE;
emu_paused = 1;
MainWindow->checkMenu(IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
}
enum CONFIGSCREEN
{
CONFIGSCREEN_INPUT,
CONFIGSCREEN_HOTKEY,
CONFIGSCREEN_FIRMWARE,
CONFIGSCREEN_SOUND
};
void RunConfig(CONFIGSCREEN which)
{ {
HWND hwnd = MainWindow->getHWnd(); HWND hwnd = MainWindow->getHWnd();
bool tpaused=false; bool tpaused=false;
@ -1833,18 +1829,20 @@ void RunConfig(int num)
NDS_Pause(); NDS_Pause();
} }
switch(num) { switch(which)
case 0: {
void RunInputConfig(); case CONFIGSCREEN_INPUT:
RunInputConfig(); RunInputConfig();
break; break;
case 1: case CONFIGSCREEN_HOTKEY:
void RunHotkeyConfig();
RunHotkeyConfig(); RunHotkeyConfig();
break; break;
case 2: case CONFIGSCREEN_FIRMWARE:
DialogBox(hAppInst,MAKEINTRESOURCE(IDD_FIRMSETTINGS), hwnd, (DLGPROC) FirmConfig_Proc); DialogBox(hAppInst,MAKEINTRESOURCE(IDD_FIRMSETTINGS), hwnd, (DLGPROC) FirmConfig_Proc);
break; break;
case CONFIGSCREEN_SOUND:
DialogBox(hAppInst, MAKEINTRESOURCE(IDD_SOUNDSETTINGS), hwnd, (DLGPROC)SoundSettingsDlgProc);
break;
} }
if (tpaused) if (tpaused)
@ -2058,7 +2056,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case IDM_OPEN: case IDM_OPEN:
return OpenFile(); return OpenFile();
case IDM_PRINTSCREEN: case IDM_PRINTSCREEN:
HK_PrintScreen(); HK_PrintScreen(0);
return 0; return 0;
case IDM_QUICK_PRINTSCREEN: case IDM_QUICK_PRINTSCREEN:
{ {
@ -2117,109 +2115,64 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
} }
return 0; return 0;
case IDM_STATE_SAVE_F1: case IDM_STATE_SAVE_F1:
StateSaveSlot(1); HK_StateSaveSlot(1);
return 0; return 0;
case IDM_STATE_SAVE_F2: case IDM_STATE_SAVE_F2:
StateSaveSlot(2); HK_StateSaveSlot(2);
return 0; return 0;
case IDM_STATE_SAVE_F3: case IDM_STATE_SAVE_F3:
StateSaveSlot(3); HK_StateSaveSlot(3);
return 0; return 0;
case IDM_STATE_SAVE_F4: case IDM_STATE_SAVE_F4:
StateSaveSlot(4); HK_StateSaveSlot(4);
return 0; return 0;
case IDM_STATE_SAVE_F5: case IDM_STATE_SAVE_F5:
StateSaveSlot(5); HK_StateSaveSlot(5);
return 0; return 0;
case IDM_STATE_SAVE_F6: case IDM_STATE_SAVE_F6:
StateSaveSlot(6); HK_StateSaveSlot(6);
return 0; return 0;
case IDM_STATE_SAVE_F7: case IDM_STATE_SAVE_F7:
StateSaveSlot(7); HK_StateSaveSlot(7);
return 0; return 0;
case IDM_STATE_SAVE_F8: case IDM_STATE_SAVE_F8:
StateSaveSlot(8); HK_StateSaveSlot(8);
return 0; return 0;
case IDM_STATE_SAVE_F9: case IDM_STATE_SAVE_F9:
StateSaveSlot(9); HK_StateSaveSlot(9);
return 0; return 0;
case IDM_STATE_SAVE_F10: case IDM_STATE_SAVE_F10:
StateSaveSlot(10); HK_StateSaveSlot(10);
return 0; return 0;
case IDM_STATE_LOAD_F1: case IDM_STATE_LOAD_F1:
StateLoadSlot(1); HK_StateLoadSlot(1);
return 0; return 0;
case IDM_STATE_LOAD_F2: case IDM_STATE_LOAD_F2:
StateLoadSlot(2); HK_StateLoadSlot(2);
return 0; return 0;
case IDM_STATE_LOAD_F3: case IDM_STATE_LOAD_F3:
StateLoadSlot(3); HK_StateLoadSlot(3);
return 0; return 0;
case IDM_STATE_LOAD_F4: case IDM_STATE_LOAD_F4:
StateLoadSlot(4); HK_StateLoadSlot(4);
return 0; return 0;
case IDM_STATE_LOAD_F5: case IDM_STATE_LOAD_F5:
StateLoadSlot(5); HK_StateLoadSlot(5);
return 0; return 0;
case IDM_STATE_LOAD_F6: case IDM_STATE_LOAD_F6:
StateLoadSlot(6); HK_StateLoadSlot(6);
return 0; return 0;
case IDM_STATE_LOAD_F7: case IDM_STATE_LOAD_F7:
StateLoadSlot(7); HK_StateLoadSlot(7);
return 0; return 0;
case IDM_STATE_LOAD_F8: case IDM_STATE_LOAD_F8:
StateLoadSlot(8); HK_StateLoadSlot(8);
return 0; return 0;
case IDM_STATE_LOAD_F9: case IDM_STATE_LOAD_F9:
StateLoadSlot(9); HK_StateLoadSlot(9);
return 0; return 0;
case IDM_STATE_LOAD_F10: case IDM_STATE_LOAD_F10:
StateLoadSlot(10); HK_StateLoadSlot(10);
return 0;
case ACCEL_I: //Quick Save
StateSaveSlot(lastSaveState);
return 0;
case ACCEL_P: //Quick Load
StateLoadSlot(lastSaveState);
return 0;
//Save slot selection
case ACCEL_0:
lastSaveState = 0;
SaveStateMessages(0,2);
return 0;
case ACCEL_1:
lastSaveState = 1;
SaveStateMessages(1,2);
return 0;
case ACCEL_2:
lastSaveState = 2;
SaveStateMessages(2,2);
return 0;
case ACCEL_3:
lastSaveState = 3;
SaveStateMessages(3,2);
return 0;
case ACCEL_4:
lastSaveState = 4;
SaveStateMessages(4,2);
return 0;
case ACCEL_5:
lastSaveState = 5;
SaveStateMessages(5,2);
case ACCEL_6:
lastSaveState = 6;
SaveStateMessages(6,2);
return 0;
case ACCEL_7:
lastSaveState = 7;
SaveStateMessages(7,2);
case ACCEL_8:
lastSaveState = 8;
SaveStateMessages(8,2);
return 0;
case ACCEL_9:
lastSaveState = 9;
SaveStateMessages(9,2);
return 0; return 0;
case IDM_IMPORTBACKUPMEMORY: case IDM_IMPORTBACKUPMEMORY:
{ {
@ -2245,26 +2198,27 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
NDS_UnPause(); NDS_UnPause();
return 0; return 0;
} }
case IDM_SOUNDSETTINGS:
{ case IDM_CONFIG:
bool tpaused=false; RunConfig(CONFIGSCREEN_INPUT);
if (execute)
{
tpaused=true;
NDS_Pause();
}
DialogBox(hAppInst, MAKEINTRESOURCE(IDD_SOUNDSETTINGS), hwnd, (DLGPROC)SoundSettingsDlgProc);
if (tpaused)
NDS_UnPause();
}
return 0; return 0;
case IDM_HOTKEY_CONFIG:
RunConfig(CONFIGSCREEN_HOTKEY);
return 0;
case IDM_FIRMSETTINGS:
RunConfig(CONFIGSCREEN_FIRMWARE);
return 0;
case IDM_SOUNDSETTINGS:
RunConfig(CONFIGSCREEN_SOUND);
return 0;
case IDM_GAME_INFO: case IDM_GAME_INFO:
{ {
CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_GAME_INFO), hwnd, GinfoView_Proc); CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_GAME_INFO), hwnd, GinfoView_Proc);
} }
return 0; return 0;
//========================================================= Tools //========================================================= Tools
case IDM_PAL: case IDM_PAL:
ViewPalette->open(); ViewPalette->open();
return 0; return 0;
@ -2312,7 +2266,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case IDM_LIGHT_VIEWER: case IDM_LIGHT_VIEWER:
ViewLights->open(); ViewLights->open();
return 0; return 0;
//========================================================== Tools end //========================================================== Tools end
case IDM_MBG0 : case IDM_MBG0 :
if(MainScreen.gpu->dispBG[0]) if(MainScreen.gpu->dispBG[0])
@ -2411,12 +2365,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
} }
return 0; return 0;
case ACCEL_SPACEBAR:
case IDM_PAUSE: case IDM_PAUSE:
if (emu_paused) NDS_UnPause(); Pause();
else NDS_Pause();
emu_paused ^= 1;
MainWindow->checkMenu(IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
return 0; return 0;
case IDM_GBASLOT: case IDM_GBASLOT:
@ -2431,13 +2381,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
CheatsSearchDialog(hwnd); CheatsSearchDialog(hwnd);
return 0; return 0;
case ACCEL_N: //Frame Advance
frameAdvance = true;
execute = TRUE;
emu_paused = 1;
MainWindow->checkMenu(IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
return 0;
case ID_VIEW_FRAMECOUNTER: case ID_VIEW_FRAMECOUNTER:
frameCounterDisplay ^= 1; frameCounterDisplay ^= 1;
MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER, frameCounterDisplay ? MF_CHECKED : MF_UNCHECKED); MainWindow->checkMenu(ID_VIEW_FRAMECOUNTER, frameCounterDisplay ? MF_CHECKED : MF_UNCHECKED);
@ -2450,7 +2393,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
osd->clear(); osd->clear();
return 0; return 0;
#define clearsaver() \ #define clearsaver() \
MainWindow->checkMenu(IDC_SAVETYPE1, MF_BYCOMMAND | MF_UNCHECKED); \ MainWindow->checkMenu(IDC_SAVETYPE1, MF_BYCOMMAND | MF_UNCHECKED); \
MainWindow->checkMenu(IDC_SAVETYPE2, MF_BYCOMMAND | MF_UNCHECKED); \ MainWindow->checkMenu(IDC_SAVETYPE2, MF_BYCOMMAND | MF_UNCHECKED); \
MainWindow->checkMenu(IDC_SAVETYPE3, MF_BYCOMMAND | MF_UNCHECKED); \ MainWindow->checkMenu(IDC_SAVETYPE3, MF_BYCOMMAND | MF_UNCHECKED); \
@ -2459,7 +2402,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
MainWindow->checkMenu(IDC_SAVETYPE6, MF_BYCOMMAND | MF_UNCHECKED); \ MainWindow->checkMenu(IDC_SAVETYPE6, MF_BYCOMMAND | MF_UNCHECKED); \
MainWindow->checkMenu(IDC_SAVETYPE7, MF_BYCOMMAND | MF_UNCHECKED); MainWindow->checkMenu(IDC_SAVETYPE7, MF_BYCOMMAND | MF_UNCHECKED);
#define saver(one) \ #define saver(one) \
MainWindow->checkMenu(one, MF_BYCOMMAND | MF_CHECKED); MainWindow->checkMenu(one, MF_BYCOMMAND | MF_CHECKED);
case IDC_SAVETYPE1: case IDC_SAVETYPE1:
@ -2519,16 +2462,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
} }
return 0; return 0;
case IDM_CONFIG:
RunConfig(0);
return 0;
case IDM_HOTKEY_CONFIG:
RunConfig(1);
return 0;
case IDM_FIRMSETTINGS:
RunConfig(2);
return 0;
case IDC_FRAMESKIPAUTO: case IDC_FRAMESKIPAUTO:
case IDC_FRAMESKIP0: case IDC_FRAMESKIP0:
case IDC_FRAMESKIP1: case IDC_FRAMESKIP1:

View File

@ -4,5 +4,13 @@
#include "CWindow.h" #include "CWindow.h"
extern WINCLASS *MainWindow; extern WINCLASS *MainWindow;
extern volatile BOOL execute, paused;
void NDS_Pause();
void NDS_UnPause();
extern unsigned int lastSaveState;
void SaveStateMessages(int slotnum, int whichMessage);
void Display();
void Pause();
void FrameAdvance();
#endif #endif

View File

@ -2303,39 +2303,5 @@ END
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDR_MAIN_ACCEL ACCELERATORS IDR_MAIN_ACCEL ACCELERATORS
BEGIN BEGIN
"0", ACCEL_0, VIRTKEY
"1", ACCEL_1, VIRTKEY
"2", ACCEL_2, VIRTKEY
"3", ACCEL_3, VIRTKEY
"4", ACCEL_4, VIRTKEY
"5", ACCEL_5, VIRTKEY
"6", ACCEL_6, VIRTKEY
"7", ACCEL_7, VIRTKEY
"8", ACCEL_8, VIRTKEY
"9", ACCEL_9, VIRTKEY
"I", ACCEL_I, VIRTKEY
"N", ACCEL_N, VIRTKEY
"P", ACCEL_P, VIRTKEY
VK_SPACE, ACCEL_SPACEBAR, VIRTKEY
VK_F1, IDM_STATE_LOAD_F1, VIRTKEY
VK_F10, IDM_STATE_LOAD_F10, VIRTKEY
VK_F2, IDM_STATE_LOAD_F2, VIRTKEY
VK_F3, IDM_STATE_LOAD_F3, VIRTKEY
VK_F4, IDM_STATE_LOAD_F4, VIRTKEY
VK_F5, IDM_STATE_LOAD_F5, VIRTKEY
VK_F6, IDM_STATE_LOAD_F6, VIRTKEY
VK_F7, IDM_STATE_LOAD_F7, VIRTKEY
VK_F8, IDM_STATE_LOAD_F8, VIRTKEY
VK_F9, IDM_STATE_LOAD_F9, VIRTKEY
VK_F1, IDM_STATE_SAVE_F1, VIRTKEY, SHIFT
VK_F10, IDM_STATE_SAVE_F10, VIRTKEY, SHIFT
VK_F2, IDM_STATE_SAVE_F2, VIRTKEY, SHIFT
VK_F3, IDM_STATE_SAVE_F3, VIRTKEY, SHIFT
VK_F4, IDM_STATE_SAVE_F4, VIRTKEY, SHIFT
VK_F5, IDM_STATE_SAVE_F5, VIRTKEY, SHIFT
VK_F6, IDM_STATE_SAVE_F6, VIRTKEY, SHIFT
VK_F7, IDM_STATE_SAVE_F7, VIRTKEY, SHIFT
VK_F8, IDM_STATE_SAVE_F8, VIRTKEY, SHIFT
VK_F9, IDM_STATE_SAVE_F9, VIRTKEY, SHIFT
"O", ACCEL_CTRL_O, VIRTKEY, CONTROL "O", ACCEL_CTRL_O, VIRTKEY, CONTROL
END END