summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-03-22 01:52:02 -0400
committerGitHub <noreply@github.com>2017-03-22 01:52:02 -0400
commit515ae5e00f2661559583a4720d9944755e23d141 (patch)
treea8a9c620259d13a47ae8823ed57c52dfc78d8585
parentf34eaec7132c4ebd455c00fd83448f57dd3d064d (diff)
parent4cd4e80ce9583a69af27084bb521c68a913ce692 (diff)
Merge pull request #240 from ProjectRevoTPP/master
fix weird cases of ROM not matching
-rw-r--r--src/mauville_old_man.c3
-rw-r--r--sym_ewram.txt1
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c
index d03042ca5..c01a51091 100644
--- a/src/mauville_old_man.c
+++ b/src/mauville_old_man.c
@@ -288,8 +288,7 @@ void sub_80F7CF4(void)
if(oldMan->oldMan2.mauvilleOldMan_ecArray[oldMan->oldMan2.unk1] != 0xFFFF) // is not the last element of the array?
{
- int random = (u16)Random();
- random &= 7;
+ u16 random = 7 % Random(); // this is a little bit closer, but the compiler prefers an AND instead of division. i assume its because the compiler wants to avoid division by zero, however using an & causes this order to not be close anymore.
sub_80EB3FC(gStringVar4, oldMan->oldMan2.mauvilleOldMan_ecArray[oldMan->oldMan2.unk1]);
stringPtr = StringCopy(gStringVar4, gOtherText_Is);
stringPtr = StringCopy(stringPtr, (u8 *)gUnknown_083E5388[random]);
diff --git a/sym_ewram.txt b/sym_ewram.txt
index 001321ea7..10ebf59c9 100644
--- a/sym_ewram.txt
+++ b/sym_ewram.txt
@@ -486,6 +486,7 @@ gPokemonCryBGMDuckingCounter: @ 202F7A0
.include "src/battle_anim.o"
+ .align 2
gUnknown_0202F7D4: @ 202F7D4
.space 0x10