From 543d4c00cd8c2ce8710cd6ea890cd53b78718b3c Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 23 Dec 2023 12:12:44 +0100 Subject: [PATCH] Sprite Fixes Adjusted Sprite offset by two vertical lines. For Kung-Fu Master, gave the top 106 lines of tiles priority over sprites for proper layering. --- Arcade_MiST/IremM62 Hardware/IremM62.qsf | 2 +- Arcade_MiST/IremM62 Hardware/rtl/spritectl.vhd | 2 +- Arcade_MiST/IremM62 Hardware/rtl/tilemapctl.vhd | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Arcade_MiST/IremM62 Hardware/IremM62.qsf b/Arcade_MiST/IremM62 Hardware/IremM62.qsf index d4ee8de1..04c0d224 100644 --- a/Arcade_MiST/IremM62 Hardware/IremM62.qsf +++ b/Arcade_MiST/IremM62 Hardware/IremM62.qsf @@ -41,7 +41,7 @@ # ======================== set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL -set_global_assignment -name LAST_QUARTUS_VERSION "13.1 SP4.26" +set_global_assignment -name LAST_QUARTUS_VERSION 13.1 set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:rtl/build_id.tcl" set_global_assignment -name SMART_RECOMPILE ON diff --git a/Arcade_MiST/IremM62 Hardware/rtl/spritectl.vhd b/Arcade_MiST/IremM62 Hardware/rtl/spritectl.vhd index f8b55288..507b44c8 100644 --- a/Arcade_MiST/IremM62 Hardware/rtl/spritectl.vhd +++ b/Arcade_MiST/IremM62 Hardware/rtl/spritectl.vhd @@ -70,7 +70,7 @@ begin yMat := yMatNext; else -- determine if the sprite is visible on the next line during active display - y := 640 - unsigned(reg_i.y) - unsigned(video_ctl.y) - 3; + y := 640 - unsigned(reg_i.y) - unsigned(video_ctl.y) - 1; -- hande sprite height, placement code := reg_i.n(10 downto 0); -- default diff --git a/Arcade_MiST/IremM62 Hardware/rtl/tilemapctl.vhd b/Arcade_MiST/IremM62 Hardware/rtl/tilemapctl.vhd index 26664060..6d9ae430 100644 --- a/Arcade_MiST/IremM62 Hardware/rtl/tilemapctl.vhd +++ b/Arcade_MiST/IremM62 Hardware/rtl/tilemapctl.vhd @@ -186,18 +186,22 @@ begin -- G Board -- JP1-4 - Tiles with color code >= the value set here have priority over sprites -- J1: selects whether bit 4 of obj color code selects or not high priority over tiles - prio := '0'; + -- prio := '0'; if ((hwsel = HW_YOUJYUDN or hwsel = HW_HORIZON) and attr_d_r(4 downto 1) >= x"8") or (hwsel = HW_LDRUN and attr_d_r(4 downto 1) >= x"c") or ((hwsel = HW_LDRUN2 or hwsel = HW_LDRUN3 or hwsel = HW_BATTROAD) and attr_d_r(4 downto 1) >= x"4") or - (hwsel = HW_KIDNIKI and attr_d_r(7 downto 5) = "111") + (hwsel = HW_KIDNIKI and attr_d_r(7 downto 5) = "111") or + --For Kung Fu Master, not sure how the hardware actually does it, and couldn't determine from color code for sprite priority + --so, as a hack, giving tiles priority over sprites for the first ~106 lines to hide sprite above top rung of stairs. + (hwsel = HW_KUNGFUM and unsigned(video_ctl.y) < x"150") then prio := '1'; + else prio := '0'; end if; - if (pel = "000") then - prio := '0'; - end if; +-- if (pel = "000") then +-- prio := '0'; +-- end if; ctl_o.pal_a <= attr_d_r(4 downto 0) & pel; ctl_o.prio <= prio;