Merge pull request #5362 from mamedev/revert-5167-16bppgfx

Revert "Allow 16bpp gfxdecode"
This commit is contained in:
R. Belmont 2019-07-19 16:36:32 -04:00 committed by GitHub
commit d604a0343d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 604 additions and 577 deletions

View File

@ -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 uint16_t* data;
const uint8_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 uint16_t* data;
const uint8_t* data;
uint8_t flipxy = (code & 0x6000) >> 13;
if (tile2 < gfx1->elements())

View File

@ -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 uint16_t *source_base = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes();
const uint8_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 uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes();
const uint8_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 uint16_t *source = source_base + (y_index>>16) * gfx->rowbytes();
const uint8_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 uint16_t *source_base = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *source = source_base + y_index*gfx->rowbytes();
const uint8_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 uint16_t *source_base = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *source = source_base + y_index*gfx->rowbytes();
const uint8_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++)

View File

@ -249,33 +249,16 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
// otherwise, just use the line modulo
else
{
if (glcopy.planeoffset[1] != GFX_RAW) // 8bpp RAW case
int base = gfx.start;
int end = region_length/8;
int linemod = glcopy.yoffset[0];
while (glcopy.total > 0)
{
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--;
}
int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 8;
int lastpixelbase = elementbase + glcopy.height * linemod / 8 - 1;
if (lastpixelbase < end)
break;
glcopy.total--;
}
}

View File

@ -24,7 +24,7 @@
//**************************************************************************
constexpr u8 MAX_GFX_ELEMENTS = 32;
constexpr u16 MAX_GFX_PLANES = 16;
constexpr u16 MAX_GFX_PLANES = 8;
constexpr u16 MAX_GFX_SIZE = 32;
@ -38,9 +38,7 @@ 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 }, { 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 };
const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { 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.

View File

@ -86,61 +86,53 @@ gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *ta
// gfx_element - constructor
//-------------------------------------------------
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)
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)
{
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_is_16bpp(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_planes(0),
m_layout_xormask(xormask),
m_layout_charincrement(0)
{
// set the layout
set_layout(gl, srcdata);
@ -164,7 +156,6 @@ 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;
@ -175,22 +166,15 @@ 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
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;
}
m_line_modulo = gl.yoffs(0) / 8;
m_char_modulo = gl.charincrement / 8;
// allocate memory for the data
m_gfxdata_allocated.resize(m_total_elements * m_char_modulo);
m_gfxdata = &m_gfxdata_allocated[0];
// RAW graphics must have a pointer up front
assert(srcdata != nullptr);
m_gfxdata = const_cast<u8 *>(srcdata);
}
// decoded graphics case
@ -241,26 +225,11 @@ 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
@ -270,6 +239,7 @@ 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);
}
@ -291,9 +261,16 @@ void gfx_element::set_source_and_total(const u8 *source, u32 total)
if (m_color_depth <= 32)
m_pen_usage.resize(m_total_elements);
// allocate memory for the data
m_gfxdata_allocated.resize(m_total_elements * m_char_modulo);
m_gfxdata = &m_gfxdata_allocated[0];
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];
}
}
@ -322,49 +299,10 @@ 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_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
if (!m_layout_is_raw)
{
// zap the data to 0
u16 *decode_base = m_gfxdata + code * m_char_modulo;
u8 *decode_base = m_gfxdata + code * m_char_modulo;
memset(decode_base, 0, m_char_modulo);
// iterate over planes
@ -379,7 +317,7 @@ void gfx_element::decode(u32 code)
for (int y = 0; y < m_origheight; y++)
{
int yoffs = planeoffs + m_layout_yoffset[y];
u16 *dp = decode_base + y * m_line_modulo;
u8 *dp = decode_base + y * m_line_modulo;
// iterate over columns
for (int x = 0; x < m_origwidth; x++)
@ -393,7 +331,7 @@ void gfx_element::decode(u32 code)
if (code < m_pen_usage.size())
{
// iterate over data, creating a bitmask of live pens
const u16 *dp = m_gfxdata + code * m_char_modulo;
const u8 *dp = m_gfxdata + code * m_char_modulo;
u32 usage = 0;
for (int y = 0; y < m_origheight; y++)
{
@ -450,7 +388,7 @@ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect,
u32 trans_pen)
{
// special case invalid pens to opaque
if (trans_pen > 0xffff)
if (trans_pen > 0xff)
return opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
// use pen usage to optimize
@ -478,7 +416,7 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect,
u32 trans_pen)
{
// special case invalid pens to opaque
if (trans_pen > 0xffff)
if (trans_pen > 0xff)
return opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
// use pen usage to optimize
@ -716,7 +654,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 > 0xffff)
if (trans_pen > 0xff)
return zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley);
// use pen usage to optimize
@ -748,7 +686,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 > 0xffff)
if (trans_pen > 0xff)
return zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley);
// use pen usage to optimize
@ -1008,7 +946,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 > 0xffff)
if (trans_pen > 0xff)
return prio_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask);
// use pen usage to optimize
@ -1038,7 +976,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 > 0xffff)
if (trans_pen > 0xff)
return prio_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, priority, pmask);
// use pen usage to optimize
@ -1301,7 +1239,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 > 0xffff)
if (trans_pen > 0xff)
return prio_zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask);
// use pen usage to optimize
@ -1336,7 +1274,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 > 0xffff)
if (trans_pen > 0xff)
return prio_zoom_opaque(dest, cliprect, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask);
// use pen usage to optimize

