Previous 199869 Revisions Next

r31532 Wednesday 6th August, 2014 at 20:39:15 UTC by hap
removed spunchout protection hack
[src/emu/machine]rp5h01.c rp5h01.h
[src/mame/drivers]punchout.c

trunk/src/mame/drivers/punchout.c
r31531r31532
1212TODO:
1313- add useless driver config to choose between pink and white color proms
1414- video raw params - pixel clock is derived from 20.16mhz xtal
15- finish spnchout protection emulation
1615- money bag placement might not be 100% correct in Arm Wrestling
1716
1817
r31531r31532
213212
214213// The RP5C01 features don't seem to be used at all except for very basic protection
215214// e.g. relying on the masking done by the internal registers.
215// The RP5H01 one-time PROM (OTP) is assumed to be unprogrammed.
216216
217217READ8_MEMBER(punchout_state::spunchout_exp_r)
218218{
219219   // d0-d3: D0-D3 from RP5C01
220220   // d4: N/C
221   // d5: /ALARM from RP5C01
221   // d5: _ALARM from RP5C01
222222   // d6: COUNTER OUT from RP5H01
223   // d7: DATA OUT from RP5H01
224
223   // d7: DATA OUT from RP5H01 - always 0?
225224   UINT8 ret = m_rtc->read(space, offset >> 4 & 0xf) & 0xf;
226225   ret |= 0x10;
227226   ret |= m_rtc->alarm_r() ? 0x00 : 0x20;
228   ret |= m_rp5h01->counter_r() ? 0x40 : 0x00;
229   ret |= m_rp5h01->data_r() ? 0x80 : 0x00;
227   ret |= m_rp5h01->counter_r() ? 0x00 : 0x40;
228   ret |= m_rp5h01->data_r() ? 0x00 : 0x80;
230229
231   // FIXME - hack d6/d7 state until we have a dump of RP5H01 and know the connections for spunchout_exp_w
232   /* PC = 0x0313 */
233   /* (ret or 0x10) -> (D7DF),(D7A0) - (D7DF),(D7A0) = 0d0h(ret nc) */
234   ret &= 0x3f;
235   if (space.device().safe_pcbase() == 0x0313)
236   {
237      ret |= 0xc0;
238   }
239
240230   return ret;
241231}
242232
243233WRITE8_MEMBER(punchout_state::spunchout_exp_w)
244234{
245235   // d0-d3: D0-D3 to RP5C01
246   // d4-d7: ? to RP5H01?
247   
248236   m_rtc->write(space, offset >> 4 & 0xf, data & 0xf);
237   
238   // d0: 74LS74 1D + 74LS74 2D
239   // 74LS74 1Q -> RP5H01 DATA CLOCK + TEST
240   // 74LS74 2Q -> RP5H01 RESET
241   // 74LS74 _2Q -> 74LS74 _1 RESET
242   m_rp5h01->clock_w(data & 1);
243   m_rp5h01->test_w(data & 1);
244   m_rp5h01->reset_w(data & 1);
245   m_rp5h01->clock_w(0);
246   m_rp5h01->test_w(0);
247
248   // d4-d7: unused?
249249}
250250
251251static ADDRESS_MAP_START( spnchout_io_map, AS_IO, 8, punchout_state )
r31531r31532
622622
623623MACHINE_RESET_MEMBER(punchout_state, spnchout)
624624{
625   /* reset the security chip */
626   m_rp5h01->enable_w(1);
627   m_rp5h01->enable_w(0);
628   m_rp5h01->reset_w(0);
629   m_rp5h01->reset_w(1);
625   m_rp5h01->enable_w(0); // _CE -> GND
630626}
631627
632628
r31531r31532
821817   ROM_LOAD( "chp1-b.4d",    0x02000, 0x2000, CRC(dd1310ca) SHA1(918d2eda000244b692f1da7ac57d7a0edaef95fb) )
822818
823819   ROM_REGION( 0x04000, "gfx2", ROMREGION_ERASEFF | ROMREGION_INVERT )
824   ROM_LOAD( "chp1-b(__a).4a",    0x00000, 0x2000, CRC(20fb4829) SHA1(9f0ce9379eb31c19bfacdc514ac6a28aa4217cbb) )   /* chars #2 */ /* Revision A */
820   ROM_LOAD( "chp1-b.4a",    0x00000, 0x2000, CRC(20fb4829) SHA1(9f0ce9379eb31c19bfacdc514ac6a28aa4217cbb) )   /* chars #2 */ /* Revision A */
825821   ROM_LOAD( "chp1-b.4b",    0x02000, 0x2000, CRC(edc34594) SHA1(fbb4a8b979d60b183dc23bdbb7425100b9325287) )
826822
827823   ROM_REGION( 0x30000, "gfx3", ROMREGION_ERASEFF )
r31531r31532
11251121
11261122   ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for the VLM5030 data */
11271123   ROM_LOAD( "chs1-c.6p",    0x0000, 0x4000, CRC(ad8b64b8) SHA1(0f1232a10faf71b782f9f6653cca8570243c17e0) )
1128
1129   ROM_REGION( 0x10, "rp5h01", ROMREGION_ERASE00 ) // security prom on daughterboard
1130   ROM_LOAD( "rp5h01.exp", 0x00, 0x10, NO_DUMP )
11311124ROM_END
11321125
11331126ROM_START( spnchouta )
r31531r31532
11461139   ROM_LOAD( "chs1-b.4d",    0x02000, 0x2000, CRC(e3de9d18) SHA1(f55b6f522e127e6239197dd7eb1564e6f275df74) )   /* Revision A */
11471140
11481141   ROM_REGION( 0x04000, "gfx2", ROMREGION_ERASEFF | ROMREGION_INVERT )
1149   ROM_LOAD( "chp1-b(__a).4a",    0x00000, 0x2000, CRC(20fb4829) SHA1(9f0ce9379eb31c19bfacdc514ac6a28aa4217cbb) )   /* chars #2 */ /* Revision A */
1142   ROM_LOAD( "chp1-b.4a",    0x00000, 0x2000, CRC(20fb4829) SHA1(9f0ce9379eb31c19bfacdc514ac6a28aa4217cbb) )   /* chars #2 */ /* Revision A */
11501143   ROM_LOAD( "chp1-b.4b",    0x02000, 0x2000, CRC(edc34594) SHA1(fbb4a8b979d60b183dc23bdbb7425100b9325287) )   /* Revision A */
11511144
11521145   ROM_REGION( 0x30000, "gfx3", ROMREGION_ERASEFF )
r31531r31532
11921185
11931186   ROM_REGION( 0x4000, "vlm", 0 )   /* 16k for the VLM5030 data */
11941187   ROM_LOAD( "chs1-c.6p",    0x0000, 0x4000, CRC(ad8b64b8) SHA1(0f1232a10faf71b782f9f6653cca8570243c17e0) )
1195
1196   ROM_REGION( 0x10, "rp5h01", ROMREGION_ERASE00 ) // security prom on daughterboard
1197   ROM_LOAD( "rp5h01.exp", 0x00, 0x10, NO_DUMP )
11981188ROM_END
11991189
12001190ROM_START( spnchoutj )
r31531r31532
12771267
12781268   ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for the VLM5030 data */
12791269   ROM_LOAD( "chs1c6pa.bin", 0x0000, 0x4000, CRC(d05fb730) SHA1(9f4c4c7e5113739312558eff4d3d3e42d513aa31) )
1280
1281   ROM_REGION( 0x10, "rp5h01", ROMREGION_ERASE00 ) // security prom on daughterboard
1282   ROM_LOAD( "rp5h01.exp", 0x00, 0x10, NO_DUMP )
12831270ROM_END
12841271
12851272ROM_START( armwrest )
trunk/src/emu/machine/rp5h01.c
r31531r31532
77    with a mask of %1010111. For example if the 8 dummy bits are $7c,
88    bits 64 to 127 are read as $7c $7c $00 $00 $7c $7c $00 $00.
99    To simplify this, our emulation expects 'overdumps', 128bits total.
10   
11    TODO:
12    - not sure if the polarity of our PROM dumps (playch10) is correct,
13      same goes for the bit order (note: does not require new dumps)
1014
1115***************************************************************************/
1216
1317#include "emu.h"
1418#include "machine/rp5h01.h"
1519
20// this is the contents of an unprogrammed PROM
21static const UINT8 initial_data[0x10] =
22{
23   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
24   0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00
25};
1626
1727//-------------------------------------------------
1828//  rp5h01_device - constructor
r31531r31532
4151
4252void rp5h01_device::device_start()
4353{
44   assert(region()->bytes() == 0x10);
4554   m_data = *region();
55   if (m_data == NULL)
56      m_data = initial_data;
57   else
58      assert(region()->bytes() == 0x10);
4659
4760   /* register for state saving */
4861   save_item(NAME(m_counter));
r31531r31532
8699
87100WRITE_LINE_MEMBER( rp5h01_device::reset_w )
88101{
89   state = !state;
90
91102   /* if it's not enabled, ignore */
92103   if (!m_enabled)
93104      return;
trunk/src/emu/machine/rp5h01.h
r31531r31532
5757   int m_enabled;        /* chip enable */
5858   int m_old_reset;      /* reset pin state (level-triggered) */
5959   int m_old_clock;      /* clock pin state (level-triggered) */
60   UINT8 *m_data;
60   const UINT8 *m_data;
6161};
6262
6363extern const device_type RP5H01;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team