Previous 15994 Revisions Next

r2835 Monday 9th June, 2008 at 09:22:55 UTC by Miodrag Milanović
[UT88] Keyboard fix
[src/mess/machine]ut88.c

src/mess/machine/ut88.c
r2834r2835
1313#include "devices/cassette.h"
1414#include "machine/8255ppi.h"
1515
16static int ut88_8255_porta;
16static int ut88_keyboard_mask;
1717
1818/* Driver initialization */
1919DRIVER_INIT(ut88)
r2834r2835
2727
2828READ8_HANDLER (ut88_8255_portb_r )
2929{
30   switch (ut88_8255_porta ^ 0xff) {
31        case 0x01 : return input_port_read(machine, "LINE0");break;
32        case 0x02 : return input_port_read(machine, "LINE1");break;
33        case 0x04 : return input_port_read(machine, "LINE2");break;
34        case 0x08 : return input_port_read(machine, "LINE3");break;
35        case 0x10 : return input_port_read(machine, "LINE4");break;
36        case 0x20 : return input_port_read(machine, "LINE5");break;
37        case 0x40 : return input_port_read(machine, "LINE6");break;
38        case 0x80 : return input_port_read(machine, "LINE7");break;
39   }   
40   return 0xff;
30   UINT8 key = 0xff;
31   if ((ut88_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
32   if ((ut88_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
33   if ((ut88_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
34   if ((ut88_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
35   if ((ut88_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
36   if ((ut88_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
37   if ((ut88_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
38   if ((ut88_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
39   return key;
4140}
4241
4342READ8_HANDLER (ut88_8255_portc_r )
r2834r2835
4746
4847WRITE8_HANDLER (ut88_8255_porta_w )
4948{
50   ut88_8255_porta = data;   
49   ut88_keyboard_mask = data ^ 0xff;   
5150}
5251
5352const ppi8255_interface ut88_ppi8255_interface =
r2834r2835
6968{
7069   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, ut88_reset);
7170   memory_set_bank(1, 1);   
72   ut88_8255_porta = 0;
71   ut88_keyboard_mask = 0;
7372}
7473
7574

Previous 15994 Revisions Next


© 1998-2018 The MESS Team