View File

@ -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, const u8 *base, u32 total, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity);
gfx_element(device_palette_interface *palette, u8 *base, 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,7 +173,6 @@ 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; }
@ -187,7 +186,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 u16 *get_data(u32 code)
const u8 *get_data(u32 code)
{
assert(code < elements());
if (code < m_dirty.size() && m_dirty[code]) decode(code);
@ -271,40 +270,39 @@ private:
void decode(u32 code);
// internal state
device_palette_interface *m_palette; // palette used for drawing (optional when used as a pure decoder)
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_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
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_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
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)
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?
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
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
};

View File

@ -470,7 +470,7 @@ while (0)
do { \
g_profiler.start(PROFILER_DRAWGFX); \
do { \
const u16 *srcdata; \
const u8 *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 u16 *srcptr = srcdata; \
const u8 *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 u16 *srcptr = srcdata; \
const u8 *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \
@ -642,7 +642,7 @@ do {
do { \
g_profiler.start(PROFILER_DRAWGFX); \
do { \
const u16 *srcdata; \
const u8 *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 u16 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \
const u8 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \
s32 cursrcx = srcx; \
srcy += dy; \
\

View File

@ -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 = 0xffff;
m_tileinfo.pen_mask = 0xff;
m_tileinfo.gfxnum = 0xff;
// allocate transparency mapping data
@ -780,7 +780,7 @@ g_profiler.stop();
// the palette_base
//-------------------------------------------------
u8 tilemap_t::tile_draw(const u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u16 pen_mask)
u8 tilemap_t::tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u8 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 u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8
int xoffs = 0;
for (u16 tx = 0; tx < m_tilewidth; tx++)
{
u16 pen = (*pendata++) & pen_mask;
u8 pen = (*pendata++) & pen_mask;
u8 map = penmap[pen];
pixptr[xoffs] = palette_base + pen;
flagsptr[xoffs] = map | category;

View File

@ -372,13 +372,13 @@ typedef u32 tilemap_memory_index;
struct tile_data
{
device_gfx_interface *decoder; // set in tilemap_t::init()
const u16 * pen_data; // required
const u8 * 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
u16 pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile
u8 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 = 65536;
static const pen_t MAX_PEN_TO_FLAGS = 256;
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 u16 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u16 pen_mask);
u8 tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8 category, u8 group, u8 flags, u8 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);

View File

@ -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);
uint16_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()];
uint8_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 uint16_t *src = gfx.get_data(index);
const uint8_t *src = gfx.get_data(index);
// loop over columns in the cell
for (x = 0; x < width; x++)
{
int effx = x, effy = y;
const uint16_t *s;
const uint8_t *s;
// compute effective x,y values after rotation
if (!(rotate & ORIENTATION_SWAP_XY))

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + y_index * gfx->rowbytes();
const u8 *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++)
{
const u16 c = source[x_index];
u8 c = source[x_index];
if (c != transparent_color)
{
if (flicker) // verified from PCB (reference : https://www.youtube.com/watch?v=ooXyyvpW1O0)

View File

@ -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 uint16_t *gfxdata = gfx->get_data(sprite);
const uint8_t *gfxdata = gfx->get_data(sprite);
for( y = 0; y < 8; y++ )
{

View File

@ -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 u16 *c0base = gfx_l->get_data(c);
const u16 *c1base = gfx_h->get_data(c);
const u8 *c0base = gfx_l->get_data(c);
const u8 *c1base = gfx_h->get_data(c);
// loop over height
for (int y = 0; y < gfx_l->height(); y++)
{
const u16 *c0 = c0base;
const u16 *c1 = c1base;
const u8 *c0 = c0base;
const u8 *c1 = c1base;
for (int x = 0; x < gfx_l->width(); x++)
{

View File

@ -589,7 +589,7 @@ void coolridr_state::video_start()
#define COOLRIDERS_DRAWGFX_CORE(PIXEL_TYPE, COOL_PIXEL_OP) \
do { \
do { \
const uint16_t *srcdata; \
const uint8_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 uint16_t *srcptr = srcdata; \
const uint8_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 uint16_t *srcptr = srcdata; \
const uint8_t *srcptr = srcdata; \
srcdata += dy; \
\
/* iterate over unrolled blocks of 4 */ \

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
const u8 *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 u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
const u8 *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 u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
const u8 *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 u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
const u8 *source = source_base + (y_index>>16) * gfx->rowbytes();
u32 *dest = &dest_bmp.pix32(y);
int x_index = x_index_base;

View File

@ -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 uint16_t *dp;
const uint8_t *dp;
int index = 0;
dp = gfx->get_data(ch);

View File

@ -183,7 +183,6 @@ 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);
@ -199,8 +198,11 @@ 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_rgb(bitmap_rgb32 &bitmap,const rectangle &clip,gfx_element *gfx,
u32 code,u32 color,bool flipx,bool flipy,int offsx,int offsy);
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);
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@ -547,44 +549,23 @@ 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, 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_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_END
@ -593,67 +574,152 @@ void gstream_state::video_start()
}
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)
// 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)
{
/* 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());
// use pen usage to optimize
code %= gfx->elements();
const pen_t *rgb = m_palette->pens(); // 16 bit BGR
int xinc = flipx ? -1 : 1;
int yinc = flipy ? -1 : 1;
// render
int x_index_base = flipx ? gfx->width() - 1 : 0;
int y_index = flipy ? gfx->height() - 1 : 0;
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;
// start coordinates
int sx = offsx;
int sy = offsy;
assert(dest.valid());
assert(gfx != nullptr);
assert(dest.cliprect().contains(cliprect));
assert(code < gfx->elements());
// end coordinates
int ex = sx + gfx->width();
int ey = sy + gfx->height();
/* ignore empty/invalid cliprects */
if (cliprect.empty())
break;
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;
}
/* 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;
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++)
/* apply left clip */
srcx = 0;
if (destx < cliprect.min_x)
{
const u16 c = source[x_index];
if (c != 0) // draw this pixel when rom data is not 0
dest[x] = pal[c];
x_index += xinc;
srcx = cliprect.min_x - destx;
destx = cliprect.min_x;
}
y_index += yinc;
}
}
/* apply right clip */
if (destendx > cliprect.max_x)
destendx = cliprect.max_x;
/* 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;
/* apply top clip */
srcy = 0;
if (desty < cliprect.min_y)
{
srcy = cliprect.min_y - desty;
desty = cliprect.min_y;
}
/* apply bottom clip */
if (destendy > cliprect.max_y)
destendy = cliprect.max_y;
/* apply X flipping */
if (flipx)
srcx = gfx->width() - 1 - srcx;
/* 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;
/* non-flipped 16bpp case */
if (!flipx)
{
/* 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++;
}
}
}
/* 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++;
}
}
}
} while (0);
g_profiler.stop();
} while (0);
}
void gstream_state::draw_bg(bitmap_rgb32 &bitmap, const rectangle &cliprect, int map, uint32_t* ram )
@ -674,8 +740,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_is_rgb)
drawgfx_rgb(bitmap,cliprect,m_gfxdecode->gfx(map),code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f));
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));
else
m_gfxdecode->gfx(map)->transpen(bitmap,cliprect,code,pal,0,0,(x*32)-(scrollx&0x1f)-m_xoffset,(y*32)-(scrolly&0x1f),0);
@ -709,10 +775,12 @@ 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 */
@ -721,12 +789,13 @@ 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_is_rgb)
if (m_gfxdecode->gfx(4))
{
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);
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);
}
else
{
@ -734,6 +803,7 @@ 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;
@ -868,28 +938,53 @@ 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 */
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) )
/* 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( 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( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
/* filled in at init*/
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( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
/* filled in at init*/
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) )
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) )
// no idea what the sound hw is?
ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 )
@ -905,28 +1000,53 @@ 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 */
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) )
/* 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( 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( 0x200000, "gfx2", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
/* filled in at init*/
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( 0x200000, "gfx3", ROMREGION_ERASE00 ) /* bg tiles (32x32x8) */
/* filled in at init*/
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) )
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) )
// no idea what the sound hw is?
ROM_REGION( 0x100000, "oki1", ROMREGION_ERASE00 )
@ -971,17 +1091,40 @@ 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;
}

