Previous 15994 Revisions Next

r874 Saturday 25th August, 2007 at 19:25:14 UTC by Dirk Verwiebe
Added Mephisto Chess Computer Driver
[src/mess]mess.mak messdriv.c
[src/mess/drivers]mephisto.c*
[src/mess/layout]mephisto.lay*

src/mess/layout/mephisto.lay
r0r874
1<?xml version="1.0"?>
2<mamelayout version="2">
3        <element name="novag">
4      <image file="mephisto.png" />
5   </element>
6 
7   <element name="digit" defstate="0">
8      <led7seg>
9         <color red="0.75" green="0.0" blue="0.0" />
10      </led7seg>
11   </element>
12 
13   <element name="led" defstate="0">
14      <disk state="1">
15         <color red="0.75" green="0.0" blue="0.0" />
16      </disk>
17      <disk state="0">
18         <color red="0.09375" green="0.0" blue="0.0" />
19      </disk>
20   </element>
21        <element name="background">
22      <rect>
23         <bounds left="0" top="0" right="1" bottom="1" />
24         <color red="0.0" green="0.0" blue="0.0" />
25      </rect>
26   </element>
27 
28         
29   
30   <element name="labels">
31      <text string="PLAY">
32         <bounds x="0" y="165" width="8" height="8" />
33      </text>
34      <text string="POS">
35         <bounds x="40" y="165" width="8" height="8" />
36      </text>
37      <text string="MEM">
38         <bounds x="80" y="165" width="8" height="8" />
39      </text>
40      <text string="TIME">
41         <bounds x="120" y="165" width="8" height="8" />
42      </text>
43                <text string="Black">
44         <bounds x="160" y="165" width="8" height="8" />
45      </text>
46                <text string="White">
47         <bounds x="200" y="165" width="8" height="8" />
48      </text>
49   </element>
50 
51   <view name="Simple LEDs">
52                <backdrop element="novag">
53         <bounds left="0" top="0" right="403" bottom="680" />
54      </backdrop>
55 
56 
57      <bezel name="digit0" element="digit">
58         <bounds left="172" top="120" right="197" bottom="170" />
59      </bezel>
60      <bezel name="digit1" element="digit">
61         <bounds left="197" top="120" right="222" bottom="170" />
62      </bezel>
63      <bezel name="digit2" element="digit">
64         <bounds left="222" top="120" right="247" bottom="170" />
65      </bezel>
66      <bezel name="digit3" element="digit">
67         <bounds left="247" top="120" right="272" bottom="170" />
68      </bezel>
69 
70      <bezel name="led5" element="led">
71         <bounds x="70" y="408" width="10" height="10" />
72      </bezel>
73      <bezel name="led4" element="led">
74         <bounds x="117" y="408" width="10" height="10" />
75      </bezel>
76      <bezel name="led3" element="led">
77         <bounds x="164" y="408" width="10" height="10" />
78      </bezel>
79      <bezel name="led2" element="led">
80         <bounds x="211" y="408" width="10" height="10" />
81                </bezel>
82                <bezel name="led0" element="led">
83         <bounds x="258" y="408" width="10" height="10" />
84      </bezel>   
85                <bezel name="led1" element="led">
86         <bounds x="305" y="408" width="10" height="10" />
87      </bezel>   
88 
89   </view>
90</mamelayout>
src/mess/messdriv.c
r873r874
804804   DRIVER( mk1 )      /* Chess Champion MK I                        */
805805   /* Quelle International */
806806   DRIVER( mk2 )      /* Chess Champion MK II                        */
807   /* NOVAG Industries Ltd. */
807   /* Hegener & Glaser Munich */
808        DRIVER( mephisto )      /* Mephisto 4+5                        */
809    /* NOVAG Industries Ltd. */
808810TESTDRIVER( ssystem3 )   /* Chess Champion Super System III / MK III         */
809811
810812#endif /* DRIVER_RECURSIVE */
src/mess/mess.mak
r873r874
367367   $(MESSOBJ)/mc10.a \
368368   $(MESSOBJ)/mk1.a \
369369   $(MESSOBJ)/mk2.a \
370   $(MESSOBJ)/mephisto.a \
370371   $(MESSOBJ)/luxor.a \
371372   $(MESSOBJ)/lviv.a \
372373   $(MESSOBJ)/lynx.a \
r873r874
10151016$(MESSOBJ)/mk2.a:      \
10161017   $(MESS_DRIVERS)/mk2.o
10171018
1019$(MESSOBJ)/mephisto.a:      \
1020   $(MESS_DRIVERS)/mephisto.o
1021
10181022$(MESSOBJ)/ssystem3.a: \
10191023   $(MESS_VIDEO)/ssystem3.o \
10201024   $(MESS_DRIVERS)/ssystem3.o
r873r874
11751179
11761180$(MESS_DRIVERS)/mk2.o:   $(MESS_LAYOUT)/mk2.lh
11771181
1182$(MESS_DRIVERS)/mephisto.o:   $(MESS_LAYOUT)/mephisto.lh
1183
11781184$(MESS_DRIVERS)/aim65.o:   $(MESS_LAYOUT)/aim65.lh
11791185
11801186$(MESS_DRIVERS)/cybiko.o:   $(MESS_LAYOUT)/cybiko.lh
src/mess/drivers/mephisto.c
r0r874
1/******************************************************************************
2 Mephisto 4 + 5 Chess Computer
3 2007 Dirk V.
4 
5******************************************************************************/
6/*
7 
8 
9Keyboard is not working !!!!!!
10 
11CPU 65C02 P4
12Clock 4.9152 MHz
13NMI CLK 50 Hz
148 KByte  SRAM Sony CXK5864-15l
15 
16$0000-$1fff   S-RAM
17$2000 LCD 4 Byte Shift Register writeonly right to left
18every 2nd char xor´d by $FF
19 
202c00-2c07 Keyboard (8to1 Multiplexer) 74HCT251
212*8 Matrix
22Adr. 0x3407
23==0 !=0
242c00 CL E5
252c01 POS F6
262c02 MEMO G7
272c03 INFO A1
282c04 LEV H8
292c05 ENT B2
302c06 >0 C3
312c07 <9 D4
32 
33$3400-$3407 LED 1-6, Buzzer, Keyboard select
34 
35$2400 // Chess Board
36$2800 // Chess Board
37$3000 // Chess Board 
38 
39$4000-7FFF Opening Modul HG550
40$8000-$FFF ROM
41 
42 
43*/
44 
45 
46 
47 
48#include "driver.h"
49 
50 
51#include "cpu/m6502/m6502.h"
52//#include "sound/dac.h"
53#include "mephisto.lh"
54 
55static UINT8 irq;
56static UINT8 lcd_shift_reg[3];
57static UINT8 lcd_shift_counter;
58static UINT8 lcd_eor_val;
59static UINT8 led_status;
60static UINT8 led7;
61static UINT8 key_array[15];
62static WRITE8_HANDLER ( write_lcd ) 
63{
64  lcd_shift_reg[lcd_shift_counter]=data ^ lcd_eor_val;
65  if (lcd_shift_counter==0) 
66    {
67      lcd_shift_counter=4;
68      lcd_eor_val=lcd_eor_val ^ 0xff;
69      logerror("LCD Shift: \n");
70    }
71  lcd_shift_counter--;
72   
73}
74 
75static READ8_HANDLER(read_keys)
76{
77  UINT8 data;
78  // if ((led7==0))data=key_array[offset]; else data=key_array[offset+8];
79   
80  //data=readinputport(offset);
81   
82  if ((led7==0))data=readinputport(offset+1); else data=readinputport(offset+8+1);
83  logerror("Keyboard Offset = %d Data = %d  led7 = %d\n",offset,data,led7);
84  return data;
85 
86}
87 
88static READ8_HANDLER(read_board)
89{
90  return 0x00;
91}
92 
93static WRITE8_HANDLER ( write_led ) 
94{
95 
96 
97// if (data==0){ led_status=led_status & (255-pow(2,offset)); else  led_status=led_status|pow(2,offset);}
98 
99  if (offset==0){ if (data==0) led_status=led_status & 254; else  led_status=led_status|1;}
100  if (offset==1){ if (data==0) led_status=led_status & 253; else  led_status=led_status|2;}
101  if (offset==2){ if (data==0) led_status=led_status & 251; else  led_status=led_status|4;}
102  if (offset==3){ if (data==0) led_status=led_status & 247; else  led_status=led_status|8;}
103  if (offset==4){ if (data==0) led_status=led_status & 239; else  led_status=led_status|16;}
104  if (offset==5){ if (data==0) led_status=led_status & 223; else  led_status=led_status|32;}
105 
106  if (offset==7){ led7=data;}
107 
108  logerror("Offset = %d Data = %d\n",offset,data);
109}
110 
111 
112// only lower 12 address bits on bus!
113static ADDRESS_MAP_START(mephisto_mem , ADDRESS_SPACE_PROGRAM, 8)
114   AM_RANGE( 0x0000, 0x1fff) AM_RAM // 
115   AM_RANGE( 0x2000, 0x2000) AM_WRITE( write_lcd)
116   AM_RANGE( 0x2c00, 0x2c07) AM_READ( read_keys)
117   // AM_RANGE( 0x2c00, 0x2c07) AM_RAM
118   AM_RANGE( 0x3400, 0x3407) AM_WRITE( write_led) // Status LEDs+ buzzer
119   // AM_RANGE( 0x3400, 0x3407) AM_RAM // Status LEDs+ buzzer
120   AM_RANGE( 0x2400, 0x2407) AM_RAM // Chessboard
121   AM_RANGE( 0x2800, 0x2800) AM_RAM // Chessboard
122   AM_RANGE( 0x3800, 0x3800) AM_RAM // unknwon write access
123   AM_RANGE( 0x3000, 0x3000) AM_READ ( read_board) // Chessboard
124   AM_RANGE( 0x4000, 0x7fff) AM_ROM   // Opening Library
125   AM_RANGE( 0x8000, 0xffff) AM_ROM
126ADDRESS_MAP_END
127 
128 
129 
130INPUT_PORTS_START( mephisto )
131  PORT_START_TAG("keyboard_1")
132  PORT_START  //Port $2c00
133  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_1)
134  PORT_START //Port $2c01
135  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("POS") PORT_CODE(KEYCODE_2)
136  PORT_START //Port $2c02
137  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("MEM") PORT_CODE(KEYCODE_3)   
138  PORT_START //Port $2c03
139  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("INFO") PORT_CODE(KEYCODE_4)
140  PORT_START  //Port $2c04
141  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEV") PORT_CODE(KEYCODE_5)
142  PORT_START //Port $2c05
143  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER)
144  PORT_START //Port $2c06
145  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)   
146  PORT_START //Port $2c07
147  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
148  PORT_START_TAG("keyboard_2")
149  PORT_START  //Port $2c08
150  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
151  PORT_START //Port $2c09
152  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
153  PORT_START //Port $2c0a
154  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)   
155  PORT_START //Port $2c0b
156  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
157  PORT_START  //Port $2c0c
158  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
159  PORT_START //Port $2c0d
160  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
161  PORT_START //Port $2c0e
162  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)   
163  PORT_START //Port $2c0f
164  PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
165INPUT_PORTS_END
166 
167 
168 
169 
170static TIMER_CALLBACK( update_leds )
171{
172   int i;
173   output_set_led_value(0, led_status&1?1:0);
174   output_set_led_value(1, led_status&2?1:0);
175   output_set_led_value(2, led_status&4?1:0);
176   output_set_led_value(3, led_status&8?1:0);
177   output_set_led_value(4, led_status&16?1:0);
178   output_set_led_value(5, led_status&32?1:0);
179   for (i=0; i<4; i++) output_set_digit_value(i, lcd_shift_reg[i]);
180   //for (i=0;i<16;i++) key_array[i]=readinputport(i);
181   
182   
183 
184}
185 
186 
187 
188 
189static TIMER_CALLBACK( update_nmi )
190{
191   irq=irq ^1;
192   // cpunum_set_input_line(0, INPUT_LINE_NMI,irq ? ASSERT_LINE: CLEAR_LINE );
193   cpunum_set_input_line(0, INPUT_LINE_NMI,PULSE_LINE);
194 
195}
196 
197static MACHINE_START( mephisto )
198{
199  lcd_shift_counter=3;
200  lcd_eor_val=0;
201  mame_timer_pulse(MAME_TIME_IN_HZ(60), 0, update_leds);
202   mame_timer_pulse(MAME_TIME_IN_HZ(600), 0, update_nmi);
203 
204}
205 
206 
207static MACHINE_RESET( mephisto )
208{
209   lcd_eor_val=0;
210   lcd_shift_counter=3;
211}
212 
213 
214static MACHINE_DRIVER_START( mephisto )
215   /* basic machine hardware */
216   MDRV_CPU_ADD(M65C02,4915200)        /* 6502 */
217   MDRV_CPU_PROGRAM_MAP(mephisto_mem, 0)
218   MDRV_SCREEN_REFRESH_RATE(60)
219   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
220   MDRV_INTERLEAVE(1)
221 
222   MDRV_MACHINE_START( mephisto )
223   MDRV_MACHINE_RESET( mephisto )
224 
225    /* video hardware */
226    MDRV_DEFAULT_LAYOUT(layout_mephisto)
227 
228   /* sound hardware */
229   // MDRV_SPEAKER_STANDARD_MONO("mono")
230 
231   //MDRV_SOUND_ADD(DAC, 0)
232   // MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
233MACHINE_DRIVER_END
234 
235 
236ROM_START(mephisto)
237   ROM_REGION(0x10000,REGION_CPU1,0)
238  //ROM_LOAD("mephisto5.rom", 0x8000, 0x8000, CRC(89c3d9d2) SHA1(77cd6f8eeb03c713249db140d2541e3264328048))
239   ROM_LOAD("mephisto4.rom", 0x8000, 0x8000, CRC(f68a4124) SHA1(d1d03a9aacc291d5cb720d2ee2a209eeba13a36c))
240   // ROM_LOAD("hg550.rom", 0x4000, 0x4000, CRC(f68a4124) SHA1(d1d03a9aacc291d5cb720d2ee2a209eeba13a36c))
241ROM_END
242 
243/***************************************************************************
244 
245  Game driver(s)
246 
247***************************************************************************/
248 
249 
250 
251 
252static DRIVER_INIT( mephisto )
253{
254   //rriot_init(0,&riot);
255}
256 
257/*    YEAR  NAME    PARENT   COMPAT   MACHINE INPUT   INIT    CONFIG    COMPANY   FULLNAME */
258CONS( 1983,   mephisto,   0,      0,      mephisto,   mephisto,   mephisto,   NULL,     "Hegener & Glaser",  "Mephisto Schach Computer", 0)
259// second design sold (same computer/program?)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team