1
0
Fork 0

New format for mapper handlers to support keeping keys pressed.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2488
This commit is contained in:
Sjoerd van der Berg 2006-02-12 23:23:52 +00:00
parent 19985730a3
commit b81c210530
5 changed files with 19 additions and 13 deletions

View file

@ -20,7 +20,7 @@ void DEBUG_SetupConsole(void);
void DEBUG_DrawScreen(void);
bool DEBUG_Breakpoint(void);
bool DEBUG_IntBreakpoint(Bit8u intNum);
void DEBUG_Enable(void);
void DEBUG_Enable(bool pressed);
void DEBUG_CheckExecuteBreakpoint(Bit16u seg, Bit32u off);
bool DEBUG_ExitLoop(void);
void DEBUG_RefreshPage(char scroll);

View file

@ -25,11 +25,11 @@ enum MapKeys {
};
typedef void (MAPPER_Handler)(void);
typedef void (MAPPER_Handler)(bool pressed);
void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char * eventname,char * buttonname);
void MAPPER_Init(void);
void MAPPER_StartUp(Section * sec);
void MAPPER_Run(void);
void MAPPER_Run(bool pressed);
void MAPPER_LosingFocus(void);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: debug.cpp,v 1.74 2006-02-09 11:47:48 qbix79 Exp $ */
/* $Id: debug.cpp,v 1.75 2006-02-12 23:23:52 harekiet Exp $ */
#include <string.h>
#include <list>
@ -1660,7 +1660,9 @@ Bitu DEBUG_Loop(void) {
return DEBUG_CheckKeys();
}
void DEBUG_Enable(void) {
void DEBUG_Enable(bool pressed) {
if (!pressed)
return;
static bool showhelp=false;
debugging=true;
SetCodeWinStart();
@ -1947,7 +1949,7 @@ void DEBUG_CheckExecuteBreakpoint(Bit16u seg, Bit32u off)
Bitu DEBUG_EnableDebugger(void)
{
exitLoop = true;
DEBUG_Enable();
DEBUG_Enable(true);
CPU_Cycles=CPU_CycleLeft=0;
return 0;
};

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdl_mapper.cpp,v 1.19 2006-02-09 11:47:48 qbix79 Exp $ */
/* $Id: sdl_mapper.cpp,v 1.20 2006-02-12 23:23:52 harekiet Exp $ */
#define OLD_JOYSTICK 1
@ -996,7 +996,7 @@ public:
handlergroup.push_back(this);
}
void Active(bool yesno) {
if (yesno) (*handler)();
(*handler)(yesno);
};
char * ButtonName(void) {
return buttonname;
@ -1502,8 +1502,8 @@ static void CreateBindGroups(void) {
case JOY_2AXIS:
default:
new CStickBindGroup(joyno);
if((joyno+1) < numsticks)
new CStickBindGroup(joyno+1);
if((joyno+1U) < numsticks)
new CStickBindGroup(joyno+1U);
break;
}
}
@ -1515,7 +1515,9 @@ void MAPPER_LosingFocus(void) {
}
}
void MAPPER_Run(void) {
void MAPPER_Run(bool pressed) {
if (!pressed)
return;
/* Deactive all running binds */
for (CEventVector_it evit=events.begin();evit!=events.end();evit++) {
(*evit)->DeActivateAll();

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: bios_disk.cpp,v 1.26 2006-02-09 11:47:56 qbix79 Exp $ */
/* $Id: bios_disk.cpp,v 1.27 2006-02-12 23:23:52 harekiet Exp $ */
#include "dosbox.h"
#include "callback.h"
@ -112,7 +112,9 @@ void swapInDisks(void) {
}
}
void swapInNextDisk(void) {
void swapInNextDisk(bool pressed) {
if (!pressed)
return;
/* Hack/feature: rescan all disks as well */
for(Bitu i=0;i<DOS_DRIVES;i++) {
if (Drives[i]) Drives[i]->EmptyCache();