various device_gfx_interface devices: cleanups and update or removal of obsolete comments (nw)

This commit is contained in:
Alex W. Jackson 2014-08-22 22:55:53 +00:00
parent 88b8d23da8
commit a64c343843
10 changed files with 57 additions and 62 deletions

View File

@ -677,9 +677,8 @@ void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bit
if (sp.use_sprite_buffer) source = sp.vram16_buffer;
else source = m_spriteram;
gfx_element *spritegfx = gfx(1);
int total_elements = spritegfx->elements();
int total_colors = spritegfx->colors();
int total_elements = m_gfx[1]->elements();
int total_colors = m_gfx[1]->colors();
int old_x = (-(sp.scrollx)) & 0x1ff;
int old_y = (-(sp.scrolly)) & 0x1ff;
@ -780,10 +779,10 @@ void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bit
*/
sprite %= total_elements;
color %= total_colors;
const pen_t *paldata = &palette()->pen(color * 16);
const pen_t *paldata = &m_palette->pen(color * 16);
{
int yy, xx;
const UINT8* srcdata = spritegfx->get_data(sprite);
const UINT8* srcdata = m_gfx[1]->get_data(sprite);
int count = 0;
int ystart, yend, yinc;
int xstart, xend, xinc;

View File

@ -157,7 +157,7 @@ void k051316_device::device_start()
}
decode_gfx();
gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
m_tmap = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k051316_device::get_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_ram.resize_and_clear(0x800);

View File

@ -68,7 +68,7 @@ public:
void zoom_draw(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,int flags,UINT32 priority);
void wraparound_enable(int status);
void mark_gfx_dirty(offs_t byteoffset) { gfx(0)->mark_dirty(byteoffset * m_pixels_per_byte / (16 * 16)); }
void mark_gfx_dirty(offs_t byteoffset) { m_gfx[0]->mark_dirty(byteoffset * m_pixels_per_byte / (16 * 16)); }
void mark_tmap_dirty() { m_tmap->mark_all_dirty(); }
protected:

View File

