summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/pipeline.cpp')
-rw-r--r--src/mame/drivers/pipeline.cpp115
1 files changed, 52 insertions, 63 deletions
diff --git a/src/mame/drivers/pipeline.cpp b/src/mame/drivers/pipeline.cpp
index 749c134c67e..0bdeb9272f2 100644
--- a/src/mame/drivers/pipeline.cpp
+++ b/src/mame/drivers/pipeline.cpp
@@ -100,7 +100,7 @@ public:
private:
DECLARE_WRITE8_MEMBER(vram2_w);
DECLARE_WRITE8_MEMBER(vram1_w);
- DECLARE_WRITE8_MEMBER(mcu_portA_w);
+ DECLARE_WRITE8_MEMBER(mcu_porta_w);
DECLARE_WRITE8_MEMBER(vidctrl_w);
DECLARE_READ8_MEMBER(protection_r);
DECLARE_WRITE8_MEMBER(protection_w);
@@ -133,32 +133,26 @@ private:
u8 m_vidctrl;
std::unique_ptr<u8[]> m_palram;
- u8 m_fromMCU;
+ u8 m_from_mcu;
};
void pipeline_state::machine_start()
{
- save_item(NAME(m_fromMCU));
+ save_item(NAME(m_from_mcu));
}
TILE_GET_INFO_MEMBER(pipeline_state::get_tile_info)
{
- int code = m_vram2[tile_index]+m_vram2[tile_index+0x800]*256;
- SET_TILE_INFO_MEMBER(0,
- code,
- 0,
- 0);
+ int code = m_vram2[tile_index] + m_vram2[tile_index + 0x800] * 256;
+ SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
TILE_GET_INFO_MEMBER(pipeline_state::get_tile_info2)
{
- int code =m_vram1[tile_index]+((m_vram1[tile_index+0x800]>>4))*256;
- int color=((m_vram1[tile_index+0x800])&0xf);
- SET_TILE_INFO_MEMBER(1,
- code,
- color,
- 0);
+ int code = m_vram1[tile_index] + ((m_vram1[tile_index + 0x800] >> 4)) * 256;
+ int color = ((m_vram1[tile_index + 0x800]) & 0xf);
+ SET_TILE_INFO_MEMBER(1, code, color, 0);
}
void pipeline_state::video_start()
@@ -182,36 +176,36 @@ u32 pipeline_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
WRITE8_MEMBER(pipeline_state::vidctrl_w)
{
- m_vidctrl=data;
+ m_vidctrl = data;
}
WRITE8_MEMBER(pipeline_state::vram2_w)
{
- if(!(m_vidctrl&1))
+ if(!(m_vidctrl & 1))
{
- m_tilemap1->mark_tile_dirty(offset&0x7ff);
- m_vram2[offset]=data;
+ m_tilemap1->mark_tile_dirty(offset & 0x7ff);
+ m_vram2[offset] = data;
}
else
{
- m_palram[offset]=data;
- if(offset<0x300)
- {
- offset&=0xff;
+ m_palram[offset] = data;
+ if (offset < 0x300)
+ {
+ offset &= 0xff;
m_palette->set_pen_color(offset, pal6bit(m_palram[offset]), pal6bit(m_palram[offset+0x100]), pal6bit(m_palram[offset+0x200]));
- }
+ }
}
}
WRITE8_MEMBER(pipeline_state::vram1_w)
{
- m_tilemap2->mark_tile_dirty(offset&0x7ff);
- m_vram1[offset]=data;
+ m_tilemap2->mark_tile_dirty(offset & 0x7ff);
+ m_vram1[offset] = data;
}
READ8_MEMBER(pipeline_state::protection_r)
{
- return m_fromMCU;
+ return m_from_mcu;
}
TIMER_CALLBACK_MEMBER(pipeline_state::protection_deferred_w)
@@ -251,9 +245,9 @@ void pipeline_state::sound_port(address_map &map)
map(0x06, 0x07).noprw();
}
-WRITE8_MEMBER(pipeline_state::mcu_portA_w)
+WRITE8_MEMBER(pipeline_state::mcu_porta_w)
{
- m_fromMCU=data;
+ m_from_mcu = data;
}
@@ -342,36 +336,35 @@ static const z80_daisy_config daisy_chain_sound[] =
PALETTE_INIT_MEMBER(pipeline_state, pipeline)
{
- int r,g,b,i,c;
u8 *prom1 = &memregion("proms")->base()[0x000];
u8 *prom2 = &memregion("proms")->base()[0x100];
- for (i=0;i<0x100;i++)
+ for (int i = 0; i < 0x100; i++)
{
- c=prom1[i]|(prom2[i]<<4);
- r=c&7;
- g=(c>>3)&7;
- b=(c>>6)&3;
- r*=36;
- g*=36;
- b*=85;
+ int c = prom1[i] | (prom2[i] << 4);
+ int r = c & 7;
+ int g = (c >> 3) & 7;
+ int b = (c >> 6) & 3;
+ r *= 36;
+ g *= 36;
+ b *= 85;
palette.set_pen_color(0x100+i, rgb_t(r, g, b));
}
}
-MACHINE_CONFIG_START(pipeline_state::pipeline)
+void pipeline_state::pipeline(machine_config &config)
+{
/* basic machine hardware */
-
- MCFG_DEVICE_ADD("maincpu", Z80, 7372800/2)
- MCFG_DEVICE_PROGRAM_MAP(cpu0_mem)
+ Z80(config, m_maincpu, 7372800/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &pipeline_state::cpu0_mem);
z80_device& audiocpu(Z80(config, "audiocpu", 7372800/2));
audiocpu.set_daisy_config(daisy_chain_sound);
audiocpu.set_addrmap(AS_PROGRAM, &pipeline_state::cpu1_mem);
audiocpu.set_addrmap(AS_IO, &pipeline_state::sound_port);
- MCFG_DEVICE_ADD("mcu", M68705R3, 7372800/2)
- MCFG_M68705_PORTA_W_CB(WRITE8(*this, pipeline_state, mcu_portA_w))
+ M68705R3(config, m_mcu, 7372800/2);
+ m_mcu->porta_w().set(FUNC(pipeline_state::mcu_porta_w));
z80ctc_device& ctc(Z80CTC(config, "ctc", 7372800/2 /* same as "audiocpu" */));
ctc.intr_callback().set_inputline("audiocpu", INPUT_LINE_IRQ0);
@@ -387,29 +380,25 @@ MACHINE_CONFIG_START(pipeline_state::pipeline)
ppi1.in_pc_callback().set(FUNC(pipeline_state::protection_r));
ppi1.out_pc_callback().set(FUNC(pipeline_state::protection_w));
- MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
+ I8255A(config, "ppi8255_2", 0);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(512, 512)
- MCFG_SCREEN_VISIBLE_AREA(0, 319, 16, 239)
- MCFG_SCREEN_UPDATE_DRIVER(pipeline_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
-
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pipeline)
-
- MCFG_PALETTE_ADD("palette", 0x100+0x100)
- MCFG_PALETTE_INIT_OWNER(pipeline_state, pipeline)
-
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(512, 512);
+ screen.set_visarea(0, 319, 16, 239);
+ screen.set_screen_update(FUNC(pipeline_state::screen_update));
+ screen.set_palette("palette");
+ screen.screen_vblank().set_inputline("maincpu", INPUT_LINE_NMI);
+
+ GFXDECODE(config, m_gfxdecode, m_palette, gfx_pipeline);
+ PALETTE(config, m_palette, 0x100+0x100).set_init(FUNC(pipeline_state::palette_init_pipeline));
+
+ /* audio hardware */
SPEAKER(config, "mono").front_center();
-
- MCFG_DEVICE_ADD("ymsnd", YM2203, 7372800/4)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
-
-MACHINE_CONFIG_END
+ YM2203(config, "ymsnd", 7372800/4).add_route(ALL_OUTPUTS, "mono", 0.60);
+}
ROM_START( pipeline )