Skip to content

Commit

Permalink
furter fix (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
vossstef authored Nov 2, 2024
1 parent 4a90864 commit 3be2149
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/tang_nano_20k_c64_top.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ gamepad: entity work.dualshock2
begin
if disk_reset = '1' then
disk_chg_trg <= '0';
reset_cnt := 14000000;
reset_cnt := 64000000;
elsif rising_edge(clk32) then
if reset_cnt /= 0 then
reset_cnt := reset_cnt - 1;
Expand Down
16 changes: 5 additions & 11 deletions src/tang_nano_20k_c64_top_138k.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ begin
pa2_i <= pa2_o;
cnt2_i <= '1';
sp2_i <= '1';
pb_i <= pb_o;
pb_i <= (others => '1');
drive_par_i <= (others => '1');
drive_stb_i <= '1';
uart_tx <= '1';
Expand All @@ -1697,8 +1697,7 @@ begin
drive_stb_i <= pc2_n_o;
pb_i <= drive_par_o;
flag2_n_i <= drive_stb_o;
else
if system_up9600 = 0 then
elsif system_up9600(0) = '0' and (disk_access = '0' or ext_en = '0') then
-- UART
-- https://www.pagetable.com/?p=1656
-- FLAG2 RXD
Expand All @@ -1718,7 +1717,7 @@ begin
pb_i(6) <= not pb_o(1); -- RTS > CTS
pb_i(4) <= not pb_o(2); -- DTR > DCD
pb_i(7) <= not pb_o(2); -- DTR > DSR
elsif system_up9600 = 1 then
elsif system_up9600(0) = '1' and (disk_access = '0' or ext_en = '0') then
-- UART UP9600
-- https://www.pagetable.com/?p=1656
-- SP1 TXD
Expand All @@ -1728,18 +1727,13 @@ begin
-- FLAG2 RXD
-- PB7 to CNT2
pb_i(7) <= cnt2_o;
-- pb_i(6) <= not pb_o(1); -- RTS > CTS
-- pb_i(4) <= not pb_o(2); -- DTR > DCD
cnt2_i <= pb_o(7);
uart_tx <= pa2_o and sp1_o;
sp2_i <= uart_rx_filtered;
flag2_n_i <= uart_rx_filtered;
pb_i(0) <= uart_rx_filtered;
elsif system_up9600 = 2 then
uart_tx <= '1';
elsif system_up9600 = 3 then
uart_tx <= '1';
elsif system_up9600 = 4 then
uart_tx <= '1';
end if;
end if;
end process;

Expand Down
16 changes: 5 additions & 11 deletions src/tang_nano_20k_c64_top_25k.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ begin
pa2_i <= pa2_o;
cnt2_i <= '1';
sp2_i <= '1';
pb_i <= pb_o;
pb_i <= (others => '1');
drive_par_i <= (others => '1');
drive_stb_i <= '1';
uart_tx <= '1';
Expand All @@ -1642,8 +1642,7 @@ begin
drive_stb_i <= pc2_n_o;
pb_i <= drive_par_o;
flag2_n_i <= drive_stb_o;
else
if system_up9600 = 0 then
elsif system_up9600(0) = '0' and (disk_access = '0' or ext_en = '0') then
-- UART
-- https://www.pagetable.com/?p=1656
-- FLAG2 RXD
Expand All @@ -1663,7 +1662,7 @@ begin
pb_i(6) <= not pb_o(1); -- RTS > CTS
pb_i(4) <= not pb_o(2); -- DTR > DCD
pb_i(7) <= not pb_o(2); -- DTR > DSR
elsif system_up9600 = 1 then
elsif system_up9600(0) = '1' and (disk_access = '0' or ext_en = '0') then
-- UART UP9600
-- https://www.pagetable.com/?p=1656
-- SP1 TXD
Expand All @@ -1673,18 +1672,13 @@ begin
-- FLAG2 RXD
-- PB7 to CNT2
pb_i(7) <= cnt2_o;
-- pb_i(6) <= not pb_o(1); -- RTS > CTS
-- pb_i(4) <= not pb_o(2); -- DTR > DCD
cnt2_i <= pb_o(7);
uart_tx <= pa2_o and sp1_o;
sp2_i <= uart_rx_filtered;
flag2_n_i <= uart_rx_filtered;
pb_i(0) <= uart_rx_filtered;
elsif system_up9600 = 2 then
uart_tx <= '1';
elsif system_up9600 = 3 then
uart_tx <= '1';
elsif system_up9600 = 4 then
uart_tx <= '1';
end if;
end if;
end process;

Expand Down

0 comments on commit 3be2149

Please sign in to comment.