From c0ea10b691cd12c28ee632fecb2479eb9777cfca Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 21 Nov 2020 13:28:54 -0500 Subject: [PATCH] shave even more cycles by using direct branches where possible --- src/fx/fx.dhgr.soft.diagonal.a | 12 ++++++------ src/fx/macros.a | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/fx/fx.dhgr.soft.diagonal.a b/src/fx/fx.dhgr.soft.diagonal.a index 8b0e145a8..21e80b86c 100644 --- a/src/fx/fx.dhgr.soft.diagonal.a +++ b/src/fx/fx.dhgr.soft.diagonal.a @@ -121,7 +121,7 @@ RowLoop +RESET_HGR_HI @block4 iny - +BRANCH_IF_Y_IS_OFFSCREEN @block5 + +LONG_BRANCH_IF_Y_IS_OFFSCREEN @block5 ; +COPY_WITH_MASK_IMM_AND_INC %00000000 +INC_HGR_HI +COPY_WITH_MASK_IMM_AND_INC %10011001 @@ -134,7 +134,7 @@ RowLoop +RESET_HGR_HI @block5 iny - +BRANCH_IF_Y_IS_OFFSCREEN @block6 + +LONG_BRANCH_IF_Y_IS_OFFSCREEN @block6 ; +COPY_WITH_MASK_IMM_AND_INC %00000000 +INC_HGR_HI +COPY_WITH_MASK_IMM_AND_INC %10011111 @@ -147,7 +147,7 @@ RowLoop +RESET_HGR_HI @block6 iny - +BRANCH_IF_Y_IS_OFFSCREEN @block7 + +LONG_BRANCH_IF_Y_IS_OFFSCREEN @block7 +COPY_WITH_MASK_IMM_AND_INC %11100110 +COPY_WITH_MASK_IMM_AND_INC %10011111 +COPY_WITH_MASK_IMM_AND_INC %11111111 @@ -212,7 +212,7 @@ RowLoop +RESET_HGR_HI @block4_aux iny - +BRANCH_IF_Y_IS_OFFSCREEN @block5_aux + +LONG_BRANCH_IF_Y_IS_OFFSCREEN @block5_aux ; +COPY_WITH_MASK_IMM_AND_INC %00000000 +INC_HGR_HI +COPY_WITH_MASK_IMM_AND_INC %11001100 @@ -225,7 +225,7 @@ RowLoop +RESET_HGR_HI @block5_aux iny - +BRANCH_IF_Y_IS_OFFSCREEN @block6_aux + +LONG_BRANCH_IF_Y_IS_OFFSCREEN @block6_aux ; +COPY_WITH_MASK_IMM_AND_INC %00000000 +INC_HGR_HI +COPY_WITH_MASK_IMM_AND_INC %11111100 @@ -238,7 +238,7 @@ RowLoop +RESET_HGR_HI @block6_aux iny - +BRANCH_IF_Y_IS_OFFSCREEN @block7_aux + +LONG_BRANCH_IF_Y_IS_OFFSCREEN @block7_aux +COPY_WITH_MASK_IMM_AND_INC %10110011 +COPY_WITH_MASK_IMM_AND_INC %11111100 +COPY_WITH_MASK_IMM_AND_INC %11111111 diff --git a/src/fx/macros.a b/src/fx/macros.a index dff050ddc..6d37285f8 100644 --- a/src/fx/macros.a +++ b/src/fx/macros.a @@ -141,6 +141,11 @@ ++ } !macro BRANCH_IF_Y_IS_OFFSCREEN .target { + bmi .target + cpy #40 + bcs .target +} +!macro LONG_BRANCH_IF_Y_IS_OFFSCREEN .target { bpl + - jmp .target + cpy #40