I made some changes to keyboard.cc and to keyboard.h.  I hope that I got the
diff right for this!!!  I added support for escaped characters (Pg-UP, Pg-DN,
Insert....etc) by making the scandcode values 16-bit.  This should help some.
I also added some more scancodes (those just mentioned plus some).

Index: user/plugins/bochs/iodev/keyboard.cc
===================================================================
RCS file: /cvsroot-plex86/plex86/user/plugins/bochs/iodev/keyboard.cc,v
retrieving revision 1.5
diff -u -r1.5 keyboard.cc
--- user/plugins/bochs/iodev/keyboard.cc        2000/12/14 15:58:51     1.5
+++ user/plugins/bochs/iodev/keyboard.cc        2001/02/23 06:50:29
@@ -554,7 +554,11 @@
   void
 bx_keyb_c::gen_scancode(Bit32u   key)
 {
-  Bit8u   scancode;
+  //this change makes the scancodes 16-bit
+  //I started to add more scancodes in the section below also
+  //Drew Northup, N1XIM 2001.02.23 (yyyy.mm.dd)
+  //Bit8u   scancode;
+  Bit16u  scancode;
 
   if (bx_dbg.record_io) {
        fprintf((FILE*)bx_dbg.record_io, "gen_scancode %lld %x\n", 
bx_pc_system.time_ticks(), key);
@@ -660,24 +664,24 @@
     case BX_KEY_KP_UP:         scancode = 0x48; break;
     case BX_KEY_KP_DOWN:       scancode = 0x50; break;
 
-    case BX_KEY_INSERT:
-      bx_printf("# Grey insert key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_DELETE:
-      bx_printf("# Grey delete key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_HOME:
-      bx_printf("# Grey home key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_END:
-      bx_printf("# Grey end key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_PAGE_UP:
-      bx_printf("# Grey page-up key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_PAGE_DOWN:
-      bx_printf("# Grey page-down key not on 83-key keyboard\n");
-      return;
+    case BX_KEY_INSERT:        scancode = 0xe052; break;
+      //bx_printf("# Grey insert key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_DELETE:        scancode = 0xE053; break;
+      //bx_printf("# Grey delete key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_HOME:          scancode = 0xe047; break;
+      //bx_printf("# Grey home key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_END:           scancode = 0xe04f; break;
+      //bx_printf("# Grey end key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_PAGE_UP:       scancode = 0xe049; break;
+      //bx_printf("# Grey page-up key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_PAGE_DOWN:     scancode = 0xe051; break;
+      //bx_printf("# Grey page-down key not on 83-key keyboard\n");
+      //return;
 
     case BX_KEY_KP_INSERT:        scancode = 0x52; break;
     case BX_KEY_KP_DELETE:        scancode = 0x53; break;
@@ -689,15 +693,15 @@
     case BX_KEY_KP_ADD:           scancode = 0x4e; break;
     case BX_KEY_KP_SUBTRACT:      scancode = 0x4a; break;
     case BX_KEY_KP_5:             scancode = 0x4c; break;
-    case BX_KEY_KP_ENTER:
-      bx_printf("# Grey Enter key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_KP_MULTIPLY:
-      bx_printf("# Grey Multiply key not on 83-key keyboard\n");
-      return;
-    case BX_KEY_KP_DIVIDE:
-      bx_printf("# Grey Divide key not on 83-key keyboard\n");
-      return;
+    case BX_KEY_KP_ENTER:         scancode = 0xe01c; break;
+      //bx_printf("# Grey Enter key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_KP_MULTIPLY:      scancode = 0x37; break;
+      //bx_printf("# Grey Multiply key not on 83-key keyboard\n");
+      //return;
+    case BX_KEY_KP_DIVIDE:        scancode = 0xe035; break;
+      //bx_printf("# Grey Divide key not on 83-key keyboard\n");
+      //return;
     case BX_KEY_NUM_LOCK:         scancode = 0x45; break;
 
     case BX_KEY_F1:               scancode = 0x3b; break;
@@ -836,7 +840,7 @@
 
 
   void
-bx_keyb_c::kbd_enQ(Bit8u   scancode)
+bx_keyb_c::kbd_enQ(Bit16u   scancode) //I changed this to 16-bits Drew Northup, N1XIM 
+2001.02.23
 {
   int tail;
 
Index: user/plugins/bochs/iodev/keyboard.h
===================================================================
RCS file: /cvsroot-plex86/plex86/user/plugins/bochs/iodev/keyboard.h,v
retrieving revision 1.2
diff -u -r1.2 keyboard.h
--- user/plugins/bochs/iodev/keyboard.h 2000/08/13 20:25:20     1.2
+++ user/plugins/bochs/iodev/keyboard.h 2001/02/23 06:50:29
@@ -81,7 +81,7 @@
       Boolean aux_clock_enabled;
       Boolean allow_irq1;
       Boolean allow_irq12;
-      Bit8u   kbd_output_buffer;
+      Bit16u   kbd_output_buffer; //changed to 16-bit Drew Northup, N1XIM 2001.02.23
       Bit8u   aux_output_buffer;
       Bit8u   last_comm;
       Bit8u   expecting_port60h;
@@ -170,7 +170,7 @@
   BX_KEY_SMF void     set_aux_clock_enable(Bit8u   value);
   BX_KEY_SMF void     kbd_ctrl_to_kbd(Bit8u   value);
   BX_KEY_SMF void     kbd_ctrl_to_mouse(Bit8u   value);
-  BX_KEY_SMF void     kbd_enQ(Bit8u   scancode);
+  BX_KEY_SMF void     kbd_enQ(Bit16u   scancode); //changed to 16-bit Drew Northup, 
+N1XIM 2001.02.23
   BX_KEY_SMF void     kbd_enQ_imm(Bit8u   val);
   BX_KEY_SMF void     activate_timer(void);
   BX_KEY_SMF void     controller_enQ(Bit8u   data, unsigned source);

Reply via email to