summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/billspctop.asm4
-rwxr-xr-xengine/color.asm2
-rw-r--r--engine/events/daycare.asm2
-rwxr-xr-xengine/events/misc_scripts_2.asm2
-rw-r--r--engine/learn.asm2
-rwxr-xr-xengine/learn_tm.asm2
-rwxr-xr-xengine/link/place_waiting_text.asm24
-rwxr-xr-xengine/main_menu.asm8
-rwxr-xr-xengine/move_mon.asm28
-rwxr-xr-xengine/pack.asm2
-rwxr-xr-xengine/predef.asm100
-rwxr-xr-xengine/specials.asm2
-rwxr-xr-xengine/title.asm4
13 files changed, 66 insertions, 116 deletions
diff --git a/engine/billspctop.asm b/engine/billspctop.asm
index bfaf3a0c..65403656 100644
--- a/engine/billspctop.asm
+++ b/engine/billspctop.asm
@@ -235,10 +235,10 @@ Functione566: ; e566 (3:6566)
call ByteFill
hlcoord 0, 0
lb bc, 10, 18
- call TextBox
+ call Textbox
hlcoord 0, 12
ld bc, IncGradGBPalTable_13
- call TextBox
+ call Textbox
call Function3456
call SetPalettes
ret
diff --git a/engine/color.asm b/engine/color.asm
index 7b081985..25f7179b 100755
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -31,7 +31,7 @@ CheckShininess:
and a
ret
-CheckContestMon: ; 9072 (2:5072)
+Unused_CheckShininess: ; 9072 (2:5072)
ld a, [hl]
cp $a0
jr c, .asm_908c
diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm
index 46cf62b8..4cd12087 100644
--- a/engine/events/daycare.asm
+++ b/engine/events/daycare.asm
@@ -522,7 +522,7 @@ DayCare_GiveEgg:
pop hl
push bc
ld b, FALSE
- predef CalcPkmnStats
+ predef CalcMonStats
pop bc
ld hl, MON_HP
add hl, bc
diff --git a/engine/events/misc_scripts_2.asm b/engine/events/misc_scripts_2.asm
index c86d3420..ac0f7e31 100755
--- a/engine/events/misc_scripts_2.asm
+++ b/engine/events/misc_scripts_2.asm
@@ -45,4 +45,4 @@ SetMemEvent:
ld e, a
ld b, SET_FLAG
call EventFlagAction
- ret \ No newline at end of file
+ ret
diff --git a/engine/learn.asm b/engine/learn.asm
index c3cb6a2f..d285d326 100644
--- a/engine/learn.asm
+++ b/engine/learn.asm
@@ -121,7 +121,7 @@ LearnMove:
hlcoord 5, 2
ld b, $8
ld c, $d
- call TextBox
+ call Textbox
hlcoord 7, 4
ld a, $28
ld [wBuffer1], a
diff --git a/engine/learn_tm.asm b/engine/learn_tm.asm
index 3116a6db..530ecf41 100755
--- a/engine/learn_tm.asm
+++ b/engine/learn_tm.asm
@@ -22,7 +22,7 @@ CanLearnTMHMMove: ; 11a25 (4:5a25)
ld b, CHECK_FLAG
push de
ld d, $0
- predef FlagPredef
+ predef SmallFarFlagAction
pop de
ret
diff --git a/engine/link/place_waiting_text.asm b/engine/link/place_waiting_text.asm
new file mode 100755
index 00000000..dc1fe215
--- /dev/null
+++ b/engine/link/place_waiting_text.asm
@@ -0,0 +1,24 @@
+PlaceWaitingText::
+ hlcoord 3, 10
+ ld b, 1
+ ld c, 11
+
+ ld a, [wBattleMode]
+ and a
+ jr z, .notinbattle
+
+ call Textbox
+ jr .proceed
+
+.notinbattle
+ predef LinkTextboxAtHL
+
+.proceed
+ hlcoord 4, 11
+ ld de, .Waiting
+ call PlaceString
+ ld c, 50
+ jp DelayFrames
+
+.Waiting:
+ db "Waiting...!@"
diff --git a/engine/main_menu.asm b/engine/main_menu.asm
index d04144c2..0bd56b1a 100755
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -152,11 +152,11 @@ Function5b45: ; 5b45 (1:5b45)
hlcoord 0, 12
ld b, $4
ld c, $d
- call TextBox
+ call Textbox
ret
.asm_5b57
- call SpeechTextBox
+ call SpeechTextbox
ret
Function5b5b: ; 5b5b (1:5b5b)
@@ -929,7 +929,7 @@ ShrinkPlayer: ; 6123 (1:6123)
ld a, e
ld [wMusicFadeID], a
ld a, d
- ld [wMusicFadeIDHi], a
+ ld [wMusicFadeID + 1], a
ld de, SFX_ESCAPE_ROPE
call PlaySFX
@@ -1051,7 +1051,7 @@ Intro_PrepTrainerPic: ; 61df, 61e0 (1:61df, 1:61e0)
ShrinkFrame: ; 61f7 (1:61f7)
ld de, $9000
ld c, $31
- predef DecompressPredef
+ predef DecompressGet2bpp
xor a
ld [hGraphicStartTile], a
hlcoord 6, 4
diff --git a/engine/move_mon.asm b/engine/move_mon.asm
index ec84c710..bbfea25e 100755
--- a/engine/move_mon.asm
+++ b/engine/move_mon.asm
@@ -214,7 +214,7 @@ GeneratePartyMonStats:
ld a, $1
ld c, a
ld b, $0
- call CalcPkmnStatC
+ call CalcMonStatC
ld a, [hStringCmpString2]
ld [de], a
inc de
@@ -281,7 +281,7 @@ GeneratePartyMonStats:
ld bc, $a
add hl, bc
ld b, $0
- call CalcPkmnStats
+ call CalcMonStats
.asm_da4b
ld a, [wMonType]
and $f
@@ -406,7 +406,7 @@ AddTempmonToParty: ; da9c (3:5a9c)
and a
ret
-SentGetPkmnIntoFromBox: ; db45 (3:5b45)
+SendGetMonIntoFromBox: ; db45 (3:5b45)
ld a, $1
call OpenSRAM
ld a, [wPokemonWithdrawDepositParameter]
@@ -544,7 +544,7 @@ SentGetPkmnIntoFromBox: ; db45 (3:5b45)
srl a
add $2
ld [wMonType], a
- predef CopyPkmnToTempMon
+ predef CopyMonToTempMon
callfar CalcLevel
ld a, d
ld [wCurPartyLevel], a
@@ -562,7 +562,7 @@ SentGetPkmnIntoFromBox: ; db45 (3:5b45)
add hl, bc
push bc
ld b, $1
- call CalcPkmnStats
+ call CalcMonStats
pop bc
ld a, [wPokemonWithdrawDepositParameter]
and a
@@ -766,7 +766,7 @@ Functiondd6a: ; dd6a (3:5d6a)
add hl, bc
push bc
ld b, $1
- call CalcPkmnStats
+ call CalcMonStats
ld hl, wPartyMon1Moves
ld a, [wPokemonData]
dec a
@@ -836,7 +836,7 @@ Functionde4a: ; de4a (3:5e4a)
ld bc, BOXMON_STRUCT_LENGTH
jp CopyBytes
-SentPkmnIntoBox: ; de74 (3:5e74)
+SendMonIntoBox: ; de74 (3:5e74)
ld a, $1
call OpenSRAM
ld de, sBoxCount
@@ -1016,7 +1016,7 @@ GiveEgg: ; df92 (3:5f92)
ld d, $0
ld hl, wPokedexCaught
ld b, RESET_FLAG
- predef FlagPredef
+ predef SmallFarFlagAction
.asm_dfc9
pop bc
ld a, c
@@ -1028,7 +1028,7 @@ GiveEgg: ; df92 (3:5f92)
ld d, $0
ld hl, wPokedexSeen
ld b, RESET_FLAG
- predef FlagPredef
+ predef SmallFarFlagAction
.asm_dfdf
pop af
ld [wCurPartySpecies], a
@@ -1234,7 +1234,7 @@ ComputeNPCTrademonStats:
ld a, MON_STAT_EXP - 1
call GetPartyParamLocation
ld b, $1
- call CalcPkmnStats
+ call CalcMonStats
pop de
ld a, MON_HP
call GetPartyParamLocation
@@ -1245,7 +1245,7 @@ ComputeNPCTrademonStats:
ld [hl], a
ret
-CalcPkmnStats: ; e16d
+CalcMonStats: ; e16d
; Calculates all 6 Stats of a Pkmn
; b: Take into account stat EXP if TRUE
; 'c' counts from 1-6 and points with 'BaseStats' to the base value
@@ -1255,7 +1255,7 @@ CalcPkmnStats: ; e16d
ld c, $0
.loop
inc c
- call CalcPkmnStatC
+ call CalcMonStatC
ld a, [hMultiplicand + 1]
ld [de], a
inc de
@@ -1268,7 +1268,7 @@ CalcPkmnStats: ; e16d
ret
; e17b
-CalcPkmnStatC: ; e181
+CalcMonStatC: ; e181
; 'c' is 1-6 and points to the BaseStat
; 1: HP
; 2: Attack
@@ -1511,7 +1511,7 @@ GivePoke: ; Give a Pokemon from script
ld a, [wCurPartySpecies]
ld [wTempEnemyMonSpecies], a
callfar LoadEnemyMon
- call SentPkmnIntoBox
+ call SendMonIntoBox
jp nc, Functione3af
ld a, BOXMON
ld [wMonType], a
diff --git a/engine/pack.asm b/engine/pack.asm
index 54bd23cc..27db7cd2 100755
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -1335,7 +1335,7 @@ Function10d70: ; 10d70 (4:4d70)
call Function10dc0
hlcoord 0, 12
ld bc, IncGradGBPalTable_13
- call TextBox
+ call Textbox
call EnableLCD
call Function10ccd
ret
diff --git a/engine/predef.asm b/engine/predef.asm
index 4e386f98..b0d0eb56 100755
--- a/engine/predef.asm
+++ b/engine/predef.asm
@@ -1,102 +1,28 @@
-GetPredefPointer:: ; 8b3b (2:4b3b)
+GetPredefPointer::
+; Return the bank and address of wPredefID in a and wPredefAddress.
+
+; Save hl for later (back in Predef)
ld a, h
- ld [wPredefHLBuffer], a
+ ld [wPredefTemp], a
ld a, l
- ld [wPredefHLBuffer + 1], a
+ ld [wPredefTemp + 1], a
+
push de
ld a, [wPredefID]
ld e, a
- ld d, $0
+ ld d, 0
ld hl, PredefPointers
add hl, de
add hl, de
add hl, de
pop de
+
ld a, [hli]
- ld [wPredefPointerBuffer + 1], a
+ ld [wPredefAddress + 1], a
ld a, [hli]
- ld [wPredefPointerBuffer], a
+ ld [wPredefAddress], a
ld a, [hl]
- ret
-PredefPointers::
-; temp macro
-predef_pointer: macro
-IF DEF(GOLD)
- dwb \1, \3
-ENDC
-IF DEF(SILVER)
- dwb \2, \3
-ENDC
-endm
+ ret
- add_predef LearnMove ; $0
- add_predef Predef1 ; $1
- add_predef HealParty
- add_predef FlagPredef
- add_predef ComputeHPBarPixels
- add_predef FillPP
- add_predef TryAddMonToParty
- add_predef AddTempmonToParty
- add_predef SentGetPkmnIntoFromBox
- add_predef SentPkmnIntoBox
- add_predef GiveEgg
- add_predef AnimateHPBar
- add_predef CalcPkmnStats
- add_predef CalcPkmnStatC
- add_predef CanLearnTMHMMove
- add_predef GetTMHMMove
- add_predef Predef_LinkTextbox ; $ 10
- add_predef PrintMoveDesc
- add_predef UpdatePlayerHUD
- add_predef PlaceGraphic
- add_predef CheckPlayerPartyForFitPkmn
- add_predef UpdateEnemyHUD
- add_predef StartBattle
- add_predef FillInExpBar
- add_predef GetMonBackpic ; $18
- add_predef GetMonFrontpic
- add_predef LearnLevelMoves
- add_predef FillMoves
- add_predef EvolveAfterBattle
- add_predef TradeAnimationPlayer2
- add_predef TradeAnimation
- add_predef CopyPkmnToTempMon
- add_predef ListMoves ; $20
- add_predef PlaceNonFaintStatus
- add_predef Predef22
- add_predef ListMovePP
- add_predef GetGender
- add_predef StatsScreenInit
- add_predef DrawPlayerHP
- add_predef DrawEnemyHP
- add_predef PrintTempMonStats ; $28
- add_predef GetTypeName
- add_predef PrintMoveType
- add_predef PrintType
- add_predef PrintMonTypes
- add_predef GetUnownLetter
- add_predef LoadPoisonBGPals
- add_predef Predef2F
- add_predef InitSGBBorder ; $30
- add_predef Predef_LoadSGBLayout
- add_predef Area_
- add_predef CheckContestMon
- add_predef Predef_StartBattle
- add_predef Predef35
- add_predef Predef36
- add_predef PlayBattleAnim
- add_predef Predef38 ; $38
- add_predef Predef39
- add_predef Predef3A
- add_predef PartyMonItemName
- add_predef GetFrontpic
- add_predef GetBackpic
- add_predef GetTrainerPic
- add_predef DecompressPredef
- add_predef CheckTypeMatchup ; $40
- add_predef ConvertMon_1to2
- add_predef NewPokedexEntry
- add_predef FrontpicPredef
- add_predef UpdateTimePredef
- dbw $ff, InexplicablyEmptyFunction
+INCLUDE "data/predef_pointers.asm" \ No newline at end of file
diff --git a/engine/specials.asm b/engine/specials.asm
index 78d281c0..aa8aefdd 100755
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -547,7 +547,7 @@ FadeOutMusic: ; c628 (3:4628)
ld a, $0
ld [wMusicFadeID], a
ld a, $0
- ld [wMusicFadeIDHi], a
+ ld [wMusicFadeID + 1], a
ld a, $2
ld [wMusicFade], a
ret
diff --git a/engine/title.asm b/engine/title.asm
index b2546dd2..8427dfc9 100755
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -341,8 +341,8 @@ Function6434:
ld hl, wce63
inc [hl]
xor a
- ld [wMusicFadeIDLo], a
- ld [wMusicFadeIDHi], a
+ ld [wMusicFadeID], a
+ ld [wMusicFadeID + 1], a
ld hl, wMusicFade
ld [hl], $8
ld hl, wce65