underruns are caused by video I/O blocking (even when not syncing to vblank). It also means that vsync blocking is a non-issue. Lots of thread-safety considerations had to
be done. Lots of tools developed to deal with new problems. Things redesigned to be asynchronous to avoid blocking the worker thread. New interfaces developed to give
clients access to these things without too much pain, as clients need to deal with thread-safety issues, and be able to do things asynchronously to avoid blocking and
unnecessary synchronization. Things developed and then scrapped as I changed my mind. Lots of thinking and testing to ensure video smoothness.
- Make configuration of the multimedia framework way more flexible, by adding methods for configuring video and sound, rather than forcing the use of the SoundDialog or
VideoDialog. Thus clients can make their own GUI for such things.
- Pass raw input events to MediaSources so that clients will not have to use the InputDialog with its Button system.
- Split BlitterWidget blitting into three methods: blit, draw, and sync, such that blitting is supposedly a fast pixel copy or buffer swap, while draw prepares for
presentation, and sync presents the completed video frame ASAP. Blit needs to be fast to avoid blocking the worker thread to avoid underruns.
- Allow heavy MediaSource video work to be skipped when frames are skipped.
- Do some work in parallel on SMP systems.
- Adjust low audio buffer detection to make it more robust.
- Move variance calculation to the user of estimations, because the variance calculated by estimators is not well defined anyway.
- Add support for adjustable fast-forward speed.
- Fast-forward now outputs audio, by skipping entire segments of audio when skipping frames.
- Adjust blitters to conform to the new threaded model.
- Direct3DBlitter: Apparently vertices point to the center of pixels. Subtract 0.5 from vertex coordinates.
- DirectDrawBlitter: Sleep more when far from vblank.
- QGLBlitter: Get rid of makeCurrent calls, because they apparently block and can be slow and don't seem to be needed anyway. They also seem to cause instability with some
drivers.
- XvBlitter: Double buffer to delay updates to sync time.
- X11Blitter: Double buffer when not scaling to delay updates to sync time.
- QPainterBlitter: Double buffer when not scaling to delay updates to sync time.
- SdlBlitter: Delay updates to sync time.
- AlsaEngine: Set max periods to 16 to work around stupid ALSA plugins and drivers that advertise smaller period sizes than properly supported. ALSA always picks the
maximum number of periods allowed, which means it picks the smallest period size allowed for a given buffer size.
- QPainterBlitter: Don't disable updates when not paused, because this breaks macx.
- Support pause on focus out.
- Add MiscDialog to allow user configuration of fast-forward speed and focus policy.
- Separate sync to refresh rate logic from sync to vblank logic.
- Sync to refresh rate menu option.
- Use semi-bilinear filtering rather than bilinear filtering for soft-scaling blitters.
- MakeSincKernel: Consider rounding effects when computing absolute gain.
- MakeSincKernel: Use a function pointer rather than a template argument to reduce code bloat.
- Reorder sinc kernel phases.
- PolyPhaseConvoluter: Simplify some calculations.
- Replace Hamming and Blackman windowed sincs with Kaiser windowed sinc of appropriate betas, because they require a lower number of taps to achieve the same specs.
- Use rounding shifts in resamplers for higher precision and performance.
- libgambatte: Update returns on video frame completion rather than using a callback for notification.
- libgambatte: Move video filters and color conversion out of the library.
- libgambatte: Get rid of unnecessarily complex VideoBlitter interface.
- libgambatte: Use bit flags rather bools for input state.
- Change some parameters to constants in 2xsai and hqx video filters.
- Probably other stuff I've forgotten about.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@234 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
- ossengine: Increase number of fragments requested from 4 to 8 for more accurate OSPACE/OPTR information with OSS4 (and possibly other implementations).
- ossengine: Minor include corrections and namespace fixes. Use log(x)/log(2) rather than non-c++98 log2. Minor rounding fix in fragment size calculation.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@231 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
- Get rid of pointless initialization of OpenGL state that is equal to
the default, or otherwise meaningless. Enable GL_CULL_FACE in case it's
slightly faster in some configurations.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@229 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
small, fixed set of variables, using templates to autogenerate
efficient, unrolled functions that update the binary tree for each
variable. It also efficiently supports priorities among variables when
their values are equal, and can give variables that change the most
frequently a better spot in the tree if the number of variables isn't a
power of 2. Will be used for event scheduling.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@227 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
increase estimated sample rate on underrun.
- OssEngine: Make use of sample period limit feature of RateEst. Don't
increase estimated sample rate on underrun.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@222 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
probably invalid.
- RateEst: Allow using a custom timestamp in feed().
- RateEst: Keep a queue of the last ~100 msec worth of samples and duration, and filter out collective
samples that give a pre-estimate that seems way off.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@215 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
Some updates only block if there's a prior unfinished update in progress. This screws up frame time estimation
in turn screwing up vsync. To fix this we do a double update (and extra blit) if close to a frame time
period has passed since the last update when sync to vblank is enabled. I really should have noticed this earlier
as it pretty much breaks vsync adaption completely.
- Direct3DBlitter: Use the D3DCREATE_FPU_PRESERVE flag when creating device. Omitting this flag can screw up floating point
calculations in other parts of the code. For instance WASAPI cursor timestamps get utterly screwed up here.
- Direct3DBlitter: It appears that managed textures are updated before they are unlocked, which screws up redraws, making
things appear choppy in some situations. Use a default memory texture and a system memory texture and the UpdateTexure
method instead.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@214 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
- Direct3DBlitter: Use D3DSWAPEFFECT_DISCARD in non-exclusive mode.
- Direct3DBlitter: Allow triple buffering and vblank-only updates in non-excusive mode.
- Rename "Page flipping" in Direct3D and DirectDraw blitters to "Exclusive full screen".
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@209 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
- Clear display buffers in DirectDrawBlitter and Direct3DBlitter in exclusive mode, since blits don't necessarily cover the entire buffers.
- DirectDrawBlitter: Make sure that a minimum amount of time has passed between calls to WaitForVerticalBlank, since it can return in the same vblank period twice on a fast system.
- DirectDrawBlitter: Support vsync for refresh rate ~= 2x frame rate
- DirectDrawBlitter: Refactor somewhat and get rid of a couple minor potential bugs.
- DirectDrawBlitter: Some tweaks to get updates closer to sync time in certain situations.
- DirectDrawBlitter: Some tweaks to better support DO_NOT_WAIT.
- DirectDrawBlitter: Make only updating during vblank while page flipping optional.
- Direct3DBlitter: Some tweaks to get updates closer to sync time in certain situations.
- Filter out very short frame times in frame time estimation.
- Don't adjust frame time during turbo, but rather skip BlitterWidget syncs to speed up, which avoids vsync limits without disabling vsync.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@208 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
Allow BlitterWidgets to opt in to get paintEvents while unpaused. Do so for QGLBlitter since it may need to clear buffers afterwards.
QGLBlitter: Try to blit right after sync in the case of single buffering.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@206 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
Revert to big f'ing switch hq2x code, as there's less duplication now. Also optimized interpolation functions further. No idea how I missed that initially.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@195 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
Route invalid rombank addresses in non-power-of-2 number of rombanks cases to disabled area assuming ceiled power of 2 address bus.
DMG window display disregards bg enable bit.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@189 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24