From 2fe0cbbb19df504723934f39473064033c64ef6f Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 24 Mar 2021 18:34:33 -0400 Subject: [PATCH] Add some comments regarding 16-bit increment/decrement --- audio/engine.asm | 2 ++ engine/gfx/pic_animation.asm | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/audio/engine.asm b/audio/engine.asm index fa3a08297..ca6fd4ab7 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -982,6 +982,7 @@ ApplyPitchSlide: add hl, bc add [hl] ld [hl], a + ; could have done "jr nc, .no_rollover / inc de / .no_rollover" ld a, 0 adc e ld e, a @@ -1022,6 +1023,7 @@ ApplyPitchSlide: ld a, [hl] add a ld [hl], a + ; could have done "jr nc, .no_rollover / dec de / .no_rollover" ld a, e sbc 0 ld e, a diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm index 62d9ad6d7..d3a176f29 100644 --- a/engine/gfx/pic_animation.asm +++ b/engine/gfx/pic_animation.asm @@ -628,14 +628,16 @@ PokeAnim_ConvertAndApplyBitmask: call AddNTimes ld a, [wBoxAlignment] and a - jr nz, .go + jr nz, .subtract + ; hl += [wPokeAnimBitmaskCurCol] ld a, [wPokeAnimBitmaskCurCol] ld e, a ld d, 0 add hl, de - jr .skip2 + jr .done -.go +.subtract + ; hl -= [wPokeAnimBitmaskCurCol] ld a, [wPokeAnimBitmaskCurCol] ld e, a ld a, l @@ -645,7 +647,7 @@ PokeAnim_ConvertAndApplyBitmask: sbc 0 ld h, a -.skip2 +.done ret .UnusedSizeData: ; unreferenced