Merge pull request #4972 from cam900/taito_helper_maskpri

taito_helper.cpp : Updates
This commit is contained in:
R. Belmont 2019-05-04 23:19:10 -04:00 committed by GitHub
commit 50d7af6b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 130 additions and 128 deletions

View File

@ -51,7 +51,7 @@ Control registers
DEFINE_DEVICE_TYPE(PC080SN, pc080sn_device, "pc080sn", "Taito PC080SN") DEFINE_DEVICE_TYPE(PC080SN, pc080sn_device, "pc080sn", "Taito PC080SN")
pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, PC080SN, tag, owner, clock), : device_t(mconfig, PC080SN, tag, owner, clock),
m_ram(nullptr), m_ram(nullptr),
m_gfxnum(0), m_gfxnum(0),
@ -108,7 +108,7 @@ void pc080sn_device::device_start()
m_tilemap[1]->set_scroll_rows(512); m_tilemap[1]->set_scroll_rows(512);
} }
m_ram = make_unique_clear<uint16_t[]>(PC080SN_RAM_SIZE / 2); m_ram = make_unique_clear<u16[]>(PC080SN_RAM_SIZE / 2);
m_bg_ram[0] = m_ram.get() + 0x0000 /2; m_bg_ram[0] = m_ram.get() + 0x0000 /2;
m_bg_ram[1] = m_ram.get() + 0x8000 /2; m_bg_ram[1] = m_ram.get() + 0x8000 /2;
@ -132,9 +132,9 @@ void pc080sn_device::device_post_load()
DEVICE HANDLERS DEVICE HANDLERS
*****************************************************************************/ *****************************************************************************/
void pc080sn_device::common_get_pc080sn_bg_tile_info( tile_data &tileinfo, int tile_index, uint16_t *ram, int gfxnum ) void pc080sn_device::common_get_pc080sn_bg_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum )
{ {
uint16_t code, attr; u16 code, attr;
if (!m_dblwidth) if (!m_dblwidth)
{ {
@ -158,9 +158,9 @@ TILE_GET_INFO_MEMBER(pc080sn_device::get_bg_tile_info)
common_get_pc080sn_bg_tile_info( tileinfo, tile_index, m_bg_ram[0], m_gfxnum ); common_get_pc080sn_bg_tile_info( tileinfo, tile_index, m_bg_ram[0], m_gfxnum );
} }
void pc080sn_device::common_get_pc080sn_fg_tile_info( tile_data &tileinfo, int tile_index, uint16_t *ram, int gfxnum ) void pc080sn_device::common_get_pc080sn_fg_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum )
{ {
uint16_t code,attr; u16 code,attr;
if (!m_dblwidth) if (!m_dblwidth)
{ {
@ -298,7 +298,7 @@ void pc080sn_device::tilemap_update( )
if (!m_dblwidth) if (!m_dblwidth)
{ {
for (j = 0; j < 256; j++) for (j = 0; j < 256; j++)
m_tilemap[0]->set_scrollx((j + m_bgscrolly[0]) & 0x1ff, m_bgscrollx[0] - m_bgscroll_ram[0][j]); m_tilemap[0]->set_scrollx((j + m_bgscrolly[0]) & 0x1ff, m_bgscrollx[0] - m_bgscroll_ram[0][j]);
for (j = 0; j < 256; j++) for (j = 0; j < 256; j++)
m_tilemap[1]->set_scrollx((j + m_bgscrolly[1]) & 0x1ff, m_bgscrollx[1] - m_bgscroll_ram[1][j]); m_tilemap[1]->set_scrollx((j + m_bgscrolly[1]) & 0x1ff, m_bgscrollx[1] - m_bgscroll_ram[1][j]);
@ -311,9 +311,9 @@ void pc080sn_device::tilemap_update( )
} }
static uint16_t topspeed_get_road_pixel_color( uint16_t pixel, uint16_t color ) static u16 topspeed_get_road_pixel_color( u16 pixel, u16 color )
{ {
uint16_t road_body_color, off_road_color, pixel_type; u16 road_body_color, off_road_color, pixel_type;
/* Color changes based on screenshots from game flyer */ /* Color changes based on screenshots from game flyer */
pixel_type = (pixel % 0x10); pixel_type = (pixel % 0x10);
@ -360,16 +360,16 @@ static uint16_t topspeed_get_road_pixel_color( uint16_t pixel, uint16_t color )
} }
void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority, uint16_t *color_ctrl_ram ) void pc080sn_device::topspeed_custom_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u16 *color_ctrl_ram, u8 pmask)
{ {
uint16_t *dst16, *src16; u16 *dst16, *src16;
uint8_t *tsrc; u8 *tsrc;
uint16_t scanline[1024]; /* won't be called by a wide-screen game, but just in case... */ u16 scanline[1024]; /* won't be called by a wide-screen game, but just in case... */
bitmap_ind16 &srcbitmap = m_tilemap[layer]->pixmap(); bitmap_ind16 &srcbitmap = m_tilemap[layer]->pixmap();
bitmap_ind8 &flagsbitmap = m_tilemap[layer]->flagsmap(); bitmap_ind8 &flagsbitmap = m_tilemap[layer]->flagsmap();
uint16_t a, color; u16 a, color;
int sx, x_index; int sx, x_index;
int y_index, src_y_index, row_index; int y_index, src_y_index, row_index;
@ -435,17 +435,17 @@ void pc080sn_device::topspeed_custom_draw( screen_device &screen, bitmap_ind16 &
} }
} }
taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? false : true, ROT0, screen.priority(), priority, pmask);
y_index++; y_index++;
} }
} }
void pc080sn_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority ) void pc080sn_device::tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask)
{ {
m_tilemap[layer]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[layer]->draw(screen, bitmap, cliprect, flags, priority, pmask);
} }
void pc080sn_device::tilemap_draw_offset( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority, int x_offset, int y_offset ) void pc080sn_device::tilemap_draw_offset(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, int x_offset, int y_offset, u8 pmask)
{ {
int basedx = -16 - m_x_offset; int basedx = -16 - m_x_offset;
int basedxflip = -16 + m_x_offset; int basedxflip = -16 + m_x_offset;
@ -454,14 +454,14 @@ void pc080sn_device::tilemap_draw_offset( screen_device &screen, bitmap_ind16 &b
m_tilemap[layer]->set_scrolldx(basedx + x_offset, basedxflip + x_offset); m_tilemap[layer]->set_scrolldx(basedx + x_offset, basedxflip + x_offset);
m_tilemap[layer]->set_scrolldy(basedy + y_offset, basedyflip + y_offset); m_tilemap[layer]->set_scrolldy(basedy + y_offset, basedyflip + y_offset);
m_tilemap[layer]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[layer]->draw(screen, bitmap, cliprect, flags, priority, pmask);
m_tilemap[layer]->set_scrolldx(basedx, basedxflip); m_tilemap[layer]->set_scrolldx(basedx, basedxflip);
m_tilemap[layer]->set_scrolldy(basedy, basedyflip); m_tilemap[layer]->set_scrolldy(basedy, basedyflip);
} }
void pc080sn_device::tilemap_draw_special( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority, uint16_t *ram ) void pc080sn_device::tilemap_draw_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u16 *ram, u8 pmask)
{ {
pc080sn_device::topspeed_custom_draw(screen, bitmap, cliprect, layer, flags, priority, ram); pc080sn_device::topspeed_custom_draw(screen, bitmap, cliprect, layer, flags, priority, ram, pmask);
} }

