commentaires

This commit is contained in:
leo 2021-12-20 14:14:55 +01:00
parent 175d0d37b7
commit d0ec84379e
2 changed files with 7 additions and 7 deletions

View File

@ -68,9 +68,9 @@ begin
-- Process de calcul d'affichage
process(X,Y,clk,reset,running,dx,dy,updateOrder,currentSnake,snakeHere,snakePresentBuffer)
begin
if(updateOrder'event and updateOrder = '1') then
snakePresentBuffer <= snakeHere;
startUpdate <= '1';
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; --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'; --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;
if(reset = '0') then
@ -97,9 +97,9 @@ elsif(clk'event and clk = '1') then
end if;
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';
--end if;
end if;
end if;
end if;
end if;

View File

@ -54,10 +54,10 @@ architecture Behavioral of updateSnake is
signal index : unsigned(SNAKE_ADDRESS_SIZE-1 downto 0);
signal currentSnake : pos;
begin
process(clk,reset,index)
process(clk,reset,index) --process de reset
begin
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);
writeEnable <= '1';
matWriteEnable <= '1';