From be47eccbb30ad90d1f0cbdfa4e1c1e45bb1539b2 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Thu, 6 Dec 2018 15:18:29 +0100 Subject: midtunit.cpp: Added an optional DMA-blitter viewer behind a #define. [Ryan Holtz] --- src/mame/drivers/midtunit.cpp | 1 + src/mame/drivers/midwunit.cpp | 1 + src/mame/drivers/midxunit.cpp | 1 + src/mame/video/midtunit.cpp | 17 ++- src/mame/video/midtunit.h | 25 +++- src/mame/video/midtunit.hxx | 143 --------------------- src/mame/video/midtunit.ipp | 143 +++++++++++++++++++++ src/mame/video/midtview.ipp | 280 ++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 464 insertions(+), 147 deletions(-) delete mode 100644 src/mame/video/midtunit.hxx create mode 100644 src/mame/video/midtunit.ipp create mode 100644 src/mame/video/midtview.ipp diff --git a/src/mame/drivers/midtunit.cpp b/src/mame/drivers/midtunit.cpp index 882c72a4794..2b2db8280b7 100644 --- a/src/mame/drivers/midtunit.cpp +++ b/src/mame/drivers/midtunit.cpp @@ -604,6 +604,7 @@ void midtunit_state::tunit_core(machine_config &config) m_maincpu->set_scanline_ind16_callback("video", FUNC(midtunit_video_device::scanline_update)); /* scanline updater (indexed16) */ m_maincpu->set_shiftreg_in_callback("video", FUNC(midtunit_video_device::to_shiftreg)); /* write to shiftreg function */ m_maincpu->set_shiftreg_out_callback("video", FUNC(midtunit_video_device::from_shiftreg)); /* read from shiftreg function */ + m_maincpu->set_screen("screen"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/drivers/midwunit.cpp b/src/mame/drivers/midwunit.cpp index b98b260bc34..60a34efc8fd 100644 --- a/src/mame/drivers/midwunit.cpp +++ b/src/mame/drivers/midwunit.cpp @@ -636,6 +636,7 @@ void midwunit_state::wunit(machine_config &config) m_maincpu->set_scanline_ind16_callback("video", FUNC(midtunit_video_device::scanline_update)); /* scanline updater (indexed16) */ m_maincpu->set_shiftreg_in_callback("video", FUNC(midtunit_video_device::to_shiftreg)); /* write to shiftreg function */ m_maincpu->set_shiftreg_out_callback("video", FUNC(midtunit_video_device::from_shiftreg)); /* read from shiftreg function */ + m_maincpu->set_screen("screen"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/drivers/midxunit.cpp b/src/mame/drivers/midxunit.cpp index 3420dd2c730..c6d7ab3fa24 100644 --- a/src/mame/drivers/midxunit.cpp +++ b/src/mame/drivers/midxunit.cpp @@ -254,6 +254,7 @@ void midxunit_state::midxunit(machine_config &config) m_maincpu->set_scanline_ind16_callback("video", FUNC(midxunit_video_device::scanline_update)); /* scanline updater (indexed16) */ m_maincpu->set_shiftreg_in_callback("video", FUNC(midxunit_video_device::to_shiftreg)); /* write to shiftreg function */ m_maincpu->set_shiftreg_out_callback("video", FUNC(midtunit_video_device::from_shiftreg)); /* read from shiftreg function */ + m_maincpu->set_screen("screen"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/video/midtunit.cpp b/src/mame/video/midtunit.cpp index cb2df663e4b..6da22567b83 100644 --- a/src/mame/video/midtunit.cpp +++ b/src/mame/video/midtunit.cpp @@ -9,7 +9,9 @@ #include "emu.h" #include "midtunit.h" -#include "midtunit.hxx" +#include "midtunit.ipp" +#include "midtview.ipp" +#include "screen.h" DEFINE_DEVICE_TYPE(MIDTUNIT_VIDEO, midtunit_video_device, "tunitvid", "Midway T-Unit Video") DEFINE_DEVICE_TYPE(MIDWUNIT_VIDEO, midwunit_video_device, "wunitvid", "Midway W-Unit Video") @@ -23,6 +25,9 @@ midtunit_video_device::midtunit_video_device(const machine_config &mconfig, devi , m_maincpu(*this, finder_base::DUMMY_TAG) , m_palette(*this, finder_base::DUMMY_TAG) , m_gfxrom(*this, finder_base::DUMMY_TAG) +#if DEBUG_MIDTUNIT_BLITTER + , m_debug_palette(*this, "debugpalette") +#endif { } @@ -57,6 +62,10 @@ void midtunit_video_device::device_start() /* allocate memory */ m_local_videoram = std::make_unique(0x100000/2); +#if DEBUG_MIDTUNIT_BLITTER + m_debug_videoram = std::make_unique(0x100000/2); +#endif + m_dma_timer = timer_alloc(TIMER_DMA); /* reset all the globals */ @@ -88,7 +97,6 @@ void midwunit_video_device::device_start() m_gfx_rom_large = true; } - void midxunit_video_device::device_start() { midtunit_video_device::device_start(); @@ -364,7 +372,11 @@ void midtunit_video_device::dma_draw() width = (m_dma_state.width - m_dma_state.endskip) << 8; /* determine destination pointer */ +#if DEBUG_MIDTUNIT_BLITTER + d = m_doing_debug_dma ? &m_debug_videoram[sy * 512] : &m_local_videoram[sy * 512]; +#else d = &m_local_videoram[sy * 512]; +#endif /* loop until we draw the entire width */ while (ix < width) @@ -606,7 +618,6 @@ WRITE16_MEMBER(midtunit_video_device::midtunit_dma_w) /* fill in the rev 2 data */ m_dma_state.yflip = (command & 0x20) >> 5; - m_dma_state.bpp = bpp; m_dma_state.preskip = (command >> 8) & 3; m_dma_state.postskip = (command >> 10) & 3; m_dma_state.xstep = m_dma_register[DMA_SCALE_X] ? m_dma_register[DMA_SCALE_X] : 0x100; diff --git a/src/mame/video/midtunit.h b/src/mame/video/midtunit.h index 489a2e5906b..69cdec0cd3f 100644 --- a/src/mame/video/midtunit.h +++ b/src/mame/video/midtunit.h @@ -16,6 +16,8 @@ #include "cpu/tms34010/tms34010.h" #include "emupal.h" +#define DEBUG_MIDTUNIT_BLITTER (0) + class midtunit_video_device : public device_t { public: @@ -132,7 +134,6 @@ protected: uint16_t color; /* current foreground color with palette */ uint8_t yflip; /* yflip? */ - uint8_t bpp; /* bits per pixel */ uint8_t preskip; /* preskip scale */ uint8_t postskip; /* postskip scale */ int32_t topclip; /* top clipping scanline */ @@ -145,6 +146,25 @@ protected: uint16_t ystep; /* 8.8 fixed number scale y factor */ }; dma_state m_dma_state; + +#if DEBUG_MIDTUNIT_BLITTER + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + uint32_t debug_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void do_debug_blit(); + void do_dma_debug_inputs(); + + required_device m_debug_palette; + std::unique_ptr m_debug_videoram; + bool m_dma_debug; + bool m_doing_debug_dma; + dma_state m_debug_dma_state; + int32_t m_debug_dma_bpp; + int32_t m_debug_dma_mode; + int32_t m_debug_dma_command; +#endif }; class midwunit_video_device : public midtunit_video_device @@ -170,6 +190,9 @@ protected: midwunit_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock = 0); virtual void device_start() override; +#if DEBUG_MIDTUNIT_BLITTER + virtual void device_add_mconfig(machine_config &config) override; +#endif }; class midxunit_video_device : public midwunit_video_device diff --git a/src/mame/video/midtunit.hxx b/src/mame/video/midtunit.hxx deleted file mode 100644 index 690afa6646b..00000000000 --- a/src/mame/video/midtunit.hxx +++ /dev/null @@ -1,143 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Alex Pasadyn, Zsolt Vasvari, Ernesto Corvi, Aaron Giles -// thanks-to:Kurt Mahan -/************************************************************************* - - #defines related to the video emulation of Midway T-unit, W-unit, - and X-unit games. - -**************************************************************************/ - -#define INIT_TEMPLATED_DMA_DRAW(dest, i, xflip, skip, scale, zero, nonzero) \ - dest[i+0] = &midtunit_video_device::dma_draw<8, xflip, skip, scale, zero, nonzero>; \ - dest[i+1] = &midtunit_video_device::dma_draw<1, xflip, skip, scale, zero, nonzero>; \ - dest[i+2] = &midtunit_video_device::dma_draw<2, xflip, skip, scale, zero, nonzero>; \ - dest[i+3] = &midtunit_video_device::dma_draw<3, xflip, skip, scale, zero, nonzero>; \ - dest[i+4] = &midtunit_video_device::dma_draw<4, xflip, skip, scale, zero, nonzero>; \ - dest[i+5] = &midtunit_video_device::dma_draw<5, xflip, skip, scale, zero, nonzero>; \ - dest[i+6] = &midtunit_video_device::dma_draw<6, xflip, skip, scale, zero, nonzero>; \ - dest[i+7] = &midtunit_video_device::dma_draw<7, xflip, skip, scale, zero, nonzero>; - -#define TEMPLATED_DMA_DRAW_NONE(dest, i) \ - dest[i+0] = &midtunit_video_device::dma_draw_none; \ - dest[i+1] = &midtunit_video_device::dma_draw_none; \ - dest[i+2] = &midtunit_video_device::dma_draw_none; \ - dest[i+3] = &midtunit_video_device::dma_draw_none; \ - dest[i+4] = &midtunit_video_device::dma_draw_none; \ - dest[i+5] = &midtunit_video_device::dma_draw_none; \ - dest[i+6] = &midtunit_video_device::dma_draw_none; \ - dest[i+7] = &midtunit_video_device::dma_draw_none; - -#define TEMPLATED_DMA_DRAW_P0(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COPY, PIXEL_SKIP) -#define TEMPLATED_DMA_DRAW_P1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_SKIP, PIXEL_COPY) -#define TEMPLATED_DMA_DRAW_C0(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COLOR, PIXEL_SKIP) -#define TEMPLATED_DMA_DRAW_C1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_SKIP, PIXEL_COLOR) -#define TEMPLATED_DMA_DRAW_P0P1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COPY, PIXEL_COPY) -#define TEMPLATED_DMA_DRAW_C0C1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COLOR, PIXEL_COLOR) -#define TEMPLATED_DMA_DRAW_C0P1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COLOR, PIXEL_COPY) -#define TEMPLATED_DMA_DRAW_P0C1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COPY, PIXEL_COLOR) - -#define TEMPLATED_DMA_DRAW_P0_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COPY, PIXEL_SKIP) -#define TEMPLATED_DMA_DRAW_P1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_SKIP, PIXEL_COPY) -#define TEMPLATED_DMA_DRAW_C0_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COLOR, PIXEL_SKIP) -#define TEMPLATED_DMA_DRAW_C1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_SKIP, PIXEL_COLOR) -#define TEMPLATED_DMA_DRAW_P0P1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COPY, PIXEL_COPY) -#define TEMPLATED_DMA_DRAW_C0C1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COLOR, PIXEL_COLOR) -#define TEMPLATED_DMA_DRAW_C0P1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COLOR, PIXEL_COPY) -#define TEMPLATED_DMA_DRAW_P0C1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COPY, PIXEL_COLOR) - -#define INIT_TEMPLATED_DMA_DRAW_GROUP(dest, skip, scale) \ - TEMPLATED_DMA_DRAW_NONE(dest, 0); \ - TEMPLATED_DMA_DRAW_P0(dest, 8, skip, scale); \ - TEMPLATED_DMA_DRAW_P1(dest, 16, skip, scale); \ - TEMPLATED_DMA_DRAW_P0P1(dest, 24, skip, scale); \ - TEMPLATED_DMA_DRAW_C0(dest, 32, skip, scale); \ - TEMPLATED_DMA_DRAW_C0(dest, 40, skip, scale); \ - TEMPLATED_DMA_DRAW_C0P1(dest, 48, skip, scale); \ - TEMPLATED_DMA_DRAW_C0P1(dest, 56, skip, scale); \ - TEMPLATED_DMA_DRAW_C1(dest, 64, skip, scale); \ - TEMPLATED_DMA_DRAW_P0C1(dest, 72, skip, scale); \ - TEMPLATED_DMA_DRAW_C1(dest, 80, skip, scale); \ - TEMPLATED_DMA_DRAW_P0C1(dest, 88, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1(dest, 96, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1(dest, 104, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1(dest, 112, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1(dest, 120, skip, scale); \ - TEMPLATED_DMA_DRAW_NONE(dest, 128); \ - TEMPLATED_DMA_DRAW_P0_XF(dest, 136, skip, scale); \ - TEMPLATED_DMA_DRAW_P1_XF(dest, 144, skip, scale); \ - TEMPLATED_DMA_DRAW_P0P1_XF(dest, 152, skip, scale); \ - TEMPLATED_DMA_DRAW_C0_XF(dest, 160, skip, scale); \ - TEMPLATED_DMA_DRAW_C0_XF(dest, 168, skip, scale); \ - TEMPLATED_DMA_DRAW_C0P1_XF(dest, 176, skip, scale); \ - TEMPLATED_DMA_DRAW_C0P1_XF(dest, 184, skip, scale); \ - TEMPLATED_DMA_DRAW_C1_XF(dest, 192, skip, scale); \ - TEMPLATED_DMA_DRAW_P0C1_XF(dest, 200, skip, scale); \ - TEMPLATED_DMA_DRAW_C1_XF(dest, 208, skip, scale); \ - TEMPLATED_DMA_DRAW_P0C1_XF(dest, 216, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1_XF(dest, 224, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1_XF(dest, 232, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1_XF(dest, 240, skip, scale); \ - TEMPLATED_DMA_DRAW_C0C1_XF(dest, 248, skip, scale); - -#define DEFINE_TEMPLATED_DMA_DRAW(xflip, skip, scale, zero, nonzero) \ - template void midtunit_video_device::dma_draw<8, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<1, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<2, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<3, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<4, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<5, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<6, xflip, skip, scale, zero, nonzero>(); \ - template void midtunit_video_device::dma_draw<7, xflip, skip, scale, zero, nonzero>(); - -#define DEFINE_TEMPLATED_DMA_DRAW_P0(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_SKIP) -#define DEFINE_TEMPLATED_DMA_DRAW_P1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COPY) -#define DEFINE_TEMPLATED_DMA_DRAW_C0(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_SKIP) -#define DEFINE_TEMPLATED_DMA_DRAW_C1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COLOR) -#define DEFINE_TEMPLATED_DMA_DRAW_P0P1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COPY) -#define DEFINE_TEMPLATED_DMA_DRAW_C0C1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COLOR) -#define DEFINE_TEMPLATED_DMA_DRAW_C0P1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COPY) -#define DEFINE_TEMPLATED_DMA_DRAW_P0C1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COLOR) - -#define DEFINE_TEMPLATED_DMA_DRAW_P0_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_SKIP) -#define DEFINE_TEMPLATED_DMA_DRAW_P1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COPY) -#define DEFINE_TEMPLATED_DMA_DRAW_C0_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_SKIP) -#define DEFINE_TEMPLATED_DMA_DRAW_C1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COLOR) -#define DEFINE_TEMPLATED_DMA_DRAW_P0P1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COPY) -#define DEFINE_TEMPLATED_DMA_DRAW_C0C1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COLOR) -#define DEFINE_TEMPLATED_DMA_DRAW_C0P1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COPY) -#define DEFINE_TEMPLATED_DMA_DRAW_P0C1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COLOR) - -#define DEFINE_TEMPLATED_DMA_DRAW_GROUP(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P0(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C0(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P0P1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C0C1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C0P1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P0C1(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P0_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C0_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P0P1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C0C1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_C0P1_XF(skip, scale) \ - DEFINE_TEMPLATED_DMA_DRAW_P0C1_XF(skip, scale) diff --git a/src/mame/video/midtunit.ipp b/src/mame/video/midtunit.ipp new file mode 100644 index 00000000000..690afa6646b --- /dev/null +++ b/src/mame/video/midtunit.ipp @@ -0,0 +1,143 @@ +// license:BSD-3-Clause +// copyright-holders:Alex Pasadyn, Zsolt Vasvari, Ernesto Corvi, Aaron Giles +// thanks-to:Kurt Mahan +/************************************************************************* + + #defines related to the video emulation of Midway T-unit, W-unit, + and X-unit games. + +**************************************************************************/ + +#define INIT_TEMPLATED_DMA_DRAW(dest, i, xflip, skip, scale, zero, nonzero) \ + dest[i+0] = &midtunit_video_device::dma_draw<8, xflip, skip, scale, zero, nonzero>; \ + dest[i+1] = &midtunit_video_device::dma_draw<1, xflip, skip, scale, zero, nonzero>; \ + dest[i+2] = &midtunit_video_device::dma_draw<2, xflip, skip, scale, zero, nonzero>; \ + dest[i+3] = &midtunit_video_device::dma_draw<3, xflip, skip, scale, zero, nonzero>; \ + dest[i+4] = &midtunit_video_device::dma_draw<4, xflip, skip, scale, zero, nonzero>; \ + dest[i+5] = &midtunit_video_device::dma_draw<5, xflip, skip, scale, zero, nonzero>; \ + dest[i+6] = &midtunit_video_device::dma_draw<6, xflip, skip, scale, zero, nonzero>; \ + dest[i+7] = &midtunit_video_device::dma_draw<7, xflip, skip, scale, zero, nonzero>; + +#define TEMPLATED_DMA_DRAW_NONE(dest, i) \ + dest[i+0] = &midtunit_video_device::dma_draw_none; \ + dest[i+1] = &midtunit_video_device::dma_draw_none; \ + dest[i+2] = &midtunit_video_device::dma_draw_none; \ + dest[i+3] = &midtunit_video_device::dma_draw_none; \ + dest[i+4] = &midtunit_video_device::dma_draw_none; \ + dest[i+5] = &midtunit_video_device::dma_draw_none; \ + dest[i+6] = &midtunit_video_device::dma_draw_none; \ + dest[i+7] = &midtunit_video_device::dma_draw_none; + +#define TEMPLATED_DMA_DRAW_P0(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COPY, PIXEL_SKIP) +#define TEMPLATED_DMA_DRAW_P1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_SKIP, PIXEL_COPY) +#define TEMPLATED_DMA_DRAW_C0(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COLOR, PIXEL_SKIP) +#define TEMPLATED_DMA_DRAW_C1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_SKIP, PIXEL_COLOR) +#define TEMPLATED_DMA_DRAW_P0P1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COPY, PIXEL_COPY) +#define TEMPLATED_DMA_DRAW_C0C1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COLOR, PIXEL_COLOR) +#define TEMPLATED_DMA_DRAW_C0P1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COLOR, PIXEL_COPY) +#define TEMPLATED_DMA_DRAW_P0C1(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, false, skip, scale, PIXEL_COPY, PIXEL_COLOR) + +#define TEMPLATED_DMA_DRAW_P0_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COPY, PIXEL_SKIP) +#define TEMPLATED_DMA_DRAW_P1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_SKIP, PIXEL_COPY) +#define TEMPLATED_DMA_DRAW_C0_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COLOR, PIXEL_SKIP) +#define TEMPLATED_DMA_DRAW_C1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_SKIP, PIXEL_COLOR) +#define TEMPLATED_DMA_DRAW_P0P1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COPY, PIXEL_COPY) +#define TEMPLATED_DMA_DRAW_C0C1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COLOR, PIXEL_COLOR) +#define TEMPLATED_DMA_DRAW_C0P1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COLOR, PIXEL_COPY) +#define TEMPLATED_DMA_DRAW_P0C1_XF(dest, i, skip, scale) INIT_TEMPLATED_DMA_DRAW(dest, i, true, skip, scale, PIXEL_COPY, PIXEL_COLOR) + +#define INIT_TEMPLATED_DMA_DRAW_GROUP(dest, skip, scale) \ + TEMPLATED_DMA_DRAW_NONE(dest, 0); \ + TEMPLATED_DMA_DRAW_P0(dest, 8, skip, scale); \ + TEMPLATED_DMA_DRAW_P1(dest, 16, skip, scale); \ + TEMPLATED_DMA_DRAW_P0P1(dest, 24, skip, scale); \ + TEMPLATED_DMA_DRAW_C0(dest, 32, skip, scale); \ + TEMPLATED_DMA_DRAW_C0(dest, 40, skip, scale); \ + TEMPLATED_DMA_DRAW_C0P1(dest, 48, skip, scale); \ + TEMPLATED_DMA_DRAW_C0P1(dest, 56, skip, scale); \ + TEMPLATED_DMA_DRAW_C1(dest, 64, skip, scale); \ + TEMPLATED_DMA_DRAW_P0C1(dest, 72, skip, scale); \ + TEMPLATED_DMA_DRAW_C1(dest, 80, skip, scale); \ + TEMPLATED_DMA_DRAW_P0C1(dest, 88, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1(dest, 96, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1(dest, 104, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1(dest, 112, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1(dest, 120, skip, scale); \ + TEMPLATED_DMA_DRAW_NONE(dest, 128); \ + TEMPLATED_DMA_DRAW_P0_XF(dest, 136, skip, scale); \ + TEMPLATED_DMA_DRAW_P1_XF(dest, 144, skip, scale); \ + TEMPLATED_DMA_DRAW_P0P1_XF(dest, 152, skip, scale); \ + TEMPLATED_DMA_DRAW_C0_XF(dest, 160, skip, scale); \ + TEMPLATED_DMA_DRAW_C0_XF(dest, 168, skip, scale); \ + TEMPLATED_DMA_DRAW_C0P1_XF(dest, 176, skip, scale); \ + TEMPLATED_DMA_DRAW_C0P1_XF(dest, 184, skip, scale); \ + TEMPLATED_DMA_DRAW_C1_XF(dest, 192, skip, scale); \ + TEMPLATED_DMA_DRAW_P0C1_XF(dest, 200, skip, scale); \ + TEMPLATED_DMA_DRAW_C1_XF(dest, 208, skip, scale); \ + TEMPLATED_DMA_DRAW_P0C1_XF(dest, 216, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1_XF(dest, 224, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1_XF(dest, 232, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1_XF(dest, 240, skip, scale); \ + TEMPLATED_DMA_DRAW_C0C1_XF(dest, 248, skip, scale); + +#define DEFINE_TEMPLATED_DMA_DRAW(xflip, skip, scale, zero, nonzero) \ + template void midtunit_video_device::dma_draw<8, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<1, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<2, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<3, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<4, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<5, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<6, xflip, skip, scale, zero, nonzero>(); \ + template void midtunit_video_device::dma_draw<7, xflip, skip, scale, zero, nonzero>(); + +#define DEFINE_TEMPLATED_DMA_DRAW_P0(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_SKIP) +#define DEFINE_TEMPLATED_DMA_DRAW_P1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COPY) +#define DEFINE_TEMPLATED_DMA_DRAW_C0(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_SKIP) +#define DEFINE_TEMPLATED_DMA_DRAW_C1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COLOR) +#define DEFINE_TEMPLATED_DMA_DRAW_P0P1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COPY) +#define DEFINE_TEMPLATED_DMA_DRAW_C0C1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COLOR) +#define DEFINE_TEMPLATED_DMA_DRAW_C0P1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COPY) +#define DEFINE_TEMPLATED_DMA_DRAW_P0C1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(false, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COLOR) + +#define DEFINE_TEMPLATED_DMA_DRAW_P0_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_SKIP) +#define DEFINE_TEMPLATED_DMA_DRAW_P1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COPY) +#define DEFINE_TEMPLATED_DMA_DRAW_C0_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_SKIP) +#define DEFINE_TEMPLATED_DMA_DRAW_C1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_SKIP, midtunit_video_device::PIXEL_COLOR) +#define DEFINE_TEMPLATED_DMA_DRAW_P0P1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COPY) +#define DEFINE_TEMPLATED_DMA_DRAW_C0C1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COLOR) +#define DEFINE_TEMPLATED_DMA_DRAW_C0P1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COLOR, midtunit_video_device::PIXEL_COPY) +#define DEFINE_TEMPLATED_DMA_DRAW_P0C1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW(true, skip, scale, midtunit_video_device::PIXEL_COPY, midtunit_video_device::PIXEL_COLOR) + +#define DEFINE_TEMPLATED_DMA_DRAW_GROUP(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P0(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C0(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P0P1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C0C1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C0P1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P0C1(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P0_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C0_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P0P1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C0C1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_C0P1_XF(skip, scale) \ + DEFINE_TEMPLATED_DMA_DRAW_P0C1_XF(skip, scale) diff --git a/src/mame/video/midtview.ipp b/src/mame/video/midtview.ipp new file mode 100644 index 00000000000..02da31bf928 --- /dev/null +++ b/src/mame/video/midtview.ipp @@ -0,0 +1,280 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/************************************************************************* + + DMA-Blitter Viewer for Midway T-unit, W-unit, and X-unit games. + +**************************************************************************/ + +#if DEBUG_MIDTUNIT_BLITTER +void midtunit_video_device::device_reset() +{ + m_dma_debug = false; + m_doing_debug_dma = false; + memset(&m_debug_dma_state, 0, sizeof(dma_state)); + m_debug_dma_state.gfxrom = m_gfxrom->base(); + m_debug_dma_state.offset = 0; + m_debug_dma_state.rowbits = 0; + m_debug_dma_state.width = 256; + m_debug_dma_state.height = 256; + m_debug_dma_state.palette = 0x0100; + m_debug_dma_state.color = 0x0001; + m_debug_dma_state.yflip = 0; + + m_debug_dma_state.xpos = 0; + m_debug_dma_state.ypos = 0; + m_debug_dma_state.preskip = 0; + m_debug_dma_state.postskip = 0; + m_debug_dma_state.topclip = 0; + m_debug_dma_state.botclip = 0xffff; + m_debug_dma_state.leftclip = 0; + m_debug_dma_state.rightclip = 0xffff; + m_debug_dma_state.startskip = 0; + m_debug_dma_state.endskip = 0; + m_debug_dma_state.xstep = 0x100; + m_debug_dma_state.ystep = 0x100; + + m_debug_dma_bpp = 0; + m_debug_dma_mode = 1; + m_debug_dma_command = 0; +} + +void midtunit_video_device::device_add_mconfig(machine_config &config) +{ + screen_device &debugscreen(SCREEN(config, "debugscreen", SCREEN_TYPE_RASTER)); + debugscreen.set_raw(8000000 * 2, 506, 100, 500, 289, 20, 274); + debugscreen.set_screen_update(FUNC(midtunit_video_device::debug_screen_update)); + + PALETTE(config, m_debug_palette, 32768).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); +} + +void midwunit_video_device::device_add_mconfig(machine_config &config) +{ + screen_device &debugscreen(SCREEN(config, "debugscreen", SCREEN_TYPE_RASTER)); + debugscreen.set_raw(8000000, 506, 101, 501, 289, 20, 274); + debugscreen.set_screen_update(FUNC(midwunit_video_device::debug_screen_update)); + + PALETTE(config, m_debug_palette, 32768).set_format(PALETTE_FORMAT_xRRRRRGGGGGBBBBB); +} + +void midtunit_video_device::do_debug_blit() +{ + m_dma_state = m_debug_dma_state; + m_debug_dma_command = m_debug_dma_mode * 8 + m_debug_dma_bpp; + m_doing_debug_dma = true; + memset(&m_debug_videoram[0], 0, 0x100000); + ((this)->*(m_dma_draw_noskip_noscale[m_debug_dma_command]))(); + m_doing_debug_dma = false; +} + +void midtunit_video_device::do_dma_debug_inputs() +{ + static const char* const mode_strs[0x20] = { + "None", "P0", "P1", "P0P1", "C0", "C0", "C0P1", "C0P1", "C1", "P0C1", "C1", "P0C1", "C0C1", "C0C1", "C0C1", "C0C1", + "None", "P0F", "P1F", "P0P1F", "C0F", "C0F", "C0P1F", "C0P1F", "C1F", "P0C1F", "C1F", "P0C1F", "C0C1F", "C0C1F", "C0C1F", "C0C1F" + }; + + bool do_blit = false; + if (machine().input().code_pressed_once(KEYCODE_M)) + { + m_dma_debug = !m_dma_debug; + if (m_dma_debug) + { + for (pen_t i = 0; i < 32768; i++) + { + m_debug_palette->set_pen_color(i, m_palette->pen_color(i)); + } + do_blit = true; + } + } + else if (machine().input().code_pressed_once(KEYCODE_O)) + { + m_debug_dma_state.rowbits++; + do_blit = true; + popmessage("DMA RowBits: %d", m_debug_dma_state.rowbits); + } + else if (machine().input().code_pressed_once(KEYCODE_U)) + { + m_debug_dma_state.rowbits--; + if (m_debug_dma_state.rowbits < 0) + m_debug_dma_state.rowbits = 0; + else + do_blit = true; + popmessage("DMA RowBits: %d", m_debug_dma_state.rowbits); + } + else if (machine().input().code_pressed_once(KEYCODE_PGDN)) + { + m_debug_dma_state.offset += 0x10000; + do_blit = true; + popmessage("DMA Offset: %08x", m_debug_dma_state.offset); + } + else if (machine().input().code_pressed_once(KEYCODE_PGUP)) + { + uint32_t old_offset = m_debug_dma_state.offset; + m_debug_dma_state.offset -= 0x10000; + if (old_offset < m_debug_dma_state.offset) + m_debug_dma_state.offset = 0; + else + do_blit = true; + popmessage("DMA Offset: %08x", m_debug_dma_state.offset); + } + else if (machine().input().code_pressed_once(KEYCODE_END)) + { + m_debug_dma_state.offset += 0x100; + do_blit = true; + popmessage("DMA Offset: %08x", m_debug_dma_state.offset); + } + else if (machine().input().code_pressed_once(KEYCODE_HOME)) + { + uint32_t old_offset = m_debug_dma_state.offset; + m_debug_dma_state.offset -= 0x100; + if (old_offset < m_debug_dma_state.offset) + m_debug_dma_state.offset = 0; + else + do_blit = true; + popmessage("DMA Offset: %08x", m_debug_dma_state.offset); + } + else if (machine().input().code_pressed_once(KEYCODE_DEL)) + { + m_debug_dma_state.offset++; + do_blit = true; + popmessage("DMA Offset: %08x", m_debug_dma_state.offset); + } + else if (machine().input().code_pressed_once(KEYCODE_INSERT)) + { + uint32_t old_offset = m_debug_dma_state.offset; + m_debug_dma_state.offset--; + if (old_offset < m_debug_dma_state.offset) + m_debug_dma_state.offset = 0; + else + do_blit = true; + popmessage("DMA Offset: %08x", m_debug_dma_state.offset); + } + else if (machine().input().code_pressed_once(KEYCODE_RIGHT)) + { + m_debug_dma_state.width += machine().input().code_pressed(KEYCODE_LCONTROL) ? 16 : 1; + if (m_debug_dma_state.width > 512) + m_debug_dma_state.width = 512; + else + do_blit = true; + popmessage("DMA Width: %d", m_debug_dma_state.width); + } + else if (machine().input().code_pressed_once(KEYCODE_LEFT)) + { + m_debug_dma_state.width -= machine().input().code_pressed(KEYCODE_LCONTROL) ? 16 : 1; + if (m_debug_dma_state.width < 0) + m_debug_dma_state.width = 0; + else + do_blit = true; + popmessage("DMA Width: %d", m_debug_dma_state.width); + } + else if (machine().input().code_pressed_once(KEYCODE_UP)) + { + m_debug_dma_state.height += machine().input().code_pressed(KEYCODE_LCONTROL) ? 16 : 1; + if (m_debug_dma_state.height > 512) + m_debug_dma_state.height = 512; + else + do_blit = true; + popmessage("DMA Height: %d", m_debug_dma_state.height); + } + else if (machine().input().code_pressed_once(KEYCODE_DOWN)) + { + m_debug_dma_state.height -= machine().input().code_pressed(KEYCODE_LCONTROL) ? 16 : 1; + if (m_debug_dma_state.height < 0) + m_debug_dma_state.height = 0; + else + do_blit = true; + popmessage("DMA Height: %d", m_debug_dma_state.height); + } + else if (machine().input().code_pressed_once(KEYCODE_I)) + { + m_debug_dma_state.palette += 0x0100; + do_blit = true; + popmessage("DMA Palette: %04x", m_debug_dma_state.palette); + } + else if (machine().input().code_pressed_once(KEYCODE_K)) + { + m_debug_dma_state.palette -= 0x0100; + do_blit = true; + popmessage("DMA Palette: %04x", m_debug_dma_state.palette); + } + else if (machine().input().code_pressed_once(KEYCODE_L)) + { + m_debug_dma_state.color++; + if (m_debug_dma_state.color == 0x0100) + m_debug_dma_state.color = 0; + do_blit = true; + popmessage("DMA Color: %02x", m_debug_dma_state.color); + } + else if (machine().input().code_pressed_once(KEYCODE_J)) + { + m_debug_dma_state.color--; + if (m_debug_dma_state.color == 0xffff) + m_debug_dma_state.color = 0x00ff; + do_blit = true; + popmessage("DMA Color: %02x", m_debug_dma_state.color); + } + else if (machine().input().code_pressed_once(KEYCODE_H)) + { + m_debug_dma_bpp++; + if (m_debug_dma_bpp > 7) + m_debug_dma_bpp = 7; + else + do_blit = true; + popmessage("DMA BitsPerPixel: %d", m_debug_dma_bpp ? m_debug_dma_bpp : 8); + } + else if (machine().input().code_pressed_once(KEYCODE_G)) + { + m_debug_dma_bpp--; + if (m_debug_dma_bpp < 0) + m_debug_dma_bpp = 0; + else + do_blit = true; + popmessage("DMA BitsPerPixel: %d", m_debug_dma_bpp ? m_debug_dma_bpp : 8); + } + else if (machine().input().code_pressed_once(KEYCODE_Y)) + { + m_debug_dma_mode++; + if (m_debug_dma_mode > 0x1f) + m_debug_dma_mode = 0x1f; + else + do_blit = true; + popmessage("DMA Mode: %s (%02x)", mode_strs[m_debug_dma_mode], m_debug_dma_mode); + } + else if (machine().input().code_pressed_once(KEYCODE_T)) + { + m_debug_dma_mode--; + if (m_debug_dma_mode < 0) + m_debug_dma_mode = 0; + else + do_blit = true; + popmessage("DMA Mode: %s (%02x)", mode_strs[m_debug_dma_mode], m_debug_dma_mode); + } + else if (machine().input().code_pressed_once(KEYCODE_F)) + { + m_debug_dma_state.yflip = 1 - m_debug_dma_state.yflip; + do_blit = true; + } + + if (do_blit) + do_debug_blit(); +} + +uint32_t midtunit_video_device::debug_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + do_dma_debug_inputs(); + const pen_t *pens = m_debug_palette->pens(); + for (int y = 0; y <= cliprect.max_y; y++) + { + uint32_t *dest = &bitmap.pix32(y); + uint16_t *src = &m_debug_videoram[y * 512]; + for (int x = 0; x < cliprect.max_x; x++) + { + *dest = pens[*src & 0x7fff]; + src++; + dest++; + } + } + return 0; +} +#endif -- cgit v1.2.3