Previous 15994 Revisions Next

r9387 Friday 15th October, 2010 at 04:05:44 UTC by Miodrag Milanović
New System Drivers Supported:
-----------------------------
- Mephisto MM2 [Ralf Schaefer]
- Mephisto Vancouver 16 Bit [Ralf Schaefer]

-Enable the chess board emulation for the following exitsting emulations.
glasgow (was already exiting, just
renewed),dallas,dallas16,dallas32,amsted,roma32,mm4,mm5,mm50,rebel5

- the mephisto chess board is defined as a machine (mboard).
- to reduce the artwork files glasgow, amsterd and mm4 are defined as PARENTS.
[artwork]amsterd.zip dallas.zip dallas16.zip dallas32.zip glasgow.zip mm4.zip mm5.zip mm50.zip rebel5.zip roma32.zip van16.zip*
[docs]messnew.txt
[src/mess]mess.mak messdriv.c
[src/mess/drivers]glasgow.c mephisto.c vancouver.c*
[src/mess/machine]mboard.c* mboard.h*

src/mess/machine/mboard.c
r0r9387
1/**********************************************************************
2
3 Mephisto Chess Computers
4
5**********************************************************************/
6#include "emu.h"
7#include "machine/mboard.h"
8
9UINT8 lcd_invert;
10UINT8 key_select;
11UINT8 key_selector;
12
13static const int start_board[64] =
14{
15   BR, BN, BB, BQ, BK, BB, BN, BR,
16   BP, BP, BP, BP, BP, BP, BP, BP,
17   EM, EM, EM, EM, EM, EM, EM, EM,
18   EM, EM, EM, EM, EM, EM, EM, EM,
19   EM, EM, EM, EM, EM, EM, EM, EM,
20   EM, EM, EM, EM, EM, EM, EM, EM,
21   WP, WP, WP, WP, WP, WP, WP, WP,
22   WR, WN, WB, WQ, WK, WB, WN, WR
23};
24
25static UINT8 border_pieces[12] = {WK,WQ,WR,WB,WN,WP,BK,BQ,BR,BB,BN,BP,};
26
27static int m_board[64];
28static int save_board[64];
29
30static UINT16 Line18_LED;
31static UINT16 Line18_REED;
32
33static MOUSE_HOLD mouse_hold;
34
35static int read_board_flag = TRUE;
36
37static int get_first_bit(UINT8 data)
38{
39   int i;
40
41   for (i = 0; i < 8; i++)
42      if (BIT(data, i))
43         return i;
44
45   return NOT_VALID;
46}
47
48static int get_first_cleared_bit(UINT8 data)
49{
50   int i;
51
52   for (i=0;i<8;i++)
53      if (!BIT(data, i))
54         return i;
55
56   return NOT_VALID;
57}
58
59static UINT8 read_board(void)
60{
61     UINT8 i_18, i_AH;
62     UINT8 data;
63
64     data = 0xff;
65
66/*
67
68Example board scan:
69Starting postion and pawn on E2 is lifted
70
71
72mask: 7f 0111 1111   Line 8
73data:  0 0000 0000   all fields occupied
74mask: bf 1011 1111   Line 7
75data:  0 0000 0000   all fields occupied
76mask: df 1101 1111   Line 6
77data: ff 1111 1111   all fields empty
78mask: ef 1110 1111   Line 5
79data: ff 1111 1111   all fields empty
80mask: f7 1111 0111   Line 4
81data: ff 1111 1111   all fields empty
82mask: fb 1111 1011   Line 3
83data: ff 1111 1111   all fields empty
84mask: fd 1111 1101   Line 2
85data: 10 0001 0000   E2 is empty rest is occupied
86mask: fe 1111 1110   Line 1
87data:  0 0000 0000   all fields occupied
88
89
90*/
91
92/* looking for cleared bit in mask Line18_REED => current line */
93
94 if (data && Line18_REED)
95 {
96      i_18=get_first_cleared_bit(Line18_REED);
97
98/* looking for a piece in this line and clear bit in data if found */
99
100      for ( i_AH = 0; i_AH < 8; i_AH = i_AH + 1)
101         if (IsPiece(64-(i_18*8 + 8-i_AH)))
102            data &= ~(1 << i_AH);         // clear bit
103
104      read_board_flag = TRUE;
105 }
106
107   return data;
108}
109
110
111static void write_board( running_machine *machine, UINT8 data)
112{
113
114   Line18_REED=data;
115
116   if (read_board_flag && !strcmp(machine->m_game.name,"glasgow") ) //HACK
117      Line18_LED = 0;
118   else
119      Line18_LED = data;
120   
121    read_board_flag = FALSE;
122
123   if (data == 0xff)
124      key_selector = 0;
125}
126
127
128
129static void write_LED(UINT8 data)
130{
131   int i;
132   UINT8 i_AH, i_18;
133   UINT8 LED;
134
135   lcd_invert = 1;
136/*
137
138Example: turn led E2 on
139
140mask:  fd 1111 1101   Line 2
141data:  10 0001 0000   Line E
142
143*/
144
145
146   for (i=0; i < 64; i++)                     /* all  LED's off */
147      output_set_led_value(i, 0);
148
149    if (Line18_LED)
150    {
151      for (i_AH = 0; i_AH < 8; i_AH++)            /* turn  LED on depending on bit masks */
152      {
153         if (BIT(data,i_AH))
154         {
155            for (i_18 = 0; i_18 < 8; i_18++)
156            {
157               LED = (i_18*8 + 8-i_AH-1);     
158               if (!(Line18_LED & (1 << i_18)))   /* cleared bit */
159                  output_set_led_value(LED, 1);
160               else
161                  output_set_led_value(LED, 0);
162            }
163         }
164      }
165   }
166
167}
168
169
170
171READ8_HANDLER( read_board_8 )
172{
173   UINT8 data;
174
175   data=read_board();
176   return data;
177}
178
179READ16_HANDLER( read_board_16 )
180{
181   UINT8 data;
182
183   data=read_board();
184   return data << 8;
185}
186
187READ32_HANDLER( read_board_32 )
188{
189   UINT8 data;
190
191   data=read_board();
192   return data<<24;
193}
194
195WRITE8_HANDLER( write_board_8 )
196{
197   write_board(space->machine,data);
198}
199
200WRITE16_HANDLER( write_board_16 )
201{
202   write_board(space->machine,data>>8);
203}
204
205WRITE32_HANDLER( write_board_32 )
206{
207   write_board(space->machine,data>>24);
208}
209
210WRITE8_HANDLER( write_LED_8 )
211{
212    write_LED(data);
213}
214
215WRITE16_HANDLER( write_LED_16 )
216{
217    write_LED(data >> 8);
218}
219
220WRITE32_HANDLER( write_LED_32 )
221{
222    write_LED(data >> 24);
223}
224
225TIMER_CALLBACK( update_artwork )
226{
227   check_board_buttons(machine);
228   set_artwork(machine);
229   set_boarder_pieces();
230}
231
232/* save states callback */
233
234STATE_PRESAVE( m_board_presave )
235{
236   int i;
237   for (i=0;i<64;i++)
238      save_board[i]=m_board[i];
239}
240
241STATE_POSTLOAD( m_board_postload )
242{
243   int i;
244   for (i=0;i<64;i++)
245      m_board[i]=save_board[i];
246
247}
248
249void mboard_savestate_register(running_machine *machine)
250{
251   state_save_register_global_array(machine,save_board);
252   state_save_register_postload(machine,m_board_postload,NULL);
253   state_save_register_presave(machine,m_board_presave,NULL);
254}
255
256void set_board( void )
257{
258   int i;
259   for (i=0;i<64;i++)
260      m_board[i]=start_board[i];
261}
262
263void clear_board( void )
264{
265   int i;
266   for (i=0;i<64;i++)
267      m_board[i]=EM;
268}
269
270void set_artwork ( running_machine *machine )
271{
272   int i;
273   for (i=0;i<64;i++)
274      output_set_indexed_value("P", i, m_board[i]);
275}
276
277void set_boarder_pieces (void)
278{
279   int i;
280   for (i=0;i<12;i++)
281      output_set_indexed_value("Q", i, border_pieces[i]);
282}
283
284void check_board_buttons ( running_machine *machine )
285{
286   int field;
287   int i;
288   UINT8 port_input=0;
289   UINT8 data = 0xff;
290   static const char *const keynames[] = { "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
291   static UINT8 board_row = 0;
292   static UINT16 mouse_down = 0;
293   UINT8 pos2num_res = 0;
294   board_row++;
295   board_row &= 7;
296   int click_on_boarder_piece=FALSE;
297
298
299/* check click on border pieces */
300   i=0;
301   port_input=input_port_read(machine, "B_BLACK");
302   if (port_input)
303   {
304      i=get_first_bit(port_input)+6;
305      click_on_boarder_piece=TRUE;
306   }
307
308   port_input=input_port_read(machine, "B_WHITE");
309   if (port_input)
310   {
311      i=get_first_bit(port_input);
312      click_on_boarder_piece=TRUE;
313   }
314
315   if (click_on_boarder_piece)
316   {
317      if (!mouse_down)
318      {
319         if (border_pieces[i] > 12 )      /* second click on selected border piece */
320         {
321            mouse_hold.border_piece=FALSE;
322            border_pieces[i]=border_pieces[i]-12;
323            mouse_hold.from=0;
324            mouse_hold.piece=0;
325         }
326         else if (!mouse_hold.piece)      /*select border piece */
327         {
328            if  (mouse_hold.border_piece)
329               border_pieces[mouse_hold.from]=border_pieces[mouse_hold.from]-12;
330
331            mouse_hold.from=i;
332            mouse_hold.piece=border_pieces[i];
333            border_pieces[i]=border_pieces[i]+12;
334            mouse_hold.border_piece=TRUE;
335         }
336
337         mouse_down = board_row + 1;
338
339      }
340      return;
341   }
342
343
344/* check click on board */
345   data = input_port_read_safe(machine, keynames[board_row], 0xff);
346
347   if ((data != 0xff) && (!mouse_down) )
348   {
349
350      pos2num_res = pos_to_num(data);
351      field=64-(board_row*8+8-pos2num_res);
352
353
354      if (!(pos2num_res < 8))
355         logerror("Position out of bound!");
356
357      else if ((mouse_hold.piece) && (!IsPiece(field)))
358      {
359         /* Moving a piece onto a blank */
360         m_board[field] = mouse_hold.piece;
361
362         if (mouse_hold.border_piece)
363         {
364            border_pieces[mouse_hold.from]=border_pieces[mouse_hold.from]-12;
365         }else if ( field != mouse_hold.from  )   /* Put a selected piece back to the source field */
366            m_board[mouse_hold.from] = 0;
367
368
369         mouse_hold.from  = 0;
370         mouse_hold.piece = 0;
371         mouse_hold.border_piece=FALSE;
372      }
373      else if ((!mouse_hold.piece) )
374      {
375         /* Picking up a piece */
376
377         if (IsPiece(field))
378         {
379            mouse_hold.from  = field;
380            mouse_hold.piece = m_board[field];
381            m_board[field] = m_board[field]+12;
382         }
383
384      }
385
386      mouse_down = board_row + 1;
387   }
388   else if ((data == 0xff) && (mouse_down == (board_row + 1)))   /* Wait for mouse to be released */
389      mouse_down = 0;
390
391/* check click on border - remove selected piece*/
392   if (input_port_read_safe(machine, "LINE10", 0x01))
393   {
394      if (mouse_hold.piece)
395      {
396         if (mouse_hold.border_piece)
397            border_pieces[mouse_hold.from]=border_pieces[mouse_hold.from]-12;
398         else
399            m_board[mouse_hold.from] = 0;
400
401         mouse_hold.from  = 0;
402         mouse_hold.piece = 0;
403         mouse_hold.border_piece = FALSE;
404      }
405         
406      return;
407   }
408
409/* check additional buttons */
410   if (data == 0xff)
411   {
412
413      port_input=input_port_read(machine, "B_BUTTONS");
414      if (port_input==0x01)
415      {
416         clear_board();
417         return;
418      }else if (port_input==0x02)
419      {
420         set_board();
421         return;
422      }
423
424
425   }
426
427}
428
429
src/mess/machine/mboard.h
r0r9387
1
2/**********************************************************************
3
4     Mephisto Chess Computers
5
6**********************************************************************/
7
8#ifndef __MBOARD_H__
9#define __MBOARD_H__
10
11#include "emu.h"
12
13
14/***************************************************************************
15    MACROS
16***************************************************************************/
17
18enum
19{
20   EM,      /*No piece*/
21   BP,
22   BN,
23   BB,
24   BR,
25   BQ,
26   BK,
27   WP,
28   WN,
29   WB,
30   WR,
31   WQ,
32   WK
33};
34
35#define NOT_VALID      99
36#define BOARDER_PIECE   64
37
38#define IsPiece(x)      ((m_board[x] >=1) && (m_board[x] <=12))
39
40#define IsBitSet(x,y)   ( y & (1<<x) )  //ersetzen durch BIT
41
42/***************************************************************************
43    TYPE DEFINITIONS
44***************************************************************************/
45
46typedef struct {
47   int border_piece;
48   UINT8 from;
49   UINT8 piece;
50} MOUSE_HOLD;
51
52/***************************************************************************
53    FUNCTION PROTOTYPES
54***************************************************************************/
55
56READ8_HANDLER( read_board_8 );
57WRITE8_HANDLER( write_board_8 );
58WRITE8_HANDLER( write_LED_8 );
59
60READ16_HANDLER( read_board_16 );
61WRITE16_HANDLER( write_board_16 );
62WRITE16_HANDLER( write_LED_16 );
63
64READ32_HANDLER( read_board_32 );
65WRITE32_HANDLER( write_board_32 );
66WRITE32_HANDLER( write_LED_32 );
67
68TIMER_CALLBACK( update_artwork );
69
70STATE_PRESAVE( m_board_presave );
71STATE_POSTLOAD( m_board_postload );
72
73void mboard_savestate_register(running_machine *machine);
74
75void set_board( void );
76void set_artwork (running_machine *machine );
77void check_board_buttons(running_machine *machine );
78void set_boarder_pieces (void);
79
80INLINE UINT8 pos_to_num(UINT8 val)
81{
82   switch (val)
83   {
84      case 0xfe: return 7;
85      case 0xfd: return 6;
86      case 0xfb: return 5;
87      case 0xf7: return 4;
88      case 0xef: return 3;
89      case 0xdf: return 2;
90      case 0xbf: return 1;
91      case 0x7f: return 0;
92      default: return 0xff;
93   }
94}
95
96/***************************************************************************
97    GLOBALS
98***************************************************************************/
99
100extern UINT8 lcd_invert;
101extern UINT8 key_select;
102extern UINT8 key_selector;
103
104#endif /* __MBOARD_H__ */
src/mess/messdriv.c
r9386r9387
15571557
15581558   /* Hegener & Glaser Munich */
15591559//  DRIVER( mephisto )  /* Mephisto  */
1560   DRIVER( mm4 )      /* Mephisto 4       */
1561   DRIVER( mm5 )      /* Mephisto 5.1 ROM   */
1562   DRIVER( mm50 )     /* Mephisto 5.0 ROM    */
1563   DRIVER( rebel5 )   /* Mephisto 5      */
1564   DRIVER( glasgow )      /* Glasgow     */
1565   DRIVER( amsterd )      /* Amsterdam */
1566   DRIVER( dallas )   /* Dallas      */
1567   DRIVER( dallas16 )     /* Dallas    */
1568   DRIVER( dallas32 )     /* Dallas    */
1569   DRIVER( roma )     /* Roma    */
1570   DRIVER( roma32 )   /* Roma  */
1560   DRIVER( mm2 )       /* Mephisto 2 */
1561   DRIVER( mm4 )       /* Mephisto 4       */
1562   DRIVER( mm5 )       /* Mephisto 5.1 ROM   */
1563   DRIVER( mm50 )      /* Mephisto 5.0 ROM    */
1564   DRIVER( rebel5 )    /* Mephisto 5      */
1565   DRIVER( glasgow )       /* Glasgow     */
1566   DRIVER( amsterd )       /* Amsterdam */
1567   DRIVER( dallas )    /* Dallas      */
1568   DRIVER( dallas16 )      /* Dallas    */
1569   DRIVER( dallas32 )      /* Dallas    */
1570   DRIVER( roma )      /* Roma    */
1571   DRIVER( roma32 )    /* Roma  */
1572   DRIVER( van16 ) /* Vancouver 16 Bit */
15711573
15721574   /* JAKKS Pacific, Inc. / HotGen, Ltd. */
15731575   DRIVER( batman )   /* The Batman, 2004 */
src/mess/mess.mak
r9386r9387
967967   $(MESS_DRIVERS)/h89.o      \
968968
969969$(MESSOBJ)/hegener.a:         \
970   $(MESS_MACHINE)/mboard.o   \
970971   $(MESS_DRIVERS)/glasgow.o   \
971972   $(MESS_DRIVERS)/mephisto.o   \
973   $(MESS_DRIVERS)/vancouver.o   \
972974
973975$(MESSOBJ)/hitachi.a:         \
974976   $(MESS_DRIVERS)/bmjr.o      \
src/mess/drivers/glasgow.c
r9386r9387
3838    between computers. The supplied artwork at svn r6463 works with my
3939    computer; it may be out of alignment on yours.
4040
41R.Schaefer Oct 2010
4142
431. everything concerning chessboard moved to machine mboard
442. Boarder pieces added. This allow setting up and repair chess positons
453. chessboard added for Amsterdam, Dallas 16 Bit, Dallas 32 Bit, Roma 32 Bit
464. Save states added.
47
4248***************************************************************************/
4349
4450#include "emu.h"
4551#include "cpu/m68000/m68000.h"
4652#include "glasgow.lh"
4753#include "sound/beep.h"
54#include "machine/mboard.h"
4855
49
5056static UINT8 lcd_shift_counter;
51// static UINT8 led_status;
5257static UINT8 led7;
53static UINT8   key_select,
54      irq_flag,
55      lcd_invert,
56      key_selector;
57static UINT8 board_value;
58static UINT8 irq_flag;
5859static UINT16 beeper;
5960
60static UINT16 Line18_LED;
61static UINT16 Line18_REED;
62
63static UINT8 read_board_flag;
64static UINT8 mouse_hold = 0;
65
66typedef struct {
67   UINT8 field;
68   UINT8 piece;
69} BOARD_FIELD;
70
71static BOARD_FIELD m_board[8][8];
72
73/* starts at bottom left corner */
74static const BOARD_FIELD start_board[8][8] =
75{
76   { {7,10}, {6,8}, {5,9}, {4,11}, {3,12}, {2,9}, {1,8}, {0,10} },
77   { {15,7}, {14,7}, {13,7}, {12,7}, { 11,7}, {10,7}, {9,7}, {8,7} },
78
79   { {23,0}, {22,0}, {21,0}, {20,0}, {19,0}, {18,0}, {17,0}, {16,0} },
80   { {31,0}, {30,0}, {29,0}, {28,0}, {27,0}, {26,0}, {25,0}, {24,0} },
81   { {39,0}, {38,0}, {37,0}, {36,0}, {35,0}, {34,0}, {33,0}, {32,0} },
82   { {47,0}, {46,0}, {45,0}, {44,0}, {43,0}, {42,0}, {41,0}, {40,0} },
83
84   { {55,1}, {54,1}, {53,1}, {52,1}, {51,1}, {50,1}, {49,1}, {48,1} },
85   { {63,4}, {62,2}, {61,3}, {60,5}, {59,6}, {58,3}, {57,2}, {56,4} }
86};
87
88INLINE UINT8 pos_to_num(UINT8 val)
89{
90   switch (val)
91   {
92      case 0xfe: return 7;
93      case 0xfd: return 6;
94      case 0xfb: return 5;
95      case 0xf7: return 4;
96      case 0xef: return 3;
97      case 0xdf: return 2;
98      case 0xbf: return 1;
99      case 0x7f: return 0;
100      default: return 0xff;
101   }
102}
103
104static void set_board( void )
105{
106   UINT8 i_AH, i_18;
107
108   for (i_AH = 0; i_AH < 8; i_AH++)
109   {
110      for (i_18 = 0; i_18 < 8; i_18++)
111      {
112         // copy start postition to m_board
113         m_board[i_18][i_AH] = start_board[i_18][i_AH];
114      }
115   }
116}
117
118static void glasgow_pieces_w ( running_machine *machine )
119{
120   /* This causes the pieces to display on-screen */
121   UINT8 i_18, i_AH;
122
123   for (i_18 = 0; i_18 < 8; i_18++)
124      for (i_AH = 0; i_AH < 8; i_AH++)
125         output_set_indexed_value("P", 63 - m_board[i_18][i_AH].field, m_board[i_18][i_AH].piece);
126}
127
12861static WRITE16_HANDLER( glasgow_lcd_w )
12962{
13063   UINT8 lcd_data = data >> 8;
r9386r9387
15689{
15790   UINT8 data = 0xff;
15891
159   static const char *const keynames[] = { "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
160   static UINT8 board_row = 0;
161   static UINT16 mouse_down = 0;
162   UINT8 pos2num_res = 0;
163   board_row++;
164   board_row &= 7;
165
166   /* See if we are moving a piece */
167   data = input_port_read_safe(space->machine, keynames[board_row], 0xff);
168
169   if ((data != 0xff) && (!mouse_down))
170   {
171      pos2num_res = pos_to_num(data);
172
173      if (!(pos2num_res < 8))
174         logerror("Position out of bound!");
175      else if ((mouse_hold) && (!m_board[board_row][pos2num_res].piece))
176      {
177         /* Moving a piece onto a blank */
178         m_board[board_row][pos2num_res].piece = mouse_hold;
179         mouse_hold = 0;
180      }
181      else if ((!mouse_hold) && (m_board[board_row][pos2num_res].piece))
182      {
183         /* Picking up a piece */
184         mouse_hold = m_board[board_row][pos2num_res].piece;
185         m_board[board_row][pos2num_res].piece = 0;
186      }
187
188      mouse_down = board_row + 1;
189   }
190   else if ((data == 0xff) && (mouse_down == (board_row + 1)))   /* Wait for mouse to be released */
191      mouse_down = 0;
192
193   /* See if we are taking a piece off the board */
194   if (!input_port_read_safe(space->machine, "LINE10", 0xff))
195      mouse_hold = 0;
196
19792   /* See if any keys pressed */
19893   data = 3;
19994
r9386r9387
209104static WRITE16_HANDLER( glasgow_keys_w )
210105{
211106   key_select = data >> 8;
212   glasgow_pieces_w(space->machine);
213107}
214108
215static READ16_HANDLER( glasgow_board_r )
216{
217   UINT8 i_AH, data = 0;
218
219   if (Line18_REED < 8)
220   {
221      // if there is a piece on the field -> set bit in data
222      for (i_AH = 0; i_AH < 8; i_AH++)
223      {
224         if (!m_board[Line18_REED][i_AH].piece)
225            data |= (1 << i_AH);
226      }
227   }
228
229   read_board_flag = TRUE;
230
231   return data << 8;
232}
233
234static WRITE16_HANDLER( glasgow_board_w )
235{
236   //UINT8 beep_flag;
237   Line18_REED = pos_to_num(data >> 8) ^ 7;
238
239   // LED's or REED's ?
240   if (read_board_flag)
241   {
242      Line18_LED = 0;
243      read_board_flag = 0;
244   }
245   else
246   {
247      Line18_LED = data >> 8;
248   }
249
250   lcd_invert = 1;
251   //beep_flag = data >> 8;
252   //if ((beep_flag & 02) == 0) key_selector = 0; else key_selector = 1;
253   //logerror("Write Beeper   = %x \n  ",data);
254   beeper = data;
255
256}
257
258static WRITE16_HANDLER( glasgow_beeper_w )
259{
260   UINT8 i_AH, i_18;
261   UINT16 LineAH = 0;
262   UINT8 LED;
263
264   LineAH = data >> 8;
265
266   if (LineAH && Line18_LED)
267   {
268      for (i_AH = 0; i_AH < 8; i_AH++)
269      {
270         if (LineAH & (1 << i_AH))
271         {
272            for (i_18 = 0; i_18 < 8; i_18++)
273            {
274               if (!(Line18_LED & (1 << i_18)))
275               {
276                  LED = m_board[i_18][i_AH].field;
277                  output_set_led_value(LED, 1);
278                  //  LED on
279               }
280               else
281               {
282               //  LED off
283
284               }
285            }
286         }
287      }
288   }
289   else
290   {
291      //  No LED  -> all LED's off
292      for (i_AH = 0; i_AH < 8; i_AH++)
293      {
294         for (i_18 = 0; i_18 < 8; i_18++)
295         {
296            // LED off
297            LED = m_board[i_18][i_AH].field;
298            output_set_led_value(LED, 0);
299         }
300      }
301   }
302}
303
304static WRITE16_HANDLER( write_beeper )
305{
306   UINT8 beep_flag;
307
308   lcd_invert = 1;
309   beep_flag = data >> 8;
310//  if ((beep_flag & 02) == 0) key_selector = 0; else key_selector = 1;
311   logerror("Write Beeper = %x \n", data);
312   beeper = data;
313}
314
315109static WRITE16_HANDLER( write_lcd )
316110{
317111   UINT8 lcd_data = data >> 8;
r9386r9387
341135   logerror("LCD Flag 16 = %x \n", data);
342136}
343137
344static READ16_HANDLER( read_board )
345{
346   return 0xff00;   // Mephisto need it for working
347}
348
349static WRITE16_HANDLER( write_board )
350{
351   UINT8 board = data >> 8;
352
353   board_value = board;
354
355   if (board == 0xff)
356      key_selector = 0;
357//  The key function in the rom expects after writing to
358//  the chess board a value from  the first key row;
359   logerror("Write Board = %x \n", data >> 8);
360}
361
362
363138static WRITE16_HANDLER( write_irq_flag )
364139{
365140   running_device *speaker = space->machine->device("beep");
r9386r9387
418193   if (lcd_flag == 0)
419194      key_selector = 1;
420195
421   logerror("LCD Flag 32 = %x \n", lcd_flag);
196   //logerror("LCD Flag 32 = %x \n", lcd_flag);
422197   //beep_set_state(0, lcd_flag & 1 ? 1 : 0);
423198
424199   if (lcd_flag != 0)
r9386r9387
427202      led7 = 0;
428203}
429204
430
431static WRITE32_HANDLER( write_keys32 )
432{
433   lcd_invert = 1;
434   key_select = data;
435   logerror("Write Key = %x \n", key_select);
436}
437
438205static READ32_HANDLER( read_newkeys32 ) // Dallas 32, Roma 32
439206{
440207   UINT32 data;
r9386r9387
444211   else
445212      data = input_port_read(space->machine, "LINE1");
446213   //if (key_selector == 1) data = input_port_read(machine, "LINE0"); else data = 0;
447   logerror("read Keyboard Offset = %x Data = %x\n", offset, data);
214   if(data)
215      logerror("read Keyboard Offset = %x Data = %x\n", offset, data);
448216   data <<= 24;
449217   return data ;
450218}
451219
452static READ32_HANDLER( read_board32 )
453{
454   logerror("read board 32 Offset = %x \n", offset);
455   return 0;
456}
457
458220#ifdef UNUSED_FUNCTION
459221static READ16_HANDLER(read_board_amsterd)
460222{
r9386r9387
463225}
464226#endif
465227
466static WRITE32_HANDLER( write_board32 )
467{
468   UINT8 board;
469   board = data >> 24;
470   if (board == 0xff)
471      key_selector = 0;
472   logerror("Write Board = %x \n", data);
473}
474
475
476228static WRITE32_HANDLER ( write_beeper32 )
477229{
478230   running_device *speaker = space->machine->device("beep");
r9386r9387
482234   beeper = data;
483235}
484236
485//static int irq_edge = 0x00;
486
487237static TIMER_CALLBACK( update_nmi )
488238{
489239   //cputag_set_input_line_and_vector(machine, "maincpu", M68K_IRQ_7, irq_edge & 0xff ? CLEAR_LINE : ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
r9386r9387
508258   irq_flag = 0;
509259   lcd_shift_counter = 3;
510260   timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, update_nmi);
261   timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, update_artwork);
511262   beep_set_frequency(speaker, 44);
263
264   mboard_savestate_register(machine);
512265}
513266
514267
r9386r9387
518271
519272   lcd_shift_counter = 3;
520273   timer_pulse(machine, ATTOTIME_IN_HZ(50), NULL, 0, update_nmi32);
274   timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, update_artwork);
521275   beep_set_frequency(speaker, 44);
276
277   mboard_savestate_register(machine);
522278}
523279
524280
525281static MACHINE_RESET( glasgow )
526282{
527283   lcd_shift_counter = 3;
284
285   set_boarder_pieces();
528286   set_board();
529287}
530288
r9386r9387
534292   AM_RANGE(0x00010000, 0x00010001) AM_WRITE( glasgow_lcd_w )
535293   AM_RANGE(0x00010002, 0x00010003) AM_READWRITE( glasgow_keys_r, glasgow_keys_w )
536294   AM_RANGE(0x00010004, 0x00010005) AM_WRITE( glasgow_lcd_flag_w )
537   AM_RANGE(0x00010006, 0x00010007) AM_READWRITE( glasgow_board_r, glasgow_beeper_w )
538   AM_RANGE(0x00010008, 0x00010009) AM_WRITE( glasgow_board_w )
295   AM_RANGE(0x00010006, 0x00010007) AM_READWRITE( read_board_16, write_LED_16 )
296   AM_RANGE(0x00010008, 0x00010009) AM_WRITE( write_board_16 )
539297   AM_RANGE(0x0001c000, 0x0001ffff) AM_RAM      // 16KB
540298ADDRESS_MAP_END
541299
r9386r9387
546304   AM_RANGE(0x00800002, 0x00800003) AM_WRITE( write_lcd )
547305   AM_RANGE(0x00800008, 0x00800009) AM_WRITE( write_lcd_flag )
548306   AM_RANGE(0x00800004, 0x00800005) AM_WRITE( write_irq_flag )
549   AM_RANGE(0x00800010, 0x00800011) AM_WRITE( write_board )
550   AM_RANGE(0x00800020, 0x00800021) AM_READ( read_board )
307   AM_RANGE(0x00800010, 0x00800011) AM_WRITE( write_board_16 )
308   AM_RANGE(0x00800020, 0x00800021) AM_READ( read_board_16 )
551309   AM_RANGE(0x00800040, 0x00800041) AM_READ( read_newkeys16 )
552   AM_RANGE(0x00800088, 0x00800089) AM_WRITE( write_beeper )
310   AM_RANGE(0x00800088, 0x00800089) AM_WRITE( write_LED_16 )
553311   AM_RANGE(0x00ffc000, 0x00ffffff) AM_RAM      // 16KB
554312ADDRESS_MAP_END
555313
r9386r9387
560318   AM_RANGE(0x00800000, 0x00800003) AM_WRITE( write_lcd32 )
561319   AM_RANGE(0x00800004, 0x00800007) AM_WRITE( write_beeper32 )
562320   AM_RANGE(0x00800008, 0x0080000B) AM_WRITE( write_lcd_flag32 )
563   AM_RANGE(0x00800010, 0x00800013) AM_WRITE( write_board32 )
564   AM_RANGE(0x00800020, 0x00800023) AM_READ( read_board32 )
321   AM_RANGE(0x00800010, 0x00800013) AM_WRITE( write_board_32 )
322   AM_RANGE(0x00800020, 0x00800023) AM_READ( read_board_32 )
565323   AM_RANGE(0x00800040, 0x00800043) AM_READ( read_newkeys32 )
566   AM_RANGE(0x00800088, 0x0080008b) AM_WRITE( write_keys32 )
324   AM_RANGE(0x00800088, 0x0080008b) AM_WRITE( write_LED_32 )
567325   AM_RANGE(0x0010000, 0x001ffff) AM_RAM   // 64KB
568326ADDRESS_MAP_END
569327
r9386r9387
611369   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MEM") PORT_CODE(KEYCODE_F4)
612370INPUT_PORTS_END
613371
614static INPUT_PORTS_START( glasgow )
615   PORT_INCLUDE( old_keyboard )
372
373static INPUT_PORTS_START( board )
616374   PORT_START("LINE2")
617375   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
618376   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
r9386r9387
685443   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
686444   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
687445   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
446
688447   PORT_START("LINE10")
689   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_KEYBOARD)
448   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
449
450   PORT_START("B_WHITE")
451   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
452   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
453   PORT_BIT(0x04,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
454   PORT_BIT(0x08,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
455   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
456   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
457
458   PORT_START("B_BLACK")
459   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
460   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
461   PORT_BIT(0x04,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
462   PORT_BIT(0x08,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
463   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
464   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
465
466   PORT_START("B_BUTTONS")
467   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
468   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
469
690470INPUT_PORTS_END
691471
472static INPUT_PORTS_START( oldkeys )
473   PORT_INCLUDE( old_keyboard )
474   PORT_INCLUDE( board )
475INPUT_PORTS_END
476
477static INPUT_PORTS_START( newkeys )
478   PORT_INCLUDE( new_keyboard )
479   PORT_INCLUDE( board )
480INPUT_PORTS_END
481
692482static MACHINE_CONFIG_START( glasgow, driver_device )
693483   /* basic machine hardware */
694484   MDRV_CPU_ADD("maincpu", M68000, 12000000)
695485   MDRV_CPU_PROGRAM_MAP(glasgow_mem)
696486   MDRV_MACHINE_START(glasgow)
697487   MDRV_MACHINE_RESET(glasgow)
698
699   /* video hardware */
700   MDRV_DEFAULT_LAYOUT(layout_glasgow)
701
702488   MDRV_SPEAKER_STANDARD_MONO("mono")
703489   MDRV_SOUND_ADD("beep", BEEP, 0)
704490   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
705491MACHINE_CONFIG_END
706492
707
708493static MACHINE_CONFIG_DERIVED( amsterd, glasgow )
709
710   /* basic machine hardware */
711   MDRV_CPU_MODIFY("maincpu")
712   MDRV_CPU_PROGRAM_MAP(amsterd_mem)
494    /* basic machine hardware */
495    MDRV_CPU_MODIFY("maincpu")
496    MDRV_CPU_PROGRAM_MAP(amsterd_mem)
713497MACHINE_CONFIG_END
714498
715
716499static MACHINE_CONFIG_DERIVED( dallas32, glasgow )
717
718   /* basic machine hardware */
719   MDRV_CPU_REPLACE("maincpu", M68020, 14000000)
720   MDRV_CPU_PROGRAM_MAP(dallas32_mem)
721   MDRV_MACHINE_START( dallas32 )
500    /* basic machine hardware */
501    MDRV_CPU_REPLACE("maincpu", M68020, 14000000)
502    MDRV_CPU_PROGRAM_MAP(dallas32_mem)
503    MDRV_MACHINE_START( dallas32 )
722504MACHINE_CONFIG_END
723505
724
725506/***************************************************************************
726507  ROM definitions
727508***************************************************************************/
r9386r9387
778559***************************************************************************/
779560
780561/*     YEAR, NAME,     PARENT,   COMPAT, MACHINE,     INPUT,          INIT, COMPANY,                      FULLNAME,                 FLAGS */
781CONS(  1984, glasgow,  0,        0,    glasgow,       glasgow,        0,   "Hegener & Glaser Muenchen",  "Mephisto III S Glasgow", 0)
782CONS(  1984, amsterd,  glasgow,  0,    amsterd,       new_keyboard,   0,   "Hegener & Glaser Muenchen",  "Mephisto Amsterdam",     0)
783CONS(  1984, dallas,   glasgow,  0,    glasgow,       old_keyboard,   0,   "Hegener & Glaser Muenchen",  "Mephisto Dallas",        0)
784CONS(  1984, roma,     glasgow,  0,    glasgow,       new_keyboard,   0,   "Hegener & Glaser Muenchen",  "Mephisto Roma",          GAME_NOT_WORKING)
785CONS(  1984, dallas32, glasgow,  0,    dallas32,      new_keyboard,   0,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 32 Bit", 0)
786CONS(  1984, roma32,   glasgow,  0,    dallas32,      new_keyboard,   0,   "Hegener & Glaser Muenchen",  "Mephisto Roma 32 Bit",   0)
787CONS(  1984, dallas16, glasgow,  0,    amsterd,       new_keyboard,   0,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 16 Bit", 0)
562CONS(  1984, glasgow,  0,        0,    glasgow,       oldkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto III S Glasgow", GAME_SUPPORTS_SAVE)
563CONS(  1984, amsterd,  0,       0,    amsterd,       newkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto Amsterdam",     GAME_SUPPORTS_SAVE)
564CONS(  1984, dallas,   glasgow,  0,    glasgow,       oldkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto Dallas",        GAME_SUPPORTS_SAVE)
565CONS(  1984, roma,     amsterd,  0,    glasgow,       newkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto Roma",          GAME_NOT_WORKING)
566CONS(  1984, dallas32, amsterd,  0,    dallas32,      newkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 32 Bit", GAME_SUPPORTS_SAVE)
567CONS(  1984, roma32,   amsterd,  0,    dallas32,      newkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto Roma 32 Bit",   GAME_SUPPORTS_SAVE)
568CONS(  1984, dallas16, amsterd,  0,    amsterd,       newkeys,        0,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 16 Bit", GAME_SUPPORTS_SAVE)
src/mess/drivers/vancouver.c
r0r9387
1/******************************************************************************
2 Mephisto Vancouver Chess Computer
3 2010 R. Schaefer
4
5 CPU 68000
6 Clock 12 MHz
7 IRQ CLK 600 Hz
8
9 RAM   0x00400000, 0x0087ffff
10 ROM   0x00000000, 0x0003ffff
11
12 I/O   0xc00000     read_board   
13      0xc80000     write_board 
14      0xd00000      write_led   
15      0xf00000     Buttons   
16      0xd00004     Buttons   
17      0xd00008     Buttons   
18      0xd80000     LCD Data 
19      0xd80008     LCD Enable + Beeper 
20      0xe80002     Unknown   
21      0xe80004     Unknown   
22      0xe80006     Unknown   
23       
24
25******************************************************************************/
26
27#include "emu.h"
28#include "cpu/m68000/m68000.h"
29#include "sound/beep.h"
30#include "debugger.h"
31
32#include "video/hd44780.h"
33
34#include "render.h"
35#include "rendlay.h"
36#include "uiinput.h"
37
38#include "machine/mboard.h"
39
40#define VERBOSE 0
41#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
42
43#define MAIN_CLOCK 12000000 /* 12 MHz */
44 
45#define FALSE   0
46#define TRUE   1
47
48static int own_char=FALSE;
49
50static emu_timer *start_timer = NULL;
51static emu_timer *irq_timer = NULL;
52
53static const hd44780_interface van16_display =
54{
55    2,                  /* number of lines */
56    16,                 /* chars for line */
57    NULL                /* custom display layout */
58};
59
60static void get_bin(char* b_str, UINT8 b)
61{
62   int i,k;
63   k=8;
64   for (i=0;i<8;i++)
65   {
66      if (k==4)
67         b_str[k--]=' ';
68
69      if ( BIT(b,i) )
70         b_str[k--]='1';
71      else
72         b_str[k--]='0';
73   }
74   b_str[9]=0;
75}
76
77static int get_char(UINT8 *data)
78{
79   switch (*data)
80   {
81   case 0xef: *data=0x6f;   /* oe = o */
82      return TRUE;
83   case 0xe1: *data=0x61;   /* ae = a */
84      return TRUE;
85   case 0xf5: *data=0x75;   /* ue = u */
86      return TRUE;
87
88   case 0x08: *data=161;   /* King */
89      return TRUE;
90   case 0x09: *data=162;   /* Queen */
91      return TRUE;
92   case 0x0a: *data=163;   /* Rook */
93      return TRUE;
94   case 0x0b: *data=164;   /* Bishop */
95      return TRUE;
96   case 0x0c: *data=165;   /* Knight */
97      return TRUE;
98   case 0x0d: *data=166;   /* Pawn */
99      return TRUE;
100   case 0x0e: *data=167;   /* symbol for white */
101      return TRUE;
102   case 0x0f: *data=168;   /* symbol for black */
103      return TRUE;
104   default:
105      return FALSE;
106   }
107}
108
109
110/* Read port */
111
112static READ16_HANDLER( read_button_f00000 )
113{
114   UINT16 data=0;
115   LOG(("Read from %06x offset: %x\n",0xf00000,offset));
116
117   data=input_port_read(space->machine, "BUTTON_1");
118
119   data=data<<8;
120
121    if (data)
122      return data;
123
124   return 0x0000;
125}
126
127static READ16_HANDLER( read_button_f00004 )
128{
129   UINT16 data=0;
130   LOG(("Read from %06x offset: %x\n",0xf00004,offset));
131
132   data=input_port_read(space->machine, "BUTTON_2");
133   data=data<<8;
134
135    if (data)
136      return data;
137
138    return 0x0000;
139}
140
141static READ16_HANDLER( read_button_f00008 )
142{
143   UINT16 data=0;
144   LOG(("Read from %06x offset: %x\n",0xf00008,offset));
145
146   data=input_port_read(space->machine, "BUTTON_3");
147
148   data=data<<8;
149   
150    if (data)
151      return data;
152
153    return 0x0000;
154}
155
156/* Write Port */
157
158/* LCD  - DATA */
159
160static WRITE16_HANDLER( write_lcd_data_d80000 )
161{
162   UINT8 data_8;
163   char bin_str[10];
164   int is_data;
165
166   hd44780_device * hd44780 = space->machine->device<hd44780_device>("hd44780");
167
168   data_8=data>>8;
169   get_bin(bin_str,data_8);
170
171   //logerror("Write DATA %06x data: %02x  %s\n",0xd80000,data_8,bin_str);
172
173   LOG(("Write from %06x data: %04x\n",0xd80000,data));
174   
175   if (!own_char)                     /* skip certain ascii control commands - only if they are not used for symbols */
176   {
177      if (data_8 == 0x0d || 
178         data_8 == 0x0f || data_8 == 0x0b )
179         return;
180   }
181
182   is_data=get_char(&data_8);
183 
184   if (BIT(data_8, 7) && !is_data) 
185      hd44780->control_write(128, data_8);      /* Set Cursor */
186   else
187      hd44780->data_write(128, data_8);
188
189
190   if ( data_8 == 0xc1 || data_8 == 0xc2 )      /* Control command for display  self defined ascii char */
191      own_char = TRUE;
192   else
193      own_char =FALSE;
194
195}
196
197/* LCD - ENABLE */
198
199static WRITE16_HANDLER( write_lcd_enable_d80008 )
200{
201   UINT8 data_8;
202   char bin_str[10];
203 
204   running_device *speaker = space->machine->device("beep");
205
206   data_8=data>>8;
207   get_bin(bin_str,data_8);
208
209   LOG(("Write from %06x data: %04x\n",0xd80008,data));
210 
211//   beep_set_state(speaker,BIT(data_8, 3)?1:0);
212   beep_set_state(speaker,BIT(data_8, 2)?1:0);
213   
214}
215
216/* Unknown read/write */
217
218static READ16_HANDLER( read_e80002 )
219{
220   LOG(("Read from %06x offset: %x\n",0xe80002,offset));
221    return 0xff00;
222}
223
224static WRITE16_HANDLER( write_e80004 )
225{
226   LOG(("Write from %06x data: %04x\n",0xe80004,data));
227}
228
229static READ16_HANDLER( read_e80006 )
230{
231   LOG(("Read from %06x offset: %x\n",0xe80006,offset));
232   return 0x0000;
233
234}
235
236static TIMER_CALLBACK( timer_update_irq )
237{
238      UINT32 A3=0;
239      UINT32 PC=0;
240
241      PC=cpu_get_reg(machine->device("maincpu"), M68K_PC);
242      A3=cpu_get_reg(machine->device("maincpu"), M68K_A3);      //HACK for Overclocking
243      if (A3 == 0x00407f00)
244      {
245         cputag_set_input_line_and_vector(machine, "maincpu",  M68K_IRQ_7,ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
246         cputag_set_input_line_and_vector(machine, "maincpu",  M68K_IRQ_7,CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);         
247      }else
248      {
249//         debugger_break(machine);
250//         logerror("A3: %08x PC: %08x\n",A3.PC);
251      }
252}
253
254
255static TIMER_CALLBACK( start_timer_callback)
256{
257   timer_adjust_periodic( irq_timer, attotime_zero, 0, ATTOTIME_IN_HZ(605) ); 
258   timer_reset(start_timer, attotime_never);
259}
260
261static MACHINE_START( van16 )
262{
263   
264   start_timer = timer_alloc(machine, start_timer_callback, NULL);
265   irq_timer = timer_alloc(machine, timer_update_irq, NULL);
266
267   timer_adjust_oneshot(start_timer, ATTOTIME_IN_MSEC(500), 0);
268   timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, update_artwork);
269
270   mboard_savestate_register(machine);
271
272}
273
274static MACHINE_RESET( van16 )
275{
276   hd44780_device * hd44780 = machine->device<hd44780_device>("hd44780");
277
278   hd44780->control_write(128, 15);      /* Initialize LCD */
279
280   set_boarder_pieces();
281   set_board();
282}
283
284static VIDEO_START( van16 )
285{
286
287}
288
289static VIDEO_UPDATE( van16 )
290{
291    hd44780_device * hd44780 = screen->machine->device<hd44780_device>("hd44780");
292
293    return hd44780->video_update( bitmap, cliprect );
294}
295
296static PALETTE_INIT( van16 )
297{
298   palette_set_color(machine, 0, MAKE_RGB(255, 255, 255));
299    palette_set_color(machine, 1, MAKE_RGB(0, 0, 0));
300}
301
302
303static const gfx_layout van16_charlayout =
304{
305    5, 8,                   /* 5 x 8 characters */
306    224,                    /* 224 characters */
307    1,                      /* 1 bits per pixel */
308    { 0 },                  /* no bitplanes */
309    { 3, 4, 5, 6, 7},
310    { 0, 8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
311    8*8                     /* 8 bytes */
312};
313
314static GFXDECODE_START( van16 )
315    GFXDECODE_ENTRY( "chargen", 0x0000, van16_charlayout, 0, 1 )
316GFXDECODE_END
317
318
319/* Address maps */
320
321static ADDRESS_MAP_START(van16_mem, ADDRESS_SPACE_PROGRAM, 16)
322
323   AM_RANGE( 0x000000,  0x03ffff)  AM_ROM
324
325   AM_RANGE( 0xc00000 , 0xc00001)  AM_READ     ( read_board_16 )            /* read_board  */
326   AM_RANGE( 0xc80000 , 0xc80001)  AM_WRITE    ( write_board_16 )            /* write_board */
327   AM_RANGE( 0xd00000 , 0xd00001)  AM_WRITE    ( write_LED_16 )            /* write_led   */
328   AM_RANGE( 0xf00000 , 0xf00001)  AM_READ     ( read_button_f00000 )         /* 2 Buttons   */
329   AM_RANGE( 0xf00004 , 0xf00005)  AM_READ     ( read_button_f00004 )         /* 2 Buttons   */
330   AM_RANGE( 0xf00008 , 0xf00009)  AM_READ     ( read_button_f00008 )         /* 2 Buttons   */
331   AM_RANGE( 0xd80000 , 0xd80001)  AM_WRITE    ( write_lcd_data_d80000 )      /* LCD Data    */
332   AM_RANGE( 0xd80008 , 0xd80009)  AM_WRITE    ( write_lcd_enable_d80008 )      /* LCD Enable + Beeper */
333   AM_RANGE( 0xe80004 , 0xe80005)  AM_WRITE    ( write_e80004 )            /* Unknown */
334   AM_RANGE( 0xe80002 , 0xe80003)  AM_READ     ( read_e80002 )               /* Unknown */
335   AM_RANGE( 0xe80006 , 0xe80007)  AM_READ     ( read_e80006 )               /* Unknown */
336
337//   AM_RANGE( 0x00400000, 0x0047ffff)  AM_RAM      /* 512KB */
338   AM_RANGE( 0x00400000, 0x0087ffff)  AM_RAM      /* 512KB ??? working */
339
340ADDRESS_MAP_END
341 
342 
343/* Input ports */
344
345static INPUT_PORTS_START( board )
346   PORT_START("LINE2")
347   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
348   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
349   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
350   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
351   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
352   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
353   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
354   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
355   PORT_START("LINE3")
356   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
357   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
358   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
359   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
360   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
361   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
362   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
363   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
364   PORT_START("LINE4")
365   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
366   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
367   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
368   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
369   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
370   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
371   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
372   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
373   PORT_START("LINE5")
374   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
375   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
376   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
377   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
378   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
379   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
380   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
381   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
382   PORT_START("LINE6")
383   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
384   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
385   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
386   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
387   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
388   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
389   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
390   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
391   PORT_START("LINE7")
392   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
393   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
394   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
395   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
396   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
397   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
398   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
399   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
400   PORT_START("LINE8")
401   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
402   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
403   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
404   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
405   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
406   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
407   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
408   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
409   PORT_START("LINE9")
410   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
411   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
412   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
413   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
414   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
415   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
416   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
417   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
418
419   PORT_START("LINE10")
420   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
421
422   PORT_START("B_WHITE")
423   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
424   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
425   PORT_BIT(0x04,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
426   PORT_BIT(0x08,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
427   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
428   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
429
430   PORT_START("B_BLACK")
431   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
432   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
433   PORT_BIT(0x04,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
434   PORT_BIT(0x08,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
435   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
436   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
437
438   PORT_START("B_BUTTONS")
439   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
440   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
441
442INPUT_PORTS_END
443
444static INPUT_PORTS_START( van16 )
445
446   PORT_INCLUDE( board )
447
448   PORT_START("MOUSE_X")
449   PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100)   
450
451   PORT_START("MOUSE_Y")
452   PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100)       
453
454   PORT_START("BUTTON_L")
455   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("left button")
456
457   PORT_START("BUTTON_R")
458   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("right button")
459
460   PORT_START("BUTTON_1")
461   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)  PORT_NAME("LEFT") PORT_CODE(KEYCODE_4)
462   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD)  PORT_NAME("ENT") PORT_CODE(KEYCODE_5)
463
464   PORT_START("BUTTON_2")
465   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)  PORT_NAME("RIGHT") PORT_CODE(KEYCODE_6)
466   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD)  PORT_NAME("UP") PORT_CODE(KEYCODE_7)
467
468   PORT_START("BUTTON_3")
469   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)  PORT_NAME("DOWN") PORT_CODE(KEYCODE_8)
470   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD)  PORT_NAME("CLR") PORT_CODE(KEYCODE_9)
471
472INPUT_PORTS_END
473 
474/* Machine driver */
475static MACHINE_CONFIG_START( van16, driver_device )
476    /* basic machine hardware */
477   MDRV_CPU_ADD("maincpu", M68000, MAIN_CLOCK)
478   MDRV_CPU_PROGRAM_MAP(van16_mem)
479   MDRV_MACHINE_START(van16)
480   MDRV_MACHINE_RESET(van16)
481
482    /* video hardware */
483
484   MDRV_SCREEN_ADD("screen", RASTER)
485   MDRV_SCREEN_REFRESH_RATE(50)
486   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
487   MDRV_SCREEN_SIZE(100, 22)
488   MDRV_SCREEN_VISIBLE_AREA(0, 100-1, 0, 22-3)
489   MDRV_PALETTE_LENGTH(2)
490   MDRV_PALETTE_INIT(van16)
491
492   MDRV_GFXDECODE(van16)
493
494   MDRV_HD44780_ADD("hd44780", van16_display)
495
496    MDRV_VIDEO_START(van16)
497    MDRV_VIDEO_UPDATE(van16)
498
499   MDRV_DEFAULT_LAYOUT(layout_lcd)
500
501   /* sound hardware */
502   MDRV_SPEAKER_STANDARD_MONO("mono")
503   MDRV_SOUND_ADD("beep", BEEP, 0)
504   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
505
506MACHINE_CONFIG_END
507 
508/* ROM definition */
509
510ROM_START( van16 )
511    ROM_REGION16_BE( 0x1000000, "maincpu", 0 )
512    ROM_LOAD16_BYTE("va16even.bin", 0x00000, 0x20000,CRC(e87602d5) SHA1(90cb2767b4ae9e1b265951eb2569b9956b9f7f44))
513    ROM_LOAD16_BYTE("va16odd.bin" , 0x00001, 0x20000,CRC(585f3bdd) SHA1(90bb94a12d3153a91e3760020e1ea2a9eaa7ec0a))
514
515    ROM_REGION( 0x00700, "chargen", ROMREGION_ERASE )
516    ROM_LOAD( "m_chargen.bin",    0x0000, 0x0700, CRC(b497af5c) SHA1(0bddebf91dac868ffbdd7f514253943635d7fe9a))
517
518ROM_END
519
520/* Driver */
521 
522/*    YEAR  NAME          PARENT  COMPAT  MACHINE    INPUT       INIT      COMPANY  FULLNAME                     FLAGS */
523CONS(  1984, van16, 0,        0,    van16,       van16,   0,      "Hegener & Glaser Muenchen",  "Mephisto Vancouver 16 Bit", GAME_SUPPORTS_SAVE)
src/mess/drivers/mephisto.c
r9386r9387
5757#include "cpu/m6502/m6502.h"
5858// #include "sound/dac.h"
5959#include "sound/beep.h"
60//#include "mephisto.lh"
6061
61#include "mephisto.lh"
62#include "machine/mboard.h"
6263
6364static UINT8 lcd_shift_counter;
6465static UINT8 led_status;
r9386r9387
9394   return data | 0x7f;
9495}
9596
96static READ8_HANDLER(read_board)
97{
98   return 0xff;   // Mephisto needs it for working
99}
100
10197static WRITE8_HANDLER ( write_led )
10298{
99   UINT8 LED_offset=100;
100   data &= 0x80;
103101
104   data &= 0x80;
105102   if (data==0)led_status &= 255-(1<<offset) ; else led_status|=1<<offset;
106   if (offset<6)output_set_led_value(offset, led_status&1<<offset?1:0);
103   if (offset<6)output_set_led_value(LED_offset+offset, led_status&1<<offset?1:0);
107104   if (offset==7) led7=data& 0x80 ? 0x00 :0xff;
108105   logerror("LEDs  Offset = %d Data = %d\n",offset,data);
109106}
110107
108static WRITE8_HANDLER ( write_led_mm2 )
109{
110
111   UINT8 LED_offset=100;
112   data &= 0x80;
113
114   if (data==0)
115      led_status &= 255-(1<<offset);
116   else
117      led_status|=1<<offset;
118
119   if (offset<6)
120      output_set_led_value(LED_offset+offset, led_status&1<<offset?1:0);
121
122   if (offset==7)
123       led7= data & 0x80 ? 0xff :0x00;   //MM2
124
125}
126
111127static ADDRESS_MAP_START(rebel5_mem , ADDRESS_SPACE_PROGRAM, 8)
112   AM_RANGE( 0x0000, 0x1fff) AM_RAM // AM_BASE(&mephisto_ram)//
128   AM_RANGE( 0x0000, 0x1fff) AM_RAM                  // AM_BASE(&mephisto_ram)//
113129   AM_RANGE( 0x5000, 0x5000) AM_WRITE( write_lcd )
114   AM_RANGE( 0x3000, 0x3007) AM_READ( read_keys )   // Rebel 5.0
115   AM_RANGE( 0x2000, 0x2007) AM_WRITE( write_led )   // Status LEDs+ buzzer
116   AM_RANGE( 0x3000, 0x4000) AM_READ( read_board )   // Chessboard
117   AM_RANGE( 0x6000, 0x6000) AM_RAM
118   AM_RANGE( 0x7000, 0x7000) AM_RAM
130   AM_RANGE( 0x3000, 0x3007) AM_READ( read_keys )         // Rebel 5.0
131   AM_RANGE( 0x2000, 0x2007) AM_WRITE( write_led )         // Status LEDs+ buzzer
132   AM_RANGE( 0x3000, 0x4000) AM_READ( read_board_8 )      // Chessboard
133   AM_RANGE( 0x6000, 0x6000) AM_WRITE ( write_LED_8)      // Chessboard
134   AM_RANGE( 0x7000, 0x7000) AM_WRITE ( write_board_8 )   // Chessboard
119135   AM_RANGE( 0x8000, 0xffff) AM_ROM
120136ADDRESS_MAP_END
121137
r9386r9387
124140   AM_RANGE( 0x0000, 0x1fff) AM_RAM AM_BASE(&mephisto_ram )//
125141   AM_RANGE( 0x2000, 0x2000) AM_WRITE( write_lcd )
126142   AM_RANGE( 0x2c00, 0x2c07) AM_READ( read_keys )
127   AM_RANGE( 0x3400, 0x3407) AM_WRITE( write_led )   // Status LEDs+ buzzer
128   AM_RANGE( 0x2400, 0x2407) AM_RAM   // Chessboard
129   AM_RANGE( 0x2800, 0x2800) AM_RAM   // Chessboard
130   AM_RANGE( 0x3800, 0x3800) AM_RAM   // unknwon write access
131   AM_RANGE( 0x3000, 0x3000) AM_READ( read_board )   // Chessboard
132   AM_RANGE( 0x4000, 0x7fff) AM_ROM   // Opening Library
143   AM_RANGE( 0x3400, 0x3407) AM_WRITE( write_led )         // Status LEDs+ buzzer
144   AM_RANGE( 0x2400, 0x2407) AM_WRITE ( write_LED_8 )      // Chessboard
145   AM_RANGE( 0x2800, 0x2800) AM_WRITE ( write_board_8)      // Chessboard
146   AM_RANGE( 0x3800, 0x3800) AM_RAM                  // unknwon write access
147   AM_RANGE( 0x3000, 0x3000) AM_READ( read_board_8 )      // Chessboard   
148   AM_RANGE( 0x4000, 0x7fff) AM_ROM                  // Opening Library
133149   AM_RANGE( 0x8000, 0xffff) AM_ROM
134150ADDRESS_MAP_END
135151
152static ADDRESS_MAP_START(mm2_mem , ADDRESS_SPACE_PROGRAM, 8)
153   AM_RANGE( 0x0000, 0x0fff) AM_RAM AM_BASE(&mephisto_ram )   
154   AM_RANGE( 0x2800, 0x2800) AM_WRITE( write_lcd )           
155   AM_RANGE( 0x1800, 0x1807) AM_READ( read_keys )               
156   AM_RANGE( 0x1000, 0x1007) AM_WRITE( write_led_mm2 )      //Status LEDs
136157
158   AM_RANGE( 0x3000, 0x3000) AM_WRITE ( write_LED_8 )      //Chessboard 
159   AM_RANGE( 0x3800, 0x3800) AM_WRITE ( write_board_8)      //Chessboard
160   AM_RANGE( 0x2000, 0x2000) AM_READ( read_board_8 )      //Chessboard         
137161
162   AM_RANGE( 0x4000, 0x7fff) AM_ROM                  // Opening Library ?
163   AM_RANGE( 0x8000, 0xffff) AM_ROM
164ADDRESS_MAP_END
165
166static INPUT_PORTS_START( board )
167   PORT_START("LINE2")
168   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
169   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
170   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
171   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
172   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
173   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
174   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
175   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
176   PORT_START("LINE3")
177   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
178   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
179   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
180   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
181   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
182   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
183   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
184   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
185   PORT_START("LINE4")
186   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
187   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
188   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
189   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
190   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
191   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
192   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
193   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
194   PORT_START("LINE5")
195   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
196   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
197   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
198   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
199   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
200   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
201   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
202   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
203   PORT_START("LINE6")
204   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
205   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
206   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
207   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
208   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
209   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
210   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
211   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
212   PORT_START("LINE7")
213   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
214   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
215   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
216   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
217   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
218   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
219   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
220   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
221   PORT_START("LINE8")
222   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
223   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
224   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
225   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
226   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
227   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
228   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
229   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
230   PORT_START("LINE9")
231   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)
232   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)
233   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)
234   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)
235   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)
236   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)
237   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)
238   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)
239
240   PORT_START("LINE10")
241   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD)
242
243   PORT_START("B_WHITE")
244   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
245   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
246   PORT_BIT(0x04,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
247   PORT_BIT(0x08,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
248   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
249   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
250
251   PORT_START("B_BLACK")
252   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
253   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
254   PORT_BIT(0x04,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
255   PORT_BIT(0x08,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
256   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD)
257   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD)
258
259   PORT_START("B_BUTTONS")
260   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
261   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
262
263INPUT_PORTS_END
264
138265static INPUT_PORTS_START( mephisto )
139266   PORT_START("KEY1_0") //Port $2c00
140267   PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_F1)
r9386r9387
169296   PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C 3") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3)
170297   PORT_START("KEY2_7") //Port $2c0f
171298   PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4)
299
300   PORT_INCLUDE( board )
301
172302INPUT_PORTS_END
173303
174304
r9386r9387
180310   beep_set_state(speaker,led_status&64?1:0);
181311}
182312
313static TIMER_CALLBACK( update_irq )      //only mm2
314{
315   running_device *speaker = machine->device("beep");
316
317   cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, ASSERT_LINE);
318   cputag_set_input_line(machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
319
320   beep_set_state(speaker,led_status&64?1:0);
321}
183322static MACHINE_START( mephisto )
184323{
185324   lcd_shift_counter=3;
186   // timer_pulse(machine, ATTOTIME_IN_HZ(60), NULL, 0, update_leds);
325
187326   timer_pulse(machine, ATTOTIME_IN_HZ(600), NULL, 0, update_nmi);
188   // cputag_set_input_line(machine, "maincpu", M65C02_IRQ_LINE,CLEAR_LINE);
189   //beep_set_frequency(0, 4000);
327   timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, update_artwork);
328
329   mboard_savestate_register(machine);
190330}
191331
332static MACHINE_START( mm2 )
333{
334   lcd_shift_counter=3;
335   led7=0xff;
192336
337   timer_pulse(machine, ATTOTIME_IN_HZ(450), NULL, 0, update_irq);   
338   timer_pulse(machine, ATTOTIME_IN_HZ(100), NULL, 0, update_artwork);
339
340   mboard_savestate_register(machine);
341}
342
343
193344static MACHINE_RESET( mephisto )
194345{
195346   lcd_shift_counter = 3;
347
348   set_boarder_pieces();
349   set_board();
350
351/* adjust artwork depending on current emulation*/
352
353   if (!strcmp(machine->m_game.name,"mm2") )
354      output_set_value("MM",1);
355   else if (!strcmp(machine->m_game.name,"mm4") )
356      output_set_value("MM",2);
357   else if (!strcmp(machine->m_game.name,"mm5") )
358      output_set_value("MM",3);
359   else if (!strcmp(machine->m_game.name,"mm50") )
360      output_set_value("MM",3);
361   else if (!strcmp(machine->m_game.name,"rebel5") )
362      output_set_value("MM",4);
196363}
197364
198365
r9386r9387
205372   MDRV_MACHINE_RESET( mephisto )
206373
207374   /* video hardware */
208   MDRV_DEFAULT_LAYOUT(layout_mephisto)
375//   MDRV_DEFAULT_LAYOUT(layout_mephisto)
209376
210377   /* sound hardware */
211378   MDRV_SPEAKER_STANDARD_MONO("mono")
r9386r9387
215382
216383static MACHINE_CONFIG_DERIVED( rebel5, mephisto )
217384   /* basic machine hardware */
385//   MDRV_IMPORT_FROM( mephisto )       
218386   MDRV_CPU_MODIFY("maincpu")
219387   MDRV_CPU_PROGRAM_MAP(rebel5_mem)
220388   //beep_set_frequency(0, 4000);
221389MACHINE_CONFIG_END
222390
391static MACHINE_CONFIG_DERIVED( mm2, mephisto )
392//   MDRV_IMPORT_FROM( mephisto )
393   MDRV_CPU_REPLACE("maincpu", M65C02, 3700000)
394   MDRV_CPU_PROGRAM_MAP(mm2_mem)
395   MDRV_MACHINE_START( mm2 )
396MACHINE_CONFIG_END
397
398
223399ROM_START(rebel5)
224400   ROM_REGION(0x10000,"maincpu",0)
225401   ROM_LOAD("rebel5.rom", 0x8000, 0x8000, CRC(8d02e1ef) SHA1(9972c75936613bd68cfd3fe62bd222e90e8b1083))
226402ROM_END
227403
404ROM_START(mm2)
405   ROM_REGION(0x10000,"maincpu",0)
406   ROM_LOAD("mm2_1.bin", 0x8000, 0x4000, CRC(e2daac82) SHA1(c9fa59ca92362f8ee770733073bfa2ab8c7904ad))
407   ROM_LOAD("mm2_2.bin", 0xc000, 0x4000, CRC(5e296939) SHA1(badd2a377259cf738cd076d8fb245c3dc284c24d))
408ROM_END
409
228410ROM_START(mm4)
229411   ROM_REGION(0x10000,"maincpu",0)
230412   ROM_LOAD("mephisto4.rom", 0x8000, 0x8000, CRC(f68a4124) SHA1(d1d03a9aacc291d5cb720d2ee2a209eeba13a36c))
r9386r9387
235417
236418ROM_START(mm5)
237419   ROM_REGION(0x10000,"maincpu",0)
238   ROM_LOAD("mephisto5.rom", 0x8000, 0x8000, CRC(89c3d9d2) SHA1(77cd6f8eeb03c713249db140d2541e3264328048))
420   ROM_LOAD("mephisto5.rom", 0x8000, 0x8000, CRC(fcfa7e6e) SHA1(afeac3a8c957ba58cefaa27b11df974f6f2066da))
239421   ROM_SYSTEM_BIOS( 0, "none", "No Opening Library" )
240422   ROM_SYSTEM_BIOS( 1, "hg550", "HG550 Opening Library" )
241423   ROMX_LOAD("hg550.rom", 0x4000, 0x4000, CRC(0359f13d) SHA1(833cef8302ad8d283d3f95b1d325353c7e3b8614),ROM_BIOS(2))
r9386r9387
262444***************************************************************************/
263445
264446/*    YEAR  NAME        PARENT  COMPAT  MACHINE     INPUT       INIT        COMPANY             FULLNAME                            FLAGS */
265//CONS( 1983, mephisto,   0,      0,      mephisto,   mephisto,   mephisto, "Hegener & Glaser", "Mephisto Schach Computer",         GAME_NOT_WORKING )
266CONS( 1987, mm4,        0,      0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 4 Schach Computer",       0 )
267CONS( 1990, mm5,        0,      0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.1 Schach Computer",     0 )
268CONS( 1990, mm50,       mm5,    0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.0 Schach Computer",     0 )
269CONS( 1986, rebel5,     0,      0,      rebel5,     mephisto,   mephisto,   "Hegener & Glaser", "Mephisto Rebel 5 Schach Computer", 0 )
447
448CONS( 1987, mm4,        0,      0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 4 Schach Computer",       GAME_SUPPORTS_SAVE )
449CONS( 1990, mm5,        mm4,   0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.1 Schach Computer",     GAME_SUPPORTS_SAVE )
450CONS( 1990, mm50,       mm4,   0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.0 Schach Computer",     GAME_SUPPORTS_SAVE )
451CONS( 1986, rebel5,     mm4,   0,      rebel5,     mephisto,   mephisto,   "Hegener & Glaser", "Mephisto Rebel 5 Schach Computer", GAME_SUPPORTS_SAVE )
452CONS( 1984, mm2,        mm4,   0,      mm2,        mephisto,   mephisto,   "Hegener & Glaser", "Mephisto MM2 Schach Computer",     GAME_SUPPORTS_SAVE )
453
270454// second design sold (same computer/program?)
docs/messnew.txt
r9386r9387
1111- Panasonic JR-100U [Murray Moffatt, Miodrag Milanovic]
1212- National JR-100 [anonymous, Miodrag Milanovic]
1313- Novag SuperConstellation Chess Computer [Ralf Schaefer]
14- Mephisto MM2 [Ralf Schaefer]
15- Mephisto Vancouver 16 Bit [Ralf Schaefer]
1416
1517
16
1718Systems Promoted from GAME_NOT_WORKING:
1819---------------------------------------
1920- Microbee Premium PC85 [Robbbert]
r9386r9387
8283- [VIP] Refactored driver to define ADDRESS_MAP_MODERN and use the new
8384  RCA COSMAC CPU. [Curt Coder]
8485
86- [MEPHISTO] the mephisto chess board is defined as a
87  machine (mboard). [Ralf Schaefer]
8588
89- [MEPHISTO] to reduce the artwork files glasgow, amsterd and mm4
90  are defined as PARENTS. [Ralf Schaefer]
8691
8792Imgtool Changes:
8893----------------
artwork/rebel5.zip
artwork/mm50.zip
artwork/mm5.zip
artwork/dallas.zip
artwork/roma32.zip
artwork/dallas32.zip
artwork/dallas16.zip
artwork/van16.zip
artwork/mm4.zip
artwork/amsterd.zip
artwork/glasgow.zip

Previous 15994 Revisions Next


© 1998-2018 The MESS Team