summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2016-06-12 03:01:20 -0500
committerdannye <corrnondacqb@yahoo.com>2016-06-12 03:01:20 -0500
commitce3ec76762d9e2f0c560e2ea7868678418883143 (patch)
tree13bd307196f870d59157ab803c858c205eba6921 /engine/overworld
parent604eb493c42b457f9e006e2cf67f29c15e0d1d0b (diff)
parentbcf0bd960b03720a02669ed2b6d3a22df60cf0b2 (diff)
Merge branch 'master' of https://github.com/pret/pokeyellow into merge-pokeredmerge-pokered
Diffstat (limited to 'engine/overworld')
-rwxr-xr-xengine/overworld/emotion_bubbles.asm4
-rwxr-xr-xengine/overworld/healing_machine.asm16
-rwxr-xr-xengine/overworld/map_sprites.asm1
-rw-r--r--engine/overworld/oam.asm2
-rwxr-xr-xengine/overworld/player_animations.asm21
-rwxr-xr-xengine/overworld/trainers.asm10
6 files changed, 27 insertions, 27 deletions
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 7c7f5e7d..3b02fd55 100755
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -3,7 +3,7 @@ EmotionBubble:
and $f
swap a
ld c, a
- ld b, $0
+ 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
@@ -64,7 +64,7 @@ EmotionBubble:
call DelayFrame
call UpdateSprites
ret
- ; jp UpdateSprites
+
EmotionBubblesOAM:
db $F8,$00,$F9,$00
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index 4648f68b..ed733d7d 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -21,13 +21,13 @@ AnimateHealingMachine:
call StopAllMusic
.waitLoop
ld a, [wAudioFadeOutControl]
- and a
- jr nz, .waitLoop
- ld a, [wPartyCount] ; wPartyCount
+ and a ; is fade-out finished?
+ jr nz, .waitLoop ; if not, check again
+ ld a, [wPartyCount]
ld b, a
.partyLoop
call CopyHealingMachineOAM
- ld a, $9e ; (SFX_02_4a - SFX_Headers_02) / 3
+ ld a, SFX_HEALING_MACHINE
call PlaySound
ld c, 30
call DelayFrames
@@ -38,18 +38,18 @@ AnimateHealingMachine:
ld [wAudioSavedROMBank], a
jr nz, .next
call StopAllMusic
- ld a, $2 ; BANK(Music_PkmnHealed)
+ ld a, BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.next
- ld a, $e8 ; MUSIC_PKMN_HEALED
+ ld a, MUSIC_PKMN_HEALED
ld [wNewSoundID], a
call PlaySound
ld d, $28
call FlashSprite8Times
.waitLoop2
ld a, [wChannelSoundIDs]
- cp $e8 ; MUSIC_PKMN_HEALED
- jr z, .waitLoop2
+ cp MUSIC_PKMN_HEALED ; is the healed music still playing?
+ jr z, .waitLoop2 ; if so, check gain
ld c, 32
call DelayFrames
pop af
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 43b44946..32d3d47b 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -328,7 +328,6 @@ GetSplitMapSpriteSetID:
.northSouthDivide
ld a, [wYCoord]
jr .compareCoord
-
.eastWestDivide
ld a, [wXCoord]
.compareCoord
diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm
index 5b9831b0..5a831327 100644
--- a/engine/overworld/oam.asm
+++ b/engine/overworld/oam.asm
@@ -8,7 +8,7 @@ PrepareOAMData:
dec a
jr z, .updateEnabled
- cp $ff
+ cp -1
ret nz
ld [wUpdateSpritesEnabled], a
jp HideSprites
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index 95a8cc12..d4ecec53 100755
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -9,7 +9,7 @@ EnterMapAnim:
bit 7, [hl] ; used fly out of battle?
res 7, [hl]
jr nz, .flyAnimation
- ld a, $a0 ; (SFX_02_4c - SFX_Headers_02) / 3
+ ld a, SFX_TELEPORT_ENTER_1
call PlaySound
ld hl, wd732
bit 4, [hl] ; used dungeon warp?
@@ -17,7 +17,7 @@ EnterMapAnim:
;res 4, [hl]
jr nz, .dungeonWarpAnimation
call PlayerSpinWhileMovingDown
- ld a, $a3 ; (SFX_02_4f - SFX_Headers_02) / 3
+ ld a, SFX_TELEPORT_ENTER_2
call PlaySound
call IsPlayerStandingOnWarpPadOrHole
ld a, b
@@ -51,7 +51,7 @@ EnterMapAnim:
.flyAnimation
pop hl
call LoadBirdSpriteGraphics
- ld a, $a4 ; SFX_BIRD_FLY
+ ld a, SFX_FLY
call PlaySound
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
@@ -104,7 +104,7 @@ _LeaveMapAnim:
dec a
jp nz, LeaveMapThroughHoleAnim
.spinWhileMovingUp
- ld a, $9f ; (SFX_02_4b - SFX_Headers_02) / 3
+ ld a, SFX_TELEPORT_EXIT_1
call PlaySound
ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, -$10
@@ -138,7 +138,7 @@ _LeaveMapAnim:
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
xor a
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
- ld [hl], $a1 ; SFX_TELEPORT_EXIT_2
+ ld [hl], SFX_TELEPORT_EXIT_2 ; wPlayerSpinInPlaceAnimSoundID
ld hl, wFacingDirectionList
call PlayerSpinInPlace
jr .spinWhileMovingUp
@@ -151,7 +151,7 @@ _LeaveMapAnim:
ld [hli], a ; wFlyAnimCounter
ld [hl], $c ; wFlyAnimBirdSpriteImageIndex
call DoFlyAnimation
- ld a, $a4 ; SFX_FLY
+ ld a, SFX_FLY
call PlaySound
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
@@ -258,7 +258,7 @@ LoadBirdSpriteGraphics:
ld c, $c
ld hl, vNPCSprites
call CopyVideoData
- ld de, BirdSprite + $c0 ; moving amination sprite
+ ld de, BirdSprite + $c0 ; moving animation sprite
ld b, BANK(BirdSprite)
ld c, $0c
ld hl, vNPCSprites2
@@ -392,7 +392,7 @@ FishingAnim:
ld c, 10
call DelayFrames
ld hl, wd736
- set 6, [hl]
+ set 6, [hl] ; reserve the last 4 OAM entries
ld hl, vNPCSprites
ld de, RedSprite
ld b, BANK(RedSprite)
@@ -422,7 +422,6 @@ FishingAnim:
; there was a bite
; shake the player's sprite vertically
-
ld b, 10
.loop
ld hl, wSpriteStateData1 + 4 ; player's sprite Y screen position
@@ -435,17 +434,19 @@ FishingAnim:
; If the player is facing up, hide the fishing rod so it doesn't overlap with
; the exclamation bubble that will be shown next.
- ld a, [wSpriteStateData1 + 2]
+ ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr nz, .skipHidingFishingRod
ld a, $a0
ld [wOAMBuffer + $9c], a
+
.skipHidingFishingRod
ld hl, wEmotionBubbleSpriteIndex
xor a
ld [hli], a ; player's sprite
ld [hl], a ; EXCLAMATION_BUBBLE
predef EmotionBubble
+
; If the player is facing up, unhide the fishing rod.
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
cp SPRITE_FACING_UP
diff --git a/engine/overworld/trainers.asm b/engine/overworld/trainers.asm
index 3ee19e8a..655c6b2a 100755
--- a/engine/overworld/trainers.asm
+++ b/engine/overworld/trainers.asm
@@ -57,7 +57,7 @@ _SetSpritePosition1:
_SetSpritePosition2:
ld hl, wSpriteStateData1
- ld de, $4
+ ld de, 4
ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a
call GetSpriteDataPointer
@@ -262,13 +262,13 @@ CheckSpriteCanSeePlayer:
jr .notInLine ; player too far away
.checkIfLinedUp
ld a, [wTrainerFacingDirection] ; sprite facing direction
- cp SPRITE_FACING_DOWN ; down
+ cp SPRITE_FACING_DOWN
jr z, .checkXCoord
- cp SPRITE_FACING_UP ; up
+ cp SPRITE_FACING_UP
jr z, .checkXCoord
- cp SPRITE_FACING_LEFT ; left
+ cp SPRITE_FACING_LEFT
jr z, .checkYCoord
- cp SPRITE_FACING_RIGHT ; right
+ cp SPRITE_FACING_RIGHT
jr z, .checkYCoord
jr .notInLine
.checkXCoord