Wrap asm statements in NONMATCHING

This commit is contained in:
GriffinR
2020-08-18 09:09:25 -04:00
parent 2455913e39
commit d8f858d04e
7 changed files with 61 additions and 17 deletions
+3 -1
View File
@@ -2159,7 +2159,9 @@ static void sub_805EE3C(u8 objectEventId, s16 x, s16 y)
#undef i
objectEvent = &gObjectEvents[objectEventId];
asm("":::"r5");
#ifndef NONMATCHING
asm("":::"r5");
#endif
subspriteTables = NULL;
graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId);
spriteFrameImage.size = graphicsInfo->size;
+10 -2
View File
@@ -136,7 +136,11 @@ bool8 SetUpFieldMove_Cut(void)
else
{
// FIXME: this fakematch
register s32 neg1 asm("r8");
#ifndef NONMATCHING
register s32 neg1 asm("r8");
#else
s32 neg1;
#endif
struct MapPosition *pos;
PlayerGetDestCoords(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y);
@@ -204,7 +208,11 @@ bool8 FldEff_CutGrass(void)
u8 i, j;
s16 x, y;
// FIXME: this fakematch
register s32 neg1 asm("r9");
#ifndef NONMATCHING
register s32 neg1 asm("r9");
#else
s32 neg1;
#endif
struct MapPosition *pos;
i = 0;
+5 -1
View File
@@ -147,7 +147,11 @@ static void sio32intr_clock_slave(void)
{
u32 regSIODATA32;
u32 r0;
register u32 reqLen asm("r2");
#ifndef NONMATCHING
register u32 reqLen asm("r2");
#else
u32 reqLen;
#endif
gSTWIStatus->timerActive = 0;
STWI_set_timer_in_RAM(100);
+3 -1
View File
@@ -903,7 +903,9 @@ void CgbModVol(struct CgbChannel *chan)
// Force chan->rightVolume and chan->leftVolume to be read from memory again,
// even though there is no reason to do so.
// The command line option "-fno-gcse" achieves the same result as this.
asm("" : : : "memory");
#ifndef NONMATCHING
asm("" : : : "memory");
#endif
chan->eg = (u32)(chan->rightVolume + chan->leftVolume) >> 4;
if (chan->eg > 15)
+25 -9
View File
@@ -1221,10 +1221,16 @@ void task00_mystery_gift(u8 taskId)
break;
case 5:
{
register u8 eos asm("r1");
gStringVar1[0] = (eos = EOS);
gStringVar2[0] = eos;
gStringVar3[0] = eos;
#ifndef NONMATCHING
register u8 eos asm("r1");
gStringVar1[0] = (eos = EOS);
gStringVar2[0] = eos;
gStringVar3[0] = eos;
#else
gStringVar1[0] = EOS;
gStringVar2[0] = EOS;
gStringVar3[0] = EOS;
#endif
}
switch (data->IsCardOrNews)
{
@@ -1385,7 +1391,11 @@ void task00_mystery_gift(u8 taskId)
break;
case 15:
{
register bool32 flag asm("r1");
#ifndef NONMATCHING
register bool32 flag asm("r1");
#else
bool32 flag;
#endif
r1 = mevent_message(&sp0, data->IsCardOrNews, data->source, data->prevPromptWindowId);
if (r1 == NULL)
{
@@ -1613,10 +1623,16 @@ void task00_mystery_gift(u8 taskId)
break;
case 31:
{
register u8 eos asm("r1");
gStringVar1[0] = (eos = EOS);
gStringVar2[0] = eos;
gStringVar3[0] = eos;
#ifndef NONMATCHING
register u8 eos asm("r1");
gStringVar1[0] = (eos = EOS);
gStringVar2[0] = eos;
gStringVar3[0] = eos;
#else
gStringVar1[0] = EOS;
gStringVar2[0] = EOS;
gStringVar3[0] = EOS;
#endif
}
if (data->IsCardOrNews == 0)
{
+10 -2
View File
@@ -1040,7 +1040,11 @@ static void InitItemIconSpriteState(struct PokemonSpecialAnimScene * scene, stru
{
u16 species;
u32 personality;
register int x asm("r4"); // FIXME
#ifndef NONMATCHING
register int x asm("r4"); // FIXME
#else
int x;
#endif
u8 y;
if (closeness == 3)
{
@@ -1252,7 +1256,11 @@ static void Task_UseItem_OutwardSpiralDots(u8 taskId)
s16 *data = gTasks[taskId].data;
struct Sprite * sprite;
int x;
register int y asm("r10"); // FIXME
#ifndef NONMATCHING
register int y asm("r10"); // FIXME
#else
int y;
#endif
int x2;
int y2;
int ampl;
+5 -1
View File
@@ -1008,7 +1008,11 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
int minGlyphWidth;
s32 (*func)(u16 glyphId, bool32 isJapanese);
int localLetterSpacing;
register u32 lineWidth asm("r5");
#ifndef NONMATCHING
register u32 lineWidth asm("r5");
#else
u32 lineWidth;
#endif
const u8 *bufferPointer;
int glyphWidth;
u32 width;