diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_tent.c | 6 | ||||
-rw-r--r-- | src/battle_tower.c | 8 | ||||
-rw-r--r-- | src/battle_transition.c | 4 | ||||
-rw-r--r-- | src/data/graphics/pokemon.h | 3 | ||||
-rw-r--r-- | src/dewford_trend.c | 4 | ||||
-rw-r--r-- | src/frontier_pass.c | 4 | ||||
-rw-r--r-- | src/graphics.c | 26 | ||||
-rw-r--r-- | src/librfu_intr.c | 6 | ||||
-rw-r--r-- | src/m4a.c | 4 | ||||
-rw-r--r-- | src/pokemon.c | 4 | ||||
-rw-r--r-- | src/pokemon_animation.c | 6 | ||||
-rw-r--r-- | src/record_mixing.c | 8 |
12 files changed, 56 insertions, 27 deletions
diff --git a/src/battle_tent.c b/src/battle_tent.c index b2db0e39c..0a03fc167 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -355,7 +355,11 @@ static void GenerateOpponentMons(void) { u16 trainerId; s32 i, j, k; - register const u16 *monSet asm("r9"); // Fix me. Compiler insists on moving that variable into stack. + #ifndef NONMATCHING + register const u16 *monSet asm("r9"); // Fix me. Compiler insists on moving that variable into stack. + #else + const u16 *monSet; + #endif u16 species[FRONTIER_PARTY_SIZE]; u16 heldItems[FRONTIER_PARTY_SIZE]; s32 monId = 0; diff --git a/src/battle_tower.c b/src/battle_tower.c index 8fcea1123..81c542d1c 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -1466,7 +1466,9 @@ u8 GetFrontierOpponentClass(u16 trainerId) else { trainerClass = gFacilityClassToTrainerClass[gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].facilityClass]; - asm(""); + #ifndef NONMATCHING + asm(""); + #endif } } else @@ -1478,7 +1480,9 @@ u8 GetFrontierOpponentClass(u16 trainerId) else { trainerClass = gFacilityClassToTrainerClass[gApprentices[gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].id].facilityClass]; - asm(""); + #ifndef NONMATCHING + asm(""); + #endif } } diff --git a/src/battle_transition.c b/src/battle_transition.c index 2ffa28645..b0cdbd93a 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -3974,7 +3974,9 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task) for (i = 0; i < 160; i++, var6 += var8) { s16 index = var6 / 256; - asm(""); + #ifndef NONMATCHING + asm(""); + #endif gScanlineEffectRegBuffers[0][i] = sTransitionStructPtr->field_16 + Sin(index, amplitude); } diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index fd4d8b95d..bce0b7a21 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -2698,7 +2698,8 @@ const u8 gMonIcon_Deoxys[] = INCBIN_U8("graphics/pokemon/deoxys/icon.4bpp"); const u8 gMonIcon_DeoxysSpeed[] = INCBIN_U8("graphics/pokemon/deoxys/icon_speed.4bpp"); const u8 gMonIcon_DeoxysSpeedWide[] = INCBIN_U8("graphics/unused/deoxys_speed_icon_wide.4bpp"); -asm(".space 0x6800"); +// Probably the leftover space from the other Deoxys forms +static const u8 sEmpty[0x6800] = {0}; const u16 gUnknown_D437F8[] = INCBIN_U16("graphics/unknown/unknown_D437F8.bin"); diff --git a/src/dewford_trend.c b/src/dewford_trend.c index 9c5e69d99..e3b98859c 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -225,7 +225,9 @@ void TrendyPhraseIsOld(void) if (gSaveBlock1Ptr->easyChatPairs[0].unk0_0 - gSaveBlock1Ptr->easyChatPairs[1].unk0_0 < 2) { - asm("":::"r2"); //Force the compiler to store address of gSaveBlock1 in r3 instead of r2 + #ifndef NONMATCHING + asm("":::"r2"); //Force the compiler to store address of gSaveBlock1 in r3 instead of r2 + #endif if (!gSaveBlock1Ptr->easyChatPairs[0].unk1_6 && gSaveBlock1Ptr->easyChatPairs[1].unk1_6) result = 1; } diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 024a954d1..adc02f90b 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1239,7 +1239,9 @@ static void sub_80C6104(u8 cursorArea, u8 previousCursorArea) if (!var) { - asm("":::"r4"); + #ifndef NONMATCHING + asm("":::"r4"); + #endif if (previousCursorArea == CURSOR_AREA_NOTHING || previousCursorArea > CURSOR_AREA_CANCEL) return; } diff --git a/src/graphics.c b/src/graphics.c index e0b2774d6..83b1b55d9 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -987,8 +987,7 @@ const u16 gTilesetAnims_BattleDomePals0_1[] = INCBIN_U16("graphics/battle_fronti const u16 gTilesetAnims_BattleDomePals0_2[] = INCBIN_U16("graphics/battle_frontier/dome_anim3.gbapal"); const u16 gTilesetAnims_BattleDomePals0_3[] = INCBIN_U16("graphics/battle_frontier/dome_anim4.gbapal"); -// 8D856C0 -asm(".2byte 0x013F, 0x0119, 0x0113, 0x010E"); // unused? +static const u16 sUnused0[] = {0x13F, 0x119, 0x113, 0x10E}; const u16 gUnknown_08D856C8[] = INCBIN_U16("graphics/battle_frontier/pyramid_light.gbapal"); // unfaded pal for the player light in battle pyramid @@ -1362,17 +1361,17 @@ const u8 gBerryBlenderMarubatsuTiles[] = INCBIN_U8("graphics/berry_blender/marub const u8 gBerryBlenderParticlesTiles[] = INCBIN_U8("graphics/berry_blender/particles.4bpp"); -asm(".space 0x120"); +static const u8 sEmpty0[0x120] = {0}; const u8 gBerryBlenderCountdownNumbersTiles[] = INCBIN_U8("graphics/berry_blender/countdown_numbers.4bpp"); const u8 gBerryBlenderStartTiles[] = INCBIN_U8("graphics/berry_blender/start.4bpp"); -asm(".space 0x200"); +static const u8 sEmpty1[0x200] = {0}; const u8 gBerryBlenderArrowTiles[] = INCBIN_U8("graphics/berry_blender/arrow.4bpp"); -asm(".space 0x2C0"); +static const u8 sEmpty2[0x2C0] = {0}; const u16 gEasyChatCursor_Pal[] = INCBIN_U16("graphics/easy_chat/cursor.gbapal"); const u32 gEasyChatCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/cursor.4bpp.lz"); @@ -1481,8 +1480,7 @@ const u16 gTradeGba_Pal[] = INCBIN_U16("graphics/link/gba.gbapal"); const u16 gTradeGba2_Pal[] = INCBIN_U16("graphics/link/gba_pal2.gbapal"); const u8 gTradeGba_Gfx[] = INCBIN_U8("graphics/link/gba.4bpp"); -// 8DD8760 -asm(".space 0x20"); //blank palette?? +static const u16 sEmptyPal[16] = {0}; #include "data/graphics/berry_fix.h" @@ -1564,10 +1562,10 @@ const u32 gUnknown_08DE34B8[] = INCBIN_U32("graphics/berry_crusher/tiles.4bpp.lz const u32 gUnknown_08DE3FD4[] = INCBIN_U32("graphics/berry_crusher/tiles.bin.lz"); // random garbage at the end. -asm(".space 0x54BAC \n\ - .byte 0x0D, 0x00, 0x58, 0x02 \n\ - .space 0x1145 \n\ - .byte 0x02 \n\ - .space 0x3242 \n\ - .byte 0x40 \n\ - .space 0x13"); +static const u8 sEmpty3[0x54BAC] = {0}; +static const u8 sUnused1[] = {0x0D, 0x00, 0x58, 0x02}; +static const u8 sEmpty4[0x1145] = {0}; +static const u8 sUnused2[] = {0x02}; +static const u8 sEmpty5[0x3242] = {0}; +static const u8 sUnused3[] = {0x40}; +static const u8 sEmpty6[0x13] = {0}; diff --git a/src/librfu_intr.c b/src/librfu_intr.c index 23962a937..1361be40e 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -148,7 +148,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); @@ -904,7 +904,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) diff --git a/src/pokemon.c b/src/pokemon.c index 44b5e55bb..1adc7b1c4 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6814,7 +6814,9 @@ static void sub_806F160(struct Unknown_806F160_Struct* structPtr) structPtr->templates[i] = gUnknown_08329D98[i]; for (j = 0; j < structPtr->field_1; j++) { - asm(""); + #ifndef NONMATCHING + asm(""); + #endif structPtr->frameImages[i * structPtr->field_1 + j].data = &structPtr->byteArrays[i][j * 0x800]; } structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->field_1]; diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index a388be39a..37abb90e9 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -2884,7 +2884,11 @@ static void sub_8181C2C(struct Sprite *sprite) } else { - register s32 var asm("r4") = sUnknown_03001240[sprite->data[0]].field_8; + #ifndef NONMATCHING + register s32 var asm("r4") = sUnknown_03001240[sprite->data[0]].field_8; + #else + s32 var = sUnknown_03001240[sprite->data[0]].field_8; + #endif sprite->pos2.x = (var << 3) * (counter % 128) / 128 - (sUnknown_03001240[sprite->data[0]].field_8 * 8); sprite->pos2.y = -(Sin(counter % 128, 8)); diff --git a/src/record_mixing.c b/src/record_mixing.c index ad8b5693c..ccdaabdd1 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -872,8 +872,12 @@ static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t r var2 = sub_80E7A9C(&_src->mail[1]); if (!var1 && var2) { - register u8 one asm("r0") = 1; // boo, a fakematch - sp24[j][1] = one; + #ifndef NONMATCHING + register u8 one asm("r0") = 1; // boo, a fakematch + sp24[j][1] = one; + #else + sp24[j][1] = 1; + #endif } else if ((var1 && var2) || (!var1 && !var2)) { |