Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarDevAchar authored Aug 9, 2024
1 parent c7e15d6 commit 99961ac
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 20 deletions.
13 changes: 0 additions & 13 deletions src/graphics_engine.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ module graphics_engine(
input wire frame_active, clk, rst_n
);

parameter [15:0] qsine_line00 = 16'b1100000000000000;
parameter [15:0] qsine_line01 = 16'b0011100000000000;
parameter [15:0] qsine_line02 = 16'b0000011000000000;
parameter [15:0] qsine_line03 = 16'b0000000110000000;
parameter [15:0] qsine_line04 = 16'b0000000001000000;
parameter [15:0] qsine_line05 = 16'b0000000000100000;
parameter [15:0] qsine_line06 = 16'b0000000000010000;
parameter [15:0] qsine_line07 = 16'b0000000000001000;
parameter [15:0] qsine_line08 = 16'b0000000000000100;
parameter [15:0] qsine_line09 = 16'b0000000000000010;
parameter [15:0] qsine_line10 = 16'b0000000000000001;
parameter [15:0] qsine_line11 = 16'b0000000000000001;

wire [5:0] overlay_rgb;
wire overlay_active;

Expand Down
33 changes: 30 additions & 3 deletions src/overlay_creator.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ module overlay_creator(
input wire frame_active, clk, rst_n
);

// TODO: QSine Stuff
parameter [15:0] qsine_line00 = 16'b1100000000000000;
parameter [15:0] qsine_line01 = 16'b0011100000000000;
parameter [15:0] qsine_line02 = 16'b0000011000000000;
parameter [15:0] qsine_line03 = 16'b0000000110000000;
parameter [15:0] qsine_line04 = 16'b0000000001000000;
parameter [15:0] qsine_line05 = 16'b0000000000100000;
parameter [15:0] qsine_line06 = 16'b0000000000010000;
parameter [15:0] qsine_line07 = 16'b0000000000001000;
parameter [15:0] qsine_line08 = 16'b0000000000000100;
parameter [15:0] qsine_line09 = 16'b0000000000000010;
parameter [15:0] qsine_line10 = 16'b0000000000000001;
parameter [15:0] qsine_line11 = 16'b0000000000000001;

assign overlay_active = |(overlay_rgb);

wire [9:0] x_shadow, y_shadow;
wire text_active;
wire text_demosiine_active, text_demosiine_main_active, text_demosiine_shadow_active;
wire text_tt08_active, text_tt08_main_active, text_tt08_shadow_active;
wire [5:0] demosiine_rgb, tt08_rgb;
wire text_sda_active, text_sda_main_active, text_sda_shadow_active;
wire [5:0] demosiine_rgb, tt08_rgb, sda_rgb;

assign x_shadow = x - 4;
assign y_shadow = y - 4;
Expand Down Expand Up @@ -42,14 +54,29 @@ module overlay_creator(
.clk(clk)
);

text_sda text_sda1 (
.overlay_active(text_sda_main_active),
.x(x), .y(y),
.clk(clk)
);

text_sda text_sda2 (
.overlay_active(text_sda_shadow_active),
.x(x_shadow), .y(y_shadow),
.clk(clk)
);

assign demosiine_rgb = text_demosiine_main_active ? 6'b11_11_11 : {1'b0, text_demosiine_shadow_active, 1'b0, text_demosiine_shadow_active, 1'b0, text_demosiine_shadow_active};
assign tt08_rgb = text_tt08_main_active ? 6'b11_11_11 : {1'b0, text_tt08_shadow_active, 1'b0, text_tt08_shadow_active, 1'b0, text_tt08_shadow_active};
assign sda_rgb = text_sda_main_active ? 6'b11_11_11 : {1'b0, text_sda_shadow_active, 1'b0, text_sda_shadow_active, 1'b0, text_sda_shadow_active};

