add F11/F12, fix pause functionality
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2314
This commit is contained in:
parent
9be07ec88b
commit
b5336f32d1
5 changed files with 22 additions and 11 deletions
|
@ -34,7 +34,7 @@ enum KBD_KEYS {
|
|||
KBD_capslock,KBD_scrolllock,KBD_numlock,
|
||||
|
||||
KBD_grave,KBD_minus,KBD_equals,KBD_backslash,KBD_leftbracket,KBD_rightbracket,
|
||||
KBD_semicolon,KBD_quote,KBD_period,KBD_comma,KBD_slash,
|
||||
KBD_semicolon,KBD_quote,KBD_period,KBD_comma,KBD_slash,KBD_extra_lt_gt,
|
||||
|
||||
KBD_printscreen,KBD_pause,
|
||||
KBD_insert,KBD_home,KBD_pageup,KBD_delete,KBD_end,KBD_pagedown,
|
||||
|
@ -47,6 +47,7 @@ enum KBD_KEYS {
|
|||
KBD_LAST
|
||||
};
|
||||
|
||||
void KEYBOARD_ClrBuffer(void);
|
||||
void KEYBOARD_AddKey(KBD_KEYS keytype,bool pressed);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: debug.cpp,v 1.68 2005-08-31 13:00:14 qbix79 Exp $ */
|
||||
/* $Id: debug.cpp,v 1.69 2005-09-18 19:50:03 c2woody Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <list>
|
||||
|
@ -41,6 +41,7 @@
|
|||
#include "programs.h"
|
||||
#include "debug_inc.h"
|
||||
#include "../cpu/lazyflags.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
#ifdef WIN32
|
||||
void WIN32_Console();
|
||||
|
@ -1651,6 +1652,7 @@ void DEBUG_Enable(void) {
|
|||
showhelp=true;
|
||||
DEBUG_ShowMsg("***| PRESS \"H\" TO SHOW ALL COMMANDS. PRESS \"RETURN\" TO ENTER COMMANDMODE. |***\n");
|
||||
}
|
||||
KEYBOARD_ClrBuffer();
|
||||
}
|
||||
|
||||
void DEBUG_DrawScreen(void) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: sdlmain.cpp,v 1.87 2005-07-28 19:53:42 c2woody Exp $ */
|
||||
/* $Id: sdlmain.cpp,v 1.88 2005-09-18 19:50:03 c2woody Exp $ */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
@ -41,6 +41,7 @@
|
|||
#include "debug.h"
|
||||
#include "mapper.h"
|
||||
#include "vga.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
//#define DISABLE_JOYSTICK
|
||||
|
||||
|
@ -214,6 +215,7 @@ void GFX_SetTitle(Bits cycles,Bits frameskip,bool paused){
|
|||
static void PauseDOSBox(void) {
|
||||
GFX_SetTitle(-1,-1,true);
|
||||
bool paused = true;
|
||||
KEYBOARD_ClrBuffer();
|
||||
SDL_Delay(500);
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: keyboard.cpp,v 1.32 2005-08-24 16:06:18 c2woody Exp $ */
|
||||
/* $Id: keyboard.cpp,v 1.33 2005-09-18 19:50:03 c2woody Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "keyboard.h"
|
||||
|
@ -72,7 +72,7 @@ static void KEYBOARD_TransferBuffer(Bitu val) {
|
|||
}
|
||||
|
||||
|
||||
static void KEYBOARD_ClrBuffer(void) {
|
||||
void KEYBOARD_ClrBuffer(void) {
|
||||
keyb.used=0;
|
||||
keyb.pos=0;
|
||||
PIC_RemoveEvents(KEYBOARD_TransferBuffer);
|
||||
|
@ -309,6 +309,7 @@ void KEYBOARD_AddKey(KBD_KEYS keytype,bool pressed) {
|
|||
case KBD_kp0:ret=82;break;
|
||||
case KBD_kpperiod:ret=83;break;
|
||||
|
||||
case KBD_extra_lt_gt:ret=86;break;
|
||||
case KBD_f11:ret=87;break;
|
||||
case KBD_f12:ret=88;break;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static Bitu call_int16,call_irq1;
|
|||
|
||||
/* Nice table from BOCHS i should feel bad for ripping this */
|
||||
#define none 0
|
||||
#define MAX_SCAN_CODE 0x53
|
||||
#define MAX_SCAN_CODE 0x58
|
||||
static struct {
|
||||
Bit16u normal;
|
||||
Bit16u shift;
|
||||
|
@ -112,14 +112,19 @@ static struct {
|
|||
{ 0x4900, 0x4939, 0x8400, 0x0009 }, /* 9 PgUp */
|
||||
{ 0x4a2d, 0x4a2d, none, none }, /* - */
|
||||
{ 0x4b00, 0x4b34, 0x7300, 0x0004 }, /* 4 Left */
|
||||
{ 0x4c00, 0x4c35, none, 0x0005 }, /* 5 */
|
||||
{ 0x4cf0, 0x4c35, none, 0x0005 }, /* 5 */
|
||||
{ 0x4d00, 0x4d36, 0x7400, 0x0006 }, /* 6 Right */
|
||||
{ 0x4e2b, 0x4e2b, none, none }, /* + */
|
||||
{ 0x4f00, 0x4f31, 0x7500, 0x0001 }, /* 1 End */
|
||||
{ 0x5000, 0x5032, none, 0x0002 }, /* 2 Down */
|
||||
{ 0x5100, 0x5133, 0x7600, 0x0003 }, /* 3 PgDn */
|
||||
{ 0x5200, 0x5230, none, 0x0000 }, /* 0 Ins */
|
||||
{ 0x5300, 0x532e, none, none } /* Del */
|
||||
{ 0x5300, 0x532e, none, none }, /* Del */
|
||||
{ none, none, none, none },
|
||||
{ none, none, none, none },
|
||||
{ 0x565c, 0x567c, none, none }, /* (102-key) */
|
||||
{ 0x8500, 0x8700, 0x8900, 0x8b00 }, /* F11 */
|
||||
{ 0x8600, 0x8800, 0x8a00, 0x8c00 } /* F12 */
|
||||
};
|
||||
|
||||
static void add_key(Bit16u code) {
|
||||
|
@ -285,10 +290,10 @@ static Bitu IRQ1_Handler(void) {
|
|||
case 0xba:flags1 &=~0x40;leds &=~0x04;break;
|
||||
case 0x45:
|
||||
if (flags3 &0x01) {
|
||||
flags3 &=0x01;
|
||||
flags3 &=~0x01;
|
||||
mem_writeb(BIOS_KEYBOARD_FLAGS3,flags3);
|
||||
if ((flags2&8)==0) {
|
||||
mem_writeb(BIOS_KEYBOARD_FLAGS2,flags2|8);
|
||||
mem_writeb(BIOS_KEYBOARD_FLAGS3,flags3);
|
||||
IO_Write(0x20,0x20);
|
||||
while (mem_readb(BIOS_KEYBOARD_FLAGS2)&8) CALLBACK_Idle(); // pause loop
|
||||
reg_ip+=4; // skip out 20,20
|
||||
|
@ -302,7 +307,7 @@ static Bitu IRQ1_Handler(void) {
|
|||
break; /* Num Lock */
|
||||
case 0xc5:
|
||||
if (flags3 &0x01) {
|
||||
flags3 &=0x01;
|
||||
flags3 &=~0x01;
|
||||
} else {
|
||||
flags1 &=~0x20;
|
||||
leds &=~0x02;
|
||||
|
|
Loading…
Add table
Reference in a new issue