// Top level of what's inside our VGA on the spartan //`include "hardware_sprite.v" //`include "vga.v" module FPGA (Clk50, Reset, button1, button2, R, G, B, HSync, VSync); input Clk50, Reset, button1, button2; output R, G, B, HSync, VSync; reg fliph, flipv; reg [9:0] posx; reg [8:0] posy; reg [15:0] movecounter; wire PClk, Row0, Col0, Active, A; wire [9:0] Col; wire [8:0] Row; vga vga0( Reset, VSync, HSync, Clk50, PClk, Row, Col, Row0, Col0, Active ); hardware_sprite hwsp0 (Reset, R, G, B, A, Clk50, PClk, Row, Col, Active, posx, posy, fliph, flipv, 0); // Initialize Values always @(posedge Clk50) begin if (Reset) begin posx = 10'd50; posy = 9'd50; fliph = 0; flipv = 0; end else begin movecounter = movecounter + 1; if (movecounter == 0) begin if (button1) posx = posx + 1; if (button2) posy = posy + 1; end end end endmodule