View File

@ -353,7 +353,7 @@ GFXDECODE_END
void hp9k_state::putChar(uint8_t thec,int x,int y,bitmap_ind16 &bitmap)
{
const uint16_t* pchar=m_gfxdecode->gfx(0)->get_data(thec);
const uint8_t* pchar=m_gfxdecode->gfx(0)->get_data(thec);
for (int py=0;py<HP9816_CHDIMY;py++)
{

View File

@ -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 uint16_t *dp;
const uint8_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++)
{
uint16_t pen = dp[index++];
uint8_t pen = dp[index++];
if (pen)
p[i] = pens[gfx->colorbase() + (att & 0xf)];
else

View File

@ -416,7 +416,7 @@ SCN2674_DRAW_CHARACTER_MEMBER(mpu4vid_state::display_pixels)
if(!lg)
{
uint16_t tile = m_vid_mainram[address & 0x7fff];
const uint16_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff);
const uint8_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();

View File

@ -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 uint16_t *dp;
const uint8_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++)
{
uint16_t pen = dp[index++];
uint8_t pen = dp[index++];
if (pen)
p[i] = pens[gfx->colorbase() + (att & 0xf)];
else

View File

@ -126,7 +126,7 @@ private:
uint8_t m_hascollided;
/* video-related */
const uint16_t get_sprite_pixel(int x, int y);
const uint8_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 uint16_t scyclone_state::get_sprite_pixel(int x, int y)
const uint8_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 uint16_t scyclone_state::get_sprite_pixel(int x, int y)
int sprx = x-minx;
int spry = y-miny;
const uint16_t* srcdata = m_gfxdecode->gfx(0)->get_data(code);
const uint8_t* srcdata = m_gfxdecode->gfx(0)->get_data(code);
uint16_t pix = srcdata[spry*32 + sprx] + col*4;
uint8_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];
uint16_t pal2 = get_sprite_pixel(realx, realy);
uint8_t pal2 = get_sprite_pixel(realx, realy);
if (pal2 & 0x3)
{

View File

@ -5298,14 +5298,14 @@ void taitof2_state::init_finalb()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
const u16 *c0base = gx0->get_data(c);
const u16 *c1base = gx1->get_data(c);
const u8 *c0base = gx0->get_data(c);
const u8 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
const u16 *c0 = c0base;
const u16 *c1 = c1base;
const u8 *c0 = c0base;
const u8 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
{

View File

@ -4217,14 +4217,14 @@ void taito_f3_state::tile_decode()
dest = srcdata;
for (int c = 0; c < spr_gfx->elements(); c++)
{
const u16 *c1base = spr_gfx->get_data(c);
const u16 *c3base = spr_gfx_hi->get_data(c);
const u8 *c1base = spr_gfx->get_data(c);
const u8 *c3base = spr_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < spr_gfx->height(); y++)
{
const u16 *c1 = c1base;
const u16 *c3 = c3base;
const u8 *c1 = c1base;
const u8 *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 u16 *c0base = pf_gfx->get_data(c);
const u16 *c2base = pf_gfx_hi->get_data(c);
const u8 *c0base = pf_gfx->get_data(c);
const u8 *c2base = pf_gfx_hi->get_data(c);
// loop over height
for (int y = 0; y < pf_gfx->height(); y++)
{
const u16 *c0 = c0base;
const u16 *c2 = c2base;
const u8 *c0 = c0base;
const u8 *c2 = c2base;
for (int x = 0; x < pf_gfx->width(); x++)
*dest++ = (*c0++ & 0xf) | (*c2++ & 0x30);

View File

@ -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 uint16_t *gfxdata0 = gfx0->get_data(code);
const uint16_t *gfxdata2 = gfx2->get_data(code);
const uint8_t *gfxdata0 = gfx0->get_data(code);
const uint8_t *gfxdata2 = gfx2->get_data(code);
// assume 16 rows
for (int y = 0; y < 16; y++)
{
const uint16_t *gd0 = gfxdata0;
const uint16_t *gd2 = gfxdata2;
const uint8_t *gd0 = gfxdata0;
const uint8_t *gd2 = gfxdata2;
// 16 columns
for (int x = 0; x < 16; x++, gd0++, gd2++)

View File

@ -58,7 +58,7 @@ protected:
template<int Layer> DECLARE_WRITE16_MEMBER(pf_w);
DECLARE_WRITE8_MEMBER(coin_counter_w);
const uint16_t *get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block);
const uint8_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);

View File

@ -376,12 +376,12 @@ protected:
int m_palette_align;
int m_palette_size;
int m_stars_rom_size;
uint16_t m_empty_tile[32*32];
uint8_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;

View File

@ -98,7 +98,7 @@ private:
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap_l;
tilemap_t *m_bg_tilemap_r;
uint16_t m_empty_tile[16*16];
uint8_t m_empty_tile[16*16];
int32_t m_watchdog_count;
int32_t m_watchdog_flip;
int32_t m_color_missiles;

View File

@ -126,7 +126,7 @@ struct namcos22_object_data
const u8 *czram;
/* sprites */
const u16 *source;
const u8 *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;
u16 *m_texture_tiledata;
u8 *m_texture_tiledata;
std::unique_ptr<u8[]> m_texture_ayx_to_pixel;
int m_is_ss22;
int m_mixer_flags;

View File

@ -85,7 +85,7 @@ private:
int m_tilemap_flip;
int m_flipscreen;
uint8_t m_irq_port_last;
uint16_t m_blank_tile[8*8];
uint8_t m_blank_tile[8*8];
uint8_t m_palette_lookup[32];
/* misc */

View File

@ -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 uint16_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 uint8_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;

View File

@ -116,7 +116,7 @@ private:
int m_is_psychos;
uint8_t m_drawmode_table[16];
uint16_t m_empty_tile[16*16];
uint8_t m_empty_tile[16*16];
int m_hf_posy;
int m_hf_posx;
int m_tc16_posy;

View File

@ -52,7 +52,7 @@ private:
uint8_t m_flip_y;
tilemap_t *m_solid_tilemap;
tilemap_t *m_tilemap;
std::unique_ptr<uint16_t[]> m_dummy_tile;
std::unique_ptr<uint8_t[]> m_dummy_tile;
uint8_t m_nmi_mask;
int m_question_address;

View File

@ -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 u16 *c0base = gx0->get_data(c);
const u16 *c1base = gx1->get_data(c);
const u8 *c0base = gx0->get_data(c);
const u8 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
const u16 *c0 = c0base;
const u16 *c1 = c1base;
const u8 *c0 = c0base;
const u8 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
*dest++ = (*c0++ & mask0) | (*c1++ & mask1);

View File

@ -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 uint16_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos, int ypos)
inline uint8_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 uint16_t sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int x
if (tileno==0) return 0x00;
const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
inline uint16_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos, int ypos)
inline uint8_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 uint16_t sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int x
if (tileno==0) return 0x00; // does this apply in this mode?
const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
inline uint16_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xpos, int ypos)
inline uint8_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 uint16_t sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int
if (tileno==0) return 0x00; // does this apply in this mode
const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
const uint8_t* srcdata = gfx(tile_region)->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
inline uint16_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xpos, int ypos)
inline uint8_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 uint16_t sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int
if (tileno==0) return 0x00;
const uint16_t* srcdata = gfx(tile_region)->get_data(tileno);
const uint8_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 uint16_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y)
inline uint8_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;
uint16_t pix = 0x0;
uint8_t pix = 0x0;
pix = read_pixel_from_stampmap(srcbitmap, xbase>>(3+8), ybase>>(3+8));

