Previous 15994 Revisions Next

r3496 Monday 27th October, 2008 at 15:12:54 UTC by Wilbert Pol
[TI990] Updated keyboard code to not depend on signedness of the char type.
[src/mess/video]911_vdt.c

src/mess/video/911_vdt.c
r3495r3496
567567
568568   static unsigned char repeat_timer;
569569   enum { repeat_delay = 5 /* approx. 1/10s */ };
570   static char last_key_pressed = -1;
570   static UINT8 last_key_pressed = 0x80;
571571   static modifier_state_t last_modifier_state;
572572   static char foreign_mode;
573573
r3495r3496
634634      /* reset REPEAT timer if the REPEAT key is not pressed */
635635      repeat_timer = 0;
636636
637   if ((last_key_pressed >= 0) && (key_buf[last_key_pressed >> 4] & (1 << (last_key_pressed & 0xf))))
637   if (! (last_key_pressed & 0x80) && (key_buf[last_key_pressed >> 4] & (1 << (last_key_pressed & 0xf))))
638638   {
639639      /* last key has not been released */
640640      if (modifier_state == last_modifier_state)
r3495r3496
661661   }
662662   else
663663   {
664      last_key_pressed = -1;
664      last_key_pressed = 0x80;
665665
666666      if (vdt[unit].keyboard_data_ready)
667667      {   /* keyboard buffer full */
r3495r3496
678678                  last_key_pressed = (i << 4) | j;
679679                  last_modifier_state = modifier_state;
680680
681                  vdt[unit].keyboard_data = (int)key_translate[vdt[unit].model][modifier_state][(int)last_key_pressed];
681                  vdt[unit].keyboard_data = (int)key_translate[vdt[unit].model][modifier_state][last_key_pressed];
682682                  vdt[unit].keyboard_data_ready = 1;
683683                  if (vdt[unit].keyboard_interrupt_enable)
684684                     (*vdt[unit].int_callback)(1);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team