assign text_demosiine_active = text_demosiine_main_active | text_demosiine_shadow_active;
assign text_tt08_active = text_tt08_main_active | text_tt08_shadow_active;
assign text_sda_active = text_sda_main_active | text_sda_shadow_active;
assign text_active = text_demosiine_active | text_tt08_active;

assign overlay_rgb = text_demosiine_active ? demosiine_rgb :
(text_tt08_active ? tt08_rgb : 6'd0);
(text_tt08_active ? tt08_rgb :
(text_sda_active ? sda_rgb : 6'd0));

endmodule
4 changes: 2 additions & 2 deletions src/text_demosiine.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ module text_demosiine(
parameter [45:0] demosiine_line7 = 46'b0001010010010001000100001001010001000010010001;
parameter [45:0] demosiine_line8 = 46'b1111010010111011100011100110010001011110001111;

wire [5:0] demosiine_off_y;
wire [6:0] demosiine_off_x;
wire [5:0] demosiine_off_y;

assign demosiine_off_y = y[8:3] - 12;
assign demosiine_off_x = x[9:3] - 18;
assign demosiine_off_y = y[8:3] - 12;

always @(posedge clk) begin
if (demosiine_off_x < 47) begin
Expand Down
41 changes: 41 additions & 0 deletions src/text_sda.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module text_sda(
output reg overlay_active,
input wire [9:0] x, y,
input wire clk
);

parameter [59:0] sda_line0 = 60'b000000000001000000100000000000110000000000000000001100011100;
parameter [59:0] sda_line1 = 60'b000000000001000001010000000001010000000000000000000010100010;
parameter [59:0] sda_line2 = 60'b000000000001000001010000000001010000000000000000000010101001;
parameter [59:0] sda_line3 = 60'b101001100111011001110101011001010101001100110011000100110101;
parameter [59:0] sda_line4 = 60'b011001010101000101010101010101010011001010101010101000001001;
parameter [59:0] sda_line5 = 60'b001001010101000101010101000101010001001010101010101000100010;
parameter [59:0] sda_line6 = 60'b001011100101011001010010011000110001011100110111000110011100;
parameter [59:0] sda_line7 = 60'b000000000000000000000000000000000000000000100000000000000000;
parameter [59:0] sda_line8 = 60'b000000000000000000000000000000000000000000101000000000000000;
parameter [59:0] sda_line9 = 60'b000000000000000000000000000000000000000000010000000000000000;

wire [6:0] sda_off_x;
wire [5:0] sda_off_y;

assign sda_off_x = x[9:3] - 11;
assign sda_off_y = y[8:3] - 38;

always @(posedge clk) begin
if (sda_off_x < 61) begin
case (sda_off_y)
6'd0: overlay_active <= sda_line0[sda_off_x];
6'd1: overlay_active <= sda_line1[sda_off_x];
6'd2: overlay_active <= sda_line2[sda_off_x];
6'd3: overlay_active <= sda_line3[sda_off_x];
6'd4: overlay_active <= sda_line4[sda_off_x];
6'd5: overlay_active <= sda_line5[sda_off_x];
6'd6: overlay_active <= sda_line6[sda_off_x];
6'd7: overlay_active <= sda_line7[sda_off_x];
6'd8: overlay_active <= sda_line8[sda_off_x];
6'd9: overlay_active <= sda_line9[sda_off_x];
default: overlay_active <= 0;
endcase
end
end
endmodule
4 changes: 2 additions & 2 deletions src/text_tt08.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ module text_tt08(
parameter [21:0] tt08_line7 = 22'b0000000000000010100010;
parameter [21:0] tt08_line8 = 22'b0000000000000000111100;

wire [5:0] tt08_off_y;
wire [6:0] tt08_off_x;
wire [5:0] tt08_off_y;

assign tt08_off_y = y[8:3] - 24;
assign tt08_off_x = x[9:3] - 30;
assign tt08_off_y = y[8:3] - 24;

always @(posedge clk) begin
if (tt08_off_x < 23) begin
Expand Down

0 comments on commit 99961ac

Please sign in to comment.