OSDN Git Service

ppu nmi clear timing changed. stub update
authorastoria-d@fc <astoria-d@fc>
Fri, 30 Sep 2016 06:18:28 +0000 (15:18 +0900)
committerastoria-d@fc <astoria-d@fc>
Fri, 30 Sep 2016 06:18:28 +0000 (15:18 +0900)
de0_cv_nes/dummy-smb-rom.vhd
de0_cv_nes/ppu/ppu.vhd

index 803b03b..98ddca0 100644 (file)
@@ -367,7 +367,7 @@ end;
                         --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
@@ -376,15 +376,16 @@ end;
                             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
index 8d3818f..ce46d4f 100644 (file)
@@ -442,7 +442,7 @@ begin
         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