summaryrefslogtreecommitdiff
path: root/engine/overworld/emotion_bubbles.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld/emotion_bubbles.asm')
-rwxr-xr-xengine/overworld/emotion_bubbles.asm30
1 files changed, 15 insertions, 15 deletions
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 4df8b6f6..7c7f5e7d 100755
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -1,13 +1,16 @@
EmotionBubble:
ld a, [wWhichEmotionBubble]
+ and $f
+ swap a
ld c, a
- ld b, 0
- ld hl, EmotionBubblesPointerTable
+ ld b, $0
+ ld hl, EmotionBubbles
+ add hl, bc ; each emotion bubble is 16 bytes, so calculate the offset directly instead of with a pointer table
add hl, bc
add hl, bc
- ld e, [hl]
- inc hl
- ld d, [hl]
+ add hl, bc
+ ld e, l
+ ld d, h
ld hl, vChars1 + $780
lb bc, BANK(EmotionBubbles), $04
call CopyVideoData
@@ -17,11 +20,11 @@ EmotionBubble:
ld [wUpdateSpritesEnabled], a
ld a, [wd736]
bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod?
- ld hl, wOAMBuffer + $8f
- ld de, wOAMBuffer + $9f
+ ld hl, wOAMBuffer + 4 * 35 + $3 ; $8f
+ ld de, wOAMBuffer + 4 * 39 + $3 ; $9f
jr z, .next
- ld hl, wOAMBuffer + $7f
- ld de, wOAMBuffer + $8f
+ ld hl, wOAMBuffer + 4 * 31 + $3 ; $7f
+ ld de, wOAMBuffer + 4 * 35 + $3 ; $8f
; Copy OAM data 16 bytes forward to make room for emotion bubble OAM data at the
; start of the OAM buffer.
@@ -59,12 +62,9 @@ EmotionBubble:
pop af
ld [wUpdateSpritesEnabled], a
call DelayFrame
- jp UpdateSprites
-
-EmotionBubblesPointerTable:
- dw EmotionBubbles
- dw EmotionBubbles + $40
- dw EmotionBubbles + $80
+ call UpdateSprites
+ ret
+ ; jp UpdateSprites
EmotionBubblesOAM:
db $F8,$00,$F9,$00