From 1d875960dbc21ff8f7ced1ee8e963d7e3eb07caf Mon Sep 17 00:00:00 2001 From: James Touton Date: Thu, 6 Aug 2015 01:31:26 -0700 Subject: [PATCH] Propagate error information from set_gamma_table. --- BasiliskII/src/include/video.h | 2 +- BasiliskII/src/video.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BasiliskII/src/include/video.h b/BasiliskII/src/include/video.h index 4459a09a..78526e67 100644 --- a/BasiliskII/src/include/video.h +++ b/BasiliskII/src/include/video.h @@ -209,7 +209,7 @@ private: bool allocate_gamma_table(int size); // Set gamma table (0 = build linear ramp) - bool set_gamma_table(uint32 user_table); + int16 set_gamma_table(uint32 user_table); // Switch video mode void switch_mode(vector::const_iterator it, uint32 param, uint32 dce); diff --git a/BasiliskII/src/video.cpp b/BasiliskII/src/video.cpp index 8204c40e..8f84f48d 100644 --- a/BasiliskII/src/video.cpp +++ b/BasiliskII/src/video.cpp @@ -290,7 +290,7 @@ bool monitor_desc::allocate_gamma_table(int size) * Set gamma table (0 = build linear ramp) */ -bool monitor_desc::set_gamma_table(uint32 user_table) +int16 monitor_desc::set_gamma_table(uint32 user_table) { if (user_table == 0) { // Build linear ramp, 256 entries @@ -340,7 +340,7 @@ bool monitor_desc::set_gamma_table(uint32 user_table) if (IsDirectMode(*current_mode)) load_ramp_palette(); - return true; + return noErr; } @@ -590,7 +590,7 @@ int16 monitor_desc::driver_control(uint16 code, uint32 param, uint32 dce) case cscSetGamma: { // Set gamma table uint32 user_table = ReadMacInt32(param + csGTable); D(bug(" SetGamma %08x\n", user_table)); - return set_gamma_table(user_table) ? noErr : memFullErr; + return set_gamma_table(user_table); } case cscGrayPage: { // Fill page with dithered gray pattern @@ -627,7 +627,7 @@ int16 monitor_desc::driver_control(uint16 code, uint32 param, uint32 dce) case cscSetGray: // Enable/disable luminance mapping D(bug(" SetGray %02x\n", ReadMacInt8(param + csMode))); - luminance_mapping = ReadMacInt8(param + csMode); + luminance_mapping = ReadMacInt8(param + csMode) != 0; return noErr; case cscSetInterrupt: // Enable/disable VBL