small cleanup (nw)

This commit is contained in:
Miodrag Milanovic 2013-04-12 08:05:10 +00:00
parent 3d7524a02d
commit 7a4840affd
8 changed files with 22 additions and 16 deletions

View File

@ -330,7 +330,7 @@ WRITE16_MEMBER(armedf_state::terraf_io_w)
WRITE16_MEMBER(armedf_state::terrafjb_io_w)
{
if(data & 0x4000 && ((m_vreg & 0x4000) == 0)) //0 -> 1 transition
machine().device("extra")->execute().set_input_line(0, HOLD_LINE);
m_extra->set_input_line(0, HOLD_LINE);
COMBINE_DATA(&m_vreg);

View File

@ -41,8 +41,8 @@ void eprom_state::update_interrupts()
{
m_maincpu->set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
if (subdevice("extra") != NULL)
subdevice("extra")->execute().set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
if (m_extra != NULL)
m_extra->set_input_line(4, m_video_int_state ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -94,13 +94,13 @@ READ16_MEMBER(eprom_state::adc_r)
WRITE16_MEMBER(eprom_state::eprom_latch_w)
{
if (ACCESSING_BITS_0_7 && (machine().device("extra") != NULL))
if (ACCESSING_BITS_0_7 && (m_extra != NULL))
{
/* bit 0: reset extra CPU */
if (data & 1)
machine().device("extra")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
m_extra->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
else
machine().device("extra")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
m_extra->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
/* bits 1-4: screen intensity */
m_screen_intensity = (data & 0x1e) >> 1;
@ -707,7 +707,7 @@ DRIVER_INIT_MEMBER(eprom_state,eprom)
/* install CPU synchronization handlers */
m_sync_data = m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this));
m_sync_data = machine().device("extra")->memory().space(AS_PROGRAM).install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this));
m_sync_data = m_extra->space(AS_PROGRAM).install_readwrite_handler(0x16cc00, 0x16cc01, read16_delegate(FUNC(eprom_state::sync_r),this), write16_delegate(FUNC(eprom_state::sync_w),this));
}

View File

@ -35,7 +35,7 @@
void thunderj_state::update_interrupts()
{
m_maincpu->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
subdevice("extra")->execute().set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
m_extra->set_input_line(4, m_scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(6, m_sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@ -81,9 +81,9 @@ WRITE16_MEMBER(thunderj_state::latch_w)
{
/* 0 means hold CPU 2's reset low */
if (data & 1)
machine().device("extra")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
m_extra->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
else
machine().device("extra")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
m_extra->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
/* bits 2-5 are the alpha bank */
if (m_alpha_tile_bank != ((data >> 2) & 7))

View File

@ -9,7 +9,8 @@ public:
m_spr_pal_clut(*this, "spr_pal_clut"),
m_fg_videoram(*this, "fg_videoram"),
m_bg_videoram(*this, "bg_videoram"),
m_maincpu(*this, "maincpu") { }
m_maincpu(*this, "maincpu"),
m_extra(*this, "extra") { }
/* memory pointers */
UINT8 * m_text_videoram;
@ -87,6 +88,7 @@ public:
int transparent_color);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_extra;
};
class bigfghtr_state : public armedf_state

View File

@ -10,7 +10,8 @@ class eprom_state : public atarigen_state
{
public:
eprom_state(const machine_config &mconfig, device_type type, const char *tag)
: atarigen_state(mconfig, type, tag) { }
: atarigen_state(mconfig, type, tag),
m_extra(*this, "extra") { }
int m_screen_intensity;
int m_video_disable;
@ -36,6 +37,7 @@ public:
UINT32 screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void update_palette();
optional_device<cpu_device> m_extra;
};
/*----------- defined in video/eprom.c -----------*/

View File

@ -10,7 +10,8 @@ class thunderj_state : public atarigen_state
{
public:
thunderj_state(const machine_config &mconfig, device_type type, const char *tag)
: atarigen_state(mconfig, type, tag) { }
: atarigen_state(mconfig, type, tag),
m_extra(*this, "extra") { }
UINT8 m_alpha_tile_bank;
virtual void update_interrupts();
@ -26,4 +27,5 @@ public:
DECLARE_MACHINE_RESET(thunderj);
DECLARE_VIDEO_START(thunderj);
UINT32 screen_update_thunderj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_extra;
};

View File

@ -79,7 +79,7 @@ void exterm_scanline_update(screen_device &screen, bitmap_ind16 &bitmap, int sca
int x;
/* get parameters for the slave CPU */
tms34010_get_display_params(screen.machine().device("slave"), &fgparams);
tms34010_get_display_params(state->m_slave, &fgparams);
/* compute info about the slave vram */
if (fgparams.enabled && scanline >= fgparams.veblnk && scanline < fgparams.vsblnk && fgparams.heblnk < fgparams.hsblnk)

View File

@ -730,7 +730,7 @@ MACHINE_RESET_MEMBER(sat_console_state,saturn)
//memset(stv_m_workram_h, 0, 0x100000);
m_maincpu->set_unscaled_clock(MASTER_CLOCK_320/2);
machine().device("slave")->set_unscaled_clock(MASTER_CLOCK_320/2);
m_slave->set_unscaled_clock(MASTER_CLOCK_320/2);
stvcd_reset();
@ -843,7 +843,7 @@ void sat_console_state::saturn_init_driver(int rgn)
// set compatible options
sh2drc_set_options(m_maincpu, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
sh2drc_set_options(machine().device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
sh2drc_set_options(m_slave, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
/* amount of time to boost interleave for on MINIT / SINIT, needed for communication to work */
m_minit_boost = 400;