aboutsummaryrefslogtreecommitdiff
path: root/basys3/basys3.srcs
diff options
context:
space:
mode:
Diffstat (limited to 'basys3/basys3.srcs')
-rw-r--r--basys3/basys3.srcs/ppu_plut.vhd30
-rw-r--r--basys3/basys3.srcs/ppu_sprite_bg.vhd4
2 files changed, 9 insertions, 25 deletions
diff --git a/basys3/basys3.srcs/ppu_plut.vhd b/basys3/basys3.srcs/ppu_plut.vhd
index d2e132e..2379274 100644
--- a/basys3/basys3.srcs/ppu_plut.vhd
+++ b/basys3/basys3.srcs/ppu_plut.vhd
@@ -34,7 +34,8 @@ architecture Behavioral of ppu_plut is
end component;
signal PLUT : std_logic_vector((64 * PPU_PAL_DATA_WIDTH)-1 downto 0) := (others => '0');
- signal CHECK_ZERO_CIDX : std_logic_vector(PPU_PALETTE_CIDX_WIDTH-1 downto 0) := (others => '0'); -- color in
+ signal COLOR : std_logic_vector(PPU_PAL_DATA_WIDTH-1 downto 0) := (others => '0'); -- COLORS RGB IN
+ signal CIDX_INT : integer := 0;
begin
RAM : component er_ram port map(
CLK => CLK,
@@ -44,26 +45,9 @@ begin
DATA => PAL_DATA,
REG => PLUT);
- process(CLK, RESET)
- variable COLOR : std_logic_vector(PPU_PAL_DATA_WIDTH-1 downto 0) := (others => '0'); -- COLORS RGB IN
- variable CIDX_INT : integer := 0;
- begin
- if RESET = '1' then
- PLUT <= (others => '0');
- else
- if rising_edge (CLK) then
- if (CIDX /= CHECK_ZERO_CIDX) then
- CIDX_INT := to_integer(unsigned(CIDX));
- COLOR := PLUT((12 * CIDX_INT) + 11 downto (12*CIDX_INT));
- R <= COLOR(11 downto 8);
- G <= COLOR(7 downto 4);
- B <= COLOR(3 downto 0);
- else
- R <= x"0";
- G <= x"0";
- B <= x"0";
- end if;
- end if;
- end if;
- end process;
+ CIDX_INT <= to_integer(unsigned(CIDX));
+ COLOR <= PLUT((12 * CIDX_INT) + 11 downto (12*CIDX_INT));
+ R <= COLOR(11 downto 8);
+ G <= COLOR(7 downto 4);
+ B <= COLOR(3 downto 0);
end Behavioral;
diff --git a/basys3/basys3.srcs/ppu_sprite_bg.vhd b/basys3/basys3.srcs/ppu_sprite_bg.vhd
index 1892694..417210c 100644
--- a/basys3/basys3.srcs/ppu_sprite_bg.vhd
+++ b/basys3/basys3.srcs/ppu_sprite_bg.vhd
@@ -68,8 +68,8 @@ architecture Behavioral of ppu_sprite_bg is
begin
-- output drivers
CIDX <= T_CIDX when OE = '1' else (others => 'Z');
- BAM_ADDR <= R_BAM_ADDR;
- TMM_ADDR <= R_TMM_ADDR;
+ BAM_ADDR <= R_BAM_ADDR when state = PL_BAM_ADDR else (others => 'Z');
+ TMM_ADDR <= R_TMM_ADDR when state = PL_TMM_ADDR else (others => 'Z');
T_BAM_DATA <= BAM_DATA;
T_TMM_DATA <= TMM_DATA;
-- CIDX combination