From 5698aa6499fa7a1763b0a251fa539ecd6edd6cc1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 11 Nov 2020 20:41:30 -0500 Subject: [PATCH] Corrects colour mapping and improves documentation for self. --- Machines/Apple/AppleIIgs/Video.cpp | 6 +++++- Outputs/ScanTarget.hpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Machines/Apple/AppleIIgs/Video.cpp b/Machines/Apple/AppleIIgs/Video.cpp index 2b9374242..70d232858 100644 --- a/Machines/Apple/AppleIIgs/Video.cpp +++ b/Machines/Apple/AppleIIgs/Video.cpp @@ -21,7 +21,11 @@ constexpr int FinalPixelLine = 192; constexpr auto FinalColumn = CyclesPerLine / CyclesPerTick; // Converts from Apple's RGB ordering to this emulator's. -#define PaletteConvulve(x) ((x&0xf00) >> 8) | ((x&0x00f) << 8) | (x&0x0f0) +#if TARGET_RT_BIG_ENDIAN +#define PaletteConvulve(x) x +#else +#define PaletteConvulve(x) ((x&0xf00) >> 8) | ((x&0x0ff) << 8) +#endif // The 12-bit values used by the Apple IIgs to approximate Apple II colours, // as implied by tech note #63's use of them as border colours. diff --git a/Outputs/ScanTarget.hpp b/Outputs/ScanTarget.hpp index 0860af010..408092bae 100644 --- a/Outputs/ScanTarget.hpp +++ b/Outputs/ScanTarget.hpp @@ -88,7 +88,8 @@ enum class InputDataType { Red1Green1Blue1, // 1 byte/pixel; bit 0 is blue on or off, bit 1 is green, bit 2 is red. Red2Green2Blue2, // 1 byte/pixel; bits 0 and 1 are blue, bits 2 and 3 are green, bits 4 and 5 are blue. - Red4Green4Blue4, // 2 bytes/pixel; first nibble is red, second is green, third is blue. + Red4Green4Blue4, // 2 bytes/pixel; low nibble in first byte is red, high nibble in second is green, low is blue. + // i.e. if it were a little endian word, 0xgb0r; or 0x0rgb big endian. Red8Green8Blue8, // 4 bytes/pixel; first is red, second is green, third is blue, fourth is vacant. };