comparison render_sdl.c @ 28:037963b4c92d

Fix BG plane B render bug
author Mike Pavone <pavone@retrodev.com>
date Sat, 08 Dec 2012 19:42:07 -0800
parents f664eeb55cb4
children 2e15fa26fe58
comparison
equal deleted inserted replaced
27:aa1c47fab3f1 28:037963b4c92d
71 r = (gen_color& 0xE) * 18; 71 r = (gen_color& 0xE) * 18;
72 *buf_32 = SDL_MapRGB(screen->format, r, g, b); 72 *buf_32 = SDL_MapRGB(screen->format, r, g, b);
73 } 73 }
74 } 74 }
75 for (int y = 224; y < 240; y++, buf_32 += (screen->pitch/4 - 320)) { 75 for (int y = 224; y < 240; y++, buf_32 += (screen->pitch/4 - 320)) {
76 for (int x = 0; x < 320; x++, buf_32++) { 76 for (int x = 0; x < 256; x++, buf_32++) {
77 uint16_t gen_color = context->cram[x/10 + ((y-224)/8)*32]; 77 uint16_t gen_color = context->cram[x/8 + ((y-224)/8)*32];
78 b = ((gen_color >> 8) & 0xE) * 18; 78 b = ((gen_color >> 8) & 0xE) * 18;
79 g = ((gen_color >> 4) & 0xE) * 18; 79 g = ((gen_color >> 4) & 0xE) * 18;
80 r = (gen_color& 0xE) * 18; 80 r = (gen_color& 0xE) * 18;
81 *buf_32 = SDL_MapRGB(screen->format, r, g, b);
82 }
83 for (int x = 256; x < 320; x++, buf_32++) {
84 if ((x/8 & 1) ^ (y/8 & 1)) {
85 b = g = r = 255;
86 } else {
87 b = g = r = 0;
88 }
81 *buf_32 = SDL_MapRGB(screen->format, r, g, b); 89 *buf_32 = SDL_MapRGB(screen->format, r, g, b);
82 } 90 }
83 } 91 }
84 break; 92 break;
85 } 93 }