Skip to content

Commit e2a3180

Browse files
committed
Fix BGR/RGB colors for compatibility with DisplayIO
1 parent 19a66d7 commit e2a3180

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

feather_m4_minitft_featherwing/ugame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
b"\xc4\x02\x8a\xee"
3030
b"\xc5\x01\x0e" # _VMCTR1 VCOMH = 4V, VOML = -1.1V
3131
b"\x20\x00" # _INVOFF
32-
b"\x36\x01\x68" # _MADCTL bottom to top refresh
32+
b"\x36\x01\x60" # _MADCTL bottom to top refresh
3333
# 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
3434
# fix on VTL
3535
b"\x3a\x01\x05" # COLMOD - 16bit color

itsybitsy_m4_express/ugame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
b"\xc4\x02\x8a\xee"
3636
b"\xc5\x01\x0e" # _VMCTR1 VCOMH = 4V, VOML = -1.1V
3737
b"\x20\x00" # _INVOFF
38-
b"\x36\x01\x18" # _MADCTL bottom to top refresh
38+
b"\x36\x01\x10" # _MADCTL bottom to top refresh
3939
# 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
4040
# fix on VTL
4141
b"\x3a\x01\x05" # COLMOD - 16bit color

pewpew_m4/pew.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
b'\xddw\xe7~\xd0UU\x0e\xde\xdd~\xe7pUU\x0e~\xd7\xe7\xde\xd2UU\r\r\xd7\xdew'
105105
b'\x05UU\x02R\xdd}\xed%UUUU \x00\x02UUUUUUUUUUUUUUUUUUU')
106106

107-
_PALETTE = array.array('H', (0, 5632, 10081, 7936, 17410, 8184, 10243, 53226,
108-
2820, 32586, 48964, 62213, 40710, 47830, 57311, 65535))
107+
_PALETTE = array.array('H', [0, 176, 11321, 248, 16418, 8184, 8259, 65402, 92,
108+
27130, 43260, 57501, 33022, 47830, 56319, 8184])
109109

110110

111111
K_X = 0x01

pybadge/ugame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
b"\xc4\x02\x8a\xee"
3838
b"\xc5\x01\x0e" # _VMCTR1 VCOMH = 4V, VOML = -1.1V
3939
b"\x20\x00" # _INVOFF
40-
b"\x36\x01\xa8" # _MADCTL
40+
b"\x36\x01\xa0" # _MADCTL
4141
# 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
4242
# fix on VTL
4343
b"\x3a\x01\x05" # COLMOD - 16bit color

pygamer/ugame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
b"\xc4\x02\x8a\xee"
3939
b"\xc5\x01\x0e" # _VMCTR1 VCOMH = 4V, VOML = -1.1V
4040
b"\x20\x00" # _INVOFF
41-
b"\x36\x01\xa8" # _MADCTL
41+
b"\x36\x01\xa0" # _MADCTL
4242
# 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie,
4343
# fix on VTL
4444
b"\x3a\x01\x05" # COLMOD - 16bit color

stage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def read_palette(self):
216216
f.seek(self.data - self.colors * 4)
217217
for color in range(self.colors):
218218
buffer = f.read(4)
219-
c = color565(buffer[0], buffer[1], buffer[2])
219+
c = color565(buffer[2], buffer[1], buffer[0])
220220
palette[color] = ((c << 8) | (c >> 8)) & 0xffff
221221
return palette
222222

@@ -328,7 +328,7 @@ def read_palette(self):
328328
f.seek(13)
329329
for color in range(self.palette_size):
330330
buffer = f.read(3)
331-
c = color565(buffer[2], buffer[1], buffer[0])
331+
c = color565(buffer[0], buffer[1], buffer[2])
332332
palette[color] = ((c << 8) | (c >> 8)) & 0xffff
333333
return palette
334334

0 commit comments

Comments
 (0)