trunk/src/mame/drivers/punchout.c
| r31531 | r31532 | |
| 12 | 12 | TODO: |
| 13 | 13 | - add useless driver config to choose between pink and white color proms |
| 14 | 14 | - video raw params - pixel clock is derived from 20.16mhz xtal |
| 15 | | - finish spnchout protection emulation |
| 16 | 15 | - money bag placement might not be 100% correct in Arm Wrestling |
| 17 | 16 | |
| 18 | 17 | |
| r31531 | r31532 | |
| 213 | 212 | |
| 214 | 213 | // The RP5C01 features don't seem to be used at all except for very basic protection |
| 215 | 214 | // e.g. relying on the masking done by the internal registers. |
| 215 | // The RP5H01 one-time PROM (OTP) is assumed to be unprogrammed. |
| 216 | 216 | |
| 217 | 217 | READ8_MEMBER(punchout_state::spunchout_exp_r) |
| 218 | 218 | { |
| 219 | 219 | // d0-d3: D0-D3 from RP5C01 |
| 220 | 220 | // d4: N/C |
| 221 | | // d5: /ALARM from RP5C01 |
| 221 | // d5: _ALARM from RP5C01 |
| 222 | 222 | // d6: COUNTER OUT from RP5H01 |
| 223 | | // d7: DATA OUT from RP5H01 |
| 224 | | |
| 223 | // d7: DATA OUT from RP5H01 - always 0? |
| 225 | 224 | UINT8 ret = m_rtc->read(space, offset >> 4 & 0xf) & 0xf; |
| 226 | 225 | ret |= 0x10; |
| 227 | 226 | 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; |
| 230 | 229 | |
| 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 | | |
| 240 | 230 | return ret; |
| 241 | 231 | } |
| 242 | 232 | |
| 243 | 233 | WRITE8_MEMBER(punchout_state::spunchout_exp_w) |
| 244 | 234 | { |
| 245 | 235 | // d0-d3: D0-D3 to RP5C01 |
| 246 | | // d4-d7: ? to RP5H01? |
| 247 | | |
| 248 | 236 | 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? |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | static ADDRESS_MAP_START( spnchout_io_map, AS_IO, 8, punchout_state ) |
| r31531 | r31532 | |
| 622 | 622 | |
| 623 | 623 | MACHINE_RESET_MEMBER(punchout_state, spnchout) |
| 624 | 624 | { |
| 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 |
| 630 | 626 | } |
| 631 | 627 | |
| 632 | 628 | |
| r31531 | r31532 | |
| 821 | 817 | ROM_LOAD( "chp1-b.4d", 0x02000, 0x2000, CRC(dd1310ca) SHA1(918d2eda000244b692f1da7ac57d7a0edaef95fb) ) |
| 822 | 818 | |
| 823 | 819 | 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 */ |
| 825 | 821 | ROM_LOAD( "chp1-b.4b", 0x02000, 0x2000, CRC(edc34594) SHA1(fbb4a8b979d60b183dc23bdbb7425100b9325287) ) |
| 826 | 822 | |
| 827 | 823 | ROM_REGION( 0x30000, "gfx3", ROMREGION_ERASEFF ) |
| r31531 | r31532 | |
| 1125 | 1121 | |
| 1126 | 1122 | ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for the VLM5030 data */ |
| 1127 | 1123 | 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 ) |
| 1131 | 1124 | ROM_END |
| 1132 | 1125 | |
| 1133 | 1126 | ROM_START( spnchouta ) |
| r31531 | r31532 | |
| 1146 | 1139 | ROM_LOAD( "chs1-b.4d", 0x02000, 0x2000, CRC(e3de9d18) SHA1(f55b6f522e127e6239197dd7eb1564e6f275df74) ) /* Revision A */ |
| 1147 | 1140 | |
| 1148 | 1141 | 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 */ |
| 1150 | 1143 | ROM_LOAD( "chp1-b.4b", 0x02000, 0x2000, CRC(edc34594) SHA1(fbb4a8b979d60b183dc23bdbb7425100b9325287) ) /* Revision A */ |
| 1151 | 1144 | |
| 1152 | 1145 | ROM_REGION( 0x30000, "gfx3", ROMREGION_ERASEFF ) |
| r31531 | r31532 | |
| 1192 | 1185 | |
| 1193 | 1186 | ROM_REGION( 0x4000, "vlm", 0 ) /* 16k for the VLM5030 data */ |
| 1194 | 1187 | 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 ) |
| 1198 | 1188 | ROM_END |
| 1199 | 1189 | |
| 1200 | 1190 | ROM_START( spnchoutj ) |
| r31531 | r31532 | |
| 1277 | 1267 | |
| 1278 | 1268 | ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for the VLM5030 data */ |
| 1279 | 1269 | 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 ) |
| 1283 | 1270 | ROM_END |
| 1284 | 1271 | |
| 1285 | 1272 | ROM_START( armwrest ) |
trunk/src/emu/machine/rp5h01.c
| r31531 | r31532 | |
| 7 | 7 | with a mask of %1010111. For example if the 8 dummy bits are $7c, |
| 8 | 8 | bits 64 to 127 are read as $7c $7c $00 $00 $7c $7c $00 $00. |
| 9 | 9 | 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) |
| 10 | 14 | |
| 11 | 15 | ***************************************************************************/ |
| 12 | 16 | |
| 13 | 17 | #include "emu.h" |
| 14 | 18 | #include "machine/rp5h01.h" |
| 15 | 19 | |
| 20 | // this is the contents of an unprogrammed PROM |
| 21 | static 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 | }; |
| 16 | 26 | |
| 17 | 27 | //------------------------------------------------- |
| 18 | 28 | // rp5h01_device - constructor |
| r31531 | r31532 | |
| 41 | 51 | |
| 42 | 52 | void rp5h01_device::device_start() |
| 43 | 53 | { |
| 44 | | assert(region()->bytes() == 0x10); |
| 45 | 54 | m_data = *region(); |
| 55 | if (m_data == NULL) |
| 56 | m_data = initial_data; |
| 57 | else |
| 58 | assert(region()->bytes() == 0x10); |
| 46 | 59 | |
| 47 | 60 | /* register for state saving */ |
| 48 | 61 | save_item(NAME(m_counter)); |
| r31531 | r31532 | |
| 86 | 99 | |
| 87 | 100 | WRITE_LINE_MEMBER( rp5h01_device::reset_w ) |
| 88 | 101 | { |
| 89 | | state = !state; |
| 90 | | |
| 91 | 102 | /* if it's not enabled, ignore */ |
| 92 | 103 | if (!m_enabled) |
| 93 | 104 | return; |