View File

@ -8,7 +8,7 @@
class pc080sn_device : public device_t class pc080sn_device : public device_t
{ {
public: public:
pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// configuration // configuration
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); } template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
@ -30,18 +30,18 @@ public:
TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info);
void common_get_pc080sn_bg_tile_info( tile_data &tileinfo, int tile_index, uint16_t *ram, int gfxnum ); void common_get_pc080sn_bg_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum );
void common_get_pc080sn_fg_tile_info( tile_data &tileinfo, int tile_index, uint16_t *ram, int gfxnum ); void common_get_pc080sn_fg_tile_info( tile_data &tileinfo, int tile_index, u16 *ram, int gfxnum );
void set_scroll(int tilemap_num, int scrollx, int scrolly); void set_scroll(int tilemap_num, int scrollx, int scrolly);
void set_trans_pen(int tilemap_num, int pen); void set_trans_pen(int tilemap_num, int pen);
void tilemap_update(); void tilemap_update();
void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask = 0xff);
void tilemap_draw_offset(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority, int xoffs, int yoffs); void tilemap_draw_offset(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, int xoffs, int yoffs, u8 pmask = 0xff);
void topspeed_custom_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority, uint16_t *color_ctrl_ram); void topspeed_custom_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u16 *color_ctrl_ram, u8 pmask = 0xff);
/* For Topspeed */ /* For Topspeed */
void tilemap_draw_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority, uint16_t *ram); void tilemap_draw_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u16 *ram, u8 pmask = 0xff);
void restore_scroll(); void restore_scroll();
@ -52,11 +52,11 @@ protected:
private: private:
// internal state // internal state
uint16_t m_ctrl[8]; u16 m_ctrl[8];
std::unique_ptr<uint16_t[]> m_ram; std::unique_ptr<u16[]> m_ram;
uint16_t *m_bg_ram[2]; u16 *m_bg_ram[2];
uint16_t *m_bgscroll_ram[2]; u16 *m_bgscroll_ram[2];
int m_bgscrollx[2], m_bgscrolly[2]; int m_bgscrollx[2], m_bgscrolly[2];