View File

@ -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 );
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 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 read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y);
uint8_t read_pixel_from_stampmap(bitmap_ind16* srcbitmap, int x, int y);
virtual void device_start() override;
virtual void device_reset() override;

View File

@ -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 uint16_t *srcgfx;
const uint8_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 uint16_t *srcgfx;
const uint8_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;

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + y_index * gfx->rowbytes();
const u8 *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))
{
const u16 c = source[x_index];
u8 c = source[x_index];
if (c != transparent_color)
{
// the priority is actually selected by bit 3 of BMPROM.07

View File

@ -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 uint16_t *source_base = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *source = source_base + y_index*gfx->rowbytes();
const uint8_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++)

View File

@ -94,7 +94,7 @@ void mechatt_state::video_start()
else if (dy&0x40) code+=32; \
else if (dx&0x40) code+=16
inline const uint16_t *bbusters_state_base::get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block)
inline const uint8_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 uint16_t *srcptr=nullptr;
const uint8_t *srcptr=nullptr;
if (!flipy)
srcline=size-srcline-1;

View File

@ -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 uint16_t *pendata;
const uint8_t *pendata;
pos = base_pos + 2 * ch;
code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8));

View File

@ -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 uint16_t *sprite_data = sprite_gfx->get_data(m_clown_z);
const uint8_t *sprite_data = sprite_gfx->get_data(m_clown_z);
int sx, sy, dx, dy;
int pixel, collision = 0;

