bf0080c4e9bb — Laurens Holst 5 years ago
Adler32Checker: Small speedup, as addends never exceed the modulo.
1 files changed, 4 insertions(+), 4 deletions(-)

M src/Adler32Checker.asm
M src/Adler32Checker.asm +4 -4
@@ 125,17 125,17 @@ Loop:
 	ret
 	ENDP
 
-; ?hl = addend
-; ?de = addend
+; ?hl = addend (< ?modulo)
+; ?de = addend (< ?modulo)
 ; ?modulo = modulo value
 ; Modifies: ?de
 AddModulo: MACRO ?hl, ?de, ?modulo
 	add ?hl,?de
-	jr nc,Check
 	ld ?de,10000H - ?modulo
+	jp nc,Check
 	add ?hl,?de
+	jp Done
 Check:
-	ld ?de,10000H - ?modulo
 	add ?hl,?de
 	jr c,Done
 	sbc ?hl,?de