summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-03-16 11:32:34 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-03-16 11:32:34 -0400
commit3367f42131fd2382e26f079ef714cba312098771 (patch)
tree51d1073b917cf990041f2cb08712ad5b043b64a0
parentaae18fb07ace51ef6ac04087a2f919aad2ff1334 (diff)
Fix diff
-rw-r--r--Improve-the-event-initialization-system.md17
1 files changed, 7 insertions, 10 deletions
diff --git a/Improve-the-event-initialization-system.md b/Improve-the-event-initialization-system.md
index 5b5f509..a4f0029 100644
--- a/Improve-the-event-initialization-system.md
+++ b/Improve-the-event-initialization-system.md
@@ -214,23 +214,20 @@ That's 72 more ROM bytes than before. It's not a whole lot, but every bit helps.
ld a, [hli]
- ld e, a
- ld d, 0
-- cp -1
+ cp -1
- jr z, .sprites_done
-- ld a, [hli]
-- push hl
-- ld hl, wVariableSprites
-- add hl, de
-- ld [hl], a
-- pop hl
-+ ld a, [hli]
-+ cp -1
+ ret z
+ add LOW(wVariableSprites)
+ ld e, a
+ adc HIGH(wVariableSprites)
+ sub e
+ ld d, a
-+ ld a, [hli]
+ ld a, [hli]
+- push hl
+- ld hl, wVariableSprites
+- add hl, de
+- ld [hl], a
+- pop hl
+ ld [de], a
jr .sprites_loop
-.sprites_done