Previous 15994 Revisions Next

r2460 Thursday 24th April, 2008 at 19:34:57 UTC by Stefano Priore
[LISA] Convert to tagged input and re-apply core changes overwritten by previous update
[src/mess/drivers]lisa.c
[src/mess/machine]lisa.c

src/mess/machine/lisa.c
r2459r2460
391391/* keyboard matrix to detect transition */
392392static int key_matrix[8];
393393
394static void scan_keyboard( void )
394static void scan_keyboard(running_machine *machine)
395395{
396396   int i, j;
397397   int keybuf;
398398   UINT8 keycode;
399   char port[6];
399400
400401   if (! COPS_force_unplug)
401402      for (i=0; i<8; i++)
402403      {
403         keybuf = readinputport(i+2);
404         sprintf(port, "LINE%d", i);
405         keybuf = input_port_read(machine, port);
404406
405407         if (keybuf != key_matrix[i])
406408         {   /* if state has changed, find first bit which has changed */
r2459r2460
445447   /*if (COPS_force_unplug)
446448      return;*/   /* ???? */
447449
448   new_mx = readinputport(0);
449   new_my = readinputport(1);
450   new_mx = input_port_read(machine, "MOUSE_X");
451   new_my = input_port_read(machine, "MOUSE_Y");
450452
451453   /* see if it moved in the x coord */
452454   if (new_mx != last_mx)
r2459r2460
13031305      set_VTIR(machine, 0);
13041306   
13051307   /* do keyboard scan */
1306   scan_keyboard();
1308   scan_keyboard(machine);
13071309}
13081310
13091311/*
r2459r2460
17461748         COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address));
17471749         if (diag2)
17481750         {
1749            if ((ACCESSING_LSB)
1751            if ((ACCESSING_BITS_0_7)
17501752               && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17511753            {
17521754               bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
17531755               bad_parity_count++;
17541756            }
1755            if ((ACCESSING_MSB)
1757            if ((ACCESSING_BITS_8_15)
17561758               && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17571759            {
17581760               bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
r2459r2460
17611763         }
17621764         else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
17631765         {
1764            if ((ACCESSING_LSB)
1766            if ((ACCESSING_BITS_0_7)
17651767               && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17661768            {
17671769               bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
17681770               bad_parity_count--;
17691771            }
1770            if ((ACCESSING_MSB)
1772            if ((ACCESSING_BITS_8_15)
17711773               && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17721774            {
17731775               bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
r2459r2460
17851787         COMBINE_DATA((UINT16 *) (lisa_ram_ptr + address));
17861788         if (diag2)
17871789         {
1788            if ((ACCESSING_LSB)
1790            if ((ACCESSING_BITS_0_7)
17891791               && ! (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
17901792            {
17911793               bad_parity_table[address >> 3] |= 0x1 << (address & 0x7);
17921794               bad_parity_count++;
17931795            }
1794            if ((ACCESSING_MSB)
1796            if ((ACCESSING_BITS_8_15)
17951797               && ! (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
17961798            {
17971799               bad_parity_table[address >> 3] |= 0x2 << (address & 0x7);
r2459r2460
18001802         }
18011803         else if (bad_parity_table[address >> 3] & (0x3 << (address & 0x7)))
18021804         {
1803            if ((ACCESSING_LSB)
1805            if ((ACCESSING_BITS_0_7)
18041806               && (bad_parity_table[address >> 3] & (0x1 << (address & 0x7))))
18051807            {
18061808               bad_parity_table[address >> 3] &= ~ (0x1 << (address & 0x7));
18071809               bad_parity_count--;
18081810            }
1809            if ((ACCESSING_MSB)
1811            if ((ACCESSING_BITS_8_15)
18101812               && (bad_parity_table[address >> 3] & (0x2 << (address & 0x7))))
18111813            {
18121814               bad_parity_table[address >> 3] &= ~ (0x2 << (address & 0x7));
r2459r2460
19491951      {
19501952         if (! (offset & 0x400))
19511953         {
1952            /*if (ACCESSING_LSB)*/   /* Geez, who cares ? */
1954            /*if (ACCESSING_BITS_0_7)*/   /* Geez, who cares ? */
19531955               answer = lisa_fdc_ram[offset & 0x03ff] & 0xff;   /* right ??? */
19541956         }
19551957      }
r2459r2460
19661968
19671969         case 2:   /* parallel port */
19681970            /* 1 VIA located at 0xD901 */
1969            if (ACCESSING_LSB)
1971            if (ACCESSING_BITS_0_7)
19701972               return via_read(1, (offset >> 2) & 0xf);
19711973            break;
19721974
19731975         case 3:   /* keyboard/mouse cops via */
19741976            /* 1 VIA located at 0xDD81 */
1975            if (ACCESSING_LSB)
1977            if (ACCESSING_BITS_0_7)
19761978               return via_read(0, offset & 0xf);
19771979            break;
19781980         }
r2459r2460
20752077         /* Floppy Disk Controller shared RAM */
20762078         if (! (offset & 0x0400))
20772079         {
2078            if (ACCESSING_LSB)
2080            if (ACCESSING_BITS_0_7)
20792081               lisa_fdc_ram[offset & 0x03ff] = data & 0xff;
20802082         }
20812083      }
r2459r2460
20882090            break;
20892091
20902092         case 2:   /* paralel port */
2091            if (ACCESSING_LSB)
2093            if (ACCESSING_BITS_0_7)
20922094               via_write(1, (offset >> 2) & 0xf, data & 0xff);
20932095            break;
20942096
20952097         case 3:   /* keyboard/mouse cops via */
2096            if (ACCESSING_LSB)
2098            if (ACCESSING_BITS_0_7)
20972099               via_write(0, offset & 0xf, data & 0xff);
20982100            break;
20992101         }
src/mess/drivers/lisa.c
r2459r2460
8383
8484
8585static INPUT_PORTS_START( lisa )
86   PORT_START /* Mouse - X AXIS */
86   PORT_START_TAG("MOUSE_X") /* Mouse - X AXIS */
8787   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
8888
89   PORT_START /* Mouse - Y AXIS */
89   PORT_START_TAG("MOUSE_Y") /* Mouse - Y AXIS */
9090   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
9191
9292   /* pseudo-input ports with (unverified) keyboard layout */
9393
94   PORT_START   /* 2 */
94   PORT_START_TAG("LINE0")/* 2 */
9595   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_UNUSED)
9696
9797   PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("mouse button")
9898
99   PORT_START   /* 3 */
99   PORT_START_TAG("LINE1")   /* 3 */
100100   PORT_BIT(0xFFFF, IP_ACTIVE_HIGH, IPT_UNUSED)
101101
102   PORT_START   /* 4 */
102   PORT_START_TAG("LINE2")   /* 4 */
103103   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Clear") PORT_CODE(KEYCODE_DEL)
104104   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_NUMLOCK)
105105   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+ (KP)") PORT_CODE(KEYCODE_SLASH_PAD)
r2459r2460
117117   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD)
118118   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter (KP)") PORT_CODE(KEYCODE_ENTER_PAD)
119119
120   PORT_START   /* 5 */
120   PORT_START_TAG("LINE3")   /* 5 */
121121   PORT_BIT(0xFFFF, IP_ACTIVE_HIGH, IPT_UNUSED)
122122
123   PORT_START   /* 6 */
123   PORT_START_TAG("LINE4")   /* 6 */
124124   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS)
125125   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS)
126126   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\") PORT_CODE(KEYCODE_BACKSLASH)
r2459r2460
143143   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Option") PORT_CODE(KEYCODE_RALT)
144144   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_UNUSED)
145145
146   PORT_START   /* 7 */
146   PORT_START_TAG("LINE5")   /* 7 */
147147   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
148148   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)
149149   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
r2459r2460
161161   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP)
162162   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O)
163163
164   PORT_START   /* 8 */
164   PORT_START_TAG("LINE6")   /* 8 */
165165   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
166166   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
167167   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
r2459r2460
179179   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
180180   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
181181
182   PORT_START   /* 9 */
182   PORT_START_TAG("LINE7")   /* 9 */
183183   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
184184   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
185185   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team