Previous 15994 Revisions Next

r12983 Tuesday 4th October, 2011 at 07:15:22 UTC by Robbbert
MEPHISTO - modernised.
[src/mess/drivers]mephisto.c

src/mess/drivers/mephisto.c
r12982r12983
22 Mephisto 4 + 5 Chess Computer
33 2007 Dirk V.
44
5******************************************************************************/
6
7/*
8
9
105CPU 65C02 P4
116Clock 4.9152 MHz
127NMI CLK 600 Hz
r12982r12983
5045$4000-7FFF Opening Modul HG550
5146$8000-$FFF ROM
5247
53
54*/
55
56/*  Mephisto 4 Turbo Kit 18mhz - (mm4tk)
48Mephisto 4 Turbo Kit 18mhz - (mm4tk)
5749    This is a replacement rom combining the turbo kit initial rom with the original MM IV.
5850    The Turbo Kit powers up to it's tiny rom, copies itself to ram, banks in normal rom,
5951    copies that to faster SRAM, then patches the checksum and the LED blink delays.
r12982r12983
6456    blinks the LEDs a little slower.
6557
6658    -- Cowering (2011)
67*/
6859
60'rebel5' driver broke somewhere between 0.141 and 0.142 and is now marked as NOT_WORKING
6961
62***********************************************************************************************/
63
64#define ADDRESS_MAP_MODERN
65
7066#include "emu.h"
7167#include "cpu/m6502/m6502.h"
7268#include "sound/beep.h"
r12982r12983
7975{
8076public:
8177   mephisto_state(const machine_config &mconfig, device_type type, const char *tag)
82      : driver_device(mconfig, type, tag) { }
78      : driver_device(mconfig, type, tag),
79   m_maincpu(*this, "maincpu"),
80   m_beep(*this, BEEPER_TAG)
81   { }
8382
83   required_device<cpu_device> m_maincpu;
84   required_device<device_t> m_beep;
85   DECLARE_WRITE8_MEMBER(write_lcd);
86   DECLARE_WRITE8_MEMBER(mephisto_NMI);
87   DECLARE_READ8_MEMBER(read_keys);
88   DECLARE_WRITE8_MEMBER(write_led);
89   DECLARE_WRITE8_MEMBER(write_led_mm2);
8490   UINT8 m_lcd_shift_counter;
8591   UINT8 m_led_status;
86   UINT8 *m_ram;
92   //UINT8 *m_p_ram;
8793   UINT8 m_led7;
8894   UINT8 m_allowNMI;
8995};
9096
9197
92static WRITE8_HANDLER ( write_lcd )
98WRITE8_MEMBER( mephisto_state::write_lcd )
9399{
94   mephisto_state *state = space->machine().driver_data<mephisto_state>();
95   if (state->m_led7 == 0) output_set_digit_value(state->m_lcd_shift_counter,data);   // 0x109 MM IV // 0x040 MM V
100   if (m_led7 == 0) output_set_digit_value(m_lcd_shift_counter,data);   // 0x109 MM IV // 0x040 MM V
96101
97   //output_set_digit_value(state->m_lcd_shift_counter,data ^ state->m_ram[0x165]);    // 0x109 MM IV // 0x040 MM V
98   state->m_lcd_shift_counter--;
99   state->m_lcd_shift_counter &= 3;
102   //output_set_digit_value(m_lcd_shift_counter,data ^ m_p_ram[0x165]);    // 0x109 MM IV // 0x040 MM V
103   m_lcd_shift_counter--;
104   m_lcd_shift_counter &= 3;
100105}
101106
102static WRITE8_HANDLER ( mephisto_NMI )
107WRITE8_MEMBER( mephisto_state::mephisto_NMI )
103108{
104
105   mephisto_state *state = space->machine().driver_data<mephisto_state>();
106   state->m_allowNMI = 1;
109   m_allowNMI = 1;
107110}
108111
109static READ8_HANDLER(read_keys)
112READ8_MEMBER( mephisto_state::read_keys )
110113{
111   mephisto_state *state = space->machine().driver_data<mephisto_state>();
112114   UINT8 data;
113115   static const char *const keynames[2][8] =
114116         {
r12982r12983
117119         };
118120
119121   data = 0xff;
120   if (((state->m_led_status & 0x80) == 0x00))
121      data=input_port_read(space->machine(), keynames[0][offset]);
122   if (((m_led_status & 0x80) == 0x00))
123      data=input_port_read(machine(), keynames[0][offset]);
122124   else
123      data=input_port_read(space->machine(), keynames[1][offset]);
125      data=input_port_read(machine(), keynames[1][offset]);
124126
125   logerror("Keyboard Port = %s Data = %d\n  ", ((state->m_led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data);
127   logerror("Keyboard Port = %s Data = %d\n  ", ((m_led_status & 0x80) == 0x00) ? keynames[0][offset] : keynames[1][offset], data);
126128   return data | 0x7f;
127129}
128130
129static WRITE8_HANDLER ( write_led )
131WRITE8_MEMBER( mephisto_state::write_led )
130132{
131   mephisto_state *state = space->machine().driver_data<mephisto_state>();
132133   UINT8 LED_offset=100;
133134   data &= 0x80;
134135
135   if (data==0)state->m_led_status &= 255-(1<<offset) ; else state->m_led_status|=1<<offset;
136   if (offset<6)output_set_led_value(LED_offset+offset, state->m_led_status&1<<offset?1:0);
137   if (offset==7) state->m_led7=data& 0x80 ? 0x00 :0xff;
136   if (data==0)m_led_status &= 255-(1<<offset) ; else m_led_status|=1<<offset;
137   if (offset<6)output_set_led_value(LED_offset+offset, m_led_status&1<<offset?1:0);
138   if (offset==7) m_led7=data& 0x80 ? 0x00 :0xff;
138139   logerror("LEDs  Offset = %d Data = %d\n",offset,data);
139140}
140141
141static WRITE8_HANDLER ( write_led_mm2 )
142WRITE8_MEMBER( mephisto_state::write_led_mm2 )
142143{
143   mephisto_state *state = space->machine().driver_data<mephisto_state>();
144
145144   UINT8 LED_offset=100;
146145   data &= 0x80;
147146
148147   if (data==0)
149      state->m_led_status &= 255-(1<<offset);
148      m_led_status &= 255-(1<<offset);
150149   else
151      state->m_led_status|=1<<offset;
150      m_led_status|=1<<offset;
152151
153152   if (offset<6)
154      output_set_led_value(LED_offset+offset, state->m_led_status&1<<offset?1:0);
153      output_set_led_value(LED_offset+offset, m_led_status&1<<offset?1:0);
155154
156155   if (offset==7)
157      state->m_led7= data & 0x80 ? 0xff :0x00;   //MM2
158
156      m_led7= BIT(data, 7) ? 0xff :0x00;   //MM2
159157}
160158
161static ADDRESS_MAP_START(rebel5_mem , AS_PROGRAM, 8)
162   AM_RANGE( 0x0000, 0x1fff) AM_RAM                  // AM_BASE_MEMBER(mephisto_state, m_ram)//
163   AM_RANGE( 0x5000, 0x5000) AM_WRITE( write_lcd )
164   AM_RANGE( 0x3000, 0x3007) AM_READ( read_keys )         // Rebel 5.0
165   AM_RANGE( 0x2000, 0x2007) AM_WRITE( write_led )         // Status LEDs+ buzzer
166   AM_RANGE( 0x3000, 0x4000) AM_READ( mboard_read_board_8 )      // Chessboard
167   AM_RANGE( 0x6000, 0x6000) AM_WRITE ( mboard_write_LED_8)      // Chessboard
168   AM_RANGE( 0x7000, 0x7000) AM_WRITE ( mboard_write_board_8 )   // Chessboard
159static ADDRESS_MAP_START( rebel5_mem, AS_PROGRAM, 8, mephisto_state )
160   AM_RANGE( 0x0000, 0x1fff) AM_RAM                  // AM_BASE(m_p_ram)
161   AM_RANGE( 0x2000, 0x2007) AM_WRITE(write_led)         // Status LEDs+ buzzer
162   AM_RANGE( 0x3000, 0x3007) AM_READ(read_keys)         // Rebel 5.0
163   AM_RANGE( 0x3000, 0x4000) AM_READ_LEGACY(mboard_read_board_8)      // Chessboard
164   AM_RANGE( 0x5000, 0x5000) AM_WRITE(write_lcd)
165   AM_RANGE( 0x6000, 0x6000) AM_WRITE_LEGACY(mboard_write_LED_8)      // Chessboard
166   AM_RANGE( 0x7000, 0x7000) AM_WRITE_LEGACY(mboard_write_board_8)   // Chessboard
169167   AM_RANGE( 0x8000, 0xffff) AM_ROM
170168ADDRESS_MAP_END
171169
172170
173static ADDRESS_MAP_START(mephisto_mem , AS_PROGRAM, 8)
174   AM_RANGE( 0x0000, 0x1fff) AM_RAM AM_BASE_MEMBER(mephisto_state, m_ram )//
175   AM_RANGE( 0x2000, 0x2000) AM_WRITE( write_lcd )
176   AM_RANGE( 0x2c00, 0x2c07) AM_READ( read_keys )
177   AM_RANGE( 0x3400, 0x3407) AM_WRITE( write_led )         // Status LEDs+ buzzer
178   AM_RANGE( 0x2400, 0x2407) AM_WRITE ( mboard_write_LED_8 )      // Chessboard
179   AM_RANGE( 0x2800, 0x2800) AM_WRITE ( mboard_write_board_8)      // Chessboard
180   AM_RANGE( 0x3800, 0x3800) AM_WRITE ( mephisto_NMI )         // NMI enable
181   AM_RANGE( 0x3000, 0x3000) AM_READ( mboard_read_board_8 )      // Chessboard
171static ADDRESS_MAP_START( mephisto_mem, AS_PROGRAM, 8, mephisto_state )
172   AM_RANGE( 0x0000, 0x1fff) AM_RAM //AM_BASE(m_p_ram)
173   AM_RANGE( 0x2000, 0x2000) AM_WRITE(write_lcd)
174   AM_RANGE( 0x2400, 0x2407) AM_WRITE_LEGACY(mboard_write_LED_8)      // Chessboard
175   AM_RANGE( 0x2800, 0x2800) AM_WRITE_LEGACY(mboard_write_board_8)      // Chessboard
176   AM_RANGE( 0x2c00, 0x2c07) AM_READ(read_keys)
177   AM_RANGE( 0x3000, 0x3000) AM_READ_LEGACY(mboard_read_board_8)      // Chessboard
178   AM_RANGE( 0x3400, 0x3407) AM_WRITE(write_led)         // Status LEDs+ buzzer
179   AM_RANGE( 0x3800, 0x3800) AM_WRITE(mephisto_NMI)         // NMI enable
182180   AM_RANGE( 0x4000, 0x7fff) AM_ROM                  // Opening Library
183181   AM_RANGE( 0x8000, 0xffff) AM_ROM
184182ADDRESS_MAP_END
185183
186static ADDRESS_MAP_START(mm2_mem , AS_PROGRAM, 8)
187   AM_RANGE( 0x0000, 0x0fff) AM_RAM AM_BASE_MEMBER(mephisto_state, m_ram )
188   AM_RANGE( 0x2800, 0x2800) AM_WRITE( write_lcd )
189   AM_RANGE( 0x1800, 0x1807) AM_READ( read_keys )
190   AM_RANGE( 0x1000, 0x1007) AM_WRITE( write_led_mm2 )      //Status LEDs
191
192   AM_RANGE( 0x3000, 0x3000) AM_WRITE ( mboard_write_LED_8 )      //Chessboard
193   AM_RANGE( 0x3800, 0x3800) AM_WRITE ( mboard_write_board_8)      //Chessboard
194   AM_RANGE( 0x2000, 0x2000) AM_READ( mboard_read_board_8 )      //Chessboard
195
184static ADDRESS_MAP_START( mm2_mem, AS_PROGRAM, 8, mephisto_state )
185   AM_RANGE( 0x0000, 0x0fff) AM_RAM //AM_BASE(m_p_ram)
186   AM_RANGE( 0x1000, 0x1007) AM_WRITE(write_led_mm2)      //Status LEDs
187   AM_RANGE( 0x1800, 0x1807) AM_READ(read_keys)
188   AM_RANGE( 0x2000, 0x2000) AM_READ_LEGACY(mboard_read_board_8)      //Chessboard
189   AM_RANGE( 0x2800, 0x2800) AM_WRITE(write_lcd)
190   AM_RANGE( 0x3000, 0x3000) AM_WRITE_LEGACY(mboard_write_LED_8)      //Chessboard
191   AM_RANGE( 0x3800, 0x3800) AM_WRITE_LEGACY(mboard_write_board_8)      //Chessboard
196192   AM_RANGE( 0x4000, 0x7fff) AM_ROM                  // Opening Library ?
197193   AM_RANGE( 0x8000, 0xffff) AM_ROM
198194ADDRESS_MAP_END
r12982r12983
293289   PORT_START("B_BUTTONS")
294290   PORT_BIT(0x01,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
295291   PORT_BIT(0x02,  IP_ACTIVE_HIGH, IPT_KEYBOARD)
296
297292INPUT_PORTS_END
298293
299294static INPUT_PORTS_START( mephisto )
r12982r12983
332327   PORT_BIT(0x080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4)
333328
334329   PORT_INCLUDE( board )
335
336330INPUT_PORTS_END
337331
338332
339333static TIMER_DEVICE_CALLBACK( update_nmi )
340334{
341335   mephisto_state *state = timer.machine().driver_data<mephisto_state>();
342   device_t *speaker = timer.machine().device(BEEPER_TAG);
343   if (state->m_allowNMI) {
336   if (state->m_allowNMI)
337   {
344338      state->m_allowNMI = 0;
345339      cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI,PULSE_LINE);
346340   }
347   beep_set_state(speaker,state->m_led_status&64?1:0);
341   beep_set_state(state->m_beep, state->m_led_status&64?1:0);
348342}
349343
350344static TIMER_DEVICE_CALLBACK( update_irq )      //only mm2
351345{
352346   mephisto_state *state = timer.machine().driver_data<mephisto_state>();
353   device_t *speaker = timer.machine().device(BEEPER_TAG);
354
355347   cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE);
356348   cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
357349
358   beep_set_state(speaker,state->m_led_status&64?1:0);
350   beep_set_state(state->m_beep, state->m_led_status&64?1:0);
359351}
352
360353static MACHINE_START( mephisto )
361354{
362355   mephisto_state *state = machine.driver_data<mephisto_state>();
r12982r12983
507500/*    YEAR  NAME        PARENT  COMPAT  MACHINE     INPUT       INIT        COMPANY             FULLNAME                            FLAGS */
508501
509502CONS( 1984, mm2,        mm4,   0,      mm2,        mephisto,   mephisto,   "Hegener & Glaser", "Mephisto MM2 Schachcomputer",     GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
510CONS( 1986, rebel5,     mm4,   0,      rebel5,     mephisto,   mephisto,   "Hegener & Glaser", "Mephisto Rebel 5 Schachcomputer", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
503CONS( 1986, rebel5,     mm4,   0,      rebel5,     mephisto,   mephisto,   "Hegener & Glaser", "Mephisto Rebel 5 Schachcomputer", GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK|GAME_NOT_WORKING )
511504CONS( 1987, mm4,        0,      0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 4 Schachcomputer",       GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
512505CONS( 1987, mm4tk,      mm4,    0,      mm4tk,      mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 4 Schachcomputer Turbo Kit + HG440",       GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
513506CONS( 1990, mm5,        mm4,   0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.1 Schachcomputer",     GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
514507CONS( 1990, mm50,       mm4,   0,      mephisto,   mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.0 Schachcomputer",     GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
515508CONS( 1990, mm5tk,      mm4,    0,      mm4tk,      mephisto,   mephisto,   "Hegener & Glaser", "Mephisto 5.1 Schachcomputer Turbo Kit + HG550",       GAME_SUPPORTS_SAVE|GAME_REQUIRES_ARTWORK )
516
517

Previous 15994 Revisions Next


© 1998-2018 The MESS Team