Skip to content

Commit c667431

Browse files
Adding function to get video refresh rate
1 parent c42f033 commit c667431

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Assets/dll/dosbox.wbx.zst

542 Bytes
Binary file not shown.

waterbox/dosbox/bizhawk.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ uint32_t ticksElapsed;
3030
uint32_t _GetTicks() { return ticksElapsed; }
3131
void _Delay(uint32_t ticks) { ticksElapsed += ticks; co_switch(_driverCoroutine); }
3232

33+
// VGA refresh rate information
34+
uint64_t _vgaRefreshRateNumerator;
35+
uint64_t _vgaRefreshRateDenominator;
36+
3337
// Memory file directory
3438
jaffarCommon::file::MemoryFileDirectory _memFileDirectory;
3539

@@ -124,6 +128,10 @@ ECL_EXPORT bool Init(InitSettings* settings)
124128
ticksTarget = 0.0;
125129
ticksElapsed = 0;
126130

131+
// Setting VGA refresh rate initial value, just in case
132+
_vgaRefreshRateNumerator = settings->fpsNumerator;
133+
_vgaRefreshRateDenominator = settings->fpsDenominator;
134+
127135
printf("Starting DOSBox-x Coroutine...\n");
128136
_driverCoroutine = co_active();
129137
constexpr size_t stackSize = 4 * 1024 * 1024;
@@ -304,6 +312,9 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f)
304312
f->base.Samples = _audioSamples.size() / 2;
305313
}
306314

315+
ECL_EXPORT uint64_t getVGARefreshRateNumerator() { return _vgaRefreshRateNumerator; }
316+
ECL_EXPORT uint64_t getVGARefreshRateDenominator() { return _vgaRefreshRateDenominator; }
317+
307318
#define DOS_CONVENTIONAL_MEMORY_SIZE (640 * 1024)
308319
#define DOS_UPPER_MEMORY_SIZE (384 * 1024)
309320
#define DOS_LOWER_MEMORY_SIZE (DOS_CONVENTIONAL_MEMORY_SIZE + DOS_UPPER_MEMORY_SIZE)

waterbox/dosbox/dosbox-x

0 commit comments

Comments
 (0)