--- BasiliskII/src/video.cpp 2001/07/04 11:12:19 1.21 +++ BasiliskII/src/video.cpp 2002/01/15 14:58:32 1.24 @@ -1,8 +1,8 @@ /* * video.cpp - Video/graphics emulation * - * Basilisk II (C) 1997-2001 Christian Bauer - * Portions (C) 1997-1999 Marc Hellwig + * Basilisk II (C) 1997-2002 Christian Bauer + * Portions written by Marc Hellwig * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,8 @@ * SEE ALSO * Inside Macintosh: Devices, chapter 1 "Device Manager" * Designing Cards and Drivers for the Macintosh Family, Second Edition + * Designing PCI Cards and Drivers for Power Macintosh Computers + * Display Device Driver Guide */ #include @@ -218,7 +220,7 @@ static void set_gray_palette(void) static void load_ramp_palette(void) { // Find tables for gamma correction - uint8 *red_gamma, *green_gamma, *blue_gamma; + uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL; bool have_gamma = false; int data_width = 0; if (VidLocal.gamma_table) { @@ -509,7 +511,7 @@ int16 VideoDriverControl(uint32 pb, uint return paramErr; // Find tables for gamma correction - uint8 *red_gamma, *green_gamma, *blue_gamma; + uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL; bool have_gamma = false; int data_width = 0; if (VidLocal.gamma_table) { @@ -860,26 +862,6 @@ int16 VideoDriverStatus(uint32 pb, uint3 WriteMacInt32(vp + vpVRes, 0x00480000); uint32 pix_type, pix_size, cmp_count, cmp_size, dev_type; switch (i->depth) { - case VDEPTH_1BIT: - pix_type = 0; pix_size = 1; - cmp_count = 1; cmp_size = 1; - dev_type = 0; // CLUT - break; - case VDEPTH_2BIT: - pix_type = 0; pix_size = 2; - cmp_count = 1; cmp_size = 2; - dev_type = 0; // CLUT - break; - case VDEPTH_4BIT: - pix_type = 0; pix_size = 4; - cmp_count = 1; cmp_size = 4; - dev_type = 0; // CLUT - break; - case VDEPTH_8BIT: - pix_type = 0; pix_size = 8; - cmp_count = 1; cmp_size = 8; - dev_type = 0; // CLUT - break; case VDEPTH_16BIT: pix_type = 0x10; pix_size = 16; cmp_count = 3; cmp_size = 5; @@ -890,6 +872,11 @@ int16 VideoDriverStatus(uint32 pb, uint3 cmp_count = 3; cmp_size = 8; dev_type = 2; // direct break; + default: + pix_type = 0; pix_size = 1 << i->depth; + cmp_count = 1; cmp_size = 1 << i->depth; + dev_type = 0; // CLUT + break; } WriteMacInt16(vp + vpPixelType, pix_type); WriteMacInt16(vp + vpPixelSize, pix_size);