Pi Firmware: Atom_cpld capture now deals with normal and bright orange

Change-Id: I58b3379367e8a79e230f2ddb503e3e9b3e5d58a2
pull/12/head
David Banks 2018-11-28 12:52:26 +00:00
rodzic d9fbb6a033
commit f5144ae984
3 zmienionych plików z 63 dodań i 13 usunięć

Wyświetl plik

@ -29,21 +29,33 @@ loop:
WAIT_FOR_PSYNC_10 // expects GPLEV0 in r4, result in r8
// Pixel 0 in GPIO 4..2 -> 2..0
// Pixel 1 in GPIO 8..6 -> 10..8
// Pixel 0 in GPIO 5..2 -> 3..0
// Pixel 1 in GPIO 9..6 -> 11..8
and r10, r8, #(7 << PIXEL_BASE)
and r9, r8, #(7 << (PIXEL_BASE + 4))
and r10, r8, #(15 << PIXEL_BASE)
tst r10, #( 8 << PIXEL_BASE) // Swap orange for yellow
bicne r10, #(15 << PIXEL_BASE)
orrne r10, #( 3 << PIXEL_BASE)
and r9, r8, #(15 << (PIXEL_BASE + 4))
tst r9, #( 8 << (PIXEL_BASE + 4)) // Swap orange for yellow
bicne r9, #(15 << (PIXEL_BASE + 4))
orrne r9, #( 3 << (PIXEL_BASE + 4))
mov r10, r10, lsr #(PIXEL_BASE)
orr r10, r10, r9, lsl #(8 - (4 + PIXEL_BASE))
WAIT_FOR_PSYNC_01 // expects GPLEV0 in r4, result in r8
// Pixel 0 in GPIO 4..2 -> 18..16
// Pixel 1 in GPIO 8..6 -> 26..24
// Pixel 0 in GPIO 5..2 -> 19..16
// Pixel 1 in GPIO 9..6 -> 27..24
and r9, r8, #(7 << PIXEL_BASE)
and r14, r8, #(7 << (PIXEL_BASE + 4))
and r9, r8, #(15 << PIXEL_BASE)
tst r9, #( 8 << PIXEL_BASE) // Swap orange for yellow
bicne r9, #(15 << PIXEL_BASE)
orrne r9, #( 3 << PIXEL_BASE)
and r14, r8, #(15 << (PIXEL_BASE + 4))
tst r14, #( 8 << (PIXEL_BASE + 4)) // Swap orange for yellow
bicne r14, #(15 << (PIXEL_BASE + 4))
orrne r14, #( 3 << (PIXEL_BASE + 4))
orr r10, r10, r9, lsl #(16 - PIXEL_BASE)
orr r10, r10, r14, lsl #(24 - (PIXEL_BASE + 4))

Wyświetl plik

@ -54,7 +54,8 @@ static const char *palette_names[] = {
"Not Red",
"Not Green",
"Not Blue",
"Atom"
"Atom Colour",
"Atom Mono"
};
static const char *pllh_names[] = {
@ -742,12 +743,48 @@ void osd_update_palette() {
g = (i & 3) * 255 / 3;
b = 0;
break;
case PALETTE_ATOM:
// In the Atom CPLD, colour bit 3 indicates a half green
case PALETTE_ATOM_COLOUR:
// In the Atom CPLD, colour bit 3 indicates some kind of orange
if (i & 8) {
g >>= 1;
if ((i & 7) == 0) {
// Dark orange
r = 160; g = 80; b = 0;
} else if ((i & 7) == 1) {
// Bright orange
r = 255; g = 127; b = 0;
} else {
// Illegal colour, show as black
r = g = b = 0;
}
}
break;
case PALETTE_ATOM_MONO:
m = 0;
switch (i) {
case 3: // yellow
case 7: // white (buff)
case 9: // bright orange
// Y = WH (0.42V)
m = 255;
break;
case 2: // green
case 5: // magenta
case 6: // cyan
case 8: // orange
// Y = WM (0.54V)
m = 255 * (72 - 54) / (72 - 42);
break;
case 1: // red
case 4: // blue
// Y = WL (0.65V)
m = 255 * (72 - 65) / (72 - 42);
break;
default:
// Y = BL (0.72V)
m = 0;
}
r = g = b = m;
break;
}
if (active) {
if (i >= (num_colours >> 1)) {

Wyświetl plik

@ -30,7 +30,8 @@ enum {
PALETTE_NOT_RED,
PALETTE_NOT_GREEN,
PALETTE_NOT_BLUE,
PALETTE_ATOM,
PALETTE_ATOM_COLOUR,
PALETTE_ATOM_MONO,
NUM_PALETTES
};