View File

@ -442,8 +442,6 @@ 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
/********************************************************************
@ -2274,7 +2272,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 */
std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0x0f);
memset(m_empty_tile, 0x0f, sizeof(m_empty_tile));
/* front masks will change at runtime to handle sprite occluding */
cps1_update_transmasks();

View File

@ -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 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();
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();
/* no alpha */
if ((alpha == 0xff) && (!shadowMode))
{

View File

@ -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 uint16_t *code_base = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes();
const uint8_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 uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes();
const uint8_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);

View File

@ -125,7 +125,6 @@
#include "emu.h"
#include "includes/decocass.h"
#include <algorithm>
static const uint32_t tile_offset[32*32] = {
@ -249,8 +248,8 @@ void decocass_state::draw_special_priority(bitmap_ind16 &bitmap, bitmap_ind8 &pr
sy += 256;
int sx = m_part_h_shift - 128;
const uint16_t *objdata0 = m_gfxdecode->gfx(3)->get_data(0);
const uint16_t *objdata1 = m_gfxdecode->gfx(3)->get_data(1);
const uint8_t *objdata0 = m_gfxdecode->gfx(3)->get_data(0);
const uint8_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++)
@ -720,7 +719,7 @@ void decocass_state::video_start()
m_gfxdecode->gfx(3)->set_source(m_objectram);
/* create an empty tile */
std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0);
memset(m_empty_tile, 0, sizeof(m_empty_tile));
}
uint32_t decocass_state::screen_update_decocass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)

