Previous 15994 Revisions Next

r3497 Monday 27th October, 2008 at 15:15:10 UTC by Wilbert Pol
[TI990] Updated keyboard code to not depend on signedness of the char type.
[src/mess/video]733_asr.c

src/mess/video/733_asr.c
r3496r3497
617617
618618   static unsigned char repeat_timer;
619619   enum { repeat_delay = 5 /* approx. 1/10s */ };
620   static char last_key_pressed = -1;
620   static UINT8 last_key_pressed = 0x80;
621621   static modifier_state_t last_modifier_state;
622622
623623   UINT16 key_buf[6];
r3496r3497
655655      /* reset REPEAT timer if the REPEAT key is not pressed */
656656      repeat_timer = 0;
657657
658   if ((last_key_pressed >= 0) && (key_buf[last_key_pressed >> 4] & (1 << (last_key_pressed & 0xf))))
658   if ( ! (last_key_pressed & 0x80) && (key_buf[last_key_pressed >> 4] & (1 << (last_key_pressed & 0xf))))
659659   {
660660      /* last key has not been released */
661661      if (modifier_state == last_modifier_state)
r3496r3497
684684   }
685685   else
686686   {
687      last_key_pressed = -1;
687      last_key_pressed = 0x80;
688688
689689      if (asr[unit].status & AS_rrq_mask)
690690      {   /* keyboard buffer full */
r3496r3497
701701                  last_key_pressed = (i << 4) | j;
702702                  last_modifier_state = modifier_state;
703703
704                  asr[unit].recv_buf = (int)key_translate[modifier_state][(int)last_key_pressed];
704                  asr[unit].recv_buf = (int)key_translate[modifier_state][last_key_pressed];
705705                  asr[unit].status |= AS_rrq_mask;
706706                  asr[unit].new_status_flag = 1;   /* right??? */
707707                  asr_field_interrupt(unit);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team