1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-25 04:29:09 +00:00

Merge pull request #1068 from TomHarte/HAM

HAM: correct red/blue confusion.
This commit is contained in:
Thomas Harte 2022-07-15 16:51:09 -04:00 committed by GitHub
commit 52c3e0592a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ template <typename Performer> struct TaskQueueStorage {
}; };
/// An implementation detail; provides a no-op implementation of time advances for TaskQueues without a Performer. /// An implementation detail; provides a no-op implementation of time advances for TaskQueues without a Performer.
template <> struct TaskQueueStorage<int> { template <> struct TaskQueueStorage<void> {
TaskQueueStorage() {} TaskQueueStorage() {}
protected: protected:
@ -65,7 +65,7 @@ template <> struct TaskQueueStorage<int> {
with the arguments supplied to TaskQueue's constructor, and that class will receive calls of the with the arguments supplied to TaskQueue's constructor, and that class will receive calls of the
form @c .perform(nanos) to update it to every batch of new actions. form @c .perform(nanos) to update it to every batch of new actions.
*/ */
template <bool perform_automatically, typename Performer = int> class TaskQueue: public TaskQueueStorage<Performer> { template <bool perform_automatically, typename Performer = void> class TaskQueue: public TaskQueueStorage<Performer> {
public: public:
template <typename... Args> TaskQueue(Args&&... args) : template <typename... Args> TaskQueue(Args&&... args) :
TaskQueueStorage<Performer>(std::forward<Args>(args)...), TaskQueueStorage<Performer>(std::forward<Args>(args)...),

View File

@ -102,17 +102,17 @@ void Chipset::apply_ham(uint8_t modification) {
case 0x00: // Direct palette lookup. case 0x00: // Direct palette lookup.
last_colour_ = swizzled_palette_[modification & 0x1b]; last_colour_ = swizzled_palette_[modification & 0x1b];
break; break;
case 0x04: // Replace red. case 0x04: // Replace blue.
colour[0] = uint8_t( colour[1] = uint8_t(
(colour[1] & 0xf0) |
((modification & 0x10) >> 1) | // bit 3. ((modification & 0x10) >> 1) | // bit 3.
((modification & 0x02) << 1) | // bit 2. ((modification & 0x02) << 1) | // bit 2.
((modification & 0x08) >> 2) | // bit 1. ((modification & 0x08) >> 2) | // bit 1.
(modification & 0x01) // bit 0. (modification & 0x01) // bit 0.
); );
break; break;
case 0x20: // Replace blue. case 0x20: // Replace red.
colour[1] = uint8_t( colour[0] = uint8_t(
(colour[1] & 0xf0) |
((modification & 0x10) >> 1) | // bit 3. ((modification & 0x10) >> 1) | // bit 3.
((modification & 0x02) << 1) | // bit 2. ((modification & 0x02) << 1) | // bit 2.
((modification & 0x08) >> 2) | // bit 1. ((modification & 0x08) >> 2) | // bit 1.