Moto NES FPGA main repository
Revision | 9eb885455fcbd74b700adf2889025ace6b508fd2 (tree) |
---|---|
Time | 2013-07-19 13:15:32 |
Author | astoria-d <astoria-d@mail...> |
Commiter | astoria-d |
sprite x-axis adjustment.
@@ -523,7 +523,7 @@ begin | ||
523 | 523 | ---primary oam |
524 | 524 | oam_ram_ce_n <= clk when oam_bus_ce_n = '0' and r_nw = '0' else |
525 | 525 | '0' when oam_bus_ce_n = '0' and r_nw = '1' else |
526 | - not io_cnt(0) when ppu_mask(PPUSSP) = '1' and | |
526 | + '0' when ppu_mask(PPUSSP) = '1' and | |
527 | 527 | cur_x > conv_std_logic_vector(64, X_SIZE) and |
528 | 528 | cur_x <= conv_std_logic_vector(256, X_SIZE) and |
529 | 529 | p_oam_cnt_wrap_n = '1' else |
@@ -838,6 +838,7 @@ end; | ||
838 | 838 | s_oam_data <= oam_data; |
839 | 839 | |
840 | 840 | if (oam_ev_status = EV_STAT_COMP) then |
841 | + --check y range. | |
841 | 842 | if (cur_y < "000000110" and oam_data <= cur_y + "000000001") or |
842 | 843 | (cur_y >= "000000110" and oam_data <= cur_y + "000000001" and |
843 | 844 | oam_data >= cur_y - "000000110") then |
@@ -919,7 +920,7 @@ end; | ||
919 | 920 | if (spr_attr(conv_integer(s_oam_addr_cpy(4 downto 2)))(SPRVFL) = '0') then |
920 | 921 | vram_addr <= "0" & ppu_ctrl(PPUSPA) & |
921 | 922 | spr_tile_tmp(dsize - 1 downto 0) & "0" & |
922 | - (next_y(2 downto 0) - spr_y_tmp(2 downto 0) - "001"); | |
923 | + (next_y(2 downto 0) - spr_y_tmp(2 downto 0)); | |
923 | 924 | else |
924 | 925 | --flip sprite vertically. |
925 | 926 | vram_addr <= "0" & ppu_ctrl(PPUSPA) & |
@@ -940,7 +941,7 @@ end; | ||
940 | 941 | vram_addr <= "0" & ppu_ctrl(PPUSPA) & |
941 | 942 | spr_tile_tmp(dsize - 1 downto 0) & "0" & |
942 | 943 | (next_y(2 downto 0) - spr_y_tmp(2 downto 0)) |
943 | - + "00000000000111"; | |
944 | + + "00000000001000"; | |
944 | 945 | else |
945 | 946 | --flip sprite vertically. |
946 | 947 | vram_addr <= "0" & ppu_ctrl(PPUSPA) & |
@@ -180,7 +180,13 @@ begin | ||
180 | 180 | for i in 0 to 32 * 5 loop |
181 | 181 | cpu_addr <= "111"; |
182 | 182 | --cpu_d <= conv_std_logic_vector(i + 32, 8); |
183 | + if (i mod 2 = 0) then | |
183 | 184 | cpu_d <= conv_std_logic_vector(37, 8); |
185 | + else | |
186 | + --cpu_d <= conv_std_logic_vector(16#0d#, 8); | |
187 | + --cpu_d <= conv_std_logic_vector(36, 8); | |
188 | + cpu_d <= conv_std_logic_vector(38, 8); | |
189 | + end if; | |
184 | 190 | wait for cpu_clk_time; |
185 | 191 | end loop; |
186 | 192 |
@@ -273,7 +279,7 @@ begin | ||
273 | 279 | cpu_d <= conv_std_logic_vector(16#11#, 8); |
274 | 280 | wait for cpu_clk_time; |
275 | 281 | --x |
276 | - cpu_d <= conv_std_logic_vector(50, 8); | |
282 | + cpu_d <= conv_std_logic_vector(0, 8); | |
277 | 283 | wait for cpu_clk_time; |
278 | 284 | |
279 | 285 | --item #4 |
@@ -356,28 +362,28 @@ begin | ||
356 | 362 | |
357 | 363 | ce_n <= '1'; |
358 | 364 | |
359 | - wait for 3 ms; | |
360 | - wait until (cpu_clk'event and cpu_clk = '1'); | |
361 | - | |
362 | - --disable show bg. | |
363 | - ce_n <= '0'; | |
364 | - r_nw <= '0'; | |
365 | - cpu_addr <= "001"; | |
366 | - cpu_d <= "00000000"; | |
367 | - wait for cpu_clk_time; | |
368 | - ce_n <= '1'; | |
369 | - | |
370 | - wait for 3 ms; | |
371 | - wait until (cpu_clk'event and cpu_clk = '1'); | |
372 | - | |
373 | - --enable show bg. | |
374 | - ce_n <= '0'; | |
375 | - r_nw <= '0'; | |
376 | - cpu_addr <= "001"; | |
377 | - cpu_d <= "00011000"; | |
378 | - wait for cpu_clk_time; | |
379 | - ce_n <= '1'; | |
380 | - | |
365 | +-- wait for 3 ms; | |
366 | +-- wait until (cpu_clk'event and cpu_clk = '1'); | |
367 | +-- | |
368 | +-- --disable show bg. | |
369 | +-- ce_n <= '0'; | |
370 | +-- r_nw <= '0'; | |
371 | +-- cpu_addr <= "001"; | |
372 | +-- cpu_d <= "00000000"; | |
373 | +-- wait for cpu_clk_time; | |
374 | +-- ce_n <= '1'; | |
375 | +-- | |
376 | +-- wait for 3 ms; | |
377 | +-- wait until (cpu_clk'event and cpu_clk = '1'); | |
378 | +-- | |
379 | +-- --enable show bg. | |
380 | +-- ce_n <= '0'; | |
381 | +-- r_nw <= '0'; | |
382 | +-- cpu_addr <= "001"; | |
383 | +-- cpu_d <= "00011000"; | |
384 | +-- wait for cpu_clk_time; | |
385 | +-- ce_n <= '1'; | |
386 | +-- | |
381 | 387 | --wait for vblank |
382 | 388 | wait until (vblank_n'event and vblank_n = '0'); |
383 | 389 | wait until (cpu_clk'event and cpu_clk = '1'); |