summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-06-11 21:30:31 -0700
committerYamaArashi <shadow962@live.com>2016-06-11 21:33:57 -0700
commit4c5c98cb2a1bc747a0eb397cb75e48dc8a098494 (patch)
tree2872a6436075c0d6132671e98af44f0a1429e498 /engine/overworld
parent54143d33fc1211fb0c949ba62633d1c8d94f2717 (diff)
sync engine code with pokered
Diffstat (limited to 'engine/overworld')
-rwxr-xr-xengine/overworld/emotion_bubbles.asm4
-rwxr-xr-xengine/overworld/healing_machine.asm24
-rwxr-xr-xengine/overworld/map_sprites.asm1
-rw-r--r--engine/overworld/oam.asm2
-rwxr-xr-xengine/overworld/player_animations.asm27
-rwxr-xr-xengine/overworld/trainers.asm10
6 files changed, 34 insertions, 34 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 1dc74e2d..ed733d7d 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -1,5 +1,5 @@
AnimateHealingMachine:
- ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7
+ ld de, PokeCenterFlashingMonitorAndHealBall
ld hl, vChars0 + $7c0
lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles
call CopyVideoData
@@ -11,23 +11,23 @@ AnimateHealingMachine:
ld a, [rOBP1]
push af
ld a, $e0
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
call UpdateGBCPal_OBP1
ld hl, wOAMBuffer + $84
- ld de, PokeCenterOAMData ; $44d7
+ ld de, PokeCenterOAMData
call CopyHealingMachineOAM
ld a, 4
ld [wAudioFadeOutControl], a
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,22 +38,22 @@ 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
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
call UpdateGBCPal_OBP1
pop hl
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 eea1b375..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
@@ -253,12 +253,12 @@ DoFlyAnimation:
ret
LoadBirdSpriteGraphics:
- ld de, BirdSprite ; $4d80
+ ld de, BirdSprite
ld b, BANK(BirdSprite)
ld c, $c
ld hl, vNPCSprites
call CopyVideoData
- ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite
+ ld de, BirdSprite + $c0 ; moving animation sprite
ld b, BANK(BirdSprite)
ld c, $0c
ld hl, vNPCSprites2
@@ -392,9 +392,9 @@ 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 ; $4180
+ ld de, RedSprite
ld b, BANK(RedSprite)
ld c, $c
call CopyVideoData
@@ -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
@@ -463,7 +464,7 @@ FishingAnim:
call LoadFontTilePatterns
ret
-.ShakePlayerSprite ; 708a3 (1c:48a3)
+.ShakePlayerSprite
ld a, [hl]
xor $1
ld [hl], a
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