summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/video/imagetek_i4100.cpp4
-rw-r--r--src/devices/video/stvvdp2.cpp16
-rw-r--r--src/emu/digfx.cpp35
-rw-r--r--src/emu/digfx.h6
-rw-r--r--src/emu/drawgfx.cpp208
-rw-r--r--src/emu/drawgfx.h72
-rw-r--r--src/emu/drawgfxm.h10
-rw-r--r--src/emu/tilemap.cpp6
-rw-r--r--src/emu/tilemap.h8
-rw-r--r--src/frontend/mame/ui/viewgfx.cpp6
-rw-r--r--src/mame/drivers/1945kiii.cpp6
-rw-r--r--src/mame/drivers/acefruit.cpp2
-rw-r--r--src/mame/drivers/aquarium.cpp8
-rw-r--r--src/mame/drivers/coolridr.cpp6
-rw-r--r--src/mame/drivers/cps3.cpp10
-rw-r--r--src/mame/drivers/gamecstl.cpp2
-rw-r--r--src/mame/drivers/gstream.cpp421
-rw-r--r--src/mame/drivers/hp9k.cpp2
-rw-r--r--src/mame/drivers/mediagx.cpp4
-rw-r--r--src/mame/drivers/mpu4vid.cpp2
-rw-r--r--src/mame/drivers/pinball2k.cpp4
-rw-r--r--src/mame/drivers/scyclone.cpp10
-rw-r--r--src/mame/drivers/taito_f2.cpp8
-rw-r--r--src/mame/drivers/taito_f3.cpp16
-rw-r--r--src/mame/drivers/zwackery.cpp8
-rw-r--r--src/mame/includes/bbusters.h2
-rw-r--r--src/mame/includes/cps1.h6
-rw-r--r--src/mame/includes/decocass.h2
-rw-r--r--src/mame/includes/namcos22.h4
-rw-r--r--src/mame/includes/nemesis.h2
-rw-r--r--src/mame/includes/seta2.h2
-rw-r--r--src/mame/includes/snk.h2
-rw-r--r--src/mame/includes/thepit.h2
-rw-r--r--src/mame/machine/atarigen.cpp8
-rw-r--r--src/mame/machine/megacd.cpp20
-rw-r--r--src/mame/machine/megacd.h10
-rw-r--r--src/mame/machine/st0016.cpp4
-rw-r--r--src/mame/video/1943.cpp6
-rw-r--r--src/mame/video/armedf.cpp4
-rw-r--r--src/mame/video/bbusters.cpp4
-rw-r--r--src/mame/video/buggychl.cpp2
-rw-r--r--src/mame/video/circus.cpp2
-rw-r--r--src/mame/video/cps1.cpp4
-rw-r--r--src/mame/video/deco_mlc.cpp8
-rw-r--r--src/mame/video/deco_zoomspr.cpp6
-rw-r--r--src/mame/video/decocass.cpp7
-rw-r--r--src/mame/video/equites.cpp2
-rw-r--r--src/mame/video/gaelco2.cpp4
-rw-r--r--src/mame/video/gaelco_wrally_sprites.cpp2
-rw-r--r--src/mame/video/gp9001.cpp4
-rw-r--r--src/mame/video/grchamp.cpp4
-rw-r--r--src/mame/video/jalblend.cpp6
-rw-r--r--src/mame/video/jedi.cpp33
-rw-r--r--src/mame/video/k053246_k053247_k055673.cpp4
-rw-r--r--src/mame/video/k054156_k054157_k056832.cpp4
-rw-r--r--src/mame/video/kaneko_spr.cpp6
-rw-r--r--src/mame/video/mcr.cpp4
-rw-r--r--src/mame/video/megasys1.cpp2
-rw-r--r--src/mame/video/namco_c355spr.cpp8
-rw-r--r--src/mame/video/namcona1.cpp12
-rw-r--r--src/mame/video/namcos22.cpp6
-rw-r--r--src/mame/video/namcos2_sprite.cpp8
-rw-r--r--src/mame/video/nemesis.cpp4
-rw-r--r--src/mame/video/polepos.cpp4
-rw-r--r--src/mame/video/popeye.cpp4
-rw-r--r--src/mame/video/psikyosh.cpp30
-rw-r--r--src/mame/video/seibuspi.cpp4
-rw-r--r--src/mame/video/seta2.cpp4
-rw-r--r--src/mame/video/snk.cpp3
-rw-r--r--src/mame/video/ssv.cpp4
-rw-r--r--src/mame/video/taito_f2.cpp6
-rw-r--r--src/mame/video/taito_f3.cpp14
-rw-r--r--src/mame/video/tatsumi.cpp10
-rw-r--r--src/mame/video/tc0100scn.cpp8
-rw-r--r--src/mame/video/thepit.cpp2
-rw-r--r--src/mame/video/toaplan1.cpp6
-rw-r--r--src/mame/video/wecleman.cpp6
77 files changed, 589 insertions, 616 deletions
diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp
index 19bf5e2ee35..f67278263bc 100644
--- a/src/devices/video/imagetek_i4100.cpp
+++ b/src/devices/video/imagetek_i4100.cpp
@@ -1082,7 +1082,7 @@ inline uint8_t imagetek_i4100_device::get_tile_pix( uint16_t code, uint8_t x, ui
gfx_element *gfx1 = gfx(big ? 3 : 1);
uint32_t tile2 = big ? ((tile & 0xfffff) + ((code & 0xf) << 3)) :
((tile & 0xfffff) + ((code & 0xf) << 1));
- const uint8_t* data;
+ const uint16_t* data;
uint8_t flipxy = (code & 0x6000) >> 13;
if (tile2 < gfx1->elements())
@@ -1115,7 +1115,7 @@ inline uint8_t imagetek_i4100_device::get_tile_pix( uint16_t code, uint8_t x, ui
gfx_element *gfx1 = gfx(big ? 2 : 0);
uint32_t tile2 = big ? ((tile & 0xfffff) + ((code & 0xf) << 2)) :
((tile & 0xfffff) + (code & 0xf));
- const uint8_t* data;
+ const uint16_t* data;
uint8_t flipxy = (code & 0x6000) >> 13;
if (tile2 < gfx1->elements())
diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp
index 91d127499fd..91e0f9f4ba0 100644
--- a/src/devices/video/stvvdp2.cpp
+++ b/src/devices/video/stvvdp2.cpp
@@ -2458,7 +2458,7 @@ void saturn_state::stv_vdp2_drawgfxzoom(
if( gfx )
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const uint8_t *source_base = gfx->get_data(code % gfx->elements());
+ const uint16_t *source_base = gfx->get_data(code % gfx->elements());
//int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16;
//int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16;
@@ -2530,7 +2530,7 @@ void saturn_state::stv_vdp2_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes();
uint32_t *dest = &dest_bmp.pix32(y);
int x, x_index = x_index_base;
@@ -2552,7 +2552,7 @@ void saturn_state::stv_vdp2_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes();
uint32_t *dest = &dest_bmp.pix32(y);
int x, x_index = x_index_base;
@@ -2574,7 +2574,7 @@ void saturn_state::stv_vdp2_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes();
uint32_t *dest = &dest_bmp.pix32(y);
int x, x_index = x_index_base;
@@ -3031,7 +3031,7 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle
int transparency, int alpha)
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const uint8_t *source_base = gfx->get_data(code % gfx->elements());
+ const uint16_t *source_base = gfx->get_data(code % gfx->elements());
int x_index_base, y_index, sx, sy, ex, ey;
int xinc, yinc;
@@ -3083,7 +3083,7 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle
{
for (y = sy; y < ey; y++)
{
- const uint8_t *source = source_base + y_index*gfx->rowbytes();
+ const uint16_t *source = source_base + y_index*gfx->rowbytes();
uint32_t *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
for (x = sx; x < ex; x++)
@@ -3108,7 +3108,7 @@ void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectan
int transparency)
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const uint8_t *source_base = gfx->get_data(code % gfx->elements());
+ const uint16_t *source_base = gfx->get_data(code % gfx->elements());
int x_index_base, y_index, sx, sy, ex, ey;
int xinc, yinc;
@@ -3160,7 +3160,7 @@ void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectan
{
for (y = sy; y < ey; y++)
{
- const uint8_t *source = source_base + y_index*gfx->rowbytes();
+ const uint16_t *source = source_base + y_index*gfx->rowbytes();
uint32_t *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
for (x = sx; x < ex; x++)
diff --git a/src/emu/digfx.cpp b/src/emu/digfx.cpp
index 0055421b80c..acc1c5f1176 100644
--- a/src/emu/digfx.cpp
+++ b/src/emu/digfx.cpp
@@ -249,16 +249,33 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
// otherwise, just use the line modulo
else
{
- int base = gfx.start;
- int end = region_length/8;
- int linemod = glcopy.yoffset[0];
- while (glcopy.total > 0)
+ if (glcopy.planeoffset[1] != GFX_RAW) // 8bpp RAW case
{
- int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 8;
- int lastpixelbase = elementbase + glcopy.height * linemod / 8 - 1;
- if (lastpixelbase < end)
- break;
- glcopy.total--;
+ int base = gfx.start;
+ int end = region_length/8;
+ int linemod = glcopy.yoffset[0];
+ while (glcopy.total > 0)
+ {
+ int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 8;
+ int lastpixelbase = elementbase + glcopy.height * linemod / 8 - 1;
+ if (lastpixelbase < end)
+ break;
+ glcopy.total--;
+ }
+ }
+ else // 16bpp RAW case
+ {
+ int base = gfx.start;
+ int end = region_length/16;
+ int linemod = glcopy.yoffset[0];
+ while (glcopy.total > 0)
+ {
+ int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 16;
+ int lastpixelbase = elementbase + glcopy.height * linemod / 16 - 1;
+ if (lastpixelbase < end)
+ break;
+ glcopy.total--;
+ }
}
}
diff --git a/src/emu/digfx.h b/src/emu/digfx.h
index 3829cd2882e..31826238243 100644
--- a/src/emu/digfx.h
+++ b/src/emu/digfx.h
@@ -24,7 +24,7 @@
//**************************************************************************
constexpr u8 MAX_GFX_ELEMENTS = 32;
-constexpr u16 MAX_GFX_PLANES = 8;
+constexpr u16 MAX_GFX_PLANES = 16;
constexpr u16 MAX_GFX_SIZE = 32;
@@ -38,7 +38,9 @@ constexpr u16 MAX_GFX_SIZE = 32;
#define GFX_RAW 0x12345678
#define GFXLAYOUT_RAW( name, width, height, linemod, charmod ) \
-const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW }, { 0 }, { linemod }, charmod };
+const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW, 0 }, { 0 }, { linemod }, charmod };
+#define GFXLAYOUT_RAW16( name, width, height, linemod, charmod ) \
+const gfx_layout name = { width, height, RGN_FRAC(1,1), 16, { GFX_RAW, GFX_RAW }, { 0 }, { linemod }, charmod };
// When planeoffset[0] is set to GFX_RAW, the gfx data is left as-is, with no conversion.
// No buffer is allocated for the decoded data, and gfxdata is set to point to the source
// data.
diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp
index 841ae7c670f..5e317deb464 100644
--- a/src/emu/drawgfx.cpp
+++ b/src/emu/drawgfx.cpp
@@ -86,53 +86,61 @@ gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *ta
// gfx_element - constructor
//-------------------------------------------------
-gfx_element::gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity)
- : m_palette(palette),
- m_width(width),
- m_height(height),
- m_startx(0),
- m_starty(0),
- m_origwidth(width),
- m_origheight(height),
- m_total_elements(1),
- m_color_base(color_base),
- m_color_depth(color_granularity),
- m_color_granularity(color_granularity),
- m_total_colors((total_colors - color_base) / color_granularity),
- m_line_modulo(rowbytes),
- m_char_modulo(0),
- m_srcdata(base),
- m_dirtyseq(1),
- m_gfxdata(base),
- m_layout_is_raw(true),
- m_layout_planes(0),
- m_layout_xormask(0),
- m_layout_charincrement(0)
-{
+gfx_element::gfx_element(device_palette_interface *palette, const u8 *base, u32 total, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity)
+ : m_palette(palette)
+ , m_width(0)
+ , m_height(0)
+ , m_startx(0)
+ , m_starty(0)
+ , m_origwidth(0)
+ , m_origheight(0)
+ , m_total_elements(1)
+ , m_color_base(0)
+ , m_color_depth(0)
+ , m_color_granularity(0)
+ , m_total_colors(0)
+ , m_line_modulo(0)
+ , m_char_modulo(0)
+ , m_srcdata(nullptr)
+ , m_dirtyseq(1)
+ , m_gfxdata(nullptr)
+ , m_layout_is_raw(true)
+ , m_layout_is_16bpp(false)
+ , m_layout_planes(0)
+ , m_layout_xormask(0)
+ , m_layout_charincrement(0)
+{
+ if (!total) total = 1;
+ // set the layout
+ set_raw_layout(base, width, height, total, rowbytes*8, width*height*8);
+ m_color_base = color_base;
+ m_color_depth = m_color_granularity = color_granularity;
+ m_total_colors = (total_colors - color_base) / color_granularity;
}
gfx_element::gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base)
- : m_palette(palette),
- m_width(0),
- m_height(0),
- m_startx(0),
- m_starty(0),
- m_origwidth(0),
- m_origheight(0),
- m_total_elements(0),
- m_color_base(color_base),
- m_color_depth(0),
- m_color_granularity(0),
- m_total_colors(total_colors),
- m_line_modulo(0),
- m_char_modulo(0),
- m_srcdata(nullptr),
- m_dirtyseq(1),
- m_gfxdata(nullptr),
- m_layout_is_raw(false),
- m_layout_planes(0),
- m_layout_xormask(xormask),
- m_layout_charincrement(0)
+ : m_palette(palette)
+ , m_width(0)
+ , m_height(0)
+ , m_startx(0)
+ , m_starty(0)
+ , m_origwidth(0)
+ , m_origheight(0)
+ , m_total_elements(0)
+ , m_color_base(color_base)
+ , m_color_depth(0)
+ , m_color_granularity(0)
+ , m_total_colors(total_colors)
+ , m_line_modulo(0)
+ , m_char_modulo(0)
+ , m_srcdata(nullptr)
+ , m_dirtyseq(1)
+ , m_gfxdata(nullptr)
+ , m_layout_is_raw(false)
+ , m_layout_is_16bpp(false)
+ , m_layout_planes(0)
+ , m_layout_xormask(xormask)
+ , m_layout_charincrement(0)
{
// set the layout
set_layout(gl, srcdata);
@@ -156,6 +164,7 @@ void gfx_element::set_layout(const gfx_layout &gl, const u8 *srcdata)
// copy data from the layout
m_layout_is_raw = (gl.planeoffset[0] == GFX_RAW);
+ m_layout_is_16bpp = (gl.planeoffset[1] == GFX_RAW);
m_layout_planes = gl.planes;
m_layout_charincrement = gl.charincrement;
@@ -166,15 +175,22 @@ void gfx_element::set_layout(const gfx_layout &gl, const u8 *srcdata)
m_layout_planeoffset.clear();
m_layout_xoffset.clear();
m_layout_yoffset.clear();
- m_gfxdata_allocated.clear();
// modulos are determined for us by the layout
- m_line_modulo = gl.yoffs(0) / 8;
- m_char_modulo = gl.charincrement / 8;
+ if (m_layout_is_16bpp)
+ {
+ m_line_modulo = gl.yoffs(0) / 16;
+ m_char_modulo = gl.charincrement / 16;
+ }
+ else
+ {
+ m_line_modulo = gl.yoffs(0) / 8;
+ m_char_modulo = gl.charincrement / 8;
+ }
- // RAW graphics must have a pointer up front
- assert(srcdata != nullptr);
- m_gfxdata = const_cast<u8 *>(srcdata);
+ // allocate memory for the data
+ m_gfxdata_allocated.resize(m_total_elements * m_char_modulo);
+ m_gfxdata = &m_gfxdata_allocated[0];
}
// decoded graphics case
@@ -225,11 +241,26 @@ void gfx_element::set_raw_layout(const u8 *srcdata, u32 width, u32 height, u32 t
layout.total = total;
layout.planes = 8;
layout.planeoffset[0] = GFX_RAW;
+ layout.planeoffset[1] = 0;
layout.yoffset[0] = linemod;
layout.charincrement = charmod;
set_layout(layout, srcdata);
}
+void gfx_element::set_raw_layout(const u16 *srcdata, u32 width, u32 height, u32 total, u32 linemod, u32 charmod)
+{
+ gfx_layout layout = { 0 };
+ layout.width = width;
+ layout.height = height;
+ layout.total = total;
+ layout.planes = 8;
+ layout.planeoffset[0] = GFX_RAW;
+ layout.planeoffset[1] = GFX_RAW;
+ layout.yoffset[0] = linemod;
+ layout.charincrement = charmod;
+ set_layout(layout, (const u8 *)srcdata);
+}
+
//-------------------------------------------------
// set_source - set the source data for a gfx_element
@@ -239,7 +270,6 @@ void gfx_element::set_source(const u8 *source)
{
m_srcdata = source;
memset(&m_dirty[0], 1, elements());
- if (m_layout_is_raw) m_gfxdata = const_cast<u8 *>(source);
}
@@ -261,16 +291,9 @@ void gfx_element::set_source_and_total(const u8 *source, u32 total)
if (m_color_depth <= 32)
m_pen_usage.resize(m_total_elements);
- if (m_layout_is_raw)
- {
- m_gfxdata = const_cast<u8 *>(source);
- }
- else
- {
- // allocate memory for the data
- m_gfxdata_allocated.resize(m_total_elements * m_char_modulo);
- m_gfxdata = &m_gfxdata_allocated[0];
- }
+ // allocate memory for the data
+ m_gfxdata_allocated.resize(m_total_elements * m_char_modulo);
+ m_gfxdata = &m_gfxdata_allocated[0];
}
@@ -299,10 +322,49 @@ void gfx_element::set_source_clip(u32 xoffs, u32 width, u32 yoffs, u32 height)
void gfx_element::decode(u32 code)
{
// don't decode GFX_RAW
- if (!m_layout_is_raw)
+ if (m_layout_is_raw)
+ {
+ if (m_layout_is_16bpp)
+ {
+ // zap the data to 0
+ u16 *decode_base = m_gfxdata + code * m_char_modulo;
+ const u16 *base = ((const u16 *)m_srcdata) + code * m_char_modulo;
+ memset(decode_base, 0, m_char_modulo);
+
+ // iterate over rows
+ for (int y = 0; y < m_origheight; y++)
+ {
+ const u16 *sp = base + y * m_line_modulo;
+ u16 *dp = decode_base + y * m_line_modulo;
+
+ // iterate over columns
+ for (int x = 0; x < m_origwidth; x++)
+ dp[x] = sp[x];
+ }
+ }
+ else
+ {
+ // zap the data to 0
+ u16 *decode_base = m_gfxdata + code * m_char_modulo;
+ const u8 *base = m_srcdata + code * m_char_modulo;
+ memset(decode_base, 0, m_char_modulo);
+
+ // iterate over rows
+ for (int y = 0; y < m_origheight; y++)
+ {
+ const u8 *sp = base + y * m_line_modulo;
+ u16 *dp = decode_base + y * m_line_modulo;
+
+ // iterate over columns
+ for (int x = 0; x < m_origwidth; x++)
+ dp[x] = sp[x];
+ }
+ }
+ }
+ else
{
// zap the data to 0
- u8 *decode_base = m_gfxdata + code * m_char_modulo;
+ u16 *decode_base = m_gfxdata + code * m_char_modulo;
memset(decode_base, 0, m_char_modulo);
// iterate over planes
@@ -317,7 +379,7 @@ void gfx_element::decode(u32 code)
for (int y = 0; y < m_origheight; y++)
{
int yoffs = planeoffs + m_layout_yoffset[y];
- u8 *dp = decode_base + y * m_line_modulo;
+ u16 *dp = decode_base + y * m_line_modulo;
// iterate over columns
for (int x = 0; x < m_origwidth; x++)
@@ -331,7 +393,7 @@ void gfx_element::decode(u32 code)
if (code < m_pen_usage.size())
{
// iterate over data, creating a bitmask of live pens
- const u8 *dp = m_gfxdata + code * m_char_modulo;
+ const u16 *dp = m_gfxdata + code * m_char_modulo;
u32 usage = 0;
for (int y = 0; y < m_origheight; y++)
{
@@ -388,7 +450,7 @@ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect,
u32 trans_pen)
{
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
// use pen usage to optimize
@@ -416,7 +478,7 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
u32 trans_pen)
{
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
// use pen usage to optimize
@@ -654,7 +716,7 @@ void gfx_element::zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect,
return transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, trans_pen);
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley);
// use pen usage to optimize
@@ -686,7 +748,7 @@ void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
return transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, trans_pen);
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley);
// use pen usage to optimize
@@ -946,7 +1008,7 @@ void gfx_element::prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect,
bitmap_ind8 &priority, u32 pmask, u32 trans_pen)
{
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return prio_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask);
// use pen usage to optimize
@@ -976,7 +1038,7 @@ void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
bitmap_ind8 &priority, u32 pmask, u32 trans_pen)
{
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return prio_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask);
// use pen usage to optimize
@@ -1239,7 +1301,7 @@ void gfx_element::prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &clipre
return prio_transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask, trans_pen);
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return prio_zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask);
// use pen usage to optimize
@@ -1274,7 +1336,7 @@ void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &clipre
return prio_transpen(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask, trans_pen);
// special case invalid pens to opaque
- if (trans_pen > 0xff)
+ if (trans_pen > 0xffff)
return prio_zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask);
// use pen usage to optimize
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index 4d3f4d0e0c9..16902a6c932 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -152,7 +152,7 @@ public:
gfx_element();
#endif
gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base);
- gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity);
+ gfx_element(device_palette_interface *palette, const u8 *base, u32 total, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity);
// getters
device_palette_interface &palette() const { return *m_palette; }
@@ -173,6 +173,7 @@ public:
// setters
void set_layout(const gfx_layout &gl, const u8 *srcdata);
void set_raw_layout(const u8 *srcdata, u32 width, u32 height, u32 total, u32 linemod, u32 charmod);
+ void set_raw_layout(const u16 *srcdata, u32 width, u32 height, u32 total, u32 linemod, u32 charmod);
void set_source(const u8 *source);
void set_source_and_total(const u8 *source, u32 total);
void set_xormask(u32 xormask) { m_layout_xormask = xormask; }
@@ -186,7 +187,7 @@ public:
void mark_dirty(u32 code) { if (code < elements()) { m_dirty[code] = 1; m_dirtyseq++; } }
void mark_all_dirty() { memset(&m_dirty[0], 1, elements()); }
- const u8 *get_data(u32 code)
+ const u16 *get_data(u32 code)
{
assert(code < elements());
if (code < m_dirty.size() && m_dirty[code]) decode(code);
@@ -270,39 +271,40 @@ private:
void decode(u32 code);
// internal state
- device_palette_interface *m_palette; // palette used for drawing (optional when used as a pure decoder)
-
- u16 m_width; // current pixel width of each element (changeable with source clipping)
- u16 m_height; // current pixel height of each element (changeable with source clipping)
- u16 m_startx; // current source clip X offset
- u16 m_starty; // current source clip Y offset
-
- u16 m_origwidth; // starting pixel width of each element
- u16 m_origheight; // staring pixel height of each element
- u32 m_total_elements; // total number of decoded elements
-
- u32 m_color_base; // base color for rendering
- u16 m_color_depth; // number of colors each pixel can represent
- u16 m_color_granularity; // number of colors for each color code
- u32 m_total_colors; // number of color codes
-
- u32 m_line_modulo; // bytes between each row of data
- u32 m_char_modulo; // bytes between each element
- const u8 * m_srcdata; // pointer to the source data for decoding
- u32 m_dirtyseq; // sequence number; incremented each time a tile is dirtied
-
- u8 * m_gfxdata; // pointer to decoded pixel data, 8bpp
- std::vector<u8> m_gfxdata_allocated; // allocated decoded pixel data, 8bpp
- std::vector<u8> m_dirty; // dirty array for detecting chars that need decoding
- std::vector<u32> m_pen_usage; // bitmask of pens that are used (pens 0-31 only)
-
- bool m_layout_is_raw; // raw layout?
- u8 m_layout_planes; // bit planes in the layout
- u32 m_layout_xormask; // xor mask applied to each bit offset
- u32 m_layout_charincrement; // per-character increment in source data
- std::vector<u32> m_layout_planeoffset;// plane offsets
- std::vector<u32> m_layout_xoffset; // X offsets
- std::vector<u32> m_layout_yoffset; // Y offsets
+ device_palette_interface *m_palette; // palette used for drawing (optional when used as a pure decoder)
+
+ u16 m_width; // current pixel width of each element (changeable with source clipping)
+ u16 m_height; // current pixel height of each element (changeable with source clipping)
+ u16 m_startx; // current source clip X offset
+ u16 m_starty; // current source clip Y offset
+
+ u16 m_origwidth; // starting pixel width of each element
+ u16 m_origheight; // staring pixel height of each element
+ u32 m_total_elements; // total number of decoded elements
+
+ u32 m_color_base; // base color for rendering
+ u16 m_color_depth; // number of colors each pixel can represent
+ u16 m_color_granularity; // number of colors for each color code
+ u32 m_total_colors; // number of color codes
+
+ u32 m_line_modulo; // bytes between each row of data
+ u32 m_char_modulo; // bytes between each element
+ const u8 * m_srcdata; // pointer to the source data for decoding
+ u32 m_dirtyseq; // sequence number; incremented each time a tile is dirtied
+
+ u16 * m_gfxdata; // pointer to decoded pixel data, 16bpp
+ std::vector<u16> m_gfxdata_allocated; // allocated decoded pixel data, 8bpp
+ std::vector<u8> m_dirty; // dirty array for detecting chars that need decoding
+ std::vector<u32> m_pen_usage; // bitmask of pens that are used (pens 0-31 only)
+
+ bool m_layout_is_raw; // raw layout?
+ bool m_layout_is_16bpp; // 16bpp raw layout?
+ u8 m_layout_planes; // bit planes in the layout
+ u32 m_layout_xormask; // xor mask applied to each bit offset
+ u32 m_layout_charincrement; // per-character increment in source data
+ std::vector<u32> m_layout_planeoffset; // plane offsets
+ std::vector<u32> m_layout_xoffset; // X offsets
+ std::vector<u32> m_layout_yoffset; // Y offsets
};
diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h
index 6361ed8bf92..e6f2b363272 100644
--- a/src/emu/drawgfxm.h
+++ b/src/emu/drawgfxm.h
@@ -470,7 +470,7 @@ while (0)
do { \
g_profiler.start(PROFILER_DRAWGFX); \
do { \
- const u8 *srcdata; \
+ const u16 *srcdata; \
s32 destendx, destendy; \
s32 srcx, srcy; \
s32 curx, cury; \
@@ -549,7 +549,7 @@ do {
{ \
PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const u8 *srcptr = srcdata; \
+ const u16 *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
@@ -584,7 +584,7 @@ do {
{ \
PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const u8 *srcptr = srcdata; \
+ const u16 *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
@@ -642,7 +642,7 @@ do {
do { \
g_profiler.start(PROFILER_DRAWGFX); \
do { \
- const u8 *srcdata; \
+ const u16 *srcdata; \
u32 dstwidth, dstheight; \
s32 destendx, destendy; \
s32 srcx, srcy; \
@@ -730,7 +730,7 @@ do {
{ \
PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const u8 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \
+ const u16 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \
s32 cursrcx = srcx; \
srcy += dy; \
\
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index c5c0ff16ad3..460e511336e 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -401,7 +401,7 @@ tilemap_t &tilemap_t::init(tilemap_manager &manager, device_gfx_interface &decod
// set up the default tile data
memset(&m_tileinfo, 0, sizeof(m_tileinfo));
m_tileinfo.decoder = &decoder;
- m_tileinfo.pen_mask = 0xff;
+ m_tileinfo.pen_mask = 0xffff;
m_tileinfo.gfxnum = 0xff;
// allocate transparency mapping data
@@ -780,7 +780,7 @@ g_profiler.stop();
// the palette_base
//-------------------------------------------------
-u8 tilemap_t::tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u8 pen_mask)
+u8 tilemap_t::tile_draw(const u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u16 pen_mask)
{
// OR in the force layer flags
category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2);
@@ -816,7 +816,7 @@ u8 tilemap_t::tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8
int xoffs = 0;
for (u16 tx = 0; tx < m_tilewidth; tx++)
{
- u8 pen = (*pendata++) & pen_mask;
+ u16 pen = (*pendata++) & pen_mask;
u8 map = penmap[pen];
pixptr[xoffs] = palette_base + pen;
flagsptr[xoffs] = map | category;
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 15794247a4f..d73b3a23ef0 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -372,13 +372,13 @@ typedef u32 tilemap_memory_index;
struct tile_data
{
device_gfx_interface *decoder; // set in tilemap_t::init()
- const u8 * pen_data; // required
+ const u16 * pen_data; // required
const u8 * mask_data; // required
pen_t palette_base; // defaults to 0
u8 category; // defaults to 0; range from 0..15
u8 group; // defaults to 0; range from 0..TILEMAP_NUM_GROUPS
u8 flags; // defaults to 0; one or more of TILE_* flags above
- u8 pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile
+ u16 pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile
u8 gfxnum; // defaults to 0xff; specify index of gfx for auto-invalidation on dirty
u32 code;
@@ -421,7 +421,7 @@ class tilemap_t
static const logical_index INVALID_LOGICAL_INDEX = (logical_index)~0;
// maximum index in each array
- static const pen_t MAX_PEN_TO_FLAGS = 256;
+ static const pen_t MAX_PEN_TO_FLAGS = 65536;
protected:
// tilemap_manager controls our allocations
@@ -548,7 +548,7 @@ private:
// internal drawing
void pixmap_update();
void tile_update(logical_index logindex, u32 col, u32 row);
- u8 tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u8 pen_mask);
+ u8 tile_draw(const u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u16 pen_mask);
u8 tile_apply_bitmask(const u8 *maskdata, u32 x0, u32 y0, u8 category, u8 flags);
void configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, u32 flags, u8 priority, u8 priority_mask);
template<class _BitmapClass> void draw_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, u32 flags, u8 priority, u8 priority_mask);
diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp
index 1dd210fa88a..04a4870eaa6 100644
--- a/src/frontend/mame/ui/viewgfx.cpp
+++ b/src/frontend/mame/ui/viewgfx.cpp
@@ -714,7 +714,7 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui
ypixel = (cellypix - 2) - ypixel;
if (info.rotate[set] & ORIENTATION_SWAP_XY)
std::swap(xpixel, ypixel);
- uint8_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()];
+ uint16_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()];
util::stream_format(title_buf, " #%X:%X @ %d,%d = %X",
code, info.color[set], xpixel, ypixel,
gfx.colorbase() + info.color[set] * gfx.granularity() + pixdata);
@@ -982,13 +982,13 @@ static void gfxset_draw_item(running_machine &machine, gfx_element &gfx, int ind
for (y = 0; y < height; y++)
{
uint32_t *dest = &bitmap.pix32(dsty + y, dstx);
- const uint8_t *src = gfx.get_data(index);
+ const uint16_t *src = gfx.get_data(index);
// loop over columns in the cell
for (x = 0; x < width; x++)
{
int effx = x, effy = y;
- const uint8_t *s;
+ const uint16_t *s;
// compute effective x,y values after rotation
if (!(rotate & ORIENTATION_SWAP_XY))
diff --git a/src/mame/drivers/1945kiii.cpp b/src/mame/drivers/1945kiii.cpp
index a17c8ad962a..ca2b22d41c5 100644
--- a/src/mame/drivers/1945kiii.cpp
+++ b/src/mame/drivers/1945kiii.cpp
@@ -129,7 +129,7 @@ void k3_state::k3_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_eleme
{
/* Start drawing */
const u16 pal = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
int xinc = flipx ? -1 : 1;
int yinc = flipy ? -1 : 1;
@@ -171,12 +171,12 @@ void k3_state::k3_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_eleme
{ // skip if inner loop doesn't draw anything
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + y_index * gfx->rowbytes();
+ const u16 *source = source_base + y_index * gfx->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
- u8 c = source[x_index];
+ const u16 c = source[x_index];
if (c != transparent_color)
{
if (flicker) // verified from PCB (reference : https://www.youtube.com/watch?v=ooXyyvpW1O0)
diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp
index c3ebc08de7b..7982b28ee9c 100644
--- a/src/mame/drivers/acefruit.cpp
+++ b/src/mame/drivers/acefruit.cpp
@@ -179,7 +179,7 @@ uint32_t acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_in
for( x = 0; x < 16; x++ )
{
int sprite = ( m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf;
- const uint8_t *gfxdata = gfx->get_data(sprite);
+ const uint16_t *gfxdata = gfx->get_data(sprite);
for( y = 0; y < 8; y++ )
{
diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp
index 0a18960d945..b04b04270d6 100644
--- a/src/mame/drivers/aquarium.cpp
+++ b/src/mame/drivers/aquarium.cpp
@@ -341,14 +341,14 @@ void aquarium_state::expand_gfx(int low, int hi)
u8 *dest = srcdata;
for (int c = 0; c < gfx_l->elements(); c++)
{
- const u8 *c0base = gfx_l->get_data(c);
- const u8 *c1base = gfx_h->get_data(c);
+ const u16 *c0base = gfx_l->get_data(c);
+ const u16 *c1base = gfx_h->get_data(c);
// loop over height
for (int y = 0; y < gfx_l->height(); y++)
{
- const u8 *c0 = c0base;
- const u8 *c1 = c1base;
+ const u16 *c0 = c0base;
+ const u16 *c1 = c1base;
for (int x = 0; x < gfx_l->width(); x++)
{
diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp
index 4bc6129aeb0..7cae64bde71 100644
--- a/src/mame/drivers/coolridr.cpp
+++ b/src/mame/drivers/coolridr.cpp
@@ -589,7 +589,7 @@ void coolridr_state::video_start()
#define COOLRIDERS_DRAWGFX_CORE(PIXEL_TYPE, COOL_PIXEL_OP) \
do { \
do { \
- const uint8_t *srcdata; \
+ const uint16_t *srcdata; \
int32_t destendx, destendy; \
int32_t srcx, srcy; \
int32_t curx, cury; \
@@ -667,7 +667,7 @@ do {
for (cury = desty; cury <= destendy; cury++) \
{ \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const uint8_t *srcptr = srcdata; \
+ const uint16_t *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
@@ -699,7 +699,7 @@ do {
for (cury = desty; cury <= destendy; cury++) \
{ \
PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \
- const uint8_t *srcptr = srcdata; \
+ const uint16_t *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp
index 5986ad19a8a..508e079a174 100644
--- a/src/mame/drivers/cps3.cpp
+++ b/src/mame/drivers/cps3.cpp
@@ -529,7 +529,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
// const pen_t *pal = &gfx->colortable[gfx->granularity() * (color % gfx->colors())];
u32 palbase = (gfx->granularity() * color) & 0x1ffff;
const pen_t *pal = &m_mame_colours[palbase];
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16;
int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16;
@@ -595,7 +595,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
@@ -611,7 +611,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
@@ -628,7 +628,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
@@ -645,7 +645,7 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;
diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp
index 947eaced689..0bb7ddc9671 100644
--- a/src/mame/drivers/gamecstl.cpp
+++ b/src/mame/drivers/gamecstl.cpp
@@ -138,7 +138,7 @@ void gamecstl_state::video_start()
void gamecstl_state::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
{
int i,j;
- const uint8_t *dp;
+ const uint16_t *dp;
int index = 0;
dp = gfx->get_data(ch);
diff --git a/src/mame/drivers/gstream.cpp b/src/mame/drivers/gstream.cpp
index 42cc5dc63ad..127ee1ac57f 100644
--- a/src/mame/drivers/gstream.cpp
+++ b/src/mame/drivers/gstream.cpp
@@ -183,6 +183,7 @@ private:
int m_oki_bank[2];
int m_toggle;
int m_xoffset;
+ bool m_is_rgb;
DECLARE_WRITE32_MEMBER(vram_w);
template<int Layer> DECLARE_WRITE16_MEMBER(scrollx_w);
@@ -198,11 +199,8 @@ private:
virtual void video_start() override;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram);
- void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2,
- uint32_t code, int flipx, int flipy, int32_t destx, int32_t desty);
-
- void rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2);
- void rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2);
+ void drawgfx_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx,
+ u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy);
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -549,23 +547,44 @@ static const gfx_layout layout32x32 =
32*32*8,
};
+
+static const gfx_layout layout16x16x16 =
+{
+ 16,16,
+ RGN_FRAC(1,1),
+ 16,
+ { STEP16(0,1) },
+ { STEP16(0,16) },
+ { STEP16(0,16*16) },
+ 16*16*16,
+};
+
+
+static const gfx_layout layout32x32x16 =
+{
+ 32,32,
+ RGN_FRAC(1,1),
+ 16,
+ { STEP16(0,1) },
+ { STEP32(0,16) },
+ { STEP32(0,16*32) },
+ 32*32*16,
+};
+
+
static GFXDECODE_START( gfx_gstream )
- GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0x1000, 4 )
- GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0x1400, 4 )
- GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0x1800, 4 )
+ GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0x1000, 4 )
+ GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0x1400, 4 )
+ GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0x1800, 4 )
GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0, 32 )
GFXDECODE_END
static GFXDECODE_START( gfx_x2222 )
- GFXDECODE_ENTRY( "gfx2", 0, layout32x32, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx3", 0, layout32x32, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx4", 0, layout32x32, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx1", 0, layout16x16, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx1_lower", 0, layout16x16, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx2_lower", 0, layout32x32, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx3_lower", 0, layout32x32, 0, 0x80 )
- GFXDECODE_ENTRY( "gfx4_lower", 0, layout32x32, 0, 0x80 )
+ GFXDECODE_ENTRY( "gfx2", 0, layout32x32x16, 0, 1 )
+ GFXDECODE_ENTRY( "gfx3", 0, layout32x32x16, 0, 1 )
+ GFXDECODE_ENTRY( "gfx4", 0, layout32x32x16, 0, 1 )
+ GFXDECODE_ENTRY( "gfx1", 0, layout16x16x16, 0, 1 )
GFXDECODE_END
@@ -574,152 +593,67 @@ void gstream_state::video_start()
}
-// custom drawgfx function for x2222 to draw RGB data instead of indexed data, needed because our regular drawgfx and tilemap code don't support that
-void gstream_state::drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2,
- uint32_t code, int flipx, int flipy, int32_t destx, int32_t desty)
+void gstream_state::drawgfx_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx,
+ u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy)
{
- // use pen usage to optimize
- code %= gfx->elements();
- const pen_t *rgb = m_palette->pens(); // 16 bit BGR
-
- // render
-
- do {
- g_profiler.start(PROFILER_DRAWGFX);
- do {
- const uint8_t *srcdata, *srcdata2;
- int32_t destendx, destendy;
- int32_t srcx, srcy;
- int32_t curx, cury;
- int32_t dy;
-
- assert(dest.valid());
- assert(gfx != nullptr);
- assert(dest.cliprect().contains(cliprect));
- assert(code < gfx->elements());
-
- /* ignore empty/invalid cliprects */
- if (cliprect.empty())
- break;
-
- /* compute final pixel in X and exit if we are entirely clipped */
- destendx = destx + gfx->width() - 1;
- if (destx > cliprect.max_x || destendx < cliprect.min_x)
- break;
-
- /* apply left clip */
- srcx = 0;
- if (destx < cliprect.min_x)
- {
- srcx = cliprect.min_x - destx;
- destx = cliprect.min_x;
- }
-
- /* apply right clip */
- if (destendx > cliprect.max_x)
- destendx = cliprect.max_x;
+ /* Start drawing */
+ const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
- /* compute final pixel in Y and exit if we are entirely clipped */
- destendy = desty + gfx->height() - 1;
- if (desty > cliprect.max_y || destendy < cliprect.min_y)
- break;
+ int xinc = flipx ? -1 : 1;
+ int yinc = flipy ? -1 : 1;
- /* apply top clip */
- srcy = 0;
- if (desty < cliprect.min_y)
- {
- srcy = cliprect.min_y - desty;
- desty = cliprect.min_y;
- }
+ int x_index_base = flipx ? gfx->width() - 1 : 0;
+ int y_index = flipy ? gfx->height() - 1 : 0;
- /* apply bottom clip */
- if (destendy > cliprect.max_y)
- destendy = cliprect.max_y;
+ // start coordinates
+ int sx = offsx;
+ int sy = offsy;
- /* apply X flipping */
- if (flipx)
- srcx = gfx->width() - 1 - srcx;
+ // end coordinates
+ int ex = sx + gfx->width();
+ int ey = sy + gfx->height();
- /* apply Y flipping */
- dy = gfx->rowbytes();
- if (flipy)
- {
- srcy = gfx->height() - 1 - srcy;
- dy = -dy;
- }
-
- /* fetch the source data */
- srcdata = gfx->get_data(code);
- srcdata2 = gfx2->get_data(code);
-
- /* compute how many blocks of 4 pixels we have */
- uint32_t leftovers = (destendx + 1 - destx);
-
- /* adjust srcdata to point to the first source pixel of the row */
- srcdata += srcy * gfx->rowbytes() + srcx;
- srcdata2 += srcy * gfx->rowbytes() + srcx;
+ if (sx < clip.min_x)
+ { // clip left
+ int pixels = clip.min_x - sx;
+ sx += pixels;
+ x_index_base += xinc * pixels;
+ }
+ if (sy < clip.min_y)
+ { // clip top
+ int pixels = clip.min_y - sy;
+ sy += pixels;
+ y_index += yinc * pixels;
+ }
+ // NS 980211 - fixed incorrect clipping
+ if (ex > clip.max_x + 1)
+ { // clip right
+ ex = clip.max_x + 1;
+ }
+ if (ey > clip.max_y + 1)
+ { // clip bottom
+ ey = clip.max_y + 1;
+ }
- /* non-flipped 16bpp case */
- if (!flipx)
+ if (ex > sx)
+ { // skip if inner loop doesn't draw anything
+ for (int y = sy; y < ey; y++)
+ {
+ const u16 *source = source_base + y_index * gfx->rowbytes();
+ u32 *dest = &bitmap.pix32(y);
+ int x_index = x_index_base;
+ for (int x = sx; x < ex; x++)
{
- /* iterate over pixels in Y */
- for (cury = desty; cury <= destendy; cury++)
- {
- uint32_t *destptr = &dest.pix32(cury, destx);
- const uint8_t *srcptr = srcdata;
- const uint8_t *srcptr2 = srcdata2;
- srcdata += dy;
- srcdata2 += dy;
-
- /* iterate over leftover pixels */
- for (curx = 0; curx < leftovers; curx++)
- {
- uint32_t srcdata = (srcptr[0]);
- uint32_t srcdata2 = (srcptr2[0]);
-
- uint16_t full = (srcdata | (srcdata2 << 8));
- if (full != 0)
- destptr[0] = rgb[full];
-
- srcptr++;
- srcptr2++;
- destptr++;
- }
- }
- }
+ const u16 c = source[x_index];
+ if (c != 0) // draw this pixel when rom data is not 0
+ dest[x] = pal[c];
- /* flipped 16bpp case */
- else
- {
- /* iterate over pixels in Y */
- for (cury = desty; cury <= destendy; cury++)
- {
- uint32_t *destptr = &dest.pix32(cury, destx);
- const uint8_t *srcptr = srcdata;
- const uint8_t *srcptr2 = srcdata2;
-
- srcdata += dy;
- srcdata2 += dy;
-
- /* iterate over leftover pixels */
- for (curx = 0; curx < leftovers; curx++)
- {
- uint32_t srcdata = (srcptr[0]);
- uint32_t srcdata2 = (srcptr2[0]);
-
- uint16_t full = (srcdata | (srcdata2 << 8));
- if (full != 0)
- destptr[0] = rgb[full];
-
- srcptr--;
- srcptr2--;
- destptr++;
- }
- }
+ x_index += xinc;
}
- } while (0);
- g_profiler.stop();
- } while (0);
+ y_index += yinc;
+ }
+ }
}
void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram )
@@ -740,8 +674,8 @@ void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int
int pal = (vram_data & 0xc000) >> 14;
int code = (vram_data & 0x0fff);
- if (m_gfxdecode->gfx(map+5))
- drawgfx_transpen_x2222(bitmap,cliprect,m_gfxdecode->gfx(map),m_gfxdecode->gfx(map+5),code,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f));
+ if (m_is_rgb)
+ drawgfx_rgb(bitmap,cliprect,m_gfxdecode->gfx(map),code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f));
else
m_gfxdecode->gfx(map)->transpen(bitmap,cliprect,code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f),0);
@@ -775,12 +709,10 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
//popmessage("(1) %08x %08x (2) %08x %08x (3) %08x %08x", m_scrollx[0], m_scrolly[0], m_scrollx[1], m_scrolly[1], m_scrollx[2], m_scrolly[2] );
bitmap.fill(0,cliprect);
-
draw_bg(bitmap, cliprect, 2, m_vram + 0x800/4);
draw_bg(bitmap, cliprect, 1, m_vram + 0x400/4);
draw_bg(bitmap, cliprect, 0, m_vram + 0x000/4); // move on top for x2222 , check
-
for (i = 0x0000 / 4; i < 0x4000 / 4; i += 4)
{
/* Upper bits are used by the tilemaps */
@@ -789,13 +721,12 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
int y = m_vram[i + 2] & 0xff;
int col = m_vram[i + 3] & 0x1f;
- if (m_gfxdecode->gfx(4))
+ if (m_is_rgb)
{
- drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset, y);
- drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset, y-0x100);
- drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset - 0x200, y);
- drawgfx_transpen_x2222(bitmap, cliprect, m_gfxdecode->gfx(3), m_gfxdecode->gfx(4), code, 0, 0, x - m_xoffset - 0x200 , y-0x100);
-
+ drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset, y);
+ drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset, y-0x100);
+ drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset - 0x200, y);
+ drawgfx_rgb(bitmap, cliprect, m_gfxdecode->gfx(3), code, col, 0, 0, x - m_xoffset - 0x200, y-0x100);
}
else
{
@@ -803,7 +734,6 @@ uint32_t gstream_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma
m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset, y-0x100, 0);
m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset - 0x200, y, 0);
m_gfxdecode->gfx(3)->transpen(bitmap, cliprect, code, col, 0, 0, x - m_xoffset - 0x200, y-0x100, 0);
-
}
}
return 0;
@@ -938,53 +868,28 @@ ROM_START( x2222 )
ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */
ROM_LOAD( "test.hye", 0x000000, 0x0112dda, CRC(c1142b2f) SHA1(5807930820a53604013a6ac66e4d4ebe3628e1fc) ) // the above binary was built from this
- /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- /* 2nd 8-bits */
- ROM_REGION( 0x800000, "gfx1_lower", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx2_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx3_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx4_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x1000000, "sprites", 0 ) /* sprite tiles (16x16x16) */
- ROM_LOAD( "spr11.bin", 0x000000, 0x200000, CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
- ROM_LOAD( "spr21.bin", 0x200000, 0x1b8b00, CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
- ROM_LOAD( "spr12.bin", 0x400000, 0x200000, CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
- ROM_LOAD( "spr22.bin", 0x600000, 0x1b8b00, CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
- ROM_LOAD( "spr13.bin", 0x800000, 0x200000, CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
- ROM_LOAD( "spr23.bin", 0xa00000, 0x1b8b00, CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
- ROM_LOAD( "spr14.bin", 0xc00000, 0x200000, CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
- ROM_LOAD( "spr24.bin", 0xe00000, 0x1b8b00, CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
-
- ROM_REGION( 0x400000, "bg1", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD16_BYTE( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
- ROM_LOAD16_BYTE( "bg32.bin", 0x000001, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
-
- ROM_REGION( 0x400000, "bg2", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD16_BYTE( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
- ROM_LOAD16_BYTE( "bg22.bin", 0x000001, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
-
- ROM_REGION( 0x400000, "bg3", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD16_BYTE( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
- ROM_LOAD16_BYTE( "bg12.bin", 0x000001, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
+ /* x2222 uses raw rgb16 data rather than 8bpp indexed */
+ ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprite tiles (16x16x16) */
+ ROM_LOAD64_WORD_SWAP( "spr11.bin", 0x000000, 0x200000, CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
+ ROM_LOAD64_WORD_SWAP( "spr21.bin", 0x800000, 0x1b8b00, CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
+ ROM_LOAD64_WORD_SWAP( "spr12.bin", 0x000002, 0x200000, CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
+ ROM_LOAD64_WORD_SWAP( "spr22.bin", 0x800002, 0x1b8b00, CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
+ ROM_LOAD64_WORD_SWAP( "spr13.bin", 0x000004, 0x200000, CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
+ ROM_LOAD64_WORD_SWAP( "spr23.bin", 0x800004, 0x1b8b00, CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
+ ROM_LOAD64_WORD_SWAP( "spr14.bin", 0x000006, 0x200000, CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
+ ROM_LOAD64_WORD_SWAP( "spr24.bin", 0x800006, 0x1b8b00, CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
+
+ ROM_REGION( 0x400000, "gfx2", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD32_WORD_SWAP( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
+ ROM_LOAD32_WORD_SWAP( "bg32.bin", 0x000002, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
+
+ ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD32_WORD_SWAP( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
+ ROM_LOAD32_WORD_SWAP( "bg22.bin", 0x000002, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
+
+ ROM_REGION( 0x400000, "gfx4", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD32_WORD_SWAP( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
+ ROM_LOAD32_WORD_SWAP( "bg12.bin", 0x000002, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
// no idea what the sound hw is?
ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 )
@@ -1000,53 +905,28 @@ ROM_START( x2222o )
ROM_REGION32_BE( 0x0200000, "misc", 0 ) /* other code */
ROM_LOAD( "older.hye", 0x000000, 0x010892f, CRC(cf3a004e) SHA1(1cba64cfa235b9540f33a5ee0cc02dfd267e00fc) ) // this corresponds to the older.bin we're using, for reference
- /* x2222 uses raw rgb16 data rather than 8bpp indexed, in order to use the same gfx decodes with a custom draw routine we arrange the data into 2 8bpp regions on init */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx4", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- /* 2nd 8-bits */
- ROM_REGION( 0x800000, "gfx1_lower", ROMREGION_ERASE00 ) /* sprite tiles (16x16x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx2_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx3_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x200000, "gfx4_lower", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
- /* filled in at init*/
-
- ROM_REGION( 0x1000000, "sprites", 0 ) /* sprite tiles (16x16x16) */ // these sprite ROMs have the Boss tiles in the wrong location for the prototype program rom
- ROM_LOAD( "spr11.bin", 0x000000, 0x200000, BAD_DUMP CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
- ROM_LOAD( "spr21.bin", 0x200000, 0x1b8b00, BAD_DUMP CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
- ROM_LOAD( "spr12.bin", 0x400000, 0x200000, BAD_DUMP CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
- ROM_LOAD( "spr22.bin", 0x600000, 0x1b8b00, BAD_DUMP CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
- ROM_LOAD( "spr13.bin", 0x800000, 0x200000, BAD_DUMP CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
- ROM_LOAD( "spr23.bin", 0xa00000, 0x1b8b00, BAD_DUMP CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
- ROM_LOAD( "spr14.bin", 0xc00000, 0x200000, BAD_DUMP CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
- ROM_LOAD( "spr24.bin", 0xe00000, 0x1b8b00, BAD_DUMP CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
-
- ROM_REGION( 0x400000, "bg1", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD16_BYTE( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
- ROM_LOAD16_BYTE( "bg32.bin", 0x000001, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
-
- ROM_REGION( 0x400000, "bg2", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD16_BYTE( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
- ROM_LOAD16_BYTE( "bg22.bin", 0x000001, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
-
- ROM_REGION( 0x400000, "bg3", 0 ) /* bg tiles (32x32x16) */
- ROM_LOAD16_BYTE( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
- ROM_LOAD16_BYTE( "bg12.bin", 0x000001, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
+ /* x2222 uses raw rgb16 data rather than 8bpp indexed */
+ ROM_REGION( 0x1000000, "gfx1", 0 ) /* sprite tiles (16x16x16) */ // these sprite ROMs have the Boss tiles in the wrong location for the prototype program rom
+ ROM_LOAD64_WORD_SWAP( "spr11.bin", 0x000000, 0x200000, BAD_DUMP CRC(1d15b444) SHA1(27ace509a7e4ec2e62453636acf444a861bb85ce) )
+ ROM_LOAD64_WORD_SWAP( "spr21.bin", 0x800000, 0x1b8b00, BAD_DUMP CRC(1c392be2) SHA1(775882f588a8bef33a79fa4f25754a47dc82cb30) )
+ ROM_LOAD64_WORD_SWAP( "spr12.bin", 0x000002, 0x200000, BAD_DUMP CRC(73225936) SHA1(50507c52b932198659e08d22d3c0a92e7c69e5ba) )
+ ROM_LOAD64_WORD_SWAP( "spr22.bin", 0x800002, 0x1b8b00, BAD_DUMP CRC(cf7ebfa1) SHA1(c968dcf768e5598240f5a131414a5607899b4bef) )
+ ROM_LOAD64_WORD_SWAP( "spr13.bin", 0x000004, 0x200000, BAD_DUMP CRC(52595c51) SHA1(a161a5f433aa7aa2f7824ea6b9b70d73ca63b62d) )
+ ROM_LOAD64_WORD_SWAP( "spr23.bin", 0x800004, 0x1b8b00, BAD_DUMP CRC(d894461e) SHA1(14dccfa8c762d928eaea0ac4cfff7d1272b69fdd) )
+ ROM_LOAD64_WORD_SWAP( "spr14.bin", 0x000006, 0x200000, BAD_DUMP CRC(f6cd6599) SHA1(170ea7a9a26fd8038df53fb333357766dabbe7c2) )
+ ROM_LOAD64_WORD_SWAP( "spr24.bin", 0x800006, 0x1b8b00, BAD_DUMP CRC(9542cb08) SHA1(d40c1f0b7d3e9deb12284c2f2c2df0ac43cb6cd2) )
+
+ ROM_REGION( 0x400000, "gfx2", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD32_WORD_SWAP( "bg31.bin", 0x000000, 0x11ac00, CRC(12e67bc2) SHA1(18618a8931af3b3aeab34fd50424a7ffb3da6458) )
+ ROM_LOAD32_WORD_SWAP( "bg32.bin", 0x000002, 0x11ac00, CRC(95afa0da) SHA1(e534bc0874329475ce7efa836000fe29fc76c44c) )
+
+ ROM_REGION( 0x400000, "gfx3", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD32_WORD_SWAP( "bg21.bin", 0x000000, 0x1c8400, CRC(a10220f8) SHA1(9aa43a8e23cdf55d8623d2694b04971eaced9ba9) )
+ ROM_LOAD32_WORD_SWAP( "bg22.bin", 0x000002, 0x1c8400, CRC(966f7c1d) SHA1(4699a3014c7e66d0dabd8d7982f43114b71181b7) )
+
+ ROM_REGION( 0x400000, "gfx4", 0 ) /* bg tiles (32x32x16) */
+ ROM_LOAD32_WORD_SWAP( "bg11.bin", 0x000000, 0x1bc800, CRC(68975462) SHA1(7a2458a3d2465b727f4f5bf45685f35eb4885975) )
+ ROM_LOAD32_WORD_SWAP( "bg12.bin", 0x000002, 0x1bc800, CRC(feef1240) SHA1(9eb123a19ade74d8b3ce4df0b04ca97c03fb9fdc) )
// no idea what the sound hw is?
ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 )
@@ -1091,40 +971,17 @@ void gstream_state::init_gstream()
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd1ee0, 0xd1ee3, read32_delegate(FUNC(gstream_state::gstream_speedup_r), this));
m_xoffset = 2;
+ m_is_rgb = false;
}
-void gstream_state::rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2)
-{
- int i;
- for (i = 0; i < 0x80000; i++)
- {
- NEW[i] = (ROM[(i * 8) + 0x000000] << 0) | (ROM[(i * 8) + 0x000001] << 8) | (ROM[(i * 8) + 0x000004] << 16) | (ROM[(i * 8) + 0x000005] << 24);
- NEW2[i] = (ROM[(i * 8) + 0x000002] << 0) | (ROM[(i * 8) + 0x000003] << 8) | (ROM[(i * 8) + 0x000006] << 16) | (ROM[(i * 8) + 0x000007] << 24);
- }
-}
-
-void gstream_state::rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2)
-{
- int i;
- for (i = 0; i < 0x200000; i++)
- {
- NEW[i] = (ROM[(i * 2) + 0xc00000] << 24) | (ROM[(i * 2) + 0x800000] << 16) | (ROM[(i * 2) + 0x400000] << 8) | (ROM[(i * 2) + 0x000000] << 0);
- NEW2[i] = (ROM[(i * 2) + 0xc00001] << 24) | (ROM[(i * 2) + 0x800001] << 16) | (ROM[(i * 2) + 0x400001] << 8) | (ROM[(i * 2) + 0x000001] << 0);
- }
-}
-
void gstream_state::init_x2222()
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0x7ffac, 0x7ffaf, read32_delegate(FUNC(gstream_state::x2222_speedup_r), this)); // older
m_maincpu->space(AS_PROGRAM).install_read_handler(0x84e3c, 0x84e3f, read32_delegate(FUNC(gstream_state::x2222_speedup2_r), this)); // newer
- rearrange_sprite_data(memregion("sprites")->base(), (uint32_t*)memregion("gfx1")->base(), (uint32_t*)memregion("gfx1_lower")->base() );
- rearrange_tile_data(memregion("bg1")->base(), (uint32_t*)memregion("gfx2")->base(), (uint32_t*)memregion("gfx2_lower")->base());
- rearrange_tile_data(memregion("bg2")->base(), (uint32_t*)memregion("gfx3")->base(), (uint32_t*)memregion("gfx3_lower")->base());
- rearrange_tile_data(memregion("bg3")->base(), (uint32_t*)memregion("gfx4")->base(), (uint32_t*)memregion("gfx4_lower")->base());
-
m_xoffset = 0;
+ m_is_rgb = true;
}
diff --git a/src/mame/drivers/hp9k.cpp b/src/mame/drivers/hp9k.cpp
index c10eed0913b..75215a1e8b9 100644
--- a/src/mame/drivers/hp9k.cpp
+++ b/src/mame/drivers/hp9k.cpp
@@ -353,7 +353,7 @@ GFXDECODE_END
void hp9k_state::putChar(uint8_t thec,int x,int y,bitmap_ind16 &bitmap)
{
- const uint8_t* pchar=m_gfxdecode->gfx(0)->get_data(thec);
+ const uint16_t* pchar=m_gfxdecode->gfx(0)->get_data(thec);
for (int py=0;py<HP9816_CHDIMY;py++)
{
diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp
index 61f4cfae945..5d6b36d1ce1 100644
--- a/src/mame/drivers/mediagx.cpp
+++ b/src/mame/drivers/mediagx.cpp
@@ -276,7 +276,7 @@ void mediagx_state::video_start()
void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
{
int i,j;
- const uint8_t *dp;
+ const uint16_t *dp;
int index = 0;
const pen_t *pens = &m_palette->pen(0);
@@ -287,7 +287,7 @@ void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, g
uint32_t *p = &bitmap.pix32(j);
for (i=x; i < x+8; i++)
{
- uint8_t pen = dp[index++];
+ uint16_t pen = dp[index++];
if (pen)
p[i] = pens[gfx->colorbase() + (att & 0xf)];
else
diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp
index 38311f62c20..b90d5df28a1 100644
--- a/src/mame/drivers/mpu4vid.cpp
+++ b/src/mame/drivers/mpu4vid.cpp
@@ -416,7 +416,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(mpu4vid_state::display_pixels)
if(!lg)
{
uint16_t tile = m_vid_mainram[address & 0x7fff];
- const uint8_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff);
+ const uint16_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff);
int offset = m_gfxdecode->gfx(m_gfx_index+0)->rowbytes() * linecount;
for(int i = 0; i < 8; i++)
bitmap.pix32(y, x + i) = (tile >> 12) ? m_palette->pen(line[offset + i]) : m_palette->black_pen();
diff --git a/src/mame/drivers/pinball2k.cpp b/src/mame/drivers/pinball2k.cpp
index 6d337040e06..c301f55354a 100644
--- a/src/mame/drivers/pinball2k.cpp
+++ b/src/mame/drivers/pinball2k.cpp
@@ -166,7 +166,7 @@ void pinball2k_state::video_start()
void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
{
int i,j;
- const uint8_t *dp;
+ const uint16_t *dp;
int index = 0;
const pen_t *pens = m_palette->pens();
@@ -177,7 +177,7 @@ void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect,
uint32_t *p = &bitmap.pix32(j);
for (i=x; i < x+8; i++)
{
- uint8_t pen = dp[index++];
+ uint16_t pen = dp[index++];
if (pen)
p[i] = pens[gfx->colorbase() + (att & 0xf)];
else
diff --git a/src/mame/drivers/scyclone.cpp b/src/mame/drivers/scyclone.cpp
index c85861d269f..a2c9aeeb2e6 100644
--- a/src/mame/drivers/scyclone.cpp
+++ b/src/mame/drivers/scyclone.cpp
@@ -126,7 +126,7 @@ private:
uint8_t m_hascollided;
/* video-related */
- const uint8_t get_sprite_pixel(int x, int y);
+ const uint16_t get_sprite_pixel(int x, int y);
const uint8_t get_bitmap_pixel(int x, int y);
uint32_t draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
uint32_t draw_bitmap_and_sprite(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -158,7 +158,7 @@ void scyclone_state::video_start()
}
}
-const uint8_t scyclone_state::get_sprite_pixel(int x, int y)
+const uint16_t scyclone_state::get_sprite_pixel(int x, int y)
{
int minx = 0xe0-m_sprite_xpos;
int miny = 0xe0-m_sprite_ypos;
@@ -178,9 +178,9 @@ const uint8_t scyclone_state::get_sprite_pixel(int x, int y)
int sprx = x-minx;
int spry = y-miny;
- const uint8_t* srcdata = m_gfxdecode->gfx(0)->get_data(code);
+ const uint16_t* srcdata = m_gfxdecode->gfx(0)->get_data(code);
- uint8_t pix = srcdata[spry*32 + sprx] + col*4;
+ uint16_t pix = srcdata[spry*32 + sprx] + col*4;
return pix;
}
@@ -275,7 +275,7 @@ uint32_t scyclone_state::draw_bitmap_and_sprite(screen_device &screen, bitmap_rg
if (pal) bitmap.pix32(y, (x*8)+i) = paldata[pal];
- uint8_t pal2 = get_sprite_pixel(realx, realy);
+ uint16_t pal2 = get_sprite_pixel(realx, realy);
if (pal2 & 0x3)
{
diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp
index 5fdd5257d23..4bb9b1ce227 100644
--- a/src/mame/drivers/taito_f2.cpp
+++ b/src/mame/drivers/taito_f2.cpp
@@ -5298,14 +5298,14 @@ void taitof2_state::init_finalb()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const u8 *c0base = gx0->get_data(c);
- const u8 *c1base = gx1->get_data(c);
+ const u16 *c0base = gx0->get_data(c);
+ const u16 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const u8 *c0 = c0base;
- const u8 *c1 = c1base;
+ const u16 *c0 = c0base;
+ const u16 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
{
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index 13db66e85d1..2615e49bdba 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -4217,14 +4217,14 @@ void taito_f3_state::tile_decode()
dest = srcdata;
for (int c = 0; c < spr_gfx->elements(); c++)
{
- const u8 *c1base = spr_gfx->get_data(c);
- const u8 *c3base = spr_gfx_hi->get_data(c);
+ const u16 *c1base = spr_gfx->get_data(c);
+ const u16 *c3base = spr_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < spr_gfx->height(); y++)
{
- const u8 *c1 = c1base;
- const u8 *c3 = c3base;
+ const u16 *c1 = c1base;
+ const u16 *c3 = c3base;
/* Expand 2bits into 4bits format */
for (int x = 0; x < spr_gfx->width(); x++)
@@ -4251,14 +4251,14 @@ void taito_f3_state::tile_decode()
dest = srcdata;
for (int c = 0; c < pf_gfx->elements(); c++)
{
- const u8 *c0base = pf_gfx->get_data(c);
- const u8 *c2base = pf_gfx_hi->get_data(c);
+ const u16 *c0base = pf_gfx->get_data(c);
+ const u16 *c2base = pf_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < pf_gfx->height(); y++)
{
- const u8 *c0 = c0base;
- const u8 *c2 = c2base;
+ const u16 *c0 = c0base;
+ const u16 *c2 = c2base;
for (int x = 0; x < pf_gfx->width(); x++)
*dest++ = (*c0++ & 0xf) | (*c2++ & 0x30);
diff --git a/src/mame/drivers/zwackery.cpp b/src/mame/drivers/zwackery.cpp
index d9d7a5f4cc3..a361e938d69 100644
--- a/src/mame/drivers/zwackery.cpp
+++ b/src/mame/drivers/zwackery.cpp
@@ -210,14 +210,14 @@ void zwackery_state::video_start()
for (int code = 0; code < gfx0->elements(); code++)
{
const uint8_t *coldata = colordatabase + code * 32;
- const uint8_t *gfxdata0 = gfx0->get_data(code);
- const uint8_t *gfxdata2 = gfx2->get_data(code);
+ const uint16_t *gfxdata0 = gfx0->get_data(code);
+ const uint16_t *gfxdata2 = gfx2->get_data(code);
// assume 16 rows
for (int y = 0; y < 16; y++)
{
- const uint8_t *gd0 = gfxdata0;
- const uint8_t *gd2 = gfxdata2;
+ const uint16_t *gd0 = gfxdata0;
+ const uint16_t *gd2 = gfxdata2;
// 16 columns
for (int x = 0; x < 16; x++, gd0++, gd2++)
diff --git a/src/mame/includes/bbusters.h b/src/mame/includes/bbusters.h
index d078fe982d0..bfd451853c9 100644
--- a/src/mame/includes/bbusters.h
+++ b/src/mame/includes/bbusters.h
@@ -58,7 +58,7 @@ protected:
template<int Layer> DECLARE_WRITE16_MEMBER(pf_w);
DECLARE_WRITE8_MEMBER(coin_counter_w);
- const uint8_t *get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block);
+ const uint16_t *get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block);
void draw_block(screen_device &screen, bitmap_ind16 &dest,int x,int y,int size,int flipx,int flipy,uint32_t sprite,int color,int bank,int block,int priority);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const uint16_t *source, int bank);
diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h
index 21aa62441d0..83073b7611b 100644
--- a/src/mame/includes/cps1.h
+++ b/src/mame/includes/cps1.h
@@ -376,12 +376,12 @@ protected:
int m_palette_align;
int m_palette_size;
int m_stars_rom_size;
- uint8_t m_empty_tile[32*32];
+ uint16_t m_empty_tile[32*32];
int m_cps_version;
/* fcrash video config */
- uint8_t m_layer_enable_reg;
- uint8_t m_layer_mask_reg[4];
+ uint8_t m_layer_enable_reg;
+ uint8_t m_layer_mask_reg[4];
int m_layer_scroll1x_offset;
int m_layer_scroll2x_offset;
int m_layer_scroll3x_offset;
diff --git a/src/mame/includes/decocass.h b/src/mame/includes/decocass.h
index 4db894b4a30..4f503c52bdc 100644
--- a/src/mame/includes/decocass.h
+++ b/src/mame/includes/decocass.h
@@ -98,7 +98,7 @@ private:
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap_l;
tilemap_t *m_bg_tilemap_r;
- uint8_t m_empty_tile[16*16];
+ uint16_t m_empty_tile[16*16];
int32_t m_watchdog_count;
int32_t m_watchdog_flip;
int32_t m_color_missiles;
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index f61174d4457..c5f79889b25 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -126,7 +126,7 @@ struct namcos22_object_data
const u8 *czram;
/* sprites */
- const u8 *source;
+ const u16 *source;
int alpha;
int line_modulo;
int flipx;
@@ -234,7 +234,7 @@ public:
int m_poly_translucency;
u16 *m_texture_tilemap;
std::unique_ptr<u8[]> m_texture_tileattr;
- u8 *m_texture_tiledata;
+ u16 *m_texture_tiledata;
std::unique_ptr<u8[]> m_texture_ayx_to_pixel;
int m_is_ss22;
int m_mixer_flags;
diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h
index c9a43a26617..b0a5089d34a 100644
--- a/src/mame/includes/nemesis.h
+++ b/src/mame/includes/nemesis.h
@@ -85,7 +85,7 @@ private:
int m_tilemap_flip;
int m_flipscreen;
uint8_t m_irq_port_last;
- uint8_t m_blank_tile[8*8];
+ uint16_t m_blank_tile[8*8];
uint8_t m_palette_lookup[32];
/* misc */
diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h
index 61fc336788e..4588466f134 100644
--- a/src/mame/includes/seta2.h
+++ b/src/mame/includes/seta2.h
@@ -135,7 +135,7 @@ protected:
std::unique_ptr<uint16_t[]> m_private_spriteram;
private:
- void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int realline, int line, int opaque);
+ void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint16_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int realline, int line, int opaque);
inline void get_tile(uint16_t* spriteram, int is_16x16, int x, int y, int page, int& code, int& attr, int& flipx, int& flipy, int& color);
std::unique_ptr<uint32_t[]> m_realtilenumber;
diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h
index 0f5fd5727e3..18dd549342d 100644
--- a/src/mame/includes/snk.h
+++ b/src/mame/includes/snk.h
@@ -116,7 +116,7 @@ private:
int m_is_psychos;
uint8_t m_drawmode_table[16];
- uint8_t m_empty_tile[16*16];
+ uint16_t m_empty_tile[16*16];
int m_hf_posy;
int m_hf_posx;
int m_tc16_posy;
diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h
index b3220c936c1..e0cf26f11ad 100644
--- a/src/mame/includes/thepit.h
+++ b/src/mame/includes/thepit.h
@@ -52,7 +52,7 @@ private:
uint8_t m_flip_y;
tilemap_t *m_solid_tilemap;
tilemap_t *m_tilemap;
- std::unique_ptr<uint8_t[]> m_dummy_tile;
+ std::unique_ptr<uint16_t[]> m_dummy_tile;
uint8_t m_nmi_mask;
int m_question_address;
diff --git a/src/mame/machine/atarigen.cpp b/src/mame/machine/atarigen.cpp
index dd1f5329d87..bb01323951f 100644
--- a/src/mame/machine/atarigen.cpp
+++ b/src/mame/machine/atarigen.cpp
@@ -683,14 +683,14 @@ void atarigen_state::blend_gfx(int gfx0, int gfx1, int mask0, int mask1)
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const u8 *c0base = gx0->get_data(c);
- const u8 *c1base = gx1->get_data(c);
+ const u16 *c0base = gx0->get_data(c);
+ const u16 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const u8 *c0 = c0base;
- const u8 *c1 = c1base;
+ const u16 *c0 = c0base;
+ const u16 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
*dest++ = (*c0++ & mask0) | (*c1++ & mask1);
diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp
index fc20389b30f..ef1ece3b4c1 100644
--- a/src/mame/machine/megacd.cpp
+++ b/src/mame/machine/megacd.cpp
@@ -1068,7 +1068,7 @@ TILE_GET_INFO_MEMBER( sega_segacd_device::get_stampmap_32x32_16x16_tile_info )
// non-tilemap functions to get a pixel from a 'tilemap' based on the above, but looking up each pixel, as to avoid the heavy cache bitmap
-inline uint8_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos)
+inline uint16_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos)
{
const int tilesize = 4; // 0xf pixels
const int tilemapsize = 0x0f;
@@ -1102,11 +1102,11 @@ inline uint8_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xp
if (tileno==0) return 0x00;
- const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
+ const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
-inline uint8_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos)
+inline uint16_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos)
{
const int tilesize = 5; // 0x1f pixels
const int tilemapsize = 0x07;
@@ -1140,11 +1140,11 @@ inline uint8_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xp
if (tileno==0) return 0x00; // does this apply in this mode?
- const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
+ const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
-inline uint8_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos)
+inline uint16_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos)
{
const int tilesize = 4; // 0xf pixels
const int tilemapsize = 0xff;
@@ -1178,11 +1178,11 @@ inline uint8_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int
if (tileno==0) return 0x00; // does this apply in this mode
- const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
+ const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
-inline uint8_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos)
+inline uint16_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos)
{
const int tilesize = 5; // 0x1f pixels
const int tilemapsize = 0x7f;
@@ -1216,7 +1216,7 @@ inline uint8_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int
if (tileno==0) return 0x00;
- const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
+ const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
@@ -1464,7 +1464,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_stampsize_w )
// the lower 3 bits of segacd_imagebuffer_hdot_size are set
// this really needs to be doing it's own lookups rather than depending on the inefficient MAME cache..
-inline uint8_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y)
+inline uint16_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y)
{
/*
if (!srcbitmap)
@@ -1547,7 +1547,7 @@ WRITE16_MEMBER( sega_segacd_device::segacd_trace_vector_base_address_w )
for (count=0;count<(segacd_imagebuffer_hdot_size);count++)
{
//int i;
- uint8_t pix = 0x0;
+ uint16_t pix = 0x0;
pix = read_pixel_from_stampmap(srcbitmap, xbase>>(3+8), ybase>>(3+8));
diff --git a/src/mame/machine/megacd.h b/src/mame/machine/megacd.h
index aacb18d56a9..87bdb560dee 100644
--- a/src/mame/machine/megacd.h
+++ b/src/mame/machine/megacd.h
@@ -177,12 +177,12 @@ protected:
void SCD_GET_TILE_INFO_16x16_16x16( int& tile_region, int& tileno, int tile_index );
void SCD_GET_TILE_INFO_32x32_16x16( int& tile_region, int& tileno, int tile_index );
- uint8_t get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos);
- uint8_t get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos);
- uint8_t get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos);
- uint8_t get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos);
+ uint16_t get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos);
+ uint16_t get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos);
+ uint16_t get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos);
+ uint16_t get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos);
- uint8_t read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y);
+ uint16_t read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y);
virtual void device_start() override;
virtual void device_reset() override;
diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp
index 17cf6e660be..9431191ff22 100644
--- a/src/mame/machine/st0016.cpp
+++ b/src/mame/machine/st0016.cpp
@@ -496,7 +496,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip
int yloop, xloop;
int ypos, xpos;
int tileno;
- const uint8_t *srcgfx;
+ const uint16_t *srcgfx;
int gfxoffs;
ypos = sy + y0 * 8 + spr_dy;
xpos = sx + x0 * 8 + spr_dx;
@@ -641,7 +641,7 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &clipre
uint16_t *destline;
int yloop, xloop;
int ypos, xpos;
- const uint8_t *srcgfx;
+ const uint16_t *srcgfx;
int gfxoffs;
ypos = y * 8 + spr_dy;//+((st0016_vregs[j+2]==0xaf)?0x50:0);//hack for mayjinsen title screen
xpos = x * 8 + spr_dx;
diff --git a/src/mame/video/1943.cpp b/src/mame/video/1943.cpp
index d7262dec3a8..c24b9781fba 100644
--- a/src/mame/video/1943.cpp
+++ b/src/mame/video/1943.cpp
@@ -215,7 +215,7 @@ void _1943_state::_1943_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx
bitmap_ind8 &priority_bitmap = m_screen->priority();
/* Start drawing */
const u16 pal = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
const int xinc = flipx ? -1 : 1;
const int yinc = flipy ? -1 : 1;
@@ -257,7 +257,7 @@ void _1943_state::_1943_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx
{ // skip if inner loop doesn't draw anything
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + y_index * gfx->rowbytes();
+ const u16 *source = source_base + y_index * gfx->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
u8 *pri = &priority_bitmap.pix8(y);
int x_index = x_index_base;
@@ -265,7 +265,7 @@ void _1943_state::_1943_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx
{
if (!(pri[x] & 0x80))
{
- u8 c = source[x_index];
+ const u16 c = source[x_index];
if (c != transparent_color)
{
// the priority is actually selected by bit 3 of BMPROM.07
diff --git a/src/mame/video/armedf.cpp b/src/mame/video/armedf.cpp
index 5e15e0ff151..b6e5681e119 100644
--- a/src/mame/video/armedf.cpp
+++ b/src/mame/video/armedf.cpp
@@ -263,7 +263,7 @@ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,g
int transparent_color)
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const uint8_t *source_base = gfx->get_data(code % gfx->elements());
+ const uint16_t *source_base = gfx->get_data(code % gfx->elements());
int x_index_base, y_index, sx, sy, ex, ey;
int xinc, yinc;
@@ -310,7 +310,7 @@ void armedf_state::armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,g
{
for (y = sy; y < ey; y++)
{
- const uint8_t *source = source_base + y_index*gfx->rowbytes();
+ const uint16_t *source = source_base + y_index*gfx->rowbytes();
uint16_t *dest = &dest_bmp.pix16(y);
int x_index = x_index_base;
for (x = sx; x < ex; x++)
diff --git a/src/mame/video/bbusters.cpp b/src/mame/video/bbusters.cpp
index 41ad5fd5337..866a2d56ddd 100644
--- a/src/mame/video/bbusters.cpp
+++ b/src/mame/video/bbusters.cpp
@@ -94,7 +94,7 @@ void mechatt_state::video_start()
else if (dy&0x40) code+=32; \
else if (dx&0x40) code+=16
-inline const uint8_t *bbusters_state_base::get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block)
+inline const uint16_t *bbusters_state_base::get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block)
{
int code=0;
@@ -147,7 +147,7 @@ void bbusters_state_base::draw_block(screen_device &screen, bitmap_ind16 &dest,i
uint16_t *destline = &dest.pix16(dy);
uint8_t *priorityline = &screen.priority().pix8(dy);
uint8_t srcline=*m_scale_table_ptr;
- const uint8_t *srcptr=nullptr;
+ const uint16_t *srcptr=nullptr;
if (!flipy)
srcline=size-srcline-1;
diff --git a/src/mame/video/buggychl.cpp b/src/mame/video/buggychl.cpp
index 26bf22f4ff4..758cb12330f 100644
--- a/src/mame/video/buggychl.cpp
+++ b/src/mame/video/buggychl.cpp
@@ -196,7 +196,7 @@ void buggychl_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
for (ch = 0; ch < 4; ch++)
{
int pos, code, realflipy;
- const uint8_t *pendata;
+ const uint16_t *pendata;
pos = base_pos + 2 * ch;
code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8));
diff --git a/src/mame/video/circus.cpp b/src/mame/video/circus.cpp
index c160672f142..63690f7d9ef 100644
--- a/src/mame/video/circus.cpp
+++ b/src/mame/video/circus.cpp
@@ -63,7 +63,7 @@ void circus_state::draw_line( bitmap_ind16 &bitmap, const rectangle &cliprect, i
void circus_state::draw_sprite_collision( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
gfx_element *sprite_gfx = m_gfxdecode->gfx(1);
- const uint8_t *sprite_data = sprite_gfx->get_data(m_clown_z);
+ const uint16_t *sprite_data = sprite_gfx->get_data(m_clown_z);
int sx, sy, dx, dy;
int pixel, collision = 0;
diff --git a/src/mame/video/cps1.cpp b/src/mame/video/cps1.cpp
index 0229acb5188..6c0fb44f910 100644
--- a/src/mame/video/cps1.cpp
+++ b/src/mame/video/cps1.cpp
@@ -442,6 +442,8 @@ The games seem to use them to mark platforms, kill zones and no-go areas.
#include "emu.h"
#include "includes/cps1.h"
+#include <algorithm>
+
#define VERBOSE 0
/********************************************************************
@@ -2272,7 +2274,7 @@ void cps_state::video_start()
m_bg_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(cps_state::get_tile2_info),this), tilemap_mapper_delegate(FUNC(cps_state::tilemap2_scan),this), 32, 32, 64, 64);
/* create empty tiles */
- memset(m_empty_tile, 0x0f, sizeof(m_empty_tile));
+ std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0x0f);
/* front masks will change at runtime to handle sprite occluding */
cps1_update_transmasks();
diff --git a/src/mame/video/deco_mlc.cpp b/src/mame/video/deco_mlc.cpp
index 6c60a5f6e7b..18d2b74fc64 100644
--- a/src/mame/video/deco_mlc.cpp
+++ b/src/mame/video/deco_mlc.cpp
@@ -90,10 +90,10 @@ void deco_mlc_state::drawgfxzoomline(uint32_t* dest,const rectangle &clip,gfx_el
if( ex>sx )
{ /* skip if inner loop doesn't draw anything */
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const uint8_t *code_base1 = gfx->get_data(code1 % gfx->elements());
- const uint8_t *code_base2 = gfx->get_data(code2 % gfx->elements());
- const uint8_t *source1 = code_base1 + (srcline) * gfx->rowbytes();
- const uint8_t *source2 = code_base2 + (srcline) * gfx->rowbytes();
+ const uint16_t *code_base1 = gfx->get_data(code1 % gfx->elements());
+ const uint16_t *code_base2 = gfx->get_data(code2 % gfx->elements());
+ const uint16_t *source1 = code_base1 + (srcline) * gfx->rowbytes();
+ const uint16_t *source2 = code_base2 + (srcline) * gfx->rowbytes();
/* no alpha */
if ((alpha == 0xff) && (!shadowMode))
{
diff --git a/src/mame/video/deco_zoomspr.cpp b/src/mame/video/deco_zoomspr.cpp
index 3413231f01d..75fa5f76316 100644
--- a/src/mame/video/deco_zoomspr.cpp
+++ b/src/mame/video/deco_zoomspr.cpp
@@ -59,7 +59,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom(
if( gfx )
{
const pen_t *pal = &m_gfxdecode->palette().pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const uint8_t *code_base = gfx->get_data(code % gfx->elements());
+ const uint16_t *code_base = gfx->get_data(code % gfx->elements());
if (sprite_screen_width && sprite_screen_height)
{
@@ -127,7 +127,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes();
+ const uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes();
uint32_t *dest = &temp_bitmap.pix32(y);
uint8_t *pri = &pri_bitmap.pix8(y);
@@ -163,7 +163,7 @@ inline void deco_zoomspr_device::dragngun_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes();
+ const uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes();
uint32_t *dest = &temp_bitmap.pix32(y);
uint8_t *pri = &pri_bitmap.pix8(y);
uint32_t *tmapcolor = &dest_bmp.pix32(y);
diff --git a/src/mame/video/decocass.cpp b/src/mame/video/decocass.cpp
index bf06d8cd5a9..74f5d4d9568 100644
--- a/src/mame/video/decocass.cpp
+++ b/src/mame/video/decocass.cpp
@@ -125,6 +125,7 @@
#include "emu.h"
#include "includes/decocass.h"
+#include <algorithm>
static const uint32_t tile_offset[32*32] = {
@@ -248,8 +249,8 @@ void decocass_state::draw_special_priority(bitmap_ind16 &bitmap, bitmap_ind8 &pr
sy += 256;
int sx = m_part_h_shift - 128;
- const uint8_t *objdata0 = m_gfxdecode->gfx(3)->get_data(0);
- const uint8_t *objdata1 = m_gfxdecode->gfx(3)->get_data(1);
+ const uint16_t *objdata0 = m_gfxdecode->gfx(3)->get_data(0);
+ const uint16_t *objdata1 = m_gfxdecode->gfx(3)->get_data(1);
assert(m_gfxdecode->gfx(3)->rowbytes() == 64);
for (int y = cliprect.top(); y <= cliprect.bottom(); y++)
@@ -719,7 +720,7 @@ void decocass_state::video_start()
m_gfxdecode->gfx(3)->set_source(m_objectram);
/* create an empty tile */
- memset(m_empty_tile, 0, sizeof(m_empty_tile));
+ std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0);
}
uint32_t decocass_state::screen_update_decocass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/equites.cpp b/src/mame/video/equites.cpp
index 55ef68af119..f8cbb20cb2a 100644
--- a/src/mame/video/equites.cpp
+++ b/src/mame/video/equites.cpp
@@ -310,7 +310,7 @@ void splndrbt_state::splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle
// const uint8_t * const xromline = xrom + (scalex << 4);
const uint8_t * const yromline = yrom + (scaley << 4) + (15 - scaley);
- const uint8_t* const srcgfx = gfx->get_data(tile);
+ const uint16_t* const srcgfx = gfx->get_data(tile);
const pen_t *paldata = &m_palette->pen(gfx->colorbase() + gfx->granularity() * color);
int x,yy;
diff --git a/src/mame/video/gaelco2.cpp b/src/mame/video/gaelco2.cpp
index 3c6e5403da8..dd4e7c65779 100644
--- a/src/mame/video/gaelco2.cpp
+++ b/src/mame/video/gaelco2.cpp
@@ -387,7 +387,7 @@ void gaelco2_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
{ /* last palette entry is reserved for shadows and highlights */
/* get a pointer to the current sprite's gfx data */
- const uint8_t *gfx_src = gfx->get_data(number % gfx->elements());
+ const uint16_t *gfx_src = gfx->get_data(number % gfx->elements());
for (int py = 0; py < gfx->height(); py++)
{
@@ -409,7 +409,7 @@ void gaelco2_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
const int gfx_px = xflip ? (gfx->width() - 1 - px) : px;
/* get asociated pen for the current sprite pixel */
- const u8 gfx_pen = gfx_src[gfx->rowbytes() * gfx_py + gfx_px];
+ const u16 gfx_pen = gfx_src[gfx->rowbytes() * gfx_py + gfx_px];
if ((gfx_pen == 0) || (gfx_pen >= 16)) continue;
diff --git a/src/mame/video/gaelco_wrally_sprites.cpp b/src/mame/video/gaelco_wrally_sprites.cpp
index c865e658a66..ce6105e2398 100644
--- a/src/mame/video/gaelco_wrally_sprites.cpp
+++ b/src/mame/video/gaelco_wrally_sprites.cpp
@@ -93,7 +93,7 @@ void gaelco_wrally_sprites_device::draw_sprites(const rectangle &cliprect, uint1
}
// wrally adjusts sx by 0x0f, blmbycar implementation was 0x10
- const uint8_t *gfx_src = gfx->get_data(number % gfx->elements());
+ const uint16_t *gfx_src = gfx->get_data(number % gfx->elements());
for (int py = 0; py < gfx->height(); py++)
{
diff --git a/src/mame/video/gp9001.cpp b/src/mame/video/gp9001.cpp
index 8ff056fd14c..42badbe5db8 100644
--- a/src/mame/video/gp9001.cpp
+++ b/src/mame/video/gp9001.cpp
@@ -727,7 +727,7 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip
color %= total_colors;
const pen_t *paldata = &palette().pen(color * 16);
{
- const u8* srcdata = gfx(1)->get_data(sprite);
+ const u16* srcdata = gfx(1)->get_data(sprite);
int count = 0;
int ystart, yend, yinc;
int xstart, xend, xinc;
@@ -768,7 +768,7 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip
if (cliprect.contains(drawxx, drawyy))
{
- const u8 pix = srcdata[count];
+ const u16 pix = srcdata[count];
u16* dstptr = &bitmap.pix16(drawyy, drawxx);
u8* dstpri = &this->custom_priority_bitmap->pix8(drawyy, drawxx);
diff --git a/src/mame/video/grchamp.cpp b/src/mame/video/grchamp.cpp
index 03eb3b23b6f..fc39267e95a 100644
--- a/src/mame/video/grchamp.cpp
+++ b/src/mame/video/grchamp.cpp
@@ -271,7 +271,7 @@ void grchamp_state::draw_objects(int y, uint8_t *objdata)
int code = (codeflip & 0x3f) + (change >> 2);
int yflip = (codeflip & 0x80) ? 0x0f : 0x00;
int xflip = (codeflip & 0x40) ? 0x0f : 0x00;
- const uint8_t *src = gfx->get_data(code) + ((dy ^ yflip) & 15) * gfx->rowbytes();
+ const uint16_t *src = gfx->get_data(code) + ((dy ^ yflip) & 15) * gfx->rowbytes();
/* the third byte is: color in bits 0-2 */
int color = (m_spriteram[0x42 + (dataoffs & ~0x20)] & 0x07) << 2;
@@ -315,7 +315,7 @@ void grchamp_state::draw_objects(int y, uint8_t *objdata)
int dy = sy + ~y;
int color = (m_spriteram[0x01 + dataoffs] & 0x07) << 2;
int code = m_videoram[hprime | ((dy & 0xf8) << 2)] + change;
- const uint8_t *src = gfx->get_data(code) + (dy & 7) * gfx->rowbytes();
+ const uint16_t *src = gfx->get_data(code) + (dy & 7) * gfx->rowbytes();
int x;
/* draw 8 pixels */
diff --git a/src/mame/video/jalblend.cpp b/src/mame/video/jalblend.cpp
index 6dc734c9229..e9e843b79af 100644
--- a/src/mame/video/jalblend.cpp
+++ b/src/mame/video/jalblend.cpp
@@ -101,7 +101,7 @@ void jaleco_blend_device::drawgfx_common(palette_device &palette,_BitmapClass &d
{
/* Start drawing */
const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
const int xinc = flipx ? -1 : 1;
const int yinc = flipy ? -1 : 1;
@@ -145,12 +145,12 @@ void jaleco_blend_device::drawgfx_common(palette_device &palette,_BitmapClass &d
// taken from case : TRANSPARENCY_ALPHARANGE
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + y_index*gfx->rowbytes();
+ const u16 *source = source_base + y_index*gfx->rowbytes();
typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index];
+ const u16 c = source[x_index];
if (c != transparent_color)
{
dest[x] = jaleco_blend_device::func(dest[x], pal[c]);
diff --git a/src/mame/video/jedi.cpp b/src/mame/video/jedi.cpp
index ea68c645413..c9d9261c7bf 100644
--- a/src/mame/video/jedi.cpp
+++ b/src/mame/video/jedi.cpp
@@ -41,12 +41,12 @@ void jedi_state::video_start()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const u8 *c0base = gx0->get_data(c);
+ const u16 *c0base = gx0->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const u8 *c0 = c0base;
+ const u16 *c0 = c0base;
for (int x = 0; x < gx0->width(); x++)
{
@@ -59,6 +59,35 @@ void jedi_state::video_start()
gx0->set_raw_layout(srcdata, gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height());
gx0->set_granularity(1);
+
+ /* the text layer pixel determines pen address bits A8 and A9 */
+ gfx_element *gx1 = m_gfxdecode->gfx(0);
+
+ // allocate memory for the assembled data
+ u16 *srcdata16 = auto_alloc_array(machine(), u16, gx1->elements() * gx1->width() * gx1->height());
+
+ // loop over elements
+ u16 *dest16 = srcdata16;
+ for (int c = 0; c < gx1->elements(); c++)
+ {
+ const u16 *c1base = gx1->get_data(c);
+
+ // loop over height
+ for (int y = 0; y < gx1->height(); y++)
+ {
+ const u16 *c1 = c1base;
+
+ for (int x = 0; x < gx1->width(); x++)
+ {
+ const u16 pix = (*c1++ & 0x3);
+ *dest16++ = pix << 8;
+ }
+ c1base += gx1->rowbytes();
+ }
+ }
+
+ gx1->set_raw_layout(srcdata16, gx1->width(), gx1->height(), gx1->elements(), 16 * gx1->width(), 16 * gx1->width() * gx1->height());
+ gx1->set_granularity(1);
#endif
/* register for saving */
diff --git a/src/mame/video/k053246_k053247_k055673.cpp b/src/mame/video/k053246_k053247_k055673.cpp
index 7b46b032563..56bbb393fef 100644
--- a/src/mame/video/k053246_k053247_k055673.cpp
+++ b/src/mame/video/k053246_k053247_k055673.cpp
@@ -438,7 +438,7 @@ void k053247_device::zdrawgfxzoom32GP(
#define FPENT 0
// inner loop
- const u8 *src_ptr;
+ const u16 *src_ptr;
int src_x;
int eax, ecx;
int src_fx, src_fdx;
@@ -452,7 +452,7 @@ void k053247_device::zdrawgfxzoom32GP(
// outter loop
int src_fby, src_fdy, src_fbx;
- const u8 *src_base;
+ const u16 *src_base;
int dst_w, dst_h;
// one-time
diff --git a/src/mame/video/k054156_k054157_k056832.cpp b/src/mame/video/k054156_k054157_k056832.cpp
index 56476fc99ca..f7699185dbb 100644
--- a/src/mame/video/k054156_k054157_k056832.cpp
+++ b/src/mame/video/k054156_k054157_k056832.cpp
@@ -1147,7 +1147,7 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap,
uint8_t code_transparent, code_opaque;
const pen_t *pal_ptr;
- const uint8_t *src_ptr;
+ const uint16_t *src_ptr;
uint8_t *xpr_ptr;
uint16_t *dst_ptr;
uint16_t pen, basepen;
@@ -2078,7 +2078,7 @@ int k056832_device::altK056832_update_linemap(screen_device &screen, bitmap_rgb3
uint8_t code_transparent, code_opaque;
const pen_t *pal_ptr;
- const uint8_t *src_ptr;
+ const uint16_t *src_ptr;
uint8_t *xpr_ptr;
uint16_t *dst_ptr;
uint16_t pen, basepen;
diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp
index 598c005f9cd..36363309529 100644
--- a/src/mame/video/kaneko_spr.cpp
+++ b/src/mame/video/kaneko_spr.cpp
@@ -244,7 +244,7 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re
bitmap_ind8 &priority_bitmap, int priority)
{
const pen_t pen_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
int dx, dy;
int ex = sx+gfx->width();
@@ -309,14 +309,14 @@ void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const re
const pen_t *pal = gfx->palette().pens();
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + y_index * gfx->rowbytes();
+ const u16 *source = source_base + y_index * gfx->rowbytes();
dest = &dest_bmp.pix(y);
u8 *pri = &priority_bitmap.pix8(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index];
+ const u16 c = source[x_index];
if (c != 0)
{
if (pri[x] < priority)
diff --git a/src/mame/video/mcr.cpp b/src/mame/video/mcr.cpp
index 46dddafaca5..21e6efd8de0 100644
--- a/src/mame/video/mcr.cpp
+++ b/src/mame/video/mcr.cpp
@@ -272,7 +272,7 @@ void mcr_state::render_sprites_91399(screen_device &screen, bitmap_ind16 &bitmap
for (int y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff)
if (sy >= cliprect.min_y && sy <= cliprect.max_y)
{
- const uint8_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
+ const uint16_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
uint16_t *dst = &bitmap.pix16(sy);
uint8_t *pri = &screen.priority().pix8(sy);
@@ -339,7 +339,7 @@ void mcr_state::render_sprites_91464(screen_device &screen, bitmap_ind16 &bitmap
for (int y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff)
if (sy >= 2 && sy >= cliprect.min_y && sy <= cliprect.max_y)
{
- const uint8_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
+ const uint16_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
uint16_t *dst = &bitmap.pix16(sy);
uint8_t *pri = &screen.priority().pix8(sy);
diff --git a/src/mame/video/megasys1.cpp b/src/mame/video/megasys1.cpp
index 18868e4a545..fd0e2d2649b 100644
--- a/src/mame/video/megasys1.cpp
+++ b/src/mame/video/megasys1.cpp
@@ -387,7 +387,7 @@ inline void megasys1_state::draw_16x16_priority_sprite(screen_device &screen, bi
gfx_element *decodegfx = m_gfxdecode->gfx(0);
sy = sy + 16;
- const u8* gfx = decodegfx->get_data(code);
+ const u16* gfx = decodegfx->get_data(code);
flipy = (flipy) ? 0x0f : 0;
flipx = (flipx) ? 0x0f : 0;
diff --git a/src/mame/video/namco_c355spr.cpp b/src/mame/video/namco_c355spr.cpp
index 7a484d86973..2caec9b84df 100644
--- a/src/mame/video/namco_c355spr.cpp
+++ b/src/mame/video/namco_c355spr.cpp
@@ -52,7 +52,7 @@ void namco_c355spr_device::zdrawgfxzoom(
const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0;
const pen_t black = palette.black_pen();
const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16;
int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16;
if (sprite_screen_width && sprite_screen_height)
@@ -117,7 +117,7 @@ void namco_c355spr_device::zdrawgfxzoom(
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
u8 *pri = &priority_bitmap.pix8(y);
int x_index = x_index_base;
@@ -125,7 +125,7 @@ void namco_c355spr_device::zdrawgfxzoom(
{
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index>>16];
+ const u16 c = source[x_index>>16];
if (c != 0xff)
{
if (pri[x] <= zpos)
@@ -153,7 +153,7 @@ void namco_c355spr_device::zdrawgfxzoom(
{
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index>>16];
+ const u16 c = source[x_index>>16];
if (c != 0xff)
{
if (pri[x] <= zpos)
diff --git a/src/mame/video/namcona1.cpp b/src/mame/video/namcona1.cpp
index 228bf817fd9..ca000a7762c 100644
--- a/src/mame/video/namcona1.cpp
+++ b/src/mame/video/namcona1.cpp
@@ -233,8 +233,8 @@ void namcona1_state::pdraw_tile(
gfx_element *mask = m_gfxdecode->gfx(2);
const u16 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u8 *source_base = gfx->get_data((code % gfx->elements()));
- const u8 *mask_base = mask->get_data((code % mask->elements()));
+ const u16 *source_base = gfx->get_data((code % gfx->elements()));
+ const u16 *mask_base = mask->get_data((code % mask->elements()));
/* compute sprite increment per screen pixel */
int dx, dy;
@@ -295,8 +295,8 @@ void namcona1_state::pdraw_tile(
{ /* skip if inner loop doesn't draw anything */
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + y_index * gfx->rowbytes();
- const u8 *mask_addr = mask_base + y_index * mask->rowbytes();
+ const u16 *source = source_base + y_index * gfx->rowbytes();
+ const u16 *mask_addr = mask_base + y_index * mask->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
u8 *pri = &screen.priority().pix8(y);
@@ -307,7 +307,7 @@ void namcona1_state::pdraw_tile(
{
if (pri[x] <= priority)
{
- const u8 c = source[x_index];
+ const u16 c = source[x_index];
dest[x] = pal_base + c;
}
pri[x] = 0xff;
@@ -319,7 +319,7 @@ void namcona1_state::pdraw_tile(
{
if (pri[x] <= priority)
{
- const u8 c = source[x_index];
+ const u16 c = source[x_index];
/* render a shadow only if the sprites color is $F (8bpp) or $FF (4bpp) */
if (bShadow)
diff --git a/src/mame/video/namcos22.cpp b/src/mame/video/namcos22.cpp
index 545fc499067..57af58accd4 100644
--- a/src/mame/video/namcos22.cpp
+++ b/src/mame/video/namcos22.cpp
@@ -56,7 +56,7 @@ void namcos22_renderer::renderscanline_uvi_full(int32_t scanline, const extent_t
u8 *primap = &extra.primap->pix8(scanline);
u16 *ttmap = m_state.m_texture_tilemap;
u8 *ttattr = m_state.m_texture_tileattr.get();
- u8 *ttdata = m_state.m_texture_tiledata;
+ u16 *ttdata = m_state.m_texture_tiledata;
u8 *tt_ayx_to_pixel = m_state.m_texture_ayx_to_pixel.get();
if (extra.cmode & 4)
@@ -194,7 +194,7 @@ void namcos22_renderer::renderscanline_sprite(int32_t scanline, const extent_t &
int fadefactor = 0xff - extra.fadefactor;
rgbaint_t fogcolor(extra.fogcolor);
rgbaint_t fadecolor(extra.fadecolor);
- u8 *source = (u8 *)extra.source + y_index * extra.line_modulo;
+ u16 *source = (u16 *)extra.source + y_index * extra.line_modulo;
u32 *dest = &extra.destbase->pix32(scanline);
u8 *primap = &extra.primap->pix8(scanline);
@@ -2478,7 +2478,7 @@ void namcos22_state::init_tables()
m_gfxdecode->gfx(1)->get_data(i);
m_texture_tilemap = (u16 *)memregion("textilemap")->base();
- m_texture_tiledata = (u8 *)m_gfxdecode->gfx(1)->get_data(0);
+ m_texture_tiledata = (u16 *)m_gfxdecode->gfx(1)->get_data(0);
m_texture_tileattr = std::make_unique<u8[]>(0x080000*2);
// unpack textures
diff --git a/src/mame/video/namcos2_sprite.cpp b/src/mame/video/namcos2_sprite.cpp
index 7d2f2f434b7..28877eed118 100644
--- a/src/mame/video/namcos2_sprite.cpp
+++ b/src/mame/video/namcos2_sprite.cpp
@@ -52,7 +52,7 @@ void namcos2_sprite_device::zdrawgfxzoom(
device_palette_interface &palette = gfx->palette();
const int shadow_offset = (palette.shadows_enabled()) ? palette.entries() : 0;
const pen_t *pal = &palette.pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
const int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16;
const int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16;
if (sprite_screen_width && sprite_screen_height)
@@ -117,7 +117,7 @@ void namcos2_sprite_device::zdrawgfxzoom(
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
u8 *pri = &priority_bitmap.pix8(y);
int x_index = x_index_base;
@@ -126,7 +126,7 @@ void namcos2_sprite_device::zdrawgfxzoom(
{
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index >> 16];
+ const u16 c = source[x_index >> 16];
if (c != 0xff)
{
if (pri[x] <= zpos)
@@ -155,7 +155,7 @@ void namcos2_sprite_device::zdrawgfxzoom(
{
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index >> 16];
+ const u16 c = source[x_index >> 16];
if (c != 0xff)
{
if (pri[x] <= zpos)
diff --git a/src/mame/video/nemesis.cpp b/src/mame/video/nemesis.cpp
index aebbf5f7078..5ae443bd5b5 100644
--- a/src/mame/video/nemesis.cpp
+++ b/src/mame/video/nemesis.cpp
@@ -9,7 +9,7 @@
#include "emu.h"
#include "includes/nemesis.h"
#include "video/resnet.h"
-
+#include <algorithm>
static const struct
{
@@ -262,7 +262,7 @@ void nemesis_state::video_start()
m_foreground->set_scroll_rows(256);
memset(m_charram, 0, m_charram.bytes());
- memset(m_blank_tile, 0, ARRAY_LENGTH(m_blank_tile));
+ std::fill(std::begin(m_blank_tile), std::end(m_blank_tile), 0);
/* Set up save state */
machine().save().register_postload(save_prepost_delegate(FUNC(nemesis_state::nemesis_postload), this));
diff --git a/src/mame/video/polepos.cpp b/src/mame/video/polepos.cpp
index e3171c229c3..b73736bb617 100644
--- a/src/mame/video/polepos.cpp
+++ b/src/mame/video/polepos.cpp
@@ -386,7 +386,7 @@ void polepos_state::zoom_sprite(bitmap_ind16 &bitmap,int big,
int sizex,int sizey)
{
gfx_element *gfx = m_gfxdecode->gfx(big ? 3 : 2);
- const uint8_t *gfxdata = gfx->get_data(code % gfx->elements());
+ const uint16_t *gfxdata = gfx->get_data(code % gfx->elements());
uint8_t *scaling_rom = memregion("gfx6")->base();
uint32_t transmask = m_palette->transpen_mask(*gfx, color, 0x1f);
int coloroffs = gfx->colorbase() + color * gfx->granularity();
@@ -404,7 +404,7 @@ void polepos_state::zoom_sprite(bitmap_ind16 &bitmap,int big,
int xx = sx & 0x3ff;
int siz = 0;
int offs = 0;
- const uint8_t *src;
+ const uint16_t *src;
if (!big) dy >>= 1;
src = gfxdata + dy * gfx->rowbytes();
diff --git a/src/mame/video/popeye.cpp b/src/mame/video/popeye.cpp
index b5052e8a1b6..4dc90efe7ea 100644
--- a/src/mame/video/popeye.cpp
+++ b/src/mame/video/popeye.cpp
@@ -318,8 +318,8 @@ void tnx1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
gfx_element *gfx = m_gfxdecode->gfx(1);
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (a->color % gfx->colors()));
- const uint8_t *source_base = gfx->get_data(a->code % gfx->elements());
- const uint8_t *source = source_base + (a->row ^ a->flipy) * gfx->rowbytes();
+ const uint16_t *source_base = gfx->get_data(a->code % gfx->elements());
+ const uint16_t *source = source_base + (a->row ^ a->flipy) * gfx->rowbytes();
if (bootleg_sprites() && flipx != a->flipx)
{
diff --git a/src/mame/video/psikyosh.cpp b/src/mame/video/psikyosh.cpp
index 4a90af50383..dc1269c1fb2 100644
--- a/src/mame/video/psikyosh.cpp
+++ b/src/mame/video/psikyosh.cpp
@@ -408,7 +408,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
for (int xtile = xstart; xtile != xend; xtile += xinc)
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
+ const u16 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
int x_index_base, y_index;
@@ -458,7 +458,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
if (z > 0)
{
- const u8 *source = code_base + (y_index) * gfx->rowbytes() + x_index_base;
+ const u16 *source = code_base + (y_index) * gfx->rowbytes() + x_index_base;
u32 *dest = &dest_bmp.pix32(sy, sx);
u16 *pri = &m_z_bitmap.pix16(sy, sx);
int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx);
@@ -470,7 +470,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
if (z >= *pri)
{
- const u8 c = *source;
+ const u16 c = *source;
if (c != 0)
{
*dest = pal[c];
@@ -488,7 +488,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
}
else
{
- const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
+ const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
u32 *dest = &dest_bmp.pix32(sy, sx);
int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx);
int dst_modulo = dest_bmp.rowpixels() - (ex - sx);
@@ -497,7 +497,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
for (int x = sx; x < ex; x++)
{
- const u8 c = *source;
+ const u16 c = *source;
if (c != 0)
*dest = pal[c];
@@ -515,7 +515,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
if (z > 0)
{
- const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
+ const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
u32 *dest = &dest_bmp.pix32(sy, sx);
u16 *pri = &m_z_bitmap.pix16(sy, sx);
int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx);
@@ -527,7 +527,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
if (z >= *pri)
{
- const u8 c = *source;
+ const u16 c = *source;
if (c != 0)
{
*dest = alpha_blend_r32(*dest, pal[c], alpha);
@@ -545,7 +545,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
}
else
{
- const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
+ const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
u32 *dest = &dest_bmp.pix32(sy, sx);
int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx);
int dst_modulo = dest_bmp.rowpixels() - (ex - sx);
@@ -554,7 +554,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
for (int x = sx; x < ex; x++)
{
- const u8 c = *source;
+ const u16 c = *source;
if (c != 0)
*dest = alpha_blend_r32(*dest, pal[c], alpha);
@@ -573,7 +573,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
if (z > 0)
{
- const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
+ const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
u32 *dest = &dest_bmp.pix32(sy, sx);
u16 *pri = &m_z_bitmap.pix16(sy, sx);
int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx);
@@ -585,7 +585,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
if (z >= *pri)
{
- const u8 c = *source;
+ const u16 c = *source;
if (c != 0)
{
if (m_alphatable[c] == 0xff)
@@ -607,7 +607,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
}
else
{
- const u8 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
+ const u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
u32 *dest = &dest_bmp.pix32(sy, sx);
int src_modulo = yinc * gfx->rowbytes() - xinc * (ex - sx);
int dst_modulo = dest_bmp.rowpixels() - (ex - sx);
@@ -616,7 +616,7 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
for (int x = sx; x < ex; x++)
{
- const u8 c = *source;
+ const u16 c = *source;
if (c != 0)
{
if (m_alphatable[c] == 0xff)
@@ -646,10 +646,10 @@ void psikyosh_state::psikyosh_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangl
{
for (int xtile = 0; xtile < wide; xtile++)
{
- const u8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
+ const u16 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
for (int ypixel = 0; ypixel < gfx->height(); ypixel++)
{
- const u8 *source = code_base + ypixel * gfx->rowbytes();
+ const u16 *source = code_base + ypixel * gfx->rowbytes();
u8 *dest = &m_zoom_bitmap.pix8(ypixel + ytile*gfx->height());
for (int xpixel = 0; xpixel < gfx->width(); xpixel++)
diff --git a/src/mame/video/seibuspi.cpp b/src/mame/video/seibuspi.cpp
index 881f62946c7..b3c7b4ab65c 100644
--- a/src/mame/video/seibuspi.cpp
+++ b/src/mame/video/seibuspi.cpp
@@ -437,7 +437,7 @@ void seibuspi_state::drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &clipre
color = gfx->colorbase() + (color % gfx->colors()) * gfx->granularity();
const pen_t *pens = m_palette->pens();
- const u8 *src = gfx->get_data(code % gfx->elements());
+ const u16 *src = gfx->get_data(code % gfx->elements());
const u8 trans_pen = (1 << m_sprite_bpp) - 1;
// draw
@@ -450,7 +450,7 @@ void seibuspi_state::drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &clipre
for (int x = x1; x <= x2; x++)
{
- const u8 pen = src[src_i];
+ const u16 pen = src[src_i];
if (!(pri[x] & primask) && pen != trans_pen)
{
pri[x] |= primask;
diff --git a/src/mame/video/seta2.cpp b/src/mame/video/seta2.cpp
index d1aaef6758b..3a171ca3d47 100644
--- a/src/mame/video/seta2.cpp
+++ b/src/mame/video/seta2.cpp
@@ -282,7 +282,7 @@ WRITE16_MEMBER(seta2_state::spriteram_w)
***************************************************************************/
-inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int which_gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int use_shadow, int realline, int line, int opaque)
+inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int which_gfx, const uint16_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int use_shadow, int realline, int line, int opaque)
{
struct drawmodes
{
@@ -310,7 +310,7 @@ inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cli
if (!use_shadow)
shadow = 0;
- const uint8_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8;
+ const uint16_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8;
uint16_t* dest = &bitmap.pix16(realline);
diff --git a/src/mame/video/snk.cpp b/src/mame/video/snk.cpp
index 60b51cb4f40..6704064f69a 100644
--- a/src/mame/video/snk.cpp
+++ b/src/mame/video/snk.cpp
@@ -3,6 +3,7 @@
// thanks-to:Marco Cassili
#include "emu.h"
#include "includes/snk.h"
+#include <algorithm>
/*******************************************************************************
Shadow Handling Notes
@@ -342,7 +343,7 @@ VIDEO_START_MEMBER(snk_state,gwar)
for(i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE;
m_drawmode_table[15] = DRAWMODE_NONE;
- memset(m_empty_tile, 0xf, sizeof(m_empty_tile));
+ std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0xf);
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(snk_state::gwar_get_tx_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 50, 32);
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(snk_state::gwar_get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32);
diff --git a/src/mame/video/ssv.cpp b/src/mame/video/ssv.cpp
index 7d280915cc5..763b595ab61 100644
--- a/src/mame/video/ssv.cpp
+++ b/src/mame/video/ssv.cpp
@@ -142,10 +142,10 @@ void ssv_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, in
{
gfx_element *gfxelement = m_gfxdecode->gfx(0);
- const uint8_t *const addr = gfxelement->get_data(code % gfxelement->elements());
+ const uint16_t *const addr = gfxelement->get_data(code % gfxelement->elements());
const uint32_t realcolor = gfxelement->granularity() * (color % gfxelement->colors());
- const uint8_t *const source = flipy ? addr + (7 - line) * gfxelement->rowbytes() : addr + line * gfxelement->rowbytes();
+ const uint16_t *const source = flipy ? addr + (7 - line) * gfxelement->rowbytes() : addr + line * gfxelement->rowbytes();
if (realline >= cliprect.min_y && realline <= cliprect.max_y)
{
diff --git a/src/mame/video/taito_f2.cpp b/src/mame/video/taito_f2.cpp
index b47500f899d..0e0b2b25bc4 100644
--- a/src/mame/video/taito_f2.cpp
+++ b/src/mame/video/taito_f2.cpp
@@ -286,7 +286,7 @@ void taitof2_state::taito_f2_tc360_spritemixdraw(screen_device &screen, bitmap_i
u32 code, u32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley)
{
const u16 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
bitmap_ind8 &priority_bitmap = screen.priority();
const int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16;
const int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16;
@@ -355,14 +355,14 @@ void taitof2_state::taito_f2_tc360_spritemixdraw(screen_device &screen, bitmap_i
/* skip if inner loop doesn't draw anything */
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index >> 16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index >> 16) * gfx->rowbytes();
u16 *dest = &dest_bmp.pix16(y);
u8 *pri = &priority_bitmap.pix8(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index >> 16];
+ const u16 c = source[x_index >> 16];
if (c && (pri[x] & 0x80) == 0)
{
u8 tilemap_priority = 0, sprite_priority = 0;
diff --git a/src/mame/video/taito_f3.cpp b/src/mame/video/taito_f3.cpp
index 1280d21d234..eeb1d010428 100644
--- a/src/mame/video/taito_f3.cpp
+++ b/src/mame/video/taito_f3.cpp
@@ -591,7 +591,7 @@ void taito_f3_state::video_start()
for (int c = 0; c < sprite_gfx->elements(); c++)
{
int chk_trans_or_opa = 0;
- const u8 *dp = sprite_gfx->get_data(c);
+ const u16 *dp = sprite_gfx->get_data(c);
for (int y = 0; y < sprite_gfx->height(); y++)
{
for (int x = 0; x < sprite_gfx->width(); x++)
@@ -616,7 +616,7 @@ void taito_f3_state::video_start()
int chk_trans_or_opa = 0;
/* 0 = 4bpp, 1=5bpp, 2=?, 3=6bpp */
const u8 extra_mask = ((extra_planes << 4) | 0x0f);
- const u8 *dp = pf_gfx->get_data(c);
+ const u16 *dp = pf_gfx->get_data(c);
for (int y = 0; y < pf_gfx->height(); y++)
{
@@ -2474,7 +2474,7 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle &
if (gfx)
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u8 *code_base = gfx->get_data(code % gfx->elements());
+ const u16 *code_base = gfx->get_data(code % gfx->elements());
{
/* compute sprite increment per screen pixel */
@@ -2537,7 +2537,7 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle &
{
int y = ey - sy;
const int x = (ex - sx - 1) | (m_tile_opaque_sp[code % gfx->elements()] << 4);
- const u8 *source0 = code_base + y_index * 16 + x_index_base;
+ const u16 *source0 = code_base + y_index * 16 + x_index_base;
u32 *dest0 = &dest_bmp.pix32(sy, sx);
u8 *pri0 = &m_pri_alp_bitmap.pix8(sy, sx);
const int yadv = dest_bmp.rowpixels();
@@ -2545,7 +2545,7 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle &
dy = dy * 16;
while (1)
{
- const u8 *source = source0;
+ const u16 *source = source0;
u32 *dest = dest0;
u8 *pri = pri0;
@@ -2623,7 +2623,7 @@ inline void taito_f3_state::f3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectang
if (gfx)
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
- const u8 *code_base = gfx->get_data(code % gfx->elements());
+ const u16 *code_base = gfx->get_data(code % gfx->elements());
{
/* compute sprite increment per screen pixel */
@@ -2686,7 +2686,7 @@ inline void taito_f3_state::f3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectang
{
for (int y = sy; y < ey; y++)
{
- const u8 *source = code_base + (y_index >> 16) * 16;
+ const u16 *source = code_base + (y_index >> 16) * 16;
u32 *dest = &dest_bmp.pix32(y);
u8 *pri = &m_pri_alp_bitmap.pix8(y);
diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp
index 2472576049c..8f1c6388d82 100644
--- a/src/mame/video/tatsumi.cpp
+++ b/src/mame/video/tatsumi.cpp
@@ -117,7 +117,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c
{
const pen_t *pal = &m_palette->pen(gfx->colorbase() + gfx->granularity() * (color % gfx->colors()));
const uint8_t *shadow_pens = m_shadow_pen_array.get() + (gfx->granularity() * (color % gfx->colors()));
- const uint8_t *code_base = gfx->get_data(code % gfx->elements());
+ const uint16_t *code_base = gfx->get_data(code % gfx->elements());
int block_size = 8 * scalex;
int sprite_screen_height = ((ssy&0xffff)+block_size)>>16;
@@ -237,7 +237,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- const uint8_t *source = code_base + (cy>>16) * gfx->rowbytes();
+ const uint16_t *source = code_base + (cy>>16) * gfx->rowbytes();
int c = source[(cx >> 16)];
if( c != transparent_color )
{
@@ -260,7 +260,7 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = code_base + (y_index>>16) * gfx->rowbytes();
+ const uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes();
typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y);
int x, x_index = x_index_base;
@@ -1158,12 +1158,12 @@ void cyclwarr_state::tile_expand()
dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const uint8_t *c0base = gx0->get_data(c);
+ const uint16_t *c0base = gx0->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const uint8_t *c0 = c0base;
+ const uint16_t *c0 = c0base;
for (int x = 0; x < gx0->width(); x++)
{
diff --git a/src/mame/video/tc0100scn.cpp b/src/mame/video/tc0100scn.cpp
index 0238be3d35e..32ae8a967c5 100644
--- a/src/mame/video/tc0100scn.cpp
+++ b/src/mame/video/tc0100scn.cpp
@@ -355,14 +355,14 @@ void tc0620scc_device::device_start()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
- const u8 *c0base = gx0->get_data(c);
- const u8 *c1base = gx1->get_data(c);
+ const u16 *c0base = gx0->get_data(c);
+ const u16 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
- const u8 *c0 = c0base;
- const u8 *c1 = c1base;
+ const u16 *c0 = c0base;
+ const u16 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
*dest++ = (*c0++ & 0xf) | (*c1++ & 0x30);
diff --git a/src/mame/video/thepit.cpp b/src/mame/video/thepit.cpp
index 58d401ca2c4..a4f68ea76df 100644
--- a/src/mame/video/thepit.cpp
+++ b/src/mame/video/thepit.cpp
@@ -133,7 +133,7 @@ void thepit_state::video_start()
m_solid_tilemap->set_scroll_cols(32);
m_tilemap->set_scroll_cols(32);
- m_dummy_tile = make_unique_clear<uint8_t[]>(8*8);
+ m_dummy_tile = make_unique_clear<uint16_t[]>(8*8);
m_graphics_bank = 0; /* only used in intrepid */
diff --git a/src/mame/video/toaplan1.cpp b/src/mame/video/toaplan1.cpp
index 41a9b6ef407..9eb8558958d 100644
--- a/src/mame/video/toaplan1.cpp
+++ b/src/mame/video/toaplan1.cpp
@@ -676,7 +676,7 @@ void toaplan1_state::draw_sprite_custom(screen_device &screen, bitmap_rgb32 &des
int priority)
{
const u32 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
- const u8 *source_base = gfx->get_data(code % gfx->elements());
+ const u16 *source_base = gfx->get_data(code % gfx->elements());
bitmap_ind8 &priority_bitmap = screen.priority();
const int sprite_screen_height = ((1 << 16) * gfx->height() + 0x8000) >> 16;
const int sprite_screen_width = ((1 << 16) * gfx->width() + 0x8000) >> 16;
@@ -742,14 +742,14 @@ void toaplan1_state::draw_sprite_custom(screen_device &screen, bitmap_rgb32 &des
{ /* skip if inner loop doesn't draw anything */
for (int y = sy; y < ey; y++)
{
- const u8 *source = source_base + (y_index >> 16) * gfx->rowbytes();
+ const u16 *source = source_base + (y_index >> 16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
u8 *pri = &priority_bitmap.pix8(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
- const u8 c = source[x_index >> 16];
+ const u16 c = source[x_index >> 16];
if (c != 0)
{
if (pri[x] < priority)
diff --git a/src/mame/video/wecleman.cpp b/src/mame/video/wecleman.cpp
index 4bb6c0c1120..5169aeb8349 100644
--- a/src/mame/video/wecleman.cpp
+++ b/src/mame/video/wecleman.cpp
@@ -542,7 +542,7 @@ void wecleman_state::wecleman_draw_road(bitmap_rgb32 &bitmap, const rectangle &c
};
- const uint8_t *src_ptr;
+ const uint16_t *src_ptr;
const pen_t *pal_ptr, *rgb_ptr;
int scrollx, sy, sx;
@@ -643,7 +643,7 @@ void wecleman_state::draw_cloud(bitmap_rgb32 &bitmap,
int tmw_l2, int tmh_l2, // tilemap width and height in log(2)
int alpha, int pal_offset ) // alpha(0-3f), # of color codes to shift
{
- const uint8_t *src_ptr;
+ const uint16_t *src_ptr;
uint16_t *tmap_ptr;
uint32_t *dst_base, *dst_ptr;
const pen_t *pal_base, *pal_ptr;
@@ -944,7 +944,7 @@ VIDEO_START_MEMBER(wecleman_state,wecleman)
m_txt_tilemap->set_scrolly(0, -BMP_PAD );
// patches out a mysterious pixel floating in the sky (tile decoding bug?)
- *const_cast<uint8_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0;
+ *const_cast<uint16_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0;
}
// Callbacks for the K051316