Commit Graph

1059 Commits

Author SHA1 Message Date
sinamas
305ec25dbf - DirectDrawBlitter: Add triple buffering option.
- 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
2009-01-01 04:21:03 +00:00
sinamas
4454c3ce0f - Adaptively skip BlitterWidget syncs if audio buffer is low, in a manner that should minimize wasted skips in sync to vblank situation, and tries to be non-disturbing. This replaces frame time halving, and blitter specific rescueing.
- 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
2008-12-31 06:10:38 +00:00
sinamas
a36ad03625 Up default audio buffer latency to 100 ms (some common system audio servers require a lot of buffering to work well).
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@207 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-12-26 17:56:19 +00:00
sinamas
6308d19123 QGLBlitter: Do a cheap front blit rather than a vsynced flip if audio buffers are low.
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
2008-12-26 17:50:13 +00:00
sinamas
7dcadcff88 Disable BlitterWidget updates (paintEvents) while not paused.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@205 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-12-26 02:32:43 +00:00
sinamas
c69e48ac80 Substantially improved rate estimation averaging.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@204 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-12-25 23:45:53 +00:00
sinamas
cbf173e0a8 Fix mbc2 not getting a rambank
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@203 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-11-03 20:42:50 +00:00
sinamas
7a939e1522 Fix HqXx pitch.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@202 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-11-01 07:38:24 +00:00
sinamas
edd2434ca2 silly ifdef typo
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@201 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-27 23:41:57 +00:00
sinamas
58ec25aff0 update changelog, README
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@200 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-27 22:23:35 +00:00
sinamas
cd799e3cd8 work around annoying random non-updating OpenGL on Mac OS X after full screen.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@199 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-27 19:53:21 +00:00
sinamas
5eb81ff36a Allow more rate estimation deviation.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@198 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-27 12:36:08 +00:00
sinamas
03ca427b8d Lower opacity OSD text.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@197 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-26 15:11:07 +00:00
sinamas
7fb056af35 Actually add the hq3x code mentioned in previous commit.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@196 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-26 13:35:29 +00:00
sinamas
7d6b0db817 Add adapted and optimized hq3x.
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
2008-10-26 13:34:13 +00:00
sinamas
bda7eaf108 saner ly write behaviour
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@194 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-26 13:21:06 +00:00
sinamas
12d33eca65 Append "_dmg" to save base name when forcing DMG mode, to avoid corrupting CGB save files and vice versa.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@193 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-26 06:23:42 +00:00
sinamas
1f6c8dc2d4 Tile loading and tile rendering can seemingly get out of sync when modifying scx at a critical time. Another pessimation with little gain in the name of accuracy.
Use a look-up table to do tile byte merging.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@192 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-26 05:44:56 +00:00
sinamas
ec9199c334 no sprites or sprite mapping busy cycles on first line after display enable. slight cleanup. small oam accessibility correction.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@191 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-25 10:41:53 +00:00
sinamas
5fc35493a6 revert DMG window display while bg disabled change
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@190 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-24 08:43:19 +00:00
sinamas
bdba031382 No rambanks for ROMs that don't request any.
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
2008-10-24 08:19:15 +00:00
sinamas
b061b5db6c Add "force DMG mode" option.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@188 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-24 05:09:37 +00:00
sinamas
f834c0a646 Update SDL_Joystick to SDL-1.2 SVN. #undef UNICODE in win32/SDL_mmjoystick.c to avoid joystick name mangling.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@187 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-24 04:04:12 +00:00
sinamas
a04726f285 Fix CoreAudio engine reporting buffer status in samples rather than frames.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@186 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-24 03:02:32 +00:00
sinamas
8a321f16c5 - Add CoreAudio engine with rate estimation and buffer status support. Default engine on Mac OS X.
- 44100 Hz default sample rate on OS X, since OS X tends to resample everything to 44100 Hz.
- Get rid of buffer status averaging in OpenAlEngine, since it makes assumptions on usage pattern that shouldn't be made.
- Extend ringbuffer.h to support resetting size, and move it to common dir since gambatte_qt/coreaudioengine uses it too now.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@185 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-24 02:51:13 +00:00
sinamas
2638002fd3 Use RateEst.reset rather than re-initing on pause.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@184 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-19 20:58:05 +00:00
sinamas
ad9eda2e3f Don't duplicate blitter pointer in mainwindow.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@183 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-19 20:55:16 +00:00
sinamas
a5f83a3719 Fractional bits for intermediate rate estimation averages.
Add RateEst reset method. Initialize RateEst count to 1.
Less refresh rate estimation averaging.
Allow more refresh rate estimation deviation.
Return NULL paintEngine in windows blitters that use the PaintToScreen attribute.
Add checks for things not being initialized in DirectDraw-blitter and QPainterBlitter paintEvents.
Don't reparent blitters (mainly to make a bug in Qt 4.4.3 win less annoying, widgets that do internal reparenting are still affected).
Check for window position less than screen top-left after mode change, before full screen, to avoid Qt moving it to the primary screen.
Add rate estimation to DirectSound engine.
Better underrun detection in DirectSound engine.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@182 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-19 20:24:27 +00:00
sinamas
eb810eb4fe use crtc mode dimensions rather than crtc dimensions when discarding modes since crtc dimensions may be rotated
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@181 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-17 07:46:44 +00:00
sinamas
0a9a6a6e57 Add support for XRandR 1.2 multi-head
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@180 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-17 07:08:05 +00:00
sinamas
415a5f3c9a postpone buffered x11 blits to after sync.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@179 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 21:31:46 +00:00
sinamas
df57dca99c delete unnecessary empty directory
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@178 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 20:45:20 +00:00
sinamas
5e3bbd0f2a Move Qt media framework to a separate subdir
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@177 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 20:41:51 +00:00
sinamas
14918d577f Don't bother allowing sources the choice of which output sample rates are selecrable,
as it's not really a per source thing at this point. If resampling avoidance is desired, then that
should rather be a user option (to depend on the OS for resampling, which is mostly nonsensical for the Game Boy/NES/PSG-system case btw).


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@176 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 17:17:30 +00:00
sinamas
f4b56a9214 allow dynamically setting samples per frame
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@175 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 16:57:44 +00:00
sinamas
3a39b8fce2 Adjust estimated frame time each frame.
Use half frame time if audio buffer is close to underrun.
Provide combined audioengine write and status get, to avoid doing potentially expensive operations twice. Utilized in OSS and ALSA engines.
Saner vsync estimate variance protection.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@174 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 01:55:07 +00:00
sinamas
efd990ffff Stricter estimate deviation limit
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@173 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 01:50:39 +00:00
sinamas
f5faa3d139 Fill available buffer space before waiting for more.
Audio buffer command line options.
Use half video frame sleep time if audio buffer is close to underrun.
Adjust estimated frame time each frame.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@172 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 01:49:32 +00:00
sinamas
8b64e527af Stricter estimate deviation limit
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@171 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-16 01:44:18 +00:00
sinamas
32232f58e1 More averaging in estimation code.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@170 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-15 02:04:15 +00:00
sinamas
6c5cb46be6 Skip resampling when fast-forwarding
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@169 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-15 00:10:50 +00:00
sinamas
f46b46d915 Do per phase normalization to avoid dc fluctuations.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@168 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-14 23:52:24 +00:00
sinamas
160b2786fa limit vsync frame rate estimation deviation
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@167 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-14 00:18:09 +00:00
sinamas
0661f57297 silence forgotten debug message
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@166 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-13 23:14:27 +00:00
sinamas
5bbabdcfdd - Real-time, sophisticated resampling framework with several performance/quality profiles for dynamically generated windowed sinc and CIC chains based on analysis of
fourier transforms and optimal cost equations. Fast 2-tap linear as a low quality alternative.
- libgambatte: Use deltas and a running sum to decrease buffer writes in sound emulation sample generation.
- libgambatte: Rearrange sound emulation event loop to optimize for high-frequency event units.
- libgambatte: Initialize palette arrays to avoid valgrind noise.
- Don't do resampling in libgambatte. Update API to reflect this.
- Move non-emulation common code to a common directory to avoid duplication.
- Update front-ends to new libgambatte API.
- Utilize resampling framework in front-ends. Selectable resamplers.
- Improved adaptive sleep class that estimates oversleep.
- Gambatte SDL: Estimate actual output sample rate in terms of OS timers and derive frame rate from it.
- Gambatte SDL: Move AudioData and RingBuffer classes to separate files.
- Gambatte SDL: Make underruns slightly less painful, by resetting buffer positions.
- Gambatte Qt: Update AudioEngine to support sample rate estimation in terms of OS timers.
- Gambatte Qt: Implement sample rate estimation in ALSA and OSS audio engines.
- Gambatte Qt: AlsaEngine: Revert to using snd_pcm_avail_update for buffer status since snd_pcm_delay may consider external latencies.
- Gambatte Qt: AlsaEngine: Use snd_pcm_hw_params_set_buffer_time_near. Don't request a particular number of periods per buffer.
- Gambatte Qt: AlsaEngine: Use hw as default custom device string, rather than hw:0,0.
- Gambatte Qt: OssEngine: Don't trust GETOSPACE fragment info.
- Gambatte Qt: Estimate optimal frame rate based on sample rate estimations.
- Gambatte Qt: Extend BlitterWidget to support estimation of vsynced frame rate in terms of OS timers.
- Gambatte Qt: Implement vsync frame rate estimation in QGlBlitter, Direct3DBlitter and DirectDrawBlitter.
- Gambatte Qt: Use a combination of OS timer sample rate estimation and vsync frame rate estimation to derive resampling ratio for no-frame-duplication vsync.
- Gambatte Qt: Change API to reflect MediaSources not being responsible for resampling.
- Gambatte Qt: Make sure to parent PaletteDialog list model, so it gets deleted properly.
- Various refactoring, small changes and stuff I forgot.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@165 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-13 21:08:08 +00:00
sinamas
6aff6b2cbd Fix LY display disable regression
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@164 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-10-01 10:26:05 +00:00
sinamas
378db29118 Correct unhalttime when resetting counters. Fixes perodic infinite halt issue in Kirby's Star Stacker and probably other games.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@163 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-07-16 21:27:11 +00:00
sinamas
0da282ee15 Prevent all text editing of input boxes.
Add custom context menu to input boxes.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@162 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-07-16 21:20:10 +00:00
sinamas
a0bc227484 Only ask for xrandr config once to avoid potential server roundtrips in some xrandr versions.
Make sure xrandr version is >= 1.1 and < 2


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@161 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-07-11 22:01:52 +00:00
sinamas
dc496432d1 fix silly "alsa not using default device by default" bug
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@160 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2008-07-11 21:08:59 +00:00