Skip to content

Commit a9b8456

Browse files
committed
Fix VPC mixing of transparent pixels
1 parent cfaad24 commit a9b8456

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/huc6260_inline.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,15 @@ void HuC6260::RenderFrameTemplate()
186186
u16 final_pixel = 0;
187187

188188
if (vdcs_enabled == 0)
189-
final_pixel = 0;
189+
final_pixel = 0x100;
190190
else if (vdcs_enabled == 1)
191191
final_pixel = pixel_1;
192192
else if (vdcs_enabled == 2)
193193
final_pixel = pixel_2;
194194
else
195195
{
196196
bool is_pixel_1_transparent = (pixel_1 & 0x2000);
197+
bool is_pixel_2_transparent = (pixel_2 & 0x2000);
197198
bool is_vdc_1_sprite = (pixel_1 & 0x1000);
198199
bool is_vdc_2_sprite = (pixel_2 & 0x1000);
199200

@@ -203,14 +204,13 @@ void HuC6260::RenderFrameTemplate()
203204
final_pixel = is_pixel_1_transparent ? pixel_2 : pixel_1;
204205
break;
205206
case HuC6202::HuC6270_PRIORITY_SPRITES_2_ABOVE_BG_1:
206-
if (is_pixel_1_transparent || (is_vdc_2_sprite && !is_vdc_1_sprite))
207+
if (is_pixel_1_transparent || (is_vdc_2_sprite && !is_vdc_1_sprite && !is_pixel_2_transparent))
207208
final_pixel = pixel_2;
208209
else
209210
final_pixel = pixel_1;
210211
break;
211212
case HuC6202::HuC6270_PRIORITY_SPRITES_1_BELOW_BG_2:
212213
{
213-
bool is_pixel_2_transparent = (pixel_2 & 0x2000);
214214
if (is_pixel_1_transparent || (is_vdc_1_sprite && !is_vdc_2_sprite && !is_pixel_2_transparent))
215215
final_pixel = pixel_2;
216216
else

src/huc6270.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void HuC6270::RenderLine()
554554

555555
if((m_latched_cr & 0x80) == 0)
556556
for (int i = 0; i < width; i++)
557-
m_line_buffer[i] = 0;
557+
m_line_buffer[i] = 0x100;
558558

559559
if (!m_burst_mode)
560560
{

0 commit comments

Comments
 (0)