Subversion Repositories pentevo

Rev

Rev 668 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 668 Rev 684
Line 25... Line 25...
25
 
25
 
26
module video_vga_sync_h(
26
module video_vga_sync_h(
27
 
27
 
28
        input  wire clk,
28
        input  wire clk,
29
 
29
 
-
 
30
        input  wire [1:0] modes_raster,
-
 
31
 
30
        output reg  vga_hsync,
32
        output reg  vga_hsync,
31
 
33
 
32
        output reg  scanout_start,
34
        output reg  scanout_start,
33
 
35
 
34
        input  wire hsync_start
36
        input  wire hsync_start
35
);
37
);
36
 
38
 
37
        localparam HSYNC_END    = 10'd106;
39
        localparam HSYNC_END    = 10'd106;
38
        localparam SCANOUT_BEG  = 10'd156;
40
        localparam SCANOUT_BEG  = 10'd156;
39
 
41
 
40
        localparam HPERIOD = 10'd896;
42
        localparam HPERIOD_224 = 10'd896;
-
 
43
        localparam HPERIOD_228 = 10'd912;
41
 
44
 
42
 
45
 
43
 
46
 
44
        reg [9:0] hcount;
47
        reg [9:0] hcount;
45
 
48
 
Line 53... Line 56...
53
 
56
 
54
        always @(posedge clk)
57
        always @(posedge clk)
55
        begin
58
        begin
56
                        if( hsync_start )
59
                        if( hsync_start )
57
                                hcount <= 10'd2;
60
                                hcount <= 10'd2;
58
                        else if ( hcount==(HPERIOD-9'd1) )
61
                        else if ( hcount==( (modes_raster==2'b11) ? (HPERIOD_228-10'd1) : (HPERIOD_224-10'd1) ) )
59
                                hcount <= 10'd0;
62
                                hcount <= 10'd0;
60
                        else
63
                        else
61
                                hcount <= hcount + 9'd1;
64
                                hcount <= hcount + 9'd1;
62
        end
65
        end
63
 
66