From 9841b30ca8d3bfd9e1631db0509f9506b430da39 Mon Sep 17 00:00:00 2001 From: pjht Date: Thu, 7 Dec 2023 13:45:46 -0600 Subject: [PATCH] Fix sort_ram_cards resaving registers every time outer loop was ran --- rom.68k | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rom.68k b/rom.68k index 87de61f..4789f1c 100644 --- a/rom.68k +++ b/rom.68k @@ -102,6 +102,7 @@ farc_done: | Length in d0 sort_ram_cards: movem.l d2-d4/a2, -(a7) | Save calle-preserved registers +src_outer_loop: move.b #0, d1 | d1 = newlen move.b #1, d2 | d2 = i move.l a0, a1 | a1 holds the pointer to the current pair @@ -125,6 +126,6 @@ bra.b src_inner_loop src_inner_loop_done: move.b d1, d0 | len = newlen cmp #1, d0 | if n > 1, branch to outer loop -bgt.b sort_ram_cards +bgt.b src_outer_loop movem.l (a7)+, d2-d4/a2 | Restore calle-preserved registers rts