diff --git a/BasiliskII/src/SDL/video_sdl2.cpp b/BasiliskII/src/SDL/video_sdl2.cpp index 578b3518..0a5f69b4 100644 --- a/BasiliskII/src/SDL/video_sdl2.cpp +++ b/BasiliskII/src/SDL/video_sdl2.cpp @@ -343,7 +343,7 @@ public: // Called by the video driver to set the color palette (in indexed modes) virtual void set_palette(uint8 *pal, int num) = 0; - // Called by the video driver to set the gamma table (in direct modes) + // Called by the video driver to set the gamma table virtual void set_gamma(uint8 *gamma, int num) = 0; }; diff --git a/BasiliskII/src/include/video.h b/BasiliskII/src/include/video.h index 208881ba..fe4404ef 100644 --- a/BasiliskII/src/include/video.h +++ b/BasiliskII/src/include/video.h @@ -205,8 +205,8 @@ private: // Set palette to 50% gray void set_gray_palette(void); - // Load gamma-corrected black-to-white ramp to palette for direct-color mode - void load_ramp_palette(void); + // Load gamma-corrected black-to-white ramp + void load_gamma_ramp(void); // Allocate gamma table of specified size bool allocate_gamma_table(int size); @@ -250,8 +250,10 @@ public: virtual void switch_to_current_mode(void) = 0; // Called by the video driver to set the color palette (in indexed modes) - // or the gamma table (in direct modes) virtual void set_palette(uint8 *pal, int num) = 0; + + // Called by the video driver to set the gamma table + virtual void set_gamma(uint8 *gamma, int num) = 0; }; // Vector of pointers to available monitor descriptions, filled by VideoInit() diff --git a/BasiliskII/src/video.cpp b/BasiliskII/src/video.cpp index 3b46864e..bd78fdbd 100644 --- a/BasiliskII/src/video.cpp +++ b/BasiliskII/src/video.cpp @@ -235,10 +235,10 @@ void monitor_desc::set_gray_palette(void) /* - * Load gamma-corrected black-to-white ramp to palette for direct-color mode + * Load gamma-corrected black-to-white ramp */ -void monitor_desc::load_ramp_palette(void) +void monitor_desc::load_gamma_ramp(void) { // Find tables for gamma correction uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL; @@ -273,7 +273,7 @@ void monitor_desc::load_ramp_palette(void) *p++ = blue; } - set_palette(palette, num); + set_gamma(palette, num); } @@ -354,8 +354,7 @@ int16 monitor_desc::set_gamma_table(uint32 user_table) Mac2Mac_memcpy(gamma_table, user_table, size); } - if (IsDirectMode(*current_mode)) - load_ramp_palette(); + load_gamma_ramp(); return noErr; } @@ -636,8 +635,7 @@ int16 monitor_desc::driver_control(uint16 code, uint32 param, uint32 dce) pat = ~pat; } - if (IsDirectMode(*current_mode)) - load_ramp_palette(); + load_gamma_ramp(); return noErr; }