summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-02-24 23:24:29 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-02-24 23:24:29 +0000
commit2b1192dec8b3b489d3a1f549db6cdf1e81a704cd (patch)
tree31b68a3ada34c9b5763d3c8979a3d528bbd35074
parentee93a9155103cb019aea2c50d3fc5f112062ab50 (diff)
- Backs out BITMAP8 removal from most places.
- I still left drawgfx.c as is, the only piece of code that used any of the functions in drawgfx was s2636.c -- everything else uses 8-bit bitmaps as a replacement for a two dimensional array
-rw-r--r--src/emu/cpu/tms34010/tms34010.c2
-rw-r--r--src/emu/drawgfx.c10
-rw-r--r--src/emu/tilemap.c120
-rw-r--r--src/lib/util/bitmap.c9
-rw-r--r--src/lib/util/bitmap.h2
-rw-r--r--src/mame/drivers/namcoic.c4
-rw-r--r--src/mame/video/battlane.c15
-rw-r--r--src/mame/video/deco16ic.c10
-rw-r--r--src/mame/video/deco32.c6
-rw-r--r--src/mame/video/deniam.c16
-rw-r--r--src/mame/video/gladiatr.c2
-rw-r--r--src/mame/video/kaneko16.c2
-rw-r--r--src/mame/video/konamiic.c65
-rw-r--r--src/mame/video/mcatadv.c4
-rw-r--r--src/mame/video/mcr.c4
-rw-r--r--src/mame/video/namcona1.c12
-rw-r--r--src/mame/video/namcos2.c2
-rw-r--r--src/mame/video/namcos22.c4
-rw-r--r--src/mame/video/pacland.c2
-rw-r--r--src/mame/video/playmark.c6
-rw-r--r--src/mame/video/psikyosh.c16
-rw-r--r--src/mame/video/segaic16.c14
-rw-r--r--src/mame/video/segaic24.c2
-rw-r--r--src/mame/video/segas18.c2
-rw-r--r--src/mame/video/seibuspi.c4
-rw-r--r--src/mame/video/system16.c6
-rw-r--r--src/mame/video/taito_f2.c2
-rw-r--r--src/mame/video/taito_f3.c34
-rw-r--r--src/mame/video/taitoic.c16
-rw-r--r--src/mame/video/tatsumi.c10
-rw-r--r--src/mame/video/toaplan1.c2
-rw-r--r--src/mame/video/twin16.c6
-rw-r--r--src/mame/video/wgp.c6
33 files changed, 249 insertions, 168 deletions
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 990639561bb..700cce3af00 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -1138,7 +1138,7 @@ VIDEO_UPDATE( tms340x0 )
for (x = params.hsblnk; x <= cliprect->max_y; x++)
dest[x] = blackpen;
}
- else
+ else if (bitmap->bpp == 32)
{
UINT32 *dest = BITMAP_ADDR32(bitmap, cliprect->min_y, 0);
for (x = cliprect->min_x; x < params.heblnk; x++)
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index b1a5f73e266..7eb6dfa0020 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -848,6 +848,7 @@ INLINE void common_drawgfx(mame_bitmap *dest,const gfx_element *gfx,
mame_bitmap *pri_buffer,UINT32 pri_mask)
{
assert(dest != NULL);
+ assert((dest->bpp == 16) || (dest->bpp == 32));
assert(gfx != NULL);
code %= gfx->total_elements;
@@ -927,6 +928,8 @@ static void copybitmap_common(mame_bitmap *dest,mame_bitmap *src,int flipx,int f
{
assert(dest != NULL);
assert(src != NULL);
+ assert((dest->bpp == 16) || (dest->bpp == 32));
+ assert(dest->bpp == src->bpp);
profiler_mark(PROFILER_COPYBITMAP);
@@ -974,6 +977,7 @@ static void copyscrollbitmap_common(mame_bitmap *dest,mame_bitmap *src,
assert(dest != NULL);
assert(src != NULL);
+ assert((dest->bpp == 16) || (dest->bpp == 32));
assert(dest->bpp == src->bpp);
assert((rows != 0) || (rowscroll == NULL));
assert((rows == 0) || (rowscroll != NULL));
@@ -1227,6 +1231,7 @@ void copyrozbitmap(mame_bitmap *dest,mame_bitmap *src,
{
assert(dest != NULL);
assert(src != NULL);
+ assert((dest->bpp == 16) || (dest->bpp == 32));
assert(dest->bpp == src->bpp);
profiler_mark(PROFILER_COPYBITMAP);
@@ -1261,6 +1266,7 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
/* verify arguments */
assert(dest_bmp != NULL);
+ assert((dest_bmp->bpp == 16) || (dest_bmp->bpp == 32));
assert(gfx != NULL);
if ((scalex == 0) || (scaley == 0)) return;
@@ -3717,6 +3723,7 @@ DECLAREG(draw_scanline, (
const DATA_TYPE *src,const pen_t *pens,int transparent_pen),
{
assert(bitmap != NULL);
+ assert((bitmap->bpp == 16) || (bitmap->bpp == 32));
assert(src != NULL);
assert(length > 0);
assert(x >= 0);
@@ -3818,7 +3825,7 @@ DECLAREG(pdraw_scanline, (
const DATA_TYPE *src,const pen_t *pens,int transparent_pen,int pri),
{
assert(bitmap != NULL);
- assert(src != NULL);
+ assert((bitmap->bpp == 16) || (bitmap->bpp == 32));
assert(length > 0);
assert(x >= 0);
assert(y >= 0);
@@ -3946,6 +3953,7 @@ DECLAREG(extract_scanline, (
DATA_TYPE *dst),
{
assert(bitmap != NULL);
+ assert((bitmap->bpp == 16) || (bitmap->bpp == 32));
assert(dst != NULL);
assert(length > 0);
assert(x >= 0);
diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c
index c20fe4b9df6..ecbd59b3220 100644
--- a/src/emu/tilemap.c
+++ b/src/emu/tilemap.c
@@ -47,8 +47,8 @@ typedef enum
/* internal blitting callbacks */
-typedef void (*blitmask_t)(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
-typedef void (*blitopaque_t)(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
+typedef void (*blitmask_t)(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
+typedef void (*blitopaque_t)(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
/* blitting parameters for rendering */
@@ -158,18 +158,18 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound);
/* scanline rasterizers for drawing to the pixmap */
-static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_opaque_ind16(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_masked_ind16(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_opaque_rgb16(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_masked_rgb16(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_opaque_rgb16_alpha(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_masked_rgb16_alpha(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_opaque_rgb32(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_masked_rgb32(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_opaque_rgb32_alpha(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode);
-static void scanline_draw_masked_rgb32_alpha(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode);
+static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_opaque_ind16(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_masked_ind16(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_opaque_rgb16(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_masked_rgb16(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_opaque_rgb16_alpha(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_masked_rgb16_alpha(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_opaque_rgb32(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_masked_rgb32(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_opaque_rgb32_alpha(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
+static void scanline_draw_masked_rgb32_alpha(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
@@ -272,7 +272,7 @@ void tilemap_init(running_machine *machine)
tilemap_tailptr = &tilemap_list;
tilemap_instance = 0;
- priority_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED16);
+ priority_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
add_exit_callback(machine, tilemap_exit);
}
}
@@ -328,7 +328,7 @@ tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_cal
/* allocate transparency mapping data */
tmap->tileflags = malloc_or_die(tmap->max_logical_index);
- tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED16);
+ tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8);
tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
for (group = 0; group < TILEMAP_NUM_GROUPS; group++)
tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
@@ -1302,7 +1302,7 @@ static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0
for (ty = 0; ty < height; ty++)
{
UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
- UINT16 *flagsptr = BITMAP_ADDR16(flagsmap, y0, x0);
+ UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
int xoffs = 0;
/* pre-advance to the next row */
@@ -1386,7 +1386,7 @@ static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0,
/* iterate over rows */
for (ty = 0; ty < height; ty++)
{
- UINT16 *flagsptr = BITMAP_ADDR16(flagsmap, y0, x0);
+ UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
int xoffs = 0;
/* pre-advance to the next row */
@@ -1508,9 +1508,9 @@ static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, in
{
mame_bitmap *dest = blit->bitmap;
const UINT16 *source_baseaddr;
- const UINT16 *mask_baseaddr;
+ const UINT8 *mask_baseaddr;
void *dest_baseaddr = NULL;
- UINT16 *priority_baseaddr;
+ UINT8 *priority_baseaddr;
int dest_line_pitch_bytes = 0;
int dest_bytespp = 0;
int mincol, maxcol;
@@ -1529,7 +1529,7 @@ static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, in
return;
/* look up priority and destination base addresses for y1 */
- priority_baseaddr = BITMAP_ADDR16(priority_bitmap, y1, xpos);
+ priority_baseaddr = BITMAP_ADDR8(priority_bitmap, y1, xpos);
if (dest != NULL)
{
dest_bytespp = dest->bpp / 8;
@@ -1545,7 +1545,7 @@ static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, in
/* get tilemap pixels */
source_baseaddr = BITMAP_ADDR16(tmap->pixmap, y1, 0);
- mask_baseaddr = BITMAP_ADDR16(tmap->flagsmap, y1, 0);
+ mask_baseaddr = BITMAP_ADDR8(tmap->flagsmap, y1, 0);
/* get start/stop columns, rounding outward */
mincol = x1 / tmap->tilewidth;
@@ -1606,7 +1606,7 @@ static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, in
{
const UINT16 *source0 = source_baseaddr + x_start;
void *dest0 = (UINT8 *)dest_baseaddr + x_start * dest_bytespp;
- UINT16 *pmap0 = priority_baseaddr + x_start;
+ UINT8 *pmap0 = priority_baseaddr + x_start;
int cury;
/* if we were opaque, use the opaque renderer */
@@ -1625,7 +1625,7 @@ static void tilemap_draw_instance(tilemap *tmap, const blit_parameters *blit, in
/* otherwise use the masked renderer */
else
{
- const UINT16 *mask0 = mask_baseaddr + x_start;
+ const UINT8 *mask0 = mask_baseaddr + x_start;
for (cury = y; cury < nexty; cury++)
{
(*blit->draw_masked)(dest0, source0, mask0, blit->mask, blit->value, x_end - x_start, pmap0, blit->tilemap_priority_code);
@@ -1703,9 +1703,9 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
int ex;
int ey;
void *dest;
- UINT16 *pri;
+ UINT8 *pri;
const UINT16 *src;
- const UINT16 *maskptr;
+ const UINT8 *maskptr;
int destadvance = destbitmap->bpp / 8;
/* pre-advance based on the cliprect */
@@ -1744,9 +1744,9 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
cy = starty >> 16;
/* get source and priority pointers */
- pri = BITMAP_ADDR16(priority_bitmap, sy, sx);
+ pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
src = BITMAP_ADDR16(srcbitmap, cy, 0);
- maskptr = BITMAP_ADDR16(flagsmap, cy, 0);
+ maskptr = BITMAP_ADDR8(flagsmap, cy, 0);
dest = (UINT8 *)destbitmap->base + (destbitmap->rowpixels * sy + sx) * destadvance;
/* loop over columns */
@@ -1756,7 +1756,7 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
if ((maskptr[cx >> 16] & mask) == value)
{
ROZ_PLOT_PIXEL(src[cx >> 16]);
- *pri = ((*pri & (priority >> 8)) | priority) & 0xff;
+ *pri = (*pri & (priority >> 8)) | priority;
}
/* advance in X */
@@ -1786,16 +1786,16 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
/* get dest and priority pointers */
dest = (UINT8 *)destbitmap->base + (destbitmap->rowpixels * sy + sx) * destadvance;
- pri = BITMAP_ADDR16(priority_bitmap, sy, sx);
+ pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
/* loop over columns */
while (x <= ex)
{
/* plot if we match the mask */
- if ((*BITMAP_ADDR16(flagsmap, (cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
+ if ((*BITMAP_ADDR8(flagsmap, (cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
{
ROZ_PLOT_PIXEL(*BITMAP_ADDR16(srcbitmap, (cy >> 16) & ymask, (cx >> 16) & xmask));
- *pri = ((*pri & (priority >> 8)) | priority) & 0xff;
+ *pri = (*pri & (priority >> 8)) | priority;
}
/* advance in X */
@@ -1826,17 +1826,17 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
/* get dest and priority pointers */
dest = (UINT8 *)destbitmap->base + (destbitmap->rowpixels * sy + sx) * destadvance;
- pri = BITMAP_ADDR16(priority_bitmap, sy, sx);
+ pri = BITMAP_ADDR8(priority_bitmap, sy, sx);
/* loop over columns */
while (x <= ex)
{
/* plot if we're within the bitmap and we match the mask */
if (cx < widthshifted && cy < heightshifted)
- if ((*BITMAP_ADDR16(flagsmap, cy >> 16, cx >> 16) & mask) == value)
+ if ((*BITMAP_ADDR8(flagsmap, cy >> 16, cx >> 16) & mask) == value)
{
ROZ_PLOT_PIXEL(*BITMAP_ADDR16(srcbitmap, cy >> 16, cx >> 16));
- *pri = ((*pri & (priority >> 8)) | priority) & 0xff;
+ *pri = (*pri & (priority >> 8)) | priority;
}
/* advance in X */
@@ -1866,7 +1866,7 @@ static void tilemap_draw_roz_core(tilemap *tmap, const blit_parameters *blit,
bitmap, setting priority only
-------------------------------------------------*/
-static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
{
int i;
@@ -1874,7 +1874,7 @@ static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int coun
if (pcode != 0xff00)
{
for (i = 0; i < count; i++)
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -1884,7 +1884,7 @@ static void scanline_draw_opaque_null(void *dest, const UINT16 *source, int coun
bitmap using a mask, setting priority only
-------------------------------------------------*/
-static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
{
int i;
@@ -1893,7 +1893,7 @@ static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UI
{
for (i = 0; i < count; i++)
if ((maskptr[i] & mask) == value)
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -1904,7 +1904,7 @@ static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UI
indexed bitmap
-------------------------------------------------*/
-static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
{
UINT16 *dest = _dest;
int pal = pcode >> 16;
@@ -1919,7 +1919,7 @@ static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int co
if (pcode != 0xff00)
{
for (i = 0; i < count; i++)
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -1929,7 +1929,7 @@ static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int co
for (i = 0; i < count; i++)
{
dest[i] = source[i] + pal;
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -1947,7 +1947,7 @@ static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int co
indexed bitmap using a mask
-------------------------------------------------*/
-static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
{
UINT16 *dest = _dest;
int pal = pcode >> 16;
@@ -1960,7 +1960,7 @@ static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const
if ((maskptr[i] & mask) == value)
{
dest[i] = source[i] + pal;
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -1980,7 +1980,7 @@ static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const
RGB bitmap
-------------------------------------------------*/
-static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT16 *dest = _dest;
@@ -1992,7 +1992,7 @@ static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int co
for (i = 0; i < count; i++)
{
dest[i] = clut[source[i]];
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2010,7 +2010,7 @@ static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int co
RGB bitmap using a mask
-------------------------------------------------*/
-static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT16 *dest = _dest;
@@ -2023,7 +2023,7 @@ static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const
if ((maskptr[i] & mask) == value)
{
dest[i] = clut[source[i]];
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2042,7 +2042,7 @@ static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const
16bpp RGB bitmap with alpha blending
-------------------------------------------------*/
-static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT16 *dest = _dest;
@@ -2054,7 +2054,7 @@ static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source,
for (i = 0; i < count; i++)
{
dest[i] = alpha_blend16(dest[i], clut[source[i]]);
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2073,7 +2073,7 @@ static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source,
blending
-------------------------------------------------*/
-static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT16 *dest = _dest;
@@ -2086,7 +2086,7 @@ static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source,
if ((maskptr[i] & mask) == value)
{
dest[i] = alpha_blend16(dest[i], clut[source[i]]);
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2105,7 +2105,7 @@ static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source,
RGB bitmap
-------------------------------------------------*/
-static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT32 *dest = _dest;
@@ -2117,7 +2117,7 @@ static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int co
for (i = 0; i < count; i++)
{
dest[i] = clut[source[i]];
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2135,7 +2135,7 @@ static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int co
RGB bitmap using a mask
-------------------------------------------------*/
-static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT32 *dest = _dest;
@@ -2148,7 +2148,7 @@ static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const
if ((maskptr[i] & mask) == value)
{
dest[i] = clut[source[i]];
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2167,7 +2167,7 @@ static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const
32bpp RGB bitmap with alpha blending
-------------------------------------------------*/
-static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT32 *dest = _dest;
@@ -2179,7 +2179,7 @@ static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source,
for (i = 0; i < count; i++)
{
dest[i] = alpha_blend32(dest[i], clut[source[i]]);
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
@@ -2198,7 +2198,7 @@ static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source,
blending
-------------------------------------------------*/
-static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT16 *maskptr, int mask, int value, int count, UINT16 *pri, UINT32 pcode)
+static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode)
{
const pen_t *clut = &Machine->pens[pcode >> 16];
UINT32 *dest = _dest;
@@ -2211,7 +2211,7 @@ static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source,
if ((maskptr[i] & mask) == value)
{
dest[i] = alpha_blend32(dest[i], clut[source[i]]);
- pri[i] = ((pri[i] & (pcode >> 8)) | pcode) & 0xff;
+ pri[i] = (pri[i] & (pcode >> 8)) | pcode;
}
}
diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c
index 69454a3cba4..3c4dec454a5 100644
--- a/src/lib/util/bitmap.c
+++ b/src/lib/util/bitmap.c
@@ -183,6 +183,12 @@ void bitmap_fill(bitmap_t *dest, const rectangle *cliprect, UINT32 color)
/* based on the bpp go from there */
switch (dest->bpp)
{
+ case 8:
+ /* 8bpp always uses memset */
+ for (y = fill.min_y; y <= fill.max_y; y++)
+ memset(BITMAP_ADDR8(dest, y, fill.min_x), (UINT8)color, fill.max_x + 1 - fill.min_x);
+ break;
+
case 16:
/* 16bpp can use memset if the bytes are equal */
if ((UINT8)(color >> 8) == (UINT8)color)
@@ -237,6 +243,9 @@ int bitmap_format_to_bpp(bitmap_format format)
/* choose a depth for the format */
switch (format)
{
+ case BITMAP_FORMAT_INDEXED8:
+ return 8;
+
case BITMAP_FORMAT_INDEXED16:
case BITMAP_FORMAT_RGB15:
case BITMAP_FORMAT_YUY16:
diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h
index 4f3c39fcc61..ab484a010ff 100644
--- a/src/lib/util/bitmap.h
+++ b/src/lib/util/bitmap.h
@@ -26,6 +26,7 @@
enum _bitmap_format
{
BITMAP_FORMAT_INVALID = 0, /* invalid format */
+ BITMAP_FORMAT_INDEXED8, /* 8bpp indexed */
BITMAP_FORMAT_INDEXED16, /* 16bpp indexed */
BITMAP_FORMAT_INDEXED32, /* 32bpp indexed */
BITMAP_FORMAT_RGB15, /* 15bpp 5-5-5 RGB */
@@ -72,6 +73,7 @@ struct _bitmap_t
#define BITMAP_ADDR(bitmap, type, y, x) \
((type *)(bitmap)->base + (y) * (bitmap)->rowpixels + (x))
+#define BITMAP_ADDR8(bitmap, y, x) BITMAP_ADDR(bitmap, UINT8, y, x)
#define BITMAP_ADDR16(bitmap, y, x) BITMAP_ADDR(bitmap, UINT16, y, x)
#define BITMAP_ADDR32(bitmap, y, x) BITMAP_ADDR(bitmap, UINT32, y, x)
diff --git a/src/mame/drivers/namcoic.c b/src/mame/drivers/namcoic.c
index a4129371465..851dd0705a6 100644
--- a/src/mame/drivers/namcoic.c
+++ b/src/mame/drivers/namcoic.c
@@ -350,7 +350,7 @@ static void zdrawgfxzoom(running_machine *machine,
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int x, x_index = x_index_base;
if( mPalXOR )
{
@@ -1237,7 +1237,7 @@ DrawRozHelper(
{
UINT32 xpos = (((cx>>16)&size_mask) + rozInfo->left)&0xfff;
UINT32 ypos = (((cy>>16)&size_mask) + rozInfo->top)&0xfff;
- if( *BITMAP_ADDR16(flagsbitmap, ypos, xpos)&TILEMAP_PIXEL_LAYER0 )
+ if( *BITMAP_ADDR8(flagsbitmap, ypos, xpos)&TILEMAP_PIXEL_LAYER0 )
{
*dest = *BITMAP_ADDR16(srcbitmap,ypos,xpos)+rozInfo->color;
}
diff --git a/src/mame/video/battlane.c b/src/mame/video/battlane.c
index 5cead779c39..f437d2f3523 100644
--- a/src/mame/video/battlane.c
+++ b/src/mame/video/battlane.c
@@ -87,9 +87,13 @@ WRITE8_HANDLER( battlane_bitmap_w )
for (i = 0; i < 8; i++)
{
if (data & 1 << i)
- *BITMAP_ADDR16(screen_bitmap, offset % 0x100, (offset / 0x100) * 8 + i) |= orval;
+ {
+ *BITMAP_ADDR8(screen_bitmap, offset % 0x100, (offset / 0x100) * 8 + i) |= orval;
+ }
else
- *BITMAP_ADDR16(screen_bitmap, offset % 0x100, (offset / 0x100) * 8 + i) &= ~orval;
+ {
+ *BITMAP_ADDR8(screen_bitmap, offset % 0x100, (offset / 0x100) * 8 + i) &= ~orval;
+ }
}
}
@@ -140,9 +144,10 @@ static TILEMAP_MAPPER( battlane_tilemap_scan_rows_2x2 )
***************************************************************************/
VIDEO_START( battlane )
{
- bg_tilemap = tilemap_create(get_tile_info_bg, battlane_tilemap_scan_rows_2x2, 16, 16, 32, 32);
+ bg_tilemap = tilemap_create(get_tile_info_bg, battlane_tilemap_scan_rows_2x2,
+ 16, 16, 32, 32);
- screen_bitmap = auto_bitmap_alloc(32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED16);
+ screen_bitmap = auto_bitmap_alloc(32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8);
}
static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
@@ -218,7 +223,7 @@ static void draw_fg_bitmap(running_machine *machine, mame_bitmap *bitmap )
{
for (x = 0; x < 32 * 8; x++)
{
- data = *BITMAP_ADDR16(screen_bitmap, y, x);
+ data = *BITMAP_ADDR8(screen_bitmap, y, x);
if (data)
{
diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c
index 7b0b6057d76..9954a51dc6a 100644
--- a/src/mame/video/deco16ic.c
+++ b/src/mame/video/deco16ic.c
@@ -518,7 +518,7 @@ WRITE16_HANDLER( deco16_pf4_data_w )
static void deco16_video_init(int pf12_only, int split, int full_width)
{
- sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED16 );
+ sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED8 );
pf1_tilemap_16x16 = tilemap_create(get_pf1_tile_info, deco16_scan_rows, 16,16,64,32);
pf1_tilemap_8x8 = tilemap_create(get_pf1_tile_info_b, tilemap_scan_rows,8,8,64,32);
@@ -861,8 +861,8 @@ void deco16_pdrawgfx(mame_bitmap *dest,const gfx_element *gfx,
{
UINT8 *source = gfx->gfxdata + ((source_base+y_index) * gfx->line_modulo);
UINT32 *destb = BITMAP_ADDR32(dest, sy, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, sy, 0);
- UINT16 *spri = BITMAP_ADDR16(sprite_priority_bitmap, sy, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, sy, 0);
+ UINT8 *spri = BITMAP_ADDR8(sprite_priority_bitmap, sy, 0);
if (sy >= 0 && sy < 248)
{
@@ -1015,7 +1015,7 @@ static void custom_tilemap_draw(
*BITMAP_ADDR16(bitmap, y, x) = Machine->pens[p];
if (priority_bitmap)
{
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
pri[x]|=priority;
}
}
@@ -1040,7 +1040,7 @@ static void custom_tilemap_draw(
*BITMAP_ADDR32(bitmap, y, x) = Machine->pens[p];
if (priority_bitmap)
{
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
pri[x]|=priority;
}
}
diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c
index 05e2d25ae72..20782a6498e 100644
--- a/src/mame/video/deco32.c
+++ b/src/mame/video/deco32.c
@@ -565,7 +565,7 @@ INLINE void dragngun_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
UINT8 *source = gfx->gfxdata + (source_base+(y_index>>16)) * gfx->line_modulo;
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(pri_buffer, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
@@ -612,7 +612,7 @@ INLINE void dragngun_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
UINT8 *source = gfx->gfxdata + (source_base+(y_index>>16)) * gfx->line_modulo;
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(pri_buffer, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
@@ -1421,7 +1421,7 @@ static void mixDualAlphaSprites(running_machine* machine, mame_bitmap *bitmap, c
/* Mix sprites into main bitmap, based on priority & alpha */
for (y=8; y<248; y++) {
- UINT16* tilemapPri=BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8* tilemapPri=BITMAP_ADDR8(priority_bitmap, y, 0);
UINT16* sprite0=BITMAP_ADDR16(sprite0_mix_bitmap, y, 0);
UINT16* sprite1=BITMAP_ADDR16(sprite1_mix_bitmap, y, 0);
UINT32* destLine=BITMAP_ADDR32(bitmap, y, 0);
diff --git a/src/mame/video/deniam.c b/src/mame/video/deniam.c
index 855c48fd0b3..0909194f93e 100644
--- a/src/mame/video/deniam.c
+++ b/src/mame/video/deniam.c
@@ -259,9 +259,9 @@ static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR16(priority_bitmap, y, sx+x) & primask) == 0)
+ if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]&0x0f);
- *BITMAP_ADDR16(priority_bitmap, y, sx+x) = 8;
+ *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
}
}
x++;
@@ -279,9 +279,9 @@ static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR16(priority_bitmap, y, sx+x) & primask) == 0)
+ if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]>>4);
- *BITMAP_ADDR16(priority_bitmap, y, sx+x) = 8;
+ *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
}
}
x++;
@@ -303,9 +303,9 @@ static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR16(priority_bitmap, y, sx+x) & primask) == 0)
+ if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]>>4);
- *BITMAP_ADDR16(priority_bitmap, y, sx+x) = 8;
+ *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
}
}
x++;
@@ -323,9 +323,9 @@ static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
if (sx+x >= cliprect->min_x && sx+x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR16(priority_bitmap, y, sx+x) & primask) == 0)
+ if ((*BITMAP_ADDR8(priority_bitmap, y, sx+x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx+x) = color*16+(rom[i]&0x0f);
- *BITMAP_ADDR16(priority_bitmap, y, sx+x) = 8;
+ *BITMAP_ADDR8(priority_bitmap, y, sx+x) = 8;
}
}
x++;
diff --git a/src/mame/video/gladiatr.c b/src/mame/video/gladiatr.c
index 3123d370001..a900dc096f9 100644
--- a/src/mame/video/gladiatr.c
+++ b/src/mame/video/gladiatr.c
@@ -272,7 +272,7 @@ VIDEO_UPDATE( ppking )
UINT16 *dest = BITMAP_ADDR16(bitmap, sy, sx);
while( x <= cliprect->max_x )
{
- if( *BITMAP_ADDR16(flagsbitmap, y, x)&TILEMAP_PIXEL_LAYER0 )
+ if( *BITMAP_ADDR8(flagsbitmap, y, x)&TILEMAP_PIXEL_LAYER0 )
{
*dest += 512;
}
diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c
index 9d939ab7a7f..1322738c222 100644
--- a/src/mame/video/kaneko16.c
+++ b/src/mame/video/kaneko16.c
@@ -468,7 +468,7 @@ static void kaneko16_draw_sprites_custom(running_machine *machine, mame_bitmap *
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c
index e640ea11b6f..d5952a280b3 100644
--- a/src/mame/video/konamiic.c
+++ b/src/mame/video/konamiic.c
@@ -7595,8 +7595,65 @@ static void K053250_pdraw_scanline8(
mame_bitmap *bitmap,int x,int y,int length,
const UINT8 *src,pen_t *pens,int transparent_pen,UINT32 orient,int pri)
{
+ /* 8bpp destination */
+ if (bitmap->bpp == 8)
+ {
+ /* adjust in case we're oddly oriented */
+ ADJUST_FOR_ORIENTATION(UINT8, orient, bitmap, priority_bitmap, x, y);
+
+ /* with pen lookups */
+ if (pens)
+ {
+ if (transparent_pen == -1)
+ while (length--)
+ {
+ *dsti = pens[*src++];
+ *dstp = pri;
+ dsti += xadv;
+ dstp += xadv;
+ }
+ else
+ while (length--)
+ {
+ UINT32 spixel = *src++;
+ if (spixel != transparent_pen)
+ {
+ *dsti = pens[spixel];
+ *dstp = pri;
+ }
+ dsti += xadv;
+ dstp += xadv;
+ }
+ }
+
+ /* without pen lookups */
+ else
+ {
+ if (transparent_pen == -1)
+ while (length--)
+ {
+ *dsti = *src++;
+ *dstp = pri;
+ dsti += xadv;
+ dstp += xadv;
+ }
+ else
+ while (length--)
+ {
+ UINT32 spixel = *src++;
+ if (spixel != transparent_pen)
+ {
+ *dsti = spixel;
+ *dstp = pri;
+ }
+ dsti += xadv;
+ dstp += xadv;
+ }
+ }
+ }
+
/* 16bpp destination */
- if(bitmap->bpp == 16)
+ else if(bitmap->bpp == 16)
{
/* adjust in case we're oddly oriented */
ADJUST_FOR_ORIENTATION(UINT16, orient, bitmap, priority_bitmap, x, y);
@@ -7926,7 +7983,7 @@ INLINE void K053250_pdraw_scanline32(mame_bitmap *bitmap, const pen_t *palette,
int src_fx, src_fdx;
int pix_data, dst_offset;
const pen_t *pal_base;
- UINT16 *pri_base;
+ UINT8 *pri_base;
UINT32 *dst_base;
int dst_adv;
UINT8 pri;
@@ -8016,7 +8073,7 @@ INLINE void K053250_pdraw_scanline32(mame_bitmap *bitmap, const pen_t *palette,
// calculate target increment for horizontal scanlines which is exactly one
dst_adv = 1;
dst_offset = dst_length;
- pri_base = BITMAP_ADDR16(priority_bitmap, linepos, dst_start + dst_offset);
+ pri_base = BITMAP_ADDR8(priority_bitmap, linepos, dst_start + dst_offset);
dst_base = BITMAP_ADDR32(bitmap, linepos, dst_start + dst_length);
}
else
@@ -8024,7 +8081,7 @@ INLINE void K053250_pdraw_scanline32(mame_bitmap *bitmap, const pen_t *palette,
// calculate target increment for vertical scanlines which is the bitmap's pitch value
dst_adv = bitmap->rowpixels;
dst_offset= dst_length * dst_adv;
- pri_base = BITMAP_ADDR16(priority_bitmap, dst_start, linepos + dst_offset);
+ pri_base = BITMAP_ADDR8(priority_bitmap, dst_start, linepos + dst_offset);
dst_base = BITMAP_ADDR32(bitmap, dst_start, linepos + dst_offset);
}
diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c
index 579e1b1f276..5a763541929 100644
--- a/src/mame/video/mcatadv.c
+++ b/src/mame/video/mcatadv.c
@@ -68,7 +68,7 @@ static void draw_sprites( mame_bitmap *bitmap, const rectangle *cliprect )
int global_y = mcatadv_vidregs[1]-0x1f1;
UINT16 *destline;
- UINT16 *priline;
+ UINT8 *priline;
int xstart, xend, xinc;
int ystart, yend, yinc;
@@ -129,7 +129,7 @@ static void draw_sprites( mame_bitmap *bitmap, const rectangle *cliprect )
if ((drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y)) {
destline = BITMAP_ADDR16(bitmap, drawypos, 0);
- priline = BITMAP_ADDR16(priority_bitmap, drawypos, 0);
+ priline = BITMAP_ADDR8(priority_bitmap, drawypos, 0);
for (xcnt = xstart; xcnt != xend; xcnt += xinc) {
drawxpos = x+xcnt-global_x;
diff --git a/src/mame/video/mcr.c b/src/mame/video/mcr.c
index 18790877069..f909c309dde 100644
--- a/src/mame/video/mcr.c
+++ b/src/mame/video/mcr.c
@@ -278,7 +278,7 @@ static void render_sprites_91399(running_machine *machine, mame_bitmap *bitmap,
{
UINT8 *src = gfx->gfxdata + gfx->char_modulo * code + gfx->line_modulo * (y ^ vflip);
UINT16 *dst = BITMAP_ADDR16(bitmap, sy, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, sy, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, sy, 0);
/* loop over columns */
for (x = 0; x < 32; x++)
@@ -348,7 +348,7 @@ static void render_sprites_91464(running_machine *machine, mame_bitmap *bitmap,
{
UINT8 *src = gfx->gfxdata + gfx->char_modulo * code + gfx->line_modulo * (y ^ vflip);
UINT16 *dst = BITMAP_ADDR16(bitmap, sy, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, sy, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, sy, 0);
/* loop over columns */
for (x = 0; x < 32; x++)
diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c
index 3532f1039bd..ae3b8050d87 100644
--- a/src/mame/video/namcona1.c
+++ b/src/mame/video/namcona1.c
@@ -295,7 +295,7 @@ static void pdraw_masked_tile(running_machine *machine,
int ypos = sy+(flipy?7-y:y);
if (ypos >= cliprect->min_y && ypos <= cliprect->max_y)
{
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, ypos, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, ypos, 0);
UINT16 *dest = BITMAP_ADDR16(bitmap, ypos, 0);
if( flipx )
{
@@ -342,7 +342,7 @@ static void pdraw_masked_tile(running_machine *machine,
int ypos = sy+(flipy?7-y:y);
if (ypos >= cliprect->min_y && ypos <= cliprect->max_y)
{
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, ypos, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, ypos, 0);
UINT16 *dest = BITMAP_ADDR16(bitmap, ypos, 0);
if( flipx )
{
@@ -402,7 +402,7 @@ static void pdraw_opaque_tile(running_machine *machine,
int gfx_pitch;
int x,y;
int ypos;
- UINT16 *pri;
+ UINT8 *pri;
UINT16 *dest;
if( sx > cliprect->min_x-8 &&
@@ -422,7 +422,7 @@ static void pdraw_opaque_tile(running_machine *machine,
ypos = sy+(flipy?7-y:y);
if (ypos >= cliprect->min_y && ypos <= cliprect->max_y)
{
- pri = BITMAP_ADDR16(priority_bitmap, ypos, 0);
+ pri = BITMAP_ADDR8(priority_bitmap, ypos, 0);
dest = BITMAP_ADDR16(bitmap, ypos, 0);
if( flipx )
{
@@ -543,7 +543,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
}
} /* draw_sprites */
-static void draw_pixel_line( UINT16 *pDest, UINT16 *pPri, UINT16 *pSource, const pen_t *paldata )
+static void draw_pixel_line( UINT16 *pDest, UINT8 *pPri, UINT16 *pSource, const pen_t *paldata )
{
int x;
UINT16 data;
@@ -608,7 +608,7 @@ static void draw_background(running_machine *machine, mame_bitmap *bitmap, const
*/
draw_pixel_line(
BITMAP_ADDR16(bitmap, line, 0),
- BITMAP_ADDR16(priority_bitmap, line, 0),
+ BITMAP_ADDR8(priority_bitmap, line, 0),
namcona1_sparevram + (ydata-0x4000) + 25,
paldata );
}
diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c
index ec45424b3a2..adf053cb314 100644
--- a/src/mame/video/namcos2.c
+++ b/src/mame/video/namcos2.c
@@ -109,7 +109,7 @@ DrawRozHelper(
goto L_SkipPixel;
}
- if( *BITMAP_ADDR16(flagsbitmap, ypos, xpos)&TILEMAP_PIXEL_LAYER0 )
+ if( *BITMAP_ADDR8(flagsbitmap, ypos, xpos)&TILEMAP_PIXEL_LAYER0 )
{
*dest = *BITMAP_ADDR16(srcbitmap, ypos, xpos)+rozInfo->color;
}
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 871f6e60ae1..b010796a7b9 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -288,7 +288,7 @@ static void renderscanline_uvi_full(void *dest, INT32 scanline, const poly_exten
rgbint fadeColor = extra->fadeColor;
int penmask, penshift;
int prioverchar;
- const UINT16 *pCharPri = BITMAP_ADDR16(priority_bitmap, scanline, 0);
+ const UINT8 *pCharPri = BITMAP_ADDR8(priority_bitmap, scanline, 0);
UINT32 *pDest = BITMAP_ADDR32(bitmap, scanline, 0);
int x;
@@ -496,7 +496,7 @@ static void renderscanline_sprite(void *destbase, INT32 scanline, const poly_ext
int alpha = extra->alpha;
UINT8 *source = (UINT8 *)extra->source + (y_index>>16) * extra->line_modulo;
UINT32 *dest = BITMAP_ADDR32(destmap, scanline, 0);
- const UINT16 *pCharPri = BITMAP_ADDR16(priority_bitmap, scanline, 0);
+ const UINT8 *pCharPri = BITMAP_ADDR8(priority_bitmap, scanline, 0);
int x;
int bFogEnable = 0;
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index af6a5ce9f47..f850d3eecb9 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -355,7 +355,7 @@ static void draw_fg(mame_bitmap *bitmap, const rectangle *cliprect, int priority
/* now copy the fg_bitmap to the destination wherever the sprite pixel allows */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
- const UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ const UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
UINT16 *src = BITMAP_ADDR16(fg_bitmap, y, 0);
UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
diff --git a/src/mame/video/playmark.c b/src/mame/video/playmark.c
index 77c7361b430..35049b58e20 100644
--- a/src/mame/video/playmark.c
+++ b/src/mame/video/playmark.c
@@ -373,7 +373,7 @@ static void draw_bitmap(mame_bitmap *bitmap, const rectangle *cliprect)
{
int x,y,count;
int color;
- UINT16 *pri;
+ UINT8 *pri;
count = 0;
for (y=0;y<512;y++)
@@ -388,7 +388,7 @@ static void draw_bitmap(mame_bitmap *bitmap, const rectangle *cliprect)
{
*BITMAP_ADDR16(bitmap, (y + bgscrolly) & 0x1ff, (x + bgscrollx) & 0x1ff) = 0x100 + color;
- pri = BITMAP_ADDR16(priority_bitmap, (y + bgscrolly) & 0x1ff, 0);
+ pri = BITMAP_ADDR8(priority_bitmap, (y + bgscrolly) & 0x1ff, 0);
pri[(x + bgscrollx) & 0x1ff] |= 2;
}
else
@@ -398,7 +398,7 @@ static void draw_bitmap(mame_bitmap *bitmap, const rectangle *cliprect)
{
*BITMAP_ADDR16(bitmap, (y / 2 + bgscrolly) & 0x1ff, (x / 2 + bgscrollx) & 0x1ff) = 0x100 + color;
- pri = BITMAP_ADDR16(priority_bitmap, (y / 2 + bgscrolly) & 0x1ff, 0);
+ pri = BITMAP_ADDR8(priority_bitmap, (y / 2 + bgscrolly) & 0x1ff, 0);
pri[(x / 2 + bgscrollx) & 0x1ff] |= 2;
}
}
diff --git a/src/mame/video/psikyosh.c b/src/mame/video/psikyosh.c
index 446ca86370a..7d731ae4c1b 100644
--- a/src/mame/video/psikyosh.c
+++ b/src/mame/video/psikyosh.c
@@ -694,7 +694,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
for( ypixel=0; ypixel<gfx->height; ypixel++ )
{
UINT8 *source = gfx->gfxdata + (source_base+ypixel) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(zoom_bitmap, ypixel + ytile*gfx->height, 0);
+ UINT8 *dest = BITMAP_ADDR8(zoom_bitmap, ypixel + ytile*gfx->height, 0);
for( xpixel=0; xpixel<gfx->width; xpixel++ )
{
@@ -772,7 +772,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
for( y=sy; y<ey; y++ )
{
- UINT16 *source = BITMAP_ADDR16(zoom_bitmap, y_index>>10, 0);
+ UINT8 *source = BITMAP_ADDR8(zoom_bitmap, y_index>>10, 0);
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
UINT16 *pri = BITMAP_ADDR16(z_bitmap, y, 0);
@@ -798,7 +798,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
for( y=sy; y<ey; y++ )
{
- UINT16 *source = BITMAP_ADDR16(zoom_bitmap, y_index>>10, 0);
+ UINT8 *source = BITMAP_ADDR8(zoom_bitmap, y_index>>10, 0);
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
int x, x_index = x_index_base;
@@ -821,7 +821,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
for( y=sy; y<ey; y++ )
{
- UINT16 *source = BITMAP_ADDR16(zoom_bitmap, y_index>>10, 0);
+ UINT8 *source = BITMAP_ADDR8(zoom_bitmap, y_index>>10, 0);
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
UINT16 *pri = BITMAP_ADDR16(z_bitmap, y, 0);
@@ -847,7 +847,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
for( y=sy; y<ey; y++ )
{
- UINT16 *source = BITMAP_ADDR16(zoom_bitmap, y_index>>10, 0);
+ UINT8 *source = BITMAP_ADDR8(zoom_bitmap, y_index>>10, 0);
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
int x, x_index = x_index_base;
@@ -870,7 +870,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
for( y=sy; y<ey; y++ )
{
- UINT16 *source = BITMAP_ADDR16(zoom_bitmap, y_index>>10, 0);
+ UINT8 *source = BITMAP_ADDR8(zoom_bitmap, y_index>>10, 0);
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
UINT16 *pri = BITMAP_ADDR16(z_bitmap, y, 0);
@@ -900,7 +900,7 @@ static void psikyosh_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
for( y=sy; y<ey; y++ )
{
- UINT16 *source = BITMAP_ADDR16(zoom_bitmap, y_index>>10, 0);
+ UINT8 *source = BITMAP_ADDR8(zoom_bitmap, y_index>>10, 0);
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
int x, x_index = x_index_base;
@@ -1054,7 +1054,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
VIDEO_START( psikyosh )
{
- zoom_bitmap = auto_bitmap_alloc(16*16, 16*16, BITMAP_FORMAT_INDEXED16);
+ zoom_bitmap = auto_bitmap_alloc(16*16, 16*16, BITMAP_FORMAT_INDEXED8);
/* Need 16-bit z-buffer */
z_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c
index 8ada3afc22f..e35edc1ff13 100644
--- a/src/mame/video/segaic16.c
+++ b/src/mame/video/segaic16.c
@@ -1551,7 +1551,7 @@ static void segaic16_sprites_hangon_draw(struct sprite_info *info, mame_bitmap *
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int xacc = 0x00;
/* note that the System 16A sprites have a design flaw that allows the address */
@@ -1716,7 +1716,7 @@ static void segaic16_sprites_sharrier_draw(struct sprite_info *info, mame_bitmap
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int xacc = 0x00;
/* note that the System 16A sprites have a design flaw that allows the address */
@@ -1884,7 +1884,7 @@ static void segaic16_sprites_16a_draw(struct sprite_info *info, mame_bitmap *bit
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
/* note that the System 16A sprites have a design flaw that allows the address */
/* to carry into the flip flag, which is the topmost bit -- it is very important */
@@ -2060,7 +2060,7 @@ static void segaic16_sprites_16b_draw(struct sprite_info *info, mame_bitmap *bit
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int xacc;
/* compute the initial X zoom accumulator; this is verified on the real PCB */
@@ -2212,7 +2212,7 @@ static void segaic16_sprites_yboard_16b_draw(struct sprite_info *info, mame_bitm
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int xacc;
/* compute the initial X zoom accumulator; this is verified on the real PCB */
@@ -2380,7 +2380,7 @@ static void segaic16_sprites_outrun_draw(struct sprite_info *info, mame_bitmap *
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int xacc = 0;
/* non-flipped case */
@@ -3523,7 +3523,7 @@ void segaic16_rotate_draw(int which, mame_bitmap *bitmap, const rectangle *clipr
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
UINT16 *src = (UINT16 *)srcbitmap->base;
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
INT32 tx = currx;
INT32 ty = curry;
diff --git a/src/mame/video/segaic24.c b/src/mame/video/segaic24.c
index 50c2783ca81..a049ae6c581 100644
--- a/src/mame/video/segaic24.c
+++ b/src/mame/video/segaic24.c
@@ -818,7 +818,7 @@ void sys24_sprite_draw(mame_bitmap *bitmap, const rectangle *cliprect, const int
int zx1 = flipx ? 7-zx : zx;
UINT32 neweroffset = (newoffset+(zx1>>2))&0x1ffff; // crackdown sometimes attempts to use data past the end of spriteram
int c = (sys24_sprite_ram[neweroffset] >> (((~zx1) & 3) << 2)) & 0xf;
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, ypos1, xpos2);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, ypos1, xpos2);
if(!(*pri & pm[c])) {
c = colors[c];
if(c) {
diff --git a/src/mame/video/segas18.c b/src/mame/video/segas18.c
index 370bdb9d643..af0ce9e96d9 100644
--- a/src/mame/video/segas18.c
+++ b/src/mame/video/segas18.c
@@ -131,7 +131,7 @@ static void draw_vdp(mame_bitmap *bitmap, const rectangle *cliprect, int priorit
{
UINT16 *src = BITMAP_ADDR16(tempbitmap, y, 0);
UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
for (x = cliprect->min_x; x <= cliprect->max_x; x++)
{
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index e4c1a34d2a1..dceff525b1b 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -567,7 +567,7 @@ static void combine_tilemap(running_machine *machine, mame_bitmap *bitmap, const
int i,j;
UINT16 *s;
UINT16 *d;
- UINT16 *t;
+ UINT8 *t;
UINT32 xscroll_mask, yscroll_mask;
mame_bitmap *pen_bitmap;
mame_bitmap *flags_bitmap;
@@ -589,7 +589,7 @@ static void combine_tilemap(running_machine *machine, mame_bitmap *bitmap, const
d = BITMAP_ADDR16(bitmap, j, 0);
s = BITMAP_ADDR16(pen_bitmap, (j+y) & yscroll_mask, 0);
- t = BITMAP_ADDR16(flags_bitmap, (j+y) & yscroll_mask, 0);
+ t = BITMAP_ADDR8(flags_bitmap, (j+y) & yscroll_mask, 0);
for (i=cliprect->min_x+rx; i <= cliprect->max_x+rx; i++)
{
if (opaque || (t[i & xscroll_mask] & (TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1)))
diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c
index a46693a2fae..29780c0b540 100644
--- a/src/mame/video/system16.c
+++ b/src/mame/video/system16.c
@@ -218,7 +218,7 @@ static void draw_sprite(running_machine *machine,
int sy, y, ycount = 0;
int dx,dy;
UINT16 *dest;
- UINT16 *pri;
+ UINT8 *pri;
unsigned pen, data;
priority = 1<<priority;
@@ -248,7 +248,7 @@ static void draw_sprite(running_machine *machine,
if( sy>=cliprect->min_y && sy<=cliprect->max_y ){
source = addr;
dest = BITMAP_ADDR16(bitmap, sy, 0);
- pri = BITMAP_ADDR16(priority_bitmap, sy, 0);
+ pri = BITMAP_ADDR8(priority_bitmap, sy, 0);
sx = x0;
xcount = 0;
for( x=width; x; x-=2 ){
@@ -304,7 +304,7 @@ static void draw_sprite(running_machine *machine,
if( sy>=cliprect->min_y && sy<=cliprect->max_y ){
source = addr;
dest = BITMAP_ADDR16(bitmap, sy, 0);
- pri = BITMAP_ADDR16(priority_bitmap, sy, 0);
+ pri = BITMAP_ADDR8(priority_bitmap, sy, 0);
sx = x0;
xcount = 0;
for( x=width; x; x-=2 ){
diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c
index 6acdf23fc71..06fdf6f5598 100644
--- a/src/mame/video/taito_f2.c
+++ b/src/mame/video/taito_f2.c
@@ -449,7 +449,7 @@ static void taito_f2_tc360_spritemixdraw( mame_bitmap *dest_bmp,const gfx_elemen
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
diff --git a/src/mame/video/taito_f3.c b/src/mame/video/taito_f3.c
index 6061063ab8a..d764c7a4943 100644
--- a/src/mame/video/taito_f3.c
+++ b/src/mame/video/taito_f3.c
@@ -302,7 +302,7 @@ struct f3_playfield_line_inf
/* use for draw_scanlines */
UINT16 *src[256],*src_s[256],*src_e[256];
- UINT16 *tsrc[256],*tsrc_s[256];
+ UINT8 *tsrc[256],*tsrc_s[256];
int x_count[256];
UINT32 x_zoom[256];
UINT32 clip0[256];
@@ -605,7 +605,7 @@ VIDEO_START( f3 )
pivot_dirty = (UINT8 *)auto_malloc(2048);
pf_line_inf = auto_malloc(5 * sizeof(struct f3_playfield_line_inf));
sa_line_inf = auto_malloc(1 * sizeof(struct f3_spritealpha_line_inf));
- pri_alp_bitmap = auto_bitmap_alloc( machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
+ pri_alp_bitmap = auto_bitmap_alloc( machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8 );
tile_opaque_sp = (UINT8 *)auto_malloc(machine->gfx[2]->total_elements);
tile_opaque_pf = (UINT8 *)auto_malloc(machine->gfx[1]->total_elements);
@@ -1378,28 +1378,28 @@ INLINE void draw_scanlines(running_machine *machine,
UINT32 sprite_noalp_5=sprite[5]&0x100;
static UINT16 *src0=0,*src_s0=0,*src_e0=0,clip_al0=0,clip_ar0=0,clip_bl0=0,clip_br0=0;
- static UINT16 *tsrc0=0,*tsrc_s0=0;
+ static UINT8 *tsrc0=0,*tsrc_s0=0;
static UINT32 x_count0=0,x_zoom0=0;
static UINT16 *src1=0,*src_s1=0,*src_e1=0,clip_al1=0,clip_ar1=0,clip_bl1=0,clip_br1=0;
- static UINT16 *tsrc1=0,*tsrc_s1=0;
+ static UINT8 *tsrc1=0,*tsrc_s1=0;
static UINT32 x_count1=0,x_zoom1=0;
static UINT16 *src2=0,*src_s2=0,*src_e2=0,clip_al2=0,clip_ar2=0,clip_bl2=0,clip_br2=0;
- static UINT16 *tsrc2=0,*tsrc_s2=0;
+ static UINT8 *tsrc2=0,*tsrc_s2=0;
static UINT32 x_count2=0,x_zoom2=0;
static UINT16 *src3=0,*src_s3=0,*src_e3=0,clip_al3=0,clip_ar3=0,clip_bl3=0,clip_br3=0;
- static UINT16 *tsrc3=0,*tsrc_s3=0;
+ static UINT8 *tsrc3=0,*tsrc_s3=0;
static UINT32 x_count3=0,x_zoom3=0;
static UINT16 *src4=0,*src_s4=0,*src_e4=0,clip_al4=0,clip_ar4=0,clip_bl4=0,clip_br4=0;
- static UINT16 *tsrc4=0,*tsrc_s4=0;
+ static UINT8 *tsrc4=0,*tsrc_s4=0;
static UINT32 x_count4=0,x_zoom4=0;
UINT16 clip_als=0, clip_ars=0, clip_bls=0, clip_brs=0;
- UINT16 *dstp0,*dstp;
+ UINT8 *dstp0,*dstp;
int yadv = bitmap->rowpixels;
int i=0,y=draw_line_num[0];
@@ -1411,7 +1411,7 @@ INLINE void draw_scanlines(running_machine *machine,
yadv = -yadv;
}
- dstp0 = BITMAP_ADDR16(pri_alp_bitmap, ty, x);
+ dstp0 = BITMAP_ADDR8(pri_alp_bitmap, ty, x);
pdest_2a = f3_alpha_level_2ad ? 0x10 : 0;
pdest_2b = f3_alpha_level_2bd ? 0x20 : 0;
@@ -2060,7 +2060,7 @@ static void get_line_ram_info(running_machine *machine, tilemap *tmap, int sx, i
if(line_t->alpha_mode[y]!=0)
{
UINT16 *src_s;
- UINT16 *tsrc_s;
+ UINT8 *tsrc_s;
x_index_fx = (sx+_x_offset[y]-(10*0x10000)+(10*line_t->x_zoom[y]))&((width_mask<<16)|0xffff);
y_index = ((y_index_fx>>16)+_colscroll[y])&0x1ff;
@@ -2078,7 +2078,7 @@ static void get_line_ram_info(running_machine *machine, tilemap *tmap, int sx, i
line_t->src_e[y]=&src_s[width_mask+1];
line_t->src[y]=&src_s[x_index_fx>>16];
- line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR16(flagsbitmap, y_index, 0);
+ line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap, y_index, 0);
line_t->tsrc[y]=&tsrc_s[x_index_fx>>16];
}
@@ -2186,7 +2186,7 @@ static void get_vram_info(tilemap *vram_tilemap, tilemap *pixel_tilemap, int sx,
if(line_t->alpha_mode[y]!=0)
{
UINT16 *src_s;
- UINT16 *tsrc_s;
+ UINT8 *tsrc_s;
// These bits in control ram indicate whether the line is taken from
// the VRAM tilemap layer or pixel layer.
@@ -2202,9 +2202,9 @@ static void get_vram_info(tilemap *vram_tilemap, tilemap *pixel_tilemap, int sx,
line_t->src[y]=&src_s[sx];
if (usePixelLayer)
- line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR16(flagsbitmap_pixel, sy&0xff, 0);
+ line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap_pixel, sy&0xff, 0);
else
- line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR16(flagsbitmap_vram, sy&0x1ff, 0);
+ line_t->tsrc_s[y]=tsrc_s=BITMAP_ADDR8(flagsbitmap_vram, sy&0x1ff, 0);
line_t->tsrc[y]=&tsrc_s[sx];
}
@@ -2737,14 +2737,14 @@ INLINE void f3_drawgfx( mame_bitmap *dest_bmp,const gfx_element *gfx,
int x=(ex-sx-1)|(tile_opaque_sp[code % gfx->total_elements]<<4);
UINT8 *source0 = gfx->gfxdata + (source_base+y_index) * 16 + x_index_base;
UINT32 *dest0 = BITMAP_ADDR32(dest_bmp, sy, sx);
- UINT16 *pri0 = BITMAP_ADDR16(pri_alp_bitmap, sy, sx);
+ UINT8 *pri0 = BITMAP_ADDR8(pri_alp_bitmap, sy, sx);
int yadv = dest_bmp->rowpixels;
dy=dy*16;
while(1)
{
UINT8 *source = source0;
UINT32 *dest = dest0;
- UINT16 *pri = pri0;
+ UINT8 *pri = pri0;
switch(x)
{
@@ -2902,7 +2902,7 @@ INLINE void f3_drawgfxzoom(mame_bitmap *dest_bmp,const gfx_element *gfx,
{
UINT8 *source = gfx->gfxdata + (source_base+(y_index>>16)) * 16;
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(pri_alp_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_alp_bitmap, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c
index 9d8a64fd1c5..d6489b07848 100644
--- a/src/mame/video/taitoic.c
+++ b/src/mame/video/taitoic.c
@@ -546,7 +546,7 @@ INLINE void taitoic_drawscanline(
const UINT16 *src,int transparent,UINT32 orient,int pri, const rectangle *cliprect)
{
UINT16 *dsti = BITMAP_ADDR16(bitmap, y, x);
- UINT16 *dstp = BITMAP_ADDR16(priority_bitmap, y, x);
+ UINT8 *dstp = BITMAP_ADDR8(priority_bitmap, y, x);
int length=cliprect->max_x - cliprect->min_x + 1;
src+=cliprect->min_x;
@@ -1073,7 +1073,7 @@ static void topspeed_custom_draw(mame_bitmap *bitmap,const rectangle *cliprect,i
UINT32 priority,UINT16 *color_ctrl_ram)
{
UINT16 *dst16,*src16;
- UINT16 *tsrc;
+ UINT8 *tsrc;
UINT16 scanline[1024]; /* won't be called by a wide-screen game, but just in case... */
mame_bitmap *srcbitmap = tilemap_get_pixmap(PC080SN_tilemap[chip][layer]);
@@ -1115,7 +1115,7 @@ static void topspeed_custom_draw(mame_bitmap *bitmap,const rectangle *cliprect,i
x_index = sx - (PC080SN_bgscroll_ram[chip][layer][row_index]);
src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
- tsrc = BITMAP_ADDR16(flagsbitmap, src_y_index, 0);
+ tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
dst16 = scanline;
if (flags & TILEMAP_DRAW_OPAQUE)
@@ -1775,7 +1775,7 @@ static void TC0080VCO_bg0_tilemap_draw(mame_bitmap *bitmap,const rectangle *clip
else /* zoom + rowscroll = custom draw routine */
{
UINT16 *dst16,*src16;
- UINT16 *tsrc;
+ UINT8 *tsrc;
UINT16 scanline[512];
mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0080VCO_tilemap[0]);
mame_bitmap *flagsbitmap = tilemap_get_flagsmap(TC0080VCO_tilemap[0]);
@@ -1862,7 +1862,7 @@ static void TC0080VCO_bg0_tilemap_draw(mame_bitmap *bitmap,const rectangle *clip
x_index = sx - ((TC0080VCO_bgscroll_ram[row_index] << 16));
src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
- tsrc = BITMAP_ADDR16(flagsbitmap, src_y_index, 0);
+ tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
dst16 = scanline;
x_step = zoomx;
@@ -2720,7 +2720,7 @@ static void TC0100SCN_tilemap_draw_fg(mame_bitmap *bitmap,const rectangle *clipr
*BITMAP_ADDR16(bitmap, y, x + cliprect->min_x) = p;
if (priority_bitmap)
{
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
pri[x + cliprect->min_x]|=priority;
}
}
@@ -3608,7 +3608,7 @@ static void TC0480SCP_bg01_draw(mame_bitmap *bitmap,const rectangle *cliprect,in
else /* zoom */
{
UINT16 *dst16,*src16;
- UINT16 *tsrc;
+ UINT8 *tsrc;
UINT16 scanline[512];
UINT32 sx;
mame_bitmap *srcbitmap = tilemap_get_pixmap(TC0480SCP_tilemap[layer][TC0480SCP_dblwidth]);
@@ -3663,7 +3663,7 @@ static void TC0480SCP_bg01_draw(mame_bitmap *bitmap,const rectangle *cliprect,in
- ((TC0480SCP_bgscroll_ram[layer][row_index+0x800] << 8) &0xffff);
src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
- tsrc = BITMAP_ADDR16(flagsbitmap, src_y_index, 0);
+ tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
dst16 = scanline;
x_step = zoomx;
diff --git a/src/mame/video/tatsumi.c b/src/mame/video/tatsumi.c
index 6bf1b7a0345..02b7ecc783b 100644
--- a/src/mame/video/tatsumi.c
+++ b/src/mame/video/tatsumi.c
@@ -425,7 +425,7 @@ INLINE void roundupt_drawgfxzoomrotate( mame_bitmap *dest_bmp,const gfx_element
{
UINT8 *source = gfx->gfxdata + (source_base+(y_index>>16)) * gfx->line_modulo;
UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT16 *priority_dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *priority_dest = BITMAP_ADDR8(dest_bmp, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
@@ -833,7 +833,7 @@ offset is from last pixel of first road segment?
/* Fill in left of road segment */
for (x=0; x<startPos && x<320; x++) {
int col = linedata[0]&0xf;
- UINT16 shadow=*BITMAP_ADDR16(shadow_bitmap, y, x);
+ UINT8 shadow=*BITMAP_ADDR8(shadow_bitmap, y, x);
if (shadow)
*BITMAP_ADDR32(bitmap, y, x) = machine->pens[768 + pal*16 + col];
else
@@ -852,7 +852,7 @@ offset is from last pixel of first road segment?
for (x=startPos; x<320 && (samplePos>>11)<0x80; x++) {
// look up colour
int col = linedata[(samplePos>>11)&0x7f]&0xf;
- UINT16 shadow=*BITMAP_ADDR16(shadow_bitmap, y, x);
+ UINT8 shadow=*BITMAP_ADDR8(shadow_bitmap, y, x);
/* Clamp if we have reached the end of the pixel data */
//if ((samplePos>>11) > 0x7f)
@@ -883,7 +883,7 @@ offset is from last pixel of first road segment?
/* Fill pixels */
for (x=startPos; x<320 && x<endPos; x++) {
int col = linedata[0x80]&0xf;
- UINT16 shadow=*BITMAP_ADDR16(shadow_bitmap, y, x);
+ UINT8 shadow=*BITMAP_ADDR8(shadow_bitmap, y, x);
/* Clamp if we have reached the end of the pixel data */
//if ((samplePos>>11) > 0x7f)
@@ -907,7 +907,7 @@ offset is from last pixel of first road segment?
for (/*x=endPos*/; x<320; x++) {
// look up colour
int col = linedata[((samplePos>>11)&0x7f) + 0x200]&0xf;
- UINT16 shadow=*BITMAP_ADDR16(shadow_bitmap, y, x);
+ UINT8 shadow=*BITMAP_ADDR8(shadow_bitmap, y, x);
/* Clamp if we have reached the end of the pixel data */
if ((samplePos>>11) > 0x7f)
diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c
index 8aee6199c44..197be3a41e4 100644
--- a/src/mame/video/toaplan1.c
+++ b/src/mame/video/toaplan1.c
@@ -1018,7 +1018,7 @@ static void toaplan1_draw_sprite_custom(mame_bitmap *dest_bmp,const gfx_element
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT16 *pri = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c
index acf045cc137..86e64dab909 100644
--- a/src/mame/video/twin16.c
+++ b/src/mame/video/twin16.c
@@ -109,7 +109,7 @@ static void draw_sprite( /* slow slow slow, but it's ok for now */
if( sy>=16 && sy<256-16 )
{
UINT16 *dest = BITMAP_ADDR16(bitmap, sy, 0);
- UINT16 *pdest = BITMAP_ADDR16(priority_bitmap, sy, 0);
+ UINT8 *pdest = BITMAP_ADDR8(priority_bitmap, sy, 0);
for( x=0; x<width; x++ )
{
@@ -371,7 +371,7 @@ static void draw_layer( mame_bitmap *bitmap, int opaque ){
{
const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pdest = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pdest = BITMAP_ADDR8(priority_bitmap, y, 0);
for (x = x1; x <= x2; x++)
{
@@ -388,7 +388,7 @@ static void draw_layer( mame_bitmap *bitmap, int opaque ){
{
const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT16 *pdest = BITMAP_ADDR16(priority_bitmap, y, 0);
+ UINT8 *pdest = BITMAP_ADDR8(priority_bitmap, y, 0);
for (x = x1; x <= x2; x++)
{
diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c
index 120a3f2383d..755d69a27b2 100644
--- a/src/mame/video/wgp.c
+++ b/src/mame/video/wgp.c
@@ -510,7 +510,7 @@ INLINE void bryan2_drawscanline(
const UINT16 *src,int transparent,UINT32 orient,int pri)
{
UINT16 *dsti = BITMAP_ADDR16(bitmap, y, x);
- UINT16 *dstp = BITMAP_ADDR16(priority_bitmap, y, x);
+ UINT8 *dstp = BITMAP_ADDR8(priority_bitmap, y, x);
if (transparent) {
while (length--) {
@@ -538,7 +538,7 @@ static void wgp_piv_layer_draw(mame_bitmap *bitmap,const rectangle *cliprect,int
mame_bitmap *flagsbitmap = tilemap_get_flagsmap(wgp_piv_tilemap[layer]);
UINT16 *dst16,*src16;
- UINT16 *tsrc;
+ UINT8 *tsrc;
int i,y,y_index,src_y_index,row_index,row_zoom;
/* I have a fairly strong feeling these should be UINT32's, x_index is
@@ -617,7 +617,7 @@ static void wgp_piv_layer_draw(mame_bitmap *bitmap,const rectangle *cliprect,int
x_max = x_index + screen_width * x_step;
src16 = BITMAP_ADDR16(srcbitmap, src_y_index, 0);
- tsrc = BITMAP_ADDR16(flagsbitmap, src_y_index, 0);
+ tsrc = BITMAP_ADDR8(flagsbitmap, src_y_index, 0);
dst16 = scanline;
if (flags & TILEMAP_DRAW_OPAQUE)