Merge pull request #1282 from Risugami/master

Added layout for Midway V-Unit games
This commit is contained in:
R. Belmont 2016-08-23 14:48:21 -04:00 committed by GitHub
commit 9ee81bdb18
3 changed files with 177 additions and 16 deletions

View File

@ -34,6 +34,7 @@ Known to exist but not dumped:
#include "machine/ataintf.h"
#include "machine/nvram.h"
#include "includes/midvunit.h"
#include "crusnusa.lh"
#define CPU_CLOCK 50000000
@ -54,6 +55,7 @@ void midvunit_state::machine_start()
save_item(NAME(m_last_port0));
save_item(NAME(m_shifter_state));
save_item(NAME(m_timer_rate));
save_item(NAME(m_output_mode));
}
@ -370,6 +372,44 @@ WRITE32_MEMBER(midvunit_state::offroadc_serial_data_w)
m_midway_serial_pic2->write(space, 0, data >> 16);
}
READ32_MEMBER(midvunit_state::midvunit_output_r)
{
//need 0x8000 to allow reading of the following:
//0x4700, 0x5100, 0x5300, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00 (ascii maybe?)
//will softlock the game if it remains 0x8000 as that is not one of the expected branches
return 0;
}
WRITE32_MEMBER(midvunit_state::midvunit_output_w)
{
int bit;
UINT8 op = (data >> 8) & 0xFF;
UINT8 arg = data & 0xFF;
switch (op) {
case 0xF7: m_output_mode = arg; break;
case 0xFB:
switch (m_output_mode) {
case 0x00: break; //device init? 3C 1C are the only 2 writes at boot.
case 0x04: output().set_value("wheel", (arg&0x80)?(0x7F-(arg&0x7F)):(arg|0x80)); break; //wheel motor delta. left < 128 < right. 128 is no change.
case 0x05: for (bit = 0; bit < 8; bit++) output().set_lamp_value(bit, (arg >> bit) & 0x1); break;
case 0x08: break; //called when motion controller reads a 0x8000 from midvunit_output_r and wants a response.
case 0x09:
if (arg != 0xD)
m_galil_cmd += (char)arg;
else {
osd_printf_error("Galil: %s\n", m_galil_cmd.c_str());
m_galil_cmd.clear();
}
break; //Galil command input. ascii inputs terminated with carriage return.
case 0x0A: break; //write 0 to request response. wants to read 0x8000 after?
case 0x0B: break; //0 written at boot.
case 0x0C: break; //0 written at boot.
}
break;
//receives same data as midvunit_sound_w. unsure what its purpose is, but it is redundant.
//case 0xFD: m_dcs->data_w(arg); break;
}
}
/*************************************
@ -476,7 +516,7 @@ static ADDRESS_MAP_START( midvunit_map, AS_PROGRAM, 32, midvunit_state )
AM_RANGE(0x992000, 0x992000) AM_READ_PORT("992000")
AM_RANGE(0x993000, 0x993000) AM_READWRITE(midvunit_adc_r, midvunit_adc_w)
AM_RANGE(0x994000, 0x994000) AM_WRITE(midvunit_control_w)
AM_RANGE(0x995000, 0x995000) AM_WRITENOP // force feedback?
AM_RANGE(0x995000, 0x995000) AM_READWRITE(midvunit_output_r, midvunit_output_w)
AM_RANGE(0x995020, 0x995020) AM_WRITE(midvunit_cmos_protect_w)
AM_RANGE(0x997000, 0x997000) AM_NOP // communications
AM_RANGE(0x9a0000, 0x9a0000) AM_WRITE(midvunit_sound_w)
@ -1811,23 +1851,23 @@ DRIVER_INIT_MEMBER(midvunit_state,wargods)
*
*************************************/
GAME( 1994, crusnusa, 0, midvunit, crusnusa, midvunit_state, crusnusa, ROT0, "Midway", "Cruis'n USA (rev L4.1)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, crusnusa40, crusnusa, midvunit, crusnusa, midvunit_state, crusnu40, ROT0, "Midway", "Cruis'n USA (rev L4.0)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, crusnusa21, crusnusa, midvunit, crusnusa, midvunit_state, crusnu21, ROT0, "Midway", "Cruis'n USA (rev L2.1)", MACHINE_SUPPORTS_SAVE )
GAMEL( 1994, crusnusa, 0, midvunit, crusnusa, midvunit_state, crusnusa, ROT0, "Midway", "Cruis'n USA (rev L4.1)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1994, crusnusa40, crusnusa, midvunit, crusnusa, midvunit_state, crusnu40, ROT0, "Midway", "Cruis'n USA (rev L4.0)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1994, crusnusa21, crusnusa, midvunit, crusnusa, midvunit_state, crusnu21, ROT0, "Midway", "Cruis'n USA (rev L2.1)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAME( 1996, crusnwld, 0, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.5)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, crusnwld24, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.4)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, crusnwld23, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.3)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, crusnwld20, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.0)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, crusnwld19, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.9)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, crusnwld17, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.7)", MACHINE_SUPPORTS_SAVE )
GAME( 1996, crusnwld13, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.3)", MACHINE_SUPPORTS_SAVE )
GAMEL( 1996, crusnwld, 0, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.5)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1996, crusnwld24, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.4)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1996, crusnwld23, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.3)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1996, crusnwld20, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.0)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1996, crusnwld19, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.9)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1996, crusnwld17, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.7)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1996, crusnwld13, crusnwld, crusnwld, crusnwld, midvunit_state, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.3)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAME( 1997, offroadc, 0, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.63)", MACHINE_SUPPORTS_SAVE )
GAME( 1997, offroadc5, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.50)", MACHINE_SUPPORTS_SAVE )
GAME( 1997, offroadc4, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.40)", MACHINE_SUPPORTS_SAVE )
GAME( 1997, offroadc3, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.30)", MACHINE_SUPPORTS_SAVE )
GAME( 1997, offroadc1, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.10)", MACHINE_SUPPORTS_SAVE )
GAMEL( 1997, offroadc, 0, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.63)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1997, offroadc5, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.50)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1997, offroadc4, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.40)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1997, offroadc3, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.30)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAMEL( 1997, offroadc1, offroadc, offroadc, offroadc, midvunit_state, offroadc, ROT0, "Midway", "Off Road Challenge (v1.10)", MACHINE_SUPPORTS_SAVE, layout_crusnusa )
GAME( 1995, wargods, 0, midvplus, wargods, midvunit_state, wargods, ROT0, "Midway", "War Gods (HD 10/09/1996 - Dual Resolution)", MACHINE_SUPPORTS_SAVE )
GAME( 1995, wargodsa, wargods, midvplus, wargodsa, midvunit_state, wargods, ROT0, "Midway", "War Gods (HD 08/15/1996)", MACHINE_SUPPORTS_SAVE )

