Skip to content

Commit

Permalink
pfba: fix "FORCE_60HZ" option not always applied
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste committed Mar 21, 2019
1 parent 5b9a880 commit 4f7b347
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ add_subdirectory(psnes)

# pfba
set(PFBA_VERSION_MAJOR 3)
set(PFBA_VERSION_MINOR 1)
set(PFBA_VERSION_MINOR 3)
add_subdirectory(pfba)
12 changes: 5 additions & 7 deletions pfba/pfba/uiEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,17 @@ int PFBAGuiEmu::load(RomList::Rom *rom) {
bForce60Hz = getUi()->getConfig()->get(Option::Id::ROM_FORCE_60HZ, true)->getValueBool();
bForce50Hz = getUi()->getConfig()->get(Option::Id::ROM_FORCE_50HZ, true)->getValueBool();
if (bForce60Hz) {
fps = 6000;
nBurnFPS = fps = 6000;
} else if (bForce50Hz) {
fps = 5000;
nBurnFPS = fps = 5000;
} else {
pDriver[nBurnDrvActive]->Init();
fps = nBurnFPS;
pDriver[nBurnDrvActive]->Exit();
}
printf("Emulation rate: %f hz\n", (float) fps / 100);

printf("Init audio device...");
int freq = getUi()->getConfig()->get(Option::Id::ROM_AUDIO_FREQ)->getValueInt();
addAudio(freq, (float) fps / 100);
addAudio(freq, (float) fps / 100.0f);
if (getAudio()->isAvailable()) {
nInterpolation = getUi()->getConfig()->get(Option::Id::ROM_AUDIO_INTERPOLATION)->getValueInt();
nFMInterpolation = getUi()->getConfig()->get(Option::Id::ROM_AUDIO_FMINTERPOLATION)->getValueInt();
Expand All @@ -69,7 +67,6 @@ int PFBAGuiEmu::load(RomList::Rom *rom) {
pBurnSoundOut = getAudio()->getBuffer();
}
audio_sync = getUi()->getConfig()->get(Option::Id::ROM_AUDIO_SYNC, true)->getValueBool();
printf("done\n");
///////////
// AUDIO
//////////
Expand All @@ -93,7 +90,8 @@ int PFBAGuiEmu::load(RomList::Rom *rom) {
nCurrentFrame = 0;
setFrameDuration(1.0f / ((float) nBurnFPS / 100.0f));
//printf("frame_duration: %f\n", getFrameDuration());
printf("done\n");
printf("FORCE_60HZ: %i, FORCE_50HZ: %i, AUDIO_SYNC: %i, FPS: %f (BURNFPS: %f)\n",
bForce60Hz, bForce50Hz, audio_sync, (float) fps / 100.0f, (float) nBurnFPS / 100.0f);
///////////////
// FBA DRIVER
///////////////
Expand Down

0 comments on commit 4f7b347

Please sign in to comment.