diff --git a/game_of_life_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd b/game_of_life_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd index cfe92575a40a107a2796a6d4ca58d773319e5ab0..fe5b329acefda36389e6cb032faa36223ab2386c 100644 --- a/game_of_life_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd +++ b/game_of_life_v2/game_of_life_v2.srcs/sources_1/new/game_of_life.vhd @@ -158,7 +158,7 @@ begin end if; -- handle shift registers - --if switch_mode = '1' and frame_counter = 0 and horizontal_counter(9 downto 3) < cell_number+2 and vertical_counter(9 downto 3) < cell_number+2 then + --if switch_mode = '1' and frame_counter = 0 and horizontal_counter(2 downto 0) = 0 and horizontal_counter(9 downto 3) < cell_number+2 and vertical_counter(2 downto 0) = 0 and vertical_counter(9 downto 3) < cell_number+2 then if switch_mode = '1' and frame_counter = 0 and horizontal_counter(2 downto 0) = 0 and horizontal_counter(9 downto 3) < cell_number and vertical_counter(2 downto 0) = 0 and vertical_counter(9 downto 3) < cell_number then shift_register_top <= shift_register_top(1 to cell_number-1) & shift_register_middle(0); @@ -185,19 +185,19 @@ begin if neighbours(4)='1' then if neighbours_count = 3 or neighbours_count = 4 then - cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '1'; - cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '1'; + cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '1'; + cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '1'; else - cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '0'; - cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '0'; + cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '0'; + cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '0'; end if; else if neighbours_count = 3 then - cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '1'; - cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '1'; + cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '1'; + cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '1'; else - cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '0'; - cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-2)) <= '0'; + cells(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '0'; + cells_to_draw(to_integer((vertical_counter(9 downto 3)-1) * to_unsigned(cell_number,8) + horizontal_counter(9 downto 3)-3)) <= '0'; end if; end if; @@ -251,7 +251,7 @@ begin -- position changing if vertical_counter = VERTICAL_SYNC_PULSE-1 then vertical_counter <= (others => '0'); - if frame_counter = 127 then + if frame_counter = 63 then frame_counter <= (others => '0'); else frame_counter <= frame_counter + 1;