summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <lordkale4@gmail.com>2020-03-20 19:53:46 +0100
committer angelosa <lordkale4@gmail.com>2020-03-20 19:53:46 +0100
commit3abd0bfbe5581fe8ac57cf5fadb28c9ee9b9a837 (patch)
tree8d33699f53c9b534d53151dea0a3b1a3f346ddca
parent514c4eb00104dbb2cb20526cb212afe21be619c0 (diff)
taito_z.cpp: fix enforceja analog inputs (always been broken, promoted to working status), add screen set_raw (pending move to the whole driver)
-rw-r--r--src/mame/drivers/taito_z.cpp43
-rw-r--r--src/mame/includes/taito_z.h5
-rw-r--r--src/mame/layout/enforce.lay72
3 files changed, 112 insertions, 8 deletions
diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp
index f5bb2799d7c..f4bee499a1b 100644
--- a/src/mame/drivers/taito_z.cpp
+++ b/src/mame/drivers/taito_z.cpp
@@ -1282,6 +1282,7 @@ DIP switches are not verified
#include "contcirc.lh"
#include "dblaxle.lh"
+#include "enforce.lh"
void taitoz_state::parse_cpu_control()
@@ -1404,6 +1405,13 @@ CUSTOM_INPUT_MEMBER(taitoz_state::brake_pedal_r)
return retval[m_brake.read_safe(0) & 7];
}
+// enforceja only, 3 bits applied on both pots
+template <int axis> CUSTOM_INPUT_MEMBER(taitoz_state::adstick_r)
+{
+ static const u8 retval[8] = { 0,1,3,2,6,7,5,4 };
+ u8 raw_value = ((axis == 0 ? m_stickx : m_sticky).read_safe(0) >> 5) & 7;
+ return retval[raw_value];
+}
u8 taitoz_state::contcirc_input_bypass_r()
{
@@ -2402,8 +2410,8 @@ static INPUT_PORTS_START( enforce )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) /* Bomb */
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) /* Laser */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Gatling Gun") PORT_PLAYER(1)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Laser") PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2425,6 +2433,19 @@ INPUT_PORTS_END
static INPUT_PORTS_START( enforceja )
PORT_INCLUDE(enforce)
+ PORT_MODIFY("IN0")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitoz_state, adstick_r<0>);
+
+ PORT_MODIFY("IN1")
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitoz_state, adstick_r<1>);
+
+ PORT_MODIFY("IN2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Shifter") PORT_TOGGLE PORT_PLAYER(1)
+ PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
+
PORT_MODIFY("DSWA")
TAITO_COINAGE_JAPAN_OLD_LOC(SW A)
@@ -2432,8 +2453,14 @@ static INPUT_PORTS_START( enforceja )
PORT_DIPNAME( 0x30, 0x30, "3D Effects" ) PORT_DIPLOCATION("SW B:5,6")
PORT_DIPSETTING( 0x30, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
- PORT_DIPSETTING( 0x10, "In Game Only" )
PORT_DIPSETTING( 0x00, "In Game Only" )
+ PORT_DIPSETTING( 0x10, "In Game Only (duplicate)" )
+
+ PORT_START("STICKX")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(20) PORT_KEYDELTA(4) PORT_PLAYER(1)
+
+ PORT_START("STICKY")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(20) PORT_KEYDELTA(4) PORT_PLAYER(1)
INPUT_PORTS_END
static INPUT_PORTS_START( bshark )
@@ -3294,10 +3321,10 @@ void taitoz_state::enforce(machine_config &config)
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_refresh_hz(60);
- screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
- screen.set_size(40*8, 32*8);
- screen.set_visarea(0*8, 40*8-1, 2*8, 31*8-1);
+ // TODO: Apply to the whole driver
+ // 26.860 MHz comes from the video board, assume /4 pixel clock
+ // vertical visible area comes from service mode
+ screen.set_raw(XTAL(26'686'000)/4, 426, 0, 320, 261, 24, 248);
screen.set_screen_update(FUNC(taitoz_state::screen_update_contcirc));
screen.set_palette(m_tc0110pcr);
@@ -5559,7 +5586,7 @@ GAMEL(1988, chasehqu, chasehq, chasehq, chasehq, taitoz_state, empty_init
GAME( 1988, enforce, 0, enforce, enforce, taitoz_state, empty_init, ROT0, "Taito Corporation Japan", "Enforce (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1988, enforcej, enforce, enforce, enforcej, taitoz_state, empty_init, ROT0, "Taito Corporation", "Enforce (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
-GAME( 1988, enforceja, enforce, enforce, enforceja, taitoz_state, empty_init, ROT0, "Taito Corporation", "Enforce (Japan, Analog Controls)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAMEL( 1988, enforceja, enforce, enforce, enforceja, taitoz_state, empty_init, ROT0, "Taito Corporation", "Enforce (Japan, Analog Controls)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE, layout_enforce )
GAME( 1989, bshark, 0, bshark, bshark, taitoz_state, init_bshark, ORIENTATION_FLIP_X, "Taito Corporation Japan", "Battle Shark (World)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1989, bsharku, bshark, bshark, bsharku, taitoz_state, init_bshark, ORIENTATION_FLIP_X, "Taito America Corporation", "Battle Shark (US)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h
index 488192463ff..27c16400ef6 100644
--- a/src/mame/includes/taito_z.h
+++ b/src/mame/includes/taito_z.h
@@ -46,12 +46,15 @@ public:
m_gas(*this, "GAS"),
m_brake(*this, "BRAKE"),
m_steer(*this, "STEER"),
+ m_stickx(*this, "STICKX"),
+ m_sticky(*this, "STICKY"),
m_io_eepromout(*this, "EEPROMOUT"),
m_lamps(*this, "lamp%u", 0U)
{ }
DECLARE_CUSTOM_INPUT_MEMBER(gas_pedal_r);
DECLARE_CUSTOM_INPUT_MEMBER(brake_pedal_r);
+ template <int axis> DECLARE_CUSTOM_INPUT_MEMBER(adstick_r);
void bshark_base(machine_config &config);
void sci(machine_config &config);
@@ -114,6 +117,8 @@ private:
optional_ioport m_gas;
optional_ioport m_brake;
optional_ioport m_steer;
+ optional_ioport m_stickx;
+ optional_ioport m_sticky;
optional_ioport m_io_eepromout;
output_finder<2> m_lamps;
diff --git a/src/mame/layout/enforce.lay b/src/mame/layout/enforce.lay
new file mode 100644
index 00000000000..e904b1691df
--- /dev/null
+++ b/src/mame/layout/enforce.lay
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<!--
+license:CC0
+-->
+<mamelayout version="2">
+ <element name="shifter" defstate="0">
+ <rect>
+ <bounds left="0" right="32" top="0" bottom="64" />
+ <color red="0.85" green="0.4" blue="0.3" />
+ </rect>
+ <rect>
+ <bounds left="2" right="30" top="2" bottom="62" />
+ <color red="0.14" green="0.17" blue="0.2" />
+ </rect>
+ <rect>
+ <bounds left="14" right="18" top="15" bottom="49" />
+ <color red="0.44" green="0.47" blue="0.5" />
+ </rect>
+ <disk>
+ <bounds left="14" right="18" top="13" bottom="17" />
+ <color red="0.44" green="0.47" blue="0.5" />
+ </disk>
+ <disk>
+ <bounds left="14" right="18" top="47" bottom="51" />
+ <color red="0.44" green="0.47" blue="0.5" />
+ </disk>
+ <text string="LOW" state="0">
+ <bounds left="3" right="29" top="2" bottom="12" />
+ <color red="1.0" green="1.0" blue="0.4" />
+ </text>
+ <text string="LOW" state="1">
+ <bounds left="3" right="29" top="2" bottom="12" />
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+
+ <text string="HIGH" state="0">
+ <bounds left="3" right="29" top="52" bottom="62" />
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ <text string="HIGH" state="1">
+ <bounds left="3" right="29" top="52" bottom="62" />
+ <color red="1.0" green="1.0" blue="0.4" />
+ </text>
+ <disk state="0">
+ <bounds left="9" right="23" top="14" bottom="28" />
+ <color red="0.85" green="0.4" blue="0.3" />
+ </disk>
+ <disk state="1">
+ <bounds left="9" right="23" top="36" bottom="50" />
+ <color red="0.85" green="0.4" blue="0.3" />
+ </disk>
+ </element>
+
+ <view name="Shifter-R">
+ <screen index="0">
+ <bounds x="0" y="0" width="640" height="480" />
+ </screen>
+ <bezel element="shifter" inputtag="IN2" inputmask="0x01">
+ <bounds x="606" y="414" width="32" height="64" />
+ <color alpha="0.6" />
+ </bezel>
+ </view>
+ <view name="Shifter-L">
+ <screen index="0">
+ <bounds x="0" y="0" width="640" height="480" />
+ </screen>
+ <bezel element="shifter" inputtag="IN2" inputmask="0x01">
+ <bounds x="2" y="414" width="32" height="64" />
+ <color alpha="0.6" />
+ </bezel>
+ </view>
+</mamelayout>