mirror of
https://github.com/Gehstock/Mist_FPGA.git
synced 2026-03-05 10:43:41 +00:00
CleanUp
This commit is contained in:
@@ -51,7 +51,6 @@ set_global_assignment -name VHDL_FILE rtl/pace.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/pace_pkg.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/platform.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/platform_pkg.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/platform_variant_pkg.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/target_pkg.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/project_pkg.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/moon_patrol_sound_board.vhd
|
||||
@@ -61,7 +60,6 @@ set_global_assignment -name VHDL_FILE rtl/Graphics.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/clk_div.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/Z80.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/sprom.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/dprom_2r.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/dpram.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/spram.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/iremm52_video_controller.vhd
|
||||
|
||||
@@ -5,7 +5,6 @@ use IEEE.std_logic_unsigned.all;
|
||||
library work;
|
||||
use work.pace_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
use work.video_controller_pkg.all;
|
||||
|
||||
--
|
||||
|
||||
@@ -5,7 +5,6 @@ use IEEE.std_logic_unsigned.all;
|
||||
library work;
|
||||
use work.pace_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
use work.video_controller_pkg.all;
|
||||
|
||||
--
|
||||
|
||||
@@ -5,7 +5,6 @@ use IEEE.std_logic_unsigned.all;
|
||||
library work;
|
||||
use work.pace_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
use work.video_controller_pkg.all;
|
||||
|
||||
--
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
LIBRARY ieee;
|
||||
USE ieee.std_logic_1164.all;
|
||||
|
||||
LIBRARY altera_mf;
|
||||
USE altera_mf.all;
|
||||
|
||||
ENTITY dprom_2r IS
|
||||
GENERIC
|
||||
(
|
||||
INIT_FILE : string := "";
|
||||
--NUMWORDS_A : natural;
|
||||
WIDTHAD_A : natural;
|
||||
WIDTH_A : natural := 8;
|
||||
--NUMWORDS_B : natural;
|
||||
WIDTHAD_B : natural;
|
||||
WIDTH_B : natural := 8;
|
||||
outdata_reg_a : string := "UNREGISTERED";
|
||||
outdata_reg_b : string := "UNREGISTERED"
|
||||
);
|
||||
PORT
|
||||
(
|
||||
address_a : in std_logic_vector (WIDTHAD_A-1 downto 0);
|
||||
address_b : in std_logic_vector (WIDTHAD_B-1 downto 0);
|
||||
clock : in std_logic ;
|
||||
q_a : out std_logic_vector (WIDTH_A-1 downto 0);
|
||||
q_b : out std_logic_vector (WIDTH_B-1 downto 0)
|
||||
);
|
||||
END dprom_2r;
|
||||
|
||||
|
||||
ARCHITECTURE SYN OF dprom_2r IS
|
||||
|
||||
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (WIDTH_A-1 DOWNTO 0);
|
||||
SIGNAL sub_wire1 : STD_LOGIC_VECTOR (WIDTH_B-1 DOWNTO 0);
|
||||
SIGNAL sub_wire2 : STD_LOGIC ;
|
||||
SIGNAL sub_wire3_bv : BIT_VECTOR (WIDTH_A-1 DOWNTO 0);
|
||||
SIGNAL sub_wire3 : STD_LOGIC_VECTOR (WIDTH_A-1 DOWNTO 0);
|
||||
SIGNAL sub_wire4_bv : BIT_VECTOR (WIDTH_B-1 DOWNTO 0);
|
||||
SIGNAL sub_wire4 : STD_LOGIC_VECTOR (WIDTH_B-1 DOWNTO 0);
|
||||
|
||||
|
||||
|
||||
COMPONENT altsyncram
|
||||
GENERIC (
|
||||
address_reg_b : STRING;
|
||||
clock_enable_input_a : STRING;
|
||||
clock_enable_input_b : STRING;
|
||||
clock_enable_output_a : STRING;
|
||||
clock_enable_output_b : STRING;
|
||||
indata_reg_b : STRING;
|
||||
init_file : STRING;
|
||||
init_file_layout : STRING;
|
||||
intended_device_family : STRING;
|
||||
lpm_type : STRING;
|
||||
numwords_a : NATURAL;
|
||||
numwords_b : NATURAL;
|
||||
operation_mode : STRING;
|
||||
outdata_aclr_a : STRING;
|
||||
outdata_aclr_b : STRING;
|
||||
outdata_reg_a : STRING;
|
||||
outdata_reg_b : STRING;
|
||||
power_up_uninitialized : STRING;
|
||||
ram_block_type : STRING;
|
||||
widthad_a : NATURAL;
|
||||
widthad_b : NATURAL;
|
||||
width_a : NATURAL;
|
||||
width_b : NATURAL;
|
||||
width_byteena_a : NATURAL;
|
||||
width_byteena_b : NATURAL;
|
||||
wrcontrol_wraddress_reg_b : STRING
|
||||
);
|
||||
PORT (
|
||||
wren_a : IN STD_LOGIC ;
|
||||
wren_b : IN STD_LOGIC ;
|
||||
clock0 : IN STD_LOGIC ;
|
||||
address_a : IN STD_LOGIC_VECTOR (WIDTHAD_A-1 DOWNTO 0);
|
||||
address_b : IN STD_LOGIC_VECTOR (WIDTHAD_B-1 DOWNTO 0);
|
||||
q_a : OUT STD_LOGIC_VECTOR (WIDTH_A-1 DOWNTO 0);
|
||||
q_b : OUT STD_LOGIC_VECTOR (WIDTH_B-1 DOWNTO 0);
|
||||
data_a : IN STD_LOGIC_VECTOR (WIDTH_A-1 DOWNTO 0);
|
||||
data_b : IN STD_LOGIC_VECTOR (WIDTH_B-1 DOWNTO 0)
|
||||
);
|
||||
END COMPONENT;
|
||||
|
||||
BEGIN
|
||||
sub_wire2 <= '0';
|
||||
sub_wire3_bv(WIDTH_A-1 DOWNTO 0) <= (others => '0');
|
||||
sub_wire3 <= To_stdlogicvector(sub_wire3_bv);
|
||||
sub_wire4_bv(WIDTH_B-1 DOWNTO 0) <= (others => '0');
|
||||
sub_wire4 <= To_stdlogicvector(sub_wire4_bv);
|
||||
q_a <= sub_wire0(WIDTH_A-1 DOWNTO 0);
|
||||
q_b <= sub_wire1(WIDTH_B-1 DOWNTO 0);
|
||||
|
||||
altsyncram_component : altsyncram
|
||||
GENERIC MAP (
|
||||
address_reg_b => "CLOCK0",
|
||||
clock_enable_input_a => "BYPASS",
|
||||
clock_enable_input_b => "BYPASS",
|
||||
clock_enable_output_a => "BYPASS",
|
||||
clock_enable_output_b => "BYPASS",
|
||||
indata_reg_b => "CLOCK0",
|
||||
init_file => INIT_FILE,
|
||||
init_file_layout => "PORT_A",
|
||||
intended_device_family => "Cyclone III",
|
||||
lpm_type => "altsyncram",
|
||||
numwords_a => 2**WIDTHAD_A,
|
||||
numwords_b => 2**WIDTHAD_B,
|
||||
operation_mode => "BIDIR_DUAL_PORT",
|
||||
outdata_aclr_a => "NONE",
|
||||
outdata_aclr_b => "NONE",
|
||||
outdata_reg_a => outdata_reg_a,
|
||||
outdata_reg_b => outdata_reg_b,
|
||||
power_up_uninitialized => "FALSE",
|
||||
ram_block_type => "M9K",
|
||||
widthad_a => WIDTHAD_A,
|
||||
widthad_b => WIDTHAD_B,
|
||||
width_a => WIDTH_A,
|
||||
width_b => WIDTH_B,
|
||||
width_byteena_a => 1,
|
||||
width_byteena_b => 1,
|
||||
wrcontrol_wraddress_reg_b => "CLOCK0"
|
||||
)
|
||||
PORT MAP (
|
||||
wren_a => sub_wire2,
|
||||
wren_b => sub_wire2,
|
||||
clock0 => clock,
|
||||
address_a => address_a,
|
||||
address_b => address_b,
|
||||
data_a => sub_wire3,
|
||||
data_b => sub_wire4,
|
||||
q_a => sub_wire0,
|
||||
q_b => sub_wire1
|
||||
);
|
||||
|
||||
END SYN;
|
||||
@@ -4,7 +4,6 @@ use ieee.numeric_std.all;
|
||||
|
||||
library work;
|
||||
use work.video_controller_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
|
||||
entity iremm52_video_controller is
|
||||
port
|
||||
|
||||
@@ -7,7 +7,6 @@ library work;
|
||||
use work.pace_pkg.all;
|
||||
use work.video_controller_pkg.all;
|
||||
use work.sprite_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
|
||||
entity platform is
|
||||
@@ -404,38 +403,26 @@ port map(
|
||||
|
||||
tilemap_o(1).tile_d(15 downto 0) <= chr_rom_d(0) & chr_rom_d(1);
|
||||
|
||||
|
||||
rom71 : entity work.mpb_23m
|
||||
rom7 : entity work.mpb_23m
|
||||
port map(
|
||||
clk => clk_video,
|
||||
addr => sprite_i.a(11 downto 5) & '0' & sprite_i.a(3 downto 0),
|
||||
data => spr_rom_left(0)
|
||||
addr_a => sprite_i.a(11 downto 5) & '0' & sprite_i.a(3 downto 0),
|
||||
data_a => spr_rom_left(0),
|
||||
addr_b => sprite_i.a(11 downto 5) & '1' & sprite_i.a(3 downto 0),
|
||||
data_b => spr_rom_right(0)
|
||||
);
|
||||
|
||||
rom72 : entity work.mpb_23m
|
||||
rom8 : entity work.mpb_13n
|
||||
port map(
|
||||
clk => clk_video,
|
||||
addr => sprite_i.a(11 downto 5) & '1' & sprite_i.a(3 downto 0),
|
||||
data => spr_rom_right(0)
|
||||
addr_a => sprite_i.a(11 downto 5) & '0' & sprite_i.a(3 downto 0),
|
||||
data_a => spr_rom_left(1),
|
||||
addr_b => sprite_i.a(11 downto 5) & '1' & sprite_i.a(3 downto 0),
|
||||
data_b => spr_rom_right(1)
|
||||
);
|
||||
|
||||
rom81 : entity work.mpb_13n
|
||||
port map(
|
||||
clk => clk_video,
|
||||
addr => sprite_i.a(11 downto 5) & '0' & sprite_i.a(3 downto 0),
|
||||
data => spr_rom_left(1)
|
||||
);
|
||||
|
||||
rom82 : entity work.mpb_13n
|
||||
port map(
|
||||
clk => clk_video,
|
||||
addr => sprite_i.a(11 downto 5) & '1' & sprite_i.a(3 downto 0),
|
||||
data => spr_rom_right(1)
|
||||
);
|
||||
|
||||
sprite_o.d(sprite_o.d'left downto 32) <= (others => '0');
|
||||
sprite_o.d(31 downto 0) <= spr_rom_left(0) & spr_rom_right(0) &
|
||||
spr_rom_left(1) & spr_rom_right(1);
|
||||
sprite_o.d(sprite_o.d'left downto 32) <= (others => '0');
|
||||
sprite_o.d(31 downto 0) <= spr_rom_left(0) & spr_rom_right(0) & spr_rom_left(1) & spr_rom_right(1);
|
||||
|
||||
rom9 : entity work.mpe_13l
|
||||
port map(
|
||||
@@ -478,7 +465,8 @@ vram_inst : entity work.dpram
|
||||
data_a => (others => 'X'),
|
||||
q_a => tilemap_o(1).map_d(7 downto 0)
|
||||
);
|
||||
tilemap_o(1).map_d(15 downto 8) <= (others => '0');
|
||||
|
||||
tilemap_o(1).map_d(15 downto 8) <= (others => '0');
|
||||
|
||||
cram_inst : entity work.dpram
|
||||
generic map
|
||||
@@ -501,7 +489,7 @@ cram_inst : entity work.dpram
|
||||
q_a => tilemap_o(1).attr_d(7 downto 0)
|
||||
);
|
||||
|
||||
tilemap_o(1).attr_d(15 downto 8) <= (others => '0');
|
||||
tilemap_o(1).attr_d(15 downto 8) <= (others => '0');
|
||||
|
||||
wram_inst : entity work.spram
|
||||
generic map
|
||||
|
||||
@@ -24,8 +24,8 @@ package platform_pkg is
|
||||
-- Platform-specific constants (optional)
|
||||
--
|
||||
|
||||
constant PLATFORM : string := "m52";
|
||||
constant PLATFORM_SRC_DIR : string := "";
|
||||
-- constant PLATFORM : string := "m52";
|
||||
-- constant PLATFORM_SRC_DIR : string := "";
|
||||
|
||||
constant CLK0_FREQ_MHz : natural :=
|
||||
PACE_CLKIN0 * PACE_CLK0_MULTIPLY_BY / PACE_CLK0_DIVIDE_BY;
|
||||
@@ -35,6 +35,163 @@ package platform_pkg is
|
||||
|
||||
type pal_rgb_t is array (0 to 2) of std_logic_vector(7 downto 0);
|
||||
type pal_a is array (natural range <>) of pal_rgb_t;
|
||||
|
||||
constant tile_pal : pal_a(0 to 127) :=
|
||||
(
|
||||
1 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
2 => (0=>"11111111", 1=>"11111111", 2=>"11111111"),
|
||||
3 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
4 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
5 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
6 => (0=>"11111111", 1=>"11111111", 2=>"00000000"),
|
||||
7 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
8 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
9 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
10 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
11 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
12 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
13 => (0=>"00000000", 1=>"10111000", 2=>"00000000"),
|
||||
14 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
17 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
19 => (0=>"10010111", 1=>"01101000", 2=>"01010001"),
|
||||
20 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
21 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
24 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
25 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
26 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
27 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
28 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
29 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
33 => (0=>"11111111", 1=>"11111111", 2=>"11111111"),
|
||||
36 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
37 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
38 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
40 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
41 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
44 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
45 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
46 => (0=>"00100001", 1=>"01000111", 2=>"10101110"),
|
||||
47 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
48 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
49 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
50 => (0=>"11111111", 1=>"11111111", 2=>"00000000"),
|
||||
51 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
52 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
53 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
54 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
55 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
56 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
57 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
58 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
61 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
62 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
63 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
65 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
66 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
67 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
69 => (0=>"11111111", 1=>"00000000", 2=>"00000000"),
|
||||
70 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
71 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
73 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
74 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
75 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
77 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
78 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
79 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
81 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
82 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
83 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
others => (others => (others => '0'))
|
||||
);
|
||||
|
||||
constant bg_pal : pal_a(0 to 31) :=
|
||||
(
|
||||
1 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
3 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
4 => (0=>"00000000", 1=>"00000000", 2=>"11111111"),
|
||||
5 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
7 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
9 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
11 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
12 => (0=>"00000000", 1=>"10010111", 2=>"10101110"),
|
||||
13 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
15 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
18 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
19 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
20 => (0=>"00000000", 1=>"00000000", 2=>"11111111"),
|
||||
22 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
23 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
26 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
27 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
28 => (0=>"00000000", 1=>"10010111", 2=>"10101110"),
|
||||
30 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
31 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
others => (others => (others => '0'))
|
||||
);
|
||||
|
||||
constant sprite_pal : pal_a(0 to 15) :=
|
||||
(
|
||||
1 => (0=>"00000000", 1=>"00000000", 2=>"00011010"),
|
||||
2 => (0=>"11000001", 1=>"00000000", 2=>"10101110"),
|
||||
3 => (0=>"00000000", 1=>"10101110", 2=>"11001000"),
|
||||
4 => (0=>"10000100", 1=>"11001000", 2=>"00000000"),
|
||||
5 => (0=>"11000001", 1=>"00000000", 2=>"00000000"),
|
||||
6 => (0=>"00000000", 1=>"11001000", 2=>"00000000"),
|
||||
7 => (0=>"10000100", 1=>"00000000", 2=>"00000000"),
|
||||
8 => (0=>"11000001", 1=>"11001000", 2=>"11001000"),
|
||||
9 => (0=>"11000001", 1=>"11001000", 2=>"00000000"),
|
||||
10 => (0=>"10000100", 1=>"01010001", 2=>"00000000"),
|
||||
11 => (0=>"00111110", 1=>"00110111", 2=>"00000000"),
|
||||
12 => (0=>"00111110", 1=>"00000000", 2=>"11001000"),
|
||||
13 => (0=>"11000001", 1=>"10010000", 2=>"00000000"),
|
||||
14 => (0=>"00111110", 1=>"10010000", 2=>"11001000"),
|
||||
15 => (0=>"00000000", 1=>"01010001", 2=>"00000000"),
|
||||
others => (others => (others => '0'))
|
||||
);
|
||||
|
||||
type table_a is array (natural range <>) of integer range 0 to 15;
|
||||
constant sprite_table : table_a(0 to 63) :=
|
||||
(
|
||||
1 => 1,
|
||||
2 => 2,
|
||||
3 => 3,
|
||||
5 => 4,
|
||||
6 => 2,
|
||||
7 => 5,
|
||||
9 => 5,
|
||||
10 => 6,
|
||||
11 => 7,
|
||||
13 => 7,
|
||||
14 => 8,
|
||||
15 => 9,
|
||||
17 => 10,
|
||||
19 => 11,
|
||||
29 => 9,
|
||||
30 => 14,
|
||||
31 => 5,
|
||||
33 => 5,
|
||||
34 => 3,
|
||||
35 => 15,
|
||||
37 => 9,
|
||||
38 => 1,
|
||||
39 => 5,
|
||||
41 => 1,
|
||||
42 => 8,
|
||||
45 => 1,
|
||||
46 => 5,
|
||||
49 => 1,
|
||||
50 => 5,
|
||||
51 => 3,
|
||||
53 => 4,
|
||||
54 => 13,
|
||||
55 => 5,
|
||||
57 => 5,
|
||||
59 => 5,
|
||||
62 => 5,
|
||||
63 => 5,
|
||||
others => 0
|
||||
);
|
||||
|
||||
|
||||
type from_PLATFORM_IO_t is record
|
||||
not_used : std_logic;
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
library work;
|
||||
use work.target_pkg.all;
|
||||
use work.project_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
|
||||
package platform_variant_pkg is
|
||||
|
||||
--
|
||||
-- PACE constants which *MUST* be defined
|
||||
--
|
||||
|
||||
--
|
||||
-- Platform-specific constants (optional)
|
||||
--
|
||||
|
||||
-- constant PLATFORM_VARIANT : string := "mpatrol";
|
||||
constant PLATFORM_VARIANT_SRC_DIR : string := "";
|
||||
type rom_a is array (natural range <>) of string;
|
||||
-- constant M52_ROM : rom_a(0 to 3) :=
|
||||
-- (
|
||||
-- 0 => "mpa-1.3m",
|
||||
-- 1 => "mpa-2.3l",
|
||||
-- 2 => "mpa-3.3k",
|
||||
-- 3 => "mpa-4.3j"
|
||||
-- );
|
||||
-- constant M52_ROM_WIDTHAD : natural := 12;
|
||||
|
||||
-- constant M52_CHAR_ROM : rom_a(0 to 1) :=
|
||||
-- (
|
||||
-- 0 => "mpe-5.3e",
|
||||
-- 1 => "mpe-4.3f"
|
||||
-- );
|
||||
|
||||
constant M52_SPRITE_ROM : rom_a(0 to 1) :=
|
||||
(
|
||||
0 => "mpb-2.3m",
|
||||
1 => "mpb-1.3n"
|
||||
);
|
||||
|
||||
-- constant M52_BG_ROM : rom_a(0 to 2) :=
|
||||
-- (
|
||||
-- 2 => "mpe-1.3l", -- mountains
|
||||
-- 1 => "mpe-2.3k", -- hills
|
||||
-- 0 => "mpe-3.3h" -- cityscape
|
||||
-- );
|
||||
|
||||
constant tile_pal : pal_a(0 to 127) :=
|
||||
(
|
||||
1 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
2 => (0=>"11111111", 1=>"11111111", 2=>"11111111"),
|
||||
3 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
4 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
5 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
6 => (0=>"11111111", 1=>"11111111", 2=>"00000000"),
|
||||
7 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
8 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
9 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
10 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
11 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
12 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
13 => (0=>"00000000", 1=>"10111000", 2=>"00000000"),
|
||||
14 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
17 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
19 => (0=>"10010111", 1=>"01101000", 2=>"01010001"),
|
||||
20 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
21 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
24 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
25 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
26 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
27 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
28 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
29 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
33 => (0=>"11111111", 1=>"11111111", 2=>"11111111"),
|
||||
36 => (0=>"00000000", 1=>"00100001", 2=>"11111111"),
|
||||
37 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
38 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
40 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
41 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
44 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
45 => (0=>"11111111", 1=>"00000000", 2=>"10101110"),
|
||||
46 => (0=>"00100001", 1=>"01000111", 2=>"10101110"),
|
||||
47 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
48 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
49 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
50 => (0=>"11111111", 1=>"11111111", 2=>"00000000"),
|
||||
51 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
52 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
53 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
54 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
55 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
56 => (0=>"10111000", 1=>"01101000", 2=>"10101110"),
|
||||
57 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
58 => (0=>"11111111", 1=>"00100001", 2=>"00000000"),
|
||||
61 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
62 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
63 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
65 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
66 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
67 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
69 => (0=>"11111111", 1=>"00000000", 2=>"00000000"),
|
||||
70 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
71 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
73 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
74 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
75 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
77 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
78 => (0=>"10111000", 1=>"11111111", 2=>"10101110"),
|
||||
79 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
81 => (0=>"11111111", 1=>"10010111", 2=>"01010001"),
|
||||
82 => (0=>"00000000", 1=>"10111000", 2=>"11111111"),
|
||||
83 => (0=>"00100001", 1=>"00000000", 2=>"00000000"),
|
||||
others => (others => (others => '0'))
|
||||
);
|
||||
|
||||
constant bg_pal : pal_a(0 to 31) :=
|
||||
(
|
||||
1 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
3 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
4 => (0=>"00000000", 1=>"00000000", 2=>"11111111"),
|
||||
5 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
7 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
9 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
11 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
12 => (0=>"00000000", 1=>"10010111", 2=>"10101110"),
|
||||
13 => (0=>"00000000", 1=>"10010111", 2=>"00000000"),
|
||||
15 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
18 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
19 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
20 => (0=>"00000000", 1=>"00000000", 2=>"11111111"),
|
||||
22 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
23 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
26 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
27 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
28 => (0=>"00000000", 1=>"10010111", 2=>"10101110"),
|
||||
30 => (0=>"11111111", 1=>"11011110", 2=>"01010001"),
|
||||
31 => (0=>"00000000", 1=>"11011110", 2=>"01010001"),
|
||||
others => (others => (others => '0'))
|
||||
);
|
||||
|
||||
constant sprite_pal : pal_a(0 to 15) :=
|
||||
(
|
||||
1 => (0=>"00000000", 1=>"00000000", 2=>"00011010"),
|
||||
2 => (0=>"11000001", 1=>"00000000", 2=>"10101110"),
|
||||
3 => (0=>"00000000", 1=>"10101110", 2=>"11001000"),
|
||||
4 => (0=>"10000100", 1=>"11001000", 2=>"00000000"),
|
||||
5 => (0=>"11000001", 1=>"00000000", 2=>"00000000"),
|
||||
6 => (0=>"00000000", 1=>"11001000", 2=>"00000000"),
|
||||
7 => (0=>"10000100", 1=>"00000000", 2=>"00000000"),
|
||||
8 => (0=>"11000001", 1=>"11001000", 2=>"11001000"),
|
||||
9 => (0=>"11000001", 1=>"11001000", 2=>"00000000"),
|
||||
10 => (0=>"10000100", 1=>"01010001", 2=>"00000000"),
|
||||
11 => (0=>"00111110", 1=>"00110111", 2=>"00000000"),
|
||||
12 => (0=>"00111110", 1=>"00000000", 2=>"11001000"),
|
||||
13 => (0=>"11000001", 1=>"10010000", 2=>"00000000"),
|
||||
14 => (0=>"00111110", 1=>"10010000", 2=>"11001000"),
|
||||
15 => (0=>"00000000", 1=>"01010001", 2=>"00000000"),
|
||||
others => (others => (others => '0'))
|
||||
);
|
||||
|
||||
type table_a is array (natural range <>) of integer range 0 to 15;
|
||||
constant sprite_table : table_a(0 to 63) :=
|
||||
(
|
||||
1 => 1,
|
||||
2 => 2,
|
||||
3 => 3,
|
||||
5 => 4,
|
||||
6 => 2,
|
||||
7 => 5,
|
||||
9 => 5,
|
||||
10 => 6,
|
||||
11 => 7,
|
||||
13 => 7,
|
||||
14 => 8,
|
||||
15 => 9,
|
||||
17 => 10,
|
||||
19 => 11,
|
||||
29 => 9,
|
||||
30 => 14,
|
||||
31 => 5,
|
||||
33 => 5,
|
||||
34 => 3,
|
||||
35 => 15,
|
||||
37 => 9,
|
||||
38 => 1,
|
||||
39 => 5,
|
||||
41 => 1,
|
||||
42 => 8,
|
||||
45 => 1,
|
||||
46 => 5,
|
||||
49 => 1,
|
||||
50 => 5,
|
||||
51 => 3,
|
||||
53 => 4,
|
||||
54 => 13,
|
||||
55 => 5,
|
||||
57 => 5,
|
||||
59 => 5,
|
||||
62 => 5,
|
||||
63 => 5,
|
||||
others => 0
|
||||
);
|
||||
|
||||
end package platform_variant_pkg;
|
||||
@@ -4,8 +4,10 @@ use ieee.std_logic_1164.all,ieee.numeric_std.all;
|
||||
entity mpb_13n is
|
||||
port (
|
||||
clk : in std_logic;
|
||||
addr : in std_logic_vector(11 downto 0);
|
||||
data : out std_logic_vector(7 downto 0)
|
||||
addr_a : in std_logic_vector(11 downto 0);
|
||||
data_a : out std_logic_vector(7 downto 0);
|
||||
addr_b : in std_logic_vector(11 downto 0);
|
||||
data_b : out std_logic_vector(7 downto 0)
|
||||
);
|
||||
end entity;
|
||||
|
||||
@@ -272,7 +274,8 @@ begin
|
||||
process(clk)
|
||||
begin
|
||||
if rising_edge(clk) then
|
||||
data <= rom_data(to_integer(unsigned(addr)));
|
||||
data_a <= rom_data(to_integer(unsigned(addr_a)));
|
||||
data_b <= rom_data(to_integer(unsigned(addr_b)));
|
||||
end if;
|
||||
end process;
|
||||
end architecture;
|
||||
|
||||
@@ -4,8 +4,10 @@ use ieee.std_logic_1164.all,ieee.numeric_std.all;
|
||||
entity mpb_23m is
|
||||
port (
|
||||
clk : in std_logic;
|
||||
addr : in std_logic_vector(11 downto 0);
|
||||
data : out std_logic_vector(7 downto 0)
|
||||
addr_a : in std_logic_vector(11 downto 0);
|
||||
data_a : out std_logic_vector(7 downto 0);
|
||||
addr_b : in std_logic_vector(11 downto 0);
|
||||
data_b : out std_logic_vector(7 downto 0)
|
||||
);
|
||||
end entity;
|
||||
|
||||
@@ -272,7 +274,8 @@ begin
|
||||
process(clk)
|
||||
begin
|
||||
if rising_edge(clk) then
|
||||
data <= rom_data(to_integer(unsigned(addr)));
|
||||
data_a <= rom_data(to_integer(unsigned(addr_a)));
|
||||
data_b <= rom_data(to_integer(unsigned(addr_b)));
|
||||
end if;
|
||||
end process;
|
||||
end architecture;
|
||||
|
||||
@@ -7,8 +7,7 @@ use work.pace_pkg.all;
|
||||
use work.video_controller_pkg.all;
|
||||
use work.sprite_pkg.all;
|
||||
use work.project_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
|
||||
entity spritectl is
|
||||
generic
|
||||
|
||||
@@ -6,7 +6,6 @@ library work;
|
||||
use work.pace_pkg.all;
|
||||
use work.project_pkg.all;
|
||||
use work.platform_pkg.all;
|
||||
use work.platform_variant_pkg.all;
|
||||
use work.video_controller_pkg.all;
|
||||
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user