VSync BENCHMARKs and avoid AdvanceRandom in tests (#3866)
This commit is contained in:
parent
ab900e38df
commit
ed850d3f6c
2 changed files with 5 additions and 1 deletions
|
@ -166,6 +166,9 @@ struct Benchmark { s32 ticks; };
|
||||||
static inline void BenchmarkStart(void)
|
static inline void BenchmarkStart(void)
|
||||||
{
|
{
|
||||||
gTestRunnerState.inBenchmark = TRUE;
|
gTestRunnerState.inBenchmark = TRUE;
|
||||||
|
// Wait for a v-blank so that comparing two benchmarks is not affected
|
||||||
|
// by the v-count (different numbers of IRQs may run).
|
||||||
|
VBlankIntrWait();
|
||||||
REG_TM3CNT = (TIMER_ENABLE | TIMER_64CLK) << 16;
|
REG_TM3CNT = (TIMER_ENABLE | TIMER_64CLK) << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "intro.h"
|
#include "intro.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "trainer_hill.h"
|
#include "trainer_hill.h"
|
||||||
|
#include "test_runner.h"
|
||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
|
|
||||||
static void VBlankIntr(void);
|
static void VBlankIntr(void);
|
||||||
|
@ -372,7 +373,7 @@ static void VBlankIntr(void)
|
||||||
m4aSoundMain();
|
m4aSoundMain();
|
||||||
TryReceiveLinkBattleData();
|
TryReceiveLinkBattleData();
|
||||||
|
|
||||||
if (!gMain.inBattle || !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_RECORDED)))
|
if (!gTestRunnerEnabled && (!gMain.inBattle || !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_RECORDED))))
|
||||||
AdvanceRandom();
|
AdvanceRandom();
|
||||||
|
|
||||||
UpdateWirelessStatusIndicatorSprite();
|
UpdateWirelessStatusIndicatorSprite();
|
||||||
|
|
Loading…
Reference in a new issue