Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BBC Micro core no OSD with 15khz RGB #40

Closed
squidrpi opened this issue Nov 14, 2016 · 4 comments
Closed

BBC Micro core no OSD with 15khz RGB #40

squidrpi opened this issue Nov 14, 2016 · 4 comments
Assignees
Labels

Comments

@squidrpi
Copy link
Contributor

The OSD works fine in VGA but with 15khz RGB it does not appear.

@squidrpi
Copy link
Contributor Author

squidrpi commented Feb 8, 2017

Additionally the colours look dark and washed out on RGB. Perhaps running at 0-255 instead of 16-235?

@squidrpi
Copy link
Contributor Author

squidrpi commented Feb 20, 2017

I've fixed the OSD missing on RGB 15khz and fixed the washed out colours in RGB 15khz (VGA wasn't affected). I've posted the binary here.

Here's the patches:

--- bbc_mist_top.v.orig 2015-10-09 08:53:27.000000000 +0100
+++ bbc_mist_top.v      2017-02-20 11:04:56.390396374 +0000
@@ -109,7 +109,7 @@
 
 // without scan doubler only half the pixel clock is used
 reg clk_12m;
-always @(clk_24m)
+always @(posedge clk_24m)
        clk_12m <= !clk_12m;
 
 wire clk_osd = scandoubler_disable?clk_12m:clk_24m;
@@ -133,7 +133,9 @@
    .green_out  ( VGA_G        ),
    .blue_out   ( VGA_B        ),
    .hs_out     ( v_hs         ),
-   .vs_out     ( v_vs         )
+   .vs_out     ( v_vs         ),
+
+   .tv15khz    ( scandoubler_disable )
 );
 
 wire v_hs, v_vs;
$ diff -Nur osd.v.orig osd.v
--- osd.v.orig  2015-09-30 11:33:46.000000000 +0100
+++ osd.v       2017-02-20 10:44:38.963717447 +0000
@@ -45,7 +45,9 @@
        output [5:0]    green_out,
        output [5:0]    blue_out,
        output                  hs_out,
-       output                  vs_out
+       output                  vs_out,
+
+    input           tv15khz
 );
 
 parameter OSD_X_OFFSET = 10'd0;
@@ -194,9 +196,16 @@
   osd_byte <= osd_buffer[{osd_vcnt[6:4], osd_hcnt}];
 
 wire [2:0] osd_color = OSD_COLOR;
-assign red_out   = !osd_de? {3{red_in}}     :  {osd_pixel, osd_pixel, osd_color[2], {red_in, red_in[1]}  };
-assign green_out = !osd_de? {3{green_in}}   :  {osd_pixel, osd_pixel, osd_color[1], {green_in, green_in[1]} };
-assign blue_out  = !osd_de? {3{blue_in}}    :  {osd_pixel, osd_pixel, osd_color[0], {blue_in, blue_in[1]} };
+
+// RGB 15khz output is different to fix dull colours, VGA not affected.
+// BBC only uses one bit per colour but video engine uses a 2-bit vector.
+wire [5:0] r_in = tv15khz? {5{red_in[0]}}   : {3{red_in}};
+wire [5:0] g_in = tv15khz? {5{green_in[0]}} : {3{green_in}};
+wire [5:0] b_in = tv15khz? {5{blue_in[0]}}  : {3{blue_in}};
+
+assign red_out   = !osd_de? r_in :  {osd_pixel, osd_pixel, osd_color[2], {red_in, red_in[1]}  };
+assign green_out = !osd_de? g_in :  {osd_pixel, osd_pixel, osd_color[1], {green_in, green_in[1]} };
+assign blue_out  = !osd_de? b_in :  {osd_pixel, osd_pixel, osd_color[0], {blue_in, blue_in[1]} };
 
 assign hs_out = hs_in;
 assign vs_out = vs_in;

@squidrpi squidrpi self-assigned this Feb 21, 2017
@squidrpi squidrpi added the bug label Feb 21, 2017
@squidrpi
Copy link
Contributor Author

I've committed the fixes to the repository.

@harbaum
Copy link
Contributor

harbaum commented Feb 21, 2017

Excellent, thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants