I was already bracketing my call to LoadLevel with calls to FadeOut and FadeIn, so my screen was already black for the duration of the call to LoadLevel.
I used the "wdr" instruction to get a baseline, and to test the performance of various parameters:
Code: Select all
__asm__ __volatile__ ("wdr");
levelOffset = LoadLevel(currentLevel, &theme, &treasuresLeft, &timeBonus);
__asm__ __volatile__ ("wdr");
Code: Select all
WDR measured 1942481 cycles
WDR measured 1937134 cycles
WDR measured 1950455 cycles
WDR measured 1946936 cycles
WDR measured 1949280 cycles
WDR measured 1951888 cycles
WDR measured 1950447 cycles
WDR measured 1955282 cycles
WDR measured 2374249 cycles
WDR measured 1951018 cycles
WDR measured 1958714 cycles
WDR measured 2385729 cycles
WDR measured 1940968 cycles
WDR measured 1949972 cycles
WDR measured 1948121 cycles
WDR measured 2380278 cycles
When I bracketed my call to LoadLevel with calls to the SetRenderingParameters function:
Code: Select all
__asm__ __volatile__ ("wdr");
SetRenderingParameters(262 - 80, 80);
levelOffset = LoadLevel(currentLevel, &theme, &treasuresLeft, &timeBonus);
SetRenderingParameters(FIRST_RENDER_LINE, FRAME_LINES);
__asm__ __volatile__ ("wdr");
Code: Select all
WDR measured 286914 cycles
WDR measured 281486 cycles
WDR measured 294796 cycles
WDR measured 291281 cycles
WDR measured 293272 cycles
WDR measured 296224 cycles
WDR measured 294806 cycles
WDR measured 299639 cycles
WDR measured 308874 cycles
WDR measured 295345 cycles
WDR measured 303093 cycles
WDR measured 319944 cycles
WDR measured 285322 cycles
WDR measured 293959 cycles
WDR measured 292476 cycles
WDR measured 314475 cycles
During my search to figure out what I needed to restore the parameters to, I noticed that the demos MegaSokoban and chess4uzebox also call SetRenderingParameters, but they call SetRenderingParameters(1, 1). When I tried those values, it actually didn't save me any cycles, and I'm curious why (I assume) it would save them cycles, but not me. The only difference I can think is that modes 10, and 5 work differently than mode 3, but I'm not familiar enough with those other modes to know why.