From 46fa9f1849f64fb4e4353f1fec3e65b558f4a540 Mon Sep 17 00:00:00 2001 From: ekeeke31 Date: Fri, 13 Nov 2009 12:15:51 +0000 Subject: [PATCH] fixed overscan color in shadow/highlight mode (always use half intensity) removed useless color updates (entry 0 of each palette is never displayed) --- source/render.c | 7 ++----- source/vdp.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/source/render.c b/source/render.c index 069a85e..e43caee 100644 --- a/source/render.c +++ b/source/render.c @@ -1838,14 +1838,11 @@ void render_line(uint32 line, uint32 overscan) } } - /* Mode 4 feature only (unemulated, no games rely on this) */ - /*if(!(reg[1] & 0x04) && (reg[0] & 0x20)) memset(&lb[0x20], 0x40, 0x08);*/ - /* borders */ if (x_offset) { - memset(&lb[0x20 - x_offset], 0x40, x_offset); - memset(&lb[0x20 + width], 0x40, x_offset); + memset(&lb[0x20 - x_offset], 0x00, x_offset); + memset(&lb[0x20 + width], 0x00, x_offset); width += 2 * x_offset; } } diff --git a/source/vdp.c b/source/vdp.c index 4cf7202..8a20472 100644 --- a/source/vdp.c +++ b/source/vdp.c @@ -669,8 +669,15 @@ static inline void data_w(unsigned int data) { int index = (addr >> 1) & 0x3F; *p = data; - if (index) color_update (index, *p); - if (border == index) color_update (0x00, *p); + + /* update color palette */ + /* color entry 0 of each palette is never displayed (transparent pixel) */ + if (index & 0x0F) + color_update(index, *p); + + /* update background color */ + if (border == index) + color_update (0x00, *p); /* CRAM modified during HBLANK */ if (!(status & 8) && (reg[1]&0x40) && (count_m68k <= (line_m68k + 84)))