From c1fd235522dfc09933e6eadd9eaa7b3590e3110a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Thu, 22 Dec 2005 20:37:20 +0000 Subject: [PATCH] use fixed keyboard buffer start/end for old bioses (ApplePanic booter); enable PCJr selection Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2421 --- src/dosbox.cpp | 5 +++-- src/ints/bios_keyboard.cpp | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 28da68d6..c2d5294f 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dosbox.cpp,v 1.90 2005-11-16 20:27:39 c2woody Exp $ */ +/* $Id: dosbox.cpp,v 1.91 2005-12-22 20:37:20 c2woody Exp $ */ #include #include @@ -179,6 +179,7 @@ static void DOSBOX_RealInit(Section * sec) { else mtype=section->Get_string("machine"); if (strcasecmp(mtype,"cga")==0) machine=MCH_CGA; else if (strcasecmp(mtype,"tandy")==0) machine=MCH_TANDY; + else if (strcasecmp(mtype,"pcjr")==0) machine=MCH_PCJR; else if (strcasecmp(mtype,"hercules")==0) machine=MCH_HERC; else if (strcasecmp(mtype,"vga")==0) machine=MCH_VGA; else LOG_MSG("DOSBOX:Unknown machine type %s",mtype); @@ -216,7 +217,7 @@ void DOSBOX_Init(void) { MSG_Add("DOSBOX_CONFIGFILE_HELP", "language -- Select another language file.\n" "memsize -- Amount of memory dosbox has in megabytes.\n" - "machine -- The type of machine tries to emulate:hercules,cga,tandy,vga.\n" + "machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.\n" "captures -- Directory where things like wave,midi,screenshot get captured.\n" ); diff --git a/src/ints/bios_keyboard.cpp b/src/ints/bios_keyboard.cpp index ed0aa613..80cb1798 100644 --- a/src/ints/bios_keyboard.cpp +++ b/src/ints/bios_keyboard.cpp @@ -130,8 +130,14 @@ static struct { static bool add_key_forced(Bit16u code) { if (mem_readb(BIOS_KEYBOARD_FLAGS2)&8) return true; Bit16u start,end,head,tail,ttail; - start=mem_readw(BIOS_KEYBOARD_BUFFER_START); - end =mem_readw(BIOS_KEYBOARD_BUFFER_END); + if (machine==MCH_PCJR) { + /* should be done for cga and others as well, to be tested */ + start=0x1e; + end=0x3e; + } else { + start=mem_readw(BIOS_KEYBOARD_BUFFER_START); + end =mem_readw(BIOS_KEYBOARD_BUFFER_END); + } head =mem_readw(BIOS_KEYBOARD_BUFFER_HEAD); tail =mem_readw(BIOS_KEYBOARD_BUFFER_TAIL); ttail=tail+2; @@ -152,8 +158,14 @@ static void add_key(Bit16u code) { static bool get_key(Bit16u &code) { Bit16u start,end,head,tail,thead; - start=mem_readw(BIOS_KEYBOARD_BUFFER_START); - end =mem_readw(BIOS_KEYBOARD_BUFFER_END); + if (machine==MCH_PCJR) { + /* should be done for cga and others as well, to be tested */ + start=0x1e; + end=0x3e; + } else { + start=mem_readw(BIOS_KEYBOARD_BUFFER_START); + end =mem_readw(BIOS_KEYBOARD_BUFFER_END); + } head =mem_readw(BIOS_KEYBOARD_BUFFER_HEAD); tail =mem_readw(BIOS_KEYBOARD_BUFFER_TAIL);