From c9c558606899f898c7b14ad4a35f19ce2831d66a Mon Sep 17 00:00:00 2001 From: gAlfonso-bit <83477269+gAlfonso-bit@users.noreply.github.com> Date: Thu, 27 May 2021 08:32:09 -0400 Subject: [PATCH] =?UTF-8?q?Fixed=20ChangeBgY=5FScreenOff=E2=80=98s=20signa?= =?UTF-8?q?ture.=20(#1447)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix Functions * Fix ChangeBgY_ScreenOff signature * Remove unneeded changes * Fix argument mismatch Just to get this out of the way * Not needed * Update palette.c --- gflib/bg.c | 10 +++++----- gflib/bg.h | 2 +- src/battle_factory.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gflib/bg.c b/gflib/bg.c index 0c702ae0fb..ec7c2113b1 100644 --- a/gflib/bg.c +++ b/gflib/bg.c @@ -246,17 +246,17 @@ static void SetBgAffineInternal(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispC switch (sGpuBgConfigs.bgVisibilityAndMode & 0x7) { + default: + case 0: + return; case 1: if (bg != 2) return; break; case 2: - if (bg < 2 || bg >= NUM_BACKGROUNDS) + if (bg != 2 && bg != 3) return; break; - case 0: - default: - return; } src.texX = srcCenterX; @@ -689,7 +689,7 @@ s32 ChangeBgY(u8 bg, s32 value, u8 op) return sGpuBgConfigs2[bg].bg_y; } -s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op) +s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op) { u8 mode; u16 temp1; diff --git a/gflib/bg.h b/gflib/bg.h index 3c7eee2927..58fd1282c0 100644 --- a/gflib/bg.h +++ b/gflib/bg.h @@ -59,7 +59,7 @@ u16 GetBgAttribute(u8 bg, u8 attributeId); s32 ChangeBgX(u8 bg, s32 value, u8 op); s32 GetBgX(u8 bg); s32 ChangeBgY(u8 bg, s32 value, u8 op); -s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op); +s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op); s32 GetBgY(u8 bg); void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); diff --git a/src/battle_factory.c b/src/battle_factory.c index 72772929a9..e0bfdfdd0b 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -38,7 +38,7 @@ static void GenerateInitialRentalMons(void); static void GetOpponentMostCommonMonType(void); static void GetOpponentBattleStyle(void); static void RestorePlayerPartyHeldItems(void); -static u16 GetFactoryMonId(u8 lvlMode, u8 challengeNum, bool8 arg2); +static u16 GetFactoryMonId(u8 lvlMode, u8 challengeNum, bool8 useBetterRange); static u8 GetMoveBattleStyle(u16 move); // Number of moves needed on the team to be considered using a certain battle style