From 04d0490c4c55366220310b9b8e1c4a181e07d842 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 15 Jul 2018 11:56:57 +0200 Subject: Fix anim_ret_command --- engine/battle_anims/anim_commands.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine') diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index e68b7d774..600168a9a 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -284,7 +284,7 @@ RunBattleAnimCommand: .loop call GetBattleAnimByte - cp $ff + cp anim_ret_command jr nz, .not_done_with_anim ; Return from a subroutine. -- cgit v1.2.3 From 23708441effabc167439724ee3d81a6f5ca84a76 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 15 Jul 2018 11:58:10 +0200 Subject: Make proper cmdqueue constants --- engine/overworld/events.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine') diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 707d31e66..e4defbc2b 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -1336,8 +1336,8 @@ DoBikeStep:: ClearCmdQueue:: ld hl, wCmdQueue - ld de, 6 - ld c, 4 + ld de, CMDQUEUE_ENTRY_SIZE + ld c, CMDQUEUE_CAPACITY xor a .loop ld [hl], a @@ -1443,7 +1443,7 @@ HandleQueuedCommand: ld hl, CMDQUEUE_TYPE add hl, bc ld a, [hl] - cp 5 + cp NUM_CMDQUEUE_TYPES jr c, .okay xor a -- cgit v1.2.3 From 778d57ba217e9f0da9af03beceab0cc5fbd153b5 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 15 Jul 2018 13:18:28 +0200 Subject: Remove some more address comments --- engine/battle/ai/scoring.asm | 2 +- engine/events/battle_tower/battle_tower.asm | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'engine') diff --git a/engine/battle/ai/scoring.asm b/engine/battle/ai/scoring.asm index 6928a3a83..3cd0e56c4 100644 --- a/engine/battle/ai/scoring.asm +++ b/engine/battle/ai/scoring.asm @@ -1550,7 +1550,7 @@ AI_Smart_Spite: dec [hl] ret -Function_0x38d16 +Function_0x38d16: jp AIDiscourageMove AI_Smart_DestinyBond: diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index e51080ae0..534e2c331 100644 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -270,7 +270,7 @@ ReadBTTrainerParty: ; Check the nicknames for illegal characters, and replace bad nicknames ; with their species names. - ld de, wBT_OTTempMon1Name ; $c643 + ld de, wBT_OTTempMon1Name ld c, MON_NAME_LENGTH farcall CheckStringForErrors jr nc, .skip_mon_1 @@ -280,44 +280,44 @@ ReadBTTrainerParty: call GetPokemonName ld l, e ld h, d - ld de, wBT_OTTempMon1Name ; $c643 + ld de, wBT_OTTempMon1Name ld bc, MON_NAME_LENGTH call CopyBytes .skip_mon_1 - ld de, wBT_OTTempMon2Name ; $c67e + ld de, wBT_OTTempMon2Name ld c, MON_NAME_LENGTH farcall CheckStringForErrors jr nc, .skip_mon_2 - ld a, [wBT_OTTempMon2] ; [$c64e] + ld a, [wBT_OTTempMon2] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld l, e ld h, d - ld de, wBT_OTTempMon2Name ; $c67e + ld de, wBT_OTTempMon2Name ld bc, MON_NAME_LENGTH call CopyBytes .skip_mon_2 - ld de, wBT_OTTempMon3Name ; $c686 + 51 = $c6b9 + ld de, wBT_OTTempMon3Name ld c, MON_NAME_LENGTH farcall CheckStringForErrors jr nc, .skip_mon_3 - ld a, [wBT_OTTempMon3] ; [$c689] + ld a, [wBT_OTTempMon3] ld [wNamedObjectIndexBuffer], a call GetPokemonName ld l, e ld h, d - ld de, wBT_OTTempMon3Name ; $c686 + 51 = $c6b9 + ld de, wBT_OTTempMon3Name ld bc, MON_NAME_LENGTH call CopyBytes .skip_mon_3 ; Add the terminator character to each of these names ld a, "@" - ld [wBT_OTTempMon1NameEnd - 1], a ; $c64d - ld [wBT_OTTempMon2NameEnd - 1], a ; $c688 - ld [wBT_OTTempMon3NameEnd - 1], a ; $c68a + 57 = $c6c3 + ld [wBT_OTTempMon1NameEnd - 1], a + ld [wBT_OTTempMon2NameEnd - 1], a + ld [wBT_OTTempMon3NameEnd - 1], a ; Fix errors in the movesets call CheckBTMonMovesForErrors ; Repair the trainer name if needed, then copy it to wOTPlayerName -- cgit v1.2.3 From 1fc7430a2baa2835f4dad4676a3e7ae513275a7d Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 17 Jul 2018 23:08:04 +0200 Subject: Fix misnamed character codes Some character codes were erroneously named after their text command counterparts. This has caused a lot of confusion with naming their functions and with other things. I've also removed the `dict2` macro and expanded the `dict` macro. This really isn't something we should be doing for macros but I can't deny it looks a lot neater than repeated code. --- engine/battle/core.asm | 2 +- engine/menus/options_menu.asm | 28 +++++++++++----------- .../townmap_convertlinebreakcharacters.asm | 8 +++---- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'engine') diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 57c0d7990..d1bd41b84 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -8578,7 +8578,7 @@ ReadAndPrintLinkBattleRecord: db " 0 0 0@" .Format: - db " --- " + db " --- " db " - - -@" .Record: db "'s RECORD@" diff --git a/engine/menus/options_menu.asm b/engine/menus/options_menu.asm index 370eba3f6..4dc6c0fe1 100644 --- a/engine/menus/options_menu.asm +++ b/engine/menus/options_menu.asm @@ -61,20 +61,20 @@ _OptionsMenu: ret StringOptions: - db "TEXT SPEED" - db " :" - db "BATTLE SCENE" - db " :" - db "BATTLE STYLE" - db " :" - db "SOUND" - db " :" - db "PRINT" - db " :" - db "MENU ACCOUNT" - db " :" - db "FRAME" - db " :TYPE" + db "TEXT SPEED" + db " :" + db "BATTLE SCENE" + db " :" + db "BATTLE STYLE" + db " :" + db "SOUND" + db " :" + db "PRINT" + db " :" + db "MENU ACCOUNT" + db " :" + db "FRAME" + db " :TYPE" db "CANCEL@" GetOptionPointer: diff --git a/engine/pokegear/townmap_convertlinebreakcharacters.asm b/engine/pokegear/townmap_convertlinebreakcharacters.asm index e0ed55131..a881b9260 100644 --- a/engine/pokegear/townmap_convertlinebreakcharacters.asm +++ b/engine/pokegear/townmap_convertlinebreakcharacters.asm @@ -5,14 +5,14 @@ TownMap_ConvertLineBreakCharacters: cp "@" jr z, .end cp "%" - jr z, .line_break + jr z, .line_feed cp "¯" - jr z, .line_break + jr z, .line_feed inc hl jr .loop -.line_break - ld [hl], "" +.line_feed + ld [hl], "" .end ld de, wStringBuffer1 -- cgit v1.2.3 From 1cb364cc1825d1b149eb4e0fe09d1cab21006208 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 18 Jul 2018 19:06:56 +0200 Subject: Fix usage of NUM_UNOWN --- engine/pokedex/pokedex.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine') diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 5682dac35..787645823 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -1317,7 +1317,7 @@ Pokedex_DrawUnownModeBG: call Pokedex_PlaceFrontpicAtHL ld de, 0 ld b, 0 - ld c, 26 + ld c, NUM_UNOWN .loop ld hl, wUnownDex add hl, de @@ -2486,11 +2486,11 @@ Pokedex_LoadUnownFont: ld a, BANK(UnownFont) call FarCopyBytes ld hl, sScratch + $188 - ld bc, 27 tiles + ld bc, (NUM_UNOWN + 1) tiles call Pokedex_InvertTiles ld de, sScratch + $188 ld hl, vTiles2 tile $40 - lb bc, BANK(Pokedex_LoadUnownFont), 27 + lb bc, BANK(Pokedex_LoadUnownFont), NUM_UNOWN + 1 call Request2bpp call CloseSRAM ret -- cgit v1.2.3