View File

@ -7,10 +7,10 @@
void taitoic_drawscanline( bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, void taitoic_drawscanline( bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y,
const uint16_t *src, int transparent, uint32_t orient, bitmap_ind8 &priority, int pri) const u16 *src, bool transparent, u32 orient, bitmap_ind8 &priority, u8 pri, u8 primask)
{ {
uint16_t *dsti = &bitmap.pix16(y, x); u16 *dsti = &bitmap.pix16(y, x);
uint8_t *dstp = &priority.pix8(y, x); u8 *dstp = &priority.pix8(y, x);
int length = cliprect.width(); int length = cliprect.width();
src += cliprect.min_x; src += cliprect.min_x;
@ -20,12 +20,12 @@ void taitoic_drawscanline( bitmap_ind16 &bitmap, const rectangle &cliprect, int
{ {
while (length--) while (length--)
{ {
uint32_t spixel = *src++; u32 spixel = *src++;
if (spixel < 0x7fff) if (spixel < 0x7fff)
{ {
*dsti = spixel; *dsti = spixel;
*dstp = pri; *dstp = (*dstp & primask) | pri;
} }
dsti++; dsti++;
@ -37,7 +37,8 @@ void taitoic_drawscanline( bitmap_ind16 &bitmap, const rectangle &cliprect, int
while (length--) while (length--)
{ {
*dsti++ = *src++; *dsti++ = *src++;
*dstp++ = pri; *dstp = (*dstp & primask) | pri;
dstp++;
} }
} }
} }

View File

@ -8,6 +8,6 @@
// These scanline drawing routines, currently used by the pc080sn, tc0080vco, tc0150rod and tc0480scp devices, were lifted from Taito F3: optimise/merge? // These scanline drawing routines, currently used by the pc080sn, tc0080vco, tc0150rod and tc0480scp devices, were lifted from Taito F3: optimise/merge?
void taitoic_drawscanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, const uint16_t *src, int transparent, uint32_t orient, bitmap_ind8 &priority, int pri); void taitoic_drawscanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, const u16 *src, bool transparent, u32 orient, bitmap_ind8 &priority, u8 pri, u8 primask = 0);
#endif // MAME_VIDEO_TAITO_HELPER_H #endif // MAME_VIDEO_TAITO_HELPER_H

View File

@ -80,7 +80,7 @@ this seems to be the only zoom feature actually used in the games.
DEFINE_DEVICE_TYPE(TC0080VCO, tc0080vco_device, "tc0080vco", "Taito TC0080VCO") DEFINE_DEVICE_TYPE(TC0080VCO, tc0080vco_device, "tc0080vco", "Taito TC0080VCO")
tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, TC0080VCO, tag, owner, clock), : device_t(mconfig, TC0080VCO, tag, owner, clock),
m_ram(nullptr), m_ram(nullptr),
m_bg0_ram_0(nullptr), m_bg0_ram_0(nullptr),
@ -156,7 +156,7 @@ void tc0080vco_device::device_start()
m_tilemap[2]->set_transparent_pen(0); m_tilemap[2]->set_transparent_pen(0);
m_ram = make_unique_clear<uint16_t[]>(TC0080VCO_RAM_SIZE / 2); m_ram = make_unique_clear<u16[]>(TC0080VCO_RAM_SIZE / 2);
m_char_ram = m_ram.get() + 0x00000 / 2; /* continues at +0x10000 */ m_char_ram = m_ram.get() + 0x00000 / 2; /* continues at +0x10000 */
m_tx_ram_0 = m_ram.get() + 0x01000 / 2; m_tx_ram_0 = m_ram.get() + 0x01000 / 2;
@ -175,7 +175,7 @@ void tc0080vco_device::device_start()
m_scroll_ram = m_ram.get() + 0x20800 / 2; m_scroll_ram = m_ram.get() + 0x20800 / 2;
/* create the char set (gfx will then be updated dynamically from RAM) */ /* create the char set (gfx will then be updated dynamically from RAM) */
m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(&m_gfxdecode->palette(), charlayout, (uint8_t *)m_char_ram, 0, 1, 512)); m_gfxdecode->set_gfx(m_txnum, std::make_unique<gfx_element>(&m_gfxdecode->palette(), charlayout, (u8 *)m_char_ram, 0, 1, 512));
save_pointer(NAME(m_ram), TC0080VCO_RAM_SIZE / 2); save_pointer(NAME(m_ram), TC0080VCO_RAM_SIZE / 2);
} }
@ -400,9 +400,9 @@ void tc0080vco_device::tilemap_update( )
/* NB: orientation_flipx code in following routine has not been tested */ /* NB: orientation_flipx code in following routine has not been tested */
void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, uint32_t priority ) void tc0080vco_device::bg0_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask)
{ {
uint16_t zoom = m_scroll_ram[6]; u16 zoom = m_scroll_ram[6];
int zx, zy; int zx, zy;
zx = (zoom & 0xff00) >> 8; zx = (zoom & 0xff00) >> 8;
@ -410,13 +410,13 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi
if (zx == 0x3f && zy == 0x7f) /* normal size */ if (zx == 0x3f && zy == 0x7f) /* normal size */
{ {
m_tilemap[0]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[0]->draw(screen, bitmap, cliprect, flags, priority, pmask);
} }
else /* zoom + rowscroll = custom draw routine */ else /* zoom + rowscroll = custom draw routine */
{ {
uint16_t *dst16, *src16; u16 *dst16, *src16;
uint8_t *tsrc; u8 *tsrc;
uint16_t scanline[512]; u16 scanline[512];
bitmap_ind16 &srcbitmap = m_tilemap[0]->pixmap(); bitmap_ind16 &srcbitmap = m_tilemap[0]->pixmap();
bitmap_ind8 &flagsbitmap = m_tilemap[0]->flagsmap(); bitmap_ind8 &flagsbitmap = m_tilemap[0]->flagsmap();
@ -520,7 +520,7 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi
} }
} }
taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, screen.priority(), priority); taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? false : true , ROT0, screen.priority(), priority, pmask);
y_index += zoomy; y_index += zoomy;
} }
@ -531,18 +531,18 @@ void tc0080vco_device::bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bi
#define PIXEL_OP_COPY_TRANS0_SET_PRIORITY(DEST, PRIORITY, SOURCE) \ #define PIXEL_OP_COPY_TRANS0_SET_PRIORITY(DEST, PRIORITY, SOURCE) \
do \ do \
{ \ { \
uint32_t srcdata = (SOURCE); \ u32 srcdata = (SOURCE); \
if (srcdata != 0) \ if (srcdata != 0) \
{ \ { \
(DEST) = SOURCE; \ (DEST) = SOURCE; \
(PRIORITY) = privalue; \ (PRIORITY) = ((PRIORITY) & primask) | privalue; \
} \ } \
} \ } \
while (0) while (0)
void tc0080vco_device::bg1_tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, uint32_t priority ) void tc0080vco_device::bg1_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask)
{ {
uint8_t layer = 1; u8 layer = 1;
uint16_t zoom = m_scroll_ram[6 + layer]; u16 zoom = m_scroll_ram[6 + layer];
int min_x = cliprect.min_x; int min_x = cliprect.min_x;
int max_x = cliprect.max_x; int max_x = cliprect.max_x;
int min_y = cliprect.min_y; int min_y = cliprect.min_y;
@ -554,7 +554,7 @@ void tc0080vco_device::bg1_tilemap_draw( screen_device &screen, bitmap_ind16 &bi
if (zoomx == 0x3f && zoomy == 0x7f) /* normal size */ if (zoomx == 0x3f && zoomy == 0x7f) /* normal size */
{ {
m_tilemap[layer]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[layer]->draw(screen, bitmap, cliprect, flags, priority, pmask);
} }
else /* zoomed */ else /* zoomed */
{ {
@ -605,26 +605,27 @@ void tc0080vco_device::bg1_tilemap_draw( screen_device &screen, bitmap_ind16 &bi
{ {
bitmap_ind16 &dest = bitmap; bitmap_ind16 &dest = bitmap;
bitmap_ind16 &src = srcbitmap; bitmap_ind16 &src = srcbitmap;
int32_t startx = sx; s32 startx = sx;
int32_t starty = sy; s32 starty = sy;
int32_t incxx = zx; s32 incxx = zx;
int32_t incxy = 0; s32 incxy = 0;
int32_t incyx = 0; s32 incyx = 0;
int32_t incyy = zy; s32 incyy = zy;
int wraparound = 0; int wraparound = 0;
uint32_t privalue = priority; u8 privalue = priority;
u8 primask = pmask;
bitmap_ind8 &priority = screen.priority(); bitmap_ind8 &priority = screen.priority();
if (dest.bpp() == 16) if (dest.bpp() == 16)
COPYROZBITMAP_CORE(uint16_t, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, uint8_t); COPYROZBITMAP_CORE(u16, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, u8);
else else
COPYROZBITMAP_CORE(uint32_t, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, uint8_t); COPYROZBITMAP_CORE(u32, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, u8);
} }
} }
} }
void tc0080vco_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority ) void tc0080vco_device::tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask)
{ {
int disable = 0x00; /* possibly layer disable bits do exist ?? */ int disable = 0x00; /* possibly layer disable bits do exist ?? */
@ -637,39 +638,39 @@ void tc0080vco_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap
case 0: case 0:
if (disable & 0x01) if (disable & 0x01)
return; return;
bg0_tilemap_draw(screen, bitmap, cliprect, flags, priority); bg0_tilemap_draw(screen, bitmap, cliprect, flags, priority, pmask);
break; break;
case 1: case 1:
if (disable & 0x02) if (disable & 0x02)
return; return;
bg1_tilemap_draw(screen, bitmap, cliprect, flags, priority); bg1_tilemap_draw(screen, bitmap, cliprect, flags, priority, pmask);
break; break;
case 2: case 2:
if (disable & 0x04) if (disable & 0x04)
return; return;
m_tilemap[2]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[2]->draw(screen, bitmap, cliprect, flags, priority, pmask);
break; break;
} }
} }
/* FIXME: maybe it would be better to provide pointers to these RAM regions /* FIXME: maybe it would be better to provide pointers to these RAM regions
which can be accessed directly by the drivers... */ which can be accessed directly by the drivers... */
uint16_t tc0080vco_device::cram_0_r(int offset) u16 tc0080vco_device::cram_0_r(int offset)
{ {
return m_chain_ram_0[offset]; return m_chain_ram_0[offset];
} }
uint16_t tc0080vco_device::cram_1_r(int offset) u16 tc0080vco_device::cram_1_r(int offset)
{ {
return m_chain_ram_1[offset]; return m_chain_ram_1[offset];
} }
uint16_t tc0080vco_device::sprram_r(int offset) u16 tc0080vco_device::sprram_r(int offset)
{ {
return m_spriteram[offset]; return m_spriteram[offset];
} }
uint16_t tc0080vco_device::scrram_r(int offset) u16 tc0080vco_device::scrram_r(int offset)
{ {
return m_scroll_ram[offset]; return m_scroll_ram[offset];
} }