View File

@ -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 uint16_t* const srcgfx = gfx->get_data(tile);
const uint8_t* const srcgfx = gfx->get_data(tile);
const pen_t *paldata = &m_palette->pen(gfx->colorbase() + gfx->granularity() * color);
int x,yy;

View File

@ -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 uint16_t *gfx_src = gfx->get_data(number % gfx->elements());
const uint8_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 u16 gfx_pen = gfx_src[gfx->rowbytes() * gfx_py + gfx_px];
const u8 gfx_pen = gfx_src[gfx->rowbytes() * gfx_py + gfx_px];
if ((gfx_pen == 0) || (gfx_pen >= 16)) continue;

View File

@ -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 uint16_t *gfx_src = gfx->get_data(number % gfx->elements());
const uint8_t *gfx_src = gfx->get_data(number % gfx->elements());
for (int py = 0; py < gfx->height(); py++)
{

View File

@ -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 u16* srcdata = gfx(1)->get_data(sprite);
const u8* 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 u16 pix = srcdata[count];
const u8 pix = srcdata[count];
u16* dstptr = &bitmap.pix16(drawyy, drawxx);
u8* dstpri = &this->custom_priority_bitmap->pix8(drawyy, drawxx);

View File

@ -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 uint16_t *src = gfx->get_data(code) + ((dy ^ yflip) & 15) * gfx->rowbytes();
const uint8_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 uint16_t *src = gfx->get_data(code) + (dy & 7) * gfx->rowbytes();
const uint8_t *src = gfx->get_data(code) + (dy & 7) * gfx->rowbytes();
int x;
/* draw 8 pixels */

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + y_index*gfx->rowbytes();
const u8 *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 u16 c = source[x_index];
const u8 c = source[x_index];
if (c != transparent_color)
{
dest[x] = jaleco_blend_device::func(dest[x], pal[c]);

View File

@ -41,12 +41,12 @@ void jedi_state::video_start()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
const u16 *c0base = gx0->get_data(c);
const u8 *c0base = gx0->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
const u16 *c0 = c0base;
const u8 *c0 = c0base;
for (int x = 0; x < gx0->width(); x++)
{
@ -59,35 +59,6 @@ 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 */

View File

@ -438,7 +438,7 @@ void k053247_device::zdrawgfxzoom32GP(
#define FPENT 0
// inner loop
const u16 *src_ptr;
const u8 *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 u16 *src_base;
const u8 *src_base;
int dst_w, dst_h;
// one-time

View File

@ -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 uint16_t *src_ptr;
const uint8_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 uint16_t *src_ptr;
const uint8_t *src_ptr;
uint8_t *xpr_ptr;
uint16_t *dst_ptr;
uint16_t pen, basepen;

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + y_index * gfx->rowbytes();
const u8 *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 u16 c = source[x_index];
const u8 c = source[x_index];
if (c != 0)
{
if (pri[x] < priority)

View File

@ -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 uint16_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
const uint8_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 uint16_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
const uint8_t *src = gfx->get_data(code) + gfx->rowbytes() * (y ^ vflip);
uint16_t *dst = &bitmap.pix16(sy);
uint8_t *pri = &screen.priority().pix8(sy);

View File

@ -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 u16* gfx = decodegfx->get_data(code);
const u8* gfx = decodegfx->get_data(code);
flipy = (flipy) ? 0x0f : 0;
flipx = (flipx) ? 0x0f : 0;

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
const u8 *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 u16 c = source[x_index>>16];
const u8 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 u16 c = source[x_index>>16];
const u8 c = source[x_index>>16];
if (c != 0xff)
{
if (pri[x] <= zpos)

View File

@ -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 u16 *source_base = gfx->get_data((code % gfx->elements()));
const u16 *mask_base = mask->get_data((code % mask->elements()));
const u8 *source_base = gfx->get_data((code % gfx->elements()));
const u8 *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 u16 *source = source_base + y_index * gfx->rowbytes();
const u16 *mask_addr = mask_base + y_index * mask->rowbytes();
const u8 *source = source_base + y_index * gfx->rowbytes();
const u8 *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 u16 c = source[x_index];
const u8 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 u16 c = source[x_index];
const u8 c = source[x_index];
/* render a shadow only if the sprites color is $F (8bpp) or $FF (4bpp) */
if (bShadow)

View File

@ -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();
u16 *ttdata = m_state.m_texture_tiledata;
u8 *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);
u16 *source = (u16 *)extra.source + y_index * extra.line_modulo;
u8 *source = (u8 *)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 = (u16 *)m_gfxdecode->gfx(1)->get_data(0);
m_texture_tiledata = (u8 *)m_gfxdecode->gfx(1)->get_data(0);
m_texture_tileattr = std::make_unique<u8[]>(0x080000*2);
// unpack textures

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + (y_index>>16) * gfx->rowbytes();
const u8 *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 u16 c = source[x_index >> 16];
const u8 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 u16 c = source[x_index >> 16];
const u8 c = source[x_index >> 16];
if (c != 0xff)
{
if (pri[x] <= zpos)

View File

@ -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());
std::fill(std::begin(m_blank_tile), std::end(m_blank_tile), 0);
memset(m_blank_tile, 0, ARRAY_LENGTH(m_blank_tile));
/* Set up save state */
machine().save().register_postload(save_prepost_delegate(FUNC(nemesis_state::nemesis_postload), this));

View File

@ -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 uint16_t *gfxdata = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *src;
const uint8_t *src;
if (!big) dy >>= 1;
src = gfxdata + dy * gfx->rowbytes();

View File

@ -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 uint16_t *source_base = gfx->get_data(a->code % gfx->elements());
const uint16_t *source = source_base + (a->row ^ a->flipy) * gfx->rowbytes();
const uint8_t *source_base = gfx->get_data(a->code % gfx->elements());
const uint8_t *source = source_base + (a->row ^ a->flipy) * gfx->rowbytes();
if (bootleg_sprites() && flipx != a->flipx)
{

View File

@ -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 u16 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
const u8 *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 u16 *source = code_base + (y_index) * gfx->rowbytes() + x_index_base;
const u8 *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 u16 c = *source;
const u8 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 u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
const u8 *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 u16 c = *source;
const u8 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 u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
const u8 *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 u16 c = *source;
const u8 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 u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
const u8 *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 u16 c = *source;
const u8 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 u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
const u8 *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 u16 c = *source;
const u8 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 u16 *source = code_base + y_index * gfx->rowbytes() + x_index_base;
const u8 *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 u16 c = *source;
const u8 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 u16 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
const u8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements());
for (int ypixel = 0; ypixel < gfx->height(); ypixel++)
{
const u16 *source = code_base + ypixel * gfx->rowbytes();
const u8 *source = code_base + ypixel * gfx->rowbytes();
u8 *dest = &m_zoom_bitmap.pix8(ypixel + ytile*gfx->height());
for (int xpixel = 0; xpixel < gfx->width(); xpixel++)

View File

@ -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 u16 *src = gfx->get_data(code % gfx->elements());
const u8 *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 u16 pen = src[src_i];
const u8 pen = src[src_i];
if (!(pri[x] & primask) && pen != trans_pen)
{
pri[x] |= primask;

View File

@ -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 uint16_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 uint8_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 uint16_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8;
const uint8_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8;
uint16_t* dest = &bitmap.pix16(realline);

View File

@ -3,7 +3,6 @@
// thanks-to:Marco Cassili
#include "emu.h"
#include "includes/snk.h"
#include <algorithm>
/*******************************************************************************
Shadow Handling Notes
@ -343,7 +342,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;
std::fill(std::begin(m_empty_tile), std::end(m_empty_tile), 0xf);
memset(m_empty_tile, 0xf, sizeof(m_empty_tile));
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);

View File

@ -142,10 +142,10 @@ void ssv_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, in
{
gfx_element *gfxelement = m_gfxdecode->gfx(0);
const uint16_t *const addr = gfxelement->get_data(code % gfxelement->elements());
const uint8_t *const addr = gfxelement->get_data(code % gfxelement->elements());
const uint32_t realcolor = gfxelement->granularity() * (color % gfxelement->colors());
const uint16_t *const source = flipy ? addr + (7 - line) * gfxelement->rowbytes() : addr + line * gfxelement->rowbytes();
const uint8_t *const source = flipy ? addr + (7 - line) * gfxelement->rowbytes() : addr + line * gfxelement->rowbytes();
if (realline >= cliprect.min_y && realline <= cliprect.max_y)
{

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + (y_index >> 16) * gfx->rowbytes();
const u8 *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 u16 c = source[x_index >> 16];
const u8 c = source[x_index >> 16];
if (c && (pri[x] & 0x80) == 0)
{
u8 tilemap_priority = 0, sprite_priority = 0;

View File

@ -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 u16 *dp = sprite_gfx->get_data(c);
const u8 *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 u16 *dp = pf_gfx->get_data(c);
const u8 *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 u16 *code_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source0 = code_base + y_index * 16 + x_index_base;
const u8 *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 u16 *source = source0;
const u8 *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 u16 *code_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = code_base + (y_index >> 16) * 16;
const u8 *source = code_base + (y_index >> 16) * 16;
u32 *dest = &dest_bmp.pix32(y);
u8 *pri = &m_pri_alp_bitmap.pix8(y);

View File

@ -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 uint16_t *code_base = gfx->get_data(code % gfx->elements());
const uint8_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 uint16_t *source = code_base + (cy>>16) * gfx->rowbytes();
const uint8_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 uint16_t *source = code_base + (y_index>>16) * gfx->rowbytes();
const uint8_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 uint16_t *c0base = gx0->get_data(c);
const uint8_t *c0base = gx0->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
const uint16_t *c0 = c0base;
const uint8_t *c0 = c0base;
for (int x = 0; x < gx0->width(); x++)
{

View File

@ -355,14 +355,14 @@ void tc0620scc_device::device_start()
u8 *dest = srcdata;
for (int c = 0; c < gx0->elements(); c++)
{
const u16 *c0base = gx0->get_data(c);
const u16 *c1base = gx1->get_data(c);
const u8 *c0base = gx0->get_data(c);
const u8 *c1base = gx1->get_data(c);
// loop over height
for (int y = 0; y < gx0->height(); y++)
{
const u16 *c0 = c0base;
const u16 *c1 = c1base;
const u8 *c0 = c0base;
const u8 *c1 = c1base;
for (int x = 0; x < gx0->width(); x++)
*dest++ = (*c0++ & 0xf) | (*c1++ & 0x30);

View File

@ -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<uint16_t[]>(8*8);
m_dummy_tile = make_unique_clear<uint8_t[]>(8*8);
m_graphics_bank = 0; /* only used in intrepid */

View File

@ -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 u16 *source_base = gfx->get_data(code % gfx->elements());
const u8 *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 u16 *source = source_base + (y_index >> 16) * gfx->rowbytes();
const u8 *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 u16 c = source[x_index >> 16];
const u8 c = source[x_index >> 16];
if (c != 0)
{
if (pri[x] < priority)

View File

@ -542,7 +542,7 @@ void wecleman_state::wecleman_draw_road(bitmap_rgb32 &bitmap, const rectangle &c
};
const uint16_t *src_ptr;
const uint8_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 uint16_t *src_ptr;
const uint8_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<uint16_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0;
*const_cast<uint8_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0;
}
// Callbacks for the K051316