commentaires
This commit is contained in:
parent
175d0d37b7
commit
d0ec84379e
@ -68,9 +68,9 @@ begin
|
|||||||
-- Process de calcul d'affichage
|
-- Process de calcul d'affichage
|
||||||
process(X,Y,clk,reset,running,dx,dy,updateOrder,currentSnake,snakeHere,snakePresentBuffer)
|
process(X,Y,clk,reset,running,dx,dy,updateOrder,currentSnake,snakeHere,snakePresentBuffer)
|
||||||
begin
|
begin
|
||||||
if(updateOrder'event and updateOrder = '1') then
|
if(updateOrder'event and updateOrder = '1') then --si on as un signal sur pxl_clk (i.e. on vient de changer de pixel)
|
||||||
snakePresentBuffer <= snakeHere;
|
snakePresentBuffer <= snakeHere; --on passe la valeur précédente sur la sortie, pour eviter des modifications en même temps qu'on affiche (ça fait des lignes noires à l'écran)
|
||||||
startUpdate <= '1';
|
startUpdate <= '1'; --on marque qu'il faut refaire une update (on doit separer en deux signaux parce que sinon on aurait un edit sur deux clk differentes). C'est pas très élégant mais j'ai pas trouvé mieux
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
if(reset = '0') then
|
if(reset = '0') then
|
||||||
@ -97,9 +97,9 @@ elsif(clk'event and clk = '1') then
|
|||||||
end if;
|
end if;
|
||||||
|
|
||||||
if(currentSnake.isDefined = '1') then
|
if(currentSnake.isDefined = '1') then
|
||||||
--if(X>=currentSnake.X-8 and X<=currentSnake.X+8 and Y>=currentSnake.Y-8 and Y<=currentSnake.Y+8) then
|
if(X>=currentSnake.X-8 and X<=currentSnake.X+8 and Y>=currentSnake.Y-8 and Y<=currentSnake.Y+8) then
|
||||||
snakeHere <= '1';
|
snakeHere <= '1';
|
||||||
--end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
|
@ -54,10 +54,10 @@ architecture Behavioral of updateSnake is
|
|||||||
signal index : unsigned(SNAKE_ADDRESS_SIZE-1 downto 0);
|
signal index : unsigned(SNAKE_ADDRESS_SIZE-1 downto 0);
|
||||||
signal currentSnake : pos;
|
signal currentSnake : pos;
|
||||||
begin
|
begin
|
||||||
process(clk,reset,index)
|
process(clk,reset,index) --process de reset
|
||||||
begin
|
begin
|
||||||
if(clk'event and clk = '1') then
|
if(clk'event and clk = '1') then
|
||||||
if(reset = '0') then
|
if(reset = '0') then --il faut qu'on ai le reset sur la clk car il controle indirectement l'entrée de la RAM
|
||||||
index <= to_unsigned(0,SNAKE_ADDRESS_SIZE);
|
index <= to_unsigned(0,SNAKE_ADDRESS_SIZE);
|
||||||
writeEnable <= '1';
|
writeEnable <= '1';
|
||||||
matWriteEnable <= '1';
|
matWriteEnable <= '1';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user