115 Commits

Author SHA1 Message Date
sinamas
9f122d245d missing ds ly reg 99 read tests. longer 99 period when ds.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@334 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-09-02 11:54:31 +00:00
sinamas
5d469bd699 m0 irq inhibits lycirq trigger.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@333 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-08-23 16:27:55 +00:00
sinamas
5a3c5ffd8f ppu: shave off 5 instructions in unrolled tile-draw inner loop on ARM (gcc)
help gcc fuse the shifts with the loads since it doesn't manage to fuse them with the ands.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@331 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-29 18:55:19 +00:00
sinamas
0031cecc5f reorder fields for easier access on ARM
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@328 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-28 12:19:32 +00:00
sinamas
183bb261ff minkeeper: make updateValue function lut static
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@327 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-28 12:18:51 +00:00
sinamas
8d0bdf218f allocate vram on heap to reduce field offset sizes for easier access on ARM
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@326 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-26 22:12:41 +00:00
sinamas
eb3c455140 slight tweak for better generated asm (gcc)
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@325 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-26 22:10:11 +00:00
sinamas
f30e23cd0a tweak ppu unrolled code
- combine tileline with tileIndexSign to reduce number of varaibles referenced/spills in inner loop.
- replace loop counter with test for dstend to get rid of potential spill of rmw variable.
- special-case dmg bgoff to get constant twmask
- update tileMapXpos in a way that reduces number of temporaries needed (and avoids gcc x86 stack read+rmw sequence)


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@324 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-15 14:20:31 +00:00
sinamas
f926818370 somewhat tighter. keeps gcc 4.7 from generating crap on x86.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@323 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-07-13 15:56:55 +00:00
sinamas
406589594e re precise serial timing details. fixes faceball 2000 frame rate.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@314 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-02-26 14:54:54 +00:00
sinamas
2c9679d7bc more flexible and less confusing return type.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@313 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-02-01 23:41:52 +00:00
sinamas
4785515dac refactor ancient mbc code somewhat.
improve HuC1 hackjob.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@312 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2012-01-26 20:16:06 +00:00
sinamas
5c52567a68 - missing explicit.
- missing [].


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@310 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-11-19 16:53:57 +00:00
sinamas
5ea9d9afe1 saner order of argument evaluation. space.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@309 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-11-14 23:04:33 +00:00
sinamas
51c55ff068 - fix MBC regression caused by forgetting to re-add rambank bit mask when adding multicart support.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@303 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-11-12 14:34:34 +00:00
sinamas
231fea8998 cast before printing with %u.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@299 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-11-10 23:16:31 +00:00
sinamas
4970799b4e - allow loading HuC1 ROM images.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@292 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-11-02 22:14:35 +00:00
sinamas
84f0c0aa6a - Allow 6 digit Game Genie codes.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@291 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-11-02 17:04:45 +00:00
sinamas
3ad6b950d9 libgambatte: - support 9 digit Game Genie codes, and 01xxxxxx Game Shark codes.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@287 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-10-30 20:57:32 +00:00
sinamas
5cd1ef284f gambatte_qt: - Add GBC DMG palettes.
- Use mapped GBC palette by default for known DMG game titles.
libgambatte: - ROM title getter.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@285 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-10-23 18:47:38 +00:00
sinamas
90438f91b3 - Support .gz files.
- Avoid using magic header values to detect file type to avoid conflicts with ROM content.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@279 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-10-02 16:00:40 +00:00
sinamas
96537c1950 - Provide option to use heuristics to support certain multicart MBCs disguised as MBC1 (Bomberman Collection, Mortal Combat I & II, Super Chinese Land 1,2,3 Dash, maybe others)
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@277 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-25 13:44:59 +00:00
sinamas
41952f42f4 libgambatte: compilation and warning fixes for clang.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@276 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-24 19:54:17 +00:00
sinamas
63b72e0bd7 Facilitate overriding CC and CXX from the command line.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@275 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-24 14:52:45 +00:00
sinamas
59abf98a9b Add GBA CGB mode option.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@269 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-17 16:54:55 +00:00
sinamas
dcfefa4202 - Add save path selection.
- Stop using different file name for save files when forcing DMG.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@268 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-17 14:18:14 +00:00
sinamas
d434892be6 reenable some printing on load fail due to unsupported mbc.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@263 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-14 22:19:10 +00:00
sinamas
bdbb19c1ee - Work around DWM compositor screwing up when duplicating frames by adding "DWM triple buffering" option (on by default) which sets presentparameters with frame queueing for all blitters.
- Work around DWM breaking windows with frame queuing after composition is disabled and re-enabled, by resetting present parameters on next video frame after composition enable event.
- Work around DWM breaking OpenGL window on minimize by unsetting present params on hide event, and setting on show event.
- Ignore sync to vblank when DWM composition is active.
- Deactivate sync to frame rate option when DWM composition is active.
- Make window size setting a menu rather than a part of video settings dialog.
- Work around Windows file dialog blocking events by waiting for pause to complete before launching such dialog.
- Work around events getting blocked when resizing on Windows by consuming pending blit requests on resizeEvent.
- WASAPI: Detect and use shared stream sampling rate in shared mode because all other rates appear to fail.
- Default screen names start at "1" rather than "0".
- Build fixes for mingw gcc 3.4.
- Refactoring.



git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@259 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-09-11 04:32:50 +00:00
sinamas
61fc540ddb refactoring.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@256 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-08-25 17:35:27 +00:00
sinamas
3cec8e0aa8 refactoring.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@255 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-08-18 19:48:16 +00:00
sinamas
cf1fe30715 refactoring.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@254 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-08-18 18:15:49 +00:00
sinamas
9dc2f7ec48 - libgambatte: *
- tons of re (cgb _and_ dmg).

$ ./run_tests.sh
...
Ran 2755 tests.
0 failures.



git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@246 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2011-07-23 17:02:32 +00:00
sinamas
fa8b85e1c9 - Optimize save state thumbnail generation.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@243 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-04-04 16:17:40 +00:00
sinamas
91d02aa38f - Better (simpler and makes sense) hypothesis for mode3 sprite cycles.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@240 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-03-26 20:20:10 +00:00
sinamas
82459cf24d - Document libgambatte better.
- Document resampling framework better.
- Use a single constant for setting number of resampler channels rather 
than two.
- thread-safety -> thread safety


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@239 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2010-02-04 00:14:08 +00:00
sinamas
470b627fa8 - Redesign Qt multimedia framework to use a worker thread for MediaSource updates. This was a ton of work, but should make underruns a lot less likely. The majority of
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
2010-02-02 21:30:46 +00:00
sinamas
57f750768a - Use MinKeeper to schedule Memory::events.
- Remove old incEndtime function since it's not worth the maintenance 
overhead.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@228 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2009-04-15 02:20:57 +00:00
sinamas
c2938c3eb8 - Add data structure that efficiently keeps track of the minimum of a
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
2009-04-15 02:18:34 +00:00
sinamas
6d2c28629e - Lyc0irq on display enable.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@226 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2009-03-23 21:25:14 +00:00
sinamas
bb91dcd035 - Make sure to reset passed pointers when deleted. Fixes potential crash when loadin ROM during OAM busy.
git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@223 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
2009-01-10 19:22:59 +00:00
sinamas
b6eab774a0 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
654aa0d2b8 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
c25bd691ad 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
3512fe21e0 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
71e80ba152 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
5313ca3ac4 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
92b72f4849 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
58a072318f 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
fccce3843e 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
98b064d235 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