mirror of
https://github.com/holub/mame
synced 2025-10-07 09:25:34 +03:00
stvvdp1.cpp: fix color calculations for non-mode 5 sprites (i.e. Virtual Hydlide avatar shadow) [Angelo Salese]
This commit is contained in:
parent
42639f4ef8
commit
bda2c9e861
@ -897,7 +897,8 @@ void saturn_state::drawpixel_4bpp_trans(int x, int y, int patterndata, int offse
|
|||||||
|
|
||||||
void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcnt)
|
void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcnt)
|
||||||
{
|
{
|
||||||
int pix,mode,transmask, spd = stv2_current_sprite.CMDPMOD & 0x40;
|
int pix,transmask, spd = stv2_current_sprite.CMDPMOD & 0x40;
|
||||||
|
// int mode;
|
||||||
int mesh = stv2_current_sprite.CMDPMOD & 0x100;
|
int mesh = stv2_current_sprite.CMDPMOD & 0x100;
|
||||||
int pix2;
|
int pix2;
|
||||||
|
|
||||||
@ -914,6 +915,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
pix = stv2_current_sprite.CMDCOLR&0xffff;
|
pix = stv2_current_sprite.CMDCOLR&0xffff;
|
||||||
|
|
||||||
transmask = 0xffff;
|
transmask = 0xffff;
|
||||||
|
#if 0
|
||||||
if ( pix & 0x8000 )
|
if ( pix & 0x8000 )
|
||||||
{
|
{
|
||||||
mode = 5;
|
mode = 5;
|
||||||
@ -922,6 +924,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
{
|
{
|
||||||
mode = 1;
|
mode = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -932,7 +935,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt/2) & 0xfffff];
|
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt/2) & 0xfffff];
|
||||||
pix = offsetcnt&1 ? (pix & 0x0f) : ((pix & 0xf0)>>4);
|
pix = offsetcnt&1 ? (pix & 0x0f) : ((pix & 0xf0)>>4);
|
||||||
pix = pix+((stv2_current_sprite.CMDCOLR&0xfff0));
|
pix = pix+((stv2_current_sprite.CMDCOLR&0xfff0));
|
||||||
mode = 0;
|
//mode = 0;
|
||||||
transmask = 0xf;
|
transmask = 0xf;
|
||||||
break;
|
break;
|
||||||
case 0x0008: // mode 1 16 colour lookup table mode (4bits)
|
case 0x0008: // mode 1 16 colour lookup table mode (4bits)
|
||||||
@ -943,7 +946,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
((((m_vdp1_vram[(((stv2_current_sprite.CMDCOLR&0xffff)*8)>>2)+((pix2&0xfffe)/2)])) & 0x0000ffff) >> 0):
|
((((m_vdp1_vram[(((stv2_current_sprite.CMDCOLR&0xffff)*8)>>2)+((pix2&0xfffe)/2)])) & 0x0000ffff) >> 0):
|
||||||
((((m_vdp1_vram[(((stv2_current_sprite.CMDCOLR&0xffff)*8)>>2)+((pix2&0xfffe)/2)])) & 0xffff0000) >> 16);
|
((((m_vdp1_vram[(((stv2_current_sprite.CMDCOLR&0xffff)*8)>>2)+((pix2&0xfffe)/2)])) & 0xffff0000) >> 16);
|
||||||
|
|
||||||
mode = 5;
|
//mode = 5;
|
||||||
transmask = 0xffff;
|
transmask = 0xffff;
|
||||||
|
|
||||||
if ( !spd )
|
if ( !spd )
|
||||||
@ -960,7 +963,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
break;
|
break;
|
||||||
case 0x0010: // mode 2 64 colour bank mode (8bits) (character select portraits on hanagumi)
|
case 0x0010: // mode 2 64 colour bank mode (8bits) (character select portraits on hanagumi)
|
||||||
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
|
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
|
||||||
mode = 2;
|
//mode = 2;
|
||||||
pix = pix+(stv2_current_sprite.CMDCOLR&0xffc0);
|
pix = pix+(stv2_current_sprite.CMDCOLR&0xffc0);
|
||||||
transmask = 0x3f;
|
transmask = 0x3f;
|
||||||
break;
|
break;
|
||||||
@ -968,22 +971,22 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
|
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
|
||||||
pix = pix+(stv2_current_sprite.CMDCOLR&0xff80);
|
pix = pix+(stv2_current_sprite.CMDCOLR&0xff80);
|
||||||
transmask = 0x7f;
|
transmask = 0x7f;
|
||||||
mode = 3;
|
//mode = 3;
|
||||||
break;
|
break;
|
||||||
case 0x0020: // mode 4 256 colour bank mode (8bits) (hanagumi title)
|
case 0x0020: // mode 4 256 colour bank mode (8bits) (hanagumi title)
|
||||||
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
|
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt) & 0xfffff];
|
||||||
pix = pix+(stv2_current_sprite.CMDCOLR&0xff00);
|
pix = pix+(stv2_current_sprite.CMDCOLR&0xff00);
|
||||||
transmask = 0xff;
|
transmask = 0xff;
|
||||||
mode = 4;
|
//mode = 4;
|
||||||
break;
|
break;
|
||||||
case 0x0028: // mode 5 32,768 colour RGB mode (16bits)
|
case 0x0028: // mode 5 32,768 colour RGB mode (16bits)
|
||||||
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt*2+1) & 0xfffff] | (m_vdp1.gfx_decode[(patterndata+offsetcnt*2) & 0xfffff]<<8) ;
|
pix = m_vdp1.gfx_decode[(patterndata+offsetcnt*2+1) & 0xfffff] | (m_vdp1.gfx_decode[(patterndata+offsetcnt*2) & 0xfffff]<<8) ;
|
||||||
mode = 5;
|
//mode = 5;
|
||||||
transmask = -1; /* TODO: check me */
|
transmask = -1; /* TODO: check me */
|
||||||
break;
|
break;
|
||||||
default: // other settings illegal
|
default: // other settings illegal
|
||||||
pix = machine().rand();
|
pix = machine().rand();
|
||||||
mode = 0;
|
//mode = 0;
|
||||||
transmask = 0xff;
|
transmask = 0xff;
|
||||||
popmessage("Illegal Sprite Mode, contact MAMEdev");
|
popmessage("Illegal Sprite Mode, contact MAMEdev");
|
||||||
}
|
}
|
||||||
@ -998,7 +1001,9 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* MSBON */
|
/* MSBON */
|
||||||
|
// TODO: does this always applies to the frame buffer regardless of the mode?
|
||||||
pix |= stv2_current_sprite.CMDPMOD & 0x8000;
|
pix |= stv2_current_sprite.CMDPMOD & 0x8000;
|
||||||
|
#if 0
|
||||||
if ( mode != 5 )
|
if ( mode != 5 )
|
||||||
{
|
{
|
||||||
if ( (pix & transmask) || spd )
|
if ( (pix & transmask) || spd )
|
||||||
@ -1007,6 +1012,7 @@ void saturn_state::drawpixel_generic(int x, int y, int patterndata, int offsetcn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if ( (pix & transmask) || spd )
|
if ( (pix & transmask) || spd )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user