From 5479ca9545412c454e6feec0e5e5db7e4a0b2495 Mon Sep 17 00:00:00 2001 From: Stefan Voss Date: Fri, 4 Oct 2024 22:50:50 +0200 Subject: [PATCH] extra button fix --- src/tang_nano_20k_c64_top.vhd | 16 ++++++++-------- src/tang_nano_20k_c64_top_138k.vhd | 16 ++++++++-------- src/tang_nano_20k_c64_top_25k.vhd | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/tang_nano_20k_c64_top.vhd b/src/tang_nano_20k_c64_top.vhd index 5781ee2..67ec17a 100644 --- a/src/tang_nano_20k_c64_top.vhd +++ b/src/tang_nano_20k_c64_top.vhd @@ -997,23 +997,23 @@ pot4 <= pd2 when joyswap = '1' else pd4; pd1 <= not paddle_1 when port_1_sel = "0110" else joystick1_x_pos(7 downto 0) when port_1_sel = "0111" else ('0' & std_logic_vector(mouse_x_pos(6 downto 1)) & '0') when port_1_sel = "0101" else - x"00" when port_1_sel < 5 and joyA_c64(5) = '1' else - x"ff"; + x"ff" when unsigned(port_1_sel) < 5 and joyA(5) = '1' else + x"00"; pd2 <= not paddle_2 when port_1_sel = "0110" else joystick1_y_pos(7 downto 0) when port_1_sel = "0111" else ('0' & std_logic_vector(mouse_y_pos(6 downto 1)) & '0') when port_1_sel = "0101" else - x"00" when port_1_sel < 5 and joyA_c64(6) = '1' else - x"ff"; + x"ff" when unsigned(port_1_sel) < 5 and joyA(6) = '1' else + x"00"; pd3 <= not paddle_3 when port_2_sel = "0110" else joystick2_x_pos(7 downto 0) when port_2_sel = "1000" else ('0' & std_logic_vector(mouse_x_pos(6 downto 1)) & '0') when port_2_sel = "0101" else - x"00" when port_2_sel < 5 and joyB_c64(5) = '1' else - x"ff"; + x"ff" when unsigned(port_2_sel) < 5 and joyB(5) = '1' else + x"00"; pd4 <= not paddle_4 when port_2_sel = "0110" else joystick2_y_pos(7 downto 0) when port_2_sel = "1000" else ('0' & std_logic_vector(mouse_y_pos(6 downto 1)) & '0') when port_2_sel = "0101" else - x"00" when port_2_sel < 5 and joyB_c64(6) = '1' else - x"ff"; + x"ff" when unsigned(port_2_sel) < 5 and joyB(6) = '1' else + x"00"; process(clk32, reset_n) variable mov_x: signed(6 downto 0); diff --git a/src/tang_nano_20k_c64_top_138k.vhd b/src/tang_nano_20k_c64_top_138k.vhd index 67e6e88..d7b38a2 100644 --- a/src/tang_nano_20k_c64_top_138k.vhd +++ b/src/tang_nano_20k_c64_top_138k.vhd @@ -913,23 +913,23 @@ pot4 <= pd2 when joyswap = '1' else pd4; pd1 <= not paddle_1 when port_1_sel = "0110" else joystick1_x_pos(7 downto 0) when port_1_sel = "0111" else ('0' & std_logic_vector(mouse_x_pos(6 downto 1)) & '0') when port_1_sel = "0101" else - x"00" when port_1_sel < 5 and joyA_c64(5) = '1' else - x"ff"; + x"ff" when unsigned(port_1_sel) < 5 and joyA(5) = '1' else + x"00"; pd2 <= not paddle_2 when port_1_sel = "0110" else joystick1_y_pos(7 downto 0) when port_1_sel = "0111" else ('0' & std_logic_vector(mouse_y_pos(6 downto 1)) & '0') when port_1_sel = "0101" else - x"00" when port_1_sel < 5 and joyA_c64(6) = '1' else - x"ff"; + x"ff" when unsigned(port_1_sel) < 5 and joyA(6) = '1' else + x"00"; pd3 <= not paddle_3 when port_2_sel = "0110" else joystick2_x_pos(7 downto 0) when port_2_sel = "1000" else ('0' & std_logic_vector(mouse_x_pos(6 downto 1)) & '0') when port_2_sel = "0101" else - x"00" when port_2_sel < 5 and joyB_c64(5) = '1' else - x"ff"; + x"ff" when unsigned(port_2_sel) < 5 and joyB(5) = '1' else + x"00"; pd4 <= not paddle_4 when port_2_sel = "0110" else joystick2_y_pos(7 downto 0) when port_2_sel = "1000" else ('0' & std_logic_vector(mouse_y_pos(6 downto 1)) & '0') when port_2_sel = "0101" else - x"00" when port_2_sel < 5 and joyB_c64(6) = '1' else - x"ff"; + x"ff" when unsigned(port_2_sel) < 5 and joyB(6) = '1' else + x"00"; process(clk32, reset_n) variable mov_x: signed(6 downto 0); diff --git a/src/tang_nano_20k_c64_top_25k.vhd b/src/tang_nano_20k_c64_top_25k.vhd index 79fa74f..3e369fe 100644 --- a/src/tang_nano_20k_c64_top_25k.vhd +++ b/src/tang_nano_20k_c64_top_25k.vhd @@ -856,23 +856,23 @@ pot4 <= pd2 when joyswap = '1' else pd4; pd1 <= not paddle_1 when port_1_sel = "0110" else joystick1_x_pos(7 downto 0) when port_1_sel = "0111" else ('0' & std_logic_vector(mouse_x_pos(6 downto 1)) & '0') when port_1_sel = "0101" else - x"00" when port_1_sel < 5 and joyA_c64(5) = '1' else - x"ff"; + x"ff" when unsigned(port_1_sel) < 5 and joyA(5) = '1' else + x"00"; pd2 <= not paddle_2 when port_1_sel = "0110" else joystick1_y_pos(7 downto 0) when port_1_sel = "0111" else ('0' & std_logic_vector(mouse_y_pos(6 downto 1)) & '0') when port_1_sel = "0101" else - x"00" when port_1_sel < 5 and joyA_c64(6) = '1' else - x"ff"; + x"ff" when unsigned(port_1_sel) < 5 and joyA(6) = '1' else + x"00"; pd3 <= not paddle_3 when port_2_sel = "0110" else joystick2_x_pos(7 downto 0) when port_2_sel = "1000" else ('0' & std_logic_vector(mouse_x_pos(6 downto 1)) & '0') when port_2_sel = "0101" else - x"00" when port_2_sel < 5 and joyB_c64(5) = '1' else - x"ff"; + x"ff" when unsigned(port_2_sel) < 5 and joyB(5) = '1' else + x"00"; pd4 <= not paddle_4 when port_2_sel = "0110" else joystick2_y_pos(7 downto 0) when port_2_sel = "1000" else ('0' & std_logic_vector(mouse_y_pos(6 downto 1)) & '0') when port_2_sel = "0101" else - x"00" when port_2_sel < 5 and joyB_c64(6) = '1' else - x"ff"; + x"ff" when unsigned(port_2_sel) < 5 and joyB(6) = '1' else + x"00"; process(clk32, reset_n) variable mov_x: signed(6 downto 0);