--scroll\r
elsif (nmi_step_cnt = 11 * cpu_io_multi) then\r
io_out(16#2005#, (scr_x) mod 255);\r
- scr_x := scr_x + 3;\r
+ scr_x := cnt_next(pi_cpu_en, scr_x, 3);\r
elsif (nmi_step_cnt = 12 * cpu_io_multi) then\r
io_out(16#2005#, 0);\r
\r
io_out(16#2001#, 16#1e#);\r
elsif (nmi_step_cnt = 14 * cpu_io_multi) then\r
io_out(16#2000#, 16#90#);\r
- nmi_handled := 1;\r
\r
else\r
io_read(16#00#);\r
end if;\r
nmi_step_cnt := cnt_next(pi_cpu_en, nmi_step_cnt, 1);\r
else\r
+ if (pi_nmi_n = '1' and nmi_handled = 1) then\r
+ nmi_handled := 0;\r
+ end if;\r
nmi_step_cnt := 0;\r
- nmi_handled := 0;\r
io_read(16#00#);\r
end if;--if (pi_nmi_n = '0' and nmi_handled = 0) then\r
\r
elsif (rising_edge(pi_base_clk)) then\r
if (reg_ppu_ctrl(PPUNEN) = '1' and pi_ppu_status(ST_VBL) = '1') then\r
reg_vblank_n <= '0';\r
- else\r
+ elsif (pi_ppu_status(ST_VBL) = '0') then\r
reg_vblank_n <= '1';\r
end if;--if (pi_cpu_en(CP_ST0) = '1' and pi_ce_n = '0') then\r
end if;--if (pi_rst_n = '0') then\r