Merge pull request #1448 from tpwrules/fix-framebuffer-colors

soc/cores/video: fix framebuffer color output
This commit is contained in:
enjoy-digital 2022-10-30 21:26:10 +01:00 committed by GitHub
commit c71db5159b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -611,7 +611,7 @@ class VideoTerminal(Module):
If(bit, If(bit,
Case(term_rdport.dat_r[font_width:], { Case(term_rdport.dat_r[font_width:], {
0: [Cat(source.r, source.g, source.b).eq(0xffffff)], 0: [Cat(source.r, source.g, source.b).eq(0xffffff)],
1: [Cat(source.r, source.g, source.b).eq(0x34e289)], 1: [Cat(source.r, source.g, source.b).eq(0x89e234)],
}) })
).Else( ).Else(
Cat(source.r, source.g, source.b).eq(0x000000), Cat(source.r, source.g, source.b).eq(0x000000),
@ -680,15 +680,15 @@ class VideoFrameBuffer(Module, AutoCSR):
] ]
if (depth == 32): if (depth == 32):
self.comb += [ self.comb += [
source.r.eq(video_pipe_source.data[16:24]), source.r.eq(video_pipe_source.data[ 0: 8]),
source.g.eq(video_pipe_source.data[ 8:16]), source.g.eq(video_pipe_source.data[ 8:16]),
source.b.eq(video_pipe_source.data[ 0: 8]), source.b.eq(video_pipe_source.data[16:24]),
] ]
else: # depth == 16 else: # depth == 16
self.comb += [ self.comb += [
source.r.eq(Cat(Signal(3, reset = 0), video_pipe_source.data[ 0: 5])), source.r.eq(Cat(Signal(3, reset = 0), video_pipe_source.data[11:16])),
source.g.eq(Cat(Signal(2, reset = 0), video_pipe_source.data[ 5:11])), source.g.eq(Cat(Signal(2, reset = 0), video_pipe_source.data[ 5:11])),
source.b.eq(Cat(Signal(3, reset = 0), video_pipe_source.data[11:16])), source.b.eq(Cat(Signal(3, reset = 0), video_pipe_source.data[ 0: 5])),
] ]
# Underflow. # Underflow.