aboutsummaryrefslogtreecommitdiff
path: root/basys3/basys3.srcs/ppu_consts.vhd
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-02-20 15:31:12 +0100
committerlonkaars <loek@pipeframe.xyz>2023-02-20 15:31:12 +0100
commit29108f38c5f885412b0a75ae46b85720946cfdb5 (patch)
tree6b78d25a98898db4a92d659d84ba1840ee6de0ee /basys3/basys3.srcs/ppu_consts.vhd
parent77870488404563df2c18e4ec4719e767fff98919 (diff)
update TMM data width + update memory map (WIP ppu_sprite_bg)
Diffstat (limited to 'basys3/basys3.srcs/ppu_consts.vhd')
-rw-r--r--basys3/basys3.srcs/ppu_consts.vhd36
1 files changed, 23 insertions, 13 deletions
diff --git a/basys3/basys3.srcs/ppu_consts.vhd b/basys3/basys3.srcs/ppu_consts.vhd
index ab2ccf1..f4d428e 100644
--- a/basys3/basys3.srcs/ppu_consts.vhd
+++ b/basys3/basys3.srcs/ppu_consts.vhd
@@ -1,22 +1,32 @@
+-- https://docs.google.com/spreadsheets/d/1MU6K4c4PtMR_JXIpc3I0ZJdLZNnoFO7G2P3olCz6LSc
package ppu_consts is
constant PPU_RAM_BUS_ADDR_WIDTH : natural := 16; -- RAM bus address width
constant PPU_RAM_BUS_DATA_WIDTH : natural := 16; -- RAM bus data width
constant PPU_FG_SPRITE_COUNT : natural := 128; -- amount of foreground sprites
constant PPU_COLOR_OUTPUT_DEPTH : natural := 4; -- VGA output channel depth
- constant PPU_PALETTE_IDX_WIDTH : natural := 3; -- palette index width (within sprite)
- constant PPU_PALETTE_WIDTH : natural := 3; -- palette index width (palette table)
- constant PPU_PALETTE_CIDX_WIDTH : natural := PPU_PALETTE_IDX_WIDTH + PPU_PALETTE_WIDTH; -- global palette index width
- constant PPU_TMM_ADDR_WIDTH : natural := 16;
- constant PPU_TMM_DATA_WIDTH : natural := 16;
- constant PPU_BAM_ADDR_WIDTH : natural := 11;
- constant PPU_BAM_DATA_WIDTH : natural := 15;
- constant PPU_FAM_ADDR_WIDTH : natural := 8;
- constant PPU_FAM_DATA_WIDTH : natural := 16;
- constant PPU_PAL_ADDR_WIDTH : natural := 6;
- constant PPU_PAL_DATA_WIDTH : natural := 12;
- constant PPU_AUX_ADDR_WIDTH : natural := 1;
- constant PPU_AUX_DATA_WIDTH : natural := 16;
+ constant PPU_PALETTE_COLOR_WIDTH : natural := 3; -- palette index width (within sprite)
+ constant PPU_PALETTE_INDEX_WIDTH : natural := 3; -- palette index width (palette table)
+ constant PPU_PALETTE_CIDX_WIDTH : natural := PPU_PALETTE_COLOR_WIDTH + PPU_PALETTE_INDEX_WIDTH; -- global palette index width
+ constant PPU_TMM_ADDR_WIDTH : natural := 16; -- tilemap memory ram bus address width
+ constant PPU_TMM_DATA_WIDTH : natural := 15; -- tilemap memory ram bus data width
+ constant PPU_BAM_ADDR_WIDTH : natural := 11; -- background attribute memory ram bus address width
+ constant PPU_BAM_DATA_WIDTH : natural := 15; -- background attribute memory ram bus data width
+ constant PPU_FAM_ADDR_WIDTH : natural := 8; -- foreground attribute memory ram bus address width
+ constant PPU_FAM_DATA_WIDTH : natural := 16; -- foreground attribute memory ram bus data width
+ constant PPU_PAL_ADDR_WIDTH : natural := 6; -- palette memory ram bus address width
+ constant PPU_PAL_DATA_WIDTH : natural := 12; -- palette memory ram bus data width
+ constant PPU_AUX_ADDR_WIDTH : natural := 1; -- auxiliary memory ram bus address width
+ constant PPU_AUX_DATA_WIDTH : natural := 16; -- auxiliary memory ram bus data width
constant PPU_POS_H_WIDTH : natural := 9; -- amount of bits for horizontal screen offset
constant PPU_POS_V_WIDTH : natural := 8; -- amount of bits for vertical screen offset
+ constant PPU_SPRITE_WIDTH : natural := 16; -- sprite width (pixels)
+ constant PPU_SPRITE_HEIGHT : natural := 16; -- sprite height (pixels)
+ constant PPU_SCREEN_WIDTH : natural := 320; -- absolute screen width (pixels)
+ constant PPU_SCREEN_HEIGHT : natural := 240; -- absolute screen height (pixels)
+ constant PPU_BG_CANVAS_TILES_H : natural := 40; -- amount of tiles (horizontally) on background canvas
+ constant PPU_BG_CANVAS_TILES_V : natural := 30; -- amount of tiles (vertically) on background canvas
+ constant PPU_TILE_INDEX_WIDTH : natural := 10; -- amount of bits needed to index a tile from TMM memory
+ constant PPU_PIXELS_PER_TILE_WORD : natural := 5; -- amount of pixels defined in one word in TMM memory
+ constant PPU_TILE_SIZE : natural := 48;
end package ppu_consts;