mirror of
https://github.com/holub/mame
synced 2025-06-02 02:49:44 +03:00
kingofb, ringking: NMI modernization (nw)
This commit is contained in:
parent
98c6e4c253
commit
5a225225f3
@ -21,6 +21,7 @@ Main CPU:
|
||||
#include "includes/kingobox.h"
|
||||
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/clock.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/volt_reg.h"
|
||||
@ -442,22 +443,14 @@ static GFXDECODE_START( rk )
|
||||
GFXDECODE_ENTRY( "gfx4", 0x00000, rk_bglayout, 0, 32 ) /* bg tiles */
|
||||
GFXDECODE_END
|
||||
|
||||
INTERRUPT_GEN_MEMBER(kingofb_state::kingofb_interrupt)
|
||||
{
|
||||
if (m_nmi_enable)
|
||||
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
void kingofb_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_nmi_enable));
|
||||
save_item(NAME(m_palette_bank));
|
||||
}
|
||||
|
||||
void kingofb_state::machine_reset()
|
||||
{
|
||||
m_nmi_enable = 0;
|
||||
m_palette_bank = 0;
|
||||
kingofb_f800_w(machine().dummy_space(), 0, 0); // LS174 reset
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( kingofb )
|
||||
@ -465,20 +458,24 @@ static MACHINE_CONFIG_START( kingofb )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(kingobox_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", kingofb_state, kingofb_interrupt)
|
||||
|
||||
MCFG_CPU_ADD("video", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(kingobox_video_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", kingofb_state, kingofb_interrupt)
|
||||
|
||||
MCFG_CPU_ADD("sprite", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(kingobox_sprite_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", kingofb_state, kingofb_interrupt)
|
||||
|
||||
MCFG_INPUT_MERGER_ALL_HIGH("nmigate")
|
||||
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("video", INPUT_LINE_NMI))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sprite", INPUT_LINE_NMI))
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(kingobox_sound_map)
|
||||
MCFG_CPU_IO_MAP(kingobox_sound_io_map)
|
||||
MCFG_CPU_PERIODIC_INT_DRIVER(kingofb_state, nmi_line_pulse, 6000) /* Hz */
|
||||
|
||||
MCFG_DEVICE_ADD("soundnmi", CLOCK, 6000) /* Hz */
|
||||
MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* We really need heavy synching among the processors */
|
||||
|
||||
@ -491,6 +488,7 @@ static MACHINE_CONFIG_START( kingofb )
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(kingofb_state, screen_update_kingofb)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(DEVWRITELINE("nmigate", input_merger_device, in_w<0>))
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", kingobox)
|
||||
MCFG_PALETTE_ADD("palette", 256+8*2)
|
||||
@ -519,20 +517,24 @@ static MACHINE_CONFIG_START( ringking )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(ringking_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", kingofb_state, kingofb_interrupt)
|
||||
|
||||
MCFG_CPU_ADD("video", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(ringking_video_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", kingofb_state, kingofb_interrupt)
|
||||
|
||||
MCFG_CPU_ADD("sprite", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(ringking_sprite_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", kingofb_state, kingofb_interrupt)
|
||||
|
||||
MCFG_INPUT_MERGER_ANY_HIGH("nmigate")
|
||||
MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("video", INPUT_LINE_NMI))
|
||||
MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("sprite", INPUT_LINE_NMI))
|
||||
|
||||
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4.0 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(kingobox_sound_map)
|
||||
MCFG_CPU_IO_MAP(ringking_sound_io_map)
|
||||
MCFG_CPU_PERIODIC_INT_DRIVER(kingofb_state, nmi_line_pulse, 6000) /* Hz */
|
||||
|
||||
MCFG_DEVICE_ADD("soundnmi", CLOCK, 6000) /* Hz */
|
||||
MCFG_CLOCK_SIGNAL_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
|
||||
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* We really need heavy synching among the processors */
|
||||
|
||||
@ -545,6 +547,7 @@ static MACHINE_CONFIG_START( ringking )
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(kingofb_state, screen_update_ringking)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(DEVWRITELINE("nmigate", input_merger_device, in_w<0>))
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rk)
|
||||
MCFG_PALETTE_ADD("palette", 256+8*2)
|
||||
|
@ -7,6 +7,7 @@
|
||||
*************************************************************************/
|
||||
|
||||
#include "machine/gen_latch.h"
|
||||
#include "machine/input_merger.h"
|
||||
|
||||
class kingofb_state : public driver_device
|
||||
{
|
||||
@ -23,6 +24,7 @@ public:
|
||||
m_sprite_cpu(*this, "sprite"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_nmigate(*this, "nmigate"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette"),
|
||||
m_soundlatch(*this, "soundlatch") { }
|
||||
@ -40,9 +42,6 @@ public:
|
||||
tilemap_t *m_fg_tilemap;
|
||||
int m_palette_bank;
|
||||
|
||||
/* misc */
|
||||
int m_nmi_enable;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_video_cpu;
|
||||
required_device<cpu_device> m_sprite_cpu;
|
||||
@ -76,6 +75,7 @@ public:
|
||||
void ringking_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<input_merger_device> m_nmigate;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<generic_latch_8_device> m_soundlatch;
|
||||
|
@ -158,7 +158,7 @@ WRITE8_MEMBER(kingofb_state::kingofb_colorram2_w)
|
||||
|
||||
WRITE8_MEMBER(kingofb_state::kingofb_f800_w)
|
||||
{
|
||||
m_nmi_enable = data & 0x20;
|
||||
m_nmigate->in_w<1>(BIT(data, 5));
|
||||
|
||||
if (m_palette_bank != ((data & 0x18) >> 3))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user