View File

@ -8,7 +8,7 @@
class tc0080vco_device : public device_t class tc0080vco_device : public device_t
{ {
public: public:
tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// configuration // configuration
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); } template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
@ -25,13 +25,13 @@ public:
DECLARE_WRITE16_MEMBER( word_w ); DECLARE_WRITE16_MEMBER( word_w );
void tilemap_update(); void tilemap_update();
void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask = 0xff);
void set_fg0_debug(bool debug) { m_has_fg0 = debug ? 0 : 1; } void set_fg0_debug(bool debug) { m_has_fg0 = debug ? 0 : 1; }
uint16_t cram_0_r(int offset); u16 cram_0_r(int offset);
uint16_t cram_1_r(int offset); u16 cram_1_r(int offset);
uint16_t sprram_r(int offset); u16 sprram_r(int offset);
uint16_t scrram_r(int offset); u16 scrram_r(int offset);
DECLARE_WRITE16_MEMBER( scrollram_w ); DECLARE_WRITE16_MEMBER( scrollram_w );
READ_LINE_MEMBER( flipscreen_r ); READ_LINE_MEMBER( flipscreen_r );
@ -42,30 +42,30 @@ protected:
private: private:
// internal state // internal state
std::unique_ptr<uint16_t[]> m_ram; std::unique_ptr<u16[]> m_ram;
uint16_t * m_bg0_ram_0; u16 * m_bg0_ram_0;
uint16_t * m_bg0_ram_1; u16 * m_bg0_ram_1;
uint16_t * m_bg1_ram_0; u16 * m_bg1_ram_0;
uint16_t * m_bg1_ram_1; u16 * m_bg1_ram_1;
uint16_t * m_tx_ram_0; u16 * m_tx_ram_0;
uint16_t * m_tx_ram_1; u16 * m_tx_ram_1;
uint16_t * m_char_ram; u16 * m_char_ram;
uint16_t * m_bgscroll_ram; u16 * m_bgscroll_ram;
/* FIXME: This sprite related stuff still needs to be accessed in video/taito_h */ /* FIXME: This sprite related stuff still needs to be accessed in video/taito_h */
uint16_t * m_chain_ram_0; u16 * m_chain_ram_0;
uint16_t * m_chain_ram_1; u16 * m_chain_ram_1;
uint16_t * m_spriteram; u16 * m_spriteram;
uint16_t * m_scroll_ram; u16 * m_scroll_ram;
uint16_t m_bg0_scrollx; u16 m_bg0_scrollx;
uint16_t m_bg0_scrolly; u16 m_bg0_scrolly;
uint16_t m_bg1_scrollx; u16 m_bg1_scrollx;
uint16_t m_bg1_scrolly; u16 m_bg1_scrolly;
tilemap_t *m_tilemap[3]; tilemap_t *m_tilemap[3];
int32_t m_flipscreen; s32 m_flipscreen;
int m_gfxnum; int m_gfxnum;
int m_txnum; int m_txnum;
@ -78,8 +78,8 @@ private:
TILE_GET_INFO_MEMBER(get_bg0_tile_info); TILE_GET_INFO_MEMBER(get_bg0_tile_info);
TILE_GET_INFO_MEMBER(get_bg1_tile_info); TILE_GET_INFO_MEMBER(get_bg1_tile_info);
TILE_GET_INFO_MEMBER(get_tx_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info);
void bg0_tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, uint32_t priority ); void bg0_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff);
void bg1_tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, uint32_t priority ); void bg1_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask = 0xff);
}; };
DECLARE_DEVICE_TYPE(TC0080VCO, tc0080vco_device) DECLARE_DEVICE_TYPE(TC0080VCO, tc0080vco_device)

