From a5e8ad13eee2b69fb5d0b95c0679badf16188d97 Mon Sep 17 00:00:00 2001 From: Richard Widen Date: Wed, 25 Apr 2012 16:01:12 +0200 Subject: [PATCH] Rorliga sprites pavag --- SpriteGpu.vhd | 2 +- frameCounter.vhd | 47 +++++++++++++++++++++++------------------------ 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/SpriteGpu.vhd b/SpriteGpu.vhd index eb11682..94aef99 100644 --- a/SpriteGpu.vhd +++ b/SpriteGpu.vhd @@ -186,7 +186,7 @@ begin end if; detected :=false; - if put_box = '1' then + if put_box = '0' then if x_pos(0) = 0 then x_pos(0) <= 800; if next_box ='1' then diff --git a/frameCounter.vhd b/frameCounter.vhd index b4f4ec8..8468a69 100644 --- a/frameCounter.vhd +++ b/frameCounter.vhd @@ -44,30 +44,29 @@ process(clk) begin if rising_edge(clk) then if(rst='1') then - score<="000111011100110101100101000000000"; --1 000 000 000 - frame<='0'; - counter_speed<="000000000000000000000000000000000"; - counter_frame<="000000000000000000000000000000000"; - speed<="000000010011000100101101000000000"; - end if; - if(rst='0') then - counter_speed<=counter_speed + 1; - counter_frame<=counter_frame + 1; - if (counter_speed=score) then - counter_speed<="000000000000000000000000000000000"; - speed<=speed - "000000000001111010000100100000000"; - if(speed="000000000000000000000000000000000")then - speed<="000000010011000100101101000000000"; - end if; - end if; - - if(counter_frame=speed) then--40 000 000 - counter_frame<="000000000000000000000000000000000"; - frame<='1'; - else - frame<='0'; - end if; - end if; + score <= "000111011100110101100101000000000"; --1 000 000 000 + frame <= '0'; + counter_speed <= "000000000000000000000000000000000"; + counter_frame <= "000000000000000000000000000000000"; + speed <= "000000010011000100101101000000000"; + else + counter_speed<=counter_speed + 1; + counter_frame<=counter_frame + 1; + if counter_speed = score then + counter_speed <= "000000000000000000000000000000000"; + speed <= speed - "000000000001111010000100100000000"; + if speed = "000000000000000000000000000000000" then + speed <= "000000010011000100101101000000000"; + end if; + end if; + + if(counter_frame=speed) then--40 000 000 + counter_frame<="000000000000000000000000000000000"; + frame<='1'; + else + frame<='0'; + end if; + end if; end if; end process; end Behavioral; \ No newline at end of file