summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-08-30 17:19:01 -0400
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-08-30 17:19:01 -0400
commit42726fd92508fe46ca0a8e52ca10a965a797ec3a (patch)
tree78f14b13103224385b4974065c20ccdfc366da46
parentbc0530c9ac7c1c34ae6f8400da6b5a9ff87be8ca (diff)
orca40c: Implement device_video_interface (nw)
-rw-r--r--src/mame/drivers/vastar.cpp6
-rw-r--r--src/mame/drivers/zodiack.cpp6
-rw-r--r--src/mame/video/orca40c.cpp34
-rw-r--r--src/mame/video/orca40c.h12
4 files changed, 34 insertions, 24 deletions
diff --git a/src/mame/drivers/vastar.cpp b/src/mame/drivers/vastar.cpp
index 373516e7bbf..454c01aaa57 100644
--- a/src/mame/drivers/vastar.cpp
+++ b/src/mame/drivers/vastar.cpp
@@ -484,13 +484,15 @@ void dogfightp_state::dogfightp(machine_config &config)
common(config);
m_maincpu->set_addrmap(AS_PROGRAM, &dogfightp_state::dogfightp_main_map);
- m_maincpu->set_vblank_int("videopcb:screen", FUNC(vastar_common_state::vblank_irq));
+ m_maincpu->set_vblank_int("screen", FUNC(vastar_common_state::vblank_irq));
ls259_device &mainlatch(*subdevice<ls259_device>("mainlatch"));
mainlatch.q_out_cb<1>().set("videopcb", FUNC(orca_ovg_40c_device::flipscreen_w));
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
+
orca_ovg_40c_device& videopcb(ORCA_OVG_40C(config, "videopcb", 0));
- videopcb.set_palette("videopcb:palette");
+ videopcb.set_screen("screen");
videopcb.set_percuss_hardware(true);
}
diff --git a/src/mame/drivers/zodiack.cpp b/src/mame/drivers/zodiack.cpp
index b8d34577f7f..53986f7bc82 100644
--- a/src/mame/drivers/zodiack.cpp
+++ b/src/mame/drivers/zodiack.cpp
@@ -510,7 +510,7 @@ void zodiack_state::zodiack(machine_config &config)
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(18'432'000)/6);
m_maincpu->set_addrmap(AS_PROGRAM, &zodiack_state::main_map);
- m_maincpu->set_vblank_int("videopcb:screen", FUNC(zodiack_state::zodiack_main_nmi_gen));
+ m_maincpu->set_vblank_int("screen", FUNC(zodiack_state::zodiack_main_nmi_gen));
m_maincpu->set_periodic_int(FUNC(zodiack_state::irq0_line_hold), attotime::from_hz(1*60)); // sound related - unknown source, timing is guessed
Z80(config, m_audiocpu, XTAL(18'432'000)/6);
@@ -520,8 +520,10 @@ void zodiack_state::zodiack(machine_config &config)
WATCHDOG_TIMER(config, "watchdog");
+ SCREEN(config, "screen", SCREEN_TYPE_RASTER);
+
orca_ovg_40c_device &videopcb(ORCA_OVG_40C(config, "videopcb", 0));
- videopcb.set_palette("videopcb:palette");
+ videopcb.set_screen("screen");
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/video/orca40c.cpp b/src/mame/video/orca40c.cpp
index f0a7149deac..67e446ed661 100644
--- a/src/mame/video/orca40c.cpp
+++ b/src/mame/video/orca40c.cpp
@@ -11,9 +11,11 @@
***************************************************************************/
#include "emu.h"
-#include "screen.h"
#include "video/orca40c.h"
+#include "emupal.h"
+#include "screen.h"
+
#define PIXEL_CLOCK (XTAL(18'432'000)/3)
#define HTOTAL (396)
@@ -28,13 +30,13 @@ DEFINE_DEVICE_TYPE(ORCA_OVG_40C, orca_ovg_40c_device, "orca_ovg_40c", "Orca OVG
orca_ovg_40c_device::orca_ovg_40c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ORCA_OVG_40C, tag, owner, clock),
- device_gfx_interface(mconfig, *this),
+ device_gfx_interface(mconfig, *this, nullptr, "palette"),
+ device_video_interface(mconfig, *this),
m_videoram(*this, "videoram"),
m_videoram_2(*this,"videoram_2"),
m_attributeram(*this, "attributeram"),
m_spriteram(*this, "spriteram"),
m_bulletsram(*this, "bulletsram"),
- m_palette(*this, "palette"),
m_percuss_hardware(false),
m_flip_screen(false)
{
@@ -216,7 +218,7 @@ TILE_GET_INFO_MEMBER(orca_ovg_40c_device::get_fg_tile_info)
SET_TILE_INFO_MEMBER(3, code, color, 0);
}
-void orca_ovg_40c_device::draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void orca_ovg_40c_device::draw_bullets( bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
for (int offs = 0; offs < m_bulletsram.bytes(); offs += 4)
{
@@ -236,7 +238,7 @@ void orca_ovg_40c_device::draw_bullets( bitmap_ind16 &bitmap, const rectangle &c
}
}
-void orca_ovg_40c_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void orca_ovg_40c_device::draw_sprites( bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
@@ -260,7 +262,7 @@ void orca_ovg_40c_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &c
}
}
-uint32_t orca_ovg_40c_device::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
+uint32_t orca_ovg_40c_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
for (int i = 0; i < 32; i++)
m_fg_tilemap->set_scrolly(i, m_attributeram[i * 2]);
@@ -272,13 +274,19 @@ uint32_t orca_ovg_40c_device::screen_update( screen_device &screen, bitmap_ind16
return 0;
}
-void orca_ovg_40c_device::device_add_mconfig(machine_config &config)
+void orca_ovg_40c_device::device_config_complete()
{
- /* video hardware */
- screen_device& screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
- screen.set_screen_update(DEVICE_SELF, FUNC(orca_ovg_40c_device::screen_update));
- screen.set_palette("palette");
+ if (!has_screen())
+ return;
+
+ if (!screen().refresh_attoseconds())
+ screen().set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
- PALETTE(config, m_palette, FUNC(orca_ovg_40c_device::palette_init), 4*8+2*8+2*1, 48+1);
+ if (!screen().has_screen_update())
+ screen().set_screen_update(screen_update_rgb32_delegate(FUNC(orca_ovg_40c_device::screen_update), this));
+}
+
+void orca_ovg_40c_device::device_add_mconfig(machine_config &config)
+{
+ PALETTE(config, "palette", FUNC(orca_ovg_40c_device::palette_init), 4*8+2*8+2*1, 48+1);
}
diff --git a/src/mame/video/orca40c.h b/src/mame/video/orca40c.h
index 4bef1695096..25f333f230e 100644
--- a/src/mame/video/orca40c.h
+++ b/src/mame/video/orca40c.h
@@ -22,7 +22,7 @@
// ======================> orca_ovg_40c_device
-class orca_ovg_40c_device : public device_t, public device_gfx_interface
+class orca_ovg_40c_device : public device_t, public device_gfx_interface, public device_video_interface
{
public:
// construction/destruction
@@ -40,6 +40,7 @@ public:
protected:
// device-level overrides
virtual void device_start() override;
+ virtual void device_config_complete() override;
virtual void device_add_mconfig(machine_config &config) override;
private:
@@ -50,9 +51,6 @@ private:
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_bulletsram;
- // devices
- required_device<palette_device> m_palette;
-
// configuration
bool m_percuss_hardware;
@@ -70,9 +68,9 @@ private:
void palette_init(palette_device &palette);
// drawing control
- void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect);
- void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_bullets(bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};
// device type definition