From 5fa2c2c76c7f612fcf784ae9bbd88b8e2328a451 Mon Sep 17 00:00:00 2001 From: Zsolt Vasvari Date: Fri, 22 Feb 2008 03:45:50 +0000 Subject: [PATCH] machine->pens lookup removal --- src/mame/video/esd16.c | 4 +- src/mame/video/exedexes.c | 4 +- src/mame/video/exidy440.c | 8 ++-- src/mame/video/exzisus.c | 2 +- src/mame/video/fantland.c | 2 +- src/mame/video/flyball.c | 8 +--- src/mame/video/funkyjet.c | 2 +- src/mame/video/gaelco.c | 4 +- src/mame/video/gaelco2.c | 4 +- src/mame/video/galaxian.c | 90 ++++++++++++++------------------------- src/mame/video/galivan.c | 4 +- src/mame/video/galpani2.c | 8 ++-- src/mame/video/galpanic.c | 8 ++-- src/mame/video/gaplus.c | 4 +- src/mame/video/gcpinbal.c | 2 +- src/mame/video/ginganin.c | 2 +- src/mame/video/gottlieb.c | 9 +--- src/mame/video/groundfx.c | 2 +- src/mame/video/hyprduel.c | 2 +- src/mame/video/kaneko16.c | 19 ++++----- src/mame/video/ksayakyu.c | 2 +- src/mame/video/ladybug.c | 12 +++--- src/mame/video/lasso.c | 10 ++--- src/mame/video/liberate.c | 8 ++-- src/mame/video/lordgun.c | 2 +- src/mame/video/lsasquad.c | 4 +- src/mame/video/m10.c | 2 +- src/mame/video/m107.c | 2 +- src/mame/video/m52.c | 2 +- src/mame/video/m90.c | 2 +- src/mame/video/m92.c | 2 +- src/mame/video/madalien.c | 2 +- src/mame/video/magmax.c | 2 +- src/mame/video/malzak.c | 4 +- src/mame/video/megasys1.c | 2 +- src/mame/video/metlclsh.c | 2 +- src/mame/video/metro.c | 2 +- src/mame/video/mexico86.c | 4 +- src/mame/video/mitchell.c | 2 +- src/mame/video/mjsister.c | 4 +- src/mame/video/momoko.c | 8 ++-- src/mame/video/mrdo.c | 2 +- src/mame/video/ms32.c | 2 +- src/mame/video/namcona1.c | 16 +++---- src/mame/video/namcos1.c | 4 +- src/mame/video/namcos86.c | 2 +- src/mame/video/nbmj8688.c | 5 +-- src/mame/video/nbmj8891.c | 4 +- src/mame/video/nbmj8991.c | 4 +- src/mame/video/nbmj9195.c | 6 +-- src/mame/video/nemesis.c | 4 +- src/mame/video/ninjakd2.c | 6 +-- src/mame/video/nitedrvr.c | 15 +++---- src/mame/video/niyanpai.c | 6 +-- src/mame/video/redclash.c | 12 +++--- 55 files changed, 155 insertions(+), 201 deletions(-) diff --git a/src/mame/video/esd16.c b/src/mame/video/esd16.c index 6c69640bae7..dc54246e222 100644 --- a/src/mame/video/esd16.c +++ b/src/mame/video/esd16.c @@ -325,7 +325,7 @@ if ( input_code_pressed(KEYCODE_Z) ) #endif if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,esdtilemap_0,0,0); - else fillbitmap(bitmap,machine->pens[0],cliprect); + else fillbitmap(bitmap,0,cliprect); if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,esdtilemap_1,0,1); @@ -353,7 +353,7 @@ if ( input_code_pressed(KEYCODE_Z) ) #endif if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,esdtilemap_0,0,0); - else fillbitmap(bitmap,machine->pens[0],cliprect); + else fillbitmap(bitmap,0,cliprect); if (layers_ctrl & 2) { diff --git a/src/mame/video/exedexes.c b/src/mame/video/exedexes.c index 07faf958aae..8b289c79615 100644 --- a/src/mame/video/exedexes.c +++ b/src/mame/video/exedexes.c @@ -222,9 +222,7 @@ VIDEO_UPDATE( exedexes ) tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); } else - { - fillbitmap(bitmap, machine->pens[0], cliprect); - } + fillbitmap(bitmap, 0, cliprect); draw_sprites(machine, bitmap, cliprect, 1); diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c index 1f813cb007a..ad2c88b6bb3 100644 --- a/src/mame/video/exidy440.c +++ b/src/mame/video/exidy440.c @@ -286,7 +286,7 @@ static TIMER_CALLBACK( collide_firq_callback ) * *************************************/ -static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int scroll_offset) +static void draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect, int scroll_offset) { int i; @@ -351,7 +351,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re { /* combine with the background */ pen = left | old[0]; - *BITMAP_ADDR16(bitmap, yoffs, currx) = machine->pens[pen]; + *BITMAP_ADDR16(bitmap, yoffs, currx) = pen; /* check the collisions bit */ if ((palette[2 * pen] & 0x80) && count++ < 128) @@ -364,7 +364,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re { /* combine with the background */ pen = right | old[1]; - *BITMAP_ADDR16(bitmap, yoffs, currx) = machine->pens[pen]; + *BITMAP_ADDR16(bitmap, yoffs, currx) = pen; /* check the collisions bit */ if ((palette[2 * pen] & 0x80) && count++ < 128) @@ -404,7 +404,7 @@ static void update_screen(running_machine *machine, mame_bitmap *bitmap, const r } /* draw the sprites */ - draw_sprites(machine, bitmap, cliprect, scroll_offset); + draw_sprites(bitmap, cliprect, scroll_offset); } diff --git a/src/mame/video/exzisus.c b/src/mame/video/exzisus.c index d40f96ac6e3..ebf098a5321 100644 --- a/src/mame/video/exzisus.c +++ b/src/mame/video/exzisus.c @@ -83,7 +83,7 @@ VIDEO_UPDATE( exzisus ) int gfx_num, gfx_attr, gfx_offs; /* Is this correct ? */ - fillbitmap(bitmap, machine->pens[1023], cliprect); + fillbitmap(bitmap, 1023, cliprect); /* ---------- 1st TC0010VCU ---------- */ sx = 0; diff --git a/src/mame/video/fantland.c b/src/mame/video/fantland.c index 33b1b714397..f68bfe5d621 100644 --- a/src/mame/video/fantland.c +++ b/src/mame/video/fantland.c @@ -137,7 +137,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec VIDEO_UPDATE( fantland ) { - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); draw_sprites(machine,bitmap,cliprect); return 0; diff --git a/src/mame/video/flyball.c b/src/mame/video/flyball.c index 2f3f5fdf062..22012ca286c 100644 --- a/src/mame/video/flyball.c +++ b/src/mame/video/flyball.c @@ -79,17 +79,11 @@ VIDEO_UPDATE( flyball ) /* draw ball */ for (y = bally; y < bally + 2; y++) - { for (x = ballx; x < ballx + 2; x++) - { if (x >= machine->screen[0].visarea.min_x && x <= machine->screen[0].visarea.max_x && y >= machine->screen[0].visarea.min_y && y <= machine->screen[0].visarea.max_y) - { - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[1]; - } - } - } + *BITMAP_ADDR16(bitmap, y, x) = 1; return 0; } diff --git a/src/mame/video/funkyjet.c b/src/mame/video/funkyjet.c index 18b5a98a303..7cb17a3d782 100644 --- a/src/mame/video/funkyjet.c +++ b/src/mame/video/funkyjet.c @@ -83,7 +83,7 @@ VIDEO_UPDATE( funkyjet ) flip_screen_set( deco16_pf12_control[0]&0x80 ); deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll); - fillbitmap(bitmap,machine->pens[768],cliprect); + fillbitmap(bitmap,768,cliprect); deco16_tilemap_2_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0); deco16_tilemap_1_draw(bitmap,cliprect,0,0); draw_sprites(machine,bitmap,cliprect); diff --git a/src/mame/video/gaelco.c b/src/mame/video/gaelco.c index 5790a784742..ed8849d5da4 100644 --- a/src/mame/video/gaelco.c +++ b/src/mame/video/gaelco.c @@ -196,7 +196,7 @@ VIDEO_UPDATE( maniacsq ) tilemap_set_scrollx(pant[1], 0, gaelco_vregs[3]); fillbitmap(priority_bitmap,0,cliprect); - fillbitmap( bitmap, machine->pens[0], cliprect ); + fillbitmap( bitmap, 0, cliprect ); tilemap_draw(bitmap,cliprect,pant[1],3,0); tilemap_draw(bitmap,cliprect,pant[0],3,0); @@ -223,7 +223,7 @@ VIDEO_UPDATE( bigkarnk ) tilemap_set_scrollx(pant[1], 0, gaelco_vregs[3]); fillbitmap(priority_bitmap,0,cliprect); - fillbitmap( bitmap, machine->pens[0], cliprect ); + fillbitmap( bitmap, 0, cliprect ); tilemap_draw(bitmap,cliprect,pant[1],TILEMAP_DRAW_LAYER1 | 3,0); tilemap_draw(bitmap,cliprect,pant[0],TILEMAP_DRAW_LAYER1 | 3,0); diff --git a/src/mame/video/gaelco2.c b/src/mame/video/gaelco2.c index e48a68d3bf2..b2ddf08f6d4 100644 --- a/src/mame/video/gaelco2.c +++ b/src/mame/video/gaelco2.c @@ -456,7 +456,7 @@ VIDEO_UPDATE( gaelco2 ) } /* draw screen */ - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, pant[1], 0, 0); tilemap_draw(bitmap, cliprect, pant[0], 0, 0); @@ -485,7 +485,7 @@ VIDEO_UPDATE( gaelco2_dual ) } /* draw screen */ - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); if (screen==1) { diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c index 198f7e53051..13e679159db 100644 --- a/src/mame/video/galaxian.c +++ b/src/mame/video/galaxian.c @@ -1421,7 +1421,7 @@ static void galaxian_draw_bullets(running_machine *machine, mame_bitmap *bitmap, /* yellow missile, white shells (this is the terminology on the schematics) */ color = ((offs == 7*4) ? BULLETS_COLOR_BASE : BULLETS_COLOR_BASE + 1); - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[color]; + *BITMAP_ADDR16(bitmap, y, x) = color; } } } @@ -1441,7 +1441,7 @@ static void scramble_draw_bullets(running_machine *machine, mame_bitmap *bitmap, x <= machine->screen[0].visarea.max_x) { /* yellow bullets */ - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[BULLETS_COLOR_BASE]; + *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE; } } @@ -1454,7 +1454,7 @@ static void darkplnt_draw_bullets(running_machine *machine, mame_bitmap *bitmap, if (x >= machine->screen[0].visarea.min_x && x <= machine->screen[0].visarea.max_x) { - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[32 + darkplnt_bullet_color]; + *BITMAP_ADDR16(bitmap, y, x) = 32 + darkplnt_bullet_color; } } @@ -1471,7 +1471,7 @@ static void theend_draw_bullets(running_machine *machine, mame_bitmap *bitmap, i if (x >= machine->screen[0].visarea.min_x && x <= machine->screen[0].visarea.max_x) { - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[BULLETS_COLOR_BASE]; + *BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE; } } } @@ -1500,7 +1500,7 @@ static void dambustr_draw_bullets(running_machine *machine, mame_bitmap *bitmap, if (x >= machine->screen[0].visarea.min_x && x <= machine->screen[0].visarea.max_x) { - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[color]; + *BITMAP_ADDR16(bitmap, y, x) = color; } } } @@ -1512,26 +1512,22 @@ static void dambustr_draw_bullets(running_machine *machine, mame_bitmap *bitmap, static void galaxian_draw_background(running_machine *machine, mame_bitmap *bitmap) { /* plain black background */ - fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea); + fillbitmap(bitmap,0,&machine->screen[0].visarea); } static void scramble_draw_background(running_machine *machine, mame_bitmap *bitmap) { if (background_enable) - { - fillbitmap(bitmap,machine->pens[BACKGROUND_COLOR_BASE],&machine->screen[0].visarea); - } + fillbitmap(bitmap,BACKGROUND_COLOR_BASE,&machine->screen[0].visarea); else - { - fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea); - } + fillbitmap(bitmap,0,&machine->screen[0].visarea); } static void turtles_draw_background(running_machine *machine, mame_bitmap *bitmap) { int color = (background_blue << 2) | (background_green << 1) | background_red; - fillbitmap(bitmap,machine->pens[BACKGROUND_COLOR_BASE + color],&machine->screen[0].visarea); + fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,&machine->screen[0].visarea); } static void frogger_draw_background(running_machine *machine, mame_bitmap *bitmap) @@ -1539,13 +1535,13 @@ static void frogger_draw_background(running_machine *machine, mame_bitmap *bitma /* color split point verified on real machine */ if (flipscreen_x) { - plot_box(bitmap, 0, 0, 128, 256, machine->pens[0]); - plot_box(bitmap, 128, 0, 128, 256, machine->pens[BACKGROUND_COLOR_BASE]); + plot_box(bitmap, 0, 0, 128, 256, 0); + plot_box(bitmap, 128, 0, 128, 256, BACKGROUND_COLOR_BASE); } else { - plot_box(bitmap, 0, 0, 128, 256, machine->pens[BACKGROUND_COLOR_BASE]); - plot_box(bitmap, 128, 0, 128, 256, machine->pens[0]); + plot_box(bitmap, 0, 0, 128, 256, BACKGROUND_COLOR_BASE); + plot_box(bitmap, 128, 0, 128, 256, 0); } } @@ -1576,15 +1572,11 @@ static void stratgyx_draw_background(running_machine *machine, mame_bitmap *bitm if ((~prom[x] & 0x01) && background_blue) color |= 0x04; if (flipscreen_x) - { sx = 8 * (31 - x); - } else - { sx = 8 * x; - } - plot_box(bitmap, sx, 0, 8, 256, machine->pens[BACKGROUND_COLOR_BASE + color]); + plot_box(bitmap, sx, 0, 8, 256, BACKGROUND_COLOR_BASE + color); } } @@ -1596,21 +1588,15 @@ static void minefld_draw_background(running_machine *machine, mame_bitmap *bitma for (x = 0; x < 128; x++) - { - plot_box(bitmap, x, 0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x]); - } + plot_box(bitmap, x, 0, 1, 256, BACKGROUND_COLOR_BASE + x); for (x = 0; x < 120; x++) - { - plot_box(bitmap, x + 128, 0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x + 128]); - } + plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 128); - plot_box(bitmap, 248, 0, 16, 256, machine->pens[BACKGROUND_COLOR_BASE]); + plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE); } else - { - fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea); - } + fillbitmap(bitmap,0,&machine->screen[0].visarea); } static void rescue_draw_background(running_machine *machine, mame_bitmap *bitmap) @@ -1619,23 +1605,16 @@ static void rescue_draw_background(running_machine *machine, mame_bitmap *bitmap { int x; - for (x = 0; x < 128; x++) - { - plot_box(bitmap, x, 0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x]); - } + plot_box(bitmap, x, 0, 1, 256, BACKGROUND_COLOR_BASE + x); for (x = 0; x < 120; x++) - { - plot_box(bitmap, x + 128, 0, 1, 256, machine->pens[BACKGROUND_COLOR_BASE + x + 8]); - } + plot_box(bitmap, x + 128, 0, 1, 256, BACKGROUND_COLOR_BASE + x + 8); - plot_box(bitmap, 248, 0, 16, 256, machine->pens[BACKGROUND_COLOR_BASE]); + plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE); } else - { - fillbitmap(bitmap,machine->pens[0],&machine->screen[0].visarea); - } + fillbitmap(bitmap,0,&machine->screen[0].visarea); } static void mariner_draw_background(running_machine *machine, mame_bitmap *bitmap) @@ -1656,13 +1635,12 @@ static void mariner_draw_background(running_machine *machine, mame_bitmap *bitma { int color; - if (x == 0) color = 0; else color = prom[0x20 + x - 1]; - plot_box(bitmap, 8 * (31 - x), 0, 8, 256, machine->pens[BACKGROUND_COLOR_BASE + color]); + plot_box(bitmap, 8 * (31 - x), 0, 8, 256, BACKGROUND_COLOR_BASE + color); } } else @@ -1671,13 +1649,12 @@ static void mariner_draw_background(running_machine *machine, mame_bitmap *bitma { int color; - if (x == 31) color = 0; else color = prom[x + 1]; - plot_box(bitmap, 8 * x, 0, 8, 256, machine->pens[BACKGROUND_COLOR_BASE + color]); + plot_box(bitmap, 8 * x, 0, 8, 256, BACKGROUND_COLOR_BASE + color); } } } @@ -1689,13 +1666,13 @@ static void dambustr_draw_background(running_machine *machine, mame_bitmap *bitm if (flip_screen_x) { - plot_box(bitmap, 0, 0, 256-dambustr_bg_split_line, 256, machine->pens[col2]); - plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, machine->pens[col1]); + plot_box(bitmap, 0, 0, 256-dambustr_bg_split_line, 256, col2); + plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col1); } else { - plot_box(bitmap, 0, 0, 256-dambustr_bg_split_line, 256, machine->pens[col1]); - plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, machine->pens[col2]); + plot_box(bitmap, 0, 0, 256-dambustr_bg_split_line, 256, col1); + plot_box(bitmap, 256-dambustr_bg_split_line, 0, dambustr_bg_split_line, 256, col2); } } @@ -1807,15 +1784,12 @@ static void plot_star(running_machine *machine, mame_bitmap *bitmap, int x, int if (flipscreen_x) - { x = 255 - x; - } - if (flipscreen_y) - { - y = 255 - y; - } - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[stars_colors_start + color]; + if (flipscreen_y) + y = 255 - y; + + *BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color; } static void noop_draw_stars(running_machine *machine, mame_bitmap *bitmap) diff --git a/src/mame/video/galivan.c b/src/mame/video/galivan.c index fb13508cdc5..6abf2d623b6 100644 --- a/src/mame/video/galivan.c +++ b/src/mame/video/galivan.c @@ -392,7 +392,7 @@ VIDEO_UPDATE( galivan ) tilemap_set_scrolly(bg_tilemap,0,scrolly[0] + 256 * (scrolly[1] & 0x07)); if (layers & 0x40) - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); else tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); @@ -416,7 +416,7 @@ VIDEO_UPDATE( ninjemak ) tilemap_set_scrolly(bg_tilemap,0,scrolly[0] + 256 * (scrolly[1] & 0xff)); if (ninjemak_dispdisable) - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); else tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c index de5b73e4aa3..ce452896489 100644 --- a/src/mame/video/galpani2.c +++ b/src/mame/video/galpani2.c @@ -164,7 +164,7 @@ if (input_code_pressed(KEYCODE_Z)) if (msk != 0) layers_ctrl &= msk; } #endif - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); fillbitmap(priority_bitmap,0,cliprect); if (layers_ctrl & 0x1) @@ -173,7 +173,7 @@ if (input_code_pressed(KEYCODE_Z)) int y = 0; copyscrollbitmap_trans(bitmap, galpani2_bg15_bitmap, 1, &x, 1, &y, - cliprect,machine->pens[0x4200 + 0]); + cliprect,0x4200 + 0); } /* test mode: @@ -188,7 +188,7 @@ if (input_code_pressed(KEYCODE_Z)) int y = - ( *galpani2_bg8_0_scrolly + 0x200 - 0x1be ); copyscrollbitmap_trans(bitmap, galpani2_bg8_bitmap_0, 1, &x, 1, &y, - cliprect,machine->pens[0x4000 + 0]); + cliprect,0x4000 + 0); } if (layers_ctrl & 0x4) @@ -197,7 +197,7 @@ if (input_code_pressed(KEYCODE_Z)) int y = - ( *galpani2_bg8_1_scrolly + 0x200 - 0x1be ); copyscrollbitmap_trans(bitmap, galpani2_bg8_bitmap_1, 1, &x, 1, &y, - cliprect,machine->pens[0x4000 + 0]); + cliprect,0x4000 + 0); } if (layers_ctrl & 0x8) kaneko16_draw_sprites(machine, bitmap, cliprect); diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c index c2622b4564c..7a85895889b 100644 --- a/src/mame/video/galpanic.c +++ b/src/mame/video/galpanic.c @@ -86,7 +86,7 @@ static void comad_draw_sprites(running_machine *machine, mame_bitmap *bitmap, co } } -static void draw_fgbitmap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) +static void draw_fgbitmap(mame_bitmap *bitmap, const rectangle *cliprect) { int offs; @@ -98,7 +98,7 @@ static void draw_fgbitmap(running_machine *machine, mame_bitmap *bitmap, const r sy = offs / 256; color = galpanic_fgvideoram[offs]; if (color) - *BITMAP_ADDR16(bitmap, sy, sx) = machine->pens[color]; + *BITMAP_ADDR16(bitmap, sy, sx) = color; } } @@ -107,7 +107,7 @@ VIDEO_UPDATE( galpanic ) /* copy the temporary bitmap to the screen */ copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect); - draw_fgbitmap(machine, bitmap, cliprect); + draw_fgbitmap(bitmap, cliprect); pandora_update(machine,bitmap,cliprect); @@ -119,7 +119,7 @@ VIDEO_UPDATE( comad ) /* copy the temporary bitmap to the screen */ copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect); - draw_fgbitmap(machine,bitmap,cliprect); + draw_fgbitmap(bitmap,cliprect); // if(galpanic_clear_sprites) diff --git a/src/mame/video/gaplus.c b/src/mame/video/gaplus.c index b81342547b9..b757ebecad8 100644 --- a/src/mame/video/gaplus.c +++ b/src/mame/video/gaplus.c @@ -172,7 +172,7 @@ static void starfield_init(running_machine *machine) if ( color && total_stars < MAX_STARS ) { stars[total_stars].x = x; stars[total_stars].y = y; - stars[total_stars].col = machine->pens[color]; + stars[total_stars].col = color; stars[total_stars].set = set++; if ( set == 3 ) @@ -322,7 +322,7 @@ VIDEO_UPDATE( gaplus ) /* flip screen control is embedded in RAM */ flip_screen_set(gaplus_spriteram[0x1f7f-0x800] & 1); - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); starfield_render(machine, bitmap); diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c index 157928b6daf..a0f202656d1 100644 --- a/src/mame/video/gcpinbal.c +++ b/src/mame/video/gcpinbal.c @@ -318,7 +318,7 @@ VIDEO_UPDATE( gcpinbal ) } fillbitmap(priority_bitmap,0,cliprect); - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); layer[0] = 0; layer[1] = 1; diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c index 4a4cf7d1e2b..f214789f3a4 100644 --- a/src/mame/video/ginganin.c +++ b/src/mame/video/ginganin.c @@ -280,7 +280,7 @@ if (input_code_pressed(KEYCODE_Z)) if (layers_ctrl1 & 1) tilemap_draw(bitmap,cliprect, bg_tilemap, 0,0); - else fillbitmap(bitmap,machine->pens[0],cliprect); + else fillbitmap(bitmap,0,cliprect); if (layers_ctrl1 & 2) tilemap_draw(bitmap,cliprect, fg_tilemap, 0,0); if (layers_ctrl1 & 8) draw_sprites(machine, bitmap,cliprect); diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c index 4bef5fe38c1..d6619982f9a 100644 --- a/src/mame/video/gottlieb.c +++ b/src/mame/video/gottlieb.c @@ -203,19 +203,14 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re VIDEO_UPDATE( gottlieb ) { if (!background_priority) - { tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); - } else - { - fillbitmap(bitmap, machine->pens[0], cliprect); - } + fillbitmap(bitmap, 0, cliprect); draw_sprites(machine, bitmap, cliprect); if (background_priority) - { tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); - } + return 0; } diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index e4a5ede7110..186c5488340 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -240,7 +240,7 @@ VIDEO_UPDATE( groundfx ) pivlayer[2] = 2; fillbitmap(priority_bitmap,0,cliprect); - fillbitmap(bitmap,machine->pens[0],cliprect); /* wrong color? */ + fillbitmap(bitmap,0,cliprect); /* wrong color? */ TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[0],0,0); TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[1],0,0); diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c index e374b0fb7e2..b6c0af6ea3c 100644 --- a/src/mame/video/hyprduel.c +++ b/src/mame/video/hyprduel.c @@ -635,7 +635,7 @@ VIDEO_UPDATE( hyprduel ) /* The background color is selected by a register */ fillbitmap(priority_bitmap,0,cliprect); - fillbitmap(bitmap,machine->pens[((hyprduel_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000],cliprect); + fillbitmap(bitmap,((hyprduel_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000,cliprect); /* Screen Control Register: diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c index f2eec121764..1322738c222 100644 --- a/src/mame/video/kaneko16.c +++ b/src/mame/video/kaneko16.c @@ -278,7 +278,7 @@ VIDEO_START( berlwall ) if ((r & 0x10) && (b & 0x10)) g = (g - 1) & 0x1f; /* decrease with wraparound */ - *BITMAP_ADDR16(kaneko16_bg15_bitmap, y, sx * 256 + x) = machine->pens[2048 + ((g << 10) | (r << 5) | b)]; + *BITMAP_ADDR16(kaneko16_bg15_bitmap, y, sx * 256 + x) = 2048 + ((g << 10) | (r << 5) | b); } VIDEO_START_CALL(kaneko16_1xVIEW2); @@ -395,7 +395,7 @@ static void kaneko16_draw_sprites_custom(running_machine *machine, mame_bitmap * UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int priority) { - const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; + pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo; int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16; @@ -477,7 +477,7 @@ static void kaneko16_draw_sprites_custom(running_machine *machine, mame_bitmap * if( c != 0 ) { if (pri[x] < priority) - dest[x] = pal[c]; + dest[x] = pen_base + c; pri[x] = 0xff; // mark it "already drawn" } x_index += dx; @@ -909,7 +909,7 @@ static void kaneko16_render_sprites(running_machine *machine, mame_bitmap *bitma } else { - fillbitmap(sprites_bitmap,machine->pens[0],cliprect); + fillbitmap(sprites_bitmap,0,cliprect); kaneko16_draw_sprites(machine,bitmap,cliprect); } } @@ -937,12 +937,12 @@ static void kaneko16_render_15bpp_bitmap(running_machine *machine, mame_bitmap * static void kaneko16_fill_bitmap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) { if(kaneko16_sprite_type == 1) - fillbitmap(bitmap,machine->pens[0x7f00],cliprect); + fillbitmap(bitmap,0x7f00,cliprect); else /* Fill the bitmap with pen 0. This is wrong, but will work most of the times. To do it right, each pixel should be drawn with pen 0 of the bottomost tile that covers it (which is pretty tricky to do) */ - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); } static VIDEO_UPDATE( common ) @@ -1006,7 +1006,7 @@ VIDEO_UPDATE( galsnew ) { UINT16 dat = (galsnew_fg_pixram[count] & 0xfffe)>>1; dat+=2048; - dest[x] = machine->pens[dat]; + dest[x] = dat; count++; } } @@ -1021,9 +1021,8 @@ VIDEO_UPDATE( galsnew ) UINT16 dat = (galsnew_bg_pixram[count]); //dat &=0x3ff; if (dat) - { - dest[x] = machine->pens[dat]; - } + dest[x] = dat; + count++; } } diff --git a/src/mame/video/ksayakyu.c b/src/mame/video/ksayakyu.c index a5bbf6f2d76..587cc87383e 100644 --- a/src/mame/video/ksayakyu.c +++ b/src/mame/video/ksayakyu.c @@ -107,7 +107,7 @@ VIDEO_START(ksayakyu) VIDEO_UPDATE(ksayakyu) { - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); if(video_ctrl&1) tilemap_draw(bitmap,cliprect,ksayakyu_tilemap,0,0); draw_sprites(machine,bitmap,cliprect); diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c index 26c0ffe3f1a..dc3781164bf 100644 --- a/src/mame/video/ladybug.c +++ b/src/mame/video/ladybug.c @@ -17,7 +17,7 @@ UINT8 sraider_grid_color; void redclash_set_stars_enable( UINT8 on ); void redclash_update_stars_state(void); void redclash_set_stars_speed( UINT8 speed ); -void redclash_draw_stars(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx); +void redclash_draw_stars(mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx); static tilemap *bg_tilemap; static tilemap *grid_tilemap; @@ -363,7 +363,7 @@ VIDEO_UPDATE( ladybug ) int offs; // clear the bg bitmap - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); for (offs = 0; offs < 32; offs++) { @@ -406,13 +406,13 @@ VIDEO_UPDATE( sraider ) } // clear the bg bitmap - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); // draw the stars if (flip_screen) - redclash_draw_stars(machine->pens,bitmap,cliprect,0x60,1,0x27,0xff); + redclash_draw_stars(bitmap,cliprect,0x60,1,0x27,0xff); else - redclash_draw_stars(machine->pens,bitmap,cliprect,0x60,1,0x00,0xd8); + redclash_draw_stars(bitmap,cliprect,0x60,1,0x00,0xd8); // draw the gridlines colortable_palette_set_color(machine->colortable, 0x40, MAKE_RGB(sraider_grid_color & 0x40 ? 0xff : 0, @@ -431,7 +431,7 @@ VIDEO_UPDATE( sraider ) if (flip_screen) x = ~x; - plot_box(bitmap, x, cliprect->min_y, 1, height, machine->pens[0x81]); + plot_box(bitmap, x, cliprect->min_y, 1, height, 0x81); } } diff --git a/src/mame/video/lasso.c b/src/mame/video/lasso.c index f5c883b9086..139195949b8 100644 --- a/src/mame/video/lasso.c +++ b/src/mame/video/lasso.c @@ -340,10 +340,10 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re } -static void draw_lasso(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect) +static void draw_lasso(mame_bitmap *bitmap, const rectangle *cliprect) { offs_t offs; - pen_t pen = pens[0x3f]; + pen_t pen = 0x3f; for (offs = 0; offs < 0x2000; offs++) { @@ -383,10 +383,10 @@ static void draw_lasso(const pen_t *pens, mame_bitmap *bitmap, const rectangle * VIDEO_UPDATE( lasso ) { palette_set_color(machine, 0, get_color(*lasso_back_color)); - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); - draw_lasso(machine->pens, bitmap, cliprect); + draw_lasso(bitmap, cliprect); draw_sprites(machine, bitmap, cliprect, 0); return 0; @@ -395,7 +395,7 @@ VIDEO_UPDATE( lasso ) VIDEO_UPDATE( chameleo ) { palette_set_color(machine, 0, get_color(*lasso_back_color)); - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); draw_sprites(machine, bitmap, cliprect, 0); diff --git a/src/mame/video/liberate.c b/src/mame/video/liberate.c index b942cfa22e1..f2cf7083b15 100644 --- a/src/mame/video/liberate.c +++ b/src/mame/video/liberate.c @@ -367,7 +367,7 @@ VIDEO_UPDATE( prosoccr ) tilemap_set_scrollx(background_tilemap,0,-deco16_io_ram[0]); if (background_disable) - fillbitmap(bitmap,machine->pens[32],cliprect); + fillbitmap(bitmap,32,cliprect); else tilemap_draw(bitmap,cliprect,background_tilemap,0,0); boomrang_draw_sprites(machine,bitmap,cliprect,0); @@ -379,7 +379,7 @@ VIDEO_UPDATE( prosport ) { int mx,my,tile,color,offs; - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); prosport_draw_sprites(machine,bitmap,cliprect); @@ -407,7 +407,7 @@ VIDEO_UPDATE( boomrang ) tilemap_set_scrollx(background_tilemap,0,-deco16_io_ram[0]); if (background_disable) - fillbitmap(bitmap,machine->pens[32],cliprect); + fillbitmap(bitmap,32,cliprect); else tilemap_draw(bitmap,cliprect,background_tilemap,TILEMAP_DRAW_LAYER1,0); @@ -425,7 +425,7 @@ VIDEO_UPDATE( liberate ) tilemap_set_scrollx(background_tilemap,0,-deco16_io_ram[0]); if (background_disable) - fillbitmap(bitmap,machine->pens[32],cliprect); + fillbitmap(bitmap,32,cliprect); else tilemap_draw(bitmap,cliprect,background_tilemap,0,0); diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c index dbf61c6f1ae..a14d0799a4f 100644 --- a/src/mame/video/lordgun.c +++ b/src/mame/video/lordgun.c @@ -294,7 +294,7 @@ if (input_code_pressed(KEYCODE_Z)) tilemap_set_scrollx( tilemap_3, 0, *lordgun_scroll_x_3 ); tilemap_set_scrolly( tilemap_3, 0, *lordgun_scroll_y_3 ); - fillbitmap( bitmap, machine->pens[0], cliprect ); + fillbitmap( bitmap, 0, cliprect ); if (layers_ctrl & 4) tilemap_draw(bitmap, cliprect, tilemap_2, 0, 0); if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, tilemap_0, 0, 0); diff --git a/src/mame/video/lsasquad.c b/src/mame/video/lsasquad.c index 59334c670db..fa4be922a85 100644 --- a/src/mame/video/lsasquad.c +++ b/src/mame/video/lsasquad.c @@ -201,7 +201,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re VIDEO_UPDATE( lsasquad ) { - fillbitmap(bitmap,machine->pens[511],cliprect); + fillbitmap(bitmap,511,cliprect); draw_layer(machine,bitmap,cliprect,lsasquad_scrollram + 0x000); draw_layer(machine,bitmap,cliprect,lsasquad_scrollram + 0x080); @@ -213,7 +213,7 @@ VIDEO_UPDATE( lsasquad ) VIDEO_UPDATE( daikaiju ) { - fillbitmap(bitmap,machine->pens[511],cliprect); + fillbitmap(bitmap,511,cliprect); drawbg(machine,bitmap,cliprect,0); // bottom draw_sprites(machine,bitmap,cliprect); drawbg(machine,bitmap,cliprect,1); // top = pallete $d ? diff --git a/src/mame/video/m10.c b/src/mame/video/m10.c index fdc1697972d..dc4d42f1528 100644 --- a/src/mame/video/m10.c +++ b/src/mame/video/m10.c @@ -138,7 +138,7 @@ VIDEO_UPDATE( m10 ) static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8}; int i; - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); decodegfx(back_gfx, state->chargen,0,4); for (i=0;i<4;i++) diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c index 5ce4e65d69a..e43709a8201 100644 --- a/src/mame/video/m107.c +++ b/src/mame/video/m107.c @@ -281,7 +281,7 @@ static void m107_screenrefresh(running_machine *machine, mame_bitmap *bitmap, co tilemap_draw(bitmap, cliprect, pf_layer[3].tmap, 1, 0); } else - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, pf_layer[2].tmap, 0, 0); tilemap_draw(bitmap, cliprect, pf_layer[2].tmap, 1, 0); diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c index 276ed26baef..e107cb05a88 100644 --- a/src/mame/video/m52.c +++ b/src/mame/video/m52.c @@ -345,7 +345,7 @@ static void draw_background(running_machine *machine, mame_bitmap *bitmap, const rect.max_y = ypos + 2 * BGHEIGHT - 1; } - fillbitmap(bitmap, machine->pens[machine->gfx[image]->color_base + 3], &rect); + fillbitmap(bitmap, machine->gfx[image]->color_base + 3, &rect); } diff --git a/src/mame/video/m90.c b/src/mame/video/m90.c index 7a6733216d2..a1cc874dc26 100644 --- a/src/mame/video/m90.c +++ b/src/mame/video/m90.c @@ -228,7 +228,7 @@ VIDEO_UPDATE( m90 ) fillbitmap(priority_bitmap,0,cliprect); if (!pf2_enable) - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); if (pf2_enable) { diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c index e4438204bdb..a446ae721c4 100644 --- a/src/mame/video/m92.c +++ b/src/mame/video/m92.c @@ -441,7 +441,7 @@ static void m92_screenrefresh(running_machine *machine, mame_bitmap *bitmap,cons tilemap_draw(bitmap, cliprect, pf_layer[2].tmap, TILEMAP_DRAW_LAYER0, 1); } else - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, pf_layer[1].wide_tmap, TILEMAP_DRAW_LAYER1, 0); tilemap_draw(bitmap, cliprect, pf_layer[1].tmap, TILEMAP_DRAW_LAYER1, 0); diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c index 7bf3aa7dab7..faef63e10ed 100644 --- a/src/mame/video/madalien.c +++ b/src/mame/video/madalien.c @@ -284,7 +284,7 @@ static VIDEO_UPDATE( madalien ) // mode 3 - transition from A to B int scroll_mode = *madalien_scroll & 3; - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); draw_edges(bitmap, cliprect, flip_screen, scroll_mode); draw_foreground(machine, bitmap, cliprect, flip_screen); diff --git a/src/mame/video/magmax.c b/src/mame/video/magmax.c index d9a9b465515..8331c925c36 100644 --- a/src/mame/video/magmax.c +++ b/src/mame/video/magmax.c @@ -98,7 +98,7 @@ VIDEO_UPDATE( magmax ) /* copy the background graphics */ if (*magmax_vreg & 0x40) /* background disable */ - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); else { int v; diff --git a/src/mame/video/malzak.c b/src/mame/video/malzak.c index 0282dd24486..87381ccba97 100644 --- a/src/mame/video/malzak.c +++ b/src/mame/video/malzak.c @@ -237,10 +237,10 @@ VIDEO_UPDATE( malzak ) int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x); if (S2636_IS_PIXEL_DRAWN(pixel0)) - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel0)]; + *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel0); if (S2636_IS_PIXEL_DRAWN(pixel1)) - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel1)]; + *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel1); } } } diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c index bdaccb62f46..6ece7c62eae 100644 --- a/src/mame/video/megasys1.c +++ b/src/mame/video/megasys1.c @@ -1001,7 +1001,7 @@ VIDEO_UPDATE( megasys1 ) if (flag != 0) { flag = 0; - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); } if (megasys1_sprite_flag & 0x100) /* sprites are split */ diff --git a/src/mame/video/metlclsh.c b/src/mame/video/metlclsh.c index 139542f581f..5eb38373502 100644 --- a/src/mame/video/metlclsh.c +++ b/src/mame/video/metlclsh.c @@ -237,7 +237,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec VIDEO_UPDATE( metlclsh ) { - fillbitmap(bitmap,machine->pens[0x10],cliprect); + fillbitmap(bitmap,0x10,cliprect); tilemap_draw(bitmap,cliprect,fg_tilemap,1,0); // low priority tiles of foreground if (metlclsh_scrollx[0] & 0x08) // background (if enabled) diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c index c0c79a7d74a..44dc8a7bdef 100644 --- a/src/mame/video/metro.c +++ b/src/mame/video/metro.c @@ -873,7 +873,7 @@ VIDEO_UPDATE( metro ) /* The background color is selected by a register */ fillbitmap(priority_bitmap,0,cliprect); - fillbitmap(bitmap,machine->pens[((metro_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000],cliprect); + fillbitmap(bitmap,((metro_videoregs[0x12/2] & 0x0fff) ^ 0x0ff) + 0x1000,cliprect); /* Screen Control Register: diff --git a/src/mame/video/mexico86.c b/src/mame/video/mexico86.c index e5cc0d9368b..0c7e67879c7 100644 --- a/src/mame/video/mexico86.c +++ b/src/mame/video/mexico86.c @@ -32,7 +32,7 @@ VIDEO_UPDATE( mexico86 ) /* the background character columns is stored inthe area dd00-dd3f */ /* This clears & redraws the entire screen each pass */ - fillbitmap(bitmap,machine->pens[255],&machine->screen[0].visarea); + fillbitmap(bitmap,255,&machine->screen[0].visarea); sx = 0; /* the score display seems to be outside of the main objectram. */ @@ -113,7 +113,7 @@ VIDEO_UPDATE( kikikai ) /* the background character columns is stored inthe area dd00-dd3f */ /* This clears & redraws the entire screen each pass */ - fillbitmap(bitmap,machine->pens[255],&machine->screen[0].visarea); + fillbitmap(bitmap,255,&machine->screen[0].visarea); sx = 0; /* the score display seems to be outside of the main objectram. */ diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c index e95138f8e34..ba6e645aa20 100644 --- a/src/mame/video/mitchell.c +++ b/src/mame/video/mitchell.c @@ -281,7 +281,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec VIDEO_UPDATE( pang ) { - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); draw_sprites(machine, bitmap,cliprect); return 0; diff --git a/src/mame/video/mjsister.c b/src/mame/video/mjsister.c index 41f7ee8e061..0a7e8937bca 100644 --- a/src/mame/video/mjsister.c +++ b/src/mame/video/mjsister.c @@ -97,10 +97,8 @@ VIDEO_UPDATE( mjsister ) if (mjsister_video_enable) { for (i=0; i<256; i++) - { for (j=0; j<4; j++) - *BITMAP_ADDR16(bitmap, i, 256+j) = machine->pens[mjsister_colorbank * 0x20]; - } + *BITMAP_ADDR16(bitmap, i, 256+j) = mjsister_colorbank * 0x20; copybitmap (bitmap,mjsister_tmpbitmap0,f,f,0,0,cliprect); copybitmap_trans(bitmap,mjsister_tmpbitmap1,f,f,2,0,cliprect,0); diff --git a/src/mame/video/momoko.c b/src/mame/video/momoko.c index f69c97ec57b..0ef89127b75 100644 --- a/src/mame/video/momoko.c +++ b/src/mame/video/momoko.c @@ -69,7 +69,7 @@ WRITE8_HANDLER( momoko_flipscreen_w ) } /****************************************************************************/ -static void momoko_draw_bg_pri(running_machine *machine, mame_bitmap *bitmap, int chr, int col, int flipx, int flipy, int x,int y, int pri) +static void momoko_draw_bg_pri(mame_bitmap *bitmap, int chr, int col, int flipx, int flipy, int x,int y, int pri) { int xx,sx,sy,px,py,dot; UINT32 gfxadr; @@ -91,7 +91,7 @@ static void momoko_draw_bg_pri(running_machine *machine, mame_bitmap *bitmap, in else py=7-sy + y; if (dot>=pri) - *BITMAP_ADDR16(bitmap, py, px) = machine->pens[col*16+dot+256]; + *BITMAP_ADDR16(bitmap, py, px) = col*16+dot+256; d0 = d0 << 1; d1 = d1 << 1; } @@ -152,7 +152,7 @@ VIDEO_UPDATE( momoko ) } } else - fillbitmap(bitmap, machine->pens[256], 0); + fillbitmap(bitmap, 256, 0); /* draw sprites (momoko) */ @@ -213,7 +213,7 @@ VIDEO_UPDATE( momoko ) { col = col & 0x0f; chr = chr + momoko_bg_select * 512; - momoko_draw_bg_pri(machine, bitmap,chr,col,flip,flip,px,py,pri); + momoko_draw_bg_pri(bitmap,chr,col,flip,flip,px,py,pri); } } } diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c index 52693fcb8ca..70b85553872 100644 --- a/src/mame/video/mrdo.c +++ b/src/mame/video/mrdo.c @@ -245,7 +245,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec VIDEO_UPDATE( mrdo ) { - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); tilemap_draw(bitmap,cliprect,fg_tilemap,0,0); draw_sprites(machine,bitmap,cliprect); diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c index cafcb4e8211..124a94bc896 100644 --- a/src/mame/video/ms32.c +++ b/src/mame/video/ms32.c @@ -488,7 +488,7 @@ VIDEO_UPDATE( ms32 ) /* TODO: 0 is correct for gametngk, but break f1superb scrolling grid (text at top and bottom of the screen becomes black on black) */ - fillbitmap(bitmap,machine->pens[0],cliprect); /* bg color */ + fillbitmap(bitmap,0,cliprect); /* bg color */ /* priority hack, we really need to figure out what priority ram is I think */ diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c index c853498ab17..2dbe7cca17d 100644 --- a/src/mame/video/namcona1.c +++ b/src/mame/video/namcona1.c @@ -259,7 +259,7 @@ static void pdraw_masked_tile(running_machine *machine, int bShadow ) { const gfx_element *gfx,*mask; - const pen_t *paldata; + pen_t pen_base; UINT8 *gfx_addr; int gfx_pitch; UINT8 *mask_addr; @@ -278,7 +278,7 @@ static void pdraw_masked_tile(running_machine *machine, mask = machine->gfx[1]; code %= gfx->total_elements; color %= gfx->total_colors; - paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color]; + pen_base = gfx->color_base + gfx->color_granularity * color; gfx_addr = gfx->gfxdata + code * gfx->char_modulo; gfx_pitch = gfx->line_modulo; mask_addr = mask->gfxdata + code * mask->char_modulo; @@ -355,7 +355,7 @@ static void pdraw_masked_tile(running_machine *machine, { /* sprite pixel is opaque */ if( priority>=pri[-x] ) { - dest[-x] = paldata[gfx_addr[x]]; + dest[-x] = pen_base + gfx_addr[x]; } pri[-x] = 0xff; } @@ -372,7 +372,7 @@ static void pdraw_masked_tile(running_machine *machine, { /* sprite pixel is opaque */ if( priority>=pri[x] ) { - dest[x] = paldata[gfx_addr[x]]; + dest[x] = pen_base + gfx_addr[x]; } pri[x] = 0xff; } @@ -397,7 +397,7 @@ static void pdraw_opaque_tile(running_machine *machine, int bShadow ) { const gfx_element *gfx; - const pen_t *paldata; + pen_t pen_base; UINT8 *gfx_addr; int gfx_pitch; int x,y; @@ -413,7 +413,7 @@ static void pdraw_opaque_tile(running_machine *machine, gfx = machine->gfx[0]; code %= gfx->total_elements; color %= gfx->total_colors; - paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color]; + pen_base = gfx->color_base + gfx->color_granularity * color; gfx_addr = gfx->gfxdata + code * gfx->char_modulo; gfx_pitch = gfx->line_modulo; @@ -433,7 +433,7 @@ static void pdraw_opaque_tile(running_machine *machine, { if( priority>=pri[-x] ) { - dest[-x] = paldata[gfx_addr[x]]; + dest[-x] = pen_base + gfx_addr[x]; } pri[-x] = 0xff; } @@ -447,7 +447,7 @@ static void pdraw_opaque_tile(running_machine *machine, { if( priority>=pri[x] ) { - dest[x] = paldata[gfx_addr[x]]; + dest[x] = pen_base + gfx_addr[x]; } pri[x] = 0xff; } /* next x */ diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c index da6cf628d7e..9d0e904e154 100644 --- a/src/mame/video/namcos1.c +++ b/src/mame/video/namcos1.c @@ -138,10 +138,10 @@ VIDEO_START( namcos1 ) /* all palette entries are not affected by shadow sprites... */ for (i = 0;i < 0x2000;i++) - machine->shadow_table[machine->pens[i]] = machine->pens[i]; + machine->shadow_table[i] = i; /* ... except for tilemap colors */ for (i = 0x0800;i < 0x1000;i++) - machine->shadow_table[machine->pens[i]] = machine->pens[i + 0x0800]; + machine->shadow_table[i] = i + 0x0800; spriteram = &namcos1_spriteram[0x800]; diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c index c7d2996e627..dc3f88a9f8b 100644 --- a/src/mame/video/namcos86.c +++ b/src/mame/video/namcos86.c @@ -360,7 +360,7 @@ VIDEO_UPDATE( namcos86 ) fillbitmap(priority_bitmap, 0, cliprect); - fillbitmap(bitmap,machine->pens[machine->gfx[0]->color_base + 8*backcolor+7],cliprect); + fillbitmap(bitmap,machine->gfx[0]->color_base + 8*backcolor+7,cliprect); for (layer = 0;layer < 8;layer++) { diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c index 0da5eeed4b0..eea7282912d 100644 --- a/src/mame/video/nbmj8688.c +++ b/src/mame/video/nbmj8688.c @@ -701,9 +701,8 @@ VIDEO_UPDATE( mbmj8688 ) copybitmap(bitmap, mjsikaku_tmpbitmap, 0, 0, 0, scrolly - 256, cliprect); } else - { - fillbitmap(bitmap, machine->pens[0], 0); - } + fillbitmap(bitmap, 0, 0); + return 0; } diff --git a/src/mame/video/nbmj8891.c b/src/mame/video/nbmj8891.c index 7a27e46ca82..54cc8d3b362 100644 --- a/src/mame/video/nbmj8891.c +++ b/src/mame/video/nbmj8891.c @@ -555,13 +555,13 @@ VIDEO_UPDATE( nbmj8891 ) if (gfxdraw_mode) { copyscrollbitmap (bitmap, nbmj8891_tmpbitmap0, 0, 0, 0, 0, cliprect); - copyscrollbitmap_trans(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, machine->pens[0xff]); + copyscrollbitmap_trans(bitmap, nbmj8891_tmpbitmap1, 0, 0, 1, &scrolly, cliprect, 0xff); } else copyscrollbitmap(bitmap, nbmj8891_tmpbitmap0, 0, 0, 1, &scrolly, cliprect); } else - fillbitmap(bitmap, machine->pens[0xff], 0); + fillbitmap(bitmap, 0xff, 0); return 0; } diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c index 910244d00c9..cde9165b9a9 100644 --- a/src/mame/video/nbmj8991.c +++ b/src/mame/video/nbmj8991.c @@ -338,7 +338,7 @@ VIDEO_UPDATE( nbmj8991_type1 ) copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); } else - fillbitmap(bitmap, machine->pens[0x00], 0); + fillbitmap(bitmap, 0, 0); return 0; } @@ -378,7 +378,7 @@ VIDEO_UPDATE( nbmj8991_type2 ) copyscrollbitmap(bitmap, nbmj8991_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); } else - fillbitmap(bitmap, machine->pens[0x00], 0); + fillbitmap(bitmap, 0, 0); return 0; } diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c index 5112298a050..fc7984dd6ca 100644 --- a/src/mame/video/nbmj9195.c +++ b/src/mame/video/nbmj9195.c @@ -504,17 +504,17 @@ VIDEO_UPDATE( nbmj9195 ) // nbmj9195 1layer copyscrollbitmap(bitmap, nbmj9195_tmpbitmap[0], SCANLINE_MAX, nbmj9195_scrollx_raster[0], 1, &scrolly[0], cliprect); else - fillbitmap(bitmap, machine->pens[0x0ff], 0); + fillbitmap(bitmap, 0x0ff, 0); if (nbmj9195_dispflag[1]) { if (gfxdraw_mode == 1) // nbmj9195 2layer - copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, machine->pens[0x0ff]); + copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, 0x0ff); if (gfxdraw_mode == 2) // nbmj9195 nb22090 2layer - copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, machine->pens[0x1ff]); + copyscrollbitmap_trans(bitmap, nbmj9195_tmpbitmap[1], SCANLINE_MAX, nbmj9195_scrollx_raster[1], 1, &scrolly[1], cliprect, 0x1ff); } return 0; } diff --git a/src/mame/video/nemesis.c b/src/mame/video/nemesis.c index dc0e2df358a..de794c6d595 100644 --- a/src/mame/video/nemesis.c +++ b/src/mame/video/nemesis.c @@ -388,7 +388,7 @@ VIDEO_UPDATE( nemesis ) update_gfx(machine); fillbitmap(priority_bitmap,0,cliprect); - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); tilemap_set_scrolly( background, 0, (nemesis_yscroll[0x180] & 0xff) ); @@ -417,7 +417,7 @@ VIDEO_UPDATE( salamand ) update_gfx(machine); fillbitmap(priority_bitmap,0,cliprect); - fillbitmap(bitmap,machine->pens[0],cliprect); + fillbitmap(bitmap,0,cliprect); clip.min_x = 0; clip.max_x = 255; diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c index c70e81b54df..1e93fc25b87 100644 --- a/src/mame/video/ninjakd2.c +++ b/src/mame/video/ninjakd2.c @@ -464,7 +464,7 @@ static void erase_sprites(running_machine* const machine, mame_bitmap* const bit VIDEO_UPDATE( ninjakd2 ) { - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); @@ -477,7 +477,7 @@ VIDEO_UPDATE( ninjakd2 ) VIDEO_UPDATE( robokid ) { - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); @@ -494,7 +494,7 @@ VIDEO_UPDATE( robokid ) VIDEO_UPDATE( omegaf ) { - fillbitmap(bitmap, machine->pens[0], cliprect); + fillbitmap(bitmap, 0, cliprect); tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0); diff --git a/src/mame/video/nitedrvr.c b/src/mame/video/nitedrvr.c index 0f9d4d5d48d..72599edaf37 100644 --- a/src/mame/video/nitedrvr.c +++ b/src/mame/video/nitedrvr.c @@ -36,27 +36,24 @@ static TILE_GET_INFO( get_bg_tile_info ) VIDEO_START( nitedrvr ) { - bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, - 8, 8, 32, 32); + bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); } -static void draw_box(running_machine *machine, mame_bitmap *bitmap, int bx, int by, int ex, int ey ) +static void draw_box(mame_bitmap *bitmap, int bx, int by, int ex, int ey ) { int x, y; for (y = by; y < ey; y++) { for (x = bx; x < ex; x++) - { if ((y < 256) && (x < 256)) - *BITMAP_ADDR16(bitmap, y, x) = machine->pens[1]; - } + *BITMAP_ADDR16(bitmap, y, x) = 1; } return; } -static void draw_roadway(running_machine *machine, mame_bitmap *bitmap) +static void draw_roadway(mame_bitmap *bitmap) { int roadway; @@ -69,13 +66,13 @@ static void draw_roadway(running_machine *machine, mame_bitmap *bitmap) ex = bx + ((nitedrvr_hvc[roadway + 32] & 0xf0) >> 4); ey = by + (16 - (nitedrvr_hvc[roadway + 32] & 0x0f)); - draw_box(machine, bitmap, bx, by, ex, ey); + draw_box(bitmap, bx, by, ex, ey); } } VIDEO_UPDATE( nitedrvr ) { tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); - draw_roadway(machine, bitmap); + draw_roadway(bitmap); return 0; } diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c index 3ab46ca9f42..5e6ee5451e5 100644 --- a/src/mame/video/niyanpai.c +++ b/src/mame/video/niyanpai.c @@ -436,13 +436,13 @@ VIDEO_UPDATE( niyanpai ) if (niyanpai_dispflag[0]) copyscrollbitmap(bitmap, niyanpai_tmpbitmap[0], 1, &scrollx[0], 1, &scrolly[0], cliprect); else - fillbitmap(bitmap, machine->pens[0x00ff], 0); + fillbitmap(bitmap, 0x00ff, 0); if (niyanpai_dispflag[1]) - copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, machine->pens[0x01ff]); + copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[1], 1, &scrollx[1], 1, &scrolly[1], cliprect, 0x01ff); if (niyanpai_dispflag[2]) - copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, machine->pens[0x02ff]); + copyscrollbitmap_trans(bitmap, niyanpai_tmpbitmap[2], 1, &scrollx[2], 1, &scrolly[2], cliprect, 0x02ff); return 0; } diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c index c57134c79ec..0e136ec067b 100644 --- a/src/mame/video/redclash.c +++ b/src/mame/video/redclash.c @@ -260,7 +260,7 @@ popmessage("unknown sprite size 0"); } } -static void draw_bullets(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect ) +static void draw_bullets(mame_bitmap *bitmap, const rectangle *cliprect ) { int offs; @@ -277,7 +277,7 @@ static void draw_bullets(const pen_t *pens, mame_bitmap *bitmap, const rectangle if (sx >= cliprect->min_x && sx <= cliprect->max_x && sy >= cliprect->min_y && sy <= cliprect->max_y) - *BITMAP_ADDR16(bitmap, sy, sx) = pens[0x19]; + *BITMAP_ADDR16(bitmap, sy, sx) = 0x19; } } @@ -357,7 +357,7 @@ void redclash_set_stars_speed( UINT8 speed ) /* Space Raider doesn't use the Va bit, and it is also set up to */ /* window the stars to a certain x range */ -void redclash_draw_stars(const pen_t *pens, mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx) +void redclash_draw_stars(mame_bitmap *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx) { int i; UINT8 tempbit, feedback, star_color, xloc, yloc; @@ -403,7 +403,7 @@ void redclash_draw_stars(const pen_t *pens, mame_bitmap *bitmap, const rectangle if ((xloc>=firstx) && (xloc<=lastx)) { star_color = (state >> 9) & 0x1f; - *BITMAP_ADDR16(bitmap, yloc, xloc) = pens[palette_offset+star_color]; + *BITMAP_ADDR16(bitmap, yloc, xloc) = palette_offset+star_color; } } } @@ -422,9 +422,9 @@ VIDEO_EOF( redclash ) VIDEO_UPDATE( redclash ) { fillbitmap(bitmap, get_black_pen(machine), cliprect); - redclash_draw_stars(machine->pens, bitmap, cliprect, 0x60, 0, 0x00, 0xff); + redclash_draw_stars(bitmap, cliprect, 0x60, 0, 0x00, 0xff); draw_sprites(machine, bitmap, cliprect); - draw_bullets(machine->pens, bitmap, cliprect); + draw_bullets(bitmap, cliprect); tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0); return 0; }