Subversion Repositories pentevo

Rev

Rev 668 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. // ZX-Evo Base Configuration (c) NedoPC 2008,2009,2010,2011,2012,2013,2014
  2. //
  3. // mux out VGA and TV signals and make final v|h syncs, DAC data, etc.
  4.  
  5. /*
  6.     This file is part of ZX-Evo Base Configuration firmware.
  7.  
  8.     ZX-Evo Base Configuration firmware is free software:
  9.     you can redistribute it and/or modify it under the terms of
  10.     the GNU General Public License as published by
  11.     the Free Software Foundation, either version 3 of the License, or
  12.     (at your option) any later version.
  13.  
  14.     ZX-Evo Base Configuration firmware is distributed in the hope that
  15.     it will be useful, but WITHOUT ANY WARRANTY; without even
  16.     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17.     See the GNU General Public License for more details.
  18.  
  19.     You should have received a copy of the GNU General Public License
  20.     along with ZX-Evo Base Configuration firmware.
  21.     If not, see <http://www.gnu.org/licenses/>.
  22. */
  23.  
  24. `include "../include/tune.v"
  25.  
  26. module video_outmux(
  27.  
  28.         input  wire        clk,
  29.  
  30.  
  31.         input  wire        vga_on,
  32.  
  33.  
  34.         input  wire [ 5:0] tvcolor,
  35.         input  wire [ 5:0] vgacolor,
  36.  
  37.         input  wire        vga_hsync,
  38.         input  wire        hsync,
  39.         input  wire        vsync,
  40.  
  41.  
  42.         output reg  [ 1:0] vred,
  43.         output reg  [ 1:0] vgrn,
  44.         output reg  [ 1:0] vblu,
  45.  
  46.         output reg         vhsync,
  47.         output reg         vvsync,
  48.         output reg         vcsync
  49. );
  50.  
  51.  
  52.         always @(posedge clk)
  53.         begin
  54.                 vgrn[1:0] <= vga_on ? vgacolor[5:4] : tvcolor[5:4];
  55.                 vred[1:0] <= vga_on ? vgacolor[3:2] : tvcolor[3:2];
  56.                 vblu[1:0] <= vga_on ? vgacolor[1:0] : tvcolor[1:0];
  57.  
  58.                 vhsync <= vga_on ? vga_hsync : hsync;
  59.                 vvsync <= vsync;
  60.  
  61.                 vcsync <= ~(hsync ^ vsync);
  62.         end
  63.  
  64.  
  65.  
  66. endmodule
  67.  
  68.