mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
driver: make flipscreen setters compatible with writeline
This commit is contained in:
parent
68e74d6b83
commit
cb510e940a
5 changed files with 31 additions and 53 deletions
|
@ -314,16 +314,16 @@ void driver_device::updateflip()
|
|||
// flip_screen_set - set global flip
|
||||
//-------------------------------------------------
|
||||
|
||||
void driver_device::flip_screen_set(u32 on)
|
||||
void driver_device::flip_screen_set(int state)
|
||||
{
|
||||
// normalize to all 1
|
||||
if (on)
|
||||
on = ~0;
|
||||
if (state)
|
||||
state = 0xff;
|
||||
|
||||
// if something's changed, handle it
|
||||
if (m_flip_screen_x != on || m_flip_screen_y != on)
|
||||
if (m_flip_screen_x != state || m_flip_screen_y != state)
|
||||
{
|
||||
m_flip_screen_x = m_flip_screen_y = on;
|
||||
m_flip_screen_x = m_flip_screen_y = state;
|
||||
updateflip();
|
||||
}
|
||||
}
|
||||
|
@ -333,16 +333,16 @@ void driver_device::flip_screen_set(u32 on)
|
|||
// flip_screen_x_set - set global horizontal flip
|
||||
//-------------------------------------------------
|
||||
|
||||
void driver_device::flip_screen_x_set(u32 on)
|
||||
void driver_device::flip_screen_x_set(int state)
|
||||
{
|
||||
// normalize to all 1
|
||||
if (on)
|
||||
on = ~0;
|
||||
if (state)
|
||||
state = 0xff;
|
||||
|
||||
// if something's changed, handle it
|
||||
if (m_flip_screen_x != on)
|
||||
if (m_flip_screen_x != state)
|
||||
{
|
||||
m_flip_screen_x = on;
|
||||
m_flip_screen_x = state;
|
||||
updateflip();
|
||||
}
|
||||
}
|
||||
|
@ -352,16 +352,16 @@ void driver_device::flip_screen_x_set(u32 on)
|
|||
// flip_screen_y_set - set global vertical flip
|
||||
//-------------------------------------------------
|
||||
|
||||
void driver_device::flip_screen_y_set(u32 on)
|
||||
void driver_device::flip_screen_y_set(int state)
|
||||
{
|
||||
// normalize to all 1
|
||||
if (on)
|
||||
on = ~0;
|
||||
if (state)
|
||||
state = 0xff;
|
||||
|
||||
// if something's changed, handle it
|
||||
if (m_flip_screen_y != on)
|
||||
if (m_flip_screen_y != state)
|
||||
{
|
||||
m_flip_screen_y = on;
|
||||
m_flip_screen_y = state;
|
||||
updateflip();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,12 +163,12 @@ protected:
|
|||
virtual void device_reset_after_children() override;
|
||||
|
||||
// generic video
|
||||
void flip_screen_set(u32 on);
|
||||
void flip_screen_x_set(u32 on);
|
||||
void flip_screen_y_set(u32 on);
|
||||
u32 flip_screen() const { return m_flip_screen_x; }
|
||||
u32 flip_screen_x() const { return m_flip_screen_x; }
|
||||
u32 flip_screen_y() const { return m_flip_screen_y; }
|
||||
void flip_screen_set(int state);
|
||||
void flip_screen_x_set(int state);
|
||||
void flip_screen_y_set(int state);
|
||||
u8 flip_screen() const { return m_flip_screen_x; } // & m_flip_screen_y?
|
||||
u8 flip_screen_x() const { return m_flip_screen_x; }
|
||||
u8 flip_screen_y() const { return m_flip_screen_y; }
|
||||
|
||||
private:
|
||||
// helpers
|
||||
|
|
|
@ -85,7 +85,6 @@ public:
|
|||
void ladybug(machine_config &config);
|
||||
|
||||
protected:
|
||||
DECLARE_WRITE_LINE_MEMBER(flipscreen_w);
|
||||
void ladybug_palette(palette_device &palette) const;
|
||||
u32 screen_update_ladybug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
|
@ -214,15 +213,6 @@ void ladybug_state::ladybug_palette(palette_device &palette) const
|
|||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ladybug_state::flipscreen_w)
|
||||
{
|
||||
if (flip_screen() != state)
|
||||
{
|
||||
flip_screen_set(state);
|
||||
machine().tilemap().mark_all_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
u32 ladybug_state::screen_update_ladybug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
|
@ -703,7 +693,7 @@ void ladybug_state::ladybug(machine_config &config)
|
|||
LADYBUG_VIDEO(config, m_video, 4000000).set_gfxdecode_tag("gfxdecode");
|
||||
|
||||
ls259_device &videolatch(LS259(config, "videolatch")); // L5 on video board or H3 on single board
|
||||
videolatch.q_out_cb<0>().set(FUNC(ladybug_state::flipscreen_w)); // no other outputs used
|
||||
videolatch.q_out_cb<0>().set(FUNC(ladybug_state::flip_screen_set)); // no other outputs used
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
|
|
@ -302,20 +302,14 @@ u32 sraider_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, co
|
|||
|
||||
void mrsdyna_state::io_w(u8 data)
|
||||
{
|
||||
// bit7 = flip
|
||||
// bit6 = grid red
|
||||
// bit5 = grid green
|
||||
// bit4 = grid blue
|
||||
// bit012 = stars speed/dir (not used for mrsdyna)
|
||||
// bit3 = enable stars (not used for mrsdyna)
|
||||
// bit210 = stars speed/dir (not used for mrsdyna)
|
||||
|
||||
if (flip_screen() != (data & 0x80))
|
||||
{
|
||||
flip_screen_set(data & 0x80);
|
||||
machine().tilemap().mark_all_dirty();
|
||||
}
|
||||
|
||||
// bit4 = grid blue
|
||||
// bit5 = grid green
|
||||
// bit6 = grid red
|
||||
// bit7 = flip
|
||||
m_grid_color = data & 0x70;
|
||||
flip_screen_set(data & 0x80);
|
||||
}
|
||||
|
||||
void sraider_state::io_w(u8 data)
|
||||
|
|
|
@ -79,7 +79,6 @@ protected:
|
|||
virtual void video_start() override;
|
||||
|
||||
void videoram_w(offs_t offset, u8 data);
|
||||
DECLARE_WRITE_LINE_MEMBER(flipscreen_w);
|
||||
void irqack_w(u8 data) { m_maincpu->set_input_line(0, CLEAR_LINE); }
|
||||
void star_reset_w(u8 data);
|
||||
template <unsigned N> DECLARE_WRITE_LINE_MEMBER(star_w);
|
||||
|
@ -275,11 +274,6 @@ void redclash_state::background_w(u8 data)
|
|||
m_background = data;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(zerohour_state::flipscreen_w)
|
||||
{
|
||||
flip_screen_set(state);
|
||||
}
|
||||
|
||||
template <unsigned N> WRITE_LINE_MEMBER(zerohour_state::star_w)
|
||||
{
|
||||
m_stars->set_speed(state ? 1 << N : 0, 1U << N);
|
||||
|
@ -773,7 +767,7 @@ void zerohour_state::base(machine_config &config)
|
|||
m_outlatch[1]->q_out_cb<0>().set(FUNC(zerohour_state::star_w<0>));
|
||||
m_outlatch[1]->q_out_cb<5>().set(FUNC(zerohour_state::star_w<1>));
|
||||
m_outlatch[1]->q_out_cb<6>().set(FUNC(zerohour_state::star_w<2>));
|
||||
m_outlatch[1]->q_out_cb<7>().set(FUNC(zerohour_state::flipscreen_w));
|
||||
m_outlatch[1]->q_out_cb<7>().set(FUNC(zerohour_state::flip_screen_set));
|
||||
|
||||
// video hardware
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
|
|
Loading…
Reference in a new issue