diff options
author | Mike Pavone <pavone@retrodev.com> | 2012-12-08 19:42:07 -0800 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2012-12-08 19:42:07 -0800 |
commit | 0847626aec31d90615b087817ff92344cc6a99b2 (patch) | |
tree | 9023971bac3a90e16d71ed2861d6ca2952fa5c0c /render_sdl.c | |
parent | f2c1f98b9d52f71f5e382c3270c4a551f744bfb1 (diff) |
Fix BG plane B render bug
Diffstat (limited to 'render_sdl.c')
-rw-r--r-- | render_sdl.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; } |