sknsspr.cpp : Add bitmap clearing disable bit

suprnova.cpp : Make bitmap draw related to cliprect, Minor cleanup
This commit is contained in:
cam900 2018-07-15 01:08:01 +09:00 committed by Vas Crabb
parent ee679254c5
commit 9edafeb048
4 changed files with 12 additions and 21 deletions

View File

@ -194,8 +194,6 @@ uint32_t galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rg
bitmap.fill(0, cliprect);
m_sprite_bitmap.fill(0x0000, cliprect);
m_spritegen->skns_draw_sprites(m_sprite_bitmap, cliprect, m_spriteram32.get(), 0x4000, m_spc_regs.get() );
// popmessage("%02x %02x", m_grap2[0]->m_framebuffer_bright2, m_grap2[1]->m_framebuffer_bright2);

View File

@ -308,7 +308,6 @@ uint32_t jchan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
for (int chip = 0; chip < 2; chip++)
{
m_sprite_bitmap[chip]->fill(0, cliprect);
m_spritegen[chip]->skns_draw_sprites(*m_sprite_bitmap[chip], cliprect, m_sprite_ram32[chip].get(), 0x4000, m_sprite_regs32[chip].get() );
}

View File

@ -288,6 +288,8 @@ void sknsspr_device::skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cl
int sprite_flip;
int sprite_x_scroll;
int sprite_y_scroll;
/* galpani3 uses sprite trail effect (disable clearing sprite bitmap) */
int clear_bitmap = (~sprite_regs[0x04/4] & 0x04); // RWR1
int disabled = sprite_regs[0x04/4] & 0x08; // RWR1
int xsize,ysize, size, xpos=0,ypos=0, pri=0, romoffset, colour=0, xflip,yflip, joint;
int sx,sy;
@ -295,6 +297,10 @@ void sknsspr_device::skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cl
int grow;
uint16_t zoomx_m, zoomx_s, zoomy_m, zoomy_s;
if (clear_bitmap)
{
bitmap.fill(0x0000, cliprect);
}
if ((!disabled)){
group_enable = (sprite_regs[0x00/4] & 0x0040) >> 6; // RWR0

View File

@ -362,7 +362,6 @@ void skns_state::video_start()
m_gfxdecode->gfx(2)->set_granularity(256);
m_gfxdecode->gfx(3)->set_granularity(256);
save_item(NAME(m_depthA));
save_item(NAME(m_depthB));
save_item(NAME(m_use_spc_bright));
@ -404,7 +403,6 @@ void skns_state::draw_a( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const
int enable_a = (m_v3_regs[0x10/4] >> 0) & 0x0001;
int nowrap_a = (m_v3_regs[0x10/4] >> 0) & 0x0004;
uint32_t startx,starty;
int incxx,incxy,incyx,incyy;
int columnscroll;
@ -434,7 +432,6 @@ void skns_state::draw_b( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const
int enable_b = (m_v3_regs[0x34/4] >> 0) & 0x0001;
int nowrap_b = (m_v3_regs[0x34/4] >> 0) & 0x0004;
uint32_t startx,starty;
int incxx,incxy,incyx,incyy;
int columnscroll;
@ -451,11 +448,11 @@ void skns_state::draw_b( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const
incxy = m_v3_regs[0x4c/4];
incxx = m_v3_regs[0x48/4]&0x7ffff;
if (incxx&0x40000) incxx = incxx-0x80000;
columnscroll = (m_v3_regs[0x0c/4] >> 9) & 0x0001; // selects column scroll or rowscroll
draw_roz(bitmap,bitmap_flags, cliprect, m_tilemap_B, startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap_b, columnscroll, &m_v3slc_ram[0x1000/4]);
//popmessage("%08x %08x %08x %08x %08x %08x", startx, starty, incxx, incyy, incxy, incyx);
}
}
@ -493,8 +490,7 @@ uint32_t skns_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
const pen_t *clut = &m_palette->pen(0);
// int drawpri;
for (y=0;y<240;y++)
for (y=cliprect.min_y;y<=cliprect.max_y;y++)
{
src = &m_tilemap_bitmap_lower.pix16(y);
srcflags = &m_tilemap_bitmapflags_lower.pix8(y);
@ -506,8 +502,7 @@ uint32_t skns_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
dst = &bitmap.pix32(y);
for (x=0;x<320;x++)
for (x=cliprect.min_x;x<=cliprect.max_x;x++)
{
uint16_t pendata = src[x]&0x7fff;
uint16_t pendata2 = src2[x]&0x7fff;
@ -542,7 +537,7 @@ uint32_t skns_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
else
{
bgpendata = pendata2&0x7fff;
bgpri = 0;;
bgpri = 0;
}
}
else
@ -560,7 +555,7 @@ uint32_t skns_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
else
{
bgpendata = 0;
bgpri = 0;;
bgpri = 0;
}
}
@ -603,10 +598,7 @@ uint32_t skns_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
if (b>255) b = 255;
dst[x] = (r << 0) | (g << 8) | (b << 16);
}
else
{
coldat = clut[pendata3];
@ -624,17 +616,13 @@ uint32_t skns_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
coldat = clut[bgpendata];
dst[x] = coldat;
}
}
}
}
}
m_sprite_bitmap.fill(0x0000, cliprect);
if (m_alt_enable_sprites)
m_spritegen->skns_draw_sprites(m_sprite_bitmap, cliprect, m_spriteram, m_spriteram.bytes(), m_spc_regs ); // TODO : not all 0x4000 of the sprite RAM area can be displayed on real hardware
return 0;
}