OSDN Git Service

rgb position reverse bug fix. bg bit pattern reverse bug fix.
authorastoria-d <astoria-d@mail.goo.ne.jp>
Sun, 18 Sep 2016 14:41:01 +0000 (23:41 +0900)
committerastoria-d <astoria-d@mail.goo.ne.jp>
Sun, 18 Sep 2016 14:41:01 +0000 (23:41 +0900)
de0_cv_nes/ppu/render.vhd
tools/regression-test/regression.asm

index f49f3ed..98c9007 100644 (file)
@@ -604,7 +604,9 @@ begin
                 --fetch low first.\r
                 if (reg_prf_x mod 8 = 6 and reg_v_cur_state = REG_SET1) then\r
                     --TODO: must reverse order if attr not set.\r
-                    reg_tmp_ptn_l <= reg_v_data;\r
+                    reg_tmp_ptn_l <= \r
+                        reg_v_data(0) & reg_v_data(1) & reg_v_data(2) & reg_v_data(3) &\r
+                        reg_v_data(4) & reg_v_data(5) & reg_v_data(6) & reg_v_data(7);\r
                 end if;\r
 \r
                 if (reg_prf_x mod 8 = 0) then\r
@@ -613,7 +615,10 @@ begin
                         reg_sft_ptn_l <= reg_tmp_ptn_l & reg_sft_ptn_l(8 downto 1);\r
                         --fetch high & shift.\r
                         --TODO: must reverse order if attr not set.\r
-                        reg_sft_ptn_h <= reg_v_data & reg_sft_ptn_h(8 downto 1);\r
+                        reg_sft_ptn_h <= \r
+                            reg_v_data(0) & reg_v_data(1) & reg_v_data(2) & reg_v_data(3) &\r
+                            reg_v_data(4) & reg_v_data(5) & reg_v_data(6) & reg_v_data(7) &\r
+                            reg_sft_ptn_h(8 downto 1);\r
                     end if;\r
                 else\r
                     if (reg_v_cur_state = AD_SET1 or reg_v_cur_state = REG_SET1) then\r
@@ -756,13 +761,13 @@ end;
                 if (reg_nes_x < HSCAN and reg_nes_y < VSCAN) then\r
                     --if or if not bg/sprite is shown, output color anyway \r
                     --sinse universal bg color is included..\r
-                    po_b <= nes_color_palette(conv_integer(reg_plt_data(5 downto 0))) (11 downto 8);\r
+                    po_r <= nes_color_palette(conv_integer(reg_plt_data(5 downto 0))) (11 downto 8);\r
                     po_g <= nes_color_palette(conv_integer(reg_plt_data(5 downto 0))) (7 downto 4);\r
-                    po_r <= nes_color_palette(conv_integer(reg_plt_data(5 downto 0))) (3 downto 0);\r
+                    po_b <= nes_color_palette(conv_integer(reg_plt_data(5 downto 0))) (3 downto 0);\r
                 else\r
-                    po_b <= (others => '0');\r
-                    po_g <= (others => '0');\r
                     po_r <= (others => '0');\r
+                    po_g <= (others => '0');\r
+                    po_b <= (others => '0');\r
                 end if;\r
             end if; --if (rising_edge(emu_ppu_clk)) then\r
         end if;--if (rst_n = '0') then\r
index c894b11..4a9e3bb 100644 (file)
@@ -45,9 +45,9 @@
 ;    jsr print_ln\r
 ;\r
 ;    ;;test start...\r
-;    jsr addr_test\r
-;    jsr single_inst_test\r
-;    jsr a2_inst_test\r
+    jsr addr_test\r
+    jsr single_inst_test\r
+    jsr a2_inst_test\r
 ;    jsr a3_inst_test\r
 ;    jsr a4_inst_test\r
 ;    jsr a5_inst_test\r