View File

@ -14,7 +14,7 @@ Road generator. Two roads allow for forking. Gfx data fetched from ROM. Refer to
DEFINE_DEVICE_TYPE(TC0150ROD, tc0150rod_device, "tc0150rod", "Taito TC0150ROD") DEFINE_DEVICE_TYPE(TC0150ROD, tc0150rod_device, "tc0150rod", "Taito TC0150ROD")
tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, TC0150ROD, tag, owner, clock) : device_t(mconfig, TC0150ROD, tag, owner, clock)
, m_roadgfx(*this, DEVICE_SELF, 0x40000) , m_roadgfx(*this, DEVICE_SELF, 0x40000)
{ {
@ -209,23 +209,23 @@ lookup table from rom for the TaitoZ sprites.
******************************************************************************/ ******************************************************************************/
void tc0150rod_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, bitmap_ind8 &priority_bitmap, uint32_t low_priority, uint32_t high_priority ) void tc0150rod_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, bitmap_ind8 &priority_bitmap, u8 low_priority, u8 high_priority, u8 pmask )
{ {
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
static int dislayer[6]; /* Road Layer toggles to help get road correct */ static int dislayer[6]; /* Road Layer toggles to help get road correct */
#endif #endif
int x_offs = 0xa7; /* Increasing this shifts road to right */ int x_offs = 0xa7; /* Increasing this shifts road to right */
uint16_t scanline[512]; u16 scanline[512];
uint16_t roada_line[512], roadb_line[512]; u16 roada_line[512], roadb_line[512];
uint16_t *dst16; u16 *dst16;
uint16_t *roada, *roadb; u16 *roada, *roadb;
uint16_t pixel, color, gfx_word; u16 pixel, color, gfx_word;
uint16_t roada_clipl, roada_clipr, roada_bodyctrl; u16 roada_clipl, roada_clipr, roada_bodyctrl;
uint16_t roadb_clipl, roadb_clipr, roadb_bodyctrl; u16 roadb_clipl, roadb_clipr, roadb_bodyctrl;
uint16_t pri, pixpri; u16 pri, pixpri;
uint8_t priorities[6]; u8 priorities[6];
int x_index, roadram_index, roadram2_index, i; int x_index, roadram_index, roadram2_index, i;
int xoffset, paloffs, palloffs, palroffs; int xoffset, paloffs, palloffs, palroffs;
int road_gfx_tilenum, colbank, road_center; int road_gfx_tilenum, colbank, road_center;
@ -766,7 +766,7 @@ void tc0150rod_device::draw( bitmap_ind16 &bitmap, const rectangle &cliprect, in
} }
} }
taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, 1, ROT0, priority_bitmap, (y > priority_switch_line) ? high_priority : low_priority); taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, true, ROT0, priority_bitmap, (y > priority_switch_line) ? high_priority : low_priority, pmask);
} }
y++; y++;

