summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Angelo Salese <lordkale4@gmail.com>2019-07-26 15:45:49 +0200
committer Angelo Salese <lordkale4@gmail.com>2019-07-26 15:45:49 +0200
commitad2e7a469463d02508c98a471332256e3e8621b2 (patch)
treecb0102a3f6bee4d5e3c3e334dee049f6b9e89b9e
parent4da0cc0224d2e8f98d443f547c039050f1d70cfb (diff)
nemesis.cpp: fix irq generation for Hyper Crash, fixes coin insertion and gameplay glitches [Angelo Salese]
-rw-r--r--src/mame/drivers/nemesis.cpp29
-rw-r--r--src/mame/includes/nemesis.h1
2 files changed, 23 insertions, 7 deletions
diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp
index ad95c25bebf..824be6e794d 100644
--- a/src/mame/drivers/nemesis.cpp
+++ b/src/mame/drivers/nemesis.cpp
@@ -75,7 +75,6 @@ TODO: others.
TODO:
- exact cycles/scanlines for VBLANK and 256V int assert/clear need to be figured out and implemented.
- bubble system needs a delay (and auto-sound-nmi hookup) so the 'getting ready... 49...' countdown actually plays before the simulated MCU releases the 68k and the load (and morning music) begins.
-- hcrash: coin insertion isn't always recognized.
- hcrash: Konami GT-type inputs doesn't work properly.
- gradiusb: still needs proper MCU emulation;
@@ -98,6 +97,9 @@ but when they get close to top of the screen they go in front of them.
--
To display score, priority of upper part is always lower.
So this is the correct behavior of real hardware, not an emulation bug.
+- hcrash:
+The "overall ranking" sums up every play score by players, by looking up
+initials
***************************************************************************/
@@ -174,6 +176,19 @@ TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::konamigt_interrupt)
m_maincpu->set_input_line(2, HOLD_LINE);
}
+// irq enables in reverse order than Salamander according to the irq routine contents
+TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::hcrash_interrupt)
+{
+ int scanline = param;
+
+ if (scanline == 240 && m_irq2_on) //&& (m_screen->frame_number() & 1) == 0)
+ m_maincpu->set_input_line(1, HOLD_LINE);
+
+ if (scanline == 0 && m_irq_on)
+ m_maincpu->set_input_line(2, HOLD_LINE);
+}
+
+
TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::gx400_interrupt)
{
int scanline = param;
@@ -231,7 +246,7 @@ WRITE_LINE_MEMBER(nemesis_state::sound_nmi_w)
// On Bubble System at least, this goes to an LS02 NOR before the Z80, whose other input is tied to ???, acting as an inverter. Effectively, if the bit is 1, NMI is asserted, otherwise it is cleared. This is also cleared on reset.
// the ??? input is likely either tied to VBLANK or 256V, or tied to one of those two through a 74ls74 enable latch, controlled by something else (probably either the one of the two output/int enable latches of the 68k, or by exx0/exx7 address-latched accesses from the sound z80, though technically it could be anything, even the /BS signal from the mcu to the 68k)
// TODO: trace implement the other NMI source; without this, the 'getting ready' pre-bubble-ready countdown in bubble system cannot work, since it requires a sequence of NMIs in order to function.
- m_audiocpu->set_input_line(INPUT_LINE_NMI, state?ASSERT_LINE:CLEAR_LINE);
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
WRITE16_MEMBER(nemesis_state::bubsys_mcu_w)
@@ -2155,7 +2170,7 @@ void nemesis_state::hcrash(machine_config &config)
/* basic machine hardware */
M68000(config, m_maincpu, 18432000/3); /* 6.144MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &nemesis_state::hcrash_map);
- TIMER(config, "scantimer").configure_scanline(FUNC(nemesis_state::konamigt_interrupt), "screen", 0, 1);
+ TIMER(config, "scantimer").configure_scanline(FUNC(nemesis_state::hcrash_interrupt), "screen", 0, 1);
Z80(config, m_audiocpu, 14318180/4); /* 3.579545 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &nemesis_state::sal_sound_map);
@@ -2185,8 +2200,8 @@ void nemesis_state::hcrash(machine_config &config)
VLM5030(config, m_vlm, 3579545);
m_vlm->set_addrmap(0, &nemesis_state::salamand_vlm_map);
- m_vlm->add_route(ALL_OUTPUTS, "lspeaker", 1.00);
- m_vlm->add_route(ALL_OUTPUTS, "rspeaker", 1.00);
+ m_vlm->add_route(ALL_OUTPUTS, "lspeaker", 2.00);
+ m_vlm->add_route(ALL_OUTPUTS, "rspeaker", 2.00);
K007232(config, m_k007232, 3579545);
m_k007232->port_write().set(FUNC(nemesis_state::volume_callback));
@@ -2197,8 +2212,8 @@ void nemesis_state::hcrash(machine_config &config)
ym2151_device &ymsnd(YM2151(config, "ymsnd", 3579545));
// ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ... Interrupts _are_ generated, I wonder where they go
- ymsnd.add_route(0, "lspeaker", 1.0);
- ymsnd.add_route(1, "rspeaker", 1.0);
+ ymsnd.add_route(0, "lspeaker", 0.50);
+ ymsnd.add_route(1, "rspeaker", 0.50);
}
/***************************************************************************
diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h
index 4f5b0df3c80..c83825ad2fb 100644
--- a/src/mame/includes/nemesis.h
+++ b/src/mame/includes/nemesis.h
@@ -153,6 +153,7 @@ private:
DECLARE_WRITE_LINE_MEMBER(blkpnthr_vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(bubsys_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(konamigt_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(hcrash_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(gx400_interrupt);
void create_palette_lookups();
void nemesis_postload();