mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
- Pen lookup removal
- With my previous update, some of the games in cave.c asserted out -- this fixes it - seta.c employs the same pattern as cave.c
This commit is contained in:
parent
2e595362d8
commit
0ab1b992b7
@ -518,7 +518,7 @@ static ADDRESS_MAP_START( dfeveron_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x408000, 0x40ffff) AM_WRITE(MWA16_RAM ) // Sprites?
|
||||
AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0 ) // Layer 0
|
||||
AM_RANGE(0x600000, 0x607fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1 ) // Layer 1
|
||||
AM_RANGE(0x708000, 0x708fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0x708000, 0x708fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0x710c00, 0x710fff) AM_WRITE(MWA16_RAM ) // ?
|
||||
AM_RANGE(0x800000, 0x80007f) AM_WRITE(MWA16_RAM) AM_BASE(&cave_videoregs ) // Video Regs
|
||||
AM_RANGE(0x900000, 0x900005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
@ -562,7 +562,7 @@ static ADDRESS_MAP_START( ddonpach_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x900000, 0x900005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0xa00000, 0xa00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_1 ) // Layer 1 Control
|
||||
AM_RANGE(0xb00000, 0xb00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_2 ) // Layer 2 Control
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xe00000, 0xe00001) AM_WRITE(cave_eeprom_msb_w ) // EEPROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -627,7 +627,7 @@ static ADDRESS_MAP_START( donpachi_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x700000, 0x700005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0x800000, 0x800005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_2 ) // Layer 2 Control
|
||||
AM_RANGE(0x900000, 0x90007f) AM_WRITE(MWA16_RAM) AM_BASE(&cave_videoregs ) // Video Regs
|
||||
AM_RANGE(0xa08000, 0xa08fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xa08000, 0xa08fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xb00000, 0xb00003) AM_WRITE(OKIM6295_data_0_lsb_w ) // M6295
|
||||
AM_RANGE(0xb00010, 0xb00013) AM_WRITE(OKIM6295_data_1_lsb_w ) //
|
||||
AM_RANGE(0xb00020, 0xb0002f) AM_WRITE(NMK112_okibank_lsb_w ) //
|
||||
@ -670,7 +670,7 @@ static ADDRESS_MAP_START( esprade_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x900000, 0x900005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0xa00000, 0xa00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_1 ) // Layer 1 Control
|
||||
AM_RANGE(0xb00000, 0xb00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_2 ) // Layer 2 Control
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xe00000, 0xe00001) AM_WRITE(cave_eeprom_msb_w ) // EEPROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -717,7 +717,7 @@ static ADDRESS_MAP_START( gaia_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x900000, 0x900005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0xa00000, 0xa00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_1 ) // Layer 1 Control
|
||||
AM_RANGE(0xb00000, 0xb00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_2 ) // Layer 2 Control
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xd00010, 0xd00011) AM_WRITE(gaia_coin_lsb_w ) // Coin counter only
|
||||
AM_RANGE(0xd00014, 0xd00015) AM_WRITE(watchdog_reset16_w ) // Watchdog?
|
||||
ADDRESS_MAP_END
|
||||
@ -758,7 +758,7 @@ static ADDRESS_MAP_START( guwange_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x900000, 0x900005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0xa00000, 0xa00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_1 ) // Layer 1 Control
|
||||
AM_RANGE(0xb00000, 0xb00005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_2 ) // Layer 2 Control
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xd00010, 0xd00011) AM_WRITE(cave_eeprom_lsb_w ) // EEPROM
|
||||
// AM_RANGE(0xd00012, 0xd00013) AM_WRITE(MWA16_NOP ) // ?
|
||||
// AM_RANGE(0xd00014, 0xd00015) AM_WRITE(MWA16_NOP ) // ? $800068 in dfeveron ? probably Watchdog
|
||||
@ -790,7 +790,7 @@ ADDRESS_MAP_END
|
||||
static ADDRESS_MAP_START( hotdogst_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM ) // ROM
|
||||
AM_RANGE(0x300000, 0x30ffff) AM_WRITE(MWA16_RAM ) // RAM
|
||||
AM_RANGE(0x408000, 0x408fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0x408000, 0x408fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0 ) // Layer 0
|
||||
AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1 ) // Layer 1
|
||||
AM_RANGE(0x980000, 0x987fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2 ) // Layer 2
|
||||
@ -897,7 +897,7 @@ static ADDRESS_MAP_START( korokoro_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x140000, 0x140005) AM_WRITE( MWA16_RAM ) AM_BASE( &cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0x180000, 0x187fff) AM_WRITE( MWA16_RAM ) AM_BASE( &spriteram16 ) AM_SIZE(&spriteram_size ) // Sprites
|
||||
AM_RANGE(0x1c0000, 0x1c007f) AM_WRITE( MWA16_RAM ) AM_BASE( &cave_videoregs ) // Video Regs
|
||||
AM_RANGE(0x200000, 0x207fff) AM_WRITE( MWA16_RAM ) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0x200000, 0x207fff) AM_WRITE( MWA16_RAM ) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0x240000, 0x240003) AM_WRITE( cave_sound_w ) // YMZ280
|
||||
AM_RANGE(0x280008, 0x280009) AM_WRITE( korokoro_leds_w )
|
||||
AM_RANGE(0x28000a, 0x28000b) AM_WRITE( korokoro_eeprom_msb_w ) // EEPROM
|
||||
@ -940,7 +940,7 @@ static ADDRESS_MAP_START( mazinger_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x600000, 0x600005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_1 ) // Layer 1 Control
|
||||
AM_RANGE(0x700000, 0x700005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0x900000, 0x900001) AM_WRITE(cave_eeprom_msb_w ) // EEPROM
|
||||
AM_RANGE(0xc08000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xc08000, 0xc0ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xd00000, 0xd7ffff) AM_WRITE(MWA16_ROM ) // ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -977,7 +977,7 @@ static ADDRESS_MAP_START( metmqstr_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM ) // ROM
|
||||
AM_RANGE(0x100000, 0x17ffff) AM_WRITE(MWA16_ROM ) // ROM
|
||||
AM_RANGE(0x200000, 0x27ffff) AM_WRITE(MWA16_ROM ) // ROM
|
||||
AM_RANGE(0x408000, 0x408fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0x408000, 0x408fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0x880000, 0x887fff) AM_WRITE(cave_vram_2_w) AM_BASE(&cave_vram_2 ) // Layer 2
|
||||
AM_RANGE(0x888000, 0x88ffff) AM_WRITE(MWA16_RAM ) //
|
||||
AM_RANGE(0x900000, 0x907fff) AM_WRITE(cave_vram_1_w) AM_BASE(&cave_vram_1 ) // Layer 1
|
||||
@ -1066,7 +1066,7 @@ static ADDRESS_MAP_START( pwrinst2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0xc00000, 0xc00005) AM_WRITE(pwrinst2_vctrl_1_w) AM_BASE(&cave_vctrl_1 ) // Layer 1 Control
|
||||
AM_RANGE(0xc80000, 0xc80005) AM_WRITE(pwrinst2_vctrl_3_w) AM_BASE(&cave_vctrl_3 ) // Layer 3 Control
|
||||
AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_cmd_w ) // To Sound CPU
|
||||
AM_RANGE(0xf00000, 0xf04fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0xf00000, 0xf04fff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -1126,7 +1126,7 @@ static ADDRESS_MAP_START( sailormn_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x110000, 0x110001) AM_WRITE(MWA16_RAM ) // (agallet)
|
||||
AM_RANGE(0x200000, 0x3fffff) AM_WRITE(MWA16_ROM ) // ROM
|
||||
AM_RANGE(0x400000, 0x407fff) AM_WRITE(MWA16_RAM ) // (agallet)
|
||||
AM_RANGE(0x408000, 0x40bfff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0x408000, 0x40bfff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0x40c000, 0x40ffff) AM_WRITE(MWA16_RAM ) // (agallet)
|
||||
AM_RANGE(0x410000, 0x410001) AM_WRITE(MWA16_RAM ) // (agallet)
|
||||
AM_RANGE(0x500000, 0x507fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size ) // Sprites
|
||||
@ -1172,7 +1172,7 @@ static ADDRESS_MAP_START( uopoko_writemem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x500000, 0x507fff) AM_WRITE(cave_vram_0_w) AM_BASE(&cave_vram_0 ) // Layer 0
|
||||
AM_RANGE(0x600000, 0x60007f) AM_WRITE(MWA16_RAM) AM_BASE(&cave_videoregs ) // Video Regs
|
||||
AM_RANGE(0x700000, 0x700005) AM_WRITE(MWA16_RAM) AM_BASE(&cave_vctrl_0 ) // Layer 0 Control
|
||||
AM_RANGE(0x800000, 0x80ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) // Palette
|
||||
AM_RANGE(0x800000, 0x80ffff) AM_WRITE(MWA16_RAM) AM_BASE(&paletteram16) AM_SIZE(&cave_paletteram_size) // Palette
|
||||
AM_RANGE(0xa00000, 0xa00001) AM_WRITE(cave_eeprom_msb_w ) // EEPROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
@ -15,6 +15,7 @@ extern UINT16 *cave_vram_0, *cave_vctrl_0;
|
||||
extern UINT16 *cave_vram_1, *cave_vctrl_1;
|
||||
extern UINT16 *cave_vram_2, *cave_vctrl_2;
|
||||
extern UINT16 *cave_vram_3, *cave_vctrl_3;
|
||||
extern size_t cave_paletteram_size;
|
||||
|
||||
WRITE16_HANDLER( cave_vram_0_w );
|
||||
WRITE16_HANDLER( cave_vram_1_w );
|
||||
|
@ -20,13 +20,11 @@ VIDEO_UPDATE( beezer )
|
||||
int x,y;
|
||||
|
||||
for (y = machine->screen[0].visarea.min_y; y <= machine->screen[0].visarea.max_y; y+=2)
|
||||
{
|
||||
for (x = machine->screen[0].visarea.min_x; x <= machine->screen[0].visarea.max_x; x++)
|
||||
{
|
||||
*BITMAP_ADDR16(bitmap, y+1, x) = machine->pens[videoram[0x80*y+x] & 0x0f];
|
||||
*BITMAP_ADDR16(bitmap, y, x) = machine->pens[(videoram[0x80*y+x] >> 4)& 0x0f];
|
||||
*BITMAP_ADDR16(bitmap, y+1, x) = videoram[0x80*y+x] & 0x0f;
|
||||
*BITMAP_ADDR16(bitmap, y, x) = videoram[0x80*y+x] >> 4;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
|
||||
|
||||
VIDEO_UPDATE( bionicc )
|
||||
{
|
||||
fillbitmap(bitmap,machine->pens[0],cliprect);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,1|TILEMAP_DRAW_LAYER1,0); /* nothing in FRONT */
|
||||
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
|
||||
tilemap_draw(bitmap,cliprect,fg_tilemap,0|TILEMAP_DRAW_LAYER1,0);
|
||||
|
@ -227,7 +227,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
|
||||
|
||||
VIDEO_UPDATE( blktiger )
|
||||
{
|
||||
fillbitmap(bitmap,machine->pens[1023],cliprect);
|
||||
fillbitmap(bitmap,1023,cliprect);
|
||||
|
||||
if (bgon)
|
||||
tilemap_draw(bitmap,cliprect,screen_layout ? bg_tilemap8x4 : bg_tilemap4x8,TILEMAP_DRAW_LAYER1,0);
|
||||
|
@ -248,7 +248,8 @@ if (input_code_pressed(KEYCODE_Z))
|
||||
if (layers_ctrl&1)
|
||||
for (i = 0; i <= 1; i++)
|
||||
tilemap_draw(bitmap, cliprect, tilemap_0, i, i);
|
||||
else fillbitmap(bitmap,machine->pens[0],cliprect);
|
||||
else
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
|
||||
if (layers_ctrl&2)
|
||||
for (i = 0; i <= 1; i++)
|
||||
|
@ -113,7 +113,7 @@ VIDEO_UPDATE( blockout )
|
||||
{
|
||||
int x,y;
|
||||
|
||||
pen_t color = machine->pens[512];
|
||||
pen_t color = 512;
|
||||
|
||||
for (y = 0;y < 256;y++)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ VIDEO_UPDATE( bottom9 )
|
||||
K052109_tilemap_update();
|
||||
|
||||
/* note: FIX layer is not used */
|
||||
fillbitmap(bitmap,machine->pens[layer_colorbase[1]],cliprect);
|
||||
fillbitmap(bitmap,layer_colorbase[1],cliprect);
|
||||
// if (bottom9_video_enable)
|
||||
{
|
||||
K051960_sprites_draw(bitmap,cliprect,1,1);
|
||||
|
@ -28,7 +28,7 @@ VIDEO_UPDATE( bublbobl )
|
||||
/* the background character columns is stored in the area dd00-dd3f */
|
||||
|
||||
/* This clears & redraws the entire screen each pass */
|
||||
fillbitmap(bitmap,machine->pens[255],cliprect);
|
||||
fillbitmap(bitmap,255,cliprect);
|
||||
|
||||
if (!bublbobl_video_enable) return 0;
|
||||
|
||||
|
@ -89,17 +89,13 @@ WRITE8_HANDLER( buggychl_bg_scrollx_w )
|
||||
|
||||
|
||||
|
||||
static void draw_sky(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
|
||||
static void draw_sky(mame_bitmap *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int x,y;
|
||||
|
||||
for (y = 0;y < 256;y++)
|
||||
{
|
||||
for (x = 0;x < 256;x++)
|
||||
{
|
||||
*BITMAP_ADDR16(bitmap, y, x) = machine->pens[128 + x/2];
|
||||
}
|
||||
}
|
||||
*BITMAP_ADDR16(bitmap, y, x) = 128 + x/2;
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +132,7 @@ static void draw_bg(running_machine *machine, mame_bitmap *bitmap, const rectang
|
||||
for (offs = 0;offs < 256;offs++)
|
||||
scroll[offs] = -buggychl_scrollh[offs];
|
||||
|
||||
copyscrollbitmap_trans(bitmap,tmpbitmap2,256,scroll,0,0,cliprect,machine->pens[32]);
|
||||
copyscrollbitmap_trans(bitmap,tmpbitmap2,256,scroll,0,0,cliprect,32);
|
||||
}
|
||||
|
||||
|
||||
@ -222,7 +218,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
|
||||
{
|
||||
int dx = flip_screen_x ? (255 - sx - px) : (sx + px);
|
||||
if ((dx & ~0xff) == 0)
|
||||
*BITMAP_ADDR16(bitmap, dy, dx) = machine->pens[sprite_color_base+col];
|
||||
*BITMAP_ADDR16(bitmap, dy, dx) = sprite_color_base + col;
|
||||
}
|
||||
|
||||
/* the following line is almost certainly wrong */
|
||||
@ -244,16 +240,14 @@ VIDEO_UPDATE( buggychl )
|
||||
|
||||
|
||||
if (sky_on)
|
||||
draw_sky(machine, bitmap, cliprect);
|
||||
draw_sky(bitmap, cliprect);
|
||||
else
|
||||
fillbitmap(bitmap,machine->pens[0],cliprect);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
|
||||
/* decode modified characters */
|
||||
for (code = 0;code < 256;code++)
|
||||
{
|
||||
if (dirtychar[code])
|
||||
decodechar(machine->gfx[0],code,buggychl_character_ram);
|
||||
}
|
||||
|
||||
if (bg_on)
|
||||
draw_bg(machine, bitmap, cliprect);
|
||||
|
@ -237,10 +237,10 @@ VIDEO_UPDATE( carpolo )
|
||||
/* draw the playfield elements in the correct priority order */
|
||||
|
||||
/* score area - position determined by bit 4 of the vertical timing PROM */
|
||||
plot_box(bitmap,0,0,RIGHT_BORDER+1,TOP_BORDER,machine->pens[BACKGROUND_PEN]);
|
||||
plot_box(bitmap,0,0,RIGHT_BORDER+1,TOP_BORDER,BACKGROUND_PEN);
|
||||
|
||||
/* field */
|
||||
plot_box(bitmap,0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[FIELD_PEN]);
|
||||
plot_box(bitmap,0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,FIELD_PEN);
|
||||
|
||||
/* car 1 */
|
||||
draw_sprite(machine, bitmap, cliprect,
|
||||
@ -248,10 +248,10 @@ VIDEO_UPDATE( carpolo )
|
||||
0, carpolo_spriteram[0x0c] & 0x0f, CAR1_COLOR);
|
||||
|
||||
/* border - position determined by bit 4 and 7 of the vertical timing PROM */
|
||||
plot_box(bitmap,0,TOP_BORDER, RIGHT_BORDER+1,1,machine->pens[LINE_PEN]);
|
||||
plot_box(bitmap,0,BOTTOM_BORDER,RIGHT_BORDER+1,1,machine->pens[LINE_PEN]);
|
||||
plot_box(bitmap,LEFT_BORDER,TOP_BORDER, 1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[LINE_PEN]);
|
||||
plot_box(bitmap,RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,machine->pens[LINE_PEN]);
|
||||
plot_box(bitmap,0,TOP_BORDER, RIGHT_BORDER+1,1,LINE_PEN);
|
||||
plot_box(bitmap,0,BOTTOM_BORDER,RIGHT_BORDER+1,1,LINE_PEN);
|
||||
plot_box(bitmap,LEFT_BORDER,TOP_BORDER, 1,BOTTOM_BORDER-TOP_BORDER+1,LINE_PEN);
|
||||
plot_box(bitmap,RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,LINE_PEN);
|
||||
|
||||
/* car 4 */
|
||||
draw_sprite(machine, bitmap, cliprect,
|
||||
@ -371,8 +371,8 @@ static int check_sprite_sprite_collision(running_machine *machine,
|
||||
|
||||
normalize_coordinates(&x1, &y1, &x2, &y2);
|
||||
|
||||
fillbitmap(sprite_sprite_collision_bitmap1, machine->pens[0], 0);
|
||||
fillbitmap(sprite_sprite_collision_bitmap2, machine->pens[0], 0);
|
||||
fillbitmap(sprite_sprite_collision_bitmap1, 0, 0);
|
||||
fillbitmap(sprite_sprite_collision_bitmap2, 0, 0);
|
||||
|
||||
drawgfx(sprite_sprite_collision_bitmap1,machine->gfx[0],
|
||||
code1,0,
|
||||
@ -388,8 +388,8 @@ static int check_sprite_sprite_collision(running_machine *machine,
|
||||
|
||||
for (x = x1; x < x1 + SPRITE_WIDTH; x++)
|
||||
for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
|
||||
if ((*BITMAP_ADDR16(sprite_sprite_collision_bitmap1, y, x) == machine->pens[1]) &&
|
||||
(*BITMAP_ADDR16(sprite_sprite_collision_bitmap2, y, x) == machine->pens[1]))
|
||||
if ((*BITMAP_ADDR16(sprite_sprite_collision_bitmap1, y, x) == 1) &&
|
||||
(*BITMAP_ADDR16(sprite_sprite_collision_bitmap2, y, x) == 1))
|
||||
{
|
||||
*col_x = (x1 + x) & 0x0f;
|
||||
*col_y = (y1 + y) & 0x0f;
|
||||
@ -426,8 +426,8 @@ static int check_sprite_left_goal_collision(running_machine *machine, int x1, in
|
||||
|
||||
normalize_coordinates(&x1, &y1, &x2, &y2);
|
||||
|
||||
fillbitmap(sprite_goal_collision_bitmap1, machine->pens[0], 0);
|
||||
fillbitmap(sprite_goal_collision_bitmap2, machine->pens[0], 0);
|
||||
fillbitmap(sprite_goal_collision_bitmap1, 0, 0);
|
||||
fillbitmap(sprite_goal_collision_bitmap2, 0, 0);
|
||||
|
||||
drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0],
|
||||
code1,0,
|
||||
@ -444,17 +444,17 @@ static int check_sprite_left_goal_collision(running_machine *machine, int x1, in
|
||||
|
||||
for (x = x1; x < x1 + SPRITE_WIDTH; x++)
|
||||
for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
|
||||
if ((*BITMAP_ADDR16(sprite_goal_collision_bitmap1, y, x) == machine->pens[1]))
|
||||
if ((*BITMAP_ADDR16(sprite_goal_collision_bitmap1, y, x) == 1))
|
||||
{
|
||||
pen_t pix = *BITMAP_ADDR16(sprite_goal_collision_bitmap2, y, x);
|
||||
|
||||
if (pix == machine->pens[LEFT_GOAL_PEN])
|
||||
if (pix == LEFT_GOAL_PEN)
|
||||
{
|
||||
collided = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!goalpost_only && (pix == machine->pens[LEFT_SCORE_PEN]))
|
||||
if (!goalpost_only && (pix == LEFT_SCORE_PEN))
|
||||
{
|
||||
collided = 2;
|
||||
break;
|
||||
@ -485,8 +485,8 @@ static int check_sprite_right_goal_collision(running_machine *machine, int x1, i
|
||||
|
||||
normalize_coordinates(&x1, &y1, &x2, &y2);
|
||||
|
||||
fillbitmap(sprite_goal_collision_bitmap1, machine->pens[0], 0);
|
||||
fillbitmap(sprite_goal_collision_bitmap2, machine->pens[0], 0);
|
||||
fillbitmap(sprite_goal_collision_bitmap1, 0, 0);
|
||||
fillbitmap(sprite_goal_collision_bitmap2, 0, 0);
|
||||
|
||||
drawgfx(sprite_goal_collision_bitmap1,machine->gfx[0],
|
||||
code1,0,
|
||||
@ -503,17 +503,17 @@ static int check_sprite_right_goal_collision(running_machine *machine, int x1, i
|
||||
|
||||
for (x = x1; x < x1 + SPRITE_WIDTH; x++)
|
||||
for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
|
||||
if ((*BITMAP_ADDR16(sprite_goal_collision_bitmap1, y, x) == machine->pens[1]))
|
||||
if ((*BITMAP_ADDR16(sprite_goal_collision_bitmap1, y, x) == 1))
|
||||
{
|
||||
pen_t pix = *BITMAP_ADDR16(sprite_goal_collision_bitmap2, y, x);
|
||||
|
||||
if (pix == machine->pens[RIGHT_GOAL_PEN])
|
||||
if (pix == RIGHT_GOAL_PEN)
|
||||
{
|
||||
collided = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!goalpost_only && (pix == machine->pens[RIGHT_SCORE_PEN]))
|
||||
if (!goalpost_only && (pix == RIGHT_SCORE_PEN))
|
||||
{
|
||||
collided = 2;
|
||||
break;
|
||||
@ -543,7 +543,7 @@ static int check_sprite_border_collision(running_machine *machine, UINT8 x1, UIN
|
||||
|
||||
for (x = 0; x < SPRITE_WIDTH; x++)
|
||||
for (y = 0; y < SPRITE_HEIGHT; y++)
|
||||
if ((*BITMAP_ADDR16(sprite_border_collision_bitmap, y, x) == machine->pens[1]))
|
||||
if ((*BITMAP_ADDR16(sprite_border_collision_bitmap, y, x) == 1))
|
||||
{
|
||||
if (((UINT8)(x1 + x) == LEFT_BORDER) ||
|
||||
((UINT8)(x1 + x) == RIGHT_BORDER))
|
||||
|
@ -58,6 +58,7 @@ UINT16 *cave_vram_0, *cave_vctrl_0;
|
||||
UINT16 *cave_vram_1, *cave_vctrl_1;
|
||||
UINT16 *cave_vram_2, *cave_vctrl_2;
|
||||
UINT16 *cave_vram_3, *cave_vctrl_3;
|
||||
size_t cave_paletteram_size;
|
||||
|
||||
/* Variables only used here: */
|
||||
|
||||
@ -87,7 +88,7 @@ struct sprite_cave {
|
||||
const UINT8 *pen_data; /* points to top left corner of tile data */
|
||||
int line_offset;
|
||||
|
||||
const pen_t *pal_data;
|
||||
pen_t base_pen;
|
||||
int tile_width, tile_height;
|
||||
int total_width, total_height; /* in screen coordinates */
|
||||
int x, y, xcount0, ycount0;
|
||||
@ -233,18 +234,20 @@ PALETTE_INIT( korokoro )
|
||||
}
|
||||
|
||||
|
||||
static void set_pens(colortable_t *colortable)
|
||||
static void set_pens(running_machine *machine)
|
||||
{
|
||||
offs_t i;
|
||||
int palette_size = colortable_palette_get_size(colortable);
|
||||
|
||||
for (i = 0; i < palette_size; i++)
|
||||
for (i = 0; i < cave_paletteram_size / 2; i++)
|
||||
{
|
||||
UINT16 data = paletteram16[i];
|
||||
|
||||
rgb_t color = MAKE_RGB(pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
|
||||
|
||||
colortable_palette_set_color(colortable, i, color);
|
||||
if (machine->colortable != NULL)
|
||||
colortable_palette_set_color(machine->colortable, i, color);
|
||||
else
|
||||
palette_set_color(machine, i, color);
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,7 +554,7 @@ static void get_sprite_info_cave(running_machine *machine)
|
||||
{
|
||||
const int region = REGION_GFX1;
|
||||
|
||||
const pen_t *base_pal = machine->pens + 0;
|
||||
pen_t base_pal = 0;
|
||||
const UINT8 *base_gfx = memory_region(region);
|
||||
int code_max = memory_region_length(region) / (16*16);
|
||||
|
||||
@ -652,7 +655,7 @@ static void get_sprite_info_cave(running_machine *machine)
|
||||
sprite->priority = (attr & 0x0030) >> 4;
|
||||
sprite->flags = SPRITE_VISIBLE_CAVE;
|
||||
sprite->line_offset = sprite->tile_width;
|
||||
sprite->pal_data = base_pal + (attr & 0x3f00); // first 0x4000 colors
|
||||
sprite->base_pen = base_pal + (attr & 0x3f00); // first 0x4000 colors
|
||||
|
||||
if (glob_flipx) { x = max_x - x - sprite->total_width; flipx = !flipx; }
|
||||
if (glob_flipy) { y = max_y - y - sprite->total_height; flipy = !flipy; }
|
||||
@ -672,7 +675,7 @@ static void get_sprite_info_donpachi(running_machine *machine)
|
||||
{
|
||||
const int region = REGION_GFX1;
|
||||
|
||||
const pen_t *base_pal = machine->pens + 0;
|
||||
pen_t base_pal = 0;
|
||||
const UINT8 *base_gfx = memory_region(region);
|
||||
int code_max = memory_region_length(region) / (16*16);
|
||||
|
||||
@ -722,12 +725,12 @@ static void get_sprite_info_donpachi(running_machine *machine)
|
||||
if (cave_spritetype == 3) /* pwrinst2 */
|
||||
{
|
||||
sprite->priority = ((attr & 0x0010) >> 4)+2;
|
||||
sprite->pal_data = base_pal + (attr & 0x3f00) + 0x4000*((attr & 0x0020) >> 5);
|
||||
sprite->base_pen = base_pal + (attr & 0x3f00) + 0x4000*((attr & 0x0020) >> 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->priority = (attr & 0x0030) >> 4;
|
||||
sprite->pal_data = base_pal + (attr & 0x3f00); // first 0x4000 colors
|
||||
sprite->base_pen = base_pal + (attr & 0x3f00); // first 0x4000 colors
|
||||
}
|
||||
|
||||
sprite->flags = SPRITE_VISIBLE_CAVE;
|
||||
@ -910,7 +913,7 @@ static void do_blit_zoom16_cave( const struct sprite_cave *sprite ){
|
||||
|
||||
{
|
||||
const UINT8 *pen_data = sprite->pen_data -1 -sprite->line_offset;
|
||||
const pen_t *pal_data = sprite->pal_data;
|
||||
pen_t base_pen = sprite->base_pen;
|
||||
int x,y;
|
||||
UINT8 pen;
|
||||
int pitch = blit.line_offset*dy/2;
|
||||
@ -931,7 +934,7 @@ static void do_blit_zoom16_cave( const struct sprite_cave *sprite ){
|
||||
source+=xcount>>16;
|
||||
xcount &= 0xffff;
|
||||
pen = *source;
|
||||
if (pen) dest[x] = pal_data[pen];
|
||||
if (pen) dest[x] = base_pen + pen;
|
||||
}
|
||||
xcount += sprite->zoomx_re;
|
||||
}
|
||||
@ -1002,7 +1005,7 @@ static void do_blit_zoom16_cave_zb( const struct sprite_cave *sprite ){
|
||||
|
||||
{
|
||||
const UINT8 *pen_data = sprite->pen_data -1 -sprite->line_offset;
|
||||
const pen_t *pal_data = sprite->pal_data;
|
||||
pen_t base_pen = sprite->base_pen;
|
||||
int x,y;
|
||||
UINT8 pen;
|
||||
int pitch = blit.line_offset*dy/2;
|
||||
@ -1027,7 +1030,7 @@ static void do_blit_zoom16_cave_zb( const struct sprite_cave *sprite ){
|
||||
xcount &= 0xffff;
|
||||
pen = *source;
|
||||
if (pen && (zbf[x]<=pri_sp)){
|
||||
dest[x] = pal_data[pen];
|
||||
dest[x] = base_pen + pen;
|
||||
zbf[x] = pri_sp;
|
||||
}
|
||||
}
|
||||
@ -1096,7 +1099,7 @@ static void do_blit_16_cave( const struct sprite_cave *sprite ){
|
||||
|
||||
{
|
||||
const UINT8 *pen_data = sprite->pen_data;
|
||||
const pen_t *pal_data = sprite->pal_data;
|
||||
pen_t base_pen = sprite->base_pen;
|
||||
int x,y;
|
||||
UINT8 pen;
|
||||
int pitch = blit.line_offset*dy/2;
|
||||
@ -1108,7 +1111,7 @@ static void do_blit_16_cave( const struct sprite_cave *sprite ){
|
||||
source = pen_data;
|
||||
for( x=x1; x!=x2; x+=dx ){
|
||||
pen = *source;
|
||||
if (pen) dest[x] = pal_data[pen];
|
||||
if (pen) dest[x] = base_pen + pen;
|
||||
source++;
|
||||
}
|
||||
pen_data += sprite->line_offset;
|
||||
@ -1173,7 +1176,7 @@ static void do_blit_16_cave_zb( const struct sprite_cave *sprite ){
|
||||
|
||||
{
|
||||
const UINT8 *pen_data = sprite->pen_data;
|
||||
const pen_t *pal_data = sprite->pal_data;
|
||||
pen_t base_pen = sprite->base_pen;
|
||||
int x,y;
|
||||
UINT8 pen;
|
||||
int pitch = blit.line_offset*dy/2;
|
||||
@ -1190,7 +1193,7 @@ static void do_blit_16_cave_zb( const struct sprite_cave *sprite ){
|
||||
pen = *source;
|
||||
if ( pen && (zbf[x]<=pri_sp))
|
||||
{
|
||||
dest[x] = pal_data[pen];
|
||||
dest[x] = base_pen + pen;
|
||||
zbf[x] = pri_sp;
|
||||
}
|
||||
source++;
|
||||
@ -1436,7 +1439,7 @@ VIDEO_UPDATE( cave )
|
||||
int pri, pri2;
|
||||
int layers_ctrl = -1;
|
||||
|
||||
set_pens(machine->colortable);
|
||||
set_pens(machine);
|
||||
|
||||
blit.baseaddr = bitmap->base;
|
||||
blit.line_offset = bitmap->rowpixels * bitmap->bpp / 8;
|
||||
|
@ -664,7 +664,7 @@ PALETTE_INIT( usclssic )
|
||||
}
|
||||
|
||||
|
||||
static void set_pens_no_colortable(running_machine *machine)
|
||||
static void set_pens(running_machine *machine)
|
||||
{
|
||||
offs_t i;
|
||||
|
||||
@ -674,23 +674,10 @@ static void set_pens_no_colortable(running_machine *machine)
|
||||
|
||||
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
|
||||
|
||||
palette_set_color(machine, i, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void set_pens_colortable(colortable_t *colortable)
|
||||
{
|
||||
offs_t i;
|
||||
int palette_size = colortable_palette_get_size(colortable);
|
||||
|
||||
for (i = 0; i < palette_size; i++)
|
||||
{
|
||||
UINT16 data = paletteram16[i];
|
||||
|
||||
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
|
||||
|
||||
colortable_palette_set_color(colortable, i, color);
|
||||
if (machine->colortable != NULL)
|
||||
colortable_palette_set_color(machine->colortable, i, color);
|
||||
else
|
||||
palette_set_color(machine, i, color);
|
||||
}
|
||||
}
|
||||
|
||||
@ -900,8 +887,8 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec
|
||||
/* For games without tilemaps */
|
||||
VIDEO_UPDATE( seta_no_layers )
|
||||
{
|
||||
set_pens_no_colortable(machine);
|
||||
fillbitmap(bitmap,machine->pens[0x1f0],cliprect);
|
||||
set_pens(machine);
|
||||
fillbitmap(bitmap,0x1f0,cliprect);
|
||||
draw_sprites(machine,bitmap,cliprect);
|
||||
return 0;
|
||||
}
|
||||
@ -990,7 +977,7 @@ if (input_code_pressed(KEYCODE_Z))
|
||||
}
|
||||
#endif
|
||||
|
||||
fillbitmap(bitmap,machine->pens[0],cliprect);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
|
||||
if (order & 1) // swap the layers?
|
||||
{
|
||||
@ -1045,7 +1032,7 @@ if (input_code_pressed(KEYCODE_Z))
|
||||
|
||||
VIDEO_UPDATE( seta )
|
||||
{
|
||||
set_pens_colortable(machine->colortable);
|
||||
set_pens(machine);
|
||||
return VIDEO_UPDATE_CALL(seta_layers);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user