Skip to content

Instantly share code, notes, and snippets.

@dekuNukem
Created March 4, 2016 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekuNukem/765f9725f7542d47c64d to your computer and use it in GitHub Desktop.
Save dekuNukem/765f9725f7542d47c64d to your computer and use it in GitHub Desktop.
test for FAP text mode display
always @(*)
begin
// inside active region
if ((vc >= vbp && vc < vfp) && (hc >= hbp && hc < hfp))
begin
vram_rd_low = 0;
hpos = hc - hbp;
vpos = vc - vbp;
hdot = hpos[2:0];
vdot = vpos[3:0];
hchar = hpos[9:3];
vchar = vpos[9:4];
vram_addr = 80 * vchar + hchar;
red = vram_data[1:0];
green = vram_data[3:2];
blue = vram_data[5:4];
end
// outside active region
else
begin
vram_rd_low = 1;
red = 0;
green = 0;
blue = 0;
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment