Fix a minor bug for B/W palette.

Signed-off-by: Ricky Zhang <rickyzhang@gmail.com>
This commit is contained in:
Ricky Zhang 2020-07-04 16:47:58 -04:00
parent bae7a4d16b
commit 2595059146
No known key found for this signature in database
GPG Key ID: 681AFAEF6CDEDB4C
1 changed files with 2 additions and 6 deletions

View File

@ -983,15 +983,11 @@ void driver_base::init()
// manually set palette for 24bit ROM
// 24 bit ROM Macintosh is BW screen. It doesn't setup palette by the ROM.
if (TwentyFourBitAddressing && !sdl_palette) {
const int nColor = 255;
const int nColor = 256;
sdl_palette = SDL_AllocPalette(nColor);
SDL_Color *p = sdl_palette->colors;
for (int i = 0; i < nColor; i++) {
if (0 == i %2) {
p->r = 0; p->g = 0; p->b = 0;
} else {
p->r = 255; p->g = 255; p->b = 255;
}
p->r = p->g = p->b = i;
p++;
}
update_palette();