1
0
mirror of https://github.com/mist-devel/mist-board.git synced 2026-04-27 04:47:18 +00:00

Merge pull request #100 from gyurco/c64

C64
This commit is contained in:
gyurco
2019-04-21 19:51:25 +02:00
committed by GitHub
3 changed files with 48 additions and 29 deletions

View File

@@ -55,6 +55,8 @@ entity fpga64_keyboard_matrix is
disk_num : out std_logic_vector(7 downto 0);
cart_detach_key : out std_logic; -- CTRL D - remove active cartridge signal - LCA
tapPlayStopKey: out std_logic;
-- Config
-- backwardsReadingEnabled = 1 allows reversal of PIA registers to still work.
@@ -366,6 +368,7 @@ begin
joySelKey <= '0';
diskChgKey <= '0';
cart_detach_key <= '0';
tapPlayStopKey <= '0';
if newScanCode = '1' then
if theScanCode=X"F0" then
releaseFlag <= '1';
@@ -458,7 +461,8 @@ begin
when X"72" => if extendedFlag = '0' then joyKeys(1) <= not releaseFlag; else key_down <= not releaseFlag; end if;
when X"74" => if extendedFlag = '0' then joyKeys(3) <= not releaseFlag; else key_right <= not releaseFlag; end if;
when X"75" => if extendedFlag = '0' then joyKeys(0) <= not releaseFlag; else key_up <= not releaseFlag; end if;
when X"76" => key_runstop <= not releaseFlag;
when X"76" => key_runstop <= not releaseFlag;
when X"7D" => if extendedFlag = '1' then tapPlayStopKey <= not releaseFlag; end if; -- pg up
when others => null;
end case;
end if;

View File

@@ -45,6 +45,7 @@ entity fpga64_sid_iec is
kbd_dat : in std_logic;
reset_key : out std_logic;
cart_detach_key : out std_logic;
tap_playstop_key : out std_logic;
-- external memory
ramAddr : out unsigned(15 downto 0);
@@ -283,7 +284,12 @@ architecture rtl of fpga64_sid_iec is
signal ntscMode : std_logic;
signal ntscModeInvert : std_logic := '0' ;
signal restore_key : std_logic;
signal cd4066_sigA : std_logic_vector(7 downto 0);
signal cd4066_sigB : std_logic_vector(7 downto 0);
signal cd4066_sigC : std_logic_vector(7 downto 0);
signal cd4066_sigD : std_logic_vector(7 downto 0);
signal clk_1MHz : std_logic_vector(31 downto 0);
signal voice_l : signed(17 downto 0);
signal voice_r : signed(17 downto 0);
@@ -610,12 +616,13 @@ div1m: process(clk32) -- this process devides 32 MHz to 1MHz (for the SID)
sid_do8580_r;
-- CD4066 analogue switch
pot_x <= potA_x when cia1_pao(6) = '1' else
potB_x when cia1_pao(7) = '1' else
x"FF";
pot_y <= potA_y when cia1_pao(6) = '1' else
potB_y when cia1_pao(7) = '1' else
x"FF";
cd4066_sigA <= x"FF" when cia1_pao(7) = '0' else potB_x;
cd4066_sigB <= x"FF" when cia1_pao(7) = '0' else potB_y;
cd4066_sigC <= x"FF" when cia1_pao(6) = '0' else potA_x;
cd4066_sigD <= x"FF" when cia1_pao(6) = '0' else potA_y;
pot_x <= cd4066_sigA and cd4066_sigC;
pot_y <= cd4066_sigB and cd4066_sigD;
second_sid_en <= '0' when sid_mode(0) = '0' else
'1' when cpuAddr(11 downto 8) = x"4" and cpuAddr(5) = '1' else -- D420
@@ -799,8 +806,9 @@ div1m: process(clk32) -- this process devides 32 MHz to 1MHz (for the SID)
reset_key => reset_key,
restore_key => restore_key,
cart_detach_key => cart_detach_key, -- cartridge detach key CTRL-D - LCA
tapPlayStopKey => tap_playstop_key,
disk_num => disk_num,
backwardsReadingEnabled => '1'
);

