X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/fe3dc8909a6c72ce4208cb5b8b64bc6b2f8cebd6..a6b499da5fd2a834963cc05178e6b8044dc9129f:/Framebuffer.v diff --git a/Framebuffer.v b/Framebuffer.v index 836f73a..35cb9d8 100644 --- a/Framebuffer.v +++ b/Framebuffer.v @@ -5,7 +5,7 @@ `define YRES 480 `define YFPORCH 10 `define YSYNC 2 -`define YBPORCH 29 +`define YBPORCH 25 `define XOFS ((640-160)/2) `define YOFS ((480-144)/2) @@ -46,8 +46,8 @@ module Framebuffer( reg [2:0] failandloss; assign {vgar, vgag, vgab} = - ((vgax > `XOFS) && (vgax < (`XOFS + 160)) && (vgay > `YOFS) && (vgay < (`YOFS + 144))) ? {failandloss[2],2'b0,failandloss[1],2'b0,failandloss[0],1'b0} : - ((vgax < 640) && (vgay < 480)) ? 8'b11100000 : + ((vgax > `XOFS) && (vgax < (`XOFS + 161)) && (vgay > `YOFS) && (vgay < (`YOFS + 144))) ? {failandloss[2],failandloss[1],1'b0,failandloss[2],failandloss[1],1'b0,failandloss[0],1'b0} : + ((vgax < 640) && (vgay < 480)) ? 8'b00000000 : 8'b00000000; always @(posedge vgaclk) @@ -57,16 +57,18 @@ module Framebuffer( if (vgay >= (`YRES + `YFPORCH + `YSYNC + `YBPORCH)) begin vgafb <= 0; vgay <= 0; - end else + vgax <= 0; + end else begin vgay <= vgay + 1; - vgax <= 0; + vgax <= 0; + end end else vgax <= vgax + 1; vgahs <= (vgax >= (`XRES + `XFPORCH)) && (vgax < (`XRES + `XFPORCH + `XSYNC)); vgavs <= (vgay >= (`YRES + `YFPORCH)) && (vgay < (`YRES + `YFPORCH + `YSYNC)); - if ((vgax > `XOFS) && (vgax < (`XOFS + 160)) && (vgay > `YOFS) && (vgay < (`YOFS + 144))) begin + if ((vgax > `XOFS) && (vgax < (`XOFS + 161)) && (vgay > `YOFS) && (vgay < (`YOFS + 144))) begin vgafb <= vgafb + 1; failandloss <= fb[vgafb + 1]; end