-- Interactive Audio Manipulation Processor -- -- file: ui.vhd -- status: compiled - no errors, however, some functionality is stubbed out -- -- author: Stephen Tang -- -- This file contains the top-level user interface entity. This entity -- is responsible for passing the user input to the audio manipulation -- processes and to the VGA display library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; library work; use work.Constants_Pkg.all; entity ui is port ( clk : in std_logic; --system clock, 25.175MHz; pin 91 rst : in std_logic; -- reset signal from pushbutton FLEX_PB1, pin 28 SlowClk: in std_logic; vga_red, vga_green, vga_blue: out boolean; -- pins 236, 237, 238 vga_h_sync,vga_v_sync : buffer boolean;-- pins 240 and 239 Jup, Jdown, Jleft, Jright, Jfire: in std_logic; sound_x, sound_y: out std_logic_vector(SOURCE_WIDTH-1 downto 0) ); end ui; architecture UserInterface of ui is component video is port ( clock, reset : in std_logic; cursorX: in std_logic_vector(DISPLAY_X-1 downto 0); cursorY: in std_logic_vector(DISPLAY_Y-1 downto 0); -- current joystick cursor position vga_red, vga_green, vga_blue: out boolean; vga_h_sync,vga_v_sync : out boolean ); end component; component joystick is port ( clock : in std_logic; -- takes in vga_h_sync up, down, left, right, fire: in std_logic; X: out std_logic_vector(DISPLAY_X-1 downto 0); Y: out std_logic_vector(DISPLAY_Y-1 downto 0) ); end component; component AudioCoords is port ( clock: in std_logic; -- should be 80ns screenX: in std_logic_vector(DISPLAY_X-1 downto 0); screenY: in std_logic_vector(DISPLAY_Y-1 downto 0); locationX: out std_logic_vector(SOURCE_WIDTH-1 downto 0); locationY: out std_logic_vector(SOURCE_WIDTH-1 downto 0) ); end component; signal JoyX: std_logic_vector(DISPLAY_X-1 downto 0); signal JoyY: std_logic_vector(DISPLAY_Y-1 downto 0); signal SoundSpriteX: std_logic_vector(DISPLAY_X-1 downto 0); signal SoundSpriteY: std_logic_vector(DISPLAY_Y-1 downto 0); signal HSyncClock: std_logic; begin -- UserInterface MakeHSyncIntoClock: process(vga_h_sync) begin case vga_h_sync is when TRUE => HSyncClock <= '1'; when FALSE => HSyncClock <= '0'; end case; end process MakeHSyncIntoClock; videocontrol: video port map ( clock => clk, reset => rst, cursorX => JoyX, cursorY => JoyY, vga_red => vga_red, vga_green => vga_green, vga_blue => vga_blue, vga_h_sync => vga_h_sync, vga_v_sync => vga_v_sync ); Joy: Joystick port map ( clock => HSyncClock, up => Jup, down => Jdown, left => Jleft, right => Jright, fire => Jfire, X => JoyX, Y => JoyY ); SoundCoordsMapper: AudioCoords port map ( clock => SlowClk, screenX => JoyX, screenY => JoyY, locationX => sound_x, locationY => sound_y ); end UserInterface;