diff options
Diffstat (limited to 'src/mame/drivers/model1.cpp')
-rw-r--r-- | src/mame/drivers/model1.cpp | 283 |
1 files changed, 189 insertions, 94 deletions
diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index dd0a02a5c04..293a1c2a714 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -585,16 +585,24 @@ Notes: #include "cpu/i386/i386.h" #include "machine/clock.h" -#include "machine/mb8421.h" #include "machine/model1io.h" +#include "machine/model1io2.h" #include "speaker.h" #include "vr.lh" +#include "model1io2.lh" // On the real system, another 315-5338A is acting as slave // and writes the data to the dual port RAM. This isn't // emulated yet, data just gets written to RAM. +READ8_MEMBER( model1_state::dpram_r ) +{ + // insert waitstate + m_maincpu->adjust_icount(-1); + return m_dpram->right_r(space, offset); +} + WRITE8_MEMBER( model1_state::vf_outputs_w ) { // 7654---- unknown (not used?) @@ -677,6 +685,63 @@ WRITE8_MEMBER( model1_state::netmerc_outputs_w ) machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); } +READ8_MEMBER( model1_state::r360_r ) +{ + return m_r360_state; +} + +WRITE8_MEMBER( model1_state::r360_w ) +{ + /* + this uses the feedback board protocol + command group B - these seem to be gamestates + + bf = init + be = attract + bd = setup #1 (lower safety bar etc.) + bc = setup #2 (push emergency button) + bb = ready to go + ba = ingame + b9 = game over + + results: + 40 = default status + 41 = * (setup #1 ack) + 42 = lowered safety bar + 43 = closed belt + 44 = lever up + 45 = pushed button + 46 = game start + 47 = game over + 48 = lever down + 49 = released belt + */ + switch (data & 0xff) + { + case 0xbf: + case 0xbe: + m_r360_state = ~0x40; + break; + + case 0xbd: + m_r360_state = ~0x44; + break; + + case 0xbc: + m_r360_state = ~0x45; + break; + + case 0xbb: + m_r360_state = ~0x46; + break; + + case 0xba: + case 0xb9: + m_r360_state = ~0x40; + break; + } +} + READ16_MEMBER(model1_state::fifoin_status_r) { return 0xffff; @@ -871,7 +936,7 @@ void model1_state::model1_mem(address_map &map) map(0x900000, 0x903fff).ram().w(this, FUNC(model1_state::p_w)).share("palette"); map(0x910000, 0x91bfff).ram().share("color_xlat"); - map(0xc00000, 0xc00fff).rw("dpram", FUNC(mb8421_device::right_r), FUNC(mb8421_device::right_w)).umask16(0x00ff); // 2k*8-bit dual port ram + map(0xc00000, 0xc00fff).r(this, FUNC(model1_state::dpram_r)).w(m_dpram, FUNC(mb8421_device::right_w)).umask16(0x00ff); // 2k*8-bit dual port ram map(0xc40000, 0xc40000).rw(m_m1uart, FUNC(i8251_device::data_r), FUNC(i8251_device::data_w)); map(0xc40002, 0xc40002).rw(m_m1uart, FUNC(i8251_device::status_r), FUNC(i8251_device::control_w)); @@ -1028,17 +1093,44 @@ static INPUT_PORTS_START( wingwar ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Smoke") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("IN.2") /* 8Bit RX-line from r360 board */ - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("STICKX") PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE PORT_START("STICKY") - PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE + PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_START("THROTTLE") PORT_BIT( 0xff, 0x01, IPT_PEDAL ) PORT_MINMAX(1,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) + + PORT_START("ioboard:dsw1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW1:8") + + PORT_START("ioboard:dsw2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW2:8") + + PORT_START("ioboard:dsw3") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW3:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW3:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW3:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW3:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW3:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW3:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW3:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW3:8") INPUT_PORTS_END static INPUT_PORTS_START( wingwar360 ) @@ -1050,6 +1142,12 @@ static INPUT_PORTS_START( wingwar360 ) PORT_MODIFY("IN.1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("STICKX") + PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) + + PORT_MODIFY("STICKY") + PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE INPUT_PORTS_END static INPUT_PORTS_START( netmerc ) @@ -1066,14 +1164,41 @@ static INPUT_PORTS_START( netmerc ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("MVD Holder") PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("IN.2") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("STICKX") PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE PORT_START("STICKY") PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE + + PORT_START("ioboard:dsw1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW1:8") + + PORT_START("ioboard:dsw2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW2:8") + + PORT_START("ioboard:dsw3") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW3:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW3:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW3:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW3:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW3:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW3:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW3:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW3:8") INPUT_PORTS_END @@ -1352,6 +1477,9 @@ ROM_START( wingwar ) ROM_LOAD32_BYTE( "mpr-16742.40", 0x000001, 0x80000, CRC(e9cc12bb) SHA1(40c83c968be3b11fad193a00e7b760f074450683) ) ROM_LOAD32_BYTE( "mpr-16739.41", 0x000002, 0x80000, CRC(6c73e98f) SHA1(7b31e62922ab6d0df97c3ecc52b78e6d086c8635) ) ROM_LOAD32_BYTE( "mpr-16740.42", 0x000003, 0x80000, CRC(44b31007) SHA1(4bb265fea25a7bbcbb8ab080fdcf09849b18f1de) ) + + ROM_REGION( 0x10000, "ioboard:iocpu", 0 ) // taken from r360 version, is it the same? + ROM_LOAD("epr-16891.6", 0x00000, 0x10000, CRC(a33f84d1) SHA1(3079397c7241c1a6f494fa310faff0989dfa04a0) ) ROM_END ROM_START( wingwaru ) @@ -1404,6 +1532,9 @@ ROM_START( wingwaru ) ROM_LOAD32_BYTE( "mpr-16742.40", 0x000001, 0x80000, CRC(e9cc12bb) SHA1(40c83c968be3b11fad193a00e7b760f074450683) ) ROM_LOAD32_BYTE( "mpr-16739.41", 0x000002, 0x80000, CRC(6c73e98f) SHA1(7b31e62922ab6d0df97c3ecc52b78e6d086c8635) ) ROM_LOAD32_BYTE( "mpr-16740.42", 0x000003, 0x80000, CRC(44b31007) SHA1(4bb265fea25a7bbcbb8ab080fdcf09849b18f1de) ) + + ROM_REGION( 0x10000, "ioboard:iocpu", 0 ) // taken from r360 version, is it the same? + ROM_LOAD("epr-16891.6", 0x00000, 0x10000, CRC(a33f84d1) SHA1(3079397c7241c1a6f494fa310faff0989dfa04a0) ) ROM_END ROM_START( wingwarj ) @@ -1456,6 +1587,9 @@ ROM_START( wingwarj ) ROM_LOAD32_BYTE( "mpr-16742.40", 0x000001, 0x80000, CRC(e9cc12bb) SHA1(40c83c968be3b11fad193a00e7b760f074450683) ) ROM_LOAD32_BYTE( "mpr-16739.41", 0x000002, 0x80000, CRC(6c73e98f) SHA1(7b31e62922ab6d0df97c3ecc52b78e6d086c8635) ) ROM_LOAD32_BYTE( "mpr-16740.42", 0x000003, 0x80000, CRC(44b31007) SHA1(4bb265fea25a7bbcbb8ab080fdcf09849b18f1de) ) + + ROM_REGION( 0x10000, "ioboard:iocpu", 0 ) // taken from r360 version, is it the same? + ROM_LOAD("epr-16891.6", 0x00000, 0x10000, CRC(a33f84d1) SHA1(3079397c7241c1a6f494fa310faff0989dfa04a0) ) ROM_END // Dumper's note: As per other R360 games wingwar is just a slightly modified version with 4 roms different on the rom board. @@ -1511,7 +1645,7 @@ ROM_START( wingwar360 ) ROM_LOAD32_BYTE( "mpr-16739.41", 0x000002, 0x80000, CRC(6c73e98f) SHA1(7b31e62922ab6d0df97c3ecc52b78e6d086c8635) ) ROM_LOAD32_BYTE( "mpr-16740.42", 0x000003, 0x80000, CRC(44b31007) SHA1(4bb265fea25a7bbcbb8ab080fdcf09849b18f1de) ) - ROM_REGION( 0x10000, "ioboard", 0 ) + ROM_REGION( 0x10000, "ioboard:iocpu", 0 ) ROM_LOAD("epr-16891.6", 0x00000, 0x10000, CRC(a33f84d1) SHA1(3079397c7241c1a6f494fa310faff0989dfa04a0) ) // Dumper's note: Video & Drive is the control board in the attendants' tower, same hardware as G-Loc R360 with the two program roms being the only difference. @@ -1558,7 +1692,7 @@ ROM_START( netmerc ) ROM_REGION32_LE( 0x200000, "tgp_data", ROMREGION_ERASE00 ) // IC39-IC42 unpopulated - ROM_REGION( 0x10000, "ioboard", 0 ) /* IO board */ + ROM_REGION( 0x10000, "ioboard:iocpu", 0 ) ROM_LOAD( "epr-18021.ic6", 0x00000, 0x10000, CRC(5551837e) SHA1(bf5b9aad99c0f8f5e262e0855796f39119d11a97) ) ROM_REGION( 0x8000, "polhemus", 0 ) /* POLHEMUS board */ @@ -1690,11 +1824,19 @@ MACHINE_CONFIG_START(model1_state::wingwar) MCFG_DEVICE_MODIFY("maincpu") MCFG_DEVICE_PROGRAM_MAP(model1_comm_mem) - MCFG_DEVICE_MODIFY("ioboard") - MCFG_MODEL1IO_AN0_CB(IOPORT("STICKX")) - MCFG_MODEL1IO_AN1_CB(IOPORT("STICKY")) - MCFG_MODEL1IO_AN2_CB(IOPORT("THROTTLE")) - MCFG_MODEL1IO_OUTPUT_CB(WRITE8(*this, model1_state, wingwar_outputs_w)) + MCFG_DEVICE_REMOVE("ioboard") + + MCFG_DEVICE_ADD("ioboard", SEGA_MODEL1IO2, 0) + MCFG_MODEL1IO2_READ_CB(READ8("dpram", mb8421_device, left_r)) + MCFG_MODEL1IO2_WRITE_CB(WRITE8("dpram", mb8421_device, left_w)) + MCFG_MODEL1IO2_IN0_CB(IOPORT("IN.0")) + MCFG_MODEL1IO2_IN1_CB(IOPORT("IN.1")) + MCFG_MODEL1IO2_AN0_CB(IOPORT("STICKX")) + MCFG_MODEL1IO2_AN1_CB(IOPORT("STICKY")) + MCFG_MODEL1IO2_AN2_CB(IOPORT("THROTTLE")) + MCFG_MODEL1IO2_OUTPUT_CB(WRITE8(*this, model1_state, wingwar_outputs_w)) + + MCFG_DEFAULT_LAYOUT(layout_model1io2) MCFG_M1COMM_ADD(M1COMM_TAG) MCFG_DEVICE_BIOS("epr15112"); @@ -1704,7 +1846,12 @@ MACHINE_CONFIG_START(model1_state::wingwar360) wingwar(config); MCFG_DEVICE_MODIFY("ioboard") - MCFG_MODEL1IO_OUTPUT_CB(WRITE8(*this, model1_state, wingwar360_outputs_w)) + MCFG_MODEL1IO2_IN2_CB(READ8(*this, model1_state, r360_r)) + MCFG_MODEL1IO2_DRIVE_WRITE_CB(WRITE8(*this, model1_state, r360_w)) + MCFG_MODEL1IO2_AN2_CB(NOOP) + MCFG_MODEL1IO2_OUTPUT_CB(WRITE8(*this, model1_state, wingwar360_outputs_w)) + + MCFG_DEFAULT_LAYOUT(layout_model1io2) MACHINE_CONFIG_END void model1_state::polhemus_map(address_map &map) @@ -1719,83 +1866,31 @@ MACHINE_CONFIG_START(model1_state::netmerc) MCFG_DEVICE_ADD("polhemus", I386SX, 16000000) MCFG_DEVICE_PROGRAM_MAP(polhemus_map) - MCFG_DEVICE_MODIFY("ioboard") - MCFG_MODEL1IO_AN0_CB(IOPORT("STICKX")) - MCFG_MODEL1IO_AN2_CB(IOPORT("STICKY")) - MCFG_MODEL1IO_OUTPUT_CB(WRITE8(*this, model1_state, netmerc_outputs_w)) + MCFG_DEVICE_REMOVE("ioboard") + + MCFG_DEVICE_ADD("ioboard", SEGA_MODEL1IO2, 0) + MCFG_MODEL1IO2_READ_CB(READ8("dpram", mb8421_device, left_r)) + MCFG_MODEL1IO2_WRITE_CB(WRITE8("dpram", mb8421_device, left_w)) + MCFG_MODEL1IO2_IN0_CB(IOPORT("IN.0")) + MCFG_MODEL1IO2_IN1_CB(IOPORT("IN.1")) + MCFG_MODEL1IO2_AN0_CB(IOPORT("STICKX")) + MCFG_MODEL1IO2_AN2_CB(IOPORT("STICKY")) + MCFG_MODEL1IO2_OUTPUT_CB(WRITE8(*this, model1_state, netmerc_outputs_w)) + MCFG_DEFAULT_LAYOUT(layout_model1io2) MACHINE_CONFIG_END -void model1_state::init_wingwar360() -{ - // install r360 hack - m_maincpu->space(AS_PROGRAM).install_read_handler(0xc00014, 0xc00015, read16_delegate(FUNC(model1_state::r360_r),this)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0xc00022, 0xc00023, write16_delegate(FUNC(model1_state::r360_w),this)); -} - -READ16_MEMBER(model1_state::r360_r) -{ - return m_r360_state; -} - -WRITE16_MEMBER(model1_state::r360_w) -{ - /* - this uses the feedback board protocol - command group B - these seem to be gamestates - - bf = init - be = attract - bd = setup #1 (lower safety bar etc.) - bc = setup #2 (push emergency button) - bb = ready to go - ba = ingame - b9 = game over - - results: - 40 = default status - 41 = * (setup #1 ack) - 42 = lowered safety bar - 43 = closed belt - 44 = lever up - 45 = pushed button - 46 = game start - 47 = game over - 48 = lever down - 49 = released belt - */ - switch (data & 0xff) - { - case 0xbf: - case 0xbe: - m_r360_state = ~0x40; - break; - - case 0xbd: - m_r360_state = ~0x44; - break; - - case 0xbc: - m_r360_state = ~0x45; - break; - - case 0xbb: - m_r360_state = ~0x46; - break; - - case 0xba: - case 0xb9: - m_r360_state = ~0x40; - break; - } -} - -GAME( 1993, vf, 0, vf, vf, model1_state, empty_init, ROT0, "Sega", "Virtua Fighter", MACHINE_IMPERFECT_GRAPHICS ) -GAMEL(1992, vr, 0, vr, vr, model1_state, empty_init, ROT0, "Sega", "Virtua Racing", 0, layout_vr ) -GAME( 1993, vformula, vr, vformula, vr, model1_state, empty_init, ROT0, "Sega", "Virtua Formula", MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1993, swa, 0, swa, swa, model1_state, empty_init, ROT0, "Sega", "Star Wars Arcade", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) -GAME( 1994, wingwar, 0, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (World)", MACHINE_NOT_WORKING ) -GAME( 1994, wingwaru, wingwar, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (US)", MACHINE_NOT_WORKING ) -GAME( 1994, wingwarj, wingwar, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (Japan)", MACHINE_NOT_WORKING ) -GAME( 1994, wingwar360, wingwar, wingwar360, wingwar360, model1_state, init_wingwar360, ROT0, "Sega", "Wing War R360 (US)", MACHINE_NOT_WORKING ) -GAME( 1993, netmerc, 0, netmerc, netmerc, model1_state, empty_init, ROT0, "Sega", "Sega NetMerc", MACHINE_NOT_WORKING ) +//************************************************************************** +// SYSTEM DRIVERS +//************************************************************************** + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROTATION COMPANY FULLNAME FLAGS +GAME( 1993, vf, 0, vf, vf, model1_state, empty_init, ROT0, "Sega", "Virtua Fighter", MACHINE_IMPERFECT_GRAPHICS ) +GAMEL(1992, vr, 0, vr, vr, model1_state, empty_init, ROT0, "Sega", "Virtua Racing", 0, layout_vr ) +GAME( 1993, vformula, vr, vformula, vr, model1_state, empty_init, ROT0, "Sega", "Virtua Formula", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1993, swa, 0, swa, swa, model1_state, empty_init, ROT0, "Sega", "Star Wars Arcade", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) +GAME( 1994, wingwar, 0, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (World)", MACHINE_NOT_WORKING ) +GAME( 1994, wingwaru, wingwar, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (US)", MACHINE_NOT_WORKING ) +GAME( 1994, wingwarj, wingwar, wingwar, wingwar, model1_state, empty_init, ROT0, "Sega", "Wing War (Japan)", MACHINE_NOT_WORKING ) +GAME( 1994, wingwar360, wingwar, wingwar360, wingwar360, model1_state, empty_init, ROT0, "Sega", "Wing War R360 (US)", MACHINE_NOT_WORKING ) +GAME( 1993, netmerc, 0, netmerc, netmerc, model1_state, empty_init, ROT0, "Sega", "Sega NetMerc", MACHINE_NOT_WORKING ) |