2016-06-12 00:24:04 +00:00
|
|
|
EmotionBubble:
|
2015-07-14 21:32:49 +00:00
|
|
|
ld a, [wWhichEmotionBubble]
|
2014-05-22 22:13:20 +00:00
|
|
|
ld c, a
|
2015-07-14 21:32:49 +00:00
|
|
|
ld b, 0
|
2015-07-03 19:37:53 +00:00
|
|
|
ld hl, EmotionBubblesPointerTable
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl, vChars1 + $780
|
2015-08-10 04:56:20 +00:00
|
|
|
lb bc, BANK(EmotionBubbles), $04
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyVideoData
|
2014-09-13 07:50:56 +00:00
|
|
|
ld a, [wUpdateSpritesEnabled]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
|
|
|
ld a, $ff
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wUpdateSpritesEnabled], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wd736]
|
2015-07-14 21:32:49 +00:00
|
|
|
bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod?
|
2016-06-12 04:30:05 +00:00
|
|
|
ld hl, wOAMBuffer + 4 * 35 + $3 ; $8f
|
|
|
|
ld de, wOAMBuffer + 4 * 39 + $3 ; $9f
|
2015-07-14 21:32:49 +00:00
|
|
|
jr z, .next
|
2016-06-12 04:30:05 +00:00
|
|
|
ld hl, wOAMBuffer + 4 * 31 + $3 ; $7f
|
|
|
|
ld de, wOAMBuffer + 4 * 35 + $3 ; $8f
|
2015-07-14 21:32:49 +00:00
|
|
|
|
|
|
|
; Copy OAM data 16 bytes forward to make room for emotion bubble OAM data at the
|
|
|
|
; start of the OAM buffer.
|
|
|
|
.next
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $90
|
2015-07-14 21:32:49 +00:00
|
|
|
.loop
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a, [hl]
|
|
|
|
ld [de], a
|
|
|
|
dec hl
|
|
|
|
dec de
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
2015-07-14 21:32:49 +00:00
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
; get the screen coordinates of the sprite the bubble is to be displayed above
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl, wSpriteStateData1 + 4
|
2015-07-14 21:32:49 +00:00
|
|
|
ld a, [wEmotionBubbleSpriteIndex]
|
2014-05-22 22:13:20 +00:00
|
|
|
swap a
|
|
|
|
ld c, a
|
2015-07-14 21:32:49 +00:00
|
|
|
ld b, 0
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
inc hl
|
|
|
|
ld a, [hl]
|
|
|
|
add $8
|
|
|
|
ld c, a
|
2015-07-14 21:32:49 +00:00
|
|
|
|
2015-07-03 19:37:53 +00:00
|
|
|
ld de, EmotionBubblesOAM
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
|
|
|
call WriteOAMBlock
|
2015-07-03 19:37:53 +00:00
|
|
|
ld c, 60
|
2014-05-22 22:13:20 +00:00
|
|
|
call DelayFrames
|
|
|
|
pop af
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wUpdateSpritesEnabled], a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DelayFrame
|
|
|
|
jp UpdateSprites
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
EmotionBubblesPointerTable:
|
2014-05-22 22:13:20 +00:00
|
|
|
dw EmotionBubbles
|
|
|
|
dw EmotionBubbles + $40
|
|
|
|
dw EmotionBubbles + $80
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
EmotionBubblesOAM:
|
2014-05-22 22:13:20 +00:00
|
|
|
db $F8,$00,$F9,$00
|
|
|
|
db $FA,$00,$FB,$00
|
|
|
|
|
2016-06-12 00:24:04 +00:00
|
|
|
EmotionBubbles:
|
2014-05-30 08:30:10 +00:00
|
|
|
INCBIN "gfx/emotion_bubbles.2bpp"
|