View File

@ -96,6 +96,8 @@ public:
UINT8 m_video_changed;
emu_timer *m_scanline_timer;
std::unique_ptr<midvunit_renderer> m_poly;
UINT8 m_output_mode;
std::string m_galil_cmd;
DECLARE_WRITE32_MEMBER(midvunit_dma_queue_w);
DECLARE_READ32_MEMBER(midvunit_dma_queue_entries_r);
DECLARE_READ32_MEMBER(midvunit_dma_trigger_r);
@ -131,6 +133,8 @@ public:
DECLARE_WRITE32_MEMBER(midvplus_misc_w);
DECLARE_WRITE8_MEMBER(midvplus_xf1_w);
DECLARE_READ32_MEMBER(generic_speedup_r);
DECLARE_READ32_MEMBER(midvunit_output_r);
DECLARE_WRITE32_MEMBER(midvunit_output_w);
DECLARE_DRIVER_INIT(crusnu40);
DECLARE_DRIVER_INIT(crusnu21);
DECLARE_DRIVER_INIT(crusnwld);

View File

@ -0,0 +1,117 @@
<?xml version="1.0"?>
<mamelayout version="2">
<element name="lamp" defstate="0">
<rect state="0">
<color red="0.1" green="0.1" blue="0.0" />
<bounds x="0.0" y="0.0" width="1.0" height="1.0" />
</rect>
<rect state="1">
<color red="1.0" green="1.0" blue="0.0" />
<bounds x="0.0" y="0.0" width="1.0" height="1.0" />
</rect>
</element>
<element name="start" defstate="0">
<disk state="0">
<bounds x="0" y="0" width="2.0" height="2.0" />
<color red="0.0" green="0.1" blue="0.061" />
</disk>
<disk state="1">
<bounds x="0" y="0" width="2.0" height="2.0" />
<color red="0.0" green="1.0" blue="0.61" />
</disk>
<text string="START">
<color red="0.0" green="0.0" blue="0.0" />
<bounds x="0.25" y="0.5" width="1.5" height="1.0" />
</text>
</element>
<element name="view1" defstate="0">
<rect state="0">
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
<color red="0.1" green="0.024" blue="0.027" />
</rect>
<rect state="1">
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
<color red="1.0" green="0.24" blue="0.27" />
</rect>
<text string="VIEW 1">
<color red="0.0" green="0.0" blue="0.0" />
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
</text>
</element>
<element name="view2" defstate="0">
<rect state="0">
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
<color red="0.087" green="0.089" blue="0.1" />
</rect>
<rect state="1">
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
<color red="0.87" green="0.89" blue="1.0" />
</rect>
<text string="VIEW 2">
<color red="0.0" green="0.0" blue="0.0" />
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
</text>
</element>
<element name="view3" defstate="0">
<rect state="0">
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
<color red="0.023" green="0.072" blue="0.1" />
</rect>
<rect state="1">
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
<color red="0.23" green="0.72" blue="1.0" />
</rect>
<text string="VIEW 3">
<color red="0.0" green="0.0" blue="0.0" />
<bounds x="0.0" y="0.0" width="5.0" height="1.0" />
</text>
</element>
<element name="counter" defstate="0">
<simplecounter digits="3">
<color red="1.0" green="1.0" blue="1.0" />
</simplecounter>
</element>
<view name="Simple LEDs">
<bounds left="0" top="0" right="4" bottom="3.472" />
<screen index="0">
<bounds left="0" top="0" right="4" bottom="3" />
</screen>
<bezel name="lamp0" element="start">
<bounds x="3.60" y="3.1" width="0.3" height="0.3" />
</bezel>
<bezel name="lamp1" element="view1">
<bounds x="0.1" y="3.075" width="0.5" height="0.1" />
</bezel>
<bezel name="lamp2" element="view2">
<bounds x="0.1" y="3.2" width="0.5" height="0.1" />
</bezel>
<bezel name="lamp3" element="view3">
<bounds x="0.1" y="3.325" width="0.5" height="0.1" />
</bezel>
<bezel name="lamp4" element="lamp">
<bounds x="1.785" y="3.2" width="0.1" height="0.1" />
</bezel>
<bezel name="lamp5" element="lamp">
<bounds x="1.895" y="3.2" width="0.1" height="0.1" />
</bezel>
<bezel name="lamp6" element="lamp">
<bounds x="2.005" y="3.2" width="0.1" height="0.1" />
</bezel>
<bezel name="lamp7" element="lamp">
<bounds x="2.115" y="3.2" width="0.1" height="0.1" />
</bezel>
<bezel name="wheel" element="counter">
<bounds x="1.9" y="3.0" width="0.2" height="0.1" />
</bezel>
</view>
</mamelayout>