OpenCores
URL https://opencores.org/ocsvn/yavga/yavga/trunk

Subversion Repositories yavga

[/] [yavga/] [trunk/] [vhdl/] [vga_ctrl.vhd] - Diff between revs 28 and 29

Show entire file | Details | Blame | View Log

Rev 28 Rev 29
Line 237... Line 237...
  --
  --
  -- to manage the cursor position  
  -- to manage the cursor position  
  signal s_cursor_x     : std_logic_vector(c_H_COUNT_W - 1 downto 0);
  signal s_cursor_x     : std_logic_vector(c_H_COUNT_W - 1 downto 0);
  signal s_cursor_y     : std_logic_vector(c_V_COUNT_W - 1 downto 0);
  signal s_cursor_y     : std_logic_vector(c_V_COUNT_W - 1 downto 0);
 
 
 
  function f_is_cursor_pixel(
 
    s_h, s_v, s_cur_x, s_cur_y : std_logic_vector)
 
    return boolean is
 
  begin
 
    return ((s_h = s_cur_x) or (s_v = s_cur_y));
 
  end f_is_cursor_pixel;
 
 
 
  function f_is_grid_pixel(
 
    s_h, s_v : std_logic_vector)
 
    return boolean is
 
  begin
 
    return (
 
      (s_h(c_GRID_BIT downto 0) = c_GRID_SIZE(c_GRID_BIT downto 0)) or
 
      (s_v(c_GRID_BIT downto 0) = c_GRID_SIZE(c_GRID_BIT downto 0))
 
      );
 
  end f_is_grid_pixel;
 
 
 
  function f_is_waveform_pixel(
 
    s_v, s_wav, s_wav_prev : std_logic_vector)
 
    return boolean is
 
  begin
 
    return (
 
      ((s_v >= s_wav) and (s_v <= s_wav_prev)) or
 
      ((s_v                    <= s_wav) and (s_v >= s_wav_prev))
 
      );
 
  end f_is_waveform_pixel;
 
 
begin
begin
  -- read config params from ram...
  -- read config params from ram...
  p_config : process(i_clk)
  p_config : process(i_clk)
  begin
  begin
    if rising_edge(i_clk) then
    if rising_edge(i_clk) then
Line 412... Line 439...
        o_g <= '0';
        o_g <= '0';
        o_b <= '0';
        o_b <= '0';
      else
      else
        if s_display = '1' then         -- display zone
        if s_display = '1' then         -- display zone
          if (
          if (
            (s_h_count = s_cursor_x) or (s_v_count = s_cursor_y) or
            f_is_cursor_pixel(s_h_count, s_v_count, s_cursor_x, s_cursor_y) or
            (s_h_count(c_GRID_BIT downto 0) = c_GRID_SIZE(c_GRID_BIT downto 0)) or
            f_is_grid_pixel(s_h_count, s_v_count)
            (s_v_count(c_GRID_BIT downto 0) = c_GRID_SIZE(c_GRID_BIT downto 0))
            ) and (s_v_count(9) = '0')  -- < 512
            )
 
            and (s_v_count(9) = '0')    -- < 512
 
          then  -- draw the cursor and/or WaveForm Grid references
          then  -- draw the cursor and/or WaveForm Grid references
            o_r <= s_cursor_color(2);
            o_r <= s_cursor_color(2);
            o_g <= s_cursor_color(1);
            o_g <= s_cursor_color(1);
            o_b <= s_cursor_color(0);
            o_b <= s_cursor_color(0);
          elsif
          elsif
            ((s_v_count(9 downto 0) >= s_waveform_DOB(9 downto 0)) and
            f_is_waveform_pixel(s_v_count, s_waveform_DOB(c_V_COUNT_W - 1 downto 0), v_previous_pixel)
             (s_v_count(9 downto 0) <= v_previous_pixel)
 
             ) or
 
            ((s_v_count(9 downto 0) <= s_waveform_DOB(9 downto 0)) and
 
             (s_v_count(9 downto 0) >= v_previous_pixel)
 
             )
 
          then                          -- draw the waveform pixel...
          then                          -- draw the waveform pixel...
            o_r <= s_waveform_DOB(12) or s_waveform_DOB(15);  -- the "or" is only
            o_r <= s_waveform_DOB(12) or s_waveform_DOB(15);  -- the "or" is only
            o_g <= s_waveform_DOB(11) or s_waveform_DOB(14);  -- to not warning
            o_g <= s_waveform_DOB(11) or s_waveform_DOB(14);  -- to not warning
            o_b <= s_waveform_DOB(10) or s_waveform_DOB(13);  -- unused signals
            o_b <= s_waveform_DOB(10) or s_waveform_DOB(13);  -- unused signals
          else                          -- draw the background and charmaps
          else                          -- draw the background and charmaps
            --if s_v_count > 512 then
 
            --FULL_SCREEN if (s_v_count(9) = '1') then -- >= 512
 
            case (s_h_count(2 downto 0)) is
            case (s_h_count(2 downto 0)) is
              when "000"  => o_g <= s_charmaps_DO(7) xor s_bg_color(1);
              when "000"  => o_g <= s_charmaps_DO(7) xor s_bg_color(1);
              when "001"  => o_g <= s_charmaps_DO(6) xor s_bg_color(1);
              when "001"  => o_g <= s_charmaps_DO(6) xor s_bg_color(1);
              when "010"  => o_g <= s_charmaps_DO(5) xor s_bg_color(1);
              when "010"  => o_g <= s_charmaps_DO(5) xor s_bg_color(1);
              when "011"  => o_g <= s_charmaps_DO(4) xor s_bg_color(1);
              when "011"  => o_g <= s_charmaps_DO(4) xor s_bg_color(1);
Line 459... Line 477...
          o_g <= '0';
          o_g <= '0';
          o_b <= '0';
          o_b <= '0';
        end if;  -- if s_display
        end if;  -- if s_display
        v_previous_pixel := s_waveform_DOB(9 downto 0);
        v_previous_pixel := s_waveform_DOB(9 downto 0);
      end if;  -- if i_reset
      end if;  -- if i_reset
    end if;
    end if;  -- if rising_edge(i_clk)
  end process;
  end process;
 
 
end rtl;
end rtl;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.