From 2988883a12d6016ff43203b7a8426355cb4fc6fa Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 29 Jan 2024 12:52:03 -0300 Subject: [PATCH 01/12] Unused warnings are not treated as errrors by default --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index d899015225..df402f96ad 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ REVISION := 0 MODERN ?= 1 TEST ?= 0 ANALYZE ?= 0 +UNUSED_ERROR?= 0 ifeq (agbcc,$(MAKECMDGOALS)) MODERN := 0 @@ -127,6 +128,9 @@ override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi ifeq ($(ANALYZE),1) override CFLAGS += -fanalyzer endif +ifeq ($(UNUSED_ERROR),0) +override CFLAGS += -Wno-error=unused-variable -Wno-error=unused-variable -Wno-error=unused-const-variable -Wno-error=unused-parameter -Wno-error=unused-function -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=unused-local-typedefs +endif ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" From e8a6c463915fcb4186c8ff2da4faaca61534eaf6 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 29 Jan 2024 13:19:01 -0300 Subject: [PATCH 02/12] Only do unused error under RHH's repo + workflow test --- .github/workflows/build.yml | 1 + Makefile | 3 +++ src/battle_interface.c | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c5bcb7ed8..0322cbe11f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: GAME_LANGUAGE: ENGLISH MODERN: 0 COMPARE: 0 + UNUSED_ERROR: 1 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index df402f96ad..88376cddef 100644 --- a/Makefile +++ b/Makefile @@ -128,9 +128,12 @@ override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi ifeq ($(ANALYZE),1) override CFLAGS += -fanalyzer endif +# Only throw an error for unused elements if its RH-Hideout's repo ifeq ($(UNUSED_ERROR),0) +ifneq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) override CFLAGS += -Wno-error=unused-variable -Wno-error=unused-variable -Wno-error=unused-const-variable -Wno-error=unused-parameter -Wno-error=unused-function -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=unused-local-typedefs endif +endif ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" diff --git a/src/battle_interface.c b/src/battle_interface.c index d3751f702f..b8bde1b25d 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3070,14 +3070,19 @@ static void ClearAbilityName(u8 spriteId1, u8 spriteId2) 7, 9, 1); } -static void PrintBattlerOnAbilityPopUp(u8 battlerId, u8 spriteId1, u8 spriteId2) +static void PrintBattlerOnAbilityPopUp(u8 battlerId, u8 spriteId1, u8 spriteId2, u8 prueba4) { + u8 prueba1; + u8 prueba2 = 2; + const u8 prueba3 = 3; + u8 prueba5; int i; u8 lastChar; u8* textPtr; u8 monName[POKEMON_NAME_LENGTH + 3] = {0}; u8* nick = gBattleMons[battlerId].nickname; // This needs to be updated for Illusion support + prueba5 = 5; for (i = 0; i < POKEMON_NAME_LENGTH; ++i) { monName[i] = nick[i]; @@ -3309,7 +3314,7 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) StartSpriteAnim(&gSprites[spriteId1], 0); StartSpriteAnim(&gSprites[spriteId2], 0); - PrintBattlerOnAbilityPopUp(battlerId, spriteId1, spriteId2); + PrintBattlerOnAbilityPopUp(battlerId, spriteId1, spriteId2, 0); PrintAbilityOnAbilityPopUp(ability, spriteId1, spriteId2); RestoreOverwrittenPixels((void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32)); } From a0bcdbff42c3597ae3b9901852015195bc6d1a50 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 29 Jan 2024 13:31:42 -0300 Subject: [PATCH 03/12] Workflow test worked, undoing changes --- src/battle_interface.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index b8bde1b25d..d3751f702f 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3070,19 +3070,14 @@ static void ClearAbilityName(u8 spriteId1, u8 spriteId2) 7, 9, 1); } -static void PrintBattlerOnAbilityPopUp(u8 battlerId, u8 spriteId1, u8 spriteId2, u8 prueba4) +static void PrintBattlerOnAbilityPopUp(u8 battlerId, u8 spriteId1, u8 spriteId2) { - u8 prueba1; - u8 prueba2 = 2; - const u8 prueba3 = 3; - u8 prueba5; int i; u8 lastChar; u8* textPtr; u8 monName[POKEMON_NAME_LENGTH + 3] = {0}; u8* nick = gBattleMons[battlerId].nickname; // This needs to be updated for Illusion support - prueba5 = 5; for (i = 0; i < POKEMON_NAME_LENGTH; ++i) { monName[i] = nick[i]; @@ -3314,7 +3309,7 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) StartSpriteAnim(&gSprites[spriteId1], 0); StartSpriteAnim(&gSprites[spriteId2], 0); - PrintBattlerOnAbilityPopUp(battlerId, spriteId1, spriteId2, 0); + PrintBattlerOnAbilityPopUp(battlerId, spriteId1, spriteId2); PrintAbilityOnAbilityPopUp(ability, spriteId1, spriteId2); RestoreOverwrittenPixels((void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32)); } From f7e5709745d6dc313b131330d1131eef7169e3f9 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 31 Jan 2024 08:18:43 -0300 Subject: [PATCH 04/12] Review changes --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 88376cddef..5632b3570e 100644 --- a/Makefile +++ b/Makefile @@ -36,14 +36,14 @@ else EXE := endif -TITLE := POKEMON EMER -GAME_CODE := BPEE -MAKER_CODE := 01 -REVISION := 0 -MODERN ?= 1 -TEST ?= 0 -ANALYZE ?= 0 -UNUSED_ERROR?= 0 +TITLE := POKEMON EMER +GAME_CODE := BPEE +MAKER_CODE := 01 +REVISION := 0 +MODERN ?= 1 +TEST ?= 0 +ANALYZE ?= 0 +UNUSED_ERROR ?= 0 ifeq (agbcc,$(MAKECMDGOALS)) MODERN := 0 @@ -130,8 +130,8 @@ override CFLAGS += -fanalyzer endif # Only throw an error for unused elements if its RH-Hideout's repo ifeq ($(UNUSED_ERROR),0) -ifneq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) -override CFLAGS += -Wno-error=unused-variable -Wno-error=unused-variable -Wno-error=unused-const-variable -Wno-error=unused-parameter -Wno-error=unused-function -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=unused-local-typedefs +ifneq ($(GITHUB_REPOSITORY_OWNER),rh-hideout) +override CFLAGS += -Wno-error=unused-variable -Wno-error=unused-const-variable -Wno-error=unused-parameter -Wno-error=unused-function -Wno-error=unused-but-set-parameter -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=unused-local-typedefs endif endif ROM := $(MODERN_ROM_NAME) From 2d24f964206cd9670d8d0e4fa22c03126ad3541c Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 1 Feb 2024 20:55:53 -0300 Subject: [PATCH 05/12] Version 1.7.3 (#4106) * Version 1.7.3 * Latest changelog --- .../ISSUE_TEMPLATE/01_battle_engine_bugs.yaml | 3 +- .github/ISSUE_TEMPLATE/04_other_errors.yaml | 3 +- CHANGELOG.md | 13 ++-- README.md | 4 +- docs/changelogs/1.7.2.md | 2 +- docs/changelogs/1.7.3.md | 77 +++++++++++++++++++ docs/changelogs/template.md | 6 +- include/constants/expansion.h | 4 +- 8 files changed, 96 insertions(+), 16 deletions(-) create mode 100644 docs/changelogs/1.7.3.md diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index 44cc8c2891..6493f4c11b 100644 --- a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.2 (Latest release) + - 1.7.3 (Latest release) - master (default when pulling, unreleased bugfixes) - upcoming (Edge) + - 1.7.2 - 1.7.1 - 1.7.0 - 1.6.2 diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml index 41d5c30eff..e39eac4f56 100644 --- a/.github/ISSUE_TEMPLATE/04_other_errors.yaml +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -23,9 +23,10 @@ body: label: Version description: What version of pokeemerald-expansion are you using as a base? options: - - 1.7.2 (Latest release) + - 1.7.3 (Latest release) - master (default when pulling, unreleased bugfixes) - upcoming (Edge) + - 1.7.2 - 1.7.1 - 1.7.0 - 1.6.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fba967c8a..d4805a5d40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Pokeemerald-Expansion Changelogs -## [Version 1.7.2](docs/changelogs/1.7.2.md) - Bugfix Release +## Version 1.7.x +### [Version 1.7.3](docs/changelogs/1.7.3.md) - Bugfix Release +### [Version 1.7.2](docs/changelogs/1.7.2.md) - Bugfix Release +### [Version 1.7.1](docs/changelogs/1.7.1.md) - Bugfix Release +### [Version 1.7.0](docs/changelogs/1.7.0.md) - Feature Release -## [Version 1.7.1](docs/changelogs/1.7.1.md) - Bugfix Release - -## [Version 1.7.0](docs/changelogs/1.7.0.md) - Feature Release - -## [Version 1.6.2](docs/changelogs/1.6.2.md) - Bugfix Release +## Version 1.6.x +### [Version 1.6.2](docs/changelogs/1.6.2.md) - Bugfix Release diff --git a/README.md b/README.md index 53dc2ab6ed..9f2e022dd6 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ pokeemerald-expansion is a decomp hack base project based off pret's [pokeemeral If you use pokeemerald-expansion in your hack, please add RHH (Rom Hacking Hideout) to your credits list. Optionally, you can list the version used, so it can help players know what features to expect. You can phrase it as the following: ``` -Based off RHH's pokeemerald-expansion v1.7.2 https://github.com/rh-hideout/pokeemerald-expansion/ +Based off RHH's pokeemerald-expansion v1.7.3 https://github.com/rh-hideout/pokeemerald-expansion/ ``` ## What features are included? @@ -166,7 +166,7 @@ With this, you'll get the latest version of pokeemerald-expansion, plus a couple ## **How do I update my version of pokeemerald-expansion?** - If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. -- Once you have your remote set up, run the command `git pull RHH expansion/1.7.2`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.7.3`. ### Please consider crediting the entire [list of contributors](https://github.com/rh-hideout/pokeemerald-expansion/wiki/Credits) in your project, as they have all worked hard to develop this project :) diff --git a/docs/changelogs/1.7.2.md b/docs/changelogs/1.7.2.md index 8fc0d60565..1c94bbda3d 100644 --- a/docs/changelogs/1.7.2.md +++ b/docs/changelogs/1.7.2.md @@ -1,4 +1,4 @@ -# Template +# Version 1.7.2 ```md ## How to update diff --git a/docs/changelogs/1.7.3.md b/docs/changelogs/1.7.3.md new file mode 100644 index 0000000000..4727e195bc --- /dev/null +++ b/docs/changelogs/1.7.3.md @@ -0,0 +1,77 @@ +# Version 1.7.3 + +```md +## How to update +- If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.7.3`. +``` + +## 🌋 *IMPORTANT CHANGES* 🌋 +* Unused warnings are no longer treated as errrors by default by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4092 +* [Critical fix] Backported gHeap alignment fix from upstream pret by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4089 + * Fixes issue that causes graphics to bug when leaving Littleroot for Birch's cutscene. + +## 🧬 General 🧬 +* Fixed HGSS Dex's dark mode search palette by @ravepossum in https://github.com/rh-hideout/pokeemerald-expansion/pull/4095 + +## 🐉 Pokémon 🐉 +### Changed +* Condensed Oinkologne teachable learnsets (they previously had different tables despite having the same learnsets) by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4026 +* Removed illegal teachable learnset moves that didn't match Gen 7 or 9 by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4039 and https://github.com/rh-hideout/pokeemerald-expansion/pull/4042 +### Fixed +* Fixed incorrect family toggle preproc blocks by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4024 + * Cosplay and Cap Pikachu animations were still being included even if disabled. + * Fixed compile errors when: + * Feebas' family was disabled but not Castform. + * Chatot was disabled but not Spiritomb. + * Virizion was disabled but not Tornadus or Thundurus. + * Zekrom was disabled but not Landorus. + * Kyurem was disabled but not Keldeo or Meloetta. + * Wishiwashi was disabled but not Rockruff. +* Fixed compile error when disabling Gen 4 cross-evolutions while having Kingdra enabled by @Skyeward and @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4044 and https://github.com/rh-hideout/pokeemerald-expansion/pull/4046 + +## ⚔️ Battle General ⚔️ ## +### Fixed +* Fixed Steven double battle palette error by @johannakullmann in https://github.com/rh-hideout/pokeemerald-expansion/pull/4078 + +## 🤹 Moves 🤹 +### Changed +* Renamed `EFFECT_STEEL_BEAM` to `EFFECT_MAX_HP_50_RECOIL` by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4043 +### Fixed +* Fixed Pursuit's effect not working by @ZnogyroP @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4086 + +## 🎭 Abilities 🎭 +### Fixed +* Fixed Emergency Exit issues: + * Fixed rounding error that caused it to not switch out when odd-numbered HP was off by 1 by @SBird1337 in https://github.com/rh-hideout/pokeemerald-expansion/pull/4040 + * Eg: going from 101 Max HP to 50 HP would've *not* cause it to switch out. + * Fixes Emergency Exit switching out even if the Pokémon was healed above the threshold before it would've triggered by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4041 + * Eg: going from 100 Max HP to 45 HP and eating a Sitrus Berry back to 55 HP would've cause it to switch out. + * Cleanup by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4100 +* Fixed Corrosion only working for status moves by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4037 +* Fixed Magic Guard not preventing Mind Blown recoil damage by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4043 + +## 🧶 Items 🧶 +### Fixed +* Fixed oversight causing chosen fossil to be lost if bag is full by @fakuzatsu in https://github.com/rh-hideout/pokeemerald-expansion/pull/3978 + * Fixed other Key Item script oversights by @Bassoonian in https://github.com/rh-hideout/pokeemerald-expansion/pull/4066 +* Fixed Life Orb causing damage on switch-in from Eject Pack and Red Card by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4038 +* Fixed Glimmering Charm sprite by @SonikkuA-DatH and @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4047 + +## 🤖 Battle AI 🤖 +### Fixed +* Fixed AI trying to switch into the same mon twice in the same turn by @DizzyEggg in https://github.com/rh-hideout/pokeemerald-expansion/pull/4098 + +## 🧪 Test Runner 🧪 +### Added +* Corrosion tests by @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4037 +* Pursuit/Tangling Hair interaction by @ZnogyroP @AlexOn1ine in https://github.com/rh-hideout/pokeemerald-expansion/pull/4086 +### Changed +* Passing `KNOWN_FAILING` tests are now listed separately from `PASSED` tests by @AsparagusEduardo in https://github.com/rh-hideout/pokeemerald-expansion/pull/4063 + +## New Contributors +* @Skyeward made their first contribution in https://github.com/rh-hideout/pokeemerald-expansion/pull/4044 + +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.7.2...expansion/1.7.3 + + diff --git a/docs/changelogs/template.md b/docs/changelogs/template.md index 607d69592a..f67520c388 100644 --- a/docs/changelogs/template.md +++ b/docs/changelogs/template.md @@ -3,7 +3,7 @@ ```md ## How to update - If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`. -- Once you have your remote set up, run the command `git pull RHH expansion/1.7.2`. +- Once you have your remote set up, run the command `git pull RHH expansion/1.Y.Z`. ``` ## 🌋 *IMPORTANT CHANGES* 🌋 @@ -88,6 +88,6 @@ ## New Contributors * Tony -**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.7.1...expansion/1.7.2 +**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.Y.Z...expansion/1.Y.Z - + diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 84a14db36b..42af988a19 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -3,10 +3,10 @@ #define EXPANSION_VERSION_MAJOR 1 #define EXPANSION_VERSION_MINOR 7 -#define EXPANSION_VERSION_PATCH 2 +#define EXPANSION_VERSION_PATCH 3 // FALSE if this this version of Expansion is not a tagged commit, i.e. // it contains unreleased changes. -#define EXPANSION_TAGGED_RELEASE FALSE +#define EXPANSION_TAGGED_RELEASE TRUE #endif From e828ae58a1f6790f275adec73a3b3ff6f688fc2f Mon Sep 17 00:00:00 2001 From: kaicardenas2 <150625530+kaicardenas2@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:20:10 -0500 Subject: [PATCH 06/12] Non-Tagged Release (#4109) --- include/constants/expansion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 42af988a19..7e6cf52b26 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -7,6 +7,6 @@ // FALSE if this this version of Expansion is not a tagged commit, i.e. // it contains unreleased changes. -#define EXPANSION_TAGGED_RELEASE TRUE +#define EXPANSION_TAGGED_RELEASE FALSE #endif From 85eea4869debe7dcd7e707a89ed6251a3d412651 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 3 Feb 2024 16:56:50 +0100 Subject: [PATCH 07/12] Fix move animation crashing on some emulators because of division by zero (#4121) * fix flip turn div by zero * fix incinerate move anim div by zero --- include/global.h | 2 +- src/battle_anim_ghost.c | 4 ++-- src/battle_anim_mons.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/global.h b/include/global.h index 60abf094af..5cd5c68995 100644 --- a/include/global.h +++ b/include/global.h @@ -61,7 +61,7 @@ // Used in cases where division by 0 can occur in the retail version. // Avoids invalid opcodes on some emulators, and the otherwise UB. #ifdef UBFIX -#define SAFE_DIV(a, b) ((b) ? (a) / (b) : 0) +#define SAFE_DIV(a, b) (((b) != 0) ? (a) / (b) : 0) #else #define SAFE_DIV(a, b) ((a) / (b)) #endif diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 7bd6a0268e..6a12481531 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -474,8 +474,8 @@ void AnimShadowBall(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[2]; sprite->data[4] = sprite->x << 4; sprite->data[5] = sprite->y << 4; - sprite->data[6] = ((oldPosX - sprite->x) << 4) / (gBattleAnimArgs[0] << 1); - sprite->data[7] = ((oldPosY - sprite->y) << 4) / (gBattleAnimArgs[0] << 1); + sprite->data[6] = SAFE_DIV(((oldPosX - sprite->x) << 4), (gBattleAnimArgs[0] << 1)); + sprite->data[7] = SAFE_DIV(((oldPosY - sprite->y) << 4), (gBattleAnimArgs[0] << 1)); sprite->callback = AnimShadowBall_Step; } diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 78e1a0a445..83d91c1ca4 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -1025,8 +1025,8 @@ void InitSpriteDataForLinearTranslation(struct Sprite *sprite) { s16 x = (sprite->data[2] - sprite->data[1]) << 8; s16 y = (sprite->data[4] - sprite->data[3]) << 8; - sprite->data[1] = x / sprite->data[0]; - sprite->data[2] = y / sprite->data[0]; + sprite->data[1] = SAFE_DIV(x, sprite->data[0]); + sprite->data[2] = SAFE_DIV(y, sprite->data[0]); sprite->data[4] = 0; sprite->data[3] = 0; } From 46d9adb32698dbd66d113b04905095dabc2101ad Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sat, 3 Feb 2024 19:34:52 +0100 Subject: [PATCH 08/12] Fixes Eerie Spell double pp and message drop (#4127) Co-authored-by: Bassoonian --- data/battle_scripts_1.s | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9a26c78dc2..c817ffc4bb 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4755,26 +4755,7 @@ BattleScript_EffectDestinyBond:: goto BattleScript_MoveEnd BattleScript_EffectEerieSpell:: - attackcanceler - attackstring - ppreduce - accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET eeriespellppreduce BattleScript_MoveEnd printstring STRINGID_PKMNREDUCEDPP From e75169fb8761c24ca890509428563bb6769b5b07 Mon Sep 17 00:00:00 2001 From: ravepossum <145081120+ravepossum@users.noreply.github.com> Date: Sat, 3 Feb 2024 14:07:47 -0500 Subject: [PATCH 09/12] Fix HGSS Dex List Decapped Tileset (#4126) * fix decap HGSS dex tileset scroll bar * more tileset fixes --------- Co-authored-by: ravepossum Co-authored-by: Bassoonian --- .../pokedex/hgss/tileset_menu_list_DECA.png | Bin 1542 -> 1552 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/pokedex/hgss/tileset_menu_list_DECA.png b/graphics/pokedex/hgss/tileset_menu_list_DECA.png index dc84b9ea38c68347040e85a4002a4856cf0cbcf8..f7f28de03979cc0cef50747d376373e9dd06be61 100644 GIT binary patch delta 1441 zcmV;S1z!4w43G?vZ~=>vaTR~t2!fy(O*ZM7&Xlt!8!v%R6m;WU5w9hBTbAqNilooS zy#+97$MQb_u%}zHKLxNKJ?=I0HmjSk@bH9VBc*3xr!_o z3$!xFZvl)JnQs>3lK{8mD}dldo^kEK2eJ0#6y#?)(+Yt4t&AB}0^l@P?<0Uv0UH1# z{ywVE0OVZ#Yv6>#;(i8z>_Y(UftG*(a;6dh$NCZ(2Mtj=0-A)HFpVJ4YzoSKLvR6r z(_vBo?2*YL)DtlU2zP%0uF4P~oB)L90MdR7AXotRPCVf`fS_d$wsiIWM?Jt<<^g~l zp!<$dNddb@>UboOMgg|Z5)h@_Jz@FCy`BD&h^C}HK*m2$!6AD>>ha#x5B=@|M0ol{ zRsi-dJP`dkfp7Gf0O>azN^b*LQg^wDo&w#KOaKOBV;T4w`jqX}{t3qRcM0G-fPSz2t$x~O>T#c%P)?^xc%T&r zhaUCc0YE+A;*IE&==8)6YbL3b5x@e?9#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VqvB}?*MFx*>tCC0a#em{87yX8q=Jd)D5QVa+Vd`E1K7I0dcPJ|27sY= zfYH*0o^$<|0JL1{l>y}HXz)1bIX>m*^l;n+a3!0ST@TL$D)ni(nsAslo(O_*Dl&f^ zoma@v^8mt}VFAl_@2Yzgqu&5jy%E3#7OHix7UyZ#IgC_*i-|%e0%t7k&!eM1QnaU` zyr17m6t?Je?txVNU81-EFxu_EOBDM6O@fdBcN2wiJBi>$F=3Sm-UgtpaF__*2C%C{ l@H)UM5xfuZv+^I{5A?RX#aAHMga8Ww002ovPDHLkV1i{yoqYfR From 512ab98bfe27da2d7f3f4487c978f096f69f031b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 4 Feb 2024 16:13:27 +0100 Subject: [PATCH 10/12] Fix disobedience not resetting multihit moves (#4133) --- src/battle_util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index 167d5bf599..856289d1f1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3842,6 +3842,10 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) gBattleStruct->beatUpSlot = 0; PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } + else + { + gMultiHitCounter = 0; + } gBattleStruct->atkCancellerTracker++; break; case CANCELLER_END: @@ -8222,6 +8226,7 @@ u8 IsMonDisobedient(void) } while (gBitTable[gCurrMovePos] & calc); gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; + SetAtkCancellerForCalledMove(); gBattlescriptCurrInstr = BattleScript_IgnoresAndUsesRandomMove; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gHitMarker |= HITMARKER_DISOBEDIENT_MOVE; From 065c0ec5887baba3fc374deaf63ef0a599dc6b7a Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 4 Feb 2024 23:23:03 +0100 Subject: [PATCH 11/12] Fairy Lock animation fix (#4111) * Fairy Lock animation fix * remove comment * fairy lock anim hopefully works --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- data/battle_anim_scripts.s | 5 ++--- include/battle_anim.h | 1 + src/battle_anim_electric.c | 27 ++++++++++++++++++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 4145679f34..4cf2bfdc13 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -9210,13 +9210,12 @@ Boomburst_Doubles: goto Boomburst_Last Move_FAIRY_LOCK:: - loadspritegfx ANIM_TAG_CHAIN_LINK @Chain Colour - loadspritegfx ANIM_TAG_FAIRY_LOCK_CHAINS @AnimTask is missing for Fairy Lock Chain + loadspritegfx ANIM_TAG_FAIRY_LOCK_CHAINS setalpha 8, 8 monbg ANIM_ATK_PARTNER createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x8, 0x6B1F waitforvisualfinish - loopsewithpan SE_M_SCRATCH, SOUND_PAN_TARGET, 0x6, 0x4 + loopsewithpan SE_M_SCRATCH, SOUND_PAN_TARGET, 0x6, 0x9 createvisualtask AnimTask_VoltTackleBolt, 0x5, 0x7 createvisualtask AnimTask_VoltTackleBolt, 0x5, 0x33 createvisualtask AnimTask_VoltTackleBolt, 0x5, 0x2 diff --git a/include/battle_anim.h b/include/battle_anim.h index f8f0dff969..250a3ac447 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -415,6 +415,7 @@ extern const struct OamData gOamData_AffineDouble_ObjNormal_64x64; extern const struct OamData gOamData_AffineDouble_ObjBlend_64x64; extern const struct OamData gOamData_AffineDouble_ObjBlend_64x32; extern const struct OamData gOamData_AffineDouble_ObjNormal_8x16; +extern const struct OamData gOamData_AffineDouble_ObjNormal_64x32; extern const struct OamData gOamData_AffineOff_ObjBlend_16x16; extern const struct OamData gOamData_AffineDouble_ObjBlend_16x16; extern const struct OamData gOamData_AffineNormal_ObjNormal_8x8; diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index 415f112d30..38ca948749 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -479,6 +479,17 @@ const struct SpriteTemplate gVoltTackleBoltSpriteTemplate = .callback = AnimVoltTackleBolt, }; +const struct SpriteTemplate gFairyLockChainsSpriteTemplate = +{ + .tileTag = ANIM_TAG_FAIRY_LOCK_CHAINS, + .paletteTag = ANIM_TAG_FAIRY_LOCK_CHAINS, + .oam = &gOamData_AffineOff_ObjNormal_64x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimVoltTackleBolt, +}; + const struct SpriteTemplate gGrowingShockWaveOrbSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -1190,11 +1201,20 @@ void AnimTask_VoltTackleBolt(u8 taskId) static bool8 CreateVoltTackleBolt(struct Task *task, u8 taskId) { - u8 spriteId = CreateSprite(&gVoltTackleBoltSpriteTemplate, task->data[3], task->data[5], 35); + u32 spriteId; + bool32 isFairyLock = (gAnimMoveIndex == MOVE_FAIRY_LOCK); + + if (isFairyLock) + spriteId = CreateSprite(&gFairyLockChainsSpriteTemplate, task->data[3], task->data[5] + 10, 35); + else + spriteId = CreateSprite(&gVoltTackleBoltSpriteTemplate, task->data[3], task->data[5], 35); + if (spriteId != MAX_SPRITES) { gSprites[spriteId].data[6] = taskId; gSprites[spriteId].data[7] = 7; + gSprites[spriteId].data[1] = isFairyLock ? 25 : 12; // How long the chains / bolts stay on screen. + gSprites[spriteId].data[2] = isFairyLock; // Whether to destroy the Oam Matrix. task->data[7]++; } @@ -1220,10 +1240,11 @@ static bool8 CreateVoltTackleBolt(struct Task *task, u8 taskId) static void AnimVoltTackleBolt(struct Sprite *sprite) { - if (++sprite->data[0] > 12) + if (++sprite->data[0] > sprite->data[1]) { gTasks[sprite->data[6]].data[sprite->data[7]]--; - FreeOamMatrix(sprite->oam.matrixNum); + if (!sprite->data[2]) + FreeOamMatrix(sprite->oam.matrixNum); DestroySprite(sprite); } } From 8b70cea7254ccaf789da8e3363bb1177ada2a0a2 Mon Sep 17 00:00:00 2001 From: ravepossum <145081120+ravepossum@users.noreply.github.com> Date: Mon, 5 Feb 2024 09:40:25 -0500 Subject: [PATCH 12/12] Fix screen select bar popping in too early for area screen in HGSS dex (#4094) * fixing screen select bar popping in too early for area screen in HGSS pokedex * exit early from select bar load function if dex is disabled * remove unnecessary early exit --------- Co-authored-by: ravepossum Co-authored-by: Bassoonian Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --- src/pokedex_area_screen.c | 11 +++++++++++ src/pokedex_plus_hgss.c | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index d5aa3f96c9..1c155bf5ec 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -107,9 +107,11 @@ static void CreateAreaUnknownSprites(void); static void Task_HandlePokedexAreaScreenInput(u8); static void ResetPokedexAreaMapBg(void); static void DestroyAreaScreenSprites(void); +static void LoadHGSSScreenSelectBarSubmenu(void); static const u32 sAreaGlow_Pal[] = INCBIN_U32("graphics/pokedex/area_glow.gbapal"); static const u32 sAreaGlow_Gfx[] = INCBIN_U32("graphics/pokedex/area_glow.4bpp.lz"); +static const u32 sPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap[] = INCBIN_U32("graphics/pokedex/hgss/SelectBar.bin.lz"); static const u16 sSpeciesHiddenFromAreaScreen[] = { SPECIES_WYNAUT }; @@ -639,6 +641,9 @@ static void Task_ShowPokedexAreaScreen(u8 taskId) BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 16, 0, RGB_BLACK); break; case 10: + if (POKEDEX_PLUS_HGSS) + LoadHGSSScreenSelectBarSubmenu(); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_ALL); StartAreaGlow(); ShowBg(2); @@ -806,3 +811,9 @@ static void CreateAreaUnknownSprites(void) } } } + +static void LoadHGSSScreenSelectBarSubmenu(void) +{ + CopyToBgTilemapBuffer(1, sPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap, 0, 0); + CopyBgTilemapBufferToVram(1); +} diff --git a/src/pokedex_plus_hgss.c b/src/pokedex_plus_hgss.c index 905fdae97e..a1c8b795f5 100644 --- a/src/pokedex_plus_hgss.c +++ b/src/pokedex_plus_hgss.c @@ -528,7 +528,6 @@ static void Task_LoadSizeScreen(u8); static void Task_HandleSizeScreenInput(u8); static void Task_SwitchScreensFromSizeScreen(u8); static void LoadScreenSelectBarMain(u16); -static void LoadScreenSelectBarSubmenu(u16); static void HighlightScreenSelectBarItem(u8, u16); static void Task_HandleCaughtMonPageInput(u8); static void Task_ExitCaughtMonPage(u8); @@ -4031,7 +4030,6 @@ static void Task_LoadAreaScreen(u8 taskId) } break; case 1: - LoadScreenSelectBarSubmenu(0xD); LoadPokedexBgPalette(sPokedexView->isSearchResults); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(13) | BGCNT_16COLOR | BGCNT_TXT256x256); gMain.state++; @@ -4086,12 +4084,6 @@ static void LoadScreenSelectBarMain(u16 unused) CopyBgTilemapBufferToVram(1); } -static void LoadScreenSelectBarSubmenu(u16 unused) -{ - CopyToBgTilemapBuffer(1, sPokedexPlusHGSS_ScreenSelectBarSubmenu_Tilemap, 0, 0); - CopyBgTilemapBufferToVram(1); -} - static void UNUSED HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused) { u8 i;