Previous 15994 Revisions Next

r5562 Wednesday 2nd September, 2009 at 21:38:13 UTC by Angelo Salese
[X1]: Fixed double pressed inputs
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5561r5562
356356   if(key_flag == 1)
357357   {
358358      key_flag = 0;
359      return 0x82;
359      return 0x82; //TODO: this is for shift/ctrl/kana lock etc.
360360   }
361361
362362   sub_cmd_length--;
r5561r5562
13771377static TIMER_CALLBACK(keyboard_callback)
13781378{
13791379   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1380   UINT8 key_press;
1381   static UINT8 old_key_val;
13801382
13811383   if(key_irq_vector)
13821384   {
1383      if(check_keyboard_press(machine))
1385      key_press = check_keyboard_press(machine);
1386      if(key_press && key_press != old_key_val)
13841387      {
1388         old_key_val = key_press;
13851389         sub_io_w(space,0,0xe6);
13861390         cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
13871391      }
1392      else
1393      {
1394         old_key_val = key_press;
1395         key_flag = 0;
1396      }
13881397   }
13891398}
13901399
r5561r5562
14151424   pcg_index[0] = pcg_index[1] = pcg_index[2] = 0;
14161425
14171426   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), x1_irq_callback);
1418   timer_pulse(machine, ATTOTIME_IN_HZ(2400), NULL, 0, keyboard_callback);
1427   timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback);
14191428}
14201429
14211430static PALETTE_INIT(x1)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team