View File

@@ -530,7 +530,8 @@ end component cartridge;
signal tap_wrreq : std_logic;
signal tap_wrfull : std_logic;
signal tap_fifo_error : std_logic;
signal tap_version : std_logic;
signal tap_version : std_logic;
signal tap_playstop_key : std_logic;
signal reset_counter : integer;
signal reset_n : std_logic;
@@ -560,6 +561,7 @@ begin
iec_cycle <= '1' when ces = "1011" else '0';
sd_sdhc <= '1';
sd_conf <= '0';
-- User io
user_io_d : user_io
generic map (STRLEN => CONF_STR'length)
@@ -579,21 +581,7 @@ begin
conf_str => to_slv(CONF_STR),
-- map status word (12 and 1 are not used)
status(18) => st_tape_sound,
status(17) => st_tap_play_btn,
status(16) => st_disk_readonly,
status(15 downto 13) => st_sid_mode,
status(11) => st_c64gs,
status(10 downto 8) => st_scandoubler_fx,
status(7) => st_user_port_uart,
status(6) => st_audio_filter_off,
status(5) => st_detach_cartdrige,
status(4) => st_cia_mode,
status(3) => st_swap_joystick,
status(2) => st_ntsc,
status(0) => st_reset,
status => status,
buttons => buttons,
scandoubler_disable => tv15Khz_mode,
ypbpr => ypbpr,
@@ -618,6 +606,22 @@ begin
mouse_strobe => mouse_strobe
);
st_tape_sound <= status(18);
st_tap_play_btn <= status(17);
st_disk_readonly <= status(16);
st_sid_mode <= status(15 downto 13);
st_c64gs <= status(11);
st_scandoubler_fx <= status(10 downto 8);
st_user_port_uart <= status(7);
st_audio_filter_off <= status(6);
st_detach_cartdrige <= status(5);
st_cia_mode <= status(4);
st_swap_joystick <= status(3);
st_ntsc <= status(2);
st_reset <= status(0);
ioctl_force_erase <= '0';
data_io_d: data_io
port map (
clk_sys => clk_c64,
@@ -1082,6 +1086,7 @@ begin
c64rom_data => ioctl_data,
c64rom_wr => c64rom_wr,
-- cart_detach_key => cart_detach_key,
tap_playstop_key => tap_playstop_key,
reset_key => reset_key
);
@@ -1119,7 +1124,7 @@ begin
end process;
-- connect user port
process (pa2_out, pb_out, joyC_c64, joyD_c64, UART_RX, status)
process (pa2_out, pb_out, joyC_c64, joyD_c64, UART_RX, st_user_port_uart)
begin
pa2_in <= pa2_out;
if st_user_port_uart = '0' then
@@ -1128,10 +1133,12 @@ begin
UART_TX <= '0';
pb_in(7 downto 6) <= pb_out(7 downto 6);
if pb_out(7) = '1' then
pb_in(5 downto 0) <= not joyC_c64(5 downto 0);
pb_in(3 downto 0) <= not joyC_c64(3 downto 0);
else
pb_in(5 downto 0) <= not joyD_c64(5 downto 0);
pb_in(3 downto 0) <= not joyD_c64(3 downto 0);
end if;
pb_in(4) <= not joyC_c64(4);
pb_in(5) <= not joyD_c64(4);
else
-- UART
pb_in(7 downto 1) <= pb_out(7 downto 1);
@@ -1272,7 +1279,7 @@ begin
cass_write => cass_write,
cass_motor => cass_motor,
cass_sense => cass_sense,
osd_play_stop_toggle => st_tap_play_btn,
osd_play_stop_toggle => st_tap_play_btn or tap_playstop_key,
ear_input => UART_RX and not st_user_port_uart
);