Skip to content

Commit

Permalink
Merge pull request #171 from dshadoff/fix_sgx_priority
Browse files Browse the repository at this point in the history
Fix sgx priority (issue #167 )

The overscan area is not displaying properly for SGX; it should display sprite color 0 (i.e. palette entry 256), but it appears to be displaying character color 0 (palette entry zero).
  • Loading branch information
pceDev16 authored Oct 18, 2024
2 parents dad7307 + 0dad95b commit 052f3c5
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions mednafen/src/pce/vce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,21 +415,43 @@ INLINE void VCE::SyncSub(int32 clocks)
/* Dai MakaiMura uses setting 1, and expects VDC #2 sprites in front of VDC #1 background, but
behind VDC #1's sprites.
*/
switch(pb >> 2)
switch(pb & 3)
{
case 1:
if((vdc2_pixel & 0x100) && !(vdc1_pixel & 0x100) && (vdc2_pixel & 0xF))
vdc1_pixel = 0; //amask;
break;
case 2:
if((vdc1_pixel & 0x100) && !(vdc2_pixel & 0x100) && (vdc2_pixel & 0xF))
vdc1_pixel = 0; //|= amask;
break;
case 0:
vdc1_pixel = 0;
vdc2_pixel = 0;
break;

case 1:
vdc2_pixel = 0;
break;

case 2:
vdc1_pixel = 0;
break;

default:
switch(pb >> 2)
{
case 1:
if((vdc2_pixel & 0x100) && !(vdc1_pixel & 0x100) && (vdc2_pixel & 0xF))
vdc1_pixel = 0; //amask;
break;
case 2:
if((vdc1_pixel & 0x100) && !(vdc2_pixel & 0x100) && (vdc2_pixel & 0xF))
vdc1_pixel = 0; //|= amask;
break;
}
}
if ( (pixel_buffer[0][i] & VDC_BOUND_BOX_MASK) || (pixel_buffer[1][i] & VDC_BOUND_BOX_MASK) )
pix = boundbox_color; // magenta bound box
else
pix = color_table_cache[((vdc1_pixel & 0xF) ? vdc1_pixel : vdc2_pixel) & 0x1FF];
{
if ((vdc1_pixel & 0x0f) != 0)
pix = color_table_cache[vdc1_pixel & 0x1FF];
else
pix = color_table_cache[((vdc2_pixel & 0x1FF) ? vdc2_pixel : vdc1_pixel) & 0x1FF];
}

if(TA_AwesomeMode)
{
Expand Down

0 comments on commit 052f3c5

Please sign in to comment.