]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - Framebuffer.v
Fix ADD HL,xx.
[fpgaboy.git] / Framebuffer.v
index 836f73a3a30163354ad7031e5985980a8af1aa7d..35cb9d83c80d957f02bac68d65950c8ddd1d00b5 100644 (file)
@@ -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
This page took 0.024893 seconds and 4 git commands to generate.