Skip to content

Commit 3924ae8

Browse files
committed
Re-add reading the exact FPS or reducing by 0.1%
1 parent 99da257 commit 3924ae8

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

arm9/source/main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,10 +809,12 @@ int playRvid(const char* filename) {
809809
}
810810

811811
if (rvidHasSound) {
812-
// Ensure video and audio stay in sync
813812
soundBufferReadLen = rvidSampleRate;
814-
for (int i = 0; i < rvidSampleRate; i += 1000) {
815-
soundBufferReadLen++;
813+
if (rvidReduceFpsBy01) {
814+
// Ensure video and audio stay in sync
815+
for (int i = 0; i < rvidSampleRate; i += 1000) {
816+
soundBufferReadLen++;
817+
}
816818
}
817819

818820
rvidSound = fopen(filename, "rb");
@@ -905,7 +907,9 @@ int playRvid(const char* filename) {
905907
IPC_SendSync(1);
906908
} else {
907909
frameOfRefreshRateLimit = 60;
908-
IPC_SendSync(2);
910+
if (!rvidReduceFpsBy01) {
911+
IPC_SendSync(2);
912+
}
909913
}
910914

911915
videoPlaying = true;

arm9/source/rvidHeader.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ rvidHeaderInfo2 rvidHeader2;
88

99
int rvidFrames = 0;
1010
int rvidFps = 0;
11+
bool rvidReduceFpsBy01 = false;
1112
int rvidHRes = 0;
1213
int rvidVRes = 0;
1314
bool rvidInterlaced = false;
@@ -52,6 +53,12 @@ void readRvidHeader(FILE* rvid) {
5253
fread(&rvidHeader2, 1, sizeof(rvidHeader2), rvid);
5354
rvidFrames = rvidHeader2.frames;
5455
rvidFps = rvidHeader2.fps;
56+
if (rvidFps >= 0x80) {
57+
rvidFps -= 0x80;
58+
rvidReduceFpsBy01 = true;
59+
} else {
60+
rvidReduceFpsBy01 = false;
61+
}
5562
rvidVRes = rvidHeader2.vRes;
5663
rvidInterlaced = rvidHeader2.interlaced;
5764
rvidDualScreen = rvidHeader2.dualScreen;

0 commit comments

Comments
 (0)