ref: 1caa50a6474edd3896911409d548faa0731621b7
parent: 5693cc49cfe6db05890c6f5fa8fbe460048f02c2
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Mon Jun 25 08:24:18 EDT 2018
No space between labels and bodies
--- a/audio/music_pointers.asm
+++ b/audio/music_pointers.asm
@@ -2,7 +2,6 @@
Music:
; entries correspond to MUSIC_* constants
-
dba Music_Nothing
dba Music_TitleScreen
dba Music_Route1
@@ -96,9 +95,7 @@
dba Music_LakeOfRageRocketRadio
dba Music_Printer
dba Music_PostCredits
-
-; Crystal adds the following songs:
-
+; new to Crystal
dba Music_Clair
dba Music_MobileAdapterMenu
dba Music_MobileAdapter
--- a/audio/sfx_pointers.asm
+++ b/audio/sfx_pointers.asm
@@ -1,6 +1,5 @@
SFX:
; entries correspond to SFX_* constants
-
dba Sfx_DexFanfare5079
dba Sfx_Item
dba Sfx_CaughtMon
@@ -191,9 +190,7 @@
dba Sfx_2Boops
dba Sfx_GlassTing
dba Sfx_GlassTing2
-
-; Crystal adds the following SFX:
-
+; new to Crystal
dba Sfx_IntroUnown1
dba Sfx_IntroUnown2
dba Sfx_IntroUnown3
--- a/engine/battle/ai/scoring.asm
+++ b/engine/battle/ai/scoring.asm
@@ -594,7 +594,6 @@
ret
AI_Smart_EvasionUp:
-
; Dismiss this move if enemy's evasion can't raise anymore.
ld a, [wEnemyEvaLevel]
cp $d
@@ -725,7 +724,6 @@
ret
AI_Smart_MirrorMove:
-
; If the player did not use any move last turn...
ld a, [wLastPlayerCounterMove]
and a
@@ -767,7 +765,6 @@
ret
AI_Smart_AccuracyDown:
-
; If player's HP is full...
call AICheckPlayerMaxHP
jr nc, .asm_389a0
@@ -872,7 +869,6 @@
ret
AI_Smart_ResetStats:
-
; 85% chance to encourage this move if any of enemy's stat levels is lower than -2.
push hl
ld hl, wEnemyAtkLevel
@@ -1090,7 +1086,6 @@
ret
AI_Smart_Confuse:
-
; 90% chance to discourage this move if player's HP is between 25% and 50%.
call AICheckPlayerHalfHP
ret c
@@ -1107,7 +1102,6 @@
ret
AI_Smart_SpDefenseUp2:
-
; Discourage this move if enemy's HP is lower than 50%.
call AICheckEnemyHalfHP
jr nc, .asm_38b10
@@ -1167,7 +1161,6 @@
ret
AI_Smart_Paralyze:
-
; 50% chance to discourage this move if player's HP is below 25%.
call AICheckPlayerQuarterHP
jr nc, .asm_38b3a
@@ -2025,7 +2018,6 @@
ret
AI_Smart_Sandstorm:
-
; Greatly discourage this move if the player is immune to Sandstorm damage.
ld a, [wBattleMonType1]
push hl
@@ -2207,7 +2199,6 @@
AI_Smart_Magnitude:
AI_Smart_Earthquake:
-
; Greatly encourage this move if the player is underground and the enemy is faster.
ld a, [wLastPlayerCounterMove]
cp DIG
@@ -2330,7 +2321,6 @@
ret
AI_Smart_RainDance:
-
; Greatly discourage this move if it would favour the player type-wise.
; Particularly, if the player is a Water-type.
ld a, [wBattleMonType1]
@@ -2352,7 +2342,6 @@
INCLUDE "data/battle/ai/rain_dance_moves.asm"
AI_Smart_SunnyDay:
-
; Greatly discourage this move if it would favour the player type-wise.
; Particularly, if the player is a Fire-type.
ld a, [wBattleMonType1]
@@ -2566,7 +2555,6 @@
AI_Smart_Twister:
AI_Smart_Gust:
-
; Greatly encourage this move if the player is flying and the enemy is faster.
ld a, [wLastPlayerCounterMove]
cp FLY
--- a/engine/battle/ai/switch.asm
+++ b/engine/battle/ai/switch.asm
@@ -435,8 +435,9 @@
and c
ld c, a
-FindEnemyMonsWithASuperEffectiveMove:
+ ; fallthrough
+FindEnemyMonsWithASuperEffectiveMove:
ld a, -1
ld [wEnemyAISwitchScore], a
ld hl, wOTPartyMon1Moves
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6036,7 +6036,6 @@
jp .Happiness
.InitDVs:
-
; Trainer DVs
; All trainers have preset DVs, determined by class
--- a/engine/battle/effect_commands.asm
+++ b/engine/battle/effect_commands.asm
@@ -68,7 +68,6 @@
ld [wBattleScriptBufferAddress + 1], a
.ReadMoveEffectCommand:
-
; ld a, [wBattleScriptBufferAddress++]
ld a, [wBattleScriptBufferAddress]
ld l, a
@@ -136,7 +135,6 @@
jp nz, CheckEnemyTurn
CheckPlayerTurn:
-
ld hl, wPlayerSubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -366,7 +364,6 @@
jp BattleCommand_SwitchTurn
CheckEnemyTurn:
-
ld hl, wEnemySubStatus4
bit SUBSTATUS_RECHARGE, [hl]
jr z, .no_recharge
@@ -589,7 +586,6 @@
jp ResetDamage
MoveDisabled:
-
; Make sure any charged moves fail
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVarAddr
@@ -604,7 +600,6 @@
jp StdBattleTextBox
HitConfusion:
-
ld hl, HurtItselfText
call StdBattleTextBox
@@ -811,7 +806,6 @@
jp .EndDisobedience
.UseInstead:
-
; Can't use another move if the monster only has one!
ld a, [wBattleMonMoves + 1]
and a
@@ -919,7 +913,6 @@
jp EndMoveEffect
IgnoreSleepOnly:
-
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVar
@@ -952,7 +945,6 @@
ret
CheckUserIsCharging:
-
ld a, [hBattleTurn]
and a
ld a, [wPlayerCharging] ; player
@@ -1775,7 +1767,6 @@
ret
.StatModifiers:
-
ld a, [hBattleTurn]
and a
@@ -3066,8 +3057,8 @@
ld [hDivisor], a
ld b, 4
call Divide
-.DoneItem:
+.DoneItem:
; Critical hits
call .CriticalMultiplier
@@ -3583,7 +3574,6 @@
jp ResetDamage
UpdateMoveData:
-
ld a, BATTLE_VARS_MOVE_ANIM
call GetBattleVarAddr
ld d, h
--- a/engine/battle/misc.asm
+++ b/engine/battle/misc.asm
@@ -50,7 +50,6 @@
ret
DoWeatherModifiers:
-
ld de, WeatherTypeModifiers
ld a, [wBattleWeather]
ld b, a
--- a/engine/battle/move_effects/baton_pass.asm
+++ b/engine/battle/move_effects/baton_pass.asm
@@ -45,7 +45,6 @@
ret
.Enemy:
-
; Wildmons don't have anything to switch to
ld a, [wBattleMode]
dec a ; WILDMON
--- a/engine/battle/move_effects/fury_cutter.asm
+++ b/engine/battle/move_effects/fury_cutter.asm
@@ -39,7 +39,6 @@
ret
ResetFuryCutterCount:
-
push hl
ld hl, wPlayerFuryCutterCount
--- a/engine/battle/move_effects/protect.asm
+++ b/engine/battle/move_effects/protect.asm
@@ -13,7 +13,6 @@
jp StdBattleTextBox
ProtectChance:
-
ld de, wPlayerProtectCount
ld a, [hBattleTurn]
and a
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -1,7 +1,6 @@
; Battle animation command interpreter.
PlayBattleAnim:
-
ld a, [rSVBK]
push af
@@ -15,7 +14,6 @@
ret
_PlayBattleAnim:
-
ld c, 6
.wait
call BattleAnimDelayFrame
@@ -53,7 +51,6 @@
ret
BattleAnimRunScript:
-
ld a, [wFXAnimID + 1]
and a
jr nz, .hi_byte
@@ -97,7 +94,6 @@
ret
RunBattleAnimScript:
-
call ClearBattleAnims
.playframe
@@ -139,7 +135,6 @@
ret
BattleAnimClearHud:
-
call BattleAnimDelayFrame
call WaitTop
call ClearActorHud
@@ -152,7 +147,6 @@
ret
BattleAnimRestoreHuds:
-
call BattleAnimDelayFrame
call WaitTop
@@ -177,7 +171,6 @@
ret
BattleAnimRequestPals:
-
ld a, [hCGB]
and a
ret z
@@ -207,7 +200,6 @@
ret
ClearActorHud:
-
ld a, [hBattleTurn]
and a
jr z, .player
@@ -241,7 +233,6 @@
ret
BattleAnim_ClearCGB_OAMFlags:
-
ld a, [wBattleAnimFlags]
bit 3, a
jr z, .delete
@@ -777,7 +768,6 @@
ret
BattleAnimCmd_EnemyFeetObj:
-
ld hl, wBattleAnimTileDict
.loop
ld a, [hl]
@@ -832,7 +822,6 @@
ret
BattleAnimCmd_PlayerHeadObj:
-
ld hl, wBattleAnimTileDict
.loop
ld a, [hl]
@@ -931,7 +920,6 @@
ret
BattleAnimCmd_UpdateActorPic:
-
ld de, vTiles0 tile $00
ld a, [hBattleTurn]
and a
@@ -951,7 +939,6 @@
ret
BattleAnimCmd_RaiseSub:
-
ld a, [rSVBK]
push af
ld a, 1 ; unnecessary bankswitch?
--- a/engine/events/shuckle.asm
+++ b/engine/events/shuckle.asm
@@ -1,7 +1,6 @@
MANIA_OT_ID EQU 00518
GiveShuckle:
-
; Adding to the party.
xor a
ld [wMonType], a
--- a/engine/events/treemons.asm
+++ b/engine/events/treemons.asm
@@ -27,7 +27,6 @@
ret
RockMonEncounter:
-
xor a
ld [wTempWildMonSpecies], a
ld [wCurPartyLevel], a
--- a/engine/games/unown_puzzle.asm
+++ b/engine/games/unown_puzzle.asm
@@ -731,7 +731,6 @@
ret
.EnlargedTiles:
-
x = 0
rept 16
db ((x & %1000) * %11000) + ((x & %0100) * %1100) + ((x & %0010) * %110) + ((x & %0001) * %11)
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -484,8 +484,8 @@
ld de, wEnemyMonPP
ld bc, NUM_MOVES
call CopyBytes
-.Transformed:
+.Transformed:
ld a, [wEnemyMonSpecies]
ld [wWildMon], a
ld [wCurPartySpecies], a
@@ -560,8 +560,8 @@
ld a, FRIEND_BALL_HAPPINESS
ld [hl], a
-.SkipPartyMonFriendBall:
+.SkipPartyMonFriendBall:
ld hl, Text_AskNicknameNewlyCaughtMon
call PrintText
--- a/engine/math/math.asm
+++ b/engine/math/math.asm
@@ -1,5 +1,4 @@
_Multiply::
-
; hMultiplier is one byte.
ld a, 8
ld b, a
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -94,7 +94,6 @@
ret
_ResetWRAM:
-
ld hl, wVirtualOAM
ld bc, wOptions - wVirtualOAM
xor a
@@ -801,7 +800,6 @@
ret
ShrinkPlayer:
-
ld a, [hROMBank]
push af
@@ -911,7 +909,6 @@
ret
Intro_PlacePlayerSprite:
-
farcall GetPlayerIcon
ld c, $c
ld hl, vTiles0
@@ -1067,7 +1064,6 @@
ret
TitleScreenEntrance:
-
; Animate the logo:
; Move each line by 4 pixels until our count hits 0.
ld a, [hSCX]
@@ -1115,7 +1111,6 @@
ret
TitleScreenTimer:
-
; Next scene
ld hl, wJumptableIndex
inc [hl]
@@ -1129,7 +1124,6 @@
ret
TitleScreenMain:
-
; Run the timer down.
ld hl, wTitleScreenTimer
ld e, [hl]
@@ -1230,7 +1224,6 @@
ret
TitleScreenEnd:
-
; Wait until the music is done fading.
ld hl, wTitleScreenTimer
--- a/engine/menus/start_menu.asm
+++ b/engine/menus/start_menu.asm
@@ -11,7 +11,6 @@
const STARTMENUITEM_QUIT ; 8
StartMenu::
-
call ClearWindowData
ld de, SFX_MENU
@@ -24,8 +23,8 @@
ld hl, .MenuHeader
jr z, .GotMenuData
ld hl, .ContestMenuHeader
-.GotMenuData:
+.GotMenuData:
call LoadMenuHeader
call .SetUpMenuItems
ld a, [wBattleMenuCursorBuffer]
@@ -459,7 +458,6 @@
ret
StartMenu_Pokedex:
-
ld a, [wPartyCount]
and a
jr z, .asm_12949
@@ -473,7 +471,6 @@
ret
StartMenu_Pokegear:
-
call FadeToMenu
farcall PokeGear
call CloseSubmenu
@@ -481,7 +478,6 @@
ret
StartMenu_Pack:
-
call FadeToMenu
farcall Pack
ld a, [wPackUsedItem]
@@ -497,7 +493,6 @@
ret
StartMenu_Pokemon:
-
ld a, [wPartyCount]
and a
jr z, .return
@@ -700,7 +695,6 @@
dbw MONMENUITEM_MAIL, MonMailAction
SwitchPartyMons:
-
; Don't try if there's nothing to switch!
ld a, [wPartyCount]
cp 2
@@ -751,7 +745,6 @@
ret
GiveTakePartyMonItem:
-
; Eggs can't hold items!
ld a, [wCurPartySpecies]
cp EGG
@@ -791,7 +784,6 @@
ret
.GiveItem:
-
farcall DepositSellInitPackBuffers
.loop
@@ -822,7 +814,6 @@
ret
TryGiveItemToPartymon:
-
call SpeechTextBox
call PartyMonItemName
call GetPartyItemLocation
@@ -885,7 +876,6 @@
ret
GivePartyItem:
-
call GetPartyItemLocation
ld a, [wCurItem]
ld [hl], a
@@ -898,7 +888,6 @@
ret
TakePartyItem:
-
call SpeechTextBox
call GetPartyItemLocation
ld a, [hl]
--- a/engine/movie/gbc_only.asm
+++ b/engine/movie/gbc_only.asm
@@ -1,5 +1,4 @@
GBCOnlyScreen:
-
ld a, [hCGB]
and a
ret nz
@@ -39,7 +38,6 @@
jr .loop
DrawGBCOnlyScreen:
-
call DrawGBCOnlyBorder
; Pokemon
@@ -63,7 +61,6 @@
ret
DrawGBCOnlyBorder:
-
hlcoord 0, 0
ld [hl], 0 ; top-left
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -1,5 +1,4 @@
_TitleScreen:
-
call ClearBGPalettes
call ClearSprites
call ClearTileMap
--- a/engine/movie/unused_title.asm
+++ b/engine/movie/unused_title.asm
@@ -1,5 +1,4 @@
UnusedTitleScreen:
-
call ClearBGPalettes
call ClearTileMap
call DisableLCD
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -485,7 +485,6 @@
ret
OWPlayerInput:
-
call PlayerMovement
ret c
and a
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -1,5 +1,4 @@
CanObjectMoveInDirection:
-
ld hl, OBJECT_PALETTE
add hl, bc
bit SWIMMING_F, [hl]
@@ -216,7 +215,6 @@
ret
CheckFacingObject::
-
call GetFacingTileCoord
; Double the distance for counter tiles.
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -256,7 +256,6 @@
ret
.TryStep:
-
; Surfing actually calls .TrySurf directly instead of passing through here.
ld a, [wPlayerState]
cp PLAYER_SURF
@@ -321,7 +320,6 @@
ret
.TrySurf:
-
call .CheckSurfPerms
ld [wd040], a
jr c, .surf_bump
@@ -395,7 +393,6 @@
db FACE_UP | FACE_LEFT ; COLL_HOP_UP_LEFT
.CheckWarp:
-
; Bug: Since no case is made for STANDING here, it will check
; [.edgewarps + $ff]. This resolves to $3e at $8035a.
; This causes wd041 to be nonzero when standing on tile $3e,
@@ -657,7 +654,6 @@
ret
.CheckStrengthBoulder:
-
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .not_boulder
@@ -779,7 +775,6 @@
ret
.BumpSound:
-
call CheckSFX
ret c
ld de, SFX_BUMP
--- a/engine/overworld/select_menu.asm
+++ b/engine/overworld/select_menu.asm
@@ -1,5 +1,4 @@
SelectMenu::
-
call CheckRegisteredItem
jr c, .NotRegistered
jp UseRegisteredItem
@@ -17,7 +16,6 @@
db "@"
CheckRegisteredItem:
-
ld a, [wWhichRegisteredItem]
and a
jr z, .NoRegisteredItem
@@ -110,7 +108,6 @@
ret
UseRegisteredItem:
-
farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
ld hl, .SwitchTo
--- a/engine/pokedex/pokedex.asm
+++ b/engine/pokedex/pokedex.asm
@@ -19,7 +19,6 @@
GLOBAL POKEDEX_SCX
Pokedex:
-
ld a, [hWX]
ld l, a
ld a, [hWY]
--- a/engine/pokemon/mon_stats.asm
+++ b/engine/pokemon/mon_stats.asm
@@ -170,7 +170,6 @@
call AddNTimes
.DVs:
-
; sBoxMon data is read directly from SRAM.
ld a, [wMonType]
cp BOXMON
--- a/home.asm
+++ b/home.asm
@@ -2,6 +2,7 @@
SECTION "NULL", ROM0
+
NULL::
INCLUDE "home/rst.asm"
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -1,7 +1,6 @@
; Audio interfaces.
MapSetup_Sound_Off::
-
push hl
push de
push bc
@@ -26,7 +25,6 @@
ret
UpdateSound::
-
push hl
push de
push bc
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -142,10 +142,6 @@
ret
MobileTextBorder::
-
-CELL_PHONE_TOP EQU $5e
-CELL_PHONE_BOTTOM EQU $5f
-
; For mobile link battles only.
ld a, [wLinkMode]
cp LINK_MOBILE
@@ -154,9 +150,9 @@
; Draw a cell phone icon at the
; top right corner of the border.
hlcoord 19, 12
- ld [hl], CELL_PHONE_TOP
+ ld [hl], $5e ; top
hlcoord 19, 13
- ld [hl], CELL_PHONE_BOTTOM
+ ld [hl], $5f ; bottom
ret
BattleTextBox::
@@ -186,7 +182,6 @@
ret
GetBattleAnimPointer::
-
ld a, BANK(BattleAnimations)
rst Bankswitch
@@ -201,7 +196,6 @@
ret
GetBattleAnimByte::
-
push hl
push de
--- a/home/game_time.asm
+++ b/home/game_time.asm
@@ -9,7 +9,6 @@
ret
GameTimer::
-
nop
ld a, [rSVBK]
--- a/home/init.asm
+++ b/home/init.asm
@@ -33,7 +33,6 @@
ld [hSystemBooted], a
Init::
-
di
xor a
--- a/home/map.asm
+++ b/home/map.asm
@@ -757,7 +757,6 @@
ret
FillMapConnections::
-
; North
ld a, [wNorthConnectedMapGroup]
cp $ff
@@ -855,7 +854,6 @@
FillNorthConnectionStrip::
FillSouthConnectionStrip::
-
ld c, 3
.y
push de
@@ -890,7 +888,6 @@
FillWestConnectionStrip::
FillEastConnectionStrip::
-
.loop
ld a, [wMapWidth]
add 6
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -18,7 +18,6 @@
ret z
ForceUpdateCGBPals::
-
ld a, [rSVBK]
push af
ld a, BANK(wBGPals2)
--- a/home/text.asm
+++ b/home/text.asm
@@ -52,7 +52,6 @@
jr TextBoxPalette
TextBoxBorder::
-
; Top
push hl
ld a, "┌"
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -20,7 +20,6 @@
.loop
; Start a battle if the object:
-
push af
push de
@@ -128,7 +127,6 @@
ret
FacingPlayerDistance_bc::
-
push de
call FacingPlayerDistance
ld b, d
--- a/home/video.asm
+++ b/home/video.asm
@@ -356,7 +356,6 @@
jr _Serve2bppRequest
Serve2bppRequest_VBlank::
-
ld a, [wRequested2bpp]
and a
ret z