From 0847626aec31d90615b087817ff92344cc6a99b2 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Sat, 8 Dec 2012 19:42:07 -0800 Subject: Fix BG plane B render bug --- render_sdl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'render_sdl.c') diff --git a/render_sdl.c b/render_sdl.c index f2f15c0..c2acef7 100644 --- a/render_sdl.c +++ b/render_sdl.c @@ -73,13 +73,21 @@ void render_context(vdp_context * context) } } for (int y = 224; y < 240; y++, buf_32 += (screen->pitch/4 - 320)) { - for (int x = 0; x < 320; x++, buf_32++) { - uint16_t gen_color = context->cram[x/10 + ((y-224)/8)*32]; + for (int x = 0; x < 256; x++, buf_32++) { + uint16_t gen_color = context->cram[x/8 + ((y-224)/8)*32]; b = ((gen_color >> 8) & 0xE) * 18; g = ((gen_color >> 4) & 0xE) * 18; r = (gen_color& 0xE) * 18; *buf_32 = SDL_MapRGB(screen->format, r, g, b); } + for (int x = 256; x < 320; x++, buf_32++) { + if ((x/8 & 1) ^ (y/8 & 1)) { + b = g = r = 255; + } else { + b = g = r = 0; + } + *buf_32 = SDL_MapRGB(screen->format, r, g, b); + } } break; } -- cgit v1.2.3