diff --git a/Components/9918/Implementation/9918.cpp b/Components/9918/Implementation/9918.cpp index ca23f1272..f67e261a6 100644 --- a/Components/9918/Implementation/9918.cpp +++ b/Components/9918/Implementation/9918.cpp @@ -827,8 +827,16 @@ void Base::commit_register(int reg, uint8_t value) { case 44: Storage::command_context_.colour = value; - Storage::command_context_.colour4bpp = uint8_t((value & 0xf) | (value << 4)); - Storage::command_context_.colour2bpp = uint8_t((value & 0x3) | ((value & 0x3) << 2) | ((value & 0x3) << 4) | ((value & 0x3) << 6)); + Storage::command_context_.colour4bpp = uint8_t( + (value & 0xf) | + (value << 4) + ); + Storage::command_context_.colour2bpp = uint8_t( + (value & 0x3) | + ((value & 0x3) << 2) | + ((value & 0x3) << 4) | + ((value & 0x3) << 6) + ); // Check whether a command was blocked on this. if(