
Сообщение от
dosikus
Спрашивается и на фига спрашивал, если в ts-conf на реверс_у16 джойстик выпилен на?
Да, посмотрел по коду - действительно был выпилен!) Я то себе запилил джойстик, правда вот эту модельку, но и любую другую - не трудно сделать)
deserializer.vhd
после
Код:
architecture rtl of deserializer is
добавить
Код:
--joystick
signal lr, ud : std_logic_vector(7 downto 0);
signal jdir : std_logic_vector(3 downto 0);
signal j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12 : std_logic;
найти эту строку
заменить на эту
Код:
when x"6" | x"4" => -- Keyboard & Joystick
Далее найти на каких байтах и битах джойстика какая кнопка висит и по аналогии можно запилить джой
Для Dialog GP-A11RF у меня получился такой код
Код:
when x"04" | x"84" => -- HID Gamepad DIALOG GP-A11RF
-- Input report - 8 bytes
-- Byte | D7 D6 D5 D4 D3 D2 D1 D0
-- ------+---------------------------------------------------------------------
-- 1 |nLeft Right 0 0 0 0 0 0
-- 2 | nUp Down 0 0 0 0 0 0
-- 3 | 0 0 0 0 0 0 0 0
-- 4 | 0 0 0 0 0 0 0 0
-- 5 | (4) (3) (2) (1) [ ANALOG DIRECTION BUTTONS ]
-- 6 | (12) (11) (10) (9) (8) (7) (6) (5)
-- 7 | 0 0 0 0 0 0 0 0
-- 8 | 0 0 0 0 0 0 0 0
case count is
when 1 =>
lr <= data;
when 2 =>
ud <= data;
when 5 =>
jdir <= data(3 downto 0);
j1 <= data(4);
j2 <= data(5);
j3 <= data(6);
j4 <= data(7);
when 6 =>
j5 <= data(0);
j6 <= data(1);
j7 <= data(2);
j8 <= data(3);
j9 <= data(4);
j10 <= data(5);
j11 <= data(6);
j12 <= data(7);
when others => null;
end case;
case lr is
when x"00" => keys(0)(0) <= '0'; keys(3)(4) <= '0'; scancode <= x"6b"; -- (L) Left
when x"FF" => keys(0)(0) <= '0'; keys(4)(2) <= '0'; scancode <= x"74"; -- (R) Right
when others => null;
end case;
case ud is
when x"00" => keys(0)(0) <= '0'; keys(4)(3) <= '0'; scancode <= x"75"; -- (U) Up
when x"FF" => keys(0)(0) <= '0'; keys(4)(4) <= '0'; scancode <= x"72"; -- (D) Down
when others => null;
end case;
case jdir is
when x"0" => keys(2)(0) <= '0'; scancode <= x"15"; -- (aUp) Q
when x"2" => keys(5)(0) <= '0'; scancode <= x"4d"; -- (aRight) P
when x"4" => keys(1)(0) <= '0'; scancode <= x"1c"; -- (aDown) A
when x"6" => keys(5)(1) <= '0'; scancode <= x"44"; -- (aLeft) O
when x"1" => keys(2)(0) <= '0'; keys(5)(0) <= '0'; scancode <= x"15"; scancode <= x"4d"; -- (aUp-aRight) Q-P
when x"3" => keys(1)(0) <= '0'; keys(5)(0) <= '0'; scancode <= x"1c"; scancode <= x"4d"; -- (aDown-aRight) A-P
when x"5" => keys(1)(0) <= '0'; keys(5)(1) <= '0'; scancode <= x"1c"; scancode <= x"44"; -- (aDown-aLeft) A-O
when x"7" => keys(2)(0) <= '0'; keys(5)(1) <= '0'; scancode <= x"15"; scancode <= x"44"; -- (aUp-aLeft) Q-O
when others => null;
end case;
if j1 = '1' then keys(3)(0) <= '0'; scancode <= x"16"; end if; -- (1) 1
if j2 = '1' then keys(3)(1) <= '0'; scancode <= x"1e"; end if; -- (2) 2
if j3 = '1' then keys(7)(0) <= '0'; scancode <= x"29"; end if; -- (3) Space
if j4 = '1' then keys(3)(2) <= '0'; scancode <= x"26"; end if; -- (4) 3
if j5 = '1' then keys(0)(0) <= '0'; scancode <= X"12"; end if; -- (5) LShift
if j6 = '1' then scancode <= x"76"; end if; -- (6) ESC
if j7 = '1' then keys(9)(0) <= '1'; scancode <= x"07"; end if; -- (7) F12 (RESET)
if j8 = '1' then keys(0)(0) <= '0'; keys(7)(0) <= '0'; scancode <= x"0d"; end if; -- (8) TAB
if j9 = '1' then keys(2)(3) <= '0'; scancode <= x"2d"; end if; -- (9) R
if j10 = '1' then keys(6)(0) <= '0'; scancode <= x"5a"; end if; -- (10) ENTER
if j11 = '1' then keys(7)(1) <= '0'; scancode <= x"14"; end if; -- (11) LCtrl
if j12 = '1' then keys(9)(1) <= '1'; scancode <= x"78"; end if; -- (12) F11 (NMI)