I don't know enough about what behavior you want from it exactly, but if you are working in VHDL, you'll want to start with something like this:
Code:
library ieee;
use ieee.std_logic_1164.all;
entity mapper_thing is
port (
addr_in: in std_logic_vector(14 downto 0);
clk_in: in std_logic;
data_in: in std_logic_vector(7 downto 0);
-- For selecting areas in a larger ROM chip than the original bus supports
addr_out: out std_logic_vector(16 downto 0);
data_out: out std_logic_vector(7 downto 0);
mirror_out: out std_logic_vector(1 downto 0);
);
end mapper_thing;
architecture behavior of mapper_thing is
signal current_bank: std_logic_vector(7 downto 0);
signal current_mirror: std_logic_vector(1 downto 0); -- bitfield for HV mirroring?
begin
-- Just a small example to get started; this is by no means functional or complete for any reason
if ( clk'event and clk = '0' ) then -- falling edge of clock
if ( addr_in = "0101000000000001" ) then -- set bank to data value
bank <= data_in;
elsif ( addr_in = "0101000000000010" ) then -- set mirroring
current_mirror <= data_in (1 downto 0);
end if;
-- You should use a signal for this so there are no inferred latches (no good in clock-land)
mirror_out <= current_mirror;
end behavior;
That's just a stub and probably could be done a lot better, but it sort of implements the two things you referred to. I didn't even set up outputs yet, but I hope it can point you towards a little bit of the right idea.