summaryrefslogtreecommitdiff
path: root/engine/routines
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 18:21:53 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 19:42:56 -0500
commit32ed487a476e01759d3d9dbc818d8566ae2c9cb7 (patch)
tree669e90b56d36f17efff5f673235193f5298c0ceb /engine/routines
parent6ff2cb20e67db2054486fc5dc48eb9263298d4ad (diff)
parentb35eb72290b964b98844afbe741bb7ede34b9ef3 (diff)
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # audio/engine.asm # constants/gfx_constants.asm # constants/map_data_constants.asm # constants/pokemon_data_constants.asm # constants/sprite_constants.asm # constants/wram_constants.asm # data/maps/data.asm # engine/battle/ai/scoring.asm # engine/battle/core.asm # engine/battle/effect_commands.asm # engine/battle/misc.asm # engine/battle_anims/getpokeballwobble.asm # engine/breeding.asm # engine/buy_sell_toss.asm # engine/decorations.asm # engine/events/battle_tower/battle_tower.asm # engine/events/battle_tower/rules.asm # engine/events/buena.asm # engine/events/bug_contest/contest_2.asm # engine/events/daycare.asm # engine/events/dratini.asm # engine/events/halloffame.asm # engine/events/happiness_egg.asm # engine/events/kurt.asm # engine/events/lucky_number.asm # engine/events/magnet_train.asm # engine/events/overworld.asm # engine/events/pokerus/pokerus.asm # engine/events/print_unown.asm # engine/events/print_unown_2.asm # engine/events/unown_walls.asm # engine/item_effects.asm # engine/link.asm # engine/mon_menu.asm # engine/player_object.asm # engine/routines/playslowcry.asm # engine/scripting.asm # engine/search.asm # engine/search2.asm # engine/specials.asm # engine/start_menu.asm # engine/timeset.asm # home/battle_vars.asm # home/map.asm # maps/GoldenrodUndergroundSwitchRoomEntrances.asm # maps/IlexForest.asm # maps/KrissHouse2F.asm # maps/Route39Barn.asm # mobile/mobile_12_2.asm # mobile/mobile_40.asm # mobile/mobile_5f.asm # wram.asm
Diffstat (limited to 'engine/routines')
-rw-r--r--engine/routines/checktime.asm2
-rw-r--r--engine/routines/correcterrorsinplayerparty.asm32
-rw-r--r--engine/routines/getbreedmonlevelgrowth.asm4
-rw-r--r--engine/routines/initlist.asm14
-rw-r--r--engine/routines/leveluphappinessmod.asm8
-rw-r--r--engine/routines/loadpushoam.asm6
-rw-r--r--engine/routines/phonering_copytilemapatonce.asm2
-rw-r--r--engine/routines/playslowcry.asm14
-rw-r--r--engine/routines/printitemdescription.asm10
-rw-r--r--engine/routines/savemenu_copytilemapatonce.asm2
-rw-r--r--engine/routines/switchpartymons.asm44
-rw-r--r--engine/routines/townmap_convertlinebreakcharacters.asm4
-rw-r--r--engine/routines/trademonfrontpic.asm12
-rw-r--r--engine/routines/unreferenced_getgen1trainerclassname.asm4
-rw-r--r--engine/routines/updateitemdescription.asm6
15 files changed, 82 insertions, 82 deletions
diff --git a/engine/routines/checktime.asm b/engine/routines/checktime.asm
index ada151dbf..4c7d033ff 100644
--- a/engine/routines/checktime.asm
+++ b/engine/routines/checktime.asm
@@ -1,5 +1,5 @@
CheckTime:: ; c000
- ld a, [TimeOfDay]
+ ld a, [wTimeOfDay]
ld hl, .TimeOfDayTable
ld de, 2
call IsInArray
diff --git a/engine/routines/correcterrorsinplayerparty.asm b/engine/routines/correcterrorsinplayerparty.asm
index 42e550900..5f2bba6bc 100644
--- a/engine/routines/correcterrorsinplayerparty.asm
+++ b/engine/routines/correcterrorsinplayerparty.asm
@@ -1,5 +1,5 @@
Unreferenced_CorrectErrorsInPlayerParty:
- ld hl, PartyCount
+ ld hl, wPartyCount
ld a, [hl]
and a
ret z
@@ -27,7 +27,7 @@ Unreferenced_CorrectErrorsInPlayerParty:
push hl
push bc
ld a, c
- ld hl, PartyMon1Species
+ ld hl, wPartyMon1Species
call GetPartyLocation
ld [hl], SMEARGLE
pop bc
@@ -40,8 +40,8 @@ Unreferenced_CorrectErrorsInPlayerParty:
jr nz, .loop1
ld [hl], $ff
- ld hl, PartyMon1
- ld a, [PartyCount]
+ ld hl, wPartyMon1
+ ld a, [wPartyCount]
ld d, a
ld e, 0
.loop2
@@ -59,14 +59,14 @@ Unreferenced_CorrectErrorsInPlayerParty:
ld [hl], SMEARGLE
push de
ld d, 0
- ld hl, PartySpecies
+ ld hl, wPartySpecies
add hl, de
pop de
ld a, SMEARGLE
ld [hl], a
.check_level
- ld [CurSpecies], a
+ ld [wCurSpecies], a
call GetBaseData
ld hl, MON_LEVEL
add hl, bc
@@ -81,7 +81,7 @@ Unreferenced_CorrectErrorsInPlayerParty:
.invalid_level
ld [hl], a
.load_level
- ld [CurPartyLevel], a
+ ld [wCurPartyLevel], a
ld hl, MON_MAXHP
add hl, bc
@@ -99,8 +99,8 @@ Unreferenced_CorrectErrorsInPlayerParty:
dec d
jr nz, .loop2
- ld de, PartyMonNicknames
- ld a, [PartyCount]
+ ld de, wPartyMonNicknames
+ ld a, [wPartyCount]
ld b, a
ld c, 0
.loop3
@@ -114,7 +114,7 @@ Unreferenced_CorrectErrorsInPlayerParty:
push bc
push hl
- ld hl, PartySpecies
+ ld hl, wPartySpecies
push bc
ld b, 0
add hl, bc
@@ -125,7 +125,7 @@ Unreferenced_CorrectErrorsInPlayerParty:
jr z, .got_nickname
ld [wd265], a
call GetPokemonName
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.got_nickname
pop de
ld bc, MON_NAME_LENGTH
@@ -137,8 +137,8 @@ Unreferenced_CorrectErrorsInPlayerParty:
dec b
jr nz, .loop3
- ld de, PartyMonOT
- ld a, [PartyCount]
+ ld de, wPartyMonOT
+ ld a, [wPartyCount]
ld b, a
ld c, 0
.loop4
@@ -150,7 +150,7 @@ Unreferenced_CorrectErrorsInPlayerParty:
jr nc, .valid_ot_name
ld d, h
ld e, l
- ld hl, PlayerName
+ ld hl, wPlayerName
ld bc, NAME_LENGTH
call CopyBytes
.valid_ot_name
@@ -159,8 +159,8 @@ Unreferenced_CorrectErrorsInPlayerParty:
dec b
jr nz, .loop4
- ld hl, PartyMon1Moves
- ld a, [PartyCount]
+ ld hl, wPartyMon1Moves
+ ld a, [wPartyCount]
ld b, a
.loop5
push hl
diff --git a/engine/routines/getbreedmonlevelgrowth.asm b/engine/routines/getbreedmonlevelgrowth.asm
index b029043d6..dc22db798 100644
--- a/engine/routines/getbreedmonlevelgrowth.asm
+++ b/engine/routines/getbreedmonlevelgrowth.asm
@@ -1,6 +1,6 @@
GetBreedMon1LevelGrowth: ; e698
ld hl, wBreedMon1Stats
- ld de, TempMon
+ ld de, wTempMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
callfar CalcLevel
@@ -14,7 +14,7 @@ GetBreedMon1LevelGrowth: ; e698
GetBreedMon2LevelGrowth: ; e6b3
ld hl, wBreedMon2Stats
- ld de, TempMon
+ ld de, wTempMon
ld bc, BOXMON_STRUCT_LENGTH
call CopyBytes
callfar CalcLevel
diff --git a/engine/routines/initlist.asm b/engine/routines/initlist.asm
index b7260e552..26c77b5bb 100644
--- a/engine/routines/initlist.asm
+++ b/engine/routines/initlist.asm
@@ -3,23 +3,23 @@ InitList: ; 50db9
cp INIT_ENEMYOT_LIST
jr nz, .check_party_ot_name
- ld hl, OTPartyCount
- ld de, OTPartyMonOT
+ ld hl, wOTPartyCount
+ ld de, wOTPartyMonOT
ld a, ENEMY_OT_NAME
jr .done
.check_party_ot_name
cp INIT_PLAYEROT_LIST
jr nz, .check_mon_name
- ld hl, PartyCount
- ld de, PartyMonOT
+ ld hl, wPartyCount
+ ld de, wPartyMonOT
ld a, PARTY_OT_NAME
jr .done
.check_mon_name
cp INIT_MON_LIST
jr nz, .check_item_name
- ld hl, CurMart
+ ld hl, wCurMart
ld de, PokemonNames
ld a, MON_NAME
jr .done
@@ -27,13 +27,13 @@ InitList: ; 50db9
.check_item_name
cp INIT_BAG_ITEM_LIST
jr nz, .check_ob_item_name
- ld hl, NumItems
+ ld hl, wNumItems
ld de, ItemNames
ld a, ITEM_NAME
jr .done
.check_ob_item_name
- ld hl, CurMart
+ ld hl, wCurMart
ld de, ItemNames
ld a, ITEM_NAME
.done
diff --git a/engine/routines/leveluphappinessmod.asm b/engine/routines/leveluphappinessmod.asm
index c253e8872..8c6dd92fe 100644
--- a/engine/routines/leveluphappinessmod.asm
+++ b/engine/routines/leveluphappinessmod.asm
@@ -1,13 +1,13 @@
LevelUpHappinessMod: ; 2709e
- ld a, [CurPartyMon]
- ld hl, PartyMon1CaughtLocation
+ ld a, [wCurPartyMon]
+ ld hl, wPartyMon1CaughtLocation
call GetPartyLocation
ld a, [hl]
and $7f
ld d, a
- ld a, [MapGroup]
+ ld a, [wMapGroup]
ld b, a
- ld a, [MapNumber]
+ ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
cp d
diff --git a/engine/routines/loadpushoam.asm b/engine/routines/loadpushoam.asm
index c07c06d0f..95f67ff73 100644
--- a/engine/routines/loadpushoam.asm
+++ b/engine/routines/loadpushoam.asm
@@ -1,5 +1,5 @@
-LoadPushOAM:: ; 4031
- ld c, hPushOAM - $ff00
+WriteOAMDMACodeToHRAM:: ; 4031
+ ld c, hTransferVirtualOAM - $ff00
ld b, .PushOAMEnd - .PushOAM
ld hl, .PushOAM
.loop
@@ -11,7 +11,7 @@ LoadPushOAM:: ; 4031
ret
.PushOAM: ; 403f
- ld a, HIGH(Sprites)
+ ld a, HIGH(wVirtualOAM)
ld [rDMA], a
ld a, NUM_SPRITE_OAM_STRUCTS
.pushoam_loop
diff --git a/engine/routines/phonering_copytilemapatonce.asm b/engine/routines/phonering_copytilemapatonce.asm
index cefe9a66d..b0d4ffa1e 100644
--- a/engine/routines/phonering_copytilemapatonce.asm
+++ b/engine/routines/phonering_copytilemapatonce.asm
@@ -23,7 +23,7 @@ PhoneRing_CopyTilemapAtOnce: ; 4d188
di
ld a, BANK(vBGMap2)
ld [rVBK], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
call .CopyTilemapAtOnce
ld a, BANK(vBGMap0)
ld [rVBK], a
diff --git a/engine/routines/playslowcry.asm b/engine/routines/playslowcry.asm
index 6f28ea845..1f27a7ca4 100644
--- a/engine/routines/playslowcry.asm
+++ b/engine/routines/playslowcry.asm
@@ -1,28 +1,28 @@
PlaySlowCry: ; fb841
- ld a, [ScriptVar]
+ ld a, [wScriptVar]
call LoadCry
jr c, .done
- ld hl, CryPitch
+ ld hl, wCryPitch
ld a, [hli]
ld h, [hl]
ld l, a
ld bc, -$140
add hl, bc
ld a, l
- ld [CryPitch], a
+ ld [wCryPitch], a
ld a, h
- ld [CryPitch + 1], a
- ld hl, CryLength
+ ld [wCryPitch + 1], a
+ ld hl, wCryLength
ld a, [hli]
ld h, [hl]
ld l, a
ld bc, $60
add hl, bc
ld a, l
- ld [CryLength], a
+ ld [wCryLength], a
ld a, h
- ld [CryLength + 1], a
+ ld [wCryLength + 1], a
farcall _PlayCry
call WaitSFX
diff --git a/engine/routines/printitemdescription.asm b/engine/routines/printitemdescription.asm
index e6d087dae..2a9007b97 100644
--- a/engine/routines/printitemdescription.asm
+++ b/engine/routines/printitemdescription.asm
@@ -1,23 +1,23 @@
PrintItemDescription: ; 0x1c8955
-; Print the description for item [CurSpecies] at de.
+; Print the description for item [wCurSpecies] at de.
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
cp TM01
jr c, .not_a_tm
- ld [CurItem], a
+ ld [wCurItem], a
push de
farcall GetTMHMItemMove
pop hl
ld a, [wd265]
- ld [CurSpecies], a
+ ld [wCurSpecies], a
predef PrintMoveDesc
ret
.not_a_tm
push de
ld hl, ItemDescriptions
- ld a, [CurSpecies]
+ ld a, [wCurSpecies]
dec a
ld c, a
ld b, 0
diff --git a/engine/routines/savemenu_copytilemapatonce.asm b/engine/routines/savemenu_copytilemapatonce.asm
index 5d4ed8b7d..9b50494a4 100644
--- a/engine/routines/savemenu_copytilemapatonce.asm
+++ b/engine/routines/savemenu_copytilemapatonce.asm
@@ -20,7 +20,7 @@ SaveMenu_CopyTilemapAtOnce: ; 4cf45 (13:4f45)
di
ld a, BANK(vBGMap2)
ld [rVBK], a
- hlcoord 0, 0, AttrMap
+ hlcoord 0, 0, wAttrMap
call .CopyTilemapAtOnce
ld a, BANK(vBGMap0)
ld [rVBK], a
diff --git a/engine/routines/switchpartymons.asm b/engine/routines/switchpartymons.asm
index 1379dff9c..b01178417 100644
--- a/engine/routines/switchpartymons.asm
+++ b/engine/routines/switchpartymons.asm
@@ -1,17 +1,17 @@
_SwitchPartyMons:
ld a, [wd0e3]
dec a
- ld [Buffer3], a
+ ld [wBuffer3], a
ld b, a
ld a, [wMenuCursorY]
dec a
- ld [Buffer2], a
+ ld [wBuffer2], a
cp b
jr z, .skip
call .SwapMonAndMail
- ld a, [Buffer3]
+ ld a, [wBuffer3]
call .ClearSprite
- ld a, [Buffer2]
+ ld a, [wBuffer2]
call .ClearSprite
.skip
ret
@@ -25,7 +25,7 @@ _SwitchPartyMons:
ld a, " "
call ByteFill
pop af
- ld hl, Sprite01
+ ld hl, wVirtualOAMSprite00
ld bc, 4 * SPRITEOAMSTRUCT_LENGTH
call AddNTimes
ld de, SPRITEOAMSTRUCT_LENGTH
@@ -43,14 +43,14 @@ _SwitchPartyMons:
push hl
push de
push bc
- ld bc, PartySpecies
- ld a, [Buffer2]
+ ld bc, wPartySpecies
+ ld a, [wBuffer2]
ld l, a
ld h, $0
add hl, bc
ld d, h
ld e, l
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld l, a
ld h, $0
add hl, bc
@@ -60,16 +60,16 @@ _SwitchPartyMons:
ld [hl], a
pop af
ld [de], a
- ld a, [Buffer2]
- ld hl, PartyMon1Species
+ ld a, [wBuffer2]
+ ld hl, wPartyMon1Species
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
push hl
ld de, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [Buffer3]
- ld hl, PartyMon1
+ ld a, [wBuffer3]
+ ld hl, wPartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
pop de
@@ -80,13 +80,13 @@ _SwitchPartyMons:
ld hl, wd002
ld bc, PARTYMON_STRUCT_LENGTH
call CopyBytes
- ld a, [Buffer2]
- ld hl, PartyMonOT
+ ld a, [wBuffer2]
+ ld hl, wPartyMonOT
call SkipNames
push hl
call .CopyNameTowd002
- ld a, [Buffer3]
- ld hl, PartyMonOT
+ ld a, [wBuffer3]
+ ld hl, wPartyMonOT
call SkipNames
pop de
push hl
@@ -94,13 +94,13 @@ _SwitchPartyMons:
pop de
ld hl, wd002
call .CopyName
- ld hl, PartyMonNicknames
- ld a, [Buffer2]
+ ld hl, wPartyMonNicknames
+ ld a, [wBuffer2]
call SkipNames
push hl
call .CopyNameTowd002
- ld hl, PartyMonNicknames
- ld a, [Buffer3]
+ ld hl, wPartyMonNicknames
+ ld a, [wBuffer3]
call SkipNames
pop de
push hl
@@ -109,7 +109,7 @@ _SwitchPartyMons:
ld hl, wd002
call .CopyName
ld hl, sPartyMail
- ld a, [Buffer2]
+ ld a, [wBuffer2]
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
push hl
@@ -119,7 +119,7 @@ _SwitchPartyMons:
call GetSRAMBank
call CopyBytes
ld hl, sPartyMail
- ld a, [Buffer3]
+ ld a, [wBuffer3]
ld bc, MAIL_STRUCT_LENGTH
call AddNTimes
pop de
diff --git a/engine/routines/townmap_convertlinebreakcharacters.asm b/engine/routines/townmap_convertlinebreakcharacters.asm
index f08b436c9..6ccd79aae 100644
--- a/engine/routines/townmap_convertlinebreakcharacters.asm
+++ b/engine/routines/townmap_convertlinebreakcharacters.asm
@@ -1,5 +1,5 @@
TownMap_ConvertLineBreakCharacters: ; 1de2c5
- ld hl, StringBuffer1
+ ld hl, wStringBuffer1
.loop
ld a, [hl]
cp "@"
@@ -15,7 +15,7 @@ TownMap_ConvertLineBreakCharacters: ; 1de2c5
ld [hl], "<LNBRK>"
.end
- ld de, StringBuffer1
+ ld de, wStringBuffer1
hlcoord 9, 0
call PlaceString
ret
diff --git a/engine/routines/trademonfrontpic.asm b/engine/routines/trademonfrontpic.asm
index e9611553b..d5f7b55de 100644
--- a/engine/routines/trademonfrontpic.asm
+++ b/engine/routines/trademonfrontpic.asm
@@ -6,8 +6,8 @@ GetTrademonFrontpic: ; 4d7fd
push af
predef GetUnownLetter
pop af
- ld [CurPartySpecies], a
- ld [CurSpecies], a
+ ld [wCurPartySpecies], a
+ ld [wCurSpecies], a
call GetBaseData
pop de
predef GetAnimatedFrontpic
@@ -19,18 +19,18 @@ AnimateTrademonFrontpic: ; 4d81e
ret c
farcall ShowOTTrademonStats
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
ld a, [wOTTrademonDVs]
- ld [TempMonDVs], a
+ ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
- ld [TempMonDVs + 1], a
+ ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
farcall TradeAnim_ShowGetmonFrontpic
ld a, [wOTTrademonSpecies]
- ld [CurPartySpecies], a
+ ld [wCurPartySpecies], a
hlcoord 7, 2
ld d, $0
ld e, ANIM_MON_TRADE
diff --git a/engine/routines/unreferenced_getgen1trainerclassname.asm b/engine/routines/unreferenced_getgen1trainerclassname.asm
index 3e23fa711..da8e98b61 100644
--- a/engine/routines/unreferenced_getgen1trainerclassname.asm
+++ b/engine/routines/unreferenced_getgen1trainerclassname.asm
@@ -1,6 +1,6 @@
Unreferenced_GetGen1TrainerClassName: ; 50a28
ld hl, Gen1TrainerClassNames
- ld a, [TrainerClass]
+ ld a, [wTrainerClass]
dec a
ld c, a
ld b, 0
@@ -9,7 +9,7 @@ Unreferenced_GetGen1TrainerClassName: ; 50a28
ld a, [hli]
ld h, [hl]
ld l, a
- ld de, StringBuffer1
+ ld de, wStringBuffer1
.copy
ld a, [hli]
ld [de], a
diff --git a/engine/routines/updateitemdescription.asm b/engine/routines/updateitemdescription.asm
index b684dd4d8..fdb1e864d 100644
--- a/engine/routines/updateitemdescription.asm
+++ b/engine/routines/updateitemdescription.asm
@@ -1,11 +1,11 @@
UpdateItemDescription: ; 0x244c3
- ld a, [MenuSelection]
- ld [CurSpecies], a
+ ld a, [wMenuSelection]
+ ld [wCurSpecies], a
hlcoord 0, 12
ld b, 4
ld c, SCREEN_WIDTH - 2
call TextBox
- ld a, [MenuSelection]
+ ld a, [wMenuSelection]
cp -1
ret z
decoord 1, 14