Quote:
|
I wanted to mean that checking /CS2 signal you know if that cartridge slot is being accesed in #4000-#BFFF
Then you can check /WR to know if it is a writing operation and D0 to get bit 0 of the data bus.
In this way you can make simple test from BASIC:
poke &hf677,&hc0 <= change BASIC program memory area
out &ha8,&b11010000 <= select slot 1 in #8000-#BFFF (short way)
out &ha8,inp(&ha8)AND&b11001111OR&b00010000 <= select slot 1 in #8000-#BFFF (long way)
poke &h8000,1 <= D0 = 1 - Led ON
poke &h8000,0 <= D0 = 0 - Led OFF
|
Great.
The VHDL code would be something like the code below.
The EPM 3064 will have only 34 pins available. For this tests, I will ignore 8 bits from the MSB, and read only 8 bits from the LSB address. That's way "a : in std_logic_vector(7 downto 0) ".
entity msx_top is
port
(
msx_clock : in std_logic;
leds : out std_logic_vector(7 downto 0);
cs2_n : in std_logic;
wr_n : in std_logic;
rd_n : in std_logic;
a : in std_logic_vector(7 downto 0); --- map only 8 bits form the MSX address bus
d : inout std_logic_vector(7 downto 0)
);
end msx_top;
architecture rtl of msx_top is
signal leds_sig : std_logic_vector(7 downto 0);
begin
process (msx_clock)
begin
leds <= leds_sig;
if msx_clock'event and msx_clock = '1' then
if cs2_n = '0' and wr_n = '0' then
if a = "00000000" then
leds <= d;
elsif cs2_n = '0' and rd_n = '0' then
if a = "00000000" then
d <= leds_sig;
end if;
end if;
end if;
end if;
end process;
end rtl;
With one Poke, it will light up 8 leds. Every bit of the data will control one led.
The code generates a latch, so the leds will remain with the state of the last poke.
Reasonable?
Tell me one more thing: I will need to use BUSDIR to tell the MSX that the data is available for read in the bus ?
thanks.