From 09eda7947e888c5de4eeebb36c4f18d58c29613d Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 1 Jan 2017 20:31:44 +1100 Subject: [PATCH] josvolly improvments: * Identify cabinet type DIP switch * Run the MCUs faster to get it back to same state as with simulation * Remove now-unnecessary MCU simulation (nw) I still don't want to drop the NOT_WORKING flag as the game's clearly still not quite right, but it's as playable as it was previously now, but using original MCU code for CPU comms. The clocks are still guesses, just better guesses. --- src/mame/drivers/gsword.cpp | 34 +++++++++++++++++----------------- src/mame/includes/gsword.h | 14 +++++++------- src/mame/video/gsword.cpp | 14 ++++---------- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp index 3d50ca8a73e..3232cf2eb29 100644 --- a/src/mame/drivers/gsword.cpp +++ b/src/mame/drivers/gsword.cpp @@ -262,8 +262,8 @@ WRITE8_MEMBER(gsword_state::sound_command_w) WRITE8_MEMBER(gsword_state::adpcm_data_w) { - m_msm->data_w(data & 0x0f); // bit 0..3 - m_msm->reset_w(BIT(data, 5)); // bit 5 + m_msm->data_w(data & 0x0f); // bit 0..3 + m_msm->reset_w(BIT(data, 5)); // bit 5 m_msm->vclk_w(BIT(data, 4)); // bit 4 } @@ -692,50 +692,50 @@ static INPUT_PORTS_START( josvolly ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("DSW1") /* DSW1 */ - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW1:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW1:2") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x0c, 0x0c, "982E" ) PORT_DIPLOCATION("DIPSW1:3,4") + PORT_DIPNAME( 0x0c, 0x0c, "982E" ) PORT_DIPLOCATION("DIPSW1:3,4") PORT_DIPSETTING( 0x0c, "0" ) PORT_DIPSETTING( 0x08, "1" ) PORT_DIPSETTING( 0x04, "2" ) PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPNAME( 0x30, 0x30, "982A" ) PORT_DIPLOCATION("DIPSW1:5,6") + PORT_DIPNAME( 0x30, 0x30, "982A" ) PORT_DIPLOCATION("DIPSW1:5,6") PORT_DIPSETTING( 0x00, "60" ) PORT_DIPSETTING( 0x10, "90" ) PORT_DIPSETTING( 0x20, "120" ) PORT_DIPSETTING( 0x30, "150" ) - PORT_DIPNAME( 0x40, 0x40, "TEST_MODE" ) PORT_DIPLOCATION("DIPSW1:7") + PORT_DIPNAME( 0x40, 0x40, "TEST_MODE" ) PORT_DIPLOCATION("DIPSW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW1:8") + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW1:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") /* DSW2 */ - PORT_DIPNAME( 0x01, 0x01, "982C" ) PORT_DIPLOCATION("DIPSW2:8") + PORT_DIPNAME( 0x01, 0x01, "982C" ) PORT_DIPLOCATION("DIPSW2:8") PORT_DIPSETTING( 0x01, "0" ) PORT_DIPSETTING( 0x00, "1" ) - PORT_DIPNAME( 0x02, 0x02, "9831" ) PORT_DIPLOCATION("DIPSW2:7") - PORT_DIPSETTING( 0x02, "0" ) - PORT_DIPSETTING( 0x00, "1" ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DIPSW2:6,5") + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DIPSW2:7") + PORT_DIPSETTING( 0x02, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DIPSW2:6,5") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) - PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DIPSW2:4,3") + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DIPSW2:4,3") PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x40, 0x40, "9827" ) PORT_DIPLOCATION("DIPSW2:2") + PORT_DIPNAME( 0x40, 0x40, "9827" ) PORT_DIPLOCATION("DIPSW2:2") PORT_DIPSETTING( 0x40, "1" ) PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW2:1") + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIPSW2:1") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -868,7 +868,7 @@ static MACHINE_CONFIG_START( josvolly, josvolly_state ) MCFG_DEVICE_ADD("aa_007", I8255, 0) MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) // 1PL - MCFG_I8255_IN_PORTB_CB(IOPORT("IN2")) // 2PL / ACK + MCFG_I8255_IN_PORTB_CB(IOPORT("IN2")) // 2PL / ACK MCFG_I8255_IN_PORTC_CB(IOPORT("IN0")) // START // the second MCU polls the first MCU's outputs, so it needs tight sync diff --git a/src/mame/includes/gsword.h b/src/mame/includes/gsword.h index 1f287d9252a..24204bf4ed5 100644 --- a/src/mame/includes/gsword.h +++ b/src/mame/includes/gsword.h @@ -98,10 +98,10 @@ public: private: required_device m_soundlatch; - required_device m_msm; + required_device m_msm; - bool m_protect_hack; - bool m_nmi_enable; + bool m_protect_hack; + bool m_nmi_enable; }; @@ -136,8 +136,8 @@ public: virtual void machine_reset() override; private: - bool m_cpu2_nmi_enable; - u8 m_mcu1_p1; - u8 m_mcu1_p2; - u8 m_mcu2_p1; + bool m_cpu2_nmi_enable; + u8 m_mcu1_p1; + u8 m_mcu1_p2; + u8 m_mcu2_p1; }; diff --git a/src/mame/video/gsword.cpp b/src/mame/video/gsword.cpp index 357e39c7cd0..46e851c5f4b 100644 --- a/src/mame/video/gsword.cpp +++ b/src/mame/video/gsword.cpp @@ -177,7 +177,7 @@ PALETTE_INIT_MEMBER(gsword_state, gsword) PALETTE_INIT_MEMBER(josvolly_state, josvolly) { - u8 const *color_prom = memregion("proms")->base(); + u8 const *const color_prom = memregion("proms")->base(); // create a lookup table for the palette for (unsigned i = 0; i < 0x100; i++) @@ -188,17 +188,11 @@ PALETTE_INIT_MEMBER(josvolly_state, josvolly) palette.set_indirect_color(i, rgb_t(r, g, b)); - // characters */ + // characters palette.set_pen_indirect(i, i); - } - /* color_prom now points to the beginning of the lookup table */ - color_prom += 0x300; - - /* sprites */ - for (unsigned i = 0; i < 0x100; i++) - { - uint8_t ctabentry = (BITSWAP8(color_prom[i],7,6,5,4,0,1,2,3) & 0x0f) | 0x80; + // sprites + u8 const ctabentry = bitswap(color_prom[i + 0x300], 0, 1, 2, 3) | 0x80; palette.set_pen_indirect(i + 0x100, ctabentry); } }