From 68b66ab09112028e4a5cd97d82008427fe4bc767 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 12 Apr 2021 12:08:47 +0200 Subject: taito_z: add electronic shutters for contcirc 3d scope --- src/mame/drivers/mephisto_smondial.cpp | 2 +- src/mame/drivers/taito_z.cpp | 15 +++++++++++++ src/mame/includes/taito_z.h | 9 ++++++-- src/mame/layout/contcirc.lay | 39 ++++++++++++++++++++++++++++++++++ src/mame/video/taito_z.cpp | 28 +++++++++++++++++++++--- 5 files changed, 87 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/mephisto_smondial.cpp b/src/mame/drivers/mephisto_smondial.cpp index a1f119ba28e..be0859edccb 100644 --- a/src/mame/drivers/mephisto_smondial.cpp +++ b/src/mame/drivers/mephisto_smondial.cpp @@ -9,7 +9,7 @@ Mephisto Mega IV Hardware notes: - G65SC02P-4 @ 4MHz -- 8KB RAMbattery-backed), 32KB ROM +- 8KB RAM(battery-backed), 32KB ROM - expansion slot at underside (only used for smondial2) - 2*PCF2112, 2 7seg LCD screens - 8*8 chessboard buttons, 24 tri-color leds, piezo diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp index f952c638a2d..ab8092c6b7f 100644 --- a/src/mame/drivers/taito_z.cpp +++ b/src/mame/drivers/taito_z.cpp @@ -3149,8 +3149,21 @@ void taitoz_state::machine_start() MACHINE_START_MEMBER(taitoz_state,chasehq) { + machine_start(); + m_lamps.resolve(); +} + +MACHINE_START_MEMBER(taitoz_state,contcirc) +{ machine_start(); + + m_shutter_out.resolve(); + m_shutter_toggle = 0; + m_shutter_control = 0; + + save_item(NAME(m_shutter_toggle)); + save_item(NAME(m_shutter_control)); } void taitoz_state::machine_reset() @@ -3193,9 +3206,11 @@ void taitoz_state::contcirc(machine_config &config) screen_config(config, 24, 248); m_screen->set_screen_update(FUNC(taitoz_state::screen_update_contcirc)); m_screen->set_palette(m_tc0110pcr); + m_screen->screen_vblank().set(FUNC(taitoz_state::contcirc_vblank)); GFXDECODE(config, m_gfxdecode, m_tc0110pcr, gfx_taitoz); + MCFG_MACHINE_START_OVERRIDE(taitoz_state,contcirc) MCFG_VIDEO_START_OVERRIDE(taitoz_state,taitoz) TC0100SCN(config, m_tc0100scn, 0); diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h index 597b9d64de1..b9fafb0f6eb 100644 --- a/src/mame/includes/taito_z.h +++ b/src/mame/includes/taito_z.h @@ -2,7 +2,6 @@ // copyright-holders:David Graves /************************************************************************* - Taito Z system *************************************************************************/ @@ -51,7 +50,8 @@ public: m_stickx(*this, "STICKX"), m_sticky(*this, "STICKY"), m_io_eepromout(*this, "EEPROMOUT"), - m_lamps(*this, "lamp%u", 0U) + m_lamps(*this, "lamp%u", 0U), + m_shutter_out(*this, "shutter%u", 0U) { } DECLARE_CUSTOM_INPUT_MEMBER(gas_pedal_r); @@ -101,6 +101,8 @@ private: s32 m_sci_int6; s32 m_ioc220_port; u8 m_eep_latch; + int m_shutter_toggle; + u8 m_shutter_control; /* devices */ required_device m_maincpu; @@ -125,6 +127,7 @@ private: optional_ioport m_sticky; optional_ioport m_io_eepromout; output_finder<2> m_lamps; + output_finder<2> m_shutter_out; void cpua_ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0); void chasehq_cpua_ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0); @@ -145,8 +148,10 @@ private: u16 sci_spriteframe_r(); void sci_spriteframe_w(u16 data); void contcirc_out_w(u8 data); + DECLARE_WRITE_LINE_MEMBER(contcirc_vblank); DECLARE_VIDEO_START(taitoz); DECLARE_MACHINE_START(chasehq); + DECLARE_MACHINE_START(contcirc); u32 screen_update_contcirc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_chasehq(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_bshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/layout/contcirc.lay b/src/mame/layout/contcirc.lay index 0b3526f73c8..51f851fdd29 100644 --- a/src/mame/layout/contcirc.lay +++ b/src/mame/layout/contcirc.lay @@ -3,6 +3,13 @@ license:CC0 --> + + + + + + + @@ -51,6 +58,9 @@ license:CC0 + + + @@ -85,4 +95,33 @@ license:CC0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/video/taito_z.cpp b/src/mame/video/taito_z.cpp index f228c6c1017..90ae3592005 100644 --- a/src/mame/video/taito_z.cpp +++ b/src/mame/video/taito_z.cpp @@ -19,7 +19,6 @@ VIDEO_START_MEMBER(taitoz_state,taitoz) SPRITE READ AND WRITE HANDLERS ********************************************************/ - u16 taitoz_state::sci_spriteframe_r() { return (m_sci_spriteframe << 8); @@ -780,14 +779,37 @@ void taitoz_state::contcirc_out_w(u8 data) /* bits 1-3 n.c. */ - /* 3d glasses control */ + /* 3d scope control */ /* bit 4 = SCPSW */ - /* bit 5 = SCP */ + /* bit 5 = _SCP */ + if (~m_shutter_control & 2 && data & 0x20) + m_shutter_toggle = 0; + m_shutter_control = data >> 4 & 3; /* bits 6 and 7 select the road palette bank */ m_road_palbank = (data & 0xc0) >> 6; } +WRITE_LINE_MEMBER(taitoz_state::contcirc_vblank) +{ + if (state) + { + // it outputs 3d scope shutters at vblank + if (m_shutter_control & 1) + { + m_shutter_out[0] = m_shutter_toggle; + m_shutter_out[1] = m_shutter_toggle ^ 1; + } + else + { + m_shutter_out[0] = 0; + m_shutter_out[1] = 0; + } + + if (m_shutter_control & 2) + m_shutter_toggle ^= 1; + } +} u32 taitoz_state::screen_update_contcirc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { -- cgit v1.2.3