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.md11
1 files changed, 2 insertions, 9 deletions
diff --git a/Improve-the-event-initialization-system.md b/Improve-the-event-initialization-system.md
index 3533644..c55e6ed 100644
--- a/Improve-the-event-initialization-system.md
+++ b/Improve-the-event-initialization-system.md
@@ -106,7 +106,7 @@ Create **engine/events/init_events.asm**:
+ ld e, a
+ ld d, 0
+ cp -1
-+ jr z, .sprites_done
++ ret z
+ ld a, [hli]
+ push hl
+ ld hl, wVariableSprites
@@ -114,9 +114,6 @@ Create **engine/events/init_events.asm**:
+ ld [hl], a
+ pop hl
+ jr .sprites_loop
-+.sprites_done
-+
-+ ret
+
+INCLUDE "data/events/init_events.asm"
```
@@ -205,8 +202,7 @@ That's 72 more ROM bytes than before. It's not a whole lot, but every bit helps.
- ld e, a
- ld d, 0
cp -1
-- jr z, .sprites_done
-+ ret z
+ ret z
+ add LOW(wVariableSprites)
+ ld e, a
+ adc HIGH(wVariableSprites)
@@ -220,7 +216,4 @@ That's 72 more ROM bytes than before. It's not a whole lot, but every bit helps.
- pop hl
+ ld [de], a
jr .sprites_loop
--.sprites_done
--
-- ret
```