Previous 15994 Revisions Next

r10522 Sunday 20th February, 2011 at 18:06:38 UTC by Miodrag Milanović
- Improved artwork for milano driver [Ralf Schafer]
- polgar driver clean up
- Enable one click capture moves in mboard
[artwork]milano.zip
[src/mess/drivers]polgar.c
[src/mess/machine]mboard.c

src/mess/machine/mboard.c
r10521r10522
3232static UINT16 Line18_LED;
3333static UINT16 Line18_REED;
3434
35static int led_updates;
36
3537static MOUSE_HOLD mouse_hold;
3638
37static int read_board_flag = TRUE;
38
3939static int get_first_bit(UINT8 data)
4040{
4141   int i;
r10521r10522
9191
9292*/
9393
94 led_updates=0;   
95
9496/* looking for cleared bit in mask Line18_REED => current line */
9597
9698 if (data && Line18_REED)
r10521r10522
102104      for ( i_AH = 0; i_AH < 8; i_AH = i_AH + 1)
103105         if (IsPiece(64-(i_18*8 + 8-i_AH)))
104106            data &= ~(1 << i_AH);         // clear bit
105
106      read_board_flag = TRUE;
107107 }
108108
109109   return data;
110110}
111111
112112
113static void write_board( running_machine *machine, UINT8 data)
113static void write_board(UINT8 data)
114114{
115115
116116   Line18_REED=data;
117   Line18_LED = data;
117118
118   if (read_board_flag && !strcmp(machine->m_game.name,"glasgow") ) //HACK
119      Line18_LED = 0;
120   else
121      Line18_LED = data;
122
123    read_board_flag = FALSE;
124
125119   if (data == 0xff)
126120      mboard_key_selector = 0;
127121}
128122
129123
130124
131static void write_LED(UINT8 data)
125static void write_LED(running_machine *machine, UINT8 data)
132126{
133127   int i;
134128   UINT8 i_AH, i_18;
135129   UINT8 LED;
136130
137131   mboard_lcd_invert = 1;
132
138133/*
139134
140135Example: turn led E2 on
r10521r10522
147142   for (i=0; i < 64; i++)                     /* all  LED's off */
148143      output_set_led_value(i, 0);
149144
145   led_updates++;
146   if ( (!strcmp(machine->m_game.name,"glasgow")) && led_updates <= 3) // HACK Change between board scan and trigger LED's
147      return;                                             // cause problems in glasgow emulation
148
150149    if (Line18_LED)
151150    {
152151      for (i_AH = 0; i_AH < 8; i_AH++)            /* turn  LED on depending on bit masks */
r10521r10522
196195
197196WRITE8_HANDLER( mboard_write_board_8 )
198197{
199   write_board(space->machine,data);
198   write_board(data);
200199   logerror("Write Board Port  Data = %02x\n  ",data);
201200}
202201
203202WRITE16_HANDLER( mboard_write_board_16 )
204203{
205   if (data && 0xff) write_board(space->machine,data);
204   if (data && 0xff) write_board(data);
206205   logerror("write board 16 %08x\n",data);
207   write_board(space->machine,data>>8);
206   write_board(data>>8);
208207}
209208
210209WRITE32_HANDLER( mboard_write_board_32 )
211210{
212211   data |= data << 24;
213212   logerror("write board 32 o: %08x d: %08x\n",offset,data);
214   write_board(space->machine,data>>24);
213   write_board(data>>24);
215214}
216215
217216WRITE8_HANDLER( mboard_write_LED_8 )
218217{
219   write_LED(data);
218   write_LED(space->machine,data);
220219   cpu_spinuntil_time(space->cpu, attotime::from_usec(7));
221220}
222221
223222WRITE16_HANDLER( mboard_write_LED_16 )
224223{
225    write_LED(data >> 8);
224    write_LED(space->machine,data >> 8);
226225    cpu_spinuntil_time(space->cpu, attotime::from_usec(9));
227226}
228227
229228WRITE32_HANDLER( mboard_write_LED_32 )
230229{
231230   data = data | data << 24;
232   write_LED(data >> 24);
231   write_LED(space->machine,data >> 24);
233232   cpu_spinuntil_time(space->cpu, attotime::from_usec(20));
234233}
235234
r10521r10522
366365      if (!(pos2num_res < 8))
367366         logerror("Position out of bound!");
368367
369      else if ((mouse_hold.piece) && (!IsPiece(field)))
368      else if (mouse_hold.piece) // && (!IsPiece(field))) capture move
370369      {
371370         /* Moving a piece onto a blank */
372371         m_board[field] = mouse_hold.piece;
r10521r10522
414413         mouse_hold.piece = 0;
415414         mouse_hold.border_piece = FALSE;
416415      }
417
418416      return;
419417   }
420418
419
421420/* check additional buttons */
422421   if (data == 0xff)
423422   {
src/mess/drivers/polgar.c
r10521r10522
128128   {
129129      for (i=0;i<8;i++)
130130      output_set_led_value(10+i,!BIT(state->latch_data,7-i));
131   }else if (!data)
131   }
132   else if (!data && (!strcmp(space->machine->m_game.name,"milano")))
132133      for (i=0;i<8;i++)
133134      {
134135         output_set_led_value(i,!BIT(state->latch_data,i));
r10521r10522
242243#endif
243244   data=input_port_read(space->machine, keynames[0][offset]);
244245
245//   logerror("read_keys = %s Data = %d\n  ", keynames[0][offset], data);
246   //logerror("read_keys: Data = %d offset = %d\n  ",data, offset);
247
248246   // logerror("Keyboard Port = %s Data = %d\n  ", ((state->led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data);
249247   return data | 0x7f;
250248}
r10521r10522
322320   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
323321   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
324322   PORT_START("LINE3")
325   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_1)
326   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_2)
327   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_3)
328   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_4)
329   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_5)
330   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_6)
331   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_7)
332   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)   PORT_CODE(KEYCODE_8)
323   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
324   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
325   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
326   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
327   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
328   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
329   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
330   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
333331   PORT_START("LINE4")
334332   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
335333   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
artwork/milano.zip

Previous 15994 Revisions Next


© 1998-2018 The MESS Team