Skip to content

Commit

Permalink
Tweak monochrome calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
budude2 committed Aug 21, 2024
1 parent e0dc646 commit 6818f50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/core_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ assign video_hs = video_hs_reg;
assign video_vs = video_vs_reg;

wire [7:0] lum;
assign lum = (video_rgb_reg[23:16]>>2) + (video_rgb_reg[23:16]>>5) + (video_rgb_reg[15:8]>>1) + (video_rgb_reg[15:8]>>4) + (video_rgb_reg[7:0]>>4) + (video_rgb_reg[7:0]>>5);
assign lum = (21 * video_rgb_reg[23:16] + 72 * video_rgb_reg[15:8] + 7 * video_rgb_reg[7:0]) / 100;

always_comb begin
if(~video_de_reg) begin
Expand Down
2 changes: 1 addition & 1 deletion src/gb/lcd.v
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ wire [31:0] g10 = (g5 * 3) + b5;
wire [31:0] b10 = (r5 * 3) + (g5 * 2) + (b5 * 11);

// greyscale
wire [7:0] grey = (pixel==0) ? 8'd252 : (pixel==1) ? 8'd168 : (pixel==2) ? 8'd96 : 8'd0;
wire [7:0] grey = (pixel==0) ? 8'd255 : (pixel==1) ? 8'd173 : (pixel==2) ? 8'd82 : 8'd0;

// sgb_border_pix contains backdrop color when sgb_border_pix[15] is low.
wire sgb_border = sgb_border_pix[15] & sgb_en;
Expand Down

0 comments on commit 6818f50

Please sign in to comment.