Merge pull request #1181 from PokeCodec/trainer-hill

Remove fakematch in trainer_hill.c
This commit is contained in:
PikalaxALT 2020-09-08 21:55:29 -04:00 committed by GitHub
commit 8f6d6b933e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 25 deletions

View file

@ -3973,11 +3973,8 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task)
for (i = 0; i < 160; i++, var6 += var8)
{
s16 index = var6 / 256;
#ifndef NONMATCHING
asm("");
#endif
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(index, amplitude);
const u16 index = var6 >> 8;
gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(index & 0xff, amplitude);
}
if (++task->tData3 == 101)

View file

@ -2241,16 +2241,8 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
}
else
{
// FIXME: Compiler insists on moving r4 into r1 before doing the eor.
#ifndef NONMATCHING
register u32 var asm("r1");
#else
u32 var;
#endif // NONMATCHING
party = gEnemyParty;
var = battler ^ BIT_SIDE;
if (var == 0)
if (battler == 1)
id1 = 0;
else
id1 = 1;

View file

@ -672,22 +672,17 @@ bool32 LoadTrainerHillFloorObjectEventScripts(void)
return TRUE;
}
static u32 sub_81D5F58(u8 floorId, u32 bit, u32 arg2, u32 arg3)
static u16 sub_81D5F58(u8 floorId, u32 bit, u32 arg2, u32 arg3)
{
u16 var0, var1;
#ifndef NONMATCHING
register u16 var2 asm("r3"); //compiler keeps wanting to "mov r3, 0x80" instead of "mov r2 0x80" and then later "add r3, r2, 0"
#else
u8 var0;
u16 var1;
u16 var2;
#endif
u16 var3;
var0 = (sHillData->floors[floorId].display.unk3A0[arg2] >> (15 - bit) & 1);
var1 = sHillData->floors[floorId].display.data[arg3 * arg2 + bit];
var2 = 0x200;
var3 = 0x3000;
var1 = sHillData->floors[floorId].display.data[arg3 * arg2 + bit] + 0x200;
var2 = 0x3000;
return ((var0 << 10) | var3) | (var1 | var2);
return (((var0 << 10) & 0xc00) | var2) | (var1 & 0x3ff);
}
void GenerateTrainerHillFloorLayout(u16 *mapArg)