@ -2,7 +2,7 @@
Konami 051960/051937
-------------
Sprite generators. Designed to work in pair. The 051960 manages the sprite
list and produces and address that is fed to the gfx ROMs. The data from the
list and produces an address that is fed to the gfx ROMs. The data from the
ROMs is sent to the 051937, along with color code and other stuff from the
051960. The 051937 outputs up to 12 bits of palette index, plus "shadow" and
transparency information.
@ -16,7 +16,7 @@ bus to the ROMs). However, the addressing space can be increased by using one
or more of the "color attribute" bits of the sprites as bank selectors.
Moreover a few games store the gfx data in the ROMs in a format different from
the one expected by the 051960, and use external logic to reorder the address
lines.
and/or data lines.
The 051960 can also genenrate IRQ, FIRQ and NMI signals.
memory map:
@ -75,6 +75,9 @@ const gfx_layout k051960_device::spritelayout =
128*8
};
// cuebrick, mia and tmnt connect the lower four output lines from the K051937
// (i.e. the ones outputting ROM data rather than attribute data) to the mixer
// in reverse order.
const gfx_layout k051960_device::spritelayout_reverse =
{
16,16,
@ -88,6 +91,11 @@ const gfx_layout k051960_device::spritelayout_reverse =
128*8
};
// In gradius3, the gfx ROMs are directly connected to one of the 68K CPUs
// rather than being read the usual way; moreover, the ROM data lines are
// connected in different ways to the 68K and to the K051937.
// Rather than copy the ROM region and bitswap one copy, we (currently)
// just use an alternate gfx layout for this game.
const gfx_layout k051960_device::spritelayout_gradius3 =
{
16,16,
@ -160,9 +168,9 @@ void k051960_device::device_start()
m_sprite_size = region()->bytes();
decode_gfx();
gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
if (VERBOSE && !(palette()->shadows_enabled()))
if (VERBOSE && !(m_palette->shadows_enabled()))
popmessage("driver should use VIDEO_HAS_SHADOWS");
m_ram = auto_alloc_array_clear(machine(), UINT8, 0x400);
@ -455,7 +463,7 @@ void k051960_device::k051960_sprites_draw( bitmap_ind16 &bitmap, const rectangle
flipy = !flipy;
}
drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
drawmode_table[m_gfx[0]->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
if (zoomx == 0x10000 && zoomy == 0x10000)
{
@ -481,14 +489,14 @@ void k051960_device::k051960_sprites_draw( bitmap_ind16 &bitmap, const rectangle
c += yoffset[y];
if (max_priority == -1)
gfx(0)->prio_transtable(bitmap,cliprect,
m_gfx[0]->prio_transtable(bitmap,cliprect,
c,color,
flipx,flipy,
sx & 0x1ff,sy,
priority_bitmap,pri,
drawmode_table);
else
gfx(0)->transtable(bitmap,cliprect,
m_gfx[0]->transtable(bitmap,cliprect,
c,color,
flipx,flipy,
sx & 0x1ff,sy,
@ -522,7 +530,7 @@ void k051960_device::k051960_sprites_draw( bitmap_ind16 &bitmap, const rectangle
c += yoffset[y];
if (max_priority == -1)
gfx(0)->prio_zoom_transtable(bitmap,cliprect,
m_gfx[0]->prio_zoom_transtable(bitmap,cliprect,
c,color,
flipx,flipy,
sx & 0x1ff,sy,
@ -530,7 +538,7 @@ void k051960_device::k051960_sprites_draw( bitmap_ind16 &bitmap, const rectangle
priority_bitmap,pri,
drawmode_table);
else
gfx(0)->zoom_transtable(bitmap,cliprect,
m_gfx[0]->zoom_transtable(bitmap,cliprect,
c,color,
flipx,flipy,
sx & 0x1ff,sy,

View File

@ -207,7 +207,7 @@ void k052109_device::device_start()
}
decode_gfx();
gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
m_ram = auto_alloc_array_clear(machine(), UINT8, 0x6000);

View File

@ -26,19 +26,7 @@ public:
static void set_k052109_callback(device_t &device, k052109_cb_delegate callback) { downcast<k052109_device &>(device).m_k052109_cb = callback; }
static void set_ram(device_t &device, bool ram);
// static configuration
static void static_set_gfxdecode_tag(device_t &device, const char *tag);
static void static_set_palette_tag(device_t &device, const char *tag);
/*
You don't have to decode the graphics: the vh_start() routines will do that
for you, using the plane order passed.
Of course the ROM data must be in the correct order. This is a way to ensure
that the ROM test will pass.
The konami_rom_deinterleave() function in konami_helper.h will do the reorganization for
you in most cases (but see tmnt.c for additional bit rotations or byte
permutations which may be required).
The callback is passed:
- layer number (0 = FIX, 1 = A, 2 = B)
- bank (range 0-3, output of the pins CAB1 and CAB2)

View File

@ -121,9 +121,9 @@ void k05324x_device::device_start()
/* decode the graphics */
decode_gfx();
gfx(0)->set_colors(palette()->entries() / gfx(0)->depth());
m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth());
if (VERBOSE && !(palette()->shadows_enabled()))
if (VERBOSE && !(m_palette->shadows_enabled()))
popmessage("driver should use VIDEO_HAS_SHADOWS");
m_ramsize = 0x800;
@ -456,7 +456,7 @@ void k05324x_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre
ox -= (zoomx * w) >> 13;
oy -= (zoomy * h) >> 13;
drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
drawmode_table[m_gfx[0]->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
for (y = 0; y < h; y++)
{
@ -520,7 +520,7 @@ void k05324x_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre
if (zoomx == 0x10000 && zoomy == 0x10000)
{
gfx(0)->prio_transtable(bitmap,cliprect,
m_gfx[0]->prio_transtable(bitmap,cliprect,
c,color,
fx,fy,
sx,sy,
@ -529,7 +529,7 @@ void k05324x_device::sprites_draw( bitmap_ind16 &bitmap, const rectangle &clipre
}
else
{
gfx(0)->prio_zoom_transtable(bitmap,cliprect,
m_gfx[0]->prio_zoom_transtable(bitmap,cliprect,
c,color,
fx,fy,
sx,sy,

View File

@ -3,7 +3,7 @@
const device_type K053250 = &device_creator<k053250_device>;
k053250_device::k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K053250, "K053250 Road Generator", tag, owner, clock, "k053250", __FILE__),
: device_t(mconfig, K053250, "K053250 LVC", tag, owner, clock, "k053250", __FILE__),
device_gfx_interface(mconfig, *this),
device_video_interface(mconfig, *this)
{
@ -351,7 +351,7 @@ void k053250_device::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int
linedata_offs += line_start * linedata_adv; // pre-advance line info offset for the clipped region
// load physical palette base
pal_base = palette()->pens() + (colorbase << 4) % palette()->entries();
pal_base = m_palette->pens() + (colorbase << 4) % m_palette->entries();
// walk the target bitmap within the visible area vertically or horizontally, one line at a time
for (line_pos=line_start; line_pos <= line_end; linedata_offs += linedata_adv, line_pos++)

View File

@ -83,7 +83,7 @@ void toaplan_scu_device::draw_sprites_to_tempbitmap(const rectangle &cliprect, U
if (flipx) sx -= m_xoffs_flipped;
flipy = attribute & 0x200;
gfx(0)->transpen_raw(m_temp_spritebitmap,cliprect,
m_gfx[0]->transpen_raw(m_temp_spritebitmap,cliprect,
sprite,
color << 4 /* << 4 because using _raw */ ,
flipx,flipy,
@ -101,7 +101,7 @@ void toaplan_scu_device::draw_sprites_to_tempbitmap(const rectangle &cliprect, U
void toaplan_scu_device::copy_sprites_from_tempbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority)
{
int y, x;
int colourbase = gfx(0)->colorbase();
int colourbase = m_gfx[0]->colorbase();
for (y=cliprect.min_y;y<=cliprect.max_y;y++)
{

View File

@ -909,23 +909,23 @@ WRITE16_MEMBER( sega_segacd_device::scd_a12006_hint_register_w )
void sega_segacd_device::segacd_mark_tiles_dirty(int offset)
{
gfx(0)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(1)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(2)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(3)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(4)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(5)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(6)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(7)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[0]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[1]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[2]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[3]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[4]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[5]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[6]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
m_gfx[7]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16));
gfx(8)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(9)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(10)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(11)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(12)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(13)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(14)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
gfx(15)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[8]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[9]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[10]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[11]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[12]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[13]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[14]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
m_gfx[15]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32));
}
@ -1060,11 +1060,11 @@ inline UINT8 sega_segacd_device::get_stampmap_16x16_1x1_tile_info_pixel(int xpos
int tile_region, tileno;
SCD_GET_TILE_INFO_16x16_1x1(tile_region,tileno,(int)tile_index);
tileno %= gfx(tile_region)->elements();
tileno %= m_gfx[tile_region]->elements();
if (tileno==0) return 0x00;
const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
@ -1098,11 +1098,11 @@ inline UINT8 sega_segacd_device::get_stampmap_32x32_1x1_tile_info_pixel(int xpos
int tile_region, tileno;
SCD_GET_TILE_INFO_32x32_1x1(tile_region,tileno,(int)tile_index);
tileno %= gfx(tile_region)->elements();
tileno %= m_gfx[tile_region]->elements();
if (tileno==0) return 0x00; // does this apply in this mode?
const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
@ -1136,11 +1136,11 @@ inline UINT8 sega_segacd_device::get_stampmap_16x16_16x16_tile_info_pixel(int xp
int tile_region, tileno;
SCD_GET_TILE_INFO_16x16_16x16(tile_region,tileno,(int)tile_index);
tileno %= gfx(tile_region)->elements();
tileno %= m_gfx[tile_region]->elements();
if (tileno==0) return 0x00; // does this apply in this mode
const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
@ -1174,11 +1174,11 @@ inline UINT8 sega_segacd_device::get_stampmap_32x32_16x16_tile_info_pixel(int xp
int tile_region, tileno;
SCD_GET_TILE_INFO_32x32_16x16(tile_region,tileno,(int)tile_index);
tileno %= gfx(tile_region)->elements();
tileno %= m_gfx[tile_region]->elements();
if (tileno==0) return 0x00;
const UINT8* srcdata = gfx(tile_region)->get_data(tileno);
const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno);
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}