View File

@ -8,11 +8,11 @@
class tc0150rod_device : public device_t class tc0150rod_device : public device_t
{ {
public: public:
tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
DECLARE_READ16_MEMBER( word_r ); DECLARE_READ16_MEMBER( word_r );
DECLARE_WRITE16_MEMBER( word_w ); DECLARE_WRITE16_MEMBER( word_w );
void draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, bitmap_ind8 &priority_bitmap, uint32_t low_priority, uint32_t high_priority); void draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, bitmap_ind8 &priority_bitmap, u8 low_priority, u8 high_priority, u8 pmask = 0xff);
protected: protected:
// device-level overrides // device-level overrides
@ -20,8 +20,8 @@ protected:
private: private:
// internal state // internal state
std::vector<uint16_t> m_ram; std::vector<u16> m_ram;
required_region_ptr<uint16_t> m_roadgfx; required_region_ptr<u16> m_roadgfx;
}; };
DECLARE_DEVICE_TYPE(TC0150ROD, tc0150rod_device) DECLARE_DEVICE_TYPE(TC0150ROD, tc0150rod_device)

View File

@ -563,7 +563,7 @@ Historical Issues
**********************************************************************/ **********************************************************************/
void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority ) void tc0480scp_device::bg01_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask)
{ {
/* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max
Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max
@ -575,7 +575,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c
if ((zoomx == 0x10000) && (zoomy == 0x10000)) /* no zoom, simple */ if ((zoomx == 0x10000) && (zoomy == 0x10000)) /* no zoom, simple */
{ {
/* Prevent bad things */ /* Prevent bad things */
m_tilemap[layer][m_dblwidth]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[layer][m_dblwidth]->draw(screen, bitmap, cliprect, flags, priority, pmask);
} }
else /* zoom */ else /* zoom */
{ {
@ -651,7 +651,7 @@ void tc0480scp_device::bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, c
} }
} }
taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? false : true, ROT0, screen.priority(), priority, pmask);
y_index += zoomy; y_index += zoomy;
} }
@ -695,7 +695,7 @@ flipscreen.
****************************************************************/ ****************************************************************/
void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority ) void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask)
{ {
bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap(); bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap();
bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap(); bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap();
@ -797,32 +797,32 @@ void tc0480scp_device::bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, co
} }
} }
taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? false : true, ROT0, screen.priority(), priority, pmask);
y_index += zoomy; y_index += zoomy;
} }
} }
void tc0480scp_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority ) void tc0480scp_device::tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask)
{ {
/* no layer disable bits */ /* no layer disable bits */
switch (layer) switch (layer)
{ {
case 0: case 0:
bg01_draw(screen, bitmap, cliprect, 0, flags, priority); bg01_draw(screen, bitmap, cliprect, 0, flags, priority, pmask);
break; break;
case 1: case 1:
bg01_draw(screen, bitmap, cliprect, 1, flags, priority); bg01_draw(screen, bitmap, cliprect, 1, flags, priority, pmask);
break; break;
case 2: case 2:
bg23_draw(screen, bitmap, cliprect, 2, flags, priority); bg23_draw(screen, bitmap, cliprect, 2, flags, priority, pmask);
break; break;
case 3: case 3:
bg23_draw(screen, bitmap, cliprect, 3, flags, priority); bg23_draw(screen, bitmap, cliprect, 3, flags, priority, pmask);
break; break;
case 4: case 4:
m_tilemap[4][m_dblwidth]->draw(screen, bitmap, cliprect, flags, priority); m_tilemap[4][m_dblwidth]->draw(screen, bitmap, cliprect, flags, priority, pmask);
break; break;
} }
} }

View File

@ -40,7 +40,7 @@ public:
void ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0); void ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void tilemap_update(); void tilemap_update();
void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask = 0xff);
/* Returns the priority order of the bg tilemaps set in the internal /* Returns the priority order of the bg tilemaps set in the internal
register. The order in which the four layers should be drawn is register. The order in which the four layers should be drawn is
@ -85,8 +85,8 @@ private:
TILE_GET_INFO_MEMBER(get_tx_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info);
void set_layer_ptrs(); void set_layer_ptrs();
void bg01_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority ); void bg01_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask = 0xff);
void bg23_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u32 priority ); void bg23_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask = 0xff);
}; };
DECLARE_DEVICE_TYPE(TC0480SCP, tc0480scp_device) DECLARE_DEVICE_TYPE(TC0480SCP, tc0480scp_device)