summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/stadhero.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-10-06 21:09:40 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-10-06 21:10:16 -0400
commit880f2b7ae1582db69443e922880ecd1ab1096eb0 (patch)
tree0cf4f08b5a0327503a9338560ff4e1a1795d250f /src/mame/drivers/stadhero.cpp
parent545f8069ef6d0095464479f4f90d3c7240d96a37 (diff)
stadhero: Make stage music selection and various other things more random
Diffstat (limited to 'src/mame/drivers/stadhero.cpp')
-rw-r--r--src/mame/drivers/stadhero.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mame/drivers/stadhero.cpp b/src/mame/drivers/stadhero.cpp
index 1015a6c44a6..c5b66a9551a 100644
--- a/src/mame/drivers/stadhero.cpp
+++ b/src/mame/drivers/stadhero.cpp
@@ -32,7 +32,6 @@ TODO : RNG issue? Some behavior isn't correct (ex: BGM randomizer).
#include "sound/3812intf.h"
#include "sound/okim6295.h"
#include "emupal.h"
-#include "screen.h"
#include "speaker.h"
@@ -43,6 +42,13 @@ WRITE16_MEMBER(stadhero_state::int_ack_w)
m_maincpu->set_input_line(M68K_IRQ_5, CLEAR_LINE);
}
+uint8_t stadhero_state::mystery_r()
+{
+ // Polled, very frequently at times, to randomly determine stage music
+ // selection, attract mode teams, base-stealing attempts, etc. etc.
+ return m_screen->hpos() / 2;
+}
+
/******************************************************************************/
@@ -54,7 +60,8 @@ void stadhero_state::main_map(address_map &map)
map(0x240010, 0x240017).w(m_tilegen, FUNC(deco_bac06_device::pf_control_1_w));
map(0x260000, 0x261fff).rw(m_tilegen, FUNC(deco_bac06_device::pf_data_r), FUNC(deco_bac06_device::pf_data_w));
map(0x30c000, 0x30c001).portr("INPUTS");
- map(0x30c002, 0x30c003).lr8("30c002", [this]() { return uint8_t(m_coin->read()); });
+ map(0x30c002, 0x30c002).lr8("30c002", [this]() { return uint8_t(m_coin->read()); });
+ map(0x30c003, 0x30c003).r(FUNC(stadhero_state::mystery_r));
map(0x30c004, 0x30c005).portr("DSW").w(FUNC(stadhero_state::int_ack_w));
map(0x30c007, 0x30c007).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x310000, 0x3107ff).ram().w("palette", FUNC(palette_device::write16)).share("palette");
@@ -132,11 +139,8 @@ static INPUT_PORTS_START( stadhero )
PORT_DIPUNUSED( 0x4000, IP_ACTIVE_LOW )
PORT_DIPUNUSED( 0x8000, IP_ACTIVE_LOW )
- PORT_START("COIN") /* 0x30c002 & 0x30c003 */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* related to music/sound */
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* related to music/sound */
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* related to music/sound */
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* related to music/sound */
+ PORT_START("COIN") /* 0x30c002 */
+ PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )