Skip to content

Commit ecd4d63

Browse files
frame timer
1 parent 582ad1f commit ecd4d63

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

arm9/include/vars.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,9 @@ bool PlayerThumbnailNeedsRedraw = false;
4848

4949
u16 PlayerFrameIndex=0;
5050

51+
const u8 frameTime[9]=
52+
{
53+
0, 120, 60, 30, 15, 10, 5, 3, 2
54+
};
55+
5156
#endif // FSPDS_VARS_H_INCLUDED

arm9/source/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ int main(int argc, char ** argv)
2929
u16 counter=0;
3030
while(1)
3131
{
32-
swiWaitForVBlank();
3332
scanKeys();
3433
uint32 input=keysDown();
3534
if(input == 0)
@@ -63,14 +62,15 @@ int main(int argc, char ** argv)
6362

6463
if(PlayerState==PLAYING)
6564
{
66-
playerNextFrame();
67-
/*counter++;
68-
if(counter==3)
65+
counter++;
66+
if(counter==frameTime[ppm_FramePlaybackSpeed])
6967
{
7068
playerNextFrame();
7169
counter=0;
72-
}*/
70+
}
7371
}
72+
else counter=0;
73+
swiWaitForVBlank();
7474
}
7575

7676
return 0;

0 commit comments

Comments
 (0)