Skip to content

Commit

Permalink
Added classic timings
Browse files Browse the repository at this point in the history
  • Loading branch information
andykarpov committed Sep 14, 2021
1 parent bf02895 commit c445a2e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
4 changes: 3 additions & 1 deletion firmware/src/fpga/profi/rtl/karabas_pro.vhd
Expand Up @@ -449,6 +449,8 @@ signal board_reset : std_logic := '0'; -- board reset on rombank switch
signal tape_in_out_enable : std_logic := '0'; -- revDS uses SW3 switches as tape in / out
signal tape_in_monitor : std_logic := '0';

signal memory_contention : std_logic := '0';

-- debug
signal fdd_oe_n : std_logic := '1';
signal hdd_oe_n : std_logic := '1';
Expand Down Expand Up @@ -1155,7 +1157,7 @@ G_MAX_TURBO_SRAM: if not enable_2port_vram generate
max_turbo <= "01";
end generate G_MAX_TURBO_SRAM;

clk_cpu <= '0' when kb_wait = '1' else
clk_cpu <= '0' when kb_wait = '1' or (kb_screen_mode = "01" and memory_contention = '1' and DS80 = '0') else
clk_bus when kb_turbo = "11" and kb_turbo <= max_turbo else
clk_bus and ena_div2 when kb_turbo = "10" and kb_turbo <= max_turbo else
clk_bus and ena_div4 when kb_turbo = "01" and kb_turbo <= max_turbo else
Expand Down
33 changes: 26 additions & 7 deletions firmware/src/fpga/profi/rtl/video/pentagon_video.vhd
Expand Up @@ -89,7 +89,11 @@ begin

if hor_cnt = 39 then
if chr_row_cnt = 7 then
if (ver_cnt = 39 and MODE60 = '0') or (ver_cnt = 32 and MODE60 = '1')then
if (ver_cnt = 39 and MODE60 = '0' and SCREEN_MODE = "00") or -- pentagon 50 Hz
(ver_cnt = 32 and MODE60 = '1' and SCREEN_MODE = "00") or -- pentagon 60 Hz
(ver_cnt = 38 and MODE60 = '0' and SCREEN_MODE = "01") or -- classic 50 Hz
(ver_cnt = 31 and MODE60 = '1' and SCREEN_MODE = "01") -- classic 60 Hz
then
ver_cnt <= (others => '0');
invert <= invert + 1;
else
Expand Down Expand Up @@ -150,11 +154,22 @@ begin
end if;
else
-- PENTAGON int
if chr_col_cnt = 6 and hor_cnt(2 downto 0) = "111" then
if ver_cnt = 29 and chr_row_cnt = 7 and hor_cnt(5 downto 3) = "100" then
int_sig <= '0';
else
int_sig <= '1';
if (SCREEN_MODE = "00") then
if chr_col_cnt = 6 and hor_cnt(2 downto 0) = "111" then
if ver_cnt = 29 and chr_row_cnt = 7 and hor_cnt(5 downto 3) = "100" then
int_sig <= '0';
else
int_sig <= '1';
end if;
end if;
-- CLASSIC int
elsif (SCREEN_MODE = "01") then
if chr_col_cnt = 0 then
if ver_cnt = 31 and chr_row_cnt = 0 and hor_cnt(5 downto 3) = "000" then
int_sig <= '0';
else
int_sig <= '1';
end if;
end if;
end if;

Expand Down Expand Up @@ -208,7 +223,11 @@ begin
if CLK = '1' then
if ENA = '1' then
if chr_col_cnt = 7 then
if ((hor_cnt(5 downto 0) > 38 and hor_cnt(5 downto 0) < 48) or ((ver_cnt(5 downto 1) = 15 and MODE60 = '0') or (ver_cnt(5 downto 1) = 14 and MODE60 = '1'))) then -- 15 = for 320 lines, 13 = for 264 lines
-- PENTAGON blank
if SCREEN_MODE = "00" and ((hor_cnt(5 downto 0) > 38 and hor_cnt(5 downto 0) < 48) or ((ver_cnt(5 downto 1) = 15 and MODE60 = '0') or (ver_cnt(5 downto 1) = 14 and MODE60 = '1'))) then -- 15 = for 320 lines, 13 = for 264 lines
blank_r <= '0';
-- CLASSIC blank
elsif SCREEN_MODE = "01" and (hor_cnt(5 downto 2) = 10 or hor_cnt(5 downto 2) = 11 or (ver_cnt = 31 and MODE60 = '0') or (ver_cnt = 30 and MODE60 = '1')) then
blank_r <= '0';
else
blank_r <= '1';
Expand Down

0 comments on commit c445a2e

Please sign in to comment.