summaryrefslogtreecommitdiff
path: root/Improve-the-event-initialization-system.md
diff options
context:
space:
mode:
Diffstat (limited to 'Improve-the-event-initialization-system.md')
-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