From ffc49cad9aa52efba7aa16920a2c7a00f22ac37a Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 29 Aug 2024 18:57:12 +0200 Subject: [PATCH] excellent/lastbank.cpp: hookup inputs and dips for fever13 --- src/mame/excellent/d9final.cpp | 5 +- src/mame/excellent/lastbank.cpp | 274 +++++++++++++++++++++++++------- 2 files changed, 218 insertions(+), 61 deletions(-) diff --git a/src/mame/excellent/d9final.cpp b/src/mame/excellent/d9final.cpp index 68e7135c600..3fd07894611 100644 --- a/src/mame/excellent/d9final.cpp +++ b/src/mame/excellent/d9final.cpp @@ -6,9 +6,8 @@ Dream 9 Final (c) 1992 Excellent Systems TODO: - What does the ES8712 control? There's definitely no ADPCM chip or sample ROM here; -- Some inputs not understood; -- A bunch of missing port outputs (including payout); -- screen disable? Start-up fading looks horrible; +- lamps; +- Start-up fading looks horrible, video timings? btanb? - Game looks IGS-esque, is there any correlation? ============================================================================================ diff --git a/src/mame/excellent/lastbank.cpp b/src/mame/excellent/lastbank.cpp index 855b0d502fe..b3bf90fd771 100644 --- a/src/mame/excellent/lastbank.cpp +++ b/src/mame/excellent/lastbank.cpp @@ -1,26 +1,25 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese +/************************************************************************************************** -/*************************************************************************** +Last Bank (c) 1994 Excellent System - Last Bank (c) 1994 Excellent System +Uses a TC0091LVC, a variant of the one used on Taito L HW - driver by Angelo Salese - - Uses a TC0091LVC, a variant of the one used on Taito L HW - - Undumped games on similar hardware (ES-9402 or ES-9410): - * Gold Strike - * Lucky Pierrot / Wonder Circus - * Miracle Seven - Heaven's Gate - * Miracle Seven - Heaven's Gate Turbo - * Ukiyo Box +Undumped games on similar hardware (ES-9402 or ES-9410): +* Gold Strike +* Lucky Pierrot / Wonder Circus +* Miracle Seven - Heaven's Gate +* Miracle Seven - Heaven's Gate Turbo +* Ukiyo Box - TODO: - fever13: inputs / dips once the GFX ROM is dumped. Dips are helpfully - shown at startup -***************************************************************************/ +TODO: +- fever13: GFX ROM dump; +- fever13: OKI sound volume overdrives a lot; +- hookup hopper device; + +**************************************************************************************************/ #include "emu.h" @@ -50,40 +49,53 @@ public: { } void lastbank(machine_config &config); - void fever13(machine_config &config); DECLARE_CUSTOM_INPUT_MEMBER(sound_status_r); protected: virtual void machine_start() override; + virtual void main_map(address_map &map); + virtual void audio_io(address_map &map); + + void sound_flags_w(uint8_t data); + private: required_device m_maincpu; required_device m_oki; required_device m_essnd; - uint8_t m_mux_data = 0; + uint8_t m_key_select = 0; uint8_t m_sound_flags = 0; void screen_vblank(int state); void output_w(offs_t offset, uint8_t data); - uint8_t mux_0_r(); - void mux_w(uint8_t data); - void sound_flags_w(uint8_t data); + uint8_t key_matrix_r(); + void key_select_w(uint8_t data); TIMER_DEVICE_CALLBACK_MEMBER(irq_scanline); - void lastbank_audio_io(address_map &map); - void fever13_audio_io(address_map &map); - void audio_program_map(address_map &map); - void main_program_map(address_map &map); + void audio_map(address_map &map); void tc0091lvc_map(address_map &map); }; +class fever13_state : public lastbank_state +{ +public: + fever13_state(const machine_config &mconfig, device_type type, const char *tag) + : lastbank_state(mconfig, type, tag) + { } + +protected: + virtual void main_map(address_map &map) override; + virtual void audio_io(address_map &map) override; +}; + + void lastbank_state::machine_start() { - save_item(NAME(m_mux_data)); + save_item(NAME(m_key_select)); save_item(NAME(m_sound_flags)); } @@ -96,7 +108,7 @@ void lastbank_state::screen_vblank(int state) } -uint8_t lastbank_state::mux_0_r() +uint8_t lastbank_state::key_matrix_r() { const char *const keynames[2][5] = { {"P1_KEY0", "P1_KEY1", "P1_KEY2", "P1_KEY3", "P1_KEY4"}, @@ -108,7 +120,7 @@ uint8_t lastbank_state::mux_0_r() for(i=0;i<5;i++) { - if(m_mux_data & 1 << i) + if(m_key_select & 1 << i) res = ioport(keynames[0][i])->read(); } @@ -133,9 +145,9 @@ void lastbank_state::output_w(offs_t offset, uint8_t data) } } -void lastbank_state::mux_w(uint8_t data) +void lastbank_state::key_select_w(uint8_t data) { - m_mux_data = data; + m_key_select = data; } void lastbank_state::sound_flags_w(uint8_t data) @@ -163,33 +175,33 @@ void lastbank_state::tc0091lvc_map(address_map &map) map(0xff08, 0xff08).rw(m_maincpu, FUNC(tc0091lvc_device::rom_bank_r), FUNC(tc0091lvc_device::rom_bank_w)); } -void lastbank_state::main_program_map(address_map &map) +void lastbank_state::main_map(address_map &map) { tc0091lvc_map(map); map(0xa000, 0xa00d).noprw(); // MSM62X42B or equivalent probably read from here map(0xa800, 0xa800).portr("COINS"); map(0xa800, 0xa802).w(FUNC(lastbank_state::output_w)); - map(0xa803, 0xa803).w(FUNC(lastbank_state::mux_w)); // mux for $a808 / $a80c + map(0xa803, 0xa803).w(FUNC(lastbank_state::key_select_w)); map(0xa804, 0xa804).portr("SPECIAL"); map(0xa805, 0xa805).w("soundlatch1", FUNC(generic_latch_8_device::write)); map(0xa806, 0xa806).w("soundlatch2", FUNC(generic_latch_8_device::write)); map(0xa807, 0xa807).nopw(); // hopper? - map(0xa808, 0xa808).r(FUNC(lastbank_state::mux_0_r)); - map(0xa80c, 0xa80c).r(FUNC(lastbank_state::mux_0_r)); - map(0xa81c, 0xa81c).portr("DSW0"); - map(0xa81d, 0xa81d).portr("DSW1"); - map(0xa81e, 0xa81e).portr("DSW2"); - map(0xa81f, 0xa81f).portr("DSW3"); + map(0xa808, 0xa808).r(FUNC(lastbank_state::key_matrix_r)); + map(0xa80c, 0xa80c).r(FUNC(lastbank_state::key_matrix_r)); + map(0xa81c, 0xa81c).portr("DSW1"); + map(0xa81d, 0xa81d).portr("DSW2"); + map(0xa81e, 0xa81e).portr("DSW3"); + map(0xa81f, 0xa81f).portr("DSW4"); } -void lastbank_state::audio_program_map(address_map &map) +void lastbank_state::audio_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xdfff).ram(); map(0xe000, 0xe7ff).ram(); } -void lastbank_state::lastbank_audio_io(address_map &map) +void lastbank_state::audio_io(address_map &map) { map.global_mask(0xff); map(0x00, 0x06).rw(m_essnd, FUNC(es8712_device::read), FUNC(es8712_device::write)); @@ -198,12 +210,19 @@ void lastbank_state::lastbank_audio_io(address_map &map) map(0xc0, 0xc0).r("soundlatch2", FUNC(generic_latch_8_device::read)); } -void lastbank_state::fever13_audio_io(address_map &map) +void fever13_state::main_map(address_map &map) { - lastbank_audio_io(map); + lastbank_state::main_map(map); + map(0xa808, 0xa808).portr("IN0"); + map(0xa80c, 0xa80c).portr("IN0"); +} + +void fever13_state::audio_io(address_map &map) +{ + lastbank_state::audio_io(map); map(0x80, 0x80).r("soundlatch2", FUNC(generic_latch_8_device::read)); - map(0xc0, 0xc0).r("soundlatch1", FUNC(generic_latch_8_device::read)).w(FUNC(lastbank_state::sound_flags_w)); + map(0xc0, 0xc0).r("soundlatch1", FUNC(generic_latch_8_device::read)).w(FUNC(fever13_state::sound_flags_w)); } static INPUT_PORTS_START( lastbank ) @@ -273,7 +292,7 @@ static INPUT_PORTS_START( lastbank ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("2-3") PORT_CODE(KEYCODE_A) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW0") + PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -299,7 +318,7 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW1") + PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -325,7 +344,7 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW2") + PORT_START("DSW3") PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW3:1,2,3,4") PORT_DIPSETTING( 0x07, "1 Coin /100 Credits" ) PORT_DIPSETTING( 0x08, "1 Coin /50 Credits" ) @@ -361,7 +380,7 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x20, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) - PORT_START("DSW3") + PORT_START("DSW4") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -388,6 +407,152 @@ static INPUT_PORTS_START( lastbank ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END +static INPUT_PORTS_START( fever13 ) + PORT_INCLUDE( lastbank ) + + PORT_MODIFY("P1_KEY0") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY1") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY2") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY3") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("P1_KEY4") + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) // "Right" + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) // "Left" + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("DSW1:1,2") + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "50" ) + PORT_DIPSETTING( 0x00, "90" ) + PORT_DIPNAME( 0x1c, 0x1c, "Win Percentage" ) PORT_DIPLOCATION("DSW1:3,4,5") + PORT_DIPSETTING( 0x1c, "95%" ) + PORT_DIPSETTING( 0x18, "90%" ) + PORT_DIPSETTING( 0x14, "85%" ) + PORT_DIPSETTING( 0x10, "80%" ) + PORT_DIPSETTING( 0x0c, "75%" ) + PORT_DIPSETTING( 0x08, "70%" ) + PORT_DIPSETTING( 0x04, "65%" ) + PORT_DIPSETTING( 0x00, "60%" ) + PORT_DIPNAME( 0x20, 0x20, "Hopper Motor" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Hopper Count" ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x40, "Sensor SW" ) + PORT_DIPSETTING( 0x00, "Micro SW" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x01, 0x00, "Payout calculation" ) PORT_DIPLOCATION("DSW2:1") // "% Calculate with" + PORT_DIPSETTING( 0x01, "Gambling" ) + PORT_DIPSETTING( 0x00, "Amusement" ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Difficulty" ) PORT_DIPLOCATION("DSW2:3,4") + PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Very_Hard ) ) + PORT_DIPNAME( 0x10, 0x10, "Double-Up Game" ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "L/R SW Reverse" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Auto Stop" ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Auto Start" ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_MODIFY("DSW3") + PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW3:1,2,3,4") + PORT_DIPSETTING( 0x07, "1 Coin /100 Credits" ) + PORT_DIPSETTING( 0x08, "1 Coin /50 Credits" ) + PORT_DIPSETTING( 0x09, "1 Coin /25 Credits" ) + PORT_DIPSETTING( 0x0a, "1 Coin /20 Credits" ) + PORT_DIPSETTING( 0x0b, "1 Coin /10 Credits" ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x01, "5 Coins /2 Credits" ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) + PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW3:5,6,7,8") + PORT_DIPSETTING( 0x70, "1 Coin /100 Credits" ) + PORT_DIPSETTING( 0x80, "1 Coin /50 Credits" ) + PORT_DIPSETTING( 0x90, "1 Coin /25 Credits" ) + PORT_DIPSETTING( 0xa0, "1 Coin /20 Credits" ) + PORT_DIPSETTING( 0xb0, "1 Coin /10 Credits" ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x10, "5 Coins /2 Credits" ) + PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x50, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) + + PORT_MODIFY("DSW4") + PORT_DIPNAME( 0x07, 0x07, "Coin C" ) PORT_DIPLOCATION("DSW4:1,2,3") + PORT_DIPSETTING( 0x06, "1 Coin /50 Credits" ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 6C_1C ) ) + PORT_DIPSETTING( 0x01, "9 Coins /1 Credit" ) + PORT_DIPSETTING( 0x00, "10 Coins /1 Credit" ) + PORT_DIPNAME( 0x38, 0x38, "Credit Limit" ) PORT_DIPLOCATION("DSW4:4,5,6") // "Give Up" + PORT_DIPSETTING( 0x38, "1000" ) + PORT_DIPSETTING( 0x30, "3000" ) + PORT_DIPSETTING( 0x28, "5000" ) + PORT_DIPSETTING( 0x20, "10000" ) + PORT_DIPSETTING( 0x18, "20000" ) + PORT_DIPSETTING( 0x10, "30000" ) + PORT_DIPSETTING( 0x08, "40000" ) + PORT_DIPSETTING( 0x00, "50000" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + +INPUT_PORTS_END + TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::irq_scanline) { int scanline = param; @@ -407,7 +572,7 @@ void lastbank_state::lastbank(machine_config &config) { // basic machine hardware TC0091LVC(config, m_maincpu, XTAL(14'318'181) / 4); //!!! TC0091LVC !!! - m_maincpu->set_addrmap(AS_PROGRAM, &lastbank_state::main_program_map); + m_maincpu->set_addrmap(AS_PROGRAM, &lastbank_state::main_map); m_maincpu->set_tilemap_xoffs(0,192); // TODO: correct? TIMER(config, "scantimer").configure_scanline(FUNC(lastbank_state::irq_scanline), "screen", 0, 1); @@ -415,8 +580,8 @@ void lastbank_state::lastbank(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181) / 4)); - audiocpu.set_addrmap(AS_PROGRAM, &lastbank_state::audio_program_map); - audiocpu.set_addrmap(AS_IO, &lastbank_state::lastbank_audio_io); + audiocpu.set_addrmap(AS_PROGRAM, &lastbank_state::audio_map); + audiocpu.set_addrmap(AS_IO, &lastbank_state::audio_io); // yes, we have no interrupts config.set_perfect_quantum(m_maincpu); @@ -453,13 +618,6 @@ void lastbank_state::lastbank(machine_config &config) // is also absent from some other games on the same hardware. } -void lastbank_state::fever13(machine_config &config) -{ - lastbank(config); - - subdevice("audiocpu")->set_addrmap(AS_IO, &lastbank_state::fever13_audio_io); -} - /*************************************************************************** Game driver(s) @@ -505,4 +663,4 @@ ROM_END GAME( 1994, lastbank, 0, lastbank, lastbank, lastbank_state, empty_init, ROT0, "Excellent System", "Last Bank (v1.16)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, fever13, 0, fever13, lastbank, lastbank_state, empty_init, ROT0, "Excellent System", "Fever 13 (v1.3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // missing GFX dump +GAME( 1995, fever13, 0, lastbank, fever13, fever13_state, empty_init, ROT0, "Excellent System", "Fever 13 (Japan, v1.3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // missing GFX dump