Previous 199869 Revisions Next

r26521 Friday 6th December, 2013 at 13:57:52 UTC by smf
Created DS1204 device & switched megatouch to use it instead of it's own local version (driver could do with some more tidying up as not all games use a key but currently it is hooked up to all games). Default data comes from a region instead of coded in driver, commands & security match are now compared, data is clocked on the correct edge, key can be written to and is saved to nvram. [smf]
[src/emu/machine]ds1204.c* ds1204.h* machine.mak
[src/mame]mame.mak
[src/mame/drivers]meritm.c

trunk/src/mame/mame.mak
r26520r26521
364364MACHINES += CDU76S
365365MACHINES += COM8116
366366MACHINES += CR589
367MACHINES += DS1204
367368MACHINES += DS1302
368369MACHINES += DS2401
369370MACHINES += DS2404
trunk/src/mame/drivers/meritm.c
r26520r26521
171171#include "cpu/z80/z80daisy.h"
172172#include "sound/ay8910.h"
173173#include "video/v9938.h"
174#include "machine/ds1204.h"
174175#include "machine/i8255.h"
175176#include "machine/z80pio.h"
176177#include "machine/ins8250.h"
r26520r26521
178179#include "machine/nvram.h"
179180
180181
181struct ds1204_t
182{
183   int state;
184   int read_ptr;
185   int last_clk;
186   UINT8 key[8];
187   UINT8 nvram[16];
188   int out_bit;
189   UINT8 command[3];
190
191};
192
193182class meritm_state : public driver_device
194183{
195184public:
r26520r26521
197186      : driver_device(mconfig, type, tag),
198187         m_z80pio_0(*this, "z80pio_0"),
199188         m_z80pio_1(*this, "z80pio_1"),
189         m_ds1204(*this, "ds1204"),
200190         m_v9938_0(*this, "v9938_0"),
201191         m_v9938_1(*this, "v9938_1"),
202192         m_microtouch(*this, "microtouch") ,
r26520r26521
214204   int m_bank;
215205   int m_psd_a15;
216206   UINT16 m_questions_loword_address;
217   ds1204_t m_ds1204;
207   required_device<ds1204_device> m_ds1204;
218208   required_device<v9938_device> m_v9938_0;
219209   required_device<v9938_device> m_v9938_1;
220210   optional_device<microtouch_serial_device> m_microtouch;
r26520r26521
236226   DECLARE_WRITE8_MEMBER(meritm_audio_pio_port_b_w);
237227   DECLARE_WRITE8_MEMBER(meritm_io_pio_port_a_w);
238228   DECLARE_WRITE8_MEMBER(meritm_io_pio_port_b_w);
239   DECLARE_DRIVER_INIT(pitbossm);
240   DECLARE_DRIVER_INIT(pitbossc);
241   DECLARE_DRIVER_INIT(pbss330);
242   DECLARE_DRIVER_INIT(pbst30);
243   DECLARE_DRIVER_INIT(pbst30b);
244   DECLARE_DRIVER_INIT(megat2);
245   DECLARE_DRIVER_INIT(megat3);
246229   DECLARE_DRIVER_INIT(megat3te);
247   DECLARE_DRIVER_INIT(megat4);
248   DECLARE_DRIVER_INIT(megat4c);
249   DECLARE_DRIVER_INIT(megat4st);
250   DECLARE_DRIVER_INIT(megat4te);
251   DECLARE_DRIVER_INIT(megat5);
252   DECLARE_DRIVER_INIT(megat5t);
253   DECLARE_DRIVER_INIT(megat6);
254230   virtual void machine_start();
255231   virtual void video_start();
256232   DECLARE_MACHINE_START(meritm_crt250_questions);
r26520r26521
261237   TIMER_DEVICE_CALLBACK_MEMBER(meritm_interrupt);
262238   TIMER_DEVICE_CALLBACK_MEMBER(vblank_start_tick);
263239   TIMER_DEVICE_CALLBACK_MEMBER(vblank_end_tick);
264   void ds1204_w( ds1204_t *ds1204, int rst, int clk, int dq );
265   int ds1204_r(ds1204_t *ds1204);
266   void ds1204_init(const UINT8* key, const UINT8* nvram);
267240   void meritm_crt250_switch_banks(  );
268241   void meritm_switch_banks(  );
269242   int meritm_touch_coord_transform(int *touch_x, int *touch_y);
r26520r26521
281254
282255/*************************************
283256 *
284 *  DS1204 Electronic Key
285 *
286 *************************************/
287
288#define DS1204_STATE_IDLE           0
289#define DS1204_STATE_COMMAND            1
290#define DS1204_STATE_READ_KEY           2
291#define DS1204_STATE_WRITE_SECURITY_MATCH   3
292#define DS1204_STATE_READ_NVRAM         4
293
294void meritm_state::ds1204_w( ds1204_t *ds1204, int rst, int clk, int dq )
295{
296   //logerror("ds1204_w: rst = %d, clk = %d, dq = %d\n", rst, clk, dq );
297   if ( rst == 0 )
298   {
299      ds1204->state = DS1204_STATE_COMMAND;
300      ds1204->read_ptr = 0;
301   }
302   else
303   {
304      if ( (ds1204->last_clk == 1) && (clk == 0) )
305      {
306         switch(ds1204->state)
307         {
308            case DS1204_STATE_COMMAND:
309               //logerror("Command bit %d = %d\n", ds1204->read_ptr, dq);
310               if ( ds1204->read_ptr < 24 )
311               {
312                  if ( dq == 1 )
313                  {
314                     ds1204->command[ds1204->read_ptr >> 3] |= (1 << (ds1204->read_ptr & 0x7));
315                  }
316                  else
317                  {
318                     ds1204->command[ds1204->read_ptr >> 3] &= ~(1 << (ds1204->read_ptr & 0x7));
319                  }
320                  ds1204->read_ptr++;
321               }
322               if ( ds1204->read_ptr == 24 )
323               {
324                  ds1204->state = DS1204_STATE_READ_KEY;
325                  ds1204->read_ptr = 0;
326               }
327               break;
328            case DS1204_STATE_READ_KEY:
329               //logerror("Key bit %d\n", ds1204->read_ptr);
330               if (ds1204->read_ptr < 64)
331               {
332                  ds1204->out_bit = (ds1204->key[ds1204->read_ptr >> 3] >> (ds1204->read_ptr & 0x7)) & 0x01;
333                  ds1204->read_ptr++;
334               }
335               if (ds1204->read_ptr == 64)
336               {
337                  ds1204->state = DS1204_STATE_WRITE_SECURITY_MATCH;
338                  ds1204->read_ptr = 0;
339               }
340               break;
341            case DS1204_STATE_WRITE_SECURITY_MATCH:
342               //logerror( "Security match bit %d = %d\n", ds1204->read_ptr, dq);
343               if (ds1204->read_ptr < 64)
344               {
345                  ds1204->read_ptr++;
346               }
347               if (ds1204->read_ptr == 64)
348               {
349                  ds1204->state = DS1204_STATE_READ_NVRAM;
350                  ds1204->read_ptr = 0;
351               }
352               break;
353            case DS1204_STATE_READ_NVRAM:
354               //logerror( "Read nvram bit = %d\n", ds1204->read_ptr );
355               if (ds1204->read_ptr < 128)
356               {
357                  ds1204->out_bit = (ds1204->nvram[ds1204->read_ptr >> 3] >> (ds1204->read_ptr & 0x7)) & 0x01;
358                  ds1204->read_ptr++;
359               }
360               if (ds1204->read_ptr == 128)
361               {
362                  ds1204->state = DS1204_STATE_IDLE;
363                  ds1204->read_ptr = 0;
364               }
365               break;
366
367         }
368      }
369      ds1204->last_clk = clk;
370   }
371};
372
373int meritm_state::ds1204_r(ds1204_t *ds1204)
374{
375   //logerror("ds1204_r\n");
376   return ds1204->out_bit;
377};
378
379void meritm_state::ds1204_init(const UINT8* key, const UINT8* nvram)
380{
381   memset(&m_ds1204, 0, sizeof(m_ds1204));
382   if (key)
383      memcpy(m_ds1204.key, key, sizeof(m_ds1204.key));
384   if (nvram)
385      memcpy(m_ds1204.nvram, nvram, sizeof(m_ds1204.nvram));
386
387   state_save_register_item(machine(), "ds1204", NULL, 0, m_ds1204.state);
388   state_save_register_item(machine(), "ds1204", NULL, 0, m_ds1204.read_ptr);
389   state_save_register_item(machine(), "ds1204", NULL, 0, m_ds1204.last_clk);
390   state_save_register_item(machine(), "ds1204", NULL, 0, m_ds1204.out_bit);
391   state_save_register_item_array(machine(), "ds1204", NULL, 0, m_ds1204.command);
392};
393
394/*************************************
395 *
396257 *  Microtouch <-> pc16550 interface
397258 *
398259 *************************************/
r26520r26521
1044905
1045906   */
1046907
1047   return ds1204_r(&m_ds1204);
908   return m_ds1204->read_dq();
1048909};
1049910
1050911WRITE8_MEMBER(meritm_state::meritm_audio_pio_port_a_w)
r26520r26521
1085946
1086947   */
1087948
1088   ds1204_w(&m_ds1204, (data & 0x4) >> 2, (data & 0x2) >> 1, data & 0x01);
949   m_ds1204->write_rst((data >> 2) & 1);
950   m_ds1204->write_clk((data >> 1) & 1);
951   m_ds1204->write_dq(data & 0x01);
1089952};
1090953
1091954WRITE8_MEMBER(meritm_state::meritm_io_pio_port_a_w)
r26520r26521
12391102
12401103   MCFG_NVRAM_ADD_0FILL("nvram")
12411104
1105   MCFG_DS1204_ADD("ds1204")
1106
12421107   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
12431108
12441109   MCFG_V9938_ADD("v9938_0", "screen", 0x20000)
r26520r26521
13871252   ROM_LOAD( "9221-12_u14-0.u14", 0x50000, 0x10000, CRC(128b4dff) SHA1(945825d654b1dce2e71b4f8613029651c7641fac) )
13881253   ROM_LOAD( "9221-12_u15-0.u15", 0x60000, 0x10000, CRC(b5beeaa9) SHA1(99db48f83d09616617b585b60614f5819f5dc607) )
13891254   ROM_LOAD( "9221-12_u16-0.u16", 0x70000, 0x10000, CRC(574fb3c7) SHA1(213741df3055b97ddd9889c2aa3d3e863e2c86d3) ) // matches pitboss2
1255
1256   ROM_REGION( 0x000022, "ds1204", 0 )
1257   ROM_LOAD( "pitbosssc-key", 0x000000, 0x000022, BAD_DUMP CRC(77249fe0) SHA1(719f66742147cb8e5720250ce744e5eb4983ab82) )
13901258ROM_END
13911259
13921260ROM_START( pbss330 ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9233-01 U1-RO1 C1993 MII */
r26520r26521
13991267   ROM_LOAD( "9233-00-01_u14-r0", 0x50000, 0x10000, CRC(c6701f15) SHA1(d475c4490df8dfa6f2374bb70ef12c7afaecd501) )
14001268   ROM_LOAD( "9233-00-01_u15-r0", 0x60000, 0x10000, CRC(5810840e) SHA1(bad6457752ac212c3c11360a13a8d3473662a287) )
14011269
1270   ROM_REGION( 0x000022, "ds1204", 0 )
1271   ROM_LOAD( "9233-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) )
14021272
14031273   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
14041274   ROM_LOAD( "qs9233-01_u7-r0",  0x00000, 0x40000, CRC(176dd688) SHA1(306cf78101219ef1122023a01d16dff5e9f2aecf) ) /* These 3 roms are on CRT-256 sattalite PCB */
r26520r26521
14161286   ROM_LOAD( "9234-10-01_u14-r0", 0x50000, 0x10000, CRC(9b0873a4) SHA1(7362c6220aa4bf1a9ab7c11cb8a51587a2a0a992) )
14171287   ROM_LOAD( "9234-10-01_u15-r0", 0x60000, 0x10000, CRC(9fbd8582) SHA1(c0f68c8a7cdca34c8736cefc71767c421bcaba8a) )
14181288
1289   ROM_REGION( 0x000022, "ds1204", 0 )
1290   ROM_LOAD( "9234-10_u1-ro1_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) )
14191291
14201292   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
14211293   ROM_LOAD( "qs9234-01_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
r26520r26521
14331305   ROM_LOAD( "9234-00-01_u14-r0a", 0x50000, 0x10000, CRC(e83f91d5) SHA1(1d64c943787b239763f44be412ee7f5ad13eb37d) )
14341306   ROM_LOAD( "9234-00-01_u15-r0a", 0x60000, 0x10000, CRC(f10f0d39) SHA1(2b5d5a93adb5251e09160b10c067b6e70289f608) )
14351307
1308   ROM_REGION( 0x000022, "ds1204", 0 )
1309   ROM_LOAD( "9234-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) )
14361310
14371311   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
14381312   ROM_LOAD( "qs9234-01_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
r26520r26521
15071381   ROM_LOAD( "9244-00-01_u15-r0", 0x60000, 0x10000, CRC(740e3734) SHA1(6440d258af114f3820683b4e6fba5db6aea02231) )
15081382   ROM_RELOAD(     0x70000, 0x10000)
15091383
1384   ROM_REGION( 0x000022, "ds1204", 0 )
1385   ROM_LOAD( "9244-00_u1-ro1_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(0455e18b) SHA1(919b48c25888af0af34b2d0cf34370476a97b79e) )
15101386
15111387   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
15121388   ROM_LOAD( "qs9243-00-01_u7-r0",  0x00000, 0x40000, CRC(35f4ca46) SHA1(87917b3017f505fae65d6bfa2c7d6fb503c2da6a) ) /* These 3 roms are on CRT-256 sattalite PCB */
r26520r26521
16061482   ROM_RELOAD(                        0x280000, 0x080000)
16071483   ROM_LOAD( "9255-10-01_u38-r0g",    0x300000, 0x080000, CRC(6bc7f1ce) SHA1(ca26afe19966f37e95f8ca25e69bbdcc1e8624d7) ) /* Location U38, 02/10/1995 09:14:15 - Standard version */
16081484   ROM_RELOAD(                        0x380000, 0x080000)
1485
1486   ROM_REGION( 0x000022, "ds1204", 0 )
1487   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
16091488ROM_END
16101489
16111490ROM_START( megat2a ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26520r26521
16181497   ROM_RELOAD(                        0x280000, 0x080000)
16191498   ROM_LOAD( "9255-10-01_u38-r0e",    0x300000, 0x080000, CRC(797fbbaf) SHA1(8d093374f109831e469133aaebc3f7c2a5ed0623) ) /* Location U38, 11/29/1994 10:51:00 - Standard version */
16201499   ROM_RELOAD(                        0x380000, 0x080000)
1500
1501   ROM_REGION( 0x000022, "ds1204", 0 )
1502   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
16211503ROM_END
16221504
16231505ROM_START( megat2b ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26520r26521
16301512   ROM_RELOAD(                        0x280000, 0x080000)
16311513   ROM_LOAD( "9255-10-01_u38-r0d",    0x300000, 0x080000, CRC(f43de55f) SHA1(456b4098e22982d5f1c6f872684eefb473939747) ) /* Location U38, 941123 514 - Standard version */
16321514   ROM_RELOAD(                        0x380000, 0x080000)
1515
1516   ROM_REGION( 0x000022, "ds1204", 0 )
1517   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
16331518ROM_END
16341519
16351520ROM_START( megat2mn ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26520r26521
16421527   ROM_RELOAD(                        0x280000, 0x080000)
16431528   ROM_LOAD( "9255-10-02_u38-r0g",    0x300000, 0x080000, CRC(22f508be) SHA1(a34c9c1ae588ec8186f328119aa62600d05f192e) ) /* Location U38, 02/21/1995 16:46:14 - Minnesota version */
16441529   ROM_RELOAD(                        0x380000, 0x080000)
1530
1531   ROM_REGION( 0x000022, "ds1204", 0 )
1532   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
16451533ROM_END
16461534
16471535ROM_START( megat2ca ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26520r26521
16541542   ROM_RELOAD(                        0x280000, 0x080000)
16551543   ROM_LOAD( "9255-10-06_u38-r0g",    0x300000, 0x080000, CRC(51b8160a) SHA1(f2dd44ff3bd62c86c385b5e1438c560947f6c253) ) /* Location U38, 02/10/1995 10:03:52 - California version */
16561544   ROM_RELOAD(                        0x380000, 0x080000)
1545
1546   ROM_REGION( 0x000022, "ds1204", 0 )
1547   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
16571548ROM_END
16581549
16591550ROM_START( megat2caa ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26520r26521
16661557   ROM_RELOAD(                        0x280000, 0x080000)
16671558   ROM_LOAD( "9255-10-06_u38-r0e",    0x300000, 0x080000, CRC(b3c0e60a) SHA1(a633fec476f44ec7964329bd80257b9070043209) ) /* Location U38, 11/29/1994 11:23:00 - California version */
16681559   ROM_RELOAD(                        0x380000, 0x080000)
1560
1561   ROM_REGION( 0x000022, "ds1204", 0 )
1562   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
16691563ROM_END
16701564
16711565ROM_START( megat3 ) /* Dallas DS1204V security key at U5 labeled 9255-20-01 U5-RO1 C1995 MII */
r26520r26521
16781572   ROM_LOAD( "9255-20-01_u38-r0n", 0x300000, 0x080000, CRC(c3b1739d) SHA1(a12d4d4205e71cf306c7e4a7b03af017096e2492) ) /* Location U38, 02/20/1996 09:32:34 - Standard Version */
16791573   ROM_RELOAD(                     0x380000, 0x080000)
16801574
1575   ROM_REGION( 0x000022, "ds1204", 0 )
1576   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1577
16811578   ROM_REGION( 0x1000, "user2", 0 ) // PALs
16821579   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
16831580   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
16951592   ROM_LOAD( "9255-20-01_u38-r0k", 0x300000, 0x080000, CRC(3c7dfff5) SHA1(b1265d6541199a1327a87881457616c56cbb8779) ) /* Location U38, 02/09/1996 14:11:24 - Standard Version */
16961593   ROM_RELOAD(                     0x380000, 0x080000)
16971594
1595   ROM_REGION( 0x000022, "ds1204", 0 )
1596   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1597
16981598   ROM_REGION( 0x1000, "user2", 0 ) // PALs
16991599   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
17001600   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
17121612   ROM_LOAD( "9255-20-01_u38-r0f", 0x300000, 0x080000, CRC(85f48b91) SHA1(7a38644ac7ee55a254c037122af919fb268744a1) ) /* Location U38, 10/27/1995 14:23:00 - Standard Version */
17131613   ROM_RELOAD(                     0x380000, 0x080000)
17141614
1615   ROM_REGION( 0x000022, "ds1204", 0 )
1616   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1617
17151618   ROM_REGION( 0x1000, "user2", 0 ) // PALs
17161619   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
17171620   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
17291632   ROM_LOAD( "9255-20-01_u38-r0b", 0x300000, 0x080000, CRC(e2d7e2c5) SHA1(bf0be5f2142e5563eb3286f5b1a643943d685621) ) /* Location U38, 06/22/1995 15:30:06 - Standard Version */
17301633   ROM_RELOAD(                     0x380000, 0x080000)
17311634
1635   ROM_REGION( 0x000022, "ds1204", 0 )
1636   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1637
17321638   ROM_REGION( 0x1000, "user2", 0 ) // PALs
17331639   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
17341640   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
17461652   ROM_LOAD( "9255-20-01_u38-r0a", 0x300000, 0x080000, CRC(1292c90e) SHA1(d6ca81396ae4f6c62a55ec688b3a36272b9c29fd) ) /* Location U38, 06/21/1995 09:31:31 - Standard Version */
17471653   ROM_RELOAD(                     0x380000, 0x080000)
17481654
1655   ROM_REGION( 0x000022, "ds1204", 0 )
1656   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1657
17491658   ROM_REGION( 0x1000, "user2", 0 ) // PALs
17501659   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
17511660   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
17631672   ROM_LOAD( "9255-20-06_u38-r0n", 0x300000, 0x080000, CRC(f9ff003a) SHA1(6c32098593c444785de2deca0f8748042980d84d) ) /* Location U38, 02/20/1996 09:24:17 - California version */
17641673   ROM_RELOAD(                     0x380000, 0x080000)
17651674
1675   ROM_REGION( 0x000022, "ds1204", 0 )
1676   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1677
17661678   ROM_REGION( 0x1000, "user2", 0 ) // PALs
17671679   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
17681680   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
17801692   ROM_LOAD( "9255-20-06_u38-r0d", 0x300000, 0x080000, CRC(c40b3a57) SHA1(7a13172b94188c5cba32622016a05eb904714a86) ) /* Location U38, 07/24/1995 12:05:34 - California version */
17811693   ROM_RELOAD(                     0x380000, 0x080000)
17821694
1695   ROM_REGION( 0x000022, "ds1204", 0 )
1696   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1697
17831698   ROM_REGION( 0x1000, "user2", 0 ) // PALs
17841699   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
17851700   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
17971712   ROM_LOAD( "9255-20-07_u38-r0g", 0x300000, 0x080000, CRC(0ac673e7) SHA1(6b014366fcc5cdaa3d6a7e40da580d14def80174) ) /* Location U38, 11/17/1995 09:43:15 - New Jersey version */
17981713   ROM_RELOAD(                     0x380000, 0x080000)
17991714
1715   ROM_REGION( 0x000022, "ds1204", 0 )
1716   ROM_LOAD( "9255-20-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(105fd1de) SHA1(da5e678b633df4d7eb5eac2647d7f1fbe04add7b) )
1717
18001718   ROM_REGION( 0x1000, "user2", 0 ) // PALs
18011719   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
18021720   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
18131731   ROM_LOAD( "9255-30-01_u38-r0e", 0x300000, 0x080000, CRC(52ca7dd8) SHA1(9f44f158d67d7443405b87a18fc89d9c88be1dea) ) /* Location U38, 02/15/1996 16:04:36 - Standard Version */
18141732   ROM_RELOAD(                     0x380000, 0x080000)
18151733
1734   ROM_REGION( 0x000022, "ds1204", 0 )
1735   ROM_LOAD( "9255-30-01_u5-ro1_c1995_mii", 0x000000, 0x000022, BAD_DUMP CRC(562e83c8) SHA1(865c8f18711df5dac9c7301f67be5bfcc925cd3d) )
1736
18161737   ROM_REGION( 0x1000, "user2", 0 ) // PALs
18171738   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
18181739   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
18301751   ROM_LOAD( "9255-40-01_u38-r0e", 0x300000, 0x80000,  CRC(407c5e57) SHA1(c7c907b3fd6a8e64dcc6c71288505980862effce) ) /* Location U38, 07/22/1996 14:52:24 - Standard Version */
18311752   ROM_RELOAD(                     0x380000, 0x80000)
18321753
1754   ROM_REGION( 0x000022, "ds1204", 0 )
1755   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1756
18331757   ROM_REGION( 0x1000, "user2", 0 ) // PALs
18341758   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
18351759   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
18471771   ROM_LOAD( "9255-40-01_u38-r0d", 0x300000, 0x80000,  CRC(0d098424) SHA1(ef2810ccd636e69378fd353c8a95605274bb227f) ) /* Location U38, 07/08/1996 14:16:56 - Standard Version */
18481772   ROM_RELOAD(                     0x380000, 0x80000)
18491773
1774   ROM_REGION( 0x000022, "ds1204", 0 )
1775   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1776
18501777   ROM_REGION( 0x1000, "user2", 0 ) // PALs
18511778   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
18521779   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
18641791   ROM_LOAD( "9255-40-01_u38-r0b", 0x300000, 0x80000,  CRC(0a16c846) SHA1(f0dcddb155f5e23a8dcf6bd8018cf6dc20c6bd34) ) /* Location U38, 05/03/1996 15:12 - Standard Version */
18651792   ROM_RELOAD(                     0x380000, 0x80000)
18661793
1794   ROM_REGION( 0x000022, "ds1204", 0 )
1795   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1796
18671797   ROM_REGION( 0x1000, "user2", 0 ) // PALs
18681798   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
18691799   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
18811811   ROM_LOAD( "9255-40-01_u38-r0a", 0x300000, 0x80000,  CRC(74188592) SHA1(aaa4cb5eb413e963c4ff3705904449e244b984ca) ) /* Location U38, 04/22/1996 14:31 - Standard Version */
18821812   ROM_RELOAD(                     0x380000, 0x80000)
18831813
1814   ROM_REGION( 0x000022, "ds1204", 0 )
1815   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1816
18841817   ROM_REGION( 0x1000, "user2", 0 ) // PALs
18851818   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
18861819   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
18981831   ROM_LOAD( "9255-40-01_u38-r0",  0x300000, 0x80000,  CRC(ec96813d) SHA1(f93bb08ae89ab5ec1c6b33d5b1040c50d3db9ef5) ) /* Location U38, 04/03/1996 14:01 - Standard Version */
18991832   ROM_RELOAD(                     0x380000, 0x80000)
19001833
1834   ROM_REGION( 0x000022, "ds1204", 0 )
1835   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1836
19011837   ROM_REGION( 0x1000, "user2", 0 ) // PALs
19021838   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
19031839   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
19151851   ROM_LOAD( "9255-41-01_u38-r0g", 0x300000, 0x80000,  CRC(9c0a515a) SHA1(01b9761a8ddf95e32498ac204844144d9dc32012) ) /* Location U38, 12/10/1996  17:08:08 - Standard version */
19161852   ROM_RELOAD(                     0x380000, 0x80000)
19171853
1854   ROM_REGION( 0x000022, "ds1204", 0 )
1855   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1856
19181857   ROM_REGION( 0x1000, "user2", 0 ) // PALs
19191858   ROM_LOAD( "sc3943(__megat4s).u20",     0x000, 0x117, CRC(f31864ff) SHA1(ff44820379a350e7bd788ffb6926612b3483e114) )
19201859   ROM_LOAD( "sc3944-0a(__megat4s).u19",  0x000, 0x2dd, CRC(ad4fddaa) SHA1(10c1575dcaa5ca4af5dc630d84f43a9ed1cb3ace) )
r26520r26521
19321871   ROM_LOAD( "9255-41-01_u38-r0e", 0x300000, 0x80000,  CRC(69cbf865) SHA1(ce555b6ab70fa57f3f87a0028db563ceee4a416b) ) /* Location U38, 10/22/1996  11:05:04 - Standard version */
19331872   ROM_RELOAD(                     0x380000, 0x80000)
19341873
1874   ROM_REGION( 0x000022, "ds1204", 0 )
1875   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1876
19351877   ROM_REGION( 0x1000, "user2", 0 ) // PALs
19361878   ROM_LOAD( "sc3943(__megat4s).u20",     0x000, 0x117, CRC(f31864ff) SHA1(ff44820379a350e7bd788ffb6926612b3483e114) )
19371879   ROM_LOAD( "sc3944-0a(__megat4s).u19",  0x000, 0x2dd, CRC(ad4fddaa) SHA1(10c1575dcaa5ca4af5dc630d84f43a9ed1cb3ace) )
r26520r26521
19491891   ROM_LOAD( "9255-41-01_u38-r0c", 0x300000, 0x80000,  CRC(14b9fe96) SHA1(a324e1ef616b33ee4235f6bed04f6d4b0b537521) ) /* Location U38, 10/04/1996  09:39:04 - Standard version */
19501892   ROM_RELOAD(                     0x380000, 0x80000)
19511893
1894   ROM_REGION( 0x000022, "ds1204", 0 )
1895   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1896
19521897   ROM_REGION( 0x1000, "user2", 0 ) // PALs
19531898   ROM_LOAD( "sc3943(__megat4s).u20",     0x000, 0x117, CRC(f31864ff) SHA1(ff44820379a350e7bd788ffb6926612b3483e114) )
19541899   ROM_LOAD( "sc3944-0a(__megat4s).u19",  0x000, 0x2dd, CRC(ad4fddaa) SHA1(10c1575dcaa5ca4af5dc630d84f43a9ed1cb3ace) )
r26520r26521
19661911   ROM_LOAD( "9255-41-02_u38-r0c", 0x300000, 0x80000,  CRC(0493168d) SHA1(99da5454902aa5dbc5939d4bef22af3e467e61d2) ) /* Location U38, 10/08/1996 09:56:42 - Minnesota version */
19671912   ROM_RELOAD(                     0x380000, 0x80000)
19681913
1914   ROM_REGION( 0x000022, "ds1204", 0 )
1915   ROM_LOAD( "9255-40-01_u5-c-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1916
19691917   ROM_REGION( 0x8000, "nvram", 0 ) // DS1225Y nv ram
19701918   ROM_LOAD( "mt4smn_ds1225y.u31",  0x0000, 0x8000, CRC(3f47e8e9) SHA1(ecf2937ddf05206c68262bccb8cb4a6c2a4048e8) ) /* No actual label, so use a unique name for this set */
19711919
r26520r26521
19861934   ROM_LOAD( "9255-41-07_u38-r0g", 0x300000, 0x80000,  CRC(71eac4d4) SHA1(73b9ed876f0af94bbd88503921a2b4f26bcfd397) ) /* Location U38, 02/11/1997 11:59:41 - New Jersey version */
19871935   ROM_RELOAD(                     0x380000, 0x80000)
19881936
1937   ROM_REGION( 0x000022, "ds1204", 0 )
1938   ROM_LOAD( "9255-40-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(f1de113a) SHA1(0ddd963e24a5c36f11967c2653ec5991a6eaa1a4) )
1939
19891940   ROM_REGION( 0x8000, "nvram", 0 ) // DS1225Y nv ram
19901941   ROM_LOAD( "mt4snj_ds1225y.u31",  0x0000, 0x8000, CRC(8d2a97e7) SHA1(7cb01d9499fed1674da6a04a11ed1cef0a39b3c0) ) /* No actual label, so use a unique name for this set */
19911942
r26520r26521
20061957   ROM_LOAD( "9255-50-01_u38-r0d", 0x300000, 0x080000, CRC(124d5b84) SHA1(3c2117f56d0dc406bfb508989729e36781e215a4) ) /* Location U38, 07/02/1996 14:41:59 - Standard Version */
20071958   ROM_RELOAD(                     0x380000, 0x080000 )
20081959
1960   ROM_REGION( 0x000022, "ds1204", 0 )
1961   ROM_LOAD( "9255-50-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(9db02da4) SHA1(d4eec99e814dd6daa091f1ff2fb06bda314c5029) )
1962
20091963   ROM_REGION( 0x8000, "nvram", 0 ) // DS1644 nv ram
20101964   ROM_LOAD( "mt4te_ds1644.u31",  0x00000,  0x8000,   CRC(d9485491) SHA1(c602bf954fe8b06f81b0f5002246e8fa89237705) ) /* No actual label, so use a unique name for this set */
20111965
r26520r26521
20261980   ROM_LOAD( "9255-50-01_u38-r0a", 0x300000, 0x080000, CRC(abf187a5) SHA1(d4d2327b4564f3cafa2640499f8c6ae818ed04b8) ) /* Location U38, 06/06/1996 13:43:39 - Standard Version */
20271981   ROM_RELOAD(                     0x380000, 0x080000 )
20281982
1983   ROM_REGION( 0x000022, "ds1204", 0 )
1984   ROM_LOAD( "9255-50-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(9db02da4) SHA1(d4eec99e814dd6daa091f1ff2fb06bda314c5029) )
1985
20291986   ROM_REGION( 0x8000, "nvram", 0 ) // DS1644 nv ram
20301987   ROM_LOAD( "mt4tea_ds1644.u31",  0x00000,  0x8000,   CRC(11e2c7ed) SHA1(99ee83410f7dbf5a259b11193829bb5c706d9fca) ) /* No actual label, so use a unique name for this set */
20311988
r26520r26521
20462003   ROM_LOAD( "9255-51-01_u38-r0b", 0x300000, 0x080000, CRC(181a83cb) SHA1(b8f92ae76ebba3849db76b084f0ab7d82256d81a) ) /* Location U38, 12/10/1996 16:59:23 - Standard Version */
20472004   ROM_RELOAD(                     0x380000, 0x080000 )
20482005
2006   ROM_REGION( 0x000022, "ds1204", 0 )
2007   ROM_LOAD( "9255-51-01_u5-b-ro1_c1996_mii", 0x000000, 0x000022, BAD_DUMP CRC(14e4dfa8) SHA1(6a6a2a49c6862bbba3bde766e8f000828b1b3998) )
2008
20492009   ROM_REGION( 0x8000, "nvram", 0 ) // DS1644 nv ram
20502010   ROM_LOAD( "mt4st_ds1644.u31",  0x00000,  0x8000,   CRC(c6226d91) SHA1(20c9fa7ad135ac229c6bdf85b901629a0ecb8a81) ) /* No actual label, so use a unique name for this set */
20512011
r26520r26521
20662026   ROM_LOAD( "9255-51-50_u38-r0a", 0x300000, 0x080000, CRC(f7c2914d) SHA1(5d05b8db5ca734f7b05c3e215c0ef5b917455537) ) /* Location U38, 11/18/1996 10:11:01 - Bi-Lingual GER/ENG Version */
20672027   ROM_RELOAD(                     0x380000, 0x080000 )
20682028
2029   ROM_REGION( 0x000022, "ds1204", 0 )
2030   ROM_LOAD( "9255-51-50_u5-b-ro1_c1996_mii", 0x000000, 0x000022, CRC(14e4dfa8) SHA1(6a6a2a49c6862bbba3bde766e8f000828b1b3998) )
2031
20692032   ROM_REGION( 0x8000, "nvram", 0 ) // DS1644 nv ram
20702033   ROM_LOAD( "mt4stg_ds1644.u31",  0x00000,  0x8000,   CRC(7f6f8e57) SHA1(d65f20ae19afc05b33d7605143b8362d6e955e89) ) /* No actual label, so use a unique name for this set */
20712034
r26520r26521
20852048   ROM_RELOAD(                     0x280000, 0x80000)
20862049   ROM_LOAD( "9255-60-01_u38-r0i", 0x300000, 0x100000, CRC(82a4471d) SHA1(e66ab64bb7047e248f9edbf99eb83c480895dc68) ) /* Location U38, 09/26/1997 12:09:52 - Standard Version */
20872050
2051   ROM_REGION( 0x000022, "ds1204", 0 )
2052   ROM_LOAD( "9255-60-01_u5-c-ro1_c1998_mii", 0x000000, 0x000022, BAD_DUMP CRC(81f1c9b1) SHA1(e03ab8fae8225332edd353725039ad0cedcd9493) )
2053
20882054   ROM_REGION( 0x1000, "user2", 0 ) // PALs
20892055   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
20902056   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
21022068   ROM_LOAD( "9255-60-01_u38-r0c", 0x300000, 0x100000, CRC(1091e7fd) SHA1(3c31c178eb7bea0d2c7e839dc3ec549463092296) ) /* Location U38, 07/10/1997 16:49:56 - Standard Version */
21032069   /* 9255-60-01_u38-r0c has been verified with 4 sets as correct. It's not working due to??? */
21042070
2071   ROM_REGION( 0x000022, "ds1204", 0 )
2072   ROM_LOAD( "9255-60-01_u5-c-ro1_c1998_mii", 0x000000, 0x000022, BAD_DUMP CRC(81f1c9b1) SHA1(e03ab8fae8225332edd353725039ad0cedcd9493) )
2073
21052074   ROM_REGION( 0x1000, "user2", 0 ) // PALs
21062075   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
21072076   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
21182087   ROM_RELOAD(                     0x280000, 0x80000)
21192088   ROM_LOAD( "9255-60-07_u38-r0n", 0x300000, 0x100000, CRC(c8163fe8) SHA1(94199b892ce9e5f543e10f3f59a9aeee4782923f) ) /* Location U38, 07/13/1998 15:19:55 - New Jersey version */
21202089
2090   ROM_REGION( 0x000022, "ds1204", 0 )
2091   ROM_LOAD( "9255-60-01_u5-b-ro1_c1998_mii", 0x000000, 0x000022, BAD_DUMP CRC(81f1c9b1) SHA1(e03ab8fae8225332edd353725039ad0cedcd9493) )
2092
21212093   ROM_REGION( 0x1000, "user2", 0 ) // PALs
21222094   ROM_LOAD( "sc3943.u20",     0x000, 0x117, CRC(5a72fe78) SHA1(4b1a36904eb7048518507fe14bdade5c2589dbd7) )
21232095   ROM_LOAD( "sc3944-0a.u19",  0x000, 0x2dd, CRC(4cc46c5e) SHA1(0bab970df1539ce905f43603ad13171b05449a01) )
r26520r26521
21342106   ROM_RELOAD(                     0x280000, 0x80000)
21352107   ROM_LOAD( "9255-70-01_u38-r0c", 0x300000, 0x100000, CRC(e4d71764) SHA1(7c4e8b484dc744a93ce42e24f3b6d5bb2a7c09e4) ) /* Location U38, 09/30/1997 12:13:24 - Standard version */
21362108
2109   ROM_REGION( 0x000022, "ds1204", 0 )
2110   ROM_LOAD( "9255-70-01_u5-ro_c1997_mii", 0x000000, 0x000022, BAD_DUMP CRC(1888e4f2) SHA1(045b94d6600345c10098cae321811717071c4902) )
2111
21372112   ROM_REGION( 0x8000, "nvram", 0 ) // DS1644 nv ram
21382113   ROM_LOAD( "mt5t_ds1644.u31",  0x00000,  0x8000,   CRC(d1b91acf) SHA1(5ae3449d83b35ba5b20f7ff60eba4359f29cb744) ) /* No actual label, so use a unique name for this set */
21392114
r26520r26521
21532128   ROM_RELOAD(                     0x280000, 0x80000)
21542129   ROM_LOAD( "9255-70-50_u38-r0d", 0x300000, 0x100000, CRC(044d123f) SHA1(d73df1f97f6da03fdee2ca3fda3845ec262a0f9a) ) /* Location U38, 10/29/1997 10:19:08 - Bi-Lingual GER/ENG Version */
21552130
2131   ROM_REGION( 0x000022, "ds1204", 0 )
2132   ROM_LOAD( "9255-70-50_u5-c-ro1_c1998_mii", 0x000000, 0x000022, BAD_DUMP CRC(1888e4f2) SHA1(045b94d6600345c10098cae321811717071c4902) )
2133
21562134   ROM_REGION( 0x8000, "nvram", 0 ) // DS1644 nv ram
21572135   ROM_LOAD( "mt5tg_ds1644.u31",  0x00000,  0x8000,   CRC(a054bb32) SHA1(4efc19cb0a671dfe9249ce85d31f6bd633f2a237) ) /* No actual label, so use a unique name for this set */
21582136
r26520r26521
21712149   ROM_LOAD( "qs9255-08_u37-r0",   0x200000, 0x100000, CRC(5ba01949) SHA1(1598949ea18d07bbc78af0ddd279a687173c1229) ) /* Location U37 */
21722150   ROM_LOAD( "9255-80-01_u38-r0a", 0x300000, 0x100000, CRC(3df6b840) SHA1(31ba1ac04eed3e76cdf637507dedcc5f7e22c919) ) /* Location U38, 08/07/1998 15:54:23 - Standard Version */
21732151
2152   ROM_REGION( 0x000022, "ds1204", 0 )
2153   ROM_LOAD( "9255-80_u5-b-ro1_c1998_mii", 0x000000, 0x000022, BAD_DUMP CRC(975099f5) SHA1(bdb870b5d3aa1139320b426f8669418cf85a513e) )
2154
21742155   ROM_REGION( 0x8000, "nvram", 0 ) // DS1230 nv ram
21752156   ROM_LOAD( "ds1230y.u31",  0x00000, 0x8000, CRC(51b6da5c) SHA1(1d53af89d7867bb48b9d46feff6fc3b7e8e80ac8) )
21762157
r26520r26521
21812162   ROM_LOAD( "sc3981-0a.u51",  0x000, 0x117, CRC(4fc750d0) SHA1(d09ff7a8c66aeb5c49e9fec84bd1521e3f5d8d0a) )
21822163ROM_END
21832164
2184DRIVER_INIT_MEMBER(meritm_state,pitbossm)
2185{
2186   static const UINT8 pitbossm_ds1204_key[8] =
2187      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2188
2189   static const UINT8 pitbossm_ds1204_nvram[16] =
2190      { 0x16, 0x90, 0xa0, 0x52, 0xd8, 0x6c, 0x12, 0xaf, 0x36, 0x22, 0x61, 0x35, 0x0d, 0x58, 0x0c, 0x00 };
2191
2192   ds1204_init(pitbossm_ds1204_key, pitbossm_ds1204_nvram);
2193
2194};
2195
2196DRIVER_INIT_MEMBER(meritm_state,pitbossc)
2197{
2198   static const UINT8 pitbossc_ds1204_key[8] =
2199      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2200
2201   static const UINT8 pitbossc_ds1204_nvram[16] =
2202         { 0x00, 0x00, 0x00, 0x39, 0x32, 0x32, 0x31, 0x2d, 0x31, 0x32, 0x30, 0xf4, 0xa1, 0x52, 0x56, 0x20 };
2203
2204   ds1204_init(pitbossc_ds1204_key, pitbossc_ds1204_nvram);
2205
2206};
2207
2208DRIVER_INIT_MEMBER(meritm_state,pbss330)
2209{
2210   static const UINT8 pbss330_ds1204_key[8] =
2211      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2212
2213   static const UINT8 pbss330_ds1204_nvram[16] =
2214      { 0x09, 0x2b, 0x6b, 0xf7, 0x83, 0xca, 0x8e, 0xdd, 0x1a, 0x7e, 0x76, 0x1a, 0x75, 0x5e, 0x77, 0x00 };
2215
2216   ds1204_init(pbss330_ds1204_key, pbss330_ds1204_nvram);
2217
2218};
2219
2220DRIVER_INIT_MEMBER(meritm_state,pbst30)
2221{
2222   static const UINT8 pbst30b_ds1204_key[8] =
2223      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2224
2225   static const UINT8 pbst30b_ds1204_nvram[16] =
2226      { 0x3e, 0x9a, 0x3c, 0x3f, 0x1d, 0x51, 0x72, 0xc9, 0x28, 0x2c, 0x1d, 0x2d, 0x0e, 0x56, 0x41, 0x00 };
2227
2228   ds1204_init(pbst30b_ds1204_key, pbst30b_ds1204_nvram);
2229
2230};
2231
2232DRIVER_INIT_MEMBER(meritm_state,pbst30b)
2233{
2234   static const UINT8 pbst30b_ds1204_key[8] =
2235      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2236
2237   static const UINT8 pbst30b_ds1204_nvram[16] =
2238      { 0xa9, 0xdb, 0x41, 0xf8, 0xe4, 0x42, 0x20, 0x6e, 0xde, 0xaf, 0x4f, 0x046, 0x3d, 0x55, 0x44, 0x00 };
2239
2240   ds1204_init(pbst30b_ds1204_key, pbst30b_ds1204_nvram);
2241
2242};
2243
2244DRIVER_INIT_MEMBER(meritm_state,megat2)
2245{
2246   static const UINT8 pitbosmt_ds1204_key[8] =
2247      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2248
2249   static const UINT8 pitbosmt_ds1204_nvram[16] =
2250      { 0x00, 0xfe, 0x03, 0x03, 0x08, 0x00, 0xa2, 0x03, 0x4b, 0x07, 0x00, 0xe6, 0x02, 0xd3, 0x05, 0x00 };
2251
2252   ds1204_init(pitbosmt_ds1204_key, pitbosmt_ds1204_nvram);
2253
2254};
2255
2256DRIVER_INIT_MEMBER(meritm_state,megat3)
2257{
2258   static const UINT8 megat3_ds1204_key[8] =
2259      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2260
2261   static const UINT8 megat3_ds1204_nvram[16] =
2262      { 0x51, 0xa1, 0xc0, 0x7c, 0x27, 0x6e, 0x51, 0xb9, 0xa5, 0xb2, 0x27, 0x0c, 0xb9, 0x88, 0x82, 0x2c };
2263
2264   ds1204_init(megat3_ds1204_key, megat3_ds1204_nvram);
2265
2266};
2267
22682165DRIVER_INIT_MEMBER(meritm_state,megat3te)
22692166{
2270   static const UINT8 megat3_ds1204_key[8] =
2271      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2272
2273   static const UINT8 megat3_ds1204_nvram[16] =
2274      { 0x99, 0x53, 0xfc, 0x29, 0x3a, 0x95, 0x8b, 0x58, 0xca, 0xca, 0x00, 0xc2, 0x30, 0x62, 0x0b, 0x96 };
2275
2276   ds1204_init(megat3_ds1204_key, megat3_ds1204_nvram);
2277
22782167   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this));
2279
22802168};
22812169
2282DRIVER_INIT_MEMBER(meritm_state,megat4)
2283{
2284   static const UINT8 megat4_ds1204_nvram[16] =
2285      { 0xe3, 0x08, 0x39, 0xd8, 0x4c, 0xbb, 0xc4, 0xf8, 0xf0, 0xe2, 0xd8, 0x77, 0xa8, 0x3d, 0x95, 0x02 };
2286
2287   ds1204_init(0, megat4_ds1204_nvram);
2288}
2289
2290DRIVER_INIT_MEMBER(meritm_state,megat4c)
2291{
2292   static const UINT8 megat4c_ds1204_key[8] =
2293      { 0xf0, 0xaa, 0x0f, 0x0f, 0x55, 0x55, 0xff, 0xab };
2294
2295   static const UINT8 megat4_ds1204_nvram[16] =
2296      { 0xe3, 0x08, 0x39, 0xd8, 0x4c, 0xbb, 0xc4, 0xf8, 0xf0, 0xe2, 0xd8, 0x77, 0xa8, 0x3d, 0x95, 0x02 };
2297
2298   ds1204_init(megat4c_ds1204_key, megat4_ds1204_nvram);
2299}
2300
2301DRIVER_INIT_MEMBER(meritm_state,megat4te)
2302{
2303   static const UINT8 megat4te_ds1204_nvram[16] =
2304      { 0x05, 0x21, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
2305
2306   ds1204_init(0, megat4te_ds1204_nvram);
2307
2308   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this));
2309
2310};
2311
2312DRIVER_INIT_MEMBER(meritm_state,megat4st)
2313{
2314   static const UINT8 megat4te_ds1204_nvram[16] =
2315      { 0x11, 0x04, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
2316
2317   ds1204_init(0, megat4te_ds1204_nvram);
2318
2319   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this));
2320
2321};
2322
2323DRIVER_INIT_MEMBER(meritm_state,megat5)
2324{
2325   static const UINT8 megat5_ds1204_nvram[16] =
2326      { 0x06, 0x23, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
2327
2328   ds1204_init(0, megat5_ds1204_nvram);
2329
2330}
2331
2332DRIVER_INIT_MEMBER(meritm_state,megat5t)
2333{
2334   static const UINT8 megat5_ds1204_nvram[16] =
2335      { 0x08, 0x22, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
2336
2337   ds1204_init(0, megat5_ds1204_nvram);
2338
2339   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this));
2340
2341}
2342
2343DRIVER_INIT_MEMBER(meritm_state,megat6)
2344{
2345   static const UINT8 megat6_ds1204_nvram[16] =
2346      { 0x07, 0x15, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 };
2347
2348   ds1204_init(0, megat6_ds1204_nvram);
2349
2350}
2351
23522170/* CRT 250 */
23532171GAME( 1988, dodgecty,  0,        meritm_crt250, dodgecty, driver_device, 0,        ROT0, "Merit", "Dodge City (9131-02)", GAME_IMPERFECT_GRAPHICS )
23542172GAME( 1988, pitboss2,  0,        meritm_crt250, pitboss2, driver_device, 0,        ROT0, "Merit", "Pit Boss II (9221-01C)", GAME_IMPERFECT_GRAPHICS )
23552173GAME( 1988, spitboss,  0,        meritm_crt250, spitboss, driver_device, 0,        ROT0, "Merit", "Super Pit Boss (9221-02A)", GAME_IMPERFECT_GRAPHICS )
23562174GAME( 1990, pitbosss,  0,        meritm_crt250, pitbosss, driver_device, 0,        ROT0, "Merit", "Pit Boss Superstar (9221-10-00B)", GAME_IMPERFECT_GRAPHICS )
23572175GAME( 1990, pitbosssa, pitbosss, meritm_crt250, pitbosss, driver_device, 0,        ROT0, "Merit", "Pit Boss Superstar (9221-10-00A)", GAME_IMPERFECT_GRAPHICS )
2358GAME( 1992, pitbosssc, pitbosss, meritm_crt250, pitbosss, meritm_state,  pitbossc, ROT0, "Merit", "Pit Boss Superstar (9221-12-01)", GAME_IMPERFECT_GRAPHICS )
2176GAME( 1992, pitbosssc, pitbosss, meritm_crt250, pitbosss, driver_device, 0,        ROT0, "Merit", "Pit Boss Superstar (9221-12-01)", GAME_IMPERFECT_GRAPHICS )
23592177
23602178/* CRT 250 + CRT 252 + CRT 256 + CRT 258 */
2361GAME( 1994, pbst30,    0,      meritm_crt250_crt252_crt258, pbst30, meritm_state,  pbst30,   ROT0, "Merit", "Pit Boss Supertouch 30 (9234-10-01)", GAME_IMPERFECT_GRAPHICS )
2362GAME( 1993, pbst30b,   pbst30, meritm_crt250_crt252_crt258, pbst30, meritm_state,  pbst30b,  ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS )
2179GAME( 1994, pbst30,    0,      meritm_crt250_crt252_crt258, pbst30, driver_device, 0,        ROT0, "Merit", "Pit Boss Supertouch 30 (9234-10-01)", GAME_IMPERFECT_GRAPHICS )
2180GAME( 1993, pbst30b,   pbst30, meritm_crt250_crt252_crt258, pbst30, driver_device, 0,        ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS )
23632181
23642182/* CRT 250 + CRT 254 + CRT 256 */
2365GAME( 1993, pbss330,   0,        meritm_crt250_questions, pbss330,  meritm_state,  pbss330,  ROT0, "Merit", "Pit Boss Superstar III 30 (9233-00-01)", GAME_IMPERFECT_GRAPHICS )
2366GAME( 1994, pitbossm,  0,        meritm_crt250_questions, pitbossm, meritm_state,  pitbossm, ROT0, "Merit", "Pit Boss Megastar (9244-00-01)", GAME_IMPERFECT_GRAPHICS )
2183GAME( 1993, pbss330,   0,        meritm_crt250_questions, pbss330,  driver_device, 0,        ROT0, "Merit", "Pit Boss Superstar III 30 (9233-00-01)", GAME_IMPERFECT_GRAPHICS )
2184GAME( 1994, pitbossm,  0,        meritm_crt250_questions, pitbossm, driver_device, 0,        ROT0, "Merit", "Pit Boss Megastar (9244-00-01)", GAME_IMPERFECT_GRAPHICS )
23672185GAME( 1994, pitbossma, pitbossm, meritm_crt250_questions, pitbossa, driver_device, 0,        ROT0, "Merit", "Pit Boss Megastar (9243-00-01)", GAME_IMPERFECT_GRAPHICS )
23682186
23692187/* CRT 260 */
2370GAME( 1994, megat2,    0,      meritm_crt260, meritm_crt260, meritm_state, megat2,   ROT0, "Merit", "Pit Boss Megatouch II (9255-10-01 ROG, Standard version)", GAME_IMPERFECT_GRAPHICS )
2371GAME( 1994, megat2a ,  megat2, meritm_crt260, meritm_crt260, meritm_state, megat2,   ROT0, "Merit", "Pit Boss Megatouch II (9255-10-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2372GAME( 1994, megat2b ,  megat2, meritm_crt260, meritm_crt260, meritm_state, megat2,   ROT0, "Merit", "Pit Boss Megatouch II (9255-10-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
2373GAME( 1994, megat2mn,  megat2, meritm_crt260, meritm_crt260, meritm_state, megat2,   ROT0, "Merit", "Pit Boss Megatouch II (9255-10-02 ROG, Minnesota version)", GAME_IMPERFECT_GRAPHICS )
2374GAME( 1994, megat2ca,  megat2, meritm_crt260, meritm_crt260, meritm_state, megat2,   ROT0, "Merit", "Pit Boss Megatouch II (9255-10-06 ROG, California version)", GAME_IMPERFECT_GRAPHICS )
2375GAME( 1994, megat2caa, megat2, meritm_crt260, meritm_crt260, meritm_state, megat2,   ROT0, "Merit", "Pit Boss Megatouch II (9255-10-06 ROE, California version)", GAME_IMPERFECT_GRAPHICS )
2376GAME( 1996, megat3,    0,      meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-01 RON, Standard version)", GAME_IMPERFECT_GRAPHICS )
2377GAME( 1995, megat3a,   megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-01 ROK, Standard version)", GAME_IMPERFECT_GRAPHICS )
2378GAME( 1995, megat3b,   megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-01 ROF, Standard version)", GAME_IMPERFECT_GRAPHICS )
2379GAME( 1995, megat3c,   megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
2380GAME( 1995, megat3d,   megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2381GAME( 1996, megat3ca,  megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-06 RON, California version)", GAME_IMPERFECT_GRAPHICS )
2382GAME( 1995, megat3caa, megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-06 ROD, California version)", GAME_IMPERFECT_GRAPHICS )
2383GAME( 1995, megat3nj,  megat3, meritm_crt260, meritm_crt260, meritm_state, megat3,   ROT0, "Merit", "Megatouch III (9255-20-07 ROG, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
2384GAME( 1996, megat3te,  megat3, meritm_crt260, meritm_crt260, meritm_state, megat3te, ROT0, "Merit", "Megatouch III Tournament Edition (9255-30-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2385GAME( 1996, megat4,    0,      meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Megatouch IV (9255-40-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2386GAME( 1996, megat4a,   megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Megatouch IV (9255-40-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
2387GAME( 1996, megat4b,   megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Megatouch IV (9255-40-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
2388GAME( 1996, megat4c,   megat4, meritm_crt260, meritm_crt260, meritm_state, megat4c,  ROT0, "Merit", "Megatouch IV (9255-40-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2389GAME( 1996, megat4d,   megat4, meritm_crt260, meritm_crt260, meritm_state, megat4c,  ROT0, "Merit", "Megatouch IV (9255-40-01 RO, Standard version)", GAME_IMPERFECT_GRAPHICS )
2390GAME( 1996, megat4s,   megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Super Megatouch IV (9255-41-01 ROG, Standard version)", GAME_IMPERFECT_GRAPHICS )
2391GAME( 1996, megat4sa,  megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Super Megatouch IV (9255-41-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2392GAME( 1996, megat4sb,  megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Super Megatouch IV (9255-41-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS )
2393GAME( 1996, megat4smn, megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Super Megatouch IV (9255-41-02 ROC, Minnesota version)", GAME_IMPERFECT_GRAPHICS )
2394GAME( 1996, megat4snj, megat4, meritm_crt260, meritm_crt260, meritm_state, megat4,   ROT0, "Merit", "Super Megatouch IV (9255-41-07 ROG, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
2395GAME( 1996, megat4te,  megat4, meritm_crt260, meritm_crt260, meritm_state, megat4te, ROT0, "Merit", "Megatouch IV Tournament Edition (9255-50-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
2396GAME( 1996, megat4tea, megat4, meritm_crt260, meritm_crt260, meritm_state, megat4te, ROT0, "Merit", "Megatouch IV Tournament Edition (9255-50-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2397GAME( 1996, megat4st,  megat4, meritm_crt260, meritm_crt260, meritm_state, megat4st, ROT0, "Merit", "Super Megatouch IV Tournament Edition (9255-51-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
2398GAME( 1996, megat4stg, megat4, meritm_crt260, meritm_crt260, meritm_state, megat4st, ROT0, "Merit", "Super Megatouch IV Turnier Version (9255-51-50 ROA, Bi-Lingual GER/ENG version)", GAME_IMPERFECT_GRAPHICS )
2399GAME( 1997, megat5,    0,      meritm_crt260, meritm_crt260, meritm_state, megat5,   ROT0, "Merit", "Megatouch 5 (9255-60-01 ROI, Standard version)", GAME_IMPERFECT_GRAPHICS )
2400GAME( 1997, megat5a,   megat5, meritm_crt260, meritm_crt260, meritm_state, megat5,   ROT0, "Merit", "Megatouch 5 (9255-60-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING )
2401GAME( 1998, megat5nj,  megat5, meritm_crt260, meritm_crt260, meritm_state, megat5,   ROT0, "Merit", "Megatouch 5 (9255-60-07 RON, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
2402GAME( 1998, megat5t,   megat5, meritm_crt260, meritm_crt260, meritm_state, megat5t,  ROT0, "Merit", "Megatouch 5 Tournament Edition (9255-70-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS )
2403GAME( 1998, megat5tg,  megat5, meritm_crt260, meritm_crt260, meritm_state, megat5t,  ROT0, "Merit", "Megatouch 5 Turnier Version (9255-70-50 ROD, Bi-Lingual GER/ENG version)", GAME_IMPERFECT_GRAPHICS )
2404GAME( 1998, megat6,    0,      meritm_crt260, meritm_crt260, meritm_state, megat6,   ROT0, "Merit", "Megatouch 6 (9255-80-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2188GAME( 1994, megat2,    0,      meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Pit Boss Megatouch II (9255-10-01 ROG, Standard version)", GAME_IMPERFECT_GRAPHICS )
2189GAME( 1994, megat2a ,  megat2, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Pit Boss Megatouch II (9255-10-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2190GAME( 1994, megat2b ,  megat2, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Pit Boss Megatouch II (9255-10-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
2191GAME( 1994, megat2mn,  megat2, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Pit Boss Megatouch II (9255-10-02 ROG, Minnesota version)", GAME_IMPERFECT_GRAPHICS )
2192GAME( 1994, megat2ca,  megat2, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Pit Boss Megatouch II (9255-10-06 ROG, California version)", GAME_IMPERFECT_GRAPHICS )
2193GAME( 1994, megat2caa, megat2, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Pit Boss Megatouch II (9255-10-06 ROE, California version)", GAME_IMPERFECT_GRAPHICS )
2194GAME( 1996, megat3,    0,      meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-01 RON, Standard version)", GAME_IMPERFECT_GRAPHICS )
2195GAME( 1995, megat3a,   megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-01 ROK, Standard version)", GAME_IMPERFECT_GRAPHICS )
2196GAME( 1995, megat3b,   megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-01 ROF, Standard version)", GAME_IMPERFECT_GRAPHICS )
2197GAME( 1995, megat3c,   megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
2198GAME( 1995, megat3d,   megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2199GAME( 1996, megat3ca,  megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-06 RON, California version)", GAME_IMPERFECT_GRAPHICS )
2200GAME( 1995, megat3caa, megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-06 ROD, California version)", GAME_IMPERFECT_GRAPHICS )
2201GAME( 1995, megat3nj,  megat3, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch III (9255-20-07 ROG, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
2202GAME( 1996, megat3te,  megat3, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Megatouch III Tournament Edition (9255-30-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2203GAME( 1996, megat4,    0,      meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch IV (9255-40-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2204GAME( 1996, megat4a,   megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch IV (9255-40-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
2205GAME( 1996, megat4b,   megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch IV (9255-40-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
2206GAME( 1996, megat4c,   megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch IV (9255-40-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2207GAME( 1996, megat4d,   megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch IV (9255-40-01 RO, Standard version)", GAME_IMPERFECT_GRAPHICS )
2208GAME( 1996, megat4s,   megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Super Megatouch IV (9255-41-01 ROG, Standard version)", GAME_IMPERFECT_GRAPHICS )
2209GAME( 1996, megat4sa,  megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Super Megatouch IV (9255-41-01 ROE, Standard version)", GAME_IMPERFECT_GRAPHICS )
2210GAME( 1996, megat4sb,  megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Super Megatouch IV (9255-41-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS )
2211GAME( 1996, megat4smn, megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Super Megatouch IV (9255-41-02 ROC, Minnesota version)", GAME_IMPERFECT_GRAPHICS )
2212GAME( 1996, megat4snj, megat4, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Super Megatouch IV (9255-41-07 ROG, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
2213GAME( 1996, megat4te,  megat4, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Megatouch IV Tournament Edition (9255-50-01 ROD, Standard version)", GAME_IMPERFECT_GRAPHICS )
2214GAME( 1996, megat4tea, megat4, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Megatouch IV Tournament Edition (9255-50-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
2215GAME( 1996, megat4st,  megat4, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Super Megatouch IV Tournament Edition (9255-51-01 ROB, Standard version)", GAME_IMPERFECT_GRAPHICS )
2216GAME( 1996, megat4stg, megat4, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Super Megatouch IV Turnier Version (9255-51-50 ROA, Bi-Lingual GER/ENG version)", GAME_IMPERFECT_GRAPHICS )
2217GAME( 1997, megat5,    0,      meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch 5 (9255-60-01 ROI, Standard version)", GAME_IMPERFECT_GRAPHICS )
2218GAME( 1997, megat5a,   megat5, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch 5 (9255-60-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING )
2219GAME( 1998, megat5nj,  megat5, meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch 5 (9255-60-07 RON, New Jersey version)", GAME_IMPERFECT_GRAPHICS )
2220GAME( 1998, megat5t,   megat5, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Megatouch 5 Tournament Edition (9255-70-01 ROC, Standard version)", GAME_IMPERFECT_GRAPHICS )
2221GAME( 1998, megat5tg,  megat5, meritm_crt260, meritm_crt260, meritm_state,  megat3te, ROT0, "Merit", "Megatouch 5 Turnier Version (9255-70-50 ROD, Bi-Lingual GER/ENG version)", GAME_IMPERFECT_GRAPHICS )
2222GAME( 1998, megat6,    0,      meritm_crt260, meritm_crt260, driver_device, 0,        ROT0, "Merit", "Megatouch 6 (9255-80-01 ROA, Standard version)", GAME_IMPERFECT_GRAPHICS )
trunk/src/emu/machine/ds1204.c
r0r26521
1// license:MAME
2// copyright-holders:smf
3/*
4 * ds1204.c
5 *
6 * Electronic Key
7 *
8 */
9
10#include <stdio.h>
11#include "emu.h"
12#include "ds1204.h"
13
14#define VERBOSE_LEVEL ( 0 )
15
16inline void ATTR_PRINTF( 3, 4 ) ds1204_device::verboselog( int n_level, const char *s_fmt, ... )
17{
18   if( VERBOSE_LEVEL >= n_level )
19   {
20      va_list v;
21      char buf[ 32768 ];
22      va_start( v, s_fmt );
23      vsprintf( buf, s_fmt, v );
24      va_end( v );
25      logerror( "%s: ds1204(%s) %s", machine().describe_context(), tag(), buf );
26   }
27}
28
29// device type definition
30const device_type DS1204 = &device_creator<ds1204_device>;
31
32ds1204_device::ds1204_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock )
33   : device_t( mconfig, DS1204, "DS1204", tag, owner, clock, "ds1204", __FILE__ ),
34   device_nvram_interface(mconfig, *this),
35   m_rst( 0 ),
36   m_clk( 0 ),
37   m_dqw( 0 )
38{
39}
40
41void ds1204_device::device_start()
42{
43   new_state( STATE_STOP );
44   m_dqr = DQ_HIGH_IMPEDANCE;
45
46   memset( m_command, 0, sizeof( m_command ) );
47   memset( m_compare_register, 0, sizeof( m_compare_register ) );
48
49   save_item( NAME( m_rst ) );
50   save_item( NAME( m_clk ) );
51   save_item( NAME( m_dqw ) );
52   save_item( NAME( m_dqr ) );
53   save_item( NAME( m_state ) );
54   save_item( NAME( m_bit ) );
55   save_item( NAME( m_command ) );
56   save_item( NAME( m_compare_register ) );
57   save_item( NAME( m_unique_pattern ) );
58   save_item( NAME( m_identification ) );
59   save_item( NAME( m_security_match ) );
60   save_item( NAME( m_secure_memory ) );
61}
62
63void ds1204_device::nvram_default()
64{
65   memset( m_unique_pattern, 0, sizeof( m_unique_pattern ) );
66   memset( m_identification, 0, sizeof( m_identification ) );
67   memset( m_security_match, 0, sizeof( m_security_match ) );
68   memset( m_secure_memory, 0, sizeof( m_secure_memory ) );
69
70   int expected_bytes = sizeof( m_unique_pattern ) + sizeof( m_identification ) + sizeof( m_security_match ) + sizeof( m_secure_memory );
71
72   if( !m_region )
73   {
74      logerror( "ds1204(%s) region not found\n", tag() );
75   }
76   else if( m_region->bytes() != expected_bytes )
77   {
78      logerror( "ds1204(%s) region length 0x%x expected 0x%x\n", tag(), m_region->bytes(), expected_bytes );
79   }
80   else
81   {
82      UINT8 *region = m_region->base();
83
84      memcpy( m_unique_pattern, region, sizeof( m_unique_pattern ) ); region += sizeof( m_unique_pattern );
85      memcpy( m_identification, region, sizeof( m_identification ) ); region += sizeof( m_identification );
86      memcpy( m_security_match, region, sizeof( m_security_match ) ); region += sizeof( m_security_match );
87      memcpy( m_secure_memory, region, sizeof( m_secure_memory ) ); region += sizeof( m_secure_memory );
88   }
89}
90
91void ds1204_device::nvram_read( emu_file &file )
92{
93   file.read( m_unique_pattern, sizeof( m_unique_pattern ) );
94   file.read( m_identification, sizeof( m_identification ) );
95   file.read( m_security_match, sizeof( m_security_match ) );
96   file.read( m_secure_memory, sizeof( m_secure_memory ) );
97}
98
99void ds1204_device::nvram_write( emu_file &file )
100{
101   file.write( m_unique_pattern, sizeof( m_unique_pattern ) );
102   file.write( m_identification, sizeof( m_identification ) );
103   file.write( m_security_match, sizeof( m_security_match ) );
104   file.write( m_secure_memory, sizeof( m_secure_memory ) );
105}
106
107void ds1204_device::new_state( int state )
108{
109   m_state = state;
110   m_bit = 0;
111}
112
113void ds1204_device::writebit( UINT8 *buffer )
114{
115   if( m_clk )
116   {
117      int index = m_bit / 8;
118      int mask = 1 << ( m_bit % 8 );
119
120      if( m_dqw )
121      {
122         buffer[ index ] |= mask;
123      }
124      else
125      {
126         buffer[ index ] &= ~mask;
127      }
128
129      m_bit++;
130   }
131}
132
133void ds1204_device::readbit( UINT8 *buffer )
134{
135   if( !m_clk )
136   {
137      int index = m_bit / 8;
138      int mask = 1 << ( m_bit % 8 );
139
140      if( buffer[ index ] & mask )
141      {
142         m_dqr = 1;
143      }
144      else
145      {
146         m_dqr = 0;
147      }
148   }
149   else
150   {
151      m_bit++;
152   }
153}
154
155WRITE_LINE_MEMBER( ds1204_device::write_rst )
156{
157   if( m_rst != state )
158   {
159      m_rst = state;
160      verboselog( 2, "rst=%d\n", m_rst );
161
162      if( m_rst )
163      {
164         new_state( STATE_PROTOCOL );
165      }
166      else
167      {
168         switch( m_state )
169         {
170         case STATE_WRITE_IDENTIFICATION:
171            verboselog( 0, "reset during write identification (bit=%d)\n", m_bit );
172            break;
173         case STATE_WRITE_SECURITY_MATCH:
174            verboselog( 0, "reset during write security match (bit=%d)\n", m_bit );
175            break;
176         case STATE_WRITE_SECURE_MEMORY:
177            verboselog( 0, "reset during write secure memory (bit=%d)\n", m_bit );
178            break;
179         }
180
181         new_state( STATE_STOP );
182         m_dqr = DQ_HIGH_IMPEDANCE;
183      }
184   }
185}
186
187WRITE_LINE_MEMBER( ds1204_device::write_clk )
188{
189   if( m_clk != state )
190   {
191      m_clk = state;
192      verboselog( 2, "clk=%d (bit=%d)\n", m_clk, m_bit );
193
194      if( m_clk )
195      {
196         m_dqr = DQ_HIGH_IMPEDANCE;
197      }
198
199      switch( m_state )
200      {
201      case STATE_PROTOCOL:
202         writebit( m_command );
203
204         if( m_bit == 24 )
205         {
206            verboselog( 1, "-> command %02x %02x %02x (%02x %02x)\n",
207               m_command[ 0 ], m_command[ 1 ], m_command[ 2 ], m_unique_pattern[ 0 ], m_unique_pattern[ 1 ] );
208
209            if( m_command[ 0 ] == COMMAND_READ && m_command[ 1 ] == ( m_unique_pattern[ 0 ] | CYCLE_NORMAL ) && m_command[ 2 ] == m_unique_pattern[ 1 ] )
210            {
211               new_state( STATE_READ_IDENTIFICATION );
212            }
213            else if( m_command[ 0 ] == COMMAND_WRITE && m_command[ 1 ] == ( m_unique_pattern[ 0 ] | CYCLE_NORMAL ) && m_command[ 2 ] == m_unique_pattern[ 1 ] )
214            {
215               new_state( STATE_READ_IDENTIFICATION );
216            }
217            else if( m_command[ 0 ] == COMMAND_WRITE && m_command[ 1 ] == ( m_unique_pattern[ 0 ] | CYCLE_PROGRAM ) && m_command[ 2 ] == m_unique_pattern[ 1 ] )
218            {
219               new_state( STATE_WRITE_IDENTIFICATION );
220            }
221            else
222            {
223               new_state( STATE_STOP );
224            }
225         }
226         break;
227
228      case STATE_READ_IDENTIFICATION:
229         readbit( m_identification );
230
231         if( m_bit == 64 )
232         {
233            verboselog( 1, "<- identification %02x %02x %02x %02x %02x %02x %02x %02x\n",
234               m_identification[ 0 ], m_identification[ 1 ], m_identification[ 2 ], m_identification[ 3 ],
235               m_identification[ 4 ], m_identification[ 5 ], m_identification[ 6 ], m_identification[ 7 ] );
236
237            new_state( STATE_WRITE_COMPARE_REGISTER );
238         }
239         break;
240
241      case STATE_WRITE_COMPARE_REGISTER:
242         writebit( m_compare_register );
243
244         if( m_bit == 64 )
245         {
246            verboselog( 1, "-> compare register %02x %02x %02x %02x %02x %02x %02x %02x (%02x %02x %02x %02x %02x %02x %02x %02x)\n",
247               m_compare_register[ 0 ], m_compare_register[ 1 ], m_compare_register[ 2 ], m_compare_register[ 3 ],
248               m_compare_register[ 4 ], m_compare_register[ 5 ], m_compare_register[ 6 ], m_compare_register[ 7 ],
249               m_security_match[ 0 ], m_security_match[ 1 ], m_security_match[ 2 ], m_security_match[ 3 ],
250               m_security_match[ 4 ], m_security_match[ 5 ], m_security_match[ 6 ], m_security_match[ 7 ] );
251
252            if( memcmp( m_compare_register, m_security_match, sizeof( m_compare_register ) ) == 0 )
253            {
254               if( m_command[ 0 ] == COMMAND_READ )
255               {
256                  new_state( STATE_READ_SECURE_MEMORY );
257               }
258               else
259               {
260                  new_state( STATE_WRITE_SECURE_MEMORY );
261               }
262            }
263            else
264            {
265               verboselog( 0, "compare register does not match\n" );
266               new_state( STATE_OUTPUT_GARBLED_DATA );
267            }
268         }
269         break;
270
271      case STATE_READ_SECURE_MEMORY:
272         readbit( m_secure_memory );
273
274         if( m_bit == 128 )
275         {
276            verboselog( 1, "<- secure memory %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
277               m_secure_memory[ 0 ], m_secure_memory[ 1 ], m_secure_memory[ 2 ], m_secure_memory[ 3 ],
278               m_secure_memory[ 4 ], m_secure_memory[ 5 ], m_secure_memory[ 6 ], m_secure_memory[ 7 ],
279               m_secure_memory[ 8 ], m_secure_memory[ 9 ], m_secure_memory[ 10 ], m_secure_memory[ 11 ],
280               m_secure_memory[ 12 ], m_secure_memory[ 13 ], m_secure_memory[ 14 ], m_secure_memory[ 15 ] );
281
282            new_state( STATE_STOP );
283         }
284         break;
285
286      case STATE_WRITE_SECURE_MEMORY:
287         writebit( m_secure_memory );
288
289         if( m_bit == 128 )
290         {
291            verboselog( 1, "-> secure memory %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
292               m_secure_memory[ 0 ], m_secure_memory[ 1 ], m_secure_memory[ 2 ], m_secure_memory[ 3 ],
293               m_secure_memory[ 4 ], m_secure_memory[ 5 ], m_secure_memory[ 6 ], m_secure_memory[ 7 ],
294               m_secure_memory[ 8 ], m_secure_memory[ 9 ], m_secure_memory[ 10 ], m_secure_memory[ 11 ],
295               m_secure_memory[ 12 ], m_secure_memory[ 13 ], m_secure_memory[ 14 ], m_secure_memory[ 15 ] );
296
297            new_state( STATE_STOP );
298         }
299         break;
300
301      case STATE_WRITE_IDENTIFICATION:
302         writebit( m_identification );
303
304         if( m_bit == 64 )
305         {
306            verboselog( 1, "-> identification %02x %02x %02x %02x %02x %02x %02x %02x\n",
307               m_identification[ 0 ], m_identification[ 1 ], m_identification[ 2 ], m_identification[ 3 ],
308               m_identification[ 4 ], m_identification[ 5 ], m_identification[ 6 ], m_identification[ 7 ] );
309
310            new_state( STATE_WRITE_SECURITY_MATCH );
311         }
312         break;
313
314      case STATE_WRITE_SECURITY_MATCH:
315         writebit( m_security_match );
316
317         if( m_bit == 64 )
318         {
319            verboselog( 1, "<- security match %02x %02x %02x %02x %02x %02x %02x %02x\n",
320               m_security_match[ 0 ], m_security_match[ 1 ], m_security_match[ 2 ], m_security_match[ 3 ],
321               m_security_match[ 4 ], m_security_match[ 5 ], m_security_match[ 6 ], m_security_match[ 7 ] );
322
323            new_state( STATE_STOP );
324         }
325         break;
326
327      case STATE_OUTPUT_GARBLED_DATA:
328         if( !m_clk && m_command[ 0 ] == COMMAND_READ )
329         {
330            m_dqr = machine().rand() & 1;
331            m_bit++;
332         }
333         else if( m_clk && m_command[ 0 ] == COMMAND_WRITE )
334         {
335            m_bit++;
336         }
337
338         if( m_bit == 64 )
339         {
340            new_state( STATE_STOP );
341         }
342         break;
343      }
344   }
345}
346
347WRITE_LINE_MEMBER( ds1204_device::write_dq )
348{
349   if( m_dqw != state )
350   {
351      m_dqw = state;
352
353      verboselog( 2, "dqw=%d\n", m_dqw );
354   }
355}
356
357READ_LINE_MEMBER( ds1204_device::read_dq )
358{
359   if( m_dqr == DQ_HIGH_IMPEDANCE )
360   {
361      verboselog( 2, "dqr=high impedance\n" );
362      return 0;
363   }
364
365   verboselog( 2, "dqr=%d (bit=%d)\n", m_dqr, m_bit );
366   return m_dqr;
367}
Property changes on: trunk/src/emu/machine/ds1204.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/machine/ds1204.h
r0r26521
1// license:MAME
2// copyright-holders:smf
3/*
4 * ds1204.h
5 *
6 * Electronic Key
7 *
8 */
9
10#pragma once
11
12#ifndef __DS1204_H__
13#define __DS1204_H__
14
15#include "emu.h"
16
17#define MCFG_DS1204_ADD( _tag ) \
18   MCFG_DEVICE_ADD( _tag, DS1204, 0 )
19
20class ds1204_device : public device_t,
21   public device_nvram_interface
22{
23public:
24   // construction/destruction
25   ds1204_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
26
27   DECLARE_WRITE_LINE_MEMBER( write_rst );
28   DECLARE_WRITE_LINE_MEMBER( write_clk );
29   DECLARE_WRITE_LINE_MEMBER( write_dq );
30   DECLARE_READ_LINE_MEMBER( read_dq );
31
32protected:
33   // device-level overrides
34   virtual void device_start();
35
36   // device_nvram_interface overrides
37   virtual void nvram_default();
38   virtual void nvram_read( emu_file &file );
39   virtual void nvram_write( emu_file &file );
40
41private:
42   inline void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, const char *s_fmt, ... );
43   void new_state(int state);
44   void writebit(UINT8 *buffer);
45   void readbit(UINT8 *buffer);
46
47   enum state_t
48   {
49      STATE_STOP,
50      STATE_PROTOCOL,
51      STATE_READ_IDENTIFICATION,
52      STATE_WRITE_IDENTIFICATION,
53      STATE_WRITE_COMPARE_REGISTER,
54      STATE_WRITE_SECURITY_MATCH,
55      STATE_READ_SECURE_MEMORY,
56      STATE_WRITE_SECURE_MEMORY,
57      STATE_OUTPUT_GARBLED_DATA
58   };
59
60   enum command_t
61   {
62      COMMAND_READ = 0x62,
63      COMMAND_WRITE = 0x9d
64   };
65
66   enum cycle_t
67   {
68      CYCLE_NORMAL = 1,
69      CYCLE_PROGRAM = 2,
70      CYCLE_MASK = 3
71   };
72
73   static const int DQ_HIGH_IMPEDANCE = -1;
74
75   int m_rst;
76   int m_clk;
77   int m_dqw;
78   int m_dqr;
79   int m_state;
80   int m_bit;
81   UINT8 m_command[3];
82   UINT8 m_compare_register[8];
83   UINT8 m_unique_pattern[2];
84   UINT8 m_identification[8];
85   UINT8 m_security_match[8];
86   UINT8 m_secure_memory[16];
87};
88
89
90// device type definition
91extern const device_type DS1204;
92
93#endif
Property changes on: trunk/src/emu/machine/ds1204.h
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/machine/machine.mak
r26520r26521
383383
384384#-------------------------------------------------
385385#
386#@src/emu/machine/ds1204.h,MACHINES += DS1204
387#-------------------------------------------------
388
389ifneq ($(filter DS1204,$(MACHINES)),)
390MACHINEOBJS += $(MACHINEOBJ)/ds1204.o
391endif
392
393#-------------------------------------------------
394#
386395#@src/emu/machine/ds1302.h,MACHINES += DS1302
387396#-------------------------------------------------
388397

Previous 199869 Revisions Next


© 1997-2024 The MAME Team