mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
btime.cpp: Use input merger device (nw)
This commit is contained in:
parent
fb9f98590f
commit
778f75afcd
@ -157,7 +157,6 @@ A few notes:
|
|||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
AUDIO_ENABLE_NONE,
|
|
||||||
AUDIO_ENABLE_DIRECT, /* via direct address in memory map */
|
AUDIO_ENABLE_DIRECT, /* via direct address in memory map */
|
||||||
AUDIO_ENABLE_AY8910 /* via ay-8910 port A */
|
AUDIO_ENABLE_AY8910 /* via ay-8910 port A */
|
||||||
};
|
};
|
||||||
@ -169,27 +168,20 @@ WRITE8_MEMBER(btime_state::audio_nmi_enable_w)
|
|||||||
lnc and disco use bit 0 of the first AY-8910's port A instead; many other
|
lnc and disco use bit 0 of the first AY-8910's port A instead; many other
|
||||||
games also write there in addition to this address */
|
games also write there in addition to this address */
|
||||||
if (m_audio_nmi_enable_type == AUDIO_ENABLE_DIRECT)
|
if (m_audio_nmi_enable_type == AUDIO_ENABLE_DIRECT)
|
||||||
{
|
m_audionmi->in_w<0>(BIT(data, 0));
|
||||||
m_audio_nmi_enabled = data & 1;
|
|
||||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER(btime_state::ay_audio_nmi_enable_w)
|
WRITE8_MEMBER(btime_state::ay_audio_nmi_enable_w)
|
||||||
{
|
{
|
||||||
/* port A bit 0, when 1, inhibits the NMI */
|
/* port A bit 0, when 1, inhibits the NMI */
|
||||||
if (m_audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
|
if (m_audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
|
||||||
{
|
m_audionmi->in_w<0>(BIT(~data, 0));
|
||||||
m_audio_nmi_enabled = ~data & 1;
|
|
||||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TIMER_DEVICE_CALLBACK_MEMBER(btime_state::audio_nmi_gen)
|
TIMER_DEVICE_CALLBACK_MEMBER(btime_state::audio_nmi_gen)
|
||||||
{
|
{
|
||||||
int scanline = param;
|
int scanline = param;
|
||||||
m_audio_nmi_state = scanline & 8;
|
m_audionmi->in_w<1>((scanline & 8) >> 3);
|
||||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADDRESS_MAP_START( btime_map, AS_PROGRAM, 8, btime_state )
|
static ADDRESS_MAP_START( btime_map, AS_PROGRAM, 8, btime_state )
|
||||||
@ -1243,8 +1235,6 @@ MACHINE_START_MEMBER(btime_state,btime)
|
|||||||
save_item(NAME(m_bnj_scroll1));
|
save_item(NAME(m_bnj_scroll1));
|
||||||
save_item(NAME(m_bnj_scroll2));
|
save_item(NAME(m_bnj_scroll2));
|
||||||
save_item(NAME(m_btime_tilemap));
|
save_item(NAME(m_btime_tilemap));
|
||||||
save_item(NAME(m_audio_nmi_enabled));
|
|
||||||
save_item(NAME(m_audio_nmi_state));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MACHINE_START_MEMBER(btime_state,mmonkey)
|
MACHINE_START_MEMBER(btime_state,mmonkey)
|
||||||
@ -1260,7 +1250,8 @@ MACHINE_START_MEMBER(btime_state,mmonkey)
|
|||||||
MACHINE_RESET_MEMBER(btime_state,btime)
|
MACHINE_RESET_MEMBER(btime_state,btime)
|
||||||
{
|
{
|
||||||
/* by default, the audio NMI is disabled, except for bootlegs which don't use the enable */
|
/* by default, the audio NMI is disabled, except for bootlegs which don't use the enable */
|
||||||
m_audio_nmi_enabled = (m_audio_nmi_enable_type == AUDIO_ENABLE_NONE);
|
if (m_audionmi.found())
|
||||||
|
m_audionmi->in_w<0>(0);
|
||||||
|
|
||||||
m_btime_palette = 0;
|
m_btime_palette = 0;
|
||||||
m_bnj_scroll1 = 0;
|
m_bnj_scroll1 = 0;
|
||||||
@ -1269,7 +1260,6 @@ MACHINE_RESET_MEMBER(btime_state,btime)
|
|||||||
m_btime_tilemap[1] = 0;
|
m_btime_tilemap[1] = 0;
|
||||||
m_btime_tilemap[2] = 0;
|
m_btime_tilemap[2] = 0;
|
||||||
m_btime_tilemap[3] = 0;
|
m_btime_tilemap[3] = 0;
|
||||||
m_audio_nmi_state = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MACHINE_RESET_MEMBER(btime_state,lnc)
|
MACHINE_RESET_MEMBER(btime_state,lnc)
|
||||||
@ -1297,7 +1287,10 @@ static MACHINE_CONFIG_START( btime )
|
|||||||
|
|
||||||
MCFG_CPU_ADD("audiocpu", M6502, HCLK1/3/2)
|
MCFG_CPU_ADD("audiocpu", M6502, HCLK1/3/2)
|
||||||
MCFG_CPU_PROGRAM_MAP(audio_map)
|
MCFG_CPU_PROGRAM_MAP(audio_map)
|
||||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("audionmi", btime_state, audio_nmi_gen, "screen", 0, 8)
|
MCFG_TIMER_DRIVER_ADD_SCANLINE("8vck", btime_state, audio_nmi_gen, "screen", 0, 8)
|
||||||
|
|
||||||
|
MCFG_INPUT_MERGER_ALL_HIGH("audionmi")
|
||||||
|
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
|
||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
MCFG_SCREEN_ADD("screen", RASTER)
|
MCFG_SCREEN_ADD("screen", RASTER)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "machine/gen_latch.h"
|
#include "machine/gen_latch.h"
|
||||||
|
#include "machine/input_merger.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
class btime_state : public driver_device
|
class btime_state : public driver_device
|
||||||
@ -25,6 +26,7 @@ public:
|
|||||||
, m_audio_rambase(*this, "audio_rambase")
|
, m_audio_rambase(*this, "audio_rambase")
|
||||||
, m_maincpu(*this, "maincpu")
|
, m_maincpu(*this, "maincpu")
|
||||||
, m_audiocpu(*this, "audiocpu")
|
, m_audiocpu(*this, "audiocpu")
|
||||||
|
, m_audionmi(*this, "audionmi")
|
||||||
, m_gfxdecode(*this, "gfxdecode")
|
, m_gfxdecode(*this, "gfxdecode")
|
||||||
, m_screen(*this, "screen")
|
, m_screen(*this, "screen")
|
||||||
, m_palette(*this, "palette")
|
, m_palette(*this, "palette")
|
||||||
@ -54,8 +56,6 @@ public:
|
|||||||
|
|
||||||
/* audio-related */
|
/* audio-related */
|
||||||
uint8_t m_audio_nmi_enable_type;
|
uint8_t m_audio_nmi_enable_type;
|
||||||
uint8_t m_audio_nmi_enabled;
|
|
||||||
uint8_t m_audio_nmi_state;
|
|
||||||
|
|
||||||
/* protection-related (for mmonkey) */
|
/* protection-related (for mmonkey) */
|
||||||
int m_protection_command;
|
int m_protection_command;
|
||||||
@ -66,6 +66,7 @@ public:
|
|||||||
/* devices */
|
/* devices */
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
optional_device<cpu_device> m_audiocpu;
|
optional_device<cpu_device> m_audiocpu;
|
||||||
|
optional_device<input_merger_device> m_audionmi;
|
||||||
required_device<gfxdecode_device> m_gfxdecode;
|
required_device<gfxdecode_device> m_gfxdecode;
|
||||||
required_device<screen_device> m_screen;
|
required_device<screen_device> m_screen;
|
||||||
required_device<palette_device> m_palette;
|
required_device<palette_device> m_palette;
|
||||||
|
Loading…
Reference in New Issue
Block a user