Compare commits

..

5592 Commits

Author SHA1 Message Date
rogerman 6f1a63fe89 Cocoa Port: Support Automatic Graphics Switching, allowing the use of the integrated GPU to run video display windows. (Requires a dual-GPU MacBook Pro with Metal-capable GPUs.)
- While this results in a 20% performance loss for video display window functions (like video filters), this also dramatically extends battery life. To return to the old way of using the discrete GPU for video display windows, the user must disable Automatic Graphics Switching in their System Preferences.
- The Troubleshooting Window now correctly reports the emulated 3D renderer that is currently active, rather than the one that is selected in the GUI.
- Also fix a bug where creating a OpenGL 3D renderer's context would immediately fall back to Apple Software Renderer if context creation failed. Now, context creation falls back to Apple Software Renderer as the last resort, only after all other Core Profile contexts have failed.
2025-03-26 16:55:25 -07:00
rogerman 25356b70f1 GPU: Add some more optimizations hints in CopyLineExpand() for SSSE3. 2025-03-26 13:26:42 -07:00
rogerman 75766495f9 Cocoa Port: Add some missing file references to the Xcode 3 project. 2025-03-20 22:55:40 -07:00
rogerman 1091e69726 Cocoa Port: Fix a bunch of bugs related to moving windows between Retina and non-Retina displays. (Related to commit 2bc5b0d.) 2025-03-19 03:11:16 -07:00
rogerman f6e0feb13e Cocoa Port: Report which OpenGL renderer is actually selected for 3D rendering. (Debug mode only.) 2025-03-18 15:55:01 -07:00
rogerman 33754b706e Cocoa Port: Add support for performing OpenGL 3D rendering on the 2013 Mac Pro's second GPU.
- For OpenGL 3D rendering, this yields a performance improvement of 2% - 4%.
2025-03-17 17:03:35 -07:00
rogerman 50e39989f7 GPU: Do some small optimizations to SSE2 and AVX2. 2025-03-16 23:15:46 -07:00
rogerman c73a7ffe53 GPU: Add NEON-accelerated functions for 2D layer compositing. (For 64-bit ARM CPUs only.)
- This improves GPU performance by up to 20% on the Raspberry Pi 5, and up to 50% on Apple Silicon CPUs.
2025-03-16 16:23:21 -07:00
rogerman e2379a66d6 matrix.h: Fix const-correctness for some *_fast function parameters.
- In practice, this only affected compiling for NEON on certain compilers. Other SIMD ISAs should remain unaffected.
2025-03-16 16:13:12 -07:00
zeromus 5cd9d36bba
Merge pull request #888 from Morilli/fix-movie-commands
fix movie command flags not actually being OR'd together
2025-02-14 03:16:42 -05:00
Morilli b756ffb1e6 fix movie command flags not actually being OR'd together 2025-02-14 08:57:30 +01:00
zeromus bec2329653
Merge pull request #886 from Anonym271/master
Bugfix: MemROMReaderWrite not working for size=1
2025-02-11 16:55:35 -05:00
Anonym271 06bef8b560 Bugfix: MemROMReaderWrite was not working for 1 byte length because it
would copy the current mem's byte into the source buffer instead of the
opposite way.
2025-02-11 22:49:20 +01:00
rofl0r dfcd482933 fix couple of header names to work on case-sensitive file systems 2024-12-06 02:37:38 +01:00
rofl0r 8a4fd0a9cb arm_jit: fix build when LOG_JIT_LEVEL != 0 2024-12-06 02:37:38 +01:00
zeromus b022181a05
Merge pull request #867 from lifehackerhansol/libnds-v2
Minor fixes for libnds v2.0.0 release
2024-11-14 23:54:53 -05:00
lifehackerhansol ee39a36f20
cp15: add support for process ID 2024-11-14 20:47:47 -08:00
lifehackerhansol c1624b2b33
MMU: support 8-bit write to REG_IPCSYNC 2024-11-14 20:47:47 -08:00
Max Fedotov 1192bf6f2c
EGL: use eglGetPlatformDisplay if available (#865)
POSIX Ports: When acquiring an EGL context, try calling the client-specific eglGetPlatformDisplay() before falling back to the more generic eglGetDisplay(). Hopefully fixes #864.
2024-11-12 22:50:35 -08:00
thesource 2c7fac57ff port 0.5 GPU scaling increments/window sizes to GTK3 2024-11-06 22:43:22 +01:00
Max Fedotov 3b1989a9d9
GTK*: add gamepad hotplug support (#855)
* add gamepad hotplug support
* Get rid of nbr_joy
2024-11-04 19:32:07 +01:00
zeromus f51e19b19b
Merge pull request #860 from En-En-Code/oglgetdriverversion-fix
fix: null-terminate versionSubstring in OGLGetDriverVersion
2024-11-02 22:24:35 -04:00
En-En 6f1d4e1d5c fix: null-terminate versionSubstring in OGLGetDriverVersion 2024-11-02 18:09:49 +00:00
rogerman 6690a8cedd posix: Update the Code::Blocks project file to include the new files that commit efdd938 added. 2024-10-28 14:39:17 -07:00
rofl0r 7d6f0982c8 gtk2: add some more presets to winsize menu 2024-10-28 19:16:45 +00:00
rofl0r 0ec9d74c39 gtk2: allow 0.5 increments on gpu scale
since the window size menu offers those as presets, and at least a 0.5
fraction on the scale doesn't seem to cause any problems in my testing.
2024-10-28 19:14:08 +00:00
rofl0r 76a6935dc8 gtk2: backport GPU scaling feature
feature was originally added via PR #764 to the gtk3 frontend.

this makes it possible to run the scaling on the GPU, avoiding the
incredibly slow software scaling that's otherwise done via cairo
when view->window size is set to anything > 1.0.
note that the window size "scale" needs to be identical to the
chosen GPU scale factor, otherwise software scaling kicks in again.

unlike the scale setting in the CLI port, which simply upscales the
native NDS framebuffer in hardware, this setting scales up even
the actual 3D textures, resulting in a sharper image, at the cost
of higher CPU/GPU usage. a game using demanding 3D scenes, like
zelda phantom hourglass' intro scene, may be able to still trash
the FPS.

the original PR also reported issues when setting the GPU scale to
a fraction, therefore the increments are currently locked to 1.0.
2024-10-28 13:50:27 +01:00
rofl0r 3ddb2669a9 cli: fix boost input detection
until now, the boost key was hardcoded to 'o' even when the config
said otherwise, and not treated in case of a joypad at all.
when triggered with the o key, it even behaved differently than
the gtk ui - the boost wasn't released together with the key,
but only when pressed again, so it was more like a shortcut for
"disable fps limiter".

this change implements the desired outcome of the second part of PR #822,
but without introducing more hacks and relying on magic values.

closes #822
2024-10-28 11:32:43 +01:00
rofl0r 58bbe693e1 cli: fix joypad and keyboard config retrieval
because the GTK frontends use GDK keysyms, not SDL ones, - the former
are being stored in the config file and used by the GTK ui) -  a temporary
workaround was put into place 14 years ago: the loaded config values
were simply being overwritten with the hardcoded defaults.

this commit removes the overriding of the config, and introduces
a cli frontend specific section "SDLKEYS", which is written by the
GTK2 frontend upon a configuration change.
it tries to convert the GDK keycodes into SDL2 ones while doing so.

an alternative solution (involving less code changes) would have been
to do the conversion in the cli frontend, but that would require having
the gdk header available for compilation, which may not be the case
if the user only wants the cli frontend. such a user could now create
the config file on another machine with the GTK frontend, or simply
manually take the desired values from the SDL_keycode.h header.

this change is instigated by one of the changes in PR #822, which simply
removed the workaround and kept parsing on error, which mitigated the
problem for some keys, but not all.
2024-10-28 11:32:43 +01:00
rofl0r 0a36e96f66
Merge pull request #845 from thesourcehim/master
[GTK*] Some gamepad input rework

- Unbind gamepad keys by default. The default bindings may fit one gamepad model but work weirdly with another causing issues like [LINUX/GTK3] Whitescreen freeze when pressing square on ds4 #834
- Use non-blocking method to obtain gamepad keys/axes during configuration to avoid visible emulator freeze and possible deadlock (see [linux] editing controlls sometimes (often) freezes the emulator #843)

closes #834
closes #843
2024-10-27 11:51:24 +01:00
thesource 5d498a97c4 Port previous two changes to gtk2 frontend. Add meson option to build
gtk2 frontend (disabled by default). Fix meson.build dependency for
gtk2.
2024-10-26 13:29:48 +03:00
zeromus fff5659879
Merge pull request #851 from dlbuhtig4096/master
Fix ensata sound register emulation.
2024-10-26 02:27:43 -04:00
En-En efdd938dc3
GTK*: Action Replay cheat menu (+ other cheat improvements) (#847)
* GTK cheats UI inputs/displays hex for address (offset)

* Added range bound to keep internal cheat data within specified size
The decision to change the value column to store G_TYPE_UINT is purely pragmatic--having all data be treated and displayed as unsized is simpler than writing a custom display to handle signedness and cleaner than 1-3 byte ints appearing unsigned and 4 byte int appearing signed.

* Added index and cheat type data to ListStore
My implementation plan is to use a GtkTreeModelFilter to create separate section for internal and ActionReplay cheats, but I was not convinced the indices in the tree path would correspond to the indices in , hence the additional column.

* Filter raw and AR cheats, display both filters in UI, patch up raw update/delete

* Action Replay UI elements [GTK]

* Memory leak fixes
+ some additional clean-up comments and small bug patches

* Backport to GTK2
2024-10-25 20:32:03 +02:00
dlbuhtig4096 ff84815acb Improve console allocation. 2024-10-24 19:20:24 +08:00
dlbuhtig4096 28f5c76035 Proper ensata handshake on reconnection. 2024-10-20 21:27:03 +08:00
dlbuhtig4096 7984eae357 Fix ensata sound register emulation. 2024-10-20 13:03:03 +08:00
Roger Manuel 2bc5b0d86b
Merge pull request #846 from BayLee4/fix_retina
Cocoa Port: Fix mixed retina/non-retina display touchscreen bug
2024-10-10 12:48:59 -07:00
BayLee4 a0386e535c Cocoa Port: Fix mixed retina/non-retina displays bug 2024-10-10 17:57:21 +02:00
thesource 72315fa339 Make gamepad key configuration non-blocking 2024-10-10 11:42:27 +03:00
thesource 1cf7c37896 Unbind joypad keys by default 2024-10-10 09:44:09 +03:00
zeromus 8fa0affab1
Merge pull request #839 from intra0/master
Update org.desmume.DeSmuME.metainfo.xml
2024-10-04 21:31:38 -04:00
zeromus e7442cc999
Merge pull request #841 from lifehackerhansol/cmdline-misleading-indentation
commandline: avoid misleading indentation
2024-10-01 05:43:24 -04:00
lifehackerhansol fa1879f9a7
commandline: avoid misleading indentation 2024-09-29 13:45:34 -07:00
intra0 bb1b6a1c80
Update org.desmume.DeSmuME.metainfo.xml
the current flatpack version is commit 640a1fdd93

was 2 years ago but is a 9.14 version
2024-09-25 21:54:14 -05:00
zeromus 91196788eb fix more screw-ups in unicode support. fixes #828 2024-08-31 22:34:38 -04:00
rogerman 8f9c6892d5 OpenGL Renderer: Fix an initialization issue with the clear image shader program when running the 3.2 Core Profile renderer for a driver that only supports OpenGL v3.2. (Regression from commit e2a25e2. Fixes #827.) 2024-08-28 10:33:27 -07:00
zeromus 42667020d8 fix ensata emulation? (re: #184) 2024-08-27 04:15:00 -04:00
rogerman 64132f765a OpenGL Renderer: Fix a bug where having Edge Mark enabled could cause fragments to disappear. (Regression from commit f910c61.) 2024-08-22 19:26:39 -07:00
rogerman 00b8df1b00 OpenGL Renderer: Add entry point for glClientWaitSync, fixing compiling on Windows. (Regression from commit f910c61.) 2024-08-15 17:50:53 -07:00
rogerman f910c6197c OpenGL Renderer: Add new rendering resource classes, and do some misc. refactoring.
- Using the new OpenGLGeometryResource and OpenGLRenderStatesResource classes, the 3.2 Core Profile and ES renderers now use triple-buffering for all geometry rendering resources and framebuffer constants.
- Delete the InitFinalRenderStates() method, which has been obsoleted over the years. Its functionality has been rolled into the InitExtensions() and _RenderGeometryLoopBegin() methods.
2024-08-15 16:49:42 -07:00
rogerman f84a804499 OpenGL Renderer: Fix bug where clear images were Y-flipped. (Regression from commit 3db6d56.) 2024-08-13 19:49:34 -07:00
rogerman 8197174d69 OpenGL ES Renderer: Fix a bug where the final output framebuffer is Y-flipped. (Regression from commit 3db6d56.) 2024-08-12 13:44:58 -07:00
rogerman 3db6d5676c OpenGL Renderer: Do some more code cleanup and tune-ups.
- In the 3.2 Core Profile and ES renderers, synchronization of vertex info uploads now occurs at a more reasonable time.
- Geometry rendering is now Y-flipped by default, eliminating the need to Y-flip the final output framebuffer under all conditions.
- Legacy OpenGL no longer needs to perform any color conversion of the final output framebuffer if FBOs are supported.
- Rename some functions and variables to better describe what things are doing now.
2024-08-12 11:23:23 -07:00
rogerman 9bbfca527a Remove redundant and currently unused Makefile. 2024-08-10 15:53:25 -07:00
rogerman 04f97d5755 OpenGL ES Renderer: Fix a major performance bug on many ARM-based mobile devices with integrated GPUs. 2024-08-10 15:06:30 -07:00
rogerman ea648f7110 OpenGL Renderer: Do some minor tune-ups.
- Remove some methods in OpenGLRenderer_2_0 and OpenGLRenderer_2_1 that have negligible contribution to either performance or code simplicity.
- OpenGLRenderer_1_2, OpenGLRenderer_2_0, and OpenGLRenderer_2_1 are now instantiated with their specific variant IDs.
- Calls to malloc_alignedCacheLine() have been replaced with the more appropriate malloc_alignedPage().
- Do some misc. code cleanup.
2024-08-10 13:48:13 -07:00
rogerman c75c1ce2c3 Linux Ports (All): Update Autotools and Meson scripts to add JIT support for ARM targets.
- Also fixes build errors related to explicitly building SIMD files for colorspacehandler. Don't do it! The proper way is to simply include "colorspacehandler.cpp" alone and let the compiler's preprocessor macros determine which SIMD file to use.
2024-08-09 12:55:13 -07:00
rogerman 2e01c0a840 Linux Ports (All): Update the Code::Blocks project file to add build targets for AArch64. Also do some other misc. updates.
- Release builds now use -Ofast optimization instead of -O3.
- Release builds no longer strip their symbols. This will be needed for profiling and debugging.
2024-08-08 17:34:26 -07:00
rogerman b799d94762 Colorspace Handler: Fix compiling for strict NEON.
- We could always use -flax-vector-conversions, but let's try to stay disciplined for now.
2024-08-08 12:11:20 -07:00
rogerman 176e38ce2f OpenGL Renderer: Simplify the code by removing the references to multiple output shaders, since commit 0c7cb99 has obsoleted them. 2024-08-07 12:20:35 -07:00
rogerman c5ab8a6ef6 OpenGL ES Renderer: Fix a bug where RGBA6665 color output would fail. (Regression from commit de9fc5a.)
- Also update some comments.
2024-08-06 23:48:54 -07:00
rogerman de9fc5ab75 OpenGL Renderer: Remove the additional FBOs that were introduced in commits 60385bd, 8b5ac56, and 3ef9271 in an attempt to fix rendering on old GPUs like the Intel HD 4000. (Fixes #820.) 2024-08-06 21:54:39 -07:00
rogerman 5baeb02754 Cocoa Port: Fix OpenGL context creation on older macOS. 2024-08-03 16:15:02 -07:00
rogerman d7dcc85d87 GTK / GTK2 Ports: EGL contexts running legacy OpenGL no longer require the EGL_KHR_surfaceless_context extension. 2024-08-03 11:14:55 -07:00
rogerman 79f3f94099 GTK2 Port: Set the audio volume in the same way as the GTK port so that the audio volume is consistent between the two ports. 2024-08-03 10:13:41 -07:00
rogerman 9aa2ddfc88 Linux Port (GTK/GTK2): Remove the requirement for libGLX.so when requesting a GLX context since libGL.so is all we need here.
- Also do some minor code cleanup in glx_3Demu.cpp
2024-08-02 12:10:21 -07:00
rogerman 4427b863ad Linux Port (GTK/GTK2): Fix compiling in glx_3Demu.cpp.
- Also fix a typo in egl_3Demu.cpp
2024-08-01 23:02:58 -07:00
rogerman 15f5b169cc Video Filters: Improve performance of Deposterize and XBRZ CPU-based filters. (Based on PR #631.)
- Special thanks to @m42a for the inspiration on this code!
2024-08-01 21:07:24 -07:00
rogerman be51e41c04 Ugh, let's try fixing the last stubborn Meson build script... 2024-08-01 18:00:54 -07:00
rogerman 46990f2d85 Fix some issues with Meson build scripts. (Regression from commit ca566eb.) 2024-08-01 17:51:12 -07:00
rogerman ca566eb11b OpenGL Renderer: Finalize all renderer-client integration to "just work".
- These changes now presume that standard OpenGL and OpenGL ES are mutually exclusive. We will NOT support running a standard OpenGL context and an OpenGL ES context in the same process.
- Clients must explicitly request supporting the OpenGL 3D renderer in their build configuration. Build configurations must define ENABLE_OPENGL_STANDARD (replacing the HAVE_OPENGL macro) or ENABLE_OPENGL_ES. If neither macro is defined, then the OpenGL 3D renderer will be assumed unavailable.
- Meson and Autotools now use better header/library checks for OpenGL functionality with their associated context type.
- Add a new Code::Blocks project file that can make builds for CLI, GTK, and GTK2.
- GTK and GTK2 ports now have the option to run a legacy OpenGL context, a 3.2 Core Profile context, or simply choosing the best context automatically like before.
- GTK and GTK2 ports have GLX and EGL as new context types. OSMesa and SDL have been updated to the latest design pattern.
- GTK and GTK2 ports can now be configured (via Meson or Autotools) to use a GLX, OSMesa, EGL, or SDL context.
- OSMesa contexts are now marked as deprecated. I don't know of anyone who still uses them, and I've never been able to get it to work correctly for years. Now that we have GLX contexts for compatibility purposes, OSMesa contexts are now completely redundant.
- Fix a bug with the GTK port where ancient GPUs without FBO support can still run framebuffers at custom sizes.
- For POSIX ports, move all "avout" and context creation files to the "shared" directory for better file organization.
2024-08-01 17:08:01 -07:00
rogerman 0a78fa2a2b OpenGL Renderer: Fix a few bugs here and there.
- Fix a compiling bug for ES due to missing tokens.
- Fix Fog and Edge Mark feature availability when running legacy OpenGL. (Regressions from commit 0c7cb99 and commit 8b5ac56.)
- glDrawBuffer() now determines its own algorithm at runtime instead of at compile time. This change is being done to be consistent with all of the other Standard vs ES changes.
2024-08-01 00:11:05 -07:00
rogerman 2f177d19a2 Cocoa Port: Update OpenGL renderer integration code to reflect current design patterns. 2024-07-26 14:56:36 -07:00
rogerman 4c90c2d9ee OpenGL ES Renderer: Finalize the last remaining bug fixes so that the ES renderer can work "out of the box".
- Respect the draw buffers ordering rules that are unique to ES.
- Report the actual OpenGL variant being requested when initializing the renderer.
- Add oglrender_deinit() function pointer so that clients can properly handle the destruction of their associated context resources at the correct time.
- Certain internal OpenGL info is now assigned at run time instead of at compile time. This change now allows any of the OpenGL renderers to run side-by-side.
2024-07-26 11:10:50 -07:00
rogerman d6532b9e91 OpenGL ES Renderer: Fix TBO-based polygon state uploading. 2024-07-24 15:28:56 -07:00
rogerman d58c0e9331 OpenGL Renderer: Oops! Fix a compiling issue introduced in commit e2a25e2. 2024-07-23 21:39:07 -07:00
rogerman e2a25e2412 OpenGL Renderer: Fix various rendering bugs.
- Fix a potential unaligned access crashing bug in ES when clear images are to be rendered.
- Fix an ES bug where clear images would fail to render when MSAA is enabled.
- Fix a legacy OpenGL bug where toon table colors were not ignoring their alpha bit, according to GBATEK.
2024-07-23 21:28:15 -07:00
rogerman f323dc464f Windows Port: Fix bug where the OpenGL 3D renderer would fail to initialize at program startup. (Regression from commit 76fe5f7. Fixes #815.) 2024-07-22 22:47:29 -07:00
zeromus 8e77a8d9f1
Merge pull request #818 from cyanea-bt/windows_paths
Windows Port: Fix empty defaults for path settings
2024-07-22 19:43:37 -05:00
cyanea-bt 5754425458 Windows Port: Fix empty defaults for path settings.
(Regression from commit 3511e14. Fixes #817.)
2024-07-23 01:57:59 +02:00
rogerman 12ed7dd054 Colorspace Handler: Fix alpha detection logic in ColorspaceConvert5551To8888_*() and ColorspaceConvert5551To6665_*(). 2024-07-21 21:02:50 -07:00
rogerman 368cd49fb6 OpenGL Renderer: Tighten up some code related to clear image. 2024-07-20 22:54:44 -07:00
rogerman 3ef927100b OpenGL Renderer: Fix some longstanding graphical glitches related to running Edge Mark and Fog with MSAA.
- These graphical glitches are resolved only when running 3.2 Core Profile with the GL_ARB_sample_shading extension, available on all modern GPUs.
- Do some minor optimizations to the Edge Mark and Fog shaders.
- Also fix an FBO attachment bug in legacy OpenGL that was introduced in commit 8b5ac56.
2024-07-20 20:49:44 -07:00
rogerman 8b5ac56d66 OpenGL Renderer: More FBO rework. 2024-07-19 14:38:05 -07:00
rogerman 60385bd099 OpenGL Renderer: Rework how the output framebuffers work.
- The output framebuffers now bind their own FBOs rather than changing draw targets with glDrawBuffer().
- Rework the general FBO management.
- Legacy OpenGL now outputs native RGBA color if FBOs are supported. This should give a minor performance increase on older GPUs.
- The fixed-function pipeline can now flip the framebuffer on GPU. This greatly reduces the CPU usage when doing the final color conversion and gives a significant performance increase on ancient GPUs.
2024-07-18 21:45:00 -07:00
rogerman 811e1de45e OpenGL Renderer: Oops! Roll back some internal test code that accidentally slipped into commit 0c7cb99. 2024-07-18 12:46:11 -07:00
rogerman 3e650f2f73 OpenGL Renderer: Add entry point for glBlendColor, fixing compiling on Windows. (Regression from commit 0c7cb99.) 2024-07-18 12:26:53 -07:00
rogerman 0c7cb99d78 OpenGL Renderer: Greatly simplify the fog rendering pass.
- There is no more need to switch to the working texture as the destination for the fog output. This change will be essential for future commits.
- The dual-source blending method has been obsoleted and removed.
- FBOs are no longer required for the fog feature, easing requirements for ancient GPUs.
- Ancient GPUs may see a small performance benefit due to shader simplification.
2024-07-18 12:17:25 -07:00
rogerman 70fef83ded OpenGL Renderer: Fix bug when the screen wasn't being cleared properly when no polygons are being sent to the renderer. (Regression from commit 241ca96.) 2024-07-16 16:15:47 -07:00
rogerman ff9231bb34 OpenGL Renderer: 16-bit texture data that is converted to 32-bit is now byte-swapped correctly on big endian systems. 2024-07-15 23:09:53 -07:00
rogerman ab1d37a44f Colorspace Handler: Fix compiling on AltiVec systems. (Regression from commit 586aea5.) 2024-07-15 23:07:24 -07:00
rogerman cc0b3ed00d Cocoa Port: Update the OpenGL blitter code to reflect the current code pattern in OGLRender.h.
- Centralize all header includes into OGLDisplayOutput.h.
- Update all extension versions of OpenGL functions/tokens that would be core in OpenGL v1.5.
2024-07-15 16:52:43 -07:00
rogerman 80694cd966 OpenGL ES Renderer: More ES fixes.
- Change the remaining FBO attachments that I missed the last time to use RGBA8 internal format.
- Fix picky ancient drivers that won't accept GL_RED as a texture internal format. It has been changed to GL_LUMINANCE.
- Fix picky ES drivers that demand that the external format used in both glTexImage2D() and glTexSubImage2D() are exactly the same.
- OpenGL ES doesn't support GL_UNSIGNED_SHORT_1_5_5_5_REV for texture data, and GL_UNSIGNED_SHORT_5_5_5_1 is incompatible with our data. So instead, all 16-bit data will be converted to 32-bit LE before uploading it via the textures, and such ES textures will now take GL_UNSIGNED_BYTE format.
- Remove the #include for EGL/egl.h in OGLRender.h, since EGL shouldn't exist at this level of the code stack.
2024-07-15 16:45:21 -07:00
rogerman 586aea5310 Colorspace Handler: Add new functions for 16-bit to 18-bit and 32-bit color conversion, now respecting the 16-bit color's alpha bit.
- ColorspaceConvert5551To8888()
- ColorspaceConvert5551To6665()
- ColorspaceConvertBuffer5551To8888()
- ColorspaceConvertBuffer5551To6665()
- Also rename the existing 16-bit color conversion functions to help further distinguish the functions from one another.
2024-07-15 16:24:02 -07:00
Roger Manuel 4b0805e139
Windows Port: Fix yet another compiling issue related to the OpenGL context. (Fixes #811.) 2024-07-15 10:00:38 -07:00
rogerman 15a6e51739 OpenGL Renderer: Add support for Fog, Edge Mark, and on-GPU framebuffer color conversion for ancient GPUs that have support for shaders and FBOs, but lack support for GL_EXT_framebuffer_blit. 2024-07-14 19:38:29 -07:00
rogerman de62116cc8 Windows Port: Fix OpenGL renderer init failure. (Regression from commit 76fe5f7. Fixes #810.) 2024-07-14 17:22:47 -07:00
rogerman 241ca96cf1 OpenGL Renderer: Fix issues that would throw a GL error.
- glTexParameteri() with GL_TEXTURE_2D_MULTISAMPLE throws INVALID_ENUM when trying to assign a sampler-related state, so these calls have been removed.
- glMapBufferRange() throws GL_INVALID_OPERATION if the buffer size is 0, so check for this condition first.
2024-07-13 10:43:04 -07:00
rogerman aaf88d9f14 OpenGL ES Renderer: More ES tune-ups.
- Any ES-specific error messages are now reported as "OpenGL ES" instead of "OpenGL".
- Explicitly declare the internal format of all textures and RBOs used as FBO attachments as "GL_RGBA8" instead of the generic "GL_RGBA". This may fix some extremely picky ES drivers that would throw GL_INVALID_ENUM if we don't use a sized internal format.
- Hard code the read pixels format as GL_RGBA and the read data type as GL_UNSIGNED_BYTE. It is meaningless to rely on GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE since we are reading from our own FBOs that are hard coded to GL_RGBA8 format.
- Require that OpenGL ES contexts support the GL_OES_surfaceless_context extension, since we are doing offscreen rendering strictly on FBOs only. This extension has been around for a very long time, and so this serves as a kind of compatibility check.
2024-07-12 15:41:09 -07:00
rogerman d480f95d79 Cocoa Port: Fix yet another crash-on-exit bug that could happen when running on an older system. 2024-07-12 12:00:49 -07:00
SimonAfek dd88556d53
CI: update github workflows (#809)
* Update macOS version in build_interface.yml

* Typo fixes in build_interface.yml

* build.yml: Update runner images

* build.yml: Update deprecated actions

* build_interface.yml: Update runner images

* build_interface.yml: Update deprecated actions

* build_interface.yml: Remove unnecessary packages from macOS "brew install" line to address warnings

* build_win.yml: Update runner image + remove vs-version parameter from setup-msbuild action

* build_win.yml: Update deprecated actions
2024-07-11 17:38:52 +02:00
rogerman 00dd6fb97a OpenGL ES Renderer: Use the proper ES extension header, and also avoid double #defining some of the tokens. 2024-07-10 21:53:49 -07:00
rogerman bb3011c262 OpenGL Renderer: Return to a more traditional method of doing texture reads in shaders, effectively removing dependent texture reads where appropriate.
- This change won't affect standard OpenGL on a desktop PC, but may improve performance on lesser GPUs trying to run OpenGL ES.
2024-07-10 16:01:13 -07:00
rogerman 86a29d768a OpenGL ES Renderer: Do some minor changes/fixes.
- Fix a bug where _isShaderFixedLocationSupported wasn't being set to true, causing shaders to fail.
- OpenGL version checks now account for non-compliant ES drivers that contain text before the version number.
- Manually set the default read/draw buffers for all FBOs upon creation. We shouldn't need to do this, since they should always be set later, but just in case...
- Add missing GL_BGRA macro.
- Tidy up the OpenGL naming in some error strings.
2024-07-10 13:59:02 -07:00
rogerman 3a6f2f6dc5 OpenGL ES Renderer: Add a new OpenGL ES 3.0 renderer. 2024-07-09 23:00:27 -07:00
rogerman 0e88f9aa94 OpenGL Renderer: Final changes for OpenGL ES compatibility. 2024-07-09 22:03:33 -07:00
rogerman 384854f6e7 OpenGL Renderer: More updates to the 3.2 Core Profile renderer to be more cross-compatible with OpenGL ES 3.0.
- Add support for fixed locations in shaders for OpenGL 3.3 and later.
- The fog density table texture is now a 2D texture instead of a 1D texture.
- Fix a memory leak where the polygon state texture wasn't being deleted upon the destruction of the OpenGLRenderer object.
2024-07-09 01:18:50 -07:00
rogerman 7dbece1082 OpenGL: Do some minor changes to the 3.2 Core Profile renderer to make it more cross-compatible with OpenGL ES 3.0.
- PBO handling now works via glMapBufferRange() instead of glMapBuffer().
- Polygon states can now be uploaded using plain integer textures. 64k UBOs and TBOs are no longer required.
2024-07-06 16:20:53 -07:00
rogerman 09090e93f9 GFX3D: Change POLYLIST_SIZE to 16384 to ensure proper memory alignment with buffers based on CLIPPED_POLYLIST_SIZE and VERTLIST_SIZE. 2024-07-06 13:58:05 -07:00
rogerman c962c550e7 OpenGL: Handle legacy functions and tokens more gracefully for OpenGL variants that may not have them. 2024-07-05 18:13:43 -07:00
rogerman 76fe5f758c OpenGL: More changes in preparation of OpenGL ES.
- Slightly change the names of attachment defines so that they can be distinguished from the native OpenGL attachment defines.
- The minimum version driver check now accounts for OpenGL ES.
- OpenGLRendererCreate() can now handle any possible OpenGL variant, as declared in the OpenGLVariantID enum.
- Framebuffer read backs may now assigned their format and data type. (Legacy OpenGL assigns the format as GL_BGRA, while 3.2 Core Profile assigns the format as GL_RGBA.)
2024-07-03 16:55:47 -07:00
rogerman ba56bbc7c2 OGLRender_3_2.cpp... try again... 2024-07-03 13:05:43 -07:00
rogerman 3ec0b0c2e1 OpenGL: Continue preparation for adding OpenGL ES. (Related to commit 086980d.) 2024-07-03 13:01:17 -07:00
rogerman fc6ff8edbd GPU: Fix a bug on big-endian systems where setting the backdrop color could cause a crash. 2024-07-02 01:35:10 -07:00
rogerman fe0ae83c40 Cocoa Port: Fix a longstanding, yet rare, crash that may occur when quitting the app. 2024-07-02 00:16:46 -07:00
rogerman d4163a1893 OpenGL: Fix building on Windows and Linux. (Regression from commit 086980d.) 2024-07-01 16:26:46 -07:00
rogerman 086980deaf OpenGL: Start reorganizing stuff in preparation for adding new OpenGL variants, such as OpenGL ES.
- All platform-specific header includes are now centralized in OGLRender.h.
- Remove all ARB and EXT versions of legacy functions (everything pre 3.0). Legacy functions now only reference their core versions.
- Do a some minor code cleanup.
2024-07-01 16:19:05 -07:00
rogerman 76bd1a5e35 Change line-ending style in OGLRender.h from Windows-style CRLF to Unix-style LF. 2024-06-29 14:50:47 -07:00
rogerman 6309a9c6a7 libretro: So apparently, _XOPEN_SOURCE has to be at the top of the file. Hopefully this makes both GCC14 users and Mac users happy. (Related to commit 779606e. Based on PR #793.) 2024-06-07 17:16:53 -07:00
rogerman 779606ec2f libretro: Fix building on Mach-based operating systems, otherwise known as Mac OS X and modern macOS (regression from commit 90d0abd). Based on PR #793. 2024-06-07 16:33:13 -07:00
zeromus ffb8666a8f winport - plumb S9X_JOY_NEUTRAL through inifile:
[Controls]
DigitalizationThreshold=50
2024-06-07 00:24:55 -04:00
zeromus ff6c33a8d6 winport - reduce joystick digitalization threshold from 60% to a more normal 50%. With a too-high threshold, it's impossible to specify diagonals. This is preferable for games without diagonals (else you accidentally crouch when you just meant to walk to the side) instead of 8-way games, so we have to be pretty aggressive about the threshold. But 50 is the more normal choice. 2024-06-07 00:18:09 -04:00
zeromus 90d0abdae0
Merge pull request #792 from atsampson/xopen-strdup
libretro-common: fix implicit declarations
2024-05-13 07:59:48 -05:00
Adam Sampson 738298a9e8 libretro-common: fix implicit declarations
strdup and realpath are only declared by glibc's headers if
_XOPEN_SOURCE >= 500.
2024-05-13 12:47:10 +01:00
zeromus 4a53a30b91 winport - fix bug where desmume would create working directory using some wrong locale encoding and produce a Pok魯n directory instead of using the Pokémon that was already there (fixes #791) 2024-05-12 21:33:49 -04:00
rofl0r 9515af82b2
add an issue template for github (#784) 2024-04-12 21:39:12 +02:00
rogerman bae67e2d0c GPU: Implement the DISPCNT register's ForceBlank bit by clearing the line to white if the ForceBlank bit is set. (Fixes #775.) 2024-03-02 15:18:51 -08:00
Max Fedotov 0a6eca6dce
GTK: hybrid layout support (#773)
* GTK: hybrid layout support
* Fix HUD with new layouts
* Simplify rotoscaled_hudedit logic a bit
2024-02-26 19:12:50 +00:00
Max Fedotov 45738beb88
GTK: make OSD scalable (#769)
* gtk: make OSD scalable

* Scale save slot indicator (oops), make text outlines look smoother, use
larger font when not scaling

* Save and load HUD layout, prefer raster font on low resolution, select
vector font size close to raster one, make OSDCLASS::scale floating point

* Build fix

* Add reset HUD layout action, only require fontconfig if libagg is found.

* Try another font in case we could not locate monospace

* Detect screen bytes per pixel instead of hardcoding it, define
AGG2D_USE_VECTORFONTS if fontconfig is found.

* Different pixel formats are handled by different draw target
implementations
2024-02-14 08:20:57 +00:00
zeromus 6508c2b115 placate -Werror=format-security (probably) (re: #768) 2024-02-01 04:26:38 -05:00
Max Fedotov f2cfd23ef2
gtk: implement GPU scale factor feature (#764)
* [WIP] gtk: implement GPU scale factor feature

* Replace combobox with spin button, fix taking screenshot

* Fix distorted image, add some checks for scale factor value

* Make OSD at least properly visible
2024-01-25 14:28:46 +00:00
rogerman b06537cf51 Cocoa Port: Fix building on Cocoa port related to new files being added in commit 8be30fe.
- Note that this commit ONLY fixes building, but DOES NOT actually add barcode reader support to the Cocoa port just yet.
2023-10-10 13:45:07 -07:00
zeromus 0b027d8cc0
Merge pull request #735 from windwakr/hcv1000-fixes
Slot2: Sega Card Reader fixes
2023-10-07 11:04:03 -05:00
windwakr 8be30fe971 Slot2: Sega Card Reader fixes 2023-10-07 00:35:48 -04:00
zeromus f3dee5d7ac
Merge pull request #733 from windwakr/hcv1000
Slot2: Add Sega Card Reader(HCV-1000)
2023-10-04 20:04:39 -04:00
windwakr 0a34ef8e0b Slot2: Add Sega Card Reader(HCV-1000) 2023-10-04 17:05:01 -04:00
Roger Manuel 7a3b748d77
Fix erroneous copyright date in slot1_retail_auto.cpp (related to commit 8fefb4f) 2023-10-04 09:45:02 -07:00
zeromus 25cbcd255e fix buffer overflow (by one value only) in spu that happened basically 100% of the time a sample ended. whether it corrupted the heap or not is a matter of luck. should fix #717 2023-09-03 06:00:41 -04:00
zeromus 3955480674
Merge pull request #720 from mjunix/master-1
Fix potential index out of bounds
2023-08-05 15:46:28 -07:00
Johan Mattsson ca799e60b7
Fix potential index out of bounds 2023-08-06 00:35:40 +02:00
Johan Mattsson 357ff8a2c5
Fix potential index out of bounds 2023-08-06 00:20:22 +02:00
rogerman 402e9f0a31 Cocoa Port: Add two new Cheat Manager actions, "Enable All Cheats" and "Disable All Cheats", which do exactly as their descriptions would suggest. 2023-08-02 13:50:41 -07:00
rogerman 41e3401765 Cocoa Port: In the Cheat Database Viewer, add the option to ignore any game compatibility checks when adding new cheats.
- At their own risk, this option allows the user to add any cheat from the database to any game that they want, regardless of any potential dangers that may arise from doing so. Use this option responsibly.
2023-08-02 13:23:18 -07:00
rogerman 751ab0255b Cocoa Port: The Cheat Database Viewer now displays the current game's serial and CRC to help users verify the existence of a game in the database file. 2023-08-02 10:53:58 -07:00
rogerman 6c5941689f Cocoa Port: In the Cheat Manager, the "Remove All Cheats" button has been moved into an Actions pop-up menu.
- This change is to help avoid misclicks on the button that may instantly wipe out the user's cheat list.
- The new Actions pop-up menu also exists to incorporate some new cheat list operations that will be coming very soon.
2023-08-02 10:51:00 -07:00
rogerman 35976edb5f Cocoa Port: Conversions between Internal cheats and Action Replay cheats now respect the value length. 2023-08-01 15:18:44 -07:00
rogerman 586c7ee199 Cocoa Port: In the cheat database viewer, make the current game entry's font slightly larger to further differentiate it from the other games. 2023-08-01 10:03:48 -07:00
rogerman e3167110b2 Cocoa Port: Completely redesign the cheat database viewing system with a whole slew of new features!
- Multiple cheat database files may now be opened simultaneously, each in their own individual windows.
- Cheat database files are now fully browsable.
- Game entries are now searchable by game title, serial, and CRC.
- Cheat entries are now viewed in a hierarchical layout, better representing the FAT format of the database entries.
- All cheats within a directory can now be selected or deselected in just a single click.
- Error handling is now more robust, informative, and nicer looking.
- Cheat database files are no longer assigned in DeSmuME Preferences; they are now opened through the "File > Open Cheat Database File" menu.
- Recent cheat database files are now saved, and can be quickly accessed through the "File > Open Recent Cheat Database File" menu.
- It is now possible to remove all cheats at once from the Cheat Manager's cheat list.
2023-08-01 01:41:15 -07:00
rogerman 4e6a7f0424 Cheat System: Fix a couple bugs with CheatDBFile::LoadGameList() when reading the entire database's game list.
- Fix a bug where loading all database game entries from an encrypted database would result in reading gobbledygook.
- Fix a bug where calling CheatDBFile::LoadGameList() for all database game entries would always return 0 entries rather than the actual number of found entries.
2023-07-24 13:46:05 -07:00
rogerman 9bf090b309 Cheat System: Fix a bug where the underlying cheat data would get deallocated earlier than intended. (Regression from commit 0c90e8f.)
- In CheatDBGame, also differentiate between actual entry size vs. working entry size.
2023-07-19 12:22:06 -07:00
rogerman d08a5dc56c Cocoa Port: Update build optimization profiles in Xcode project. 2023-07-18 16:43:15 -07:00
rogerman 6ee942ca5f types.h: Remove an extraneous file inclusion. 2023-07-18 12:10:55 -07:00
rogerman 0c90e8f4e3 Cheat System: Rearchitect the system for loading cheat database files in preparation for adding new features to the database file presentation. Also do a bunch of code cleanup and fix multiple bugs.
- The file description is no longer limited to 16 characters.
- Folder notes are now included in the description strings of exported cheat items. These can be important for cheats that include operating instructions in their associated folder notes.
- Fix a bug where reading the last game entry of the database file would fail.
- Fix a potential bug where reading a game entry from an encrypted database file would fail if the initial entry data resides very close to a 512-byte boundary.
- Fix a bug where deleting a CHEATSEXPORT object without calling CHEATSEXPORT.close() would result in its associated file remaining open.
- Fix a bug where deleting a CHEATSEXPORT object without calling CHEATSEXPORT.close() would result in CHEATSEXPORT.cheats leaking memory.
2023-07-18 11:13:42 -07:00
SimonAfek 50f02ae172
Fix broken macOS interface build (#679)
* Update macOS version in build_interface.yml
* Typo fixes in build_interface.yml
2023-07-12 08:49:01 +00:00
rogerman 0fc3306bfc Cocoa Port: Standardize all Internal cheat direct memory writes (clicking the 'Write Once' button) to write to NDS memory before NDS_exec() is called. 2023-07-08 20:28:01 -07:00
rogerman f240472f5e Cheat System: Standardize memory writes for all cheat types. Most notably, Internal cheats now reset the JIT in the same way as Action Replay cheats do. 2023-07-08 19:52:10 -07:00
rogerman 12347c7cd9 Cocoa Port: Continue refactoring the cheat system code, Part IV.
- Add the following C++ classes: ClientCheatSearcher, ClientCheatDatabase
- Remove the following Obj-C classes: CocoaDSCheatSearch, CocoaDSCheatSearchParams
- Remove duplicate GUI code from EmuControllerDelegate.mm and preferencesWindowDelegate.mm
- All basic functionality for managing game session cheat items, the cheat database list, and cheat search are now managed through CocoaDSCheatManager.
2023-07-07 19:31:26 -07:00
rogerman d00e6355da Cocoa Port: Continue refactoring the cheat system code.
- Add ClientCheatManager C++ class, further reducing dependence on Objective-C code.
2023-07-02 22:54:13 -07:00
rogerman 946f7df9bc Cocoa Port: Continue refactoring the cheat system code.
- Add new ClientCheatList C++ class, further reducing dependence on Objective-C code.
- Making any changes to the cheat list or to any cheat items no longer requires the acquisition of an R/W lock.
2023-06-30 20:04:19 -07:00
rogerman 4e7926eaa1 Windows Port: Fix compiling issue that prevented building. (Regression from commit 7fb5a58.) 2023-06-30 15:58:22 -07:00
rogerman 7fb5a5871b Cheat System: Minor code cleanup and robustness improvements. 2023-06-30 15:13:35 -07:00
zeromus f48aee928c fix bug from 9767f79346 that made the cheat search results list produce strange cheats without 0x02xxxxxx prefix that don't work 2023-06-25 18:24:53 -04:00
rogerman ba83b68b7f Cocoa Port: Begin work on cleaning up and refactoring the cheat system. Also add some quality-of-life improvements to the GUI while I'm at it.
- Add new ClientCheatItem C++ class to handle cheat items, greatly reducing dependence on Objective-C code.
- Remove a bunch of methods from CocoaDSCheatItem and CocoaDSCheatManager that were never used and are no longer planned to ever be used in the new code refactor.
- The Cheat Manager window may now be resized.
- The Action Replay code editor now uses Monaco 13 font instead of the system default font.
- The command for "Enable/Disable Cheats" has been renamed to "Enable/Disable Cheat System" to help clarify that the command affects the entire cheat system as a whole, as opposed to enabling/disabling individual cheat items.
2023-06-23 14:18:02 -07:00
rogerman aeefd86f57 Cocoa Port: In the cheat system code, remove Obj-C dot syntax for object properties to avoid ambiguity with features from other languages. 2023-06-21 14:53:49 -07:00
rogerman b468aee01a Linux GTK Port: Fix compiling issues that prevented building. (Regression from commit aa21454.) 2023-06-20 17:12:53 -07:00
rogerman aa21454373 Cheat System: Do some code cleanup and silence all of the compiler warnings (on Windows and Cocoa ports only).
- Some minor API changes were made, but only Windows and Cocoa were actually tested. Tried to make sure that Linux ports were updated to the new API, but haven't tested it.
2023-06-20 16:44:30 -07:00
rogerman cedc1c9f38 Cocoa Port: Add option for Catmull-Rom sound interpolation in the GUI. Also update tooltips for all interpolation methods to better reflect how they compare to one another. 2023-06-20 14:06:04 -07:00
rogerman 8bba9dc955 Cocoa Port: Due to commit fac70ce fixing FBO issues with older GPUs, OpenGL rendering is now returning to PowerPC Macs. This change effectively reverts commit 4708404. 2023-06-19 18:44:14 -07:00
rogerman 5c805b2de0 Cocoa Port: Fix some compiler warnings. 2023-06-14 13:57:30 -07:00
zeromus 7c2f281d25
Merge pull request #674 from oheikk/fix-audio-volume-resetting
Fix audio volume resetting on posix/gtk
2023-06-08 16:46:43 -04:00
Oskari Heikkinen 941c2e39be Fix audio volume resetting on posix/gtk 2023-06-08 22:47:26 +03:00
zeromus 1bde1c28ac fix non-windows compilation, maybe. could be bugged, didnt test 2023-05-28 14:31:50 -04:00
zeromus 3511e14ac6 winport: path settings support unicode now (fixes #669). old ini files may malfunction since they're now expected to be written with unicode. old ones can't be effectively upgraded (consequence of using obsolete ini file apis). 2023-05-28 14:22:09 -04:00
SimonAfek 3cefa5d78e
Update deprecated GitHub actions v2 (#666)
* Windows CI: Update deprecated github actions

* build_interface.yml: Update actions

* release_tarball.yml: Update checkout action

* build.yml: Update actions
2023-05-20 16:33:23 +01:00
SimonAfek fadd3b6e63 Windows CI: Update deprecated github actions 2023-05-10 13:56:54 +01:00
rogerman bf344e9a3e SoftRasterizer: Perform all calculations using fixed-point math instead of float-based math.
- CommonSettings.GFX3D_TXTHack has been repurposed to switch between fixed-point math and float-based math.
- Fix various rendering bugs that were caused by a loss of Z precision introduced in commit 7751b59.
- In Pokemon Diamond/Pearl, the bug that caused random black dots to appear on the ground has been fixed.
2023-05-04 12:36:49 -07:00
zeromus 1dbbeba3a7 add another mic sample 2023-04-24 15:21:45 -04:00
zeromus 65ec088918 add mic samples. we're gonna start distributing these eventually. 2023-04-23 16:18:51 -04:00
zeromus 6b7559c71b fix alignment of tempMultiplyMatrix and currentMatrix[4] in GeometryEngineLegacySave. Fixes #657. It would be better to fix this perhaps by making NDSMatrix a type that has the alignas(16) put on it while inheriting from std::array<u32,16> perhaps, so this mistake is not possible? 2023-04-21 15:18:32 -04:00
zeromus c97ba8fb16 fix spurious RRX variant selection in several disassembly macros (fixes #652 maybe) 2023-04-10 11:43:46 -04:00
rogerman ab17945377 GFX3D: Obsolete and remove the VERT struct, since OpenGL, and SoftRasterizer are now both receiving their vertex data in fixed-point.
- Also remove the unused NDSVertexf struct. There shall be only one representation of the NDS vertex data, and that shall be the fixed-point values of NDSVertex.
2023-03-06 22:19:09 -08:00
rogerman 952585eaae SoftRasterizer: Read in vertex data data as fixed-point instead of as floating-point. 2023-03-06 21:39:57 -08:00
rogerman be88a0b4c3 Remove superfluous x/y/z names from Vector2s16, Vector2s32, Vector2s64, and Vector2f32 union data types, since it is extremely unlikely that these extra names will ever be used. Just use names "x" and "y", which are the most likely to be used for these kinds of 2-element vectors. 2023-03-06 21:27:47 -08:00
rogerman 4e1ce23982 SoftRasterizer: Do some minor refactoring and code cleanup, and also prepare SoftRasterizer to accept fixed-point vertex data. 2023-03-06 14:35:47 -08:00
rogerman 56251cafd1 GFX3D: Clean up the big-endian compatibility code. 2023-03-03 13:58:37 -08:00
rogerman 111292ff15 GFX3D / SoftRasterizer: Small refactor to use some of the new data types introduced in commit cda8cb5.
- Also make SoftRasterizer's framebuffer out-of-bounds width check more robust.
2023-03-03 13:02:04 -08:00
rogerman 90c8411cbf GFX3D: Fix clear color on big-endian systems. (Regression from commit 97848fc.) 2023-02-28 01:34:27 -08:00
rofl0r dcd1072800 CI: limit autoconf build to 8 processes
hopefully will prevent the OOM killer from kicking in.
2023-02-28 03:07:43 +00:00
rogerman 1daebcd670 Silence some compiler warnings. 2023-02-27 16:36:08 -08:00
rogerman cda8cb5686 Core: Move low-level vector, vertex coordinate, and color data type declarations into types.h so that they can be used universally. Also update the data type names to be more descriptive and have better consistency.
- Add SIMD-float32 data types, and also add macros to track SIMD data-type availability.
- Also fix some bugs where 3D would fail to render on big-endian systems. (Regression from commit a67e040.)
2023-02-27 15:39:17 -08:00
rogerman d9be9c6bf6 Cocoa Port: Silence some compiler warnings. 2023-02-25 12:11:22 -08:00
rogerman a7bdd1e3a9 GFX3D: Remove the mistaken addition of color clamping when converting fixed-point vertex colors into floating-point. Fixes the proper coloring of Princess Peach in the opening sequence of Super Mario 64 DS. (Regression from commit 7751b59.) 2023-02-24 16:01:14 -08:00
rogerman fac70ce98b OpenGL Renderer: Use the fixed-point vertex list data instead of the floating-point based one, alongside other tune-ups.
- To determine polygon facing, use GFX3D's CPoly.isPolyBackFacing instead of using GLSL's gl_FrontFacing. This eases OpenGL version requirements and improves older GPU compatibility a little.
- Also fix a bug where GPUs that support FBOs, but not shaders, were unable to read out their framebuffers properly.
2023-02-24 13:49:07 -08:00
rogerman 37683a708e GFX3D: Y-sorting and writing out vertices to a save state are now handled using fixed-point instead of floating-point, where appropriate. 2023-02-23 13:12:13 -08:00
rogerman 7751b59882 GFX3D: Polygon clipping, viewport transformation, perspective correction, and face calculations are now done in fixed-point instead of floating point. 2023-02-22 22:07:37 -08:00
rogerman e1969c470b GFX3D: Vertex post-processing has been moved from the 3D renderers to GFX3D.
- Specifically, viewport transformation, face calculation, and face culling are now handled in GFX3D, and are now standard behaviors for all 3D renderers. This reorganization makes more sense since the 3D renderers are primarily responsible for rasterization and framebuffer post-processing, rather than for processing geometry.
- As a positive side-effect, the OpenGL renderer gains a small performance improvement as well as better accuracy in face culling.
2023-02-19 20:23:44 -08:00
rogerman 5457932d75 OpenGL Renderer: Fix bug where the Depth L-Equal Polygon Facing option would fail to become enabled when running OpenGL 3.2 or later. (Regression from commit ab38d17. Note that this bug does affect the 0.9.13 release build.) 2023-02-18 16:31:38 -08:00
rogerman cf75e26353 OpenGL Renderer: Silence compiler warnings. 2023-02-18 16:21:44 -08:00
rogerman 97848fce8c GFX3D: Move some last bits of static data floating around in gfx3d.cpp into the GFX3D struct, and then make the instantiation of the struct itself static. 2023-02-18 13:37:17 -08:00
rogerman 92d662cb71 GFX3D: Fix longstanding potential overflows related to polygon lists by reducing POLYLIST_SIZE from 20000 to 16383.
- Historically (ever since commit b1e4934 and commit d5bb6fd), VERTLIST_SIZE (based on POLYLIST_SIZE) could reference an index over 66535, but POLY.vertIndexes has always been an unsigned 16-bit value with a max value of 66535, making for a potential overflow. In practice, an overflow has never happened in the past 15 years because a hardware NDS has a limit of 6144 polygons (or 24576 vertices), and that even a VERTLIST_SIZE of 80000 is way more than plenty to accommodate that. Rather than increasing POLY.vertIndexes to 32-bit, it makes more sense to reduce POLYLIST_SIZE to 16383 to keep VERTLIST_SIZE below 66536. Even with this change, POLYLIST_SIZE and VERTLIST_SIZE should be more than plenty in practice.
- Also, now that we're performing polygon clipping for all client 3D renderers (ever since commit e06d11f), we're finally accounting for the fact that the clipped polygon list size is larger than POLYLIST_SIZE. Client 3D renderers have been updated to now reflect this change and avoid theoretical overflow issues that have never actually happened in practice.
2023-02-18 10:54:02 -08:00
rogerman 86b990f68a GFX3D: The shininess table is no longer a part of SWAP_BUFFERS.
- Since the shininess table is only ever used for vertex generation, it makes no sense for the table to included for the rasterization step. The shininess table has been moved to the NDSGeometryEngine class, which is a class dedicated to just vertex and polygon generation. This reorganization seems more sensible.
2023-02-17 18:32:42 -08:00
rogerman 4a95e9b8d1 GFX3D: Reorder members of the GeometryEngineLegacySave struct to better reflect the actual order of data in the existing save state format.
- Also rename some matrix-related members for better clarity.
2023-02-17 14:01:24 -08:00
rogerman d0d23cce7e GFX3D: Attempt to fix an MSVC compiling issue. (Related to commit 5d6e866.) 2023-02-17 12:00:27 -08:00
rogerman 5d6e8663c4 GFX3D: Finish refactoring geometry engine related stuff into the new NDSGeometryEngine class.
- Also, the vector test has been changed so that the result vector accounts for the 4 sign bits and proper sign expansion on overflow.
2023-02-16 21:58:28 -08:00
rogerman db365e849f GFX3D: Clean up some lighting-related code. 2023-02-16 02:59:05 -08:00
rogerman 79aa5b558e GFX3D: Continue encapsulating stuff into the new NDSGeometryEngine class, mostly focusing on matrix-related things.
- There are two significant behavior changes in this commit that will require further testing.
- Behavior change: Before, MTX_LOAD_4x4 and MTX_LOAD_4x3 commands would update the individual values in the current matrix for each command. Now, these commands will batch the values into a temporary matrix until the temp matrix is complete, and then copy the temp matrix into the current matrix. This now matches the batching behavior that the other matrix commands already do.
- Behavior change: Before, there was a single shared temporary multiplication matrix used to batch the values of incoming MTX_MULT_4x4, MTX_MULT_4x3, and MTX_MULT_3x3 commands, theoretically allowing these commands to be used interchangeably and overwrite values from previous commands until the last command made a completed multiplier matrix. Now, there are 3 separate temporary multiplier matrices, one for each of the MTX_MULT_* commands, which means that each command type must now complete its own multiplier matrix before it can perform a matrix multiply.
2023-02-15 19:59:59 -08:00
rogerman 669f1b05f5 GFX3D: Begin encapsulating stuff into the new NDSGeometryEngine() class.
- Also do some minor misc. code cleanup.
2023-02-15 00:52:23 -08:00
rogerman d03e4a6886 Cocoa Port: In the OpenGL blitter, prevent FBO-related GL calls if FBOs are not available.
- Also silence some compiler warnings.
2023-02-14 23:30:22 -08:00
zeromus d0ed57d1b3 fixed: EMUFILE_FILE eof() on textmode failed on windows (caused .dct files from mac systems freeze process while loading) 2023-02-11 15:59:40 -05:00
rogerman 5831099ebc GFX3D: The Box Test is now performed with integer operations instead of with floating point.
- The integer-based Box Test should be just as good as the old float-based one, as tested by "American Girl: Julie Finds a Way". Of course, there are still bugs compared to a hardware NDS, but we haven't transitioned to rendering with integer-based vertices yet to make a meaningful test possible.
2023-02-10 19:01:16 -08:00
rogerman 624f649acb Oops! Forgot a file. (Related to commit a67e040.) 2023-02-10 18:38:21 -08:00
rogerman a67e040a57 GFX3D: Do some major code cleanup.
- Rename a bunch of variables to better reflect their intended usage.
- Add new data types for organizing 3D vectors and coordinates.
- C functions that are called in response to 3D commands now follow the exact same pattern: “static void gfx3d_glFuncName(const u32 param)”
- Be super explicit about the usage of numeric data types and their typecasts to improve their code visibility.
- Remove implementation-specific ambiguity of right bit-shifting signed numerics (Logical-Shift-Right vs Arithmetic-Shift-Right) in the following functions: gfx3d_glLightDirection_cache(), gfx3d_glNormal(), gfx3d_glTexCoord(), gfx3d_glVertex16b(), gfx3d_glVertex10b(), gfx3d_glVertex3_cord(), gfx3d_glVertex_rel(), gfx3d_glVecTest().
2023-02-10 18:25:21 -08:00
rogerman 242cb63327 GFX3D: Remove POLY struct members that don't need to be swapped. This results in less buffer copying for all POLY lists.
- Also remove Viewer3D_State.indexList. This member is obsolete since Viewer3D_State.gList.clippedPolyList is generated in the same order described by indexList.
- Encapsulate and rename some more lists to make their intended purpose more descriptive.
2023-02-09 00:27:45 -08:00
zeromus 23400431a1
Merge pull request #632 from hjung4/fix/strchr-oob-check
Fix out-of-bounds index access
2023-02-08 12:25:41 -06:00
Henry Jung 0e538b0931 fix: strchr check 2023-02-08 07:54:08 -05:00
rogerman d8ee3480df GFX3D: Clipping functions now take VERT parameters as non-nullable references instead of as nullable pointers where appropriate.
- GFX3D_ClipPoint() (formerly named clipPoint()) now writes directly to the target VERT rather than copying a return value back to the target.
2023-02-06 23:20:46 -08:00
rogerman 9554595948 GFX3D: Various minor tweaks and optimizations, plus code cleanup.
- Most importantly, refactor the GFX3D_Clipper::ClipPoly() method into the standalone GFX3D_GenerateClippedPoly() function, which drops all class member dependencies and is much more straightforward to use.
- Remove the GFX3D_Clipper class. It has been slowly gutted over the years, but the loss of the ClipPoly() method makes the class obsolete, putting the final nail in its coffin.
- Using the new GFX3D_GenerateClippedPoly() function, gfx3d_PerformClipping() operates on the unsorted clipped polygon list directly. This means that the polygon clipping step requires one less buffer copy.
- Clipped polygons no longer retain direct pointers to POLY structs, instead using their index member to reference a POLY struct at a POLY array location. All 3D renderers have been updated to reflect this change.
- Rename a bunch of variables that reference POLY, CPoly, and VERT structs to clearly differentiate them between raw NDS data and our own internally processed data.
- Fix a potential bug in GFX3D_GenerateRenderLists() where sorting clipped polygons would reorder their polygon indices without reordering their other data members along with the indices, causing the data members to desync. OpenGL rendering was immune to this bug, but SoftRasterizer might have possibly seen it. In any case, this fix is the correct behavior.
2023-02-06 17:50:42 -08:00
rogerman 628eb6596a Cocoa Port: Fix some random compiling issues. 2023-02-04 19:33:35 -08:00
rogerman cbbacdbf59 GFX3D: The POLY and VERT structs have been converted to POD-style structs for better data consistency. 2023-02-02 02:19:49 -08:00
rogerman 9273c9ab13 GFX3D: Encapsulate some data into the GFX3D struct, and also do some minor code cleanup. 2023-02-01 16:54:04 -08:00
rogerman a3e84e28c2 Save States: Oops! Fix a bug where 3D vertices were getting double-loaded, causing save state file reads to desync. Fixes #629. (Regression from commit 5426509e.)
- Problems only occurred when LOADING a save state. However, SAVING a save state on commit 5426509e should be okay, so such save states should not be broken.
2023-02-01 15:17:20 -08:00
zeromus 5bcfd2f022
Merge pull request #628 from radioactiveman/master
Fix a few compiler warnings
2023-01-30 16:53:26 -06:00
Thomas Lange ef3f285f95
Fix a few compiler warnings
warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]

Reported by clang 15.
2023-01-30 23:40:50 +01:00
rogerman c9a4d9c4b8 SoftRasterizer: Fix compiling issue for non-SSE2 systems. (Regression from commit 5426509e.) 2023-01-25 19:09:21 -08:00
rogerman 5426509ede GFX3D: Render states and geometry lists are now copied/swapped more consistently on flush. (Related to commit 8438a5a6.)
- Viewports are now processed on VIEWPORT register write instead of being processed at render time.
- CLEAR_DEPTH, CLRIMAGE_OFFSET, EDGE_COLOR, FOG_TABLE, and TOON_TABLE register writes are now handled more consistently.
- The fogDensityTable check for force-drawing clear images in gfx3d_VBlankEndSignal() has been removed. Changes done in commit 8438a5a6 will always causes this check to fail, and this commit will always cause this check to fail. Therefore, this check is now obsolete.
- Change a bunch of GFX3D-related structs from C++ style constructed structs into C-style POD structs.
2023-01-25 18:52:45 -08:00
zeromus be287de623
Merge pull request #627 from RainingChain/fwSettingsMacAddress
Add mac address setting
2023-01-21 16:59:18 -06:00
Raining Chain 9d2ddfa648 Add mac address setting 2023-01-21 17:32:05 -05:00
rogerman f0b0afe18b Colorspace Handler: FragmentColor may now be accessed through a 4-element array, in which elements 0-1-2-3 represent color components R-G-B-A, respectively. 2023-01-19 14:24:35 -08:00
rogerman 2b66e756da Add support for page-aligned variables/arrays.
- Better account for UltraSPARC's unique memory page size.
- malloc_alignedCacheLine() no longer returns 16-byte aligned memory if the architecture is neither 32-bit or 64-bit. Now, the function only returns 64-byte alignment for 64-bit architectures OR 32-byte alignment for 32-bit architectures.
2023-01-19 14:18:58 -08:00
zeromus 8438a5a647 crude hack to fix problem where loadstate could crash if the GPU hasn't ever booted up. see TODO TODO TODO TODO in gfx3d.cpp -- somebody needs to revise the tables so they arent memory mapped but so that they work rather like shininess tables. if they aren't truly latched when the gpu is flushed, then put them in a table anyway and simply reference the live values instead of the latched ones. How to keep from accidentally referencing the latched ones? perhaps the 3d state could be divided into a latched part and an unlatched part via base classes. Could also be done by embedding a "latched" and "unlatched" struct in the gpu but that would involve touching every line of code that used something from it. 2023-01-17 23:32:47 -06:00
zeromus 29c077c165 winport - fix issues with save/load state to japanese filename (fixes #615) 2022-12-05 15:54:38 -05:00
zeromus 91efef9346
Merge pull request #602 from KellanClark/master
Fix division edge cases and prevent crash
2022-10-23 21:07:41 -04:00
Kellan Clark b5b7f29255 Fix division edge cases and prevent crash 2022-10-23 20:22:21 -04:00
rogerman 739f3162d5 Cocoa Port: Fix HUD rendering on the OpenGL blitter for GPUs that don't support shaders. 2022-09-15 15:42:12 -07:00
rogerman 698139ed8e saves.cpp: Fix compiling issue for all non-Windows platforms. (Regression from commit 3a6c8cf9.) 2022-08-04 21:26:55 -07:00
zeromus 3a6c8cf9f8
Merge pull request #523 from Keppl/backup_saves_max_patch
Limit maximum number of backups files for load state backup
2022-08-04 17:33:43 -04:00
zeromus 3614b45a6c
Merge pull request #575 from janisozaur/update-default-joystick-size
Update default joystick cofiguration size in line with #567
2022-08-04 17:32:25 -04:00
Michał Janiszewski 83396a88c0 Update default joystick cofiguration size in line with #567 2022-08-04 20:52:15 +02:00
zeromus 35d7561fd7 make hud editor actually save position (fixes #572) 2022-07-30 16:47:43 -04:00
rogerman 5ab59eac86 FIFO.cpp: Code cleanup; remove AltiVec-specific code from display FIFO, as it is no longer needed.
- The new code works by pre-swapping big-endian words on disp_fifo.buf write, rather than swapping the big-endian words during disp_fifo.buf read.
- There is a behavior change here. Before, 8-bit and 16-bit writes to disp_fifo.buf would increment disp_fifo.tail. Now, 8-bit and 16-bit writes only increment disp_fifo.tail when the most significant bit within the FIFO value's 32-bit boundary is written to.
- Behavior is unchanged when doing 32-bit writes. In practice, the rare games that use display FIFO have only ever done 32-bit writes, so this scenario is well tested.
2022-07-21 15:31:40 -07:00
zeromus f8a7723e86
Merge pull request #569 from janisozaur/patch-3
Remove self-reference in variable declaration
2022-07-21 15:30:04 -04:00
Michał Janiszewski f07cd5bae2
Remove self-reference in variable declaration 2022-07-21 12:57:49 +02:00
rofl0r b7dadd1797 CI: also upload linux cli/gtk2 build artifact 2022-07-20 21:09:45 +01:00
rofl0r 2664b03d93 CI: add build job for linux/GTK2 2022-07-20 21:09:45 +01:00
rofl0r b27b31c57d posix: properly fix size mismatch of keyboard/joystick_cfg arrays
fixes #563

unlike #566, this also fixes the gtk2 frontend automatically.
2022-07-20 21:09:11 +01:00
zeromus 22fd8b231d
Merge pull request #566 from janisozaur/patch-1
Fix #563: mismatched buffer sizes for memcpy
2022-07-20 12:04:19 -04:00
zeromus 16e7c126e2
Merge pull request #564 from janisozaur/fix-use-of-internal-buffer
Fix use of internal storage of temporary buffer
2022-07-20 12:03:52 -04:00
Michał Janiszewski a84a48dc75 Fix #563: mismatched buffer sizes for memcpy 2022-07-20 14:53:55 +02:00
Michał Janiszewski d107562a16 Fix use of internal storage of temporary buffer
The entry index gets converted to a (temporary) string, from which a
pointer to internal data is taken and only consumed outside the loop,
where parent variable no longer exists.
2022-07-19 13:43:53 +02:00
rofl0r 677c6bb907 gtk3/gtk2: fix mismatched types for keyboard config temp storage
fallout from c68cc14, closes #558
2022-06-28 22:16:13 +00:00
rogerman 146a6ac655 Preemptively fix a compiling issue for AltiVec systems when using GCC without running keyword-and-predefine mode. 2022-06-27 12:10:56 -07:00
rogerman 640a1fdd93 Fix yet another compiling issue on GCC for AArch64. Fixes #556. 2022-06-25 15:01:21 -07:00
rogerman d4afd4977c libretro-common: Compiling tune-up for ARM architectures.
- Fixes a mismatched register warning in arm_enable_runfast_mode() when compiling for AArch64.
- Fix compiling check_arm_cpu_feature() on non-ARM architectures by being super explicit and pedantic about checking for __ARM_ARCH; none of this compiler-assumes-a-macro-equals-zero-if-undefined stuff.
2022-06-20 11:22:26 -07:00
rogerman a95e4c57c6 Remove AltiVec compiling for ppcle and ppc64le architectures, since our AltiVec code only works on big-endian systems anyways. Fixes #550. 2022-06-19 20:36:50 -07:00
rogerman 24eb5ed95c Fix compiling on GCC for AArch64. Fixes #548. 2022-06-18 21:56:25 -07:00
zeromus a3499803ac
Merge pull request #532 from Aikku93/patch-3
Check `gameCode==####` for homebrew
2022-06-17 14:28:27 -04:00
zeromus 1ccbf52246
Merge pull request #546 from Aikku93/spu-enhanced-interpolation
Enhanced interpolation, and fixed-point sample positions
2022-06-16 15:16:25 -04:00
Aikku93 09f7ab13c7 fix overflow problems
Catmull-Rom can give outputs greater than 16bit, so we must use 15bit precision. Also, ensure to use floor() to force a round-down regardless of host rounding behaviour.
2022-06-13 16:44:24 +10:00
Aikku93 aa25e1dd54 tighter bounds on interpolation accuracy 2022-06-13 15:14:54 +10:00
Aikku93 589084ec74 Split 64bit counters into 2x32bit
This appears to generate slightly saner code
2022-06-13 14:28:44 +10:00
Aikku93 41edf7be5e fix broken adpcm 2022-06-12 20:10:26 +10:00
Aikku93 235d9efea7 attempt to fix for macos 2022-06-12 19:33:09 +10:00
Aikku93 b2c4d449ca fix PSG square wave
Was reading the wrong part of GBATek
2022-06-12 19:03:48 +10:00
Aikku93 6215418dc7 sampcnt/sampinc as .32fxp, add catmull-spline interpolation 2022-06-12 18:36:37 +10:00
zeromus 48f5a8289d attempt to fix some problems caused by users running desmume out of directories with non-english characters (could manifest as "could not get read/write access to the battery save file") 2022-06-04 20:35:53 -04:00
Lino5000 b2ad722473 CLI: Re-work KEYDOWN handling to allow both shift keys as control inputs
Right Shift is the default for Select key.
2022-05-31 11:37:54 +00:00
Lino5000 c68cc14f16 Fix Linux CLI keyboard input bug due to mismatched types 2022-05-31 11:37:48 +00:00
rogerman ba05516b7d Cocoa Port: When dealing with file paths, replace instances of [NSString cStringUsingEncoding:NSUTF8StringEncoding] with [NSString fileSystemRepresentation] and [NSFileManager stringWithFileSystemRepresentation:].
- This commit doesn't actually do anything, but it is the "proper" way for Apple OSes to deal with file paths that interact with lower-level C file functions.
2022-05-30 13:25:20 -07:00
zeromus 416b08d6f7
Merge pull request #537 from colton5007/patch-1
Fixed GBA SRAMPath in posix CLI
2022-05-29 02:45:25 -04:00
colton5007 bc85e0b165 Fixed GBA SRAMPath in posix CLI 2022-05-29 01:04:42 -05:00
rogerman b82c3d7bce GFX3D: The box test now partially works in fixed-point.
- Specifically, the vertex calculations are performed using fixed-point. However, clipping still occurs using floating-point.
2022-05-24 12:02:27 -07:00
rogerman 3632142547 JIT (ARM): Make the code a little more portable, and also silence a couple compiler warnings. 2022-05-23 16:08:06 -07:00
rogerman 356fe47df7 GFX3D: GEM_TransformVertex() now uses the SIMD-optimized generic matrix functions instead of using its own scalar-only version.
- This change results in a small, yet measurable, performance improvement.
- Note that this change has the side-effect of enabling saturation logic for the following functions: MatrixMultVec3x3(), MatrixTranslate(), MatrixScale(). This is a change in their behavior, since these functions did not perform saturation logic before. This will need additional testing.
2022-05-23 15:53:05 -07:00
rogerman d757d83b3d GFX3D: The position test and the vector test are now performed using fixed-point instead of floating-point. 2022-05-23 15:29:57 -07:00
rogerman 95b824b541 Cocoa Port: Update version number to support version bump from commit 60714f6d. 2022-05-23 15:19:55 -07:00
zeromus 60714f6d22 bump version to 0.9.14 for future interim builds. 2022-05-23 18:10:07 -04:00
zeromus d9479cd6d3 update make_scmrev.h.js for modern times by searching for 64bit git on 32bit msbuild/devenv 2022-05-23 18:03:42 -04:00
zeromus 75230bfe0a fix support link in help menu 2022-05-23 18:03:18 -04:00
Aikku93 aa2a5f2a34 check `gameCode==####` for homebrew 2022-05-23 18:35:25 +10:00
rogerman 08b6fade0b Documentation: Update all URLs to match.
- Also fix a bug in the Cocoa port with copying the troubleshooting info to the Clipboard.
2022-05-22 21:37:41 -07:00
zeromus b66ac3b1db update README 2022-05-23 00:20:22 -04:00
Roger Manuel bfb693ff75
Update Cocoa section of ChangeLog 2022-05-22 21:03:39 -07:00
rofl0r 00684566dd changelog: update linux notes 2022-05-22 23:28:03 +00:00
zeromus c48583675b take a stab at a core and windows changelog 2022-05-22 17:23:19 -04:00
zeromus 0193ba3b02 windows - bump version number to 0.9.13 2022-05-22 17:20:53 -04:00
zeromus 0140eceabd
Merge pull request #531 from Aikku93/patch-2
Decide `hasSecureArea` from `DecryptSecureArea()`
2022-05-22 15:09:35 -04:00
zeromus 8940b33c9c
Merge pull request #529 from Aikku93/patch-1
Allow scanDir() to operate when fatDir is empty
2022-05-22 15:09:00 -04:00
Aikku93 669783439f decide hasSecureArea from DecryptSecureArea()
This avoids some issues when loading homebrew that has CRC16 != 0.
2022-05-22 21:16:45 +10:00
Ruben f769f439dd
Allow scanDir() to operate when fatDir is empty
The only time we need fatDir to be not-empty is when we are using a custom FAT directory (ie. `slot1_R4_path_type/sameAsRom == false`). When we are using the ROM path (`slot1_R4_path_type/sameAsRom == true`), fatDir is not even used, and we should be able to load the FAT image.
2022-05-22 17:50:22 +10:00
zeromus 76357662be delete this old retroarch-provided arm-arm jit. nobody can build it. we have officially supported arm jits now, years newer vintage. use those instead. 2022-05-22 01:10:13 -04:00
rogerman 0346f7b946 Cocoa Port: Bump version number to 0.9.13. 2022-05-21 19:41:57 -07:00
zeromus 105a7f639d
Merge pull request #527 from rofl0r/release_action
CI: add action to create release tarball
2022-05-19 16:24:08 -04:00
rofl0r 8c26417d49 CI: fix tag naming scheme in release 2022-05-19 20:20:23 +00:00
rofl0r 204c58d81f CI: add action to create release tarball 2022-05-19 20:02:45 +00:00
rogerman 0c568fd6ac MMU: BGnX and BGnY registers written in 16-bit mode now write to the correct byte locations on big-endian systems.
- Fixes the Y-offset of drawn levels in Bubble Bobble Revolution classic mode on big-endian systems.
2022-05-19 00:19:30 -07:00
rogerman a5860aae8e GPU: Fix more rotation-scaling bugs on big-endian systems. 2022-05-18 18:12:23 -07:00
rogerman 92aab4834b matrix.h: Fix some non-working AltiVec functions. This fixes setting the 2D layer's clear color and also setting an all-white/all-black master brightness level for AltiVec systems. 2022-05-18 16:26:08 -07:00
rogerman c904706a6b Cocoa Port: If default.metallib is missing or corrupted in the app bundle, then fail running Metal video output and fall back to using OpenGL instead. 2022-05-18 12:44:00 -07:00
rogerman 183dd57136 GPU: Fix a long-standing bug with 2D rotation-scale rendering on big-endian systems. 2022-05-18 10:32:06 -07:00
rogerman 9f6ee8c55a Cocoa Port: Fix a rare crash with debug and profiling builds (but not release builds) where Metal display views running CPU-based pixel scalers can make the Metal debugger assert if the pixel scalers are switched very very quickly under low frame rate conditions (less than 30 FPS). 2022-05-17 04:10:27 -07:00
rogerman 1bbb065786 Firmware: Fix a data corruption bug with firmware.dfc that could occur with a rare and specific sequence of events. 2022-05-16 01:30:31 -07:00
rogerman 7cccf90976 Cocoa Port: Fix a crash that can occur when taking a display window full screen while running macOS El Capitan. (Regression from commit ebc39eae.) 2022-05-15 08:21:29 -07:00
rogerman 07aefbd02c Cocoa Port: Fix a possible crash when performing Copy-Framebuffer-To-Clipboard operations on Metal display views. 2022-05-13 18:17:13 -07:00
rogerman 9ed9c0a9e4 Cocoa Port: Use MTLPixelFormatBGRA8Unorm pixel format for all Metal display view pipeline descriptors in order to stop dev+ builds from assert crashing themselves under some very rare and specific situations. 2022-05-13 15:53:13 -07:00
rogerman b565073299 GPU: Fix a drawing bug with display capture when the GPU scaling factor is 4x while running on an SSE2 system without SSSE3. 2022-05-13 02:04:44 -07:00
rogerman cdc1b5bc6d Cocoa Port: Final updates to the Read Me for Macintosh.
- Replace all references to "OS X" with "macOS".
- Make the example bug report reflect a user running Monterey instead of Mojave.
- Simplify the notes regarding a Penryn-era Core 2 Duo as the minimum recommended processor. I forgot that release builds drop the CPU instruction set from SSE4.1 to SSSE3, and so a 2.4GHz Penryn with SSSE3 isn't that much faster than a 2.4GHz Santa Rosa.
2022-05-11 03:15:21 -07:00
rogerman 1fc64eb4fd Cocoa Port: Resort to a more traditional method of performing texture sampling for Metal display view output filters, since the "Metal way" can result in GPU incompatibilities. (Related to commit 56473033 and #476.) 2022-05-10 09:52:56 -07:00
rogerman 5647303305 Cocoa Port: Do a quick-and-dirty attempt at fixing an issue with some output filters when using Metal display views. (Related to #476.) 2022-05-10 04:10:24 -07:00
rogerman 0f6cbffe77 Cocoa Port: Fix a bug where repeatedly using save states in quick succession can cause intermittent failures with HUD rendering when using OpenGL display views. (Regression from commit 3c04e8f4.) 2022-05-09 23:54:28 -07:00
rogerman 6f8c085890 Cocoa Port: Take a shot in the dark at fixing a bug where the video output could intermittently persist after a ROM is unloaded. 2022-05-09 21:59:57 -07:00
rogerman 9a5596ce54 Cocoa Port: Add a quick Troubleshooting section in the Read Me for Macintosh. 2022-05-09 15:58:18 -07:00
rogerman 8fbced9c85 Cocoa Port: Rename the "Intel32 Intel64" build schemes from "Xcode 9" to "Xcode 8" to help reduce confusion in the build documentation and to make things more consistent. 2022-05-09 15:43:26 -07:00
rogerman 38634a7e5c Cocoa Port: Separate the 32-bit Intel and 64-bit Intel Release build targets, and also reenable PGO for all Release build targets. 2022-05-08 00:59:27 -07:00
rogerman d9c912d7fd Cocoa Port: Fix a bug where mipmapped HUD font rendering would fail on very small non-Retina displays. (Regression from commit 180df28c.)
- As a positive side-effect, this fix also allows mipmapped HUD font rendering to work on the OpenEmu plug-in, so that capability has now been enabled.
2022-05-08 00:12:20 -07:00
rogerman 25643e5f82 Cocoa Port: Fix a compiliing issue with Xcode 3. (Regression from commit ebc39eae.) 2022-05-08 00:05:04 -07:00
rogerman 4976f57b0c Cocoa Port: Update Read Me for Macintosh. 2022-05-07 16:35:49 -07:00
rogerman 069b26aa4c Cocoa Port (OpenEmu Plug-in): Remove a now defunct comment. 2022-05-07 13:51:06 -07:00
rogerman 75e9697c5d Cocoa Port: Update copyright year. 2022-05-07 12:10:45 -07:00
rogerman 9c3e206fed Cocoa Port (OpenEmu Plug-in): Changing a single display mode no longer applies all settings each time. Now, individual settings are applied only if the relevant state bits were actually changed.
- This change helps make display view resizing smoother.
2022-05-07 11:33:02 -07:00
rogerman 289c68fae8 Cocoa Port: Tweak the "View" menu in the standalone app and the "Display Modes" menu in the OpenEmu plug-in to better match each other. 2022-05-06 20:08:40 -07:00
rogerman 3c04e8f4c7 Cocoa Port (OpenEmu Plug-in): Add OpenGL as an option for the emulated GPU rendering engine.
- Now that we can use OpenGL, we can increase the 3D render scaling to up to 8x for machines that can handle it.
- Also add the Fragment Sampling Hack option for SoftRasterizer for certain games that need it to 'fix' texture rendering.
- Also add the Smooth Textures option for OpenGL for games that can benefit from it.
2022-05-06 18:23:52 -07:00
rogerman e90ac6cc43 Cocoa Port (OpenEmu Plug-in): Fix a crash with HUD rendering when running on macOS Monterey.
- So apparently, the buffers used to upload the font texture data must remain in memory for the entire lifetime of the texture when running on Monterey. It is a mystery why the OpenEmu plug-in requires this for Monterey, as this is not required for older macOS versions, nor is it required in any way on the standalone app.
- Also remove the copy of the HUD font path. Since we're now copying the font file itself into memory, retaining a copy of the font path is no longer necessary.
2022-05-06 03:12:01 -07:00
rogerman 0a6aee6421 Cocoa Port (OpenEmu Plug-in): Add support for higher 3D rendering resolutions (up to 4x) with texture upscaling.
- Brings back compatibility for OpenEmu v1.0.4. (This was done because the v0.9.11 could run on it. Note that the advanced display features still require the latest OpenEmu version.)
- Also fixes issues with HUD font rendering.
2022-05-05 22:31:13 -07:00
rogerman dce04f722f Cocoa Port: Rename class "GPUEventHandlerOSX" to "GPUEventHandlerAsync".
- Also make a stub class of GPUEventHandlerAsync to better control some multithreaded stuff in the OpenEmu plug-in.
2022-05-05 14:32:00 -07:00
rogerman 180df28ce7 Cocoa Port: Improve the handling of HUD font rendering for OpenGL display views running on old drivers. 2022-05-05 14:29:53 -07:00
rogerman 6e26980d87 Cocoa Port (OpenEmu Plug-in): Do a complete revamp of the OpenEmu plug-in, giving it the same performance level as the standalone app, plus most of the video display options as the standalone app!
- Includes native binaries for Intel 64-bit, Intel 64-bit Haswell, and ARM64.
- The Dynamic Recompiler engine for ARM64 processors is now enabled by default, greatly increasing performance on Apple Silicon Macs.
- Now includes the full suite of dual-screen display layouts, screen rotations, display gap options, and so on.
- The Heads Up Display is now included.
- Can use the latest features of OpenEmu v2.3.3 running on macOS Monterey, but is also backwards compatible with OpenEmu v2.0.9.1 running on macOS El Capitan.
- Also includes general stability improvements.
2022-05-03 13:24:24 -07:00
rogerman cc530c7a38 Cocoa Port: Display presenter objects now cache the font file in memory, just in case a bad client decides to repeatedly force the reloading of the font. (cough... OpenEmu view resizing... cough) 2022-05-03 04:21:34 -07:00
rogerman ccfd5a5a55 Cocoa Port: Fix a theoretical crash that may occur on app exit.
- This doesn't actually happen in practice, but its good to fix this anyways.
2022-05-03 04:17:30 -07:00
rogerman e2373bc5ff Cocoa Port: Calculate the execution speed less often, but more accurately.
- Also fix a theoretical memory leak with the Video FPS timer.
2022-05-03 04:16:06 -07:00
rogerman e25fd2e8c5 Cocoa Port: Restore the HUD visibility state of an OpenGL presenter if it ever needs to be reinitialized. 2022-05-03 04:11:41 -07:00
rogerman 7239c6cfd6 Cocoa Port: Small refactor to make the ClientDisplayViewInterface::GetNDSPoint() method always available. 2022-05-02 16:10:38 -07:00
rogerman 0e42f772bc Cocoa Port: Refactor a few things. 2022-04-29 12:04:49 -07:00
rogerman ba630ee278 JIT (ARM): Fix for transformers 32bit JIT, corrects shifts in 64bit jit on non condition shifts
- Special thanks to @byte4byte for these fixes.
2022-04-28 10:02:22 -07:00
rogerman a276d8c29c JIT (ARM): Fixes a rendering bug in the SVatGLovesYou demo.
- Special thanks to @byte4byte for the fix. His notes: "Fixed rrx shifts"
2022-04-27 22:58:53 -07:00
rogerman a72134539d JIT (ARM): Fix bug that prevented the Titan LMNTS Demo homebrew ROM from starting up.
- Special thanks to @byte4byte! His notes: "Fixed cmp operands, Fixes titan homebrew rom"
2022-04-27 18:08:34 -07:00
rogerman ebc39eae64 Cocoa Port: Major code refactor to the video display system with the purpose of breaking up multipurpose classes of homogenous data into more focused classes.
- Also removes unnecessary Objective-C code and converts it into C++. Objective-C has its place, but not at this level of function.
2022-04-27 17:02:04 -07:00
rogerman 908a53e85a JIT (ARM): Fix graphical glitches in "Diddy Kong Racing" and "Pokemon Ranger".
- Special thanks again to @byte4byte for this fix. His notes: "Fixes for shifting. Fixes diddy kong racing & pokemon ranger text".
2022-04-27 11:24:59 -07:00
rogerman 88f2dfdb53 Cocoa Port: Fix a longstanding bug where OpenGL video blitter would fail to render to window correctly on Retina displays. 2022-04-27 04:52:25 -07:00
rogerman cfa75df069 JIT (ARM): Fix audio issues with "Chronicles of Narnia: The Lion, the Witch and the Wardrobe". Also fixes incorrect colors in "Transformers: Decepticons" opening movie.
- Special thanks to @byte4byte for this fix. His notes: "Corrected OP_SMxxW_ arm64 instructions, fixes narnia & transformers".
2022-04-26 13:34:39 -07:00
rogerman 2ab69da5e2 JIT (ARM): Fix bugs that caused "Alice in Wonderland" and "Sonic Chronicles: The Dark Brotherhood" to fail to start.
- Also fixes ultra slow text timing in "7th Dragon".
- Special thanks to @byte4byte for this fix. His notes: "Fixed issue with sbc&adc reg and mvns".
2022-04-25 11:18:23 -07:00
rogerman 0b0bee78cc Cocoa Port: Remove the dev+ requirement for Dynamic Recompiler on ARM CPUs. The Dynamic Recompiler option is now available for users running Apple Silicon Macs! 2022-04-24 14:56:07 -07:00
rogerman b1ee7e80d5 JIT (ARM): Fix a crash when resetting the emulator. Also fixes a memory leak. (Related to commit f12a70f4.) 2022-04-24 14:11:33 -07:00
rogerman f12a70f4b7 Add a brand new JIT CPU emulation engine for ARM! Special thanks to user @byte4byte from byte4byte.com for making this new feature!
- If you have an ARM processor, expect anywhere between 10% to 50% improvement to CPU emulation performance for most games.
- But it isn't quite for prime time just yet. There is a crashing bug related to munmap() at emit_core.cpp:93 that causes the app to crash when resetting the emulator after a game has already been run.
- The Cocoa port now enables the new ARM JIT engine for Macs running Apple Silicon processors, but only for dev+ builds. This is due to the crashing bug noted above.
2022-04-23 20:00:30 -07:00
rogerman 2e95dda3f5 Cocoa Port: Fix some memory leak issues, especially apparent when running Metal display views. 2022-04-22 18:23:46 -07:00
rogerman 57dd000496 Cocoa Port (OpenEmu Plug-in): Add arm64 binary. 2022-04-22 12:12:05 -07:00
rogerman cd0cc31505 Cocoa Port (OpenEmu Plug-in): Remove [OEGameCore changeDisplayMode] deprecation in favor of the latest display mode API. (Related to commit 452c3340.)
- Also sets things up for adding new display modes in the future.
2022-04-22 04:03:43 -07:00
rogerman 452c33405c Cocoa Port (OpenEmu Plug-in): Update DeSmuME's OEGameCore to the latest version of the OpenEmu SDK.
- There should be no functional changes in this commit. We're simply mirroring the latest SDK for changes to come.
- Fix all deprecations, with the exception of [OEGameCore changeDisplayMode]. This one will be quite involved.
2022-04-21 11:13:04 -07:00
rogerman 4708404734 Cocoa Port: Disable OpenGL 3D renderer for PowerPC Macs. Also update some tooltips to reflect new app behavior based on previous commits. 2022-04-20 22:34:25 -07:00
rogerman 53dd630ea5 Cocoa Port: Remove the menu options "Emulation > Show Wi-Fi Settings" and "Tools > Show AV Capture Tool".
- The features contained therein aren't ready for prime time, and so they are being pushed out to the next release.
- These menu options are still accessible on dev+ builds.
2022-04-20 18:43:27 -07:00
rogerman 725ffb5127 Cocoa Port: Be a lot cleaner about commenting out non-working code. 2022-04-20 18:31:22 -07:00
rogerman ab38d17fea OpenGL Renderer: Fix rendering on very very very old GPUs, such as the ATi Mobility X1600 (circa 2006).
- This change basically returns us to using 1D textures for color LUTs instead of using uniform arrays. 1D textures seem to be more compatible for most older hardware.
- Unfortunately, while most older GPUs will work better with this change, this may break the OpenGL renderer on even older GPUs, such as the GeForce 7800 GT (circa 2005).
- I'm estimating that more old GPUs benefit from this change than not, and so using 1D textures is what will stand. The vast majority of users will be using hardware newer than this, and so anyone who can't run OpenGL renderer in 2022 can just switch to SoftRasterizer.
2022-04-20 18:24:07 -07:00
rogerman 45a2f424e6 matrix.cpp: Remove saturation logic from MatrixMultiply(), as this causes characters to disappear during "Kingdom Hearts: Re-coded" character conversations.
- This bug was found by enabling FIXED_POINT_MATH_FUNCTIONS_USE_ACCUMULATOR_SATURATE. Since this macro is disabled by default, this commit should not affect any normal operation.
2022-04-18 23:29:21 -07:00
rogerman 803c885ef2 Cocoa Port: Rollback strong linking of Metal.framework for the x86_64h Final Release build. (Related to commit d0d0f62d.)
- Apparently, there are some Macs that have Intel Haswell CPUs that can run macOS versions earlier than El Capitan, so Metal.framework must be weak-linked for the Final Release.
- All x86_64h Debug builds and all Apple Silicon builds still retain strong linking with Metal.framework.
2022-04-18 17:00:50 -07:00
rogerman d0d0f62d4d Cocoa Port: Strong link Metal.framework for builds that can support it. 2022-04-18 16:46:20 -07:00
rogerman 42da2645c1 Cocoa Port: Fix a bug where the troubleshooting form text would not switch to Dark Mode appearance. 2022-04-18 15:32:06 -07:00
rogerman 864d419513 Cocoa Port: Use [MTLDrawable present] instead of [MTLDrawable presentAtTime:]. Does this reduce microstuttering even further? 2022-04-18 14:54:54 -07:00
rogerman bd030db03f Cocoa Port: Use a std::queue to keep track of Metal drawable ordering.
- This is probably super paranoid and completely overkill, but it makes me feel better to do this. Now there is absolute certainty that nothing can disrupt the drawable order in between rendering and presentation. Microstuttering from mis-ordered drawables can no longer happen.
2022-04-18 13:20:41 -07:00
rogerman 32461006d9 Cocoa Port: Fix bug where CPU-based video filters would cause wonky colors on PowerPC Macs. 2022-04-18 10:03:09 -07:00
rogerman a758e3f0df Cocoa Port: In DeSmuME Preferences, increase the size of the Input Preferences view from 640x495 to 800x540. 2022-04-16 21:50:39 -07:00
rogerman 84e98a0c49 Cocoa Port: Fix some bugs related to macOS Mojave's Dark Mode.
- Fix a bug where running DeSmuME on a Mac with a non-Haswell 64-bit Intel CPU would fail to switch the GUI icons into Dark Mode, despite the user running Mojave or later.
- Fix a bug where the GUI icons would occasionally fail to correctly switch between Light Mode and Dark Mode if the user changed the system appearance in System Preferences while running Mojave or Catalina.
- Add a new menu option in "Tools > App Appearance Mode" to manually force DeSmuME's app appearance to reflect Light Mode or Dark Mode. (Only available on dev+ builds.)
2022-04-16 20:58:10 -07:00
rogerman 680b3c16a3 Cocoa Port: Troubleshooting forms for Public Release builds now display the same detailed app build info as the other builds.
- Since the executable can now contain 5 binary slices, having the detailed info available can provide extra insight on the user's runtime environment.
2022-04-16 20:40:33 -07:00
rogerman 9035c193c8 Cocoa Port: The microphone and speaker icons now adapt their appearance to macOS Mojave's Dark Mode. 2022-04-15 17:30:59 -07:00
rogerman a73705bc50 Cocoa Port: Polish the behaviors for hardware microphone authorization. (Related to commit efa72df1.)
- Hardware microphone authorization is now requested on app startup instead of when a ROM is loaded.
- CoreAudioInput is now better at handling situations when the hardware mic is not available, fixing some bugs with the mic level indicator.
- Add some helpful tooltips in the Microphone Settings panel when the hardware mic is not authorized.
- Add a new idle mic icon to denote when the hardware mic is not available. (The gray color should denote a 'software only' status.)
- Further brighten up the microphone icon for when software samples are active to help with visibility when running Dark Mode.
2022-04-15 12:34:05 -07:00
rogerman 02d8f0aa4d Oops! Forgot to commit a file. 2022-04-14 16:02:47 -07:00
rogerman 899ab48d78 GFX3D: Rework how matrix stacks are initialized in an attempt to get MSVC to successfully build Win32.
- Access to the matrix stacks has been simplified to the point where MatrixStackInit() and MatrixStackGet() are now obsolete. These functions have been removed.
2022-04-14 15:53:15 -07:00
rogerman 965419d7ca Cocoa Port: Add new microphone and speaker icons in preparation of adding support for macOS Mojave's Dark Mode.
- Also adds the AVFoundation framework to the "Xcode (Latest).xcodeproj" file in preparation of new UI related to dealing with macOS Mojave's microphone permissions.
2022-04-14 13:55:18 -07:00
rogerman 2645a69005 matrix.cpp: Simplify the NEON functions by replacing separate multiply and add instructions with combined multiply-accumulate instructions.
- Also simplify the __mtx4_multiply_mtx4_* functions by removing duplicate code.
2022-04-13 23:29:34 -07:00
rogerman efa72df171 Cocoa Port: Fix microphone permissions when running macOS v10.14 Mojave and later. (Fixes #475.)
- Also fixes another bug where the microphone level indicator won't update when running macOS v10.14 Mojave and later.
2022-04-13 17:31:40 -07:00
rogerman 2113af2994 Cocoa Port: Update the microphone level once every 4 frames instead of once every 8 frames. This makes the level indicator appear smoother. 2022-04-13 17:24:23 -07:00
rogerman 7c90bc592f Cocoa Port: Fix broken settings sheets for Input Preferences when running on pre-Mavericks macOS. (Regression from commit e9b3998f, also related to commit 8f20237c.) 2022-04-13 15:42:25 -07:00
rogerman 46a8c2385a Cocoa Port: Rename one more instance of "OS X Core Audio" to "macOS Core Audio". (Related to commit 62f78f2f.) 2022-04-13 11:42:40 -07:00
rogerman 8d1188f552 matrix.cpp: Add NEON versions of geometry engine math functions.
- Also do some minor bug fixes with some floating-point functions.
- Also remove __vec4_dotproduct_vec4_fixed_SSE4() since the function didn't work anyways, and since we now have __vec4_dotproduct_vec4_fixed_NEON() to use as an actual working reference.
2022-04-13 02:03:12 -07:00
rogerman b608a62cd0 matrix.cpp: Major cleanup and refactor. All previous functionality and behavior should be retained.
- This refactor was done to support future additions of SIMD functions using ISAs other than SSE / SSE4.1.
- Add support for fixed-point math functions using accumulators that saturate, following the GEM_TransformVertex() function. This feature requires new testing, and has been disabled for now in order to retain the previous behavior.
- Remove the obsolete and unused functions _MatrixMultVec4x4_NoSIMD() and vector_fix2float(). If non-SIMD testing is required, it should be easy enough to comment out the SIMD code paths in the appropriate function in favor of the plain C code path.
2022-04-12 17:33:20 -07:00
Keppl 631f2a265e Added check that index file was actually openned for writing.
If not, skip creating backup part of loading.
2022-04-12 19:07:06 -04:00
Keppl dec93fecfa Added configuration option to define number of max number of backups. Windows only at the moment. 2022-04-11 22:26:16 -04:00
Keppl 970663bf71 Fixed bug when writing index, set default max to 200 2022-04-11 17:59:17 -04:00
Keppl 53be5f6968 Changed loadstate_slot function to keep only 5 latest backups when saving curring state before loading.
Once more than 5 exist, oldest one will be overwritten.
2022-04-10 22:36:10 -04:00
rogerman 2e6b938378 Render3D / SoftRasterizer: Add some more NEON optimizations. 2022-04-08 03:43:07 -07:00
rogerman e8de3db99c Cocoa Port: If OpenGL is the Video Output Engine, then drop the revision number from the engine name in the troubleshooting forms.
- The only OpenGL version with a revision number is v1.2.1, but the Cocoa port will always use v2.0 or higher. So let's remove the revision number to make things look cleaner.
- Also change the tags "DESMUME RUNTIME INFORMATION" to "DESMUME TROUBLESHOOTING INFORMATION", which is more explanatory when the information is copy/pasted into whatever text field it appears in.
2022-04-08 01:27:08 -07:00
rogerman 1490a19ad1 Cocoa Port: Fix a GUI bug where adding or removing an input mapping in Input Preferences may occasionally cause its outline view to fail to update under certain OS/build combinations.
- I solved it by simply reloading the entire outline view instead of picking and choosing specific items to reload. Due to the relatively few amount of items in the outline view (less than 1000 items), reloading the entire outline view is still very fast, even on a PowerPC Mac.
2022-04-07 18:21:30 -07:00
rogerman ed52d0e093 Cocoa Port: dev+ builds from the "DeSmuME (Latest).xcodeproj" file no longer generate MainMenu.strings files.
- MainMenu.strings files can still be generated from builds from the "DeSmuME (XCode 3).xcodeproj" file, which does result in a cleaner file to begin with.
2022-04-07 17:15:00 -07:00
rogerman 62f78f2f24 Cocoa Port: Rename the "OS X Core Audio" audio output engine to "macOS Core Audio". 2022-04-07 17:02:47 -07:00
rogerman 4df869c309 Cocoa Port: Fix a potential crash on startup if Metal is not available. (Regression from commit 6833e315.)
- Also change one of Apple's Metal enums to an older version to fix a compiling issue with Xcode 8.
2022-04-07 16:28:50 -07:00
rogerman 6833e3159d Cocoa Port: Tune up the DeSmuME runtime information in the troubleshooting forms.
- Add line for the Video Output Engine. Backend type (OpenGL or Metal), version, and renderer information are all reported.
- Remove section breaking dashes, as this causes GitHub's comment parser to reformat the runtime info in unpredictable ways.
- To compensate for removing the section breaking dashes, add delimiters for the beginning and the ending of the runtime information.
- If the Active Cheat Count is 0, then just report "NO" for Cheats, as this is functionally equivalent, but less confusing to read.
2022-04-07 13:29:30 -07:00
rogerman 2efb260b44 GPU: Client fetch objects can now have names and descriptions. 2022-04-07 13:17:34 -07:00
rogerman 7c036c1d50 Cocoa Port: Fix bug where Apple Silicon dev+ builds didn't include "dev+" in their app name. 2022-04-07 00:08:03 -07:00
rogerman 31225d0ed1 texcache.cpp: Oops! This file accidentally got sent with the last commit before I could clean it up. All unused development/debugging code has now been removed.
- Here's what the notes should have said: Add SIMD optimized versions of texture unpacking functions. AVX2, NEON, and AltiVec are now supported.
2022-04-06 23:59:56 -07:00
rogerman 28f12cf088 Colorspace Handler: Further optimize NEON code.
- Commit 9ccc791 was, more or less, a straight port of the SSE2 code, making it less than ideal. This updated version uses more NEON-only instructions to further improve performance.
2022-04-06 23:51:29 -07:00
rogerman 27a32d6262 Sigh... partially revert commit e8328ed to make Linux builds happy. 2022-04-06 10:34:26 -07:00
rogerman 42c59d9257 Minor correction related to commit e8328eda.
- If this doesn't fix Linux builds (it probably won't), then I will partially revert commit e8328eda to make it work.
2022-04-06 10:16:49 -07:00
rogerman e8328eda33 GPU: Clean up some old header stuff now that the SIMD code has been factored out. 2022-04-05 23:15:51 -07:00
rogerman c5c9e2d3a7 Colorspace Handler: Pad out some small arrays so that they can be useful for SIMD vector loads. Up to 512-bit vector loads are supported.
- For practical reasons, we shouldn't need to pad out any arrays past 64 bytes any time soon.
2022-04-05 22:28:43 -07:00
rogerman b1d49d14ec matrix.h: Fix compiling on AltiVec-enabled systems. (Regression from commit 8a9fec43.) 2022-04-05 22:12:05 -07:00
rogerman 74cdfeea32 Colorspace Handler: Fix some bugs with NEON.
- These changes shouldn't change existing functionality, but are more to document what the code should actually be doing. Regardless, these changes are truly correct.
2022-04-03 15:34:15 -07:00
rogerman 9ccc791e32 Colorspace Handler: Add support for NEON-A64.
Signed-off-by: rogerman <rogerman@users.noreply.github.com>
2022-04-02 23:47:21 -07:00
rogerman 8a9fec431a matrix.h: stream_copy_fast() for AltiVec and NEON now mirror their associated buffer_copy_fast() functions, replacing memcpy().
- Since stream_copy_fast() and buffer_copy_fast() are intended for small finite-sized buffers only, we shouldn't need a full memcpy() call with these.
2022-04-02 23:43:46 -07:00
rogerman 7e85253ebb Core: Add preliminary support for ARM NEON-A64. The generic memset and buffer_copy functions are now supported.
- Note that NEON support is assuming the A64 instruction set. But if there is enough user demand for running the A32 instruction set, and if it is feasible to backport the NEON code to A32, then this may be explored at a later date. But for now, we are sticking with A64.
2022-04-02 21:33:14 -07:00
Roger Manuel 03be21608e
Update build.yml for macOS nightlies (regression from commit e9b3998f) 2022-04-02 17:36:25 -07:00
rogerman 1f377be17b Core: Do some minor header cleanup. 2022-04-02 17:28:02 -07:00
rogerman a9706059e0 Cocoa Port: Fix AltiVec vec_perm() related bugs if building for ppc64.
- Apparently, vec_perm() on ppc32 assumes that vec_perm() will always use vectors with 8-bit elements. However, ppc64 vec_perm() can use elements of different sizes, and so we need to typecast every single case of this so that the correct vec_perm() is called on ppc64.
2022-04-02 15:57:38 -07:00
rogerman a677ffd168 videofilter.cpp: Silence a compiler warning by initializing the entire SSurface struct instead of just a part of it. 2022-04-02 15:53:03 -07:00
rogerman 8f20237c04 Cocoa Port: Fixes the use of macOS GUI sheets in Lion and Mountain Lion. (Regression from commit e9b3998f.) 2022-04-02 15:40:23 -07:00
rogerman e9b3998fe8 Cocoa Port: Add new build targets for Apple Silicon, and also clean up Release Build targets.
- Apple Silicon builds target macOS 11.0 SDK, so almost all deprecation warning associated with this have also been fixed. (The remaining deprecation warnings in preferencesWindowDelegate.mm still need to be fixed in some other way.)
- Intel 64-bit developer builds now require macOS 10.12 SDK (Xcode 8 or later). Of note, this produces faster SSE4.1 code by default, but also requires a Penryn-era Core2Duo CPU or later. (Note that Intel 64-bit non-Haswell in release builds still use SSSE3.)
- Improves overall stability when running DeSmuME on macOS 10.5 Leopard.
- In addition, release builds running Intel 64-bit non-Haswell no longer require macOS 10.7 Lion. They can run on Leopard again!
- Finally fix some GUI issues in the About box when running Dark Mode on macOS 10.14 Mojave or later.
2022-04-02 13:52:17 -07:00
rogerman 407931288a WiFi: Fix compiling for compilers not running C++11 language features. 2022-04-02 13:25:29 -07:00
Marco Köpcke b86a7748b1
Interface: Added a function to get/set the ARM9 next instruction (#517)
* Interface: Added a function to set the ARM9 next instruction

* Comment about potential JIT issues

* Interface: Made setting next instructions no-op with JIT
2022-03-31 18:06:37 -04:00
tech-ticks 1cec82613b
interface: Fix macOS build (#485)
* Compile macOS interface with clang

* Fix OpenGL dependency on macOS
2022-03-30 20:21:00 -04:00
zeromus 599c981481
Merge pull request #516 from SkyTemple/fix-register-read-write-hooks
Fix register read/write hooks (potentially) using wrong integers sizes
2022-03-15 13:33:39 -05:00
Parakoopa 61036472b5 Fix register read/write hooks (potentially) using wrong integers sizes 2022-03-15 17:48:47 +01:00
zeromus 96b1150558
Merge pull request #515 from SkyTemple/update-interface-build-instructions
Update build instructions for the DLL/SO
2022-03-12 15:33:11 -06:00
Marco Köpcke 666c1ef455 Update build instructions for the DLL/SO 2022-03-12 16:47:58 +01:00
zeromus 95c44e389c
Merge pull request #512 from SimonAfek/feature/fix_msbuild_warning
Fix build action warning + use 64-bit build tools
2022-03-01 16:27:05 -06:00
SimonAfek b143ed6544
Use setup-msbuild v1.1 2022-03-01 13:12:19 +01:00
zeromus 8fd322e817
Merge pull request #469 from TornaxO7/reference_fixes
Fixing urls
2022-02-12 17:45:09 -06:00
rofl0r bd9dcc558f CI: fix mac os interface build, to make everything green again
it's highly annoying to get the red X for any push or pull request
because mac os x interface build is broken since december.
fix it by installing glib which meson complains about.
2022-02-11 20:55:26 +00:00
zeromus 0e83bd5000
Merge pull request #505 from rofl0r/winbuild3
add github workflow to build win64 artifact
2022-02-11 13:06:28 -06:00
rofl0r 9e0aed2267 add github workflow to build win64 artifact
special thanks to @SimonAfek who figured out some nitty-gritty stuff
to make this work.
2022-02-11 18:57:28 +00:00
zeromus f52eed131a fix msvc-clang errors 2022-02-10 14:50:11 -05:00
zeromus 5e48c9c44a fix clang errors 2022-02-10 14:49:42 -05:00
zeromus b2c2e8f5ee try fixing clang compiling another way 2022-02-09 22:52:21 -05:00
zeromus 1770d0a232 try to fix xaudio compiling on clang 2022-02-09 18:37:43 -05:00
rofl0r 6f66e09d82 fix build with clang-cl
clang-cl is the MSVC's recent included clang compiler, which has some
different defaults regarding narrowing and preprocessor.
2022-02-09 21:00:22 +00:00
zeromus 7e787700e7
Merge pull request #502 from algoRhythm99/vs2022
Visual Studio 2022 build support
2022-02-01 21:58:45 -06:00
algoRhythm99 258adbcfca Visual Studio 2022 build support
Bare minimum changes to get it building out of the box in Visual Studio 2022 community
2022-01-31 21:47:37 -06:00
zeromus 747f369483 third unicode fix for issue #496. please go away. 2022-01-11 22:32:57 -05:00
zeromus af06cc4aca fix window title on non-english locales (probably, but not tested)
fixes #496 addendum
2022-01-11 20:29:05 -05:00
zeromus 81573818a9 Revert "WiFi: Fix compiling for Cocoa port by eliminating typed enums. (Regression from commit 43b00fb2, for which the regression was caused by commit 5f76ba8b.)"
This reverts commit 9f82cea20b.

If cocoa compiling is broken let's discuss it instead of reverting work
2022-01-11 19:12:37 -05:00
zeromus 8510948f6c fix game info text fields on non-english locales (probably, but not tested)
fixes #496
2022-01-11 19:09:34 -05:00
zeromus 3ba3821228
Merge pull request #495 from rinsuki/ci/macos-app
ci: Add macOS app Build
2021-12-14 15:26:28 -06:00
rinsuki e344b4ce2a ci: Add macOS app Build 2021-12-14 21:02:07 +00:00
Ingo Saitz b4080b2cae Linux: Call NDS_Init() early
Since NDS_Init takes no arguments, it should not hurt to call it early
in the gtk frontend, too.

This fixes the segfault in issue #415, although I could not get it to
run a r4 kernel in a quick test.
2021-11-19 16:52:44 +01:00
Ingo Saitz f827be2e0f Linux: Add pop-up menu back
This adds the view menu back as pop-up menu, which was disabled by the
gtk2 port.

This fixes issue #407.
2021-11-19 16:51:44 +01:00
Ingo Saitz 327dcd3d7b Linux: Fix recent entries with quote in filename
According to RFC 2396, the single quote character (') is allowed in uri
strings and is not escaped by gtk, so the action string constructed for
the recent files menu must be quoted with " instead of '.

This fixes issue #437
2021-11-19 16:49:36 +01:00
zeromus 629724d865
Merge pull request #489 from Salz/pullreq/openal-linux-01
Pullreq/openal linux 01
2021-11-18 12:47:28 -05:00
Ingo Saitz 6aa320aa0a [Linux] OpelAL: Initialize the Mic_Buffer with silence data 2021-11-18 13:38:01 +01:00
Ingo Saitz 9f19d681de [Linux] OpenAL: fix mic data
The data returned by Mic_ReadSample() must be transfered in 2 parts.
This must be done by every microphone driver.

I did test with Lunar: Dragon Song which values are considered loud,
since you can run away by screaming/blowing into the microphone. Values
from 33-223 don't trigger the escape, values from 0-32 and from 224-255
trigger an escape attempt. Thus 128 would be considered silence.
2021-11-18 13:15:52 +01:00
rogerman 0b4b58f3b4 GPU: Remove a now defunct check that could cause the window test buffer to fail to update. This fixes a graphical issue in Pokemon Black 2 when watching movies at the Pokestar Studios. (Regression from commit 7fc2e4b6. Fixes #486.) 2021-11-12 16:27:11 -08:00
rogerman 9f82cea20b WiFi: Fix compiling for Cocoa port by eliminating typed enums. (Regression from commit 43b00fb2, for which the regression was caused by commit 5f76ba8b.) 2021-11-12 16:16:37 -08:00
rofl0r f000d1a9c0 gtk2: fix build with fresh clone
this was overlooked as my copy already contained a generated Makefile.in.
2021-11-07 16:23:31 +00:00
rofl0r d1d626f221 GTK2: add crude 'dump memory' button to tools
the offsets in the dump file are as follows (code snippet taken
from the dump function and annotated with locations from gbatek:

                0x2000000
        fp.fseek(0x000000,SEEK_SET); fp.fwrite(MMU.MAIN_MEM,0x800000); //arm9 main mem (8192K)

  4       DTCM            027C0000h 16KB   -     -    -    R/W
or 0x800000 or 0xb000000 . DTCM location in real NDS varies, as the program can select where
it's mapped to, apparently.

        fp.fseek(0x900000,SEEK_SET); fp.fwrite(MMU.ARM9_DTCM,0x4000); //arm9 DTCM (16K)
        fp.fseek(0xA00000,SEEK_SET); fp.fwrite(MMU.ARM9_ITCM,0x8000); //arm9 ITCM (32K)
        fp.fseek(0xB00000,SEEK_SET); fp.fwrite(MMU.ARM9_LCD,0xA4000); //LCD mem 656K

  0       I/O and VRAM    04000000h 64MB   -     -    R/W  R/W

        fp.fseek(0xC00000,SEEK_SET); fp.fwrite(MMU.ARM9_VMEM,0x800); //OAM
                 0xc000bc

        fp.fseek(0xD00000,SEEK_SET); fp.fwrite(MMU.ARM7_ERAM,0x10000); //arm7 WRAM (64K)
        fp.fseek(0xE00000,SEEK_SET); fp.fwrite(MMU.ARM7_WIRAM,0x10000); //arm7 wifi RAM ?
        fp.fseek(0xF00000,SEEK_SET); fp.fwrite(MMU.SWIRAM,0x8000); //arm9/arm7 shared WRAM (32KB)
2021-11-03 22:07:52 +00:00
rofl0r b1ffe0ae76 GTK2: add crude "import backup" dialog to File menu
this is necessary to load saves from other devices or emulators,
as desmume uses its own incompatible format.

it works for importing .sav files from flashcarts, but only if the
file extension is .sav or .SAV - if using .dsv desmume guesses it's
of its own type and looks for a specific string, then fails.

the right code was taken from windows/importSave.cpp - it might make
sense to add the export item at some point too, however that will
probably require some more effort.
2021-11-03 22:07:52 +00:00
rofl0r da75178fd6 update README.LIN 2021-11-03 22:07:52 +00:00
rofl0r 2bd5f2804f configure.ac: switch gtk dir to gtk2 2021-11-03 22:07:52 +00:00
rofl0r c2d7a8a643 revert autoconf-part of ba92804d9f 2021-11-03 22:07:52 +00:00
rofl0r 03e14584f6 re-add gtk+2 frontend in gtk2 directory 2021-11-03 22:07:52 +00:00
rofl0r 54f3549108 fix implicit declaration of pthread_setname_np on musl 2021-11-03 22:07:52 +00:00
rofl0r f9393ab57c fixup build sys for GLX removal
the cli frontend still doesn't build, but gtk does
2021-11-03 22:07:52 +00:00
rofl0r d5e9df3691 fixup build system for SDL2
doesn't build yet (at least with --enable-glx - this will be fixed later)
2021-11-03 22:07:52 +00:00
rofl0r 4cef851cbf Revert "Linux: Remove the autotools build system"
This reverts commit 19147a8457.
2021-11-03 22:07:52 +00:00
zeromus 83a3d30fa8
Merge pull request #484 from Minabsapi/master-fix-interface_memory_leak_mitigation
Hotfix: fixed memory leak in binary interface
2021-11-03 14:14:45 -04:00
Minabsapi 00ab686625 Hotfix: fixed memory leak in binary interface's draw_sdl_window.cpp `sdl_draw_no_opengl` method
A call to the `SDL_DestroyTexture` method was forgotten, resulting in all the textures created to render the game's frames being stored indefinitely until running out of memory
This is a temporary fix so anyone using the interface (mainly `py-desmume` users) can have it working correctly again. Next step is to mirror the changes from POSIX CLI's main.cpp `Draw` method, if stable
2021-11-03 16:47:06 +01:00
zeromus 2468b1dbbe
Merge pull request #482 from rofl0r/pr481new
PR 481 redone
2021-11-02 10:37:13 -04:00
rofl0r 2153e53012 frameskip log update: use snprintf, remove gratuitous memset 2021-11-01 21:48:50 +00:00
thesource 79abd40913 Update menu state on setting frameskip value and also print new value 2021-11-01 21:46:18 +00:00
zeromus 8461e2f08d fix bug where windows frontend stopped processing hotkey input from gamepads while paused (fixes #479) 2021-10-28 03:15:15 -04:00
zeromus 021fcdd0de
Merge pull request #478 from rofl0r/cli_fix
fix/improve CLI frontend
2021-10-27 10:06:40 -04:00
rofl0r 7db8f4fcd6 sdl: use emu_halt before loading savestates, just like win32 2021-10-26 16:56:42 +00:00
rofl0r d3dee7ce9c cli: disable jit when using gdb stub 2021-10-26 16:56:42 +00:00
rofl0r 65a280618b cli: turn off sound when entering gdb stub 2021-10-26 16:56:42 +00:00
rofl0r 9f4e6992fb simplify/fix sdl2 sound backend, fixes no audio in CLI
- simplified ring-buffer mechanism
- added proper locking for all variables accessed by 2 different threads
- fixed oob writes that occassionally crashed SDL's "Alsa Hotplug thread"
- make buffer sufficiently large to prebuffer enough samples to survive
  the occassional SDL_Delay(1) in the frontend.
- fixed ignoring volume set by the SPU.
- improved speed and robustness by not calling malloc over and over in
  SDL callback, and copying directly to the SDL buffer if volume is max
  (no need to use mixer to lower the volume in that case).
2021-10-26 16:56:42 +00:00
rofl0r 09506c9a19 cli: add fullscreen toggle with alt-enter 2021-10-26 16:56:42 +00:00
rofl0r 9868c00fca cli: add --horizontal command line option
this option puts the touchscreen to the right, allowing higher scales
on widescreen monitors.
2021-10-26 16:56:42 +00:00
rofl0r 90326ea1f9 cli: add scaling
the new command line parameter --scale allows to scale the window by
a floating point factor. SDL2 stretches it in hardware to the desired
size, which makes the scaled window run at almost identical speed to
1x scale.
2021-10-26 16:56:42 +00:00
rofl0r b685818413 cli: fix FPS display
1) the float format displayed like 50.123456789123456 wouldn't fit
   into the window title bar, and
2) most likely not into the char buffer of length 20, of which half
   was already used for the desmume string.
2021-10-26 16:56:42 +00:00
rofl0r 699f63d688 cli: user proper SDL2 OpenGL-accelerated rendering primitives
additionally:
- don't allocate memory for surfaces and textures over and over
- use one texture for each NDS screen - this allows to easily
  add support for horizontal screen layout.
2021-10-26 16:56:42 +00:00
rofl0r 7e0336d57d cli: re-add ability to set frameskip
the command line option existed once, but was turned off when a
new generic commandline parser class was introduced. the entire
array in main.cpp using custom commandline options is currently
unused.
2021-10-26 16:56:42 +00:00
rofl0r d07bdedbd6 cli: remove unused and broken OPENGL2D code
this code was broken since the switch to SDL2, but nobody noticed
because the new meson build system doesn't set HAVE_GL_GL_H.
2021-10-26 16:56:42 +00:00
rofl0r a2c6a789ad cli frontend: fix mouse input
there were 2 logical issues which caused reproducible misbehaviour.
for example when starting up pokemon soulsilver, one can click away
the intro, but it's not possible to click on the "load savegame"
icon.
the issues were:

1) failure to record whether the down event has been
passed to the emulator before abandoning it and turning it into
a click event (on a fast click, both events would happen during
the same SDL_Pollevent loop), and
2) mouse coordinates were discarded and unless the mouse down
event was registered. that means if the down and up events happen
on the exact same coordinate, the .x and .y of the mouse weren't
updated at all.
2021-10-26 16:56:42 +00:00
zeromus 086112c4b5 isSwapBuffers is savestated with a size set to 4, so it needs to be a u32 and not a BOOL 2021-10-25 23:00:25 -04:00
zeromus 43b00fb2a0 fix some sloppy stuff in wifi that made its savestates unreliable 2021-10-25 20:07:51 -04:00
zeromus fe8c424c4a fix gdbstub compiling on windows 2021-10-25 20:04:35 -04:00
zeromus b8bed7082b
Merge pull request #477 from rofl0r/gdbstub_block
Gdbstub improvement, fix 100% cpu use in cli frontend
2021-10-24 21:07:12 -04:00
rofl0r 339ea16b15 gdbstub_wait(): add timeout parameter
this is probably helpful for frontends other than cli that have to repaint
and react on events in the user interface, so they can set a timeout like
100 ms, or simply poll whether the stub is active using timeout 0.
2021-10-24 15:39:01 +00:00
rofl0r ed5ff51c0c gdb stub: since debug info is printed anyway, show the actual command 2021-10-24 15:38:55 +00:00
rofl0r d5693c54cf cli frontend: fix 100% cpu when using gdb stub
the emulator thread was consuming 100% cpu even when the debugger was
active and execution paused.

a second pipe was added to gdb stub, which allows communication in
direction stub -> emulator/frontend, and also to infinitely block
in the frontend until the debugger returns control, for example
by typing "c" (continue) in gdb.

the other frontends use an inefficient method of running usleep(1000)
or similar in a loop, which will cause high cpu usage too, albeit not
a full 100% but more like 10-20%.

in order not to fill up the pipe with data for frontends that don't use
this mechanism, the functionality needs to be explicitly enabled.
(see functions added to gdbstub.h)

the functions added could in theory also be used to communicate
other data to the frontend, and optimally even replace all the locking
between the 2 sides.
2021-10-24 15:38:50 +00:00
rofl0r dbc1f06662 gdbstub: remove more WIN32 ifdefs, refactor pipe setup code to be re-usable 2021-10-24 15:38:44 +00:00
rofl0r 747f7b114b NDSSystem: replace GDB_STUB ifdefs with macro 2021-10-24 15:38:38 +00:00
rofl0r 70a1727bd5 gdbstub: improve readability by using less ifdef WIN32 2021-10-24 15:38:31 +00:00
rogerman 7fc2e4b6b6 GPU: Only perform window testing when the relevant window states actually change. 2021-09-22 13:24:05 -07:00
zeromus 2fb06cf4cc
Merge pull request #472 from MathyFurret/patch-1
Disassembler: Fix LDR/STR immediate offset
2021-09-21 15:52:18 -04:00
rogerman f42975aa4d GPU: Remove some dubious or now obsolete templates for OUTPUTFORMAT. Shouldn't affect performance, but does slightly decrease the code size. 2021-09-21 11:40:09 -07:00
Alexander B db7bfdb185
Disassembler: Fix LDR/STR immediate offset 2021-09-21 12:10:58 -05:00
rogerman b02dd3afaf GPU: Do some more refactoring, mostly related to applying the master brightness. 2021-09-20 23:14:49 -07:00
rogerman 173e2ae6e7 GPU: Do some code refactoring. 2021-09-20 19:10:29 -07:00
rogerman 4afbb18eab GPU: Correctly resolve the 18-bit and 24-bit colorspaces to 32-bit when auto-resolving is enabled. Fixes #471.
- Also revert commits e1cadfe and 77d38b1. Using masterNativeBuffer16 was the correct choice here after all.
2021-09-20 15:06:34 -07:00
rogerman d6e80e7864 OpenEmu Plug-in: This frame buffer also needs to use masterCustomBuffer because it's running 18-bit color space. 2021-09-20 11:12:19 -07:00
rogerman e1cadfe112 Linux Port (CLI): Oops! Wrong buffer... 2021-09-20 11:04:12 -07:00
rogerman 77d38b15b1 Linux Port (CLI): Take a shot in the dark at #471, but I have no way to test it.
- It's a regression from commit 4578728. I'm suspecting that this particular buffer is to be read as 32-bit since all of the other Linux frontends explicitly used 16-bit except for this one.
2021-09-20 11:02:24 -07:00
rogerman 004ec526aa GPU: Completely revert commit a948838. I forgot that Zelda PH and Zelda ST could use both GPU engines for the same display when moving the map to and from the touch screen, and so native line tracking MUST be performed at the display level in order to account for this.
- Added some additional comments so that I'm not tempted to change the native line tracking paradigm ever again.
- Do some refactoring to make GPUEngineBase::_targetDisplay handle more buffer associations itself instead of relying on GPUEngineBase's copies of the associations.
2021-09-20 01:23:06 -07:00
TornaxO7 4e96d07678 Fixing urls 2021-09-19 22:28:44 +02:00
rogerman d626bad6bd Fix broken builds due to commit 45787281. 2021-09-18 23:01:20 -07:00
rogerman 4578728120 GPU: Change the rendering paradigm where, rather than performing inline colorspace conversions during rendering, all rendering is performed at 15-bit until 3D rendering or 24-bit custom VRAM creates the need for a color space conversion.
- For purposes of maintaining a record and make for easier reversions, the code has NOT been fully optimized or cleaned up. This will happen over a period of time as the code settles down through testing.
- All "native" buffers are no longer assumed to be in any color space and are now assumed to always be 15-bit. The native buffers are now referenced using uint16_t pointers and are now suffixed with "16" in order to reflect this change.
- Of note, all clients that reference masterNativeBuffer or nativeBuffer via NDSDisplayInfo must now assume that these native buffers will always be in the 16-bit color space.
- Any 18-bit and 24-bit rendering now happens in the custom buffers.
2021-09-18 22:36:40 -07:00
rogerman c082782fa9 GPU: Fix main memory capture on big-endian systems when running 15-bit and 18-bit mode.
- 24-bit mode is still bugged on big-endian systems. This will be fixed at a later date.
2021-09-18 20:35:51 -07:00
rogerman 7dd98ddb45 GPU Operations: Fix a bug where running 18-bit color, 24-bit color, or a custom framebuffer size would cause a crash on systems without SSE2 or AVX2. (Regression from commit 0db9872.) 2021-09-18 15:44:42 -07:00
rogerman 5b1eb55351 GPU Operations (SSE2): Apply the same code optimizations to the PixelOperation_SSE2::_unknownEffectMask16() and PixelOperation_SSE2::_unknownEffectMask32() methods as their corresponding AVX2 versions.
- Also fixes a bug in PixelOperation_SSE2::_unknownEffectMask32() that would cause 3D layers to appear black if the user was running 15-bit color mode. (Regression from commit 0db9872.)
2021-09-18 13:57:07 -07:00
rogerman 9ace87207d FIFO: Fix a bug where running 18-bit or 24-bit color depth would cause a buffer overrun. (Regression from commit 329eade.) 2021-09-16 18:36:42 -07:00
rogerman 07aadb462e GPU: Partially revert commit a948838. It still bothered me that native line tracking wasn't individually handled for rendered lines and displayed lines, and so this paradigm has been restored. However, native line tracking continues to be handled purely with GPUEngineBase.
- GPUSubsystem::ClearWithColor() also now handles clearing the master framebuffer with better specificity.
2021-09-16 15:24:23 -07:00
rogerman c6d35f9894 Cocoa Port: Metal display views can now handle the possibility where the fetched main and touch display framebuffers are in different colorspaces. 2021-09-16 15:16:37 -07:00
zeromus ff28ca6df5
Merge pull request #468 from anlsh/master
Enable "Save state to" and "Load state from" functionality in GTK
2021-09-14 23:16:48 -04:00
Anish Moorthy 4754987279 Suggest proper file extension for save dialog 2021-09-14 23:11:49 -04:00
Anish Moorthy 71ed1ca073 Redraw screen in after loading state from file 2021-09-14 23:11:49 -04:00
Anish Moorthy fffd574aae Disable save/load actions when there is no ROM, but menu is still clickable 2021-09-14 23:11:49 -04:00
Anish Moorthy 98a1c58db7 Make "Load state from" pressable on linux 2021-09-14 23:11:49 -04:00
Anish Moorthy 91b2e22894 Make "Save State To" pressable, even if sometimes broken 2021-09-14 23:11:49 -04:00
zeromus db6e978276
Merge pull request #466 from anlsh/master
Change background color on Linux
2021-09-14 18:38:35 -04:00
Anish Moorthy 19b081c8b8 Fix second layer of toolbar 2021-09-14 18:05:58 -04:00
rogerman d60684ce4d GPU Operations: Fix bug where generic calls to CopyLine*<>() caused certain compilers to interpret 0xFFFF as -1 in all cases.
- This fix has the side effect of greatly increasing the code size.
- Quick testing shows that this fix increases overall graphics performance by 2% - 3%. But is this small performance gain worth the massive increase in code size? Hmmm....
2021-09-14 14:49:31 -07:00
rogerman a948838c16 GPU: Native lines are no longer tracked through NDSDisplay. Native lines are now only tracked through GPUEngineBase.
- While this is technically incorrect according to object roles, tracking native lines this way makes it a bit easier to manage them.
2021-09-14 01:53:05 -07:00
Anish Moorthy 5057299fa5 Change background color on Linux 2021-09-13 23:40:18 -04:00
rogerman 7bac2ce759 GPU: Standardize all aligned memory block allocations to be page-aligned. 2021-09-13 19:36:27 -07:00
rogerman 8a610234c5 GPU: Simplify GPUSubsystem::PostprocessDisplay(). 2021-09-13 19:31:31 -07:00
rogerman a5b25313f8 GPU: The internal buffer for custom-sized layer IDs is now cleared in its entirety, rather than just most of it. 2021-09-13 19:30:47 -07:00
rogerman fffa7ebb8c FIFO: Oops! Fix a bug that snuck in from commit 31851c2.
- In practice, no games seemed to be affected by this bug, but even so, this fix is correct.
- While technically unnecessary, when the index is singly incremented, it's better to hard reset an overrunning index to zero in order to improve the theoretical stability of the code.
2021-09-13 10:42:39 -07:00
rogerman ad64e73bb2 Colorspace Handler: Colorspace conversions no longer do big-endian byte swapping by default. Instead, byte swapping must be explicitly requested.
- Byte swapping can now be independently controlled for both input and output data.
- As an application to this new API, VRAM display mode now shows the correct colors on big-endian systems.
2021-09-11 20:59:41 -07:00
rogerman 329eade565 FIFO: Simplify _DISP_FIFOrecv_LineOpaque32_vec() code paths for non-AltiVec systems. 2021-09-11 11:50:53 -07:00
rogerman bf71da494e Colorspace Handler: Make the ColorspaceConvert555To*_AltiVec() functions behave consistently with their scalar counterparts by byte swapping the result. Fixes SoftRasterizer's toon table colors on AltiVec-enabled systems. 2021-09-11 11:49:07 -07:00
rogerman 3dabb10145 OpenGL Renderer: The fog density table is now sampled as a 1D texture instead of being indexed as a uniform array. Should yield a performance improvement on older GPUs.
- Even if the new fog rendering yields no performance improvement on newer GPUs, at least the new code is MUCH cleaner and simpler.
2021-09-10 10:13:11 -07:00
rogerman df18eda84f OpenGL Renderer / SoftRasterizer: Properly handle cases where FogShiftSHR is greater than 10. Related to commit 9f4f3ec. 2021-09-09 19:54:06 -07:00
rogerman 9f4f3ecf95 GFX3D: Oops, I misread GBATEK. It actually meant that the Fog Step (not the Fog Shift) would become zero if Fog Shift was greater than 10. So set Fog Shift to 11 in this case.
- This also discovers an existing issue with the fog weight calculation code in both OpenGL and SoftRasterizer, since Fog Shift could be zero and thereby cause the calculations to divide by zero. This issue will have to be dealt with at a later time.
2021-09-09 13:59:25 -07:00
rogerman d9fabf6347 GFX3D: So apparently, GBATEK says that, instead of clamping the FogShiftSHR value to 10, the FogShiftSHR value should reset to 0 if it goes above 10. Hmm, okay. 2021-09-09 13:34:47 -07:00
rogerman c0552cab6d OpenGL Renderer: Do a micro-optimization when NDS-style Depth Calculation is used. 2021-09-08 23:42:29 -07:00
rogerman 506128760a Do some minor fixes in preparation for making an Apple Silicon build. 2021-09-08 15:07:02 -07:00
rogerman 9e79b1dcb3 OpenGL Renderer: Fog rendering now works like how SoftRasterizer does it. (3.2 only)
- Also rework SoftRasterizerRenderer::_UpdateFogTable() to use the same variable naming scheme as OpenGL. This is done for better code consistency.
- In reality, I'm already looking to scrapping this algorithm in OpenGL for something that could be better in every possible way, but I want to commit this SoftRasterizer-esque algorithm first so that we have a working version of it on record.
2021-09-08 12:54:35 -07:00
zeromus 8c4e42f98d fix bug that made desmume get a random MAC address on each boot without anybody knowing it or asking for it. this triggered time-travel protections in games. 2021-09-08 04:17:57 -04:00
rogerman f3c3228c70 Windows Port: Fix Windows build. (Regression from commit 037d328.) 2021-09-07 02:13:35 -07:00
rogerman 037d3285a9 Cocoa Port: Update project files to accommodate new GPU_Operation_* files. Also updates builds for AVX2. 2021-09-06 19:46:53 -07:00
rogerman 0db98725dc GPU: Do a massive refactor of the manually vectorized code and add full support for AVX2.
- Most notably, each version of the manually vectorized code now resides in their own files.
- Depending on the rendering situation, the new AVX2 code may increase rendering performance by 5% to up to 50%.
- Certain functions automatically gain manual vectorization support since the new GPU code makes use of the new general-purpose copy functions that were added in commit e991b16. In other words, AVX-512 and AltiVec builds also benefit from this.
2021-09-06 18:00:38 -07:00
rogerman 4226fa7ab2 SPU.cpp: More silencing of compiler warnings, code cleanup, and consistency improvements. 2021-09-06 15:10:05 -07:00
rogerman 207e93b8ae mc.cpp: Silence a whole bunch of compiler warnings and improve code consistency. 2021-09-06 14:28:11 -07:00
rogerman 620d3b3a26 Render3D: Fix clear image on big-endian systems.
- Also renames "Altivec" to "AltiVec" to remain consistent with Colorspace Handler's naming.
- Also adds an AltiVec accelerated version of the clear image parser.
2021-09-05 01:25:13 -07:00
rogerman c49a480d51 SoftRasterizer: Due to how the class inheritance works, SoftRasterizer_AVX actually requires AVX2 instead of just AVX. And in reality, AVX2 is just more practical than AVX for what we're doing here.
- Also do some minor refactoring of Render3D.
2021-09-04 19:31:55 -07:00
rogerman 92fcd1313e OpenGL Renderer: Do a minor optimization when running NDS-Style Depth Calculation.
- As a positive side-effect, generating the geometry shaders now runs quicker too.
2021-09-04 17:50:10 -07:00
rogerman ef35f72172 FIFO: Fix buffer copying for AltiVec. 2021-09-04 17:42:56 -07:00
rogerman 192e0f88b2 Cocoa Port: Perform post-build code signing for final stage of Release build. 2021-09-03 12:03:06 -07:00
rogerman 777329a993 Cocoa Port: Fix the OpenGL renderer on macOS v10.7 Lion. 2021-09-03 02:20:07 -07:00
rogerman 22801dac3c Cocoa Port: Delete now defunct Xcode 9 build scheme. 2021-09-03 01:07:57 -07:00
rogerman 2b3a7a7e50 Cocoa Port: Update Final Release builds to split 32-bit and 64-bit binaries between Xcode 9 and Xcode 12, respectively.
- Final Release builds still remain as PowerPC 32-bit, Intel 32-bit, and Intel 64-bit. ARM64 is not supported yet.
- PowerPC 32-bit and Intel 32-bit continue to require macOS v10.5 Leopard like before, but the Intel 64-bit binary now requires macOS v10.7 Lion or later. (Now, the Intel 64-bit binary will simply fail to run on Leopard and Snow Leopard.)
2021-09-02 22:53:45 -07:00
rogerman e775f17c87 OpenGL Renderer: Fix some issues where shaders wouldn't work on older/stricter video drivers.
- Specifically, we're now respecting uniform control flow for texture lookups, for which older/stricter drivers will silently fail because they consider texture lookups within conditional blocks to be undefined.
2021-09-02 22:44:12 -07:00
rogerman ea02efda78 Alright, fix the Windows build for real. 2021-09-01 02:54:20 -07:00
rogerman 379af45813 Did this fix it? 2021-09-01 01:18:00 -07:00
rogerman 7eabbb8ea6 Silence a whole lot of longstanding compiler warnings. 2021-09-01 00:49:50 -07:00
rogerman 0df858f2e8 Cocoa Port: Add the ability for the user to set a fixed frame skip value, just like in the Windows port. This is in addition to the existing automatic frame skip setting. 2021-08-31 13:56:07 -07:00
rogerman 67fa412144 gdbstub.cpp: Fix compiling for builds that use GDB stub. (Regression from commit cfe88ce.) 2021-08-31 11:06:22 -07:00
rogerman cfe88ce0d7 Core: Silence the 1000+ compiler warnings about using offsetof() on a non-POD type... again. 2021-08-31 10:23:04 -07:00
rogerman 3f47c4ad7d Cocoa Port: Fix building for Xcode 3. (Regression from commit 03b9481.) 2021-08-30 20:34:42 -07:00
rogerman 4a9c71b988 Cocoa Port: Also add command queue names for Metal display views. 2021-08-30 20:07:58 -07:00
rogerman 03b9481095 Cocoa Port: Add thread names for this port's own threads too. 2021-08-30 20:06:42 -07:00
rogerman 4f8ba2beb9 task.cpp: Support thread naming on macOS.
- Related to commit 11fe823 and commit e70e065.
2021-08-30 20:02:49 -07:00
rogerman 0d51b40479 Do some minor changes to support compilers running strict C++17 conventions. 2021-08-30 12:50:15 -07:00
rogerman 3b06be0d07 FIFO.cpp: For AVX-512 built targets only, correct _DISP_FIFOrecv_LineOpaque32_vec() to require Tier-1 support instead of Tier-0. 2021-08-30 12:44:30 -07:00
rogerman 479c404b60 Core: Fix compiling for AltiVec build targets. 2021-08-30 12:42:48 -07:00
rogerman 63702ff6bd task: Change to C++03 conventions to support older compilers. Related to commit 5428763. 2021-08-30 12:39:28 -07:00
rogerman ac472c13ef encrypt.h: Change to C++03 conventions to support older compilers.
- This change partially reverts commit 87cb2f6, but still preserves the elimination of the destructor, which is probably the code simplification that was originally wanted, I guess.
2021-08-30 12:29:09 -07:00
rogerman 9ac09387e3 Cocoa Port: Fix a bug where changing the GPU Scaling Factor or GPU Color Depth while the emulator is paused would cause the program to freeze upon restarting the emulation via Run, Frame Advance, or Frame Jump. 2021-08-27 14:48:22 -07:00
rogerman b7c9b6b614 Cocoa Port: Fix a bug where the Frame Advance and Frame Jump buttons in the Execution Control panel would cause the other buttons to enable/disable themselves inconsistently, but only if the .app was built on Xcode 10 or later.
- Apparently, KVO-based UI updates being made across threads are a big no-no in the macOS v10.14 SDK and later. So now we need to make sure that ALL KVO-based UI updates are done on the main thread only.
2021-08-27 13:35:10 -07:00
rogerman c7f85ba00a Cocoa Port: Fix a bug where the video filter preview in Preferences would display a black box if the .app was built using Xcode 10 or later.
- Also make OGLImage run a little more efficiently.
2021-08-27 03:03:44 -07:00
rogerman 31851c2524 FIFO.cpp: Add new manually vectorized versions of FIFO buffer line copies for AVX2, AVX-512, and AltiVec. 2021-08-26 18:05:53 -07:00
rogerman 79437371e3 Render 3D: In the vectorized code, tweak how memory is indexed. Not only does this make the code more consistent, but it might make some subtle code generation improvements in the compiled code (depending on compiler and optimization settings). 2021-08-26 17:08:10 -07:00
rogerman e991b16ec1 matrix.h: Add more general-purpose vectorized fixed copy functions. (They don't actually do anything as of this commit, but they will be used in future commits.) 2021-08-26 16:36:54 -07:00
rogerman 64cbba2e24 Cocoa Port: Fix crashes and improve stability.
- Fixes a crash that can occur on startup or when modifying the Video Pixel Scaler in Preferences. Fixes #321. (Regression from commit 0663661.)
- Fixes a crash on startup where write+execute privileges returned by mprotect() are not supported when compiled against the macOS v10.15 SDK or later. Fixes #335.
- Fixes a possible crash that can occur if an invalid ID is sent when trying to set the 3D Rendering Engine. Maybe fixes #342.
2021-08-26 16:09:50 -07:00
rogerman 92cb90f433 Cocoa Port: Fix build errors that can occur when building on Xcode versions later than 10.3.
- The script that renames the DeSmuME.app package with the git version now runs as a Build Post-Action script rather than as the last build rule. This is to fix an incompatibility with code signing, which is now forced in Xcode 11 and later.
- Update some variables to comply with newer and stricter compiler rules.
2021-08-26 14:32:25 -07:00
zeromus e8f619c44a winport: fix #442 2021-04-09 11:43:20 -04:00
zeromus 9d8332d671 winport - fix #441 (nonsense japanese directory creation on open rom file dialog and other cases probably) 2021-04-06 15:09:48 -04:00
zeromus 42093b4929 fix #423 more 2021-04-06 01:12:18 -04:00
zeromus 4b77e9b77a winport - fix file creation time not shown in file menu when filename has moonrunes, fixes #440 2021-04-05 22:59:02 -04:00
zeromus 84e8508520 fix WIN32_FRONTEND (broken by PR #350)
fixes #432
2021-04-05 22:43:33 -04:00
thesource 85a2674eb5 GTK: fix freeze when editing joystick controls 2021-03-13 14:10:31 +01:00
Emmanuel Gil Peyrot 445579b053 GTK: Use the correct hyphenation for properties 2021-03-11 16:53:22 +01:00
zeromus 67f30f4023
Merge pull request #350 from SkyTemple/binary-interface
DeSmuME as a shared object / dynamic library
2021-03-07 19:49:00 -05:00
Parakoopa 8e7af8ada8 Github action for interface build -- Corrected windows path 2021-03-07 12:03:52 +01:00
Parakoopa c135751ded Github action for interface build 2021-03-07 11:59:10 +01:00
Parakoopa 37ed174621 Fix libdesmume name in meson build 2021-03-05 13:05:31 +01:00
Parakoopa 1455b830c5 Interface: Windows: Switched to SDL2 2021-03-05 11:23:52 +01:00
Parakoopa 34b4fc3d72 Interface: Posix: Switched to SDL2 and Meson 2021-03-05 10:28:28 +01:00
zeromus 600d159427
Merge pull request #432 from thesourcehim/master
Update menu and config upon save type change
2021-02-27 14:43:22 -05:00
thesource d3fda11a0e Update menu and config upon save type change 2021-02-27 18:49:58 +03:00
Parakoopa f62318ced4 Fix wrong type in interface after SDL2 migration 2021-02-21 14:24:15 +01:00
zeromus 6ef876b217 fix 1 pixel rounding oopsie in horizontal odd-ratio'd layout case 2021-02-05 14:09:16 -05:00
Parakoopa 1809c0a17e Added documenation, removed unimplemented API functions 2021-01-31 14:15:36 +01:00
Parakoopa 6be61e4a42 Support for making Joystick processing optional 2021-01-31 14:15:36 +01:00
Parakoopa 3d198fcb9b MacOS compatibility 2021-01-31 14:15:36 +01:00
Parakoopa 4917d177cc Binary interface: Removed lua support from Windows 2021-01-31 14:15:36 +01:00
Parakoopa f7bada2526 Flag to disable AVX512 2021-01-31 14:15:36 +01:00
Parakoopa 651cb53fbe Binary interface: Memory and register access & hooks 2021-01-31 14:15:34 +01:00
Parakoopa b18e2058cb Binary interface: Removed some unused functions 2021-01-31 14:15:03 +01:00
Parakoopa 283f31cf87 Binary interface: Movie recording and playback 2021-01-31 14:15:03 +01:00
Parakoopa 7b3da44f5a ABI: Changes to the core and other modules to be buildable on Win32 2021-01-31 14:15:03 +01:00
Parakoopa c7426e24b7 Binary interface: Windows: Newer SDL 1.2 version 2021-01-31 14:15:03 +01:00
Parakoopa 10414b1f1d Binary interface: Windows building 2021-01-31 14:15:03 +01:00
Parakoopa 1f37dcc0a0 Binary interface: Posix building 2021-01-31 14:15:03 +01:00
Parakoopa 97d1613421 First incomplete version of a binary interface 2021-01-31 14:15:03 +01:00
zeromus bb5849abec
Merge pull request #421 from MaddTheSane/patch-1
Add aarch64 string
2021-01-25 20:45:48 -05:00
zeromus 0942fb5c5b
Merge pull request #422 from MaddTheSane/patch-2
Update rthreads.c
2021-01-25 17:18:34 -05:00
C.W. Betts 11fe823bbd Update rthreads.c
Make it build again on macOS.
2021-01-25 14:50:44 -07:00
C.W. Betts 7f035acdaa
Add aarch64 string
Adds aarch64 to the lists of available DESMUME_PLATFORM_STRINGs.
Cherry-picked from 0d763b350a3ce0de7ee4d965ca54c5f3af4373f8.
2021-01-25 14:12:55 -07:00
zeromus 44282bc151
Merge pull request #367 from linkmauve/thread-names
Give thread names to ease debugging
2021-01-21 11:06:28 -05:00
zeromus a04ebb8743
Merge pull request #419 from nicegamer7/github-actions
Fix GitHub Actions
2021-01-21 10:42:00 -05:00
nicegamer7 b873f898c0
fix github actions 2021-01-21 10:10:47 -05:00
zeromus 21af401263 make cheat database lookup based on crc instead of game ID, which locates the wrong file half the time when the cheat DB contains two entries with the same game ID (but differing crc). Left the serial check ADDITIONALLY as a backup in case of a crc collision 2021-01-19 22:46:00 -05:00
zeromus 9836f56312 change readme.md link to downloads since by far the most important single piece of information about desmume in 2021 is that you should download it. 2021-01-12 22:09:12 -05:00
zeromus dbff32fdaa dive into the N-layer muck of zip file opening and try to run amok on filenames with weird characters in them (should fix #412) 2021-01-07 16:53:59 -05:00
Emmanuel Gil Peyrot aeaf404177 Posix: Fix a few warnings in ctrlssdl.cpp 2020-12-25 03:08:16 +01:00
Emmanuel Gil Peyrot ac507ebdc0 GTK: Move more of the graphics dialog into its .ui file 2020-12-19 04:07:07 +01:00
Emmanuel Gil Peyrot 0e5dec143f GTK: Move emulation settings to a .ui file 2020-12-19 04:04:02 +01:00
Emmanuel Gil Peyrot b4b2781826 GTK: Move the menu into its .ui file 2020-12-19 03:23:54 +01:00
Emmanuel Gil Peyrot 5e051a981d GTK: Move graphics settings into its own .ui file 2020-12-19 01:44:05 +01:00
Emmanuel Gil Peyrot 21276a5a07 GTK: Move the main window into an .ui file 2020-12-19 01:35:28 +01:00
Emmanuel Gil Peyrot b568fbc5dc GTK: Move .ui string into a GResource
This makes it easier to edit those files in Glade or such, while keeping
it inside the final binary.

As a bonus, XML data is getting minified at the packing step.
2020-12-19 01:11:07 +01:00
Emmanuel Gil Peyrot 02e49123da CLI frontend: Add missing name to gdb thread
This broke in 101fa1ef58.
2020-12-16 21:55:52 +01:00
Emmanuel Gil Peyrot d503376558 filters: Fix warnings on gcc 2020-12-16 21:21:11 +01:00
zeromus 50a24fbbd7 fixed y-sorting that was messed up by the more convoluted multi-purpose indirect clipping approach that was added in early 2019 (e.g. 4cd19ce522 and e06d11f6df )
fixes SF bug 1724 (7th dragon HP renderer) but this was probably affecting many other games.
2020-12-15 00:58:19 -05:00
zeromus b138666bf6 fix misuse of SetWindowLongPtr 2020-12-14 22:32:31 -05:00
zeromus e5a7fbe634 add a log note when creating a backup state 2020-12-09 23:09:32 -05:00
Emmanuel Gil Peyrot dc60f82ace slot2: Remove bogus const on integer return type 2020-11-27 20:29:19 +01:00
Emmanuel Gil Peyrot 4d86151839 MMU: Use correct size_t type for iterations 2020-11-27 20:20:35 +01:00
Emmanuel Gil Peyrot baccf00674 Remove bogus static function declaration in header 2020-11-27 20:18:10 +01:00
Emmanuel Gil Peyrot eab1fb9583 GTK: Add debug logging on OpenGL initialisation issues
Thanks @thesourcehim for the suggestion!
2020-11-26 19:48:17 +01:00
Emmanuel Gil Peyrot 6e35440436 GTK: Set GL attributes before creating the SDL window
This apparently helps on the proprietary Nvidia driver.

Thanks @thesourcehim for debugging that!

Fixes #399.

Fixes #400.
2020-11-26 19:48:13 +01:00
Emmanuel Gil Peyrot 91f6e4a9ef Revert "Posix: Remove X11 dependencies"
This reverts commit 48d0717f82.

It was causing crashes when running on Xorg…

Fixes #398.
2020-11-20 22:01:57 +01:00
Emmanuel Gil Peyrot 49fda66b3b CI: Install SDL2 instead of SDL 1.2 2020-11-19 02:10:01 +01:00
Emmanuel Gil Peyrot 48d0717f82 Posix: Remove X11 dependencies
There is no code specific to X11 anymore, we can stop linking to it.
2020-11-19 02:05:34 +01:00
Emmanuel Gil Peyrot d319d2c6fb GTK: Use SDL2 instead of GLX for OpenGL context creation
GLX is tied to X11, while SDL2 works on many other platforms (including
native Wayland).
2020-11-19 02:04:57 +01:00
Emmanuel Gil Peyrot 101fa1ef58 Posix: Replace SDL 1.2 with SDL2
This is required for DeSmuME to start without X11, for instance on a
pure Wayland system.
2020-11-19 01:25:47 +01:00
Emmanuel Gil Peyrot 72386f28de GTK: Remove the libglade interface
It was unmaintained anyway, and the other one is a better base to start
from.  And if someone ever needs one of these files, they are preserved
in the git history anyway.
2020-11-18 23:38:29 +01:00
Emmanuel Gil Peyrot a5f13edb7f saves: Remove unused variable 2020-11-18 23:13:03 +01:00
Emmanuel Gil Peyrot c3ea512a0b saves: Remove redundant break 2020-11-18 23:12:42 +01:00
Emmanuel Gil Peyrot 02c0553977 saves: Remove noop allocation/deallocation
Compilers (at least gcc 10) were already reaching that conclusion, so
this shouldn’t change code generation at all.

This piece of code got introduced in commit
3eb9de4614 when upgrading to save state
version 1 (we’re at version 12), and commit
64073a2558 added some OOP on top of it so
that cp15 was in charge of handling that memory.  The code never got
cleaned until now.
2020-11-18 23:08:04 +01:00
Emmanuel Gil Peyrot 87cb2f648f encrypt: Simplify initialization code
This avoids destructors being even needed.
2020-11-18 22:38:36 +01:00
Emmanuel Gil Peyrot 7de7d6c1c5 GTK: Use correct icon name
a8e581dcf3 renamed it, but it never got
updated in the UI.
2020-11-18 21:28:45 +01:00
Emmanuel Gil Peyrot 8708460666 GTK: Remove unused static variable 2020-11-18 21:28:18 +01:00
Emmanuel Gil Peyrot 19147a8457 Linux: Remove the autotools build system
Fixes #394.
2020-11-07 21:02:00 +01:00
Dan Church 7ec93bce63 GTK: Use standard meson to install man pages 2020-11-07 20:52:16 +01:00
Emmanuel Gil Peyrot 25d7194779 GTK: Install the icon at its correct location 2020-11-04 12:41:11 +01:00
Emmanuel Gil Peyrot a8e581dcf3 GTK: Also rename the icon like the desktop file 2020-11-04 11:42:38 +01:00
Emmanuel Gil Peyrot 907cbf8308 Improve ARM runtime feature detection on Linux
getauxval(AT_HWCAP) is the best way to check for features on ARM and
AArch64, as it doesn’t require parsing a file, instead it just returns a
value provided by the kernel in our address space.

This commit should be synchronised with
https://github.com/libretro/libretro-common/pull/176
2020-11-04 00:34:25 +00:00
Emmanuel Gil Peyrot 7a7c1fbfc3 GTK: Add a metainfo file for Flathub 2020-11-04 01:31:17 +01:00
zeromus 79515e978e change "freeze value" checkbox in windows internal cheats add dialog to say "Enabled" because that's what it really means 2020-11-03 12:50:33 -05:00
Emmanuel Gil Peyrot b400093e3c Linux: Make all frontends optional 2020-11-03 18:08:28 +01:00
Emmanuel Gil Peyrot 0479afb877 GTK: Remove unused GLU header 2020-11-03 17:34:37 +01:00
Emmanuel Gil Peyrot df91fe9e00 Try GitHub Actions for Linux CI 2020-11-02 17:56:52 +01:00
Emmanuel Gil Peyrot cabb0eb327 Lower meson version requirement to 0.45 2020-11-02 17:41:23 +01:00
prg318 cec553f4b9
gtk: add import/export memory menu items (#391)
GTK: Add import/export memory menu items
2020-10-29 21:59:07 +01:00
Emmanuel Gil Peyrot 64da66f37b GTK: Disable deprecated symbols altogether 2020-10-29 20:56:11 +01:00
zeromus 0d65ea6050 add code to make a backup savestate every time a slot savestate is loaded. I don't need to spell out for you which users this is for, and why they need it. 2020-10-15 16:46:16 -04:00
Emmanuel Gil Peyrot d854909b04 GTK: Fix opening a ROM from the command line
Only the first of the positional arguments is interpreted as the ROM’s
filename, because we don’t emulate multiple ROMs at once.

Fixes #382.
2020-10-03 12:37:43 +02:00
Emmanuel Gil Peyrot cb49416952 GTK: Fix gdb stub support
I never tried to build this codepath, this is now done.

Fixes #381.
2020-10-03 12:36:56 +02:00
zeromus e07e5e5db4
Merge pull request #380 from thesourcehim/master
GTK: fixed LCD layout switching
2020-09-27 14:23:35 -04:00
thesource 905de91c96 Fixed LCD layout switching 2020-09-27 11:10:14 +03:00
Emmanuel Gil Peyrot 8aaabb9b05 meson: Fix building with -Dwifi=true 2020-09-25 21:52:41 +02:00
Emmanuel Gil Peyrot 59c2b8a990 meson: Add back forgotten manpages
Thanks @dantob for noticing that on the AUR package.
2020-09-25 21:48:24 +02:00
Emmanuel Gil Peyrot 626d5b4d36 GTK: Replace the logo with a SVG version
This makes it render crisp on desktop environments which use an icon
size bigger than 32×32, such as GNOME.
2020-09-25 21:38:18 +02:00
Emmanuel Gil Peyrot 0896b99b49 README.LIN: Direct to release builds by default
Fixes #376.
2020-09-22 12:04:24 +02:00
zeromus e38e98714e
Merge pull request #378 from thesourcehim/master
Add missing libsoundtouch define for meson
2020-09-21 14:44:48 -04:00
thesource 50abbbafa7 Add missing libsoundtouch define for meson 2020-09-21 21:13:15 +03:00
Emmanuel Gil Peyrot 5552ef11c0 GTK: Add missing guards for HUD actions
Fixes #377.
2020-09-21 14:55:44 +02:00
Emmanuel Gil Peyrot 35c44285a8 README.LIN: Update from autotools to meson 2020-09-20 22:49:40 +00:00
davg-qqq ba92804d9f GTK: Update autotools config to use gtk3
This will depend on 3.24 as this is the only version I have available.
If someone else confirms it works on an older version we can lower it.
2020-09-20 22:42:48 +00:00
Emmanuel Gil Peyrot 0abe38ce76 GTK: Fix build with AGG
This was prevending HUD from building.  Note that this doesn’t make it
work fully yet, as the pixel format seems wrong, as if AGG was assuming
RGB888 while the buffer is actually RGBx8888 or something like that.

Fixes #375.
2020-09-20 22:39:25 +00:00
Emmanuel Gil Peyrot 383e315b21 meson: Downgrade minimum version to 0.53
I tested it on Ubuntu 20.04 and it works properly.
2020-09-20 21:01:31 +00:00
Emmanuel Gil Peyrot 46c7e34439 meson: Add missing dependency on threads
Thanks @davg-qqq for noticing, I could reproduce on Ubuntu 20.04, but
not on ArchLinux, where I originally wrote this code.
2020-09-20 21:01:17 +00:00
zeromus 2ac787a855
Merge pull request #370 from linkmauve/fixup
Fix two issues in the recent GTK+ move
2020-09-09 18:05:53 -04:00
Emmanuel Gil Peyrot bfeff3fe66 GTK: Restore content scaling
It had been broken in eabfcb71be when
moving from GtkVBox to GtkBox removed homogeneous=false.
2020-09-09 23:54:06 +02:00
Emmanuel Gil Peyrot 3ecbb29863 GTK: Fix a build issue in a lambda
It wasn’t correctly capturing its outer variable.
2020-09-09 23:53:20 +02:00
zeromus 5dd62b214b
Merge pull request #368 from linkmauve/gtk3
Port DeSmuME to GTK+ 3.24
2020-09-09 17:20:13 -04:00
Emmanuel Gil Peyrot a1ea27d7f9 GTK: Restore the open recent submenu
This now only uses GtkRecentManager to populate the menu.
2020-09-09 23:17:43 +02:00
Emmanuel Gil Peyrot 7435ffaefd GTK: Restore savestate menu
This is now using an action parameter to send the slot to save to/load
from.

There was a previous comment about Shift-Fn being broken and a
workaround using Key_Press(), but it doesn’t seem to be broken anymore
so we can use the accelerators instead and remove a static variable.
2020-09-09 22:46:39 +02:00
Emmanuel Gil Peyrot 5629855183 GTK: Properly guard HUD function when AGG isn’t found 2020-09-04 14:40:51 +02:00
Emmanuel Gil Peyrot 74cd070e61 GTK: Reimplement the toolbar using GtkBuilder 2020-09-04 14:40:50 +02:00
Emmanuel Gil Peyrot ef0e3b3adf GTK: Migrate from GtkAction to GAction 2020-09-04 14:40:32 +02:00
Emmanuel Gil Peyrot 0c9a8a5282 GTK: Replace deprecated gdk_window_get_pointer() with gdk_window_get_device_position() 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot 3c32aeb0f5 GTK: Replace deprecated GtkHButtonBox with horizontal GtkButtonBox 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot ad9e7e8be1 GTK: Replace deprecated GtkHRange with horizontal GtkRange 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot 2423a9bb5e GTK: Replace stock texts with their actual string 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot 96bc8977bd GTK: Replace GtkTable with GtkGrid, in a UI string 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot d680c4be51 GTK: Use modern GDK accessors to its Cairo context 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot 13b5c0fd01 GTK: Migrate from gtk_main() to GtkApplication
This will make it possible to use GAction to replace the deprecated
GtkAction and GtkToggleAction and such.
2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot cc9d7a1450 GTK: Replace GtkFileChooserDialog with GtkFileChooserNative
This one uses the native file chooser the user is used to, which can be
GTK’s on Linux but a more familiar one on other OSes.  If
xdg-desktop-portal is installed, it can even use the DE’s native one on
Linux.
2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot c1efe4f475 GTK: Remove usage of deprecated GtkMisc 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot eabfcb71be GTK: Replace deprecated GtkVBox/GtkHBox with GtkBox 2020-09-01 20:47:44 +02:00
Emmanuel Gil Peyrot e4b07d2f4d Name various threads to ease debugging 2020-09-01 00:05:27 +02:00
Emmanuel Gil Peyrot 5428763559 task: Add the ability to name threads 2020-08-31 23:56:14 +02:00
Emmanuel Gil Peyrot e70e065ffe rthreads: Add the ability to name threads 2020-08-31 23:56:14 +02:00
Emmanuel Gil Peyrot 917db3ecac rthreads: Fix documentation (void function doesn’t return) 2020-08-31 23:56:14 +02:00
Emmanuel Gil Peyrot 4c53f62967 GTK: Remove deprecated gtk_widget_modify_bg()
If we want to change the style of a widget, we should use CSS nowadays.
2020-08-29 23:13:24 +02:00
Emmanuel Gil Peyrot e808897c47 GTK: Reenable deprecation warnings
At this point we got a fully (?) functional gtk3 port, but it uses a ton
of deprecated functions that will be removed in gtk4.  Better enable the
warnings so that we know what to fix before then.
2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 81f0ded5b6 GTK: Restore drawing capability
The expose_event signal has been renamed draw.
2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 89f5e50039 GTK: Use accessor to retrieve GtkAdjustment value 2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 87c2377c6a GTK: Fetch widget’s window with the relevant function
At this point, this version builds.  It is full of deprecated widgets
and functions though, which will have to be cleaned over time.  It also
doesn’t display any visuals in the DS emulation part yet.
2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot cdbad3d05a GTK: Fetch dialogs’ content area with the relevant function 2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 3927aa4422 GTK: Rename GDK keys to their new name 2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 70733a55b4 GTK: Switch to gtk3 instead of gtk2
All deprecation warnings are disabled for now, they will be reenabled at
a later point.
2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 6823aed6dd GTK: Add a meson build system 2020-08-29 20:53:15 +02:00
Emmanuel Gil Peyrot 2a5150ff7d GTK: Add missing include when neither OSMesa nor GLX are enabled 2020-08-29 04:06:56 +02:00
Emmanuel Gil Peyrot 8e31ecd9c4 Remove executable bit from source files 2020-08-29 01:31:52 +02:00
zeromus f6064006d2 re-add windows specific stuff, properly ifdefing it? (should fix #360) 2020-08-19 17:11:27 -04:00
zeromus 79c6ab430a
Merge pull request #357 from Yackerw/master
Add many debugging features
2020-08-19 00:39:22 -04:00
zeromus e654d1e7e9 winport - fix OamView bug (proper obj priority wasn't being used when rendering it, causing many composite sprites to be rendered more or less in the opposite Z-order due to LATER obj drawing on top (whereas lower obj are supposed to draw on top). fixes #358 2020-08-16 19:38:58 -04:00
Yackerw 7591028509 Removed Windows specific stuff 2020-08-15 20:07:34 -04:00
Yackerw 5bd5c630f1 Added debugging tools
Breakpoints, memory breakpoints, made disassembler better in general
2020-08-15 16:02:38 -04:00
zeromus 316103d2ec
Merge pull request #352 from PypeBros/master
Fix directory crawling on symlink-capable systems
2020-08-06 14:47:48 -04:00
PypeBros 5a368922c9 Fix directory crawling on symlink-capable systems 2020-08-06 18:34:14 +02:00
zeromus 209dfca35f fix chinese filenames in savestates and dct files (fixes #343) 2020-07-12 14:33:26 -04:00
zeromus fc3d81e73a cleanups related to prior commits 2020-06-18 15:58:16 -04:00
Mattia Rombi 622b763bf1 Use DeSmuME name - but not in firmware.cpp
1. didn't like every line in the file being touched
2. DESMUME_NAME is cosmetic; it may have had special meaning in this file. I didnt feel like investigating it any more
2020-06-18 15:53:21 -04:00
Mattia Rombi ebf073e5c0 Update .gitignore for Visual Studio 2020-06-18 21:14:50 +02:00
Mattia Rombi 357843c543 winport: add title size check and fixed code style/typo 2020-06-18 21:14:50 +02:00
Mattia Rombi 3466c7f69a winport: update main window title with current game 2020-06-18 21:14:50 +02:00
zeromus 3ec927de75
Merge pull request #331 from thesourcehim/master
GTK: fix audio interpolation mode not being saved or loaded from config
2020-05-10 09:32:05 -04:00
thesource f007ef655e GTK: fix audio interpolation mode not being saved or loaded from config 2020-05-10 16:29:01 +03:00
zeromus 255f5c8b91
Merge pull request #330 from davg-qqq/feat-linux-msaa-ui
Linux GTK Port: Fix config for new MSAA options
2020-05-08 18:18:27 -04:00
davg-qqq 4186c33745 Linux GTK Port: Fix config for new MSAA options
a289055e removed the code that updated the old "multisampling enabled"
config. This fix adds a new config value for the multisampling size and
updates the old config in sync. When loading the config, the new
multisampling size value is prioritized, but if it is 0 (possibly not set)
then it falls back to the previous logic using the old boolean config
value.
2020-05-09 00:07:38 +02:00
zeromus 1305dd1e49
Merge pull request #329 from davg-qqq/feat-linux-msaa-ui
Linux GTK Port: Add more detailed MSAA options
2020-05-08 16:36:14 -04:00
davg-qqq a289055e1c Linux GTK Port: Add more detailed MSAA options 2020-05-08 22:21:18 +02:00
zeromus 76fafe0230 winport - fix drag & drop and recent roms menu so I can verify whether any of that stuff works in chinese 2020-05-05 02:00:58 -04:00
zeromus d4c17e5f8d winport - fix some unicode file opening crap 2020-05-05 01:49:14 -04:00
zeromus 1cc14031c9
Merge pull request #327 from davg-qqq/fix-osmesa-crash
Fix unhandled null causing crash when using osmesa with nvidia driver
2020-05-03 16:52:43 -04:00
davg-qqq a1791a24f0 Fix unhandled null causing crash when using osmesa with nvidia driver 2020-05-03 19:34:49 +02:00
zeromus d556c99771 Merge branch 'master' of https://github.com/TASVideos/desmume 2020-04-27 20:29:05 -04:00
zeromus 55253504e3 fix spurious warning in exporting battery save memory even when it works (fixes #325) 2020-04-27 20:28:56 -04:00
zeromus 2d1eee284c
Merge pull request #323 from lucianposton/fix-glade
Fix glade UI file path in local builds
2020-04-23 07:27:27 -04:00
Lucian Poston 827af7a494
Update GLADEUI_UNINSTALLED_DIR to current dir hierarchy 2020-04-23 05:21:15 -05:00
Lucian Poston bf5065859b
Add debug output when failing to find glade ui file 2020-04-23 05:19:50 -05:00
zeromus 7fdf800b58 fix ddraw HW breaking after windows lock screen 2020-04-22 15:47:31 -04:00
zeromus c52ee0386e remove accidental debug code ("DebugBreak") 2020-03-31 20:02:03 -04:00
zeromus 5f76ba8bb3 I couldn't make any sense out of the wifi saving code, and I was pretty sure I saw a variable not getting saved, so I redid it. Did I do it right? I don't know, you tell me. Also in this commit I reformatted all of wifi.cpp because I had lost 10 minutes or more to not being able to find `variable = value` or `variable=value` due to it being inexplicably `variable\t=value` all over that file and uhmmmmmmmmmmmm no. 2020-03-31 00:18:54 -04:00
zeromus 600957a840 fix compilation issue when logging is enabled 2020-03-31 00:17:19 -04:00
zeromus 347a3aa833 remove x86 from windows port since there are now known code generation bugs in the wifi which definitely pose user-facing problems 2020-03-31 00:16:57 -04:00
zeromus d787b737e3 winport: dont crash if hitting ctrl+r when no rom is loaded 2020-03-05 23:44:27 -05:00
zeromus bca921ddae
Merge pull request #316 from perallard/master
Issue: can't compile on Arch Linux #304
2020-01-20 16:15:36 -05:00
Per Allard f814164de2 Issue: can't compile on Arch Linux #304
The build failure(s) come from the fact that the posix frontends currently
use deprecated functions for multi-threading. The offending functions are:
g_thread_create and g_thread_supported, both deprecated since 2.32.
g_thread_create is replaced by g_thread_new and g_thread_supported is no
longer needed at all for glib >= 2.32 threading is automatically initialized
when the program starts.
2020-01-16 23:29:01 +01:00
zeromus ce2c1a6774
Merge pull request #312 from sietschie/master
set fullscreen background to black for gtk frontend
2019-12-11 10:54:15 -05:00
sietschie 25f7469920 set fullscreen background to black for gtk frontend 2019-12-11 14:18:51 +01:00
zeromus 7a3699aba6
Merge pull request #308 from astoliar/fix_to_compile_offsetof
Fix to compile with gcc
2019-11-20 14:58:02 -05:00
Andres Stoliar 3658f3c949 Fix to compile with gcc 2019-11-20 10:58:53 -03:00
zeromus 7df351850c
Merge pull request #306 from Aikku93/patch-1
Add interpolation at loop boundary
2019-10-28 01:08:46 -04:00
Ruben 0dc75ca089
add interpolation at loop boundary
Fixes crackling in small streams and correctly interpolates chip-style samples
2019-10-28 15:28:09 +11:00
zeromus 46980d7732 fix crc calculation method for cheats DB 2019-09-25 22:04:58 -04:00
zeromus 9e6b4f128f
Merge pull request #289 from YuGiOhJCJ/gtk-warning-fix-1
Move a statement later to avoid a GTK warning
2019-07-28 02:27:24 -04:00
Your Name b9317ad184 * desmume/src/frontend/posix/gtk/main.cpp(common_gtk_main): Modify a multiline comment to be a single line comment.
* desmume/src/frontend/posix/gtk/main.cpp(common_gtk_main): Add a comment to indicate that moving the following instruction implies that a GTK warning is shown.
* desmume/src/frontend/posix/gtk/main.cpp(common_gtk_main): Move a statement later to avoid a GTK warning.
2019-07-28 08:10:55 +02:00
zeromus 2185b6adfe
Merge pull request #288 from YuGiOhJCJ/gtk-firmware-language
Add the "Set firmware language" menu item
2019-07-26 08:50:05 -04:00
YuGiOhJCJ 07576fea31 * desmume/src/frontend/posix/gtk/config_opts.h: Add the "command_line_overriding_firmware_language" option.
* desmume/src/frontend/posix/gtk/config_opts.h: Add the "firmware_language" option.
* desmume/src/frontend/posix/gtk/main.cpp: Add the "setfirmwarelanguage" menu item.
* desmume/src/frontend/posix/gtk/main.cpp: Add the "setfirmwarelanguage" action entry.
* desmume/src/frontend/posix/gtk/main.cpp(CallbackSetAudioVolume): Fix its parameters ("*" attached to the name rather than the type).
* desmume/src/frontend/posix/gtk/main.cpp(SetAudioVolume): Fix its indentation (spaces replaced by a tab).
* desmume/src/frontend/posix/gtk/main.cpp(SetFirmwareLanguage): Add this function.
* desmume/src/frontend/posix/gtk/main.cpp(CallbackSetFirmwareLanguage): Add this function.
* desmume/src/frontend/posix/gtk/main.cpp(common_gtk_main): If the command line overriding is enabled, then use the language set on the GUI.
2019-07-26 08:48:18 +02:00
zeromus 1e0a29ee27
Merge pull request #287 from YuGiOhJCJ/gtk-audio-volume
Add the "Set audio volume" menu item
2019-07-24 03:09:57 -04:00
YuGiOhJCJ ac42f1d1bf * desmume/src/frontend/posix/gtk/config_opts.h: Add the "audio_volume" option.
* desmume/src/frontend/posix/gtk/main.cpp: Add the "setaudiovolume" menu item.
* desmume/src/frontend/posix/gtk/main.cpp: Add the "setaudiovolume" action entry.
* desmume/src/frontend/posix/gtk/main.cpp(SetAudioVolume): Add this function.
* desmume/src/frontend/posix/gtk/main.cpp(CallbackSetAudioVolume): Add this function.
* desmume/src/frontend/posix/gtk/main.cpp(common_gtk_main): Add the "SNDSDLSetAudioVolume" function call.
* desmume/src/frontend/posix/shared/sndsdl.cpp: Add the "audio_volume" global variable.
* desmume/src/frontend/posix/shared/sndsdl.cpp(MixAudio): Add the "SDL_MixAudio" function call.
* desmume/src/frontend/posix/shared/sndsdl.cpp(SNDSDLGetAudioVolume): Add this function.
* desmume/src/frontend/posix/shared/sndsdl.cpp(SNDSDLSetAudioVolume): Add this function.
* desmume/src/frontend/posix/shared/sndsdl.h: Add the "audio_volume" global variable.
* desmume/src/frontend/posix/shared/sndsdl.h(SNDSDLGetAudioVolume): Add this function.
* desmume/src/frontend/posix/shared/sndsdl.h(SNDSDLSetAudioVolume): Add this function.
2019-07-24 08:20:18 +02:00
rogerman de198c00a0 Colorspace Handler: Add support for AVX-512, new 16-bit to 32-bit alpha agnostic conversion functions, and minor optimizations to some functions.
- New 16-bit to 32-bit alpha agnostic conversion functions: ColorspaceConvert555XTo888X_*(), ColorspaceConvert555XTo666X_*().
- Minor optimizations to the following functions: ColorspaceConvert555To8888_*(), ColorspaceConvert555To6665_*(), ColorspaceApplyIntensity32_*().
2019-05-20 14:57:34 -07:00
zeromus 2d2320f4d1
Merge pull request #276 from fpscan/patch-4
typo related updates
2019-05-07 19:46:32 -04:00
Ömercan Kömür 8a826d4230
Update resources.rc 2019-05-08 00:38:15 +03:00
Ömercan Kömür 6cf9f1a98d
typo related updates
Since full text unable to read when it was 35, changed to 71, so its readable right now.
Typo corrected
Added Windows Border to sound setting to make it more important
“Wi-fi” is used to certify the interoperability of wireless computer networking devices. So Wifi changed to Wi-fi
2019-05-07 23:49:29 +03:00
zeromus 79633495c4
Merge pull request #275 from fpscan/patch-1
update reoursces.rc
2019-05-07 15:11:25 -04:00
Ömercan Kömür 85cb5b6c65
update reoursces.rc
Missed Caption added
2019-05-07 22:06:35 +03:00
zeromus 21df3059f4
Merge pull request #274 from awforsythe/master
Clarify parameter names for gui.setlayermask
2019-05-04 21:53:26 -04:00
Alex Forsythe 6e5c9dbaf8 Clarify parameter names for gui.setlayermask
This is a tiny follow-up to PR #273, with no actual changes in
functionality. In short:

- gui.setlayermask(top, bottom) -> gui.setlayermask(main, sub)

Display layers correspond to GPU (main or sub), not to screen (top or
bottom), so this change just updates the Lua parameter names to reflect
that.
2019-05-04 01:02:32 -05:00
zeromus be7f22a7f9
Merge pull request #273 from awforsythe/master
Add Lua function gui.setlayermask
2019-05-04 00:16:37 -04:00
Alex Forsythe cc9335eea6 Add Lua function gui.setlayermask
This change adds a Lua function called gui.setlayermask, which allows Lua
scripts to procedurally modify which render layers are visible. It takes
two arguments: one integer bitfield representing the visibility states for
the main GPU, and the other representing the sub GPU. For example: 0b11111
shows all layers, 0b00000 hides all layers, 0b00001 shows only layer 0
(BG0), 0b10000 shows only layer 5 (OBJ), etc.

Since display layer state is coupled to the frontend, and since frontends
are entirely separate between platforms (i.e., on Windows, toggling
display layer state requires updating the GUI state asl well), this
function is only supported and tested on the Windows build. On MacOS and
Linux, gui.setlayermask will simply return 0 without doing anything.
2019-05-03 21:51:07 -05:00
zeromus 851274b3e8
Merge pull request #269 from Prof9/master
Fix Action Replay DS code type 0x0E
2019-04-24 14:19:57 -04:00
Prof. 9 5c557440d7 Fix Action Replay DS code type 0x0E patch lines not being skipped over when execution status is false. 2019-04-24 20:05:49 +02:00
zeromus 463fc545b7
Merge pull request #268 from Jules-A/msvc2019
Fix MSVC2019 solution loading and compiling
2019-04-24 13:59:34 -04:00
Jules Anthony cc4446ab29 Fixes MSVC2019 solution loading and compiling. Due to 2019 dropping XP support by default, anyone needing XP compiles will need to download the v141 toolkit as an extra and manually configure TargetPlatform and PlatformToolset. 2019-04-24 18:35:44 +08:00
zeromus 55c158d305 fix lua random crash / unreliability introduced by commit 43fcaf68f1
fix strange non-functional static-assert-likes designed to prevent this problem, by turning them into actual static asserts
2019-04-19 16:18:29 -04:00
rogerman ce8275fca1 Render3D: Add an actual AVX2-accelerated code path for setting up clear images. 2019-03-22 00:25:38 -07:00
rogerman 331cfa3596 Render3D: Demote some functions and classes to only require AVX instead of AVX2 where appropriate. 2019-03-21 22:43:09 -07:00
rogerman 96df0343f7 GPU: The info for native lines and custom lines are now handled at the display level rather than at the engine level. By doing this, we no longer assume that engines will maintain a constant association to a particular display for all lines; rather, we now take into account that an engine/display association may change mid-frame. Fixes #132. 2019-03-21 21:18:50 -07:00
zeromus f0737b679f winport - change mic sequence loading to use _0 as a signal, and fix bug in paths with . earlier in the name before the extension 2019-03-19 14:18:02 -04:00
rogerman be2735b3c5 OpenGL Renderer: Fix bug where resizing the framebuffer may cause subsequent rendering to fail. This bug affected OpenGL 3.2 only. (Regression from commit fa8cf5a.) 2019-03-18 00:03:03 -07:00
rogerman fe428fdda0 Cocoa Port: Fix bug where the HUD would appear smaller than intended on Retina displays.
- Also make the HUD scaling curve more precise.
2019-03-17 23:32:01 -07:00
rogerman c6269ca7ff Firmware: Initializing the fake firmware and applying the firmware settings from an internal firmware config struct are now split into separate operations. This allows the user to freely choose between using internal firmware config or using an external firmware.dfc file for their firmware settings, regardless of whether or not they are booting from external firmware. Fixes #259.
- Also fixes a compiling issue with compilers that are not MSVC 2015 or later. (Regression from commit ac94244.)
2019-03-17 21:55:00 -07:00
zeromus 175a471e5e actually limit mic samples to 254 2019-03-17 23:38:34 -04:00
zeromus ac94244757 support recording mic samples in header and current mic sample selection. tested reading and writing, but no more thoroughly than that. this requires a new movie version (mic sample selection stored kind of like an analog coord, a 3-digit number in dsm) 2019-03-17 23:34:54 -04:00
zeromus 3dc7e6d70e fix warnings from weird code 2019-03-17 23:23:48 -04:00
zeromus aef0374ed8 fix warnings and 64bit problems 2019-03-17 23:12:08 -04:00
zeromus 065d9e4321 fix printf warning 2019-03-17 23:08:21 -04:00
zeromus 9805fe3de4 winport - support multiple mic samples, selected with new hotkeys 2019-03-17 22:55:53 -04:00
zeromus ec351f3015 fix warnings 2019-03-17 22:53:55 -04:00
zeromus 72ecc8e66c quick fix to stop OSD from crashing if we try to print a line to the OSD before the frontend is fully initialized 2019-03-17 22:53:40 -04:00
zeromus ed92e1ef68 get rid of printf warnings 2019-03-17 22:02:40 -04:00
rogerman fe9541b448 NDSSystem.cpp: Make firmware loading more robust. 2019-03-10 00:57:16 -08:00
rogerman 8fa60fafd3 Firmware: Ensure that memory leaks don't happen when errors occur. 2019-03-10 00:53:26 -08:00
rogerman 42817475c2 OpenGL Renderer: Fix bug where Edge Mark and Fog were not properly being handled when the framebuffer is cleared using a clear image, such as in "Sonic Chronicles: The Dark Brotherhood". (Regression from commit 0dab591.) 2019-02-06 23:17:35 -08:00
rogerman bb25742512 GPU: Fix some compiler warnings. 2019-02-06 18:43:11 -08:00
rogerman fa8cf5a6dc OpenGL Renderer: Fix bug where the Special Zero Alpha Blending option would cause graphical glitches in certain games while MSAA was enabled on GPUs that support the GL_ARB_sample_shading extension. (Regression from commit e4ec1d6.) 2019-02-06 17:57:44 -08:00
rogerman 3c87d8b268 OpenGL Renderer: In GLX, there is no need to load glBlendEquation(), which is an OpenGL v1.2 function, since the current version of GLX (v1.4, circa 2005) implicitly supports OpenGL v1.3. Fixes #254. (Regression from commit ef3e93b.) 2019-02-06 10:23:17 -08:00
rogerman ee7d707acf OpenGL Renderer: Fix compiling for non-Cocoa ports. (Regression from commit ef3e93b.) 2019-02-05 11:58:31 -08:00
rogerman ef3e93b4e9 OpenGL Renderer: Fog rendering now uses dual-source blending if available. (OpenGL 3.2 only.) 2019-02-05 02:43:20 -08:00
rogerman fc4f12efd0 OpenGL Renderer: In the shaders, replace texture() with texelFetch() wherever appropriate. (OpenGL 3.2 only.)
- Also do some minor code cleanup.
2019-02-05 01:57:20 -08:00
rogerman e433a6d80e SoftRasterizer: Fix a bug where some games would occasionally have unreliable rendering or precipitous performance drops. (Regression from commit e06d11f.) 2019-02-04 23:40:15 -08:00
rogerman 242ccb26cf GFX3D: Oops! Make the clipper modes actually work as intended instead of ALWAYS using ClipperMode_Full. 2019-02-02 20:39:47 -08:00
rogerman 4f8b788e97 Render3D: Refactor the Render3D class in order to better reflect how the 3D renderers do things now. 2019-02-01 17:57:33 -08:00
rogerman 3e73a550e3 OpenGL Renderer: Ensure that all color attachments are assigned sequentially without gaps, and ensure that fragment shaders write out a value to each assigned attachment in all cases. This is being done to try and satisfy extremely picky AMD drivers that can do crazy-go-nuts things when the color attachments are not meticulously managed this way. 2019-01-29 16:50:47 -08:00
rogerman e4ec1d634a OpenGL Renderer: Better emulate the special NDS rendering quirk for drawing front-facing fragments on top of back-facing opaque fragments. Completely fixes the Customize screens in Sands of Destruction. (Related to commit 8944328.)
- Specifically, translucent polygons now properly render on top of the back-facing opaque fragments from the opaque polygon rendering pass. Do note that emulating this special NDS rendering quirk is still not complete, as it does not account for drawing any translucent polygons on top of the opaque fragments of back-facing partially-translucent alpha-textured polygons. However, I have not seen any games that actually go so deep into such an edge case. If there is such a game, then this issue will need to be revisited.
- Now that this special rendering quirk is more accurate, this does cost some performance. However, since this rendering quirk is controlled by the "Enable Depth L-Equal Polygon Facing" option, which is OFF by default, this performance loss is deemed acceptable in favor of the increased accuracy.
2019-01-29 01:20:13 -08:00
zeromus 1c937adb9e fix #250, probably 2019-01-27 12:24:35 -05:00
rogerman e06d11f6df GFX3D: The polygon clipping stage now occurs before any polygon sorting, allowing for the sorting of smaller lists. This can be a significant performance improvement for some 3D scenes with high polygon counts.
- 3D renderers no longer perform polygon clipping themselves, instead relying on GFX3D to do it. By default, the clipping mode is ClipperMode_DetermineClipOnly, but 3D renderers can change this by overriding the virtual method Render3D::GetPreferredPolygonClippingMode() and returning their preferred clipping mode.
2019-01-23 16:03:09 -08:00
rogerman b8e85e0c9d OpenGL Renderer: Revert the texture sampling hack in commit 02cd950 -- it causes graphical glitches in Sands of Destruction, especially visible within the Sky Gaol. 2019-01-23 14:44:47 -08:00
rogerman 4cd19ce522 OpenGL Renderer: Before rendering, determine the list of clipped polygons, and then only render the clipped polygons, just like how SoftRasterizer does it. Most 3D games will see a significant performance improvement. For certain games with very high polygon count scenes, those games will see a massive performance boost. 2019-01-21 16:21:32 -08:00
rogerman bb93a0a365 OpenGL Renderer: Fix an occasional crashing bug that may occur when initializing the Clear Image textures. (Regression from commit 3dc860b.) 2019-01-18 16:20:11 -08:00
rogerman d70bc19d9a OpenGL Renderer: Oops!!! Fix a critical bug that completely broke all rendering!!! (Regression from commit ab3d489.) 2019-01-18 14:32:13 -08:00
rogerman ab3d48947a OpenGL Renderer: Reduce some buffer related synchronization in BeginRender(). 2019-01-18 13:54:37 -08:00
rogerman 02cd950b02 OpenGL Renderer: In an effort to try and reduce graphical glitches whenever users try to run enhancements that were never native to the NDS to begin with, the texture sampling method is now being forced to clamp for polygons with texture coordinates of either 0.0 or 1.0. 2019-01-17 23:03:52 -08:00
rogerman 0dab5917b6 OpenGL Renderer: Fix a bug where the incorrect buffer would be cleared when trying to clear the Fog attributes buffer while Edge Mark is disabled. Partially addresses #247. (Regression from commit 21a3fae.) 2019-01-16 16:19:33 -08:00
rogerman d63ae63d1b OpenGL Renderer: Fix compiling for non-Cocoa ports. (Regression from commit c9db815.) 2019-01-16 15:46:13 -08:00
rogerman c9db815171 OpenGL Renderer: Improve the overall reliability of CPU-to-GPU buffer writes, fixing a bug where certain polygons would intermittently flicker in some games. (OpenGL 3.2 only.) 2019-01-16 11:57:36 -08:00
rogerman 7990e6c3f3 OpenGL Renderer: Fix a bug where Fog rendering would fail when used with MSAA. Fixes #246. (OpenGL 3.2 only. Regression from commit 21a3fae.) 2019-01-15 21:47:50 -08:00
zeromus 6ed5cf8420 winport - fix bug using all available window size when maximizing and fullscreening 2019-01-16 00:10:25 -05:00
rogerman 3dc860b248 Render 3D: Simplify the code a little by removing the working Polygon ID buffer for clear images.
- As a collateral improvement, this change also works as a minor optimization for the OpenGL Renderer for games that use clear images.
2019-01-14 16:13:08 -08:00
rogerman 26504031ff OpenGL Renderer: Partially revert commit 0f045d4 -- don't do the Z adjust in the vertex shader. Apparently, we shouldn't need to explicitly do this in OpenGL, as this adjustment should be automatic. Fixes a graphical glitch that can occur in "Sonic Chronicles: The Dark Brotherhood". 2019-01-14 15:17:13 -08:00
rogerman 0f045d430c OpenGL Renderer: When rendering the main geometry, adjusts all Z-positions in the vertex shader so that Z is more likely to naturally fall between the depth range of 0.0 and 1.0. Further mitigates the performance cost of using the NDS-Style Depth Calculation option. 2019-01-14 12:08:33 -08:00
zeromus 9b1ce0efc3 add --slot1-no8000prot, fixes #183 2019-01-13 14:51:51 -05:00
rogerman 066366184c Video Filters: Fix an issue where the internal buffers were not created using a guaranteed alignment, possibly causing a segfault on AVX2-enabled systems. Fixes #245. 2019-01-11 00:40:16 -08:00
rogerman f5d90a77c1 GPU: Fix graphical glitch that can occur when frameskip is enabled, running a custom resolution on a multicore CPU system. (Regression from commit abc0649.) 2019-01-10 21:33:16 -08:00
zeromus 605ce35812 winport - restore some tool windows which are minimized, when their menu option is selected 2019-01-10 20:54:31 -05:00
rogerman 4a13a03f46 Windows Port: Fix compiling on 32-bit Windows. (Regression from commit abc0649.) 2019-01-09 23:40:32 -08:00
rogerman abc0649ad2 GPU: Significantly improve the performance of HD rendering for many 3D games.
- Specifically, if the previous frame is determined to draw the entire HD layer directly over the backdrop layer, then the current frame's entire custom framebuffer is asynchronously cleared using line 0's backdrop color since most games will keep the backdrop color constant for all scanlines. Because this is a common rendering case, many 3D games should see a performance improvement when running very large HD framebuffers (8x or higher).
- Also fix a compiling issue for non-SSE2 systems. (Regression from commit 3890431.)
2019-01-09 22:41:42 -08:00
rogerman 3890431154 GPU: Working engine buffers are now set up in advance, asynchronously, starting after line 191. 2019-01-08 23:47:36 -08:00
rogerman 0f87ada863 types.h: Add support for atomic variables.
- Also clean up some stuff that doesn't belong in this file.
2019-01-08 17:17:30 -08:00
rogerman 50f42fae55 OpenGL Renderer: More minor shader efficiency tweaks when using the NDS Style Depth Calculation option. 2019-01-06 00:23:17 -08:00
rogerman 85ee9e0ff9 OpenGL Renderer: Fix some interactions between Edge Mark and the Special Zero Alpha Blending option. (Regression from commit 6f8c060.)
- Also remove some extraneous stencil buffer clears.
2019-01-05 12:49:16 -08:00
rogerman 40a4b3cdcf OpenGL Renderer: Do some minor shader efficiency tweaks. (OpenGL 3.2 only.) 2019-01-04 18:48:28 -08:00
rogerman 21a3fae0f3 OpenGL Renderer: Do some minor efficiency, stability, and consistency tweaks. 2019-01-02 01:10:59 -08:00
rogerman f97c633441 OpenGL Renderer: Okay, let's try using GL_AMD_conservative_depth for those AMD drivers that outright lie about supporting GL_ARB_conservative_depth. (Related to commit 4d6a132 and commit 39f9483.) 2018-12-30 02:12:54 -08:00
rogerman 39f9483034 OpenGL Renderer: Also require GLSL 4.00 when using the GL_ARB_conservative_depth extension. (Related to commit 4d6a132.) 2018-12-30 01:36:54 -08:00
rogerman 4d6a132116 OpenGL Renderer: Mitigate some of the performance penalty of using the NDS Style Depth Calculation option.
- GPUs that support the GL_ARB_conservative_depth extension will benefit more from this commit. (OpenGL 3.2 only.)
- Also fix some miscellaneous bugs.
2018-12-29 22:37:37 -08:00
rogerman 0c0bd5144e Cocoa Port: Do a small optimization when doing video output framebuffer fetches for Metal display views. 2018-12-28 15:39:09 -08:00
rogerman aeea0ea46a OpenGL Renderer: Remove the material_6bit_to_float LUT, since we already have an equivalent existing LUT -- divide6bitBy63_LUT. 2018-12-26 22:35:34 -08:00
rogerman c1357c1451 OpenGL Renderer: Do some minor performance improving tweaks.
- Most notably, fix a performance regression where polygon drawing was no longer getting batched due to an incorrect polygon-facing test. (Regression from commit dab414c.)
2018-12-26 19:48:22 -08:00
rogerman 062d9a65a7 Cocoa Port: Do a minor optimization for Metal display views running on macOS v10.13 High Sierra and later. 2018-12-24 21:35:17 -08:00
rogerman 022cf3c702 Cocoa Port: Looks like all macOS versions 10.13 High Sierra and later don't support P-Buffers, so properly handle this error condition and disable the OpenGL 3D renderer when trying to run it without FBOs on these newer macOS versions. 2018-12-22 14:53:19 -08:00
rogerman 7bb438020b OpenGL Renderer: Fix bug where the OpenGL renderer would completely fail to run if the user's ancient GPU doesn't support shaders. (Regression from commit 7080e21.)
- Also do some minor improvements to the code robustness when creating an OpenGLRenderer object.
2018-12-21 16:21:44 -08:00
rogerman 589524823b OpenGL Renderer: Oops! Finish doing the shader rework started in commit 7080e21 for legacy OpenGL so that it works the way its supposed to. Doing this now fixes legacy OpenGL for (hopefully) all GPU drivers and also allows for all of the same shader optimizations as OpenGL 3.2. 2018-12-18 20:21:18 -08:00
rogerman d3e4b6010c OpenGL Renderer: Eliminate the requirement for 66 varying floats in the Fog shader by replacing the varying floats with constants. Also fixes an issue with the geometry shader in legacy OpenGL. (Regressions from commit 7080e21 and commit 37afaef. Fixes #240.) 2018-12-18 16:47:53 -08:00
zeromus 30212212b5 winport - set PreferredToolArchitecture to x64 2018-12-18 13:53:42 -05:00
rogerman 37afaefa2f OpenGL Renderer: Replace the accuracy/performance tradeoff "Enable Depth Equals Test Tolerance" with "Enable NDS-Style Depth Calculation", where disabling this option allows the host GPU to natively calculate depth which significantly improves performance in many games.
- New Behavior: In addition to emulating the existing Depth Equals Test Tolerance, NDS-Style Depth Calculation accounts for all NDS depth calculations within the fragment shader. Most notably, disabling this option forgoes the W-depth / Z-depth differentiation that the NDS uses, instead preferring the GPU's native Z-depth calculation. Using the GPU's native depth calculation significantly improves performance, but many games use W-depth calculations or are sensitive to subtleties in the Z-depth calculation, and so this option must remain ON by default for compatibility's sake.
- Also fixes a shader initialization issue on the Windows port. (Regression from commit 7080e21.)
2018-12-18 10:50:41 -08:00
rogerman 7080e2156b OpenGL Renderer: Rework the rendering shaders so that the shader program code is more dynamically generated. This may yield some performance improvement for certain 3D rendering cases, especially when running on lesser GPUs with fewer and/or slower shader execution units. 2018-12-17 16:16:50 -08:00
rogerman ae8fb2c3bb GPU: Fix a bug where using VRAM as a display capture source would sometimes cause graphical glitches under certain conditions. (Regression from commit 2c6a5f9.) 2018-12-17 15:33:16 -08:00
zeromus 88d930ce82 winport - fix loading files named things like Splookékrong from commandline, fixes #238 2018-12-15 17:26:28 -05:00
rogerman 7ff5c5eece Render 3D: Improve the overall rendering accuracy of Edge Mark. Most notably, Edge Mark now properly renders at screen edges. As of now, the current algorithm is as accurate as its ever going to get under our current 3D rendering engine. 2018-12-14 17:08:16 -08:00
rogerman e6d6f2e10d Cocoa Port: Fix a bug where clipboard copies and screenshots taken from Metal display views will cause the image to be Y-flipped. 2018-12-14 15:41:05 -08:00
rogerman 2c6a5f9868 GPU: Do some code cleanup of the display capture code. 2018-12-12 18:34:47 -08:00
zeromus e604631413 winport - fix things named like Blorkénflarge in the recent roms menu (#238) 2018-12-12 15:50:52 -05:00
rogerman 8c2379f6f8 Firmware: Fix various endianness issues. Most importantly, this fixes a bug with touch input not working correctly on big-endian systems. (Regression from commit bb38022.) 2018-12-12 02:49:44 -08:00
rogerman 471f53e506 Cocoa Port: Fix various issues on the PPC build.
- Fix compiling issues for big-endian systems.
- Fix bug where the Recent ROMs menu and also launching the app while loading a ROM file would fail to load the ROM on macOS v10.5 Leopard.
- Fix bug where GPU main memory display mode would show incorrect pixels on big-endian systems when running at 15-bit color depth.
- As an unintended collateral improvement, GPUEngineA::_HandleDisplayModeMainMemory() now has SSE2-accelerated versions for 18-bit and 24-bit color depths. This was done less for its performance benefit (main memory display mode is an extremely rare feature) and more for better code consistency and code completeness.
2018-12-11 17:45:36 -08:00
zeromus e56059872f winport - fix loading games named things like "Yokémorp". It was probably only open through drag and drop.
Probably broke japanese. If I did, write a bug so I can fix japanese and break latin characters again.
2018-12-11 18:20:39 -05:00
zeromus b5477b608b
Merge pull request #236 from NetwideRogue/master
don't clobber existing screenshots
2018-12-06 08:08:40 -06:00
Declan Hoare a3eebbac21
don't clobber existing screenshots 2018-12-06 23:59:18 +11:00
rogerman 35e834ff2c GFX3D: Revert the polygon sorting code back to its original state, which should result in a minor performance improvement for high polygon-count scenes.
- After years of testing, no one has reported running into the assert in gfx3d_ysort_compare() so I think we should be safe in reverting std::stable_sort() back to std::sort().
- For the sorting function, use gfx3d_ysort_compare_orig() since this function compiles down to fewer instructions than gfx3d_ysort_compare_kalven() does, resulting in better sorting performance.
- Of note, I'm pretty sure that SF commit r5132 is what fixed the original bug (see SF#1461 for more details) by getting rid of the NaN comparisons that were tripping up std::sort(). In the future, we should research why we're dividing by 0 in the first place, since r5132 is clearly a hack of a fix.
2018-12-05 14:37:33 -08:00
zeromus d80a84b762
Merge pull request #207 from cosmo-ray/fix-linux-gcc8.2-warnings
Fix gcc8.2 warnings on linux
2018-12-05 14:10:52 -06:00
zeromus 9ea1b5cbda
Merge pull request #223 from intact/gtk-fix-screenshot-path
Gtk+ Port: Use Desktop or Home as fallback directory for screenshots
2018-12-05 14:10:42 -06:00
rogerman 355e4a0fb4 OpenGL Renderer: Remove a now defunct framebuffer texture, significantly reducing VRAM usage at the higher resolutions. 2018-12-04 21:49:09 -08:00
rogerman 3d573e150f OpenGL Renderer: Properly clear the framebuffer during a power-off condition, just like how SoftRasterizer does it. (Related to commit 66b5da1 and commit 759a039. Fixes #234.)
- Also do a minor performance optimization by only doing the framebuffer clear once for each power-off condition, rather than repeatedly and unnecessarily clearing the framebuffer for each and every V-blank.
2018-12-04 21:23:58 -08:00
rogerman df22c6e14d Cocoa Port: Fix some intermittent issues related to launching the app while loading a ROM file (i.e. double-clicking an NDS ROM file to launch DeSmuME.app). 2018-12-04 01:26:27 -08:00
rogerman b9a8bafe8b GPU: Do some code cleanup of the display capture code. 2018-12-03 16:22:12 -08:00
zeromus fe93b70de8
Merge pull request #233 from Jules-A/hideConsole
[Windows] Hide the console window in the current session when disabling in menu.
2018-12-02 11:00:52 -06:00
Jules.A 157717a61f Hide the console window before freeing so if the console is attachted to another process (currently occuring under Win10) it is at least hidden. 2018-12-03 00:52:09 +08:00
rogerman c3614a7e95 GPU: Do some minor code cleanup. 2018-12-01 21:56:32 -08:00
rogerman fb8d937239 GPU: Fix bug where GPUEngineA::RenderLine_Layer3D() was trying to run with uninitialized values. (Regression from commit 37a8ca0.) 2018-12-01 21:38:03 -08:00
rogerman 37a8ca0983 GPU: Do a bunch of minor tweaks and code cleanup to the various pixel compositor methods. Significantly reduces the compiled code size.
- Of note, when running at custom resolutions, we are now being more aggressive in performing early tests for rejecting pixels as soon as possible. This may yield a minor performance improvement in some very specific rendering scenarios that require the window test.
2018-12-01 20:44:45 -08:00
rogerman 6a1d9e4848 GPU: Rendering complete OBJ layer lines is now SSE2-accelerated at the native resolution. This change is less of a performance enhancement and more of improving the code consistency. As of now, ALL complete OBJ layer lines, whether internally generated or from read from VRAM, whether rendering at native resolution or custom resolution, should now be SSE2-accelerated. This commit finalizes this concept. (Related to commit 8e9e7c4 and commit 60c01bd.) 2018-12-01 15:46:23 -08:00
rogerman 60c01bd63a GPU: Do a few more minor optimizations to rendering complete OBJ layer lines. Most notably, all complete OBJ layer lines, not just ones reading directly from custom VRAM, now benefit from the SSE2-accelerated code. 2018-11-30 20:12:58 -08:00
rogerman 9a53e8be69 GPU: Fix bug in GPUEngineBase::_PixelUnknownEffectWithMask16_SSE2() where blending effects for OBJ layers were being handled incorrectly. This bugfix only affects SSE2-enabled systems. (Regression from commit 8e9e7c4. Fixes #232.) 2018-11-30 17:10:56 -08:00
rogerman 2c5c2f6186 GPU: Use the same technique in the commit 6bcd19b GPUEngineBase::_CompositeVRAMLineDeferred() bug fix in order to do a tiny optimization to GPUEngineBase::_CompositeLineDeferred(). Also makes the code more consistent as well. 2018-11-29 22:25:37 -08:00
rogerman d0330fc96e Cocoa Port: Upgrade Interface Builder .xib files to 3.2 format with minimum deployment target of macOS 10.6. This change effectively drops support for building DeSmuME directly from a PowerPC Mac. Fixes #231.
- It is still possible to create a PowerPC binary, but this now requires some extra steps. From now on, you must use an Intel Mac running Mavericks or earlier to re-save the .xib files with a deployment target of macOS 10.5 in Interface Builder 3.2, and then use Xcode 3 to build a PowerPC binary using the Xcode 3 project file.
2018-11-29 22:02:07 -08:00
zeromus 3e37352bee winport - menu option to control CLI console visibility
fixes #230
2018-11-29 16:25:59 -06:00
rogerman 6bcd19b3cb GPU: Fix a bug in GPUEngineBase::_CompositeVRAMLineDeferred() where compInfo.target.xCustom was overstepping its bounds in X-dimension only custom buffers. This had the effect of causing undefined coloring when running at custom resolutions. (Regression from commit 8e9e7c4. Fixes #228 and fixes #229.) 2018-11-29 13:12:56 -08:00
zeromus f6938dc80a
Merge pull request #217 from SuuperW/paths
Paths
2018-11-29 15:04:31 -06:00
rogerman 8e9e7c4a2a GPU: Enable SSE2-accelerated custom-sized VRAM reads through the OBJ layer. This significantly improves the performance of many games, such as those that make use of dual-screen 3D, when running at the higher resolutions. 2018-11-29 02:00:21 -08:00
rogerman 6fc6ceb294 SoftRasterizer: For SSE2-enabled systems only, fix a rare graphical glitch that can sometimes occur in some games. (Regression from commit 21f04c9.) 2018-11-28 17:31:49 -08:00
rogerman 4f543aa8ca Cocoa Port: Yet another attempt at eliminating microstuttering in Metal display views. While it hasn't been completely eliminated yet, it shouldn't be as bad now. 2018-11-28 13:36:02 -08:00
rogerman 1f9b9e02a4 SoftRasterizer: Fix build issues on Windows. (Regression from commit 21f04c9.) 2018-11-23 15:30:11 -08:00
rogerman 21f04c9ef2 SoftRasterizer: Do some minor improvements to both performance and code size. 2018-11-23 14:59:13 -08:00
Roger Manuel b1abf50a01
Merge pull request #224 from Jules-A/WinOglCompatUI
WIP WinFrontend UI for the new OpenGL compatabilty tradeoffs.
2018-11-23 14:17:00 -08:00
Jules.A a51a6d4b6d Revert pointless changes that only saved a few lines. 2018-11-23 17:18:16 +08:00
Jules.A 20547d38a2 Remove unneeded bool initialisation and now that ini values are sanatized comboboxes can be initialised and set in a loop to save a few lines. 2018-11-23 17:05:40 +08:00
Jules.A 7e4a270644 Ughh... get rid of the extra semicolon... 2018-11-23 14:19:56 +08:00
Jules.A db1ca70f59 Fix label variable naming, spacing and finally get ini value checking working without requiring to check for the value that is getting changed, 2018-11-23 14:12:52 +08:00
Jules.A 156c590ca4 Check if user inputted values are correct on initiation. 2018-11-23 01:47:14 +08:00
Jules.A 54c6205e95 Fix up the UI and delete the unusused function (it's really not worth it until more settings can be checked). 2018-11-22 22:16:36 +08:00
rogerman d410b5c195 SoftRasterizer: Fix Z-depth calculations when compiling on MSVC. Fixes the overworld map in Dragon Quest IV. (Regression from commit d81a75c.)
- Apparently, MSVC has a more strict implementation of IEEE-754 single-precision floats (with 23-bit significands) than Clang and GCC, and so we going to drop 2 LSBs during the calculation so that we're multiplying z by a 22-bit significand. Coincidentally, this now matches what we're doing with the OpenGL renderer, so this tends to better code consistency.
2018-11-21 19:52:30 -08:00
Jules.A 30e9fb9c46 WIP WinFrontend UI for the new OpenGL compatabilty tradeoffs. Should be fully functional except for CheckValid3DSettingInt where I messed up so I left it commented out, honestly it's probably not needed anyways as there's already checks in place, it just doesn't update ini until you save settings. UI is still a mess, will have to work on that later. 2018-11-21 21:48:30 +08:00
intact 2f93fedbf8 Gtk+ Port: Use Desktop or Home as fallback directory for screenshots 2018-11-21 14:44:35 +01:00
rogerman f03a880ef9 WiFi: In Compatibility mode, reset the current RX packet's latency counter for every halfword write like its supposed to be. 2018-11-20 23:14:09 -08:00
rogerman adbbd406b1 Cocoa Port: Add tooltips for each of the OpenGL rendering accuracy options. 2018-11-20 17:56:18 -08:00
rogerman 6f8c060db6 OpenGL Renderer: It is now possible to toggle certain accuracy-related features on and off so that users can choose where to make their accuracy-performance tradeoffs. These four emulation accuracy features are: 'Shadow polygons', 'Special zero alpha blending', 'Depth-Equals test tolerance', and 'Depth-LEqual polygon facing'.
- New Behavior: Due to the rarity of needing to emulate 'Depth-LEqual polygon facing' and its guaranteed reduction in performance in all games, this accuracy feature is now OFF by default.
- Expose these new settings in the Cocoa port UI.
2018-11-20 11:44:30 -08:00
rogerman 1e18c3fb9f Windows Port: When running OpenGL display method, properly initialize V-sync to match wantVsync rather than assuming that the default setting for wantVsync will match the default setting of the video driver. 2018-11-19 02:49:31 -08:00
rogerman d81a75c867 SoftRasterizer / OpenGL Renderer: Drop less bits in the depth calculation, making for smoother depth transitions. For certain games, this may allow for better distance rendering, especially at the higher resolutions. (Related to commit c9025e8.)
- SoftRasterizer may now drop at most one LSB, down from dropping 9 LSBs.
- OpenGL will now drop only 2 LSBs, down from 9 LSBs. In this case, dropping 2 LSBs was specifically chosen to ensure that the Dragon Quest IV overworld map continues to work.
- If this change makes the depth inaccuracy too much worse than before, then we may have to make these particular depth calculations optional in the future. This will need additional testing.
2018-11-17 23:20:59 -08:00
rogerman be8d08ae87 WiFi: Make WifiHandler::_CopyFromRXQueue() more efficient by doing less copying and less locking. 2018-11-17 19:50:45 -08:00
rogerman 91526e6324 WiFi: Significantly reduce the host-to-emulator latency of libpcap-sourced packets in Infrastructure mode by running RX packet receives on a separate thread, just like how socket-sourced packets in Ad-hoc mode do it.
- Also, Infrastructure mode can no longer "partially function." Now, it either works completely or not at all, just like how Ad-hoc mode does it.
2018-11-17 16:02:04 -08:00
rogerman 71df3f4f28 NDSSystem.cpp: Fix interactions between external firmware loading and BIOS loading. Always ensure that loading external firmware is dependent on loading both ARM9 and ARM7 BIOS files. 2018-11-15 01:04:06 -08:00
rogerman e27cc87bdf Firmware: Standardize how the firmware configuration is set.
- Now, the only two methods for changing any firmware setting is by modifying CommonSettings.fwConfig or by loading an external NDS firmware binary file.
- All methods for changing the firmware MAC address through the WifiHandler class have been removed.
- The FirmwareConfig struct can now handle the WFC User ID.
- Clients can now retrieve the current MAC address and WFC User ID using NDS_GetCurrentWFCUserID(). It is also possible to retrieve the WFC User ID from CommonSettings.fwConfig.
- Setting up the firmware in NDS_Reset() should now be more consistent. However, this does change some of the loading/unpacking order previously set by NDS_FakeBoot(). This will need additional testing.
- Do a whole bunch of code refactoring and cleanup.
2018-11-15 00:18:22 -08:00
rogerman 5d85ac2e23 WiFi: Reduce the number of packets read by pcap_dispatch() from 16 to 1, significantly reducing the host-to-emulator latency of Infrastructure packet reads. This seems to be the best choice for maintaining a stable online connection, albeit at a significantly increased CPU cost for the host machine.
- Also do some minor code refactoring and cleanup.
2018-11-08 01:49:36 -08:00
rogerman 6eb1a79a71 WiFi: Significantly reduce the host-to-emulator latency of socket-sourced packets and make the emulated copy-to-WRAM latency more consistent when running Compatibility mode.
- Also slightly reduce the host-to-emulator latency of libpcap-sourced packets.
2018-11-07 13:20:10 -08:00
Roger Manuel 7ae2d764b0
Merge pull request #216 from Jules-A/winWifi
Win Port: Wifi cleanups following 9d05935
2018-11-04 15:32:05 -08:00
SuuperW 4affd3ca8a Allow user to change new path settings in the path config dialog. 2018-11-04 07:08:59 -06:00
SuuperW c8d534299f Add SRAM_IMPORT_EXPORT path setting to separate from the auto-save battery location. 2018-11-04 06:08:08 -06:00
rogerman c8306de8d2 arm_jit.cpp: OP_LDRD_REG() and OP_STRD_REG() now treat even-numbered registers as double-word load/stores, while odd-numbered registers are treated as single-word load/stores. (Fixes #215.)
- This change shouldn't actually change any functionality in practice... probably. This change is there to silence a compiler warning more than anything else... hopefully.
2018-11-02 13:06:15 -07:00
Jules.A aecf153016 Fix wrong bool type, attempt to make warnings more clear. 2018-11-02 10:18:27 +08:00
Jules.A ef53eccb0e I guess they aren't the same message. 2018-11-02 09:26:08 +08:00
Jules.A b6c69b031f Nit: GetBridgeDeviceList already has proper return codes so just initialize variable locally. 2018-11-02 09:19:55 +08:00
Jules.A 36040e90a3 Let the user know when WinPcap isn't loaded. 2018-11-02 07:35:15 +08:00
Jules.A 4705c3e59a Whoops, fix deviceCount. 2018-11-01 21:47:15 +08:00
Jules.A c640e5c480 Winport wifi cleanups after 9d05935. Removes interface for setting wifi mode along with removing redundant code. 2018-11-01 21:40:14 +08:00
rogerman 620048c43c Firmware: Add the NDS_ReadFirmwareDataFromFile() function, which allows ports to either retrieve the entirety of a firmware file's data or to quickly read just a specific piece of it.
- The Cocoa port uses this new function for UI purposes.
2018-11-01 03:44:05 -07:00
rogerman 9d05935696 WiFi: The user no longer has to manually choose between using Ad-Hoc or Infrastructure modes. The code now automatically sends/receives packets to and from their proper places.
- This change obsoletes "CommonSettings.wifi.mode", which now does nothing. Ports that make use of this setting should remove it.
- Also do a bunch of code refactoring and cleanup.
2018-11-01 00:23:41 -07:00
rogerman 1e9aa08f54 Cocoa Port: Do some minor code cleanup. 2018-11-01 00:02:05 -07:00
rogerman 84e5228274 matrix.cpp: Use the __restrict keyword for MatrixCopy(), MatrixCompare(), and MatrixGetMultipliedIndex() to further clarify that the passed in matrices must be separate and non-overlapping. 2018-10-31 23:45:49 -07:00
zeromus d8c0ca6f5b notify the lua script of an updated projection, in more cases (re: #130) 2018-10-31 23:30:40 -04:00
zeromus ad7b80ec87 add lua functions emu.gamecode and emu.smallgamecode for game-specific hacks in scripts
re #130
2018-10-31 21:29:25 -04:00
rogerman 56895a11aa Cocoa Port: Delete the now defunct preferredResourceStorageMode property that was obsoleted by commit da3970d. 2018-10-31 15:54:46 -07:00
rogerman 8944328f80 OpenGL Renderer: Partially fix rendering in the Customize screen of Sands of Destruction.
- This fix properly emulates the less-than-or-equal depth test rendering for front-facing polygons drawn on top of opaque back-facing fragments, but only if the front-facing polygon is opaque. Translucent front-facing polygons are not supported at this time due to requiring extensive changes to the rendering logic and shaders in order to emulate this extremely rare and niche NDS feature. (If you require the proper rendering of translucent front-facing polygons on top of back-facing fragments, then you must use SoftRasterizer.)
2018-10-31 13:44:20 -07:00
rogerman 44ac04df27 OpenGL Renderer: Do some small optimizations to the OpenGLRenderer::ZeroDstAlphaPass() and OpenGLRenderer::RenderEdgeMarking() methods. Also reduce VRAM usage. 2018-10-31 01:23:13 -07:00
rogerman dab414c725 OpenGL Renderer: Force front facing and back facing polygons to draw in separate groups, fixing a rendering bug in the car selection screen of "Need For Speed: Most Wanted". (Regression from commit 47a7194. Fixes #212.) 2018-10-29 15:00:59 -07:00
rogerman 276e26c194 OpenGL Renderer: Calculate the polygon facing for each individual polygon, just like how SoftRasterizer does it. 2018-10-29 14:08:44 -07:00
rogerman 2000737593 GPU: Remove now defunct line info buffers. 2018-10-29 09:58:00 -07:00
rogerman 1c36705fe3 Windows Port: Fix all the compilers warnings when using the CACHE_ALIGN macro by reverting the use of alignas(X) back to __declspec(align(X)). 2018-10-28 15:54:09 -07:00
zeromus 26bfb66caf auto-select retail nand for Daigassou! Band-Brothers DX (fixes #213) 2018-10-28 09:00:24 -04:00
rogerman 0beabec97c Save States: Properly rescale and convert the internal 3D framebuffer to and from a standard format -- 32-bit RGBA8888. (Related to commit c1eafc5 and completes all the work in PR #190 by @SuuperW.) 2018-10-27 22:54:30 -07:00
rogerman 79687d3031 GPU: Okay, so fix another potential bug with main memory display mode in 15-bit since the evaluation order of function parameters is not guaranteed across different compilers. (In this particular case, the evaluation order is actually important.) 2018-10-27 19:49:24 -07:00
rogerman fb7dbca344 GPU: Fix bug with main memory display mode when running 18-bit or 24-bit color depth. (Fixes #211.) 2018-10-27 19:25:15 -07:00
rogerman 4735079c9a Save States: The GPU framebuffer downscaling code can now take a faster code path if available. 2018-10-27 16:28:00 -07:00
rogerman 0f9f86fe61 GPU: Improve the code consistency when it comes to scaling up lines. 2018-10-27 15:50:16 -07:00
rogerman 4b28d272a7 Save State: Properly rescale and convert the GPU framebuffers to and from a standard format -- native size at 15-bit RGB555. (Related to commit c1eafc5 and PR #190 by @SuuperW.) 2018-10-27 12:11:34 -07:00
rogerman c1eafc53f2 Save States: Manually merge in most of the changes (with the exception of the GPU framebuffer rescaling and reformatting code) based on several commits in PR #190 by @SuuperW. 2018-10-26 00:17:08 -07:00
rogerman c3dbb920fa Cocoa Port: Do some UI tweaks with reporting the firmware MAC address. 2018-10-25 15:42:27 -07:00
rogerman 2e7099052d Linux GTK Port: Fix compiling for GTK port. (Regression from commit 064527e.)
- The new behavior for the Multisample Antialiasing checkbox: Checked - GFX3D_Renderer_MultisampleSize = 4, Unchecked - GFX3D_Renderer_MultisampleSize = 0. (If someone else wants to make some UI so that GFX3D_Renderer_MultisampleSize can be set to other sizes, then have at it.)
2018-10-25 11:55:44 -07:00
rogerman e2d60f62fd Windows Port: Fix compiling for Windows port. (Regression from commit bb38022.) 2018-10-25 02:34:26 -07:00
rogerman bb38022873 Firmware: Replace the old NDS_fw_config_data struct with the new FirmwareConfig struct, which allows for easy modification of all the user-related settings, including all the WiFi settings. Also do a massive refactor and cleanup of the firmware-related code.
- Also exposes all of the WiFi-related firmware settings in the Cocoa port UI.
2018-10-25 01:43:19 -07:00
rogerman da3970d817 Cocoa Port: Improve the performance and robustness of Metal display views.
- Add a unique sequence number to fetched frames to ensure that older frames are not drawn after newer frames.
- After much research, finally settle on a method for fetching the NDS framebuffers -- using a MTLBlitCommandEncoder to blit a MTLBuffer to a MTLTexture. It is faster than uploading a texture using [id<MTLTexture> replaceRegion:mipmapLevel:withBytes:bytesPerRow:], and also faster than using a pinned-memory backed linear texture. This method will be the way going forward for fetching framebuffers in Metal.
2018-10-25 01:05:36 -07:00
rogerman 064527e24e CommonSettings: Remove the now obsolete GFX3D_Renderer_Multisample setting. (Related to commit 94ddf1a.) 2018-10-25 00:35:22 -07:00
Roger Manuel 3cc4a64b69
Merge pull request #205 from Jules-A/antialiasing_settings
AntiAliasing Settings
2018-10-24 23:56:07 -07:00
Jules.A 0965eef5b3 rogerman fixes 2018-10-25 07:05:06 +08:00
Jules.A cfd77abaf7 Fixed UI elements moving around by simply re-arranging the order in resources.rc... Also added extra check when context is created. 2018-10-25 04:50:33 +08:00
Jules.A 65285aeb8c Cleaned up variable positions, added dummy OGL initiation so max device samples could be obtained from any renderer.
As a result, values higher than user is capable of won't be created.
2018-10-24 08:04:59 +08:00
Jules.A 3fd42ae720 WIP Updates. 2018-10-24 04:41:15 +08:00
rogerman ff84420424 OpenGL Renderer: Improve robustness when changing the MSAA sample size. 2018-10-23 00:04:28 -07:00
rogerman d85f140b64 Cocoa Port: Sigh... let's try to fix building this time... 2018-10-22 13:17:31 -07:00
rogerman 0ef9543f87 Cocoa Port: Oops! Fix a compiling issue caused by commit 5d3e53d. 2018-10-22 13:01:42 -07:00
rogerman 5d3e53d804 Cocoa Port: Expose the new user-selectable MSAA sample size feature in the UI that was introduced in commit 94ddf1a.
- Also add some other future UI-related stuff that was already in-flight at the time of this commit.
2018-10-22 12:33:04 -07:00
rogerman 68174fb31f movie.cpp/movie.h: Fix compiling issues for old GCC 4.2, which doesn't allow for variable initialization in C++ class declarations. (Regression from commit e83ec89.) 2018-10-22 11:38:06 -07:00
Roger Manuel acf49dfa01
Merge branch 'master' into antialiasing_settings 2018-10-22 11:08:49 -07:00
rogerman 94ddf1a467 OpenGL Renderer: The MSAA sample size is no longer automatically selected and must now be manually selected via GFX3D_Renderer_MultisampleSize.
- All frontends will need to be updated to use the new GFX3D_Renderer_MultisampleSize setting.
- This change obsoletes GFX3D_Renderer_Multisample, which currently does nothing at the moment. It will be removed after all frontends are updated.
2018-10-22 10:32:16 -07:00
rogerman a894000333 matrix.cpp Fix a bug with _Vec3_MultiplyByMatrix() returning an incorrect value on SSE4.1. 2018-10-20 14:53:49 -07:00
matthias gatto 2dfc7866d0 dlditool: fix redefinition of VERSION 2018-10-20 07:30:22 +02:00
matthias gatto bf3e1b1cf3 posix: fix deprecated warning about g_thread_init
problems with the old if, is that the code still compiled(but optimised out)
as g_thread_supported is a macro, #if work well enouth and doesn't generate
warning
2018-10-20 07:27:28 +02:00
matthias gatto 50755c6a45 ROMReader: fix specified bound depends on the length of the source argument
It seems gcc have a (new ?) warning that doesn't allow *ncpy functions
to have any source length related value as len argument.

I've use strdunp to fix this, but I guess there is some other solutions
that doesn't require free.
use c++ strings ?
use strcpy(...); tmp1[strlen(filename) - 4] = 0; ... ?
remove the warning in the Makefile ?

but as the strdump solution is simple enouth I've keep this.
2018-10-20 07:15:48 +02:00
rogerman 68e91ec57f OpenGL Renderer: Fix a bug with the MSAA automatic selector where the MSAA sample size would be selected based on the PREVIOUSLY set framebuffer size, even though the selection should be based on the CURRENTLY set framebuffer size. 2018-10-19 16:33:37 -07:00
Jules.A 1010709de2 Fix #c65ec32 illogical operators (|| instead of &&), save to ini straight away to avoid wrong value being displayed there and don't bother creating another variable to try make a turd prettier. 2018-10-17 22:40:54 +08:00
Jules.A c65ec323ef Default to 8 if invalid uservalue is entered, add a check so it won't be set to 2x if limiting is disabled and clean up settings interface more. 2018-10-17 21:18:58 +08:00
Jules.A d818155e8e Fixed settings not getting instantly updated causing MSAA sample checkboxes to not be disabled. 2018-10-17 03:51:21 +08:00
Jules.A faeced5c66 Clean up interface. 2018-10-17 02:24:23 +08:00
Jules.A 118b629728 Be more specific for VS2017 ignores. 2018-10-17 01:21:25 +08:00
Jules.A c53f9632ed Change from "force" to "limit", half sample amount since x16 was pointless and remove some unneeded logic. 2018-10-17 01:01:45 +08:00
Jules.A d045b9fa34 Initial AntiAliasing Settings. 2018-10-16 20:39:12 +08:00
zeromus 01225c65ee
Merge pull request #203 from QueeferSutherland/master
added support for joystick axes to lua function, controller.get()
2018-10-12 00:46:28 -04:00
QueeferSutherland b9829ba349
added support for joystick axes to lua function, controller.get() 2018-10-12 00:19:39 -04:00
matthias gatto 8c6c2e8071 threads: fix implicit declaration of memset 2018-10-11 23:22:21 +02:00
rogerman da714ea719 WiFi: Standardize the handling of received packets for both Ad-hoc and Infrastructure modes.
- Received packets are now queued properly and should no longer be overwritten or lost.
- Received packets under Ad-hoc mode now use the same transfer delay as Infrastructure mode. (Read one halfword every 8 microseconds.)
- Received packet transfer delay only works when the emulation level is set to WifiEmulationLevel_Compatibility. Transfer delay can be disabled by setting the emulation level to WifiEmulationLevel_Normal, which will cause the entire received packet to be transferred immediately.
2018-10-09 15:32:11 -07:00
rogerman 4e92d24b14 WiFi: Some more minor code cleanup. 2018-10-08 13:50:25 -07:00
rogerman e3653b76ce WiFi: Clean up and refactor some more stuff, mostly related to LLC/SNAP encapsulated 802.11 frames. 2018-10-07 21:02:19 -07:00
rogerman 7fda7997b2 MMU.cpp: Only report a VCOUNT change if the new value differs from the existing value. 2018-10-07 14:35:25 -07:00
rogerman f67154484f WiFi: Do a whole bunch of code cleanup, as well as some minor behavioral changes which are listed below.
- If the WiFi emulation level is Off, then always set POWER_US.Disable = 1.
- If POWER_US.Disable == 1, then do not trigger any further WiFi actions.
- The name contained within DeSmuME's frame header has been changed from "NDSWIFI\0" to "DESMUME\0".
- DeSmuME's frame header size has been increased from 12 bytes to 16 bytes.
- Baseband data is now set to a default dataset on reset.
- Baseband data reads/writes now respect the actual R/W behavior of each data byte.
2018-10-05 18:31:55 -07:00
zeromus 5ebc0ca21d
Merge pull request #201 from cbranch/cbranch/fix-pos-test-arm64
Fix undefined behaviour converting 3D postest registers
2018-10-05 18:17:20 -04:00
Chris Branch af205cf582 Fix undefined behaviour converting 3D postest registers
If the position test register is negative, conversion to unsigned
integer is undefined. This breaks games on arm64 where the behaviour is
defined as 'truncate to zero'. Converting to a signed integer first
guarantees the intended behaviour.
2018-10-05 22:59:06 +01:00
zeromus c741f37c11 Merge branch 'newluastuff'
fixes #198

# Conflicts:
#	desmume/ChangeLog
#	desmume/src/Makefile.am
#	desmume/src/OGLRender.cpp
#	desmume/src/OGLRender.h
#	desmume/src/OGLRender_3_2.cpp
#	desmume/src/OGLRender_3_2.h
#	desmume/src/render3D.cpp
#	desmume/src/render3D.h
2018-10-04 22:52:31 -04:00
zeromus ad2dafe661 add lua apis for raw joystick input (on windows, anyway) 2018-10-04 22:43:21 -04:00
rogerman 151b577cc0 GFX3D: Fix compiling for ports that don't support Lua. (Regression from commit 43fcaf6.) 2018-10-03 01:06:42 -07:00
zeromus 43fcaf68f1 add "ability to move camera" (aka freelook). it requires use of a lua script to actually control the matrix switcheroo
re: #130
2018-10-03 03:18:16 -04:00
zeromus d6babce9b7 winport - add some kind of hack to exit the emulator better whenever a lua script is running 2018-10-03 03:13:48 -04:00
zeromus 0406828da2 winport - don't break build if git isn't found in environment
fixes #186
2018-10-03 00:55:51 -04:00
rogerman e6b3dfd5bd Cocoa Port: Sigh... replace the pipe character '|' with a double-dash '--' so that the generated .xcscheme file names won't screw up the file systems of lesser operating systems (cough... Windows... cough). 2018-09-26 02:44:39 -07:00
rogerman d9aa1ac31e Cocoa Port: Update all build schemes in "DeSmuME (Latest).xcodeproj" for compatibility with Xcode 10. 2018-09-26 02:26:19 -07:00
rogerman a857e0e65c ROMReader.cpp: Fix compiling on non-Windows systems. (Regression from commit 12c9323.) 2018-09-22 13:41:28 -07:00
zeromus 12c93232b9 winport - minimal work to get wacky characters filenames loading via file menu
fixes #192
2018-09-22 15:56:02 -04:00
zeromus 1b10b39603 fix bugs in utf8/utf16 string conversion functions dating back to libretro-common installation 2018-09-22 15:55:09 -04:00
rogerman acb140209a GPU: Make the overall functionality of CopyLineExpand() and CopyLineReduce() more complete. Also do some small optimizations to GPUEngineBase::_LineCopy() while I'm at it.
- GPUEngineBase::_LineCopy() optimizations only apply to 2x, 3x, and 4x scaling.
- Add SSE2 version of 3x CopyLineExpand() when using ELEMENTSIZE==1.
- Add SSE2 versions of CopyLineReduce() and add specific 2x/3x/4x versions of CopyLineReduce_*() algorithms.
- CopyLineExpand() now supports vertical scaling in addition to horizontal scaling.
- GPU buffers that were previously only cache-aligned are now page-aligned if appropriate.
2018-09-19 16:06:39 -07:00
rogerman 7c80205a40 Render3D: Small optimization to scrolling clear images on non-SSE2 systems.
- Also fix a depth bug for scrolling clear images on SSE2 systems by disabling the SSE2-specific code. This issue will need to be researched at a later date.
2018-09-19 15:51:58 -07:00
rogerman 1767651b19 Fix all current build issues for all non-Windows platforms. Truly fixes #191. (Regressions from commit e697391 and commit b8ebe97.) 2018-09-15 14:50:11 -07:00
zeromus 5bb4437720 fix movie.cpp 2018-09-15 17:21:06 -04:00
zeromus 1a34cfae5f fix posix build error in wifi.h. fixes #191 2018-09-15 16:59:18 -04:00
zeromus 0c6f18d5eb fix replay-related posix build error 2018-09-15 16:58:10 -04:00
zeromus e09f269914
Merge pull request #188 from SuuperW/paths
Paths
2018-09-13 18:44:47 -04:00
zeromus e828070d4d
Merge pull request #187 from SuuperW/movies
Movies
2018-09-13 18:44:28 -04:00
rogerman b8ebe973b9 WiFi: Huge code cleanup and refactor, mostly reworking register handling.
- Note that functionality should remain practically the same as before. Any actual functional changes are completely unintentional.
2018-09-12 16:54:33 -07:00
SuuperW 35337a562a fix commit 910661f 2018-09-07 16:34:31 -05:00
SuuperW 910661f982 (Windows) Switch Record WAV to use the same directory as Record AVI. 2018-09-07 16:24:02 -05:00
SuuperW 39f473c590 (Windows) Save selected WAV path 2018-09-07 16:14:00 -05:00
SuuperW 3b310082dc (Windows) Properly set ofn.lpstrFile for import/export sav and for recording AVI/WAV 2018-09-07 16:12:54 -05:00
SuuperW 0cb3bbe87d Format code. (mostly fixing indentation) 2018-09-05 00:39:12 -05:00
SuuperW aaad5e63c5 (Windows) Save and use all config paths.
Add StateSlots path to avoid losing saved slot states when user manually selects a file to load elsewhere.
2018-09-05 00:27:49 -05:00
SuuperW e2d83f99fe Support type string in setpath, use new method in several places.
Make SwitchPath check for all directory delimiters when removing trailing delimiter, remove redundant trailing delimiter logic in CFIRMWARE::GetExternalFilePath().
2018-09-04 12:14:02 -05:00
SuuperW 524997e406 clean up Path::IsPathRooted 2018-09-04 11:23:11 -05:00
SuuperW c9c6049892 Move PathInfo method definitions to .cpp file. 2018-09-04 00:26:34 -05:00
SuuperW 407b01b39d (Windows) Set default path for exporting a save to path.BATTERY (same as importing a save) 2018-09-03 06:02:01 -05:00
SuuperW 4c5842d2aa code cleanup 2018-09-03 05:42:30 -05:00
SuuperW 2a7103ec0b Save movie's savestate to a separate file instead of encoding it in the movie file. (This gives significantly faster performance, and will make it easier for the user to edit the starting savestate if need be.) 2018-09-03 05:35:05 -05:00
SuuperW e697391dfd Support recording/playing movies starting from a savestate. 2018-09-03 01:05:41 -05:00
SuuperW 484b062bf5 Add swiFromBios and bootFromFirmware to MovieData. 2018-09-02 10:52:53 -05:00
SuuperW 11e2448d1c Better loading of JIT settings from a movie. 2018-09-01 12:38:39 -05:00
SuuperW 3645ff4e77 Alert the user when opening emulation/firmware settings while they are set by a movie. 2018-09-01 12:34:17 -05:00
SuuperW 80047bff91 When closing or rebooting a ROM, reset emulation settings that were set by a movie. 2018-09-01 12:05:21 -05:00
SuuperW 4a844b2394 bugfix from last commit 2018-09-01 12:03:31 -05:00
SuuperW e83ec89578 Loading a movie now sets emulation/firmware settings. 2018-09-01 11:12:01 -05:00
SuuperW bd299672a1 Save jitBlockSize to movie files 2018-08-31 23:02:47 -05:00
SuuperW 10dc63abca Some more cleanup of movie.cpp LoadFM2 2018-08-31 21:30:13 -05:00
SuuperW a5d843e361 Rework MovieData::installValue to separate code for each key/value and to avoid using a long if else if chain. 2018-08-31 21:13:16 -05:00
SuuperW 491ee62754 Clean up movie.cpp LoadFM2. 2018-08-31 16:18:21 -05:00
zeromus c8ef38ad20
Merge pull request #185 from SuuperW/hotkeys
Hotkeys
2018-08-30 14:55:13 -05:00
zeromus 68d365c2f8
Merge pull request #181 from SuuperW/cheats
Cheats
2018-08-30 14:53:31 -05:00
SuuperW 57bfbb1562 Change implementation of moving a cheat in the cheat list. (originally implemented in commit 24cdbf0) 2018-08-30 11:49:11 -05:00
SuuperW dee24cdbc1 Print a message when a cheat code forces the JIT to reset. 2018-08-30 11:47:56 -05:00
SuuperW bbb190a136 bugfix (from commit 534cf251) 2018-08-30 11:47:35 -05:00
SuuperW 38b2039844 (Windows) Implement Ctrl+A shortcut for cheat list. 2018-08-30 11:45:57 -05:00
SuuperW 534cf2515b (Windows) Allow un/checking multiple cheats at once. (#178) 2018-08-30 11:45:57 -05:00
SuuperW 24cdbf0269 (Windows) Allow rearranging of cheats in the cheat list. (Requested by #178) 2018-08-30 11:45:56 -05:00
SuuperW 084a42a2f8 (Windows) Ask the user if they want to save changes to the Cheat list when the dialog's close/X button is clicked, if there are changes to save. 2018-08-30 11:45:31 -05:00
SuuperW 51303b9bc9 (Windows) Extend last column of Cheats list to fully show max-length descriptions, and shorten window/list view width. (Requested by #178) 2018-08-30 11:45:10 -05:00
SuuperW 80cfb59c2c (Windows) Clean up/combine string tables. 2018-08-30 11:27:25 -05:00
SuuperW 56477f0c5c (Windows) Add hotkeys for toggling display layers. 2018-08-30 11:14:44 -05:00
SuuperW 811d9a3c18 (Windows) Move TwiddleLayer from main.cpp to display.cpp (prepare for new hotkeys) 2018-08-30 11:01:57 -05:00
SuuperW 5cc49fe417 (Windows) Add hotkeys for cheat list and toggle cheats. 2018-08-30 10:35:29 -05:00
SuuperW 48414b144d (Windows) Reorganize some hotkeys code, and move Lua hotkeys to the Tools page. 2018-08-30 10:34:57 -05:00
SuuperW 16ea99e78c (Windows) Remove redundant hotkey initializing code. 2018-08-30 10:34:12 -05:00
zeromus b3a352a409
Merge pull request #176 from SuuperW/refactor
Refactor+Bugfixes
2018-08-28 13:50:27 -05:00
zeromus 77e05eb1f8 dont lose toon table when geometry engine is powered off (fixes #179) 2018-08-24 16:53:26 -05:00
rogerman 0aa8dad199 WiFi: Fix a bug where AdHoc connections would fail to read the socket on non-Windows systems. 2018-08-23 21:50:17 -07:00
rogerman 5d384f9eae Cocoa Port: Fix a bug in Metal display views where the internal V-sync would cause the total frame rate to be divided amongst multiple visible display views. 2018-08-23 09:56:23 -07:00
rogerman 5c85bcd732 Cocoa Port: Rework the auto-frameskip algorithm yet again. It should be more accurate this time. 2018-08-22 01:25:52 -07:00
SuuperW 8fa3c6f9ed fix regression from commit 17c30c48 2018-08-21 10:26:11 -05:00
SuuperW d671d0a888 minor cleanup 2018-08-20 10:23:10 -05:00
SuuperW 43d79393c7 Remove unused flags for display method, and remove OpenGL-specific display flag. 2018-08-20 10:23:10 -05:00
SuuperW c4ea4ad879 fix: DD_DoDisplay would not update the display if resolution had just been changed 2018-08-20 10:23:10 -05:00
SuuperW c9b41e3c53 Fix regression from commit 2acfdbe; setting display method to DDraw HW/SW did not actually set ddraw.systemMemory 2018-08-20 10:23:10 -05:00
SuuperW 2c8909ed3c Fix regression from commit 2acfdbe; the selected display method wasn't checked. 2018-08-20 10:23:10 -05:00
SuuperW 212f0a358f Only wait for the display thread if the previous frame was not skipped. 2018-08-20 10:23:09 -05:00
SuuperW 2890c4b075 Regression fix: Lua functions which draw to the screen work again. 2018-08-20 10:23:09 -05:00
SuuperW 17c30c48c5 more refactoring; created display.cpp and .h files 2018-08-20 10:23:09 -05:00
SuuperW 89fc0a12e3 move/refactor OpenGL code 2018-08-20 10:23:09 -05:00
SuuperW 4c83ec19e9 Move DirectDraw code to its own .h and .cpp files. 2018-08-20 10:23:09 -05:00
SuuperW 4357ba8f47 Am I doing this right? 2018-08-20 10:22:42 -05:00
retr0s4ge 6fa6467c5c
Merge pull request #175 from retr0s4ge/master
(Windows Frontend) Add Fullscreen Options And Window Sizing Fixes
2018-08-17 08:04:14 +02:00
retr0s4ge 7fa405b679 (Windows Frontend) Rename "Non-exclusive Mode" option to "Force Windowed Fullscreen" 2018-08-16 13:20:26 +02:00
rogerman c9a405e959 OpenGL Renderer: Use memcmp() to ensure that UploadClearImage() uploads clear image data only when necessary. Significantly improves the performance of games that use clear images. 2018-08-15 23:07:22 -07:00
retr0s4ge 9314fc2d5e (Windows Frontend) Ignore the menu key if the main window has no menu 2018-08-15 00:33:22 +02:00
rogerman 208f99f4a6 Cocoa Port: Fix a bug where HID devices would fail to be detected on startup when running on macOS High Sierra. 2018-08-13 23:33:24 -07:00
rogerman 8448b3ee10 Cocoa Port: Instead of using a single shared draw timing for all displays, use individualized draw timings for each display. 2018-08-13 23:32:31 -07:00
retr0s4ge 775e3ae91a (Windows Frontend) Fix the bug where cursor is auto-hidden even when over the menu
Also, changed the time before auto-hiding to 10 seconds.
2018-08-12 19:58:02 +02:00
rogerman c9009c9302 Linux Ports: Now require libpcap for all POSIX builds. (Related to commit 5e67e9c.) 2018-08-11 13:19:45 -07:00
retr0s4ge 36b97ada75 (Windows Frontend) Add Fullscreen Options And Several Window Sizing Fixes 2018-08-11 16:15:57 +02:00
retr0s4ge f2e43ca90b Add *.VC.opendb to gitignore 2018-08-11 15:23:50 +02:00
rogerman 6797f00d23 Windows Port: Oops! Fix a bug that will cause the app to crash on app exit. (Regression from commit 5e67e9c.) 2018-08-10 18:53:00 -07:00
rogerman 5e67e9ca7c WiFi: Do a big refactor of the client interface code for better code cleanliness, organization, and stability. There are also some minor behavior changes.
- EXPERIMENTAL_WIFI_COMM no longer disables all of the WiFi-related code. Instead, the WiFi code is always enabled and actually running the code is now controlled using WifiHandler::SetEmulationLevel().
- On the Windows port, EXPERIMENTAL_WIFI_COMM no longer hides all of the WiFi options. Instead, it only affects the user's ability to control the WiFi emulation. (Forces the WiFi emulation level to WifiEmulationLevel_Off if EXPERIMENTAL_WIFI_COMM is undefined.)
- The Cocoa port (and probably other POSIX-based ports) should now work better with the WiFi code.
- WiFi comm interfaces no longer initialize only once upon app startup. Instead, they initialize each time the emulator resets, and then uninitialize each time a ROM is unloaded. Now, users no longer have to restart the app in order to apply any changed WiFi settings. Instead, users only need to reset the emulator or load a new ROM.
- Previously, the SoftAP comm interface wouldn't run if libpcap was unavailable or if a network device wasn't found. Now, the SoftAP comm interface will now run without libpcap or a network device, albeit with significantly reduced functionality.
- Previously, saving pcap files required WIFI_LOGGING_LEVEL >= 3. Now, saving pcap files no longer relies on WIFI_LOGGING_LEVEL, instead relying on WIFI_SAVE_PCAP_TO_FILE to enable the functionality.
2018-08-10 18:36:33 -07:00
rogerman 65901c77c0 WiFi: Do some minor fixes. 2018-08-06 10:29:28 -07:00
rogerman 36ee2477b1 SoftRasterizer: Fix the animating characters in Customize status screen in Sands of Destruction by emulating a special LEQUAL depth test. (Fixes #41. Special thanks to StapleButter for his insight on this issue.) 2018-08-01 13:46:08 -07:00
rogerman c4317df76f Cocoa Port: Significantly boost the performance of the HQnX and xBRZ Metal shaders. 2018-07-31 21:55:56 -07:00
zeromus 637ad2ab18 revert pointless change to declaration of CommonSettings from 07d7588
(fixes #169)
2018-07-30 21:22:49 -05:00
rogerman ca6d8aaf73 WiFi: Initialize wifiEmulationLevel to WifiEmulationLevel_Off on startup. 2018-07-30 15:58:48 -07:00
retr0s4ge 07d75886bc
Merge pull request #166 from retr0s4ge/master
Implement basic support for multiple WiFi emulation levels
2018-07-30 23:48:52 +02:00
rogerman ad7083ea98 Cocoa Port: Do another UI bug fix on High Sierra, expanding the NSSegmentedControl element width even further so that all numbers appear as intended in all cases. (Related to commit 4913c0e.) 2018-07-30 13:50:38 -07:00
rogerman fad678c2b3 SoftRasterizer: Fix a bug for Altivec-enabled CPUs that caused multithreaded rendering to fail. (Related to commit 43d3883.) 2018-07-30 12:10:57 -07:00
retr0s4ge cf5ed05cab Replace scoped enum used for WifiEmulationLevel with unscoped enum for code compatibility with older compilers. 2018-07-30 06:26:49 +02:00
retr0s4ge 259ca8579f Implement basic support for multiple WiFi emulation levels 2018-07-30 00:17:44 +02:00
retr0s4ge 09a545902d Don't emulate wifi unless wifi.emulated flag is set in common settings.
Changes:
1- Add wifi.emulated flag to common settings
2- Don't emulate wifi unless wifi.emulated is set
3- Add a check box in windows frontend to toggle it, and read/write setting from/to ini file.
2018-07-28 05:40:44 +02:00
rogerman 232e3d6f51 Cocoa Port: Do a bunch of tweaks and fixes for an upcoming new feature. (Related to commit 932cdd6.) 2018-07-27 13:18:48 -07:00
rogerman bee3fd30ce Cocoa Port: Update the Metal blitter to support Y-flipping of the rendered video frame, matching the same feature that already exists in the OpenGL blitter. 2018-07-27 02:10:28 -07:00
rogerman 4913c0e7ae Cocoa Port: Fix a UI bug on macOS High Sierra where the dropdown sheet for configuring an NDS input's turbo pattern would fail to show the numbers in each NSSegmentedControl element. 2018-07-27 01:38:00 -07:00
zeromus d7c347d3ae set debug colors for DD area filling for new empty areas 2018-07-26 10:31:30 -05:00
rogerman 1e0e7f5e28 Cocoa Port: When running SoftRasterizer; for every 12 cores that would exist, reserve 1 core for the rest of the system. This should help maintain performance stability. 2018-07-25 20:46:42 -07:00
rogerman b0a6188902 SoftRasterizer: Fix a longstanding bug where using a thread count that was not a power-of-two would result in many threads remaining idle. 2018-07-25 20:44:30 -07:00
rogerman cbd488e157 SoftRasterizer: Force the number of rendering threads to be a power-of-two since any additional threads that are not power-of-two will be wasted. 2018-07-25 15:18:36 -07:00
rogerman b6072287c5 Cocoa Port: Improve SoftRasterizer multithreading and stabilize multithreaded performance.
- Automatic setting of the SoftRasterizer thread count (the most common use case) now takes into account systems with many CPU cores/hyperthreads. When using Automatic mode, SoftRasterizer will take advantage of more threads on machines like the Mac Pro and iMac Pro.
- Manually assign the thread priorities of the SoftRasterizer threads and other related high-priority threads to better ensure stable performance. Most importantly, the main emulation thread will no longer preempt any SoftRasterizer thread since the main emulation thread has to wait on the results of SoftRasterizer anyways.
- These changes aren't targeted for improving overall performance -- they help stabilize performance so that CPU cycles are used more consistently, which might translate into slightly improved performance, depending on hardware, as a byproduct of doing these changes.
2018-07-25 14:19:25 -07:00
zeromus fe851aa10c
Merge pull request #159 from SuuperW/display 2018-07-21 15:27:56 -05:00
rogerman ad5f5c24e6 Colorspace Handler: Fix bug where ColorspaceApplyIntensityToBuffer*() would not apply an R/B color swap when requested. 2018-07-20 18:45:44 -07:00
zeromus d869e6cb10
Merge pull request #162 from retr0s4ge/master
(Windows Frontend) Fix window size increase on startup
2018-07-20 17:17:33 -05:00
retr0s4ge 8cbdc339f2 (Windows Frontend) Fix window size increase on startup if screen size ratio > 1
Fix missing division in ScaleScreen function which caused window size to increase on each startup  if screen size ratio > 1.
2018-07-21 00:00:54 +02:00
SuuperW 9ccf9acea4 Revert commit 15957ba, and apply backlight effect regardless of whether using DirectDraw or OpenGL. 2018-07-18 14:51:45 -05:00
SuuperW 84e8057682 Resize the window when changing the screen gap. 2018-07-18 12:20:03 -05:00
SuuperW a4411086e0 Fix issue with resizing the window vertically. 2018-07-18 12:19:33 -05:00
SuuperW 842ed1b93c Put HUD drawing back to before applying the video filter. 2018-07-18 10:09:59 -05:00
SuuperW 77c0b6e702 Fix bug where OpenGL HUD would be stretched with 90 or 270 degree rotation. (regression from commit 6fc7161) 2018-07-18 01:58:56 -05:00
SuuperW 15957ba792 Remove use of backlight intensity when using DirectDraw. (previously removed it with OpenGL in commit 6fc7161) 2018-07-17 11:40:05 -05:00
SuuperW 60aedec5d2 Scale HUD when using DirectDraw. (fix regression from commit 5906d44) 2018-07-17 11:38:59 -05:00
zeromus 6fd23368ce
Merge pull request #158 from retr0s4ge/master
(Windows Frontend) Allow screen resizing in horizontal display layout.
2018-07-13 22:02:07 -04:00
retr0s4ge 43a9734ba2 Fill the areas above and below the resized screen with black when using DirectDraw display method.
This is needed to remove garbage from the window after resizing the screen. OpenGL display method already does this.
2018-07-13 16:43:43 +02:00
retr0s4ge d17a01d0c3 Center the resized screen vertically by default and add a check menu setting to change that if required. 2018-07-13 14:43:02 +02:00
SuuperW 6fc7161f19 Rework HUD rendering with OpenGL.
-Fixes regression from commit 5906d44 where HUD would appear smaller when using HD scaling. (only fixed with OpenGL for now)
-Remove use of backlightIntensity for displaying. Fixes bug where screen would appear dark on the first frame after loading a save state. Underlying cause should probably still be fixed, though. (Why would the backlight level affect the display anyway? That setting on the DS is only present because it has its own physical screens and makes no sense here.)
2018-07-12 11:23:23 -05:00
retr0s4ge 9dd7e0f451 Adjust the aspect ratio of the resized screen to follow the user setting, and modify input scaling accordingly. 2018-07-12 00:13:43 +02:00
SuuperW dc41f09189 some code cleanup; fix crash on changing to 15 bpp from a higher bpp 2018-07-09 11:41:46 -05:00
retr0s4ge 610caf0e45
Merge pull request #157 from retr0s4ge/master
Don't save ethernet packets to pcap files by default.
2018-07-09 02:07:35 +03:00
retr0s4ge 5ad5e16a40 (Windows Frontend) Allow screen resizing in horizontal display layout.
The right hand screen is allowed to be resized in horizontal screen layout to enable the window or full screen display to better utilize the screen area.

Changes:
1- Modify scaling, resizing and update functions to allow for new screen resizing ratio
2- Modify touch input scaling (incl. HUD editing) to adapt to different screen sizes
3- Add GUI menu for user to select the screen resizing ratio
4- Implement saving/loading settings from file similar to other settings
2018-07-09 01:03:35 +02:00
retr0s4ge 66062bca80 Don't save ethernet packets to pcap files by default.
Save only if the defined WIFI_LOGGING_LEVEL >= 3
2018-07-08 23:39:14 +02:00
SuuperW b95f58826e Fix ordering of fonts 2018-07-08 11:28:29 -05:00
zeromus 41104fd315 fiddle around with movie sram
re #152
2018-07-06 14:18:14 -04:00
zeromus f79e24dba8
Merge pull request #153 from Salz/pullreq/agg
revert to agg >= 2.4
2018-07-06 13:54:50 -04:00
zeromus a17bafa652
Merge pull request #154 from Salz/pullreq/gdb-stub
Pullreq/gdb stub
2018-07-06 13:54:23 -04:00
zeromus 9f7ed1aeeb
Merge pull request #155 from Salz/pullreq/commandline
Fix CommandLine initialization
2018-07-06 13:53:40 -04:00
zeromus 1065666997
Merge pull request #152 from SuuperW/master
Properly handle SRAM while playing movies.
2018-07-06 13:52:52 -04:00
SuuperW 5496c8e024 Remove the now unused firstTime parameter of DoDisplay. 2018-07-06 11:45:38 -05:00
SuuperW 5906d44c2d On Windows, draw HUD before the filter to avoid having to scale it separately. (significant performance boost when using a filter) 2018-07-06 11:45:07 -05:00
SuuperW e4d5da97c0 Add prefilterWidth/Height 2018-07-06 11:44:11 -05:00
Ingo Saitz cebbb262d1 revert to agg >= 2.4 2018-07-05 11:42:03 +02:00
Ingo Saitz 696135d712 Fix BaseDriver class
Commit 7548294333 broke compilation of
desmume/src/NDSSystem.cpp if DEVELOPER is defined by --enable-gdb-stub

Needs commit c9ad909a75b0ad89d0bd84829ed536c5ae0ffc93
2018-07-05 11:28:52 +02:00
Ingo Saitz b976584451 fix --enable-gdbstub 2018-07-05 11:28:46 +02:00
Ingo Saitz dd8d4e6715 Fix CommandLine initialization
Commit 7548294333 added _fw_boot and
_fw_path, need to make sure they are initialized, too.
2018-07-05 11:28:05 +02:00
SuuperW c64a556d82 Properly handle SRAM when playing movies, with or without starting from SRAM. 2018-07-04 11:11:57 -05:00
SuuperW 35ddbb341d Fix bug where movies starting from sram would crash. 2018-07-01 12:46:38 -05:00
zeromus 490c7e917c
Merge pull request #150 from retr0s4ge/master
Add WiFi fix from desmume-reloaded, tweak the wait for display thread added in commit ee8fdeb
2018-06-29 23:57:48 -04:00
retr0s4ge 411bcaa15d Forcibly wait for the display thread to draw each frame (never skip any frame) ONLY IF the user set frame skip to "0 (never skip)".
Current implementation causes significant display lag if any magnification filter is used while GPU scaling factor is >1.
2018-06-29 14:23:01 +02:00
retr0s4ge 7548294333 1- Apply WiFi-ONLY related fixes from desmume-reloaded project by Jackobo Le Chocobo to desmume project (code base 22/06/2018).
2-Add required include and define statement to aviout.h to fix build error.

(cherry picked from commit 470e54e361)
2018-06-29 09:31:30 +02:00
zeromus bd63ff1bd1
Merge pull request #148 from SuuperW/master
Do not allow skipping display frames (except in extreme lag).
2018-06-28 12:50:47 -04:00
SuuperW ee8fdebcf1 Do not allow skipping display frames (except in extreme lag), so that the user sees every emulated frame and the HUD updates every frame. 2018-06-28 11:34:38 -05:00
Ingo Saitz 0e86cf128d Call XInitThreads() in posix frontend
XInitThreads() is needed in multi-threading X applications when multiple
threads try to access the Xlib. Add the call to the three frontends in
posix/ and add the required autoconf-stuff, too.
2018-06-27 14:41:02 -05:00
zeromus 23f4dcc009
Merge pull request #147 from SuuperW/master
Reduce RAM usage
2018-06-27 12:59:03 -04:00
SuuperW a8fa8a44d6 Do not reset buffers when calling SetPrescale with the current scaling values. 2018-06-27 11:27:05 -05:00
SuuperW 35a2ca9721 Redraw display after changing video filter. (Regression from commit 8622a33.) 2018-06-27 11:25:48 -05:00
SuuperW 8622a334a2 Rework buffer size allocations to only allocate as much space as is actually required. 2018-06-27 11:23:36 -05:00
zeromus 0f4b3ead00 replace SMLAL_BB and friends with more clear logic that hopefully isnt bugged
but I couldnt find a game exercising it, so I dont know whether it's correct.

should fix #139
2018-06-15 17:48:28 -04:00
zeromus 022d24b5c2 gfx3d - savestate `renderState` along with `state`
there's really nothing more to it than this. it should have been done from the beginning.
you wouldn't notice this unless you had a game that stopped rendering 3d, though.
(re #141)
2018-05-25 11:39:58 -04:00
rogerman 932cdd6366 Cocoa Port:
- Do a bunch of code refactoring and cleanup.
- Add some new UI for an upcoming new feature.
2018-05-17 21:22:51 -07:00
rogerman c024a78a43 GPU / SoftRasterizer: Fix a build issue for Altivec-enabled code. (Related to commits c41a006 and 43d3883.) 2018-05-17 20:06:31 -07:00
zeromus 9c128460c4 winport - make it so you can only open one of each disassembler views at a time (reportedly theyre crashy if theres more than one of them open.. seems likely to be the case for any of our tool windows) 2018-04-18 13:14:01 -05:00
zeromus deffcaa075 added /LARGEADDRESSAWARE so we can get more than 6x or 7x scaling in 32bit builds 2018-04-12 21:48:22 -05:00
rogerman 24d941d02e Colorspace Handler: Fix some bugs in AVX2. (Regression from commit 858b05d. Fixes #131.) 2018-03-11 14:13:26 -07:00
rogerman ab3c221bf6 Windows Port: In Sound Settings, under the Interpolation menu, remove the obsolete performance notes, as these options do not actually affect performance. Instead, provide a better description of the effects caused by these options as experienced by the end-user. 2018-03-05 12:06:10 -08:00
rogerman 92924db136 Windows Port: Related to commit 8d011f8 -- check the flag first to try to avoid the more expensive system calls. 2018-03-04 17:39:27 -08:00
rogerman 42c0379cbb OpenGL Renderer: Fix one more possible crash that may occur if the 3D framebuffer is read before the 3D renderer has a chance to render at least once. (Related to commit f8bbbec.) 2018-03-04 17:20:21 -08:00
rogerman 8d011f8344 Windows Port: Optimize input handling, reducing CPU usage when the emulator is idle. (Related to commit 8fb0d6d.) 2018-03-04 17:17:26 -08:00
rogerman 8fb0d6ddc5 Windows Port: Reduce CPU usage while the emulator is idle. 2018-03-03 20:41:23 -08:00
rogerman e825cddbe5 Windows Port: Fix a rare and intermittent bug that could cause the AVI recording to accidentally stop in between AVI segments. (Regression from commit db1a19a.) 2018-03-02 15:59:37 -08:00
rogerman b8c006b0b5 Windows Port: Do some minor code cleanup related to commit 8763a61. 2018-03-02 14:00:52 -08:00
rogerman 8763a6169a Windows Port: AVI recording now maintains many more frames in memory. Also, the framebuffer color conversion threads and file writing thread are more free running threads.
- These changes help to stabilize the performance of AVI recording, making it less sensitive to sudden changes in disk writing speed.
- The maximum amount of frames maintained in memory will either be 1.5 GB worth or 180 frames (or 3 seconds) worth, whichever is less.
2018-03-02 13:09:39 -08:00
rogerman db1a19ad86 Windows Port: Do a complete code cleanup and refactor of aviout.cpp to use proper C++ objects.
- aviout.cpp now uses Windows-style line-endings instead of Unix-style line-endings.
- AVI segments now fill up much closer to the 2 GB file limit than before.
- Error handling in the file writing thread is much more robust.
2018-03-01 08:47:24 -08:00
rogerman cbe4717d2f Windows Port: When recording AVIs, video framebuffer conversions and file write operations are performed asynchronously with the main thread. This should greatly increase AVI recording performance. 2018-02-25 16:00:31 -08:00
rogerman c7ca122d95 Windows Port: Fix building on Windows. (Regression from commit c7bb41e.) 2018-02-19 12:46:41 -08:00
rogerman c7bb41e4b1 matrix.cpp: Rework all matrix function parameters for explicit array sizing in order to aid compiler optimization and (hopefully) aid in code readability. Also add SSE4.1 versions for the main matrix functions. 2018-02-19 11:43:55 -08:00
rogerman 5a61a08727 matrix.cpp: Do some more code cleanup. 2018-02-16 20:11:36 -08:00
rogerman 249afccfca matrix.cpp: Do a bunch of code cleanup. 2018-02-16 11:59:19 -08:00
rogerman c41a006b2a GPU: Add additional basic SIMD-accelerated functions for memset_u16(), memset_u16_fast(), memset_u32(), and memset_u32_fast() for AVX2 and Altivec. 2018-02-13 14:45:17 -08:00
rogerman 5fbaa53b46 GPU: If a custom-sized layer is to be rendered first, GPUEngineBase::_TransitionLineNativeToCustom() will do a line clear instead of an upscaled line copy.
- Since this is a very common occurrence in many games, and since doing a clear is faster than doing an upscaled copy, this should give a small performance improvement for the larger framebuffer sizes.
2018-02-13 13:54:10 -08:00
rogerman 43d3883986 SoftRasterizer: Framebuffer clears are now accelerated using AVX2 and Altivec. 2018-02-12 18:03:52 -08:00
rogerman ab18de05ef SoftRasterizer: Oops! Fix a performance regression in SoftRasterizerRenderer_SSE2::ClearUsingValues() where the framebuffer was accidentally being cleared twice. (Regression from commit 7509d46.) 2018-02-12 13:42:42 -08:00
rogerman 7509d469b9 SoftRasterizer: Do some multithreading improvements, and also clean up and refactor RasterizerUnit.
- Completely encapsulate all stray global variables into the SoftRasterizer class where they belong.
- Framebuffer clears are now fully multithreaded, significantly improving clearing performance.
- Doing multithreaded texture loads and vertex calculations now requires a minimum of 2 threads, down from 4 threads.
- The maximum amount of SoftRasterizer threads has been increased from 16 to 32.
2018-02-12 11:35:21 -08:00
rogerman 9e3b694ace Cocoa Port: Do some minor code cleanup. 2018-02-05 20:29:09 -08:00
rogerman d1dcbb8218 Cocoa Port: Fix a potential deadlock that may occur on emulation reset. 2018-02-04 13:07:59 -08:00
rogerman 9ee7cd8ec0 NDSSystem.cpp: Check for the GPU struct before calling GPUSubsystem::ForceFrameStop() in GameInfo::closeROM(). 2018-02-03 21:59:00 -08:00
rogerman 23be799a67 Cocoa Port: Metal display views no longer lose visible frames when running multiple display views. 2018-02-03 21:21:54 -08:00
rogerman 01c508f93a Cocoa Port: Remove and replace the high-overhead NSThread with the lower-overhead pthread_t. Improves video display performance when the frame rate is very high (greater than 600 FPS). 2018-02-03 11:31:41 -08:00
rogerman f9c32c9e79 Cocoa Port: Rework triple buffering for Metal display views yet again. This should fix the performance regression introduced in commit a65ceae9 for the larger custom framebuffer sizes. 2018-01-30 16:26:05 -08:00
zeromus 2a58246eb5
Merge pull request #123 from keelimeguy/master
Windows Port: Adding Pen and Touch support for touch screen devices
2018-01-08 16:04:11 -06:00
Keelin Wheeler b11bde4be4 Windows Port: Adding Pen and Touch support for touch screen devices 2018-01-08 16:37:20 -05:00
rogerman f2f3680a7c Cocoa Port: Fix a bug where Metal display view backing textures weren't updating their custom framebuffer sizes. (Regression from commit 4c01e66.) 2017-12-19 15:35:20 -08:00
rogerman 4c01e66a8a GPU: Instead of using fixed double-buffered output framebuffers, allow clients to request any number of framebuffer pages between 1 and 8.
- For all non-Cocoa ports, reduce the number of framebuffer pages from 2 to 1, reducing the memory usage for those ports.
- For the Cocoa port, increase the number of framebuffer pages from 2 to 3 in preparation for a new triple-buffered display scheme.
2017-12-19 14:33:48 -08:00
rogerman d3b628af47 Cocoa Port: Rework synchronization for Metal display views yet again. It should be a lot better now. 2017-12-17 20:35:00 -08:00
rogerman a65ceae98f Cocoa Port: For Metal display views, be much smarter about how we do synchronization. Should fix the performance issues introduced with commit 26ac91ed. 2017-12-11 16:28:42 -08:00
rogerman 1ea95cdde4 Cocoa Port: Do some minor code cleanup. 2017-12-11 16:17:02 -08:00
rogerman cd2f75e43a Cocoa Port: Replace all POSIX named semaphores with Mach semaphores and GCD semaphores, which are both faster than POSIX named semaphores. 2017-12-08 11:49:49 -08:00
rogerman 1e36b36bef Cocoa Port: Remove now obsolete locks from sound functions, since we now call SPU_Emulate_user() in the emulation thread again. 2017-12-07 23:00:28 -08:00
rogerman cee6867bd8 Cocoa Port: In RunCoreThread(), don’t use a potentially more expensive wait method before doing a cheaper time comparison first. 2017-12-07 21:01:59 -08:00
rogerman bac10c7618 Cocoa Port: OpenGL display views no longer use glFlush() when rendering for final flush, since glFlush() has been found to not actually be necessary. 2017-12-05 17:13:24 -08:00
rogerman 26ac91edd0 Cocoa Port: For Metal display views, replace all locks with semaphores, which are the correct synchronization primitive to use here.
- Also change the CocoaDSOutput list lock from a mutex to a rwlock, since testing has shown that there is more thread contention here than I previously thought.
2017-12-05 13:43:30 -08:00
rogerman f9109568b8 Cocoa Port: Improve stability of Metal display views when running CPU-based pixel scalers.
- Also fix a bug where restoring multiple display windows on startup would only have the last display window shown to work properly.
2017-12-03 00:18:30 -08:00
rogerman 39039f2396 Cocoa Port: Have the HUD Settings panel title show the number of the display window that is currently in focus, just like all the other panels. 2017-12-02 19:33:08 -08:00
rogerman b48666ea9c Cocoa Port: Add new HUD item, “Show Execution Speed”, which displays the emulator’s execution speed as a percentage. 2017-12-02 15:35:51 -08:00
zeromus 87335dd57a
Merge pull request #121 from spiveeworks/master
Update README.LIN (autogen.sh, dependencies)
2017-12-01 01:11:48 -06:00
Spivee 93d01f7bf5
Update README.LIN (autogen.sh, dependencies)
I found these dependencies harder to figure out than usual, 
since I'm used to installing packages with pregenerated `configure` scripts.
In particular if `glib` is missing then `configure` will generate with unexpanded macros, which is confusing.
This extra paragraph should be helpful for others. 

Thanks for a great program :)
2017-12-01 18:07:11 +11:00
rogerman 66e8a95657 Cocoa Port: Stability improvements for Metal display views. 2017-11-29 21:31:39 -08:00
rogerman 02a3b58edd Cocoa Port: Fix memory leaks with Metal display views.
- Also fix a bug where Metal display views fail on macOS High Sierra if a CPU-based pixel scaler was used.
2017-11-29 20:02:39 -08:00
rogerman c81df97a92 Cocoa Port: Restore the ability to use Metal display views on macOS High Sierra.
- Also rework the way the HQnx LUTs are loaded in Metal.
2017-11-28 14:06:34 -08:00
rogerman cd6fbcd5ea Cocoa Port: In the Metal framebuffer fetcher, further optimize 18-bit to 32-bit color conversions whenever the master brightness does not need to be applied, which is the most typical use case. 2017-11-28 00:53:50 -08:00
rogerman f0564cc4ac Cocoa Port: Fix a couple of rare edge-case bugs with Metal display views. 2017-11-27 22:53:18 -08:00
rogerman 258ebfd6ea Cocoa Port: Synchronously force a framebuffer fetch on startup to guarantee that all display windows will appear black. 2017-11-27 21:17:16 -08:00
rogerman e18dd27d30 Cocoa Port: Fix the Screenshot Capture Tool with running Metal. (Regression from commit f5ead86.) 2017-11-27 21:15:26 -08:00
rogerman 7213c6373b GPU: All fields for NDSDisplayInfo should be set consistently relative to the NDSDisplayID, not the GPUEngineID.
- In practice, this should change nothing, since all pointers somehow managed to point to the correct buffer locations. This should be nothing more than a programming consistency and readability improvement.
2017-11-27 21:07:14 -08:00
zeromus fa4b027dbd winport: add --windowed-fullscreen 2017-11-27 18:16:40 -06:00
rogerman d5b62d3d02 OpenGL Renderer: Improve the robustness of error-checking OpenGL drivers. 2017-11-24 02:02:05 -08:00
rogerman 010efff31b Linux Port (GTK): Fix OSMesa context creation. (Regression from r4905. Fixes #119.)
- Also do some code cleanup.
2017-11-24 00:28:49 -08:00
rogerman b9ada994df Linux Port (GTK): Remove and replace legacy colorspace handling routines with the new SIMD-optimized colorspace handling routines. 2017-11-22 17:43:17 -08:00
rogerman 96bd35517b Cocoa Port: Signal a fetch at startup, after reading the user defaults for GPU Scaling Factor and GPU Color Depth, in order to guarantee that the client-side fetch buffers will be cleared. 2017-11-21 19:05:11 -08:00
rogerman 5890540007 OpenGL: Maintain one more flag to ensure that textures are always initialized. (Fixes #116.) 2017-11-21 11:17:52 -08:00
rogerman 4269925258 GPU: Properly initialize the newer NDSDisplayInfo fields.
- This has the side-effect of having the Windows port’s display window
start up with a white screen and HUD showing (if enabled) just like
before, rather than a black screen and HUD possibly hidden.
2017-11-20 23:51:42 -08:00
rogerman 25eae6e1ed Cocoa Port (OpenEmu Plug-in): Change the video format to 18-bit RGB666, which matches a hardware NDS. 2017-11-20 21:04:50 -08:00
rogerman a7065311cc Core: Change some default settings to use more compatible and true-to-hardware settings.
- GPU Color Depth (from 24-bit to 18-bit), Advanced SPU Logic (from Disabled to Enabled), SPU Interpolation (from Linear to Cosine), Synchronization Mode (from Dual SPU Sync/Async to Synchronous)
- Just like the previous change to the default JIT block size, let the users themselves disable these settings so that they are more aware that they are sacrificing compatibility for speed.
2017-11-20 16:39:50 -08:00
rogerman 48fee8d590 Windows Port: Don't resize the display window after changing GPU Scaling Factor.
- Also remove TCommonSettings.GFX3D_PrescaleHD. It is a useless setting in core because the internal resolution is not limited to integer-multiplied scaling.
- Also fix spelling on the "Maintain Aspect Ratio" menu option.
2017-11-20 14:37:30 -08:00
rogerman 24108e35e2 Core: Change the default max. JIT block size from 100 to 12, since 12 has been tested to be more compatible and safer to use.
- There is only a negligible performance difference between 100 and 12.
- It is better for users to change the JIT block size from 12 to 100
themselves, since it might make them more aware that they are
sacrificing compatibility in favor of speed.
2017-11-20 12:57:24 -08:00
rogerman 6680577146 Render 3D: Handle RenderFinish() more consistently. Fixes 3D flushing issues when running single-threaded SoftRasterizer. 2017-11-20 10:58:27 -08:00
rogerman e5694abd63 SoftRasterizer: Tiny optimization to rasterization if a shadow polygon is used, taking advantage of an already existing hint. 2017-11-17 19:18:14 -08:00
rogerman d0c0a5641a Cocoa Port: Fix occasional screen flickering on Metal display views whenever a pixel scaler is used. (Regression from commit 7202fb8.) 2017-11-17 00:51:10 -08:00
rogerman 7202fb8d47 Cocoa Port: Fix a rare race condition that could cause Metal display views to crash if the GPU Scaling Factor very quickly and repeatedly changes. 2017-11-16 00:22:20 -08:00
rogerman bc7b03c3d5 Cocoa Port: Try to fix some more synchronization issues in Metal display views.
- Also remove the usage of _rwlockFrame and change it to a simple
pthread_mutex_t, since CocoaDSDisplay objects no longer have a need for
a full pthread_rwlock_t.
2017-11-15 21:25:21 -08:00
rogerman a481abebf9 Cocoa Port: Remove all fonts from all builds except for SourceSansPro-Bold. 2017-11-15 16:56:14 -08:00
rogerman d311517278 Cocoa Port: Remove extra underscore to make the .app bundle names consistent with the current naming scheme. 2017-11-15 16:44:15 -08:00
rogerman bfefaa7486 Cocoa Port: Remove --broken from the "OS X App" Release build target.
- Apparently, the —broken option isn’t available on all versions of git
describe. Remove it to avoid issues, since it isn’t really necessary.
2017-11-15 16:35:00 -08:00
rogerman 1373babe52 Cocoa Port: Update "DeSmuME (Latest).xcodeproj" to reflect the latest build procedures.
- Build artifacts are now created in the source code directory itself
instead of in DerivedData, just like how Xcode 3 does it.
- Making Profile builds using the “OS X App” build scheme now
automatically appends the git commit number to the .app bundle name.
2017-11-15 16:24:19 -08:00
rogerman 4457b95468 Cocoa Port (OpenEmu Plug-in): Update the microphone controls to use the latest CocoaDSController standards. Fixes both hardware and software mic modes. 2017-11-14 16:11:21 -08:00
Roger Manuel 16948fe8bd
Update .gitignore 2017-11-14 11:31:53 -08:00
rogerman 6c4e951e68 Cocoa Port: Only enable the "Use External Firmware Image" checkbox if the "Use External BIOS Images" checkbox is checked and only if both BIOS images are set. 2017-11-13 18:38:18 -08:00
rogerman 63a5cb90ae Windows Port: Fix compiling due to BackupDevice::_info name change. (Regression from commit 0907207.) 2017-11-13 14:43:41 -08:00
rogerman 0907207222 mc.cpp: It is now possible for DeSmuME to import its own battery save file format using the new method, BackupDevice::import_dsv(). 2017-11-13 14:13:09 -08:00
rogerman 3b2a9ededc Cocoa Port: The "File > Import ROM Save File" menu option now pauses the emulation when the NSOpenPanel is up.
- Also disable the "File > Export ROM Save File" menu option when there is no actual file to export.
2017-11-12 20:24:26 -08:00
rogerman 509d117f5f Cocoa Port (OpenEmu Plug-in): Update the OpenEmu plug-in to work using the latest version of the SDK. 2017-11-11 23:39:44 -08:00
rogerman 4abfa4466a Cocoa Port: Don't compile Lua-related files right now. Let's bring them back once there's an actual working prototype of this feature. 2017-11-11 17:24:10 -08:00
rogerman 128f9d0c96 Cocoa Port: As a small optimization, the MTLBuffers used in Metal display views should use MTLResourceCPUCacheModeWriteCombined wherever possible. 2017-11-11 16:16:17 -08:00
rogerman b03a799834 Linux Port (CLI and GTK): When building with --enable-hud, fix the segfault on startup that was caused by an uninitialized OSD object. (Fixes #107.) 2017-11-10 14:26:29 -08:00
rogerman 109dd6f373 Render3D: Change the Depth-Equal Test tolerance from +/-512 to +/-255.
- Special thanks to StapleButter for coming to us and informing us of this issue. 47a71941ac (commitcomment-25533528)
- This change does imply that GBATEK got this value wrong. http://problemkaputt.de/gbatek.htm#ds3dpolygonattributes
2017-11-10 09:43:54 -08:00
rogerman 89a74e5c3e Cocoa Port: Fix a whole slew of synchronization issues in the entire client display system, hopefully improving stability.
- Of special note, Metal display views aren't allowed to run on macOS High Sierra because of an assert bug in [id<MTLDevice> newBufferWithBytesNoCopy:length:options:deallocator:] in this particular version of macOS. Note that Metal display views will continue to work with macOS El Capitan and macOS Sierra.
2017-11-10 01:31:50 -08:00
zeromus 57f5fa0e6e Merge pull request #112 from atsampson/master
Linux Port: Fix missing semicolon.
2017-10-25 11:36:49 -04:00
Adam Sampson d74ab529a7 Linux Port: Fix missing semicolon.
This was lost in 0869afded6315fb14d2265e8b3872b36ccc3fdce's refactoring.
2017-10-25 14:40:28 +01:00
rogerman 0869afded6 GPU: All GPU settings are now staged. Pending settings are applied only right before the GPU actually renders.
- Of note, initialization of the 3D rendering engine is also staged, where the pending engine is initialized prior to applying the 3D rendering settings. However, only ports that support this behavior will do this. Ports that do not support this behavior will work the same way as before (initialize the 3D engine immediately).
2017-10-24 09:40:56 -07:00
rogerman 3ca9e871e8 Colorspace Handler: Fix some pixel alignment issues in ColorspaceConvertBuffer555XTo888_AVX2() and ColorspaceConvertBuffer888XTo888_AVX2(). (Related to commit 858b05d.)
- Also do some additional optimizations while we're at it.
2017-10-23 15:51:39 -07:00
rogerman 1be210271b Windows Port: AVI RGB888 color conversions are now multithreaded, and are also vectorized for SSSE3 and AVX2. (Fixes #105.) 2017-10-23 12:21:42 -07:00
rogerman 4c950d2a37 Colorspace Handler: Oops! Fix compiling in colorspacehandler_AVX2.cpp. (Related to commit 858b05d. Fixes #111.) 2017-10-23 11:11:49 -07:00
rogerman 8e16b618a7 Colorspace Handler: Fix bug where RB-swapping in ColorspaceConvert555XTo888() would cancel itself out, leaving RB unswapped in all cases. (Related to commit 858b05d.) 2017-10-22 23:31:24 -07:00
rogerman 858b05df79 Colorspace Handler: Add new functions for converting 16-bit RGBA5551 and 32-bit RGBA8888 color buffers to 24-bit RGB888.
- Also improve the performance of RGB555-to-RGBA6665 and RGB555-to-RGBA8888 conversions.
2017-10-22 22:14:05 -07:00
rogerman 2bc3be0711 Cocoa Port: Bottom-tier GPUs running an OpenGL display presenter now use faster (but less accurate) shaders for Bicubic B-Spline and Bicubic Michell-Netravali. 2017-10-22 22:08:41 -07:00
rogerman d9394594bf Cocoa Port: Fix bug where touch locations were being improperly calculated on Retina displays. (Regression from commit 059ea51. Fixes #110.) 2017-10-20 14:21:47 -07:00
rogerman 97525d94d7 Colorspace Handler: Properly maintain the alpha value when applying intensity to an RGBA5551 color buffer. 2017-10-20 13:03:03 -07:00
rogerman 64d32dca0e Cocoa Port: In the Screenshot Capture Tool, users can now assign the save directory by drag-and-dropping a folder onto the NSTextField. 2017-10-20 13:02:06 -07:00
rogerman 70d6df40d6 Cocoa Port: Enable Lua's ability to use dynamic-linked libraries. 2017-10-20 12:50:48 -07:00
rogerman 45572fb277 Render3D: Assume the initial states of the 3D rendering instead of initializing them with CommonSettings. Most notably, assume that _enableTextureDeposterize = false in order to force it to create its buffer later on. Fixes a potential crashing bug whenever Texture Deposterization is enabled. (Regression from commit 15a19ba. Fixes #109.) 2017-10-19 16:11:55 -07:00
rogerman 711115921b Cocoa Port: Begin setting up support for LUA. 2017-10-19 11:06:05 -07:00
rogerman 15a19ba02f Render3D: All 3D rendering settings are now staged. Pending settings are applied only right before the 3D renderer actually renders. 2017-10-18 15:45:46 -07:00
rogerman 8be15113e2 Linux Port (GTK-Glade): Fix screen drawing for GTK-GL. (Regression from commit f5c9a36.) 2017-10-17 23:31:00 -07:00
rogerman 43e740c661 GPU: Fix the clear color on big-endian systems when running RGB666 and RGB888.
- Also endian swap the BGnX and BGnY values on big-endian systems. This is a non-functional change, and is only meant to show that the endian swaps are indeed the correct choice for big-endian.
2017-10-17 18:49:05 -07:00
rogerman f5ead86d89 Cocoa Port: Fix various presentation issues, focusing mostly on the OpenGL presenter and the Screenshot Capture Tool.
- Changing the display video source now updates the display window properly while the emulator is paused.
- Fix bug in the Screenshot Capture Tool where screenshots would have incorrect colors if taken on a PowerPC Mac.
- Fix bug in the Screenshot Capture Tool where screenshots would be completely black if a CPU-based pixel scaler on OpenGL was used.
- The OpenGL presenter's GPU tiering system has been changed to be more strict. This effectively pushes many older GPUs into lower tiers.
- The following pixel scalers now require at least a Low-Tier GPU (previously only required Bottom-Tier): 2xSaI, Super2xSaI, SuperEagle, HQ3x, HQ3xS, HQ4x, HQ4xS
- The following pixel scalers now require at least a Mid-Tier GPU (previously only required Low-Tier): 2xBRZ, 3xBRZ
- Due to the new changes to the GPU tiering system and allowed pixel scalers per tier, the Screenshot Capture Tool running OpenGL now allows pixel upscaling on the GPU instead of disabling it completely.
2017-10-17 13:45:55 -07:00
rogerman e8e3200a23 GFX3D: Fix bug where 3D would fail to render on big-endian systems. (Regression from commit c6a5740.) 2017-10-16 17:38:37 -07:00
rogerman ba6e8e0bab Cocoa Port: Fix a bunch of HUD coloring issues on PowerPC Macs.
- Also fix a display backlight intensity issue on big-endian systems.
2017-10-16 17:03:01 -07:00
rogerman c31a5717ab Cocoa Port: Whenever attempting to take a screenshot using the Screenshot Capture Tool, simply cancel the operation altogether if the target directory does not exist or is not writable. 2017-10-16 12:11:57 -07:00
rogerman 7d2c70b7a8 Cocoa Port: Fix some issues with the Screenshot Capture Tool.
- Fix potential crashing bug that may occur if the target directory
isn’t found when clicking the Take Screenshot button.
- In the Display Layout dropdown panel, reposition the Display
Separation menu to be in the center section instead of in the leftmost
section.
2017-10-16 11:56:24 -07:00
rogerman 649587fcb1 Cocoa Port: Change CommandAttributes, now renamed ClientCommandAttributes, to call a C function pointer instead of an Objective-C selector when dispatching its command function. 2017-10-16 11:35:49 -07:00
zeromus 5c9fbdfb06 winport-fix some screenshots 2017-10-15 16:07:28 -05:00
rogerman baef8b3fda Cocoa Port: In the Screenshot Capture Tool, allow users to override the default display scale (calculated from GPU Scaling Factor) with their own user-defined display scale. 2017-10-14 17:29:59 -07:00
rogerman 73b5074313 OpenGL Renderer: Bring back support for handling the transparent polygon ID check. This fixes many graphical glitches involving transparent polygons in many games. (Regression from r5372. Fixes #74 and fixes #24.) 2017-10-13 18:35:05 -07:00
rogerman 9bfbaf23b8 GFX3D: Correct some notes about the POLYGON_ATTR Mode attribute. 2017-10-13 17:30:00 -07:00
rogerman 5f0c4ecf52 OpenGL Renderer: Shadow polygons doing the polygon ID check should only update the stencil buffer once instead of twice. 2017-10-11 12:45:29 -07:00
rogerman 8e94926072 OpenGL Renderer: Fix bug where translucent fragments drawing on top of zero-alpha fragments were not overwriting the destination fragment color as intended. (Regression from commit 2a1aaf7.) 2017-10-10 17:43:43 -07:00
rogerman 47a71941ac OpenGL Renderer: Add true support for the depth-equals test by properly emulating the tolerance value. This fixes many longstanding bugs related to missing polygons, Z-fighting glitches, and other misc. graphical glitches in many games. 2017-10-10 11:25:16 -07:00
rogerman 2a1aaf727e OpenGL Renderer: Reduce the number of stencil bits needed to emulate the shadow volume mask from 2 to 1. 2017-10-09 14:05:53 -07:00
rogerman c9025e81cb OpenGL Renderer: The fragment depth calculation now works more like how SoftRasterizer does it.
- Also update some comments in gfx3d.h.
2017-10-09 11:05:56 -07:00
rogerman c6a5740665 GFX3D: Rework polygon attributes and texture parameters using the latest coding style. Also improve the performance of SoftRasterizer while we’re at it. 2017-10-06 17:13:08 -07:00
rogerman e7d63e6cd2 GFX3D: Reduce the memory requirement of the vertex lists to one-third of its previous size.
- Has the positive side-effect of improving the OpenGL renderer's performance when many vertices are used.
- Also fix the vertex list double-buffering so that it actually works as intended.
2017-10-04 16:55:08 -07:00
rogerman f4c01c4b57 GPU: Fix bug where the backlight intensity would be incorrectly averaged if frameskipping is enabled. (Regression from commit f5c9a36.) 2017-10-04 00:32:43 -07:00
rogerman 6ca2dbe6d0 Cocoa Port: Fix a crash and a potential deadlock that may occur when responding to host display changes. (Regression from commit 4957d7b.) 2017-10-03 23:49:18 -07:00
rogerman addb17b660 Fix a bug where games would almost always start up with the main screen at low brightness and touch screen completely off. (Regression from commit f5c9a36.) 2017-10-03 17:28:33 -07:00
rogerman ff4a3e0a5c Linux Port (CLI and GTK-Glade): Add support for rendering the backlight intensity on the CPU-based display methods. (Related to commits f5c9a36 and 74ba49e.) 2017-10-03 15:16:18 -07:00
rogerman a3a577f2e9 Windows Port: Replace the backlight kludge in the DirectDraw display method with the new ColorspaceApplyIntensityToBuffer32(). (Related to commits f5c9a36, 3a000b6 and 74ba49e.)
- Also fixes a build problem in MSVC. (Regression from commit 74ba49e.)
2017-10-03 14:26:36 -07:00
rogerman 74ba49e168 Colorspace Handler: Add dedicated functions ColorspaceApplyIntensityToBuffer16() and ColorspaceApplyIntensityToBuffer32() for applying an RGB intensity value to a framebuffer. 2017-10-03 13:54:51 -07:00
zeromus 174dcc11bb Merge pull request #102 from atsampson/master
Fix broken option list in POSIX frontend
2017-10-03 01:56:59 -05:00
Adam Sampson ecbcb3c821 Fix broken option list in POSIX frontend
f5c9a36930 tried to remove an entry from
the list of options, but only deleted half of it.
2017-10-03 07:52:39 +01:00
zeromus 3a000b68fd re #59 - abuse accelerated masterbrightness processor to crudely implement LCD backlight for DD display methods 2017-10-02 14:55:50 -05:00
rogerman f5c9a36930 GPU: NDSDisplayInfo now reports the backlight intensity for each display. The LMNTS demo now properly fades the backlights in and out, but only on frontends that support this feature. (Fixes #59.)
- Note: The backlight intensity is only emulated on frontends with 3D-based display methods, such as OpenGL and Metal. CPU-based display methods, such as DirectDraw, SDL and Cairo, are currently unsupported.
2017-10-02 11:39:40 -07:00
rogerman 059ea519bc Cocoa Port: Vastly improve the ability to take screenshots of the NDS displays.
- The old Tools > Save Screenshot As has been replaced with the new Screenshot Capture Tool.
- The new Screenshot Capture Tool allows screenshots to be configured to render with the same layout features as a display view.
- Screenshot captures now both render and save to file on their own independent threads.
- Screenshots are now captured using the Take Screenshot button, and files are now automatically named based on ROM name and timestamp.
- All of these features means that users can now rapidly take screenshots with their own custom layouts, all with little to no slowdown to the emulation.
- Also do a bunch of code cleanup and refactoring as a side-effect of adding these new features.
2017-09-30 23:54:05 -07:00
zeromus 2c1360dec5 fix #97 - increasing matrix stack cursor size to 6bits caused garbage to get masked into GXSTAT since there had been no &31 to select only the needed 5 bits 2017-09-29 14:47:15 -05:00
rogerman d37ef1ff95 Cocoa Port: Copying the contents of the display window via Edit > Copy now copies the actual contents of the display window instead of directly copying the NDS screens with a generic vertical layout. 2017-09-25 21:21:51 -07:00
rogerman 70c69a46d3 OpenGL Renderer: Fix a bug where the behavior of translucent polygons can become undefined if the frame contains nothing but translucent polygons. Fixes a graphical glitch in Grey's intro scene in Mega Man ZX Advent. (Regression from commit 1742114.) 2017-09-23 21:32:34 -07:00
rogerman 1742114fcd OpenGL Renderer: Reset the current polygon's OpenGL states to the last opaque polygon whenever the zero-destination-alpha-pass is performed. Fixes a graphical bug in MegaMan ZX Advent, where the explosions from the boss in Grey's first level will render incorrectly. (Regression from commit eea54a7.) 2017-09-22 17:25:01 -07:00
rogerman f521ab1164 Cocoa Port: Refactor the hardware mic stuff out of CocoaDSController and into ClientInputHandler. 2017-09-21 00:33:28 -07:00
rogerman f8bbbec0ae OpenGL Renderer: Fix possible crash that may occur if the 3D framebuffer is used before the 3D renderer has a chance to render at least once. (Partially addresses #59.) 2017-09-19 17:47:48 -07:00
rogerman 4ea08792cb Cocoa Port: Fix bug where the ROMInfoPanel was misaligning the locations of info sections. 2017-09-19 15:49:22 -07:00
rogerman aa04c8f233 Cocoa Port: Better guarantee that display views will always be assigned a display ID. 2017-09-19 14:47:55 -07:00
rogerman 830dd0d78c Cocoa Port: Give user feedback for when the emulation gets halted internally.
- Also be more consistent when recovering from an internal emulation halt.
- Also apply enabling the external BIOS, external firmware and firmware boot settings at load/reset time instead of at frame time.
2017-09-19 12:59:44 -07:00
zeromus 1c59441697 fix bug in sthread_isself (fixes #34) 2017-09-17 04:05:17 -05:00
zeromus c5cea732fa update rthreads.c from upstream 2017-09-17 04:02:14 -05:00
rogerman fda9fc2a89 Cocoa Port: Reduce threading overhead for framebuffer fetches and SPU_Emulate_user().
- Framebuffer fetches no longer run on a CocoaDSThread, but instead uses a pthread directly. This can be done since framebuffer fetching only serves one function and always receives the same execution message, making a full CocoaDSThread a waste.
- SPU_Emulate_user() is no longer called on a separate thread, and instead is called in the emulation thread directly. For the typical SPU use case (SPU Sound Synchronization w/ Advanced SPU Logic), SPU_Emulator_user() becomes negligible, and so the threading overhead becomes unnecessary. In the use case where Dual SPU Synch/Asynch is used, Advanced SPU Logic is almost always disabled with it, and so the penalty of calling SPU_Emulator_user() on the emulation thread will be more than compensated by the performance increase of turning off Advanced SPU Logic.
- Also do some code cleanup/refactoring here and there.
2017-09-16 18:08:07 -07:00
rogerman 8f2c85fe86 Cocoa Port: Remove some extraneous properties from DisplayWindowController since these same properties are handled elsewhere. 2017-09-16 02:36:22 -07:00
rogerman 4957d7be5b Cocoa Port: Rework how Metal display views flush to screen, improving their overall performance.
- Fix a bug where Metal display views can block emulation execution if the user very quickly spams inputs while the input HUD is shown.
- Metal display views are no longer frame capped -- they can now run to their fullest performance potential, as fast as the host hardware will allow. This behavior is now consistent with OpenGL display views.
- As a side-effect, non-layer backed OpenGL display views also have a performance improvement.
2017-09-16 00:13:52 -07:00
zeromus 759a039e25 handle powered-off geometry engine more sensibly. involves commit 66b5da1c and issue #31, intended to fix ZX advent. fixes #58. 2017-09-15 09:57:16 -05:00
rogerman d33faecd12 Cocoa Port: Create new DisplayView objects in code instead of creating them implicitly through the nib. 2017-09-13 14:48:19 -07:00
rogerman c94f353f2a Cocoa Port: For Metal display views, in -renderDrawable, separate buffer updates from encoding commands in an effort to try to reduce the hold time on the vended drawable as much as possible. 2017-09-12 00:50:57 -07:00
rogerman d0f16193c5 Cocoa Port: Refactor out more input-related stuff into some new files -- ClientInputHandler.cpp/.h. 2017-09-11 23:32:30 -07:00
rogerman cb4ecbe17e Cocoa Port: Do some refactoring to remove extraneous connections in EmuControllerDelegate. 2017-09-11 15:26:37 -07:00
rogerman 221fa5f72b Cocoa Port: Add support for reporting inputs in the HUD.
- Also do a bunch of code refactoring.
2017-09-11 09:41:54 -07:00
rogerman 17ff2b2d6e vfat.cpp: Silence a couple of compiler warnings. 2017-09-09 13:00:35 -07:00
rogerman 4cfa910e75 Cocoa Port: NEW FEATURE - Users can now apply custom colors to individual HUD line items. 2017-09-05 13:12:31 -07:00
rogerman 2b9bc2509a Cocoa Port: Additional tweaks to the new turbo settings UI. (Related to commit af22153.) 2017-09-04 09:54:35 -07:00
rogerman af22153f5c Cocoa Port: NEW FEATURE - Add the ability to set up custom frame-by-frame press/release state patterns for turbo. 2017-09-04 09:33:11 -07:00
rogerman d1ac719b5c Cocoa Port: Fix UI issue where status bar on display windows would no longer show the mic gain control. (Regression from commit 3bf295f.) 2017-09-04 08:09:48 -07:00
rogerman ccaefb18bc Cocoa Port: Fix UI issue where the Input Preferences window may not be automatically assigned as the first responder. (Regression from commit 1e9b179.) 2017-09-03 14:25:25 -07:00
rogerman f67f959fe3 Cocoa Port: Retrieve both pending and applied NDS inputs post-NDSExec().
- Also do some minor code cleanup on some input-related stuff.
2017-09-01 16:38:06 -07:00
rogerman a86539eb1c Cocoa Port: Do some refactoring on reading the client-side inputs.
- Also make calculating the mic level average more efficient, as well
as updating the mic level average every 8th frame instead of every
frame.
2017-09-01 00:33:54 -07:00
Roger Manuel b4650e4083 Merge pull request #94 from atsampson/master
Update remaining stub versions of mic_savestate/loadstate. Fixes #95.
2017-08-31 01:16:40 -07:00
rogerman fd6ed7b518 Cocoa Port: Synchronize access to ClientDisplayView._hudString. 2017-08-30 15:34:58 -07:00
rogerman db4982f4bc Cocoa Port: Continue refactoring cocoa_core.mm.
- Also fix a small off-by-one error in slot1_Change().
2017-08-30 15:20:08 -07:00
rogerman e29e825d27 Cocoa Port: Report newer options in the Support Requests and Bug Reports pages to reflect the current feature set.
- Also update the URL for the Bug Report webpage from sourceforge.net
to github.com.
2017-08-29 17:16:19 -07:00
rogerman abebaebdef Cocoa Port: Continue refactoring the emulation execution loop code to be less port-dependent. 2017-08-29 15:14:24 -07:00
rogerman 3bf295f4ce Cocoa Port: Fix bug where Lion-style full screen failed to work on OS X Mavericks and Yosemite. 2017-08-28 19:36:55 -07:00
rogerman 1e9b179bf4 Cocoa Port: Begin refactoring some of the emulation execution loop code to be less port-dependent.
- Also clean up some UI code with switching app preferences views when
running OS X Leopard.
2017-08-28 17:30:19 -07:00
rogerman a05e03e2cc OpenGL Renderer: When running a GPU Scaling Factor of 3x and 4x, increase the MSAA sample size limit from 8xMSAA to 16xMSAA. 2017-08-27 14:07:13 -07:00
rogerman 2379dc1e41 OpenGL Renderer: Make the MSAA sample size limit based on the framebuffer size instead of being fixed at 8xMSAA.
- The MSAA sample size limit is now based on the following sizes:
1x Native Resolution - 32xMSAA
2x Native Resolution - 16xMSAA
3x-8x Native Resolution - 8xMSAA
9x and greater Native Resolution - 4xMSAA
2017-08-26 22:41:53 -07:00
Adam Sampson e58fb84707 Update remaining stub versions of mic_savestate/loadstate.
11cf901336 changed most of these but
missed these three.
2017-08-26 15:32:14 +01:00
rogerman e6d5a8fbe1 Windows Port: Increase the maximum GPU Scaling Factor from 5x to 16x. (This should be safe on the vast majority of GPUs out there, but if we find out that this ends up being unsupported on many GPUs, the max scaling factor may have to be reduced back to 5x. This will need additional testing.)
- Also do some minor code cleanup here and there.
2017-08-25 18:53:07 -07:00
rogerman 823e9edf7f Windows Port: Fix compiling on Windows. (Regression from commit 11cf901.) 2017-08-24 15:28:46 -07:00
rogerman 11cf901336 Major code cleanup across the board, mostly involving interactions with EMUFILE.
- Function/method parameters for EMUFILE objects are now passed by
reference instead of passed by pointers, where appropriate. This is
true for the vast majority of EMUFILE usage.
- Eliminate duplicate little-endian read/write functions in
readwrite.cpp. Use the equivalent methods in EMUFILE instead.
- Completely standardize the design patterns and usage of the various
little-endian read/write methods. Should help stabilize interactions
with save state files, as well as try to make save states
cross-compatible between big-endian and little-endian systems.
- Replace EMUFILE fread()/fwrite()/fputc() calls with equivalent
size-specific methods where applicable.
- Misc. code readability and stability improvements.
2017-08-24 15:14:25 -07:00
rogerman e17e1bd0af Cocoa Port: Minor tweaks to some UI elements to eliminate some build warnings. 2017-08-23 02:37:37 -07:00
rogerman c52b5702ed Cocoa Port: Change InfoPlist.strings format from UTF-16LE to UTF-8.
- Also add macosx_10_5_compat.cpp back into the normal OS X build of
the Xcode Latest project. It’s still needed for compatibility on OS X
10.5 Leopard for x86/x86-64. (Don’t know how this got disabled — it
just somehow mysteriously did.)
2017-08-23 01:47:44 -07:00
rogerman 3a63db2086 Cocoa Port: Do some minor code cleanup. 2017-08-22 21:31:28 -07:00
rogerman 2746427dd7 Colorspace Handler: Fix more RGBA8888 and RGBA6665 conversions for Altivec. 2017-08-22 15:50:03 -07:00
rogerman c7b9ecfc52 Cocoa Port: Tiny code consistency change. 2017-08-22 13:57:12 -07:00
rogerman e4f935743c GPU: Clean up and optimize the BG mosaic code. 2017-08-21 19:31:41 -07:00
rogerman da6c79c6bd GPU: When calculating the VRAM pixel location using MMU_gpu_map(), replace division and mod instructions with bitshift and bitwise AND instructions. Should help older compilers that don't know how to optimize the division/mod instructions into bitshift/bitwise AND instructions. 2017-08-21 08:23:12 -07:00
rogerman f02210bfdb GPU: Try to clean up GPUEngineBase::_SpriteRenderPerform() a little bit. 2017-08-19 20:21:09 -07:00
rogerman a9f2e53c25 GPU: Be consistent with how we apply the sprite window flags.
- Now applies the sprite window flags consistently between rotozoomed
and non-rotozoomed modes.
- Applying the sprite window flags in rotozoomed modes now ignores
sprite priority as intended.
2017-08-19 12:07:48 -07:00
rogerman 48f0f69929 GPU: When compositing a sprite, remove the color effect enable test so that the enable test and the OBJ translucency test don't conflict whenever window testing is also enabled. Fixes the portal-in-the-horizon scene in Pokemon Mystery Dungeon: Explorers of Sky. (Fixes #92.)
- Also rename some variables for better code clarity.
2017-08-19 11:42:06 -07:00
rogerman c0a21a717d GPU.cpp/.h: Revert back to using Unix-style line-endings instead of Windows-style line-endings. 2017-08-19 11:04:45 -07:00
zeromus 222f5d8507 gpu - clean up sprite window rendering so it isn't a separate codepath but rather is identical to regular character OBJ until the very end. may fix subtle bugs, may do nothing, but it's cleaner now anyway 2017-08-18 22:44:56 -05:00
rogerman bf120f3c3e OpenGL Renderer: Fix one more compiling issue on Windows 32-bit. 2017-08-17 01:05:08 -07:00
rogerman 51a9e2b0ab OpenGL Renderer: The zero-dst-alpha-fragment pass for edge marking now works the same as the one for rendering the main geometry.
- Also fix a compiling issue in the Windows build. (Regression from
commit 6acf781.)
- Also fix an issue in the zero-dst-alpha-fragment pass while running
MSAA in legacy OpenGL. (Related to commit 6acf781.)
2017-08-17 00:51:30 -07:00
rogerman 6acf7818ea OpenGL Renderer: Translucent fragments now correctly overwrite zero-alpha destination fragments when running MSAA. (Related to commit 3b354a0.) 2017-08-16 22:27:38 -07:00
rogerman 3a11041ef0 GPU: Rename some stuff for better clarity. 2017-08-14 21:43:28 -07:00
rogerman 7487bf2295 GPU: Remove some assumptions with how OBJ layers will read custom VRAM, instead assigning the read location on a per-line basis based on the isLineCaptureNative flag. Fixes screen flickering in Kingdom Hearts: 358/2 Days. 2017-08-14 16:37:56 -07:00
rogerman 9a5e52a7fa Cocoa Port: New feature - The Main and Touch displays can now be individually assigned the engine that feeds them video. This can be done on a per-display window basis. 2017-08-12 23:04:53 -07:00
rogerman 623d490393 OpenGL Renderer: Use backface culling for whole-framebuffer processing steps.
- Also tidy a few things here and there.
2017-08-08 12:33:19 -07:00
rogerman 10d2776938 Colorspace Handler: Altivec conversion functions no longer use vec_splat*(), but instead use literals directly. Fixes compiling for ppc64 systems. 2017-08-07 18:23:44 -07:00
rogerman b9c6cd69a1 Cocoa Port: Tidy and tighten up the spacing of certain UI elements. 2017-08-07 17:50:24 -07:00
rogerman 7dbe1444c3 Cocoa Port: Fix a few more coloring issues on PowerPC Macs. 2017-08-07 15:47:04 -07:00
rogerman 8df7d15664 Cocoa Port: When the OpenGL blitter uses CPU-based pixel upscaling, framebuffer fetches no longer swap R and B colors.
- Also silence a compiler warning in DisplayWindowController.h.
2017-08-07 12:56:46 -07:00
rogerman 54f0e4b19b Colorspace Handler: When SWAP_RB is true, ColorspaceConvert555To8888_AltiVec() and ColorspaceConvert555To6665_AltiVec() will now swap R and B colors as intended. 2017-08-07 12:53:21 -07:00
rogerman 4fd39bac56 NDSSystem.cpp: Fix bug where certain inputs would fail to work on big-endian systems. (Regression from commit bcc7421.) 2017-08-07 12:51:50 -07:00
rogerman 4e1bdab8c7 Fix some graphical bugs on big-endian systems. (Regressions from commits f8d129b and f97283e.) 2017-08-05 22:45:38 -07:00
rogerman f377bfeb76 cheatSystem.cpp: Fix compiling on non-x86 systems. 2017-08-05 14:07:56 -07:00
rogerman 4473f5425d Cocoa Port: Fix compiling issues when building using Xcode 3. 2017-08-05 13:55:28 -07:00
rogerman 3b354a0096 OpenGL Renderer: Fix longstanding blending bug where zero-alpha destination fragments were being blended with instead of being overwritten. This fixes certain coloring bugs in many games. (Does not currently work with MSAA.) 2017-08-04 16:54:51 -07:00
rogerman d2b25360d5 OpenGL Renderer: Do some minor code cleanup. 2017-08-04 11:49:50 -07:00
rogerman eea54a753c OpenGL Renderer: Be a little more precise when doing polygon comparisons between opaque and translucent drawing modes. (Related to commit 5aeed21.) 2017-08-04 11:25:06 -07:00
rogerman f8ab45fc4b OpenGL Renderer: Fix bug where edge mark and fog would fail if MSAA is used. (Regression from commit fd5d882.) 2017-08-03 15:53:04 -07:00
zeromus b442998635 Merge pull request #87 from edbird/README_LIN_update
edited README.LIN
2017-08-03 16:45:31 -05:00
EdBird 5294ef1799 edited README.LIN 2017-08-03 18:55:56 +01:00
rogerman 5aeed2112b OpenGL Renderer: Maintain the continuity of polygon comparisons when transitioning between 'opaque polygon drawing mode' and 'translucent polygon drawing mode'. Fixes #85. (Regression from commit 1ff91b7.) 2017-08-03 00:08:08 -07:00
rogerman 87e52c334b OpenGL Renderer: Fix 3D rendering for builds using an an MSVC compiler. Fixes #81. (Regression from commit 1ff91b7.) 2017-08-02 15:12:40 -07:00
rogerman 1ff91b7841 OpenGL Renderer: The RenderGeometry() polygon drawing loop is now splits up the drawing of opaque polygons and transparent polygons. 2017-08-02 00:57:59 -07:00
rogerman 600ae21668 OpenGL Renderer: Do some minor code cleanup. 2017-08-01 13:02:50 -07:00
rogerman fd5d882fe1 OpenGL Renderer: Remove the working depth buffers, and read the default depth/stencil buffer directly. 2017-07-31 20:37:20 -07:00
rogerman 7a018eb9c6 OpenGL Renderer: Fix bug where rendering will fail for GPU drivers that support FBOs, but not Multisampled FBOs. (Regression from commit 5deec25.) 2017-07-31 07:03:27 -07:00
rogerman aead3f4109 GPU: Fix pixel alignment bug when the framebuffer is 3x sized, running on an SSE2 system. (Regression from commit 062c0ad.) 2017-07-31 06:56:16 -07:00
rogerman c0a2193290 OpenGL Renderer: Bring back OpenGLRenderer_2_0::InitFinalRenderStates(), fixing blending for the v3.2 renderer. (Regression from commit 8c37d4a.) 2017-07-31 05:11:37 -07:00
zeromus 4b8e7ceaef Merge pull request #80 from heftig/master
include string.h in all colorspacehandler implementations
2017-07-30 18:15:59 -05:00
Jan Alexander Steffens (heftig) 315320e0c1
include string.h in all colorspacehandler implementations 2017-07-31 01:10:19 +02:00
zeromus 368d785301 include string.h for memcpy. fixes #79 2017-07-30 11:51:17 -05:00
rogerman 917475b9cd OpenGL Renderer: Oops! Fix a bug where shaders would fail to work in legacy OpenGL, even when they are actually supported. (Regression from commit 8c37d4a.) 2017-07-29 20:34:32 -07:00
rogerman 69f97b056a OpenGL Renderer: Lower host GPU requirements for performing on-GPU final framebuffer conversions.
- Framebuffer conversion now occurs purely in shaders, and also
performs flipping along with conversion. FBOs and PBOs are no longer
required to do this.
- If shaders are not available, then framebuffer flipping will occur if
FBOs are available. PBOs are no longer required to do this.
- Also fix a minor framebuffer attachment bug in the v3.2 renderer.
2017-07-29 19:39:21 -07:00
rogerman 5deec25409 OpenGL Renderer: Eliminate two extraneous framebuffers, especially saving VRAM at the larger custom framebuffer sizes. 2017-07-29 17:47:53 -07:00
zeromus 353dcef3ec winport (aviout) - fix stuff 2017-07-29 16:45:22 -05:00
zeromus ef4b203064 winport (aviout) - make output end with less bugs when the disk is full 2017-07-29 13:48:01 -05:00
zeromus 153b3ed61b winport (aviout) - fix regressions in multipart naming; fix spurious "avi recording ended" message 2017-07-29 13:46:45 -05:00
rogerman d08dffd122 OpenGL Renderer: _FlushFramebufferFlipAndConvertOnCPU() now handles all 4 possible permutations of frame buffer flipping and color conversion.
- Also remove OpenGLRenderer_2_1::ReadBackPixels().
2017-07-28 18:41:49 -07:00
rogerman 8c37d4acd6 OpenGL Renderer: Remove extraneous OpenGL v1.x classes, and do more aggressive capabilities checks on init.
- Keep OpenGLRenderer_1_2 as the sole OpenGL v1.x class, and then
remove the following classes: OpenGLRenderer_1_3, OpenGLRenderer_1_4,
OpenGLRenderer_1_5.
2017-07-28 11:22:34 -07:00
rogerman 1938dc2eed Colorspace Handler: Fix the RGBA5551 color swapping lookup table. (Related to commit 8600466.) 2017-07-27 22:45:03 -07:00
rogerman 8600466498 OpenGL Renderer: Standardize 32-bit color red-blue swapping in OpenGLRenderer::_FlushFramebufferConvertOnCPU(). 2017-07-27 22:04:42 -07:00
zeromus d16785eba8 winport - fix avi segmenting (especially or exclusively when dumping with HD) 2017-07-27 22:16:15 -05:00
rogerman 740fb66ca5 OpenGL Renderer: Fix more possible red-blue color swapping issues in legacy OpenGL when the output color format is RGB888. 2017-07-26 23:21:05 -07:00
rogerman d2165f90fe Colorspace Handler: Fix ColorspaceConvert8888To6665_SSE2() for the SSE2 code path. 2017-07-26 22:57:07 -07:00
zeromus 5893dc78f3 action replay - attempt to avoid running off the end of cheat codes and crashing in case of invalid codes (fixes #78) 2017-07-26 23:48:50 -05:00
zeromus 1e5e47f75e winport - fix RGB/BGR of OSD rendering (all bpp's) 2017-07-26 23:13:01 -05:00
zeromus db16f2f888 winport - fix crash making PNG screenshots 2017-07-26 23:02:02 -05:00
rogerman 35e295e3dd OpenGL Renderer: Try and fix some recent issues with legacy OpenGL. 2017-07-26 15:42:30 -07:00
zeromus 679d5384e3 winport: fix some RGB/BGR orders in various displaymethod/gpu_bpp configurations. fixes #77 2017-07-25 13:06:54 -05:00
rogerman b96d2f01e1 GPU: When rendering at custom framebuffer sizes, initialize the deferred index buffer per layer so that previous layers won't corrupt the current layer. Fixes the score screen in Sonic Rush.
- Also do some minor code cleanup in
GPUEngineBase::_RenderPixelsCustom().
2017-07-25 10:43:20 -07:00
rogerman 062c0adef2 GPU: Unify line copying routines, and also make SSSE3-enhanced integer-scaled copying more available. 2017-07-24 23:35:40 -07:00
rogerman 654537a4fb GPU: Do some code cleanup. 2017-07-24 13:57:44 -07:00
rogerman 4ba36cbd1e Colorspace Handler: Fix pixel alignment bug in _ConvertColorBaseTo5551_AVX2(). (Related to commit de4f1c9.) 2017-07-24 13:33:03 -07:00
zeromus 5c983ede81 winport - support 15bpp as well 2017-07-24 13:47:30 -05:00
zeromus 46c28635ef winport - make 3d settings organization match cocoa UI's, and expose choice of 24/18 bpp GPU 2017-07-23 21:30:00 -05:00
zeromus a7ec7c9581 just a comment 2017-07-23 21:29:36 -05:00
zeromus 71eb37f44e gpu - small refinements to BPP-setting interfaces 2017-07-23 21:29:24 -05:00
zeromus 18f02cb7d3 winport - fix screenshot, aviout bugs due to 888 colorspace change 2017-07-23 20:42:27 -05:00
zeromus 918f45e7a4 libretro-common rbmp - add support for y-flipping 2017-07-23 20:42:27 -05:00
zeromus 6ced9e3942 update libretro-common rbmp 2017-07-23 20:42:27 -05:00
zeromus e620b15d3c Revert "Revert "winport: use 666 color". Now I know how to do it... but it wasn't 100% ready anyway, and it breaks avi/screenshot, so let's wait and fix those when the 666 color is finally 100% done."
This reverts commit 50390c6f4f.
2017-07-23 20:42:27 -05:00
rogerman 12a0c861a7 GPU: Add fast compositing paths for BrightnessUp/BrightnessDown color effects. 2017-07-22 13:00:15 -07:00
rogerman 250de64ee5 GPU: Unify the GPUEngineBase::_PixelEffect*() functions. 2017-07-21 15:49:01 -07:00
rogerman 301c875ecb GPU: For native-sized captures, always read from native VRAM -- never from custom VRAM. Should make captures a little faster when running a custom framebuffer and/or using RGB888 color format. 2017-07-21 12:49:57 -07:00
rogerman 1b483d266a GPU: Fix bug where sprite blending would no longer work. (Regression from commit 624dd57.) 2017-07-21 09:51:13 -07:00
rogerman 624dd5788c GPU: Another significant performance improvement to GPU compositing in many games.
- Now composites pixels using explicit functions for simple copy,
masked copy, and masked effect.
- On SSE2 systems, pixels composited using a simple copy no longer
require the destination pixels to be loaded first, since all the pixels
are guaranteed to be overwritten anyways.
- Try and move the window test as far up the pipeline as possible so
that pixel rendering can bail as soon as possible if the window test
fails.
- Clean up and further standardize the code for compositing BG layers,
OBJ layers, and 3D layers.
2017-07-20 23:45:41 -07:00
rogerman 80a4c3f071 GPU: Fix bug where 3D rendering sometimes does not appear correctly on SSE2 systems. (Regression from commit 5c6fcb0.) 2017-07-20 00:55:08 -07:00
rogerman 5c6fcb0f47 GPU: Significantly improve GPU compositing performance in many games.
- Adds more possible conditions for compositing to take the fast path
(simple pixel copying).
- Adds SSE2 optimizations for the 2x and 4x scaling cases in
GPUEngineBase::_LineColorCopy().
2017-07-19 23:41:43 -07:00
rogerman c3bce87556 Cocoa Port: Expose the new feature to change the GPU color depth in the UI. (Related to commit 3b37058.) 2017-07-18 20:57:55 -07:00
rogerman 3b37058cbc GPU: Custom VRAM now works with 24-bit color depth. It can be captured natively in 24-bit and used as a source buffer in 24-bit. (Related to r5433. This rework is now COMPLETE!)
- NEW FEATURE: Clients may now call GPUSubsystem::SetColorFormat() to
choose the color format of the GPU output, which can be RGB555
(15-bit), RGB666 (18-bit), or RGB888 (24-bit).
- On a special note, the Deposterize filter for 3D textures can now
show its true smoothing effect when clients run the GPU in 24-bit color
mode.
2017-07-18 20:56:11 -07:00
rogerman e7f1737bdb Cocoa Port: The Vertical Sync setting has been removed -- it is now automatically set.
- New behavior for layer-backed views (OpenGL on Mountain Lion and
later, or Metal): Vertical Sync is always enabled.
- New behavior for non-layer-backed views (OpenGL on Lion and earlier):
Vertical Sync is only enabled if frameskip is enabled or if the
execution speed is set to 1x or less while the speed limiter is engaged.
- Remove all associated UI for manually setting Vertical Sync.
- Also add a new menu option to the Tools menu for disabling Metal,
instead forcing display views to use OpenGL. (For developer builds
only.)
2017-07-18 17:10:26 -07:00
rogerman ddac7122d3 Cocoa Port: Ensure that display windows avoid drawing with uninitialized display info and possibly non-existent buffers on startup. 2017-07-18 01:26:42 -07:00
rogerman 7791f60495 Cocoa Port: Avoid sending a torrent of MESSAGE_RELOAD_REPROCESS_REDRAW messages whenever a new display window is created. 2017-07-18 01:24:08 -07:00
rogerman 68f201c3ce SoftRasterizer: Fix incorrect coloring when using an output format of RGB888. (Regression from commit eaa5210.) 2017-07-15 17:02:56 -07:00
rogerman eaa5210fb0 GPU: Finishing 3D rendering and flushing the 3D framebuffers are now split into separate operations.
- Fixes the background appearance when receiving items in Pokemon
Black/White 2. (Fixes SF bug #1624.)
2017-07-15 16:00:26 -07:00
rogerman 0f05656a17 Save States: Fix save state compatibility for files created between 32-bit and 64-bit systems. (Regression from r5363.) 2017-07-15 15:38:39 -07:00
rogerman 63b232c1b8 GPU: Fix possible crash by properly initializing working capture buffers. (Regression from commit 28f5c3a.) 2017-07-08 10:56:29 -07:00
rogerman 652af9ec71 Cocoa Port: Always allow client display views to process displays if the client did not request a custom framebuffer size.
- Also try to solve some synchronization issues with Metal display
views.
2017-07-07 13:13:29 -07:00
rogerman 1f60446f3f GPU: Fix bug on SSE2 builds where the window test mask would be undefined if the output color format is RGB666 or RGB888. 2017-07-05 23:30:31 -07:00
rogerman 28f5c3a895 GPU: Don't do ad-hoc allocations of working capture lines in GPUEngineA::_RenderLine_DisplayCapture(). Allocate the lines in GPUEngineA::SetCustomFramebufferSize() instead.
- Also do some minor refactoring and code cleanup.
2017-07-05 23:22:49 -07:00
zeromus ee235d2abc fix gdbstub compiling in posix frontend. didnt really test it... should fix #73 2017-07-03 09:37:51 -05:00
rogerman c37e892090 GPU: Partially reverts changes to the LCDC check, bringing back an optimization for display capture.
- Revert commit abe2e61997. (But retains
the comments about Mario Kart.)
- Partially revert adf682eb23. (But
retains the removal of the LCDC check in ResetDisplayCaptureEnable().)
2017-07-01 13:51:15 -07:00
rogerman 76063a389c Cocoa Port: Fix bug that causes building to fail. (Regression from commit c365617.)
- Also do some minor code cleanup to byteSizeStringWithLargerUnit:.
2017-07-01 13:44:52 -07:00
zeromus 73c8f8af37 Merge pull request #71 from kongfl888/screenshot
winport: fix the screenshot type is not saved.
2017-06-09 23:16:00 -05:00
kongfl888 65bd5b565c winport: fix the screenshot type is not saved. 2017-06-10 10:47:23 +08:00
zeromus d6872769ae cheats: fix bug in EXXXXXXX code eating one too many code lines 2017-05-29 10:05:22 -05:00
zeromus 50390c6f4f Revert "winport: use 666 color". Now I know how to do it... but it wasn't 100% ready anyway, and it breaks avi/screenshot, so let's wait and fix those when the 666 color is finally 100% done.
This reverts commit a0d42e1536.
2017-05-28 20:11:45 -04:00
zeromus 126db2d6de fix null assignments to std::strings the right way 2017-05-05 14:26:34 -05:00
zeromus 4707380746 Merge pull request #68 from klapeto/master
PosixGTK Graphics Dialog UI
2017-05-05 14:25:34 -05:00
klapeto a2527ef733 posixGTK: Additional graphic options added to Graphics Dialog 2017-05-05 21:42:51 +03:00
zeromus adf5151568 cheats: reset jit, sometimes, when it's needed 2017-05-05 00:45:28 -05:00
klapeto 08e2244cea posixGTK: Added Graphics Settings dialog and 3D core switch ui 2017-05-04 22:34:59 +03:00
klapeto b460d76698 Fixed segmentation faults caused by NULL assignments to std::strings 2017-05-04 16:16:12 +03:00
zeromus 58b69b912a winport: fix crash opening nonexistent recent rom (fixes #67) 2017-05-03 19:32:24 -05:00
zeromus 6b92b6fb2a Merge pull request #66 from np511/master
Add GUI to change JIT settings
2017-05-03 14:20:40 -05:00
np511 ff2ebe400d Add GUI to change JIT settings 2017-05-03 12:24:11 -04:00
zeromus e0945c362b fix booting from firmware since I broke it adding the new slot-1 timing (failed to support it on arm7). fixes #64 (broken by 281268e) 2017-05-02 17:59:33 -05:00
zeromus 09ffe3545e try to fix bad, bad, badness caused by running nitrofs tool in another thread (hopefully fixes #65) 2017-05-02 17:50:23 -05:00
zeromus 9357fd79e3 fix bug in fsnitro FAT reading; fixes #63 2017-04-28 20:53:40 -05:00
zeromus bc2e1d99d3 fix crash in slot1 retail(debug) when it's set while no game is loaded (fixes #63) 2017-04-27 20:37:40 -05:00
zeromus 281268e05f emulate slot-1 read timings (fixes SF bug 1258) 2017-04-26 18:34:07 -05:00
zeromus 6600a2c393 Merge pull request #61 from atsampson/master
fix: add missing comma in ZIPROMReader definition
2017-04-26 16:47:54 -05:00
Adam Sampson ebde061afe fix: add missing comma in ZIPROMReader definition
This was omitted in c365617ff737bdb3c06c307159078ca4e5f7e175; the other
ROMReader_structs it updated were correct.
2017-04-26 22:44:08 +01:00
zeromus 669515bf6e winport: fix OSD with prescale + single CPU 2017-04-26 15:02:46 -05:00
zeromus a0d42e1536 winport: use 666 color 2017-04-26 15:00:47 -05:00
zeromus 06f0bb492b winport: fix non-saving KillStylusOffScreen 2017-04-26 14:03:38 -05:00
zeromus 751987cb90 fsnitro: fix build error from recent commit (for some compilers, anyway). fixes commit c365617ff7 2017-04-12 10:31:13 -05:00
zeromus fbad56bd14 fix bugs in lingering rom reading cursor caching code that made the winport memview capable of ruining rom reads 2017-04-11 21:14:16 -05:00
zeromus 297449caa2 winport: fix mis-sorted full/cartrom memdomains 2017-04-11 21:13:17 -05:00
zeromus c365617ff7 take a stab at fixing the ram/streaming option so that there arent split codepaths everywhere. homebrew that is eligible for DLDI patching now switches entirely to load from memory, because we lack the facilities to patch the DLDI in flight (although we now have a point to hook it into). really, all this code should be torched, but it's less of a mess now. 2017-04-11 19:40:31 -05:00
zeromus e332e3df26 fix error in initialization of clear depth register - fixes #57 (cod3r colorz top screen) 2017-04-10 21:12:25 -05:00
zeromus abe2e61997 fix possibility for display capture to VRAM block not-mapped-to-LCDC doing something which I guess can clobber important memory. Mario kart does this after course demo during black screen transition if buttons are pressed (maybe programming error or emulation timing bug). The functionality that used to block this was lost during HD revisions. Fixes #54 2017-04-09 17:30:00 -05:00
zeromus e7d7c08455 Merge pull request #55 from BigBigos/rtc-override
Add rtc-day/hour options to override NDS clock
2017-04-09 12:51:44 -05:00
Gustaw Smolarczyk bc34bb457d Add rtc-day/hour options to override NDS clock
--rtc-day and --rtc-hour may be used to override the emulated time.
rtc-day is a day of week (0-6) rtc-hour is the hour (0-23). Time
difference is calculated at emulator start and the emulated RTC then
reports time from the future. This difference is then maintained so that
an hour after the emulator is started means an hour passes according
to the RTC.
2017-04-09 18:18:19 +02:00
zeromus d141d13705 add cheat code DFFFFFFF 77777777/99999999 for enabling emulator hacks and allowing access to the ARM9. I didn't test this, I may have broken some cheats 2017-04-08 00:57:19 -05:00
zeromus 5172e1c1f3 Merge pull request #51 from intact/fix-jit-size
fix jit-size command line option processing
2017-04-08 01:35:28 -04:00
zeromus 58b0adab4b fix a bunch of broken non-standard sized register IOs in the SPU. fixes #53 2017-04-08 00:33:19 -05:00
zeromus 8c1627b8c0 action replay: fix D8 codes (were writing 16 bits instead of 8) 2017-04-06 00:15:33 -05:00
intact bb1f34c287 fix jit-size command line option processing 2017-04-03 22:05:48 +02:00
zeromus d82110e99b Update desmume.props
fix linking on vs2017
2017-03-14 19:35:25 -05:00
zeromus 3b6a5168c2 Merge pull request #49 from pal1000/work
Autoretarget Visual Studio 2017. Compilation still fails though
2017-03-14 18:24:11 -05:00
prodea2 27ffdf2ee9 Autoretarget Visual Studio 2017. Compilation still fails though 2017-03-14 22:33:07 +02:00
zeromus 199c9fb90d winport: support vs2017 in msbuild file (fixes #48) 2017-03-13 18:39:43 -04:00
zeromus 363424baaa fix mirroring of bank I across BBG (fixes #46, corrupted pause screen in ultimate mortal kombat) 2017-03-05 17:55:43 -06:00
zeromus e74ef8d0c5 winport: remove accidental relic StylusJitter inifile read 2017-03-05 02:49:40 -06:00
rogerman e38246da31 Cocoa Port: Update the UI for the removal of GFX3D_Zelda_Shadow_Depth_Hack, the changes in StylusJitter, and the addition of gamehacks. 2017-03-05 00:22:28 -08:00
zeromus 5563d61f66 fix #25 (monster trucks) by adding some hacky logic to permit redrawing the scene (for an altered clear image) even when no geometry's been flushed recently 2017-03-04 04:11:00 -06:00
zeromus 66b5da1cdc clear contents of geometry engine ram when it's powered down. fixes #31 (imagine teacher black garbage on screen) 2017-03-04 03:34:20 -06:00
zeromus 51163c33a1 tidy win32 3d options box 2017-03-04 01:54:35 -06:00
zeromus 3c48d83376 remove obsolete zelda depth comparison threshold hack 2017-03-04 01:45:32 -06:00
zeromus 23c8955551 fix last commit not working at all, and also, move stylus jitter (for CSI: dark motives) into a game hack 2017-03-04 01:42:08 -06:00
zeromus c1e5a56233 add system for applying individual game hacks by gamecode 2017-03-04 01:31:14 -06:00
zeromus 7c9abef399 rename game hacks 2017-03-04 01:12:28 -06:00
zeromus 859d47e7ff make CPU freezing flags more flexible, then don't use that. shrink overclocking interval. 2017-03-04 01:09:02 -06:00
zeromus adf682eb23 gpu: remove LCDC check in capture reset 2017-03-04 01:07:09 -06:00
zeromus 9909f34a35 fix hacks not getting enabled properly 2017-03-04 00:37:15 -06:00
zeromus b5a4cf3bac swrast: tiny speedup to backface tests 2017-03-03 21:53:48 -06:00
rogerman 1e96e738d2 Cocoa Port: Correct the touch display location transformation for Retina displays. (Regression from commit ce494a2. Fixes #42.) 2017-03-01 23:09:52 -08:00
rogerman 5e06fbc547 GPU: Change how DISPCAPCNT's CaptureEnable flag is handled, fixing a graphical issue when starting a battle in Pokemon Black/White. (Regression from r5259.)
- To note: This fix to Pokemon Black/White does not require
CommonSettings.pokehax to be enabled.
- The CaptureEnable flag is now only read at the start of line 0,
instead of being read directly from the DISPCAPCNT register per line.
In addition, this same state is held all the way through line 192.
- The CaptureEnable flag is now reset at the start of line 192, instead
of near the end of line 191 H-blank. (This is the proper behavior
according to GBATEK.)
- The CaptureEnable flag is now only reset when the VRAM configuration
is LCDC, instead of always being reset. This makes it possible for this
flag to remain set on line 192 if the VRAM configuration is changed to
a non-LCDC configuration.
- CommonSettings.pokehax is now initialized to false.
- Fix a small bug when setting CommonSettings.pokehax via the command
line.
2017-03-01 18:02:20 -08:00
zeromus 8e18531784 add win32 ui for game-specific workarounds toggling 2017-03-01 00:34:31 -06:00
zeromus cfae9c7674 add logic and CLI for game-specific workarounds 2017-03-01 00:34:09 -06:00
zeromus 99f68c8a51 fix errors in rigorous-timing and advanced-timing and spu-advanced commandline options 2017-03-01 00:31:38 -06:00
rogerman be8530bc3d GPU: Fix graphical issue in Billiards Action when running at custom framebuffer sizes.
- Fixes custom VRAM reads for OBJ bitmap reads when the read location
doesn’t start at line 0. This behavior is now consistent with how BG
extended layers do it.
2017-02-28 22:04:36 -08:00
rogerman 65c5cdd712 GFX3D: Also treat wireframe polygons using A3I5/A5I3 textures as opaque if the polygon is a Decal or Shadow polygon.
- Also do a few readability improvements in the OpenGL renderer.
2017-02-28 14:48:42 -08:00
zeromus 4fb55bddb9 fix: trying to use a dldi-function without --load-type=1 would end up in desmume crashing 2017-02-28 16:31:51 -06:00
zeromus 8c8ba5e355 does github want me to add this? 2017-02-28 15:11:58 -06:00
zeromus 1f5ece6eeb Update README.md 2017-02-28 15:10:57 -06:00
zeromus 2cb8ce2c4f Create README.md 2017-02-28 15:10:29 -06:00
rogerman 68958a7a08 GFX3D: Opaque polygons using A3I5/A5I3 textures are no longer considered transparent if the polygon is a Decal or Shadow polygon.
- Fixes the edge marking of blocks in Picross 3D when running
SoftRasterizer.
2017-02-27 15:20:58 -08:00
rogerman 3b74861fc2 OpenGL Renderer: Edge marking now blends properly to zero-alpha pixels. 2017-02-27 13:13:37 -08:00
rogerman 0f70654dab SoftRasterizer: Fix bug where edge marking can accidentally cause pixels to become fully transparent.
- Fixes the edge marking rendering issue for the girls in the title
screen of Love Plus.
2017-02-24 12:48:21 -08:00
rogerman a2273b5eac OpenGL Renderer: Prevent applying edge marking on wireframe polygons. 2017-02-23 19:38:41 -08:00
rogerman c71da856f5 Render3D: Another rework on viewport transformations in SoftRasterizer and OpenGL. Completes fixes on #27.
- Also fixes major rendering regressions with SoftRasterizer in Metroid
Prime Hunters and Princess Debut. (Regressions from e02d134.)
2017-02-23 15:40:23 -08:00
zeromus 5335312704 fix little bug in prior (re #27) 2017-02-23 01:55:17 -06:00
zeromus e277fb2aed fix prior commit for HD 3d (re #27) 2017-02-23 01:08:08 -06:00
zeromus e02d134482 fix handling of invalid viewports. solves homie rollerz character select. only implemented in softrasterizer. re #27 2017-02-23 00:55:33 -06:00
rogerman 8dd7c9b924 GPU: No more need for clients to specify whether to apply the master brightness on a per-scanline basis or on a per-framebuffer basis; GPUSubsystem can now automatically switch between applying per-scanline or applying per-framebuffer. 2017-02-22 17:07:11 -08:00
zeromus 7031bd9c0c matrix stacks: fix new asserts in nanostray2 weapon shooting and dual strike combat anims (re #39) 2017-02-22 17:42:37 -06:00
rogerman 093ce4b05d Cocoa Port: The Metal blitter now performs its own display postprocessing instead of letting the GPUSubsystem do it.
- Display views now take the Deposterize filter into account when
determining the direct-to-CPU-filtering state.
- GPUSubsystem now combines the RGB666-to-RGB888 conversions and master
brightness steps into a single postprocessing step.
- Do some minor code cleanup.
2017-02-22 14:14:22 -08:00
zeromus b553ff917b fix matrix stacks better (re: #39). fixes broken mario 64 head 2017-02-22 00:26:03 -06:00
zeromus 1cc22ae2aa fix matrix stack error conditions and handling (fixes #39) (savestates are broken) 2017-02-20 23:26:51 -06:00
rogerman fb2cfc4e9c GPU: Better handle the NDSDisplayInfo flags for applying the master brightness. 2017-02-16 00:31:02 -08:00
rogerman 60ae4c8de3 matrix.h: Fix compiling on certain 32-bit systems. (Regression from commit fc3570a. Fixes issue #40.) 2017-02-14 14:52:42 -08:00
zeromus 6cd42cbfe4 stop printing garbage to osd due to bad stdarg forwarding (bug from osd refactoring) 2017-02-11 08:14:27 -06:00
rogerman 72fa455ca0 Cocoa Port: Display views now run using Apple Metal, if available.
- An Apple Metal display view requires macOS 10.11 El Capitan or later,
in addition to a Metal-compatible GPU.
- Apple Metal display views have significantly lower CPU usage then
OpenGL display views.
2017-02-10 12:33:34 -08:00
rogerman 3799af3a01 Cocoa Port: ClientDisplayView::FinishFrameAtIndex() is no longer abstract. 2017-02-10 12:28:11 -08:00
rogerman ff2e6cb220 Cocoa Port: Increment/decrement the number of display views in need of CPU filtering, instead of looping through all outputs to determine it. Prevents a possible deadlock when changing CPU-based pixel scalers.
- Also do some additional code cleanup.
2017-02-10 11:28:35 -08:00
rogerman 241f50ee7a Cocoa Port: Don't load framebuffers from the fetch object if the Deposterize filter is enabled. 2017-02-09 09:26:30 -08:00
rogerman 00b5ff70d0 Cocoa Port: Move the CPU pixel scaler object from OGLVideoOutput to ClientDisplayView. 2017-02-08 13:35:42 -08:00
rogerman fc9b4831a0 Cocoa Port: Do some code cleanup. 2017-02-07 18:50:13 -08:00
rogerman a09763f8c3 Video Filters: Reorganize the VideoFilter class and simplify RenderDeposterize(). 2017-02-07 15:19:32 -08:00
zeromus d9a0c0ef00 newer win32 scond stuff for bug smoking out 2017-02-04 16:33:55 -06:00
rogerman 6564827199 Cocoa Port: Move InitHQnxLUTs() out of OGLDisplayOutput.cpp into ClientDisplayView.cpp so that the code can be shared with other ClientDisplayView subclasses.
- Also make the HQnx LUT textures 32-bit instead of 24-bit.
2017-02-03 18:30:20 -08:00
rogerman 64d58b9b09 Cocoa Port: Oops! Forgot to take out a reference to the not-yet-released Apple Metal renderer.
- Fixes building of the Xcode project. (Regression from commit aff2d07.)
2017-02-01 16:09:12 -08:00
rogerman aff2d07146 Cocoa Port: Huge refactor to ClientDisplayView, now supporting the use of shared fetch objects and shared client objects in order to lower memory usage and CPU/GPU usage when many display views are running at the same time.
- OpenGL display views now use a shared fetch object to fetch the emulated GPU framebuffers and store them in shared textures within a shared context. In conjunction with the new double-buffering support from the last commit, this eliminates the copying between the framebuffers and each display view.
- OpenGL display views now use shared HQnx LUT textures, rather than having to initialize and maintain a copy of the LUT textures for each display view.
- OpenGL display views no longer perform any rendering while their associated NSView is hidden, improving the performance of creating new display views.
- OpenGL display views can now DMA directly from pinned-memory both custom-sized framebuffers and CPU-pixel-scaled native-sized framebuffers at the same time.
2017-02-01 15:56:54 -08:00
rogerman 08b8a1a62c GPU: The output framebuffers are now double-buffered and page-aligned.
- Framebuffers are now page-aligned on 4KB boundaries. This is to
improve performance when using the framebuffers directly as pinned AGP
memory.
- Framebuffers are now double-buffered. The target buffer index is now
tracked using the bufferIndex field of NDSDisplayInfo.
- Clients may no longer supply their own buffers to
SetCustomFramebufferSize(). Clients must use the pointers supplied by
NDSDisplayInfo.
- The frameskip flag is now set only on line 0 and remains consistent
for all 192 lines of rendering.
- GPUSubsystem no longer needs a special allocater/deallocator for
itself, so it has been reverted back to a standard C++ new/delete.
- Add a GPUClientFetchObject helper class as an aid to clients that
need to read out the framebuffers. (Should probably move to its own
file at some later date.)
2017-02-01 09:34:21 -08:00
rogerman fc3570a18a Revert "Fix buffer overrun issues with custom memset functions."
This reverts commit 53c4a27aef.

I forgot that these functions are based on element count, not based on
byte count. Rename “length” to “elementCount” for better clarification.
2017-01-26 01:23:42 -08:00
rogerman 62f230ef44 common.cpp: Add the convenience function malloc_alignedPage(), which returns a 4KB page-aligned (for most systems) block of memory. 2017-01-25 20:03:22 -08:00
rogerman 53c4a27aef Fix buffer overrun issues with custom memset functions. 2017-01-25 20:01:28 -08:00
rogerman b9a9b8e7b2 Cocoa Port: Another round of refactoring for ClientDisplayView.
- Fetching and loading of GPU frame data is now performed as two
separate operations.
- Display windows no longer draw concurrently on backgrounds threads;
instead they are updated synchronously.
- Associate the CALayer after the .xib completely loads the NSView for
better compatibility.
- MacOGLDisplayView now creates an NSOpenGLContext instead of a
CGLContextObj, bringing back compatibility with macOS 10.5 Leopard.
- Fix building with the Xcode 3 project.
2017-01-24 19:08:44 -08:00
rogerman 3b0920d7f0 Video Filters: Rework the Scanline and Nearest2X filters to modern standards, and also add an SSE2 version of the Scanline filter. 2017-01-23 12:31:52 -08:00
zeromus 48bef75fd9 sync with retroarch again -- new work to make scond_signal slightly more pthreads compliant (and other tidies) 2017-01-21 22:43:34 -06:00
zeromus e79b37dcb4 synchronize rthreads with libretro-common scond/slock cleanup and optimization for smoke testing 2017-01-21 17:12:50 -06:00
rogerman c7af5cbe11 Cocoa Port: Refactor ClientDisplayView to improve subclasses' ease-of-use for the HUD-related methods. 2017-01-20 16:44:44 -08:00
rogerman aa8069ce1a Cocoa Port: More refactoring work on ClientDisplayView.
- Most notably, HandleGPUFrameEndEvent() now sends the entirety of the
NDSDisplayInfo struct to the client.
- The OpenGL blitter now skips the loading, processing and rendering of
disabled screens.
- Begin preparing DisplayView to handle the upcoming Apple Metal
blitter.
- Do some misc. code cleanup and simplification.
2017-01-18 16:05:41 -08:00
zeromus e487193545 remove outdated information from linux readme (address #35) 2017-01-17 18:45:14 -06:00
rogerman 8aa066dffc GPU: Add some more properties to NDSDisplayInfo pertaining to auto-applying the master brightness. 2017-01-17 11:30:14 -08:00
rogerman 25c0232673 Cocoa Port: Fix some bugs with HUD font loading and HUD rendering on Retina displays. 2017-01-15 21:45:26 -08:00
rogerman 6756f41bdb Cocoa Port: Significantly increase the performance of the 4xBRZ, 5xBRZ and 6xBRZ shaders.
- Also disable the 4xBRZ shader for low-tier GPUs. (Testing has shown
that low-tier GPUs have no chance at running this shader in real-time
anyways.)
- Also do some misc. tweaks to other various shaders.
2017-01-15 20:36:13 -08:00
zeromus d33f2f095c change an `int` to `s32` which was being serialized as an s32 2017-01-13 18:41:31 -06:00
rogerman 019a959702 GPU: Silence compiler warnings about implicit 64-to-32 bit conversions. 2017-01-13 16:29:39 -08:00
Markus Kitsinger (SwooshyCueb) 125df2970e copy paths to variables rather than uninitialized data 2017-01-12 22:29:24 -06:00
rogerman 558cbf71d2 Cocoa Port: Also bring back setWantsBestResolutionOpenGLSurface: in order to support Retina displays on Macs running macOS 10.7 Lion. 2017-01-12 10:57:59 -08:00
rogerman 3af5423387 Cocoa Port: Bring back NSOpenGLContext for Macs running macOS 10.7 Lion or earlier.
Also do some misc. backwards compatibility fixes.
2017-01-11 17:56:21 -08:00
rogerman 07a68dbb7a Cocoa Port: Clean out utilities.c a little bit more. 2017-01-10 23:57:47 -08:00
rogerman 669487ff05 Cocoa Port: Eliminate the old colorspace conversion functions from utilities.c in favor of the new colorspace handler functions. 2017-01-10 23:45:06 -08:00
rogerman 858d14b5fe Cocoa Port: Transition display views from using an NSOpenGLContext to using a CAOpenGLLayer. 2017-01-10 21:45:09 -08:00
rogerman ee306a9f07 Cocoa Port: Disable the default clipping feature in display views as a micro optimization. 2017-01-10 10:42:08 -08:00
zeromus 522a4e25d1 merge latest rthreads.c from libretro-common, and improve sthread_isself to null check argument (fixes crash in winport's single-core codepaths when lua window is open) 2017-01-09 16:51:02 -06:00
rogerman 9c573370f3 Cocoa Port: Oops! Revert a little test code that snuck in from the last commit. 2017-01-09 14:00:20 -08:00
rogerman 34656d977c Cocoa Port: Simplify OpenGL context handling. 2017-01-09 13:57:59 -08:00
rogerman 91f2bb9ee5 Cocoa Port: Even more display view refactoring work.
- Move Mac-specific OpenGL code to its own file.
- Eliminate the CocoaDSDisplayDelegate and CocoaDSDisplayVideoDelegate
protocols. Instead, call ClientDisplay3DView class methods directly.
2017-01-09 11:20:25 -08:00
zeromus a5b4df2038 bring softrasterizer shadow rendering up to modern standards. 2017-01-08 15:25:47 -06:00
rogerman f1558bf4e6 Cocoa Port: More display view refactoring work. 2017-01-08 00:21:19 -08:00
rogerman c7c472673f Cocoa Port: Fix a few more issues caused by commit cffc343.
- Fix bug where restored windows would fail to update properly if the
window size would be the same as the one set in user defaults.
(Regression from commit cffc343.)
- Fix bug where changing the rotation to be exactly 180 degrees
different from the old rotation would cause the view to render the
screens with a vertical offset. (Regression from commit cffc343.)
- OGLDisplayLayer respects its own _needUpdateRotationScale and
_needUpdateVertices flags once again, preventing it from repeatedly
uploading already established data to the GPU. (Regression from commit
cffc343.)
2017-01-07 15:54:23 -08:00
rogerman 6eca2163f7 Cocoa Port: Fix bug where switching the display mode to Main or Touch would fail to work correctly.
Also do some misc. code cleanup.

(The bug is a regression from commit cffc343.)
2017-01-06 17:22:02 -08:00
rogerman 34df91f412 Merge remote-tracking branch 'origin/master' 2017-01-06 15:23:43 -08:00
rogerman cffc343496 Cocoa Port: Continue refactoring of the display view code to reduce port-specific dependence. 2017-01-06 15:23:26 -08:00
zeromus ce044f3700 remove rewind code completely (it wasnt hooked up to the UI and it was worthless anyway) 2017-01-06 16:53:46 -06:00
rogerman 616962f0b7 Cocoa Port: Standardize display rotations to always assume a left-handed Cartesian coordinate system (clockwise rotation). 2017-01-03 03:31:35 -08:00
rogerman a6cb37901f Cocoa Port: Eliminate dsPointFromEvent:inputID: method. 2017-01-03 00:25:24 -08:00
rogerman eed334f999 Cocoa Port: Change "Display Orientation" to "Display Layout".
Also change the name of “Hybrid (3:2)” to “Hybrid (2:1)”. The display
ratio was incorrectly identified as 3:2, when in fact it is 2:1.
2017-01-02 23:01:31 -08:00
rogerman ce494a2eaa Cocoa Port: Begin refactoring display view code to reduce the dependence on port-specific code. 2017-01-02 22:39:25 -08:00
rogerman 207a3b2e9e Cocoa Port: New feature -- add Hybrid display orientations.
- The new Hybrid display orientations show three NDS screens — the top
and bottom screens on the left side, and a larger major screen on the
right side. This feature is intended to better use the widescreen
resolution of most users’ host displays, which are usually 16:9 or
16:10. Three different Hybrid orientations are provided (3:2, 16:9, and
16:10) so that users can choose the display size ratio that they prefer.
- Horizontal display orientation no longer uses the display separation
setting.
- Do some additional code cleanup.
2016-12-31 18:10:48 -08:00
rogerman cf8f021b30 OpenGL Renderer: Don't force backface culling when drawing shadow polygons.
Do note that we need to do this for SoftRasterizer as well, but
SoftRasterizer will need some additional rework on shadow polygon
handling to get all the test cases to work.

Fixes issue #21.
2016-12-30 11:04:35 -08:00
rogerman c9d5d69c06 GPU: Fix graphical inconsistencies with BG extended layers using custom VRAM.
(Regression from commit 36e03fe.)
2016-12-29 17:36:31 -08:00
rogerman 000efb1095 GPU: Fix bug where native-sized lines would be improperly blended with non-native-sized lines during display capture.
Fixes a graphical issue in Golden Sun: Dark Dawn whenever a battle
sequence begins when using a custom framebuffer size.
2016-12-29 14:12:23 -08:00
rogerman 36e03fefa5 GPU: Disable the use of custom VRAM for extended BG layers whenever they are scaled or rotated.
Fixes the zoom-in effect whenever entering buildings in Pokemon
Black/White. (Regression from r5371.)
2016-12-29 10:26:24 -08:00
zeromus ae37e1259e winport: fix crash with HD prescale and --num-cores 1. OSD is messed up in this case. Not going to fix that now since --num-cores 1 is a very old quirks hack anyway. Fixes #20 2016-12-28 17:25:12 -06:00
rogerman 1213deb102 OpenGL Renderer: Fix various bugs when running OpenGL 2.1 and earlier.
Fixes regressions from commits 8fab805 and 7b13501.
2016-12-28 14:07:06 -08:00
zeromus 4710cf7e37 fix errors in ogl old 3d driver (recent changes from ogl 3.2 not fully ported) 2016-12-27 21:09:08 -06:00
rogerman 8159da3f0c GFX3D: Save the opaque polygon count in POLYLIST. 2016-12-26 14:19:45 -08:00
rogerman f50f9d38fd OpenGL Renderer: Reduce OGLRENDER_MAX_MULTISAMPLES from 16 to 8.
Now that framebuffer sizes can be greater than 256x192, using MSAAx16
is excessive and consumes too much bandwidth. We’re reducing the
maximum sample size of MSAA to 8 since it will significantly reduce
bandwidth consumption at the larger framebuffer sizes while remaining
mostly visually equivalent to MSAAx16.
2016-12-26 12:37:22 -08:00
rogerman 4e96cc8b6e Cocoa Port: Simplify some code in the OpenGL blitter. 2016-12-24 11:08:17 -08:00
rogerman fa971e3d63 GPU: Make updating the 3D renderer FPS into its own method. 2016-12-23 09:56:55 -08:00
rogerman 922a7ac6f6 GPU: Consolidate applying the master brightness into one place. 2016-12-22 22:16:56 -08:00
rogerman dfd23f6ba3 GPU: Fix bug where the master brightness would be incorrectly applied in some instances when a custom framebuffer size is used.
(Regression from commit 65d7568.)
2016-12-22 21:12:15 -08:00
rogerman 7b1350127d OpenGL Renderer: Fix instances where the transparent fragments of A3I5 and A5I3 textures would fail to render correctly.
Fixes issue #19.
2016-12-22 00:58:13 -08:00
rogerman 528513118a OpenGL Renderer: Greatly improve the accuracy of rendering shadow polygons. 2016-12-21 15:28:21 -08:00
rogerman 8fab80596b OpenGL Renderer: Minor rework on handling shadow polygons.
- Determining the depth write state is now handled purely within the
fragment shader.
- Color and depth write states are now handled more consistently across
fixed-function and fragment shader.
- Force backface culling when drawing shadow polygons.
2016-12-19 09:48:52 -08:00
rogerman 49309fb053 OpenGL Renderer: Allow all opaque non-shadow polygons to write to the depth buffer, making polygon opacity a priority state.
Fixes issue #13. (Regression from r5372.)
2016-12-16 13:00:32 -08:00
zeromus efcdd320f8 winport: attempt to make vsync work on opengl display method (see #14) 2016-12-16 01:00:47 -06:00
rogerman e6b352c73a GPU: When rendering the 3D layer, prioritize color blending over the window color effect flag.
Fixes color blending in the dialogue boxes of Front Mission.
(Regression from r5285.)
2016-12-14 17:04:07 -08:00
rogerman a80fa6d4de MMU: Only report writing to undefined registers when the value being written is non-zero. 2016-12-13 14:31:45 -08:00
rogerman ce4f61eaf6 texcache.cpp: Silence some compiler warnings. 2016-12-13 11:36:06 -08:00
rogerman 0628cb5756 Silence some debug messages related to the MASTER_BRIGHT register.
- Now that Mega Man Zero Collection has proven that it is perfectly
legal to set MASTER_BRIGHT within V-blank, remove the related debug
message.
- Properly silence the texture memory debug message when the
MASTER_BRIGHT intensity is 0.
2016-12-13 11:22:06 -08:00
zeromus f230067524 dont make tex deposterize and text smoothing default enabled on winport (bugged from e0f8e5a). fixes #10 2016-12-13 01:39:28 -06:00
rogerman de4f1c9c69 Colorspace Handler: Fix pixel alignment bug in ColorspaceConvert555To8888_AVX2() and ColorspaceConvert555To6665_AVX2().
Fixes issue #8.
2016-12-12 21:30:14 -08:00
zeromus 1cc8cb6fc6 fix lua print() on some systems, due to mistaken use of printf %Lg instead of just plain %g
(fix ported from fceux)
2016-12-12 16:26:21 -06:00
zeromus 5cfb407f35 winport: tidy some things required to make AVX2 support compile, apparently (see github #8) 2016-12-11 19:05:30 -06:00
rogerman 1787081fca GPU: Fix BG layer 3 when reading VRAM with a BMPAddress that maps exactly to the head of the VRAM blank region.
Fixes a possible graphical glitch during the Arangoa Prelude in Golden
Sun: Dark Dawn.
2016-12-10 21:26:30 -08:00
rogerman cf3758ff3f Command Line: Allow --disable-sound and --disable-limiter options on Windows.
These two options are, in fact, supported on Windows, so make them
universally available.
2016-12-10 13:39:29 -08:00
rogerman 1b3825a100 Command Line: Allow texture post-processing options on non-Windows platforms.
The —3d-texture-deposterize-enable, —3d-texture-upscale and —3d-texture-smoothing-enable options work independently of the frontend, and so it should be safe to make these options universally available.
2016-12-10 12:17:11 -08:00
rogerman 60e71ce823 Command Line: Add command line options for accessing the custom framebuffer sizing and texture postprocessing features.
--3d-texture-deposterize-enable
--3d-texture-upscale N [1|2|4]
--3d-texture-smoothing-enable
--gpu-resolution-multiplier N [1|2|3|4|5]
2016-12-09 16:52:56 -08:00
zeromus be11b35df9 winport: fix occasional garbage subscreen rect in one LCD mode (fix #6) 2016-12-09 05:56:06 -06:00
rogerman 36b192af00 SoftRasterizer: Fix bug where texture sampling coordinates were incorrectly calculated when texture upscaling is used with GFX3D_TXTHack enabled.
Fixes issue #5. (Related to commit a8c8a86.)
2016-12-08 01:18:41 -08:00
rogerman 7a573e75b5 NDSSystem: Fix bug where the X, Y, and Debug inputs were being read incorrectly, causing unintended behavior in many games.
Fixes issue #3 and issue #4. (Regression from commit bcc7421.)
2016-12-07 10:28:36 -08:00
zeromus 6b78dc1f12 since we have evidence (from cheaters) that 32bits should be supported: fix 8 and 32bit reads of timer registers. i probably messed something up since we have no proper systematic solution for doing this kind of stuff. 2016-12-06 01:45:01 -06:00
zeromus bcc7421be4 make EXTKEYIN register emulation more sensible, and possibly fix "0x04000134 activator" AR codes (due to the register formerly being readable only from 0x04000136 as a halfword) 2016-12-05 21:27:33 -06:00
zeromus bdf580036c fix fsnitro.cpp the way it was supposed to be fixed, without platform dependencies 2016-12-05 18:51:32 -06:00
rogerman 3b92f41b45 Windows Port: Fix compiling on Windows.
(Regression from commit 1d8bdd5.)
2016-12-05 16:02:27 -08:00
rogerman d2f054b5fb OpenGL Renderer: Fix bug where certain polygons would occasionally render their textures blank.
(Regression from commit 1368b2d).
2016-12-05 15:13:17 -08:00
zeromus 1d8bdd5b54 Merge pull request #1 from lefta/fix-linux-build
Fix linux build
2016-12-05 14:14:52 -06:00
zeromus 3498665e7b Merge pull request #2 from pal1000/work
gitignore: Visual Studio 2015 database
2016-12-05 14:14:16 -06:00
rogerman 9564097182 SoftRasterizer: Further cleanup following 7711f82. 2016-12-05 11:49:00 -08:00
rogerman 7711f8288b SoftRasterizer: Fix bug where the texture wrap mode would be applied inconsistently under multithreaded rendering.
(Regression from 032622e.)
2016-12-05 11:45:40 -08:00
pal1000 af1a77e294 gitignore: Visual Studio 2015 database
Visual Studio 2015 produces an extra .VC.db file when building any
solution
2016-12-05 19:22:33 +02:00
zeromus e767018e2a cheats: fix error in masked comparison functions 2016-12-05 05:32:59 -06:00
rogerman 65d7568259 GPU: Revert applying the master brightness as a framebuffer operation. It is now a scanline operation once again.
Fixes brightness issues in The Legend of Zelda: Spirit Tracks.
(Regression from #ac69f1e.)

The user may still choose to apply master brightness on a
per-framebuffer basis by passing ‘false’ to
GPUEngineBase::SetWillApplyMasterBrightnessPerScanline(). For better
consistency, this behavior has also been changed to only use the master
brightness settings as they were in line 0.
2016-12-04 00:59:36 -08:00
zeromus 5f1e50db69 cheats: fix Ex, DB, and Fx codes 2016-12-03 23:44:52 -06:00
Cédric Legrand 2f327c4af0 Fix glade frontend build 2016-12-03 22:58:02 +01:00
Cédric Legrand 5d10b8022a Fix linux build 2016-12-03 16:15:52 +01:00
rogerman 444b1f67db Texture Handler: TextureStore::VRAMCompareAndUpdate() now performs a single memcmp() on the packed data instead of performing each memcmp() separately. 2016-12-02 22:45:42 -08:00
rogerman c5678a6ba4 Render 3D: Whenever the texture deposterization or upscaling settings are changed, simply reload the existing textures instead of completely destroying and recreating them from scratch. 2016-12-02 22:08:21 -08:00
rogerman ac69f1e229 GPU: If a GPU engine has master brightness at full intensity , revert to filling the output framebuffer on line 0.
Fix bug where the screen may end up fully black or white if the master
brightness is modified in the middle of the frame. Fixes SourceForge
#1603. (Regression from r5538.)
2016-12-02 13:50:17 -08:00
rogerman a0f8b7a894 GPU: Fix crashing bug where target.lineLayerID can be overrun at custom framebuffer sizes.
Fixes SourceForge issue #1600. (Regression from r5512.)
2016-12-02 10:40:14 -08:00
rogerman 8821e7b162 Render3D: Make _textureList universal for all 3D renderers. 2016-11-29 17:09:25 -08:00
rogerman 1368b2d5c7 Render3D: Make the _isSamplingEnabled flag universal for all 3D renderers.
Also update the OpenGL renderer to use the new flag.
2016-11-29 16:49:52 -08:00
rogerman 032622e817 SoftRasterizer: Have texture setup within the main rendering loop be handled more like how OpenGLRenderer does it. 2016-11-29 16:31:38 -08:00
rogerman 2698993805 OpenGLRenderer: Rework texture loading to work at BeginRender(), just like how SoftRasterizer does it. 2016-11-29 13:34:08 -08:00
zeromus 3da9f273d2 cheats: add notes for C4 and C5 codes (won't be implemented until needed) and implement C6 code (only for v1.54 ARDS) 2016-11-29 14:40:14 -06:00
zeromus 6abf2b3454 completely rewrite ARDS processing. definitely fix some bugs. probably create some more. overall clarity level increased 2016-11-29 02:50:03 -06:00
zeromus 9d6e52acac winport: change labels to show texture scaling applies to all 3d renderers now 2016-11-28 22:28:24 -06:00
zeromus 1c36704633 winport: a bunch of other vcxproj path fixes. I don't know how this got so broken. there's probably still more broken 2016-11-28 22:22:41 -06:00
zeromus 5b1a034aa9 cleanup fsnitro (clean portability hazards and use libretro-common parts) 2016-11-28 21:44:32 -06:00
zeromus 1559f450fd winport: fix a bunch more paths in vcxproj 2016-11-28 21:21:58 -06:00
rogerman 6d1db6daae Render3D: Refactor common parts of OpenGLTexture and SoftRasterizerTexture into a new Render3DTexture class. 2016-11-28 15:08:24 -08:00
rogerman 031f677486 OpenGL Renderer: Refactor and use the same coding style for texture loading as SoftRasterizer. 2016-11-28 13:55:46 -08:00
rogerman b82f42dfde Cocoa Port: Update Xcode project files to reflect the current state of the file hierarchy. 2016-11-27 21:55:06 -08:00
rogerman 2f98c8b545 Merge remote-tracking branch 'origin/master' 2016-11-27 20:57:09 -08:00
rogerman b57f2dec12 Cocoa Port: Update GUI to reflect the new SoftRasterizer texture post-processing support.
Moves the Deposterize Textures and Texture Scaling Factor UI items from
OpenGL Options to General Settings in the 3D Rendering Settings panel
and DeSmuME Preferences.
2016-11-27 16:43:53 -08:00
rogerman a8c8a8665b SoftRasterizer: Texture deposterization and upscaling are now supported with this renderer. 2016-11-27 16:10:00 -08:00
zeromus 425ddecb8b cleanup: remove our own ConvertUTF8 file which was only being used by the movie code (which needs radical cleanup anyway); use libretro-common's isntead. however we're keeping our std::string wrappers which are convenient. 2016-11-27 16:19:15 -06:00
zeromus 9a613fb440 libretro-common: update UTF files from upstream 2016-11-27 16:04:43 -06:00
zeromus fb561adaad winport: fix a bunch of header paths in vcxproj 2016-11-27 15:20:59 -06:00
zeromus 574815124a cleanup: remove md5 (it was deactivated, and we should use libretro-common's if we readd it
cleanup: move valuearray into guid which was the only place using it. we should probably then move guid into movie later, since it's unlikely anything else will use it.
2016-11-27 15:13:33 -06:00
zeromus 4a922b927d winport: fix disassembler move, and other project tidy (rearrange sources to match source tree) 2016-11-27 14:54:41 -06:00
zeromus 297721b73d make disassembler a frontend module 2016-11-27 14:50:26 -06:00
zeromus 3e10928bf5 libretro-common: incorporate latest cpu_features (and merge with prior commit). rogerman please check. 2016-11-27 14:36:58 -06:00
rogerman 0a4635eb5b Texture Handler: Use the new TextureStore::Load() method instead of calling TextureStore::Unpack() directly. 2016-11-26 19:55:52 -08:00
rogerman 41e9b1680e Cocoa Port: Update Xcode project files and scripts for the GitHub transition. 2016-11-26 17:40:01 -08:00
rogerman 3612586e8b Ignore .xcscmblueprint files for now.
It doesn’t look like it’s really needed for commits, but if we find it
necessary in the future, we can always bring it back.
2016-11-26 17:39:24 -08:00
rogerman 7f77037c75 Cocoa Port: Update include paths due to commit #ed40663. 2016-11-26 17:21:13 -08:00
rogerman 2612484c54 Core: Update some include paths. 2016-11-26 17:11:39 -08:00
rogerman 183b41cb77 libretro-common: Update features_cpu.c to take macOS 10.12 Sierra into account when defining clock_gettime(). 2016-11-26 17:10:05 -08:00
rogerman 6744e162a8 Update .gitignore for Xcode 2016-11-26 17:06:45 -08:00
rogerman ed40663b1f Move Cocoa frontend files to the desmume/src/frontend/cocoa directory. 2016-11-26 16:01:57 -08:00
zeromus 2144f44c67 minimum work needed to get windows picking git's lamehash instead of svn's coolrev. thanks to dolphin for the script. other frontends shouldn't be affected. 2016-11-23 23:54:16 -06:00
zeromus e1d635c392 fix endian ifdefs to newer standard 2016-11-23 22:42:50 -06:00
zeromus e2d9626be9 fix windows build after merge grief 2016-11-23 22:42:40 -06:00
zeromus f97283e9bc Merge branch 'master' into round-1-start
# Conflicts:
#	desmume/src/frontend/windows/DeSmuME.vcxproj.filters
#	desmume/src/libretro-common/rthreads/rthreads.c
#	desmume/src/texcache.cpp
#	desmume/src/utils/vfat.cpp
2016-11-23 21:13:34 -06:00
twinaphex 1394197244 Silence more Clang warnings 2016-11-23 21:12:34 -06:00
twinaphex 559b4ad077 Prevent some Clang warnings 2016-11-23 21:12:34 -06:00
zeromus 81d1070d9a remove agg and osd stuff from emulator core to a frontend module 2016-11-23 21:11:58 -06:00
zeromus 012b8d9e19 goodbye PO files 2016-11-23 21:11:45 -06:00
zeromus 43d6e7f7e3 trying to merge some stuff 2016-11-23 21:11:38 -06:00
zeromus a8d04b5152 fixes related to building new colorspace handler 2016-11-23 21:11:15 -06:00
zeromus 9f91a14b7f fixes related to building new colorspace handler 2016-11-23 21:10:53 -06:00
zeromus 41d26c6bd7 fix some endian macro bugs in new code from last merge 2016-11-23 21:10:37 -06:00
zeromus ae64d4659b Merge commit '9c1f523a725abca2fcfbf07cd11d12077154a80c' into round-1-start
# Conflicts:
#	desmume/src/GPU.h
#	desmume/src/frontend/windows/DeSmuME.vcxproj
#	desmume/src/frontend/windows/DeSmuME.vcxproj.filters
#	desmume/src/types.h
2016-11-23 21:09:50 -06:00
zeromus 56083bcd1f move source files only used by posix frontends 2016-11-23 21:06:39 -06:00
zeromus 57f26cb716 fix little bug in cli building 2016-11-23 21:06:39 -06:00
zeromus 7a12d75529 .gitignore 2016-11-23 21:06:38 -06:00
zeromus 23ae2f8a60 move gtk,cli ports to frontend/posix directory 2016-11-23 21:06:38 -06:00
zeromus 602da31591 Revert "(MMU_timings.h) Style nits/cleanups"
This reverts commit 04c8b0915e85da85a8f08a7b2ad6814d95b6618f.
2016-11-23 21:06:38 -06:00
zeromus b554b05b00 Revert "(MMU.cpp) Cleanups/style nits"
This reverts commit 2d9d446a0fa845f895bcba61dcbd53af96521e39.
2016-11-23 21:06:38 -06:00
zeromus 9d63abca3f Revert "(MMU.cpp) Use retro_assert" (fine idea but unintentional functional changes) This reverts commit 2e8886adb041aa341f8eb214039ea887e8acdf39. 2016-11-23 21:06:38 -06:00
zeromus 8a23178d29 Revert "remove ConvertUTF (use libretro-common parts instead)" Yikes! I didn't realize this was going to be such a mess. Need stronger wchar_t-based fu in libretro-common This reverts commit 55e71006b04c824f7cd5f1f2f70a3ff9c9912c03. 2016-11-23 21:06:38 -06:00
twinaphex 7fac2b6e11 Move en/delsb functions to src/utils/guid.cpp 2016-11-23 21:06:38 -06:00
twinaphex 5d52b7a0af Don't need float to u32 and vice versa functions 2016-11-23 21:06:38 -06:00
twinaphex 2759834178 Move FlipByteOrder to saves.cpp 2016-11-23 21:06:38 -06:00
twinaphex 10b6b1e33a (MMU.cpp) Use retro_assert 2016-11-23 21:06:38 -06:00
twinaphex 6c4aa4571d (MMU.cpp) Cleanups/style nits 2016-11-23 21:06:38 -06:00
twinaphex 09879832b3 (MMU_timings.h) Style nits/cleanups 2016-11-23 21:06:38 -06:00
zeromus a5ab52c3fb remove some unused garbage from xstring, so we at least have an idea what garbage is actually in use 2016-11-23 21:06:37 -06:00
zeromus b40ae5699c remove ConvertUTF (use libretro-common parts instead). The results haven't been tested real well, but it's only used in movies.. could be cleaner with a few little changes to libretro-common parts but i'm too tired now 2016-11-23 21:06:37 -06:00
zeromus c61e44da34 libretro-common : fix extern C guards in encodings/utf.h 2016-11-23 21:06:37 -06:00
zeromus 1705b3eb21 remove a bunch of common.h includes, since that file's almost dead 2016-11-23 21:06:37 -06:00
zeromus 84e5c98ef0 move windows port into frontend directory 2016-11-23 21:06:37 -06:00
zeromus 63feee1190 remove some dependencies from xstring.h 2016-11-23 21:06:36 -06:00
zeromus 45d07d41de move bits.h to utils/bits.h. quite a lot of noise, but i tidied up some header dependencies while i was at it 2016-11-23 21:06:36 -06:00
twinaphex 632a322be9 Add arm_arm dynarec 2016-11-23 21:06:36 -06:00
twinaphex 75c9c6f5d2 Silence warning with Clang 2016-11-23 21:06:36 -06:00
twinaphex f54d68405f Use libretro-common's fxp.h header 2016-11-23 21:06:36 -06:00
zeromus d1dfb067bf .gitignore 2016-11-23 21:06:36 -06:00
zeromus ff2536aa0f create Database.cpp to contain game database-like things. Kind of a weak refactor, and doesnt have savedata records yet, but it helps me whittle common.cpp down to nothing. 2016-11-23 21:06:36 -06:00
zeromus b646efdd55 common.h/common.cpp garbage cleanup 2016-11-23 21:06:36 -06:00
zeromus ff3eb24e2a remove clunky, buggy, and memory-leaking bitwise instruction decoding only used during error messages pretty much for displaying the opcode part of the instruction. would be better implemented as an online utility anyway 2016-11-23 21:06:36 -06:00
zeromus 1303defe47 delete garbage 2016-11-23 21:06:36 -06:00
zeromus 21ddbb95eb fix windows building 2016-11-23 21:06:36 -06:00
zeromus 96143c293b .gitignore 2016-11-23 21:06:36 -06:00
twinaphex 9893afc59a Get rid of macro 2016-11-23 21:06:36 -06:00
twinaphex be01a89164 Get rid of emufile_types.h 2016-11-23 21:06:35 -06:00
twinaphex cf185123eb Reduce ifdef to what's necessary 2016-11-23 21:06:35 -06:00
twinaphex aab3a7d0a6 enums - last enum value should not have a comma 2016-11-23 21:06:35 -06:00
twinaphex a607264086 Start replacing getOnlinecores with libretro-common equivalent 2016-11-23 21:06:35 -06:00
twinaphex 2d0852aaf9 Update vfat.cpp so that it works again with new libretro-common code 2016-11-23 21:06:35 -06:00
twinaphex 3b0fc202b2 Update libretro-common 2016-11-23 21:06:35 -06:00
twinaphex f8d129b164 Use only MSB_FIRST for determining endianness 2016-11-23 21:06:35 -06:00
twinaphex 629681b094 Get rid of INLINE macro - handled by retro_inline.h 2016-11-23 21:06:35 -06:00
twinaphex 2a71c9c6fb Use retro_miscellaneous.h 2016-11-23 21:06:35 -06:00
zeromus 833ac7b658 remove locale crap, which probably breaks the glade port, but i dont care right now 2016-11-23 21:06:35 -06:00
zeromus 0e8265e911 root directory cleanup, move docs to doc dir 2016-11-23 21:06:35 -06:00
zeromus 6489452867 kill QT port 2016-11-23 21:06:34 -06:00
zeromus ac500c8249 gitignore 2016-11-23 21:06:34 -06:00
rogerman 02645310b4 Texture Handler:
- Finish refactoring and cleaning up TexCache (now renamed to “TextureCache”) and TexCacheItem (now renamed to “TextureStore”).
- TextureCache items are now evicted based on age and usage instead of arbitrarily.
2016-11-23 20:41:07 +00:00
zeromus c75b9ed62b oops, remove unneeded printf 2016-11-11 02:34:02 +00:00
zeromus 2801ee5d19 fix vfat (broken in r5438). file sizes weren't counted right. only ~36MB would get allocated and then it would get blown when loading the files. 2016-11-11 02:33:33 +00:00
zeromus 6e0077ecb9 fix retriggering sounds in AC:WW 2016-11-10 07:02:54 +00:00
rogerman 812cabb752 Texture Handler:
- The 3D renderers are now responsible for managing the texture unpack buffers instead of relying on the TexCacheItem itself to do it.
- The OpenGL 3D renderer now uses a fixed 4MB buffer for unpacking textures, instead of maintaining extra copies of each unpacked texture in main memory even after they’ve been uploaded to the GPU.
2016-11-03 00:39:02 +00:00
rogerman 158f0c561b Texture Handler:
- Increase TEXCACHE_MAX_SIZE to 32MB. Fixes severe performance problems with continuously evicting/reloading the texture cache in Umihara Kawase Shun.
2016-11-02 18:49:36 +00:00
rogerman b0e649c9bb Texture Handler:
- Fix a bug where 4x4 formatted textures were being read incorrectly. (Regression from r5569.)
2016-11-02 09:37:59 +00:00
rogerman df60214b26 Texture Handler:
- Rework TexCacheItem::GetTexture() so that instantiating a new object, dumping the packed data, and dumping the palette are performed as separate operations.
- Invalid OpenGL textures are now updated instead of being completely replaced.
- NDSTextureUnpack4x4() now uses the srcIndex pointer parameter instead of recalculating the palette address.
- Delete the now obsolete MemSpan-based texture unpacking functions.
2016-11-02 07:25:11 +00:00
rogerman 2c82d4b7b4 Texture Handler:
- Texture items in cache are now searched using std::map instead of std::multimap.
- Texture item search keys now ignore the render-specific bits of the texture attributes (repeat mode, flip mode, and coordinate transformation mode bits are ignored). This is to help reduce the number of duplicate textures in the cache.
- Searching a texture and unpacking a texture are now performed as separate operations.
- Texture unpacking functions now use restrict pointers instead of normal pointers.
2016-11-01 21:07:17 +00:00
rogerman 95db2317b9 Texture Handler:
- Do some heavy cleanup and code refactoring.
- Add SSE2-enabled unpacking function for direct 16-bit color textures.
2016-10-30 23:16:49 +00:00
zeromus 318613e783 add savetype hardcode for puzzler world 2016-10-25 06:02:33 +00:00
zeromus 77918f13ee fix support importing newer style ardsi duc files 2016-10-05 08:21:38 +00:00
zeromus 66613008f1 update path format tooltip 2016-10-03 01:48:05 +00:00
rogerman b9c33745c5 Filters:
- Simplify the functionality of the Deposterize filter by making the threshold a constant value.
- Increase the Deposterize threshold from 21 to 23.
2016-09-30 05:41:00 +00:00
zeromus 284119237e support importing newer style ardsi duc files 2016-09-30 05:08:23 +00:00
rogerman 4af90cd902 Filters:
- Remove the Deposterize texture filter from render3D.cpp and make it a general-purpose standalone filter.
2016-09-29 00:58:04 +00:00
zeromus b39f9ef9e4 fix bugs in MC import. I dont want to talk about it. 2016-09-25 22:09:13 +00:00
rogerman 59088e1ff8 Cocoa Port:
- OS X App Debug builds now use Xcode 8’s new Incremental LTO feature.
2016-09-14 21:49:47 +00:00
zeromus 14458da8f8 do a better job on the language setting, probably 2016-09-08 22:39:31 +00:00
zeromus ebff84cd45 try to apply patches from #1593 2016-09-08 22:31:31 +00:00
zeromus de91bcf369 winport: fix #1590 1 pixel black line on the right side of the emulator 2016-09-06 21:17:32 +00:00
zeromus df7f081cb5 placement of fastbuild hacks in gpu.cpp breaks some build types. tired of fixing it locally. not a safe hack anyway. 2016-09-06 18:09:00 +00:00
zeromus 8f6bfd2808 w32 scond: reorder variable declarations and statements for ancient compilers 2016-09-02 01:15:26 +00:00
rogerman 538442861b rthreads.c:
- In scond_wait(), make use of SignalObjectAndWait() as an optimization.
2016-08-29 20:08:07 +00:00
zeromus 5d66422b94 win32 scond: remove volatile, fix busy loops in some scenarios, tidy code. Except for scond_wait_timeout, this may be done 2016-08-29 04:54:30 +00:00
rogerman 386d9bad96 task.cpp:
- Revert the last resort execution of workFunc in Task::Impl::finish(). Windows now has much better compliance with the behavior of pthread_cond_wait(), so the last resort execution is no longer necessary.
2016-08-26 10:57:20 +00:00
rogerman 3ae591be7a task.cpp:
- Add additional checks for workFunc in Task::Impl::execute() and Task::Impl::finish() to make their reentrancy more robust on Windows.
- Add a last resort execution of workFunc in Task::Impl::finish() in the case where taskProc() misses the wake up signal from Task::Impl::execute() when running on Windows.
2016-08-26 03:45:42 +00:00
rogerman 212c23f30e task.cpp:
- EXPERIMENTAL: Revert task.cpp and pthreads.c to what they were back in r5538, but change scond_wait() to explicitly unlock the mutex before calling WaitForSingleObject().
2016-08-24 21:17:39 +00:00
zeromus 66bc2d1d71 etc 2016-08-23 23:35:06 +00:00
zeromus 166365ab0d task cleanup and add some volatiles which i reasoned were necessary 2016-08-23 23:32:44 +00:00
rogerman 07e3612e4d task.cpp:
- When shutting down, ensure that the existing task is finished if its running before continuing with the shutdown process.
- Explicitly declare thunkTaskProc() as static.
2016-08-23 23:17:10 +00:00
rogerman a1a6c47aac task.cpp:
- Fix compiling for non-MSVC compilers.
2016-08-23 21:55:59 +00:00
zeromus fc77539bda reimplement task to not be buggy 2016-08-23 21:13:29 +00:00
zeromus ae92918d27 fix bugs in libretro's scond for win32, hopefully. 2016-08-23 21:12:49 +00:00
rogerman b4759f854c GPU:
- Add some functions to control when master brightness and RGB666=to=RGB888 conversions occur internally or not.
2016-08-22 21:04:03 +00:00
jsteffens 701bfdde80 configure.ac: Add missing conditionals 2016-08-21 22:41:56 +00:00
jsteffens a7a9371b3a Makefile.am: Fix syntax errors 2016-08-21 21:52:29 +00:00
zeromus 5b2691b40e winport: experimental fix for hanging softrasterizer code. extremely finnicky and untested thread synchronization code in here! 2016-08-21 01:16:51 +00:00
rogerman 44b227d0b8 GPU:
- If a GPU engine is disabled or has master brightness at full intensity, fill the output framebuffer on line 191 instead of on line 0.
- Replace global variable Render3DFramesPerSecond with accessor method GPUSubsystem::GetFPSRender3D().
2016-08-20 19:20:27 +00:00
rogerman c5cae26246 GPU:
- Do some additional tweaks to how GPU events are handled. (Related to r5534.)
2016-08-18 04:38:59 +00:00
rogerman 84a007451a Colorspace Handler:
- Generic color conversion functions are now inlined at the header in order to keep up performance for compilers without LTO.
2016-08-18 04:14:45 +00:00
zeromus 9c1f523a72 support --3d-render in common commandline parsing and use in windows port as a demo 2016-08-16 22:00:27 +00:00
rogerman 8c60f5fdf3 GPU:
- Use more consistent behavior when forcing the 3D rendering to finish.
- Guarantee that 3D rendering will always be finished at the end of V-blank.
2016-08-16 20:00:36 +00:00
rogerman d8735a803b Colorspace Handler:
- Factor out the generic colorspace handling routines out of GPU.cpp/GPU.h into their own separate files.
- Add vectorized routines using AVX2 and AltiVec.
2016-08-16 06:47:22 +00:00
rogerman d837653b5f GFX3D:
- Fix 3D rendering on non-MSVC builds.
2016-08-16 00:12:34 +00:00
zeromus 7abca69750 better fix than r5529 for same bug (which fixes some regressions from that commit) 2016-08-15 07:10:42 +00:00
zeromus abbfa4a6b7 fix #1134 (american girls julie finds a way) by changing behaviour of box test busy flag relative to fifo 2016-08-13 23:50:25 +00:00
zeromus cc2c86cf11 fix #1555 (regression in Kingdom Hearts Re:coded caused by r5440) by changing how wacky nearly-out-of-limits geometry is handled to a possibly more plausible mechanism 2016-08-13 23:48:51 +00:00
zeromus d89fa0c761 winport: fix fastbuild flag 2016-08-13 18:24:45 +00:00
zeromus 17b7ebfa88 change backup memory whitelist application technique and fix SM64 (KOR) which needs an 0.5KB eeprom apparently (based on its use of WRHI and RDHI commands) 2016-08-13 18:24:33 +00:00
zeromus 02a5944a20 winport: allow sizing window under "minimum size". Unclear why we wanted this functionality to begin with, but probably predated view>window size multiples for more easy scaling. Other benefit: stops messing up the viewport determination when magnification overshoots window size (i.e. fullscreening a massive 5x filter applied by idiots) 2016-08-08 03:10:13 +00:00
rogerman a966765ae5 GPU:
- Display capture blending functions now support RGB888 color format. (Related to r5433. This rework is still incomplete.)
2016-08-07 00:26:31 +00:00
rogerman c7e3298b94 GPU:
- Fix compiling on systems that support SSE2 and not SSSE3. (Regression from r5524.)
2016-08-06 04:09:57 +00:00
rogerman 9ea82d913a GPU:
- Do some code cleanup.
2016-08-06 03:36:37 +00:00
rogerman e54a0eb3e4 GPU:
- Fix bug where the composited 3D layer could have incorrect colors on non-SSE2 systems. (Regression from r5509.)
2016-08-04 01:08:42 +00:00
rogerman cd7690730b GPU:
- For SSE2 systems, when reading graphics data from main memory, eliminate the extraneous pshufd instruction.
2016-08-03 18:14:44 +00:00
rogerman 2e2d02302b GPU:
- Fix compiling issue with non-SSE2. (Regression from r5512.)
2016-07-31 21:10:14 +00:00
rogerman 44ff1b077f Cocoa Port:
- Do some minor code cleanup.
2016-07-30 01:50:54 +00:00
rogerman b053c562d0 GPU:
- Do some minor code cleanup.
2016-07-30 01:49:47 +00:00
zeromus 7dae5d2206 fix #1570 better 2016-07-30 01:38:14 +00:00
rogerman 0ee96c0262 GPU:
- Fix bug where the OBJ layer wasn’t doing the window test. Fixes graphical issues in Mario Kart DS. (Regression from r5515. Fixes bug #1572 and #1574.)
- The NOWINDOWSENABLEDHINT template parameter is no longer an optional hint; it is now required functionality. It has been renamed to WILLPERFORMWINDOWTEST to reflect this change.
2016-07-28 19:34:12 +00:00
rogerman 687ddb39c2 GPU:
- Window testing is now a per-scanline operation instead of a per-pixel operation. Removes the performance penalty of window testing at larger framebuffer sizes.
2016-07-27 16:58:39 +00:00
zeromus d6677ef42f apply suggestions from #1570 2016-07-26 17:17:36 +00:00
zeromus 2d143a9147 fix infinite loop bugs in commandline parsing 2016-07-26 17:15:27 +00:00
rogerman b5519378e7 GPU:
- Use a GPUEngineCompositorInfo struct for managing compositor states, instead of using individual variables for everything.
2016-07-22 19:30:24 +00:00
rogerman cd07e14802 GPU:
- Fix bugs with window processing when rendering at the native resolution. (Regression from r5506.)
2016-07-22 18:32:31 +00:00
rogerman ebea960714 Cocoa Port:
- In the OpenGL blitter, replace some calls to glBufferSubDataARB() with glMapBufferARB(). This, maybe, possibly, fixes an intermittent crash that can occur with the Intel HD Graphics 3000 OpenGL driver.
2016-07-20 10:07:53 +00:00
rogerman ab874d0d5e GPU:
- Do some code cleanup.
2016-07-19 06:40:53 +00:00
zeromus d243063c2c add texture smoothing option to windows port 2016-07-16 22:21:22 +00:00
rogerman 7d58eb9885 GPU:
- Move towards completing support for changing the output framebuffer color format to RGB666 or RGB888. Significantly increases the generated code size, but this is necessary for performance. (Related to r5433. This rework is still incomplete.)
2016-07-15 20:30:05 +00:00
rogerman c5c9e14eb9 GPU:
- Parse and cache the WININ and WINOUT registers, instead of using them directly.
- Parse and cache the Target1 bits of the BLDCNT register.
- Remove some template parameters which are now suspected to no longer improve performance, most notably LAYERID. Should significantly reduce the generated code size.
2016-07-15 16:29:08 +00:00
rogerman 7ae811e5cf GPU:
- Do some refactoring and code cleanup.
2016-07-14 05:49:47 +00:00
rogerman 6530d35c3e GPU:
- Do some minor code cleanup.
2016-07-13 23:14:38 +00:00
rogerman 3a11617bed GFX3D:
- Do some minor code cleanup.
2016-07-13 23:13:14 +00:00
zeromus fedef6c842 apply patch #174 2016-07-12 17:50:24 +00:00
zeromus 07c08f03d2 remove non-OPTIMIZED_CLIPPING_METHOD which hasnt been used for 7 years. also remove the broken index_lookup_table which used it (reported by patch #173) 2016-07-12 17:48:53 +00:00
rogerman ae0023c5fd Linux Port (GTK-Glade):
- Fix bug where the NDS displays wouldn't draw in the window when GdkGL is enabled. (Regression from r5273.)
2016-07-12 01:18:01 +00:00
rogerman 8454c93fa3 Apply patch from [patches:#172]: “fix gcc compiler warning about pointer conversion in path.h” 2016-07-11 15:37:11 +00:00
zeromus a39d104d1b fix windows screenshots from r5458 / r5459 2016-07-11 01:36:34 +00:00
rogerman 11673c7a88 Render3D:
- Additional tweaks to texture upscaling on textures that are not A3I5 or A5I3. (Related to r5496.)
2016-07-10 07:02:08 +00:00
rogerman 8e08a92b9d Render3D:
- Improve texture upscaling smoothness for A3I5 and A5I3 textures.
2016-07-10 06:27:20 +00:00
rogerman 8be7dccdda GPU:
- Do a tiny optimization for GPUEngineBase::_RenderPixel16_SSE2().
- Fix a bug where the 3D layer would fail to draw correctly on non-SSE2 systems if the output framebuffer’s color format is RGB666 or RGB888. (Regression from r5492.)
- Do some minor code cleanup.
2016-07-10 03:38:22 +00:00
rogerman 3246953ca2 GPU:
- Oops! Fix a build issue where the code would fail to compile for architectures that support SSE2 but not SSSE3. (Regression from r5493.)
2016-07-08 18:51:28 +00:00
rogerman 1f0ca239bb GPU:
- 2D layer compositing now supports RGB666 and RGB888 color formats. (Related to r5433. This rework is still incomplete.)
- Fix a couple of bugs in GPUEngineBase::_ColorEffectBlend3D() when dealing with RGBA6665 or RGBA8888 color formats.
2016-07-08 18:45:13 +00:00
rogerman 6c78aa0520 GPU:
- Establish some assumptions about what the 3D layer’s color format will be with respect to the output framebuffer’s color format. This is being done in order to simplify the code.
- The new rules are as follows: If the output framebuffer’s color format is RGB666 or RGB888, then the 3D layer’s color format will be RGBA6665 and RGBA8888, respectively. If the output framebuffer’s color format is RGB555, then the 3D layer’s color format will be RGBA6665.
2016-07-07 00:57:26 +00:00
rogerman 1b93208782 GPU:
- 3D layer compositing now supports RGB666 and RGB888 color formats. (Related to r5433. This rework is still incomplete.)
- Fix a bug in GPUEngineBase::_ColorEffectBlend3D() where variables were left undefined when the source and destination color formats were mismatched.
2016-07-07 00:12:34 +00:00
rogerman 771ceee36b GPU:
- Partially fix a bug with affine and extended BG layers on big-endian systems. Such layers that perform rotation or scaling aren’t fixed yet.
- Loosen a restriction on taking the faster code path in GPUEngineBase::_RenderPixelIterate_Final().
- Silence a compiler warning on non-SSE2 systems.
2016-07-06 01:23:36 +00:00
rogerman b129392683 Render3D:
- Fix some coloring issues on big-endian systems brought about by the recent changes to the colorspace conversion code. (Regression from r5455.)
2016-07-04 00:13:36 +00:00
rogerman 68825ec961 Texture Handler:
- Fix unpacking 16-bit direct color textures on big-endian systems.
2016-07-03 21:58:42 +00:00
rogerman cab3408049 OpenGL Renderer:
- Fix a bug where if both flipping and colorspace conversion occur on the CPU, then the 3D framebuffer would flush incorrectly. (Regression from r5455.)
2016-07-03 07:56:59 +00:00
rogerman d50c8f8e3e GPU:
- Nope! Apparently, GPUEngineBase::_RenderPixel_CheckWindows16_SSE2() does need to be forced inline, or else performance will drop! (Regression from r5485.)
2016-07-03 02:17:42 +00:00
rogerman b314a49dee GPU:
- GPUEngineBase::_RenderPixel_CheckWindows16_SSE2() no longer need to be forced inline.
- Do some code cleanup.
2016-07-03 01:46:50 +00:00
rogerman a815b1c458 Cocoa Port:
- Fix another tiny blending bug in the 5xBRZ fragment shader. (Related to r5379.)
2016-07-02 22:07:26 +00:00
rogerman 2953799788 Linux Port (CLI / GTK / Glade):
- Fix builds that were broken due to new libretro-common API additions. (Regression from r5398.)
- KNOWN REGRESSION: In order to hasten the process of restoring the ability to build the Linux ports, the additional command-line options that are available in the Linux ports have been disabled. Maybe someone else can restore their functionality.
2016-07-02 20:23:56 +00:00
rogerman 3c5461e786 Core:
- Fix some issues with building on older compilers.
2016-07-02 19:47:13 +00:00
rogerman 9683b7e070 GPU:
- Once again, tell the 3D renderer which framebuffers need to be flushed per frame so that we can avoid flushing unneeded framebuffers. This fixes a performance regression with many 3D games. (Regression from r5383.)
2016-07-01 20:19:13 +00:00
rogerman e6dac5ec96 GPU:
- Further optimize the SSE2 versions of ConvertColor555To6665Opaque() and ConvertColor555To8888Opaque().
2016-07-01 18:32:10 +00:00
rogerman a05ddab710 Texture Handler:
- Include SSSE3 versions for unpacking the following texture types: I2, I4, and A5I3.
- As a side-effect of working on these optimizations, the SSE2 versions of ConvertColor555To6665Opaque() and ConvertColor555To8888Opaque() are now a little faster.
2016-07-01 10:15:57 +00:00
rogerman 0d9d59455f GPU:
- Remove GPUEngineBase::_RenderPixel_CheckWindows8_SSE2() and GPUEngineBase::_RenderPixel8_SSE2(). I don’t see us ever needing to use these methods in the future.
- Replace patterns of por(pand,pandn) with pblendvb where appropriate. (Requires SSE4.1)
2016-07-01 00:13:32 +00:00
rogerman a35edad4fc GPU:
- The need to read the 3D framebuffer is now checked on a per-line basis instead of solely at line 0. Once more, this fixes the map rendering in Advance Wars: Dual Strike during some conversations. (Regression from r5429.)
2016-06-29 19:16:23 +00:00
rogerman 031f65fe83 GPU:
- Fix a bug in window processing. Fixes the appearance of chips in the Gear Matrix of Kingdom Hearts Re:coded. (Regression from r5473.)
2016-06-29 16:13:34 +00:00
rogerman bce02d9cc8 Render3D:
- Remove duplicate lookup table.
- Better optimize Render3D_SSE2::ClearFramebuffer(). Should improve performance for games that do their clears using image buffers.
2016-06-29 06:29:11 +00:00
rogerman 558e405511 GPU:
- Ensure that window states are updated when the framebuffer size changes. (Regression from r5473.)
2016-06-29 01:03:11 +00:00
rogerman 8cfea593f8 GPU:
- Improve the SSE2 optimizations in the compositor.
2016-06-29 00:28:02 +00:00
rogerman 425643bf92 GPU:
- GPUEngineBase::_ColorEffectBlend() now supports RGB666 and RGB888 color formats.
- Use some SSSE3-specific optimizations in GPUEngineA::_RenderLine_DispCapture_BlendFunc_SSE2().
- Do some minor cleanup.
2016-06-27 06:11:39 +00:00
rogerman edf1d305d4 GPU:
- Fix a small bug where uninitialized variables were being used. (Related to r5470.)
2016-06-26 08:04:32 +00:00
rogerman d04c8eeae7 GPU:
- Continue rework towards supporting RGB666 and RGB888 color formats. (Related to r5433. This rework is still incomplete.)
- More basic blending methods now support RGB666 and RGB888 color formats.
- Don’t reset some sprite-related state buffers if the OBJ layer is disabled.
- Replace instances of std::min() with ternary operators.
- Better optimize SSE2 versions of ConvertColor8888To5551() and ConvertColor6665To5551().
- Use some SSSE3-specific optimizations in GPUEngineBase::_ColorEffectBlend() and GPUEngineBase::_ColorEffectBlend3D().
- Fix some compiling issues with some SSE2 color conversion functions on older compilers.
2016-06-26 05:46:42 +00:00
zeromus cdd5892c60 fix vs2010 compiling. gpu.cpp compling is slow... :( 2016-06-24 18:29:00 +00:00
rogerman dde0da24ab GPU:
- Avoid generating autovectorized SSE2 code for loops where a hand-coded SSE2 loop already exists. (MSVC and Clang only.)
2016-06-23 20:30:24 +00:00
rogerman 3f895b85fb Cocoa Port:
- Fix a performance issue where if the status bar is hidden while Vertical Sync is enabled, then status text updates will cause a severe slowdown due to conflicting vertical syncs. (Fixed by setting the ‘hidden’ flag of the statusText control to YES while the status bar is hidden.)
2016-06-23 01:37:07 +00:00
rogerman 051e58a4fd GPU:
- Reorder some functions to fix building on older compilers.
2016-06-23 01:32:53 +00:00
rogerman 314bb2130d OpenGL Renderer:
- Revert a change in setting the fog render bit for translucent fragments. Fixes the appearance of the Air Robo GP in Solatorobo: Red the Hunter. (Regression from r5464.)
2016-06-22 17:11:54 +00:00
rogerman 0cb3bd723f OpenGL Renderer:
- Fix a bug with depth writes, which also fixes bugs with fog and edge mark. (Fixes bug #1522.)
2016-06-22 09:27:52 +00:00
rogerman 4ae207fb03 GPU:
- Reduce overall register contention in some color blending methods.
2016-06-21 20:30:52 +00:00
rogerman 03d8ee62aa Cocoa Port:
- In the OpenGL blitter, only allow source filters (such as Deposterize) to run on native-sized framebuffers. This is being done since the visual impact on custom-sized framebuffers, even those at 2x size, is not enough to warrant the additional GPU load. This behavior is now consistent with the pixel scalers, which only run on native-sized framebuffers and not on custom-sized framebuffers.
- Fix a bug in the OpenGL blitter where the Deposterize filter wouldn’t run if the pixel scaler was set to None.
2016-06-20 21:22:51 +00:00
rogerman 4d2307538d GPU:
- Add 555-to-6665 opaque color conversion.
- Add UNALIGNED switch to 555-to-8888, 555-to-6665, 8888-to-5551, and 6665-to-5551 color buffer conversion functions, allowing clients to inform these functions that the incoming buffer pointers may not be 16-byte aligned.
- Rendered lines from GPUEngineBase::_HandleDisplayModeOff(), GPUEngineA::_HandleDisplayModeVRAM(), and GPUEngineA::_HandleDisplayModeMainMemory() now output colors with the alpha bits filled in. This is working towards a time when clients that work directly in 16-bit and 32-bit colorspaces don’t have to fill in the alpha bits themselves.
- Unify more color conversion code.
2016-06-20 18:47:45 +00:00
rogerman d1a8663acb GPU:
- In the SSE2 version of ConvertColor555To8888Opaque(), change the algorithm to use computation instead of memory lookups. Although memory lookups are faster on newer CPUs, computation is much faster on older CPUs, which have smaller caches and longer memory latencies. I believe this is the correct decision, since older CPUs are the ones that need as much performance as they can get.
2016-06-18 22:20:07 +00:00
rogerman 0110fe22d6 Windows Port:
- Oops! Missed a small typo that still caused compiling on Windows to fail. (Related to r5458.)
2016-06-18 01:44:15 +00:00
rogerman 9e07cc95b4 Windows Port:
- Fix compiling on Windows due to new color conversion code. (Regression from r5455.)

GPU:
- The SSE2 version of ConvertColor555To8888Opaque() now uses memory lookups instead of calculating things through.
2016-06-18 01:38:51 +00:00
rogerman 29ff68cda9 GPU:
- Add color 555 to 8888-opaque conversions.
- In the new color buffer conversion functions, change the FragmentColor data types to u32. (Related to r5455.)
2016-06-17 22:36:56 +00:00
rogerman 0d162bdb9f Cocoa Port:
- Change gpuColorFormat property data type from UInt32 to NSUInteger.
2016-06-17 21:33:43 +00:00
rogerman f8e0585d26 GPU:
- Unify all colorspace conversion code.
- Fix bug with VRAM-to-VRAM capture.

OpenGL Renderer:
- Try and fix a possible bug with applying fog to transparent fragments.
2016-06-17 04:22:51 +00:00
rogerman b543e309c5 Cocoa Port:
- Fix bug where the texture smoothing option was not getting saved to the user defaults file. (Related to r5451.)
2016-06-10 21:11:51 +00:00
rogerman 5d2b5054ba OpenGL Renderer:
- Remove some code duplication in OpenGLRenderer::SetupTexture().
2016-06-10 20:48:03 +00:00
rogerman 41d9061ce4 OpenGL Renderer:
- Fix building on platforms that aren’t OS X. (Regression from r5450. Fixes bug #1561.)
2016-06-10 18:20:55 +00:00
rogerman 490e34f81e Cocoa Port:
- Add support for texture smoothing. (Related to r5450.)
2016-06-10 04:16:28 +00:00
rogerman 9a9f006397 OpenGL Renderer:
- Texture sampling now works with bilinear filtering, mipmapping, and anisotropic filtering! These texture smoothing features can be used by enabling the new CommonSettings.GFX3D_Renderer_TextureSmoothing flag.
2016-06-10 03:57:32 +00:00
rogerman ce5765006f Cocoa Port:
- Fix some possible issues with HUD text rendering.
2016-06-09 18:47:54 +00:00
rogerman d682d15142 Cocoa Port:
- Fix builds that were broken due to new libretro-common API additions. (Regression from r5438.)
2016-06-09 18:46:55 +00:00
zeromus b157132dbc change build system to support dev+ with gdb stub enabled. I think that's basically where it was at historically 2016-06-02 18:17:22 +00:00
zeromus d24883ee85 more helpful --help for arm9gdb etc 2016-06-02 18:15:22 +00:00
zeromus 82904b4a74 fix bug entering cheats with values > 7FFFFFFF 2016-05-25 05:09:44 +00:00
zeromus 9767f79346 support cheats to any address, not just main memory. 2016-05-23 17:11:33 +00:00
zeromus 9b33859c68 fix a bug making vs2015 builds unable to open roms on XP systems 2016-05-14 05:00:39 +00:00
rogerman 45b559eae6 Cocoa Port:
- Simplify some drawing code in the OpenGL blitter.
2016-05-13 06:26:38 +00:00
zeromus afb63d0b2f fix crashes in bilinear final filter + HD prescaling (buffer overflows in sloppy filter code, as usual) 2016-05-09 22:23:54 +00:00
zeromus 13032f6712 fix garbage polygon rendering (error in gfx3d matrix math overflows) in spectrobes: beyond the portals 2016-04-24 19:14:07 +00:00
zeromus caec37ef25 fix newish crash on windows when shutting down with --num-cores 1 2016-04-24 19:13:07 +00:00
zeromus 73f5067ebc VFAT: use retro_dir and retro_stat instead of additional fs- layer 2016-04-22 01:38:45 +00:00
zeromus b03347dc48 retro_dirent and retro_stat tidy and bugfixes: windows retro_dir would have missed the first entry; retro_stat wasn't extern "C"'d; retro_dirent_is_dir didn't need a path argument (path can always be gotten from RDIR in a trivial operation) 2016-04-22 01:38:26 +00:00
zeromus cd702e32f3 fix vcxproj 2010/2015 selection better 2016-04-22 01:35:13 +00:00
zeromus 591f419ffe add .editorconfigs 2016-04-22 01:29:42 +00:00
zeromus b0f4989230 update libretro-common 2016-04-22 00:34:34 +00:00
rogerman 3685c6e1f6 GPU:
- Begin rework for supporting RGB666 and RGB888 color formats. (This rework is still incomplete.)
2016-04-16 20:36:20 +00:00
rogerman 9a2bc94fc9 Render3D:
- 3D renderers can now be requested to output their framebuffers in RGBA6665 (SoftRasterizer and OpenGL) or RGBA8888 (OpenGL only) color formats.
2016-04-09 07:47:53 +00:00
rogerman f036f26310 Cocoa Port:
- Add property methods for setting the GPU color format.
2016-04-05 17:41:17 +00:00
jsteffens 0ce1df58c5 Some build fixes for Linux (but still doesn't build) 2016-04-03 23:16:56 +00:00
rogerman 549079cb95 GPU:
- Fix the random battle transition in Final Fantasy III. (Regression from r5344. Fixes bug #1548.)
2016-04-03 06:26:02 +00:00
zeromus aba30866b1 fix crash in gbagame slot2 addon when gba rom doesn't exist 2016-03-30 23:50:54 +00:00
zeromus bf911bf571 winport: add options for killing stylus off-screen 2016-03-29 22:52:44 +00:00
zeromus f22f05959d zero out capture buffer in case advanced spu logic is disabled (prevents noise in savestates taken with a different advanced spu logic setting) 2016-03-29 07:12:26 +00:00
zeromus 660248816e winport: add note to sound config gui that advanced spu logic is a sync setting 2016-03-29 07:11:33 +00:00
zeromus fbb564db25 fix vcxproj in 2010 (ctrl+f7 building and resource editing) 2016-03-29 06:52:39 +00:00
zeromus 6e88f8e5dc update libretro-common 2016-03-29 06:10:12 +00:00
zeromus 7e43d12cc7 winport: don't spew /arch:SSE2 warnings compiling x64 on vs2015 2016-03-22 15:59:55 +00:00
zeromus 60ba992495 forgot to commit two files 2016-03-22 15:53:13 +00:00
zeromus 9766d2d8a6 winport: remove userconfig, replace with msbuild-based system. easily support newer SSE versions while we're at it 2016-03-22 06:27:58 +00:00
rogerman 8e7c58e11f Cocoa Port:
- Fix builds that were broken due to new libretro-common API additions. (Regression from r5398.)
2016-03-21 21:29:57 +00:00
zeromus f6d8a4a0c4 fix errors and tidiness in commandline help 2016-03-21 08:45:49 +00:00
zeromus 0a5f63c0f1 fix bin output filename 2016-03-21 08:30:51 +00:00
zeromus 4a6ea70c94 fix commandline processing (none of the no-args were working) 2016-03-21 08:30:19 +00:00
zeromus 08383c8195 yes, still wrestling with EOLs 2016-03-21 02:21:31 +00:00
zeromus cb2e219470 fix vcxproj for libretro-common update 2016-03-21 02:19:30 +00:00
zeromus a0e0aed5a4 remove a bunch of eol-style properties... again.. bear with me. 2016-03-21 02:15:01 +00:00
zeromus 7f0c1276d4 update libretro-common. lots of noisy EOL changes because originally I screwed up and changed them. 2016-03-21 02:12:11 +00:00
zeromus 655dd15cc1 remove a bunch of eol-style properties 2016-03-21 02:02:11 +00:00
zeromus 6724231a2d rebuild vcxproj and sln to use a handcrafted props file and share a vcxproj. launch in 2010 through batchfile; launch in 2015 through sln 2016-03-21 01:33:13 +00:00
zeromus 708a2cfef5 vs2015 fixes 2016-03-21 01:33:13 +00:00
zeromus a0ea0b258d fix bug in rthreads resource creation on win32 (spurious failures) 2016-03-21 01:33:13 +00:00
zeromus 0e346c62be fix glib deps in main.cpp 2016-03-21 01:33:12 +00:00
zeromus 60d5004d14 add sthread_isself 2016-03-21 01:33:12 +00:00
zeromus 4d1374a675 remove glib 2016-03-21 01:33:12 +00:00
zeromus 3785435414 use getopt for commandline, to remove glib dependency 2016-03-21 01:33:12 +00:00
zeromus 6851ff2737 define no_argument and friends if needed in compat/getopt 2016-03-21 01:33:12 +00:00
zeromus 86fe433eed fix C++ comments
vc2010 build fixes for new libretro-common
2016-03-21 01:33:12 +00:00
zeromus a009d2ac13 vc2010 workarounds for libretro-common 2016-03-21 01:33:12 +00:00
zeromus 2c127b73b0 merge latest libretro-common 2016-03-21 01:27:43 +00:00
zeromus c4d7e476c5 1st pass using libretro-common 2016-03-19 10:21:30 +00:00
zeromus ac26660c86 delete vio2sf; kode54 decided to maintain it. see https://bitbucket.org/kode54/vio2sf 2016-03-19 07:37:36 +00:00
rogerman da90bfec30 GPU:
- Fix crash that can occur when changing the framebuffer size. (Regression from r5395.)
2016-03-19 02:58:09 +00:00
rogerman d8a6112049 GPU:
- The framebuffer pointers in NDSDisplayInfo are no longer assumed to be 16-bits per pixel in size. This is being done now in preparation for higher color depth processing. (This feature is not yet implemented.)
- Instead, clients should be reading NDSDisplayInfo.colorFormat to determine the color format of the framebuffers. NDSDisplayInfo.pixelBytes is a convenience field that reports the number of bytes per pixel (either 2 or 4 bytes).
- By default, the framebuffers will continue to be in 16-bit BGR555_Rev format for backwards compatibility.
2016-03-19 02:22:03 +00:00
rogerman fbf2b970a1 GFX3D:
- If GPU engine A is disabled, then continue respecting the 3D rendering order when blanking out the 3D framebuffer.
2016-03-18 21:25:46 +00:00
zeromus a0f207c66a cleanup vc2010 vcxproj 2016-03-18 09:15:56 +00:00
rogerman c9ad78971c crc.h:
- Fix building for non-MSVC compilers. (Regression from r5391.)
2016-03-18 07:56:08 +00:00
zeromus 40d4d80c25 (winport) fix: #1543 fex identifying ROMs as compressed archives, causing crash (added a method to attempt to ID any kind of NDS rom before even passing it to FEX) 2016-03-18 00:36:55 +00:00
zeromus e0f8e5a82a vs2010 - add fastbuild configuration, hookup texture upscaling options 2016-03-16 06:47:46 +00:00
zeromus 9af7c039e4 fix loading DQ5 2016-03-15 05:48:44 +00:00
rogerman 07d9613295 OpenGL Renderer:
- Fix compiling for Linux/GCC. (Regressions from r5359 and r5372. Addresses bug #1541.)
2016-03-12 18:45:37 +00:00
rogerman 344290283a GPU:
- The DidFrameBegin callback now reports whether frameskip was requested or not.
2016-03-10 19:46:37 +00:00
rogerman e73e60cb02 GPU:
- Fix compiling on non-SSE2 systems. (Regressions from r5370, r5371).
2016-03-09 06:16:45 +00:00
rogerman a213a7aba7 Cocoa Port:
- Add support for automatic texture upscaling and deposterization. (Related to r5384.)
2016-03-09 06:04:20 +00:00
rogerman 485e2cc254 OpenGL Renderer:
- Textures can now be automatically upscaled using the xBRZ filter. Textures can be upscaled to 2x or 4x.
- Textures can now be smoothed using a deposterization filter. This can be helpful in smoothing some of the hard color banding that sometimes occurs with xBRZ.
2016-03-09 05:25:18 +00:00
rogerman e0a139aeda GPU:
- Only flush the 3D rendering buffers and update the rendering properties if the frame is not skipped.
- Be more accurate when using callbacks for DidRender3DBegin and DidRender3DEnd.
- Make the 3D rendering stage more multithreading friendly.
2016-03-08 01:57:08 +00:00
rogerman 7b84225fa4 Cocoa Port:
- Fix occasional crash that can occur when switching 3D rendering engines. (Regression from r5288.)
2016-03-06 01:52:28 +00:00
rogerman 4c9a50ae91 Cocoa Port:
- Fix freezing bug that can occur when switching the 3D rendering engine while the emulation is paused. (Regression from r5288.)
2016-03-05 03:33:16 +00:00
rogerman 4f8a16d980 Cocoa Port:
- Oops! Forgot to add the 6xBRZ menu item to the View > Video Pixel Scaler menu.. (Related to r5379.)
2016-03-05 02:13:12 +00:00
rogerman d4ff390287 Cocoa Port:
- Expose 6xBRZ pixel scaler in the UI. (Related to r5377.)
- Fix a tiny blending bug in the 5xBRZ fragment shader.
2016-03-05 01:45:54 +00:00
zeromus 86eff9d3f0 fix xbrz on msvc 2010 2016-03-04 20:02:39 +00:00
rogerman 313dd2932f Video Filter:
- Upgrade xBRZ to v1.4.
- Add 6xBRZ pixel scaler.
2016-03-04 19:32:06 +00:00
rogerman 6b5aff79ad GPU:
- Remove now obsolete template parameter from GPUEngineA::_RenderLine_DisplayCapture().
2016-03-03 19:57:36 +00:00
zeromus 8a4813b6ff winport: fix directdraw display method screen rotation 2016-03-03 15:18:39 +00:00
rogerman 04e06869d9 GPU:
- Fix bug where the background would blink in The Wizard of Oz: Beyond the Yellow Brick Road when frameskip is enabled. (Regression from r5368).
2016-03-03 01:27:23 +00:00
rogerman 34ec6bb985 MMU:
- HACK: Drop the acknowledgment bits when writing the DISP3DCNT register. Fixes the title screen in “Planet Rescue: Animal Emergency”. (Regression from r5259. Fixes bug #1538.)
2016-03-02 21:01:00 +00:00
rogerman 2f473cd113 OpenGL Renderer:
- Fix some rendering issues with shadow polygons. As a byproduct, this also fixes the drawing of certain missing polygons.
2016-03-02 05:30:40 +00:00
rogerman 891fd01f82 GPU:
- Custom rendering is now determined on a per-scanline basis rather than on a per-framebuffer basis. This greatly improves rendering accuracy and fixes any remaining graphical glitches associated with rendering at custom sizes.
2016-03-01 01:39:38 +00:00
rogerman c5f950d1aa GPU:
- Fix crashing bug that can occur if BMPAddress maps exactly to the head of the custom VRAM blank region, such as in Hotel Dusk: Room 215. (Regression from r5366.)
- Do some code cleanup.
2016-02-27 18:17:35 +00:00
rogerman dcb2c5fa05 GPU:
- Fix crashing bug that can occur if BMPAddress maps into the custom VRAM blank region. (Regression from r5366.)
- Fix bug where a 128-width display capture would actually perform a 256-width capture in custom VRAM. (Regression from r5243.)
- Fix bug where if the display mode is Off or MainMemory, then the destination buffer may not always be the native buffer.
- Remove VRAM display mode’s dependence on the isCustomRenderingNeeded flag.
2016-02-24 21:09:47 +00:00
rogerman ee5fcf6bd2 GPU:
- Fix possible memory corruption with display capture, at the cost of some performance. (Regression from r5243.)
- Add a couple more rules for determining if the 3D framebuffer will be read directly for display capture.
- Keep track of render states that are updated while rendering, even when the frame isn’t rendered.
2016-02-24 07:33:42 +00:00
rogerman 45f6ca71cc GPU:
- Fix possible crash that can occur when switching off the 3D renderer after changing the framebuffer size.
2016-02-23 19:31:50 +00:00
rogerman dc53f97d17 GPU:
- Use the proper address when reading custom VRAM during a BG layer affine extended direct render. Fixes the pencil drawing background in the title screen of Super Mario 64 DS when rendering at a custom resolution.
2016-02-23 07:26:44 +00:00
rogerman c98e669d74 GPU:
- Improve the heuristics in determining when custom-sized rendering and custom-sized output is needed.
2016-02-23 03:52:27 +00:00
rogerman 782b60b824 SoftRasterizer:
- Revert the z-depth calculation in r5191, since this fails to draw units properly in Advance Wars: Days of Ruin when running on big-endian systems.
2016-02-18 22:55:19 +00:00
rogerman 3c710f33dd Render3D:
- In the OpenGL renderer, fix framebuffer color conversions on big-endian systems.
- In SoftRasterizer, fix toon table coloring on big-endian systems.
2016-02-18 20:38:48 +00:00
rogerman 532f78740a Cocoa Port:
- Silence a bunch of console warnings.
2016-02-18 07:35:07 +00:00
rogerman 8f01207e9d Cocoa Port:
- Fix display window restoration on startup if building the app with an OS X SDK earlier than v10.7. (Regression from r5349.)
2016-02-18 04:34:15 +00:00
rogerman b849c5b1c3 OpenGL Renderer:
- Fix bug where if converting the framebuffer on GPU is not supported, but PBO is still supported, then the resulting framebuffer would be flipped with incorrect colors. (Regression from r5359.)
- Read back the pixels in RGBA format instead of BGRA on OpenGL 3.2 devices, since such devices should natively support that type of pixel transfer.
2016-02-18 02:13:47 +00:00
rogerman d6ae36e068 OpenGL Renderer:
- Perform the RGBA6665 color space conversion of the 3D framebuffer on the GPU before pixel read back, and then read that 3D framebuffer directly.
2016-02-17 10:33:44 +00:00
zeromus 9346ced34c commit patch #170 "load gzip/zip compressed files" 2016-02-15 19:13:10 +00:00
rogerman 07031ea621 Cocoa Port:
- In the OpenGL blitter, eliminate the need for fences. Just test the finishing of texture objects directly.
2016-02-15 06:44:28 +00:00
rogerman f985f40ba8 Render3D:
- By default, do not create a separate RGBA6665 buffer for rendering. Instead, directly render to GPUEngineA’s RGBA6665 buffer.
- SoftRasterizer no longer needs to flush the RGBA6665 buffer now that it is rendered to directly.
- Fix the OpenGL renderer’s RGBA5551 buffer flushing on big-endian systems.
2016-02-15 05:25:45 +00:00
rogerman 607c3687ca Cocoa Port:
- Fix bug where the HUD wouldn’t report the correct FPS if more than one display window is in use.
2016-02-14 07:44:01 +00:00
rogerman 86f84fa21c Cocoa Port:
- Change the HUD font from Source Sans Pro Semibold to Source Sans Pro Bold.
- HUD text rendering is now more crisp and handles scaling better.
- HUD objects are now clamped to a minimum size.
2016-02-14 05:26:55 +00:00
rogerman ef376a5426 Cocoa Port:
- HUD objects now scale with the display window instead of remaining at a fixed size. Scaling is linear up to 2x, and then logarithmic up to 3x.
- HUD text now looks sharper on Retina displays.
2016-02-13 00:42:49 +00:00
rogerman 549f754be2 Cocoa Port:
- Fix bug where restoring full screen windows on startup would fail. (Regression from r5349.)
- Fix bug where the dock would fail to reappear when the last window exited full screen mode. (Regression from r5349.)
2016-02-12 08:50:35 +00:00
rogerman e8f660b381 Cocoa Port:
- Add the following toolbar items: Frame Advance, Enable/Disable HUD, Toggle Displays
2016-02-12 06:51:34 +00:00
rogerman 25f33c54ba GPU:
- Fix compiling for non-SSE2 builds.
2016-02-12 06:13:34 +00:00
rogerman a6ad4e04a8 Cocoa Port:
- Fix full screen behavior when running on OS X Mavericks or later.
2016-02-12 01:22:12 +00:00
rogerman fd4d3b19dd Cocoa Port:
- Fix HUD layer scaling on Retina displays.
- Have the HUD layer dynamically change the size of the text box as necessary.
2016-02-10 08:29:06 +00:00
rogerman d565d07841 Cocoa Port:
- The OpenGL blitter now respects if client storage is disabled.
- The HUD layer now scales properly on Retina displays.
2016-02-10 02:10:16 +00:00
rogerman f553d50e97 Wi-Fi:
- Disable logging when EXPERIMENTAL_WIFI_COMM is disabled.
- Now that Nintendo has discontinued their WFC service, we will no longer block users from trying to connect to it.
2016-02-09 23:16:18 +00:00
rogerman 65c0eec884 Cocoa Port:
- Optimize VBO uploading of the HUD layer.
2016-02-08 23:53:05 +00:00
rogerman f68df5b976 Render3D:
- Provide a means of specifying which specific framebuffers need to be flushed for each frame.
2016-02-08 21:20:13 +00:00
rogerman ed1879dc8f GPU:
- Fix bug where a swapped screen state was not being properly reset. (Regression from r5340.)
2016-02-07 07:12:16 +00:00
rogerman ac07bc2639 OpenGL Renderer:
- If PBOs are supported, avoid doing an extra framebuffer copy and read the PBO directly.
2016-02-07 02:30:57 +00:00
rogerman a5c102540f Cocoa Port:
- In the OpenGL blitter, use DMA texture uploads for all possible video source cases. Doing this removes a longstanding MAJOR performance bottleneck.
- Native-sized video sees up to a 15% performance improvement, while higher-resolution video can see up to a 100% performance improvement!!!!!
2016-02-07 01:34:52 +00:00
rogerman f22fd97d28 GPU:
- Allow clients to specify their own framebuffer storage when calling GPUSubsystem::SetCustomFramebufferSize().
2016-02-07 01:15:55 +00:00
rogerman fa898fcf76 GPU:
- Apply SSE2 optimizations to all of the BG layer modes. (Related to r5332.)
- Do some code refactoring and cleanup.
2016-02-03 04:41:54 +00:00
rogerman 2823f599ba Render3D:
- Revert r5331, since it results in incorrect alpha testing. Add additional notes to remind myself why I wrote the code that way in the first place.
2016-02-01 22:28:38 +00:00
rogerman 7542718cde GPU:
- Optimize the loading of destination blending masks if SSSE3 is available.
2016-01-31 22:09:23 +00:00
rogerman 67989f5260 Cocoa Port:
- Return to using Snow Leopard style Audio Components. Requires building with Xcode v7.2 or later, since Xcode v7.0 and v7.1 have bugs that will cause AudioUnits to crash. (Related to r5280.)
2016-01-31 22:06:40 +00:00
rogerman b695f1596f GPU:
- Remove the other reference to the DISPCNT.BG0_Enable flag for determining when 3D rendering is enabled. Fixes minimap rendering at custom resolutions in Advance Wars: Dual Strike during some conversations. (Related to r5334.)
2016-01-31 06:00:03 +00:00
rogerman ea4d0960a0 GPU:
- Fix bug where 3D layers still needed to be rendered even when the DISPCNT.BG0_Enable flag is disabled. Fixes minimap rendering in Advance Wars: Dual Strike during some conversations. (Regression from r5255.)
2016-01-31 03:37:40 +00:00
rogerman 0cb3bf1d2f GPU:
- Fix Windows compiling. (Regression from r5332.)
2016-01-30 11:17:17 +00:00
rogerman 3771d2a76d GPU:
- Begin the process of applying SSE2 optimizations to BG layer compositing.
- In this revision, only Text mode layers use the new SSE2 optimizations. Other BG layer modes have yet to be implemented.
2016-01-30 03:07:11 +00:00
rogerman f1172fe5c8 Render3D:
- Further optimize SSE2 versions of FlushFramebuffer().
2016-01-21 02:47:56 +00:00
rogerman 90e9947da9 GPU:
- When compositing the BG layers, provide a hint for when blending is disabled.
2016-01-18 19:21:06 +00:00
rogerman 0ff9773eaf GPU:
- Replace _mm_set1_epi64x() with _mm_set1_epi32() where appropriate.
- Complete GPUEngineBase::_RenderPixel_SSE2() method.
- Fix potential bug with window checks in GPUEngineBase::_RenderPixel3D_SSE2().
- Do some minor code cleanup.
2016-01-09 23:12:41 +00:00
rogerman a1280789db GPU:
- Avoid doing scalar lookups in the SSE2 portion of GPUEngineBase::ApplyMasterBrightness().
2016-01-05 22:06:55 +00:00
rogerman 76ba4e164d GPU:
- Do SSE2 optimization when compositing the 3D layer.
- Add SSE2 optimized version of GPUEngineBase::_RenderPixel() for future use (currently inactive).
2016-01-05 04:12:36 +00:00
rogerman a4972abe61 Linux Port:
- Fix compiling for GTK and Glade ports.
2016-01-04 23:12:40 +00:00
rogerman abd4704711 GPU:
- Do some code cleanup.
2016-01-04 21:54:00 +00:00
zeromus 69ee626639 winport - fix crash on startup with clean ini file 2015-12-11 01:22:00 +00:00
zeromus bc84d6930b fix DD display method bombing when using high prescale and magnification filter levels 2015-12-09 06:25:11 +00:00
rogerman a738364416 Cocoa Port:
- Fix crash when loading invalid ROM header data.
2015-11-15 06:08:32 +00:00
rogerman 4d32f051ab Render3D:
- Explicitly make the Render3D class allocate itself with a cache-aligned base pointer. Fixes SSE2-related alignment crashes with OS/compiler combinations that don’t 16-byte align the base pointer for you.
2015-11-09 03:46:14 +00:00
zeromus af00e3b3f3 clarify how a jit function table is declared, which has implications on whether a giant 256MB static buffer is allocated, which is causing problems when desmume is loaded as a DLL in 32bit systems. shouldnt affect the main windows or cocoa ports, but will cause other ports to take a different (safer and speed indeterminate) codepath. Build scripts must now make a choice to opt into the riskier behaviour. 2015-11-08 08:09:54 +00:00
zeromus dc3d1945af win32 - fix crash in some display methods when emulator boots up 2015-11-06 01:57:46 +00:00
zeromus 40fd9c2385 winport - fix bug in AR during fullscreen, and fix long-standing bug with white rectangle in bottom right of DD display method when letterbox area is shown 2015-11-01 14:29:42 +00:00
rogerman c40374df16 Cocoa Port:
- When clicking one of the Save Settings as Default buttons in one of the settings panels, force the user defaults file to synchronize immediately. This fixes updating the user defaults file on OS X v10.11 El Capitan.
- Fix bug where video settings wouldn’t update immediately while the emulation is paused. (Regression from r5310).
- Fix bug where if a ROM is unloaded, the previous video frame would remain instead of blacking out as intended. (Regression from r5310).
2015-10-29 06:40:54 +00:00
rogerman 2fbd0685d1 Cocoa Port:
- Add support for displaying the CPU load average in the HUD.
2015-10-28 05:29:17 +00:00
rogerman bb6fe7d06b Cocoa Port:
- Fix bug where using Frame Jump or executing the emulation faster than 1.00x would cause the execution speed to be limited by Vertical Sync.
- Do some code cleanup on CocoaDSOutput.
- Expand the text box further when the RTC is shown.
2015-10-25 02:11:09 +00:00
rogerman 11403180db Windows Port:
- Fix crashing bug with the OAM Viewer tool.
- Improve the sprite drawing performance of the OAM Viewer tool.
2015-10-21 06:09:52 +00:00
zeromus 3c85700c5c fix error in arm7 memorymap mask for IO regs (permitted errant register accesses from clobbering outside the regs buffer) 2015-10-21 04:34:30 +00:00
rogerman 3eb0585129 Cocoa Port (OpenEmu Plug-in):
- Fix crashing bug when initializing the plug-in.
- Update to the latest version of the OpenEmu SDK.
2015-10-20 07:01:07 +00:00
rogerman dd305b36d9 Cocoa Port:
- Add support for displaying the Real-Time Clock in the HUD.
2015-10-16 21:26:52 +00:00
rogerman a6a1875e05 Cocoa Port:
- New feature: Add OpenGL-based Heads-Up Display.
2015-10-16 07:28:42 +00:00
rogerman 57929ed232 Cocoa Port:
- Fix compiling by removing some future code that accidentally snuck into r5306.
2015-10-14 18:08:36 +00:00
zeromus 5b1a6e2cd9 fix vc2015 build flag on x64 dev+ 2015-10-14 07:52:07 +00:00
rogerman 9988ed1293 Cocoa Port:
- Fix bug where using one of the View > Display Size menu options would fail to work if the window’s resize grip was used previously.
2015-10-13 19:43:40 +00:00
rogerman 793f19d47e Cocoa Port:
- Fix some compiler warnings.
- Delete some legacy strings which are no longer used.
2015-10-12 20:06:33 +00:00
rogerman 4eedbca3d9 GPU:
- Fix display capture copy mode colors on big-endian systems.
2015-10-10 22:56:28 +00:00
rogerman 21d9294697 Cocoa Port:
- Fix some compatibility issues with OS X v10.5 Leopard.
2015-10-10 20:16:46 +00:00
rogerman d9cc320c4e GPU:
- Fix bug with horizontal offsets. (Regression from r5295.)
- Fix display capture blend mode colors on big-endian systems.
2015-10-10 19:53:29 +00:00
zeromus 1fc6cbdec2 split processing of internal cheats from AR cheats, and process AR cheats more correctly when an ARM7 IRQ happens 2015-10-10 09:55:06 +00:00
rogerman 18caac989b MMU:
- Fix writing to the sub engine’s MASTER_BRIGHT register. Fixes the touch screen display output for “Pirates of the Caribbean: At World’s End”. (Regression from r5261.)
2015-10-10 02:19:51 +00:00
rogerman f05eb523c1 GPU:
- Loosen the restriction on what constitutes “set mosaic values”, just to be safe. (Related to r5299.)
2015-10-09 21:00:01 +00:00
rogerman d885c383b2 GPU:
- Also skip mosaic rendering if the mosaic values themselves aren’t set.
2015-10-09 20:45:49 +00:00
zeromus f69a3738ae move AR cheats to arm7 bus 2015-10-09 10:01:16 +00:00
rogerman 9cd43cc115 GPU:
- Use restrict pointers where appropriate.
2015-10-08 01:15:12 +00:00
rogerman 61e8cfb063 GPU:
- Account for the fact that extended palette mappings can change independently of the BGnCNT register. Fixes the BG3 layer in Phoenix Wright: Ace Attorney. (Regression from r5286.)
2015-10-06 17:13:24 +00:00
rogerman ec539cba02 GPU:
- Fix a bunch of graphical corruption regressions on big-endian systems.
- Also fix rotation/scale sprite colors and the 3D clear color on big-endian systems.
2015-10-06 01:14:44 +00:00
zeromus 3308d5b28e winport - fix bugs in fullscreen viewport sizing 2015-10-04 18:12:14 +00:00
rogerman 60ea6fe7d5 GPU:
- Fix compiling issue with non-SSE2 builds.
2015-10-03 17:59:20 +00:00
zeromus 216d36d292 winport - dump avis with selected prescaleHD 2015-09-30 23:30:44 +00:00
zeromus b0131342d4 winport - fix a bunch of sloppy broken stuff related to runtime changing of prescale and filtering 2015-09-28 08:34:21 +00:00
zeromus 15b6e7dbea fix crashing of some magnification filters by allocation way too much memory. why wasn't this done long ago? 2015-09-27 22:15:25 +00:00
rogerman 6536230867 Cocoa Port:
- In the Support Request Form and Bug Report Form, update the reported configuration to reflect the current 3D rendering features.
- Do some minor code cleanup.
2015-09-24 21:45:53 +00:00
rogerman 9f04d9076a GPU:
- Auto-resolving the native framebuffer is now only performed if the frame isn’t skipped.
- Add some callback routines for the beginning and ending of rendering a frame, and for the beginning and ending of rendering the 3D layer.
2015-09-24 05:05:06 +00:00
rogerman f3fd4e2ebc GPU:
- Autoresolving the native framebuffer is now performed at the end of line 191 instead of at the end of V-Blank.
- Do misc. code cleanup.
2015-09-23 21:22:25 +00:00
rogerman 9c5f355d00 GPU:
- Better organize BG layer states.
- Do a bunch of other code cleanup.
2015-09-22 22:45:20 +00:00
rogerman d5cf747ce4 GPU:
- Begin unifying pixel rendering. Rendering the BG and OBJ layers now use the same method.
- Pass the destination buffer pointer and line index by means of function parameters, instead of using object variables.
- Rendering a BG layer (for debugging purposes) is now completely handled in the core code.
- Do some other code cleanup.
2015-09-22 01:00:37 +00:00
zeromus e4195c9277 try to fix some gfx3d savestate bugs, but its all kind of a mess. 2015-09-21 21:51:36 +00:00
zeromus 0535b9f874 winport - fix layout/scaling of HD windows in some cases 2015-09-21 21:13:13 +00:00
zeromus 584c334c08 gfx3d - optimize texCoordinateTransform==1 a little bit, while I was looking at it anyway 2015-09-21 21:12:46 +00:00
rogerman 76ce2107fa GPU:
- Clearing to the backdrop color has been changed from a pixel operation to a scanline operation.
- Clearing to black when the GPU engine is disabled has been changed from a scanline operation to a framebuffer operation.
- Applying the master brightness has been changed from a scanline operation to a framebuffer operation.
- Resetting the BGnX and BGnY registers now occurs at the end of line 191 instead of at the start of line 0.
2015-09-18 22:14:59 +00:00
rogerman 574e6a2640 Cocoa Port:
- Fix AudioUnit crash when building against the OS X 10.11 SDK.
2015-09-18 19:33:56 +00:00
zeromus 2336008f73 wimport - oops, cleanup some junk and also some old language junk 2015-09-18 17:37:47 +00:00
zeromus 81d5f697c1 winport - fix hd prescale vs gap (#1505) 2015-09-18 17:34:55 +00:00
rogerman 81dae68652 GPU:
- Do some minor code cleanup.
2015-09-15 20:20:13 +00:00
zeromus 1bce1f1811 fix parsing of december dates 2015-09-15 06:49:35 +00:00
rogerman 8441e6e833 Cocoa Port / Cocoa Port (OpenEmu Plug-in):
- Fix compiling, incorporating the API changes from r5273.
2015-09-15 06:25:33 +00:00
rogerman fe97b5bbef Windows Port:
- Fix compiling, incorporating the API changes from r5273.
2015-09-15 06:19:06 +00:00
rogerman 444c4fcc0c GPU:
- Per zeromus’ suggestion, remove GetNativeFramebuffer() and GetCustomFramebuffer() from the GPUSubsystem class. Users must parse the NDSDisplayInfo struct returned from GetDisplayInfo() instead.
- Per zeromus’ suggestion, rename Get/SetWillAutoBlitNativeToCustomBuffer() to Get/SetWillAutoResolveToCustomBuffer().
- Add some more notes to the NDSDisplayInfo struct to help clarify the meaning of each field.
2015-09-15 01:13:48 +00:00
zeromus c389bc7301 winport - fix clipboard printscreens 2015-09-14 19:11:50 +00:00
rogerman adc64a1c61 SLOT-2:
- When loading Metroid Prime Hunters, set automatic SLOT-2 selection to select the Rumble Pak.
2015-09-14 18:37:00 +00:00
rogerman da132f1f1c GPU:
- More code cleanup.
2015-09-14 18:33:33 +00:00
zeromus f36f5b5627 fix file-based screenshot methods for HD 2015-09-14 18:20:11 +00:00
zeromus 8c00e2c676 winport - preliminary work on binding HD rendering 2015-09-14 09:13:57 +00:00
zeromus 601b86c78a fix more SSE buffer alignment problems, and solve a crash dependent on uninitialized memory 2015-09-14 07:49:09 +00:00
zeromus 386bbd6544 ok, change the GPU buffer back to an embedded array, and change how it's allocated to ensure that it isnt allocated misaligned 2015-09-14 04:38:30 +00:00
zeromus 60f2d5d9cf remove vs2012 support, add vs2015 support. update the zlib version winport uses. 2015-09-14 03:47:44 +00:00
zeromus 74a13d55ff some biz work and cleanup 2015-09-14 03:46:41 +00:00
zeromus 58732d31b4 some portability fixes for gpu work 2015-09-14 03:45:53 +00:00
rogerman 5e8b836e83 GPU:
- Parse necessary registers upon loading state to ensure that internal variables get set properly.
2015-09-13 03:01:56 +00:00
rogerman 20dc706c68 GPU / MMU:
- Further cleanup display I/O register handling.
- Do some misc. code cleanup.
2015-09-11 22:51:24 +00:00
rogerman 73d1a89d21 Windows Port:
- Fix Windows compiling.
2015-09-11 05:15:59 +00:00
rogerman 760b5a61d6 GPU / MMU:
- Begin standardizing how the display I/O registers are handled.
- Do other heavy code cleanup.
2015-09-11 05:15:07 +00:00
rogerman 07e56b07c5 GPU:
- Fix bug where 3D rendering may not always finish on line 0, causing lingering 3D artifacts in certain games. Now it is always forced to finish. (Regression from r5255.)
- Bring back the backdrop clearing optimization from r5198 when rendering in the native resolution.
- Do some minor code cleanup.
2015-09-07 15:19:34 +00:00
rogerman 8038e559fe GPU:
- Fix possible crash when doing a direct-color sprite render due to aligned access, since incoming sprite coordinates can cause access to become unaligned. (Regression from r5256.)
2015-09-05 23:21:26 +00:00
rogerman 7e3f1d85ae GPU / MMU:
- Do SSE2 optimization for direct-color sprite renders.
- Make ARM9_LCD cache-aligned. Allows for SSE2 to perform aligned load/stores on certain operations, improving performance.
- Further templatize some methods.
- Do some misc. code cleanup.
2015-09-05 22:35:34 +00:00
rogerman ced0d3986d GPU:
- Do heavy code cleanup.
- Split the engine-specific functionality of the main and sub engines into the new GPUEngineA and GPUEngineB subclasses.
- Templatize some parameters. Greatly increases the generated code size, but restores (and possibly improves) performance from r5251.
2015-09-04 02:05:50 +00:00
rogerman 88006197b9 GPU:
- Do heavy code cleanup.
- Encapsulate higher level GPU functions into the new GPUSubsystem class.
2015-09-01 00:13:02 +00:00
rogerman d5280f82b0 GPU:
- Do heavy code cleanup.
- Encapsulate GPU-related functions into the new GPUEngineBase class.
2015-08-28 17:45:12 +00:00
rogerman 5a6590ff49 Windows Port:
- Fix compiling issues on Visual Studio 2015.
2015-08-26 03:06:37 +00:00
rogerman 2967cd2c62 GPU:
- Be smarter about manually inlining functions. Greatly reduces the generated code size, and fixes making optimized builds on MSVC. (Regression from r5248.)
- This change may affect performance. This will need additional testing.
2015-08-26 01:27:24 +00:00
rogerman c36c379e1f Cocoa Port:
- Fix drawing bug where the wrong texture coordinates were being used when a display window is in Touch mode. (Regression from r5249.)
2015-08-25 23:44:19 +00:00
rogerman e344486e8a Cocoa Port:
- Add support for handling combination native/custom rendering sizes.
- As a side-effect of supporting this feature, pixel scalers now work as intended when high-resolution rendering is enabled (but only if the incoming display framebuffer is at the native size).
2015-08-25 18:56:03 +00:00
rogerman e8cd47acf0 GPU:
- Finish support for combination native/custom rendering sizes. Can give a significant performance improvement when running the GPUs at a custom size, but only for frontends that support this feature.
2015-08-25 17:57:00 +00:00
rogerman bccbae0df9 GPU:
- Begin refactoring work in order to support combination native/custom rendering sizes.
2015-08-24 22:12:18 +00:00
rogerman bf5b1505c8 GFX3D:
- Fix bug where the 3D framebuffer didn’t clear properly if the main GPU is disabled. (Regression from r5190 and r5212.)
2015-08-24 19:40:37 +00:00
rogerman 7bc5aca100 Cocoa Port:
- Expose feature for resolution-independent 3D rendering. Currently, 3D rendering may be scaled anywhere from 1x - 16x of the native NDS resolution.
2015-08-20 19:58:40 +00:00
rogerman be5615b477 GPU:
- Fix compiling on WIN32.
2015-08-20 18:57:24 +00:00
rogerman 5cfa2b4797 GPU:
- Rework display capture and the NDS VRAM buffers to support non-native resolutions.
2015-08-20 18:12:25 +00:00
rogerman e1f7039f1b Core:
- Do more explicit casting to fix build errors on C++11 compilers.
- Fix bug with libfat string handling.
2015-08-17 21:15:04 +00:00
rogerman 0fc37d2c06 GPU:
- Fix possible crash during display capture due to aligned access on an unaligned memory block. (Regression from r5239.)
2015-08-10 19:12:53 +00:00
zeromus 76c390b17a fix bug in sndxa2 driver that made it chow major cpu in a busy loop 2015-08-10 15:54:47 +00:00
rogerman 8e3ff3c708 GPU:
- Cleanup and optimize OAM attributes handling. (Special thanks to Twinaphex from libretro for pointing this out to us.)
- Add SSE2 optimizations to display capture operations.
- Do a whole bunch more code cleanup.
2015-08-09 04:32:53 +00:00
rogerman a30ca9e350 Cocoa Port:
- Expose stylus pressure and stylus jitter settings in Emulation > Show Stylus Settings.
2015-08-07 19:37:53 +00:00
rogerman d9bb1f30e2 NDSSystem.cpp:
- Also update stylus jitter setting per frame instead of only on reset.
2015-08-07 19:35:34 +00:00
rogerman 33d69b27f5 Cocoa Port:
- Delete HQ3x LUTs when we’re done using them. (Recommits what was once r5226 before SourceForge screwed it up.)
2015-08-07 19:27:38 +00:00
rogerman a7b62386a7 Cocoa Port:
- Also load/save external firmware settings if Use External Firmware Image is enabled.
- Do some minor code cleanup.
2015-08-07 00:16:35 +00:00
zeromus e0d2567e6c fix #1492 RAM Watch editing problem (dont reorder entries when editing them) 2015-08-06 21:46:35 +00:00
rogerman f06c81d671 SoftRasterizer Renderer:
- Don’t evict the texture cache in the middle of geometry rendering! Fixes app crashing with games like Advance Wars: Days of Ruin that actually need to evict the texture cache. (Regression from r5175.)
- Do some minor code cleanup.
2015-08-06 21:15:26 +00:00
zeromus 761834948d fix r5031 gxfifo regression 2015-08-04 23:11:53 +00:00
rogerman 96c47d6734 OpenGL Renderer:
- Revert r5176 until polygon IDs can be handled correctly in one go. Fixes missing polygon issues in certain games such as missing rings in Sonic Chronicles: The Dark Brotherhood and missing loop traces in the Pokemon Ranger: Shadows of Almia title screen. (Addresses one of the issues noted in bug #1253.)
2015-08-02 06:01:50 +00:00
rogerman ee1a489dc7 OpenGL Renderer:
- Change toon highlight blending to match SoftRasterizer. Fixes the “Shadows of Almia” logo in the Pokemon Ranger: Shadows of Almia title screen. (Addresses one of the issues noted in bug #1253.)
2015-07-31 20:46:00 +00:00
rogerman 8c68f22165 SoftRasterizer:
- Minor tweaks and code cleanup.
2015-07-31 05:54:27 +00:00
rogerman e41857fa82 Render3D:
- Revert the SSE2 bit shift optimizations that were done in r5216. Fixes a regression related to fog, as well as a regression that caused a flickering problem in the title screen of Pokemon Ranger: Shadows of Almia. (Fixes bug #1487.)
2015-07-27 05:06:53 +00:00
rogerman e9d6cc3611 GTK Port:
- Fix crash that occurs after the GTK file chooser is used to load a ROM. (Fixes bug #1486.)
2015-07-25 23:51:45 +00:00
zeromus 5a55349155 support trimmed roms to non 4-aligned sizes (supposedly a regression from 0.9.10) 2015-07-25 23:46:58 +00:00
rogerman 9b370cd602 Render3D:
- Fix possible crash due to aligned access.
2015-07-15 04:34:23 +00:00
rogerman 3c9931b1c8 Cocoa Port:
- In addition to the UI controls in the Show Video Settings panel, also add the “Use Vertical Sync” and “Run Filters on GPU” options to the View menu.
- Disable UI controls for Depth Comparison Threshold, since the setting is now obsolete. (Will need to delete UI controls before release.)
- Also add HQ3x/HQ3xS filters to the Pixel Scaler menu in Display Preferences.
- Fix bug where the HQ3x/HQ3xS filters running on the GPU sometimes wouldn’t draw correctly.
2015-07-15 01:36:48 +00:00
rogerman 7daab3d784 Windows Port:
- Oops! Missed a file that should’ve been committed in r5222.
2015-07-15 00:23:59 +00:00
rogerman 47adbc5455 GPU:
- More code cleanup.
2015-07-15 00:22:49 +00:00
zeromus adae275e16 (windows) fix big fail in auto-selection of .duc import size 2015-07-14 01:11:23 +00:00
zeromus 4a128f946c someone ran static analysis on our code, I guess I should fix what it reported 2015-07-13 03:23:28 +00:00
rogerman 4d77617e3e Cocoa Port:
- Add high-resolution UI artwork for Retina displays.
2015-07-09 08:31:41 +00:00
rogerman 04cbc13a6d Cocoa Port:
- Enable Retina displays to draw video frames at their native resolution. (Tested on the iMac 5K Retina and MacBook Pro Retina.)
2015-07-08 06:49:37 +00:00
rogerman a8ffd1e40c GPU:
- Fix compiling on Windows. Looks like vector intrinsics are mandatory on MSVC. (Regression from r5216.)
2015-07-07 22:39:09 +00:00
rogerman 55516fc20e GPU:
- Do some code cleanup, especially with the SSE2-related code.
- Fix potential crash in the OpenGL renderer when changing the framebuffer size.
2015-07-07 22:16:34 +00:00
rogerman e53e289e77 Cocoa Port:
- Add some additional locks when reading the GPU framebuffer.
2015-07-07 21:24:19 +00:00
rogerman fbda969347 Render3D:
- SSSE3-specific optimizations now only require SSE2.
- Better optimize clear image operations.
2015-07-01 21:24:49 +00:00
rogerman 611d0c9036 Core:
- Fix compiling issues on some platforms. (Regression from r5212.)
2015-06-30 20:09:03 +00:00
rogerman d1db3dd7ef GPU:
- Add new malloc_alignedN() functions for easier dynamic allocation of aligned memory blocks.
- Rework buffer allocations using the new malloc_alignedN() functions.
- To enable SSSE3, also require ENABLE_SSE2 and ENABLE_SSE3.
- Add some more SSE2/SSSE3 optimizations.
- CACHE_ALIGN and malloc_alignedCacheLine() now set 64 byte alignment on 64-bit systems.
- Do a bunch more code cleanup.
2015-06-30 19:25:00 +00:00
rogerman 3b332f3a12 GPU:
- Fix HOFS bug when reading back the 3D framebuffer. Tested in Nanostray 2 by explosions that cause the screen to shake. (Regression from r5210.)
2015-06-20 01:32:32 +00:00
rogerman d28e49dd2b GPU:
- Last major round of code cleanup as a set up for future rework.
2015-06-19 20:13:27 +00:00
rogerman 54fc839208 GPU:
- Revert VRAM readback optimization. Fixes the battle sequence in Golden Sun: Dark Dawn. (Regression from r5208.)
2015-06-17 08:18:00 +00:00
rogerman d3ec1dedfb GPU:
- More code cleanup, and various small optimizations.
- Optimize the OpenGL 3D renderer’s framebuffer flush. (Requires SSSE3.)
2015-06-17 07:15:22 +00:00
zeromus ccf2e76c32 fix windows compiling 2015-06-14 21:07:45 +00:00
zeromus c7cbf47472 fix allocations of formerly 32-byte aligned buffers to once more be 32-byte aligned. not 100% sure I did this right... 2015-06-14 21:07:20 +00:00
rogerman e95c176f82 Render3D:
- Fix bug where using the Null 3D renderer would greatly reduce performance, instead of improving performance as intended. (Regression from r5198.)
2015-06-14 04:35:21 +00:00
rogerman 4f3990245d GPU:
- Do a whole bunch of code cleanup.
2015-06-14 00:52:53 +00:00
rogerman 6673298c1e GTK/CLI Ports:
- Fix compiling for CLI port. (Regression from r5198.)
- Fix issue with GTK port where the video output framebuffer wasn't getting cleared on reset. (Regression from r5198.)
2015-06-13 23:23:56 +00:00
rogerman 11a8221856 GTK/Glade/Qt Ports:
- Fix compiling issues. (Regression from r5196.)
- On Qt port, use -Ofast and -ffast-math optimizations.
2015-06-13 20:54:47 +00:00
rogerman d2a0307431 Windows Port:
- Fix compiling issues. (Regression from r5198.)
2015-06-10 04:58:59 +00:00
rogerman 70cb9375cc Cocoa Port:
- Add shader-based equivalents to the following pixel scalers: HQ3x, HQ3xS
2015-06-10 04:28:47 +00:00
rogerman db06a04d73 Cocoa Port:
- Give the video blitter the ability to handle any arbitrary dimensions of video input.
2015-06-10 03:53:19 +00:00
rogerman 12342e21cc GPU:
- Do a whole bunch of code cleanup.
2015-06-10 03:45:58 +00:00
rogerman 1648b5f74d Render3D:
- Hack: Fix bug where the overworld map in Dragon Quest IV wouldn't draw correctly. (Regression from r5191. Addresses bug #1477.)
2015-06-08 04:36:19 +00:00
rogerman 947adcd956 Video Filters:
- Add HQ3x and HQ3xS pixel scalers.
- Delete unused hq4x.h file.
2015-06-05 20:08:55 +00:00
rogerman fec691bd26 Render3D:
- Add the ability to set the size of the output framebuffer.
- Do some more code cleanup.
2015-05-20 23:39:43 +00:00
rogerman afba637244 Cocoa Port:
- Silence some compiler warnings.
2015-05-14 20:56:00 +00:00
rogerman 5215efe844 Windows Port:
- Fix compiling issue. (Regression from r5192.)
2015-05-11 18:35:08 +00:00
rogerman b41c194c10 GFX3D:
- The code cleanup continues.
2015-05-11 08:54:01 +00:00
rogerman 28d40ffcf5 GFX3D:
- Fix bug where the depth LUT wasn’t being generated correctly, causing the clear image depth buffer to malfunction. (Regression from r5187.)
- In SoftRasterizer, obsolete GFX3D_Zelda_Shadow_Depth_Hack for depth-equals tests. We’re now using a fixed tolerance of +/-0x200, according to GBATEK.
- In SoftRasterizer, z-depth is now calculated using the depth LUT instead of with << 9. This spreads the depth value more evenly across the range of [0 - 0x00FFFFFF]. This change will need additional testing.
- Do some small optimizations to SoftRasterizer.
- Do more code cleanup.
2015-05-10 23:38:35 +00:00
rogerman 9d6f284681 GFX3D:
- Do more code cleanup and refactoring.
2015-05-08 22:45:09 +00:00
rogerman dcbe28c94e Render3D:
- In SoftRasterizer, do multithreading optimization for the fog and edge mark pass. This involved a change to the edge marking algorithm, so this will need additional testing.
- Fix bug where a SoftRasterizer renderer object wouldn’t get destroyed properly. (Regression from r5187.)
- Fix bug where the user wasn’t able to switch between different threaded versions of SoftRasterizer. (Regression from r5187.)
- Fix a potential bug that might occur if an OpenGL renderer object failed to create. (Regression from r5188.)
2015-05-07 19:06:13 +00:00
rogerman c36b8cbebb Render3D:
- Get rid of annoying flickering when switching 3D renderers.
- More code cleanup and refactoring.
2015-05-07 05:49:53 +00:00
rogerman 0c0f968d01 Render3D:
- Do some code cleanup and refactoring.
2015-05-07 00:42:28 +00:00
rogerman f56e15da02 OpenGL Renderer:
- Upload the toon table through the render state UBO instead of through a 1D texture. (OpenGL 3.2 only.)
- Small optimization in the edge mark fragment shader.
2015-05-06 04:48:33 +00:00
rogerman c5350f6247 OpenGL Renderer:
- Remove even more extraneous binds.
- Do some misc. optimizations.
2015-05-05 23:58:38 +00:00
zeromus e527ed1e37 im tired of seeing the 2005 and 2008 projects. 2010 is the end of the line, the others arent needed 2015-05-05 03:59:27 +00:00
zeromus 6461b474bc apply patch from bug #1468 to fix vs2012 x64 building 2015-05-05 03:56:28 +00:00
rogerman 42a1f7b9f5 Windows Port:
- Fix compiling issues. (Regression from r5162. Fixes bug #1468.)
- Fix crashing issue when selecting the OpenGL 3.2 renderer. Failure to init should now fallback properly. (Regression from r5180. Fixes bug #1470.)
2015-05-04 22:52:32 +00:00
rogerman d5bb6fd79e Render3D:
- In the OpenGL renderer, do better handling of the geometry index buffer, and also load its data in OpenGLRenderer::BeginRender().
- In the OpenGL renderer, remove a bunch of extraneous binds.
- Fix bug in SoftRasterizer where clear-image depth wasn’t being written correctly. (Regression from r5176.)
- Reduce the buffer sizes in the core 3D engine.
- Do even more refactoring.
2015-05-04 18:30:09 +00:00
rogerman 7dd90c9948 OpenGL Renderer:
- Optimize the uploading of all rendering and polygon states, moving all state uploads to OpenGLRenderer::BeginRender(). (OpenGL 3.2 only)
2015-05-01 23:40:59 +00:00
rogerman 15f9d3ee6b OpenGL Renderer:
- Fix compiling for platforms that aren't OS X. (Regression from r5178.)
2015-04-30 16:48:01 +00:00
rogerman 80ac952e9e Render3D:
- In the OpenGL renderer, optimize framebuffer clearing (OpenGL v3.2 only).
- In SoftRasterizer, multithread the rendering state setup (requires at least 4 threads).
- Do more code refactoring.
2015-04-30 08:39:10 +00:00
rogerman 5c64a3858f Render3D:
- In the OpenGL renderer, optimize edge marking performance.
- In SoftRasterizer, fix a bug where edge marking and fog weren’t being drawn if multithreading was off.
2015-04-29 17:35:50 +00:00
rogerman 8f38fb38e8 OpenGL Renderer:
- Clear the stencil buffer with a value of 0 instead of with the polygon ID.
2015-04-29 09:14:32 +00:00
rogerman f48ed9fb89 SoftRasterizer:
- Refactor SoftRasterizer to use Render3D as the base class.
2015-04-29 04:50:23 +00:00
rogerman d627a5b6aa OpenGL Renderer:
- Fix bug where certain scenes would fail to draw when edge marking is enabled.
2015-04-28 00:39:48 +00:00
rogerman e89544aa7b OpenGL Renderer:
- Fix some more graphical bugs with fog and translucent fragments.
- Do some small optimizations to the fragment shaders.
2015-04-27 21:18:48 +00:00
rogerman ecc22fb24d OpenGL Renderer:
- Don’t output the depth to the secondary depth buffer if depth writing is disabled.
2015-04-25 19:07:54 +00:00
rogerman 74dbe2efdd OpenGL Renderer:
- Fix compiling for platforms that aren't OS X. (Regression from r5169.)
2015-04-25 03:08:20 +00:00
rogerman 398cd31bf3 Cocoa Port:
- In the 3D Rendering Settings panel in the DeSmuME Preferences view, move the Enable Edge Marking and Enable Fog checkboxes to the General Settings section.
- Update tooltips to reflect the new behavior.
2015-04-25 02:52:57 +00:00
rogerman d652249c34 OpenGL Renderer:
- Add support for edge marking.
2015-04-25 02:04:13 +00:00
rogerman 629da9c8e2 OpenGL Renderer:
- Fix compiling for platforms that aren't OS X. (Regression from r5166.)
2015-04-24 09:00:54 +00:00
rogerman f66287d0e0 OpenGL Renderer:
- Fix some graphical bugs with fog and translucent fragments.
2015-04-23 22:46:37 +00:00
rogerman 2ae84828e5 OpenGL Renderer:
- Add fog support.
2015-04-23 20:01:51 +00:00
rogerman 4fdcffa126 OpenGL Renderer:
- Do a bunch of code cleanup.
- Prepare the code for doing multipass rendering for the implementation of fog and edge mark.
2015-04-22 21:38:31 +00:00
zeromus db5b63fc2e fix vs2012 vcxproj 2015-04-18 16:17:49 +00:00
rogerman 21fce2cab0 OpenGL Renderer:
- Bring back vertex draw batching from r4522, fixing the bug that caused it to fail on Metroid Prime Hunters. This gives a small performance improvement for users with older drivers.
2015-04-16 21:55:57 +00:00
zeromus e0aa9eb56b update to fex github.com/kode54/File_Extractor/commit/e9e7560df9ca9b25348e0bfb4012f6e570711bb3
should fix new format RARs that dont work, but havent tested it
2015-04-15 06:04:46 +00:00
zeromus 66e314ec65 add a stdint for old visualstudios 2015-04-15 06:00:23 +00:00
zeromus c767066858 Merged revision(s) 5157-5158 from branches/release_0_9_11/desmume:
fix files missing from Makefile.am
........
oops this should probably be tabs
........
2015-04-14 23:57:20 +00:00
zeromus 7c7fd242c2 oops this should probably be tabs 2015-04-14 23:42:15 +00:00
zeromus d1e7a1ba41 fix files missing from Makefile.am 2015-04-14 23:41:43 +00:00
zeromus 6ca691914e png crunch 2015-04-14 22:58:23 +00:00
rogerman 0b4fd3cb5e OpenGL Renderer (v0.9.11):
- Backport changes from r5154 to the 0.9.11 branch.
2015-04-07 22:34:29 +00:00
rogerman e526546bc0 OpenGL Renderer:
- Remove all of the state caching code. Things actually run a little faster without it.
- Do a bunch of other code cleanup.
2015-04-07 22:26:39 +00:00
zeromus 4fe116b423 Merged revision(s) 5152 from trunk/desmume/src:
fix small mistake in r5121 that whacks all battery saves when making a savestate
........
2015-04-05 18:35:43 +00:00
zeromus 6af7350461 fix small mistake in r5121 that whacks all battery saves when making a savestate 2015-04-05 18:13:43 +00:00
rogerman 207c00df6b Cocoa Port:
- Update all info .plist files to v0.9.12 for future SVN builds.
2015-03-31 01:34:11 +00:00
zeromus e973f53e52 bump version number for trunk svn builds 2015-03-29 09:12:27 +00:00
zeromus 95ba5d8a97 clarify new version changelog 2015-03-29 09:11:11 +00:00
zeromus 5bfe553a8b set final revision in changelog 2015-03-29 09:10:03 +00:00
zeromus f6f1ba423a make 0.9.11 release branch 2015-03-29 09:08:22 +00:00
rogerman ccbf85ed42 Cocoa Port:
- Have SoftRasterizer’s Fragment Sampling Hack be disabled by default.
2015-03-29 01:14:03 +00:00
rogerman d5565bad72 SoftRasterizer:
- Do some code cleanup around GFX3D_TXTHack. Also make this check a little more robust.
2015-03-29 01:12:47 +00:00
zeromus 6697c7c0db fix nand more 2015-03-28 20:26:47 +00:00
zeromus c325eac5e3 winport - remove glitchy save type advanced menu thingy 2015-03-28 00:16:41 +00:00
zeromus 3289a3aecc clean formatting of r4800, messing up otherwise clean code 2015-03-28 00:10:53 +00:00
zeromus 6fadb2c07f improve previous commit 2015-03-28 00:05:29 +00:00
zeromus b79bd5fd33 fix " #1454 NAND games won't save " by continuing my sloppy fixes from r5052 and r5053 while also removing some of r4880 "optimize read/writes to NAND" since that kind of logic should be handled in the file IO layer even if it isn't now, otherwise the logic is too redundant and complicated spread around the codebase. In the future we need to evaluate using EnablePositionCache() on all the mc.cpp operations 2015-03-27 23:46:53 +00:00
rogerman 0161ced7ff OGLRender:
- When doing the depth buffer calculation, clamp the depth value to GL_DEPTH_RANGE {0.0, 1.0} in the fragment shader itself. Fixes 3D rendering on older drivers that won’t do the clamp for you. (Regression from r5133.)
2015-03-27 21:45:43 +00:00
rogerman 8a9295796d Documentation:
- Add one more note to the Cocoa port changes in ChangeLog.
2015-03-27 20:28:43 +00:00
rogerman 16bfa74d9f Documentation:
- Update release date for README.
- Update Read Me for Macintosh to reflect the current feature set.
2015-03-27 19:59:31 +00:00
rogerman 75bdce0942 OGLRender:
- Force cache alignment on the 5-bit LUT.
- Better localize OpenGL-specific LUTs.
2015-03-27 19:52:31 +00:00
zeromus e9b919d792 update changelog 2015-03-27 05:21:40 +00:00
rogerman 4031ee211a OGLRender:
- Revert depth buffer calculation change in r5133 for the z-buffer mode. Keep the w-buffer mode change, since that’s the one that works. Fixes the buttons in Blazer Drive. (Regression from r5133.)
2015-03-26 11:01:27 +00:00
rogerman 69ec85e624 OGLRender:
- Fix depth buffer calculations. Fixes lots of graphical glitches in “Harry Potter and the Order of the Phoenix” and many other 3D rendering cases.
2015-03-26 10:30:44 +00:00
rogerman 9b2d36df0c GFX3D:
- Do workaround for possible NaN comparisons being done when Y-sorting. (Addresses bug #1461.)
2015-03-26 09:49:56 +00:00
rogerman 2fc39e3c3e Documentation:
- Note Cocoa port changes in the ChangeLog.
2015-03-25 06:12:03 +00:00
zeromus 61df0246e6 add comments about y-sorting 2015-03-25 06:04:23 +00:00
rogerman 3a747f85ce GFX3D:
- Fix bug where 4x4 compressed textures in Mode 2 would mix the incorrect colors. (Regression from r5128.)
- Do some minor code cleanup.
2015-03-25 03:48:15 +00:00
rogerman 59d33fddb7 GFX3D:
- Fix texture coloring bugs with 4x4 compressed textures on big-endian systems. (This should be the last of the texture coloring bugs.)
- Do small optimization to 4x4 compressed texture conversion.
- Do some minor code cleanup.
2015-03-23 20:58:37 +00:00
rogerman b253fc44a7 Video Filters:
- Do some minor code cleanup on the xBRZ filter.
2015-03-23 17:52:33 +00:00
rogerman 4db72d4254 Cocoa Port:
- Fix bug when using dual display mode with a screen separation where the displays could mistakenly draw ghost lines at the top or bottom of each screen. (Partially addresses bug #1435.)
2015-03-23 07:57:18 +00:00
rogerman f0e8760dc4 Cocoa Port:
- Fix compiling when using Xcode 3.
- Don’t set the output frame size with multiple glViewport() calls per frame. Just set it once for the output.
- Do some minor code cleanup.
2015-03-21 21:18:00 +00:00
rogerman b906b233c5 Cocoa Port:
- Fix bug where the user can force activate the mic while the emulator is idle by manipulating its mute control.
- Fix bug where the mic icon remains black if the emulator resets while in execute.
- Further optimize mic icon updates.
2015-03-20 08:48:40 +00:00
rogerman 3088fd581e Cocoa Port:
- Run the Display Preferences preview inside a single-buffered context.
- Do some minor code cleanup.
2015-03-20 07:42:13 +00:00
rogerman 1674170370 mc.cpp:
- Handle the case where the EMUFILE size is less than the DeSmuME footer size. Allows an in-memory BackupDevice to work with NAND flash saves.
2015-03-19 22:06:26 +00:00
rogerman 3331fb1890 Windows Port:
- Fix crashing bug where the app would crash if the SaveRam path is invalid or does not allow for read/write access. (Fixes bugs #1394 and #1426.)
- New behavior: If the SaveRam path is invalid or does not allow for read/write access, warn the user. After the warning, continue emulation as normal.

mc.cpp:
- Allow backup memory to operate inside RAM if read/write file access is unavailable.
2015-03-19 01:50:15 +00:00
rogerman bfe105a188 GFX3D:
- Workaround a bug specific to GCC v4.9 where allocating the VERTLIST blocks would cause a std::bad_alloc exception. (Fixes bug #1438.)
2015-03-18 03:25:14 +00:00
rogerman 5bab1a14f3 Windows Port:
- Fix bug where using the 5xBRZ filter through the DirectDraw HW/SW display method would cause a crash. (Fixes bug #1444.)
2015-03-15 22:40:29 +00:00
rogerman 0ac489ade1 Cocoa Port:
- Fall back to using a legacy OpenGL context if the GPU driver rejects initializing a 3.2 Core Profile context.
2015-03-15 06:46:49 +00:00
rogerman d59ead2b51 Cocoa Port:
- Update UI tooltips to reflect current knowledge of DeSmuME’s behavior.
- Move the 3D Rendering Settings tab in DeSmuME Preferences from Display to Emulation.
2015-03-14 21:11:40 +00:00
rogerman 60d0726a2a Cocoa Port:
- Fix bug where the mic level value wasn’t being displayed correctly on OS X v10.5 Leopard.
- Remember the sound output volume setting between app launches.
2015-03-12 23:01:00 +00:00
rogerman e3fdd8f7f2 Cocoa Port:
- Update copyright year.
2015-03-11 07:28:15 +00:00
rogerman 2cee9a1eb9 Cocoa Port:
- Fix bug where the frame wouldn’t update itself when starting/stopping GDB stub, frame advance, or frame jump under certain conditions.
2015-03-11 06:36:33 +00:00
rogerman af1c434727 Cocoa Port:
- Fix bug where the mic level thresholds were based on the peak value instead of the average value.
2015-03-11 04:55:24 +00:00
rogerman 76b9689bf2 Cocoa Port:
- All display window settings panels now show the window number of the corresponding display window.
2015-03-11 03:45:51 +00:00
rogerman e893c4eab5 Cocoa Port:
- Include SoftRasterizer’s Fragment Sampling Hack setting in the troubleshooting report.
- Misc. UI changes/fixes.
2015-03-10 19:41:04 +00:00
rogerman fa4d2cb58f Cocoa Port:
- Add the Microphone Settings panel for easier control and more verbose info. The new panel also allows the user to change and monitor mic settings without needing a display window's status bar.
- Implement a more proper mic level UI that reports the level per frame instead of per sample. This should improve UI performance.
- Make all methods in the CocoaDSControllerDelegate protocol optional and remove all related protocol methods from the OpenEmu plug-in.
- Try attaching a new hardware input device on startup.
- Remove debug printf stuff when attaching a new hardware input device. The new Microphone Settings panel makes the extra printf stuff unnecessary.
- Remember the hardware mic mute setting between app launches.
2015-03-10 08:53:59 +00:00
rogerman d0ec648952 Cocoa Port:
- Fix some UI bugs with mic level checks where the mic status icon wasn't showing the correct color under certain conditions.
- Fix UI bug where the mic mute control wasn't being respected under certain conditions.
- The mic status icon now includes a tooltip that reports the name and sample rate of the current input device.
- Handle mic hardware state changes more gracefully when the input device is changed externally.
2015-03-09 21:49:22 +00:00
rogerman 381324ca09 Cocoa Port:
- Add full support for using hardware microphones on the host machine for emulating the NDS microphone. Finally, mic driven games, such as Nintendogs, are fully playable on the Mac!
- Display windows no longer include an output volume slider directly in the status bar. Instead, the slider has been moved inside a popup button, which now behaves just like OS X's volume menu. This was done for better space efficiency.
- Display windows now include a microphone icon alongside the output volume icon. Like the output volume, there is a slider control to adjust microphone gain and also a mute control.
- The microphone icon changes color depending the microphone's state (as seen by the NDS, not the host).
- Replace the existing microphone icon with one that looks better and is more modern.
- Adjust the size of the output volume icon from 20x20 pixels to 16x16 pixels.
- Fix yet another font rendering bug in the Input Profile viewer on OS X Yosemite.
2015-03-08 09:41:19 +00:00
rogerman 64ea7591ab Cocoa OpenEmu Plug-in:
- Update to SDK v1.0.4.
- Change the SPU sync method to N-method.
- Fix bug where the enable state of cheats could not be toggled.
2015-02-25 05:50:15 +00:00
rogerman 7d87434a21 Cocoa Port:
- Max out the core emulation thread's priority. This improves the overall timing accuracy of the emulator.
2015-02-24 21:33:11 +00:00
rogerman df96846915 Cocoa OpenEmu Plug-in:
- Fix compiling issue.
2015-02-21 20:37:55 +00:00
rogerman 83578add74 Cocoa Port:
- Completely revamp the ROM Info panel to have a more modern and mainstream look and feel.
- The ROM Info panel can now be resized and scrolled through.
- Each individual info section in the ROM Info panel can now be expanded or collapsed.
- Fix bugs where the ROM capacity and ROM used capacity info weren't being calculated correctly.
- Do a bunch of random UI text clipping fixes when running on OS X Yosemite.
2015-02-20 22:18:08 +00:00
rogerman 06ece0cb07 Cocoa Port:
- Do a major revamp of the File Migration Assistant. It has been renamed "Game Data Migration Assistant". All following notes will pertain to the new Game Data Migration Assistant.
- Files no longer appear in a single list. They are now organized by app version and file type.
- Users can now select multiple files at once by clicking the checkbox of their corresponding app version or file type.
- File selection is much smarter. If the same file exists in multiple versions, then if the user selects one version of a file, all other versions of that same file are automatically deselected. This also works in multiple selection cases.
- Remove the Select All and Select None buttons. With the smarter selection UI, these buttons are no longer necessary.
- Provide better user feedback when no files need to be migrated.
- Rework the outline view to be more space efficient.
2015-02-18 05:48:25 +00:00
rogerman 634d1ba89b Cocoa Port:
- Fix font rendering weight of the Input Preferences view when running on OS X Yosemite.
2015-02-17 19:52:44 +00:00
rogerman 697c91d99a Cocoa Port:
- Fix bug where changing a display window's pixel scaler while in Touch mode would sometimes cause a crash.
- Do some minor code cleanup.
2015-02-15 09:00:45 +00:00
rogerman cfb408d63b Cocoa Port:
- Fix bug where switching between CPU-based and GPU-based filters in the DeSmuME Preferences display preview would sometimes fail.
- Fix bug where the DeSmuME Preferences display preview would show incorrect colors when using a CPU-based filter on PowerPC Macs.

Video Filters:
- Fix bug where the Scanline filter would show incorrect colors on big-endian systems.
2015-02-15 02:14:29 +00:00
rogerman 5254d7143a Cocoa Port:
- Fix some compiling issues if the C++ standard library is set to libc++ w/ C++11 support instead of libstdc++.
- Fix some compiling issues if compiling on OS X Leopard w/ Xcode 3.1.4.
2015-02-14 02:26:02 +00:00
rogerman d83b1a260c Cocoa Port:
- Fix another freeze on app exit when running on OS X v10.5 Leopard.
2015-02-12 09:02:04 +00:00
rogerman 782447e115 Cocoa Port:
- Fix the behavior of the Display Preferences filter preview.
- Fix an intermittent crash that sometimes occurs when creating a new display window.
- Fix a rare and mysterious crashing bug that sometimes occurs when initializing the HQ4x LUT.
2015-02-11 12:03:47 +00:00
rogerman afa4d57545 Cocoa Port:
- Fix a longstanding bug where audio frames were accidentally getting dropped when using N-sync and Z-sync methods. Greatly improves the audio quality of the N-sync method.
- Now that N-sync actually works as intended, it is now the default sync method. (N-sync has much better latency compared to the other sync methods, especially compared to P-sync, which was the previous default.)
- Update sync method tooltips to better reflect their actual behavior.
- Fix UI bug where the Advanced SPU Logic control text would get truncated on OS X Yosemite.
2015-02-11 01:47:31 +00:00
rogerman 2ff7821e85 Cocoa Port:
- Update the SLOT-1 Manager UI to be more consistent with the SLOT-2 Manager.
- Add some more options to the SLOT-1 Manager's ROM action menu.
2015-02-08 05:44:47 +00:00
rogerman a8ef76f07b Cocoa Port:
- Store the HQnx LUTs on the heap instead of on the stack. Fixes app builds from the Xcode 3 project, where the default stack size is smaller than when using the latest Xcode. (Regression for r5087.)
- Update Xcode 3 project so that builds actually work. (Regression from r5070.)
2015-02-06 19:40:41 +00:00
rogerman 453baff89c Cocoa Port:
- Refactor the OpenGL blitter to work with 3.2 Core Profile contexts.
- Simplify some of the init code.
2015-02-05 21:36:13 +00:00
rogerman baeb5313d2 Cocoa Port:
- Add shader-based equivalents to the following pixel scalers: 2xBRZ, 3xBRZ, 4xBRZ, 5xBRZ. (And yes, these are exact GLSL ports of Zenju's xBRZ scalers, not Hyllian's xBR scalers. These shaders are very demanding on your GPU, so users with older GPUs may want to continue using the CPU-based versions instead.)
- Add a preliminary GPU tiering system to help detect GPU capabilities and allow for better optimizations to be used on newer GPUs.
- Do some optimizations to the following shaders: Bicubic B-Spline, Bicubic Mitchell-Netravali, Lanczos3, EPX.
- Change the shader-based EPX+ color comparisons to be more true to the original CPU-based algorithm.
- Improve color blending on the Deposterize shader.
2015-02-04 01:22:13 +00:00
zeromus f0bef635c2 try to fix some winport joystick hotkey bullcrap for >1 attached joysticks 2015-02-02 19:16:34 +00:00
rogerman 928004e13e GFX3D:
- Fix possible invalid memory access crashes when Y-sorting, most notably, in Super Mario 64 adventure mode. Using std::stable_sort() instead of std::sort() should have little to no performance impact since we're not sorting a lot of elements here. (Regression from r2436.)
2015-01-26 19:46:34 +00:00
rogerman 3abfa637b4 Cocoa Port:
- Initialize the HQnx LUTs only once, instead of doing it per display window.
- Fix issue where the HQnx LUT init code was causing extremely long compile times. (Regression from r5087.)
2015-01-26 05:22:43 +00:00
rogerman c233b1c14f Cocoa Port:
- Add shader-based equivalents to the following pixel scalers: LQ2x, LQ2xS, HQ2x, HQ2xS, HQ4x, HQ4xS
2015-01-25 01:43:37 +00:00
rogerman 1041fe8e3a Video Filters:
- Fix bug where the LQ2xS pixel scaler was using the same code as LQ2x.
- Change LQ2xS brightness thresholds so that LQ2xS actually works as intended.
2015-01-23 18:34:51 +00:00
rogerman 9849a88269 Cocoa Port:
- Fix bug where using Deposterize with a CPU-based pixel scaler would make the video fail to update. (Regression from r5083.)
2015-01-21 02:53:45 +00:00
rogerman 81772f1906 Cocoa Port:
- Oops! Missed some files that should've been committed in r5083. (Regression from r5083.)
2015-01-21 02:15:38 +00:00
rogerman d880c58f75 Cocoa Port:
- Read the GPU_screen buffer directly and avoid making multiple copies of it. Improves performance when many display windows are used.
2015-01-21 02:09:59 +00:00
yki 245586a978 gtk-glade port: Added gdbstub_mutex_init() and destroy() to src/gtk-glade/main.cpp. Now it should be in all ports. 2015-01-17 21:38:06 +00:00
rogerman 6724ce53e3 Cocoa Port:
- Fix crashes from illegal memory accesses when a display window is set to Touch mode. (Regression from r5079.)
2015-01-17 19:51:04 +00:00
yki e714ce9e20 GDB stub:
- Added CPU mutex functions gdbstub_mutex_init/destroy/lock/unlock, which govern access to NDS_ARM9 and NDS_ARM7 structs.
- Added locking and unlocking of the mutex to gdbstub.cpp/processPacket_gdb() and NDSSystem.cpp/NDS_exec()
Cocoa, CLI, GTK, Windows ports:
- Added mutex initialization and destruction to main() functions (cocoa/cocoa_core.mm, cli/main.cpp, gtk/main.cpp, windows/main.cpp)
2015-01-17 15:37:33 +00:00
rogerman 0754569c17 Cocoa Port:
- Have video from CPU-based pixel scalers transfer to GPU via DMA. Should improve performance on pixel scalers with large scaling sizes, such as HQ4xS and 5xBRZ.
2015-01-17 00:53:25 +00:00
rogerman 9329a961f2 Video Filters:
- Add method VideoFilter::SetDstBufferPtr() - allows users to use their own destination buffer instead of having to use the VideoFilter object's internal buffer.
2015-01-17 00:16:29 +00:00
rogerman 433d263b4e Qt Port:
- Fix compiling issues. (Regression from r5068.)
2015-01-16 22:06:11 +00:00
zeromus 37ee317415 clean up sleep hack 2015-01-15 21:48:27 +00:00
rogerman d0aeee71dd Cocoa Port:
- Fix GDB stub functionality in the optimized dev+ build.
2015-01-15 01:18:33 +00:00
rogerman 7b096b400f Glade Port:
- Fix compiling issues. Updates to latest code structure changes. (Regressions from r1031, r5061, r5068.)
2015-01-14 21:02:00 +00:00
rogerman aef36c1949 Cocoa Port:
- Silence some compiler warnings.
- Do some tiny code cleanup.
2015-01-13 05:17:39 +00:00
rogerman acc22b29cb Cocoa Port:
- Fix Latest build. (Regression from r5070.)
2015-01-13 05:10:29 +00:00
rogerman 402434fe19 Cocoa Port:
- Delete the Legacy Cocoa port. (Not only was the Tiger build broken in several ways, but all features from the Legacy port have been subsumed into the main Cocoa port now. Therefore, the Legacy port is no longer necessary.)
- Remove the "Xcode 4" and "Xcode 5" project files. These files have been superseded by the one project file "Xcode (Latest)".
2015-01-13 04:15:07 +00:00
rogerman 3e96459aea Cocoa Port:
- Fix building for the OpenEmu Plug-in build target.
- Enable PGO. (Xcode 6 and later only.)
- Do some misc. build tweaks.
2015-01-13 03:52:49 +00:00
rogerman 8fefb4fb7a Core:
- Do a massive cleanup of the #include and header structure.
- Remove a lot of unnecessary dependencies in the headers.
- Make headers responsible for including what they need for themselves. This makes the headers more independent of where they are in the #include order.
- Relocate some structs/classes to more logical locations.
- Clean up some platform-specific #ifdef stuff.
2015-01-10 02:04:18 +00:00
rogerman d5ab656090 GTK Port:
- Fix compiling issue. (Regression from r5061.)
2015-01-04 21:18:48 +00:00
rogerman bf413dc443 Windows Port:
- Fix compiling issue. (Regression from r5065.)
2015-01-04 05:46:27 +00:00
rogerman 9273aa58cd GDB Stub:
- Fix bug where set breakpoints were being ignored. (Regression from r5061.)
- Do some more cleanup on the GDB stub init code.
2015-01-04 04:45:53 +00:00
rogerman a987ce8ad2 CLI Port:
- Fix compiling issue. (Regression from r5061.)
2015-01-02 22:31:08 +00:00
rogerman c0a710fadb Windows Port:
- Fix compiling issue. (Regression from r5061.)
2015-01-02 09:48:39 +00:00
rogerman 5b9061264b Cocoa Port:
- Oops! Needed to add the .xcscheme files to the Xcode projects. Fixes build issues from r5061.
2015-01-02 09:11:01 +00:00
rogerman 32d9abebbc Cocoa Port:
- Add a new developer-oriented build scheme called "OS X App; dev+" to the Xcode4 and Xcode5 projects.
- Add preliminary GDB stub support to the dev+ build. (Use the menu option Tools > Show GDB Stub Control.)

GDB Stub:
- Do some minor cleanup on the GDB stub init code.
2015-01-02 09:08:50 +00:00
zeromus b7273762fb windows - rename Zup and Zdown to Z+ and Z- and straighten them out 2014-12-17 21:17:01 +00:00
zeromus 64ce4799fd add a vs2015 sln and stuff, but it only uses the vs2010 toolset. thats the lazy way. works ok though. 2014-12-15 03:33:37 +00:00
rogerman 878649a0a8 Cocoa Port:
- Remove the extra mutex from NDS_exec() in the main emulation loop. Have all consumers use the rwlock instead.
2014-11-27 05:36:45 +00:00
rogerman f17312c91d GFX3D:
- Clean up magic numbers related to the 3D framebuffer size.
2014-11-26 23:17:34 +00:00
zeromus fb2e4730e3 revert r5043. this revision quite unexpectedly broke about 8000 games. 2014-11-24 20:38:58 +00:00
rogerman 588744d323 Video Filters:
- Update XBRZ filters to v1.1 (thanks Zenju!) Addresses feature request #160 - https://sourceforge.net/p/desmume/feature-requests/160/
2014-11-19 23:00:19 +00:00
zeromus 16f9140960 fix regression within past 2 commits of launching any game from firmware 2014-09-16 04:42:38 +00:00
zeromus 66e6ba9497 improve previous commit, which was just plain buggy. now card is detected again. but... the game crashes when trying to boot. 2014-09-16 04:30:55 +00:00
zeromus dd13e33401 fix obvious crashy bug in NAND cards when booting from firmware, but for some reason the card isn't detected still. 2014-09-16 03:53:58 +00:00
zeromus b781234576 fix bug loading gba roms with no .sav file (fixes bug #1431) 2014-09-14 17:36:25 +00:00
zeromus 6ab5ff5917 savestate gamecode printing was endian-wrong 2014-09-05 03:28:08 +00:00
zeromus 51e478e66a fix bugs from r4926 (off-by-one error in out-of-range rom-reading check). possibly broke the last u32 in the rom. fixes bug #1406 (phantasy star 0 CHS translation black screen freeze) 2014-09-01 23:20:20 +00:00
zeromus e24720f69d apply patch #164 to screenshot path building format 2014-08-21 16:17:21 +00:00
normmatt234 b95380054e Fix Action Replay DS code type 0xE (Patch #163) 2014-08-17 06:57:10 +00:00
zeromus 204e9b46e5 block reading of BGxHOFS and BGxVOFS registers. fixes some ratatouille stages 2014-08-10 04:42:33 +00:00
zeromus bbc1517cc8 fix ancient errors in instruction decode table created by r3504 and r3510. not known to fix anything, but might be hg/ss related. 2014-07-30 22:20:25 +00:00
zeromus dabca07a9e add comments to instruction_tabdef.inc to salvage r3504 which modified the formatting as well as the contents 2014-07-30 20:56:43 +00:00
zeromus 0c54127f59 fix #1134 - american girl games (need system jamming when sending 3d commands with pending flush)
TODO - check #1428 (reportedly it affects PMD somehow)
2014-06-17 05:46:49 +00:00
alvinwong fca4afd7ce Fix file seeking of gba ROM and fix seeking behaviour of EMUFILE_FILE 2014-05-26 09:50:11 +00:00
zeromus 262fc4f14a apply alvinhochun's gbagame patches
--- 
add system in EMUFILE_FILE to switch correctly between read/write modes; add system in EMUFILE_FILE to (optionally) track current file position and avoid redundant fseeks - this code is UNTESTED.
 --- 
add better console feedback when gbagame .sav is being scanned, to make developers less likely to think the emulator is frozen
2014-05-26 06:23:56 +00:00
thelemonman fc6930c2e1 Fix JIT profiler compilation on linux 2014-05-03 15:52:20 +00:00
thelemonman 23955ff791 Remove the useless include 2014-04-23 18:16:20 +00:00
thelemonman 85c1c3c39d Acquire an OGL3.2 core profile when available 2014-04-23 18:14:20 +00:00
thelemonman f4cf398962 Fix the include guard 2014-04-23 09:53:05 +00:00
thelemonman 03edf63c31 Backport the w-buffer fix to the OGL 3.2 renderer. Delete the useless and misleading third copy of the same shaders. 2014-04-19 07:16:16 +00:00
thelemonman ce96c060f5 w-buffer support for OGL renderer. Remove the broken and silly i965 hack. 2014-04-18 17:14:13 +00:00
rogerman f02a1e83ee Cocoa Port:
- Fix bug where video filters weren't preferring to use the GPU by default.
- Display threads now each pull a copy of the video frame from the emulation thread, rather than the emulation thread pushing copies of the video frame to each display thread. (Slight performance improvement when many display threads are used.)
2014-04-13 00:23:52 +00:00
zeromus 608b9b3986 overhaul GXFIFO again, maybe better this time. 2014-04-06 01:44:49 +00:00
zeromus ef212121bf win32-apply patch #156 Win32:Expose AntiAliasing in 3D settings 2014-04-05 01:18:01 +00:00
zeromus a51fb22a40 overhaul GXFIFO packed-command handling to more closely resemble a reasonable hardware behaviour. this is unlikely to have fixed anything, since previous revisions had somehow smashed their way through most of the bugs; however, the previous revision did have a tiny potential bug which might have been fixed by this (array out of bounds access). the code is so pretty now, I think it must be right, but there's a chance that I have created a new bug. 2014-03-30 21:32:53 +00:00
rogerman 2873d83de4 Core:
- Fix some graphical glitches on big-endian systems.
- Do some minor code cleanup.
2014-03-25 22:17:02 +00:00
rogerman db358049b9 Cocoa Port:
- Do a huge refactor of the display code.
- Add support for shader-based filters.
- New feature: The display pipeline has been separated into three parts - Source --> Pixel Scale --> Output. Different sets of filters may be applied to each part of the pipeline.
- Add the following source filters: Deposterize
- Add the following output filters: Bicubic (B-Spline), Bicubic (Mitchell-Netravali), Lanczos2, Lanczos3.
- Add shader-based equivalents to the following pixel scalers: Nearest 2x, Scanline, EPX, EPX+, Super Eagle, 2xSaI, Super 2xSaI. These will be used instead of the CPU-based scalers if "Run filters on GPU if possible" is enabled (default is enabled).
- Remove the following pixel scalers from the UI: Nearest 1.5x, Nearest+ 1.5x, Bilinear 2x, EPX 1.5x, EPX+ 1.5x. The reasoning behind this is because these pixel scalers aren't necessary due to the automatic sizing of display view to window. Also, the new output filters make it so that running similar pixel scalers along with an output filter will always yield superior results.
2014-03-24 18:19:11 +00:00
alvinwong d16070ecb4 Qt: Implement control config dialog. 2014-03-20 15:09:28 +00:00
alvinwong 83ebb04cc2 Qt:
- Add fps counter
- Minor code cleanup
- Linux: DEFINES cleanup
2014-03-18 13:19:23 +00:00
alvinwong f09b93c62a Set eol style on Qt frontend files 2014-03-18 05:26:44 +00:00
alvinwong 9fdb1d26bb Initial Qt frontend code commit. 2014-03-18 05:14:22 +00:00
rogerman 73f44f0aeb Video Filters:
- Do some minor code cleanup.
2014-03-15 17:48:54 +00:00
rogerman dca852468c Cocoa Port:
- Fix intermittent freeze on app exit when running on OS X v10.5 Leopard.
2014-03-14 21:27:42 +00:00
alvinwong 2b3198e392 Linux: Fix compilation errors if HUD support not enabled 2014-03-13 12:32:34 +00:00
alvinwong 5c3c1f14d9 Linux (gtk): Actually change filter when loading options. 2014-03-08 10:23:35 +00:00
alvinwong 84460eeb5a Linux (gtk): Remove an unused option. 2014-03-08 08:39:13 +00:00
alvinwong 3f9de84fb1 Linux (gtk): Add option saving. 2014-03-08 08:34:31 +00:00
zeromus 8de0c23924 dont crash if save/loadstating 0 bytes of backup memory 2014-03-06 14:47:16 +00:00
alvinwong b7e996218b Linux (gtk): Change pause/resume to Pause button. 2014-03-06 14:15:06 +00:00
alvinwong 34b9cf1c0f Linux (gtk): Initialize VideoFilter with the number of CPU cores instead of hard-coded to 4 threads. 2014-03-06 08:01:45 +00:00
rogerman 560b23103c Video Filters:
- When using multiple threads, ensure that all lines are accounted for when the line count isn't evenly divisible by the thread count.
- Add static method VideoFilter::GetAttributesByID().
- Reallocating the destination buffers now uses its own method. Reverts the changes from r5000.
- Prepare the code for the use of multi-pass filters.
2014-03-05 18:20:00 +00:00
rogerman e23beb8630 Cocoa Port:
- Fix building of the Legacy project.
- In the Legacy and Xcode 3 projects, make the default C language GNU99.
2014-03-05 04:47:34 +00:00
rogerman 4d50b396dd Cocoa Port:
- If a video filter is used, upload textures in BGRA8888 instead of RGBA8888 format.
- Do some cleanup of the OpenGL display code.
2014-03-05 04:26:08 +00:00
rogerman 48f20e49f7 Cocoa Port:
- Fix intermittent bugs with loading user defaults on app startup.
2014-03-04 18:49:51 +00:00
alvinwong 11ff936fa1 Linux (cli): Fix HUD rendering (regression in [r5004]). 2014-03-04 10:07:33 +00:00
alvinwong 2ac5065fb4 Linux (gtk): Run video filter before fps limiter to make better use of time (and hopefully more accurate frame timing...). 2014-03-04 04:28:41 +00:00
alvinwong 037cf4e065 Linux (gtk): Clear screen after reset. 2014-03-03 08:50:33 +00:00
alvinwong 443cef56be Change a few places to use DESMUME_SAMPLE_RATE instead of hard-coding 44100. 2014-03-03 08:36:08 +00:00
alvinwong 6b8a1b979b NDSSystem.cpp:
- "Fix" opening ROM files of unknown file extension.
- Fix buffer overflow when last character of ROM game code is not a recognized country code.
- Add country code Chinese (iQue DS).
2014-03-01 14:39:37 +00:00
alvinwong 12f5776a3f Linux (gtk):
- Add HUD editor mode.
- Small changes.
2014-03-01 07:53:24 +00:00
zeromus 9295bb5f73 set eol-style on aggdraw.cpp 2014-03-01 06:21:33 +00:00
alvinwong 041941876d Linux (gtk):
- Don't render HUD directly to gpu screen.
- Redraw display for some operations which updates HUD display.
- Make HUD aware of swapped screen and/or single screen.
2014-03-01 06:13:30 +00:00
alvinwong 8b8e7b1648 Linux (gtk):
- Fix possible stack overflow if video filter resolution is high enough.
- Fix not being able to toggle HUD when paused.
- Fix HUD 3d fps display when there is frameskip.
2014-02-28 15:33:26 +00:00
alvinwong 2fe8cb330d Linux (gtk):
- Remove gtk pixbuf usage on drawing DS screens, use only Cairo.
- Use transformation matrix to handle touchscreen coordinates.
- Adapt RGB555-to-RGBA8888 conversion code from Cocoa port, should result in brighter colour.
- Re-enable fullscreen menu item on start.
2014-02-28 07:52:39 +00:00
rogerman 4fec0a060e Cocoa Port:
- 16-bit to 32-bit color space conversions no longer darken images.
2014-02-27 05:56:32 +00:00
alvinwong e9da2c318c Video Filter:
- When changing source image size, force the construction of a new buffer. Fixes [bugs:#1384] introduced in [r4987].
2014-02-26 14:32:01 +00:00
alvinwong 4e5b6e6d6f Linux (gtk, glade, cli):
- Add control for Lid (defaults to Backspace).
- Disallow Left+Right or Up+Down, acts like Windows port.
- Show correct button state on HUD.
2014-02-26 11:29:53 +00:00
alvinwong fed37e55d3 Windows:
- Fix a possible (but slim) buffer overflow caused by the usage of sprintf.

Linux (gtk):
- Show error instead of warning if --enable-hud is configured but libagg not found.
- Change F10 to use savestate slot 0 instead of 10.
- Show savestate time on savestate menu.
- Change startup window size back to resizable.
2014-02-26 09:52:06 +00:00
alvinwong ae36159259 Linux (gtk): Add fixed window size options. 2014-02-25 14:13:40 +00:00
zeromus 513370ca21 fix bug that made 5x filters crash in windows 2014-02-22 20:48:14 +00:00
rogerman 823d99c73a task.cpp:
- Have CPU core detect on OS X use sysctl() instead of sysconf().
2014-02-21 21:15:25 +00:00
alvinwong 76732a03ed Linux (gtk): Add sound interpolation option. 2014-02-20 13:58:00 +00:00
alvinwong f71fe6e108 Linux (gtk): Fix foolish typos. 2014-02-17 05:36:24 +00:00
alvinwong 6f91e947c3 Linux (gtk): Add preliminary AV recording with x264 and flac. 2014-02-17 04:02:42 +00:00
rogerman a15e6cee10 Video Filters:
- Have the Bilinear filter use the same SSurface struct as all the others.
2014-02-15 20:35:54 +00:00
rogerman 98713caf4b Cocoa Port:
- Fix potential crashing bug when changing the video filter from None to a different video filter with 1x scaling.
2014-02-15 06:40:55 +00:00
rogerman def065be97 Video Filters:
- Fix compiling of videofilter.cpp if compiled on Windows.
2014-02-14 01:09:30 +00:00
rogerman 9d44ca55f6 Video Filters:
- Have the xBRZ filter handle the alpha channel.
- Minor code cleanup of video filter managing code.
2014-02-13 23:30:01 +00:00
rogerman 9a642be896 Video Filter:
- When changing filters, skip the costly construction of a new destination buffer if the new surface size will be the same.
2014-02-13 04:49:00 +00:00
rogerman d1c6c6e3ac Cocoa Port:
- On startup, expand all items in the Input Preferences control list by default.
2014-02-13 02:43:08 +00:00
rogerman cf109b69dd Cocoa Port:
- Add SoftRasterizer hack from r4984.
- Update UI to reflect the current feature set.
- Do some code cleanup.
2014-02-10 07:14:05 +00:00
zeromus 443b24cac2 apply patch #159 from tracker to add hack for softrasterizer text rendering improvement in some games 2014-02-09 08:28:48 +00:00
alvinwong fd3b89bac2 Linux (gtk): Minor change to HUD toggle code 2014-02-09 08:17:51 +00:00
alvinwong 04d0faa240 Linux (gtk):
- Add HUD display toggle menu (require --enable-hud on configure)
- Reorganize menu items to be more alike the Windows port
- Change fullscreen hotkey to F11
- Change default video filter to None (user can still switch via menu)
2014-02-09 08:11:33 +00:00
alvinwong 249059e9c0 Linux (gtk):
- Fix DesMuME name case inconsistency
- Make title and status bar more informative in some situations
2014-02-08 15:23:09 +00:00
rogerman 2a85d684eb Cocoa Port:
- Disable replay related UI elements whenever a ROM is not loaded or if the save state sheet is shown.
2014-02-08 03:32:45 +00:00
rogerman f2cd7ad4b0 Cocoa Port:
- Add preliminary replay support.
2014-02-07 21:40:21 +00:00
alvinwong 74b7993d1a Linux (gtk): Fix screen gap bug 2014-02-07 14:13:08 +00:00
alvinwong 675e3424b3 Linux (gtk):
- Rewrite fps limiter and frame skipping code.
- Decrease EmuLoop priority to force screen redraw at maximum rate.
- Add menu option for fps limiter.
- Support boost button.
- Force disable Ubuntu's global menu.
2014-02-07 09:18:01 +00:00
alvinwong 895be3efec Linux (gtk):
- Support xBRZ filters (and fixed build error)
2014-02-07 08:17:53 +00:00
zeromus 0bcf4eaf59 actually make the filters work in windows 2014-02-07 07:44:22 +00:00
squall-leonhart 73bc032c1c just adding a couple of files missing from the VS2010 project file 2014-02-07 06:57:54 +00:00
zeromus c76469cbc1 update vcproj with xbrz files 2014-02-07 04:41:25 +00:00
rogerman 875ae2cc4b Video Filters:
- Add new xBRZ family of filters.

Cocoa Port:
- Refactor all display code. OpenGL code is pushed to a lower level and filter code is pushed towards the UI level.
- Add support for the new xBRZ filters.
- The Execution Control panel no longer always appears on app startup.
2014-02-07 04:34:32 +00:00
rogerman 2c3db349c3 Cocoa Port:
- Don't completely block output threads when they are set to idle, since we need to assume that messages will be passed to them at any time. It seems like NSRunLoop is smart enough not to unnecessarily wake the CPU on idle, so the thread block was not necessary.
- Fix bug where user settings were not being applied while the emulator was paused. (Regression from r4970.)
2014-02-05 19:38:39 +00:00
rogerman 9f6f8c1cfd Cocoa Port:
- Optimize the emulator idle state to achieve 0% CPU usage. This greatly reduces the app's energy usage when the emulator is idle.

Cocoa Port (OpenEmu Plug-in):
- Remove some dependencies needed to compile the OpenEmu plug-in.
2014-01-31 08:31:20 +00:00
rogerman 8e3198436b Cocoa Port:
- Update status text when the autohold state changes.
2014-01-31 03:28:37 +00:00
rogerman 491a978f31 Cocoa Port:
- Add support for .dss Action Replay save files.
2014-01-31 02:08:33 +00:00
rogerman 7fa5f7763e Cocoa Port:
- The input handler now supports autohold.
- NDS inputs in the input handler now support turbo.
2014-01-31 01:30:52 +00:00
rogerman 71c196b920 Cocoa Port:
- Fix building when using the Xcode 5 project. (Regression from r4965.)
2014-01-29 18:04:20 +00:00
rogerman 47b2b6eac6 Cocoa Port:
- Add controls for frame advance, frame jump, and display mode toggle.
- Add new execution control panel. (Emulation > Show Execution Control)
- Reorganize several menu items in the Emulation and View menus.
2014-01-29 08:36:47 +00:00
rogerman db94b7c8a6 movie.cpp:
- Do some preliminary cleanup of the code.
- Fix bug where firmware nicknames and messages weren't being saved properly.
2014-01-25 00:39:52 +00:00
rogerman 088495f0cd Cocoa Port:
- Change DefaultUserPrefs.plist from binary format to XML format.
- Update copyright year in plist files.
2014-01-09 08:37:26 +00:00
zeromus 0c99529409 etc 2014-01-08 16:36:58 +00:00
zeromus 0983a34bd4 same for CLI 2014-01-08 16:28:14 +00:00
zeromus c88a2071a7 try to fix GTK port compilation after gbagame configuration changes. i havent tried compiling this yet 2014-01-08 16:20:28 +00:00
rogerman b93e53ac1a Cocoa Port:
- Add support for the Guitar Grip and the Easy Piano.
- Fix minor alignment issues with some UI elements.
- Do some random code cleanup.
2014-01-08 09:16:24 +00:00
rogerman 0ec2b21a20 Cocoa Port:
- Do a bunch of optimization and cleanup of the input handler.
- Add support for using analog inputs in their native format.
- The paddle controller now supports native analog control.
- NOTE: Due to the changes in the input handler, users will need to rebind any hatswitch inputs that were previously used. Only hatswitch inputs were affected by these changes.
2014-01-07 18:35:40 +00:00
rogerman ac146b26d2 Cocoa Port:
- Add preliminary support for SLOT-2 devices. (Guitar Grip and Piano remain unsupported, but all other devices work.) Happy New Year, folks!
2014-01-02 03:13:44 +00:00
rogerman e568f8c4fd Slot-2:
- Clean up GBA Cartridge device code, and also add the ability to have the SRAM file be on a different file path from the ROM file.
- Force Rumble Pak to turn off rumble upon disconnect.
- Fix file path issue when trying to use a disk image file for an MPCF device.
2014-01-02 01:29:31 +00:00
rogerman 38f02e0804 Slot-2 Rumble Pak:
- The use of the BOOL datatype in a function pointer for front-ends is not as portable as one might think. Switch to using a standard C++ bool datatype instead.
- Add auto-selection to Rumble Pak for Metroid Prime Pinball.
2013-12-31 04:49:37 +00:00
rogerman 2b633d1cb3 Windows Port:
- Fix compiling for Windows port. (Regression from r4952.)
2013-12-30 06:38:54 +00:00
rogerman dd09eb888d Cocoa Port:
- Fix a possible crashing bug that was exposed by the changes from r4952.
2013-12-24 07:38:15 +00:00
rogerman c95eba3901 Slot-2:
- Fix SLOT-2 connect/disconnect behaviors when switching in and out of auto-detect mode.
- Do some cleanup on the auto-detect code.
2013-12-24 07:35:46 +00:00
rogerman c7c3662ed2 Slot-2:
- Fix possible crash on init when using expansion memory.
2013-12-24 00:22:31 +00:00
rogerman c2a4da43c3 Cocoa Port:
- Update all info .plist files to v0.9.11 for future SVN builds.
2013-12-21 08:32:53 +00:00
zeromus 76f83f2bf6 make some tweaks for netbsd compiling 2013-12-19 05:40:16 +00:00
rogerman 995459dc92 Core:
- Fix ROM reading on big-endian systems.
2013-12-18 08:05:32 +00:00
zeromus bc7e3bf00f speedfix for speedtyporeport 2013-12-16 05:25:55 +00:00
zeromus a8d01255ed add warning when booting homebrew game while using "stream rom from disk" since it doesnt work right now, and it essentially breaks most homebrew apps by default. 2013-12-16 05:22:49 +00:00
zeromus 0445bcc9ee fix crashy bug in slot2_gbagame and also change it to use EMUFILE while I was at it, like it shouldve been in the first place. but.. i didnt really test it. 2013-12-16 05:17:34 +00:00
zeromus f94727dc1e win32-remove libdwarf etc link deps from 2005 vcproj 2013-12-14 03:35:38 +00:00
mtabachenko acaa4e85d2 winport:
- now VS2012 build works on Windows XP/2003 64;
2013-12-09 11:03:25 +00:00
mtabachenko 074c9881ae winport:
- now VS2012 build works on Windows XP 32 bit;
- update svn tools to 1.8.4;
2013-12-09 10:45:25 +00:00
jsteffens fd55e1af4d fix include case 2013-12-09 07:54:40 +00:00
zeromus fcccf48307 fix potential but unlikely bug in advanscene import 2013-12-09 01:31:50 +00:00
zeromus 6caeb38edc add --advanscene-import <infile> commandline option which reads <infile> and writes to <infile>.ddb. (and then exits) its not completely clear whether this would work on ports other than windows due to completely disorganized emulator initialization logic between different frontends, but it should be easy to resolve. 2013-12-09 01:26:08 +00:00
zeromus da4b6487e2 win32-use the same method for displaying colors in the palette tool as is used for converting 555 to 888 in the frontend, so they match 2013-12-08 23:41:37 +00:00
rogerman 82f9342a5b Cocoa Port:
- Make frame rate transitions more smooth. This has the effect of making video much smoother, with only a negligible effect on execution speed accuracy.
- Make auto frame skip slightly less aggressive.
2013-12-07 22:21:52 +00:00
mtabachenko 72c34257a6 winport:
- fixed the path of directories in VS2012 project;
2013-12-07 18:36:33 +00:00
mtabachenko c8586c1241 buildfix VS2008 project 2013-12-05 23:22:39 +00:00
mtabachenko 285c4d567f core:
- add import Action Replay .dss save file;
2013-12-04 14:43:03 +00:00
mtabachenko 4c8e70acd9 winport:
- fix multiselect rows in Cheats List dialog;
2013-12-03 18:41:59 +00:00
mtabachenko 702879c848 core:
- add autofix the device capacity value in broken header (fix bug [#1353]);
2013-12-02 12:49:36 +00:00
zeromus d2ed4ca30e make the engineering around kUninitializedSaveDataValue not so horrible; affects "Daigassou! Band Brothers DX" but not tested (make the slot1comp_mc configure the BackupDevice with the appropriate uninitializedValue since it is a property of the physical backup memory hardware) 2013-12-01 07:06:56 +00:00
zeromus 912355488e fix new bugs in save code which broke some games in sneaky ways. fixes apollo justice, although reportedly it was broken for other reasons in previous releases. also might have fixed a regression in tomb raider underworld 2013-12-01 06:52:14 +00:00
mtabachenko 0191b680c4 core:
- fixed a bug in SPU when total length of the samples is less than 16 bytes (fixed issue [#1357])
2013-11-30 12:48:25 +00:00
zeromus dba7e21423 revert a little bit of r4815. it seems wrong, or needs more documentation: the rom header should not be consulted when deciding whether to return 0xFFFFFFF for out of range cart rom data. did dsi have something to do with this? please explain or comment. 2013-11-30 05:07:58 +00:00
mtabachenko f9eb416311 core:
- optimize SPU and fix bug [#1356];
winport:
- optimize Sound View Tool;
2013-11-30 03:15:42 +00:00
mtabachenko 02701e48d9 the BIAS register set to 0x200 on fake boot. 2013-11-28 14:40:14 +00:00
mtabachenko cc13d8f6d4 bump version number in trunk for future SVN builds. 2013-11-28 09:19:19 +00:00
rogerman dbcbeedd8a Cocoa Port (OpenEmu Plug-in):
- Fix compiling issues.
- Fix bug where sound wasn't working.
- Add cheat system support.
- Implement changeDisplayMode method.
2013-11-28 08:55:08 +00:00
rogerman ddf957fcf7 Cocoa Port:
- Load cheat item icons higher up in the front-end code.
- Remove CocoaDSCheatManager's and CocoaDSCheatSearch's dependence on CocoaDSCore. Just use basic mutex pointers instead.
2013-11-28 08:51:43 +00:00
yabause f9f6a74a72 deinit_glx_3Demu is not a void function anymore. 2013-11-28 00:46:17 +00:00
yabause 3b0797a21d We need to use a modern tar format for those very long
file paths in the repository.
2013-11-28 00:45:23 +00:00
rogerman fc733b695f Documentation:
- Update Read Me for Macintosh.
2013-11-27 20:38:43 +00:00
rogerman 432a56ec95 Cocoa Port:
- Update Bug Report URL to the current one.
- Silence some compiler warnings.
2013-11-27 20:36:39 +00:00
mtabachenko ea6ad164db - comment out print log in RLUnCompWram;
- applied changes from thunk to 0.9.10 branch.
2013-11-27 12:09:40 +00:00
mtabachenko 7b48e7f650 sorry, my silly brain; 2013-11-26 22:57:42 +00:00
zeromus 0fbe77a9a8 add some notes to self 2013-11-26 22:37:17 +00:00
zeromus 9815ef3cab authors and changelog updated for 0.9.10 2013-11-26 22:37:01 +00:00
mtabachenko 5e5e56df87 winport:
- move "Show Console" parameter in ini-file for [Display] to [Console] section and renamed to "Show";
2013-11-25 13:48:27 +00:00
jsteffens eee29ace05 error: return-statement with a value, in function returning 'void' 2013-11-25 12:52:22 +00:00
thelemonman 0e9766f096 Deinit the opengl context before exiting. 2013-11-24 22:21:58 +00:00
rogerman 50dbb2aee5 Cocoa Port:
- Add AppleScript for deleting the user defaults files.
2013-11-24 01:01:50 +00:00
rogerman a8b27aeb66 Cocoa Port:
- The Support Request and Bug Report forms now report more application states.
2013-11-23 21:18:47 +00:00
mtabachenko d6db1f7e96 - fix path to firmware settings file (fix [#1354]); 2013-11-23 14:34:27 +00:00
mtabachenko 3d8f138874 core:
- set ROM Loading to "Stream from Disk" by default;
2013-11-23 11:49:40 +00:00
mtabachenko 5e3aae6b9f update AUTHORS list 2013-11-22 23:35:52 +00:00
mtabachenko 6db2459178 revert GNU license 2013-11-22 23:13:08 +00:00
mtabachenko 3c03def68f - update GNU license;
- update bug tracker URL in the README file;
2013-11-22 23:04:26 +00:00
mtabachenko 3a88139f99 core:
- added copying logo data from ROM header into ARM9 BIOS memory area when not using the external BIOS;
2013-11-22 21:40:36 +00:00
rogerman e52511502e Cocoa Port:
- Remember the emulation speed setting between app runs.
2013-11-22 19:36:14 +00:00
mtabachenko b85d168f9a tools:
- add slot2 dumper, for debug Slot2 Option Paks;
2013-11-22 10:30:29 +00:00
mtabachenko e5eb8918d4 winport:
- fixed the icon for file association.
2013-11-22 09:52:20 +00:00
rogerman 5f44858edd Cocoa Port:
- Fix bug where SPU settings were not properly being set. (Regression from r4882.)
2013-11-21 20:41:54 +00:00
mtabachenko e05ef815ce core:
- fix export backup.
2013-11-21 18:12:57 +00:00
mtabachenko bdd4f2e3f5 core:
- fix bug in backup savestate.
2013-11-21 18:00:17 +00:00
mtabachenko 1fa0886fe7 - fix import save; 2013-11-21 09:03:02 +00:00
rogerman 9e45290c47 Cocoa Port:
- Fix bug where the "Automatically load this ROM on startup" pop-up menu wouldn't update properly if the same option is chosen.
2013-11-20 22:59:37 +00:00
mtabachenko 63406703aa fix auto import raw (uncompressed) no$gba saves; 2013-11-19 10:32:58 +00:00
mtabachenko b3586a0a98 fix auto import no$gba saves; 2013-11-19 09:24:17 +00:00
mtabachenko b05fe32a44 winport: add wiki and faq links to menu; 2013-11-17 19:03:32 +00:00
mtabachenko ebfe8a312c - add SPU synchronization mode and method to command line; 2013-11-16 15:04:32 +00:00
mtabachenko c6d959ea53 fix write backup bug introduced by [r4880]; 2013-11-16 13:19:45 +00:00
mtabachenko b5f78e2652 - optimizing reads/writes NAND backup data. 2013-11-16 12:30:47 +00:00
mtabachenko 88e34db3e7 fix import backup memory 2013-11-16 10:56:39 +00:00
mtabachenko 6cdd10b84a - rewrite IO backup memory. now reading/writing direct from/to file without temporary buffer in memory. 2013-11-15 15:08:15 +00:00
rogerman 2db8779e08 Cocoa Port:
- Remove embedded scripts for generating SVN_REV from Xcode projects; move the script to a single common script file.
- Make the SVN_REV generation script a bit more robust. Building no longer fails if svnrevision doesn't support SVN 1.7.
2013-11-13 19:33:33 +00:00
mtabachenko 7e176d1998 Slot1:
- add Slot1 NAND savestate;
2013-11-13 17:33:08 +00:00
normmatt234 59d8d798ef Fix save corruption bug in retail nand slot1. 2013-11-13 08:18:34 +00:00
normmatt234 5b6d16da87 Fix initializer-list bug reported by VS2013. 2013-11-13 08:16:52 +00:00
mtabachenko 1c49c3daf5 slot2:
- fix crash Memory Expansion Pak;
2013-11-13 08:12:55 +00:00
jsteffens 3233bf9c86 SVN revision fixes, mostly for linux 2013-11-12 16:50:40 +00:00
mtabachenko 31d2679e07 fix linux build 2013-11-12 15:31:32 +00:00
mtabachenko a61e91a078 savestates:
- fix write Slot1/Slot2 device ID;
- write more info in savestate;
2013-11-12 14:51:38 +00:00
mtabachenko ed85c3df12 Slot2:
- implement save state of "Memory Expansion Pak";
2013-11-12 11:08:23 +00:00
mtabachenko 429afd87f6 core:
- fix load slot2 savestate from old savestates created before [r4867]
2013-11-12 10:32:51 +00:00
mtabachenko 2f094cf11d core:
- add slot2 to savestate;
2013-11-12 09:55:14 +00:00
thelemonman f838938887 Fix r4862 and make the input system a bit saner. 2013-11-12 02:41:02 +00:00
rogerman 6ea032a191 Cocoa Port:
- Integrate new SLOT-2 code with all projects.
2013-11-11 20:46:03 +00:00
mtabachenko 3ee1fe0d4b winport:
- fix initialize slot2;
2013-11-11 20:25:33 +00:00
mtabachenko b4e1286dd3 slot2:
- added new games to auto-selection list;
winport:
- added customizing the keys for Taito Paddle Controller;
- now don't need reset DS when you change the slot2 device;
2013-11-11 19:47:59 +00:00
thelemonman a57bf33472 Reset the keypad status before reading. Fixes spurious keys being pressed at startup. 2013-11-11 18:06:26 +00:00
thelemonman b4c243fade Integrate the new slot2 system in gtk/cli frontends. 2013-11-11 17:28:25 +00:00
mtabachenko 3cd1e909fc Slot1:
- add device ID code;
2013-11-11 10:04:10 +00:00
mtabachenko 94aac3fccd Slot1:
- add ID code to Slot2 devices;
2013-11-11 09:19:20 +00:00
mtabachenko 69f5f165e2 slot2:
- add more games to autodetect list;
2013-11-11 07:51:42 +00:00
mtabachenko ec07d6bd55 Slot2:
- add new "PassME" stuff;
2013-11-11 00:17:13 +00:00
mtabachenko e5b34983a9 winport:
- Slot2 device set to Auto by default;
2013-11-11 00:07:33 +00:00
mtabachenko 61124f6551 Slot2:
- add auto-detection device;
2013-11-11 00:01:22 +00:00
mtabachenko 2d93fc7901 Slot2:
- add new "GBA Cartridge" stuff;
2013-11-10 23:08:25 +00:00
mtabachenko 41fe58e0f8 Slot2:
- add new MPCF Flash Card Device code;
- add new paddle code (untested);
2013-11-10 21:05:11 +00:00
mtabachenko 08c66df12b Slot2:
- rewrite all slot2 code, not finished yet;
2013-11-10 20:20:46 +00:00
mtabachenko 0cc53ad207 core:
- fake boot: read secure area before boot and remove this from readROM function (fixed);
2013-11-09 23:57:23 +00:00
mtabachenko 40b58be6ba revert my last commit, this is wrong way; 2013-11-09 23:08:44 +00:00
mtabachenko 4c50354b0e core:
- fake boot: read secure area before boot and remove this from readROM function;
2013-11-09 22:51:52 +00:00
mtabachenko 95d32bc4d2 core:
- don't read from secure area buffer for ROMs with GBA Loader;
- fix declare importData function in BackupDevice class;
2013-11-09 20:49:42 +00:00
rogerman 4700d63db8 Cocoa Port:
- Add slot2_passme.cpp to all projects.
- Fix compiling. (Regression from r4843.)
2013-11-09 20:22:55 +00:00
mtabachenko 742bc11da3 core:
- fix load ROM with GBA Loader (*.ds.gba);
2013-11-09 17:20:35 +00:00
jsteffens 0fdac4d989 linux compile fix (missing include) 2013-11-09 14:22:37 +00:00
mtabachenko 5d671b8b92 GBA slot:
- add emulation PassME (required for old Homebrew libs);
2013-11-09 13:34:11 +00:00
mtabachenko b4765567ad - moved import/export backup code from NDSystem into MC;
- moved write BMP/PNG code from NDSSystem into common;
- removed old GC log;
2013-11-09 11:42:54 +00:00
zeromus caf8d336e7 nobody is allowed to set alignments on typedefs without testing on linux and windows simultaneously. its only known to work on data declarations. in the meantime, sort all this crap out hopefully. 2013-11-08 19:19:49 +00:00
thelemonman dae13c04b1 Fix what r4840 was meant to fix but didn't. 2013-11-08 17:19:37 +00:00
mtabachenko 44051ee09f - fix application crash introduced by [r4838]; 2013-11-08 15:32:22 +00:00
thelemonman 589960f91b Make VERT coord field aligned to 16 bytes. 2013-11-08 15:14:37 +00:00
thelemonman 79cd1fc354 Use SSE matrix multiplication in box testing. 2013-11-08 14:33:30 +00:00
mtabachenko 4d79e39f36 core:
- implemented mc write status command;
- add feature custom initial value mc data on reset; (fix bug #1325 Daigassou! Band Brothers DX - JP)
2013-11-07 02:27:20 +00:00
mtabachenko cb5e9df984 addons:
- add lock/unlock control bit in Memory Expansion Pack;
2013-11-06 08:53:10 +00:00
mtabachenko c2e9dbb126 core:
- add R4 DLDI autopatcher;
2013-11-06 00:15:02 +00:00
mtabachenko 8d4390bace core:
- fix R4 path;
2013-11-06 00:01:38 +00:00
mtabachenko 11be795869 winport:
- fix bug in slot1 R4 dialog;
2013-11-05 23:10:29 +00:00
thelemonman b41dd28132 Silence autoconf errors. Fix the svn revision retrieval in the autoconf script. 2013-11-05 22:09:47 +00:00
mtabachenko e2f2bf6bb3 core:
- fix R4 (now scan directory on reset);
- add R4 new path type. now can select youself a directory to scan or auto select same as ROM;
winport:
- now in select Slot1 dialog (folder dialog) cursor autosets to current selected directory;
2013-11-05 11:13:39 +00:00
mtabachenko da29c3f483 core:
- fix touch screen calibrate when use external firmware;
2013-11-05 09:23:36 +00:00
thelemonman 7f88812fa9 Add license headers. 2013-11-04 17:07:19 +00:00
thelemonman 5faea57f2c New GLX-based 3D renderer. Linux users can now enjoy hw accelerated rendering. 2013-11-04 17:02:43 +00:00
rogerman 8c2fb6e44e types.h
- Explicitly use CPU architecture detection only for platforms that don't use autoconf. Fixes Linux build warnings. (Regression from r4824.)
2013-11-04 16:37:00 +00:00
zeromus 5f1d7492cc clean up english text for new rom streaming options 2013-11-03 21:52:18 +00:00
zeromus 7f8d2e4028 change resources.rc to ascii, since we took out the other languages. maybe this will avoid some of the problems with merging edits to the .rc file 2013-11-03 18:29:30 +00:00
rogerman b2b3a14b63 - Fix compiling for OS X Cocoa port and some other platforms. (Regression from r4821.)
- Since DeSmuME on OS X can be built for both Cocoa and CLI, revert some naming changes from r4821 for the Cocoa port specific features.
2013-11-03 03:21:26 +00:00
zeromus 79e97e339e fix windows compiling 2013-11-02 19:31:26 +00:00
thelemonman 7c62880b00 Oops, that was unintended. 2013-11-02 19:29:23 +00:00
thelemonman 4de7a417a9 Detect the host system and architecture at configure time, makes conditional compiling easier. Start the platform defines cleanup, there's still much left. Autodetect the number of cores for every platform (BSD is untested), the port mantainers should drop their own implementations. 2013-11-02 19:24:26 +00:00
rogerman 981dac038f Cocoa Port:
- Add support for the new stream loaded ROM feature.
- Update ROM loading code to latest core code.
2013-10-30 20:23:59 +00:00
thelemonman e692e05e94 Make streamed roms working for non-windows systems. 2013-10-30 11:32:11 +00:00
mtabachenko 8edec83002 core:
- add streaming ROM data from disk. I was broke all ports except windows, on linux/mac ports need fix rom_init_path in NDSSystem.cpp but i can't test this;
2013-10-28 13:18:37 +00:00
mtabachenko 76de7fc3ec - typo fix, sorry (fix NDS header and savestates works again); 2013-10-28 08:21:54 +00:00
mtabachenko cc923dc444 core:
- fix ROM serial info for DSi Enhanced ROMs;
- add some new country codes;
2013-10-28 07:53:17 +00:00
mtabachenko b782e366e2 core:
- fix ROM mask (use card size from header instead file size);
- fix read range from DS card (real DS can't read data from ROM for DSi console);
- temporary fix "write enable/disable" mc command;
2013-10-28 00:42:41 +00:00
mtabachenko c9507d2e8e core:
- remove double load/reset backup memory;
2013-10-25 22:55:50 +00:00
mtabachenko 3384b93c4a core:
- more work on backup memory handler (not finished yet, i'll be finished this coming soon);
2013-10-25 18:58:48 +00:00
mtabachenko 4ce78d5e49 core:
- more work on a backup memory stuff (fix Fokemons :) broken by me on r4807)
2013-10-23 19:00:12 +00:00
mtabachenko 68525db6d9 typo fix, sorry 2013-10-22 21:58:15 +00:00
mtabachenko f9b4229fd5 core:
- add backup size hack for Dementium II;
2013-10-20 17:19:25 +00:00
mtabachenko de36370a91 core:
- add DSi Enhanced ROM detection;
- add new country code info (O - USA);
2013-10-20 16:56:14 +00:00
mtabachenko 338077614a core:
- fix backup memory hacks;
2013-10-20 15:47:35 +00:00
mtabachenko 3dc14e59da core:
- more accurate emulation of backup chips (add emulation aux HOLD bit);
2013-10-20 12:20:44 +00:00
mtabachenko 22f814672d windows:
- fix cursor position set in memviewer;
2013-10-17 18:25:07 +00:00
mtabachenko 80547ca877 revert to 4803 2013-10-17 18:06:12 +00:00
mtabachenko 4cb1a99474 core:
- move auxspi code into slot1 device stuff;
2013-10-17 10:49:29 +00:00
mtabachenko bf58a880d1 core (slot1):
- fix typo;
2013-10-17 07:58:34 +00:00
thelemonman 0d8fc520c4 Add a post_fakeboot hook for the mcrom_debug addon too. 2013-10-15 20:57:54 +00:00
thelemonman 35706cbd97 Make libnds detect no SD in the R4 when no FAT image is selected or fails to get created. 2013-10-15 20:40:22 +00:00
thelemonman 4033c0e470 Introduce post_fakeboot hook. Switch card to normal mode after NDS_FakeBoot in a cleaner way. R4 is usable again. 2013-10-13 21:56:47 +00:00
thelemonman 960a9774e3 Don't segfault when trying to change the slot1 cart type in the cli frontend. 2013-10-13 17:46:50 +00:00
thelemonman d0e44dbaf3 Fixed a typo. 2013-10-13 10:47:33 +00:00
thelemonman fd424a1e3a Don't segfault if the specified bios files aren't found. 2013-10-12 20:29:43 +00:00
zeromus f8778ef3f2 add something, at least, in place of the deleted memset code 2013-10-08 16:53:09 +00:00
thelemonman 09ea476892 Don't memset the structures as it invaludates the string pointers. 2013-10-08 15:14:55 +00:00
zeromus b947fb3563 change sprite blending again to fix some broken scenarios in the firmware and probably others. 2013-10-05 17:56:25 +00:00
thelemonman 3acf4eb496 Jit: Take into account ofs displacement. Fixes a handful of games on Linux. 2013-10-05 13:31:34 +00:00
zeromus 7b78be0382 spriteblend test also tests whether window or bg priority logic applies first. 2013-10-03 18:24:58 +00:00
zeromus 6b8b766211 fix some sprite blending cases, regression post 0.9.9. fixes bug #1338 2013-10-03 16:52:06 +00:00
zeromus 927189550a add test for sprite blending 2013-10-03 16:50:30 +00:00
zeromus c33a11ac03 remove logic from mmu.cpp which might have been interfering MMU_VRAMmapControl() 2013-10-02 22:04:47 +00:00
zeromus 39f1b7260e revert r4787. this was already supposedly handled by MMU_VRAMmapControl(). there may still be bugs in mmu.cpp which blocked that from working 2013-10-02 22:02:52 +00:00
zeromus bc79ca81c6 add vram control register read handling 2013-10-02 20:27:24 +00:00
mtabachenko 20c2810f85 core:
- fix validate MMU registers;
2013-09-29 22:31:41 +00:00
normmatt234 04761fed6c Correctly fix the negative value in "Made In Ore". 2013-09-28 09:07:55 +00:00
mtabachenko 624252bf05 core - retail NAND:
- remove "Daigassou! Band Brothers DX (J)" from Slot1 autodetection, doesn't use then NAND flash;
2013-09-28 08:54:20 +00:00
normmatt234 36ae91938b Revert r4782 because "Daigassou! Band Brothers DX" doesn't use the nand save type. 2013-09-28 08:47:20 +00:00
mtabachenko 07d60c9da1 core - retail NAND:
- add autodetection "Daigassou! Band Brothers DX";
2013-09-28 08:20:18 +00:00
mtabachenko 274907e9b2 core - retail NAND:
- fix crash when save address is negative; (fix Made in Ore);
2013-09-28 07:42:53 +00:00
normmatt234 31697c68f8 Add "Jam with the Band" and remove region check on "WarioWare DIY" in Slot1 Retail Auto detection. 2013-09-28 06:22:23 +00:00
normmatt234 eb1f462016 Fixed writes to GCDATAIN.
Added proper NAND save emulation.
2013-09-28 06:13:04 +00:00
mtabachenko 81c063bec9 JIT:
- remove debug assertion from sync_r15 function;
2013-09-26 16:25:10 +00:00
rogerman d221b1d3d5 Cocoa Port:
- Condense the UI in DeSmuME Preferences for autoloading ROMs on startup.
- Rename the "Combo" display mode to "Dual Screen" display mode.
- Do some minor code cleanup.
2013-09-24 05:15:41 +00:00
mtabachenko 5ea6410107 winport:
- buildfix;
2013-09-21 15:06:03 +00:00
zeromus 188c53d46c fix string check in win32 cheat code 2013-09-18 21:29:18 +00:00
mtabachenko fcb8551d4f - revert some part to r4771; 2013-09-18 19:59:22 +00:00
mtabachenko 7d6b1db97b fix typos 2013-09-16 17:43:21 +00:00
mtabachenko 1cde7d498d - fix warnings; 2013-09-16 17:10:51 +00:00
mtabachenko 4d95474f92 JIT:
- merge OP_BL in thumb mode;

winport:
- update SVN tools;
2013-09-16 08:03:52 +00:00
mtabachenko 45658d4543 core:
- add more info when write to undefined Registers;
2013-09-15 16:52:19 +00:00
mtabachenko e0a2a6f8a2 core:
- discard writings to undefined MMU registers;
2013-09-15 14:35:08 +00:00
jsteffens 7a5efe8828 purge WX from the project 2013-09-14 19:49:03 +00:00
zeromus b39a54ab57 goodbye, wxdlg 2013-09-14 19:37:36 +00:00
zeromus 07a3cd6483 gpu-low impact bugfix to coloreffect up/down. just a tweak to the previous re-engineering which seems to still be holding up. 2013-09-14 18:22:33 +00:00
mtabachenko 24c2460715 winport - nitroFS viewer:
- add simply quick viewer selected file;
2013-09-13 22:00:47 +00:00
mtabachenko 4772a0b427 - suppress MC command messages; 2013-09-13 09:11:18 +00:00
zeromus baaddef970 remove wx and libelf/libdwarf code which wasnt going anywhere 2013-09-11 20:47:16 +00:00
mtheall bb40b69791 add intltoolize as a prereq before running autogen.sh on Linux 2013-09-11 19:24:18 +00:00
mtabachenko 249691f817 winport:
- fix typo in slot1 dialog config;
2013-09-10 17:46:55 +00:00
mtabachenko 7be35134be JIT:
- fix flags bug in MULxx instructions (fix bug #1333);
2013-09-10 10:22:25 +00:00
mtabachenko 2c7b47be4e - fix wrong file names in NitroFS (fix bug#1337) 2013-09-10 09:11:52 +00:00
rogerman 3cff5390f8 Cocoa Port:
- New feature: If the user quits DeSmuME while display windows remain, the user has the option to restore the display windows on app launch.
2013-09-07 23:03:42 +00:00
rogerman d9d41b5a96 videofilter:
- Add one layer of abstraction to the thread synchronization code.
- By doing this abstraction, this code has been made compatible with Windows.
2013-09-04 05:11:49 +00:00
rogerman 5d26046bc6 videofilter:
- Minor code refactoring and cleanup.
2013-09-03 20:24:56 +00:00
rogerman e339d4c767 Cocoa Port:
- Fix building for all Xcode projects. (Regression from r4739).
2013-09-03 18:40:50 +00:00
zeromus 8d45169345 boot processors into thumb mode correctly; fixes some games that hang immediately after loading 2013-09-02 20:42:28 +00:00
jsteffens 7d359a2be5 Fix linux build 2013-09-01 14:01:15 +00:00
mtabachenko c19e4d2b94 winport - NitroFS viewer:
- fix double click bug on folders;
2013-09-01 11:53:00 +00:00
mtabachenko 966f44785b winport:
- fix typo (allow edit ROM in Memory Viewer);
2013-09-01 09:35:28 +00:00
mtabachenko 0794fc29fa winport - NitroFS viewer:
- add file viewer;
2013-09-01 09:02:13 +00:00
zeromus 0da83b5a4a fix fsnitroView building on old SDK versions 2013-08-31 20:01:54 +00:00
mtabachenko 9ac50c5b85 winport:
- fix application icon;
2013-08-31 19:54:12 +00:00
mtabachenko 8dc662eb8b winport:
- forgot .ico files on my latest commit;
2013-08-31 19:40:39 +00:00
mtabachenko ddc10231ef winport:
- add NitroFS viewer;
2013-08-31 19:34:10 +00:00
zeromus bc61000d9a some cleanup in boot process 2013-08-31 19:23:28 +00:00
zeromus 4baad291dc clarify chipId checks and fake booting 2013-08-31 18:51:09 +00:00
zeromus dd56e6c231 slot-1 savestates 2013-08-31 18:30:09 +00:00
mtabachenko 7555d69e9e winport:
- added selecting a path to internal files in ROM on PC disk for Slot1 Debug;
2013-08-31 09:14:23 +00:00
mtabachenko 9935052acc - linux buildfix;
- add game code of "Made in Ore" for Slot1 auto selection;
2013-08-31 07:31:08 +00:00
jsteffens 85675ca0ab Fix linux build 2013-08-31 07:25:40 +00:00
mtabachenko 89606483cc core:
- first implementation a slot1 debugger (for debug reading files from game card, romhacking and fan-made translations);
2013-08-31 00:32:59 +00:00
rogerman e62995291a Cocoa Port:
- Fix building for all Xcode projects. (Regression from r4731).

Core:
- Fix include path in slot1comp_protocol.cpp. (Regression from r4731).
- Remove strongly-typed enum in MMU.h for compilers configured to build for (or can only support) C99. (Regression from r4731).
2013-08-28 23:08:51 +00:00
mtabachenko 7b9e626597 winport:
- fix bug on save console position;
- add pause key handler in console;
- add skip "Ctrl+C", "Ctrl+Break" events in console;
2013-08-28 20:33:46 +00:00
zeromus f237eeb0f7 fix mess in GC controllers.. apparently more of it than i thought is duplicated across the two CPUs. games and banners properly booting now. 2013-08-28 18:25:38 +00:00
zeromus b18a4af885 a bit of slot-1 stuff cleanup.. things are still pretty broken though. 2013-08-28 15:26:01 +00:00
zeromus 0ec8ea7282 fix some assorted slot-1 stuff 2013-08-28 08:01:47 +00:00
zeromus d9f04eae64 remove my little RTC hack 2013-08-28 07:10:33 +00:00
zeromus 2ddb2daf3c reinstall the R4 device. its probably severely broken. need to rehabilitate it more. 2013-08-28 07:06:12 +00:00
zeromus e0d02ddda2 massive slot-1 reorganization and code cleanup 2013-08-28 06:48:05 +00:00
mtabachenko b464ea0461 winport:
- add save console window position;
2013-08-26 23:43:32 +00:00
mtabachenko 31a9cb55de winport:
- reorganize about dialog, again :)
- remove "view 3D" from menu;
- fix slot1 dialog OK button;
2013-08-26 20:20:26 +00:00
pengvado 04b78849b7 JIT x86_32 linux:
fix calling convention when calling ordinary C functions from asm
2013-08-25 16:24:10 +00:00
mtabachenko d5ccf2939c core:
- add hack for firmware boot in JIT mode (JIT block size change to 12 until finish firmware boot process);
2013-08-23 14:31:06 +00:00
rogerman c739c7ab32 Cocoa Port:
- Fix building for all Xcode projects. (Regression from r4723).
- Add support for "Retail (Auto-detect) and "Standard Retail Memory Card + ROM" devices in the SLOT-1 Manager.

General:
- Fix compiler warnings in bios.cpp. (Regression from r4722).
- Fix include path in advanscene.cpp. (Regression from r4723).
- Fix compiling when using GCC and Clang. (Regression from r4692).
2013-08-22 07:20:28 +00:00
mtabachenko f95635f998 - added list of games with NAND Flash (in slot1_retail_nand.cpp); 2013-08-21 12:02:42 +00:00
mtabachenko 58483225d0 - linux buildfix; 2013-08-20 12:40:05 +00:00
zeromus 0924555303 reorganize slot-1, firmware, MC, advanscene code to provide a more modular and less crufty development environment 2013-08-20 06:57:03 +00:00
mtabachenko 4238ad7e97 core:
- add size of ROM to chipID;
2013-08-17 14:49:13 +00:00
mtabachenko 8814b24a48 firmware:
- add save WiFi settings;
2013-08-12 20:56:44 +00:00
mtabachenko 93b1192365 core:
- fix save firmware user settings;
2013-08-12 18:15:17 +00:00
zeromus bff45b34f8 bios-fix bugs in huffman HLE 2013-08-12 17:18:21 +00:00
mtabachenko 68be9026c0 core:
- fix boot games without real firmware (tested on Contra 4);
2013-08-12 16:13:31 +00:00
mtabachenko 3a3179a1b3 core:
- now firmware boot works when enabled JIT (JIT max block should be less 13);
2013-08-12 15:45:38 +00:00
zeromus a850bc64d3 fix HLE BitUnPack and clarify historical crc16 bugs. 2013-08-12 06:08:57 +00:00
zeromus b18f284799 clarification to chipId in retail slot-1 device 2013-08-12 05:44:05 +00:00
zeromus 03bdecc899 clean up fake bios definition (add some asm comments and merge old codepaths); fix SWI3 patch on arm7; fix disassembler to be able to view arm7 bios (bios protection logic had crept in to interfere) 2013-08-11 20:38:40 +00:00
zeromus d4bc8227a4 fix SWI HLE fail to boot from firmware regression from r4705 2013-08-11 19:20:53 +00:00
zeromus 590acba412 refactor slot-1 to object oriented interface; clean up and clarify a lot of firmware boot process and card-eject handling stuff. I probably broke some things, but I'm in the mood lately to tidy it up as soon as anyone notices 2013-08-11 19:06:27 +00:00
mtabachenko 5e0b720c9d fix linux build 2013-08-11 16:55:39 +00:00
mtabachenko 8248128cde core:
- remove old boot code
2013-08-11 16:46:33 +00:00
zeromus c8a4dd3037 bios cleanup 2013-08-11 06:17:18 +00:00
mtabachenko 57ae659145 core:
- rewrite load/save firmware User Settings from/to external file (.dfc);
2013-08-10 19:56:23 +00:00
mtabachenko 44898881ca new boot:
- now boot unencrypted ROMs from firmware;
2013-08-10 18:35:56 +00:00
mtabachenko 6ff5f84243 new boot:
- fix some bugs and removed DMA hack. now games boot fine from firmware, but supported only ROMs with encrypted Secure Area (i will fix it later);
2013-08-10 18:09:16 +00:00
zeromus b64746f7a4 cleanup bios Diff functions a little bit and fix some errors 2013-08-10 17:25:12 +00:00
mtabachenko d9fd89c4f8 fix linux build 2013-08-10 17:09:36 +00:00
mtabachenko 7a28e26a98 opps, forget a file 2013-08-09 23:13:40 +00:00
mtabachenko 243cadb4cd JIT:
- fix OP_MCR (fix a delay boot M&L:PiT and SPP on x64 PGO build);
2013-08-09 23:08:13 +00:00
zeromus 8184770cd5 gpu-fix a little bug from last commit 2013-08-07 04:46:43 +00:00
zeromus 99add0a870 gpu-fix some bugs in sprite blending. fixes much ui in fossil fighters. 2013-08-06 18:36:49 +00:00
mtabachenko f8f19fd419 winport:
- upgrade SVN utils to 1.8.1.24570 (SubWCRev);
2013-07-31 17:05:26 +00:00
mtabachenko 82cae0c168 new boot:
- fix command "get secure area" from DS card to RAM;
2013-07-31 16:45:32 +00:00
rogerman 7f1805dcc7 NDSSystem:
- Fix compiler error for Clang (and possibly others): "goto into protected scope". (Regression from r4696.)
2013-07-30 00:09:55 +00:00
mtabachenko bce045de58 new boot:
- refactoring old boot code;
2013-07-29 10:16:34 +00:00
mtabachenko 42705efde7 new boot:
- forgot file;
2013-07-28 23:36:36 +00:00
mtabachenko 075131da3a new boot:
- remove hack in halt mode;
- some work on secure area decrypt;
2013-07-28 23:34:17 +00:00
mtabachenko 0468380d12 new boot:
- refactoring code;
2013-07-26 08:24:38 +00:00
mtabachenko ef6daf9c10 core:
- added part a new boot code (not finished yet and disabled by default).
entry point ARM CPUs set to xxxx0000h and now booting a firmware from BIOS as on a real DS.
all versions iQue and DS (patched with FlashME too) firmware works now, but can't run a games from firmware yet.
2013-07-26 01:31:58 +00:00
mtabachenko 06a70e4b0a JIT:
- a bit optimized OP_BX_THUMB (with Rm=R15);
2013-07-18 12:56:30 +00:00
mtabachenko 42f5338e56 JIT:
- fix firmware boot broken in r4689;
2013-07-18 08:16:26 +00:00
mtabachenko 53ff80b635 JIT:
- fix bug in OP_BX_THUMB when Rm=15 (fix bug #1310 "Shiren the Wanderer 4: crashed");
2013-07-18 06:45:09 +00:00
mtabachenko 98d9290a22 core:
- fix typo;
2013-07-17 09:43:21 +00:00
rogerman e7c4293591 Cocoa Port:
- Fix Cocoa port builds. (Regression from r4685.)
2013-07-09 21:24:59 +00:00
mtabachenko c97207b8d4 core:
- fix boot firmware when no cartridge in slot1;
2013-07-09 07:54:51 +00:00
mtabachenko 822cf3d289 core:
- refactoring for new boot code;
2013-07-08 18:53:10 +00:00
mtabachenko 65af9c2df5 winport:
- change url to new cheats database updates;
2013-07-06 16:07:34 +00:00
mtabachenko 0e7a62002c winport:
- add range checks for cheats database mode when it load from config file;;
2013-07-06 14:34:36 +00:00
mtabachenko 6c3b7c1762 - fix x64 build; 2013-07-05 13:13:53 +00:00
zeromus dd36fd2d3a win32-fix more screen layout errors, this time in horizontal lcd layout 2013-06-30 03:09:54 +00:00
zeromus 0a6ccebaf7 texcache-fix bug which made stale 4x4 textures stick around when the palette memory had changed 2013-06-28 19:39:28 +00:00
zeromus 8b4b729d07 fix bugs in savestate header checks; refactor how header is loaded from rom to be less offensive. 2013-06-28 18:02:57 +00:00
rogerman 56130bec27 Cocoa Port:
- Actually use -Ofast and -fvectorize in the Xcode 5 project.
- Replace data type unsigned int with size_t where appropriate.
- Do some minor code cleanup.
2013-06-26 04:53:22 +00:00
zeromus 2469ecb419 change something about edge marking which made no sense to me, re: picross edge marking #1301. if we can find more evidence about this topic, write it in the comments 2013-06-20 15:49:07 +00:00
rogerman 593d82ca2b videofilter.cpp:
- Replace data type unsigned int with size_t where appropriate.
- In the VideoFilter ctor, now require srcWidth and srcHeight to be specified.
- Be more conservative when generating SSurface structs.
2013-06-19 15:54:59 +00:00
rogerman 5e18fe732d Cocoa Port:
- Add Xcode 5 project, based on the Xcode 5 Developer Preview.
- This project is identical with the Xcode 4 project, except that it now uses -Ofast instead of -O3, and also adds the -fvectorize optimization.
2013-06-19 04:12:53 +00:00
rogerman cf9a25a8ba Cocoa Port:
- Use Relax IEEE Compliance (-ffast-math) optimization for all builds on all projects.
- Use Enforce Strict Aliasing (-fstrict-aliasing) optimization for all Debug builds on the Xcode 3 and Legacy projects.
2013-06-19 02:47:45 +00:00
mtabachenko c1cfbe4556 JIT:
- fix bug in SMLAL instruction (fix Diddy Kong Racing DS player falls);
- fix bug in LDR instruction when Rd=15 (fix boot GTA Chinatown wars);
2013-06-17 13:04:06 +00:00
zeromus 2bd54afffb win32-when being run from a subdirectory of %temp%, store user files in local appdata, in effort to shut up remaining pokemon gamers running desmume from zipfiles. 2013-06-08 06:01:17 +00:00
zeromus fa5d62b740 change the way paths are generated for roms contained in subdirectories of archives so that the battery data etc. doesnt get lost 2013-06-08 02:29:53 +00:00
zeromus 60d899b335 win32- revert r4666 (remove FEX to static library), since it isnt working right at all. In fact, it is very difficult to get working. We probably need to build a vc10 and vc7 version independently, or remove std::string use from Zip_Extractor; or, have a good reason for doing any of this work to begin with. 2013-06-04 16:28:36 +00:00
mtabachenko f1d7c895c6 winport:
- removing duplicate addresses from list in memview tool;
2013-05-29 15:09:32 +00:00
mtabachenko 392715f053 winport:
- fixed sort saved address in memview tool;
2013-05-29 13:14:40 +00:00
mtabachenko 5aa87df570 winport:
- typo fix in memview tool;
2013-05-29 13:02:06 +00:00
mtabachenko 0b84b68b4b winport:
- moved file extractor from projects to VS .lib;
2013-05-29 11:46:17 +00:00
mtabachenko 0bdfe338b7 core:
- initialize fake firmware user settings on NDS reset when not using external firmware;
winport:
- using global structure for fake firmware user settings;
2013-05-29 10:13:06 +00:00
mtabachenko abd0aef26f winport:
- small optimization memview tool;
2013-05-28 18:31:30 +00:00
mtabachenko d7b92c0840 winport:
- add memory viewer features (navigate using a keyboard, toggle view all ASCII chars, saving latest 20 addresses to ini-file, go to address on [ENTER] key hit..)
2013-05-28 17:58:33 +00:00
mtabachenko 0567969202 - fix bugs in import save; 2013-05-27 18:37:40 +00:00
mtabachenko eb3831d4fe - fix another bug in import save dialog; 2013-05-27 17:31:04 +00:00
mtabachenko 672f466fef winport:
- fixed advanscene info in import save dialog;
2013-05-27 17:23:10 +00:00
mtabachenko 3e0452053a 2013-05-27 16:38:13 +00:00
mtabachenko 98c0065807 - typo fix, sorry 2013-05-27 16:27:17 +00:00
mtabachenko 59bac06efe - revert r4643 2013-05-27 16:25:35 +00:00
mtabachenko 65b31c7ad6 - fix advanscene save size detect and description in console; 2013-05-27 16:04:14 +00:00
mtabachenko 3896bf18c8 core:
- fix SPI bug. allow 8bit write to data/command;
2013-05-27 13:26:12 +00:00
zeromus 69edb2cb7f dont emit giant data tables of std::strings into 100% of source files 2013-05-27 07:22:42 +00:00
mtabachenko 26db9ee640 winport:
- revert application main icon removed in r4647;
2013-05-26 07:55:42 +00:00
zeromus 8462ea6618 win32-fix various bugs when fullscreen mode toggles off which leave the window in a different size than the original 2013-05-24 09:29:52 +00:00
zeromus a093258ec2 win32-add Pad To Integer view menu option, for help when maximizing or fullscreening to keep from distorting the image non-integerly 2013-05-24 08:47:31 +00:00
yabause 7a160accc7 Added missing stdarg.h include 2013-05-22 19:59:48 +00:00
rogerman 0e4e74d8f7 Cocoa Port (OpenEmu Plug-in):
- Fix possible crash on emulation reset.
2013-05-22 01:09:17 +00:00
zeromus 3835544919 add hacks for certain games whose save size autodetection is always doomed to fail 2013-05-21 20:07:47 +00:00
zeromus bea761c04e win32-remove some crap about alternate ui languages which was left in. the translated uis are doomed to be stale forever. history has proven it. the win32 resource system of making translated uis is a poor fit for the open source development model, designed instead of businesses taking things seriously. 2013-05-21 02:08:36 +00:00
rogerman 1b5d34dedb Cocoa Port:
- Fix bug where HID analog inputs would fail to off-state in the upper value range.
2013-05-17 17:06:25 +00:00
mtabachenko 01756f15f4 winport:
- fix app. crash on some systems introduced in r4643;
2013-05-15 18:03:31 +00:00
mtabachenko 42b51f4e45 - add checks savestate ROM header data with loaded ROM header; 2013-05-13 08:08:19 +00:00
mtabachenko 997be2f2a2 winport:
- disable render screen when emulation is paused;
- add loading screen;
2013-05-12 18:05:28 +00:00
rogerman 23b2f9b693 Cocoa Port:
- Use game developer names instead of raw maker codes.
2013-05-11 18:52:08 +00:00
rogerman e0f7643648 Cocoa Port:
- Fix compiling on Xcode 3 build targets.
2013-05-11 18:38:34 +00:00
mtabachenko 0444abb7b3 - add game developer codes; 2013-05-11 13:48:18 +00:00
mtabachenko be8d5288ee - add platform independent message dialog; 2013-05-11 11:53:21 +00:00
mtabachenko 09c8027d69 - write rom header to savestate; 2013-05-11 11:05:54 +00:00
rogerman 41f4653ea0 Cocoa Port:
- New feature: Displays can be individually set to full screen mode or windowed mode. This feature is multiple monitor aware.
2013-05-10 06:38:39 +00:00
rogerman bd55aae699 Cocoa Port:
- Fix bug where using an input mapped Set Speed control did not properly reset the execution speed if the Set Speed Limit slider was previously used.
- Move the display window related methods from the EmuControllerDelegate to DisplayWindowController.
2013-05-05 05:44:47 +00:00
rogerman 5b6ab8049e Cocoa Port:
- Fix bug where the SLOT-1 R4 directory path wasn't being saved properly.
- Fix bug where loading an external audio file with a sample rate less than 16000 Hz would cause a crash.
- Fix bug where creating a new display window with a default display mode of Main or Touch would cause the display window to draw incorrectly.
2013-05-05 00:57:04 +00:00
zeromus bf35d0af3f win32-save opengl filter option 2013-05-03 20:29:14 +00:00
yabause a0adb77ed5 Fixed make distcheck 2013-05-01 21:15:11 +00:00
rogerman 75827a1700 Cocoa Port:
- Update all info .plist files to v0.9.10 for future SVN builds.
2013-04-30 20:58:05 +00:00
zeromus 61544e807e next version is 0.9.10. get over it. 2013-04-30 18:45:52 +00:00
zeromus 66a9a09483 re-fix advanscene import to use the file that was intended, which always has serial numbers 2013-04-30 17:53:58 +00:00
zeromus faf39c8f52 fix advanscene import 2013-04-28 05:48:15 +00:00
zeromus 2a71904419 fix changelog 2013-04-28 05:47:27 +00:00
mtabachenko 142cd2e31a - typo fix in changelog; 2013-04-27 20:23:15 +00:00
mtabachenko 4739cf9a38 - update change log; 2013-04-27 19:29:37 +00:00
mtabachenko 627d5122c7 - remove "-JIT" text from version string for public release build; 2013-04-27 14:41:07 +00:00
mtabachenko 69d4b84110 Core:
- add additional checks for valid firmware config file size;
2013-04-25 13:53:07 +00:00
rogerman 79ed5b8117 Cocoa Port:
- Do a bunch of misc. UI additions, alignments, and fixes.
2013-04-25 00:01:41 +00:00
rogerman a9750234c9 Cocoa Port:
- Enable Speed Limit, Enable Auto Frame Skip, and Enable Cheats options now remember their states between app runs, instead of always being reset to enabled on startup.
2013-04-24 20:58:36 +00:00
rogerman 21faaa78b4 Cocoa Port:
- Remove mappings for Debug and Mute/Unmute from the base user defaults.
2013-04-24 00:38:28 +00:00
rogerman aac5493f61 Cocoa Port:
- The Cheat Manager, SLOT-1 Manager, ROM Info and all settings windows now remember their positions between app runs.
2013-04-23 22:06:15 +00:00
rogerman 812b637aaa Cocoa Port:
- Allow mouse input for windows in Main display mode.
2013-04-23 17:21:46 +00:00
rogerman df4d72e055 Documentation:
- In the change log, note the addition of miscellaneous user interface improvements in the Cocoa port.
2013-04-23 01:35:20 +00:00
rogerman af7ffde7e0 Cocoa Port:
- Add PowerPC Release Build build target.
- Remove the ppc64 binary from the universal binary build script. (Release builds will no longer contain any ppc64 binaries.)
2013-04-23 00:51:22 +00:00
rogerman f63e20501f NDSSystem:
- Fix potential crashing bug.
2013-04-23 00:17:00 +00:00
rogerman 763d65ad3e Cocoa Port:
- Replace layer control options in the Tools > View Layers menu to using a panel (Tools > Show GPU Layers).
- Move Tools > Show Game Data Folder in Finder menu option to File > Reveal Game Data Folder in Finder.
- Add File > Reveal ROM in Finder menu option.
- In the ROM Info panel, allow the text fields to be selectable.
- In DeSmuME Preferences, split the Emulation settings into two tabs.
- In DeSmuME Preferences, remove hyperlink to the R4 cheats database (since the link is now broken).
2013-04-22 07:18:49 +00:00
rogerman 5596351d8b Cocoa Port:
- Fix bug where the default input profile was not being applied when user defaults contained no input mappings.
- Rename keyboard key name "-" to "- (Dash)".
2013-04-21 01:42:26 +00:00
rogerman c7846262c9 Cocoa Port:
- Log when the app has been run for the first time.
- Improve the various behaviors of the File Migration window.
- Add the ability to select all files or select no files in the File Migration window.
2013-04-20 19:57:39 +00:00
mtabachenko 4d04bc009b winport:
- cosmetic fix to about dialog;
2013-04-20 00:48:05 +00:00
mtabachenko 86fd6238bd JIT:
- suppress block size debug info when use interpreter;
2013-04-19 16:28:48 +00:00
mtabachenko 2dd81387c5 - oops, sorry. copy/paste error :) 2013-04-19 11:39:23 +00:00
mtabachenko 593dd559fc JIT:
- fix set CPU mode in MSR instruction; (fix FeOS - http://feos.mtheall.com/ maybe others);
2013-04-19 09:49:15 +00:00
rogerman 7d4983eb11 Cocoa Port:
- Fix memory leak when dispatching commands from an InputManager object.
- Fix potential memory leak that can occur if InputHIDManagerTarget delegates created autorelease-able objects within the handleHIDQueue: method.
2013-04-19 02:16:58 +00:00
rogerman dd2942dc63 Cocoa Port:
- Determine whether we're running on Intel or PowerPC as early as possible so that the UI doesn't get confused.
2013-04-18 20:20:08 +00:00
rogerman e596aa777a Versioning:
- Add platform string for ppc64.
- Rename platform string for ppc from " PowerPC" to " PPC".
2013-04-18 20:03:00 +00:00
rogerman 66ef280dde Cocoa Port:
- Do a better job of disabling JIT-related controls when running on ppc/ppc64.
- When running on ppc/ppc64, use std::map instead of std::tr1::unordered_map to avoid input-related crashes.
- For Emulation Settings, rename the "General Settings" section to "Emulation Timing".
2013-04-18 18:51:58 +00:00
rogerman ac5191161a Cocoa Port:
- Fix a bug where duplicate commands would appear in the input profile viewer whenever a command had zero inputs mapped to it.
- Fix device info summary of the Touch command in the Default input profile.
2013-04-17 18:26:17 +00:00
rogerman d18a0e1782 JIT:
- Enable MAPPED_JIT_FUNCS for the Cocoa port.

Cocoa Port:
- Change the default JIT Block Size to 12.
- Update some tooltips for the CPU Emulation Engine controls.

Cocoa Port (OpenEmu Plug-in):
- Make CommonSettings.jit_max_block_size=12 the default setting.
2013-04-17 17:31:51 +00:00
gocha 7d78f85f4c Reset firmware at movie play/record (if external firmware is not used). This prevents movie desync caused by games which rewrites firmware area during the play. (for instance, Ragnarok Online DS) 2013-04-17 13:03:23 +00:00
zeromus c3e55253d4 savestate firmware less totally wrongly 2013-04-17 01:59:52 +00:00
rogerman e7a7a38d91 Cocoa Port:
- Allow the Rotate Display Left and Rotate Display Right commands to be mapped.
2013-04-16 22:45:40 +00:00
rogerman 0abccb098f Documentation:
- Update ChangeLog with Cocoa frontend changes.
- Add note that some poly/texture coloring bugs are fixed on big-endian.
2013-04-16 20:46:56 +00:00
rogerman 259cb61992 Cocoa Port (OpenEmu Plug-in):
- Make CommonSettings.jit_max_block_size=15 the default setting.
2013-04-16 19:21:22 +00:00
rogerman 7c8d40f3d1 Cocoa Port:
- Change the default JIT Block Size to 15.
- Remove mappings for Debug and Mute/Unmute from the Default input profile.
2013-04-16 19:15:30 +00:00
rogerman 0fd7cdf6e8 Documentation:
- Update the Read Me for Macintosh to reflect the current feature set.
- Fix Public Forum link in the Read Me for Macintosh.
- Add Improving Emulation Performance section in the Read Me for Macintosh.
2013-04-16 19:12:02 +00:00
zeromus b8c21dd0ad work on changelog 2013-04-16 18:07:43 +00:00
zeromus ddb6c3dbe7 etc 2013-04-16 17:24:39 +00:00
zeromus 4c5793cc75 add mmu.fw.data to savestate.. but not tested 2013-04-16 17:23:57 +00:00
zeromus 94eb1a5103 spruce up jit settings dialog 2013-04-16 17:10:22 +00:00
zeromus b31e692921 misc slot1 config related stuff 2013-04-16 17:03:16 +00:00
zeromus 548aee9e83 fix some slot1 commandline configuration code errors 2013-04-16 16:24:03 +00:00
mtabachenko 3afdddafa0 winport:
- fix missing text in Hotkeys dialog;
2013-04-16 10:55:51 +00:00
rogerman 8cd082bdde Cocoa Port:
- Add support for changing the JIT max block size in Emulation Settings.
2013-04-15 23:44:21 +00:00
mtabachenko 70a2ac3fed winport:
- fix CPU features detection on x64 in SoundTouch module;
2013-04-15 21:19:15 +00:00
rogerman 664e7391bc Cocoa Port:
- Add support for SLOT-1 devices.
- New feature: Add new SLOT-1 Manager for handling SLOT-1 devices. Use the Emulation > Show SLOT-1 Manager menu option.
2013-04-15 21:01:37 +00:00
mtabachenko 31b7f554b9 winport:
- add hotkeys for change JIT block size; (default: Ctrl+Numpad+, Ctrl+Numpad-);
2013-04-15 20:23:04 +00:00
rogerman 3982cdb90e Cocoa Port:
- In the Xcode 4 project, enable LTO for the OS X App Release Build and OpenEmu Plug-in build targets.
2013-04-15 19:50:34 +00:00
mtabachenko 9bfbbb1441 winport:
- add "jit block size" field in Emulation Settings dialog;
2013-04-15 19:49:36 +00:00
rogerman e5c8509ad1 - Fix compiling of SoundTouch library when using GCC or Clang compilers.
- Fix detectCPUextensions() to work with 64-bit processors and certain compiler optimizations like LTO. We do this because the current version of the SoundTouch library (v1.7.0) uses cpuid for the CPU detection, which may not be available on all compilers.
2013-04-15 18:04:58 +00:00
zeromus 982cc77111 update soundtouch library sources 2013-04-15 16:05:18 +00:00
zeromus 734ed9a271 add ImageHasSafeExceptionHandlers=false to vs2012 sln to make it buildable (this was due to incorporation of a zlib built by old msvc) 2013-04-15 16:00:14 +00:00
mtabachenko 2db82d334c JIT:
- fix OP_SMLAW_B instruction in 32 bit mode (test on Golden Sun Dark Dawn);
2013-04-14 16:09:21 +00:00
mtabachenko 6989113b71 JIT:
- fix OP_SMLAW_B in 32 bit mode (test on Golden Sun Dark Dawn);
2013-04-14 16:04:54 +00:00
mtabachenko 440c666545 JIT:
- fix timings broken in r4561;
2013-04-14 08:45:43 +00:00
squall-leonhart c482d90d8a this fixes up the VS2012 debug property groups.
unlike vs2010, vs2012 will set the toolset property group in order to differentiate itself from vs2010 (and 2012 has 2 toolsets, v110 and v110_xp
this commit also changes the toolset to v110_xp (since some  people actually want to run vs2012 builds on XP (shock; horror)

anyway, because vs2012 sets the property group, the property group condition lines ending in /> were buggering up loading the file in vs2012, so these have been corrected and the required </PropertyGroup> lines have been inserted
2013-04-14 02:13:27 +00:00
rogerman 749badfd22 Cocoa Port:
- Add support for separating the DS screens while in Combo display mode.
2013-04-12 04:25:52 +00:00
rogerman d6c2dfa7dc Cocoa Port (OpenEmu Plug-in):
- Fix type in plist.
2013-04-11 23:51:17 +00:00
rogerman defb771f8a Cocoa Port (OpenEmu Plug-in):
- Update copyright year in plist.
- Add Sparkle properties in plist.
2013-04-11 23:34:45 +00:00
rogerman ae7f6c76d0 Cocoa Port (OpenEmu Plug-in):
- Fix bug where the display aspect ratio was incorrect.
- Update code to match the latest changes to the OpenEmu SDK.
- Do some code cleanup.

The method for building the OpenEmu Plug-in has changed. Please refer to this link for the newest build procedure:
http://wiki.desmume.org/index.php?title=Installing_DeSmuME_from_source_on_OS_X
2013-04-11 22:49:46 +00:00
rogerman bd571202e1 Cocoa Port:
- New feature: Audio files may now be used as audio generators for microphone input. Any Core Audio supported audio format may be used.
- New feature: A sine wave tone audio generator is now available as a microphone input.
- Fix bug where retrieving input device info from a CommandAttributes struct would retrieve garbage values if an object value was nil.
- Fix bug where editing input settings would immediately change the input device info state, instead of waiting for user confirmation as intended.
- Decouple the audio sample generation code from the microphone handling code.
- Do some code cleanup.
2013-04-10 21:59:55 +00:00
rogerman cc767726aa Cocoa Port:
- Fix bug where where nil profile names were unhandled.
- Prevent the user from continuing if a blank profile name is entered.
2013-04-04 07:17:18 +00:00
rogerman 41a4ee009f Cocoa Port:
- New feature: Users can now save and restore their favorite input settings as an "Input Profile". This feature may be accessed in the Input section in DeSmuME > Preferences.
2013-04-04 01:21:21 +00:00
squall-leonhart 02f7b9f030 my cleanup prevented the vcproj file from starting correctly because i added </PropertyGroup> for the Debug profile lines
this isn't required as these lines end in />
2013-04-01 13:11:00 +00:00
squall-leonhart 15470b2fe7 VCXproj cleanups for 2010 and 2012, no functional change 2013-04-01 12:54:01 +00:00
mtabachenko c542768e68 JIT:
- add commend line option to set max block size [1..100] (1-accuracy, 100-faster);
2013-03-31 22:20:06 +00:00
mtabachenko 59ff024507 JIT:
- fix typo;
2013-03-31 13:26:44 +00:00
mtabachenko 7033fcbf86 JIT:
- refactoring some code;
- fix & make static some timings;
2013-03-31 12:50:58 +00:00
rogerman 2ae5f548f9 Cocoa Port:
- In coreaudiosound.cpp, do not use deprecated Component Manager functions when running on OS X v10.6 or later.
- When checking the OS version, read SystemVersion.plist only once.
- Move the lowest-level utility functions to their own file, utilities.c.
- Geometry-based utility functions no longer take NSPoint and NSSize parameters, instead favoring raw double values.
- Disable JIT in the Legacy port, since it no longer works there and is too low priority an issue to make working again.
- Do a bunch of code cleanup.
2013-03-28 22:37:38 +00:00
zeromus e4d487bf14 implement BKPT instruction better 2013-03-25 20:41:41 +00:00
rogerman 2815eaf0af Cocoa Port:
- Fix compiling when using the Xcode 3 project.
2013-03-17 02:20:00 +00:00
rogerman 98ed8e83e6 Cocoa Port:
- Fix bug where the menu hotkeys for File > Load State Slot and File > Save State Slot weren't being passed to the event manager.
2013-03-13 23:02:27 +00:00
rogerman 12dc048a63 Cocoa Port:
- Fix a crashing bug where making the build using Xcode 4 would crash on OS X versions earlier than v10.7 (missing _strnlen() function).
2013-03-13 07:34:09 +00:00
rogerman b78553cca8 Cocoa Port:
- Fix a performance bug where CocoaDSDisplay objects weren't properly frameskipping.
- Fix compiling when building on a machine running Leopard.
2013-03-13 05:04:12 +00:00
rogerman a18082d29b Cocoa Port:
- Fix a crashing bug that can sometimes occur when removing an input mapping.
- Make command names and input setting strings localizable.
- Do some minor code cleanup.
2013-03-12 21:14:34 +00:00
rogerman 5cd1cdef80 Cocoa Port:
- Users can now take advantage of the new input handling system with a completely redesigned user interface. Check it out in the input preferences!
- New feature: Touch input can be mapped to any input device. In addition, touch coordinates can now be user-defined.
- New feature: Multiple inputs may be assigned to the same command at the same time.
- Enhancement: It is now possible to remove all input mappings from a command.
- Also, many new commands are available for mapping. They are: Execute/Pause, Reset, Mute/Unmute, Load State Slot, Save State Slot, Copy Screen, Set Speed, Enable/Disable Speed Limiter, Enable/Disable Auto Frame Skip, Enable/Disable Cheats, and Enable/Disable GPU State.
2013-03-12 09:13:29 +00:00
zeromus 4577cc9c92 win32-a little tweak to ogl display method, should fix some video cards.. dont think it should break anything 2013-03-11 02:05:28 +00:00
zeromus 7f7beb6027 win32-improve opengl display method, i hope. 2013-03-10 02:45:47 +00:00
zeromus eb67250f71 win32-fix dev+ build compilation 2013-03-10 02:12:54 +00:00
rogerman a961a2e690 armcpu.cpp
- Silence the 1000+ compiler warnings about using offsetof() on a non-POD type.
2013-03-01 23:49:52 +00:00
rogerman 52090c2be7 Cocoa Port:
- Completely reimplement the input handling architecture to be simpler, more efficient, and more extensible.
- Decouple the high level input handling code from the lower level emulation interfacing code.
- Obsolete and remove the following classes: CocoaDSInput, CocoaHIDManager, CocoaHIDDevice. (Their functionality has been superseded by InputManager, InputHIDManager and InputHIDDevice, respectively.)
2013-03-01 23:41:03 +00:00
zeromus 7051021efc slight refinements in backup type database recordkeeping, and win32 import save dialog 2013-02-27 08:44:52 +00:00
zeromus df34dec94f win32-fix building in x64 projects 2013-02-25 19:58:00 +00:00
zeromus e60c2c5503 oops. revert r4543 2013-02-24 19:03:21 +00:00
zeromus d65baf1245 win32-fix error in 2005 vcproj 2013-02-24 18:59:54 +00:00
zeromus ad46657229 win32-fix weird scanline linking error 2013-02-24 18:55:47 +00:00
zeromus 7b1fe7eef0 win32-apply patches from ov2, to add xaudio2 output driver support 2013-02-24 18:51:09 +00:00
rogerman 839727664b Cocoa Port:
- Do some Cocoa bindings cleanup.
2013-02-20 01:50:43 +00:00
rogerman dc661e3edb Cocoa Port:
- New feature: Add support for multiple display windows. Use the File > New Display Window menu option!
- Add menu option File > Close Window (Command-W).
- The menu option File > Unload ROM keyboard shortcut has been changed to Command-Option-W.
- Rename menu option View > Show Video Output Settings... to View > Show Display Video Settings..., and also change its position in the menu.
- Obsolete and remove the following classes: EmuWindowDelegate, DisplayViewDelegate, ImageDisplayView, OpenGLDisplayView. (Their functionality has been incorporated into DisplayWindowController and DisplayView.)
- Obsolete and remove the following protocols: DisplayViewDelegate. (The new DisplayView class uses the CocoaDSDisplayVideoDelegate protocol directly.)
- Fix several bugs with thread handling and cleanup.
- Do heavy code cleanup of EmuControllerDelegate.
2013-02-19 01:31:04 +00:00
rogerman 514e09a159 - Revert commandline.cpp and videofilter.cpp back to r4536. Fixes regression from r4538 that broke compiling on non-Windows platforms.
- Do temporary workaround for setting the scanline filter parameters on Windows.
2013-02-18 19:44:06 +00:00
mtabachenko f00e94c64b - fix compile (broke on r4536); 2013-02-18 14:35:54 +00:00
zeromus 355cf3f367 win32-try not to freak out so much when using a hotkey to summon the printscreen dialog 2013-02-18 07:32:10 +00:00
riccardom ee6501fbc0 Add filters support to the gtk frontend
From Alberto, #3603211
2013-02-15 21:01:03 +00:00
riccardom 6acaab2bf5 GPU: Rename BlendFunc's enum value None to NoBlend
It looks like None is defined in X.h as 0L so breaking
compilation on platforms which use X. Instead of playing
with the preprocessor just rename the enum value.
As seen on:
http://forums.desmume.org/viewtopic.php?pid=20591

Thanks Alberto for forwarding the issue.

Remember: everytime a bug is reported in a forum a kitten dies!
2013-02-15 08:46:08 +00:00
rogerman 1055a9235f Cocoa Port:
- Fix regression from r4533 where the UI elements in the Cheat Manager window wouldn't update in sync with ROM loading/unloading.
- Do a bunch of code cleanup.
2013-02-15 02:37:14 +00:00
rogerman 4dd70a0120 Cocoa Port:
- Decouple window handling from the emulation control logic.
- Update copyright year on several files.
- Do various minor code cleanup.
2013-02-13 23:46:02 +00:00
rogerman 0fd5648ab6 Cocoa Port:
- Do some random code cleanup.
2013-02-11 20:57:16 +00:00
rogerman f923c7a493 GFX3D:
- Fix regression from r4528 where 32-bit colors might have an incorrect alpha value on certain compilers.
2013-02-11 07:17:27 +00:00
rogerman 52ffa0e577 Video Filters:
- Move videofilter.cpp/.h files out of the cocoa directory since it is planned to be use in other ports.
2013-02-11 06:53:26 +00:00
zeromus 529797517c win32-reorganize menus to be more compact and sensible 2013-02-10 08:16:03 +00:00
rogerman 90b038f19a GFX3D:
- Fix some texture coloring bugs on big-endian systems. (Some endianness bugs remain with texturing enabled.)
2013-02-10 04:46:50 +00:00
zeromus 654b51eeb9 win32-unhook language option. its just doing a disservice to people 2013-02-09 19:19:01 +00:00
zeromus 24647e57e0 win32-tweak opengl display method 2013-02-09 19:02:17 +00:00
rogerman 533b810efe OpenGL Renderer:
- Fix polygon coloring bug when converting the framebuffer on big-endian systems. (Disabling textures will show the correct polygon coloring. Endianness bugs remain with texturing enabled.)
2013-02-08 23:38:10 +00:00
rogerman 58d32b05c4 OpenGL Renderer:
- Revert OpenGLRenderer_1_2::CreateShaders() to r4522.
- Add OpenGLRenderer::LoadShaderPrograms() to give a chance to modify the shader programs before compiling them.
- Fix bug where shader compiling would fail on the 3.2 renderer.
2013-02-08 22:37:15 +00:00
zeromus a08b1a3d0a win32-improve opengl initialization some more, add gma965 hack 2013-02-08 09:23:28 +00:00
rogerman 006d39c3a3 OpenGL Renderer:
- Remove vertex draw batching. This fixes polygon rendering in certain games, like Metroid Prime Hunters. There is a performance penalty in doing this, but for GPUs that support VBOs, the performance hit will be negligible.
- Do a bunch of code cleanup.
2013-02-08 04:15:51 +00:00
rogerman 78c13cc41d Cocoa Port:
- Bring back glVertexAttribPointer() to the OpenGL blitter.
- Disable shaders on PowerPC builds since they don't seem to work there.
- Since OS X v10.5 is required, assume the availability of GL_APPLE_vertex_array_object and GL_ARB_vertex_buffer_object. Remove the associated code paths to reduce code complexity.
2013-02-07 22:18:21 +00:00
zeromus 854c15de87 win32-dont depend on wgl render target extension 2013-02-07 20:27:46 +00:00
zeromus 83b9722276 win32-refine opengl init code 2013-02-07 20:17:53 +00:00
squall-leonhart 53756bc480 and missing libsasl32.dll 2013-02-07 15:14:41 +00:00
squall-leonhart 4127ce530e may as well put the latest executable as well. 2013-02-07 15:06:25 +00:00
squall-leonhart f57f8e00fb added missing libsvn_tsvn32.dll 2013-02-07 15:02:21 +00:00
zeromus dfe56f909d win32-retool opengl initialization 2013-02-07 09:07:59 +00:00
zeromus ba1a39d2e5 win32-update subwcrev and bring dll deps along for the ride 2013-02-07 09:06:31 +00:00
rogerman 98b01c43d8 Cocoa Port:
- The OpenGL blitter now uses legacy gl*Pointer functions instead of glVertexAttribPointer() to improve compatibility with older drivers.
- The OpenGL blitter now uses ARB versions of VBO functions to improve compatibility with older drivers.
- Do some code cleanup.
2013-02-07 07:52:20 +00:00
zeromus 0e380f908a win32-fix bug making old opengl renderer not work well at all 2013-02-07 00:43:22 +00:00
zeromus 9bd7b25aff win32-fix selection of null 3d core 2013-02-06 23:53:29 +00:00
zeromus 37ebeb0682 win32-dont print garbage in console when initializing 2013-02-06 21:59:08 +00:00
zeromus b16f5e8c07 win32-try a different approach to improve new opengl initialization reliability 2013-02-06 21:39:38 +00:00
rogerman 719e1244cc Cocoa Port:
- Remove the requirement for the OS X v10.5 SDK when building using the "OS X App; v10.5 Leopard Release Build" scheme in the Xcode 4 project. The scheme now uses the latest OS X SDK available. This is being done for forward compatibility purposes.
- Fix compiling when building using the OS X v10.5 and earlier SDKs in the Xcode 3 and Legacy projects.
- Fix compiling when building for all PowerPC build targets.
2013-02-06 21:39:22 +00:00
zeromus db77b2456e win32-add some opengl initialization diagnostics clarification 2013-02-06 21:12:07 +00:00
rogerman 71345d4d20 Cocoa Port:
- Fix many compiler warnings.
2013-02-06 05:55:23 +00:00
rogerman aef86fe900 Cocoa Port:
- Add Rigorous 3D Rendering Timing setting to Emulation Settings.
- Add option for 8 Threads to 3D Rendering Settings.
- Do some code cleanup to the display code.
2013-02-06 05:17:53 +00:00
rogerman 2e6ab871c1 Cocoa Port:
- Move OpenGL renderer code from the UI code to the emulation core interface code.
- Clean up the OpenGL renderer init code, and lazy load the context init.
- Fix bug where the wrong display would show when changing display modes after changing video filters.
- Do some other random bug fixes.
2013-02-06 00:54:39 +00:00
rogerman 2dc9077511 Cocoa Port:
- Add support for the new OpenGL 3.2 renderer. (Requires OS X v10.7 or later, Xcode 4 builds only.)
2013-02-05 07:12:50 +00:00
rogerman 14d6e53f54 OpenGL Renderer:
- Fix bug with automatic renderer selection.
- Do some code cleanup.
2013-02-05 06:36:47 +00:00
zeromus f2d177b23a win32-fix magnification filters in ogl display mode 2013-02-05 00:44:04 +00:00
zeromus 98f9f0b64e win32-support ogl 3.2 and oglOld driver choices independently, and fallback to oglOld when ogl3.2 cant initialize 2013-02-05 00:35:57 +00:00
zeromus f09aaa3205 win32-clarify threading logic in ogl display method 2013-02-05 00:10:40 +00:00
zeromus 5538270c1a win32-make ogl display method not leak gdi handles like theyre going out of style, and run more peacefully with new opengl code (i.e. not at 2fps) 2013-02-05 00:02:59 +00:00
rogerman 5b215efacc OpenGL Renderer:
- Major rewrite of the OpenGL rendering code! Most important changes listed below.
- Encapsulate 3D rendering code in C++ classes.
- Add support for 3.2 Core Profile contexts, while preserving backwards compatibility with legacy contexts.
- Initialize the renderer to choose the best OpenGL entry points available from the driver, automatically falling back to legacy entry points as needed.
- Remove multithreading code. New and previous optimizations have obsoleted the need for it, so remove it to reduce code complexity.
- Obsolete shaders.h and add the shader code directly into the .cpp files. Ports can safely remove the shaders.h file from their project/make files.
2013-02-04 22:30:20 +00:00
zeromus d310766240 win32-add opengl display method 2013-02-03 23:05:40 +00:00
rogerman 6506df3a30 OpenGL Renderer:
- Temporary compile fix: Don't dynamically link glActiveTextureARB for Linux/X11 platforms.
2013-01-27 01:12:36 +00:00
rogerman a340c63734 OpenGL Renderer:
- Use ARB version of glActiveTexture() to improve backwards compatibility.
2013-01-26 22:04:32 +00:00
zeromus 02d131a365 win32-fix tiny buglet in gethostbyname call ? 2013-01-22 20:16:25 +00:00
squall-leonhart 6b7896cf93 replaces all instances of >un7z_and_touch.bat with >call un7z_and_touch.bat to make VS2010 and 2012 builds compile first time instead of having to run the build 2-3 times to extract all libs. 2013-01-22 19:10:18 +00:00
rogerman ed2ef989d7 OpenGL Renderer:
- Move lookup table initialization to its own function + bugfixes.
2013-01-21 22:58:56 +00:00
mtabachenko a1fbdd04a6 - fix crash when use wrong index bridge adapter; 2013-01-20 16:32:23 +00:00
rogerman e751cfb9bd OpenGL Renderer:
- Lots of refactoring and code cleanup (important points listed below).
- Clean up #include stuff.
- Make dynamic extension linking a bit nicer.
- Remove ARB and EXT tokens and replace with 3.2 Core Profile tokens. Add backwards compatibility for pre-3.0 OpenGL headers.
- Check for GL_ARB_texture_mirrored_repeat, GL_EXT_blend_func_separate, and GL_EXT_blend_equation_separate. Older GPUs that don't support these extensions should no longer malfunction.
2013-01-20 01:33:12 +00:00
rogerman 2914677ad6 Cocoa Port:
- Add the (Get/Set)FilterParameter family of methods for video filters that need parameters.
- Make VideoFilter::RunFilter() and the destructor a little bit more thread-safe.
- Do some minor code cleanup.
2013-01-18 07:53:09 +00:00
rogerman 4abb36899b OpenGL Renderer:
- Fix compiling on OS X.
2013-01-17 09:14:06 +00:00
zeromus f3bbcfcd63 fix windows compiling by adding GL prototypes for newly-required MSAA junk. not sure what the implications are on old opengl drivers. we'll have to wait for someone to complain. 2013-01-17 06:34:21 +00:00
rogerman 91c53cc772 Cocoa Port:
- New feature: Add support for the OpenGL renderer's multisample antialiasing (MSAA) feature.
- Update UI tooltips for the 3D renderers to reflect the current state of the code.
2013-01-17 01:22:53 +00:00
rogerman 72eb5e6d12 OpenGL Renderer:
- New feature: Support multisample antialiasing (MSAA). This can be enabled through the CommonSettings.GFX3D_Renderer_Multisample setting (disabled by default).
- Do some cleanup of the init code.
2013-01-17 01:19:08 +00:00
rogerman c15911a1b1 GFX3D:
- Do various stability improvements.

task.cpp:
- Fix race condition on Windows.
- Do some minor code cleanup.
2013-01-16 23:38:47 +00:00
zeromus 39997cfebf fix bug from r4479 in windows with softrasterizer task freezing 2013-01-16 09:24:53 +00:00
rogerman fb60a9bcd8 OpenGL Renderer:
- Do some more code cleanup.
2013-01-16 06:17:24 +00:00
rogerman a2f078ec81 GFX3D:
- Remove NDS_3D_GetLineData(), as it wasn't appropriately named or used for its intended purpose.
- Add NDS_3D_RenderFinish(), which is what should have been used in the first place. (Purpose: Blocks the thread until 3D rendering is finished.)
- Optimize gpu3DNull so that it doesn't have to clear the 3D layer every frame.

task.h:
- Fix multiple #include compiling bug.

SoftRasterizer:
- Improve the performance of rendering in multithreaded mode.
- Improve the stability of reset and shutdown in multithreaded mode.
- Do some minor code cleanup.

OpenGL Renderer:
- Improve the stability of reset and shutdown.
- Do some minor code cleanup.
2013-01-15 09:36:17 +00:00
rogerman ad65e6abf7 OpenGL Renderer:
- Make PBO feature support check a little less strict.
- Do some small optimizations to the DS framebuffer color conversion and ClearImage buffers.
- Do a big round of code cleanup.
2013-01-15 00:27:38 +00:00
riccardom 7e9a80c4a1 gtk: correct file name in header 2013-01-12 18:03:52 +00:00
riccardom 8faddbfdc8 gtk: add fullscreen view
Can't see how it is useful on big screen but who am i to
disagree :)

From Alberto, #3597339
2013-01-12 15:19:07 +00:00
riccardom a38920d612 gtk: start the emulation automatically
Like on windows, From Alberto #3597339
2013-01-12 15:17:50 +00:00
riccardom 34e6c5a5f5 gtk: correct audio state with --disable-sound
Audio enabled check was always set even if called with
--disable-sound.

Fix #3574138
2013-01-12 15:06:53 +00:00
squall-leonhart d46f75c188 correct reference casing to fix building on linux
mtabachenko, Unix filesystems are case sensitive(insane, i know), file names in source and make files must match the file name casing or build fails.
2013-01-11 14:45:43 +00:00
rogerman 2cac9d3be3 Cocoa Port:
- Make the video filters code more cross-platform friendly by adding #includes for Linux.
- Do more parameter checks in RunFilterCustom() and also add more helpful comments.
2013-01-11 09:27:07 +00:00
rogerman c0181e741d OpenGL Renderer:
- Small optimization to texture handling.
- Rewrite console info strings for better reading, and also prefix all lines with "OpenGL:".
- Report basic GPU info in the console on init.
- Check for a minimum OpenGL header version of v2.0 and a minimum OpenGL GPU version of v1.2. (Note that these requirements were always implied by the code, but now we can explicitly check for them.)
- Do even more code cleanup.
2013-01-10 22:02:10 +00:00
rogerman 9e1837dc4b JIT:
- Fix compiling on non-Windows platforms. (Regression from r4469)
- Fix compiling for 32-bit. (Regression from r4469)

asmjit Library:
- Do temporary fix for compiling on OS X for SDKs earlier than v10.7.

Cocoa Port:
- Update Xcode project files to include the new asmjit library from r4469.
- Limit OS X SDK version to v10.6 in the Xcode 3 project.
2013-01-10 21:35:32 +00:00
mtabachenko a03d04a335 - update asmjit library; 2013-01-10 10:51:22 +00:00
rogerman a2315eb314 Cocoa Port:
- Fixed dimension bug in VideoFilter::RunFilterCustom().
- Do some minor code cleanup of the video filters code.
- Fixed bug in setting GPU layer states where the Main and Sub GPUs were swapped.
- Add DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO token.
2013-01-09 08:31:21 +00:00
squall-leonhart c5a389684a since vs2010 sp1 fixes the bugs that previously caused the softraster to crash, i've re-enabled SSE2 and brought the build settings to be closer to the vs2008 project
This reduces the binary size down a bit from 5.3 and 7.1MB, to 4.7 and 6.4MB's for the 32 and 64bit 2010 release binaries respectively
2013-01-09 05:25:17 +00:00
rogerman c3af0b199f OpenGL Renderer:
- Remove compile dependency for cocoa/macasx_10_4_compat.h
2013-01-08 21:49:06 +00:00
rogerman 30ea51bce0 OpenGL Renderer:
- Copy read PBO pixels into our own buffer before unmapping the pointer. This is to help avoid tripping up certain drivers.
- Do some minor code cleanup.
2013-01-08 01:06:35 +00:00
zeromus c7466bc4a1 fix r4410/r4411 (WRAMCNT memory mapping) regression in firmware bootup: WRAMCNT=3 must happen before firmware boot programs are copied in; continue cleaning up the monumentally chaotic boot process code. 2013-01-07 20:12:36 +00:00
rogerman effc847ee0 Cocoa Port:
- Do some small optimizations to the windowing system.
- Fix an occasional crashing bug that sometimes occurred when changing the display mode.
- Do some code cleanup.
2013-01-05 01:32:05 +00:00
rogerman 777fd6bc78 Cocoa Port:
- Optimize some utility functions
- Make the OpenGL renderer the default 3D renderer in the legacy port
- Fix compiling issue in the legacy port
- Build frameworks now all use SDK relative paths instead of absolute paths

OpenGL Renderer:
- Allow it to compile using the OS X v10.4 Tiger SDK
- OpenGL feature support checks now run an SDK check in addition to the GPU check
2013-01-04 01:40:52 +00:00
rogerman 9ab3c45c2a Cocoa Port:
- Do many optimizations to the OpenGL blitter.
2013-01-03 22:41:35 +00:00
rogerman bd9d8c9612 OpenGL Renderer:
- Do small VBO optimization.
2013-01-02 06:51:09 +00:00
rogerman 46cad337e2 OpenGL Renderer:
- Fix one more bug with VAO support detection.
2013-01-02 04:10:38 +00:00
rogerman 1c08348f4d Video Filters:
- Fix out-of-bounds memory reads on HQ4x and HQ4xS filters that might cause a crash.
2013-01-02 02:58:27 +00:00
rogerman b3fa10446a OpenGL Renderer:
- Fix small bug with VAO support detection.
2013-01-02 02:34:04 +00:00
rogerman e20037f4c7 OpenGL Renderer:
- Add VAO support.
- Fix compiling on Windows.
- Do some minor code cleanup.
2013-01-02 02:20:38 +00:00
rogerman 3389e5974f GFX3D:
- User settings for 3D rendering states now control all 3D renderers.
2013-01-02 00:42:42 +00:00
rogerman 86e6c34f98 OpenGL Renderer:
- Shaders now use generic vertex attributes instead of relying on fixed-function attributes.
2013-01-02 00:28:53 +00:00
rogerman d37650a8a5 Cocoa Port:
- Fix some compilation issues related to r4452.
- Switch the order of model identifier info and OS info in the About box.
- Do some minor code cleanup.
2012-12-31 02:01:37 +00:00
rogerman 6c66a740c6 Cocoa Port:
- New feature: Users can now use some very user-friendly forms for submitting support requests and bug reports. The new forms can be found in the Help menu.
- The About box now shows the model identifier and running OS version.
- The About box display font for the read me files has been changed to Monaco 10.
2012-12-30 09:08:19 +00:00
rogerman a62168ccff Cocoa Port:
- The OpenGL 3D renderer now respects the "Rendering Threads" setting.
- Display output now auto-configures whether to run video filters in single-threaded or multi-threaded mode.
- Video filters now run much better in single-threaded mode.
- Do a lot of very heavy cleanup of the video filter code.
- Fixed bug in the UI where the HQ4xS option didn't work correctly in the user preferences.
2012-12-29 02:15:58 +00:00
gocha 06cd0ef7f9 Lua: fix a bug that gui.gdscreenshot() always returns a transparent image. it will always return a complete opaque image from now. 2012-12-28 09:18:59 +00:00
rogerman c77f686f6b Cocoa Port:
- Add new static method to run a video filter without needed to instantiate a new video filter object.
- When changing filters, do not reinitialize the destination buffers if the video filter ID is the same.
- Do some other cleanup of the video filter code.
- Add new HQ4XS video filter.
2012-12-28 03:36:57 +00:00
rogerman db96f7a0b6 Video Filters:
- Fix off-by-one line bug in HQ4x filter.
- Add new HQ4xS filter.
2012-12-28 03:25:20 +00:00
rogerman a4cdf1b9a6 OpenGL Renderer:
- Do more random code cleanup.
2012-12-27 00:12:00 +00:00
rogerman dcf601ebb2 GFX3D:
- Improve ClearImage/Rear-plane emulation accuracy and performance for both 3D renderers.

OpenGL Renderer:
- Do additional optimizations to ClearImage/Rear-plane emulation.
- Make FBO support check a little less strict.
- Some minor code cleanup.
2012-12-25 05:10:51 +00:00
mtabachenko 887f78a0d0 JIT:
- fix ASR shifts with IMM value (fix Monster Truck DS);
2012-12-24 00:31:15 +00:00
rogerman 97ddd12360 OpenGL Renderer:
- Move alpha testing to the fragment shader.
- Do a bunch of code cleanup.
2012-12-23 10:05:42 +00:00
rogerman cb1f8af8d7 OpenGL Renderer:
- Fix bugs with ClearImage/Rear-plane emulation that caused it to stop working. (Makes games like Sonic Chronicles: The Dark Brotherhood playable again with this renderer.)
2012-12-23 05:46:12 +00:00
rogerman 4efa980cba OpenGL Renderer:
- Windows doesn't seem like multithreading on the same OpenGL context, so revert to r4435 where we disable this on Windows. Should fix related crashing bugs on certain drivers. Someone please research.
2012-12-22 21:38:10 +00:00
rogerman 3ced7f5c8b OpenGL Renderer:
- Fix regression from r4438 where the toon table didn't upload correctly.
2012-12-22 20:50:09 +00:00
rogerman fd5dc6a521 OpenGL Renderer:
- Change detection of toon table invalidation from using a render state flag to doing a full memcmp() on the render state's toon table. (Maybe fixes some bugs?)
- Lazy load the toon table instead of loading on invalidate.
2012-12-22 07:00:17 +00:00
rogerman fcd5447274 OpenGL Renderer:
- In single-threaded mode, defer pixel reads until H-Blank to help improve single-threaded performance.
- Move the framebuffer conversion code to its own function.
2012-12-22 01:44:57 +00:00
rogerman 9ba6873ef4 OpenGL Renderer:
- Fix bugs with multithreading that was causing instability.
- Revert temporary crash fix on Windows from r4435.
2012-12-21 22:18:54 +00:00
mtabachenko 5a0c9632bb OpenGL:
- temporary fix crash on Windows;
2012-12-21 19:08:23 +00:00
rogerman 233d079b45 Cocoa Port:
- Fix compiling. (I forgot to commit displayView.h in r4432, oops!)
2012-12-21 04:01:37 +00:00
rogerman be3059f547 OpenGL Renderer:
- Add PBO support.
- Pixels reads are now multithreaded, giving a significant performance boost. (Note: This optimization does not work on GPUs lacking PBO support and running on Windows. Someone please research...)
2012-12-21 03:19:05 +00:00
rogerman 2a4b7380d3 Cocoa Port:
- Add shader support to the OpenGL blitter and move matrix transforms to the shaders.
- Remove the assumption that the renderer will have VBO support. The code will now work without it.
2012-12-20 02:28:36 +00:00
rogerman 755c63721d OpenGL Renderer:
- Add VBO support plus optimizations.
- Standardize the naming conventions for OpenGL feature support.
2012-12-20 00:21:02 +00:00
rogerman 91ec1589a8 OpenGL Renderer:
- Fix compiling on Windows
2012-12-19 05:31:46 +00:00
rogerman d43c709c33 OpenGL Renderer:
- Do some small optimizations.
- Move matrix transforms, texture scaling, and vertex color handling to the shaders.
- Tons of code cleanup.
2012-12-19 00:57:47 +00:00
rogerman ad1c1e6a18 OpenGL Renderer:
- Improve accuracy of wireframe mode rendering.
- Fix regression from r4426 where wireframe rendering of GL_QUADS and GL_QUAD_STRIP would render an extra diagonal line. (Tested on Nanostray 2)
2012-12-10 10:50:40 +00:00
mtabachenko 27d4d5f92b JIT:
- fix bug in SMULW/SMLAW instructions on x86;
2012-12-09 09:38:45 +00:00
rogerman b66bbd5654 OpenGL Renderer:
- Render GL_QUADS and GL_QUAD_STRIP as GL_TRIANGLES.
- Fix rendering of GL_QUAD_STRIP.
2012-12-09 08:41:30 +00:00
zeromus 1f321224b6 fix memory leak in jit loadstate. someone who uses the jit ought to test this a bit, but i think its right. 2012-12-09 05:19:11 +00:00
rogerman 8dd727fc01 Cocoa Port:
- Remove some test code that accidentally snuck into r4423.
2012-12-08 01:18:13 +00:00
rogerman e841a8aa1a Cocoa Port:
- Allow the OpenGL 3D renderer to render in HW (allow for SW fallback).
- Remove the depth buffer from the display output context (doesn't need it and never will need it).
2012-12-08 01:10:33 +00:00
rogerman 68fd51ac1f OpenGL Renderer:
- Optimize vertex uploading by replacing immediate mode calls with glDrawElements().
- Do some minor code cleanup.
2012-12-08 01:05:13 +00:00
rogerman 57eb23b97e Cocoa Port:
- Optimize OpenGL blitter for better performance (now uses VBOs to modify display properties instead of completely reconstructing display lists whenever the properties change).
- Some refactoring and code cleanup of the video output code.
2012-12-07 08:32:47 +00:00
rogerman a2fe2fdd21 Cocoa Port:
- Add support for the OpenGL 3D renderer.
- Improve thread-safety of the display code.
- Fix a pixel alignment issue when resizing the display window.
- Lots of refactoring and cleanup of the display code.
2012-12-05 09:17:49 +00:00
rogerman e8072e0eb0 OpenGL Renderer:
- Fix enable texture setting.
2012-12-05 08:22:28 +00:00
rogerman e6615d640d OpenGL Renderer:
- Wrap OpenGL calls in OGLReset().
2012-12-04 02:27:41 +00:00
rogerman c87672f680 Cocoa Port:
- Optimize OpenGL blitter for better performance (now uses display lists instead of rendering in immediate mode).
- Some refactoring and code cleanup of the video output code.
2012-11-24 05:45:59 +00:00
zeromus ba35ebce6a add todo 2012-11-08 21:52:07 +00:00
zeromus e54a1201a9 fix regressions in handling of weird characters in filenames/archives, dating from introduction of fex. also improve fex to support utf-8 extended filenames in zipfiles. 2012-11-08 21:44:46 +00:00
zeromus edbfa51bae fix fullscreen horizontal-lcd mode display rectangle calculation to correct aspect ratio 2012-11-07 08:55:27 +00:00
rogerman 54626689cf JIT:
- Fix a low-level bug on 32-bit processors. This was most noticeable with 3D graphics corruption in games like Golden Sun: Dark Dawn.
2012-11-02 21:42:30 +00:00
zeromus 02882f9483 fix bugs in slot-1 init that made non-default choices fail to init at emulator boot-up time 2012-10-24 18:14:48 +00:00
zeromus e6216b978a improve WRAMCNT memory mapping 2012-10-21 21:17:07 +00:00
zeromus e2fcf5eadb support WRAMCNT memory mapping, and do some other code cleanup and documentation 2012-10-21 19:44:16 +00:00
rogerman 059b396d97 Cocoa Port:
- Remove code for Eject Card functionality. (Function is currently unimplemented, and has been obsoleted in r4392.)
2012-10-21 05:42:21 +00:00
zeromus b514a4b0a2 fix #3574181 Readme: wrong forum address 2012-10-21 00:08:42 +00:00
zeromus 3295e71825 rough draft of new RTC dialog 2012-10-18 00:52:03 +00:00
zeromus 89aa770a82 windows-fix bug in FEX interface which made archive opening effectively useless. apparently fex_seek_arc takes an offset into the archive which must be got by fex_tell_arc; it doesnt take an archive index. am i right? 2012-10-17 05:44:16 +00:00
hi-coder 35b6d80a62 add hot key to toggle cursor on and off win - english 2012-10-15 06:28:21 +00:00
mtabachenko 0b689ec20d OpenGL:
- fix program crash when graphics card not support FBO;
WinPort:
- fix create console in Windows XP;
2012-10-06 10:21:01 +00:00
mtabachenko 9bc148b9cc JIT:
- speed up optimization;
2012-09-30 00:43:41 +00:00
pengvado 9a2eaad15c JIT: fix compilation on gcc
regression in r4372
2012-09-19 16:34:21 +00:00
mtabachenko 231b9dfe08 JIT:
- fix bug in BX/BLX THUMB instructions (fix set CPU T-flag);
- more optimizations;
2012-09-19 09:24:06 +00:00
mtabachenko 7001f8c533 winport:
- fix compile windows builds when HAVE_JIT undefined;
2012-09-15 06:53:00 +00:00
mtabachenko 1b77d8b3e3 JIT:
- fix bug in arithmetic shifts when imm>32;
- a bit speed optimizations;
2012-09-13 11:48:24 +00:00
zeromus e7b9bc7765 add es to LINGUAS file 2012-09-13 01:28:49 +00:00
zeromus d65b92517d add spanish .po file 2012-09-13 01:23:57 +00:00
zeromus b2a81e3ea5 fix asmjit to at least give me _something_ to disable its typedefs of int32_t etc so that we can avoid them redundantly declaring themselves in builds that include EXPERIMENTAL_WIFI_COMM. asmjit is a bit too smart for its own good. 2012-09-11 19:09:35 +00:00
zeromus fe6b99a7a0 default jit to disabled, i think 2012-09-06 20:58:00 +00:00
mtabachenko 532209dd61 winport:
- fix x64 builds;
2012-08-31 10:51:49 +00:00
zeromus a6742bbe6a fix regression by me from r4129 of code added in r3698 by crazymax to emulate 8bit DIVCNT reads. fixes nostalgia options screen. add some clarification so the related code isnt quite so mystic. 2012-08-30 18:27:22 +00:00
zeromus 8ef50bfa7c remove eject from win32 menu items and make card eject IRQ fire whenever slot-1 devices change. a note to this effect is in the slot 1 config dialog. this means we no longer reset when the slot-1 device changes. why did we need to do that, anyway? was it copied from the slot-2 config? why do we need to do that for slot-2?
rationale: i think some users were picking this menu item on accident and scrambling their games, and we had needed to do this eventually anyway as part of logicalization of systems
2012-08-30 17:25:24 +00:00
zeromus 1f6181db81 win32-7z.exe was necessary for building, for dearchiving the lib deps. readded 2012-08-30 17:09:33 +00:00
gocha 43020c4c3f Fix to load StylusJitter setting on startup 2012-08-29 23:13:51 +00:00
zeromus 7f8f86905a fix link errors with CRC stuff - crc.cpp from utils/decrypt was overwriting crc.obj from FEX; changed so that crc.cpp from utils/decrypt builds to a different dir 2012-08-28 23:33:37 +00:00
gocha 4b424e3dba rasterize: fix pixel poly regression at r3954 2012-08-28 15:06:30 +00:00
zeromus 38778e34e5 fix bug compiling in old visual studios due to mistaken use of stdint.h. we could add stdint.h if we need to but fex compiles fine without it 2012-08-27 16:45:04 +00:00
gocha 671b1a95f1 Replace non-ASCII quotes. 2012-08-27 12:25:45 +00:00
rogerman c1f4a60a9e Cocoa Port:
- Change the default DS frame rate to what it should be - 59.8261 FPS.
2012-08-26 05:08:33 +00:00
gocha 0f70aa87c0 Fix ARM9 intrWaitARM_state save/load
Revert MMU.reg_DISP3DCNT_bits load (it should be read from MMU.ARM9_REG only if it's old savestate)
2012-08-26 03:53:30 +00:00
zeromus 7414084aec fix a pretty obvious bug in savestating gxstat 2012-08-26 00:37:16 +00:00
rogerman 6e9a041176 movie.cpp:
- Fix a buffer overrun bug by disabling reading the ROM checksum in .dsm files for now. (Reading the checksum doesn't work correctly anyways, and nothing currently uses it in practice.)
2012-08-24 23:09:08 +00:00
rogerman 58faffaa26 xstring.cpp:
- Fix potential buffer overruns in FromUtf8() on non-Windows systems.
2012-08-24 23:04:42 +00:00
rogerman 1a48e36abb Cocoa Port:
- Fix bugs with window resizing with certain configurations of display orientation and using a minimum display size of less than 1x.
2012-08-24 04:20:59 +00:00
rogerman 1a1f92877c Cocoa Port:
- Fix bug where File menu items were being permanently disabled when the file migration sheet was used.
- Fix bug where closeRom: would occasionally not work correctly.
2012-08-23 20:00:57 +00:00
kode54 de4922c339 Fixed up project files 2012-08-22 04:49:04 +00:00
kode54 1b5a49d5b1 Replaced 7-Zip dynamic library with File_Extractor 2012-08-22 04:08:53 +00:00
mtabachenko 956b6d2f89 JIT:
- add simple CPU profiler;
2012-08-19 18:10:03 +00:00
rogerman 61ae419858 SPU:
- Fix r4306 regression that caused audio recording to fail if the user was using Dual SPU Synch/Asynch mode.
2012-08-19 07:13:57 +00:00
rogerman 8bc04ea411 Cocoa Port:
- Support full version reporting
- Tweak the About box to look nicer and give more detailed build info
2012-08-19 04:42:17 +00:00
rogerman 9f1744e2a3 Versioning:
- Detect more processor architectures
- Detect more compilers and report their version numbers
- Minor code cleanup
2012-08-19 01:11:32 +00:00
rogerman 9f1a392803 Cocoa Port:
- Video filters are now multithreaded! This significantly improves video filter performance on multiprocessor machines.
2012-08-17 23:58:48 +00:00
rogerman 2b82193674 Cocoa Port:
- Rewrite the display code to be much more flexible (the OpenGL blitter now uses cached vertices instead of calculating the vertices per frame).
- New feature: The DS screens can now be arranged horizontally as well as vertically.
- New feature: The order of the DS screens can now be set.
- Misc. code cleanup.
2012-08-17 06:56:35 +00:00
hi-coder df04471b41 autoload lua script if filename matches - ID: 3558045
added option for to autoload lua scripts when loading a rom. 
Config->Path Settings->Auto-load Lua scripts with ROM

Windows/English
2012-08-16 23:38:24 +00:00
rogerman 874b469cf0 Cocoa Port:
- Fix one more bug related to main window positioning, which occurs when the status bar is shown when the main window is too large for the desktop content area.
2012-08-16 00:51:06 +00:00
rogerman d960b4c061 Cocoa Port:
- The main window now remembers if the status bar is shown or hidden.
- Fix a bug with the status bar where if the status bar was to be shown when the main window was larger than the desktop's content area, then the status bar wouldn't show properly until the user resized or rotated the DS display. Now, the main window shrinks in size as necessary to accommodate the status bar.
2012-08-16 00:36:22 +00:00
rogerman fa17fa0554 Cocoa Port:
- Show the ROM icon and ROM name in the main window's title bar.
- Support OS X's standard document handling UI in the main window's title bar.
2012-08-15 22:44:31 +00:00
rogerman d0c70eccb3 Cocoa Port:
- Replace deprecated [NSSavePanel setRequiredFileType:] method when compiling for OS X v10.6 or later.
2012-08-15 22:03:12 +00:00
rogerman c148c440e1 Cocoa Port:
- Simplify method names in CocoaDSRom
- Change some names to improve code readability
2012-08-15 20:25:45 +00:00
rogerman bd1e0eec6a Cocoa Port:
- Add preprocessor macros for DEBUG and NDEBUG, since, apparently, Xcode doesn't do this for us :(
- Add Windows-style preprocessor macro for _DEBUG (AsmJit uses this)
2012-08-11 17:20:57 +00:00
rogerman 4f282c9499 Cocoa Port:
- Refactor video output code to not assume the use of SoftRasterizer
- Change SoftRasterizer-based video output in combo display mode to draw a separate quad for each DS screen, instead of drawing one big quad for both screens
- Begin adding preliminary support for the OpenGL 3D renderer
- Misc. code cleanup
2012-08-10 15:48:18 +00:00
rogerman 4e7b94f75e Cocoa Port:
- Add support for the new dynamic recompiler CPU emulation engine to the legacy port
- Legacy project build targets are now separated into distinct Intel and PowerPC builds
- Fix sound playback issue in the legacy port
- Add OpenGL 3D renderer support to the legacy port (but we're still use the software rasterizer, which is much faster and more accurate)
2012-08-08 04:16:26 +00:00
rogerman a5a03613f1 Cocoa Port:
- Add vertical sync feature.
2012-08-07 03:57:23 +00:00
rogerman dae7f8f2dd Cocoa OpenEmu Plug-in:
- Fix compiling by updating the sound processing code. Fixes bug #3549080 - http://sourceforge.net/tracker/?func=detail&aid=3549080&group_id=164579&atid=832291
2012-08-06 23:01:29 +00:00
rogerman 98329bf085 Cocoa Port:
- Add support for the new dynamic recompiler CPU emulation engine
- Xcode 3 project build targets are now separated into distinct Intel and PowerPC builds
- Rework build targets to always use the latest SDK (except for the PowerPC builds, which require v10.5)
- Remove build targets for specific OS versions other than v10.5 Leopard
- The Xcode 4 project is now compatible with Xcode 4.4
- Minor update to About window text
2012-08-06 22:18:21 +00:00
riccardom ffadf35be3 build: disable glade frontend by default
I can't see why having two gtk* frontends while i can't even
maintain one :|
2012-08-03 18:48:23 +00:00
riccardom 0523e85ca8 build: require intltool
We would file without it coping with po files anyway
2012-08-03 18:45:57 +00:00
riccardom f0fe543682 build: PKG_CHECK_MODULES already check for pkg-config
Remove some unneened checks
2012-08-03 18:37:18 +00:00
gocha ded6309e2b win32: Sound View - workaround for the animation of progress control since Windows Vista 2012-08-03 13:56:51 +00:00
rogerman 78e34d98f1 Cocoa Port:
- Fix errors in the OpenGLDisplayView's NSOpenGLPixelFormat attributes (NSOpenGLPFADepthSize=16, NSOpenGLPFADoubleBuffer=false).
- Fix a bug with the OpenGLDisplayView's init method.
- These changes fix the graphics display of the main window in OS X v10.8 Mountain Lion.
2012-08-03 06:54:57 +00:00
rogerman 54538f155d Cocoa Port:
- Fix bugs in the build script for merging universal binaries where the script would fail if the Xcode project was located in a directory that was not stored on the primary drive and if the drive had a space in its name.
2012-08-03 06:41:33 +00:00
riccardom 738c5c3c43 arm_jit: add missing include for offsetof() 2012-08-01 15:33:02 +00:00
pengvado eecf260b22 JIT: fix compilation
regression in r4330
2012-07-31 21:48:43 +00:00
riccardom 54fc86ced8 build: do not define HAVE_JIT before we are able to compile it :) 2012-07-31 21:33:06 +00:00
riccardom f5e00560a6 cli: use the unix driver instead of the base one
Modified version of patch #3550558 from someone with a google account :)
2012-07-31 19:48:25 +00:00
riccardom 24acedacd5 build: disable jit since arm_jit does not compile 2012-07-31 19:46:46 +00:00
riccardom ba5ee5e9d5 build: compile jit stuff onlyif HAVE_JIT is set 2012-07-31 19:46:04 +00:00
gocha de241c139f win32: memView - update address range check in WM_CHAR handler 2012-07-28 22:43:10 +00:00
mtabachenko 01030efe10 JIT:
- fix firmware boot;
- cleanup code;
2012-07-28 14:54:51 +00:00
gocha 2aeafe654e win32: memView - add Firmware view 2012-07-28 14:11:19 +00:00
gocha b3b782f810 win32: memView - fix initial address 2012-07-28 13:59:56 +00:00
gocha 3d33308fe7 win32: memView - fix not to crash at 16bit write and text dump, I guess MMU.ARM9_LCD read/write was used temporarily for debugging.
win32: memView - fix to update the screen immediately when big endian checkbox gets changed.
win32: memView - code generalization, it makes adding other regions to the memView easier than before.
2012-07-28 13:36:27 +00:00
gocha d47e9bd2d6 add stylus jitter on/off hotkey (default:on)
because the jitter hack can be annoying when TASing.
2012-07-27 10:31:23 +00:00
gocha 49eb575ccb define lua stylus functions with DEFINE_LUA_FUNCTION 2012-07-27 08:38:18 +00:00
rogerman 2e9eadd1de Cocoa Port:
- Update scanline video filter parameters introduced in r4316.
2012-07-24 20:18:26 +00:00
rogerman bdb3a756bc NDSSystem:
- When reading the ROM region info, do a proper bounds check to prevent out-of-bounds crashes if the region code is invalid. An invalid region code will now report as "Unknown".
2012-07-24 20:12:46 +00:00
rogerman 167234d171 NDSSystem:
- In NDS_Init(), move open brace out of #ifdef to help Xcode 3 properly parse the file.
2012-07-24 20:08:38 +00:00
zeromus 1251e7cab7 win32-add stdout redirector checkbox to lua console 2012-07-24 07:09:27 +00:00
mtabachenko 4d1f041cfc JIT:
- fix THUMB CMN instruction;
- fix timings when use R15;
- remove next instruction attribute;
2012-07-15 10:28:57 +00:00
zeromus 0ea0e94ab4 tweak scanline filter to be more versatile 2012-07-12 05:49:13 +00:00
zeromus faf986b559 win32-shrink new .rc static text to keep under 256char limit 2012-07-11 02:07:57 +00:00
zeromus 22c905d9d8 win32-describe jit option in more detail in emulation options dialog 2012-07-10 20:03:17 +00:00
pengvado 1c88873788 fix linux build
regression from r4291, which accidentally reverted a hunk of configure
2012-07-10 19:53:29 +00:00
mtabachenko 8ca63cbb54 2012-07-10 12:49:05 +00:00
mtabachenko 64073a2558 - merge JIT branch into trunk;
- remove JIT branch;
2012-07-10 12:39:40 +00:00
rogerman d9f13c57c0 Cocoa Port:
- Make sound processing thread-safe. Fixes bug #3538263. < http://sourceforge.net/tracker/?func=detail&aid=3538263&group_id=164579&atid=832291 >
2012-07-09 23:58:05 +00:00
rogerman 3f320792e5 SPU:
- In SPU_Emulate_core(), allow custom sound cores to use their own sample fetch logic.
- In SPU_Emulate_user(), allow custom sound cores to use their own sound post-process logic.
- Refactor existing fetch/post-process logic into SPU_DefaultFetchSamples() and SPU_DefaultPostProcessSamples(), respectively.
2012-07-09 23:50:43 +00:00
rogerman 17d3c59485 Cocoa Port:
- Clean up some #include stuff in ringbuffer.cpp/.h
- Add/fix some comments in ringbuffer.cpp/.h
- Add accessor for _bufferFillSize
2012-07-09 22:34:25 +00:00
zeromus b209420a38 win32-apply patch #3540789 (Rotation Hotkey(s)) 2012-07-07 22:44:21 +00:00
rogerman 4f2b3feee4 Cocoa Port:
- Fix thread-safety issue when changing the execution speed.
2012-07-04 05:17:48 +00:00
zeromus 5cda370b9d refine timing of swapbuffers more. fixes 098 regression in devil survivor 2. 2012-07-03 17:32:34 +00:00
zeromus 0910dc507a improve (very coarsely; it isnt perfect) timing of swapbuffers process to at least sequence it correctly with regards to vblank. fixes #3538901 DBZ Kai Butouden 3d on character select 2012-07-01 08:26:30 +00:00
zeromus a2e9667964 spu-fix 8bit data to be signed 2012-06-25 20:23:53 +00:00
zeromus ffd4c5fb81 gpu-fix catastrophic sprite rendering regression from r4289 2012-06-23 20:02:33 +00:00
zeromus e9a12555d1 block writes under 0x02000000 on arm7 to eliminate chance of mirrored bios getting clobbered; fix arm7 dma of 0 bytes to actually be 0 bytes (instead of 0x200000 bytes as on arm9) 2012-06-22 19:46:22 +00:00
zeromus 1fb288cbda change vram bank A-D conflict priorities, since we found a test case where they were wrong. 2012-06-20 21:08:24 +00:00
zeromus ca005cc3e7 spu-run reads through full memory mapping system. fixes some buggy homebrew experiments which were playing sounds from LCD memory, as well as other potential (unlikely) lurking bugs which wouldve been hard to find. 2012-06-20 19:01:06 +00:00
mtabachenko 5caa5b3df4 - fix GPU init (fix compiling builds); 2012-06-14 11:45:36 +00:00
zeromus ca68894e48 gpu-ahhhhhhhhh purge more old crud 2012-06-13 19:47:27 +00:00
zeromus 130623e6ab gpu-remove endian swapping struct balderdash from sprite rendering 2012-06-13 19:41:54 +00:00
zeromus 811b94de9b apply patch #3534136 to fix lua's readbyterange function 2012-06-10 16:11:15 +00:00
zeromus 4a6c59e018 win32-fix soundview in x64 2012-05-26 22:18:46 +00:00
riccardom 3ad7bec287 configure: remove GTK_MACOS_HACK
Not needed anymore sicne we have a great mac os x frontend
2012-05-20 14:07:32 +00:00
riccardom 848c19f3b0 configure: always set PO_DIR and PO_MAKEFILE
This should avoid to do releases without po/
2012-05-20 13:53:52 +00:00
rogerman ed51d86bdc Cocoa OpenEmu Plug-in:
- Reorder NDS input enum to match the latest revision of the OpenEmu NDS system plug-in.
2012-05-09 05:18:46 +00:00
riccardom 532358c562 Update GPL 2.0 License #1
Update references to GPL outside src/

See bug #3521565
2012-05-08 17:47:26 +00:00
zeromus aa1afebfc1 fix red line for touch screen input display 2012-05-05 16:30:09 +00:00
mtabachenko 167c85ae4b JIT:
- fix crash windows x64 build;
2012-05-01 10:37:59 +00:00
rogerman 1af87a2a68 Cocoa Port:
- Update all info .plist files to v0.9.9 for future SVN builds.
- Update translation scripts to use absolute file paths from $SRCROOT instead of assuming that the path is relative to $SRCROOT.
- Add a new build script that creates an application package that merges the ppc and ppc64 binaries from an Xcode 3 universal binary build to the i386 and x86_64 binaries from an Xcode 4 Intel-only build. Basically, this makes a build that combines the best of both builds. This means that everyone can now easily make a build that is more like an official release build.
2012-04-18 03:21:29 +00:00
zeromus a775c75a69 gpu-fix bug leftover from r4073/r4227 which caused some games (AC:WW) to fail to clear their backdrops depending on BLDCNT configurations (fixes #3518648) 2012-04-17 18:37:46 +00:00
zeromus d5003c4db6 bump version number in trunk for future svn builds 2012-04-09 20:34:07 +00:00
riccardom 97699cd7dd po: Add some windows file to POTFILES.skip
So it looks like some gettext stuff got into windows/ and
our build system is not happy about it. So ignore them.
2012-04-09 18:42:49 +00:00
riccardom c5346930fd Fix autogen.sh
These files are needed for autogen.sh so please do not
remove them :)
2012-04-09 18:39:02 +00:00
yabause 9205cf987d Removed src/cocoa/Makefile from configure'd files. 2012-04-09 07:55:13 +00:00
yabause 0f3feb7f51 Some fixes for autotools based distribution:
- removed README.TRANSLATION from distributed files
- moved cocoa from SUBDIRS to EXTRA_DIST as it seems the cocoa
  port doesn't use autotools to build
2012-04-09 07:24:56 +00:00
mtabachenko 07fde97215 core:
- fix crash ADVANsCEne DB import;
2012-04-02 22:01:55 +00:00
zeromus fa7710b3ff authors file needed updating 2012-04-02 16:45:41 +00:00
zeromus fcc986b068 fix 2005 vcproj and version number 2012-04-02 16:20:06 +00:00
rogerman 24c859fe44 Cocoa Port:
- Fix building in all Xcode projects by removing the now defunct README.TRANSLATION file.
2012-04-02 06:25:05 +00:00
rogerman 037e08f1ee Documentation:
- Add the System Requirements section to the Read Me for Macintosh.
2012-04-01 05:44:21 +00:00
rogerman 15f022f90a Documentation:
- Delete obsolete NEWS and TODO files.
2012-04-01 04:33:40 +00:00
rogerman 45ff50478c Documentation:
- Fix line reference in README.
- Delete README.TRANSLATION, now that the information is obsolete.
2012-04-01 04:28:04 +00:00
rogerman afccc7226b Documentation:
- Update formatting, style, and licensing of README.
- Add the actual IRC link in the Read Me for Macintosh.
- Do some minor formatting fixes in the Read Me for Macintosh.
2012-04-01 04:12:22 +00:00
rogerman ad1a8ee505 Documentation:
- Fix the line number references in the Read Me for Macintosh.
2012-04-01 02:44:23 +00:00
rogerman f74459ea46 Documentation:
- Update Read Me for Macintosh to reflect current knowledge, procedure, support references, and licensing.
2012-04-01 02:32:25 +00:00
zeromus b4462b3862 update changelog 2012-03-30 19:21:43 +00:00
zeromus 04f8434bb1 license cleanup (but none of the linux port files yet) 2012-03-30 08:27:53 +00:00
zeromus cf6345497b gpu-backtrack a little bit from r4073, which introduced bugs involved with flashing colors during fully-faded transitions between game modes. i left insufficient records at the time to know what i was trying to fix by r4073, so I can't double check it, but I think this checkin is even better than before while fixing the noted regressions. 2012-03-30 05:50:39 +00:00
zeromus 25b77c1b31 win32-did not mean to check in this hack 2012-03-30 05:27:10 +00:00
zeromus a67f084bbe other license cleanup 2012-03-30 04:18:23 +00:00
zeromus 16dd75b1e4 fix regression from r4111 in store/restore matrix operations regarding stack size and overflow. also fix regression from other time in the handling of push/pop commands regarding stack size and overflow (fixes sims games and spiderman games). also a bunch of unrelated license cleanup i foolishly mixed in here 2012-03-30 04:11:00 +00:00
rogerman d546cd53c5 Cocoa Port:
- Disable SSE4.1 and SSE4.2 in build settings.
- Disable SSSE3 in build settings for 32-bit builds (remains enabled for 64-bit).
2012-03-30 03:53:33 +00:00
zeromus 30f6881980 core-switch some hardcoded PROCNUM checks in opcode handlers to checks against the arm architecture version, which is what they really were 2012-03-29 23:03:06 +00:00
zeromus 1adec8da24 re-time LCD state machine to conform more closely to reality. also, delay IRQ for vmatch and vblank by 1 dot from their flag settings to act very crudely like a pipeline and fix games with race conditions between flag-read and irq by allowing the flag-read to win sometimes (e.g. egokoro kyoushitsu). check for regressions in any raster fx. 2012-03-29 22:45:05 +00:00
mtabachenko b2547e767b core:
- fix swi 0x03 (CRC16) R3 contains the last processed halfword;
2012-03-29 21:01:24 +00:00
zeromus f18e4a4df2 core-add ldrex and strex instructions to arm 2012-03-20 01:18:01 +00:00
mtabachenko afc0eef0b7 core:
- fix MRC instruction;
2012-03-19 00:56:12 +00:00
riccardom 8fecdad891 gfx3d.cpp: correct memset size for vertlists and polylists 2012-03-18 16:39:47 +00:00
riccardom 0093cc9648 mc: correct assignment to the right variable
This was introduced in r3875.
2012-03-18 16:25:37 +00:00
riccardom 2bcac4e190 GPU: add default case in GPU::setFinalColorBG draw switch
In practice it cannot happen but this silences more than
100 lines of gcc warnings so...
2012-03-18 15:53:33 +00:00
riccardom a931324050 Fix compilation with gcc 4.7
Add missing headers

From Andrea Musuruane, #3507136
2012-03-18 10:08:21 +00:00
riccardom 855a6db00f mc: add some brackets to make gcc happy and code easier to follow 2012-03-17 20:01:50 +00:00
riccardom b2467a6032 metaspu: make GetAlignedBufferSize static 2012-03-17 19:56:32 +00:00
riccardom d6935d07f7 mmu: put braces to avoid gcc warning us we may are doing something fishy 2012-03-17 19:53:35 +00:00
riccardom 4134d2556b wifi: put WIFI_RXQueuePacket under EXPERIMENTAL_WIFI_COMM 2012-03-17 19:48:47 +00:00
riccardom 35bde51221 FIFO: remove unused variable proc_remote 2012-03-17 19:46:57 +00:00
riccardom a5ba9829c5 commandline: make mytoupper static 2012-03-17 19:40:16 +00:00
riccardom 6e86aa288a commandline: correct autodetect_method check 2012-03-17 19:39:26 +00:00
rogerman 7f6e9074f4 Cocoa Port:
- Fix potential deadlock on application exit.
- Misc. code cleanup.
2012-03-16 04:21:28 +00:00
rogerman f6f1678eca Cocoa Port:
- Throttle execution speed using mach_wait_until() instead of usleep(). This improves execution timing, and reduces screen tearing when running the video at >= 60FPS.
- Improve thread safety when changing the execution speed.
- Do some miscellaneous minor optimizations to the execution loop and frame skip.
2012-03-13 01:59:32 +00:00
rogerman 7ae952f366 Cocoa Port:
- Reverse locking mechanics for the core emulation loop's producer/consumer threads. (Instead of the producer telling consumers to lock, now consumers check if the producer is locked.)
- Add additional error check for the execution state within the core emulation loop.
- Reduce spin lock time when setting the GPU state flags.
- Improve thread safety when changing the execution state.
2012-03-10 20:42:49 +00:00
rogerman 0fdb9308c1 Cocoa Port:
- Lower the Xcode and Interface Builder version requirements from v3.2 to v3.1 in the Legacy project.
- Clean up build settings in the Xcode 3 project.
2012-03-09 04:27:50 +00:00
wntrmute 86408a37ab Xcode 3.1.4 has llvm gcc 4.2 2012-03-07 20:10:59 +00:00
rogerman 753bb09007 Cocoa Port:
- Also lower IB version requirements to IB v3.1.
- Add a build target that forces the standard app to build with GCC in the Xcode 3 project.
2012-03-07 17:18:13 +00:00
rogerman 45f01066c5 Cocoa Port:
- Lower Xcode version requirements to Xcode v3.1 in the Xcode 3 project.
2012-03-07 16:32:00 +00:00
rogerman 7ca5067856 Cocoa OpenEmu Plug-in:
- Change system identifier from openemu.system.nintendods to openemu.system.nds.
- Integrate touch pad support.
2012-03-07 08:27:48 +00:00
rogerman 8839973caa Cocoa Port:
- Reduce spin lock time when setting the displayType property.
2012-03-07 04:49:59 +00:00
rogerman e214a9b6c7 Cocoa OpenEmu Plug-in:
- Ensure that the OpenEmu data directory exists before ROM loading.
- Add future support for changing the DS display mode. (Not yet implemented.)
- A lot of general code cleanup.
2012-03-07 02:25:22 +00:00
rogerman 5b11947f77 Cocoa OpenEmu Plug-in:
- Integrate OpenEmu's audio system with the OpenEmu Plug-in. (Special thanks to jweinberg, clobber, and Psy from the OpenEmu team!)
- Make input handling asynchronous through the Distributed Object system.
- Rename OpenEmuSoundInterface.mm/.h to OESoundInterface.mm/.h.
- Some minor cleanup to global defines.
2012-03-04 08:00:29 +00:00
rogerman 18a5907a1e Cocoa OpenEmu Plug-in:
- Update method names to match the newest revision of the OEGameCore API.
- Return audioBufferCount==0 since we're using DeSmuME's sound handling code for now.
- Change the 3D rendering core to the null core on dealloc.
2012-03-03 21:18:27 +00:00
rogerman 0b00a16f4e This commit adds support for building an emulator core plug-in that is compatible with OpenEmu (http://openemu.org). Please note that this is completely separate from our official port. You may see a different feature set when using DeSmuME in our official port vs. using DeSmuME in OpenEmu. Due to this reason, commit logs will distinguish each build target as "Cocoa Port", which is our official port, and "Cocoa OpenEmu Plug-in", which refers to the plug-in for OpenEmu.
Cocoa OpenEmu Plug-in:
- Add a build target for the OpenEmu Plug-in to the Xcode 4 project.
2012-03-03 03:45:30 +00:00
rogerman 8a7fd2445f Cocoa Port:
- Refactor audio playback code for better code modularity.
- Improve overall performance of audio playback.
- Fix compile issue with the legacy build.
- Add a method for setting the emulator core's file paths directly by using a dictionary. This method can be used as an alternative to reading FileTypeInfo.plist.
- Add file handling support for the upcoming OpenEmu Plug-in build target.
2012-03-03 02:16:24 +00:00
rogerman ab53131bd8 Cocoa Port:
- Fix bug with Import ROM Save File where .sav files weren't being recognized.
2012-02-27 05:35:17 +00:00
rogerman 80b775730b Cocoa Port:
- Silence compiler warning when compiling for Mac OS X v10.6/v10.7.
2012-02-27 05:33:41 +00:00
rogerman a537f3c166 Cocoa Port:
- Significant improvements to auto frame skip! It now uses less CPU, and timing is much smoother and more accurate.
- Some minor code cleanup for the emulation core object.
2012-02-25 22:26:12 +00:00
mtabachenko dfb4e04a0d - ops, forgot file; 2012-02-24 14:29:08 +00:00
mtabachenko f864e4386c winport:
- rewrite import backup memory;
2012-02-24 14:22:14 +00:00
rogerman ee6ee321a4 Cocoa Port:
- Fix compiling when using Clang v3.1.
2012-02-20 21:09:00 +00:00
mtabachenko 266eccb5d5 winport:
- fix initialize autodetect_method (revert  r4101);
2012-02-20 19:47:58 +00:00
zeromus d628ede53b just a tiny bit of cleanup 2012-02-20 19:35:44 +00:00
zeromus a6333a2d02 update subwcrev.exe to somewhat newer version 2012-02-20 19:18:38 +00:00
rogerman d881160c03 Cocoa Port:
- Change the app identifier from "com.DeSmuME.DeSmuME" to "org.desmume.DeSmuME".
- Change the app category from Utilities to Entertainment.
2012-02-20 18:40:32 +00:00
rogerman 416a5e18a1 Cocoa Port:
- Reimplement Objective-C memory management by using the standard patterns for retain/release mechanics. This fixes several real and potential memory leaks.
- Additional miscellaneous code cleanup and fixes.
2012-02-20 17:00:13 +00:00
rogerman 1fdf99cf1a Cocoa Port:
- Fix potential deadlock upon application exit when running on Mac OS X v10.7.
2012-02-13 22:27:28 +00:00
rogerman c7fd9f79b0 Cocoa Port:
- Based on user suggestion, rename menu option "Tools > Show Support Folder in Finder" to "Tools > Show Game Data Folder in Finder".
2012-02-13 06:22:56 +00:00
rogerman e55ad2f34e Cocoa Port:
- When detecting an analog input's on state, use the upper/lower third of the range instead of the upper/lower quarter of the range. This helps improve compatibility with certain joysticks.
- Perform an integer length bounds check before calling IOHIDValueGetIntegerValue(), since this function will cause a crash if the returned integer value is very large. This prevents crashing when using certain controllers, such as the PS3 controller.
- When mapping inputs in Input Preferences, require the user to hold the input in its on state for at least 0.1 seconds. In addition, the user must also perform a full on-off state transition with the input. This helps stabilize jittery inputs, and also helps ignore unintentional inputs from devices that constantly throw a large number of signals, such as the PS3 controller's accelerometer.
- When mapping inputs in Input Preferences, remove all previous mappings for the particular control before mapping the input. Since the UI doesn't yet support multiple bindings per control, the previous behavior was confusing for users.
2012-02-13 05:48:10 +00:00
zeromus 239301d405 add zlib 1.2.6, make at least one of the vcproj use it for testing, and fix ROMReader to work with zlib 1.2.6 2012-02-10 19:58:06 +00:00
rogerman 8fd633a0c9 Cocoa Port:
- Add an XCode 4 project with a Mac OS X v10.7 build target.
- Update build settings for XCode projects: Disable symbol strip, enable dead code strip, enable prebinding.
- Include OpenGL gl.h header to fix compiling with Mac OS X v10.7.

libfat:
- Don't define strnlen() on Mac OS X v10.7.
2012-02-09 21:33:57 +00:00
rogerman 062f54806c Cocoa Port:
- There is a bug where if the user changes cheat items using the cheat list directly, the changes will not save to file. (However, any applied changes using Cheat Settings are saved to file as intended.) Workaround behavior: Save the cheat file upon ROM unloading.
2012-02-08 01:34:20 +00:00
rogerman d3ed81a259 Cocoa Port:
- Fix positioning of UI element in the R4 Cheat Database sheet.
2012-02-03 17:31:22 +00:00
rogerman 21680f3c71 Cocoa Port:
- Fix UI element sizing/positioning in the File Migration window.
- Rewrite text in ROM save file migration sheet so that the reading flows better.
- Update tooltip info to better reflect current knowledge from testing.
- Misc. grammatical fixes to UI elements.
2012-01-31 20:05:18 +00:00
rogerman b1fbd863c5 Cocoa Port:
- Fixed bug where applying an internal cheat would cause the byte size to reset.
2012-01-21 00:31:06 +00:00
rogerman b78912e1c3 Cocoa Port:
- Update XCode project and videofilter.h for filters relocation.
2012-01-20 05:20:46 +00:00
zeromus 8eba5500cb fix vcproj for filters relocation 2012-01-20 05:15:35 +00:00
zeromus 1487db8cdc move filters out of windows directory since theyre now used by the cocoa port 2012-01-20 05:13:01 +00:00
zeromus 3d2e656e83 fix buffer overflow in epx filter 2012-01-20 05:10:23 +00:00
rogerman 0d4811a028 Cocoa Port:
Here it is folks -- A brand new Cocoa port! This is a complete remake from the ground up, and constitutes about a year's worth of coding and testing, so enjoy! This log entry only includes a summary of the new features compared to v0.9.7. Due to the number of changes that have taken place, any bug fixes and developer-related details will not be reported here.

User Experience:
- Added many icons throughout the application to improve the visual appearance and provide easier visual cues.
- Added a toolbar and a sound volume slider to the emulation window.
- Added mouseover tooltips for most of the controls.
- Added the ability to change the emulation window display mode. The user can choose to display only the main screen, only the touch screen, or both screens.
- Added the ability to rotate the emulation window display to any arbitrary rotation angle.
- Added a bilinear filtering option for the display output.
- Added support for using video filters on the display output.
- Added the ability to copy a screenshot to the clipboard using Edit > Copy.
- ROM Info now provides much more ROM information in a better organized panel.
- The emulation window's status bar now gives more user feedback.
- In the emulation window, you can now click close to unload ROMs and quit the application.
- Externally loaded save states now behave more like typical document files: they ask to save upon close/quit, behave properly using Save and Save As, and support revert.

Emulation System:
- A modernized program architecture brings substantial performance improvements, especially on multiprocessor/multicore machines. This brings the Cocoa port much closer to the Windows port in terms of performance.
- Exposed all emulation, firmware, SPU, and SoftRasterizer options in the user interface. This should help users in configuring DeSmuME to work with many ROMs that were unusable before.
- Added support for using BIOS and firmware images.
- Added support for completely disabling GPUs (Tools > View Layers > Main GPU and Tools > View Layers > Sub GPU menu options).
- Added the ability to change the number of 3D rendering threads.
- Added support for using an ADVANsCEne database to autodetect the ROM save type.

Cheat System:
- Added a cheat manager, which allows the user to use cheat codes. DeSmuME internal cheats and Action Replay cheats are both supported.
- Added the ability to run a cheat search.
- Added the ability to import Action Replay cheats from an R4 Cheat database.

Input System:
- Any non-modifier key on the keyboard may now be used for the controller input.
- Added support for using USB HID devices for the controller input. Yes, you can use your favorite gamepads and joysticks now.
- All emulated controls can now be mapped, including Lid and Debug.
- Microphone input is now partially supported. Internal and white noise samples can now be generated for certain ROMs that require microphone input. For now, this should help the user complete certain games that rely heavily on microphone input, such as "The Legend of Zelda: Spirit Tracks".

File Handling:
- Added a file migration assistant to help the user migrate their old files to the current version of DeSmuME.
- Added support for importing and exporting ROM save files in RAW and No$GBA formats.
- Added the Tools > Show Support Folder in Finder menu option, which opens DeSmuME's Application Support folder. This exists as a convenience for Lion users.
- Added new icons for DeSmuME's files.


Note: The XCode Legacy project is now deprecated, and should only be used to make unofficial Tiger builds. Any new builds should use the XCode 3 project.
2012-01-20 05:09:13 +00:00
rogerman 0247b86c2c Cocoa Port:
- In the XCode legacy project, add the English MainMenu (Legacy).strings file to the output list of the localization build scripts.
2012-01-20 02:47:57 +00:00
rogerman 4e20669538 mc.cpp:
- Make ADVANsCEne string array (const char *) to shut up compiler warning.
2012-01-19 05:21:46 +00:00
rogerman 51ac52af5c Cocoa Port:
- Add the new firmware config icon to the XCode legacy project. It should work now!
- Update strings to better reflect what should be shown in the user interface.
2012-01-19 05:19:48 +00:00
rogerman 656cdca7b0 Cocoa Port:
- Merge new strings from upcoming Cocoa port into Localizable.strings.
2012-01-19 04:46:38 +00:00
rogerman 67aabb5fbc Cocoa Port:
- Add new IPC utility method - messageSendOneWayWithMessageComponents:msgID:array:
2012-01-19 04:45:37 +00:00
rogerman 46958e2bb5 Cocoa Port:
- Update file handling code for ROM save exporting to handle more file formats.
2012-01-19 04:42:55 +00:00
rogerman 83847bf9a1 Cocoa Port:
- Add new icon for firmware config files (.dfc).
- Fix the appearance of cheat file icons in the Finder.
- Update copyright year.
2012-01-19 04:40:15 +00:00
rogerman 4f4704b486 SPU:
- Improve performance of cosine interpolation (making it as fast as linear).
2012-01-18 04:25:49 +00:00
rogerman 09985b15a8 Cheat System:
- Rename private method XXcodePreParser() to XXCodeFromString() and make public static.
- Add methods getListPtr() and getItemByIndex() to return pointers to the actual cheat items in the array list.
- Do some minor code cleanup.
2012-01-18 04:02:08 +00:00
rogerman a164fca4c5 Cocoa Port:
- Make InfoPlist.strings localizable.
- Update copyright year in InfoPlist.strings.
2012-01-17 08:12:12 +00:00
rogerman 096baef750 Cocoa Port:
- Fix a minor bug in file handling for the Tiger build.
2012-01-17 01:11:34 +00:00
rogerman 46d9ab17bf Cocoa Port:
- Remove one of the now unused XCode project files.
2012-01-17 01:03:28 +00:00
rogerman 2212f36cb0 Cocoa Port:
- Fix bug in GetNormalPointFromTransformedPoint() function where the angleDegrees parameter was actually in radians. It's now in degrees, as intended.
2012-01-17 01:02:38 +00:00
rogerman 5f2dd3e4c2 Cocoa Port:
- Update file handling utility methods to use external dictionary lookups instead of hard-coded values.
2012-01-17 01:00:48 +00:00
rogerman 48a849adba Cocoa Port:
- Rename legacy files to distinguish them from new code.
- Set svn to ignore xibs from non-English translations.
2012-01-11 23:31:12 +00:00
rogerman a1f043ecc9 Cocoa Port:
- Rename existing XCode project to DeSmuME (Legacy).
2012-01-11 23:24:17 +00:00
rogerman b0fef6d6af Cocoa Port:
- Delete files that have been obsoleted by the move to xib-based format in r4149.
2012-01-11 20:34:25 +00:00
rogerman e612203da4 Cocoa Port:
- Updated the English xib file. We kinda needed this in the last commit, so oops!
- Fix bug in translation build scripts that could cause build errors.
2012-01-11 20:29:53 +00:00
rogerman 02acfa3fe3 Cocoa Port:
- Although the Cocoa port looks very similar to the last update, there have been a lot of changes under the hood! Lots of code has moved around, lots of refactoring has been done, and lots of new code was copied from the upcoming Cocoa code base. Due to this, there have been a few collateral improvements as a result.
- Convert main.mm back to a plain Obj-C file, and remove all code from it. It has now been reverted back to its original empty form.
- Move all app related stuff to appDelegate_legacy.mm/h.
- Move all emulation window related stuff to emuWindowDelegate_legacy.mm/h.
- Because we're now using xibs, translations have been reworked. The English xib is the base xib, and translations now use .strings files to make modified copies of the English xib at compile time.
- Add user interface icons.
- Make the Custom Speed Limit Window panel more functional and look nicer.
- Add new Tools > Show Support Folder in Finder menu option, which opens DeSmuME's Application Support folder. This exists as a convenience for Lion users.
- Remove the View > Constrain Proportions menu option. Now, DeSmuME behaves as if this option is always enabled.
- Combine Emulation > Execute and Emulation > Pause into a single menu item.
- Status text now gives more user feedback.
- Add a sound volume slider to the emulation window.
- Remove the Sound menu.
- In the main emulation window, you can now click close to unload ROMs and quit the application.
- Add ability to save screenshots in JPEG 2000 format.
- Add ability to copy a screenshot to the clipboard using Edit > Copy.
- BUG #3394244: Fix bug where touch coordinates did not map correctly on rotated screens.
2012-01-11 19:59:17 +00:00
rogerman 0bcaded804 Cocoa Port:
- Another file handling code update that I missed.
- Integrate DeSmuME's directory structure into this port.
2012-01-06 16:47:12 +00:00
rogerman a46431a236 Cocoa Port:
- Update more old file handling code to use the new methods added from the last commit.
2012-01-06 09:52:23 +00:00
rogerman cf86f83fb0 Cocoa Port:
- Convert cocoa_util.m from Obj-C to Obj-C++, and add many new utility methods.
- Remove obsolete globals.h file, and convert needed C functions into Obj-C methods in cocoa_util.mm.
- Add cocoa_file.mm for general file handling methods.
- Change all file handling to use NSURLs instead of NSString paths.
- Refactor existing code to use the new methods.
- Remove obsolete UI code.
- Move Tiger-specific compatibility code to a new file, macosx_10_4_compat.h.
2012-01-06 08:53:13 +00:00
rogerman 5f0805e306 Cocoa Port:
- Change Interface Builder format from .nib to .xib.
- Rename the main IB file from "MainMenu" to "MainMenu (Legacy)".
2012-01-05 00:14:32 +00:00
rogerman c07ba69e7e Cocoa Port:
- Fix compile issue for the Tiger target build.
2012-01-05 00:04:12 +00:00
rogerman 1f218e95c5 Cocoa Port:
- Add new icon for ROM cheat files (.dct).
2012-01-04 21:15:24 +00:00
rogerman c02ffe1548 Cocoa Port:
- Update necessary files that I forgot in the last commit.
2012-01-04 21:13:13 +00:00
rogerman 719e210de6 Cocoa Port:
- Major rewrite of the OS X Core Audio backend code! This brings performance improvements, bug fixes, and general code cleanup.
- Remove all Objective-C code from sndOSX.mm, and change into a pure C++ file.
- Fixed audio noise issues that intermittently occurred while the emulation was running. This most often occurred after a ROM has been loaded.
- Fix possible crash on application exit.
2012-01-04 21:10:19 +00:00
rogerman 861308954f Cocoa Port:
- Bring back the build target for the v10.4 SDK in the XCode project. (This is for legacy support only. Do not use for new builds -- use the v10.5 build target instead.)
- Add "Info (Debug).plist", and remove the custom build script phase for adding external files to the .app package, replaced with file references in the XCode project. This fixes Debug builds so that they can compile again.
- Use UTIs in addition to file extensions for determining file types.
- Add new icons for ROM Cartridge Images (.nds), ROM Saves (.dsv), and Emulation Save States (.dst).
- Change default compiler to Clang/LLVM (but continue to use GCC 4.2 for ppc64 build).
- Add instruction scheduling optimization to ppc and ppc64 builds, slightly improving performance on PowerPC machines.
2011-12-28 23:50:09 +00:00
luigi__ 97b5a7ed1d MMU: add (experimental) support for writing to VCount. This is apparently required for proper multiplayer sync. 2011-12-25 18:17:36 +00:00
luigi__ 07ed2680a5 Christmas commit!
Wifi: adhoc: goal not reached but this is definitely a step closer. Adding some RX statistics and an experimental MP reply functionality, among others.
Mario and Luigi communicate a bit more but connection still breaks.
2011-12-25 14:59:52 +00:00
zeromus b547e6bd3b some matrix code cleanup leftover from olden times of more floating point in gfx3d 2011-12-12 21:37:06 +00:00
zeromus 55c0d8e32f win32-fix memoryview tool, which i broke some time ago 2011-12-11 20:28:13 +00:00
zeromus e3a1c15e83 add twltouch demo to tests directory 2011-11-29 23:13:12 +00:00
zeromus a2c7355b97 apparently we must support geriatric compilers for xcode, so do not use an enum size for new consoletype value or else it will get confused 2011-11-29 23:12:26 +00:00
zeromus 3f674a7cf6 fix minor bug in nds header decryption created when porting from ndstool (pointed out by #3445390) 2011-11-29 21:47:53 +00:00
riccardom ce4d0c9e10 task: use mac os x task implementation on other !WIN platforms too.
Thanks rogerman and pengvado.
2011-11-26 16:16:55 +00:00
zeromus 2d7b42dbf2 fix host memory clobber crash in new TSC code when the arm7 is acting wacky 2011-11-23 21:15:23 +00:00
zeromus 22a69c92d8 clarify debug console vs console type and add dsi main memory mapping 2011-11-23 20:32:12 +00:00
zeromus e101b54d21 * base DMA time accounting on MMU_timing infrastructure for slightly better estimate, and add system to lock ARM9 bus while DMA occurs. still not completely realistic, but fixes a number of freezes
* fix multithreading bug in rasterizer exposed by some OSX builds a few weeks ago
* remove --dsimode and --debug-console and replace with --console-type={fat,lite,ique,debug,dsi}
* add a zany hack to jitter the stylus position for frames which read it more than once; no human can hold his hands that still, and CSI polled for and demanded sub-frame touch motion for swipe gestures, it seems. this is a bit fishy.. it is still open for discussion.
* track raw ADC coords for NDS and screen coords for DSI independently.
2011-11-23 10:32:27 +00:00
rogerman ffcca74387 task (Mac OS X):
- Now uses a bool flag to check the thread state instead of checking the thread variable directly. This should make the code more compatible between FreeBSD-based OSes and Linux-based OSes.
- Changes the thread variable visibility from public to private.
2011-11-14 23:11:21 +00:00
zeromus c87c49c17d someone decides to check for null before deleting. someone else thinks its an error to do that. removing them to make ticket #3413784 go away. 2011-11-14 08:12:36 +00:00
riccardom bfab5b230f windows/filter: fix use of unitiliazed variable
Spotted by Merkil using cppcheck (#3413784)
2011-11-13 17:54:11 +00:00
riccardom 598baf257f path: shut up cppcheck " Unusual pointer arithmetic" error
[src/path.h:252]: (error) Unusual pointer arithmetic
2011-11-13 17:40:12 +00:00
riccardom f26e86a77f task: Add Mac OS X backend (#3414787)
As of October 2011, Mac OS X does not support named semaphores.
So instead of trying to rework the existing Linux code to work
with semaphores in both OS X and Linux, it's easier to reimplement
with pthread mutexes for just OS X.

From rogerman.

xrmx: fixed gcc warnings for storing NULL in a pthread_t.
Also while at it moved the includes on top.
2011-11-13 14:55:25 +00:00
riccardom f3d37a17a1 GPU: Fix compiler warnings (#3436995)
gcc throws some compiler warnings in GPU.cpp because it's
passing NULL for an u32 argument. NULL is only used for
pointers, correct should be to pass the numeric value 0.

From: hanno boeck
2011-11-13 13:51:23 +00:00
riccardom 1aa9ff3595 cheatSystem: free() needs stdlib.h 2011-11-13 13:45:52 +00:00
rogerman d4d045f9be - Allows the NDS input system to work on big-endian processors. 2011-11-07 07:29:53 +00:00
zeromus a51e28b3b6 dsi tsc work 2011-11-04 05:24:24 +00:00
zeromus 68d69a6d1d win32-as requested, a larger cheat list dialog 2011-11-01 21:23:46 +00:00
rogerman 9012f5426f Cheat System:
- Fixed a crashing bug in certain situations when if a bad AR cheat code is applied, would then cause an invalid memory access.
2011-10-29 20:18:55 +00:00
rogerman cf621a6665 - Fixed a crashing bug when reading from a cheat database, which would cause invalid memory accesses on 64-bit systems.
- Fixed a dangling pointer bug when reading from a cheat database.
- Fixed many potential buffer overflow issues related to C-string usage.
- Increased the memory allocation for cheat items to account for very large database entries. Also, the new behavior of any exported database entry that attempts to exceed the memory allocation is: Too big code size will not read. Too big description will be truncated.
2011-10-28 07:33:38 +00:00
riccardom d81bfe29de configure.ac: add a switch to disable gtk-glade frontend 2011-10-09 14:40:28 +00:00
riccardom 4bd6b84fef configure.ac: cleanup pkg-config stuff
Check pkg-config early so we fail early. So remove all the
module detection from inside pkg-config macro availability.
Group together pkg module check and autoconf / automake
related stuff.
2011-10-09 14:25:26 +00:00
rogerman b72acc0959 - Fixes compiling when trying to run a build target using the v10.6 SDK. Addresses bug #3418878.
- Adds a build target using the v10.6 SDK to the XCode project.
- Changes the default compiler from GCC 4.2 to LLVM w/ GCC 4.2. (Slightly improves execution speed.)
2011-10-07 06:44:06 +00:00
riccardom d6525883d9 windows: fixup filter compilation with gcc #3414832
From rogerman
2011-10-04 17:23:23 +00:00
zeromus b7ba91a0b9 it seems that really only pushes and pops affect the stack busy flag 2011-10-03 03:18:17 +00:00
zeromus 236e4b3374 fix handling of matrix stack busy flag (the fifo seems to track whether whether a matrix operation is pending and set flag if so; if a non-matrix command jams in a busy geometry engine then backed-up matrix command will cause the flag to get set). fixed wild west, which polls this flag to see when it is safe to read the matrix stack cursor while the geometry engine is jammed. our understanding of the gfx fifo behaviour is still incomplete.. 2011-10-03 03:04:35 +00:00
riccardom c73a7cb883 gtk: remove compat code for gtk version < 2.14 2011-10-02 14:46:10 +00:00
riccardom 10cb19b39f gtk: remove usage of depecrated functions
This requires bumping minimum gtk version to 2.14.
2011-10-02 14:44:11 +00:00
riccardom 8bd73be83f configure: add -Wno-reorder in hardcore mode
does not warn against different ordering between definition
and initialization in classes.
2011-10-02 14:30:25 +00:00
riccardom 048f0c292e firmware: Move firmware.dfc to Battery directory, #3349229
There currently is no official place for the firmware.dfc
file. The current behavior is to save the .dfc in the same
directory as the executable. Per zeromus' suggestion, the
.dfc will now be saved in the Battery directory.
This will be true for all ports that support DeSmuME's
directory structure.

Patch from rogerman.
2011-10-02 11:27:29 +00:00
riccardom fb9445ffa3 Better common fake mic, #3320744
This is the preliminary patch that adds different
behaviour to the comon fake mic implementation to better
match desmume feature set.

This patch adds the code for the missing feature before
changing the mic API.

From rogerman, #3320744
2011-10-02 09:40:42 +00:00
riccardom f4f0c50444 wifi: Don't dereference null pointer
This probably is not hit in practice but better safe than
sorry. Reported by cppcheck.
2011-10-02 08:12:35 +00:00
luigi__ 0d43101548 Oops, my bad 2011-10-01 22:41:40 +00:00
luigi__ 77b692aa1b Wifi: flush RX queue when RX is disabled, fixes odd problems. Also remove some superfluous counters, add a global usec counter that's always enabled, and change the comm interfaces' usTriggers to trigger every millisecond since they don't need microsecond accuracy. 2011-10-01 22:29:15 +00:00
zeromus 592d5e5ef7 fix bug in texcoordtransform 2 (normal source) created from r3660 fixed point changes (broke smackdown 2010 textures) 2011-10-01 22:23:56 +00:00
riccardom 9b241b9033 commandline: initialize autodetect_method to 0
CommonSettings.autodetectBackupMethod is already initialized
to 0 so nothing will change.

This silence a silly warning in (at least)  gtk frontend.
2011-10-01 17:04:48 +00:00
zeromus 3fcb0a78d3 might as well make a note of it then 2011-09-29 22:46:26 +00:00
zeromus 778f4ce0d9 oops 2011-09-24 01:13:03 +00:00
zeromus 47afec91fa support nocash-style prints from ARM, in addition to thumb support which has existed for much time 2011-09-24 00:52:20 +00:00
riccardom b72ea5ee4b cocoa: Add tinyxml to xcode project file to compile latest svn
Fix #3411141
2011-09-18 16:24:44 +00:00
riccardom d5ce941e01 mc: rename ADVANsCEne::check() to ::checkDB() to fix compilation on MacOS X
Also while at it define it as class instead of struct.

Another step to fix #3411141
2011-09-18 15:43:18 +00:00
riccardom 3bd84c2bb8 mc: Remove unused crc argument from ADVANsCEne::check
This should fix #3411141
2011-09-18 15:19:39 +00:00
zeromus cb4e8fec9c lua-add vram_readword and vram_writeword (continued) 2011-09-16 02:50:09 +00:00
zeromus 92fe950b24 lua-add vram_readword and vram_writeword 2011-09-16 02:47:53 +00:00
riccardom 375fa0c94f Fix libagg crashes on 64bit
Putting a "\n" in OSDCLASS->addLine SIGSEGVs.

A newline is 10 in ASCII while the libagg's font starts
from a 32 (a space), so it nicely underflows and accesses
out-of-bounds memory in agg_glyph_raster_bin.h:90:

m_font + 4 + (glyph - start_char) * 2
m_font + 4 + (16 - 32) * 2

Should fix #2829308

Patch from kouteiheika, #3407304
2011-09-12 17:37:28 +00:00
mtabachenko 14cd6b722c OpenGL:
- add converting z coordinate from NDS [-1.0,1.0] to OpenGL [0.0,1.0]
2011-08-29 22:47:51 +00:00
mtabachenko 82ed19cc72 - add fix backup memory size when import save; 2011-08-29 18:30:12 +00:00
mtabachenko 3a41cfdf11 - add select autodetect save method (internal or from database); 2011-08-29 16:03:13 +00:00
mtabachenko e43e603ff1 - fix VS2010 build; 2011-08-29 12:17:46 +00:00
mtabachenko 1ba3dabe0d - add game database (only crc & savetype yet);
winport:
- add convert ADVANsCEne database (http://www.advanscene.com/offline/datas/ADVANsCEne_RToolDS.zip) to DeSmuME internal database;
2011-08-29 12:01:42 +00:00
zeromus d849bf11db remove memory randomization for homebrew. this ended up being a bad idea for a number of reasons. it wont return until it is made optional. 2011-08-25 20:31:19 +00:00
zeromus 35b32046e9 fix poppy interpolation audio quality bug 2011-08-23 22:27:49 +00:00
zeromus f2dc074b40 fix that with less warnings 2011-08-23 22:27:29 +00:00
zeromus 55122bb9fa fix poppy interpolation audio quality bug 2011-08-23 22:23:47 +00:00
wntrmute 4aff5bb444 use actual DS ID code 2011-08-15 19:05:14 +00:00
zeromus a9bba6473e win32: dont screenshot if no rom is open (menu was already disabled, anyway) 2011-08-15 01:48:47 +00:00
zeromus ba2887e700 win32: dont stay paused when canceling the save state as filebrowser 2011-08-14 19:03:24 +00:00
zeromus 6f90eec593 win32: actually do what my last checkin said it did. but now i no longer think it was necessary, so just ignore the last two revisions 2011-08-14 18:59:53 +00:00
zeromus b1bac119bb win32: make printscreen save as suspend emulation 2011-08-14 18:54:07 +00:00
mtabachenko 8917c70613 gxFIFO:
- fix typo (fix GTA - bug #3390024);
2011-08-13 14:11:53 +00:00
luigi__ 71a766b157 Firmware: fix firmware settings file path generation. 2011-08-12 13:49:03 +00:00
zeromus 312628821f win32: add hotkey for limit framerate limit toggle 2011-08-11 04:12:36 +00:00
zeromus 1d8ec4bb5e r3396 is alleged to have broken reverse of arcadia. it is alleged to have fixed fifa 2010. r3396 contains a change to thumb ASR which is plainly wrong. after that time several other cpu fixes were made, and the ASR changes are not necessary to fix fifa 2010 anymore. so I am reverting that part, and reverse of arcadia should be retested. 2011-08-04 01:31:34 +00:00
zeromus 307e0182af gpu: fix 2 years old regression in blending of backdrop 2011-08-03 00:29:02 +00:00
zeromus 4244eb69c6 rasterizer: tweak alpha blending edge cases. it seemed wrong. keep on the lookout for newly mis-blended things. also slightly tweak fat printf diagnostics 2011-07-30 22:08:10 +00:00
zeromus 57606c4aa8 win32: remove stop and reset toolbar buttons. too powerful for single stray clicks. 2011-07-29 18:51:45 +00:00
wntrmute 651672bf7a simplify list files, ensure all entries get recursed 2011-07-27 19:02:04 +00:00
zeromus 17f9e422d3 add some cflash diagnostic print 2011-07-26 22:50:53 +00:00
zeromus 55ae89cd4c happy belated 1st anniversary of no work being done, xbox port! 2011-07-26 22:05:10 +00:00
zeromus dad016d6e5 win32: change compactflash rompath to use the actual rom's path instead of the rom path setting configuration (that isnt what anybody wanted) 2011-07-26 22:04:27 +00:00
wntrmute f2c0c41bee add slot1_retail_nand.cpp to xcode project 2011-07-26 19:46:10 +00:00
riccardom 182f81fb46 Fix memory block alignment in RomBanner for 4-byte wchar_t, #3354040
From rogerman:

The RomBanner struct requires UTF-16 strings for the six different ROM titles.
Currently, we use wchar_t buffers to define the memory blocks where the title
strings are supposed to go. Using wchar_t is fine for compilers that assume a
2-byte wchar_t. But compilers that use a 4-byte wchar_t will misalign
the memory blocks.

I've submitted a new patch that changes all the wchar_t in RomBanner titles
to u16 for all ports. It took me a while to research the dependencies on
titles, and to make sure I didn't accidentally break something in the
Windows port.

As for the wcscpy() deal in the RomBanner constructor, it's an arbitrary
default init value that we don't actually use in practice, so I removed it.
If a particular port wants to know what to display for the titles when a
ROM isn't loaded, there are plenty of ways to figure this out. Or they can
just check the titles for an empty string, which the constructor inits the
titles to before the wcscpy() call.

For CHEATS::save(), I removed the dependency on using titles. The ROM name
we write to file is also an arbitrary value which we don't actually
reference in practice. I changed it to use gameInfo.ROMname, since we're
already using gameInfo.ROMserial.
2011-07-23 16:01:48 +00:00
riccardom 4bfd29c702 cheatSystem: headerId should be const 2011-07-23 15:34:00 +00:00
zeromus 657759c3f4 win32: newer console title format, somewhat more useful. now %EXENAME% %ARGS% to show you how you launched it. let me know what you think. also let me know if it crashes while trying to parse something! 2011-07-23 09:17:58 +00:00
zeromus 25b53c7fa3 win32: some minor clarifications to console behaviour. console behaviour is now verified to be pretty dang good in cygwin/msys bash as well as cmd.exe so long as you launch with "cmd /c desmume.exe". 2011-07-23 08:21:21 +00:00
normmatt234 d1309e73ac fix missing return. 2011-07-21 09:36:14 +00:00
milor 1d4b33903d Update spanish language 2011-07-13 21:25:00 +00:00
lainz 0364f55d14 Updated spanish translation. 2011-07-10 14:25:31 +00:00
zeromus 2049720303 win32: add another @!#*(@#$ing language, braziliano this time. now another 3% of the world population can use desmume without having to be arsed to learn internetional. 2011-07-08 19:24:36 +00:00
zeromus b9e3356bd3 win32: revert korean language patch. korean .rc change removed all non-ascii latin characters. not acceptable. try again without losing them. 2011-07-08 02:50:32 +00:00
normmatt234 91d2e0e596 opps typo. 2011-07-07 04:20:17 +00:00
normmatt234 af1c040eb5 Fix read below 8000h to support wrapping. 2011-07-07 04:19:26 +00:00
riccardom 7c7fa25c0a Rename ALIGN macro do DS_ALIGN
Anthony J. Bentley reports that desmume does not compile
on OpenBSD when the hud is enabled in bug #3148356.

After a few he reports that Stuart Henderson of OpenBSD
found the problem. The macro definition of ALIGN() conflicts
with a definition in /usr/include/machine/param.h.

So rename ALIGN macro to DS_ALIGN.
2011-07-05 07:33:10 +00:00
zeromus 55c8021624 win32: add korean language resources 2011-07-05 07:27:24 +00:00
zeromus bbddf0bc24 pseudorandomize LCD/PAL/ITCM/DTCM/MAINMEM for homebrew (previously just pal and LCD was pseuodorandomized) 2011-07-03 03:02:27 +00:00
mtabachenko b050640b95 - fix Windows port compiling (added include windows.h for MAX_PATH declaration) 2011-06-28 12:50:10 +00:00
zeromus 60c3c1a91a debug print how many rasterizer cores got booted up 2011-06-28 03:11:25 +00:00
riccardom 0c7d5d796d Fix buffer overflow when creating firmware.dfc file string
When the user uses an external firmware image, there is a 
call to getpathnoext() in firmware.cpp:571 in order to
generate a file name for the saved firmware config file.

The size of the MMU.fw.userfile char buffer is only 260,
as declared in mc.h:73. However, getpathnoext() expects
the buffer size to be MAX_PATH, which is declared as 1024
in types.h:77. The buffer overflow occurs in path.h:293
with the call to strncpy(), which copies 1024 chars into
MMU.fw.userfile, which is only 260 chars.

This patch fixes this bug by setting the MMU.fw.userfile
char buffer to a size of MAX_PATH. This is consistent with
the char buffers used for the other file names.

From rogerman, #3328686
2011-06-25 21:50:00 +00:00
normmatt234 3e29b63554 Fix magic numbers in FIFO code
Add a hack for preGCROMCTRL writes.
2011-06-22 15:41:50 +00:00
riccardom 738c80d67a metaspu: support the PCSX-2 Synchronizer in the Cocoa port
From rogerman, #3320757
2011-06-20 15:01:55 +00:00
wntrmute f165ec8b9f add ifdef to WIFI_Reset 2011-06-18 03:02:46 +00:00
zeromus da92d102f4 add a printf to elaborate cause of "SYSTEM POWERED OFF VIA ARM7 SPI POWER DEVICE" for homebrewers (main() returned) 2011-06-17 05:17:55 +00:00
luigi__ d1e5efcda9 wifi: make WIFI_RXPutWord() always defined. 2011-06-16 17:14:29 +00:00
zeromus fcce252f50 fix wifi.cpp compiling 2011-06-16 16:42:05 +00:00
luigi__ d383d0f5aa Wifi: proper queuing of received packets, emulate TX/RX delays, and misc extra accuracy. Also removed a bunch of redundant code.
NSMB gets one step further. When Luigi receives Mario's data frames, he tries to use port 094 (REPLY1) to respond, but only writes zero there for whatever reason.
2011-06-16 15:36:08 +00:00
lainz 5f92953103 Improved Spanish Translation. 2011-06-11 21:49:01 +00:00
riccardom 8032d4dee4 configure: better libagg detection
user heftig says that he can't find Agg_init() at link time when he uses
--enable-hud. Fix AM_CONDITIONAL to check for the proper variable and to
set in true only if --enable-hud was set.

Relayed by zeromus in a comment in #3250391
2011-06-08 10:03:30 +00:00
riccardom 93304143f9 gtk-glade: Fix wrong savestate slot, bug #3305716
satelight reports the menu item position for savestates does
not match the slots they are saved.
As zeromus explains the pattern should be:

F1 saves to ds1
F2 saves to ds2
F10 saves to ds0
recent savestates list looks like:
1 myfile.ds1 F1
2 myfile.ds2 F2
...
0 myfile.ds0 F10

Based on a patch from satelight.
2011-06-05 21:33:29 +00:00
riccardom b140005236 wx: Add ability to clear recent file list
From Jan Bücken (nooris), #3301520
2011-06-05 17:29:08 +00:00
riccardom 31027b491d Changelog: oops, remove duplicated line :) 2011-06-05 16:57:58 +00:00
riccardom 4761353f94 List Jan's contributions to wx frontend in Changelog. 2011-06-05 16:53:53 +00:00
riccardom c7e6149f1f gtk: remove variable set but not used reported by gcc 2011-06-05 16:46:48 +00:00
riccardom 8348f883bf gtk: call launch after rom reset
Jan reports that if you call reset when a game is paused
the statusbar would wrongly report the game as playing
when it is actually paused. Jan's attached patch removes
the call to desmume_resume() and the status bar update.
I think the intent here is different and the plan was to
reload the game so just call Launch directly as already
Jan noticed it would do the right thing.

Based on a patch from Jan Bücken (nooris), #3288654
2011-06-05 16:43:18 +00:00
riccardom 2691463d4a gtk: open recent should behave the same as open
If running, pause before loading a new rom

From Jan Bücken (nooris), #3288654
2011-06-05 16:28:48 +00:00
zeromus 59ec9700c6 win: fix [3311520], which causes MPCF path to get initialized wrongly and the whole c:\ drive to get scanned sometimes 2011-06-04 17:04:46 +00:00
riccardom 9b2821de3a wx: Pause spu and emulation before loading a rom
xrmx: kept only the hunk that pause and not the one
that reenable the previous state, i think we should
stay paused and the user should act to continue 
playing.

Based on a patch from: Jan Bücken (nooris), #3301520
2011-06-03 17:41:41 +00:00
riccardom 0a5a3c383c wx: Change rotation after setting the menu bar
I need to set the menu bar before setting the window size.
Otherwise it is a little bit too short.

From: Jan Bücken (nooris), #3301520
2011-06-03 17:29:57 +00:00
riccardom 073c8844e0 wx: Fix recent file list
From: Jan Bücken (nooris), #3301520
2011-06-03 17:24:41 +00:00
riccardom 4c0c82c92f wx: fixup window icon
Make it work here and maybe even in a portable way.
2011-06-03 17:16:40 +00:00
riccardom fae159d2ec wx: Add window icon
This is not portable on windows and actually it's not even
working here. Anyway it should be working for Jan
otherwise it wouldn't have posted the patch right? :)

From: Jan Bücken (nooris), #3301520
2011-06-03 16:58:08 +00:00
riccardom b7a9d5085f wx: keep execute and SPU_Pause together
execute=false and SPU_Pause(1) belongs together (avoid sound problems).

From: Jan Bücken (nooris), #3301520
2011-06-03 16:40:09 +00:00
riccardom 3503f1cc56 wx: reorder some code
Spring cleanup:
After this patch the file wxMain.cpp is ordered as follows:

1) header
2) includes
3) vars (and defines)
4) the wx oninit function that every wx project needs
5) the desmume class functions
        5a) for functionality and events (e.g. for clicks on buttons, etc...)
        5b) to load the menu
6) the wx event table

[xrmx: i hate these labels before code :)]

From: Jan Bücken (nooris), #3301520
2011-06-03 16:33:51 +00:00
riccardom 1d43b346fe wx: remove duplicated code for the GUI menu
We have a fair chunk of duplicated code to build the GUI
menus, remove the monolithic one in favour of the one
splitted in smaller functions.

From: Jan Bücken (nooris), #3301520
2011-06-03 16:28:57 +00:00
mtabachenko 1cbd6afa28 cheats:
- fix bug for import from R4 cheats base (removing empty codes from list);
2011-06-03 10:38:46 +00:00
mtabachenko f8408fdab2 DING! :D 2011-05-25 17:40:35 +00:00
zeromus 4c8c0e0b72 win32: caca en espanol 2011-05-25 02:37:08 +00:00
zeromus 8c69f8ac3a win32: remove redundant "default size" menu item which didnt always work (size 1x should be used instead) 2011-05-24 21:31:11 +00:00
riccardom 0a40273b16 Spring cleanup, remove CRLF from Makefile.am 2011-05-24 17:18:04 +00:00
riccardom c922d67e86 Fix make distcheck 2011-05-24 17:06:58 +00:00
mtabachenko 8d51fdfbbe slot1:
- add support retail cartridge with NAND flash (Made in Ore/WariWare D.I.Y.);
winport:
- add choose Slot 1 device (Menu: Emulation->Slot 1);
- fix change type of R4 cheats base;
- fix printlog function;
2011-05-24 12:51:36 +00:00
mtabachenko 13ae3664ab cheats:
- add support R4 encrypted cheats base;
cheats (winport):
- fix GUI bugs;
- add boxcheck in export dialog;
- add convert internal cheats to AR;
- add select R4 cheats base format (Path Settings);
- cheats base file moved to cheat folder (CHEAT.DAT/USRCHEAT.DAT);
2011-05-19 12:54:00 +00:00
zeromus 10f649e843 potentially fix a ton of bugs in the cheat system by going through the correct memory access APIs. also potentially break some cheats, because i didn't test any of it. 2011-05-17 19:47:37 +00:00
riccardom 6009d46485 NDSSystem: Merge NDS_LoadROM common code
Move the path stuff that is different between platforms
to an helper in order to share the common code.

The !WINDOWS should receive a bit more love though.
2011-05-15 22:05:57 +00:00
riccardom 3c92ad957e iNDSSystem: fix call to DLDI::tryPatch in !WINDOWS NDS_LoadRom 2011-05-15 17:55:51 +00:00
riccardom 29fa5037bf NDSSystem: call fillGap() after loading romdata in NDS_LoadRom !WINDOWS 2011-05-15 17:47:03 +00:00
riccardom 1b1d4acdd3 NDSSystem: fixup indendation in NDS_LoadROM for windows 2011-05-15 17:32:29 +00:00
riccardom 0aa0b07733 NDSSystem: cleanup NDS_LoadROM()
Rearrange and update some code in !WINDOWS NDS_LoadROM() so
that it is easier to see the difference with the WINDOWS one.
2011-05-15 17:27:36 +00:00
riccardom 64d9792067 wx: don't crash on pause if no rom is loaded
A different version of a patch from Jan Bücken (nooris), #3288648
2011-05-15 16:41:51 +00:00
riccardom 18110b0db2 wx: white space cleanup
Taken from a patch by Jan Bücken (nooris), #3288648
2011-05-15 16:21:49 +00:00
riccardom 60e8ec45bd NDS_LoadRom: Use gameInfo.romdata to store the rom for !WINDOWS
This makes NDS_FreeROM() works properly and avoid to
allocate the buffer for the ROM data twice.

Thanks to Jan Bücken for reporting the issue.
2011-05-15 15:33:10 +00:00
riccardom 5fc80d83aa wx: Make spu mode and audio driver changeable
From Jan Bücken (nooris), #3288648
2011-05-15 14:35:11 +00:00
hi-coder 961a467f92 win32: add "paused" text to caption 2011-05-11 02:36:43 +00:00
zeromus b1e92e6cb0 win32: get rid of some broken cruft leftover from the last console checkin 2011-05-09 05:46:33 +00:00
zeromus b26e760d2c win32: allow stdio redirect in some cases where it was broken before 2011-05-01 05:49:25 +00:00
riccardom 9432c70bd2 Update Changelog 2011-04-30 16:06:03 +00:00
mtabachenko 2d1a6d34bf OpenGL:
- fix alpha blending (fixed storm clouds in NSMB at the beginning);
2011-04-29 11:36:47 +00:00
zeromus cd38ecbd34 vio2sf: add updated patch 3026630 with newer features and fix a bug in sound viewer tool dialog management 2011-04-27 05:14:40 +00:00
zeromus c28b2423cc win32: add hicoder patch 3292481 "Windows File Association patch" (its optional) 2011-04-27 04:14:38 +00:00
riccardom 1b647bc46a cocoa: Update xcode project files
From rogerman, #3259154
2011-04-20 16:21:08 +00:00
riccardom 88c7d5d906 emufile: Fix compilation on big endian systems
From rogerman, #3289150
2011-04-20 07:02:42 +00:00
zeromus 3014da89b3 use EXCEPTION_UNDEFINED_INSTRUCTION instead of magic number 0x04 2011-04-20 06:26:42 +00:00
riccardom fb317f2717 slot2_gbagame: fix include path of path.h 2011-04-19 07:00:15 +00:00
riccardom 7312b2844d gtk: Fix some typos in metaspu modes
From Tobias Jakobi
f3a9682499
2011-04-18 21:38:22 +00:00
riccardom 625c8c270f wx: Add licence header file to wxMain.cpp
Please double check it's correct :)
2011-04-18 21:15:11 +00:00
riccardom 5fa0218104 wx: fix compilation with libsoundtouch
The way we are building right now we have to link against
libsoundtouch even if the frontend does not use it.
Read: we have to build SPU and metaspu per frontend and
not globally.

From Jan Bücken, #3288648
2011-04-18 21:00:20 +00:00
riccardom dd351a80b9 build: Shut up aureconf warnings with autoconf 2.68
autoreconf: running: aclocal --force 
configure.ac:46: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from...
../../lib/autoconf/libs.m4💯 AC_CHECK_LIB is expanded from...
configure.ac:46: the top level

The fix is to put AC_LANG_PROGRAM inside []
2011-04-18 20:01:59 +00:00
riccardom dc78778ae2 wx: link against xlib
/usr/bin/ld: PadSimple.o: undefined reference to symbol 'XLookupKeysym'
/usr/bin/ld: note: 'XLookupKeysym' is defined in DSO //usr/lib/libX11.so.6 so try adding it to the linker command line
//usr/lib/libX11.so.6: could not read symbols: Invalid operation
2011-04-18 17:12:49 +00:00
riccardom 9acc466729 cocoa: Update copyright year
From rogerman, #3259154
2011-04-17 16:34:42 +00:00
riccardom f6393a9210 ctrlsdl: Fix compilation without OpenGL
Since r3947 ctrlssdl.h breaks the build with a compile
error in build environments that don't have GL.h such as
Mac OS.

[xrmx: define screen_texture anyway to be on the safe side]

Based from a patch from Sidney Markowitz in #3288504
2011-04-17 15:31:51 +00:00
riccardom 49b5243c1a cocoa: Update cocoa frontend
From Roger Manual, #3259154:

BUGFIXES:
- Fixed the bug tracker website link used by the "Submit a Bug Report" command
  in the Help menu.
- Fixed issue where if one of the text files used for the About window was
  missing from the DeSmuME/Contents/Resources folder, then the entire panel
  didn't show.

CHANGES:
- Frame skipping options have been removed in this release. The way it works
  now, drawing a frame in Cocoa takes an insignificant amount of time. In other
  words, skipping Cocoa frames does NOT yield any significant speed improvement.
  It may be possible to gain speed by skipping frames in the actual NDS GPU
  rendering, but this is an emulation engine issue, not a Cocoa frontend issue.
- Added OBJ layer toggling in the View/Layers menu.
- Files are now saved in more logical locations. Save states slot files are now
  saved in "~/Library/Application Support/DeSmuME/(DeSmuME version number)/States".
  All other files (like battery files) are now saved in the same directory as the ROM.

DEVELOPER:
- Added Application Creator Code for DeSmuME. Registered 'DSmM' with Apple.
- Reworked the execution loop for better maintainability.
- Preliminary code refactoring for better DS controller function. Cocoa DeSmuME now
  uses the NDS_beginProcessingInput() and NDS_endProcessingInput() functions, which
  helps input support for some games. Note that this change probably breaks support
  for PowerPC Macs, but I don't know if we should be supporting PowerPC Macs anyways...

xrmx: I'm not able to build this with xcode because 10.4 SDK does not like gcc4.2 but
      the cocoa stuff builds fine in cocoa so applying it.
2011-04-16 15:27:39 +00:00
riccardom 1d4977cb4b cocoa: Update Rakefile
Something is still missing, compilation get stuck
at ../libs/emufat.cpp without error messages though.
2011-04-16 15:15:22 +00:00
riccardom 234e2b755f build: remove duplicate texcache entry in Makefile.am 2011-04-16 14:47:49 +00:00
riccardom 2c318062b7 utils: correct emufile.h include in xstring.h
This helps cocoa rakefile build.
2011-04-16 14:16:24 +00:00
pengvado e1c70f0ac6 cli: fix a freeze when turning FPS limiting back on after some boost mode
(regression in r3944)
2011-04-15 15:31:50 +00:00
zeromus a99026df03 do the same for standard palettes 2011-04-14 21:38:15 +00:00
zeromus c44819873a add boot-up vram randomization for homebrew games, to more accurately mimic being loaded from a flash card that leaves behind some junk 2011-04-14 21:05:19 +00:00
riccardom 2c8a4603ab path: don't use glib in LoadModulePath for cocoa build
From rogerman in #3259154
2011-04-13 20:50:48 +00:00
riccardom 4d1b0b5809 dma controller: rename check to dmaCheck
The conflicting macro is the check() assertion macro defined
in Apple's CoreFoundation framework, specifically in the
AssertMacros.h file.
Unfortunately, this file must be included in the Cocoa port.

From rogerman in bug #3259154
2011-04-13 20:38:55 +00:00
riccardom 713b5dc1b2 types: tidy some windows ifdefery 2011-04-10 17:12:11 +00:00
riccardom 7dd20a3330 NDSsystem: remove old compat code in NDS_setTouchPos/NDS_releaseTouch
The cli and gtk frontend works fine without it, a patch
has been posted in tracker to avoid that for the cocoa
one so i think we can safely remove it.
2011-04-10 12:20:58 +00:00
riccardom 978fdfe680 Fix include format
From rogerman at #3259154
2011-04-09 23:25:11 +00:00
riccardom e441291f32 bump gtk min version to 2.10 in configure.ac too 2011-04-09 20:07:41 +00:00
riccardom cdfb727f8d gtk: remove support for gtk < 2.10 2011-04-09 19:50:58 +00:00
riccardom fe4500e44e gtk: Add menu for SPU mode selection
From Tobias Jakobi (liquidacid) at #3250391.
2011-04-09 19:13:45 +00:00
riccardom ae4a1c64e3 Disable hud by default on autotools build
The hud libagg crash on 64bit so better have it off by
default. Use --enable-hud to enable it.

From Tobias Jakobi (liquidacid) at #3250391.
2011-04-09 18:36:39 +00:00
riccardom 9a32b37048 Add detection and build support for libsoundtouch and so metaspu
Based on patches from Tobias Jakobi (liquidacid) in #3250391
2011-04-09 17:12:32 +00:00
riccardom 74b8df277c metaspu: have it compiled under gcc too
Based on patches from Tobias Jakobi (liquidacid) in #3250391
2011-04-09 17:09:26 +00:00
zeromus 79684686c3 add texcache speedup patch #3275389 - be on the lookout for stale or glitched textures, but i think its safe. 2011-04-05 20:36:09 +00:00
zeromus eb3963bc37 fix bug in rasterizer linehack rendering, add 3d config option since it still breaks hotel dusk, and make nocash debug messages always show up, even with no #define DEVELOPER. 2011-04-02 18:39:26 +00:00
mtabachenko ce73043bec winport:
- add antispam for cheaters :)
2011-03-28 09:27:44 +00:00
zeromus e3b27ecd16 apparently fix some situations where too many cheat codes are entered. codr's patch 3200856 2011-03-27 20:08:09 +00:00
mtabachenko bd5cccef40 fix typo on last rev, sorry 2011-03-27 14:38:58 +00:00
mtabachenko 47f781d26d OpenGL:
- fix line segment detection (fix missing textures in Garfield's Nightmare, Zelda PH);
- recreate toon texture on load state;
2011-03-27 14:21:11 +00:00
mtabachenko ea19f9cf6c GE:
- removed hacks from Geometry FIFO;
2011-03-26 17:06:32 +00:00
riccardom 40d89c77f6 gtk: Fix build on gtk 2.24 2011-03-25 20:48:27 +00:00
riccardom 42ffac8197 firmware: don't leak fp when not patched. 2011-03-25 17:15:14 +00:00
riccardom b3122f97ee gtk-glade: Fix a couple of off-by-one reported by cppcheck 2011-03-25 17:01:24 +00:00
pengvado c4c9cf60f6 drawscanline: factor bounds check out of the loop.
Initialize edge_fx_fl even if width=height=0.

Fix a freeze/slowdown in Okamiden (#3240891).
Also a slight softrasterizer speedup.
2011-03-24 22:00:54 +00:00
zeromus 9e70ebca45 fix freebsd libfat compiling? 2011-03-24 21:51:17 +00:00
riccardom a070dc091b Update and reenable pthreads
Apply pengvado pthread backend for task. We are probably
not gaining that much but it is better than a stub :)

Removed the rasterize.cpp hunk sice zeromus likes it more
as it is now.

Patch from  #3203082.

From: Loren Merritt <pengvado@akuvian.org>
2011-03-24 18:15:40 +00:00
zeromus 972d9e28ea fix memory leak in slot2 mpcf 2011-03-21 02:52:16 +00:00
gocha d77e3ee425 RAM Search: fix reset code and update the current values for every addresses.
RAM Search: workaround for auto search restart.
2011-03-21 00:22:53 +00:00
zeromus 143217af2c sync emufiles between emus 2011-03-20 18:33:41 +00:00
riccardom 80fd38374f Reinitialize GL after SDL_SetVideoMode
On some systems SDL_SetVideoMode resets OpenGL context,
dropping the screen texture and leading to glTexSubimage2D
failure when using the --opengl-2d switch.

Attached patch reinitialized OpenGL after window resize.

This is a forward port of Jakub Higersberger patch at
 #2839785. This fix the broken resize with cli frontend
reported in #3195218.
2011-03-16 21:42:53 +00:00
riccardom 8422f0ab7c cli: put 'now' variable declaration were due
Note to self: this is C not python.
2011-03-12 16:41:08 +00:00
riccardom 3713c1ba7f cli: avoid some overhead with DISPLAY_FPS defined
Avoid a call to SDL_GetTicks() which in turn call the
gettimeofday() syscall when DISPLAY_FPS() is defined.
2011-03-09 22:07:44 +00:00
riccardom 18349689c8 cli: better FPS limiting
Simplify and make the fps limit behave better.

From: Thomas Jones <thomas.jones@utoronto.ca>

[rm: remove fps_limiter_frame_period now unused and fixup whitespace]
2011-03-09 21:55:48 +00:00
riccardom 9d0c383e93 autoconf: use AC_CANONICAL_HOST not AC_CANONICAL_TARGET
AC_CANONICAL_TARGET is for compilers, desmume is not a compiler. It
figures out what platform the compiler should generate binaries for.

AC_CANONICAL_HOST is for figuring out what platform you will run on.

From: Thomas Jones <thomas.jones@utoronto.ca>
2011-03-09 21:15:40 +00:00
zeromus ade66fd351 fix bug from r3935 which broke textures when loading savestate while using softrasterizer 2011-03-08 07:00:22 +00:00
zeromus 782a15da11 don't render rotscaled bitmap sprites with alpha==0 2011-03-06 22:03:06 +00:00
zeromus 9897125f9a add hq4x filter. i can't tell if i did it right, because all hqx filters look broken to me even when theyre working. 2011-03-05 20:04:05 +00:00
riccardom 009029b15d rasterize: check if _MSC_VER is defined before checking against a version 2011-02-28 18:08:13 +00:00
riccardom e7064a71b6 gtk: Remove usage of deprecated gtk_label_set 2011-02-28 18:06:02 +00:00
mtabachenko fc0daf243a - fix line segment detection; 2011-02-25 14:57:01 +00:00
zeromus bf013a7c18 more robust dsi touch 2011-02-25 07:21:52 +00:00
zeromus 4a330878ae add --dsi-mode=1 and dsi TSC emulation. this does not constitute "dsi support". you will probably think that it does anyway. 2011-02-22 07:13:20 +00:00
zeromus 0a0d4fe509 add --debug-console=1 which affects arm9 swi 0x0F and whether 8MB ewram is installed 2011-02-21 20:12:04 +00:00
mtabachenko 8c049fc914 - removed new 3D polygon definitions; 2011-02-16 09:31:14 +00:00
wntrmute a8f6163bb2 remove delay from idle loop, correct slash in desmume.ini path (both slashes work on windows, backslashes don't on linux & osx 2011-02-14 17:05:37 +00:00
zeromus d583566a3e fix bugs in arm7's VRAMSTAT register 2011-02-11 07:35:08 +00:00
mtabachenko 711f5ef88c - added new 3D polygon definitions (disabled by default and work only with OpenGL);
OpenGL:
- a bit optimization FBO;
2011-02-09 16:04:15 +00:00
mtabachenko 133419a1e3 - renamed file names for slot2 addons; 2011-02-09 15:04:07 +00:00
zeromus 20aa3cc42e now that i have a piano to test with, refine piano emulation a bit. also rename that file to conform to more recent standards 2011-02-09 00:36:25 +00:00
zeromus 1d239bce90 properly handle sprite virtual screen y dimension wrapping (fixes rotoscaled sprites which wrap across the bottom of the screen and back to the top) 2011-02-07 21:01:42 +00:00
zeromus 111476de2e flush some logging more often 2011-02-07 18:41:06 +00:00
gocha cb21139402 Commented out r3909 changes, because of Portrait of Ruin warp stone regression.
I guess, not much sure though, gfx3d_IsLinePoly doesn't need to take Z position. Z will be handled well by each renderer, whether it's polygon or line.
2011-02-06 05:17:01 +00:00
gocha 967d00cf34 Fix Increase Pressure hotkey default. 2011-02-06 01:28:45 +00:00
zeromus fd76bc0f6c fix some VRAM_I mirroring and change sprite rendering to memory map per-pixel instead of per-scanline, fixing sprites going over the edge of vram. fixes a lens flare at the end of ff3. also do some housekeeping 2011-02-03 05:23:01 +00:00
zeromus dbcf7e675e add vram test 2011-02-01 22:29:47 +00:00
zeromus ca6c16394e fix some slot-2 addons and bump trunk version number 2011-02-01 21:44:35 +00:00
adelikat 0d4763d281 Lua - fix memory.readdword function (was returning signed values), same fix as r296 of GENS 2011-01-31 15:17:51 +00:00
zeromus de1374a445 test 2011-01-31 05:15:46 +00:00
mtabachenko 98d5d4a597 opps, sorry :( 2011-01-26 15:28:12 +00:00
mtabachenko ac8d9977ee core:
- fixed bug in Alpha Blending Coefficients Register (fix white screen in Star Wars The Force Unleashed 2);
2011-01-26 15:24:59 +00:00
zeromus 430759d54f forgot to add a file!! 2011-01-24 08:47:39 +00:00
zeromus c3f521d09a add arkanoid paddle emulation. also add some emulation of EXMEMCNT bus allocation 2011-01-24 08:28:59 +00:00
zeromus 0eb39e48c3 fix windows desmume vcproj after recent source tree changes 2011-01-19 22:43:41 +00:00
zeromus b6431dda83 ogl renderer: fix line loop detection so that it is aware of the existence of 3d games 2011-01-16 19:01:21 +00:00
zeromus 575d87fc98 rearrange vfat code to be reusable by multiple devices, make slot1-R4 use it, add slot1-fat-dir=/path/to/dir for setting up a fat image for slot-1 devices, rename "compact flash" addon to MPCF, make DLDI-autopatcher not touch roms unless "Default (No interface)" is the current driver (otherwise, your roms intentionally patched with other things will get overwritten) 2011-01-14 03:19:05 +00:00
normmatt234 b14e6f01df Added emulation for 16bit writes to REG_GCROMCTRL.
Reset slot1_device in NDS_Reset.
2011-01-13 04:35:11 +00:00
zeromus 1d2ceefbe9 remove "BX using PC as operand" diagnostic message 2011-01-08 03:32:19 +00:00
mtabachenko 46ecfcf7fd winport:
- add hack for vs2010 build (crash on SoftRasterizer);
2011-01-07 11:25:36 +00:00
mtabachenko 75dcdfd020 OpenGL:
- add ClearImage/Rear-plane emulation (fix Sonic Chronicles Dark Brotherhood, The Chronicles of Narnia - The Lion, The Witch and The Wardrobe, Harry Potter and the Order of the Phoenix etc);
2011-01-05 11:36:59 +00:00
zeromus f502769b6c clear lag frame on 8 and 32bit keypad register reads 2011-01-01 21:41:31 +00:00
zeromus ca198d08bf win32: allow debug console showage to be overridden with ini file [Display] Show Console=1 2010-12-31 18:07:07 +00:00
riccardom bb0ceffcd5 Correct ALIGN preprocessor stuff for __GNU_C__ 2010-12-31 18:01:32 +00:00
riccardom e6ad3b5db5 Fix build without opengl, fix #3148357
Stop linking unconditionally to libGLU because it will
fail at link time if GL headers are not found.
2010-12-31 16:42:58 +00:00
riccardom d23f9f77a9 We use FAST_ALIGN from types.h so include it directly, possibly fix #3148356 2010-12-31 15:39:08 +00:00
riccardom e82f680e48 wx: fix compilation, + operator doesn't know what to do with string literals 2010-12-31 15:27:19 +00:00
riccardom 5fa4217abf wx: fix compile without libaggx 2010-12-31 15:21:21 +00:00
gocha 41d9972ec2 rasterizer: improve horizontal line (Portrait of Ruin, Dart) 2010-12-29 04:02:11 +00:00
gocha 19f9986750 rasterizer: enabled line poly hack 2010-12-23 22:43:51 +00:00
gocha a882fd6373 rasterizer: add workaround for line poly. However, it's commented out since it's incomplete and also causes another glitch. 2010-12-22 11:30:15 +00:00
gocha 4ba4419e8f OGLRender: prefer GL_LINE_LOOP rather than GL_QUADS for line segment.
Algorithm of isPolyLine() isn't perfect, but I think it'll work good enough for most cases.
This change should improve Castlevania Portrait of Ruin (trajectory of ricochet, and glow of warp stone)
SoftRasterizer must have a similar issue, it doesn't display both of them.
2010-12-20 12:45:39 +00:00
dormito b721929595 adjusted ini file location to ensure that is in the same path as the executable 2010-12-19 21:20:12 +00:00
wntrmute d093315786 fix osx compile 2010-12-19 13:14:52 +00:00
dormito fd6c778db0 minor corrections to wx port; spacifcaly to fix osx compile 2010-12-19 13:01:28 +00:00
dormito 5d68b4d98e updates to wx to move class declarations out of wxmain.cpp and into wxmain.h; along with primative additon of Hud font setter 2010-12-19 12:31:19 +00:00
wntrmute 95c40ea60a temp fixes for compiling wx on osx 2010-12-19 11:11:03 +00:00
zeromus d37ac82039 try fixing spu race conditions more 2010-12-19 05:29:48 +00:00
zeromus e2c27f9c88 win32: try to make loadstates crash less frequently by fixing spu/mainthread race condition 2010-12-19 04:45:05 +00:00
zeromus f13fabcc73 add big endian toggle to memview 2010-12-19 01:32:40 +00:00
zeromus 3f6e986076 win32: add 5x window size 2010-12-17 20:35:06 +00:00
mtabachenko 8266164a60 OpenGL:
- add support quad primitives (fix wireframe: Nanostray 2 menu and stage select screen, Harvest Moon Frantic Farming);
2010-12-17 18:44:43 +00:00
zeromus 1994e00506 fix boneheaded hotkey mistakes 2010-12-11 18:37:33 +00:00
zeromus 0f94429bab add support for varying stylus pressure. not tested very well. default hotkey shift +/- 2010-12-10 05:17:34 +00:00
zeromus f0d3bd7f40 2010-12-04 23:05:19 +00:00
zeromus d93668c4c0 change all code related to padding save memory to go through one function that pads with 0xFF. maybe that will help fix some mysterious quirks in save file importing. 2010-12-03 20:07:44 +00:00
zeromus be8b6906c8 fix some ipc fifo bugs (fixes Defc0n-Zero demo and some recent libnds fifosystem changes) 2010-12-01 08:08:52 +00:00
zeromus fde699f8d9 fix up wx msvc 2010-11-24 23:58:21 +00:00
zeromus da27b3e49e remove some useless stuff 2010-11-24 23:46:50 +00:00
dormito 5c1a85e264 prevent crashesh when sound is enable but no working soundcard is avalible 2010-11-23 05:06:34 +00:00
zeromus b50a86f560 add some error handling for ridiculous mis-uses of cflash directories containing too many GB of files 2010-11-23 01:45:48 +00:00
zeromus 4ffac4d2df 7z libs should not include a hacky overridden operator new() made for msvc6 compatibility 2010-11-23 01:40:34 +00:00
dormito 189ea22a75 set target throttle speed to 1.00x and save/load from ini 2010-11-21 05:40:33 +00:00
dormito 168aa1c39f restored "Display Frame Counter"'s ID back to ID_VIEW_FRAMECOUNTER 2010-11-21 02:54:59 +00:00
dormito 04e454c8a3 corrections to make IDs reguarding the font switcher unique 2010-11-19 09:20:35 +00:00
zeromus ef37c65f92 add hud font switching code 2010-11-19 08:26:07 +00:00
zeromus 4e181756da etc 2010-11-18 02:35:37 +00:00
zeromus efdd1e8621 oh i see. GPOINTER_TO_UINT as well 2010-11-17 08:08:22 +00:00
zeromus 0bb93e7c8c ok i shouldve checked for these all at once but now i did and this is the last 2010-11-17 08:06:49 +00:00
zeromus 73b9cd6503 more of the same 2010-11-17 08:05:43 +00:00
zeromus 07f8735d02 fix 64bit GPOINTER_TO_INT ? 2010-11-17 08:04:27 +00:00
zeromus 8a38d05f18 osx compile fixes from recent libfat additions 2010-11-17 07:31:02 +00:00
zeromus 4180b540a7 fix regression from r3848 that was making some mic malfunction 2010-11-14 07:25:24 +00:00
zeromus 5141a38ec6 apparently 100% of pokemon AR codes were typed with the letter O in place of zero in some places, so lets try to adjust for it in the parser 2010-11-13 17:57:09 +00:00
zeromus 95b62807e3 a bit more granularity for fps throttle control, and add OSD message display for it 2010-11-10 19:34:45 +00:00
zeromus e901dd33a2 spu: don't track user spu in synch mode (probably negligable speedup) 2010-11-09 21:34:42 +00:00
zeromus 3562dbad63 unify emufile across emulators 2010-11-07 23:33:11 +00:00
mtabachenko 84e9be0e29 - remove spi printf; 2010-11-07 13:50:45 +00:00
zeromus 98965bac99 emulate temperature register*
* the temperature is always 309 kelvins
2010-11-07 04:02:38 +00:00
gocha e7dc68e5ce Lua: add menu functions, sample http://pastebin.com/VD9quJRS 2010-11-06 14:59:44 +00:00
zeromus 2e7f6bd52a try rewriting part of the AR parser a little differently to see if it will trick vs2010 into working 2010-11-04 09:44:52 +00:00
mtabachenko 7d31f5569b -fix Windows x64 build; 2010-11-03 16:35:55 +00:00
gocha c529adf458 Fix lua51.lib reference error 2010-11-02 03:35:58 +00:00
zeromus b691731341 visual studio: clean up lua-related building mess 2010-10-30 21:15:50 +00:00
gocha 98589c29bd ramwatch: oops, "new" button must be always active 2010-10-30 06:50:00 +00:00
zeromus 8b01f9eb3d 2010-10-27 04:44:26 +00:00
zeromus 3cc1963129 vcxproj should not have wifi comm enabled by default 2010-10-27 01:42:11 +00:00
zeromus 711e0779ab 32bit vs2010 vcxproj was worthless and broken 2010-10-27 01:33:51 +00:00
zeromus 834bc40a56 add cache miss analysis debug toy 2010-10-26 22:54:30 +00:00
zeromus f841376e58 delay load lua51.dll 2010-10-26 20:48:24 +00:00
gocha a1bd1e4872 Link to lua51.dll instead of static lib 2010-10-23 11:59:49 +00:00
zeromus 81f72036b8 add 20.12 display to ram watch 2010-10-23 02:50:13 +00:00
zeromus 5d5d6fbf91 add 20.12 fixed point display to mem view 2010-10-23 02:40:59 +00:00
zeromus cee3ce6bad make libfat reflect recent svn change 2010-10-23 02:40:18 +00:00
zeromus 1a42e8103b fix severe memory leak in recently changed gtk code. attn xrmx. must be ported to release branch. 2010-10-14 05:58:28 +00:00
zeromus fbd3bd438c fix bug in changelog and little memory leak 2010-10-14 05:41:05 +00:00
zeromus cd024f7c69 apply yonizaf's search cheats hotkey patch #3086897 2010-10-13 20:55:26 +00:00
gocha 6a35a42883 ramwatch: fix the multiple selection glitch of watch up/down 2010-10-09 07:41:42 +00:00
adelikat e89f37f38d Movies - Add in functions for "bullet-proof" read-only state loading. Functions not hooked into the code yet. 2010-10-08 14:35:23 +00:00
adelikat 8b98ed38e1 movie.cpp - hook up GUID mismatch error message 2010-10-08 14:11:12 +00:00
zeromus 576255a0b8 fix emulator crash caused by uninitialized blending table. now.. why did it only show up in linux? some nondeterminism difference between windows and linux emulation.... disturbing.... 2010-10-07 23:33:07 +00:00
zeromus 2443cf866a remove useless 0 byte file (continued) 2010-10-07 21:20:46 +00:00
zeromus a537003680 remove useless 0 byte file 2010-10-07 21:19:33 +00:00
zeromus 1533d75ea4 changelog 2010-10-07 20:06:45 +00:00
zeromus f06a8d5731 fix broken shadows regression in wizard of oz 2010-10-07 18:20:28 +00:00
zeromus a41d8a4242 port libfat to PC and c++; use it in compactflash emulation; LFN are supported once more; files have been re-added, please run autogen.sh; there may be bugs in 64bit builds, let me know. 2010-10-07 09:41:47 +00:00
zeromus 3795d559e0 revert touchscreen modified crap. firmware is too broken to touch without rewriting entirely. 2010-10-07 09:25:42 +00:00
zeromus cc1aa30e0b fix raster fx bug in mmzero collection. should have broken other raster fx, but didnt--maybe something else fixed them. 2010-10-07 03:30:22 +00:00
zeromus bb389cec2b get rid of printf spam 2010-10-07 02:27:05 +00:00
zeromus 170bc431f0 clean up touchscreen calibration code a little bit. this was all i did before deciding the entire firmware system needs rebooting after a release 2010-10-06 22:03:48 +00:00
zeromus cfc5ce2335 fix some gcc compile issues in new source file 2010-10-06 03:28:46 +00:00
zeromus 964bc43c29 replace worthless ansi C time functions with DateTime borrowed from mono. fixes year > 2038 bug. source files changed, please rerun autogen.sh. interested users please test well. 2010-10-04 08:01:16 +00:00
gocha 60badc15d7 windows: RAM Search: fix the restoration of the selection range in signal_new_size. 2010-10-03 13:11:25 +00:00
gocha ad0689009d windows: improve multiple selection support of ram tools. 2010-10-03 10:16:51 +00:00
gocha 520bd4e712 windows: update cheat list - support removing multiple entries, fix the selection glitch of radio buttons. 2010-10-03 08:22:46 +00:00
zeromus c1ad2cc5a4 fix missing bg in love plus, broken since regression way back in r1764 due to my erroneous refactor of gpu code!! 2010-10-03 03:42:42 +00:00
zeromus 5ac1ce70b5 repair the rarely used main memory display dma that was broken a year ago 2010-10-02 02:04:54 +00:00
zeromus 414d661205 port an emufile fix from fceux 2010-10-02 01:48:56 +00:00
zeromus 15ac34c397 fix bios intrWaitARM even better 2010-10-01 19:22:51 +00:00
zeromus b867a40eb7 fix bugs in internal bios intrWaitARM after basic IRQ handling was rewritten 2010-10-01 10:32:55 +00:00
normmatt234 20e02710b5 disable sse optimizations in vs2010. 2010-09-28 00:58:12 +00:00
zeromus 8731de6e8c remove verbose console spam 2010-09-27 23:50:24 +00:00
zeromus 053635ef55 fix copy paste error in changed irq code, fix regressions (freezes in some games) 2010-09-27 23:04:56 +00:00
zeromus 372e35e04f quit crashing emulator sometimes in cases where the rom would just used to freeze (recent regression) 2010-09-27 19:45:16 +00:00
zeromus 2be21622ae rewrite disp3dcnt register emulation and add support for accesses of all widths. one down, one thousand to go. 2010-09-27 08:28:22 +00:00
zeromus 6a33eb0cf8 simplify irq and wait4IRQ handling and related cleanup. this could potentially cause bugs. 2010-09-26 08:23:44 +00:00
zeromus ec51fa5be0 make EMUFILE not require RTTI 2010-09-26 06:45:46 +00:00
mtabachenko 436358a51b - add save firmware settings (User, WiFi, WiFi AP);
- fix OpenGL shader for texture blending on decal mode;
2010-09-25 14:30:23 +00:00
zeromus 042e584b20 mask rom reads outside of range instead of returning 0xFF. clean up some other archaic memory map cruft 2010-09-25 08:00:53 +00:00
luigi__ 7be2b0da6e Wifi: for the Adhoc interface, generate a MAC address from the computer's IP and the process ID as to prevent MAC collisions in any case. 2010-09-24 22:34:20 +00:00
zeromus 4c21753dd9 and fix compatibility for non-win32 systems 2010-09-21 23:42:05 +00:00
zeromus 0a0c1f0fe6 increase of few fps during 3d heavy games in 32bit windows builds which may have slowed down after fixed point changes. should probably add sse2 optimizations but this is easier and safer 2010-09-21 23:33:59 +00:00
zeromus f8c453def5 fix some recently agitated gxfifo-related asserts 2010-09-21 19:54:33 +00:00
zeromus d55eb9ba06 cleanup unused xbox port cruft 2010-09-21 04:10:50 +00:00
zeromus 11afd9c97d fix new linux compile issues and use more symbolic constants instead of magic numbers 2010-09-21 03:35:57 +00:00
zeromus 4d201d86d2 make REG_IF a generated value instead of a cached value; rewrite IPC FIFO IF handling and IPC FIFO clearing 2010-09-20 20:47:33 +00:00
gocha 9cf546bef3 Cancel the HAVE_LUA commit for the time being, since it might cost speed. 2010-09-20 10:24:32 +00:00
gocha e3cd9556cb windows: define HAVE_LUA 2010-09-20 08:36:31 +00:00
gocha de38a3d08e set current directory to script's location on lua script load 2010-09-20 08:11:39 +00:00
gocha 6e40d456f9 windows: improve "background input" a bit 2010-09-18 04:44:46 +00:00
gocha f969eedf7d windows: add "background input" option to the menu. 2010-09-18 03:26:00 +00:00
zeromus af035533a0 add troulouliou's depth compare hack 2010-09-09 23:04:17 +00:00
zeromus 74ff219aa9 print long filename in console when adding files to fat image 2010-09-06 15:46:40 +00:00
zeromus 42ffdf7c7b stop using static ints in #ifs 2010-09-04 16:39:20 +00:00
zeromus b1362ccb40 libfat improvements: now actually works, and uses fat32. 2010-09-04 02:57:52 +00:00
zeromus cf5ba963c0 dont crash when you can't open a scanned fat file 2010-09-03 11:34:58 +00:00
zeromus b1891e35a9 more useful compact flash failure diagnostic printing 2010-09-03 11:32:15 +00:00
zeromus ca6054c6d1 no longer require a reset before auto-dldi works with libfat 2010-09-03 11:21:11 +00:00
zeromus 2a91ec3c9c fix autodldi in linux and fix attempt to load savestate -1 in linux-cli 2010-09-03 11:13:27 +00:00
zeromus 8cf436f9f8 this time without a hardcoded debug write to d:\\test.ima 2010-09-03 10:41:27 +00:00
zeromus b68eba259b begin rewriting and vastly simplifying compact flash fat generation code so that it is more amenable to bugfixing 2010-09-03 10:39:59 +00:00
zeromus c1f2d4629a fix handling of --load-slot=0 (same as --load-slot=10) 2010-09-02 06:51:31 +00:00
zeromus 8a55bc6219 fix load average calculators (has been broken for a long time) and add an arm7 load average. calculating that may be useless for practically everyone, later I may remove it or make it optional 2010-08-31 23:12:20 +00:00
zeromus a199a91f47 emulate firmware command 0x9F (read ID) and update test 2010-08-30 06:30:57 +00:00
zeromus e1901a2f08 win32: dont crash when dragdropping a savestate while no rom is loaded. its tacky. and fix a couple of warnings 2010-08-30 03:34:42 +00:00
zeromus d617c0141b broken directx.7z caused pointless rebuilds over and over 2010-08-30 03:31:39 +00:00
zeromus 78be544fc2 improve regs test (and make it a fifo example) 2010-08-30 02:21:39 +00:00
zeromus c442ae295f rasterizer: slightly improve shadow precision 2010-08-28 03:45:40 +00:00
zeromus a77cb87edc block 8bit writes to oam and palette memory (and update tests) 2010-08-27 19:11:00 +00:00
zeromus 86c9c63aed win32: add vsync option under display method. a bit tricky due to our display multithreading. let me know how it works for you. 2010-08-21 18:32:59 +00:00
zeromus 864e2664a3 port r3749 from 096 release branch 2010-08-17 06:06:56 +00:00
zeromus cb0ce43bfc spu: fix a sort of a memory leak when synch mode was selected but output was disabled. this may have been done for a reason....? 2010-08-15 23:50:47 +00:00
zeromus 84aca05c89 some spu regs needed to be fewer bits and write-only. also added tests 2010-08-15 21:15:59 +00:00
riccardom 541dba3a78 Don't leak dir on error path. 2010-08-15 14:06:39 +00:00
gocha 7fab839c75 Lua: warn when memory.register* function is called, although it's not available. 2010-08-15 02:56:14 +00:00
zeromus e28f34a6d9 emulate expanded memory a little more accurately, but for no reason other than that i got an expand memory pak and was playing with it 2010-08-13 02:02:21 +00:00
wntrmute 8c0cc33773 disable broken gdb stub code 2010-08-10 10:07:56 +00:00
gocha f00bdc7b72 RAM Search: Fix counting of number of changes. 2010-08-10 05:22:41 +00:00
zeromus b2faef8aad win32: fix start paused commandline flag, and i had forgotten to checkin xinput.h earlier 2010-08-10 02:54:17 +00:00
zeromus 9248e9454b make slot2 addons more realistic, and add xinput rumble support 2010-08-10 01:55:43 +00:00
adelikat cc38aeeef8 Win32 - Ram Watch - Add Separator button 2010-08-10 01:42:41 +00:00
zeromus 29acd2d238 would you believe there are still bugs in our @#&*@#ing matrix stack? fixes a bug that causes overwrite of matrix stack when offset==31; and apply fixed point logic for texCoordinateTransform==3 2010-08-08 22:46:13 +00:00
riccardom 56ea49a9e3 Some fixes and cleanups for FAT_R4
- Use typedef in struct definition
- Fix zeroing of struct, {0} is not enough need memset
- Fix english and size specifier in printf: u64 wants ll
2010-08-06 16:53:23 +00:00
mtabachenko 3bfdea87a1 sorry, forgot update MMU.cpp 2010-08-06 10:04:41 +00:00
mtabachenko dbea6bfe75 SLOT1:
- separated slot1 handler to new files;
- fix boot games from firmware;
2010-08-06 09:39:36 +00:00
mtabachenko 8f090d0499 cheats:
- add support for Action Replay V1.54
2010-08-06 07:27:21 +00:00
zeromus da36b80fdd win32: repair a copy/paste error which prevented layer display twiddling for sub gpu from working 2010-08-01 23:59:54 +00:00
riccardom f842340653 gtk: kill gdk_draw_* apis that will go away in gtk 2.22
So it's summer cleanup in gnome land and some functions
will go away in the next gtk release. So remove the
usage.

Reference:
http://blogs.gnome.org/otte/2010/07/27/rendering-cleanup/
2010-08-01 14:35:15 +00:00
mtabachenko 82db2206b0 core:
- ignore writting to the GPU engine control registers when it disabled in POW register (ex. Youshi Touch Go send commands to GE, but 3D GE bit in POW register disabled);
2010-07-28 08:50:20 +00:00
zeromus e4fcfb08af try fix 64bit pointer math compile errors 2010-07-28 03:58:59 +00:00
mtabachenko 0add4b34bf Cheats:
- add export cheats from R4 database (only from decrypted);
use: place USRCHEAT.DAT in DeSmuME folder, in Emulation->Cheats->List click on "Export..." button.
TODO: decrypting encrypted DB, add choose path for DB
2010-07-27 21:35:44 +00:00
mtabachenko f13b137867 core:
- add mapping ROM data to 0x08000000 (GBA ROM) and SRAM to 0x0A000000 (GBA RAM) when GBA slot is empty (fix homebrew);
2010-07-27 13:15:52 +00:00
zeromus 5e3b0bb527 try to fix backup memory in movie mode which was pretty much completely broken 2010-07-25 07:54:19 +00:00
zeromus 522bbb7cec win32: dont resume emulation if resetting while paused. possibly annoying, but without it theres no way to pause on the very first frames. todo: consider philosophy of this 2010-07-23 20:54:48 +00:00
normmatt234 6bcf46190b remove useless variable. 2010-07-21 07:34:28 +00:00
normmatt234 90698769d0 Fix R4 SD Writing. 2010-07-21 07:31:55 +00:00
riccardom f71a1ae89c Fix mispelling of MMU.h. 2010-07-21 06:47:07 +00:00
zeromus 384c6bca66 run slot1 through a modular addon system 2010-07-21 05:47:05 +00:00
riccardom 295ffa90b1 Fix wx frontend compilation
Add wxcontrolsconfigdialog.* stuff to the build and fix
wxcontrolsconfigdialog.h include path. What about a
shorter name next time? ;)
2010-07-18 09:05:24 +00:00
riccardom 1f279f75af Thou shalt not use strnicmp.
Thou shalt use strncasecmp.

Fix compilation on !MSC.
2010-07-18 08:51:51 +00:00
zeromus dcfe3bad86 what about AR he says 2010-07-18 07:01:28 +00:00
zeromus 9bf7ca718c win32: subwcrev needs dlls 2010-07-18 06:58:36 +00:00
zeromus 9c750642c8 fixes to cheat system 2010-07-18 06:32:15 +00:00
zeromus 5e8fa718c6 win32: fix matrixview (which was broken during fixedpoint conversions) 2010-07-17 10:56:58 +00:00
zeromus fb7b9a2104 make cheat system not so flaky with respect to numbers of cheats. it is my hypothesis that every single person whose cheats slay the emulator has entered more than 100 cheats and until now, 10,000 crashed emulator users later, nobody has bothered to tell us. should support unlimited cheats now, but i refuse to test cheats so someone else tell me if i broke something. 2010-07-16 02:40:54 +00:00
zeromus c5643835a1 win32: support more joystick parts 2010-07-13 06:19:48 +00:00
luigi__ 9e40fe4435 WX port: Add in new input dialog and base stuff. Not functional yet.
Fix high CPU usage when not running.
2010-07-10 14:22:17 +00:00
zeromus 98546fb57c vio2sf: integrate patch #3026630 (vio2sf instrument selection). additionally, add the sound view from desmume. 2010-07-08 04:58:34 +00:00
riccardom 97d601d2cd More pretty printing of the versione name. 2010-07-07 22:50:13 +00:00
zeromus 1adb24e67d print emulator version when it initializes, just because it is handy 2010-07-07 22:37:23 +00:00
zeromus b1df012477 wxwin: standardize sdl lib 2010-07-07 20:58:55 +00:00
zeromus e60ee3fb27 win: forgot to save texture option 2010-07-07 20:40:03 +00:00
luigi__ cbacd016c0 WX: enjoy SDL sound under Windows
--
Is it okay to also use SDL for a simple and clean input module? the current one is full of Dolphin specific stuff and it's a mess `_`
2010-07-07 18:29:35 +00:00
zeromus 84bfa26bc7 rasterizer: apparently decal needs a special case for texture-disable after all. 2010-07-07 05:12:09 +00:00
zeromus 49689be1ce don't auto-patch DLDI unless game code is #### 2010-07-06 04:05:24 +00:00
riccardom 68a0e791db comment (sigh!) a variable that is used only in already
commented code.
2010-07-05 12:42:26 +00:00
mtabachenko b1db5d2080 core:
- fix IRQ handler for ARM7 when use external SWI (big speedup);
2010-07-04 15:19:16 +00:00
mtabachenko 54c80ae16e core:
- add 8bit read divcnt register(fix bug #3015135);
2010-07-04 11:20:31 +00:00
riccardom d7e32d8e8f MatrixMultVec3x3_fixed should be available also when
ENABLE_SSE is not set. Fix compilation on linux.
2010-07-03 16:07:49 +00:00
zeromus 4dbec12893 gfx3d: change lighting engine almost entirely to fixed point, and substantially improve accuracy of specular component 2010-07-03 11:35:10 +00:00
zeromus 25c2789ca5 win32: add an option to disable texturing, for debugging and educational purposes 2010-07-02 18:56:05 +00:00
normmatt234 705a26cf41 Armwrestler now uses standard devkitarm makefiles. 2010-07-01 05:27:33 +00:00
normmatt234 9535e3cff9 opps wrong folder. 2010-07-01 04:34:41 +00:00
normmatt234 6a04e0323a add armwrestler. 2010-07-01 04:29:46 +00:00
normmatt234 533c294023 Lets make SUB use the common OverflowFromSUB function. 2010-07-01 04:25:19 +00:00
zeromus b4d1199518 win32: show editbox in path config directory browser, so that it is not evil anymore 2010-06-30 21:39:07 +00:00
normmatt234 5d3f4e9e22 Fix the overflow flag on thumb SUB opcodes (this could also affect other opcodes). 2010-06-30 10:51:14 +00:00
zeromus 7b4b78b215 win32: fix huge executable size. now maybe certain people will pay attention to less useless things 2010-06-29 21:47:30 +00:00
zeromus b5ff3a3111 fix emulator memory corruption when a ridiculously large texture is bound, such as one that might be defined by 0xFFFFFFFF 2010-06-29 00:10:54 +00:00
zeromus f810403c92 rasterize: simplify handling of non-textured polys: it seems that everything is logical if the sampler returns opaque white and everything else proceeds as normal. 2010-06-28 07:24:20 +00:00
mtabachenko ef767f03c3 - add experimental control of bus (fix games with "--FIFO FULL--" message) - a HACK!!! 2010-06-26 17:56:25 +00:00
zeromus cfb5940ea8 rasterizer: remove toon table caching. i thought of conditions where it could fail and not recover. left it for ogl though since updating toon table costs a texture update. 2010-06-26 07:01:51 +00:00
riccardom f9353eab01 wx: Don't crash when loading from recent files a file
which is gone.
2010-06-24 09:36:04 +00:00
luigi__ 90086cf357 WX:
- put the WX libraries into the project settings. (I had to do it with Notepad++ to be compatible with x64. Hoping I didn't fuck up anything but everything should be ok). Start getting rid of those #pragma comment's.
- first attempt at implementing touchscreen. Doesn't work, probably due to crossplatformness issues. >_<
2010-06-23 22:11:53 +00:00
zeromus a562c7f966 fix some stuff in wx windows, and add wxConfig to the wx lib 2010-06-23 18:00:18 +00:00
luigi__ 1ed8852044 WX: smash certain compilation errors. The remaining ones are because the wxConfig stuff aren't in the WX .lib's for some reason. zeromus gotta rebuild those properly and everything should work :) 2010-06-23 16:59:52 +00:00
luigi__ 423e1ad7fa WX: little fix. Windows building still broken, working on it.
(also we should quit using stuff from other softwares because it can cause problems like this little one)
2010-06-23 15:58:34 +00:00
riccardom d58743fd37 Remove comment that may suggest to use wxConfig instead
of wxFileConfig since on windows it would mean using
wxRegConfig and we don't want that.
2010-06-23 15:50:21 +00:00
normmatt234 a81c816841 Fix a few FIFO bugs. 2010-06-23 14:09:35 +00:00
riccardom 138d14b4bc Don't try to build OGLRender.cpp without GL headers, warn
about it instead.
2010-06-22 21:59:29 +00:00
zeromus b2610dfe11 win32: tileview: fix palette index display 2010-06-22 03:15:36 +00:00
zeromus 60c5b06bc8 win32: mapview: fix crash bug which should have rendered it useless, but was mysteriously not for anyone until just now for me 2010-06-22 02:59:33 +00:00
riccardom 499826aab3 Fix compilation on !_WINDOWS. 2010-06-21 12:24:45 +00:00
zeromus 271fd8bfe1 dont crash when empty path configurations are specified 2010-06-21 06:17:40 +00:00
zeromus 5808c1d667 win32: lets try this to fix path configuration 2010-06-20 21:12:06 +00:00
zeromus 9804f0119a try to handle slot1 motion pack commands without confusing it with save memory access. 2010-06-20 09:42:16 +00:00
riccardom 1ef7d2101c Use strcasecmp instead of stricmp. On MSC_VER it's the
same, see types.h.
2010-06-17 15:55:59 +00:00
zeromus b804c2e2b1 add --gbaslot-rom=self special value which mounts the current nds rom as a gba game, and fix the win32 cflash configuration dialog 2010-06-17 05:24:35 +00:00
zeromus f72ce94f8d correctly emulate GX FIFO DMA of 0 words (why would anybody do that?) by properly freaking out 2010-06-16 20:48:26 +00:00
zeromus 68ffbc5ca7 random perk - auto-dldi patch 2010-06-15 03:16:17 +00:00
riccardom 4308f68535 Remove leftover, palette is already cleared some lines before. 2010-06-14 11:31:52 +00:00
zeromus 142a66bab0 gpu: fix blinking cursor in estpolis. 2010-06-14 00:54:14 +00:00
zeromus 45132ba796 what dont you guys like debug prints? 2010-06-13 23:11:33 +00:00
riccardom 125ecc8cf4 configured_features is a class and not a struct. 2010-06-13 15:08:57 +00:00
zeromus 24bff13260 convert heart of geometry engine to fixed point. some things will be broken but it is hopefully only one cause which we'll fix when we find it. but then again, maybe i broke everything. 2010-06-13 03:20:14 +00:00
zeromus 8fd20b6b3b fix use of uninitialized memory in compactflash leading to unpredictable failures 2010-06-13 03:16:11 +00:00
riccardom 0d6321b491 gtk: don't segfault with not available files in recent list
Instead of segfault display an annoying window and remove it
from the list.
Reported by tvtoon.
2010-06-02 12:31:09 +00:00
zeromus 42ffb6345a add version field to nds_header 2010-06-02 03:34:26 +00:00
zeromus c9551b5144 more cleanup of 0x08xxxxxx and 0x09xxxxxx along those same lines 2010-06-01 23:02:35 +00:00
zeromus 7e1ec9f583 some cleanup of banner info handling, so bitbox 4k demo loads again 2010-06-01 22:39:59 +00:00
luigi__ e40600564f Remove zeromus' stupid sabotaging. Completely block WFC. 2010-05-30 10:39:51 +00:00
normmatt234 e72cf1b901 add vs2010 filters file 2010-05-27 02:14:37 +00:00
yabause 79254b307a Applied patch by Guillaume Bedot to include missing files
in distribution.
2010-05-25 19:22:12 +00:00
zeromus 7535e4b8e0 oops debug prints 2010-05-24 14:58:48 +00:00
zeromus 0ba2839065 fix care of magical creatures (relies on invalid vram mapping behaviour); maybe break other things? 2010-05-24 03:07:23 +00:00
zeromus acb25f73a2 upgrade subwcrev.exe to a newer one which doesnt trip clamav 2010-05-19 02:23:22 +00:00
zeromus 2008c48d04 fix vs2010 x64 compilation 2010-05-18 04:46:06 +00:00
zeromus 37453c7af9 fix r3643 regression which broke arm7 on certain bios configurations due to bug in the bios protection check 2010-05-17 19:22:34 +00:00
gocha 40d58e14fc RAM Search: fix reset to update previous values
RAM Search: redraw the list when search size/format is changed.
Probably those are common bugs of the Gens-style RAM search dialog.
2010-05-16 08:40:45 +00:00
zeromus b6d3c26b2b auto-select #DEVELOPER if #GDB_STUB 2010-05-16 04:04:31 +00:00
zeromus ed7b6cd6f6 maintenance on gdb stub (should work again); don't crash when receiving invalid parameters for swi 0x1A-0x1C (and add a crude test case for that) 2010-05-15 23:23:10 +00:00
riccardom 0bb50b5372 Cleanup ExposeDrawingArea a bit. 2010-05-15 16:02:56 +00:00
riccardom 9f10047113 Uh, it looks to me that we should unref the gdk pixbuf
unconditionally.
2010-05-15 15:59:16 +00:00
riccardom d1e2adbbab Apply single screen patch from #2998869 by noodlebox. 2010-05-15 15:22:40 +00:00
zeromus da6af1be95 remove poopy hack 2010-05-15 14:32:26 +00:00
riccardom 85d94c07e4 Window size bugfix from noodlebox. 2010-05-14 08:28:28 +00:00
luigi__ bf6392079a screw default arm7 binary. The whole part about loading ELFs will be done differently. This is unneeded. 2010-05-13 16:41:38 +00:00
luigi__ 4885c6588b Fix WinPCap loading. No idea why zeromus made it load pcap_send() instead of pcap_sendpacket(), but now it supports both, and if pcap_send() can't be found, pcap_sendpacket() is loaded instead. 2010-05-13 16:12:12 +00:00
luigi__ 04d9bec939 Add in default ARM7 binary from libnds, under both raw and ELF format. 2010-05-13 14:54:34 +00:00
riccardom a6c6f6b354 Make some global variable with a common name static to
avoid clashes.
2010-05-13 13:43:24 +00:00
riccardom 7e3c80e1d8 gtk frontend: nds_screen.size_ratio is not needed anymore. 2010-05-13 11:52:56 +00:00
riccardom 02b5aa97e5 List enhancements from needlebox's patches. 2010-05-12 19:11:46 +00:00
riccardom c43184b77b make distcheck does not like file supposed to be
translated which are not. So for now add wx frontend
related strings to the skip list.
2010-05-12 16:33:58 +00:00
riccardom ad1dc864fc Fix make distcheck
Add wx to DIST_SUBDIRS as suggested by Guillaume.
2010-05-12 16:24:03 +00:00
riccardom be3000353b gtk frontend: Ignore initial mouse clicks from outside the
touchscreen, but allow dragging outside of it once touch
is started.

Patch from #2998869 by noodlebox.
2010-05-12 16:11:10 +00:00
riccardom 77024d3b82 On glib > 2.14 save screenshots on XDG specified dir for
pictures.
2010-05-12 16:02:08 +00:00
riccardom 1c31be8a5c Don't crash taking a screenshot on non default rotation / orientation
Patch from #2998869 by noodlebox.
2010-05-12 15:20:11 +00:00
riccardom 0e61c45d5f Add option to swap screens to gtk frontend
Code taken from patch #2998869 by noodlebox.
2010-05-12 14:55:11 +00:00
riccardom b68eac1b42 Add Horizontal orientation to gtk frontend
Code extracted and cleaned up from patch #2998869 by noodlebox.
2010-05-12 14:44:44 +00:00
riccardom dd77b3aeda Make sdl mandatory, build fails anyway as found by Guillame. 2010-05-12 14:23:56 +00:00
mtabachenko b2af2527fe - add some docs;
- add IDA PRO NDS loader;
2010-05-12 10:24:47 +00:00
riccardom 73bf5e3467 Merge r3618 from 0.9.6 release branch
Remove wxdlg from DIST_SUBDIRS to unbreak dist-gzip.
2010-05-11 23:15:59 +00:00
mtabachenko aaf0092a4a GBA slot:
- fix detect savetype;
2010-05-11 16:59:04 +00:00
riccardom fe0f471812 More housekeeping in sdl controller stuff, remove stuff
that is not used and make static if it is only used in
ctrlssdl.cpp.
2010-05-09 22:35:48 +00:00
nitsuja 960d3514be typofix 2010-05-09 19:05:10 +00:00
nitsuja d8df35d418 rasterize: hack to avoid obvious regression of edge mark quality compared to in 0.9.5 (the transparency was not there to compensate for the colors being too dark). should revisit this when working out how antialiasing really works on the ds. 2010-05-09 18:51:23 +00:00
riccardom 9912b1b04d Convert rotation menu to a GtkRadioActionEntry
And one atoi less in the wild :)

Code change extracted from patch #2998869 by noodlebox.
2010-05-09 16:24:35 +00:00
riccardom 65151a3094 Cleanup the code a bit, make some loops more natural and
merge two duplicate functions.

Again the compiler does not care about the changes :)
2010-05-09 15:42:40 +00:00
riccardom e1f7f155a2 Cleanup REG_IME cases in MMU.cpp to have a correct coding
style and a bit more compact code. No functional changes,
compiled object is the same.
2010-05-09 15:29:52 +00:00
riccardom d25ec2d119 Apply patch #2998037 from noodlebox:
1) Larger dead zone for analog controls.  Also fixed possible
 issue where negative side of dead zone might not be applied.
 (right bitwise shift applied to negative integers, implementation seems to vary)
2) Analog controls can now be assigned to buttons, and
 non-analog controls can now be assigned to the directional controls.
3) Differentiates between positive and negative movement
 for analog controls.
4) In the GTK and Glade ports, directional buttons can now
 be set independently of their "twins".
5) Hat/POV/D-Pad controls are usable now.
6) Differentiates between multiple controllers.
7) Slightly modified method of storing joypad key codes, in
 a way similar to VBA-M's method of configging controls, though
 I kept the codes as u16's.  The way it's arranged now will allow
 for up to 16 unique joypads, and up to 128 axes, 64 POV hats,
 and 256 Buttons per joypad, which should probably be enough.
 The method of determining a key code is explained in ctrlssdl.cpp.
 Basically, it starts with 0x1000 * joypad_index.
 For buttons, add 0x200 + button_index.
 For hats, add 0x100 + 4 * hat_index + (0, 1, 2, or 3 for R, L, U, D). 
 For axes, add 2 * axis_index + (0 or 1 for negative or positive). 
 Maybe there's a way to get the config file to save these values in
 a hexadecimal representation for easier editing, but I didn't really
 mess with the configs.

So, the reason I decided to try this was that I was having some issues
with my wired XBox 360 controller in the Linux GTK, Glade, and CLI ports
(The controller works fine otherwise).
It seemed to be very sensitive, so it was impossible to "zero" the axes,
which leads to constantly scrolling through menus, etc.  The slightest
touch would trigger the input.  Also wanted to be able to use the D-Pad
and Analog triggers for something useful. The distinction between multiple
"joypads" should also help anyone with any other odd input devices being
recognized, like accelerometers. 

[rm: removed clear_events() from ctrlsdl.cpp since it is unused ]
2010-05-09 15:21:17 +00:00
riccardom fb7ebf22f4 Remove redundant declaration of void armcpu_exception(armcpu_t*, u32)
we already have in armcpu.h.
2010-05-09 15:10:12 +00:00
riccardom a84b35c819 Remove write only variable old_val. 2010-05-09 14:50:49 +00:00
mtabachenko 39692de722 - fix typo in MC READSTATUS register; 2010-05-08 17:26:57 +00:00
riccardom 20ed74f6d5 Fix click and drag, patch #2998460 from noodlebox. 2010-05-08 16:35:48 +00:00
riccardom 80625f4229 Fix compilation using the right variable name. 2010-05-08 16:27:54 +00:00
normmatt234 1ff0161d4e Add support for loading .srl files
Fix a few bugs in spi handling.
Update vs2010 project file.
2010-05-07 09:57:41 +00:00
zeromus d6cc212f0f fix gdb stub in trunk, make wifi warning more severe, fix some occasional link errors, and some other cleanup 2010-05-04 19:44:38 +00:00
zeromus dae6fcbd0f add libelf and libdwarf for potential fun times. none of the elf examples were working for me so i didnt even get a chance to test dwarf, but i dont think the problem is with the libs 2010-04-29 20:12:21 +00:00
mtabachenko 8c4d4bb3a1 core:
- a bit fixes on THUMB opcodes;
2010-04-26 22:33:08 +00:00
mtabachenko d6b75e99ac core:
- fix bug in Geometry Engine when in packed commands latest command is undefined (bug #2973143);
2010-04-25 17:53:47 +00:00
mtabachenko 0ca0356432 core:
- fix SMLABB instruction;
2010-04-25 16:02:18 +00:00
zeromus de4ff111bb fix obviously broken code in the RTC dayofweek calculation. Is it correct now? Not sure, but i think it fixes animal crossing at least 2010-04-24 20:10:24 +00:00
mtabachenko f535f9ac58 - fix overflow flag in ADCS/SBCS/RSCS; 2010-04-24 16:47:53 +00:00
riccardom fc0c459391 Add missing parens. 2010-04-24 15:55:21 +00:00
riccardom ce8d525928 Add missing include header. 2010-04-24 15:46:40 +00:00
riccardom d2434c3bd9 strdup needs string.h. 2010-04-24 14:31:42 +00:00
riccardom 7c420765a9 Fix "suggest parentheses around comparison in operand of ‘&’"
warnings.
2010-04-24 14:28:16 +00:00
mtabachenko ed419e6a3a core:
- a lot work on fix CPU emulation but not finished yet. Report to bugtracker if it break something.
2010-04-24 13:37:29 +00:00
zeromus 53a76b5be5 win32: save type menu was completely broken. awesome. 2010-04-24 07:24:18 +00:00
zeromus 882d05895e more chinese gobbledegook 2010-04-24 07:23:37 +00:00
zeromus bf2c15b24d critical bugfix!@! 2010-04-24 06:23:06 +00:00
zeromus c2ecb37c26 commit whatever pokefan did to chinese translation 2010-04-24 05:50:01 +00:00
zeromus 68588dd964 piano controller emulation. maybe youll want to use the mouse anyway once you try the game... 2010-04-24 00:54:44 +00:00
zeromus a9b186acb3 more realistic exception handling 2010-04-23 03:31:55 +00:00
zeromus 4069c5a517 win32: add shift+ptrscrn to capture 256x384 to clipboard with no extra info 2010-04-22 21:10:12 +00:00
zeromus 6e4af3f8b0 rasterize: edge mark colors were too dark 2010-04-22 20:45:12 +00:00
riccardom e8bd687f08 Make log3D static and put it under the same ifdef which
surround its usage.
2010-04-21 20:18:56 +00:00
adelikat 6b3438925c Win32 Drag & Drop - if .dsm file is dropped with no ROM loaded prompt for one. 2010-04-21 14:41:43 +00:00
normmatt234 77934940e2 update vs2010 project. 2010-04-21 11:04:30 +00:00
luigi__ d3b329ec7f tiny mistake again. 2010-04-21 10:27:25 +00:00
luigi__ fe2e22962a r3550, again :P 2010-04-21 10:20:12 +00:00
riccardom d727d83b5b WIFI_WFCWarning is supposed to be false as default. 2010-04-21 09:08:49 +00:00
zeromus 4393a347e3 B I T 2010-04-21 07:01:39 +00:00
zeromus fa8b1c7483 tweakin tha changelogs 2010-04-21 06:55:16 +00:00
zeromus 2ac4dfe8e6 merge r3563 to trunk and unnecessarily touch 1000 files 2010-04-21 06:34:19 +00:00
zeromus e4c49d8de9 merge r3561 from release branch 2010-04-21 04:32:19 +00:00
riccardom 96a47a4af9 Enjoy OO in driver instead of the same old boring ifdefery. 2010-04-20 22:42:50 +00:00
riccardom 8c80050dbe Fixup indentation. 2010-04-20 22:40:13 +00:00
riccardom 9ff4a176cf Fix preprocessor check for xbox. 2010-04-20 22:34:27 +00:00
zeromus 197273887f win32: clean up winpcap lib references (i.e. remove them) in all vcproj 2010-04-20 21:36:41 +00:00
luigi__ 02bfeac444 RIP, WinPCap libs (using GetProcAddress() since a while now) 2010-04-20 21:35:27 +00:00
zeromus df589d321a redefine elementary mathematics 2010-04-20 21:06:45 +00:00
luigi__ 07d7d2c01d MMU: wifi registers/RAM are only in range 04800000-0480FFFF, not 04800000-04FFFFFF. 2010-04-20 19:52:04 +00:00
luigi__ 455e2c7080 Memview: prevent modification of wifi registers and RAM. 2010-04-20 19:33:41 +00:00
riccardom cb6f0c0dfd Warn if --enable-wifi is set but libpcap is not available. 2010-04-20 18:58:38 +00:00
riccardom 42f9017627 Set infrastructure as default wifi mode. 2010-04-20 17:29:35 +00:00
luigi__ 5a4f5f9614 Wifi: fix potential endian issues on bigendian in the DNS parsing code. 2010-04-20 17:21:31 +00:00
riccardom 294e3e959c Use different stubs for wifi on !WINDOWS, mostly is using
plain pcap.
2010-04-20 17:18:24 +00:00
riccardom 3587dbad50 Add missing parens, spotted by gcc. 2010-04-20 17:16:36 +00:00
riccardom 4c0e2761e8 Add hack to have an understandable device name on
!WINDOWS (at least linux :) and print the selected
device name on log level 2.
2010-04-20 17:10:35 +00:00
riccardom 5f98f3906e Update code for RXHWWriteCursor -> RXWriteCursor rename. 2010-04-20 17:00:16 +00:00
luigi__ fb0db7b5ac Wifi: put in some parsing of DNS requests, and a warning when a DNS request to the WFC servers is detected, rather than just blocking any packet that contains "nintendowifi".
The user has to confirm he wants to connect to WFC, otherwise SoftAP will deauthenticate (therefore breaking the connection). Note on the warning, for those who don't read warnings and just hit spacebar: I made the No button selected by default.
If someone really wants to just block WFC, atleast we've got a more proper detector now...
2010-04-20 16:38:21 +00:00
zeromus 9dbac0c047 gtk: merge r3543 from release branch to fix dsm recording 2010-04-20 02:34:45 +00:00
luigi__ 323db4cdf2 wifi: tiny mistake, shouldn't have broken much 2010-04-19 11:39:50 +00:00
normmatt234 562eefd1b5 add vs2010 project files. 2010-04-18 23:39:40 +00:00
zeromus e72b321d29 rasterizer: fix an occasional crash during loadstate 2010-04-18 23:10:53 +00:00
zeromus 80ba44d209 add a crude technique to block connections only to WFC servers. youll have to comment it to get any love. 2010-04-18 18:34:23 +00:00
luigi__ b9740ab5c7 Wifi: fix some silly error in SoftAP_RXHandler. I don't know but that might have caused buffer overflows. 2010-04-18 17:38:21 +00:00
riccardom c390f82621 Comment a log message that references old
code now gone to make it compile with log level
higher than 0.
2010-04-18 16:15:11 +00:00
riccardom 012bf26764 Avoid segfault without available interfaces
On gnu/linux pcap_findalldevs can return 0 but
provide a NULL interfaces list. This could be
common on !windows because from what i can see
normal users can't list devices :|.
2010-04-18 15:59:27 +00:00
riccardom 09b06acd47 Move CPRS flags helpers wheremakes sense to
have them static.
2010-04-18 11:51:47 +00:00
luigi__ 5cd32213da Wifi: warning, possible awesomeness inside
DeSmuME can now connect to the WFC servers.
Connections may be unstable though. (hint, MKDS suffers from a timing problem when the race starts)
Also it seems safe to use the same fixed MAC. The only packets that contain the MAC address of the DS are DHCP and ARP packets sent at the beginning.
2010-04-18 10:59:04 +00:00
mtabachenko 31f60d908a core:
- fix single data transfer opcodes in ARM mode (fix UMK);
2010-04-17 17:11:21 +00:00
gocha b0f2383e4c windows: force update tool windows just after loading a savestate (ported from 0.9.6 branch) 2010-04-16 23:50:17 +00:00
dottorleo 91f338a4b9 Updated italian and chinese strings of the lastest Hotkey added. 2010-04-14 14:02:57 +00:00
zeromus 80e807c6da return Z1 and Z2 from TSC (fix scummvm mouse); and fix a creepy looking bug with IME setting in swi intrWaitARM 2010-04-14 06:12:19 +00:00
zeromus 8d72769735 win32: fix start-paused commandline 2010-04-14 03:59:27 +00:00
zeromus c034385553 merge 3520-3522 from release branch, add reload rom hotkey, and change label in control config dialog to no longer mention grayed out keys since theyre now all supported. and, as usual, unnecessarily touch 1000 files. 2010-04-14 03:31:43 +00:00
gocha 582db02edc Import resource file from 0.9.6 branch 2010-04-12 13:16:18 +00:00
gocha b9ee75878a Imported resource file from 0.9.6 branch 2010-04-11 05:55:31 +00:00
zeromus 1b8973649f fix spu loadstate crashes 2010-04-09 20:34:03 +00:00
mtabachenko a477807219 core:
- fix LDR definitions in table of instructions;
2010-04-09 16:58:33 +00:00
zeromus 264dc80808 win32: add feature: dump all memory (new button in memory viewer; inspect debug.cpp for a map of the file) 2010-04-08 20:33:12 +00:00
mtabachenko 2f01b6c2a0 - again ADC/SBC :( 2010-04-07 21:11:24 +00:00
yabause c627c6b8ad Added missing agg flags. 2010-04-07 20:57:51 +00:00
luigi__ 3bd57c4c95 Add more TODO, and nuke the useless OP_LDR_M_IMM_OFF_POSTIND2. 2010-04-07 16:54:12 +00:00
riccardom f0ca368148 Switch hud related switches to proper widget too. 2010-04-07 16:53:54 +00:00
luigi__ 26643f18eb ARM: Add more missing opcodes to the table (it should be fine now).
Also, more clean formatting, each line has got its index shown in binary to help looking for one particular opcode...
2010-04-07 16:36:09 +00:00
riccardom 634c2f31d4 Correct menu layers widgets to be checked check item. 2010-04-07 16:27:30 +00:00
riccardom d0f2fdc2e8 Update wx frontend per GPU changes. 2010-04-07 16:18:06 +00:00
riccardom 0fffdaca01 Move cli frontend event processing to process_ctrls_event
Unify the switch Instead of evaluating sdl events both
in ctrlsdl and cli frontend.

With this change now ctrlsdl gets in touch with both
GPU_osd and fake mic code.
2010-04-07 12:51:47 +00:00
mtabachenko e2dfe00574 - fix CPSR flags in ADC/SBC :P 2010-04-06 21:28:14 +00:00
zeromus 01ef774e13 win32: make layer toggling not so glitchy when switching roms or loading states, and fix a spu related crash when opening a new rom 2010-04-06 21:10:11 +00:00
zeromus 7909a3f8c2 spu: fix crash in loadstate with sound enabled 2010-04-06 18:41:19 +00:00
mtabachenko 833f4fcdb9 THUMB:
- fix Carry & Negative flags in ADC, SBC opcodes;
2010-04-06 17:24:31 +00:00
normmatt234 d2d18907c3 fix a couple of thumb opcode regressions.
allow ds, ds/dsi hybrid and dsi only nds files to be opened.
2010-04-06 16:20:48 +00:00
mtabachenko 3eb9de4614 core:
- fix CP15 register 1 (control register);
- fix CP15 register 2 (TCM size);
- remove CP15 from ARM7;
- fix some CPU bugs in THUMB mode (added comments from official reference);
- added loops for HLE BIOS exceptions;
2010-04-06 15:44:03 +00:00
zeromus 47bb26f093 and lo, the lies were abated and the untruth receded from the land 2010-04-05 22:47:46 +00:00
riccardom 6b88ebf513 Move initialization stuff not strictly related with the
wx frontend in DesmumeFrame::NDSInitialize(). While at
it add dummy firmware.
2010-04-05 17:03:06 +00:00
riccardom 867ac232e9 No need to include wx/isql.h (!) for a typedef. Brown
paper bag for me.
2010-04-05 16:33:24 +00:00
riccardom 914d91da2c Cleanup the code a bit wrt, unused functions and functions
that can be declared static.
2010-04-05 16:11:29 +00:00
riccardom 320fa688f1 Make our stub code for not shipping lua a bit less lame. 2010-04-05 15:16:37 +00:00
riccardom 76d9a939ed Reorder initialization order of some classes to shut up
gcc warnings about having them in a different order
where defined.
2010-04-05 15:03:51 +00:00
riccardom ba023fa075 Remember to destroy the 3d dialog
If we don't call Destroy() on close event callback i'm not
able to quit fully from wx frontend if i've previously
launched the 3d viewer.
2010-04-05 14:40:08 +00:00
riccardom 168c08ae11 Remove wx integration demo from gtk frontend
It works but since we have the 3d viewer available in the
wx frontend it does little sense to keep this here.
2010-04-05 14:30:46 +00:00
riccardom b12c226333 Does this FASTCALL definition helps? how much? in the mean
time just don't enable it for clang since it breaks
arm_instruction.cpp compilation with that. clang finally
compiles desmume \o/
2010-04-05 13:07:30 +00:00
riccardom e324dc1e9a Add missing cast. 2010-04-05 13:00:51 +00:00
zeromus c4c8592f7f spu: fix regression in some sound capture cases and support reverb better 2010-04-05 06:24:12 +00:00
zeromus 3882ebb4e7 dont checkin debug code 2010-04-04 09:23:53 +00:00
gocha 8db331c5ff Do not memcpy the destination itself 2010-04-04 09:12:55 +00:00
zeromus 99ccf835b8 add soundview toys 2010-04-04 09:06:29 +00:00
gocha ee7244e382 Give movies firmware settings as well as bios settings. (For now, it's write only!) 2010-04-04 08:43:32 +00:00
zeromus 61e06aea02 oops typo 2010-04-04 08:25:42 +00:00
zeromus 796364c337 tweak boot from card flag 2010-04-04 07:28:00 +00:00
gocha 4c5e700318 Add dirty dirty() calls for clearing Lua drawings even when no HUD parts are displayed. 2010-04-04 03:59:10 +00:00
gocha 7bca51aa57 Fix toBCD(), RTC read date should work right again. 2010-04-03 23:11:48 +00:00
luigi__ 90ff47e8fe ARM: fix a bug in the instruction table.
Fixes issue #2977277 (undefined instruction 0x54F13001).
2010-04-03 19:14:44 +00:00
gocha 50c7b966e2 Add RTC display for movie recording, and small modifications. 2010-04-03 15:18:57 +00:00
riccardom 67465b636f Fixup movie.cpp compilation. 2010-04-03 13:04:55 +00:00
gocha 1d0743861b Add new field 'rtcStart' to the movie. It specifies the time of RTC at the beginning of the movie. (needs more test!)
TODO: record firmware settings as well.
2010-04-03 07:11:29 +00:00
zeromus 196170a5c0 win32: why wasnt the debug key enabled? 2010-04-02 19:38:15 +00:00
zeromus 725159d943 add --advanced-timing for nonwindows users 2010-04-02 18:06:21 +00:00
riccardom f0b76ada6d Shutdown the machine before exiting, otherwise we can
segfault if a rom is playing. It also cleanups valgrind
output when looking for leaks.
2010-04-02 13:49:57 +00:00
riccardom 40d342e48f ROMfullName is already zero'ed before, no need to do it
for each entry.
I swear, i was looking there for another issue.
2010-04-02 13:45:54 +00:00
riccardom a4ffedc8df ...So there's no need to call NDSInitialize everytime
we load a rom.
2010-04-01 17:01:29 +00:00
riccardom 61933278a4 Standardize on WIN32 for preprocessor directives. 2010-04-01 16:54:26 +00:00
riccardom 113146e6b3 Pause the SPU when closing rom to avoid annoying sound loop 2010-04-01 16:52:00 +00:00
riccardom 93430f6d8d Add recent menu to wx frontend
Apply patch 2 series 2 from yar-tour, #2969484

rm: The fact that we need to call NDSInitialize on rom
    open is silly.
2010-04-01 16:47:07 +00:00
riccardom 78aa4a7a48 Use WxConfig for config file
No need to rewrite the handling of a ini-like config
file when wxwidgets have already one available.

These are patches 1 and 3 from yar-tour second series,
at #2969484
2010-04-01 16:35:00 +00:00
zeromus f53d6b5ee6 remove alternate flush mode reminder label; add option for advanced bus timing and add to emuconfig dialog; unhook 3d viewer temporarily since it doesn't work yet 2010-04-01 04:57:08 +00:00
zeromus a4fd327ced block 8bit vram writes (except from arm7 which gbatek says works) 2010-03-31 23:51:47 +00:00
zeromus aaa7ade12b changelog needed 2 months of updates 2010-03-31 21:51:51 +00:00
zeromus fad6fa759f default to soft rasterizer 2010-03-31 21:49:56 +00:00
zeromus 65ab7e85c5 win32: add arm9 load average to ctrl+prtscr 2010-03-31 21:31:30 +00:00
zeromus cf0cde6108 gfx3d: fiddle with poly sorting. break some things, fix more things. broken things I think are due to floating point gfx3d math 2010-03-31 19:19:39 +00:00
zeromus 08714ea7f2 make swap_buffers parameter take effect for subsequent frame, instead of previous frame, contrary to intuition and good sense. fixes some dual screen games which have been w/z broken for ages 2010-03-31 06:58:14 +00:00
zeromus ccff2d3149 oops i did that wrong 2010-03-30 08:43:42 +00:00
zeromus 513b3b648f add emulation for spi power management device system power-off and add power management device to savestates 2010-03-30 08:34:01 +00:00
zeromus 3198207ee3 fix interrupt handling to respond immediately when CPSR.I is changed; also double buffer 3d configuration so that the settings in place at the time of flush get used for rendering (important for dual screen 3d games that use different settings for each screen); and handle 3d clear color register more thoroughly 2010-03-30 06:34:08 +00:00
zeromus 79d4d0c3b0 continue tweaking scanline render timing (fix some parallax regressions) 2010-03-30 02:11:04 +00:00
mtabachenko 2cc4debe55 oops :( 2010-03-28 20:20:29 +00:00
mtabachenko 51ad58c5b1 core:
- add support for 16Mbit, 32Mbit, 64Mbit, 128Mbit, 256Mbit, 512Mbit flash memory card :) (NAND not implemented yet);
- fix a "div by zero" flag; 

winport:
- now savetypes in menu create dynamically;
- fix x64 build;
2010-03-28 20:18:49 +00:00
zeromus 0f04ee8a90 fix fog tables more correctly by throwing away top bit and making write-only. add a new test for register tests 2010-03-27 19:18:57 +00:00
zeromus d7d270f52c dont checkin suo 2010-03-26 18:53:54 +00:00
yoshihiropsp 3c57a06635 Xbox Project 2010-03-26 18:51:37 +00:00
zeromus 9e776c48ca check in all the xbox compile fixes after tweaking some things. looks benign. need to test compilation in nix still 2010-03-26 18:22:46 +00:00
yoshihiropsp 68bc1d1901 #undef min max and fix forceinline for XBOX360 2010-03-26 15:38:56 +00:00
yoshihiropsp 5910c2f198 Added XBOX include 2010-03-26 15:37:25 +00:00
yoshihiropsp 855be2fac3 Added Forceinline fix on XBOX360 cannot be used with static 2010-03-26 15:36:22 +00:00
yoshihiropsp ce47b5e87b Fixed GFX3D reset on xbox hardware #define _XBOX 2010-03-26 15:33:46 +00:00
yoshihiropsp 39f549db47 #undef min max for XBOX360 2010-03-26 15:32:15 +00:00
yoshihiropsp 4d0593d1a8 Add _XBOX undefined 2010-03-26 15:30:35 +00:00
yoshihiropsp fb1921507e Added XBOX360 support for compactflash 2010-03-26 15:27:39 +00:00
yabause cbd71f0b71 Reverting the whole tree to revision 3423, please test to
make sure everything is back :)
2010-03-26 14:48:19 +00:00
yoshihiropsp 643fdd4552 Big endian argb 2010-03-26 14:09:25 +00:00
yoshihiropsp ae5b752001 2010-03-26 14:07:31 +00:00
yoshihiropsp a7e636e8b0 Version string fixed for XBox360 new def 2010-03-26 14:05:31 +00:00
yoshihiropsp 30a8f124f1 2010-03-26 14:03:43 +00:00
yoshihiropsp 9d49db9111 Added some define for the xbox360 support 2010-03-26 14:01:24 +00:00
yoshihiropsp b60c6a0cce 2010-03-26 14:00:06 +00:00
yoshihiropsp 390bc43513 Added xbox360 support to desmume Yoshihiro 2010-03-26 13:53:21 +00:00
yoshihiropsp 2902629632 2010-03-26 13:50:14 +00:00
yoshihiropsp 194f66e4e2 2010-03-26 13:48:41 +00:00
yoshihiropsp 1c3bcfbaf8 Added xbox360 support on desmume 2010-03-26 13:47:15 +00:00
mtabachenko fc480466b7 - move xbox360 stuff to new directory; 2010-03-26 13:45:24 +00:00
yoshihiropsp c448f604ad Added xbox360 support by Yoshihiro 2010-03-26 13:26:31 +00:00
zeromus c8210b838d fix dualscreen 3d frameskip screen cloning/flickering regression from r3422 2010-03-25 03:10:11 +00:00
zeromus e068592d6b tweak around lcd line timing: make 3d vblank more generous (is still unrealistically brutal since all the rendering happens instantaneously, unlike real HW); give scanlines more time to render (render at end of scanline instead of hblank begin); execute an additional hblank dma on vcount=262 (speculative; fixes jittery nsmb split-parallax clouds) 2010-03-24 23:13:36 +00:00
zeromus c9f278e00d rasterize: fix fog densities > 127 2010-03-23 21:56:24 +00:00
mtabachenko edb9ebda3f core:
- fix overflow in matrices, NDS using only 24 bits for fixed-point numbers (fixed minigame with carrot :) and dialogs with star in "M&L Bowser Inside Story");

tools:
- add matrix stack test;
2010-03-23 18:56:10 +00:00
zeromus dcb572a348 fix swi 0x0E (crc16); your dawn of sorrow savefiles are invalidated. 2010-03-18 22:19:31 +00:00
zeromus 298c5256e3 debug: get rid of excessive "Reading beyond end of cart" messages 2010-03-18 18:57:36 +00:00
zeromus ee66bde8a0 debug: add no$ message support 2010-03-17 22:45:33 +00:00
zeromus 6a27ce1264 gpu: fix 3d blending color effects being applied when they shouldnt be 2010-03-17 21:25:11 +00:00
zeromus 5916d00047 win32: add menu items for obj display toggle 2010-03-17 19:25:33 +00:00
mtabachenko ef10848729 winport:
- fix input feedback support;
2010-03-17 14:04:50 +00:00
mtabachenko 51d227bff5 core:
- fix matrix stack for Projection & Texture mode (fix bug #2910405);
- fix some typos;
2010-03-17 13:10:15 +00:00
riccardom de1c8aed5a Add gap and resize support to wx frontend
This patch adds gap up to 90px when the user resize
vertically the window.

Speaking of sizes we are losing the last entry in the menu
because it does not fit in the 256 px limit.

Patch #5 by yar-tour from #2969484
2010-03-16 20:33:47 +00:00
riccardom fbe279dbdf Add rotation to wxwidgets frontend
Add rotation to wxwidgets frontend, code derived from
gtk frontend.

rm: my changes are mostly cosmetics (how can you read
multiple statements in one line? a mistery to me :)
and some tidy up for gpu_screen_to_rgb. Let me left
this quote in my defense:
"If you want to go somewhere, goto is the best way to
 get there."

Patch #4 by yar-tour from #2969484
2010-03-16 17:34:53 +00:00
riccardom 59a8ea41ab Add audio to wxfrontend on !win32
I've verified that calling the SPU_* functions without
SPU_ChangeSoundCore() does not harm here.

Based on patch #3 by yar-tour in #2969484.
2010-03-16 14:43:26 +00:00
riccardom ea6222a941 Cleanup load / save states menu
This cleanup the load and save states menu by using
EVT_MENU_RANGE.
Slightly edited from patch #2 of yar-tour in bug #2969484
2010-03-16 14:23:27 +00:00
riccardom 55fdb1b562 Fixup event enum
Using straight standard wx defintion as values in the
enum for events is wrong because we end up reusing the
already defined standard values. Use the wx definitions
directly in the code so we start from 0 in the enum.
This fix the funny random icons in the menu.
Slightly edited from patch #1 by yar-tour in bug #2969484
2010-03-16 14:01:08 +00:00
riccardom 71db5c1c21 Use Destroy() instead of Close() to exit from the controls
dialog.
2010-03-15 10:38:30 +00:00
riccardom c85a15078c Let the wx frontend build without libagg, based on a
patch by Yar-Tour in bug #2969484.
2010-03-14 23:17:21 +00:00
mtabachenko fb5f523f95 core:
- handle 32bit divnumer & divdenom (fix "Sonic Classic Collection");
2010-03-14 08:26:41 +00:00
riccardom 3ef409ba4e Move unused functions under #if 0. 2010-03-12 14:57:43 +00:00
riccardom 934fc9f777 colorAlpha is not used anymore. 2010-03-12 14:48:18 +00:00
riccardom 41b6f579c9 Remove unused variable and fix signed vs unsigned
comparison warning.
2010-03-12 14:47:15 +00:00
riccardom 2ecd8e296b Move declaration of nds_debug_* functions in header. 2010-03-12 14:46:44 +00:00
riccardom 8a083e5acb We can make validateIF_arm9 static. 2010-03-12 14:37:33 +00:00
riccardom a3bc1cd1cc Make acl_check_access static and comment a variabile which
is used only in commented code.
2010-03-12 14:33:58 +00:00
mtabachenko 3f3158c3c0 win32:
- sorry, I`m ignored last commit from zeromus :)
2010-03-11 21:53:23 +00:00
mtabachenko e4c0154dd8 win32:
- fix some bugs in OAM viewer and add scale thumb viewer;
2010-03-11 21:21:44 +00:00
mtabachenko 04aac479df core:
- fix timings in THUMB CPU mode (fix bug #2879374 and break SW: CW JA intro :(, maybe mistake in WiFi emulation);
2010-03-11 21:18:33 +00:00
zeromus 7b768b83d8 win32: straighten out the save slot 0 / F10 business 2010-03-10 18:03:11 +00:00
wntrmute 8ebe438af2 use correct address for argv 2010-03-05 20:42:35 +00:00
riccardom 8674c8cffe Cleanup resize code with opengl 2d
Based on a patch submitted at #2839785 by ramarren
simplifies a lot the code. It removes so much lines it
can't be wrong :)
2010-03-05 14:13:43 +00:00
riccardom e68f2e6cf1 Fixup cflash handling in cli frontend, bug #2955684
The code is c&p from gtk frontend to handle some addons
stuff properly. Should fix #2955684.

[insert a rant here on patches without reporter feeedback]
2010-03-05 13:43:41 +00:00
riccardom 63e66733bd Whitespace fixup. 2010-03-05 13:31:56 +00:00
riccardom 61a10c4ab6 Simply fps calculation. 2010-03-02 16:47:49 +00:00
riccardom 2ed569e475 Temporary workaround for forcing the cli keyboard mapping
instead of the gtk one.
2010-03-02 16:46:28 +00:00
zeromus 0254b5e5e2 screw around with some debugging features and the win32 disassembler windows 2010-02-28 00:07:11 +00:00
riccardom 9698f5670f Add a note about the libagg now optional for linux
frontends.
2010-02-20 13:57:06 +00:00
mtabachenko f89f383f91 core:
- add 32bits BLDY register write (fix fading in GTA);
2010-02-19 19:25:07 +00:00
riccardom b171a0991a Whitespace cleanup. 2010-02-17 21:40:30 +00:00
riccardom af100c36dc Don't build the wx frontend if antigrain is not available
I don't want to clutter the source code with ifdef :)
2010-02-17 14:36:51 +00:00
riccardom 264b0987e8 Let desmume build without libagg
libagg is used only by the HUD but the usage of it
outside windows is pretty small. So just in case it is
not available we can live without it.
2010-02-17 14:06:00 +00:00
riccardom 3573ce6248 GPU_osd.h is not needed here. 2010-02-17 10:49:02 +00:00
zeromus 40b6351dae stop letting roms read off the end of the cart and crash the emulator. 2010-02-15 11:02:49 +00:00
riccardom ecf8cf18c7 We can make CLZ_TAB const. 2010-02-12 16:57:39 +00:00
zeromus 277401e4d8 don't print mandatory \n in ideaslog 2010-02-09 19:33:03 +00:00
mtabachenko f5e29556bc winport:
- removed EXPERIMENTAL_WIFI_COMM definition from VS2008 x86 project (use userconfig.h for definitions);
2010-02-08 12:27:12 +00:00
zeromus 87124da471 fix another typo. this is why i said I dont have a code pattern i like yet 2010-02-06 15:51:04 +00:00
zeromus 15a712cc42 fix typo in powcnt1 2010-02-06 15:37:30 +00:00
zeromus bc3fd907e3 fix powcnt1 better (fixes manicminer homebrew)
note that 90% of all remaining desmume bugs can probably be fixed by more correct register emulation in a way done like this checkin. however I have not yet established a code pattern that I like for it so I am not sweeping through and changing them all at once yet.
2010-02-05 18:48:44 +00:00
mtabachenko 721f0406c9 OpenGL:
- rewrite shaders, optimized & fixed some bugs (fixed dark donuts in Garfield, bosses in Nanostray 2);
2010-02-05 16:41:15 +00:00
riccardom e48fcc9e85 Dont include lua cflags unconditionally especially since
we don't compile lua stuff.
2010-02-05 14:24:07 +00:00
wntrmute fdd1c0e6e8 build with gdb stub 2010-02-05 01:52:20 +00:00
zeromus e48bd707f3 wx port vcproj 2010-02-04 06:22:54 +00:00
wntrmute 99401dd1f4 fix about dialog 2010-02-04 03:11:08 +00:00
wntrmute fbd2bceab4 emulate 8bit REG_AUXSPIDATA writes 2010-02-04 01:16:08 +00:00
wntrmute ca4912c0f2 fix type error on OSX 2010-02-03 22:30:00 +00:00
wntrmute 20d1adf7b4 use --enable-wxwidgets for wx build as per help text 2010-02-03 22:14:09 +00:00
wntrmute b40dcdf3f7 use __APPLE__ for OSX specifics 2010-02-03 21:55:22 +00:00
riccardom 7d557512be Now that it build we can add the wx frontend, beware it
will hurt your kittens if you try to run it.
2010-02-03 21:29:51 +00:00
riccardom b0596ab4a2 Oops, missed icon and desktop file. 2010-02-03 21:28:09 +00:00
riccardom 8af1a93e77 Rename binary to wxdesume to avoid name clash with gtk
frontend. Add icon and desktop file.
2010-02-03 21:27:00 +00:00
riccardom 87f110db0b Fixup includes and add missing pieces needed for linkage. 2010-02-03 20:58:41 +00:00
riccardom 5b3f629a8d Add missing files to wx build. 2010-02-03 20:57:56 +00:00
riccardom 1743b0b81b More string fixup. 2010-02-03 20:28:52 +00:00
riccardom 83aad21779 Correctly use _T() to convert const char * to wxString
instead of a simple cast.
2010-02-03 20:16:32 +00:00
riccardom 13283cdf8f A few more const char * to wxChar * cast. 2010-02-03 19:49:33 +00:00
riccardom fd16c41514 Rename switch and description for wxwidgets. 2010-02-03 16:03:43 +00:00
riccardom cb63fb4d98 Add a makefile for wx frontend
The frontend will not build automatically from top dir,
you have to type make inside wx until it starts to compile
fine.
2010-02-03 15:35:46 +00:00
riccardom ec455a15aa Tentative fix for "conversion from const char * to const Wstring ambiguos" error, please review.
While at it define lstrlen as strlen which is not available
on !WIN32. Pretty sure it will not handle unicode chars
correctly but we can fix that issue later.
2010-02-03 15:32:39 +00:00
riccardom 144d049898 First batch to have wx stuff compiling
This is mostyle missing includes, includes with the wrong
case and wrong path, also there is that PanicAlert 
function that is not defined.
2010-02-03 14:19:10 +00:00
riccardom 4433cec8fc Show the view3d stuff and move it under tools. 2010-02-03 13:43:42 +00:00
riccardom 1721251fcb Avoid to link wxlibs with frontends that does not use them
The only frontend that may use wxwidgets library is the
gtk one so there is no need to link the others against
a tons of wxwidgets libs when calling configure with
--enable-wxwidgets.
2010-02-03 13:21:23 +00:00
riccardom 1f745442b8 Use memset to initialize data instead of a loop. 2010-02-02 17:06:55 +00:00
riccardom 7a6c1e5fd7 Plug file pointer leak, spotted by cppcheck. 2010-02-02 16:58:32 +00:00
riccardom 9ade0bd991 Fix a memory leak on error path, spottend by cppcheck.
While at it cleanup a static vs const misuse.
2010-02-02 16:46:44 +00:00
riccardom 8875c7d302 Fix allocation / deallocation mismatch, found by cppcheck. 2010-02-02 15:52:15 +00:00
riccardom 3db430b2bf Fix allocator / deallocator mismatch, found by cppcheck. 2010-02-02 15:47:42 +00:00
riccardom 26c12949b0 Remove some missing bits of disable limiter and sound in
cli frontend.
2010-02-02 13:53:36 +00:00
riccardom a5bbd83c8e Move disable sound and disable limiter switches to common
code.
2010-02-02 09:14:41 +00:00
zeromus 4e7172ac4a win32: fix x64 zlib link error 2010-02-02 05:38:35 +00:00
riccardom aed5f82988 Does not need GTK_CFLAGS here. 2010-02-01 20:46:04 +00:00
riccardom 69bf4a0b03 Don't link unconditionally against libosmesa
fix cli frontend --opengl-2d when libosmesa is available.
2010-02-01 20:22:30 +00:00
zeromus 568e0548e5 gpu: fix broken bg regression 2010-02-01 18:47:35 +00:00
riccardom bfaa92649e SDL_GL_DOUBLEBUFFER is not a valid SDL_SetVideoMode flag. 2010-02-01 17:05:23 +00:00
riccardom 907889d756 Whitespace cleanup. 2010-02-01 15:57:03 +00:00
riccardom 06a820969c Convert cli frontend to common command line handling. 2010-02-01 15:55:15 +00:00
riccardom ed9c5eb8f5 Cflash image file is handled by common code, remove unused variables. 2010-02-01 15:03:58 +00:00
riccardom 541348deda Fix indentation. 2010-02-01 14:51:46 +00:00
mtabachenko 66ec4060e4 core:
- add support for patched firmwares;
2010-02-01 14:47:01 +00:00
zeromus 7abcb201e6 win32: use faster zlib with asm optimizations 2010-02-01 06:37:47 +00:00
zeromus d042d84840 forgot to checkin a file. also, add some little gpu speedups 2010-02-01 05:34:43 +00:00
zeromus a440388cda core: don't execute builtin SWI when intvec is relocated to an abnormal location 2010-02-01 05:23:20 +00:00
gocha b18a6d62ab add lua51.dll and lib 2010-01-31 11:18:27 +00:00
riccardom 1cb3ae44ee Handle the B button again, fix bug #2942776. 2010-01-30 19:59:47 +00:00
riccardom 5df8e5548f Mode desmume_config.* in common dir
Move desmume_config.* in src/ since we are now using it
in three frontends.
2010-01-30 18:07:01 +00:00
riccardom 5a8ec614ba Revert previous commit, should take a rest indeed. 2010-01-30 18:03:33 +00:00
riccardom 7d79980fb0 Oops, write config file in gtk-glade frontend instead of
reading it again.
2010-01-30 17:22:09 +00:00
zeromus d5d24cbb88 gpu: fix some (all?) sprite priority regressions 2010-01-29 20:04:38 +00:00
riccardom 950c6c7460 SoftAP_RXHandler may be static. 2010-01-29 13:43:14 +00:00
riccardom 27484f074f Iniatilize _spu_advanced othwerise we read uninitialized
memory as reported by valgrind.
2010-01-29 11:14:35 +00:00
riccardom 9b8a0dc52c Add a note about using a common place for config and
saves. While at it give credits to OpenAL patch author.
2010-01-29 10:59:41 +00:00
riccardom 269d1940c4 Store config and save*s in user specific config directory
Apply patch #2936906 from Jan Steffens to save config,
saves and savestates in a common dir instead of having
them in the current dir.

The config file is moved automagically but you need to move
the saves and savestates inside ~/.config/desmume/ by hand.
2010-01-29 10:52:53 +00:00
riccardom 9b1d5c4ef2 Convert gtk-glade frontend to gtk config machinery 2010-01-29 10:45:38 +00:00
riccardom 7fefaca661 Add an entry about the OpenAL microphone support 2010-01-28 16:45:56 +00:00
riccardom 540ad3d357 Use DoQuit() when exiting. 2010-01-28 16:34:56 +00:00
riccardom 98f88f2aca gtk / cli frontends update. 2010-01-28 16:33:17 +00:00
riccardom 22d77183f5 Add joystick configuration gui for the gtk frontend
There's no reason why we can't have one too :)
2010-01-28 16:28:31 +00:00
riccardom 16e047c8e9 Implement set_get_joy_key(), set_get_joy_axis() as wrapper
around a get only version of the same. These will be used
in the gtk frontend where we want to have the luxury of
discarding changes.
2010-01-28 16:19:20 +00:00
zeromus 45e95b1a8a gpu: fix sprite rendering order to be front to back 2010-01-28 04:30:58 +00:00
riccardom 136f3a8642 Cleanup ALSA mic initialization
ALSA microphone code still suck but now a little bit less.
Cleanup the initialization:
- use default device
- don't force a buffer size and a period which some drivers
can't support, instead query the driver for them

The next step would be to add use interrupt driven capturing
on a separathe thread but ALSA is a bitch...
2010-01-26 20:47:36 +00:00
zeromus 1d7b5994ee win32: fix background pause menuitem 2010-01-26 17:52:18 +00:00
zeromus 7a96bc7c3a win32: fix occasional race condition crash in subsequent rom loads 2010-01-26 17:47:56 +00:00
riccardom 752a660b7d Whitespace fixup. 2010-01-26 16:20:24 +00:00
riccardom b5b2729ad0 Remove path for local includes
We have src/ in our path so no need all these ../
2010-01-26 15:35:25 +00:00
riccardom 5d6a64797f Read configuration from ini file
Use gtk frontend desmume_config.* machinery to read the ini
file. This should fixup joystick not working correctly as
reported in #2897620.
2010-01-26 15:33:45 +00:00
riccardom 3b9af24780 Make desmume_config.* frontend agnostic
Remvoe references to gdk and gtk frontend specific
configurations.
2010-01-26 15:31:33 +00:00
riccardom 6c996f8993 Init glib threads
We actually does not use them but there's a plan to do so.
2010-01-26 14:38:24 +00:00
zeromus 823030cbaf wifi: fix bugs in winpcap init; gdb: don't emulate hardware while stalled 2010-01-26 09:10:21 +00:00
zeromus 0d47349db8 win32: fix default command in pathconfig dialog to be OK instead of Cancel 2010-01-25 20:59:42 +00:00
zeromus ce0342e702 add capture registers to soundview; emulate remainder of spu mixing functionality; add "advanced spu" sound configuration and --spu-advanced=1 to unlock new features, since they are running a little slow right now. 2010-01-25 07:23:54 +00:00
zeromus 6f04d2be74 core: change uninitialized save data to be 0xFF like it is supposed to be 2010-01-23 18:13:28 +00:00
zeromus 01aa3ccccd spu: fix new bug in some sequenced music 2010-01-23 17:33:10 +00:00
zeromus 46c5ee5ef8 spu: proof of concept of sound capture. works in starfy and maxmod; not yet in nsmb. 2010-01-23 10:21:46 +00:00
luigi__ 27a730b365 Wifi: some cleanup/code refactoring. Nothing exciting. 2010-01-22 19:52:50 +00:00
zeromus 95163ca09a spu: overhaul register emulation; fixes a bunch of maxmod bugs 2010-01-22 08:59:09 +00:00
mtabachenko 2e4fb2384c core:
- some fixes in PU and cleanup MMU;
2010-01-21 23:29:00 +00:00
mtabachenko 5f49036c2a core:
- add PU for ARM7 BIOS region (fixed #2598209, #2596062);
2010-01-21 15:00:50 +00:00
luigi__ 01aef49125 Luigi__ is stupid stupid stupid stupid stupid stupid
pcap_open without the promiscuous flag!!!
2010-01-20 21:04:33 +00:00
luigi__ 7ab58ee5b2 Wifi: a few optimizations. 2010-01-20 17:58:44 +00:00
luigi__ 2072f74f71 Oops. 2010-01-20 17:40:24 +00:00
luigi__ 51497fc1a8 Wifi: put PCap functions in the platform driver.
Load WinPCap symbols through GetProcAddress(), remove linking against WinPCap, more graceful failing at GUI side when PCap is missing.
2010-01-20 17:31:51 +00:00
luigi__ a841946fd8 Wifi: rewrite SoftAP's packet receiver so that it can now receive up to 64 packets per millisecond. Use nonblocking mode (speedup).
Connections to the internet are still wonky. Are packets still being missed? Dunno.
2010-01-20 15:48:19 +00:00
zeromus c3bd9cd6e4 sdlports: fix bizarre occasional touchpad failure 2010-01-20 06:54:57 +00:00
zeromus b395a819e1 fix some valground bugs 2010-01-20 06:22:42 +00:00
zeromus 12259cefcd oops, apparently vc6 doesnt save dsp until you close it 2010-01-20 05:47:36 +00:00
zeromus ef6022e61e add a readme for howto build 2010-01-20 05:44:26 +00:00
zeromus 33c8717151 organize vio2sf for easier distribution 2010-01-20 05:22:32 +00:00
kode54 caaebe35e6 Fixed doubled interpolation options in Winamp configuration 2010-01-20 04:56:59 +00:00
luigi__ 58d236151a Wifi: some bugxifing. After that I've been able to use ClIRC (IRC client for DS) and chat on #dolphin-emu! But I couldn't connect to freenode.net for some reason.
Also, I readded the WFC profile for SoftAP, which would be needed by some homebrew. But I made the connection ID field empty. Anyway WFC doesn't work, remember.
2010-01-18 21:19:41 +00:00
luigi__ b496da643d Wifi: fix a bug due to the new POWCNT1/2 implementation. 2010-01-16 01:10:28 +00:00
luigi__ 31c31675c5 ARM: fix execution time for MUL/MLA opcodes. 2010-01-14 21:35:14 +00:00
luigi__ d0cfc8d6be Add an option to patch the DelayLoop SWI when loading BIOS images (speed hack).
Will work ONLY with Nintendo BIOS dumps! (the addresses that are overwritten are hardcoded).
2010-01-14 18:55:45 +00:00
zeromus e03efa73ef core: set default cpu stacks, necessary for bitbox demo sound 2010-01-14 00:18:32 +00:00
riccardom c80f085444 Fix OpenAL on Mac OS X (hopefully)
Unfortunately we are not able to check if OpenAL is
available or not on mac os x so add it as requirement.
2010-01-13 11:21:48 +00:00
riccardom a7032a211e Cleanup the openal microphone code a bit. 2010-01-13 10:48:18 +00:00
zeromus f82946cd96 core: properly emulate POWCNT1 and POWCNT2 (fix picross bootup) 2010-01-13 05:15:21 +00:00
riccardom 4306e404e4 Whitespace cleanup. 2010-01-11 16:11:11 +00:00
zeromus 14b1122641 win32: apply patch [2925555] to stop emu from crashing when no sound device is available 2010-01-10 07:41:14 +00:00
zeromus 685e8ef91e add a note about how to execute ideas printf 2010-01-09 20:41:23 +00:00
zeromus 7874f746eb gfx3d: fix a bug in vectest? 2010-01-09 08:40:57 +00:00
kode54 024e8b9707 Fixed vio2sf interpolation setting, imported foobar2000 0.9 SDK, imported missing files from foobar2000 0.8.3 SDK 2010-01-09 04:14:00 +00:00
kode54 16c57263de Updated MSVC6 project files, bundled necessary parts of foobar2000 0.8.3 SDK 2010-01-09 01:53:29 +00:00
zeromus 7a88e3e80d add old vc6 projects in case theyre needed 2010-01-09 00:33:29 +00:00
zeromus ec367f17be tools: add vio2sf; enable mute channels and add interpolation choice 2010-01-08 23:56:14 +00:00
mtabachenko 2ef411f641 winport:
- fix VS2008 x64 builds;
2010-01-08 13:07:30 +00:00
riccardom d41862a36a Updated Traditional Chinese translation from Ronmi Ren #2922635. 2010-01-07 14:35:00 +00:00
zeromus 4ae597c2f0 fix some warnings, move alignment masks ahead of other logic in the main mmu routines (fixes potential crashes when accessing totally terrible addresses), crudely emulate OP_BKPT 2010-01-01 09:03:00 +00:00
gocha d781e65e09 windows: fix some obvious weird errors of Japanese translation, add some new items from the English resource, and add a few of new translations. 2010-01-01 02:02:21 +00:00
zeromus dc5dbcba26 win32: fix non-checked language menu items 2009-12-29 06:18:32 +00:00
zeromus bd96da18a6 win32: fix vs2008 x64 builds 2009-12-29 06:08:19 +00:00
zeromus 19d38dc7aa win32: fix compile error 2009-12-28 17:17:40 +00:00
riccardom bb36f962ab Update desmume.pot, sorry translators. 2009-12-28 14:38:20 +00:00
riccardom 87f422bf6f Move _NOSSE_MatrixMultVec4x4 declaration in matrix.h
instead of inside a function in gfx3d.cpp. The _ suggests
it was meant to be in someway private but it's already
used outside matrix.cpp.
2009-12-28 14:08:01 +00:00
riccardom c1b4ad4ea2 Remove unused variable in gbagame addon and sort
initialization order in firmware class to shut up
gcc warnings.
2009-12-28 13:48:40 +00:00
riccardom bc53cc5a22 Shut up declaration vs initialization order gcc warnings. 2009-12-28 13:42:37 +00:00
riccardom 9cb111f927 Correct EXPERIMENTAL_WIFI_COMM ifdef position to avoid
compiling unused stuff.
2009-12-28 13:35:51 +00:00
riccardom c7fd1a9d07 Remove unused vars. 2009-12-28 13:24:40 +00:00
riccardom e2ca4ed530 Check fgets return code and shut up signed vs unsigned
integer comparison gcc warning.
2009-12-28 13:22:49 +00:00
riccardom 92090532b2 Make logo_dataconst and shut up gcc warning about signed
vs unsigned integer comparison.
2009-12-28 13:12:23 +00:00
riccardom 91be00d42e Add missing parens. 2009-12-28 13:07:59 +00:00
riccardom aa3cb25961 extern is not needed in this declarations. 2009-12-28 13:06:06 +00:00
riccardom fb0b919205 Remove duplicated NDS_CreateDummyFirmware declaration,
already available in firmware.h
2009-12-28 13:05:31 +00:00
riccardom 21c4253efc Add default case to switch to shut up gcc warnings about
missing handling of possible enum values.
2009-12-28 13:00:32 +00:00
riccardom 5ba23ec012 Remove unused vars. 2009-12-28 12:54:54 +00:00
riccardom dfbfdac140 Make some functions static. 2009-12-28 12:52:46 +00:00
riccardom f78409a83f Fix includes for version.cpp 2009-12-28 12:43:58 +00:00
riccardom 0bf3a00a65 Move class members initialization so that gcc stops bitching
about their order.
2009-12-28 12:34:35 +00:00
riccardom bca1dfb9ac The declaration should be under ifdef too. 2009-12-28 11:27:23 +00:00
riccardom 99d2e8baa9 Move wx specific code inside proper ifdef and fixup wx
related menu code indentation.
2009-12-28 11:25:13 +00:00
riccardom 5e8af885e1 Remove some commented code and fixup a comment indentation while at it. 2009-12-28 11:20:15 +00:00
riccardom fb9ead56d5 Remove unused but computed baseaddr variable. 2009-12-28 11:16:37 +00:00
riccardom ed6fd31c38 Add a simple auto frameskip to the gtk frontend
Add a simple auto frameskip method based on effective fps
ratio (fps / 60). If the ratio is too low add more frameskip,
if the ratio is too high or we are skipping too much do
the opposite. The proposed patch that led to this one is
available in bug #2862131.
While at it shorten the number of frameskip values
available since they skip too much to be playable.
2009-12-28 11:15:37 +00:00
riccardom 559039dc38 Shut up signed vs unsigned integer comparison warning by gcc. 2009-12-28 11:04:34 +00:00
riccardom e60dffbc84 Add zh_TW localization from Ronmi Re, #2921906. 2009-12-28 10:46:24 +00:00
zeromus 2f2dccee70 win32: apply patch: validation an add/edit cheat [2921008] 2009-12-27 19:12:10 +00:00
zeromus dcbff3f40b fix crash/freeze when adding internal cheats [2921845] 2009-12-27 18:57:10 +00:00
luigi__ efc55ff761 VS2008 project: Release Fastbuild is now Dev+ build.
Reason for that is that some things, like breakpoint support, will likely cause a slowdown. They can't be left in the normal build.
Now you don't have to modify your project file in order to build a Dev+ desmume when dev'ing.
2009-12-26 21:15:34 +00:00
zeromus d6ea4bf138 win32: fox bogus string loading function 2009-12-26 17:31:19 +00:00
mtabachenko 1d7d7df7e9 winport:
- fix load a settings of GuitarGrip;
- add saving a status of cheats (disabled/enabled);
2009-12-26 10:10:55 +00:00
zeromus 52b8847c04 more screwing around with languages 2009-12-25 17:18:20 +00:00
riccardom 0649ef51f5 No need to define HAVE_OPENAL here. 2009-12-25 15:14:58 +00:00
mtabachenko 3969516d0b - add check for bounds of internal cheats; 2009-12-24 18:49:50 +00:00
mtabachenko e629f9ea7a - fix load/save of cheats; 2009-12-24 18:16:21 +00:00
zeromus 094a1870c2 win32: checkin some chinese junk 2009-12-24 17:40:06 +00:00
riccardom 437d19fd24 Write message error when something fails in alsa microphone init(). 2009-12-24 15:05:13 +00:00
mtabachenko 7e959377ae typo fix in cheats :) sorry 2009-12-23 14:58:21 +00:00
mtabachenko 5bcac684dd typo fix in cheats :) 2009-12-23 14:56:44 +00:00
mtabachenko 69c199b857 winport:
- fix ddraw backbuffer for filters;
2009-12-23 14:42:46 +00:00
mtabachenko c762cdf95d winport:
- rewrite DirectDraw implementation (now it correctly works in Win7 HW mode);
2009-12-23 13:45:09 +00:00
nitsuja a9d76cb8c5 - fix some window size bugs regarding interaction between toolbar/lockdown/maximize/rotation/gap/layout
- make close rom clear the screen
- disable auto-unpause-on-reset if a movie is active
- prevent menu display from lingering over toolbar sometimes
- switch cw/ccw toolbar buttons (because the previous order was really confusing)
- fix crash in DD_DoDisplay
2009-12-23 12:10:25 +00:00
luigi__ 9a4457e4ff Add some rotate buttons to the toolbar, fix the black/random line under the toolbar and remove useless code. 2009-12-23 00:11:50 +00:00
zeromus 7e800960ff win32: add directdraw software-forcer (config > display method), to fix some systems with broken directdraw as well as block the bilinear filtering in winxp 2009-12-22 22:11:14 +00:00
luigi__ c07b76dc86 Fix a bug with the touchscreen when the toolbar is enabled. 2009-12-22 19:08:34 +00:00
luigi__ 1f58256b66 Windows port: make the toolbar optional as zeromus suggested.
Also took the liberty of clarifying the View menu a bit.
2009-12-22 18:52:47 +00:00
luigi__ b1f426ba3f Fix a sizing bug when changing screen layout. 2009-12-22 18:03:04 +00:00
zeromus 1058078891 it no longer lets WM_COMMAND fall through to WM_NOTIFY 2009-12-22 17:51:47 +00:00
luigi__ c7baaff898 Last commit messed up includes. Fixed. 2009-12-22 17:44:07 +00:00
luigi__ ba2ba7cca4 Fix compilation errors. 2009-12-22 17:40:57 +00:00
luigi__ 47c8545bee Windows port: Add a toolbar to the main window.
Unfinished, lacks some tooltips and some other buttons. But atleast the big part is here.
2009-12-22 17:25:32 +00:00
mtabachenko fad737ae87 RTC:
- fix "Select Out" low mode (fix bug #2919073);
2009-12-22 15:00:15 +00:00
mtabachenko 539aa86231 core:
- fix bug in RTC;
2009-12-21 23:42:14 +00:00
riccardom e89cfe3a49 Remove c&p error in configure.ac that broke alsa as default
mic implementation.
2009-12-21 21:17:56 +00:00
zeromus 76c3d62147 speculative fix for some failure-to-wake problems: maybe any irq should wake up arm7, and it is supposed to set up reasonable irq enables before going to sleep. 2009-12-21 21:09:37 +00:00
zeromus b57aabc994 add card eject emulation 2009-12-21 20:33:22 +00:00
normmatt234 db8774bdbf make carts think they are booted from card. (firmware sets this value). 2009-12-21 20:09:25 +00:00
mtabachenko 5e0a1bb8d1 - add FLASH 8mbit save type support and fix import backup memory; 2009-12-21 19:41:52 +00:00
riccardom a11364e8d9 Add experimental OpenAL microphone support (patch #2918507)
Add OpenAL microphone support as provided by ncalexan.
[rm: cleaned up the patch a bit using debug macros instead
     of plain printf and cleaning autotools stuff a bit.
     Not so sure it still builds on macos x so please raise
     your hand :)
]
2009-12-21 18:36:40 +00:00
zeromus 60e382c816 win32: what you dont like my debug printfs? 2009-12-21 18:10:19 +00:00
zeromus c9e117452f win32: minimally handle lcd layouts in fullscreen 2009-12-21 17:56:53 +00:00
zeromus 56c4cbc679 win32: fix fullscreen stylus coords 2009-12-21 17:33:16 +00:00
mtabachenko 41297b6d8e core:
- the type of ROM serial code is changed (now NTR-****-***)
2009-12-21 14:06:04 +00:00
zeromus 0eae3afc27 win32: might as well add the maximize button now 2009-12-21 08:09:10 +00:00
zeromus 482267cd75 win32: add alt+enter hotkey to delete all your pokemons 2009-12-21 08:00:39 +00:00
mtabachenko ee6f3dff11 winport:
- add to new custom printscreen code 3D render info;
2009-12-21 00:19:35 +00:00
zeromus 3f59a0b5d4 win32: dont screensave while using gamepad 2009-12-20 20:56:44 +00:00
zeromus 0490039779 win32: fix newlines in action replay cheats edit, and fix sticky pause condition when resetting or loading games 2009-12-20 17:19:32 +00:00
riccardom 8941b4aba9 Add missing header for memset and declare strings as const char. 2009-12-20 14:43:30 +00:00
mtabachenko bc56097041 - another fix :) 2009-12-20 14:40:27 +00:00
mtabachenko 659b0dbcb6 - fix for non WIN32 compilers; 2009-12-20 14:36:43 +00:00
mtabachenko 9d56185bc2 oops, typo fix, sorry 2009-12-20 13:53:46 +00:00
mtabachenko 039e177db6 cheats:
- fix EXXXXXXX code;
2009-12-20 13:46:46 +00:00
mtabachenko 6fe8d6bdc7 cheats:
- cleanup & add classes;
- new cheat file format;

tools:
- add 'cheat file format converter' (.dct) from old versions (console);
2009-12-20 01:31:58 +00:00
zeromus f397adaf47 win32: a bunch of cleanup and fix recent roms not saving when emulator crashes 2009-12-20 00:06:45 +00:00
zeromus 64cecb1b3e win32: try another tablet disabling tactic 2009-12-19 23:29:28 +00:00
zeromus 0888b3a5de win32: disable wacky stylus stuff for main window 2009-12-19 21:58:15 +00:00
zeromus 8adec34759 win32: still fencing with the resizing 2009-12-19 19:23:37 +00:00
zeromus ab429334f4 fix non-compiling wxdlg code in linux 2009-12-19 18:47:01 +00:00
zeromus 99ba104317 win32: put the new custom printscreen code behind ctrl+printscreen because it is obnoxious to interfere with standard printscreen that way 2009-12-19 18:42:33 +00:00
zeromus cde65de6a9 smack around window sizing code a little more 2009-12-19 18:31:29 +00:00
mtabachenko 217c1d336f add new NDS firmware tool 2009-12-19 17:13:59 +00:00
zeromus d96d624d6e try fixing some window size flakiness 2009-12-17 23:49:11 +00:00
mtabachenko 250fca30a9 - revert flag logic introduced by r3176 (fix #2916033, #2915937); 2009-12-17 07:59:05 +00:00
zeromus b377287bdb win32: fix window size creep when using various features while lockdown mode enabled 2009-12-17 06:36:40 +00:00
gocha e91edccdbb enhance gui.gdoverlay(), the new one can overlay a part of image and load indexed image. 2009-12-17 02:13:12 +00:00
mtabachenko 4fbf560d7a typo fix (nothing important) 2009-12-16 23:00:12 +00:00
mtabachenko 6e496c9834 core:
- another fix CPU emulation :)
2009-12-16 22:30:16 +00:00
mtabachenko 7ae6f09c1e core:
- fix some bugs in CPU emulation on ARM mode (need to test);
2009-12-16 21:50:42 +00:00
mtabachenko 2c59c934a8 texcache:
- add 'size' variable initialization in MemSpan class (fix emu crash, ex.Metal Slug 7);
2009-12-16 11:33:28 +00:00
zeromus 7b7bb56ba2 misc 3dviewer work. still not worth using 2009-12-16 08:52:03 +00:00
zeromus 55f60d5496 fix new bug in texture cache which wouldve caused corrupted textures to appear 2009-12-16 07:51:55 +00:00
zeromus 7b22d0b6bc i doubt everyone wants a hacky debug print to appear every frame 2009-12-16 05:47:09 +00:00
zeromus d0c111ebf6 core: fix an old shortcoming in texcache where games that burned through sprites memory with lots of tiny sprites could use gigabytes of texcache buffers (metal slug) 2009-12-16 05:41:59 +00:00
zeromus 18b544b251 win32: i doubt everyone wants a hacky test dialog to appear when they boot the emu 2009-12-16 05:11:32 +00:00
zeromus 8b89eb1ebe win32: fix always on top inifile saving and add "lockdown" option to keep mouse from breaking the window during fast stylus action 2009-12-16 05:07:38 +00:00
p989 16a06984bf wx: ini file and control config saving 2009-12-16 04:59:39 +00:00
p989 2aa985baec wx: input configuration 2009-12-15 21:49:39 +00:00
p989 2abb85a05d wx: savestate menu items 2009-12-15 08:50:30 +00:00
p989 cea3cc3ff6 wx: lua window 2009-12-15 06:37:49 +00:00
zeromus dea5e779c8 win32: fix build. 3dview is broken for a bit while it is renovated 2009-12-15 04:42:11 +00:00
zeromus 32e64e3e51 add wx dialog to gtk port as demonstration, but you can't see it because i can't figure out how to add a gtk menu item. anyway, my work here is done: concept proved. 2009-12-15 03:47:22 +00:00
p989 fcf244747d preliminary wx port 2009-12-15 03:06:47 +00:00
gocha 3bec8d8d00 hopefully fix awful movie handle leaks 2009-12-15 01:39:35 +00:00
yabause aa840c41ca Added a check to detect wx installation.
For now, it's disabled by default and you need to use
the configure flag --enable-wxwidget to enable it.
If wx is found, -DHAVE_WX=1 is added to compilation options.
2009-12-14 20:37:21 +00:00
zeromus e484e43cfa win32: fix error in 2005 vcproj 2009-12-14 17:53:38 +00:00
zeromus b8cbaf2828 win32: add wx, and preliminary 3d viewer work. i am not necessarily committed to wx yet, the bulk of the work is still refactoring in the core emulator. (also slow down release fastbuilds by improving gpu.cpp build speed) 2009-12-14 08:54:15 +00:00
zeromus 4f997b7dba linux: add --nojoy=1 to skip joystick initialization (for folks with laptops that have accelerometers for joysticks) 2009-12-13 21:42:55 +00:00
zeromus c10af35f4d fix --num-cores commandline in linux 2009-12-13 17:59:45 +00:00
nitsuja c9d1c8e467 add more 1.5x render filters, fix the EPX 1.5x filter, fix loading of frameskip=0 setting 2009-12-13 11:30:52 +00:00
luigi__ 04e3d1dafd Maybe I should delete those objects once printscreen is done... 2009-12-13 01:21:18 +00:00
nitsuja b12a40496f fix cheat add sometimes cutting off a digit 2009-12-13 01:18:59 +00:00
luigi__ f39cfd0c80 Window port: add some NO$GBA-like printscreen function:
when pressing Printscreen, a copy of DeSmuME's screens is sent to the clipboard, with extra data (desmume version, game title/code, framerate/status) appended at the bottom.
2009-12-13 01:10:52 +00:00
nitsuja 967408cbc1 fix a glaring desync that would happen if you load a savestate while the lid is closed 2009-12-12 22:52:01 +00:00
zeromus cf93552f98 win32: fix build configuration for zlib 2009-12-12 22:12:26 +00:00
zeromus 57c1f5caa5 win32: oop fix 2008 32bit release build 2009-12-12 17:36:05 +00:00
riccardom 92204bbe48 Correct SSE2 instructions ifdef, bug #2911655
prompt366 reports that linux build on his athlon (SSE but no
SSE2) is broken because of missing __m128i. Compiler is right
that instructions is from SSE2. Fix the ifdef to match the
code as suggested by prompt366.
2009-12-12 16:30:55 +00:00
nitsuja d37f31bf68 enable "add cheat" button in ram search and ram watch, and fix some cheat add/edit dialog bugs/limitations 2009-12-12 10:34:06 +00:00
zeromus b3b25bcc96 win32: give the same treatment to the other large libs 2009-12-12 08:19:38 +00:00
luigi__ df237f39d1 Remove that useless bitmap. 2009-12-11 22:05:32 +00:00
mtabachenko 0e05f39b21 core:
- fix MMU crashes;
2009-12-11 19:16:15 +00:00
zeromus d5b8a5be35 win32: now that is seriously lame. the 7z.exe depends on 7z.dll I think 2009-12-11 15:43:44 +00:00
zeromus fc12c385f0 win32: testing a strange idea. 7z the static libs we use and dearchive them to .libs as part of the build process. this will shrink a 30MB wx lib down to 3MB. let me know what you think (let me know asap if it breaks your build) 2009-12-11 08:46:44 +00:00
nitsuja a9351c7b75 sprinkling some W's around. maybe it will fix some title bars or something, either way it probably can't hurt anything 2009-12-11 08:43:20 +00:00
nitsuja e0204926c2 fix touchscreen crash 2009-12-11 06:23:42 +00:00
zeromus 1944fe2931 win32: fix 2008 vcproj 2009-12-11 06:11:58 +00:00
zeromus e0040d0da9 win32: use tastools lua 2009-12-11 05:22:46 +00:00
mtabachenko cf04dac50f core:
- fix support calibrating the stylus with firmware;
- some cleanup MMU;

addons:
- fix return value for blank memory (change to 0xFF);
2009-12-10 22:49:47 +00:00
luigi__ 49667709bd Also remove the code for Danish translation. 2009-12-10 17:15:31 +00:00
luigi__ 1971cd07cb Removed the Danish option from the language menu. 2009-12-10 17:12:21 +00:00
luigi__ ca035407c0 This goes with r3131. 2009-12-10 17:06:58 +00:00
luigi__ 1037bfa736 Added all the missing French dialogs. Phew.
Also removed the remaining Danish dialogs - I highly doubt we'll see that thomas-2007 again.
2009-12-10 17:03:26 +00:00
luigi__ 2e28c61837 Resource file: First try at applying the coding rules for resource file.
- Add missing Chinese dialogs (those are just copies of the English ones. The translation job is for zeromus or whoever made this translation.)
- Fix a few quirks.
- The Danish translation is desperately out of date. If we can't contact the person who made it, it'll get removed.
- The French translation is too. However, if I find some time...
2009-12-09 22:34:22 +00:00
zeromus b87032f948 fix linux compilation 2009-12-08 20:25:09 +00:00
zeromus c4a8559462 fix a bunch of games which were broken by r3123 2009-12-08 17:53:17 +00:00
mtabachenko 03068ccf1d core:
- rewrite firmware support. added support patched firmware (bugged and default disabled);
2009-12-08 17:33:18 +00:00
nitsuja 71d73de359 fix possible crash on minimizing app 2009-12-08 17:15:44 +00:00
zeromus 19fef7e068 core: handle 32bit divcnt and sqrtcnt 2009-12-08 15:45:45 +00:00
zeromus 0b6c04c04b win32: fix the most egregious cheats bugs for large cheat values 2009-12-08 07:50:58 +00:00
zeromus d248ef5cfd add another kind of debug print which may be useful to some people 2009-12-08 06:48:56 +00:00
zeromus b3ad503d49 win32: fix view registers tool 2009-12-07 20:55:39 +00:00
gocha 09689d9865 Lua: fix gui.gdoverlay 2009-12-07 06:50:44 +00:00
nitsuja 0f6b30741d lots of emulator features were missing from the french/danish/chinese menus... added them (untranslated)
fix missing accent marks and broken chinese characters resulting from the recent japanese language patch
fix UpdateHotkeyAssignment not working for many hotkeys and possibly breaking chinese/japanese menu items
2009-12-06 19:20:50 +00:00
zeromus 6f486fc2cf fix bigendian compiling in saves.cpp.
someone ought to test savestate portability between big endian and little endian. to test this easily on little endian only systems we could setup the save system somehow so that it can write in either big or little endian.
2009-12-06 18:31:24 +00:00
zeromus 56468eda49 win32: fix virtual from constructor random crash bug in tool windows; fix some more finicky cflash configuration; core: add devkitpro argv support; add --gbaslot-rom commandline 2009-12-05 21:21:33 +00:00
zeromus 4327d8725a win32: change chonese to chinese 2009-12-05 18:34:42 +00:00
zeromus 6781716712 win32: add japanese language patch 2009-12-05 16:38:32 +00:00
zeromus 3176cf6b18 fix vectest 2009-12-05 06:41:06 +00:00
mtabachenko 56a6d6cddd fix VS2008 project; 2009-12-04 11:46:32 +00:00
zeromus d5382702c2 try to rebuild fewer files when svn version changes 2009-12-04 06:49:24 +00:00
zeromus ccf7dfb10c fix some multi-gamepad bugs 2009-12-04 05:44:56 +00:00
nitsuja e82e1733db simplify the frameskip menu (combining the submenus) 2009-12-03 08:41:34 +00:00
zeromus ed58f6e1f3 core: fix a bug in sqrt (and probably div) control register emulation which permitted user to overwrite busy flag. fixes games with sensitivities to div/sqrt timing which would sometimes break when interrupted during their math busy wait loop (sm64) 2009-11-30 05:35:29 +00:00
zeromus 9b5bac0646 win32: cleanup gbaslot configuration dialog 2009-11-30 01:58:05 +00:00
nitsuja 78d9f41bee fix some bug with the triggerDma loop unrolling 2009-11-29 18:03:34 +00:00
zeromus 73fa6826f9 core: a tiny speedup by unrolling a loop which was intended to unroll 2009-11-29 06:53:46 +00:00
nitsuja c5834ad616 -add EPX magnification filter
-add EPX1.5x filter (something I made up just now for 1.5x scaling)
-fix screen gap size not scaling properly when using magnification filters
2009-11-29 06:17:32 +00:00
nitsuja a9cfa9ba4c fix for a small bug added in r3102 2009-11-28 23:52:12 +00:00
nitsuja f257f61412 switching the renderer to SoftRasterizer instead of None in the case that the OpenGL renderer fails 2009-11-28 23:30:55 +00:00
nitsuja 8a40316fe3 -fix 16-bit display depth final output (and 15- and 24-bit)
-handle display depth changes that happen while desmume is running
2009-11-28 22:24:20 +00:00
zeromus c90533d007 include file format specs with dist and always define HAVE_LUA for developer builds 2009-11-28 05:31:46 +00:00
zeromus 5209fd6e61 2009-11-26 21:43:20 +00:00
zeromus 1f7f2be0a3 update build scripts in trunk 2009-11-26 21:08:02 +00:00
zeromus fe84248b05 odds and ends 2009-11-26 16:47:35 +00:00
zeromus 83d8d19f39 cocoa: might as well add the norwegian translation sinc ewe have it 2009-11-23 01:39:27 +00:00
zeromus f9e8e9c862 gpu: clean up use of scroll registers to make sure that the correct &0x1FF is done everywhere 2009-11-23 00:53:46 +00:00
zeromus e5f90aaaa9 this file is out of date 2009-11-22 22:33:24 +00:00
zeromus 447200f537 win32: update readme.win and add italian language patch 2009-11-22 22:29:28 +00:00
zeromus 1d41eb9ad5 oops, remove a hack 2009-11-22 06:59:34 +00:00
zeromus 3d16c5b71c dont go on a grand tour of unallocated memory when closing a rom (fixes 2900956) 2009-11-22 06:57:58 +00:00
zeromus 0a4a6b4957 fix dma address reloading (fixes contra4 classic modes) 2009-11-22 06:11:07 +00:00
zeromus 2adab7ef1a gpu: dont render an obj window in one of N cases remaining where that happens accidentally and add a note about a failing save autodetection 2009-11-22 00:07:24 +00:00
zeromus b25867dc5f win32: fix horribly broken sound for some users 2009-11-21 20:24:53 +00:00
mtabachenko 8459879bed core:
- fix dma (fix bug #2867258);
2009-11-20 18:38:33 +00:00
mtabachenko 9e3ddf7fe7 core:
- add handling keypad interrupt (demo http://www.double.co.nz/nintendo_ds/nds_develop8.html)
2009-11-19 11:43:05 +00:00
mtabachenko 9ba8f348ee core:
- fix bug #2900169;
- fix background scroll register;
2009-11-19 11:40:34 +00:00
nitsuja 7416f2a973 fix for sudden exit if passing bad arguments into a lua gui at a time when it must be deferred 2009-11-19 08:01:55 +00:00
nitsuja 5bc0040f1a fix lua aggdraw crash (maybe not the best way), and add script stopped message to lua console 2009-11-19 07:31:14 +00:00
yabause 3e47306a26 Removed the PO_FILES(_IN) variables as they were getting in
the way of make dist(check)
If someone knows what were their use and feels I did something
wrong by removing them, bring them back... but make sure to
not break make dist by doing so :)
2009-11-18 22:27:55 +00:00
yabause ad8e19a9d0 s/$LUAPC/lua/ as LUAPC was not defined and lua sounds like
a sensible value. This was also breaking make dist.
2009-11-18 22:04:40 +00:00
nitsuja 6f83e98aaf win32: giving "clear recent ROMs" a confirm dialog 2009-11-18 05:25:09 +00:00
zeromus 3751ca21cf add someones romanian cocoa translation, because the cocoa port is so great that it should be translated into every language 2009-11-15 20:23:00 +00:00
zeromus db8ebad34d remove LTCG from zlib to fix release builds in 2008 2009-11-15 19:42:07 +00:00
zeromus 1726035ad2 try to fix a bug from r3047 in intrWaitARM 2009-11-15 18:40:45 +00:00
zeromus b973902023 might as well zero that toon table while we're at it 2009-11-15 06:44:03 +00:00
zeromus 53df785ad4 fix 32bit toon table writes 2009-11-15 06:35:30 +00:00
zeromus 8332160bb5 fix a build configuration with wrong lib reference 2009-11-15 06:00:09 +00:00
zeromus a82dad9a4c win32: readd headers and fix 2008 build 2009-11-15 05:45:57 +00:00
zeromus 8c81d6fd27 same but for glib 2009-11-15 05:38:08 +00:00
zeromus d1c1aa9f7e win32: readd 7z headers and fix 2008 build 2009-11-15 05:19:23 +00:00
zeromus 3b5ee1f29f win32: switch 7z to an externally housed static library, same as zlib. clean up some source file license headers 2009-11-15 05:13:50 +00:00
nitsuja 8c62cc838a switch movie to "finished" mode if you load a non-movie savestate during recording or playback 2009-11-15 01:46:48 +00:00
nitsuja 3b71e1d6b0 reclaim texcache memory on softrasterizer reset 2009-11-15 01:16:56 +00:00
nitsuja 97dd427407 possibly-slightly-better-behaving autoframeskip logic. It's still not completely immune to FPS drops, however (because that seems to require either knowledge from the future, systematic over-estimation, or complete disregard for visual consistency, although it can surely be improved somehow). 2009-11-15 00:49:02 +00:00
zeromus a6eb5c11d9 win32: remove zziplib, no longer necessary with 7z included; remove vs2010 project, hopelessly broken and out of date; cleanup main rom openfiledialog usage w.r.t. suggested extensions; use a zlib which is built more robustly 2009-11-14 19:16:27 +00:00
luigi__ bbcda495e5 SPU:
Oops. After my previous change, sounds couldn't stop playing. Fixed now.
2009-11-13 22:15:09 +00:00
luigi__ 33640517af SPU:
- emulate sound start timings (http://nocash.emubase.de/gbatek.htm#dssoundnotes)
- fix KeyOn condition (KeyOn happens when changing status bit from 0 to 1)
2009-11-13 22:06:13 +00:00
luigi__ 7a650d67ff SPU: since SPU_Emulate_core is called once per hline and resets buf_pos at every call, it doesn't need a whole 740-sample buffer. ceil(samples_per_hline) (currently 3) is enough. 2009-11-13 19:51:32 +00:00
luigi__ 5d362c9409 SPU: small fix to PSG noise. 2009-11-13 17:31:07 +00:00
mtabachenko 38a687eed8 winport:
- add cheats disable menu item;
2009-11-13 10:00:19 +00:00
normmatt234 53fb4ac616 Remove useless wIRQ variable.
Some Made In Ore cart commands added.
2009-11-13 02:46:44 +00:00
zeromus 926ac850ba fix compile error? 2009-11-13 01:56:10 +00:00
luigi__ 3d353ce490 Remove an useless include. 2009-11-12 22:24:23 +00:00
riccardom 9c9b01cb62 And the oldmode should be moved upper too. 2009-11-12 21:13:00 +00:00
riccardom 03214b3848 Move wait4IRQ before intrWaitARM since it used by the latter. 2009-11-12 21:12:05 +00:00
luigi__ f65d5965a5 SPU: correct the framerate to 59.8261 instead of 60. Thank you zeromus ;) 2009-11-12 21:07:06 +00:00
luigi__ 9ce1236c21 SPU: Change the computation of samples_per_hline to something more simple and therefore more precise.
With zeromus's complicated way, the core SPU used to mix 737.something samples per frame... now it should always be 735 samples per frame.
2009-11-12 20:59:20 +00:00
mtabachenko b438ec39b7 core:
- another fix SWI 4/5 (fixed bug #2781521);
2009-11-12 17:29:18 +00:00
nitsuja e3276828f6 new logic for autoframeskip, and new options to limit the maximum consecutive frames it's allowed to skip. the old logic would skip frames in an arbitrary pattern, the new logic prefers to keep the skipping rate steady. 2009-11-11 17:47:18 +00:00
zeromus bbc0a1d6d6 spu synchronizer bugfix: dont perpetually enqueue samples when there is no audio output driver active to dequeue them! 2009-11-10 23:24:45 +00:00
zeromus c7ed3cbc8c remove windows from autotools dist generation. it produces a unbuildable windows port anyway, as many megabytes of additioal headers and static libraries need including. we'll need to package that as an svn export. also update linux build scripts to survive going through a source tarball 2009-11-10 05:53:47 +00:00
zeromus 0ce2f29016 work on changelog. we will be making a release soon. let me know asap if I should give anyone more time. 2009-11-09 07:58:58 +00:00
zeromus f7111cd07a fix inability to toggle between 3d cores (multithread util class couldnt restart) 2009-11-09 07:32:33 +00:00
nitsuja 2d4c9d19e8 fix for hotkeys pressed quickly in a row not working if they use different modifier keys, fix for F10 pulling down the menu if it's been assigned to a hotkey 2009-11-08 22:40:15 +00:00
nitsuja b971c6b4fd disabling WifiComInterface Adhoc for now, I don't think it works yet so there's no reason to let it open network ports 2009-11-08 21:36:42 +00:00
nitsuja 0771dd39cb maybe fixed some sort of wifi shutdown crash 2009-11-08 20:44:49 +00:00
nitsuja 00ef096082 fix for input display and frame counter resetting to off every time you start desmume if you turn them on with hotkeys, fix for "play movie" and "record movie" hotkeys not actually doing anything, fix for "pause" hotkey toggling pause rapidly if held down, dimmed the green (future/physical) textual input display letters 2009-11-08 20:23:41 +00:00
nitsuja e010e03b9c fix for 3d lighting sometimes being screwed up on the frame after loading a savestate 2009-11-08 19:46:09 +00:00
zeromus 58c56aca0b reconfigure wifi configuration so that register emulation is always enabled, and the actually experimental communication is all that is optionally enabled (i.e. softAP/libpcap) 2009-11-08 19:09:15 +00:00
nitsuja 07331b522e shutting down some threads explicitly on app close in hopes that this will reduce the frequency of random shutdown crashes 2009-11-08 19:03:05 +00:00
nitsuja 00b28e5807 add some things to maybe help debug sound quality issues (developer option to record user SPU to WAV, define the sample rate 44100 in a single place, printout on audio buffer clear) 2009-11-08 17:04:07 +00:00
nitsuja 1b7d14c178 removing a workaround for a rasterizer bug that I believe was fixed for real in r3015 2009-11-08 15:50:12 +00:00
nitsuja 09c69e5a2c a slight quality improvement to the slow-motion handling part of the N audio synchronizer method (for an example, mario's jump sounded all crackly before) 2009-11-08 06:22:52 +00:00
nitsuja 19e82b56f8 fix for frameskip making the same image often appear on both screens in dual-screen-3D scenes that run slowly 2009-11-08 05:36:55 +00:00
nitsuja f0a986eeef fix occasional crash or corruption when starting up the audio synchronizer 2009-11-08 04:54:58 +00:00
nitsuja d7d3e9f21b preventing frameskip from affecting frame advance except when also fast-forwarding, and fixing a bug where the very first frame advance would not pause the game 2009-11-08 02:30:42 +00:00
nitsuja 89e4e948c3 reworked frameskipping logic to hopefully fix frameskipping in dual-screen-3d games 2009-11-08 02:27:25 +00:00
nitsuja b0895ec82f fix screwed-up LCD display if you set a rotation and then switch to horizontal layout
(rotation is still not supported in non-vertical layouts)
2009-11-07 20:58:16 +00:00
nitsuja 907657f63b disable border drag gap editing when in a gapless layout 2009-11-07 19:16:48 +00:00
nitsuja 18b7aefa78 - fix border drag gap editing
- double the default sound buffer size back to what it used to effectively be (this will reset your setting once)
2009-11-07 19:13:55 +00:00
luigi__ 09641d27ff Missed a few 5-wide tabs... 2009-11-06 18:03:37 +00:00
luigi__ 829ca50a7a Yet another cleanup:
- change f*cking weird indentation to tabs
- reorganize, put opcodes of same kind together
2009-11-06 17:45:29 +00:00
nitsuja 60534b840d excluding non-4-byte-aligned addresses from 4-byte size value ram searching when "check misaligned" is disabled, because such values should always be 32-bit aligned on the ds and it's confusing to always see unaligned ones mixed in 2009-11-05 08:26:14 +00:00
nitsuja 5902173ae0 fix for sound sometimes looping endlessly if you pause and bring up a menu or dialog,
possible fix for an occasional crash when changing synchronizer mode,
fix for sound.clear not actually working,
fix for screen gap settings messing up certain alternate LCD layout calculations (I thought I already checked this in)
2009-11-05 07:45:31 +00:00
zeromus 7d450e5a13 win32: fix svn rev scanner, which was scanning too deep through all tags and branches and sometimes making VS freeze before proceeding with a build 2009-11-05 04:12:57 +00:00
nitsuja b8625a6f20 possibly fixing a bug where frame advance can run out of control sometimes, and disabling a throttle setting that didn't seem to add much 2009-11-04 11:31:45 +00:00
gocha b117ca793d change the behavior of menu item "Emulation > Pause" to call TogglePause() rather than Pause(); add Increase/Decrease Volume hotkey. 2009-11-04 08:41:43 +00:00
zeromus 961264bd1b win32: fix bug in cflash configuration 2009-11-04 07:47:38 +00:00
zeromus 3411a9c9ca clean up mic configuration and only enable mic when physical mic mode is selected 2009-11-04 03:51:01 +00:00
zeromus a9e0617180 fix 2891025 (random display of black lines polygon?) in rasterizer due to misuse of a global across the multiple SLI threads 2009-11-04 01:57:20 +00:00
luigi__ 2cdc3b828d Cleanup:
- fix indentation so it's tabs everywhere (or almost) instead of some weird mix
- fix some weird namings
- and some others...
2009-11-04 01:34:40 +00:00
nitsuja 71022e6920 various improvements to the new LCDs settings.
- you can select "main screen first" to automatically put the main GPU screen on top. combining this with the "one LCD" setting lets games like NSMB and Sonic Rush be playable on a single screen (it auto-switches to the screen that has the character on it).
- fully exclude screen gap from calculations when in single screen or side-by-side mode
- make OSD elements stay consistently located when flipping the LCDs around
- possibly improved the stylus-dragged-offscreen behavior for the alternate layouts
2009-11-03 17:51:28 +00:00
mtabachenko 2c8473e761 winport:
- fix bug with stylus in vertical swapped screens layout;
2009-11-02 12:22:38 +00:00
mtabachenko 53e61f0ece winport:
- added custom LCDs layout: vertical, horizontal and one LCD (default hotkeys: End - change layout, PageDown - swap screens);
2009-11-02 11:56:54 +00:00
zeromus 0539d6039d fix determination of dsv filename for games loaded from archives from recent roms menu (which mismatched the case when loaded from open menu) and fix the loading of .ds.gba files 2009-11-02 05:38:51 +00:00
nitsuja 04e2e8d221 fix for texcache scan occasionally doing unnecessary iterations 2009-11-01 22:24:44 +00:00
zeromus 4db71dcea5 some speedups to texture cache 2009-11-01 22:03:43 +00:00
nitsuja 2e82cbae5b re-enable ACCOUNT_FOR_CODE_FETCH_CYCLES since I've seen a couple of cases where it makes a difference. (it's not clear whether this is where the corrective timing change should be coming from, but I don't have any better ideas at the moment) 2009-11-01 20:12:40 +00:00
nitsuja 35773f0c4b fix parsing of --num-cores=# option 2009-11-01 20:04:25 +00:00
zeromus 23e7264061 fix bug in new texcache which caused performance disaster 2009-11-01 18:53:27 +00:00
zeromus 50f1d99435 fix a little bug in the 3d frameskipping 2009-11-01 18:04:57 +00:00
nitsuja d6746f7dd8 added more speed settings for increase/decrease speed hotkeys, and fixed the bug where it would crash if you pressed decrease speed 9 times 2009-11-01 11:04:14 +00:00
nitsuja 95e463ce27 - fixed movie not closing when loading a new rom or closing the rom
- fixed tab+alt key combination getting the emulator stuck in fast-forward mode
2009-11-01 09:07:21 +00:00
nitsuja 9c84eb674c - re-enable sound during frame advance (hold)
- prevent user from resetting emulation during movie playback
- hide the "disabled" hotkey name in menu items
2009-11-01 08:32:33 +00:00
nitsuja 4915fc6978 - fixed bug where trying to save two savestates in a row would load the second one instead of saving it
- fixed movie recording which was totally broken by my last checkin
- fixed some minor snddx buffer size problems (the default size might need to be increased now, but if so, someone else should do it, since it works fine for me as is.)
2009-11-01 06:40:18 +00:00
nitsuja b7daefd0f9 add "finished" movie mode to make TASing less annoying (so you don't have to restart the movie every time you let it reach the last frame). fixed some little bugs like a movie loading crash bug too. 2009-10-31 18:50:55 +00:00
riccardom 2789c7e495 Shut up annoying gcc warning about initialization vs declaration order. 2009-10-31 18:31:54 +00:00
riccardom 2922015e6a Lot of functions could be made static, add proper declaration for _hack_getMatrixStackLevel(). 2009-10-31 18:28:12 +00:00
riccardom 7ef3df046b Reorder field initialization to shut up gcc warnings. 2009-10-31 17:09:45 +00:00
riccardom 7d8a9d5a64 execRasterizerUnit can be static. 2009-10-31 17:06:28 +00:00
riccardom 49043c097c Use the same type as the declaration. 2009-10-31 17:05:30 +00:00
riccardom ffb0c189e4 Add missing parens. 2009-10-31 16:58:25 +00:00
riccardom cf77d4398b Reorder class variable initialization in order to shut up gcc warnings. 2009-10-31 16:49:23 +00:00
zeromus 67a9a34dfa support multiple game devices. 2009-10-30 06:05:43 +00:00
zeromus a248e403d6 fix bug preventing use of joysticks for hotkeys (even though they could be bound) 2009-10-30 05:24:52 +00:00
zeromus e502d5b656 zero dma src/dst addresses on reset; clean up dma code; fix texture dumping; cleanup in new texcache code 2009-10-30 03:39:16 +00:00
zeromus e6bc023301 fix warnings and more gcc pedantic errors 2009-10-29 05:20:49 +00:00
zeromus 93186fb640 fix pedantic gcc compile errors 2009-10-29 04:28:57 +00:00
zeromus d219cccb49 fix 64bits compilation 2009-10-28 16:53:19 +00:00
zeromus 8934925019 rewrite texture cache, change commandline from --single-core to --num-cores=N, add multithreading to rasterizer, add toggles to 3d config to disable fog+edgemarking for little speedups in games that use them. 2009-10-28 09:39:52 +00:00
zeromus dd117dc47f fix radiobuttons in soundconfig 2009-10-23 06:54:56 +00:00
zeromus 44a36b7950 add spu synch method "P" featuring very refined code from PCSX2 which tempo-shifts intelligently. 2009-10-23 06:14:46 +00:00
nitsuja a3fd06019e some small cleanup of audio output code 2009-10-22 08:59:13 +00:00
zeromus c5e9f51523 fix a bit of a boneheaded performance-slaying bug in spu synch mode 2009-10-21 07:53:22 +00:00
gocha 2a46b30940 luaconsole: add vertical scrollbar 2009-10-20 08:17:56 +00:00
zeromus 38217c032f add synch mode to spu and add necessary dialog configuration. (this is a spu option which fixes most streaming audio). it may become the default after we perform more analysis and refinement. also straighten out all the volume slider bugs. 2009-10-20 06:52:07 +00:00
zeromus 959d551b34 fix clipper to handle output of 10 verts, instead of 8 2009-10-20 05:19:53 +00:00
gocha ab20fa00ca Replace LuaBitOp function definitions with DEFINE_LUA_FUNCTION 2009-10-20 01:12:39 +00:00
gocha ce78157274 Fix timeBeginPeriod-timeEndPeriod nesting 2009-10-20 01:01:34 +00:00
gocha 651aa9e4a5 win32: improved Edit action of Lua console. it tries to open a script by other ways if there is no association with "edit" action. 2009-10-19 04:39:19 +00:00
gocha 2db8e74050 win32: Edit button of Lua Console now opens a script with "edit" rather than "open" on ShellExecute. 2009-10-19 03:49:50 +00:00
yabause 06b13db0e5 Another update to the pt_BR translation by Felipe2 2009-10-18 20:15:40 +00:00
yabause 40ea3c8435 Updated pt_BR translation by Felipe2. 2009-10-18 12:39:46 +00:00
riccardom 72b3c8d375 Disable --enable-memory-profiling since it does not compile. 2009-10-16 20:12:40 +00:00
riccardom e1424ba86c Add Norwegian (Bokmål) Translation to glade frontend from Stian Drøbak, patch #2872647. 2009-10-16 19:22:08 +00:00
yabause 9cd9f8ab58 #ifdef protected lua function calls. This fixes linking problems. 2009-10-16 15:47:24 +00:00
yabause d4c92e2f8a Fixed two compilation errors with g++:
- added typename to iterator definitions
- g++ doesn't like using an anonymous variable as a reference,
  added a local variable to make it happy
2009-10-16 15:46:36 +00:00
zeromus 583fa3089d change relative vertex submission to use the same overflow logic as boxtest, although i have no test csae for this. fix bugs in matrix stack which broke sims apartment pets. 2009-10-16 08:55:48 +00:00
zeromus ca086a3b85 add more flexible mic configuration and add rand() mode for m&l 3 (could be changed to another builtin sample instead if we find one we like). remove alternate flush mode configuration from UI since it isnt even hooked up anymore. 2009-10-15 22:39:52 +00:00
zeromus 9b7fd520cb tighten the 3d timing even more to fix marvel nemesis. this is now clearly at epic compatibility hack level as 3d takes virtually no time to execute, but lets gather data on whether there are any negative consequences. 2009-10-15 18:10:18 +00:00
nitsuja 711d596793 disabling a printf 2009-10-15 10:59:09 +00:00
zeromus f8972f1772 fix boxtest once and for all by correctly emulating the addition overflow, which strawberry shortcake and garfields nightmare were actually relying on. also tighten the 3d timing a bit since strawberry shortcake was expecting the gxfifo to be emptied earlier than it was. 2009-10-15 08:07:01 +00:00
nitsuja 91ced7c47f moved CallRegisteredLuaMemHook into a header so that it doesn't slow down release fastbuild quite so much 2009-10-15 06:34:41 +00:00
gocha e6c0897328 win32: main window now accepts dropped *.lua and *.wch files. 2009-10-15 06:12:02 +00:00
gocha ab70394898 Lua: add memory.getregister and memory.setregister, fix memory.registerexec. 2009-10-15 05:35:59 +00:00
gocha 0ebac3b4af Lua: add memory.registerwrite, memory.registerread, and memory.registerexec. 2009-10-15 04:58:17 +00:00
zeromus 451366ab66 spu: fix the ancient bug in looping adpcm sounds which slew performance. this is what made the adpcm caching option necessary as a workaround. so--get rid of adpcm caching. 2009-10-12 07:41:16 +00:00
riccardom 715b2a0c4c Add --enable-macosxhack to let zero compile the gtk frontend as macos x package. 2009-10-11 21:32:32 +00:00
zeromus 53622dc5f0 just a little cleanup to one of my debug OSD, nothing to see here. 2009-10-11 18:08:25 +00:00
nitsuja 16e20312dd temporary compile fix (until we can clean up this wifi stuff) 2009-10-11 07:32:14 +00:00
nitsuja 7e1c184144 - fixed a bug in MatrixStackInit
- fixed various other savestated variables not getting cleared on reset
- fixed game staying frozen after loading a savestate after the game crashes
- added emu.reset Lua function
- removed a few unused values from savestates
2009-10-11 07:14:35 +00:00
nitsuja 1a7bb26c39 so far I haven't seen this timing option have any effect whatsoever (even in timing-sensitive games) besides slowing down the emulator a lot. I think the result it calculates gets max'ed away the vast majority of the time. And the thing it enables probably isn't very accurate anyway. So let's see if we can get away with leaving it disabled for the time being... 2009-10-11 04:23:13 +00:00
nitsuja 66d36f5989 optimized the clipper 2009-10-11 04:11:41 +00:00
riccardom 481642bc65 Readd glib checks which are needed to build on linux. Then force the dependency on pkg-config because without it we don't have glib which is mandatory. 2009-10-10 20:32:25 +00:00
riccardom dd0286c96c glib is not a local include. 2009-10-10 20:14:35 +00:00
nitsuja 391f277360 fixed backface culling of non-convex quads 2009-10-10 06:14:36 +00:00
zeromus fd4aa08333 modifications for osx gtk building. not sure about the safety of the sdl modifications, and had to temporarily remove the configure check for glib. can someone help me make it bypassed on osx? my gtk/glib setup cannot be detected by the glib detector 2009-10-10 00:39:28 +00:00
zeromus 0589adbb56 fix bug where ramwatch would not update without ramsearch open (thanks cwitty) 2009-10-09 21:33:35 +00:00
luigi__ d7e57c83bf Okay, re-add SNDDXThread. But newer system. Synchronous with main thread.
No more loopy playback while menus are opened. No more silent playback while
the emu is paused.
(when you open the menu, sound stutters for a quarter of second before
stopping but that's acceptable)
2009-10-09 17:27:45 +00:00
zeromus 1a4423e9c8 fix bug in cflash writing, thanks obcd 2009-10-08 20:13:34 +00:00
luigi__ d8578f1f58 Re-implement BIOS SoundBias function more correctly. Get rid of SPU_ReadLong.
(is the bias feature really used by many games anyway? I don't think so)
2009-10-08 19:58:15 +00:00
luigi__ 1fcd48722a Fix for sound still playing while menu is opened.
While I'm at it, make snddx.cpp more C++.
2009-10-08 19:19:36 +00:00
luigi__ 2a0edb3c90 SPU refactoring, step 1: Goodbye SNDDXThread.
Music doesn't continue playing anymore while the emu is paused.

Feel free to revert.
2009-10-08 18:20:14 +00:00
gocha 680c4b3b00 remove '#ifndef PUBLIC_RELEASE' which surrounds a part of wifi function. wifi function can be enabled/disabled by EXPERIMENTAL_WIFI. 2009-10-08 10:06:14 +00:00
gocha 72108f36d2 Lua: register entire LuaBitOp library. 2009-10-08 03:13:29 +00:00
luigi__ 07bc70c16f Rename GPU_ligne and some derivating functions to something more english.
Not that I'm against French but it makes code cleaner for people who can't read French.
2009-10-07 14:38:16 +00:00
nitsuja 931d45d026 added DTCM and ITCM to ram search 2009-10-07 07:19:46 +00:00
zeromus 20a9a469f6 i probably should not have checked in rand() test data in vectest 2009-10-06 20:49:53 +00:00
zeromus 1f076df6ce fix bug where backup memory resets when rom resets 2009-10-06 20:33:39 +00:00
zeromus 20fe8c2e8a attempt to emulate vectest, but leave logging in because i want a better test case. remove postest printf since i found a few test cases. 2009-10-06 20:31:35 +00:00
zeromus d3915c5f8b give boxtest ability to render the test boxes. now i am certain that games which the boxtest interacts with strangely are actually suffering from bad timing, and returning different boxtest results changes how much rendering they do and thus radically alters the timing. its a false lead, i think the box test is perfect. 2009-10-06 18:32:08 +00:00
zeromus 703a3266b2 preliminary implementation of clipper moved to gfx3d and used for box test. should have fixed all box test issues, but some cases will still fail due to unresolved timing problems 2009-10-06 08:42:55 +00:00
zeromus c986a7eb1a fix old bug causing inability to use gamepads for hotkeys 2009-10-04 22:23:05 +00:00
zeromus d4c5831828 add some emuloop performance diagnostics 2009-10-04 21:25:01 +00:00
nitsuja 385a2cdaa8 optimized fog table calculation 2009-10-04 21:18:59 +00:00
zeromus b2341c6137 re-add arm9 load average tracking, this time displayed in the OSD so that people arent confused by it in the window title. 2009-10-04 18:18:39 +00:00
zeromus 6c019ad77a gxstat shouldnt have a reset method. its constructor resets it. this happens when MMU_struct_new gets reconstructed. 2009-10-04 16:25:07 +00:00
mtabachenko 7e70ed64bb - ops, sorry, I forgot commit some stuff (bug #2868470); 2009-10-03 08:26:43 +00:00
mtabachenko 953ced2c6c core:
- fix bug #2868470 (Pokémon Ranger - freezing at the first battle);
- fix bug #2860505 (Pokemon Diamond/Pearl/Platinum In-game trades not working);

winport:
- fix change sound buffer size;
2009-10-02 17:16:24 +00:00
gocha 7bae874515 movie dialog: fixed subsecond calculation; added subsecond rounding code; expanded the width of frameCount/rerecordCount display. 2009-10-01 14:32:03 +00:00
zeromus 7c082ecaa3 win32: load wav file for mic instead of raw 2009-09-30 23:31:36 +00:00
gocha 3af6e8075b main windows can handle dropped lua script from now. 2009-09-30 04:52:52 +00:00
gocha bc1d031b29 Removed Update_RAM_Watch() lines because it's called from Update_RAM_Search() 2009-09-28 23:42:09 +00:00
gocha 9e8a66a006 win: upgraded hotkey code (ported from snes9x-rr) 2009-09-28 04:15:07 +00:00
zeromus 676c90a0f0 add new "random" mic noise which needed updating since the code which returns samples to the game software was corrected 2009-09-28 00:11:36 +00:00
gocha 32246bac4a close movie file when it's stopped 2009-09-27 06:26:18 +00:00
luigi__ 99473f8d9b Again a fix
Add a missing file again >.<
2009-09-26 11:51:12 +00:00
luigi__ 8fd41a18a6 Fix to VS2010 project: add two missing files. 2009-09-26 11:47:21 +00:00
nitsuja ecbdbf21df adding missing check to an optimization so it can be re-enabled 2009-09-25 15:48:17 +00:00
gocha ce279995de ramwatch: add more (ListView_GetSelectionMark() != -1) checks 2009-09-25 13:30:04 +00:00
zeromus bab64f3c94 gpu: revert an optimization which broke some edge handling in affine bg (fix NYT crosswords) 2009-09-25 05:16:54 +00:00
zeromus a570e7a054 fix a bad bug in savefile handling introduced a few revisions ago due to changes in initialization/reset code flow, always a desmume weakness and area of confusion.... but maybe not for long 2009-09-23 18:48:45 +00:00
zeromus 44ff6e97b4 fix another unhandled command 0xDD case. 2009-09-23 03:07:52 +00:00
zeromus e3b223d046 fix the undefined command 0xDD 00000000 which may have been causing undetected problems 2009-09-22 22:32:55 +00:00
zeromus 3a74300a72 fix regression in gxfifo 0x00 command handling (fixes galactik and nintendogs:dalmatian) 2009-09-22 16:59:33 +00:00
gocha ab8f50eae2 Modify my old comment to fit the current status. 2009-09-22 08:45:12 +00:00
nitsuja 0accc4eaf8 enabling cache emulation. this seems to fix timing bugs in several games. we can worry about the speed later. 2009-09-22 08:31:00 +00:00
zeromus 6cf200b1e1 fix glitches in dma and poor code in command unpacking which were causing some slowdown. clean up ioregview refresh triggering code and add a note about how to cut compile time of gpu.cpp in half. 2009-09-22 03:02:39 +00:00
zeromus 14c011d8de fix gcc compiling 2009-09-21 17:10:52 +00:00
zeromus 523d2713f9 rewrite dma, gxfifo, gxstat, command unpacking; old gxfifo removed; many games fixed, gta and dq4 broken; dma still not finished; your savestates will be broken; have coded 40 hours without checking performance, beware; add dma regs to ioregview, fix cpu selector in < vista; 2009-09-21 01:51:42 +00:00
zeromus 8c6e56e679 fix an annoying bug in mapview that made some layers not show up at all due to interference from blending logic in gpu 2009-09-20 20:20:18 +00:00
nitsuja cb1d7d2f23 - new memory access timing, should be more accurate. this fixes some games for me.
- this includes basic cache emulation, but that's disabled for now for performance reasons
- got rid of the fast fetch execute menu option
(switching between the two should no longer be needed and I don't think we should have things like that be options)
2009-09-20 20:11:16 +00:00
riccardom f78ce4e966 Enable sse/sse2 fast path
Apply patch from cwitty to enable sse/sse2 fast path with
gcc. Patch #2860351
2009-09-19 19:07:59 +00:00
riccardom 47910a5264 Look for modules in cwd instead of home
gmelquio suggests in bug #2862128 we should use cwd and
not force the home directory where looking for modules
like savefiles. Applied a modified patch which uses glib
and does not leak the string.
2009-09-19 17:14:50 +00:00
riccardom 8b7a7f9b50 Move preprocessor directives at column 0, cleanup some risky ifdef usage. 2009-09-19 16:44:20 +00:00
nitsuja 1d9c7c6bc4 some minor optimization and cleanup 2009-09-19 04:46:19 +00:00
zeromus 388c5253e3 add commandline handling for --bios-arm9 and --bios-arm7 and --bios-sw1=1 2009-09-17 21:37:32 +00:00
zeromus ea3e02d098 gpu: a very small speedup by templateizing the wrap logic in affineext modes which is not commonly used 2009-09-17 19:49:10 +00:00
mtabachenko f7e0c34ef3 winport:
- add manual import\export No$GBA saves;
2009-09-17 11:42:17 +00:00
zeromus c151e6983c fix a windows compile error added when the gcc compile error was fixed 2009-09-16 22:51:26 +00:00
riccardom 831893aac7 This one want to be constified too. 2009-09-16 19:27:07 +00:00
riccardom 2be3bc944c Declare gfx3d_ClearStack() properly in a header and include
the header where needed.
2009-09-16 19:25:56 +00:00
riccardom cc94f7abf8 Mark a function static. 2009-09-16 19:21:57 +00:00
riccardom f8743f1412 Mark arm_instruction_names as const char * otherwise gcc
will hate you.
2009-09-16 18:57:33 +00:00
gocha 857fb4f7f7 Replaced glColor4ubv with glColor4fv. This might affect alpha test. 2009-09-16 15:17:41 +00:00
gocha 084dfbf703 Revert to r2882 since it awfully broke Castlevania games (possibly other games as well).
The reasons I replaced GL_GREATER with GL_GEQUAL in r2883 are:
1. gbatek says "Hide pixels if Alpha<AlphaRef"
2. rasterizer also says "if(shaderOutput.a < gfx3d.alphaTestRef) goto rejected_fragment;"
2009-09-16 13:57:37 +00:00
gocha e524718237 OGLRender: Replaced GL_GREATER with GL_GEQUAL 2009-09-16 11:01:14 +00:00
zeromus 49bc297032 optimizations (especially for 32bit systems) to sequencing logic in main emulation loop; few fps speedup for cpu heavy games 2009-09-16 07:38:28 +00:00
zeromus d0bfdc0a02 for dev+ builds, add logging of execution counts for each instruction. 2009-09-16 00:00:13 +00:00
normmatt234 96db719b0c Support new Backup command required for Pokemon HG/SS to work without triggering an anti-piracy protection. 2009-09-15 12:14:17 +00:00
zeromus ab61e64ac2 unhook all emulation of STRBT and LDRBT which were confusingly only half emulated; I think that they shouldn't be emulated at all. someone prove me wrong. also, fix the FORCEINLINE macro on gcc to do something approximating its intent. maybe it doesn't work on old gccs and we'll have to change it back or conditionalize it differently. 2009-09-15 06:20:09 +00:00
zeromus d3d573d777 add that lq2x and hx2xs patch #2852221 and also fix a bug in the new ioregview which prevented it from compiling on older windows sdks 2009-09-15 04:36:21 +00:00
mtabachenko 91f19f2521 winport:
- fix search cheats crash on x64;
2009-09-14 11:40:30 +00:00
gocha dd649aafa2 Fix render_sprite_Win to handle 256 color objects properly. 2009-09-14 04:30:40 +00:00
luigi__ 86bd06801f Small feature: add a possibility to make "Emulation paused/unpaused" messages
optional when calling NDS_Pause()/NDS_Unpause() by adding them a parameter
defaulted to true. Shouldn't break anything.
2009-09-13 19:59:26 +00:00
gocha f7799d4b2e Replaced Lua bit operations with LuaBitOp 1.0.1. Now it can handle the sign bit (bit 31) correctly. 2009-09-13 15:52:14 +00:00
luigi__ 99483fc4f7 I/O reg viewer: fix scrollbar, and implement all graphics registers for
2D graphics engines.
2009-09-13 14:11:36 +00:00
luigi__ ce48f43c89 I/O reg viewer: improve scrollbar handling, and fix a small bug with
names/descriptions that have ampersands and/or underscores inside them.
2009-09-13 10:17:25 +00:00
mtabachenko 75b285b45c core:
- add load logo data into ARM9 BIOS area;
(for a GBAgame not need external BIOS now)
2009-09-13 10:13:18 +00:00
luigi__ 1b8eaa9501 I/O reg viewer: fix a bug where ARM9 IE/IF had two blank Bit0 fields at the bottom. 2009-09-13 09:55:52 +00:00
luigi__ 34c2ff9e23 Remove two weird empty lines. 2009-09-13 00:36:27 +00:00
luigi__ 860ad0caa5 Commit missing stuff. Sorry. 2009-09-13 00:32:26 +00:00
luigi__ 56403c75af Windows port: delete the old I/O reg viewer dialog templates.
(Yup, the new one is a plain window. It appears plain windows
refresh faster than dialogs :( )
2009-09-13 00:25:52 +00:00
luigi__ 6740d478b2 Windows port: brand new I/O reg viewer.
- Allows to view all the registers, the registers of a certain category, or one
register in detail.
- Table system facilitating implementation of new registers
- Implements the registers that were implemented in the old I/O reg viewer, so
there's no loss
- You can open as many I/O reg viewers as you want
2009-09-13 00:17:59 +00:00
mtabachenko 7f418a40e0 addons:
- GBAgame: add flash memory support. Pokemons migrate work now (need use external BIOS without SWI, I will fix it later) :)
2009-09-12 21:44:46 +00:00
luigi__ 8e53ad6bd7 MMU: add some extremely basic Ninja SD support, based on libfat code.
This was my first attempt at getting ndsmail working properly.
All the needed init code is here, but reading and writing operations
are seriously lacking for now.
2009-09-10 18:46:42 +00:00
riccardom dd321a27e1 Use the correct type for recvfrom argument. 2009-09-09 18:24:23 +00:00
luigi__ 3ac9b07639 Windows port: Add a constructor to CToolWindow. Also fix a bug that would cause
the Adhoc interface to always be initialized even when SoftAP is selected.
2009-09-09 18:11:51 +00:00
luigi__ 3fb9b04bfe Wifi: lots of improvements here and there:
- fix USCOUNTER and USCOMPARE implementation
- add support for extra TX slot
- add some experimental receiving code for SoftAP
- and others...

Also, change the predefined WFC profile to be an empty profile and remove support
for probe requests. This should prevent any WFC connection attempt, without breaking
homebrews (atleast dswifi lib based ones). (Note: WFC doesn't work anyway)
2009-09-09 17:59:50 +00:00
zeromus 25d84132f7 it seems as if we added a winver>=0x0501 dependency (winxp) in CWindow.cpp with the font bullcrap. Im not sure why it needs to be there, but lets make the 2005 vcproj define that sdk version so it compiles once more 2009-09-09 00:57:15 +00:00
gocha 23087b4c0c Moved fastFetchExecute to CommonSettings, and set the default value to false. 2009-09-08 22:53:43 +00:00
mtabachenko c0ea64bed8 winport:
- add save "Fast Fetch-Execute" state;
2009-09-08 16:43:15 +00:00
gocha 6769ec30ac winport: add "Fast Fetch-Execute" to the menu, since r2844 brought some emulation glitches. 2009-09-08 15:48:13 +00:00
gocha b7a55e65e8 disabled frameskip while avi recording 2009-09-08 15:37:37 +00:00
gocha 460aa6d04a Fetch-execute cycle is now processed parallelly. It's still inaccurate, but much better than before.
Additionally, indentations are adjusted.
2009-09-08 04:09:16 +00:00
gocha c368300c05 winport: a little fix for stylus autohold 2009-09-08 03:12:55 +00:00
gocha 158852cea2 winport: add autohold for stylus 2009-09-08 02:39:58 +00:00
mtabachenko d9534edf36 core:
- fix SWI 0x03 (WaitByLoop);
2009-09-07 21:02:46 +00:00
mtabachenko 6828c1f746 winport:
- fix ICC project compiling;
2009-09-07 09:44:37 +00:00
gocha 407fa8f157 {S} instructions don't consume more cycles than non {S} instructions, do they? 2009-09-07 02:35:55 +00:00
nitsuja 1bc975995f fix vs2008 linking 2009-09-06 22:50:37 +00:00
luigi__ fbb877874f Add comctl32.lib to VS2008 and VS2010 projects. 2009-09-06 22:20:06 +00:00
luigi__ fd1b12dbc1 Holy shit... macro redefinition. 2009-09-06 22:14:49 +00:00
luigi__ 644e4a7b71 Add a couple of defines for the new I/O reg viewer. 2009-09-06 22:02:15 +00:00
mtabachenko fd10aa872f core:
- fix SWI 4,5 (Children of Mana run now);
- fix reset bug in IPC FIFO;
2009-09-06 21:55:14 +00:00
nitsuja 87a167983e crash fix for win32 closerom 2009-09-06 16:41:18 +00:00
luigi__ 9828dc1ce7 Small cosmetic fix: add DeSmuME icon to toolwindows. 2009-09-05 22:30:14 +00:00
luigi__ 8a6520e549 Resize a bit the mem viewer so the last line fits in the view box. 2009-09-05 22:06:01 +00:00
luigi__ 22e68e57a6 Windows port: adapt the mem viewer to the new tool system. And its layout
has been slightly changed:
- a combobox has been added to let you choose the CPU
- the view mode radiobuttons became a combobox due to space lacking,
- the Close button has been moved to the bottom-right corner
- the view box is less wide due to the font changed to Courier New

You can now open as many mem view windows as you want. Don't abuse it though, 
at least until we find a super-fast refreshing method. For now the tools will
refresh every 6 frames.

Little extra for zeromus: if font antialiasing is turned off, the font the 
view box uses will not be antialiased.

(sorry for blank log message in last revision. The log message I forgot to add was this one.)
2009-09-05 21:58:31 +00:00
luigi__ 50f238c98c 2009-09-05 21:53:47 +00:00
luigi__ b3caff23d2 Windows port: small fix in RegWndClass for x64 builds. 2009-09-05 20:06:11 +00:00
luigi__ 998787e921 Windows port: add a base CToolWindow class and a toolwindow handler. 2009-09-05 19:08:51 +00:00
nitsuja 54f771536e added Close ROM menu command and made Lua scripts stop when opening or closing a ROM 2009-09-05 17:39:22 +00:00
luigi__ b14a3a592b Noone wants to bitch about the new organization of the VS2008 project?
Okay, then let's apply it to the VS2010 project.
2009-09-05 15:32:22 +00:00
luigi__ 35ed3204a7 VS2008 project: move gdbstub.h into the gdbstub filter. 2009-09-05 15:25:15 +00:00
gocha 68313ef467 Fix cycle count (gbatek: Execution Time: If condition=false: 1S cycle) 2009-09-05 09:10:38 +00:00
nitsuja 0b704f27a2 win32: added Lua recent script menu items and hotkey 2009-09-05 08:54:19 +00:00
nitsuja 4b50a9ec03 win32: customizable gap color (white/gray/black) 2009-09-05 04:19:56 +00:00
gocha bec8aa50de Make instruction cycles same as GDB_STUB build (decreased all instruction cycles by 1) 2009-09-04 22:31:59 +00:00
luigi__ b2289368a3 VS2008 project: more reorganization: move resource files filter into Windows
filter, move instruction tables into Core filter, remove the non-existing 
gl_vertex.h as for VS2010 project.
2009-09-04 18:01:36 +00:00
luigi__ 27b89f03ae VS2008 project: reorganize the project to have sources and includes together,
in two filters: Core and Windows. Let resource files in their original filter
and move the instruction tables to another filter.

Feel free to revert if you don't like this organization.

If people like it, I'll do the same with the VS2010 project.
2009-09-04 17:58:14 +00:00
luigi__ 889c449bbb Remove an offensive line. 2009-09-04 15:53:07 +00:00
luigi__ 04778112f6 Wifi: re-enable SoftAP.
(Oh, and I also happened to commit the version 0.00001 of what would
be the dialog template for the new (unfinished) I/O reg viewer)
2009-09-04 15:51:20 +00:00
luigi__ 2609e7391c VS2010 project: remove the non-existing gl_vertex.h. 2009-09-04 15:45:51 +00:00
luigi__ 8d60c75448 VS2010 project: add the vcxproj.filters file which contains filter (folder) info. 2009-09-04 15:28:30 +00:00
gocha c24d88fa35 Fix GDB_STUB compile 2009-09-04 15:27:53 +00:00
nitsuja f710b64523 fix for mic being stuck at max volume in some games if you don't have a microphone 2009-09-03 08:44:10 +00:00
zeromus d729e8dbad fix a little error which broke compilation on 64bit systems? reported on forums 2009-09-02 20:49:27 +00:00
riccardom 5aef7a1010 Fix whitespace :) 2009-09-02 18:44:00 +00:00
riccardom 359ed207fe Apply the same workaround applied to the gtk frontend by zeromus to make it not segfault. 2009-09-02 18:43:08 +00:00
nitsuja df5bf19909 mic: it seems like some other bugs must be here, but I'll fix this obvious one of mine... 2009-09-02 09:21:37 +00:00
zeromus 584ab583b7 add a tiny little hack for nonwindows port to change the screen drawtarget so that it is suitable for rendering to GPU_screen (the old fashioned way); this only affects gtk right now, other linux ports will need it 2009-09-02 06:29:08 +00:00
zeromus ea70941994 fix bug in linux rom loading resulting from code changes for smaller roms 2009-09-02 06:05:19 +00:00
riccardom 0c671d2a4b Reorder fields in the same order they are initialized to shut up gcc warnings. 2009-09-01 19:04:39 +00:00
riccardom 5f4d43f738 Add missing addons/expMemory.cpp to makefile. 2009-09-01 19:01:35 +00:00
mtabachenko e1d70a6f76 addons:
- add Expansion Memory Pak (need for NDS Browser (Opera) and other games);
- fix init GBAgame buffer;

bios:
- fix SWI 10h (BitUnPack - DSlinux dont freeze emu now);
2009-09-01 09:35:33 +00:00
nitsuja 9c4a2dc20c added savestate.verify Lua function for automated desync detection (disabled in public release) 2009-08-30 22:46:28 +00:00
nitsuja 5e42454cf4 some small CPU optimizations
(and reducing the minimum rom size)
2009-08-30 11:22:00 +00:00
zeromus 60276cdf2e fix memory leak and otherwise stabilize code in emufile 2009-08-29 23:48:29 +00:00
nitsuja 0a07f61db0 I'm pretty sure that won't quite work (further mic fixup) (for code that shouldn't even need to be here) 2009-08-28 09:47:45 +00:00
riccardom a9a0412a69 Fixup compilation breakage for fake and alsa microphone. 2009-08-28 09:31:50 +00:00
riccardom 6e937faaf0 Thou shalt include all the needed string headers. 2009-08-28 09:14:54 +00:00
nitsuja 50665860b3 implemented/enabled Lua functions: savestate.create/save/load, stylus.set, gui.box/line/text/pixel/getpixel/opacity/transparency/gdscreenshot/gdoverlay 2009-08-28 09:06:48 +00:00
zeromus 41a10c95f5 finish porting iostream stuff to EMUFILE*. movies and sram-start movies work once again 2009-08-26 19:01:21 +00:00
zeromus e05c17dfbb transform a bunch of iostream stuff into EMUFILE. main savestate and savedata codepaths work, movies may still be borked. ill fix it soon. 2009-08-26 08:54:48 +00:00
p989 fce7cb2701 convert movie system to FILE* 2009-08-26 05:15:15 +00:00
luigi__ c5458e7509 Wifi: implement/change various stuff.
More correct handling of all the various TX status regs/bits = no
more weird hangs/communication errors when hosting a multiplayer
game then going back.
2009-08-25 13:20:22 +00:00
nitsuja 489556e656 missed replacement fix 2009-08-24 04:48:46 +00:00
nitsuja 2988bb303f enabled/implemented functions for Lua: emu.frameadvance, emu.speedmode, emu.wait, emu.redraw, emu.pause, emu.unpause, emu.emulateframe* (needs driver class support, so currently only works for win32) (had to split up the win32 main loop for this)
fixed gui.register calling time, I hope
made single-core OSD more useful (when paused)
made FPS display show "(paused)" (when paused)
added --multi-core option for testing purposes
enabled Lua API checks in debug (only x86 for now), and switched to a better integer conversion method
possibly improved frame advance initial pause responsiveness
a few other minor bugfixes
2009-08-24 04:44:25 +00:00
luigi__ 6e8850c903 Wifi: more work on packet reception.
NSMB two-card multiplayer now half-works. Luigi sees Mario,
but Mario doesn't see Luigi :(
2009-08-23 22:01:54 +00:00
luigi__ ce8b6bc7b9 Wifi: add support for periodic beacon transmission.
The socket stuff works fine; I could see all the beacons
by using an ethernet sniffer, as expected :)
2009-08-23 19:45:01 +00:00
luigi__ 399f024fcb Wifi: add some socket code for sending and receiving (incomplete).
Cache some regs that will be useful for beacon transmission.
2009-08-23 18:13:16 +00:00
luigi__ adeec7e38f Wifi: add socket init/deinit code.
Remove ad-hoc client/server stuff from wifi settings dialog as
they're going to be useless.
2009-08-23 12:55:10 +00:00
luigi__ a8ff7220cc Windows port: re-add WSA init/deinit code.
(yup, sockets will be needed for wifi adhoc interface)
2009-08-23 10:50:52 +00:00
luigi__ 6e36bfe1fd Windows port: putting some bases in place for new tool system.
Here, clean window class handler, which prevents regging a class
twice and unregging a class which isn't regged.

The stuff I'm adding is not set in a stone. It may be modified or
even removed at any moment.
2009-08-22 22:34:28 +00:00
nitsuja 8167bff3c4 mic: oops, well, trying to make the savestate stubs work for cross-platform loads for now 2009-08-22 19:03:15 +00:00
riccardom fd7f8f0ef6 Add missing includes for recent microphone changes and add stubs for !WIN32 to continue compiling. Greeting from FROSCON! 2009-08-22 15:01:24 +00:00
nitsuja 17d4b20115 enabling some more Lua functionality (like input.get().x/y, movie.replay(), emu.emulating()) 2009-08-22 09:12:27 +00:00
nitsuja 54193cc623 Lua: fix for joypad.set not working when called from outside a registerbegin callback 2009-08-22 07:39:15 +00:00
nitsuja c20c88bdbc - revised input code to be more explicit and "sync-safe"
- touchscreen calibration/wraparound fix
- hud edit mode fixes
- nicer input displays
- master brightness blank screen optimization
- implemented left+rt/up+dn checking
- fixed autohold activation
- enabled diagonal keys
- play and record movie dialog and menu improvements
- fixed potential microphone desyncs (savestated, and silenced non-mic-button during movie)
- fixed window squashing when resizing top corner above top of screen
- fixed freeze if frame advance button is pressed before loading a ROM
- implemented joypad Lua functions
2009-08-21 09:56:17 +00:00
mtabachenko bb7d9f16a4 core:
- fix EXMEMSTAT register;
2009-08-20 08:11:10 +00:00
zeromus c9db2532a2 win32: x64 builds for vs2005 and vs2008 2009-08-18 19:23:34 +00:00
riccardom abcd172c83 Move some stuff around so that it compiles with gcc. 2009-08-18 11:14:35 +00:00
gocha 8b5aa23605 make 'samples' (in SPU.cpp) to be zero at reset (to prevent desyncs) 2009-08-18 05:37:20 +00:00
riccardom dee58ee4b8 Make a few functions static. 2009-08-16 08:57:07 +00:00
zeromus eb2b400ea8 win32: correctly bind graphical input display checkstate to menu 2009-08-16 02:58:35 +00:00
gocha 27ad47f155 some grammatical fixes on MainWindow->checkMenu use 2009-08-16 01:39:37 +00:00
p989 1e67b897d4 win32: graphical input display 2009-08-13 03:35:47 +00:00
mtabachenko c170681139 gxFIFO:
- fix gxFIFO write context & add projection stack reset;
wifi:
- disable log;
2009-08-12 07:57:28 +00:00
zeromus 621ebaad0d x64 dx libs 2009-08-12 04:15:09 +00:00
zeromus 81f18cab30 fix bilinear filter after change to 32bpp 2009-08-10 03:42:53 +00:00
zeromus d5b938452c win32: fix osd compositing pipeline for singlecore 2009-08-10 03:29:43 +00:00
zeromus a39c62b129 fix new savestate bug, wifi warning, and scanlines 2x filter 2009-08-10 03:01:49 +00:00
p989 88f0549e85 win32: start converting filters to 32bit 2009-08-10 02:30:32 +00:00
nitsuja c4be07bc87 disp3dcnt fix (fixes missing zx advent sprites, and I don't know what else) (possibly incomplete though),
32-bit poly+vert-count read fix,
disassembler stack corruption fix,
savestate fix with wifi sequencer,
made wifi random not use rand() since that could potentially cause desyncs,
did some probably-minor savestate optimizations
2009-08-09 22:31:59 +00:00
yabause 5e3cb11c83 Fixed MAX_PATH definition for POSIX systems without any
limit on filename length (where PATH_MAX is not defined).
2009-08-09 21:07:34 +00:00
luigi__ e007f422f4 Wifi: implement a communication interface structure, change SoftAP to use this
structure, add a (dummy for now) adhoc interface. Also SoftAP is disabled for
now as I'm going to focus on adhoc (multiplayer games, download play, etc...).
2009-08-08 20:58:17 +00:00
luigi__ 7532a5d66e Wifi: add proper resetting & deiniting, remove the useless 'wifimac_t *wifi'
parameter from all functions.
2009-08-08 14:46:49 +00:00
luigi__ c2291bfee6 Wifi: modify wifi settings dialog, add two modes: Ad-hoc and infrastructure.
Disable Infrastructure as it's just SoftAP, it doesn't work yet and I'm
going to focus on Ad-hoc mode for the moment.
2009-08-08 13:18:35 +00:00
riccardom aa32f62368 Remove unused variables, ifdef what looks debug code. 2009-08-08 10:50:38 +00:00
riccardom c0ebfc43f0 Remove a few unused variables. 2009-08-08 10:49:08 +00:00
mtabachenko 07806eb836 core:
- fix matrix stack (this is a hack, need rework. Tony Hawk's American Sk8land work now);
- i some fixed boxtest, its need for Garfield & Nanostrays (BIG speedup) need to rework.
2009-08-06 22:54:32 +00:00
luigi__ 90d57bf8ce CPU (THUMB): LSR instruction now deals correctly with carryflag.
For instance this fixes bugs with CpuSet SWI when "Emulate SWIs by BIOS"
is enabled.
2009-08-06 22:20:18 +00:00
mtabachenko 525541d037 new gxFIFO:
- fix bug in FIFO buffer;
2009-08-05 20:30:52 +00:00
zeromus 128305c5fd win32: fix typo in sound config dialog 2009-08-04 22:33:29 +00:00
riccardom 339eb9973c Remove usage of uint which is not available on MSC, thanks CrazyMax for noticing. 2009-08-04 21:00:23 +00:00
riccardom 4029f105d8 On gcc the packed attribute is supposed to not work when you use
a typedef in the struct definition. Then packing the whole struct
and each member is redundant. So cleanup __PACKED usage and
hopefully both shut up gcc warnings and keeps things working :).
2009-08-04 20:49:19 +00:00
riccardom 7324afeafd Move rewindsave and dorewind declaration to a proper header instead of using extern. 2009-08-04 20:32:13 +00:00
riccardom e3c0aadb86 Fix gcc warning about enum not handled in switch. 2009-08-04 20:24:56 +00:00
riccardom 04e66de722 Reorder variable initialization to shut up gcc warnings. 2009-08-04 20:20:39 +00:00
riccardom 3043d4045e Fix a few signed vs unsigned comparison warnings. 2009-08-04 19:47:03 +00:00
riccardom 0069c02e73 Put that big pile of double commented code inside an if 0. 2009-08-04 18:46:39 +00:00
riccardom d0ed6ae79c Kill the extern since this would be the default. 2009-08-04 18:41:09 +00:00
riccardom 8e75d3521a Make a function static, add a missing prototype for another one and remove an unused variable. 2009-08-04 18:35:50 +00:00
riccardom 00b5148274 Make a few functions static and shut up signed vs unsigned gcc warnings. 2009-08-04 18:28:03 +00:00
riccardom c99e7dc2e5 This should be MSC specific. 2009-08-04 18:19:01 +00:00
riccardom fc8b2dbfc2 Oh there is another windowDraw gcc bitches about the possibility to have
it unitialized.
2009-08-04 18:10:23 +00:00
riccardom 8bef7cfa68 gcc warns that windowDraw may be used unitialized which in theory is true. 2009-08-04 17:59:58 +00:00
riccardom 6c3b1059b0 Move variable initialization in constructors to shut up gcc warnings about their ordering. 2009-08-04 17:50:02 +00:00
p989 fbab1c2b5f agg.setFont and agg.text 2009-08-04 16:35:38 +00:00
nitsuja 84f637865f win32: some dialog flags/extensions fixes, minor menu readability/grammar fixes, and changing some instances of "Gens" to "DeSmuME" 2009-08-04 10:06:01 +00:00
nitsuja 194723d96d win32:
- added freeform editing of the screen gap size by dragging the window border (optional)
- added extra gap size option
- fixed bug with window sliding around when resizing from the top/left
- fixed(?) bug with default window size command setting invalid sizes after the rotation/gap settings have changed
- fixed some inconsistency in the restoring of forced aspect ratio when changing modes
- fixed window getting very squashed at large sizes even if force maintain ratio is on
2009-08-04 07:44:39 +00:00
zeromus 52b7454046 rasterize: fix bug in edge marking that overwrote depth buffer with one line of color data 2009-08-03 21:57:00 +00:00
zeromus 4015411ad6 gpu: fix bug with 16color bg overdrawing line buffer by one pixel when scrolled to an odd offset. move assert x<256 lower in callstack to help spot these bugs more aggressively. 2009-08-03 21:41:07 +00:00
zeromus 77da6267bf win32: guess for now we have burn cycles copying the GPU_screen so that we keep a pristine copy for screenshots. also screenshots for savestates. the final display handling pipeline still isnt finished yet so this could change again 2009-08-03 05:08:37 +00:00
zeromus 057703e529 fix linux compile, and some warnings 2009-08-03 02:15:35 +00:00
nitsuja ea08d4aa84 rasterizer: fix for everything blended being slightly transparent
opengl: fix for everything blended being doubly opaque
2009-08-03 01:57:25 +00:00
luigi__ c9e2db0250 Oops... fix IORegView. 2009-08-02 23:06:39 +00:00
luigi__ 2254c143ed General: merge ARM9_struct contents into MMU_struct and remove ARM9.h.
(why was ARM9 mem separated from the rest? plus MAIN_MEM doesn't really
belong to the ARM9)
2009-08-02 23:04:26 +00:00
luigi__ 81cf844df6 General: the DS card stuff can perfectly fit in MMU.h (though it'd fit
better in NDSSystem.h, but it would require more work). There's no need 
for tiny extra files.
2009-08-02 22:35:44 +00:00
nitsuja d6fb00bb84 win32: fix for crash when changing the rotation or filter mode 2009-08-02 22:20:44 +00:00
luigi__ d1fe3e3c21 General: the definitions of ARMCPU_ARM9, ARMCPU_ARM7 and ARMPROC seem
to fit the best in MMU.cpp ... so let's get rid of that hack.

Feel free to revert if it breaks compilation under Linux or whatever.
Worked fine under Win32.
2009-08-02 21:14:27 +00:00
luigi__ bf124165f7 Core: prepare gamecard system for future KEY1 and KEY2 encrypted command support.
Also rename MMU_clearMem to MMU_Reset because it's called upon reset and it
doesn't only clear memory.
2009-08-02 20:55:38 +00:00
adelikat 64e0b8a2af Win32 - drag n drop for savestates and movie files. 2009-08-02 20:32:53 +00:00
adelikat 07bdf7d148 Win32 - Adding an "all files" open in the Loadstate as Open file dialog box. Adding on the trunk and on 9.2+ 2009-08-02 19:53:20 +00:00
mtabachenko 13fbc2ea8e undef wifi in non public release (luigi__, sorry if i broke you stuff, but WiFi slowdown emu. may define it only after optimising wifi) 2009-08-02 18:01:10 +00:00
mtabachenko bd04d8e9bb revert last commit. (DON'T touch it if you don't understand how it work. you reverted function which used ONLY in new gxFIFO) 2009-08-02 17:35:14 +00:00
riccardom 28ff237695 Revert r2697 and r2698 because they slowdown things a lot for me and at least
another user.
2009-08-02 16:39:47 +00:00
luigi__ a10305e786 CPU (THUMB): fix for opcode 'BX PC' which does switch to ARM state.
This fix allows the BIOS to boot a bit further (still doesn't boot).
2009-08-02 11:21:50 +00:00
zeromus 573f321508 rasterize: another fix for shadows. fixes most, if not all, of the recently broken shadows. 2009-08-02 08:18:13 +00:00
zeromus f1fa6973ab fix some regressions in display capture (fixes games with vertical streaks corruption) 2009-08-01 22:09:19 +00:00
luigi__ 6dd74f9fd2 NDS: calculate ADC touch coords from firmware calibration info.
Now when using an external firmware, you don't have to re-calibrate
the screen anymore to get correct touchscreen input.
Though, touchscreen input is still broken in commercial games
when using an external firmware. Info on that problem: touchscreen
calibration data in main mem are zeroed out for some weird reason.
2009-08-01 20:42:32 +00:00
luigi__ ea35450d02 Win32: make disassembler available in non-dev+ builds.
NDS: remove the Win32-specific include. The "autoupd asm" 
thing is just crap anyway, and we should avoid platform-
specific code in the core.
2009-08-01 11:45:13 +00:00
mtabachenko 71158e5081 revert some stuff from rev.2697 2009-08-01 06:54:15 +00:00
zeromus b8694398f6 rasterize: fix shadows more. it seems that we need more than one stencil bit. 2009-08-01 06:44:33 +00:00
zeromus c0ea499806 change 3d rendering to use 18 bits of color instead of 15. fix mario kart star powerup rainbow effect regression. merge all 3d pixel blitters into one function. fix bugs in new fifo savestates. i probably just broke some stuff but its worth it. 2009-08-01 00:47:21 +00:00
zeromus 131603c25b fix an error in wifi savestates; add sanity checking for chunk identifier to savestate code to keep this mistake from happening again 2009-07-31 21:46:21 +00:00
mtabachenko 27ce7acf63 new gxFIFO:
- fix pipe clear;
2009-07-31 17:04:02 +00:00
mtabachenko 0eaef3ea53 new gxFIFO:
- more optimizations FIFO;
2009-07-31 13:09:23 +00:00
mtabachenko d78cc99dab new gxFIFO:
- add small hack (smb64 work now)
2009-07-31 10:26:19 +00:00
nitsuja 3790d1d52e fix for too-thick rendering of edgemarked single pixels or sharp protrusions 2009-07-31 09:58:35 +00:00
gocha 14fd8ae6eb Fixed turbo behavior on movie playback (when a movie held a button and the turbo for the button was enabled, the button became released) 2009-07-31 06:33:24 +00:00
mtabachenko 8952a9005e - typo fix (unpacked no$gba saves); 2009-07-30 16:32:49 +00:00
mtabachenko 9bd1b7e691 -some fixes in no$gba saves unpacker; 2009-07-30 15:13:11 +00:00
mtabachenko 517d31bae9 - add loading saves from No$GBA ;) 2009-07-30 14:47:54 +00:00
mtabachenko 66b71553d0 core:
- optimize IPC FIFO;
2009-07-29 22:59:46 +00:00
mtabachenko 309cb2418a new gxFIFO:
- optimization of FIFO functions (speedup);
2009-07-29 22:10:55 +00:00
nitsuja ea5abf672e attempt at fixing the edge marking implementation (softrasterizer) 2009-07-29 13:14:05 +00:00
nitsuja d9b6e86c40 fix for emu window not showing up after it gets saved at position (-32000,-32000) 2009-07-29 04:51:38 +00:00
riccardom 146f8b43df Note we have osd and hud on linux frontends too. 2009-07-28 20:43:56 +00:00
riccardom ffeb6b97f0 Make glib mandatory for all frontends. 2009-07-28 20:36:53 +00:00
zeromus 74e0fabca9 gfx3d: fix bugs in poly sorting 2009-07-28 08:14:11 +00:00
zeromus 2c3cef961c win32: more threading fixes, and fix a bug in stylus coordinate osd 2009-07-28 05:29:28 +00:00
zeromus 11e417f55a win32: safer threading logic in shutdown sequence 2009-07-28 05:12:23 +00:00
zeromus 7219f88382 win32: change osd compositing to 32bpp and decouple from emulation update; add nearest2x resizing filter; add framerate-independent drawing equipment to osd (test in savestate slot display); make lua drawing thread-safe once again; get rid of some warnings 2009-07-28 04:47:06 +00:00
zeromus 74702bae5a gpu: fix a bug in affine start register regeneration which may have made some games (pokemon dash?) fail to make it back from a savestate with scroll variables intact 2009-07-27 20:15:07 +00:00
zeromus bb85744a6f win32: change mapview tool scroll display to indicate that it is useless, because it is 2009-07-27 19:57:36 +00:00
luigi__ 642ce3a115 Win32: fix a bug which would cause recent roms menu to accept only
9 recent roms instead of 10.
2009-07-27 18:35:48 +00:00
zeromus 66c895dca4 fixi wifi compiling in linux 2009-07-27 18:01:42 +00:00
nitsuja ae940c79e1 savestate date memory overwrite fix 2009-07-27 16:25:00 +00:00
mtabachenko de427321ab gxFIFO:
- fix crash some games (Rayman DS now works);
2009-07-27 15:15:00 +00:00
zeromus 2ed7ef8c89 dmacompleted needs savestating 2009-07-27 11:28:02 +00:00
zeromus 6ada678c69 oops my bad. newgxfifo changes back in 2009-07-27 11:16:09 +00:00
zeromus e41741f457 revert gxfifo related changes so at least we have a revision that works. feel free to paste over when its working again 2009-07-27 11:08:37 +00:00
mtabachenko 45d7f2aef9 opps, sorry :( i forget commit mmu.cpp in rev.2667 2009-07-27 11:02:19 +00:00
zeromus c6a8854e92 integrate desync fixes from 094 branch. many extra files touched due to svn merge info tracking being poopy 2009-07-27 10:39:56 +00:00
mtabachenko 8339abdd71 new gxFIFO:
- fix gxFIFO buffer overflow with DMA (Zelda, Submarine tech demo etc.); (but this fix hackly and need rewrite all dma stuff)
2009-07-27 10:28:59 +00:00
zeromus c04caafcbf rasterize: little tweaks to fog 2009-07-26 21:41:10 +00:00
zeromus db610129bb rasterize: add fog emulation 2009-07-26 21:13:38 +00:00
luigi__ 9828895c53 NDS: oops... comment out some logging I added to figure out why the firmware couldn't
boot games.
2009-07-26 18:18:47 +00:00
luigi__ c48ef684f6 MMU: reorganize gamecard emulation so it's easier to implement commands.
NDS: when booting from firmware, copy secure area to main memory (this
is done by the BIOS, not the firmware). This allows the firmware to boot
games! :)
2009-07-26 18:06:47 +00:00
riccardom ef6717c210 Add osd notification for fake microphone and audio toggle, cleanup a bit the hud code. 2009-07-26 08:26:41 +00:00
riccardom 2f1c14fe33 Cleanup the recent hud addition: remove unneeded function calls and includes and put hud initialization code in the same place. 2009-07-26 08:19:21 +00:00
zeromus 1ba3351f6e oglrender: support wireframe 2009-07-25 19:59:40 +00:00
riccardom b5dfdc501c Hook the hud in the cli frontend, based on a patch from szigor at #2825066.
Auto pause, fake mic and boost now have osd notification.
2009-07-25 08:18:16 +00:00
riccardom aa08c20987 Remove stale prototype for ResetHud() which is gone. 2009-07-25 07:54:42 +00:00
zeromus 443fa0c50f gpu: fix disp fifo capture and vram capture/display from same bank. i am beginning to rewrite the dispfifo logic so there may be some easy regressions to fix. fixes splinter cell. 2009-07-25 06:40:47 +00:00
zeromus c0b302f4e4 fix color overflow in capture blending; fixes freedom wings 2009-07-25 03:40:27 +00:00
luigi__ 3856c0c5e9 Add missing files to VS2010 project. 2009-07-24 18:18:39 +00:00
zeromus 9fe5205b2e win32: fix little menu bugs 2009-07-24 08:40:26 +00:00
zeromus 2d5889eaa8 rasterize: add rear depth scroll register emulation; fixes narnia 1 2009-07-24 07:31:56 +00:00
zeromus acadc2f784 fix a bunch of warnings 2009-07-23 20:49:33 +00:00
riccardom c16bf09a68 Update cli frontend makefile to add libagg cflags and to use AM_CPPFLAGS as
used by the gtk frontend instead of AM_CFLAGS. Issues pointend out by szigor
in patch #2825066.
2009-07-23 19:04:58 +00:00
zeromus 188a7e54c4 hud editor works on savestate slot display 2009-07-23 18:34:45 +00:00
zeromus c2943e28d9 allow hud editor to move elements to the bottom screen 2009-07-23 17:24:45 +00:00
p989 908f4116a7 win32: make frame advance more normal 2009-07-22 02:01:31 +00:00
zeromus 689d9a94df win32: fix some frame advance bugs. also maybe fix hotkey mushiness 2009-07-22 01:28:23 +00:00
zeromus 5676772a6c win32: cleanups for hotkey autorepeat 2009-07-22 00:25:25 +00:00
zeromus a88b22e547 increase visual studio warning level and deal with the consequences. 2009-07-21 23:38:19 +00:00
zeromus a086c21ba7 fix savestate saving 2009-07-21 23:18:22 +00:00
zeromus 123743fa57 win32: get rid of some new glibc linker warnings. 2009-07-21 22:59:51 +00:00
zeromus 359aafba57 speed up state rewinding 2009-07-21 08:09:52 +00:00
p989 1559e84d0d win32: savestate rewinding 2009-07-21 07:09:14 +00:00
zeromus 2228a8de13 win32: tone down the default intensity of the scanline filter a bit, and add commandline args to control the intensity, in the vain hopes that someone will give me feedback on what their favourite values are 2009-07-21 02:32:55 +00:00
zeromus 3f3e086d61 win32: what's this..? is it..? could it be..? indeed, it is! a multicore optimization! now featuring all final display logic triple-buffered in another thread. offloads to another thread: rotation, color conversion, filter scaling, and directdraw buffer copy. this makes filter scaling effectively costless. 2009-07-21 01:55:16 +00:00
zeromus f95c64cc6a win32: enable gthreads 2009-07-21 00:08:52 +00:00
zeromus 0d36fecf93 reconfigure sse optimizations. all asm routines have been rewritten with intrinsics so that they are more neatly inlineable; this speeds them up by a couple of FPS; also, they work in gcc; and they can be enabled separately with ENABLE_SSE and ENABLE_SSE2; 95% of the optimizations come from the SSE optimizations, meaning that SSE2 will not be necessary to enjoy the bulk of the optimizations. I think. 2009-07-20 23:33:39 +00:00
zeromus 3abc58ae36 change loadrom() to use FILE* instead of std::ifstream. sidesteps mbcs path issues 2009-07-20 22:55:51 +00:00
p989 17fe2472a2 win32: cursor doesn't get stuck when dragged outside window 2009-07-20 16:03:00 +00:00
gocha 6d4e256d2b Fixed movie length info (60.00fps -> 59.82fps) 2009-07-20 04:37:07 +00:00
zeromus 81b885777c fix some rom loading things 2009-07-20 01:41:22 +00:00
zeromus a61483d87d fix linux compile bug 2009-07-20 01:06:06 +00:00
luigi__ 06e4bcfbb1 zeromus,
(l706) I am okay with these optimizations, even if they don't help much.
But you really, really should avoid giving your macros/variables such...
terrible names. This really looks terrible and unclear.

After waiting a while for you or somebody else to rename those vars/macros, 
I finally decided to do it myself because they were bugging me. It's okay 
for this time, but the next time I see such terrible names in a commit, I'll
just revert it.
2009-07-19 23:13:09 +00:00
p989 2a90946ff5 win32: load archives without temp files 2009-07-19 21:42:15 +00:00
gocha 488fc951d0 Quick fix that should disable autohold while movie playback 2009-07-19 13:07:03 +00:00
zeromus c24caade3e gpu: fix rotozoomed 2d mapped direct color bmp sprites. fixes knights in the nightmare credits intro 2009-07-19 09:41:05 +00:00
zeromus 4a19bac748 gfx3d: i've realized that the poly sorting must happen after clipping. there is no way to do this now, so to approximate really well, it, we will perspective divide the y values. fixes island of happiness shop menus. 2009-07-19 08:23:14 +00:00
zeromus 119deba104 old gxfifo: fix bug which broke galactik football 2009-07-19 07:07:58 +00:00
zeromus 7a2b970aff revert my earlier changes to 0x8000 handling in display capture. i changed my mind, it is working the way it needs to. hotel dusk is broken for other reasons 2009-07-19 02:05:07 +00:00
shashclp 2d6477ce1b - Fixed emulator crash on sample loading failure 2009-07-19 01:23:43 +00:00
zeromus 6c00a49806 gpu: rework capture opaque flag handling a bit. this is a risky change and may break some other capture and layer blending scenarios, but the old way of doing it (writing 0x8000 to vram for opaque black pixels from capture blending) is simply wrong and unworkable. fixes hotel dusk. 2009-07-18 20:24:20 +00:00
zeromus e9d75ad573 rasterize: fix bug in sse texture sampling optimization, fixes ridge racer sky 2009-07-18 18:52:11 +00:00
zeromus f9592ea6d1 gpu: fix layer blending regression, fixes yoshi touch and go 2009-07-18 18:32:10 +00:00
zeromus d8b3a0581d rasterize: fixes to shadows 2009-07-18 18:19:17 +00:00
riccardom 706af15ebe Remove dumplicate double dummy backend from SNDCoreList. 2009-07-18 16:50:24 +00:00
riccardom e96e14d8e6 Shut up gcc's deprecated conversion from string constant to ‘gchar*’ warning. 2009-07-18 13:26:04 +00:00
riccardom 305da3d38a Remove -Wshadow from --enable-hardcore because it triggers so much inside libagg code. 2009-07-18 13:14:23 +00:00
riccardom 2d9bd66224 Declare nds_savestate and nds_loadstate in a proper place. 2009-07-18 13:02:53 +00:00
riccardom 894458bc53 Make some functions static and remove a couple of unused variables. 2009-07-18 12:52:44 +00:00
riccardom a3cbf8ea01 Add missing enum value in switch. 2009-07-18 12:13:45 +00:00
riccardom 194ee3f339 Make a few functions static. 2009-07-18 12:11:36 +00:00
riccardom ec25feee98 Add missing header for memset. 2009-07-18 12:04:36 +00:00
zeromus 062a228877 grab bag of optimizations: many optimizations to sse functions, now using intrinsic functions. this would enable these functions to work on gcc (i think) if our configuration supported it, but it will fail for some vc++ express installations. those guys will have to either #define SSE2_NOINTRIN or help me figure out which installations are broken and why and how to fix it. also, collapse BG layer pixel blenders into a single function, so watch for regressions there. 2009-07-18 09:15:41 +00:00
riccardom baef153e05 Make clear that at least for now antigrain library is mandatory. 2009-07-18 08:57:51 +00:00
zeromus f71921404c win32: screenshot: fix failure to save pngs and failure to respect user specified path 2009-07-17 21:04:42 +00:00
p989 087e9ae5ed display stylus coordinates 2009-07-17 20:33:41 +00:00
zeromus ca6c0db294 dont crash when exiting program 2009-07-17 20:23:17 +00:00
zeromus dd505213be fix path building for archived roms 2009-07-17 17:32:39 +00:00
mtabachenko f6d2ca247e new gxFIFO:
- rewrite GE functions;
winport:
- fix GBAslot dialog;
2009-07-17 09:06:23 +00:00
zeromus ecf5b68df6 a grab bag of optimizations good for about 4fps on my system 2009-07-17 08:33:35 +00:00
zeromus dbe2226498 newemuloop: change main loop to 32bit math for a little speedup and fix a goofup that was costing a small amount of speed 2009-07-17 05:16:07 +00:00
zeromus ccf3535154 newemuloop: fix bug in instruction disassembly logging 2009-07-17 04:51:04 +00:00
zeromus b5d9628a7d newemuloop: bump diagnostic counter up to 22 2009-07-17 04:22:59 +00:00
zeromus bb8e239206 man, i am getting sloppy 2009-07-17 04:17:44 +00:00
zeromus b4c4d55ce2 win32: fix a bug in the last checkin 2009-07-17 04:17:07 +00:00
zeromus 6297f00247 fix screenshot path bugs and add some string utility functions 2009-07-17 04:09:07 +00:00
p989 68cf6f1e5e rework and integrate path settings 2009-07-17 02:37:51 +00:00
zeromus 3c5ad7c896 newemuloop: comment that a little better so i dont forget 2009-07-17 00:15:48 +00:00
zeromus e482c772e2 newemuloop: handle an edge case in timing logic better 2009-07-17 00:09:33 +00:00
zeromus 24a040ef2b gpu: emulate display capture while frame skipping 2009-07-17 00:04:35 +00:00
zeromus ffa4adfc47 newemuloop: add diagnostic code for timer calculation 2009-07-16 23:31:25 +00:00
zeromus 3e9dd9d6c0 newemuloop: fix bug in cascaded timers. fixes shrek streamed music 2009-07-16 23:21:21 +00:00
mtabachenko 980a06f871 - cleanup; 2009-07-16 11:17:23 +00:00
zeromus 00d535f9d3 gpu: fix 128-wide captures. fixes hotel dusk 2009-07-16 09:31:06 +00:00
mtabachenko d8fde20f85 new gxFIFO:
- fix execute 3D commands;
new emuloop:
- add reset ticks counters;
2009-07-16 08:49:32 +00:00
zeromus 55a208d0ee core: remove last traces of MMU_RenderMapToLCD, the heinous function which should never have been used. prevents crash in megaman star force 2009-07-16 08:05:00 +00:00
zeromus 3f291c8e6a newemuloop: fix some timing regressions; win32: improve map view 2009-07-16 07:39:21 +00:00
zeromus 3c0646c423 win32: fix bug where screen scale and size are not correctly handled when relaunching emulator 2009-07-16 05:10:39 +00:00
zeromus 71441a541d newemuloop: bump a quirk detector from 16 to 18. 2009-07-16 04:47:13 +00:00
zeromus 646998871e win32: scalers: add a slightly optimized case for non-filtered. probably doesn't add up to much 2009-07-16 04:45:04 +00:00
p989 da1bc169a1 win32: bilinear filter 2009-07-16 04:08:18 +00:00
zeromus 9735a8a1fd new gxFIFO: fix tags on savestate struct (crazymax: these must be different for each thing in the group! its poopy, i know.) 2009-07-16 04:05:25 +00:00
mtabachenko aa84f1529e new gxFIFO:
- fix for work with new emuloop;
- add early implementation of pipeline;
2009-07-15 22:46:33 +00:00
zeromus 6275b5d746 newemuloop: fix read of timers which aren't turned on. fixes staff of kings launching 2009-07-15 21:57:23 +00:00
zeromus 7f13b77a78 zzz reduction surgery 2009-07-15 20:44:07 +00:00
zeromus 28435d9334 totally rewrite main emulation loop! YOUR SAVESTATES ARE INVALIDATED. your timing is all different. but, your timing is more precise, a few hidden old bugs surfaced and were smashed, and some games work that didn't used to. INSTRUCTIONS_PER_BATCH is a thing of the past. crazymax and luigi, I may have broken your parts, but hopefully only a little bit. your new hookups into the emulation loop are more complicated but potentially faster and definitely more precise. 2009-07-15 19:42:32 +00:00
p989 b54420e5a7 win32: save and load filter settings 2009-07-15 18:41:29 +00:00
zeromus 2e592dca73 oops 2009-07-15 17:52:34 +00:00
zeromus 215a6cb6fa win32: make scanlines look more like lcd scanlines. 2009-07-15 17:44:06 +00:00
p989 8ea1fc16c7 win32: upscaling image filters 2009-07-15 16:50:52 +00:00
p989 47bea83c76 win32: more refactoring 2009-07-14 23:30:51 +00:00
p989 cb09cf5170 win32: some presentation refactoring 2009-07-14 21:15:06 +00:00
riccardom 633a5638a7 Apply workaround patch for compiling against nvidia headers posted as
#2819332 by larryhaja. It reports that the patch fixes compilation for him
and it doesn't break it for me so hopefully there aren't regressions.
Said that i've tried to define GL_GLEXT_PROTOTYPES at configure time but
it breaks compilation and making OGLRender.cpp:133 not optional looks way
more risky.
2009-07-14 19:02:15 +00:00
riccardom c0fc487be3 Add a note for alsa microphone to Changelog. 2009-07-14 18:27:58 +00:00
riccardom 5c61957e10 Fix typo, sorry. 2009-07-14 18:06:13 +00:00
riccardom 8b4736e078 Add chinese translation to gtk-glade frontend done by F.E. Nebula, shouldn't hurt :) 2009-07-14 16:59:07 +00:00
mtabachenko a6b05cf101 - fixes in new gxFIFO (NSB, FFx, Arcanoid and others work now)
- fix 3D flush;
2009-07-14 16:13:50 +00:00
riccardom 01af8a7453 More work on the alsa microphone so that it is near an usable state. Actually it
does a pretty good job recognizing when i clap hands, decent when i blow,
epic fail when speaking. Progress nonetheless! \o/
2009-07-13 19:27:25 +00:00
zeromus f152bd98bb gpu: fix the ancient comment which deceived me into making that mistake in the first place 2009-07-13 07:40:16 +00:00
zeromus 875d4ae2a6 gpu: fix 256B granularity sprite addressing for sub gpu (fixes pinball deluxe) 2009-07-13 07:38:04 +00:00
zeromus 048d2318a0 gfx3d: cache rendering params at flush time, instead of using values which happen to be current at scanline=0 when we do 3d rendering. fixes trouble pop bubble 2009-07-13 06:35:33 +00:00
zeromus 319f68ac68 gpu: correctly(?) handle case where backdrop is requested as a top blend layer. fixes ff3 fading text 2009-07-13 05:15:25 +00:00
zeromus b7ffd2a806 rasterize: fix an alpha blending case 2009-07-13 04:19:42 +00:00
p989 80a2a480c3 agg lua bindings 2009-07-13 02:03:21 +00:00
riccardom 218319d5f9 Add license header to microphone stuff. 2009-07-12 19:47:40 +00:00
p989 3453ac71d4 transformations 2009-07-12 19:41:15 +00:00
riccardom 075455d407 More fixes to alsa microphone, still not enough. 2009-07-12 19:34:54 +00:00
p989 8f1eb173e5 general attributes 2009-07-12 17:32:05 +00:00
riccardom 4fc72bb5e2 Remember to free g_filename_to_uri() result. 2009-07-12 14:04:36 +00:00
riccardom 6739397035 Some configure scripts fixup for libagg, we can check for HAVE_LIBAGG for checking agg library availability. 2009-07-12 10:01:43 +00:00
zeromus 67010790e1 win32: fix screen rotation 2009-07-12 07:47:34 +00:00
yabause 69ac706959 Added support for application/x-nintendo-ds-rom mime type
in gtk desktop file.
Also added some (un)install hooks so that mime type
database is updated when (un)installing the gtk port.
Those two changes let users double-click on a rom to open
it with the gtk port.
2009-07-12 06:22:41 +00:00
gocha ff2de2bc58 win32: fix a glitch that the GetOpenFileName dialog for AVI doesn't appear when the last character of avi output path is '\\'. 2009-07-12 06:01:30 +00:00
p989 e5979f2bc1 fixed a blending bug 2009-07-12 04:55:58 +00:00
p989 9c6426aae4 win32: fix screenshots, path setting disabled temporarily 2009-07-12 04:36:11 +00:00
zeromus 7365c9e6ea fix r,g,b ordering in 555 antigrain renderer 2009-07-12 04:13:22 +00:00
zeromus c87812a0db refactor save slot display; first example of hud operating in linux 2009-07-12 03:52:02 +00:00
zeromus dd05ece216 fix linux compiling and add hud to gtk. wont display anything until someone adds menu items for CommonOptions toggles, but it will eventually. 2009-07-12 03:43:28 +00:00
p989 2802c9a16f savestate slot display 2009-07-12 03:38:20 +00:00
zeromus 1e28d6aebe reorganize hud drawing and move it to the core 2009-07-12 03:18:16 +00:00
p989 6cd699f684 new stylus display 2009-07-12 02:04:22 +00:00
zeromus 64350887cc change hud to use antigrain, fix antigrain compiling in linux (for now, libagg is mandatory; give me a preprocessor symbol and i will make it optional) and move antigrain source back into windows directory 2009-07-12 01:34:27 +00:00
yabause 04f79fb224 recent files now use a better mime type (at least,
something that's already used)
2009-07-11 22:07:35 +00:00
riccardom 71a84795b1 oops, missing backslash. 2009-07-11 21:41:43 +00:00
riccardom 187bb950f3 Removing unwanted file that slipped in. 2009-07-11 21:41:08 +00:00
zeromus 7246a12ced change cocoa to use swrasterize. there are still other bugs... 2009-07-11 21:10:14 +00:00
yabause 2d31b5bb8d Added some #ifdef protection for recent files feature that
require gtk 2.10 when desmume only require 2.8
2009-07-11 19:44:29 +00:00
riccardom 4ccb09d36d Use freetype font backend on !WIN32 2009-07-11 18:46:36 +00:00
riccardom 3307f91dcf More makefile work for libagg, disable libagg dependant stuff until it compiles. 2009-07-11 18:45:54 +00:00
p989 0b9b7dab23 basic shapes 2009-07-11 17:51:34 +00:00
riccardom 1cf0998d34 Add libagg detection machinery. 2009-07-11 17:48:24 +00:00
riccardom 7647ebbccd Put fake mic toggle under FAKE_MIC ifdef. 2009-07-11 17:43:03 +00:00
p989 073b71a46e more drawing funcs 2009-07-11 17:09:43 +00:00
yabause d0200bdbcd Added "recent files" support:
- when loading a rom, the filename is saved in recent files
  with "application/x-nds-binary" mime type
- a new "open recent" submenu let you choose a recent file
  with the "application/x-nds-binary" mime type
2009-07-11 16:08:38 +00:00
riccardom fbc2d8e296 Add alsa cflags / libs to makefiles. 2009-07-11 15:24:53 +00:00
riccardom ba33e8aa6b Brown paper bug: use plughw:0,0 as device instead of default, this is actually an error i introduced and not on the original.
Then check snd_pcm_readi return since it can fails and actually it is doing so.
2009-07-11 15:15:57 +00:00
riccardom fd20b10c90 Need to initialize stuff in Mic_Init(). 2009-07-11 14:37:50 +00:00
riccardom f63909b1d9 Add the alsa microphone implementation done by Heptaeon and posted in the
forum. Dear contributors please don't do that, write to the list, come on
irc, post a patch in sf.net instead.
Anyway this is made the default if you have alsa, tested a bit and haven't
managed to get it working. Since I don't know if it is our bad or common code
issue please test and maybe report back on irc.
2009-07-11 14:21:09 +00:00
zeromus b6c16bdb0c antigrain: add raster font rendering 2009-07-11 08:22:17 +00:00
zeromus 867c17d7a3 more antigrain refactors 2009-07-11 06:46:46 +00:00
zeromus e2a29f6c3e antigrain refactors, need an intermediate checkin 2009-07-11 04:27:03 +00:00
zeromus 11983ace12 move antigrain to core and build with make 2009-07-11 02:51:16 +00:00
zeromus f6f4719115 win32 agg: build with vs2005 instead of 2008; for some reason 2008 produces a lib in this case that 2005 can't handle 2009-07-10 22:41:37 +00:00
zeromus 078ac3bea0 remove the optional gpc component from antigrain, which is licensed under a retarded homemade non-commercial license 2009-07-10 22:27:36 +00:00
wntrmute 2288f5fdf4 remove cflash.cpp/.h add guitarGrip.cpp, enable universal binary 2009-07-10 22:03:59 +00:00
zeromus 0211a78a8e spu: last checkin with spu controls was bad. i guess i committed from the wrong directory. this fixes it 2009-07-10 19:29:05 +00:00
zeromus c2751af7f5 spu and win32: add individual channel muting capability 2009-07-10 18:46:50 +00:00
zeromus 5d40f08ce2 apply patch 2816373 which fixes extension dot parsing for creating save paths from rom paths 2009-07-10 18:15:45 +00:00
mtabachenko 09c7e4bf2c winport:
- fix config load for Guitar Grip addon;
2009-07-10 10:46:16 +00:00
mtabachenko 275cf18417 winport:
- added config keys for Guitar Grip;
2009-07-10 10:34:49 +00:00
riccardom c0e17f2a2b Add addons/guitarGrip.cpp to compilation. 2009-07-09 18:54:27 +00:00
p989 b9e0eee019 marker renderer 2009-07-09 15:52:22 +00:00
p989 082b8a1e92 line renderer 2009-07-09 15:11:48 +00:00
zeromus 7459a4a0db win32: add demo of agg compositing separate lua and emuscreen layers 2009-07-09 08:16:10 +00:00
zeromus d4b9473034 win32: fix vcproj again 2009-07-09 07:36:21 +00:00
zeromus 4eb59b05c1 win32: refactor agg drawing 2009-07-09 05:17:29 +00:00
p989 740fbdf6f6 agg_draw_line_pattern 2009-07-09 03:35:26 +00:00
zeromus 24b0d4cc74 fix vcproj files from antigrain addition 2009-07-09 02:25:39 +00:00
mtabachenko 5d2a46c1ad addons:
- add Guitar Grip device;
2009-07-08 23:26:35 +00:00
p989 20bbb21f56 antigrain geometry renderer and static lib 2009-07-08 23:01:43 +00:00
zeromus b671d2dc37 update version info to 095 and also port changed dsm spec from 094 branch 2009-07-07 23:05:30 +00:00
zeromus 8f2825ca2f rasterize: tweak around alpha blending again, mostly reverting to the older form 2009-07-06 06:54:41 +00:00
zeromus 2a9f14b516 win32: fix map view tool to display more modes, taking advantage of more evolved gpu code. also port changelog from 094 branch 2009-07-06 05:54:02 +00:00
zeromus 6e05ab43a1 rasterize: fix clear image support; gpu: fix a 2d obj mode; and a fix to vram diagnostics printing 2009-07-06 00:21:45 +00:00
zeromus a0c9689b6f rasterize: experimental edge marking; also mess around with alpha blending a bit 2009-07-05 20:02:41 +00:00
luigi__ 8495cce7d8 VS2010 project: Added pathsettings.cpp and pathsettings.h. 2009-07-04 11:09:50 +00:00
riccardom 9fd39b42be Sopt hardcoding dTools_list size. 2009-07-04 09:08:09 +00:00
riccardom b6e6cfd1f0 Remove hardcoded ioregtool in tool menu creation by adding a shortname field in the dTool_t struct. While at it cleanup a bit the names and shrink a bit name field. 2009-07-04 08:56:14 +00:00
mtabachenko 40ac90fa14 gfx3d:
- add SSE2 fix2float (some speedup);
new gxFIFO:
- fix timing for SwapBuffers (Homebrew apps work correct now);
2009-07-04 08:20:56 +00:00
riccardom a30f22976a Fixup whitespace. 2009-07-03 21:06:58 +00:00
riccardom 02915ec2d6 The tileview depends on gtkglext so just make it a stub, not nice but works. gtk-glade is such a mess this isn't goind to be noticed :) This should fix sf.net #2813691. 2009-07-03 19:06:13 +00:00
riccardom 4c42b9ebaf Remove a chunk of double zero-ifdeffed code. 2009-07-03 18:51:10 +00:00
riccardom 52340b1f18 Force lua disabled. 2009-07-03 18:40:32 +00:00
zeromus a266b8239d gpu: fix a couple of obj final pixel rendering regressions 2009-07-03 18:01:59 +00:00
zeromus 04af01a1ef core: emulate dma access to TCM by reading 0 and discarding writes. also fix a bug in the newer (extremely verbose) instruction logging 2009-07-03 09:52:32 +00:00
zeromus fb1bde8d41 gpu: overhaul sprite final pixel rendering to fix bugs and reduce code bloat. I may have broken some things (there are many rarely used configurations in here) but the code is in a final compact form now. also fix some win32 rom path related bugs. 2009-07-03 07:15:17 +00:00
p989 da7cb2fede lua: multiple vms with callbacks, string printing and console output, editing a script has immediate effects, clean up some libs and win32 menus 2009-07-03 06:28:39 +00:00
zeromus 1119a788ef fix a bug in vram mapping diagnostics printing 2009-07-03 02:27:53 +00:00
zeromus 11509592e4 win32: repair path-related things 2009-07-02 05:12:34 +00:00
p989 4dea9cc186 win32: fix lua path 2009-07-01 19:50:06 +00:00
mtabachenko 321873924b sorry, forgot commit resource file; 2009-07-01 10:23:07 +00:00
mtabachenko 9445a175fc - some fixes in gbaslot; 2009-07-01 09:46:41 +00:00
zeromus 7500bd0611 add packing attributes to another fat struct 2009-07-01 06:37:04 +00:00
zeromus 2b83987056 gbaslot is no longer experimental. old cflash system removed. clean up (hopefully) gbaslot cflash configuration system. common command line parsing for cflash. fix bug in cflash path mounting involving struct packing which failed in gcc (fat image mounting remains untested). 2009-07-01 05:51:42 +00:00
zeromus 5a0f4d989a add ideas-style debug console printing commands 2009-07-01 01:27:45 +00:00
p989 a57fd04002 lua: stylus.read 2009-06-30 18:01:31 +00:00
p989 c3d97b7854 move the stylus display to the bottom screen 2009-06-30 15:41:02 +00:00
p989 fa63c0da88 win32: path settings on one page, manual edits saved 2009-06-29 06:59:21 +00:00
p989 515d4e9987 win32: applied hicoder's path settings dialog patch. the default path behavior has changed from putting/looking for files where the rom is to putting/looking for files where the exe is 2009-06-28 18:44:00 +00:00
mtabachenko 8074480ba4 opps 2009-06-28 16:21:31 +00:00
mtabachenko 0046fa5c41 zeromus: sorry, i fix rev.2449 (reverted and fixed); dogs look fine now :) 2009-06-28 16:19:12 +00:00
gocha 845917c43b reset lag counter when reset rom, add reset lag counter hotkey 2009-06-28 06:25:17 +00:00
zeromus 6016b74e94 fix lua engine warnings 2009-06-28 04:15:25 +00:00
zeromus 572365617d clean up auxspicnt emulation 2009-06-28 03:19:48 +00:00
gocha ceea17083d win32: fix turbo start/select 2009-06-28 01:57:38 +00:00
zeromus cb75fa85fb reset frame counter when resetting rom 2009-06-28 01:55:23 +00:00
zeromus bc91ee7d50 crazymax: reverted packed command handling outside of USE_GEOMETRY_FIFO_EMULATION; check wandering dogs on nintendogs intro kennel chooser. im not sure why your approach didnt work. but good work on all the other stuff! i also suggest decoding commands written to registers (including packed commands) and putting them in the fifo since i bet that is how it works (it will simplify the logic as well). ill do this eventually if you dont. 2009-06-28 01:34:16 +00:00
zeromus b194f3566b win32: fix vs2010 vcxproj 2009-06-28 00:03:04 +00:00
zeromus bff9cfdd5e win32: change everything away from fastcall. its not so much faster since all the important stuff is inlined, and it is a huge headache and was going to end badly eventually anyway. also shrink some libs and fix some build errors. 2009-06-27 23:49:59 +00:00
zeromus f99e9e1456 fix a case in the rom header validation 2009-06-27 22:50:48 +00:00
p989 9facabe8a1 win32: 7z, rar, bz2 support, dialog for selecting a file from an archive with multiple files, lua console dialog 2009-06-27 18:41:37 +00:00
mtabachenko 44d89dfcc5 core:
- removed GE IRQ hack from new gxFIFO;
2009-06-27 18:06:12 +00:00
mtabachenko 52f43889b3 core:
- many fixes in experimental GEOMETRY_FIFO_EMULATION (now work many 3D games - Castlevania, M&L - TiP, MetalSlug 7 and many, but glitches in full 3D games: NSMB, FFx, Sonic etc.). need to test.
2009-06-27 15:50:55 +00:00
zeromus c742ca7c82 blahhhhhh update the chinese version of that dialog. 2009-06-26 22:35:10 +00:00
zeromus 8a099f51be win32: fix sound view to show volumes with datashift builtin optionally, and other misc cleanups 2009-06-26 22:32:49 +00:00
zeromus d3ccd7e968 win32: fix vs2008 more. fastcall needs to be removed eventually, it is an epic struggle to continue using it, which will culminate in failure once we start using glibc in more than one file 2009-06-26 20:16:45 +00:00
zeromus f6b07a41e8 win32: fix vs2008 release build 2009-06-26 20:07:07 +00:00
riccardom c5e0f2500e Add the alternative cf implementation from the addons. The plan is to have more instruments to sort out what's wrong with not being able to run pythonNDS demo under linux. 2009-06-26 19:30:08 +00:00
riccardom 78d17e31e8 Compile lua engine on linux if lua is available, still not hooked in gui. 2009-06-26 19:12:23 +00:00
mtabachenko 1af7d5e9ec winport:
- added Lua 'fastcall' library in VS2008; :)
2009-06-26 13:35:05 +00:00
zeromus a18ecb3527 remove <TexCache_TexFormat format> which caused compile errors on one lone person's system. why only him?? 2009-06-26 06:17:20 +00:00
zeromus faa55cf1f7 win32: add lua-engine.cpp to vs2005 vcproj 2009-06-26 06:14:57 +00:00
p989 20b89b2b49 lua scripting 2009-06-26 06:10:28 +00:00
zeromus 918afdcb2b win32: add static lua library 2009-06-26 05:57:05 +00:00
zeromus eac2b05c70 gfx3d: fix advance wars invisible tiles yet again. 2009-06-25 17:08:52 +00:00
luigi__ 92464f0c84 Re-enable wifi usec trigger which was accidentally(?) commented out.
Also, I changed my way so it's more like zero's one, but the decrement value for nds.wifiCycle makes more sense to me. zero, could you consider it please?
Also added some comments.
2009-06-24 23:20:17 +00:00
riccardom 3c184e0cfd make FCEUSS_SaveSRAM static and fixup whitespace on a line. 2009-06-24 21:14:48 +00:00
p989 07df6a630a reset recording 2009-06-24 21:10:10 +00:00
zeromus bcf3b9be14 win32: fix danish language menu selection as reported in forums 2009-06-24 20:35:37 +00:00
zeromus d647b9f481 gfx3d: a refinement to poly sorting 2009-06-24 19:23:37 +00:00
zeromus fc43f75b70 gpu: change affine bg drawing to use more accurate vram mapping. fixes some display issues, costs some speed. 2009-06-24 06:03:19 +00:00
zeromus 8ca0cddb7c gfx3d: add a default clear depth of maximum value (most distant) for games which never set it. 2009-06-24 05:17:32 +00:00
zeromus 1b44158f75 gfx3d: fix an ancient bug in matrix set position. fixes some mispositioned verts e.g. diddy kong racing 2009-06-24 00:40:40 +00:00
riccardom d489599bc6 Add X includes on darwin platform to allow cli frontend build on mac os x out
of the box. .lart^Wthanks giskard for the help.
2009-06-23 18:15:00 +00:00
zeromus 7789ebb3f1 oops 2009-06-23 04:45:47 +00:00
zeromus 263617e84b add some persons's osx chinese translation 2009-06-23 04:24:55 +00:00
zeromus 6b9f3f6b5b osx: apply save type selection patch 2009-06-23 04:14:17 +00:00
zeromus dd704aa865 win32: add background pause 2009-06-23 03:56:38 +00:00
zeromus 197392788a win32: fix bug in rc and add 2.5x window size 2009-06-22 20:50:24 +00:00
zeromus d8cb1ea638 rasterize: fix depth buffering again. 2009-06-22 18:05:47 +00:00
riccardom e9ebd7df18 Fix compilation with EXPERIMENTAL_GBASLOT defined. 2009-06-22 07:53:38 +00:00
zeromus af53b8e106 gpu: add experimental handling for a case of translucent bmp obj blending 2009-06-22 06:09:37 +00:00
zeromus 41a953f4a6 rasterize: fix highlight rendering 2009-06-21 19:26:13 +00:00
matusz 15b2a7cbc1 gtk-port WIP: building cheat searching dialog 2009-06-21 17:26:27 +00:00
riccardom 643d8f460c Shut up a couple of signed vs unsigned gcc warnings. 2009-06-21 09:14:10 +00:00
zeromus 83d9d24747 rasterize: remove a recent depth buffering regression in advance wars tile rendering 2009-06-21 06:26:09 +00:00
p989 642cbae742 store ext bios / swi settings 2009-06-20 21:47:58 +00:00
zeromus 4489fcd31f win32: fix svn version reporting in some cases 2009-06-20 21:29:04 +00:00
zeromus 0340f67a5f rasterize: fix toon shading when no texture is set (mario kart star powerup) 2009-06-20 19:27:22 +00:00
zeromus 6550d01a86 shut up gcc 2009-06-20 17:58:12 +00:00
zeromus a410b2f610 win32: fix warning in rc 2009-06-20 17:50:13 +00:00
matusz 7dc2c12bc8 include added parameters in save_movie 2009-06-20 17:49:59 +00:00
zeromus ec3a46782a rasterize: fix battles of prince of persia display failure regression 2009-06-20 17:45:39 +00:00
luigi__ 869ecc2788 Fixed PSG sound which would sometimes not play (regression).
By the way, SPU.cpp should be cleaned up. Some parts are messy and it takes hours to get compiled.
2009-06-20 13:55:56 +00:00
luigi__ c46ab0ca31 uh? need to commit again? 2009-06-20 13:18:50 +00:00
luigi__ f192604d10 Changed intermediate directory to '.VS2010'. 2009-06-20 13:15:07 +00:00
riccardom 35b67fb337 Add a toogle to disable / enable fps limiter while playing. The purpose of this is to fast
forward attack animations from. We don't have patience :) 

This patch is a modified version of the one from szigor from bug #2806869. Please note i've
used the already available boost key (SDLK_o) instead of the tab.
2009-06-20 10:02:37 +00:00
zeromus 1dcbe7b83a oops, left a hack uncommented 2009-06-20 08:02:54 +00:00
zeromus 959207cbeb rasterize: add clear image emulation 2009-06-20 07:57:52 +00:00
p989 c64e50151e starting a movie from sram 2009-06-20 06:28:23 +00:00
zeromus 6cc044c496 win32: add chinese translation 2009-06-20 03:56:12 +00:00
riccardom 1f0cadcfe8 Add enable-wifi switch and proper check for pcap 2009-06-19 22:42:41 +00:00
riccardom e89c997958 Fixup declaration vs initialization order warning. 2009-06-19 22:24:13 +00:00
yabause 792d1ba728 Added some files to distribution. 2009-06-19 21:11:18 +00:00
zeromus 3f80c39f33 win32: fjx types.h and add version.h to vcproj files 2009-06-18 20:14:58 +00:00
riccardom fa2afc6386 Fixup compilation and remove duplicate stuff rom types.h 2009-06-18 20:10:56 +00:00
riccardom b9f520a85a Allow compilation of linux cli without glib since it does not need it. Probably there is a cleaner
way but since desmume still compiles fine with glib it is not regressing. Guillame take a look at
this and remember we should take a serious look at configure.ac ;).
2009-06-18 19:50:51 +00:00
riccardom 6d66840326 define SVN_REV_STR as SVN_REV if is set. 2009-06-18 19:33:51 +00:00
riccardom bd0f5f9eb2 Define SVN_REV filled with latest svn revision. Code kindly taken from geany project. 2009-06-18 19:21:28 +00:00
luigi__ 05b10e8faa Added a project file for VS2010.
Note: this project is a converted version of the VS2008 project because I'm too lazy to replicate all the settings of the VS2008 project in a new VS2010 one. Please check that it works. I may have omitted important files :P
2009-06-18 16:27:51 +00:00
zeromus 8477368c41 add wificycle to savestate (probably an unimportant bug)
add write_enable=FALSE to backupdevice init (possibly an important bug)
2009-06-18 15:25:41 +00:00
zeromus 33e735a926 hoepfully fix atma's build error 2009-06-18 15:07:13 +00:00
matusz 8028559d84 s/#include "disassembler.h"/#include "Disassembler.h"/
(case sensitive filesystem here and it is capitalized everywhere else)
2009-06-18 10:50:50 +00:00
gocha fbf63505cf AutoHold for L and R 2009-06-18 08:43:58 +00:00
zeromus a55e58a804 update makefile with version.h 2009-06-18 06:51:06 +00:00
zeromus a2897ac198 core: move all desmume version #defines to version.h so that less stuff depends on it;
win32: add svn revision detection and print it in console and title etc.
2009-06-18 05:25:20 +00:00
zeromus caf0952774 win32: fix a ~1month old bug which made memview not able to see dtcm; fix a rerecording desynch bug involving the framecounter being wrong, which causes rtc reads during movies to yield the wrong value at the wrong time 2009-06-18 00:21:46 +00:00
yabause f7e9eb8598 Added some missing file to distribution. 2009-06-17 22:02:06 +00:00
zeromus ada3cc8c59 add a common commandline option --start-paused for when a rom is specified on commandline (but you dont want it to start immediately) 2009-06-17 21:52:40 +00:00
zeromus 258f1fb2c3 move the possibly useless backup memory flushing code to core to make sure that everyone gets it. 2009-06-17 20:30:28 +00:00
zeromus c248dd4f1d ok 2009-06-17 20:22:53 +00:00
riccardom f60a8de07d Make wifi compiles for !WIN32, now the only missing bits are configure check for libpcap and runtime testing :).
It is possible that i've made a typo or similar mistake in the wrappers, i'm sorry for that but should be easy to spot and fix.
2009-06-17 20:21:20 +00:00
riccardom b481b8d5d9 Fix warnings and add libpcap include for !WIN32, need more fixes to compile. 2009-06-17 18:59:43 +00:00
zeromus dfcbea4161 win32: fix bugs which made compling without EXPERIMENTAL_WIFI fail 2009-06-17 18:55:03 +00:00
matusz 8d4a505f72 gtk-port: unhide cheat menu items
limit cheat size option to 1-4
2009-06-17 18:04:10 +00:00
riccardom 7ca7824ebf Hook fake mic in cli frontend: use m to toggle. 2009-06-17 17:23:52 +00:00
riccardom a2b08efbd7 Random cleanup: fix whitespace in config check, remove commented debug code. Cleanup a bit initGL. 2009-06-17 17:19:06 +00:00
zeromus 2a86619492 ditto 2009-06-17 05:07:52 +00:00
zeromus ff8be953a9 update dsm spec 2009-06-17 01:23:43 +00:00
p989 e2206215bf parenthesis 2009-06-16 19:44:46 +00:00
zeromus 0579983459 adding these files seems to help vc++ express build. i think it doesnt break full vs because their builtin versions have higher priority? 2009-06-16 19:43:19 +00:00
p989 eb05c12759 preliminary lid recording 2009-06-16 19:39:21 +00:00
zeromus e91c8f89c1 resource.h instead of resource1.h 2009-06-16 19:38:22 +00:00
zeromus 8a020c11ba try fixing rc to work in 2010 and 2005 2009-06-16 18:58:58 +00:00
p989 5688e953ca ported previous 2009-06-16 18:43:36 +00:00
mtabachenko 08628592cf - sse2 optimizations (speed test http://www.turboupload.com/uzmjnuzfbvf1/test_matrix_SSE2_09-06-16.ZIP) 2009-06-16 18:01:56 +00:00
luigi__ b7f41c4ff1 Remove including of targetver.h. 2009-06-16 17:36:43 +00:00
luigi__ f02500bf67 Fixed the first (and hoefully, the last) problem. 2009-06-16 17:25:14 +00:00
zeromus 827322a013 try fixing resources for vs2005 2009-06-16 17:19:05 +00:00
luigi__ 1382b51492 Saved resources from VS2010 resource editor. Please check that nothing was broken.
If everything went fine, then WE DON'T NEED RESEDIT ANYMORE!!! EVERYTHING IS LIKE BEFORE!!! EVERYBODY CAN NOW EDIT DIALOGS!!!
2009-06-16 17:06:33 +00:00
zeromus 5b83d55092 integrate from release branch 2009-06-16 05:50:48 +00:00
gecko_reverse ae6f134406 compile fix for cocoa port 2009-06-15 10:54:27 +00:00
mtabachenko 3ed0604e12 winport:
- fixed search after load savestate and reset game;
- fixed grayed 'OK' button in GBAslot dialog;
2009-06-14 16:44:00 +00:00
matusz 728db76bde gtk-port: cheat-window size-column bug-fix 2009-06-14 01:53:55 +00:00
matusz 4175f299d3 remove a stray variable 2009-06-14 01:31:53 +00:00
riccardom 9000a56039 Add recent cli improvements. 2009-06-13 15:36:09 +00:00
riccardom 8aa6cce8cb Hide cheat system directly in the gui. 2009-06-13 15:27:00 +00:00
matusz a8bed32619 gtk-port: fix a few bugs in cheat window
keeping cheats disabled (until release)
2009-06-13 14:14:43 +00:00
matusz 99e1e3b5d5 defer cheating in gtk until after release 2009-06-13 10:13:35 +00:00
riccardom 808c6f8d3d Fix up annoying warning about declaration vs initialization order. 2009-06-13 09:50:37 +00:00
riccardom d6532cfbe2 No need for extern here. 2009-06-13 08:23:57 +00:00
riccardom d6e495da98 Don't need 100 chars for win title, while at it use snprintf instead of sprintf. 2009-06-13 08:05:34 +00:00
matusz e2e74e9b3e gtk-port: Hook up cheating engine
cheat searching not hooked yet
2009-06-13 08:05:10 +00:00
riccardom 1019c9bb46 Exit when pressing escape, patch by szigor from #2801291. 2009-06-12 20:15:20 +00:00
riccardom 748c4c810b Add auto pause option to cli frontend by szigor from #2801291. 2009-06-12 20:12:08 +00:00
riccardom 9ac2a2a48f Commit a modified version of szigor cli input refactoring patch from #2801291.
The change from the original are mainly moving the input update to an helper
 and calling it in the frameskip loop like it is done on other frontends.
2009-06-12 19:40:30 +00:00
riccardom 27e9db8c6b Add frameskip for cli frontend, patch by szigor from #280129. The FIXME could be easily resolvable so we should fix it shortly :) 2009-06-12 08:03:51 +00:00
riccardom 1de4517874 Fixup whitespace. 2009-06-12 07:25:50 +00:00
riccardom 63a893a277 atoi needs stdlib.h 2009-06-12 07:16:11 +00:00
zeromus b18e0dcb15 gtk: fix movieplaying and add minimal play/record/stop menu support 2009-06-12 07:11:40 +00:00
mtabachenko 45f129f229 - fix bug in init & reset OpenGL engine; 2009-06-11 20:25:27 +00:00
zeromus 0ef0afed15 try a little hack to fix tomb raider underworld savefile which was writing past its 512B limit 2009-06-11 04:33:11 +00:00
p989 1c1dd8bb30 win32: reset mic button buffer pos if not pressed 2009-06-11 04:14:42 +00:00
zeromus 947356fbe1 clean up rom info collection and mix it up with the movie system 2009-06-11 03:40:56 +00:00
zeromus 5e3e6f8676 win32: work around unknown glitch with stdio attachment in visual studio command prompt 2009-06-10 20:59:57 +00:00
zeromus 7d69942bbb gdb stub fixups 2009-06-10 20:30:15 +00:00
zeromus 71eac340d5 work on changelog 2009-06-10 06:49:51 +00:00
zeromus d5dc1f45b1 spu: handle word writes to length register; fixes freeze during maxmod reverb (reverb still isnt supported, though) 2009-06-10 02:04:30 +00:00
zeromus 3cf5ec430a fix a certain pattern of ipc register writes which was breaking devkitpro touch input 2009-06-09 23:14:26 +00:00
zeromus 53aaa6850f set up a system to handle detection of bogus roms by header instead of by extension. fix poly sorting which was broken when changed to a stable sort (will make some invisible gui elements reappear) 2009-06-09 21:15:00 +00:00
zeromus 1828745e5d win32: add commandline handling for play-movie, record-movie, and load-slot 2009-06-09 05:21:58 +00:00
zeromus 28164e5bb2 fix screenshot bugs with rotation and accidentally including hud. rotation is fixed by writing screenshot unrotated since rotation is handled by platform code now and screenshotting is in the core. 2009-06-09 03:50:58 +00:00
zeromus 333a10a655 win32: add ability to disable each gpu, for speedup by halting render of useless screens 2009-06-09 03:35:37 +00:00
zeromus 7dbe16b4c4 only display X when input display is on 2009-06-09 03:06:15 +00:00
p989 952440b17d adjusted mic command number 2009-06-08 22:53:58 +00:00
p989 1b24d34ad2 removed main.h 2009-06-06 15:22:10 +00:00
p989 8ff221a8fa moved ShowInputDisplay 2009-06-06 15:08:13 +00:00
riccardom d38623350f Use tabs for whitespace consistently in MMU_struct. 2009-06-06 13:22:58 +00:00
riccardom 817e6af268 One should be enough :) 2009-06-06 12:41:20 +00:00
riccardom f9caa9490a stricmp is not available on !WIN32, use strcasecmp that is not available on WIN32 but it's already defined as _stricmp in types.h. 2009-06-06 12:33:51 +00:00
gocha d8d593d048 stylus display from rr-branch + minor change 2009-06-06 05:54:25 +00:00
p989 7d7a6c4bfa hotkey config doesn't center 2009-06-06 05:50:06 +00:00
zeromus 38fca0bb3c fix loading of zipfiles 2009-06-06 05:22:00 +00:00
gocha 77a8d25a13 win32: the updown control in ram watch now works well 2009-06-06 05:13:29 +00:00
luigi__ a208def471 For immediate LDR, if we're loading from [PC + 0xXXX], print final offset instead of [PC + 0xXXX]. 2009-06-05 21:09:35 +00:00
luigi__ 72f363a4fb Fixed crash when loading files that aren't ROMs (for example when accidentally dragging some file on DeSmuME's window). 2009-06-05 12:11:09 +00:00
luigi__ 343c013385 Fix two bugs with emulation settings dialog. 2009-06-05 11:52:03 +00:00
luigi__ b95d041976 Oops... the prevoius attempt was fucking horrible. This should be better. 2009-06-04 21:34:25 +00:00
luigi__ 7cb5d48907 Re-add writing to firmware because I need it for testing wifi stuff. 2009-06-04 21:27:31 +00:00
gocha 20c2734317 win32: changed avi framerate very slightly because it seems to have less audio desync. (old one wasn't so bad, anyway...) 2009-06-04 15:06:36 +00:00
riccardom b3a1dde141 Fixup linux build. 2009-06-03 19:10:13 +00:00
zeromus 3499207db6 fix crash in cheat search involving loading state in the middle of a search session 2009-06-03 15:32:51 +00:00
normmatt234 cd5560b966 Fix some broken stuff. 2009-06-03 05:24:23 +00:00
luigi__ ad8fe45f83 Hack a bit the power-on stuff. Fixes some problems with Nintendo WFC config util. 2009-06-02 20:28:38 +00:00
p989 d5aef7da1d preliminary mic recording 2009-06-02 20:22:58 +00:00
riccardom f4fb58d0ff Define empty macros as {} to avoid problem with empty macros inside if statements. 2009-06-02 19:11:09 +00:00
riccardom 327dc2c2b9 Remove unused parameters from NDS_LoadROM(). 2009-06-02 18:52:54 +00:00
zeromus fb6bf65dfd wifi: a timing tweak that may help luigi 2009-06-02 17:42:36 +00:00
luigi__ 7f483fcab4 Cleanup in wifi core:
- removed socket shit (which is anyway not suited to our needs)
- Added a logging system configured by a logging level
- Some other stuff...
2009-06-02 17:10:39 +00:00
zeromus 43b31e3f0c fix (new?) wifi crash 2009-06-02 04:32:21 +00:00
luigi__ 19fa692af8 Clean up packet managing in SoftAP. 2009-06-01 21:52:50 +00:00
luigi__ c2f70995b4 Oops... forgot to undo a hack I had added.
Also added comments about the packet length field in RX header.
2009-06-01 21:33:27 +00:00
luigi__ 5e51f9f1b4 After some fixes into SoftAP I managed to get the Nintendo WFC config util to see SoftAP. But unfortunately the connection test that follows will never end. Another problem to solve.
But first I should clean up the wifi core and add a logging system that I can disable without having to commenting everything :P
2009-06-01 21:12:19 +00:00
luigi__ 37fdc95e87 Wifi writes are written to MMU.MMU_MEM, so I can see wifi memory in the mem viewer. 2009-06-01 20:34:26 +00:00
zeromus 84f01716a1 fix linux builds 2009-06-01 15:10:36 +00:00
zeromus 40d5c4a485 more work on the sav system. see forum for details 2009-06-01 08:40:46 +00:00
zeromus 1ce2cb86f5 fix bugs in wifi no-winpcap handling. make vs2008 debug build able to load savestates. add some notes for luigi with "luigi:" 2009-05-31 23:53:38 +00:00
gocha 9c2369fac6 OOPS, sorry guys 2009-05-31 13:57:00 +00:00
gocha f1aa73d511 59.8261 or 33513982/(6*355*263)? I'm not sure which has less audio-desync, anyway I commented out the alternative framerate for now. (no behavior changes) 2009-05-31 06:45:45 +00:00
zeromus 3ae63b6a0a gpu: fix some probably inaccurate math in 3d blending against 3d. the effects of this are subtle, but see if you think it helps any 2009-05-30 23:25:14 +00:00
zeromus 814078f2ae gpu: blend 3d with whats beneath it in more cases. not entirely sure about the correctness of this, so keep eyes peeled for regressions in 3d/2d compositing 2009-05-30 22:17:05 +00:00
mtabachenko a5ea4e0cc8 - fix bug #2798680 (load & save message display interfere with gameplay) 2009-05-30 20:06:44 +00:00
zeromus 92ded778aa print rom crc32 when loading 2009-05-30 19:00:47 +00:00
zeromus d55b3836ee win32: fix icproj 2009-05-29 09:39:31 +00:00
zeromus 26302fda39 win32: odds and ends to get things compiling in all cases 2009-05-29 08:39:36 +00:00
zeromus f3a0332bc3 i wish i couldve done it right the first time 2009-05-29 08:27:03 +00:00
zeromus 2d622d98e0 core: add a preliminary core commandline parser component. please note that temporarily linux cli may depend on gtk--we should change it to a bare glibc dependency.
win32: add glib. this is a rather behemoth checkin, but I think it will be worth it, as it is a necessary step for unification of some of the linux and windows parts.
2009-05-29 08:26:18 +00:00
zeromus 7b4804b878 win32: attach to existing console (from commandprompt) if it exists instead of always creating a new one. still needs a bit more work 2009-05-29 08:13:06 +00:00
zeromus 29ac31a5a4 win32: redirect stderr to console in addition to stdout 2009-05-29 06:15:29 +00:00
gocha d8d3cd7dc0 GPU_OSD.h -> GPU_osd.h 2009-05-28 22:09:28 +00:00
riccardom 5c7d20450f Revert sputrunc to u32 and change the struct field to u32 too. 2009-05-28 18:20:07 +00:00
riccardom f33e81f7c3 We compare the result of sputrunc alwyas with s32 type so just return it. Well, the real reason is that i'm so tired of that 50 lines warning. 2009-05-28 18:10:50 +00:00
riccardom beecc55eb0 Putting 5000 (OSD_TIMER_SIZE) in a u8 is no fun. 2009-05-28 17:51:09 +00:00
riccardom fa588a6abb Need header for strlen(). 2009-05-28 17:42:37 +00:00
riccardom d19917f31b case sensitive ftw! ;) 2009-05-28 17:42:07 +00:00
mtabachenko cc12f72058 win32:
- fix resources (not visible scrollbars). please, guys, check for expressions `NOT WS_VISIBLE | NOT WS_VISIBLE` before commit recource.rc to svn, replace to `WS_VISIBLE`
2009-05-28 17:23:10 +00:00
mtabachenko 7d670af6da core:
- many changes & fixes in OSD;
winport:
- fixed HUD editor for scaled window size;
2009-05-28 14:02:56 +00:00
gocha e910b610dc win32 - "Stop WAV" menu item title fix 2009-05-27 21:44:16 +00:00
gocha 7c2cb8223f win32 - audio segment in avi is stored on every 1s now (to prevent the tons of audio segments problem) 2009-05-27 15:40:27 +00:00
zeromus 81db33cb4a OOPS 2009-05-27 15:12:49 +00:00
zeromus df666957da assorted housekeeping: gocha's spu streaming patch for all platforms, driver system, copyrights, credits, wav writer in, sndfile spu core out (wav writer is better, it will need to be added to ports) 2009-05-27 06:46:58 +00:00
adelikat e81787b703 Win32 - very tiny menu fix 2009-05-26 16:04:38 +00:00
adelikat 34a92d859f win32 - record movie dialog - minor code cleanup 2009-05-26 15:20:57 +00:00
adelikat aa8baf0686 win32 - record movie dialog - OK button doesn't work until user specifies a filename 2009-05-26 15:16:42 +00:00
adelikat 7253fe7775 win32 - record movie dialog - if user doesn't not specify a file extension add .dsm for them 2009-05-26 15:13:51 +00:00
gocha aa2b5b75c8 win32 - now memView can update its contents on every frame, the code is still poor after all 2009-05-26 11:11:04 +00:00
gocha 05563cf9c7 win32 - add soundView 2009-05-26 02:52:07 +00:00
riccardom 0de92a1a4d Correct fprintf usage. 2009-05-25 21:14:15 +00:00
riccardom 85153d0f31 Cleanup EmuLoop a bit: use an array instead of heap for the fps string and save a
variable by moving zeroing of one with the very same value after we need it.
2009-05-25 19:46:29 +00:00
mtabachenko 2d288f338f - some cleanups GXFIFO; 2009-05-25 16:40:48 +00:00
normmatt234 d963afde7f Fix some things in the disassembler. 2009-05-24 09:04:58 +00:00
riccardom 2fd1266680 Adapt gtk-glade to new frameskip api, the behaviour looks a bit saner that the gtk one :| 2009-05-24 08:49:08 +00:00
riccardom eb0bc23d6e Adapt to new frameskip api, there's something strange here, at frameskip 1 i have 30 more fps and the poor frameskip limiter does not kick in. 2009-05-24 08:46:12 +00:00
zeromus 5211cea5b8 win32: add wx stub. with this, we could launch a wx dialog from win32 driver. this is not an endorsement of wx or even the philosophy of cross platform ui but rather a favor to those lunatics that mumble about cross platform stuff, so that they can drop wx dialogs into the emu core and launch them from windows without having to rewrite the entire windows port to use wx. 2009-05-24 07:26:15 +00:00
adelikat 2ae4e618e5 Win32 - disabled savestate, loadstate, and setsaveslot hotkeys when no rom is loaded. 2009-05-23 19:51:51 +00:00
luigi__ 016a543ef3 I finally figured out why 2D and 3D get desynced when skipping 3D frames.
Thus, I fixed the frameskip system so it'll also skip 3D frames. 2D and 3D stay synchronized, and frameskip is now much faster when using the soft rasterizer, for example.
2009-05-23 19:30:29 +00:00
riccardom 307fdf527f We really want to know when the savetype discovery fails so it's easier for people to report. 2009-05-21 18:28:26 +00:00
zeromus 6a743748e4 gpu: take out that assert. it has done its job and proven that we can't make that assumption 2009-05-21 17:44:59 +00:00
riccardom ec89bf7ca1 Autosave for scooby-doo! Unmasked. 2009-05-21 16:19:25 +00:00
zeromus 6323e05bd6 gpu: ensure the thing that the assert catches, just for release builds so that people wont find subtle errors. we really need better error and info reporting facilities. 2009-05-21 14:59:19 +00:00
zeromus 698cfe1f93 gpu: reorder the layer rendering, capture, and final display, to be a little less confusing, and it should get rid of a frame of latency on motion blurs 2009-05-21 08:55:37 +00:00
zeromus 4bbb85bb83 gfx3d: sorry, the poly sorting callback must be this way. there must be something else going wrong where this breaks 2009-05-21 08:45:34 +00:00
zeromus 620618d22b gpu: display capture: fix bug blending vram + 2d/3d causing 2d elements to be black 2009-05-21 07:17:11 +00:00
zeromus 41aa900bb7 spu: fix bug with badly messed up sequenced music 2009-05-21 06:04:46 +00:00
zeromus 57dbe9128d win32: fiddle with the mic input, moving it towards more reliability 2009-05-21 05:44:55 +00:00
zeromus 250bcd5b18 win32: fix bug in mic reading which makes it return unpredictable garbage 100% of the time 2009-05-21 05:04:11 +00:00
zeromus 39e13e6612 win32: set correct fastbuild output path for vs2008 2009-05-21 02:20:54 +00:00
zeromus eb960e1e39 add another autodetection. still &3 2009-05-20 21:41:36 +00:00
zeromus 8cf301fd25 add another autodetection (still &3) 2009-05-20 20:17:04 +00:00
mtabachenko ca9f2fec36 core:
- fix poly sort (zeromus, check it), now fix Harvest Moon, Orc & Elves, but some game broken (from rev 2230 - Lunar Knight, Orc & Elves no sprites);
2009-05-20 08:34:12 +00:00
zeromus 1c886d15b1 we now have proof that a stable sort is necessary for poly sorting. this fixes advance wars regression 2009-05-20 06:17:30 +00:00
zeromus 47e27cffa5 re-add duc importing for new savefile system 2009-05-20 06:05:39 +00:00
zeromus c6c2ec7137 win32: dont reset spu from sound config dialog unless the core changes 2009-05-20 04:46:23 +00:00
zeromus e9537e2468 this might fix the periodic crash with a null polylist 2009-05-20 04:31:18 +00:00
zeromus ce9523d39c add another autodetection 2009-05-20 03:23:16 +00:00
riccardom 0ef9b64379 Move variables in the same order they are inited. 2009-05-19 20:08:38 +00:00
riccardom 3edf67ae85 put some unused / commented code into ifdef to shut up gcc warnings. 2009-05-19 20:07:47 +00:00
riccardom 4e41817906 Declare variables in the same order they are inited to shut up gcc warnings. 2009-05-19 20:00:23 +00:00
zeromus 29cc1443ac add another autodetect case. still conforming to the &3 pattern... 2009-05-19 17:21:55 +00:00
zeromus 1e55bc3832 add another autodetect case 2009-05-19 16:34:12 +00:00
zeromus 133b9866b6 gfx3d: make 'alternate flush mode' emulation option. this option toggles between two methods, neither of which is entirely accurate such that under one of the modes, certain games are unplayable. if a game is fixed by alternate flush mode, please report it in the bug tracker under that category for data collecting purposes. also hooked up this option in windows. 2009-05-19 03:26:15 +00:00
normmatt234 522ef7db4d add another autodetectoin 2009-05-18 20:36:21 +00:00
zeromus cbf3d47bcb add another autodetectoin 2009-05-18 20:31:11 +00:00
riccardom 3ccc9ae7dd Shut up a few gcc warnings in GPU.cpp. 2009-05-18 19:18:52 +00:00
yabause 47b2f84711 Added some #if and some workaround so we only need
gtk 2.8 now.
2009-05-18 18:57:48 +00:00
zeromus 679669e1d0 add another autodetection 2009-05-18 17:28:34 +00:00
zeromus e461cc9ce5 add another autodetection 2009-05-18 17:15:22 +00:00
zeromus 3c3b9a4a23 add another autodetection 2009-05-18 17:01:00 +00:00
mtabachenko af0c060a7a - fix windows resource; 2009-05-18 07:35:26 +00:00
normmatt234 a5218faeba Implement a few of the new card commands used in Made in Ore. It wont save but at least it boots now. This is just a temporary fix until something better can be worked out. 2009-05-18 07:24:47 +00:00
zeromus 1d13bcb323 fix shared 2-bank shared wram mapping; add Release FastBuild to 2008 vcproj 2009-05-18 06:49:51 +00:00
zeromus 4fb93568de win32: fix vs2008 project to support zipped roms in debug builds 2009-05-18 06:32:05 +00:00
zeromus 2d9968e2eb fix bad new crashiness 2009-05-18 05:48:43 +00:00
zeromus 0baa5914a5 gfx3d: fix stack corruption in normal command 2009-05-18 05:36:50 +00:00
zeromus ca1ad0bfba win32: fix buffer overflow in savestate description generation 2009-05-18 05:34:51 +00:00
zeromus 5e78d6a888 savedata: handle warioware touched (still gathering test cases, keep them coming)
win32: fix vs2005 fastbuild output directory
2009-05-18 05:07:38 +00:00
zeromus fec0ae896e fix linux compile? 2009-05-18 04:37:03 +00:00
zeromus ca540cb6b6 new save file system. the manual save type selection no longer does anything. If you think you still need it, we need to study the case and find out why. 2009-05-18 04:25:19 +00:00
gocha 89df112dd8 win32 - added wav recording 2009-05-18 00:15:48 +00:00
gocha 503108cfa1 Merged "Stop AVI" to "Record AVI" 2009-05-17 22:58:35 +00:00
riccardom 3e53a28f3c Fix b shadowing warning. 2009-05-17 19:11:28 +00:00
zeromus e347ab6c90 fix up linux compiling 2009-05-17 18:53:14 +00:00
zeromus 13fb9e8a2f fix [2792967] Emulator crash when opening homebrew 4k intro 2009-05-17 17:05:29 +00:00
adelikat 761f9232b2 movies - add romname to movie when movie is created. Win32 - Replay dialog - added some fields such as length, frames, etc. Fields are not yet hooked up however. 2009-05-17 14:58:00 +00:00
gocha 5e2b6b5582 prevent a crash reported by Robert 2009-05-17 07:30:39 +00:00
normmatt234 caf05e22ea Fix windows disassembler goto addressing.
Clear SPI variables on reset.
2009-05-17 05:58:08 +00:00
zeromus d807f08fcc add gochas rerecording fixes 2009-05-17 04:58:24 +00:00
zeromus 86093ba19f i really should quit checking in debug printfs 2009-05-17 01:26:51 +00:00
luigi__ 58ea43bf2e Oops... don't know why IDC_SPU_INTERPOLATE_CB was removed... 2009-05-17 01:08:25 +00:00
matusz 058b218e59 change 2 debug printf's to LOG's (should add SPUDEBUG logging channel?) 2009-05-17 01:02:17 +00:00
luigi__ ef590739da Oh shit... tiny fix to the I/O reg dialog. 2009-05-17 00:59:59 +00:00
zeromus de794ec6e8 core: make adpcm cache optional (defaulted to off) temporarily until it can handle streams well. i have a plan for that but i am burnt out on it for now. bind that option into win32 gui 2009-05-17 00:21:41 +00:00
luigi__ 52e26afa32 Commit the remaining I/O reg viewer tab templates once for good. 2009-05-16 23:46:08 +00:00
matusz 6acc3e0d65 gtk port: janitorial stuff
some changes to make the code meaning more obvious:
split, move and rename of a few functions
add empty (for now) configure event
2009-05-16 23:18:40 +00:00
zeromus 6365f26d7d spu: interpolation is now an emulator option, defaulting to linear, and it is bound to the win32 gui. choosing interpolation:none can net you a small framerate boost. 2009-05-16 22:22:06 +00:00
matusz 1a6079ce4d cli port: silence a 'shadow' warning 2009-05-16 18:39:06 +00:00
riccardom 6a3591bb84 nds_screen_rotation_angle is really an int. 2009-05-16 18:14:37 +00:00
matusz 95c441ea0c one correct and one bogus warning silenced 2009-05-16 18:08:57 +00:00
riccardom cf04a5e589 Shut up a few gcc warnings, mostly signed vs unsigned. 2009-05-16 17:56:11 +00:00
matusz 53ec75c9b0 gtk port: allow interscreen gap 2009-05-16 17:48:25 +00:00
zeromus 4c1061b84b fix spu in non-windows builds. 2009-05-16 16:32:35 +00:00
zeromus 7904345439 didnt mean to checkin debug printfs 2009-05-16 07:08:48 +00:00
zeromus 67117c1280 spu: sorry about the float/double thing. how about this instead: added an adpcm decode cache system. 2009-05-16 06:59:12 +00:00
luigi__ ea8ecd9dc2 Reverted the types of the sample counters to double. Using floats was causing wrong frequencies sometimes. 2009-05-15 21:56:13 +00:00
adelikat f1a573079a Win32 - applied patch from Hicoder ID: 2780499, Menu option for window always on top. 2009-05-15 15:40:09 +00:00
adelikat 7fe0f62617 Win32 - Recent ROM menu - if a recent rom doesn't exist it will now prompt the user if he wants to remove the item. 2009-05-15 15:13:17 +00:00
adelikat 4fa564f062 Stop movie hotkey hooked up, Play & Record movie hooked up but commented out because of a bug that causes the dialogs to open twice. 2009-05-15 13:10:33 +00:00
mtabachenko 229055cb0e winport:
-fix Intel C++ project; :)
2009-05-14 17:51:03 +00:00
matusz 305eb40c1e just a bunch of propsets for svn:eol-style=native 2009-05-14 10:08:18 +00:00
matusz ffb5de877d SPU: gcc does not like a goto, changing it to a block 2009-05-14 09:54:14 +00:00
zeromus e5f35a5f3e a few minor speedups to spu. the doubles have been changed to float. i think this should be safe... 2009-05-14 08:08:27 +00:00
zeromus 7bea1697c3 revert geometry flush timing to an older form. can't remember what this was supposed to fix. it was supposed to be more accurate, but it turns out to be way more complicated than I thought. the form i am checking in now should be an effective approximation. This will fix some games whose 3d was entirely broken (and even crashing the emulator). But I am more interested in what regressions it will cause, which may involve broken dual screen 3d modes or other bugs with things flickering in and out of existence. these I will track in detail while I try to understand the problem. 2009-05-13 21:44:47 +00:00
riccardom 9fbac3e7bc I think is more natural for a gtkToggleActionEntry to query the GtkToggleAction to be active instead of checking if the widget is already visible or not. 2009-05-13 20:01:35 +00:00
adelikat 7cd0426a37 Win32 - Added Play Movie, Record Movie, and Stop Movie hotkeys, they are not yet functional though 2009-05-13 17:33:08 +00:00
adelikat ace96ce5e0 Win32 - Hotkeys - Added a Movie page, moved read only toggle to that page 2009-05-13 16:38:04 +00:00
zeromus 29297644ac a number of little graphical speedups, and more intelligent arm7 memory access pattern optimization. good for a few fps. 2009-05-13 07:44:06 +00:00
zeromus 3844e866e0 gpu: fix regression introduced yesterday which messed up layer blending 2009-05-13 05:35:31 +00:00
riccardom 5c5be96f52 Remember to load default config for keys and joypad so no need
to mess ourself setting them if we don't find the group in the
config file.
2009-05-12 19:39:23 +00:00
riccardom 10ebeb093f Add missing file, thanks Guillame for noticing. 2009-05-12 19:26:34 +00:00
riccardom 2b574440ab Rework the way config file works in gtk frontend. From a write once on exit
we are moving to write only what changed when is changed model which i think
is more correct.
2009-05-12 19:05:56 +00:00
adelikat d33cfa55a5 Win32 - RamWatch - hooked up accel table 2009-05-12 16:35:22 +00:00
adelikat 3bc7efc516 Win32 - Code cleanup 2009-05-12 15:23:45 +00:00
adelikat 5428c3614a Win32 - Tiny speedup - UpdateRamWatch & UpdateRamSearch return immediately if dialogs are not open 2009-05-12 13:12:28 +00:00
adelikat 1215be45c0 Win32 - minor Resource file cleanup 2009-05-12 12:15:42 +00:00
zeromus 7ff78b6215 large speedup in bg pixel pipeline 2009-05-12 07:48:45 +00:00
p989 0876ae03d4 win32: fixed ram search endianness 2009-05-11 04:40:28 +00:00
riccardom 756b4fd8eb Random cleanup: move some struct definitions, defines, global variables on top. Remove some silly banners or move them where they belong. 2009-05-10 14:33:20 +00:00
adelikat 113615af35 Win32 - UpdateHotkeyAssigments() - More hotkeys added. 2009-05-09 21:56:09 +00:00
adelikat b0669283e7 Win32 - UpdateHotkeyAssignments() - code cleanup 2009-05-09 19:36:03 +00:00
adelikat a8a53aa82e Win32 - UpdateHotkeyAssignment() - fixed up code, not elegant but gets proper results 2009-05-09 19:09:09 +00:00
riccardom 9956cab1d4 Simplify Modify_Layer() by removing some superfluos checks, we really don't care if the layer was already in the state we want now. 2009-05-09 17:00:32 +00:00
adelikat 1ba78a6ea3 Win32 - UpdateHotkeyAssignments() added Save Screenshot As. However, the keys struct doesn't properly return F keys as strings. 2009-05-09 16:13:09 +00:00
adelikat d3bb120ebe Win32 - minor fix to UpdateHotkeyAssignments() 2009-05-09 15:37:36 +00:00
riccardom c7bd2c7cbd Add the possibility to have a desmume quit after a timeout. The idea is to use
this feature in conjunction with load state to have a more reliable way of
profiling the same stuff in different moments. A companion to this patch
would be a script that start the profiler, start desmume and close the profiler
once desmume exited.
2009-05-09 10:26:46 +00:00
adelikat 7b49f8923b Win32 - UpdateHotkeyAssignments - now retrieves key assignment from hotkeys 2009-05-09 04:09:21 +00:00
p989 3b1591abe2 win32: pause is now the default for pause hotkey 2009-05-09 04:07:51 +00:00
p989 6047ff9c72 win32: pause works as a hotkey 2009-05-09 02:51:11 +00:00
adelikat dd00cbd1b7 Win32 cleanup - Removed redundant GetHWND() that I made previously. Moved GetRomName() to common.h. Moved Ram Watch and Ram Search menu items to tools menu. 2009-05-09 02:37:57 +00:00
adelikat fde0833da2 Win32 - fix accelerator table for RamWatch 2009-05-09 01:42:44 +00:00
adelikat ae847d37e2 Win32 - Ramwatch - oops 2009-05-09 01:40:54 +00:00
adelikat e80b91bd56 Win32 - Ramwatch - fixed AskSave() when called from main window 2009-05-09 01:10:08 +00:00
matusz ed89660799 gtk-port: give pause/run focus 2009-05-08 22:32:16 +00:00
riccardom 550a71e640 Move a couple of includes at top of the file 2009-05-08 22:20:22 +00:00
riccardom 3dbed90795 Cleanup SetRotation() a bit: use a single switch instead of multiple if, instead of exiting with a not correct angle just reset it to 0. 2009-05-08 22:03:50 +00:00
riccardom 0c937d7f98 Remove some unneeded code from gpu_screen_to_rgb(). 2009-05-08 21:16:38 +00:00
riccardom 3fd744b810 Set the current dir for the gtk file chooser to user home dir instead of the current path. 2009-05-08 19:51:15 +00:00
riccardom ece807b605 Let nds filter in the file chooser match againt upper case extensions. 2009-05-08 19:41:35 +00:00
adelikat dc86077865 credz 2009-05-08 13:57:42 +00:00
adelikat 5936de5a32 Win32 - main.cpp now keeps track of current RomName. Set up a GetRomName() function to return name of ROM (useful for default filenames on OPENFILENAME dialogs. Ramwatch - uses romname for default .wch filename. 2009-05-08 13:52:28 +00:00
adelikat 63200b09c8 Win32 - RamWatch - code cleanup 2009-05-08 13:18:38 +00:00
adelikat f085acf680 Win32 - RamWatch and RamSearch update values when Load As is selected 2009-05-08 12:50:43 +00:00
adelikat 871f7b3aee win32 - ramwatch - now updates values on loadstate 2009-05-08 12:43:06 +00:00
zeromus f068dfda3b win32: fix auto ramwatch load getting ignored (and making it always autoload) 2009-05-08 05:32:00 +00:00
zeromus 7c24040c97 fix bug introduced in rev 2092 which made switching 3d renderers crashy. thanks pokefan 2009-05-08 05:24:24 +00:00
adelikat cd564d1a8f Win32 - Ram Search - Watch button hooked up. Also, prompt dialog added to resource file (this could be useful for other generic input as well). 2009-05-08 00:21:49 +00:00
adelikat 9ff5be6f67 Win32 - Added Update_Ram_Search() and Update_Ram_Watch() to loadstate function. However, the values still do not update until the dialog refreshes (such as minimizing and restoring) 2009-05-08 00:09:43 +00:00
yabause edbfe3f066 More endian fixes. Now the first screen with 3D in SPP
displays correctly.
2009-05-07 23:49:03 +00:00
matusz 821141414c gtk-port: make interface elements hideable 2009-05-07 20:17:27 +00:00
adelikat e62fa0e2bb Win32 - Added an accel table for Ram Watch, key combos with shift or ctrl are unfinished since you can't add shift or ctrl with RESEdit. Woo, RESEdit. 2009-05-07 17:19:51 +00:00
adelikat 131a3a989b Win32 - Prevent loading Ram Watch and Ram Search dialog if no rom is loaded. 2009-05-07 17:11:06 +00:00
adelikat 4485db61eb Win32 - RamWatch - main window will load the watch file now 2009-05-07 16:47:53 +00:00
adelikat 2915400b9b Win32 - Ramwatch - autoload now auto-loads the watch file. However, only when opening the dialog manually, not when desmume main does. 2009-05-07 16:41:51 +00:00
adelikat 1f6b5a2f6d Win32 - Ramwatch - Auto-load hooked up to main 2009-05-07 16:32:55 +00:00
adelikat 68c8951648 Win32 - RamWatch - Recent Watch menu now hooked up 2009-05-07 16:17:22 +00:00
matusz 90b14dccfd gtk-port: 'load from' and 'save to' for savestates 2009-05-07 12:05:45 +00:00
zeromus 54350d19b3 maybe id better not check that in with the debug texture dumping enabled 2009-05-07 06:19:23 +00:00
zeromus f6cf1e4ee1 fix bug in 16bpp texturing across vram banks 2009-05-07 06:14:38 +00:00
zeromus 832d168be0 fix a crash in matrix stack handling which was corrupting emulator state 2009-05-07 06:05:43 +00:00
zeromus 1de5957a3e gpu: fix a bug added today which causes the backdrop not to get drawn sometimes 2009-05-07 04:51:54 +00:00
zeromus 23c6438dc0 fix tex coord transform mode 3, which had been entirely broken since rev 1411; this will fix some cases of 3d ortho sprites 2009-05-06 20:50:26 +00:00
zeromus 34ea5aaa5f fix #2787953 (2D windows and colour effects on the backdrop) 2009-05-06 19:57:08 +00:00
zeromus 152a7b132f fix bug where dma length > 128k words was misinterpreted, causing catastrophic failure. 2009-05-06 06:58:40 +00:00
zeromus 300a8b996d win32: fix tile viewer lcdc mode which broke due to changed memory mapping 2009-05-06 04:49:58 +00:00
p989 444c3a0b0a integrate previous with trunk 2009-05-06 04:48:39 +00:00
zeromus 642baafe9d win32: rollback filename parsing patch. it can't handle filenames with spaces. i know that was the point, but it doesnt even work with quoted paths. 2009-05-06 04:13:46 +00:00
riccardom 7c386f0310 Last hunk of ldesnogue patch to make desmume more 64 bit architectures friendly: convert Ceil28_4 to use int instead of long. 2009-05-05 19:00:13 +00:00
zeromus cec7b68614 win32: apply HerrDoktorTuba patch 2787336 for better commandline parsing 2009-05-05 17:45:13 +00:00
zeromus 8057953b1c take out the thing that made vc2008 express not compile 2009-05-05 16:36:38 +00:00
adelikat cb18c55aa2 Win32 - RamWatch Hooked up AskSave() to the main window closing function. However, AskSave() fails to open the message box when called from there. 2009-05-05 16:15:18 +00:00
adelikat a13f65d415 Win32 - RamWatch- saves "Save Window position" bool, and saves window position values in .ini 2009-05-05 16:03:12 +00:00
zeromus 4832522315 a handful of tiny optimizations and important bugfixes in gfx3d savestates. also add a MSC_FORCEINLINE macro for people to use instead when they doing like my FORCEINLINES and are thinking about removing them. at least then we know which ones didnt work on gcc. 2009-05-05 07:30:27 +00:00
zeromus 712b23d512 win32: fix #2785867 (date & timestamp not shown on savestate slot immediately) 2009-05-05 00:02:43 +00:00
zeromus a30cf51c7d import latest from rerecording branch 2009-05-04 23:36:46 +00:00
riccardom fbbe9da5ef Use cast instead of implicit conversion in rasterize.cpp.
Taken from ldesnogue's patch at #2752961.
2009-05-04 19:13:57 +00:00
riccardom 2bf05b75fb Apply GPU.h hunk of ldesnogue's integer type patch at patch #2752961.
Patch modified to use u32 instead of int for pointer math.
2009-05-04 18:09:09 +00:00
zeromus 0ce99ce869 integrate 2087 from rerecording_0_9_2 2009-05-04 07:29:08 +00:00
luigi__ ffb4ea538c Oops... fixed the invisible scrollbars.
By the way I also fixed the French version of the pal viewer which had two auto update checkboxes.
2009-05-03 21:45:10 +00:00
luigi__ cee2f02928 Fixed the "None" and "Clear" menu items of the recent roms menu.
Also there's one half of the new I/O reg viewer. I'm working on the other half :P
2009-05-03 21:39:33 +00:00
luigi__ a71f16f390 Moved the IDM_RESERVED_* identifiers to common.h, like the timer IDs.
Because if they stay in resource.h they'll get wiped out by Resedit. :(
2009-05-03 21:30:31 +00:00
zeromus 0ed4e21eed integrate 2075 from rerecording branch. this touches a lot of file because merges for me always make null changes to a ton of files and i am hoping that by checking it in this once, the problem will go away 2009-05-03 20:55:35 +00:00
yabause 43f7306752 Patch by Evgeni Golov for universal binary generation. 2009-05-03 18:52:00 +00:00
yabause 1e316e7008 Added script to build the dmg for Mac binary distribution. 2009-05-03 18:51:06 +00:00
zeromus dc28399028 maybe one other thing we should do to reset backupmem 2009-05-03 18:39:32 +00:00
zeromus e9708f7595 gah. rollback that sln 2009-05-03 18:12:29 +00:00
zeromus 5263070da5 although the last change probably wouldve worked, this fix solves the real problem: save ram didnt close file pointers when roms reset 2009-05-03 18:10:30 +00:00
p989 2e4026e86d sram clearing fix 2009-05-03 16:26:39 +00:00
yabause 744668e821 Patch by Evgeni Golov to fix compilation problem on
case sensitive OSX.
2009-05-03 11:49:46 +00:00
p989 a843ff2f22 fixed wrong byte order in ram search 2009-05-02 23:19:19 +00:00
zeromus c7bd555cc0 this should fix use of uninitialized pad value 2009-05-02 22:14:05 +00:00
yabause e8c5cffe03 Fixed endianess bugs so now controls are working :) 2009-05-02 21:31:48 +00:00
zeromus 54d6fad245 more fixes to affine scroll handling: fixes nsmb backdrops 2009-05-02 19:58:18 +00:00
zeromus 5317608340 remove 'MOVI' and 'NOMO' 2009-05-02 18:40:42 +00:00
riccardom af8f69ccb9 Make a functin without declaration static. 2009-05-02 18:31:08 +00:00
riccardom 99f5c1dc0a Fixup a printf. 2009-05-02 18:30:27 +00:00
zeromus 0cc0e4739b fix compile errors in movie.cpp 2009-05-02 17:57:06 +00:00
riccardom 4798e034f8 Add proper include file for memset. 2009-05-02 12:22:35 +00:00
riccardom 1366b34d4e ifdef windows specific include, i've used _MSC_VER because it's the same used for MessageBox. 2009-05-02 12:21:24 +00:00
riccardom 90eaff428d Move ifdef at column 0. 2009-05-02 12:03:54 +00:00
zeromus 7bfbd6b887 [2783433] fix 64bit error in savestate writing (thanks martin) 2009-05-02 08:13:42 +00:00
zeromus 6a1ff20e07 improve compatibility even more. i have learned my lesson, all future stuff will be versioned. i thought it was a pain, but listening to people cry about their broken savestates is an even bigger pain. 2009-05-02 08:06:45 +00:00
zeromus 4702c15820 even more improvements to savetate compatibility 2009-05-02 08:02:52 +00:00
zeromus 6b0d234643 fix the most egregious savestate backwards compatibility violation. also remove code which would have prevented non-windows from compiling 2009-05-02 07:31:29 +00:00
zeromus 89d9ebbbd2 didnt need this file 2009-05-02 06:39:45 +00:00
zeromus c52a03f95e integrate stuff from rerecording branch 2009-05-02 06:39:08 +00:00
luigi__ 1719e1eb41 Fixed a bug with 3D layer scrolling where that layer would wrap incorrectly. 2009-05-01 20:56:54 +00:00
yabause ad388e0610 removed some printf code that I forgot to clean up before
commiting... sorry ^^;
2009-05-01 06:34:03 +00:00
zeromus ba719bf431 removed too much debug logging 2009-05-01 04:51:49 +00:00
matusz f8141e77b4 gtk port scaling: allow NEAREST interpolation in addition to BILINEAR 2009-04-30 23:51:37 +00:00
yabause 8a772475f8 Fixed "Rotozoomed 16/16 palette" for big endian systems. 2009-04-30 22:56:51 +00:00
yabause 243f7cd58c Testing if the zzip_read is the old (with char *) or new
(with void *) version. When the old one is detected we
cast the second parameter to char *
2009-04-30 19:31:35 +00:00
riccardom be5cc2152c Move parenthesis before the shift. 2009-04-30 16:51:59 +00:00
matusz 9abd38ff8e gtk port: rotate stylus input when screen rotated 2009-04-30 15:15:50 +00:00
yabause d67d0b7714 Fix for big endian systems. 2009-04-29 20:19:43 +00:00
matusz e6ad57be22 gtk port: screen rotation, WIP:
no stylus rotation, 
  slower conversion from nds to rgb format
minor changes:
  remove useless alias for drawing area
  rearrange actions table to make it easier to spot hot-key conflicts
2009-04-29 14:34:52 +00:00
yabause 3dd9e0a27c Removed the errors when gtk is not found, so now you
can build cli port only.
Added an error when zlib is not found as compilation
fails if it's not here.
2009-04-28 23:32:15 +00:00
yabause 3348cdf6e2 Added some empty default case in switches to keep gcc happy. 2009-04-28 20:57:20 +00:00
yabause 01cbda9a1c Rewrote some commented parts with #if 0 instead of /*
to avoid nested comments. (didn't remove those commented
parts as I'm not sure why they were left here.)
2009-04-28 20:32:47 +00:00
yabause 3dd0ee91d0 Removed the frame limiter code based on SDL semaphore that
was commented and unused.
2009-04-28 19:48:48 +00:00
yabause a6f99da9cf Removed -Wswitch-enum from --enable-hardcore.
-Wall already turn on -Wswitch that reports missing
enum in a switch case. The only difference is that
-Wswitch-enum report them even if there's a default
case. I don't think we want to handle each 322 cases
of the SDLkey enum :)
2009-04-28 19:25:04 +00:00
matusz 81743d139c ChangeLog: screen resize in gtk 2009-04-28 11:08:05 +00:00
matusz cca48b9a34 set svn:eol-style to native for Changelog 2009-04-28 11:06:35 +00:00
matusz 75e749ecf9 move 'FORCEINLINE mmu_gpu_map()' to MMU.h, because gcc does not like it in .cpp 2009-04-28 10:49:41 +00:00
zeromus b8aea4ffaa revert sln file 2009-04-28 06:07:56 +00:00
zeromus b2764f5bc3 fix an issue in vram mapping which let junk get written on the screen via LCDC. also fix a bug which was causing affine layer positions not to get written to savestates. this change will possibly BREAK YOUR SAVESTATES, but there are more changes coming which will break it anyway. Ill try and add a pass of robustification to the savestates before the next release. 2009-04-28 06:05:41 +00:00
zeromus 69dabb3c02 more fixes to vram mapping. this time, for one particular test case, gpu accesses to unmapped memory return 0 like it is supposed to. I will wait for more test cases before I change it in other places. 2009-04-28 03:30:50 +00:00
zeromus 7b1af20be4 gfx3d: fix condition where matrices could be read/write out of bounds of the matrix stack, clobbering some other variable in the emulator 2009-04-27 21:08:17 +00:00
zeromus 28b1fcdcd6 remove that @&#@#ing assert from wifi which was the dumbest thing i ever did 2009-04-27 06:27:15 +00:00
zeromus f65e0e223c fix rectangular window handling for 32bit reg writes; was caused by my own unparenthesized (macro_parameters) 2009-04-27 04:48:33 +00:00
zeromus 686c52b34c fix the large screen 512KByte 8bpp bitmap BG mode which was entirely broken. along the way, fix up some affine layers which were rendering at the wrong size and thus distorted and with garbage 2009-04-27 04:08:43 +00:00
yabause 01daf40120 Fixed hyphens in man pages. Thanks debian games team :) 2009-04-26 18:32:12 +00:00
riccardom 1e598f014c Do less work in gtkFloatExposeEvent(), this gives me 6 more fps on a static background. The heap to stack conversion helps for less than 1 fps though. 2009-04-26 13:55:29 +00:00
mtabachenko 822552b138 winport:
- fixed toggle on/off for Action Replay (double click in list)
2009-04-26 12:58:21 +00:00
mtabachenko cc0c3c4e26 cheats: small fix in AR loop code 2009-04-26 11:31:33 +00:00
mtabachenko ff59371827 - added full Action Replay code parser; (hooks not need...?) 2009-04-26 11:26:20 +00:00
yabause 7704d2fd80 it seems osmesa depends on GL and we need to add -lGL
so compilation works with --as-needed
2009-04-26 06:46:31 +00:00
zeromus ada2d9ce12 nothing came out of this hour of debugging but fixing a lame typo in a variable name so by golly i will check in a fix for it 2009-04-26 06:36:11 +00:00
zeromus 3708a80b54 more fixes to bg affine parameter handling. I am becoming increasingly dissatisfied with the way this is handled, but we need to collect more test cases. this actually reverts the changes from rev 2010 and fixes it a better way (by adding support for 16bit affine parameter startpoint writes) 2009-04-26 05:30:48 +00:00
gecko_reverse 18b3701693 updated out of date version number in cocoa ports plist file 2009-04-26 05:25:44 +00:00
zeromus 4f887b912d fix bug in display capture source mode B = VRAM setting which made it just capture garbage 2009-04-26 03:30:51 +00:00
zeromus 594b1316a6 fix master brightness logic for parameters which are outside of the reasonable range. Fixes insane color warping during fades. 2009-04-26 02:48:49 +00:00
zeromus 5f2c541ada fix affine BG scroll starting points. fixes totally whack affine layer positioning 2009-04-25 23:47:55 +00:00
matusz 41dc477e74 gtk port: resize screen first attempt - very slow 2009-04-25 23:19:13 +00:00
zeromus f1ea9cca7a win32: fix compiling in release builds 2009-04-25 22:50:35 +00:00
zeromus d988ba6192 fix major issue with poly sorting. this fixes 3d user interface elements being invisible 2009-04-25 22:35:43 +00:00
zeromus 78f07fd7aa fix the only memory leak that wasnt a false alarm, or gnu something, or sdl something. 2009-04-25 19:42:05 +00:00
zeromus 9987bd13f8 accidentally checked in a hack the other day 2009-04-25 19:24:58 +00:00
riccardom f464846c3c Remember to zero current_reg on close. Should fix #2781065 and hopefully
doesn't break anything.
2009-04-25 16:17:12 +00:00
riccardom f6cde624f4 Spring cleanup for firmware support, put all the stuff under proper ifdef and
clean it up to make it compile. I don't have a firmware bin so the only test
i've done is to load a random text file instead and see desmume not crashing.
If someone is interested into this feature it has a bit more decent base
to start from.
2009-04-25 13:44:35 +00:00
riccardom 4c446543b4 Looks this modulo in savestate labels is a leftover. 2009-04-25 10:26:17 +00:00
riccardom 94c9f45b88 Remove this Close() function that has been disabled since a long time. 2009-04-25 10:22:49 +00:00
riccardom 61e4c0bddc Poor man's mic fake implementation, don't expect it to be similar to a blow it's just noise or not. 2009-04-25 10:21:10 +00:00
riccardom c89f3a86bd Rework EmuLoop to save one level of indentation. 2009-04-24 17:14:20 +00:00
riccardom 3b7a0e79b5 Whitespace cleanup in Emuloop. 2009-04-24 17:09:00 +00:00
riccardom e678242556 Add some 0.9.3 entries. 2009-04-24 05:47:11 +00:00
riccardom a413a17260 Remove some stuff that was used only with gtkglext. 2009-04-23 20:50:59 +00:00
riccardom f6c5dce881 Whitespace cleanup in gtk_common_main 2009-04-23 20:34:27 +00:00
riccardom 05d9c1b169 Cleanup includes ifdefs. 2009-04-23 20:24:51 +00:00
riccardom 651ed760b7 Remove the gtkglext support from gtk frontend. 2009-04-23 20:15:37 +00:00
riccardom 571af5c2d7 Rename the local variable to not shadow the global ui_description. 2009-04-23 18:01:04 +00:00
zeromus 39d123cbfc [2777429] (missing 3d art) fixed: recent regression causing 16bpp textures to be transparent on softrasterizer 2009-04-23 06:22:01 +00:00
zeromus d3de70b80d win32: apply hicoder's patch to display timestamps in savestate menu 2009-04-23 03:58:44 +00:00
matusz 57feffc70d gtk port: add a FIXME 2009-04-23 01:06:36 +00:00
matusz 76885cefc2 gtk port: remove unused array, use better mask for input keys 2009-04-23 01:02:08 +00:00
matusz f422c236d3 gtk port: switch all of menu/toolbar system to GtkAction + GtkUIManager 2009-04-23 00:55:49 +00:00
riccardom b7d4a8b352 This file is generated by ./autogen.sh so remove it from svn. 2009-04-21 18:17:28 +00:00
matusz 1849ac85d1 change 2 NOSSEs to NOSSE2s
remove 'static' from alpha_lookup
2009-04-21 08:43:33 +00:00
zeromus df48d9a889 a bunch of small performance optimizations in the 3d engines, gains a couple of fps over the current trunk. still a little slower than 0.9.2 though, I am not sure why. 2009-04-21 04:13:47 +00:00
zeromus e30b3fea70 test of dumping the faq as html 2009-04-20 18:11:37 +00:00
zeromus b4ec5d6748 test of pasting wiki contents for readme.win 2009-04-20 18:07:38 +00:00
yabause 153cb5e386 french -> english 2009-04-20 14:05:54 +00:00
matusz 7704899055 glade port: hide layers selector by default 2009-04-20 13:43:05 +00:00
yabause 48a3dc398a french -> english 2009-04-20 13:29:06 +00:00
zeromus 5f22118a6f tiny softrasterizer speedups: change texcache to produce different pixel formats depending on 3d renderer, and optimize getline 2009-04-20 05:31:04 +00:00
zeromus 5abdb2faed win32: [2761959] fixed: 3d options dont stick in other UI languages; also get rid of some dual 3d console spam i accidentally left turned on 2009-04-19 18:44:56 +00:00
zeromus 7a266f75b2 an uncertain change: permit geometry commands after swapbuffers, up until vblank: this will fix some 3d games that rely on very picky timing, including some dual 3d games. but keep an eye open for totally destroyed 3d games and modes 2009-04-19 08:49:22 +00:00
zeromus 7180336b20 win32: fixed: [2773492] When turning "Limit framerate" on or off the screen separation resets to none. 2009-04-19 05:58:32 +00:00
zeromus 823b57c6db win32: try to fix language selection. works in xp; need to verify in vista 2009-04-18 23:32:14 +00:00
zeromus 6a03c7ff09 [2750702] fixed: shift key is sticky in hotkeys, making you save sometimes when you meant to load 2009-04-18 21:25:41 +00:00
zeromus a05659a208 change NOSSE2 conditional compilation. hope it still works for gcc guys 2009-04-18 21:14:16 +00:00
mtabachenko d4afa548de again :( , typo fix 2009-04-18 20:32:57 +00:00
mtabachenko 6b82719eb0 typo fix :( 2009-04-18 20:29:00 +00:00
mtabachenko 438800961e AR: implemented some codes and fixed early my commit 2009-04-18 20:01:26 +00:00
riccardom ea58962012 Use of macro that can be a nop inside a conditional should be protected by braces otherwise a kitten will get hurt! 2009-04-18 19:28:59 +00:00
mtabachenko 9304d34bf8 added parser for comma when load cheats; 2009-04-18 17:41:14 +00:00
mtabachenko 7fd9817cdb fixed bug #2772570 (CheatSystem: Address size reverting after search restart) 2009-04-18 16:50:21 +00:00
mtabachenko 19d5e1c354 cheats:
- added some Action Replay codes processing;
2009-04-18 16:12:25 +00:00
riccardom e3d3b1407f Make a couple of functions static and shut up a signed vs unsigned warning in cheatSystem.cpp. 2009-04-18 13:44:31 +00:00
matusz f01283e4af glade port: rename 'ouvrir' elements to 'open' 2009-04-18 13:33:15 +00:00
mtabachenko 654952bcf8 winport:
- it is now possible to add Action Replay to the cheats (THIS IS ONLY ADD TO CHEATS and NOT EXECUTE AR CODE)
2009-04-18 12:46:24 +00:00
matusz e585142003 gtk port: quit on unsupported savetype in command line option 2009-04-17 18:27:41 +00:00
matusz ee53e4c03a glade port: correction to savetype option and menu 2009-04-17 18:23:15 +00:00
matusz 0e94d6ee51 better ignore of NOSSE2 on linux per xrmx advice 2009-04-17 17:18:46 +00:00
matusz 6889b87605 adding FASTCALLs to make function definitions consistent with structs 2009-04-17 14:54:25 +00:00
matusz 151ebfc21f define NOSSE2 globally until somebody finds a better way 2009-04-17 14:51:40 +00:00
mtabachenko 2684c683a8 cheats:
- fixed search lists (and 3 byte size work correct now);
- fixed search after load savestate;
(will next step - add Action Replay parser)
2009-04-17 11:13:59 +00:00
zeromus df99182300 reorganize a bit of mmu code to displease me less and make a couple of minuscule optimizations 2009-04-17 05:13:11 +00:00
zeromus da9cfbe200 win32: continue to overhaul vs project organization. You will need to delete your sln files as I am now checking these in. Additionally, every build is now SSE2. If you want a non-sse2 build you better define NOSSE2 and turn off the codegen option. 2009-04-17 02:32:43 +00:00
luigi__ b831e49635 Remved an unused variable. 2009-04-16 20:46:35 +00:00
riccardom 0e48ce4d99 Removed unused variable. 2009-04-16 18:31:42 +00:00
riccardom 8ecd2ee393 Put braces around a possible nop. 2009-04-16 18:27:16 +00:00
matusz 2c154a932a glade port: add save-type commandline option and synch it with menu; change one sprintf to snprintf 2009-04-16 17:21:56 +00:00
matusz 751825a009 gtk port: saveslot/loadslot submenus in 'File' menu 2009-04-16 10:50:28 +00:00
zeromus 62334ef6c0 win32: add a configuration system. remove excess build configurations, which were getting hard to manage. to configure your build (such as to enable SSE2), check out the example in the defaultconfig directory. this is a bit strange. please evaluate it. 2009-04-16 08:43:57 +00:00
zeromus 563c4c5a45 win32 revert resource changes! 2009-04-16 04:37:15 +00:00
adelikat 6365619445 Added a record to dialog to the res 2009-04-16 03:47:47 +00:00
riccardom 25e07dfc79 Fix a few signed vs unsigned int comparison warnings. 2009-04-14 19:26:02 +00:00
riccardom 6e6e97c551 Remove unused var. 2009-04-14 19:09:25 +00:00
zeromus eeed006c67 2009-04-14 18:45:23 +00:00
zeromus 7e31cf4dab mmu: fix windows compile error. ERROR enum value wasnt necessary at all 2009-04-14 18:34:10 +00:00
riccardom 813a3bbbff This patch tries to fixup typedef defined in types.h in order to help x86-64 people:
- convert [us]32 to be unsigned /signed  int on both 32 and 64 bit platforms like is uint32_t in stdint.h.
- remove pointer typedef, likely cause of 32 bit / 64 bit issues but currently not used.

Please be patient if something is broken :)
2009-04-14 16:30:16 +00:00
riccardom 1704c79067 Make MovieTime static, while at it cleanup the ifdef. 2009-04-14 16:13:34 +00:00
riccardom 878bd69a0e ok, this really wants to be declared to be an ull (sorry 64 bit guys). 2009-04-14 15:57:57 +00:00
riccardom 6ce60f84e6 gcc does not like this function to be inlined 2009-04-14 15:50:18 +00:00
riccardom c24884c363 Add missing member of enum. 2009-04-14 15:19:33 +00:00
luigi__ 298b9fbabb Slight code reorganization and better handling of scrollbar and mem editing. 2009-04-14 10:15:11 +00:00
zeromus 0e88f49326 fix another bmp sprite issue and add some mmu diagnostics 2009-04-14 08:35:00 +00:00
zeromus 47ab70f48e fix some bitmap objs. many more types are still broken. 2009-04-14 06:47:57 +00:00
zeromus 08ae197fed win32: fix missing tool window scrollbars again. now i KNOW it must be resedit's fault 2009-04-14 06:42:47 +00:00
zeromus b54baa86c6 eliminate emulator crashes and freakouts when rendering some totally messed up 3d stuff. is this masking a deeper issue? quite possibly, but the checks need to be done anyway. 2009-04-14 05:35:49 +00:00
zeromus 1a5944f90c fix some bugs in new vram mapper 2009-04-14 02:05:55 +00:00
luigi__ 5debaa0857 Added ability to edit memory through the mem viewers.
Basically, it works like an hex editor, ie you click on the value you want to
edit, then you enter the new value, which is applied only once it has been
entirely entered.
Warning! it may have bugs. If you find any, tell me.
2009-04-14 00:18:43 +00:00
adelikat 96113b7ee4 Win32 - Partial implementation of function to display hotkey mappings on corresponding menu items 2009-04-13 19:04:24 +00:00
adelikat 2863925859 Win32 - Minor cosmetic fix to Cheat search dialog 2009-04-13 15:01:39 +00:00
adelikat 150dbbbdaf Win32 - Moved checked menu item code for Frameskip to ENTERMENULOOP 2009-04-13 14:59:23 +00:00
adelikat d9f5a46a6a Win32 - Gray out recent ROM menu item if there are no recent ROMs 2009-04-13 14:51:07 +00:00
adelikat 5029f2058c Win32 - Removed the accel table from main since we have a remappable hotkey system in place instead. 2009-04-13 14:46:41 +00:00
adelikat caf463b302 Win32 - Added Clear sound menu item to Danish & French Menus. Removed Ctrl+O from Open ROM menu item name. 2009-04-13 14:41:23 +00:00
p989 187d9a8dbc simple clock for movie recording 2009-04-13 06:55:29 +00:00
adelikat 97789af476 Added Open ROM Hotkey, Removed Ctrl+O accel key. 2009-04-13 04:56:51 +00:00
adelikat f054fc3da6 Win32 - Code cleanup - removed a lot of redundant menuchecked and enablemenuitem code. Moved it all to ENTERMENULOOP 2009-04-13 04:45:38 +00:00
adelikat fc8f4f694f Win32 - Added all gray/enabled & check/unchecked code to the ENTERMENULOOP case. Changed Shut Up to Clear Sound 2009-04-13 04:18:45 +00:00
adelikat 6aa80c44cf Win32 - AVI Capture - added started/ended messages to the screen. 2009-04-12 22:15:08 +00:00
adelikat d8601e00a3 Win32 - Record AVI and Stop AVI menu items enabled/grayed based on whether an AVI is recording or not. 2009-04-12 21:30:03 +00:00
adelikat f1e58b3c92 Win32 - Added Record AVI and Stop avi hotkeys. Minor change to AVI menu items. 2009-04-12 21:10:51 +00:00
adelikat 2474633f79 Win32 - Added Reset hotkey. Changed Printscreen to Save Screen Shot As to match the equivlant menu item. Changed screenshot default key to F12 which is the more standard screenshot hotkey 2009-04-12 20:42:50 +00:00
adelikat 6e3963d1ca Added Hotkeys for Display FPS, Input, and Frame Counter 2009-04-12 19:31:52 +00:00
adelikat 274d8178aa Win - Added Lag Counter Display Toggle Hotkey 2009-04-12 18:50:54 +00:00
zeromus d608b190dd fix mario kart boot regression by readding support for arm7 shared vram banks. it still has some bg mapping issues, but it shares that in common with many games right now 2009-04-12 09:45:09 +00:00
zeromus 4269612bb4 better change the version number in the trunk to keep folks from releasing post 0.9.2 svn builds with 0.9.2 version tags (probably has already happened) 2009-04-12 08:46:36 +00:00
luigi__ 85ca9b12e3 Fixed the mini tile box. It still refreshes the whole screen when clicking a tile. But anyway all that shit will be remade someday. 2009-04-12 00:01:12 +00:00
luigi__ 9fa2003bc5 The display capture EVA/EVB factors are now clamped to 16. This avoids corrupted colors when the game sets these factors to values over 16. 2009-04-11 22:07:32 +00:00
yabause a2c33d0d35 Added italian translation 2009-04-11 20:49:48 +00:00
riccardom 8b13beb5ee This trick let desmume be compiled against osmesa 7.4, thanks Guillame. 2009-04-11 19:54:40 +00:00
riccardom c292d7d9e3 signed long to s32 conversion based on the patch posted by ldesnogu in #2752961. 2009-04-11 17:20:19 +00:00
riccardom 0854f57647 Apply ldesnogu signed long -> s32 conversion to help x86-64 from #2752961 2009-04-11 17:14:19 +00:00
riccardom 17fa00685f Make SetTurbo static. 2009-04-11 16:48:02 +00:00
riccardom b99da6e496 Update gfx3d.h function declaration to match the definition, this is a subset of ldesnogu patch from #2752961. 2009-04-11 16:47:16 +00:00
riccardom a81bd98c7a Remove unused label. 2009-04-11 16:02:41 +00:00
luigi__ dd0d05928d Oops... fixed a stupid bug with MMU_DumpMemBlock. Both mem viewers would show ARM7 memory. I'm stupid sometimes... 2009-04-11 15:51:28 +00:00
riccardom ba4a4b1915 Use u32 instead of unsigned long since that's the type of the data that is passed to armcp15_setSingleRegionAccess(). 2009-04-11 15:28:12 +00:00
matusz 88303c627d glade port: disable code initializing removed fields in ARM9Mem
this is a hack to make it compile, since tileview wasn't working anyway
2009-04-11 15:27:48 +00:00
riccardom 804bf0bfcf Change cast of cflash_read from unsigned long to u32 since it's what _MMU_ARM9_read32 is supposed to return. 2009-04-11 15:14:18 +00:00
riccardom 75843be9c4 Add explicit cast in FetchADPCMData() as in patch from #2752961. 2009-04-11 15:09:09 +00:00
riccardom 37b44bfb60 Apply gtk frontend hunk of explicit type conversion patch posted
by ldesnogu_ in #2752961.
2009-04-11 14:57:41 +00:00
riccardom dc9fd91bf6 Use CLAMP in Stylus_Press too, need a bigger screen :) 2009-04-11 14:44:57 +00:00
riccardom 80ebb0dcd5 Use CLAMP from glib in Stylus_Move. 2009-04-11 14:42:15 +00:00
riccardom 30c0e56fc9 Whitespace cleanup Stylus_Move, no functional changes. 2009-04-11 14:40:36 +00:00
riccardom 95a80303b5 Remove unuseful debug line from layers code, this fix #2750334 which reports
a crash in that line caused by the conversion from string to an enum of the
layers.
2009-04-11 14:12:48 +00:00
luigi__ 167386847d Big tool remake started. New memory viewer.
Here are the main differences with the old one:
- threading/timer system dropped; the viewers refresh every 10 frames
- same dialog template and procedure shared for both viewers, like before
- no trouble jumping over 0x0FFFFFFF; all addresses supported
- correct interpretation of the address entered
- scrollbar working correctly
- two view dump functions: Text dump will dump the current view into a text file, in an human-readable form; Raw dump will copy the current view to a binary file that can be opened with an hex editor
- the viewers use MMU_DumpMemBlock to read memory; this is better than the MMU_readX functions as it doesn't risk affecting the emulation; but that func isn't suitable for the I/O register region, as some registers aren't written to MMU.MMU_MEM.
2009-04-11 14:09:16 +00:00
zeromus c95bc1c458 fix a probably broken linux build 2009-04-11 09:09:06 +00:00
zeromus 30502706ee totally rewrite vram mapping. a few of your savestates might be ugly until you reload a level or somesuch. this fixes drill spirits and kirby. some regressions are to be expected, please let me know when you see them 2009-04-11 09:00:56 +00:00
zeromus 45661199e6 hey pa__ dont use ARRAYSIZE, use ARRAY_SIZE instead. 2009-04-11 08:54:26 +00:00
p989 ed3393987f win32: fixed an input display related merging mistake 2009-04-11 01:08:03 +00:00
p989 5382dab908 win32: moved turbo keys to their own hotkey page 2009-04-10 23:41:05 +00:00
p989 dd60bc24a3 win32: microphone hotkey, sample loader, and display 2009-04-10 23:01:53 +00:00
zeromus 07e090c224 prevent totally out of bounds card accesses from crashing emulator by masking to rom size 2009-04-10 22:38:29 +00:00
zeromus a48b1a725d change gpu to use only one function for 1D and 2D sprite rendering. this makes it easier to debug and tweak, since they were 95% similar already. also fix a bunch of bugs in the win32 oam viewer. 2009-04-10 20:59:44 +00:00
p989 9821e2342f win32: hud editor 2009-04-10 18:40:09 +00:00
zeromus a165e5b1c3 win32: fix scroll bars in tool dialogs. somehow they all became invisible. i blame resedit 2009-04-10 17:20:59 +00:00
p989 dc9b05137e win32: autofire, autohold, input display fix 2009-04-10 17:07:54 +00:00
p989 3d95e1061a win32: png file support 2009-04-10 16:24:04 +00:00
zeromus 031dde96d2 add authors 2009-04-09 19:30:00 +00:00
luigi__ 6feb15dd11 Fixed a few details. 2009-04-09 17:59:42 +00:00
zeromus eedca01baa update changelog, and make every build a DEV+ build. we won't use the distinction after all for 0.9.2 2009-04-09 05:19:16 +00:00
yabause de49480ef5 Added some missing files to distribution 2009-04-08 22:19:07 +00:00
zeromus 0ab5605002 win32: fix typo in error message and change the default frameskip options to 0, limit (desmume classic style) which people seem to like more 2009-04-08 18:52:55 +00:00
zeromus 210de746fb win32: fix yet another vs2005 build type that got broken. add a warning to wifi dialog that it doesnt actually work. fix wpcap.dll detection 2009-04-08 18:07:53 +00:00
riccardom 9b96d80ecc Cleanup whitespace in MMU_DeInit() 2009-04-08 09:57:51 +00:00
matusz 9cd29c65bf open memory-card-file for writing when savetype is not AUTODETECT 2009-04-08 09:32:39 +00:00
zeromus 4b2ae3ad5e not sure how these vs2005 build types got messed up 2009-04-08 08:09:04 +00:00
riccardom d5858ba555 Make a couple of functions static. 2009-04-08 08:07:54 +00:00
zeromus ba967c8fda win32: clean up experimental wifi building to work in fastcall and run correctly without winpcap.dll etc on all build types in vs2005 and vs2008 2009-04-08 08:01:47 +00:00
zeromus c83531b12c win32: prevent wifi configuration from running when winpcap couldnt initialize 2009-04-08 07:06:54 +00:00
zeromus 12c709885b fix [2705723] 4mb flash savetype is broken. 2009-04-08 06:18:20 +00:00
zeromus c2ddd1f83e major fixes to viewport handling which didn't work at all before since it was not executed per poly (closes out SF [1701567]). now advance wars battle scenes work 2009-04-08 05:17:36 +00:00
zeromus 1da5cc74ef win32: vs2005: fix building of release and interim non-sse (forgot include directories) 2009-04-08 04:30:20 +00:00
zeromus 475b4a77b2 win32: recent roms bugs: [2595745] [2598258] 2009-04-08 04:27:46 +00:00
yabause 907851c822 Some changes to fix "make dist" 2009-04-07 21:05:20 +00:00
luigi__ 94717c5785 And finally removed all the GDI+ include files. GDI+ shit is now gone for good.
BTW, it is better for us to remove them. Zeromus told me we aren't supposed to redistribute them. (I hate Microsoft more and more)
2009-04-07 19:18:32 +00:00
luigi__ 57d64f5bca Remeber what I did with the VS2005 project file? Did the exact same thing with the Intel one. 2009-04-07 19:15:29 +00:00
luigi__ ac933b2cfd Attempted to take out GDI+ shit using the Notepad. Tell me if the project breaks (normally shouldn't) or if some GDI+ shit remains, I'll take care of it. 2009-04-07 19:00:17 +00:00
luigi__ 1db8af1adb Taken out the GDI+ inclusions (todo: do so with the VS2005 project as the gdiplus folder will be removed at the next commit from me). 2009-04-07 18:56:35 +00:00
luigi__ a5e2102033 Removed GDI+ initialization.
GDI+ shit can be taken out of the project as we'll stick to GDI which is faster.
2009-04-07 18:53:42 +00:00
luigi__ 4b7b652f47 Hacky fix for the crash of the IO reg view tool.
Reason of the crash: a WM_COMMAND message was being sent for IDC_AUTO_UPDATE_SECS before the WM_INITDIALOG message was sent. I can't figure out why.
2009-04-07 16:37:01 +00:00
zeromus 97ac62d69f novice mistake: dont crash when loading a gbagame with no sram 2009-04-07 15:59:43 +00:00
matusz c62fe23941 gtk port: add --save-type command line option
and sync it with save-type menu
and update gtk port's manpage
2009-04-07 12:59:04 +00:00
zeromus ab0af7fa7e add sram support to gbagame addon 2009-04-07 08:35:06 +00:00
sigmaris bb1e85a546 Integrated GDB stub to Mac version and added a target to the XCode project to build with GDB stub enabled 2009-04-07 03:19:09 +00:00
adelikat 55676e4bb7 Fix bug in HK_StateSetSlot() 2009-04-06 23:51:28 +00:00
matusz 30ef5275d9 all .cpp .h files: convert to uniform EOLs and set svn:eol-style to native 2009-04-06 19:52:10 +00:00
matusz cdef916569 unify eols in saves.cpp and saves.h
setting svn:eol-style to native for saves.cpp and saves.h
2009-04-06 16:42:02 +00:00
normmatt234 568682a3f0 typo in comment 2009-04-05 22:51:22 +00:00
normmatt234 df915330e7 Fix card reads below 0x8000 2009-04-05 22:50:03 +00:00
luigi__ 64a4300ba2 Changed the buffer type to u8 as the data returned by WinMM is unsigned.
Added a double buffer system which reduces crackling noticeably.
2009-04-05 12:30:43 +00:00
riccardom 7b0bddf64b Comment a variable that has its users already commented. 2009-04-05 12:16:04 +00:00
riccardom f7d7b5242c Comment a variable with its users already commented. 2009-04-05 12:13:28 +00:00
riccardom 2d0be6346c Made a couple of functions static. 2009-04-05 12:11:26 +00:00
luigi__ 1230a55a4b Removed the EXPERIMENTAL_WIFI define from the Interim SSE2 configuration, so it should now compile. 2009-04-05 07:24:24 +00:00
luigi__ 7a5ac180de Yeah, I know, skipping 3D frames is nice with the soft rasterizer, but we can't do it until somebody figures out why the 2D/3D synchronization problem happens when doing it. It's so sad :( 2009-04-05 00:03:51 +00:00
p989 1f1507b9ef win32: fast forward now has separate active and toggle hotkeys 2009-04-04 21:23:01 +00:00
p989 51c37da018 win32: lag frame menu typo 2009-04-04 00:10:35 +00:00
p989 ae9cad072c win32: debugging windows update in frames, 1 frame default 2009-04-03 23:54:05 +00:00
luigi__ d3bf30c646 Add a langs folder meant to contain .mo files for all the translations, as well as some stuff useful to compile them (though my fr_FR.mo was built by Poedit). 2009-04-03 22:00:48 +00:00
luigi__ 4cb195abf8 Added a French translation of the menu. 2009-04-03 21:55:06 +00:00
luigi__ 3163f756b5 Added a base .po file containing everything needed to translate the Windows menu with gettext.
This is testing, it's why I first just translate the menu. If it's not a total pain, I'll translate everything else with gettext.
2009-04-03 21:39:36 +00:00
zeromus b231f48093 change the 3d frameskipping method to take advantage of the rendering deferral system which was already there. now, whenever a 3d frame is requested, and it isnt rendered due to having been skipped, it has the capability to render itsself. This should resolve any issues like ideas frameskip synchronization -- let me know. 2009-04-03 18:46:01 +00:00
luigi__ a077ddf472 The window refreshing handling when sizing/moving and/or emu paused is less hacky now.
Also fixed a slight bug with the "pause emu when main window minimized" thing: now it won't unpause the emu if it was manually paused before being minimized.
2009-04-03 17:42:35 +00:00
Luigi__ 748127d658 The frameskip now also makes the 3D soft rasterizer skip frames. But it causes a problem that appears in iDeaS: 3D and 2D aren't synchronized when using frameskip. Feel free to revert it if that problem is annoying for you. 2009-04-03 12:33:10 +00:00
Luigi__ b8a2915c26 More efficient frameskip by using NDS_SkipFrame(). Also tried to fix the framerate limiter (maybe we should just revert to the semaphore system and try to make it more precise?). 2009-04-03 12:19:10 +00:00
matusz c3ee047c7e glade: notify user about lack of 3D (failed NDS_3D_ChangeCore) 2009-04-03 08:01:35 +00:00
matusz 21f8b3fbcf update manpages for cli, gtk, glade ports 2009-04-03 01:03:42 +00:00
matusz c60ce7faa1 synchronize default emu keys to the windows version 2009-04-03 00:28:52 +00:00
matusz 99fa5a3c76 glade: stop emu keys from blocking gui keys 2009-04-02 23:31:02 +00:00
zeromus 430a6064b7 change lag counter to be cumulative instead of instantaneous. also fix some file line endings 2009-04-02 22:48:32 +00:00
zeromus e1f77790cc tweaks to lag frame 2009-04-02 22:27:06 +00:00
p989 fd09b81b07 win32: lag counter 2009-04-02 22:05:51 +00:00
Luigi__ 4d6ac95a44 Inlined desmume_cycle() and desmume_running() for speed. 2009-04-02 20:25:45 +00:00
zeromus 8009863daa see if this fixes the build in non-windows 2009-04-02 18:37:21 +00:00
zeromus 8c7c89f036 oops i failed to checkin everything 2009-04-02 17:01:17 +00:00
zeromus cf92e9fcd6 win32: integrate patch: add fast forward, target framerate control (other than 60), and input display 2009-04-02 16:59:57 +00:00
zeromus 85803255c3 rasterize: change polyid clearing method. it was a guess before, and now it is still a guess but it fixes a game 2009-04-02 08:28:06 +00:00
zeromus a039a35122 win32: fix small directdraw display bug which looked like a glitch inbetween screens sometimes with non-integer window scalings 2009-04-02 07:37:32 +00:00
zeromus 32ca5e236e rasterize: fix new bug with captured 3d 2009-04-02 07:03:41 +00:00
zeromus 21e027bfa1 rasterize: fix the most serious issues with texturing. i would now call the rasterizer useable. 2009-04-02 06:59:31 +00:00
Luigi__ 36a45e8cfc More precise and stable FPS limiter, not using the SDL semaphore system.
Also removed the "3D operation detected" dialog which is useless.
2009-04-01 19:40:39 +00:00
Luigi__ 56f013a04c Dummy commit for the sake of testing if kdesvn works. Please ignore this. 2009-04-01 16:17:37 +00:00
matusz 2baeab260d cli port: savetype commandline option 2009-04-01 00:20:32 +00:00
zeromus 80296899f2 add a "shut up" feature which kills all the active voices without otherwise interrupting the spu. handy for shutting up streaming sounds. hook it up in windows. 2009-03-31 22:11:00 +00:00
matusz d1ccf402ad gtk port: make keypad allow menu/toolbar accel keys to work too
also: translate some french comments and remove some other
also: silence 2 glade warnings
2009-03-31 21:40:37 +00:00
zeromus 7f0616d4ba fix some vs2008 builds 2009-03-30 19:01:39 +00:00
matusz be311cbd44 glade port: allow 3d renderer command line selection when no GTKGLEXT 2009-03-30 12:26:39 +00:00
zeromus 928cf15312 convert file to ascii 2009-03-29 22:17:30 +00:00
zeromus d515af0367 fix windows builds so that they can run without winpcap.dll being installed. this causes the initialization of softAP to be conditional. also add an assert where luigi needs to decide on a return value. also add an extensible driver system so that new platform-specific calls can be made from the core emulator without breaking all the other ports. look in windows port for an example of how to extend it. feel free to criticize the architecture before we get too stuck on it. 2009-03-29 21:38:06 +00:00
matusz f10f44b0ac glade port: reenable gtkglext 3d rendering 2009-03-29 19:12:08 +00:00
matusz 1fb75500a0 add rasterizer to gtk-glade, make it default renderer for cli,gtk,glade 2009-03-29 17:51:26 +00:00
matusz 443c3529d3 gtk-glade: split Saves menu into File and Config submenus 2009-03-29 12:22:59 +00:00
luigi__ 772d30531e New game info dialog. 2009-03-28 23:59:36 +00:00
matusz 6260a74e6d gtk-glade port: load savegame from command line 2009-03-28 13:40:00 +00:00
zeromus 64dd5ac5ef fix crash in wifi 2009-03-27 20:34:49 +00:00
matusz 2412eefa6f gtk-port: kbd save/load ; make controls additive
one can load (f1-f10) and save (shift+f1-f10) from keyboard while playing
corrected a bug that made controls pressed together not work

changed ISO8859-1 in fr.po to ISO-8859-1
2009-03-27 19:46:44 +00:00
luigi__ f588bcf10e Added more wifi emulation. Some fixes, and support for two new types of management frames, as well as support for sending data frames. 2009-03-27 16:12:07 +00:00
matusz f2918281a3 gtk-port: command line option to load savegame 2009-03-27 13:32:04 +00:00
matusz a6c84b7078 gtk-port: add software rasterizer
gtk-port changes:
adding software rasterizer to the gtk port
adding option to select 3d renderer (null by default)

configure.ac: make osmesa enabling macro a bit more explicit
2009-03-27 12:50:47 +00:00
zeromus 8910583330 more graceful wifi compiling in vs2005 2009-03-26 23:00:40 +00:00
luigi__ 3b866964db Added code for the Wifi settings dialog. 2009-03-26 22:38:45 +00:00
zeromus 23a4437641 fixes for compiling new pcap stuff 2009-03-26 22:17:24 +00:00
luigi__ 447aa2e144 Added the winpcap lib to the link options.
Also, I added the EXPERIMENTAL_WIFI define, and the _WINSOCKAPI_ define which is required to get the Wifi core to compile.
2009-03-26 22:04:56 +00:00
luigi__ 3186220dfc Added the winpcap lib to the link options.
Also, I added the EXPERIMENTAL_WIFI define, and the _WINSOCKAPI_ define which is required to get the Wifi core to compile.
2009-03-26 21:40:41 +00:00
luigi__ 061f375146 Added all the include and lib files for WinPCap.
Warning: don't forget to provide the WinPCap DLL with the DeSmuME binaries when releasing!
2009-03-26 21:34:28 +00:00
zeromus 331c4ee269 [ 2710782 ] win32: saved window position gradually floats around the screen 2009-03-26 20:52:01 +00:00
luigi__ bbae9c713e Added a wifi settings dialog. 2009-03-26 16:51:55 +00:00
matusz f3a0a5fd60 cli-port: updated manpage 2009-03-26 14:07:20 +00:00
matusz 7c9647b954 cli port: in-game save/load 2009-03-26 01:47:51 +00:00
matusz dee9315f14 cli port: option for loading saved game 2009-03-25 22:56:48 +00:00
matusz 0a7e159408 make rasterizer optional in cli port 2009-03-25 22:11:43 +00:00
matusz 9fe45a37de add software rasterizer 3d to cli port 2009-03-25 21:19:47 +00:00
zeromus 776d0aa72a while i had a test case set up, make some small performance improvements to display capture copy loops 2009-03-25 17:11:16 +00:00
zeromus 823f0aebb2 parenthesize expression correctly 2009-03-25 15:14:57 +00:00
mtabachenko 85599d83e5 core:
- fix VRAM mapping
2009-03-25 12:03:59 +00:00
zeromus f302f00e0d win32: add a 3d fps counter so you can see how fast the game logic is running. this isnt as good as a proper lag counter 2009-03-25 04:51:07 +00:00
zeromus c1c5ff3b0e win32: at some point the emulator quit remembering the window position between sessions. i fixed that. 2009-03-25 02:40:27 +00:00
zeromus 62876b7be6 another fix to 3d capture (possibly a regression made the other day); additionally a fix to rotated bg coordinate wrapping 2009-03-24 22:40:03 +00:00
mtabachenko ab97b6c349 - many fixes in cheat system (core & winport);
winport:
- added edit, remove & toggle on/off cheat in list;
2009-03-24 20:16:56 +00:00
zeromus 2e51fcbf1f win32: somehow zip loading got left out of the vs2005 debug vcproj. i think there may have been some reason why, but i dont remember it 2009-03-24 04:11:41 +00:00
riccardom 3f4091d6fe Move saves menu under emulation to keep the gtk window size the same of the display. 2009-03-23 21:28:36 +00:00
zeromus eedb20b350 another fix for cross of venus, which should now display from boot-up. this is part of a nest of evil that has been opened up due to needing to support the rendering of 2d graphics even while display mode is `off` or `vram framebuffer` or `main ram from fifo` so we will need to keep our eyes peeled for games whose display modes are totally broken due to this. it should be easy to straighten out. 2009-03-23 18:05:49 +00:00
zeromus 1191fafd18 fix to capturing in a mode we hadnt tested yet. this fixes cross of venus 2009-03-23 03:02:36 +00:00
riccardom 5ce77db69f Use proper gint macros for converting pointers and ints in the new saves code. While at it convert the loop to a for one. 2009-03-21 14:21:22 +00:00
riccardom bc0cbc1f2e Correct _MSC_VER definition check 2009-03-21 14:09:29 +00:00
yabause 8d22c9363c Added save types to gtk port. I have no idea if
this work, please report problems... :)
2009-03-20 21:50:14 +00:00
zeromus 7f65461438 win32: restore oam and pal viewer scrollbars which had mysteriously vanished 2009-03-19 23:08:13 +00:00
zeromus d87ac68255 fix for loading savestates which mismatch current 8MB debug mode setting 2009-03-19 18:58:14 +00:00
zeromus 2a66e41ad5 add concept of #ifdef DEVELOPER ("dev+") build type which will be used to prevent costly diagnostics computations and finetuning configurations from slowing down other users. 2009-03-19 17:26:15 +00:00
zeromus 303bf1747f rasterize: small fix to shadows. i still can't get them working perfectly though :( 2009-03-18 02:55:37 +00:00
riccardom 1eed08c7ae Shut up gcc warnings for ignored fwrite returns. Frankly, who cares about bmp images :P 2009-03-17 19:23:21 +00:00
zeromus 3dca16b37a win32: [ 2607896 ] 1.5x Window Size 2009-03-17 05:57:37 +00:00
zeromus c3c3e48da7 win32: add separate framelimiter so that you can use frameskip 0 + limit (the old pre-0.9.1 style before I broke it) 2009-03-17 05:45:51 +00:00
zeromus 962d1e5e2d rasterize: more work on shadow accuracy. back to you, __luigi 2009-03-17 02:40:42 +00:00
riccardom 4e53839385 Shut up a few more warnings. 2009-03-15 14:55:44 +00:00
riccardom b95a7cc921 Remove unused variable and comment BTcoords while its users are commentend too. 2009-03-15 14:40:46 +00:00
riccardom f16052595d Fix compilation on !WIN32 2009-03-15 14:33:55 +00:00
mtabachenko f955afe276 core:
- added save/load cheats for other ports (sorry old saved cheats don't work, i change file format). later i fix winport cheat system
2009-03-15 14:03:02 +00:00
luigi__ 159f323068 Cartridge emulation entirely remade as I was trying to get the BIOS running. But I can't get the BIOS running.
The Nintendo logo checksum in the cart header is copied to 0x027FF808, allowing the firmware to detect the cart. But unfortunately you can't boot from it.
2009-03-15 13:43:07 +00:00
riccardom 311d723004 Made some functions static, removed one unused variable, and changed the type of string constant to const char*. 2009-03-10 21:27:40 +00:00
luigi__ e974a64498 Added the ARM7 GetBootProcs SWI. It fixes the firmware freeze when trying to do anything. 2009-03-10 20:05:40 +00:00
luigi__ 5f617ca6ef Added the ability to write to the external firmware image (when there's one).
The firmware can now save new settings!
2009-03-10 16:48:03 +00:00
luigi__ fabcf94d50 Fixed a lot of glitches with shadows (but there are still glitches).
If you think it's wrong, read this: http://nocash.emubase.de/gbatek.htm#ds3dshadowpolygons
GBATek rocks :)
2009-03-09 22:33:08 +00:00
zeromus 14efca22bd rasterize: some small speedups and experimental optimization code 2009-03-09 16:40:30 +00:00
zeromus e51385c0bf win32: fix a crash which happened randomly when the app exited 2009-03-09 05:07:30 +00:00
riccardom 44e6332c7b Add missing include. 2009-03-08 13:34:03 +00:00
riccardom ff9f900413 Remove cvs id leftover. 2009-03-07 21:03:56 +00:00
luigi__ ef3e819215 Fixed another bug. 2009-03-05 22:51:13 +00:00
luigi__ 345cf53d4a Fixed another bug. 2009-03-05 22:47:13 +00:00
luigi__ e548c3c257 Fixed a few bugs. 2009-03-05 22:44:18 +00:00
luigi__ 7a998d0d38 Added the needed code for the emulation settings dialog.
External BIOS, SWIs from BIOS, external firmware and boot from firmware now working.
2009-03-05 22:34:39 +00:00
luigi__ 6d2ca3ee33 Modified the emulation settings dialog to hold BIOS/firmware config. 2009-03-05 21:34:23 +00:00
riccardom 5ce4e91296 Fix some gcc warnings in rasterize.cpp: remove unused variables, rename shadowing variables, make a function static, change depth type to same of the variable it is tested against. 2009-03-03 20:57:42 +00:00
riccardom 09448f9404 Move nds7old under WIFI_EXPERIMENTAL, outside it's unused. 2009-03-03 20:43:14 +00:00
riccardom b6f31aabb4 Remove nested /* */ comments 2009-03-03 20:38:25 +00:00
zeromus fbd906ba8d try fixing unresolved link errors with gcc 2009-03-03 20:04:16 +00:00
riccardom 96f784de02 Remove three functions that has been made static in MMU.cpp 2009-03-03 19:41:49 +00:00
zeromus 964e164d2a substantial core peformance improvements of a few FPS: remove checks for 0 parameters in operand ROR which was a big waste of time; also rearranged MMU read/write routines inlinedness and added some early outs for DTCM and main mem. The MMU read/writes are a mess and will be overhauled soon in separate checkins. 2009-03-03 02:01:38 +00:00
zeromus 91b27d48fa rasterize: clean up a little bit and speed up some 2009-03-01 16:40:19 +00:00
luigi__ 45d7d54c40 Some bugfixes here and there. Also, better timing.
And mostly, very incomplete implementation of SoftAP. ATM, it sends beacons every 100 ms, and tries to reply to probe request frames. But it doesn't work yet. If somebody can find what's wrong, he's welcome.
2009-02-27 13:37:29 +00:00
zeromus 3fc3cb346f rasterize: unexpected necessity: render any convex polygon without triangulating (more complex polygons can be created by culling) 2009-02-27 08:53:03 +00:00
zeromus 51ed1af70f rasterize: quads are now directly supported 2009-02-27 07:15:34 +00:00
zeromus 222664eb8c win32: default keyboard config was wrong for L and R buttons 2009-02-27 04:06:58 +00:00
zeromus a1ea7c6c62 rasterize: continue formulating new triangle engine into a form that will be easier to extend to quads 2009-02-27 04:01:26 +00:00
zeromus e7c46f12a0 rasterize: continue formulating new triangle engine into a form that will be easier to extend to quads 2009-02-26 09:06:24 +00:00
luigi__ cfc4dfe53d Coorected errors with WIFI_triggerIRQ. 2009-02-25 21:47:20 +00:00
luigi__ ba617f9b7e More correct emulation of the power registers.
(Tested, doesn't seem to break anything)
2009-02-25 21:32:56 +00:00
luigi__ e05df5f15f Hacked two regs, so most games don't freeze anymore when using wifi functionality.
But I'm perfectly conscient that it isn't correct emulation. I'll try to implement these correctly.
2009-02-25 19:20:47 +00:00
zeromus 2ac6e00def also ifdef my debugging code which only works on windows 2009-02-25 09:58:14 +00:00
zeromus b804bd6ebc add a hotkey to switch gpu cores. add a new triangle rasterizer (currently disabled) which should yield more accurate results once we wrestle with it some more. split the pixel ops out of the rasterizer so that it can be worked on mostly independently. 2009-02-25 09:57:06 +00:00
luigi__ 33ec203f93 Some fixes to the wifi core, mostly to the BB writes, but also a very inaccurate random generator (uses rand() atm), and saving all the I/O values to a buffer, for unsupported I/O ports, and support for 32-bit reads/writes to wifi I/O ports.
Games still freeze on wifi transmission but now they send stuff to the wifi core.
2009-02-24 22:59:41 +00:00
zeromus f0e0d21227 defer installation of polyattr until a begin command, and give a warning when you try to set polyattr inside a begin/end pair since this is probably a mistake. 2009-02-24 20:33:15 +00:00
gecko_reverse 5c158071b8 cocoa port codeblocksproj/rakefile put their stuff in the build folder now 2009-02-24 08:25:50 +00:00
gecko_reverse 714e2b445b added Italian translation to cocoa port thanks to Paolo Bernini. move cocoa translation files to their own folder to simplify things 2009-02-24 03:22:12 +00:00
gecko_reverse 127e0066f2 cocoa compile fix (needed texcache) 2009-02-24 02:19:41 +00:00
luigi__ 2e2f0428ab Fixed a bug with screen gap of 64 pixels. 2009-02-24 00:41:48 +00:00
luigi__ 25a144e820 Display should now work for people who have their desktop color depth set to 16bpp (RGB 565).
Also added more correct handling of unsupported desktop colour depth.
2009-02-17 00:59:35 +00:00
luigi__ 20ff3c2e0f The WM_LBUTTONDBLCLK message is now handled.
This makes the SPP puzzle mini-game much easier to play.
2009-02-16 22:07:37 +00:00
luigi__ 52fc632ec7 Enabled the lid open/close key. 2009-02-16 00:30:59 +00:00
luigi__ f9c98a3202 Fixed a possible bug with read/write flag of big-endian commands. 2009-02-15 12:12:37 +00:00
zeromus 448161a65c windows: change debug builds to use fast floating point. since thats what we want final builds to use. also, prevent hotkeys and input keys from working while the game window is not foreground 2009-02-15 02:22:26 +00:00
luigi__ 40eaf9f5d6 Added support for viewport. 2009-02-15 01:38:48 +00:00
zeromus 0e2532cc85 rasterize: fix an interaction between polyids and shadows resulting in failure to render shadows sometimes 2009-02-15 01:28:36 +00:00
luigi__ 2fbf9e8d94 Fixed the shader availability check once again.
Also added more infos for shader creation errors.
2009-02-15 01:19:28 +00:00
zeromus 127f345a9c apparently the very ancient form was wrong for thumb. now it is back to the most modern form, but it looks different than the arm equivalent. we need an expert to sort this out, or we need to find a rock solid arm cpu emulator and compare it to that. 2009-02-14 22:32:30 +00:00
zeromus 8dd437b984 fix ff4 zoning bugs. its the SBCS/RSCS flags again. I reverted these to very ancient forms, in arm and thumb. Lets try it out for a while. 2009-02-14 22:28:32 +00:00
zeromus 842b39d1a6 fix the RGB ordering of dumped textures 2009-02-14 22:24:45 +00:00
luigi__ 7ad6fc5257 Added support for 16-bit and 32-bit read/writes to the RTC reg,
and fixed the little-endian commands.
With these fixes, the SPP menu background has now the right colour depending on the time (formerly it was always night blue).
2009-02-14 22:04:24 +00:00
riccardom fc6cbdf03d Removed redefition of WORDS_BIGENDIAN on big endian machine as showed by
this build log on ppc: http://buildsys.rpmfusion.org/logs/fedora-development-rpmfusion_free/2765-desmume-0.9.1-1.fc11/ppc/build.log. Spotted by Andrea
Musuruane.
2009-02-14 13:36:21 +00:00
riccardom a5cdad9ff8 Apply patch from Andrea Musuruane to fix compilation with g++ 4.4, fix #2599049. 2009-02-14 13:26:33 +00:00
luigi__ d5c80e3681 Corrected the DS gap to 64 pixels (Thanks to Atma). 2009-02-14 12:20:50 +00:00
luigi__ 096ff9dd4c Added an option to separate the screens. ATM the gap between the screens is white, maybe you won't like it, I'll try to make it prettier in the future.
There are 3 options:
-No separation (screens stuck together)
-Narrow border (5-pixel border, like NO$GBA)
-DS (90-pixel gap, approximatively reproduces the gap on the DS)

Also added the missing Help->About menu item to the French and Danish menus.
2009-02-13 14:29:07 +00:00
luigi__ 017949cacb Fixed a bug with PM hours in 24-hour mode. 2009-02-12 18:51:08 +00:00
riccardom abb57abc6e Fix "gfx3d.cpp:622: warning: array subscript is above array bounds" by removing that line that is now unused (confirmed by zero). 2009-02-11 20:32:17 +00:00
zeromus 1226363d5d rasterize: perspective correct material colors--not doing this was a bug. optionally interpolate material colors when clipping. the hardware doesnt do this, but it looks ugly on the hardware and unless I am debugging I want it done. 2009-02-11 08:58:26 +00:00
zeromus ce7cb192ed win32: cleanup and fix bug where input is ignored during frameadvance 2009-02-11 05:21:40 +00:00
zeromus b3d0485587 win32: fix some hotkey bugs. change how the main wndproc works, because it was working in a lame way before. this might have some subtle undesired effects but none of them serious 2009-02-11 04:45:08 +00:00
zeromus cfdc18fa53 win32: route all the old hardcoded accelerators through the hotkey system 2009-02-11 04:23:52 +00:00
zeromus 4247b76b47 win32: move hotkey code and definitions to its own file, for more easy organization 2009-02-11 03:14:36 +00:00
zeromus 41b8605937 win32: pass #2 of adding snes9x input configuration - hotkey system added 2009-02-11 03:05:59 +00:00
luigi__ c9bf594a3f POV diagonals now work correctly. 2009-02-10 22:16:18 +00:00
zeromus 4b4b307f0e win32: try this to fix compilation on older sdks 2009-02-10 21:45:30 +00:00
luigi__ c73cc81494 Added support for decal texture blending and toon/highlight shading. 2009-02-10 16:57:52 +00:00
luigi__ f42c529a5a Fixed language support for Vista. 2009-02-10 16:28:22 +00:00
mtabachenko 93a6318a42 -fix render & OSD (moved to gpu.cpp) 2009-02-10 12:54:10 +00:00
mtabachenko 7e4d70f2b8 - fix bug #2584564;
current osd method slow and incorrect. this need to rewrite. I think need make: data send to OSD buffer in core, but data from osd buffer must render in port depend (ex. in windows with DDraw). still this will fix display capture.
2009-02-10 10:56:39 +00:00
zeromus 3cb5c4a7c1 win32: fix joystick up/down; add something back for rumble support, but still havent tested it 2009-02-10 08:21:48 +00:00
zeromus 07ca5cc0a3 win32: pass #1 of adding snes9x input configuration - input binding system and dialog implemented, meshed with our directinput joystick system for rumble support. I have no rumble pad; can someone test it? 2009-02-10 06:47:06 +00:00
luigi__ b24f4fe17e The window is now refreshed even when resized or moved. 2009-02-09 22:21:14 +00:00
luigi__ 7dedcf1ab5 Made the OSD messages totally rotation aware. Thus, for example, when using rotation, the FPS counter doesn't rotate anymore.
Also a bit of cleanup (removed some unused funcs in main.cpp).
2009-02-09 22:07:49 +00:00
luigi__ 68375447ed Fixed a bug with texcoord generation mode 2 (normal). 2009-02-09 19:08:06 +00:00
luigi__ 32fd9d5ec5 The emu is now paused when minimized.
WM_PAINT is handled when the emu is paused so the screen is still refreshed.
The screen buffer is filled with white upon reset, if you don't like it you can set another color.
2009-02-09 18:59:52 +00:00
luigi__ a94dd4290e The GPU image data is now drawn to a temporary buffer, then copied to GPU_screen.
This avoids OSD messages overprinting when the screen isn't refreshed (for example when closing the lid).
2009-02-09 18:08:47 +00:00
luigi__ 2a47d2bcf6 Added support for Sleep mode (experimental), so for most games, when you close the lid, the game won't continue running. Also improved a bit the close lid func (no need to pause the SPU).
Also added basic support for the SPI power management device.
2009-02-09 17:18:58 +00:00
zeromus eedd91854f rasterize: clean up some interactions between translucent polyids and shadows 2009-02-09 02:22:00 +00:00
zeromus 56eb522142 rasterize: stencil shadows 2009-02-09 01:32:47 +00:00
zeromus d50d5720e7 rasterize: fix same transparent-translucent blending on same polyids 2009-02-09 00:51:19 +00:00
zeromus 22e651884a rasterize: a trivial optimization which i had been itching to make 2009-02-09 00:23:17 +00:00
zeromus 852ede072a rasterize: fixes to depth buffering. now w- and z- buffer both work. also update version to 1.9.2 2009-02-08 23:38:21 +00:00
zeromus be2a4ba077 rasterize: clipping works the way it should now. 2009-02-08 22:52:10 +00:00
mtabachenko 0653b9ec11 winport:
- fix Intel C++ project;
2009-02-08 21:42:16 +00:00
luigi__ 920be714ac Stub implementation for ARM7 SWI #7 (Sleep), by writing 0xC0 to HALTCNT, exactly as on the DS.
TODO: implement HALTCNT at the MMU side.
2009-02-08 21:38:30 +00:00
zeromus 650fa47468 fix to authors file 2009-02-08 21:29:40 +00:00
yabause 9668f3014f Added some missing files to windows port. 2009-02-08 15:45:22 +00:00
yabause b5e4481313 s/0.10/0.9.1/ 2009-02-08 14:35:05 +00:00
luigi__ f6c6d12fd9 The output sound buffer is now zeroed out before mixing, that prevents noise when the SPU is disabled.
Cleaned up the SPU read/write funcs (removed useless switch statements).
2009-02-08 11:49:56 +00:00
zeromus dcd2d76e96 rasterize: fix the most serious clipping issues which rendered games unplayable. now they are merely ugly 2009-02-08 05:55:07 +00:00
riccardom 5219aca9dd Fix gcc compilation as suggested by zero on irc. 2009-02-07 17:45:33 +00:00
luigi__ 21c2b4ebfc oops... forgot to remove something. Never mind. 2009-02-07 17:20:13 +00:00
luigi__ e3f4325160 Fixed the texcoord generation mode 2 (normal).
I know it's strange, but it seems the transform must be applied on the raw texcoord val, not on the floating-point one.
2009-02-07 17:19:26 +00:00
luigi__ 1029997586 Added support for the polygon ID shit, using the stencil buffer.
I also changed the values used when rendering opaque polygons or shadows, so they don't interfer with the translucent polygons.
We can now close the bug report #2488334 for good!
2009-02-07 14:18:51 +00:00
zeromus cb70fb5af6 rasterize: better clipping. still a horrible bug somewhere, and w-buffer doesnt work 2009-02-07 10:11:18 +00:00
zeromus 07055b389c rasterize: first attempt at clipping. works well, but still glitches 2009-02-07 06:56:07 +00:00
zeromus 410143f6b5 rasterize: I dont think it made sense to interpolate material alpha. just one value per poly 2009-02-06 17:31:24 +00:00
zeromus e2f324c466 nope, my way is much faster, and clearer to boot 2009-02-06 16:51:00 +00:00
luigi__ 9c622b790f Oops, somebody removed my triangle-strip vertex submitting, probably not on purpose. 2009-02-06 15:13:16 +00:00
luigi__ 30fe4c5d0d Removed an assert which broke SM64DS. 2009-02-06 15:06:30 +00:00
zeromus de0b2d6dc9 rasterize: z-buffering and more accurate blending 2009-02-06 09:28:01 +00:00
zeromus 6118e62c10 fix a tiny error in the ogl renderer state caching 2009-02-06 06:50:40 +00:00
zeromus a73e0bf6a2 rasterize: handle polyids, improve transparency logic 2009-02-06 04:56:14 +00:00
zeromus a0940cad34 rasterize: improve texturing precision 2009-02-06 04:14:11 +00:00
luigi__ cd962b82e4 Better culling (thanks to sgstair).
Changed the vertex submitting method as I did for OGLRender. The clockwise-defined triangles are re-ordered as the renderer doesn't seem to like them.
And last, added SoftRast before the function names, as I had to do with OGLRender.
2009-02-05 21:52:58 +00:00
luigi__ 47fed9080a Seems Resedit had a problem saving this bitmap :/ 2009-02-05 15:56:01 +00:00
luigi__ aefe74fb0e Added a 20x20 background bitmap.
(Will be used in the new viewers)
2009-02-05 15:46:57 +00:00
zeromus 26abbe2f7f rasterizer: fix texture sampling issues and drawing of back faces 2009-02-05 10:16:19 +00:00
luigi__ 6a4cbf19c4 Again some adjustments to the BG map viewer template. 2009-02-04 21:33:00 +00:00
luigi__ 197d126736 Changed a bit the new bg map viewer pattern. 2009-02-04 20:47:26 +00:00
riccardom 228fb78696 Declare variables in the same order they are initialized to fix a gcc warning. 2009-02-04 19:39:11 +00:00
riccardom 7911585bdc Make a function static. 2009-02-04 19:38:23 +00:00
luigi__ e67704d5b7 Changed the vertex submitting method: all the polys are rendered as triangles, so the vertex number can be anything you want. It doesn't seem to cause glitches.
It'll probably be required for clipping, as we'll need replacing clipping vertices properly, like the DS does.
2009-02-04 19:14:13 +00:00
zeromus eca3d75efd rasterize: fix off by one texel error 2009-02-04 03:28:50 +00:00
zeromus 8b24e2c386 didnt mean to leave texture dumping enabled 2009-02-04 02:45:38 +00:00
zeromus 33be370fe6 rasterizer: more correct texturing and alpha blending 2009-02-04 02:34:07 +00:00
luigi__ ac68f0317f Added the template of the new map viewer. I'll start coding it tomorrow.
(For info, you shouldn't commit resource.h after having just saved it with VS just to test Resedit, it gives me conflicts with TortoiseSVN, and Resedit can still open it. It just annoys me. Thank you for your understanding.)
2009-02-03 22:32:29 +00:00
mtabachenko c070b10034 - opps, forgot remove it 2009-02-03 22:26:45 +00:00
mtabachenko 23f54c7d71 moved timers id for Windows port in common.h :) 2009-02-03 22:26:01 +00:00
zeromus 3d7cfba55f saving from vs2005 once more. see how resedit likes it 2009-02-03 22:04:36 +00:00
luigi__ 6a769e0bc0 Moved the timer IDs to an external include because, if they're located in resource.h, Resedit will blow them up when saving. 2009-02-03 21:53:37 +00:00
zeromus 107ede7375 this is what happens when i save resources back out with vs2005. can luigi still load them? 2009-02-03 21:42:06 +00:00
mtabachenko 50e13fc8c6 fix for windows resources; 2009-02-03 21:36:50 +00:00
luigi__ 9d6fc8d726 VS doesn't seem to support sublang IDs, so we'll cheat a bit.
(Anyway I don't think they're so important)
2009-02-03 21:21:41 +00:00
luigi__ 856afa2116 Fixed compatibility with Resedit.
Test: just opened the resource file with Resedit and saved it. The file is now said to be generated by Resedit. If VS can't handle it, revert this commit.
2009-02-03 21:11:59 +00:00
luigi__ c0606403cf Added two defs for Resedit to work correctly with the resource file.
(Reminder: I plan to remake the tools and I'll use Resedit as my VS2008 is Express and doesn't have resource edition)
2009-02-03 20:49:01 +00:00
riccardom a67566b01f Add static qualifier where due. 2009-02-03 20:08:21 +00:00
zeromus 9ba8408af9 rasterize: i give up trying to make the interpolator precision good. that is a waste of time right now. just clamp material colors to the right range 2009-02-03 19:51:58 +00:00
riccardom 54b392d76b Add missing files to makefile and add proper includes to let desmume compile again. 2009-02-03 19:40:05 +00:00
zeromus a680b58121 if microsoft is going to play games with where they stuff their libraries, i will just checkin their libraries myself 2009-02-03 18:32:07 +00:00
luigi__ fbff3694c6 Oops... forgotten to add chan->x to savestates (this variable is needed for PSG white noise). 2009-02-03 17:37:19 +00:00
luigi__ a2548e687b Added GDI+ setup as I plan to rewrite the viewers soon (they'll use GDI+).
But, we do keep DirectDraw for the main window!
2009-02-03 17:34:10 +00:00
zeromus a0cade405f rasterize: speedups 2009-02-03 08:17:43 +00:00
zeromus 5e90f6ae10 rasterize: perspective correct textures and backface culling 2009-02-03 07:49:28 +00:00
zeromus 517a27294a rasterize: textures, shading, blending 2009-02-03 06:36:36 +00:00
zeromus 0d4cf9fe49 fix a bug in the vertex list generation which resulted in empty, unlinked vertices in the list. also added a few variables to savestate 2009-02-03 04:51:18 +00:00
zeromus d4604c7d81 add recently created files to vs2008 vcproj 2009-02-03 02:36:53 +00:00
zeromus 9c99aa58c8 add new file to makefile. add newline to end of common.h 2009-02-03 02:08:06 +00:00
zeromus 64feb0117c extract texture cache from OGLRender so that it can be reused by rasterizer. add interpolator for material color and texture to rasterizer 2009-02-03 02:03:49 +00:00
mtabachenko 49365a2630 typo fix in 3d save state; 2009-02-03 01:15:57 +00:00
zeromus 73b541a2c7 fix the lurking issue that made alpha permanently break after loading a savestate. astounding, yes, but true. this MUST make it into 0.9.1 2009-02-03 00:06:34 +00:00
zeromus 38d10282f4 rasterize: fix viewport and perspective transformations. now triangles are rendered terribly in the correct place 2009-02-02 22:15:46 +00:00
riccardom fff695d3c1 Remove an empty function, used as a callback though. 2009-02-02 22:11:53 +00:00
zeromus 257a138d82 software rasterizer stub complete with terrible flat shaded tri renderer 2009-02-02 22:09:09 +00:00
riccardom 3d78ca9c1c Hook the nice NDS_SkipFrame() function, this gives us a bit more boost with frameskip on. 2009-02-02 22:03:27 +00:00
yabause c17e0a6037 s/addons.c/addons.cpp/ 2009-02-02 21:47:31 +00:00
riccardom 650ac714da Looks like this should be const instead of static, nothing changed in practice. 2009-02-02 21:18:48 +00:00
riccardom 361220ce5d Enable reset at launch time and not on rom file open. This way it will work even when the rom is passed as argument. 2009-02-02 21:13:15 +00:00
zeromus 2c0656a786 fix changelog 2009-02-02 20:46:21 +00:00
riccardom b068d69810 Remove another unused var. 2009-02-02 20:46:06 +00:00
zeromus e3e45c4606 get rid of gcc warnings. 2009-02-02 20:39:00 +00:00
riccardom d107e7b2f4 Remove unused variable. 2009-02-02 20:34:46 +00:00
mtabachenko 4cb665c1e9 minor fix ChangeLog 2009-02-02 08:08:20 +00:00
zeromus 4bacc49da2 minor speedups to gpu 2009-02-02 04:37:25 +00:00
zeromus 839f66924c fixed a bug in the aboutbox scrolly credits 2009-02-02 02:43:08 +00:00
zeromus 75e56280c1 windows: very slightly speed up rotation / final color conversion 2009-02-01 23:21:41 +00:00
zeromus 499adfe59c work on the changelog 2009-02-01 02:13:22 +00:00
zeromus 869f56bf41 correction to the new affine bg handling: parameters must be reset to the last user-specified value before scanline 0. 2009-02-01 01:28:34 +00:00
luigi__ d66fd4ab85 Rewritten the incorrectly implemented setFinalBGColorSpecialIncreaseWnd and setFinalBGColorSpecialDecreaseWnd functions. This fixes the part 1 of the glitch #2488334 (SPP puzzle glitch). 2009-02-01 00:24:03 +00:00
zeromus 3bb392c413 [ 2488334 ] fix (SPP affine rotation display bug)
also start capturing register disp3dcnt but not using it for anything yet
2009-01-31 23:45:12 +00:00
zeromus 0f8211ec84 add new newIrqFlags variable to savestates 2009-01-31 22:15:20 +00:00
luigi__ 9cd1ad785e Better BIOS IRQ wait routines, supporting old IRQ flags discarding.
This seems to fix all the SPP problems!
2009-01-31 19:37:06 +00:00
riccardom 61a36046d4 Rename a variable that returns something ret from i. 2009-01-31 17:20:49 +00:00
riccardom f9d572f07a Move rom serial related code from NDS_LoadROM to an helper function and clean it up a bit. 2009-01-31 17:01:13 +00:00
zeromus b884832675 re-add my change to stop throttling when frameskip is 0, but do it right this time, so that autoframeskip causes the throttling to enable as a limiter 2009-01-31 16:44:06 +00:00
riccardom 97b86029a6 Add a missing free of a NDS_header struct. While at it cleanup things a bit. 2009-01-31 13:23:31 +00:00
luigi__ 3221fc2a88 Revert the last change because we lost the ability to limit framerate when using auto frameskip, which can be annoying.
I think we should rather add a "Limit framerate" option.
2009-01-31 13:13:54 +00:00
zeromus 36e1fee5fe disable throttling when frameskip is 0 in windows, so you can sort of fast forward, or test how fast the emu is running. also revert a couple hacks in oglrender which I do think cause a net glitch count increase 2009-01-31 05:20:06 +00:00
zeromus 19f9cd36fc fix: [ 2550645 ] Super Princess Peach: crash when starting a puzzle 2009-01-31 04:47:23 +00:00
gecko_reverse 98c68d8d89 added more keyboard buttons to the input settings 2009-01-31 04:36:48 +00:00
gecko_reverse 98528a75a7 fixed left and right key config (thanks to Arakun for finding the bugged code) 2009-01-31 04:20:53 +00:00
zeromus bf054c32ed fix vertex source texcoord generation (fixes environment mapping e.g. stars in sm64); this is a low risk fix and could be safely ported into release branch 2009-01-31 04:01:10 +00:00
zeromus 2578a0a291 fix a serious bug which crippled 3d engine loading from savestates. this should be ported to release branch. also add some missing dma state to savestate. 2009-01-31 03:40:20 +00:00
zeromus 09229a159e fix dual screen 3d bug: when capturing 2d+3d output, but the display mode is not producing 2d+3d data (such as in vram display mode), then we should peek directly at the 3d output as if we were capturing 3d output only 2009-01-31 02:58:45 +00:00
luigi__ e4a7588d4a Added casts from s16 to s32 in the PSG noise func.
Added the new channel_struct variables to savestates.
Fixed the wave write core (WMP doesn't complain anymore when playing a wave file recorded from DeSmuME)
2009-01-30 13:08:50 +00:00
gecko_reverse 8c2a951941 mac compile fix 2009-01-29 23:54:55 +00:00
zeromus e661331bd1 revert something crazymax did in dma which broke repeating dmas 2009-01-29 14:38:11 +00:00
luigi__ 18fa16d748 Added support for PSG white noise. 2009-01-29 14:34:28 +00:00
riccardom a87501a235 Put brackets around a possible empty macro. 2009-01-26 19:52:42 +00:00
riccardom 23cffd809c Make gfx3d_FlushFIFO() static. 2009-01-26 19:51:07 +00:00
zeromus 2df831cbb0 add some diagnostic messages 2009-01-26 18:43:34 +00:00
mtabachenko 4e9176a4c0 core:
- add busy flag in GXSTAT for BoxTest, PosTest & VecTest;
- fix pop matrix stack;
- GXFIFO emulation (with USE_GEOMETRY_FIFO_EMULATION definition in FIFO.h): I some corrected FIFO, but this have errors. On Homebrew roms (with small commands buffer) it`s work perfectly, but in commercial games with glitches. I can`t understand when it is needed flush GXFIFO to render. I always get the buffer overflow and loss of data. Where is a bug? I wrote small test for GXFIFO for comparing to the real DS (http://www.turboupload.com/files/get/wuf9IR3Oo1/fifo-3d.zip)
2009-01-26 13:18:17 +00:00
zeromus 18fed5b2ac speedup to x/y window handling code by precalculating as much as possible at beginning of scanline or when WIN0H* are set 2009-01-26 09:28:09 +00:00
zeromus fecd7ffd69 fix a bug that made some sprites get cut off in x=255; also some small speedups in GPU 2009-01-26 07:58:13 +00:00
zeromus 9689548ac8 change back to linear interpolation in SPU. it seems a bit extravagant now. perhaps we should make it configurable.. or, for luigi__'s consideration, I added a commented-out cos lookup table instead of doing the full call to cos() 2009-01-26 07:55:36 +00:00
zeromus 990c2a062e fix a bug in windows framerate throttling which made frameskip auto unable to skip frames. 2009-01-26 07:53:42 +00:00
zeromus 1d71a7d4b7 check me crazymax: it is a shame to have to memset the fifo so often. would it be sufficient just to reset the tail? 2009-01-26 07:02:50 +00:00
zeromus 0055130494 readme crazymax: matrix stack "size" is 31 for 32 entry stack (silly, i know) so your overrun check was wrong. 2009-01-25 22:11:50 +00:00
mtabachenko 63605b9967 core:
- added stack level into GXSTAT register;
2009-01-25 20:49:24 +00:00
zeromus b0fbd6a919 fix to sprite windows which I broke the other day. various speedups in win32 and in GPU 2009-01-25 20:16:19 +00:00
riccardom 26dc322b2c Remove extern stuff thas has been made static in GPU.cpp 2009-01-25 15:52:53 +00:00
zeromus 0c8e597533 finish some things i meant to do in the mosaic system and do some other gpu cleanups. 2009-01-25 07:26:01 +00:00
zeromus 1f2982fa5c fix recently introduced bug which made >256 wide BGs crash the map viewer debug tool.
remove redundant GPU blending code and add a lookup table.
2009-01-25 06:12:19 +00:00
riccardom 82b6c5c8ea Reenable gtk-glade compilation with offscreen mesa enabled for gtk frontend. 2009-01-24 13:43:46 +00:00
riccardom a3775a0138 gtk-glade: make a couple of functions static 2009-01-24 13:07:46 +00:00
riccardom 577a91896b Oops, i missed to commit the same change to header :) 2009-01-23 22:30:44 +00:00
riccardom c23054364d We can make quite a bit of data const. 2009-01-23 22:28:45 +00:00
riccardom 1f68f2de4a Make a few functions static and put parentheses around shift operators 2009-01-23 22:21:14 +00:00
riccardom 1b10babf27 Add proper includes to compile on linux (patch by gualteri) 2009-01-23 22:13:13 +00:00
yabause d2070ca6e5 Updated version number to something else, so users testing
svn won't get confused.
Also removed the check for a C compiler. It seems that
when searching for both a C and a C++ compiler, configure
don't care that there's no C++ if there's a C one.
2009-01-23 14:21:28 +00:00
mtabachenko dd167055b2 fix typos in addons and make functions is static (thanks xrmx) 2009-01-23 10:09:09 +00:00
mtabachenko f9d81fcd0d core:
- add experimental GFX FIFO emulation (It has a bit bugs and a revision is required. I will endeavour to correct it soon)
2009-01-22 21:50:51 +00:00
riccardom 992214a67a Fix a buffer overflow :) 2009-01-22 20:49:13 +00:00
riccardom 74a217400b noext is allocated by malloc in strdup so use free instead of delete []. 2009-01-22 20:40:18 +00:00
riccardom 3289c31d62 Make a couple of functions static. 2009-01-22 20:17:57 +00:00
riccardom bfc30a659e gcc does not like to skip variable initialization with gotos 2009-01-22 20:13:05 +00:00
zeromus 672b8e3c8f apply my planned mosaic optimizations to BG 2009-01-22 07:24:57 +00:00
zeromus 3e57278979 fix crash after loading savestate matrix stacks originating from revision 1513 2009-01-22 07:22:46 +00:00
zeromus a6b21e74e1 never mind. i was persuaded that i was wrong 2009-01-22 06:29:21 +00:00
zeromus b8b16c02df I think we should throw out touch input when it is out of bounds of the touchscreen, instead of clamping it. what do other people think? 2009-01-22 05:59:45 +00:00
luigi__ c6c4871020 Implemented a more efficient frameskip support, skipping frames at GPU level, which is loads faster.
It only works for Windows port atm, to make it work in the other ports :
call NDS_SkipFrame with param : true = skip the current frame, false = render the current frame.
2009-01-21 22:35:46 +00:00
luigi__ 47785d2015 Some minor optimiSome minor optimizations to the BG mosaic func.
Feel free to correct any problem I may have introduced!
2009-01-21 21:48:44 +00:00
mtabachenko d742dd7745 core:
- fix quick save states (bug in geometry)
2009-01-21 19:43:40 +00:00
luigi__ fbd32a12da Oops... the blending is forced only if the 3D layer has the highest prio, not if it's selected as 1st target... 2009-01-21 19:25:08 +00:00
riccardom 83fb5e2223 Make a couple of functions static and put () around & operands. 2009-01-21 18:59:47 +00:00
mtabachenko a5e3e92106 core:
- added VRAM mapping for DMA;
2009-01-21 14:06:16 +00:00
mtabachenko c92e7dca78 fixed bug in dma 2009-01-21 13:12:34 +00:00
mtabachenko 2affa600c1 - some cleanup (added template DMA & change send data to TOONTABLE implementation) 2009-01-21 11:30:54 +00:00
zeromus a645bdb1d9 apply a similar mosaic approach to sprites. however, it is substantially different in practice, and I am sure it is not entirely accurate. however, it is reasonably close, and immediately mosaic will work decently for every kind of sprite, so it is a good starting point. 2009-01-21 08:28:13 +00:00
zeromus 3dc426451e fix recently introduced exit-time crashy bug in windows 2009-01-21 06:54:08 +00:00
riccardom 8b2ebeb2da Add static where due, remove unused variable 2009-01-21 06:41:48 +00:00
riccardom c7188b2d48 stop shadowing of i 2009-01-21 06:41:17 +00:00
mtabachenko f9acd10d94 - add clear data for paths variables; 2009-01-21 00:16:36 +00:00
mtabachenko 8b80838fb8 - added detect Homebrews for game serial :) 2009-01-21 00:09:43 +00:00
mtabachenko 63e9338860 :( stupid me!!! I declared variable "buf" as array pointers "char" with size MAX_PATH in LoadROM. sorry 2009-01-20 23:20:32 +00:00
luigi__ 8c9d99b608 Optimized the 3D pixel blitting funcs a bit. 2009-01-20 22:32:33 +00:00
zeromus e3ce9a41f4 forgot to checkin a file 2009-01-20 22:12:20 +00:00
zeromus f251df055e example of how i think mosaic should work, for 16 and 256 color standard BGs. not tested well. 2009-01-20 22:10:41 +00:00
mtabachenko 16eee0c416 - opps I broke display FIFO. fixed :) 2009-01-20 22:03:55 +00:00
luigi__ 9f6ed6db93 Blending should now work correctly in SPP. 2009-01-20 21:36:44 +00:00
mtabachenko a0c3c02ea9 core:
- fix display FIFO;
- more accurate RTC implementation (is working more correct with Homebrew now);
2009-01-20 21:31:32 +00:00
luigi__ 36132978f5 Oops, forgotten to remove a hack to disable mosaic :(
(anyway mosaic is buggy)
2009-01-20 16:47:28 +00:00
luigi__ dd92d07548 Oops, it seems that the palette index can't be used when using regular palettes on 16-bit affine backgrounds.
BTW, DeSmuME now validates all the graphics tests! (http://wiki.akkit.org/Nds_test_app_releases)
Does somebody have champagne? :P
2009-01-19 22:28:57 +00:00
luigi__ b104d06b4f Fixed a bug with 16-color affine BGs. 2009-01-19 21:42:45 +00:00
yabause 06ab1d081b Added copyright headers for files coming from FCEU.
I'm mostly unsure about those one :)
Again, feel free to update them.
2009-01-19 21:36:27 +00:00
yabause 6909133c5f Added missing copyright headers.
Again, feel free to fix any error I made.
2009-01-19 20:46:49 +00:00
yabause eeb78c4086 Added/fixed some copyright headers.
Feel free to double check and further fix what I've done.
2009-01-19 20:25:40 +00:00
luigi__ b4a3a5ddef Better determination if BG0 has the highest prio. 2009-01-19 19:04:10 +00:00
luigi__ d652b5a0f4 Cleaner and better blending logic for backgrounds.
For info, not performing blending if BLDALPHA_EVA is 16 can cause glitches.
2009-01-18 16:40:31 +00:00
luigi__ 15904d31de Changed default color to pink, so we can now distinguish between transparent and black pixels. 2009-01-18 15:49:09 +00:00
mtabachenko b76fc6277b core:
-fix VRAM mapping for textures (broke in rev 1459, zeromus check it)
2009-01-18 15:25:57 +00:00
mtabachenko f15e3c1b6a - added display FIFO data to savestate; 2009-01-18 13:48:18 +00:00
mtabachenko 38bdc6c2f2 core:
- added display memory FIFO;
2009-01-18 13:43:05 +00:00
luigi__ 5b53b8c73e I made the first correct implementation ever for sprite blending!
(Transparency for bitmap sprites isn't supported yet... tell me if you see sprites that still don't blend correctly)
2009-01-18 12:47:53 +00:00
mtabachenko c4a0542ad3 winport:
- fix crash when close the input config dialog and on exit (on systems where no feedback game devices);
2009-01-18 08:07:53 +00:00
luigi__ 45ee9f6bb5 Changed the sprite drawing functions to save sprite type & alpha.
I've figured out how to implement sprite blending, I'll do it soon.
2009-01-18 00:39:24 +00:00
riccardom 4447955558 Fix strange usage of decrement operator. 2009-01-17 20:09:53 +00:00
luigi__ bf5ca69394 Reverted the save file extension to sav.
Why was it changed to dmc ? I can't find a good reason, it's only annoying.
2009-01-17 17:29:47 +00:00
mtabachenko 081a269f94 core: - cleanup LoadROM and adden paths variables; I changed file saves extension for different with others emuls. :)
for saves (memory cards): dmc (DeSmuME memory card);
for quick saves: dsx (DeSmuME saves when x-number of slot);
for cheats: dct (DeSmuME cheats).

may need later add import saves (memory card) from another emuls.
2009-01-17 16:12:46 +00:00
luigi__ e271c6c4eb Reverted the direct sprite blitting as it causes problems when sprites are behind translucent backgrounds.
Added a new param to the sprite rendering funcs, meant for proper sprite blending.
2009-01-17 15:08:55 +00:00
mtabachenko fd69a0e0aa ops... forgot update file :( - fix winport compile 2009-01-17 14:16:07 +00:00
luigi__ 17f285d455 Changed sprite blitting to draw them directly on GPU_screen instead of a separate buffer.
We'll now be able to do proper sprite blending.
2009-01-17 13:48:58 +00:00
luigi__ f538364e3b Added support for disabling the sound speakers (bit1 of POWCNT2) 2009-01-17 12:12:42 +00:00
mtabachenko 2efd0e19e0 core:
- fix lid folding;
- fix rumblePak addon;
winport:
- added feedback support & analog joysticks;
2009-01-17 11:47:13 +00:00
riccardom 02b6c46751 Add needed header osmesa_3Demu.h, remove unneeded stdio.h and move stdlib.h on top because. 2009-01-16 23:04:09 +00:00
luigi__ 26c2dd2ec9 Fixed a possible bug with 256-color backgrounds not using extended palettes. 2009-01-16 22:41:01 +00:00
luigi__ f035b9d331 Removed some hacks that were supposed to force blending for sprites and that actually cause glitches. 2009-01-16 22:07:58 +00:00
luigi__ 171b4aeeba Fixed a bug with scrolling on 16-color text backgrounds.
Fixed a possible bug with 3D layer scrolling.
2009-01-16 20:35:40 +00:00
riccardom 519711e6f8 Add enable / disable audio switch to gtk frontend. 2009-01-16 20:04:00 +00:00
riccardom 58ac31761a This is more useful not commented, desmume handles the error fine. 2009-01-16 19:52:08 +00:00
luigi__ 747cc72948 Fixed scrolling for 3D layer (it would scroll backwards).
Plus, we can now get rid of the start/end params in the 3D GetLine func.
2009-01-16 15:25:12 +00:00
riccardom 6740cc3b7d Put brackets around a possible noop inside an if. 2009-01-15 21:09:43 +00:00
riccardom e8b3a77331 This is static in NDSSystem.cpp so declaring it extern here does not make sense. 2009-01-15 21:02:47 +00:00
riccardom b57533998a Move MAX_PATH definition for _GNU_C platform to types.h since it's used more than once. 2009-01-15 21:01:35 +00:00
riccardom daa2d26ff6 Add chetSystem to compilation and fix compilation. 2009-01-15 20:59:37 +00:00
zeromus 3b32a1cb4e fix texture debug dumping to flip bmp so that they are wysiwyg 2009-01-15 20:16:49 +00:00
zeromus c3e28a662f mount empty memory for tex and tex palette memory when slots are unmapped. provide diagnostics when unmapped slots are referenced by textures. 2009-01-15 19:33:04 +00:00
mtabachenko 92fb5e378f minor fix in cheat system 2009-01-15 11:43:25 +00:00
mtabachenko 8a9103ed33 core:
- add cheat system (i will Action Replay & Codebreaker parser later :( )
winport:
- add cheats finder and cheats editor;
2009-01-15 00:46:18 +00:00
luigi__ 0bdad85503 Added a table for alpha conversion from 5-bit to 4-bit. Avoids having the 3D layer slightly transparent where it should be opaque. 2009-01-14 22:33:43 +00:00
zeromus f5556d2a16 fix more of the same &0xF instead of &0x1F in shift ops problem, this time in arm opcodes. 2009-01-14 19:03:15 +00:00
zeromus 066681fce4 never mind; i have concluded that anyone who says they need the directx sdk is building an old version of the source. 2009-01-14 01:22:59 +00:00
zeromus dd9524bd3c try fixing directx sdk dependencies 2009-01-14 01:11:41 +00:00
luigi__ f49c15fdec Commented out the "depth write for alpha poly" stuff as it causes glitches more than everything else.
Changed the first depth func from GL_LESS to GL_LEQUAL, it fixes Z-fighting in some cases where the depth func is GL_LESS and two elements have the same depth.
2009-01-13 19:58:54 +00:00
riccardom 84e4fa02d3 Comment a variable used for already commented code. 2009-01-13 19:54:13 +00:00
luigi__ 1d9ba5599d Added the pos test coords to the savestate struct. 2009-01-13 19:44:33 +00:00
luigi__ 4ad158ce2f Implemented PosTest (I'm rapid, amn't I ? :P )
It fixes some mini-games in RRR2.
2009-01-13 19:29:47 +00:00
riccardom dc88d927bd Even more hardcore --enable-hardcore. 2009-01-13 19:25:51 +00:00
luigi__ 120d8f29eb Hooked up the gfx3d_glGet{Pos/Vec}Res funcs as I plan to implement these tests soon. 2009-01-13 19:19:40 +00:00
luigi__ 9a49138493 Changed the vertex transformation method so now we don't have to pass the projection matrices to OpenGL.
(I left the proj matrix cache commented so if this change causes problems, we can revert it easily)
2009-01-13 17:32:56 +00:00
gecko_reverse 30eb7eb773 added mic and addon files to cocoa port project files 2009-01-13 12:25:09 +00:00
zeromus 52b49c17e7 fix recently added bugs in texture caching and 4x4 textures 2009-01-13 05:58:06 +00:00
mtabachenko ec0b4547c6 core:
- more correctly IPC FIFO implementation;
2009-01-13 00:59:16 +00:00
riccardom 3f9c4cf341 Cleanup Modify_Layer() a bit more. 2009-01-12 22:41:19 +00:00
riccardom aa62c44724 White space cleanup. 2009-01-12 22:39:51 +00:00
riccardom af7702bb20 tiny style fix. 2009-01-12 21:10:35 +00:00
riccardom 70a8db3231 Try to fix rake compilation for mac port at least :) 2009-01-12 21:07:08 +00:00
riccardom 6340db8150 Move stub mic implementation for not win32 platforms to a separate file. 2009-01-12 20:48:31 +00:00
mtabachenko fd52754682 -fix windows port compiling; 2009-01-12 17:53:01 +00:00
luigi__ 840952a06a Fixed microphone problem 3 : the emu doesn't freeze anymore when closing it. 2009-01-12 16:41:57 +00:00
luigi__ a28d6c1d23 Surprise! Added support for microphone emulation, but only for Win32.
There are 3 problems : 
1. the sound crackles a bit
2. the microphone amplifier isn't supported
3. the emu freezes if you don't close it by the console
2009-01-12 16:17:18 +00:00
luigi__ 0fa4b42eb4 Surprise! Added support for microphone emulation, but only for Win32.
There are 3 problems : 
1. the sound crackles a bit
2. the microphone amplifier isn't supported
3. the emu freezes if you don't close it by the console
2009-01-12 16:17:03 +00:00
luigi__ 47db86ec02 Surprise! Added support for microphone emulation, but only for Win32.
There are 3 problems : 
1. the sound crackles a bit
2. the microphone amplifier isn't supported
3. the emu freezes if you don't close it by the console
2009-01-12 16:16:33 +00:00
mtabachenko c0cb8ee700 core:
- fix bug in IPC FIFO (https://sourceforge.net/tracker2/?func=detail&aid=2490867&group_id=164579&atid=832291)
2009-01-12 15:38:49 +00:00
mtabachenko 0caab415d6 rename variable 'i' in setupTexture to 'tx' :) 2009-01-11 10:41:00 +00:00
riccardom 4c322a586b Shut up last gcc signed vs unsigned comparison warnings 2009-01-11 10:26:00 +00:00
riccardom 28a9cb1091 Shut up some gcc warnings about functions without declaration, shadowing variables, unsigned vs signed comparison and no brackets around empty if. 2009-01-11 10:18:03 +00:00
mtabachenko 4cb74761c4 fix black screen in some games when using 3D (zeromus check it) 2009-01-11 09:21:00 +00:00
zeromus 7ea5ecfb17 clean up texture format conversion code, but rework it at same time to be more powerful and safer from making mistakes in the caching, although this is hard to test. also made it safe from textures and palettes which straddle texture and palette slots. i may have broken something, but now the code is much closer to where it needs to be. 2009-01-11 05:56:36 +00:00
zeromus 08f0a76fe2 fix bug in 3d h-scrolling which was introduced by new 3d compositing 2009-01-11 01:19:26 +00:00
luigi__ 5dfc89ca83 oops, I had forgotten to set gpu->bgPixels in one of the 3D pixel blitting funcs. 2009-01-10 23:23:18 +00:00
luigi__ 25c7d09e58 Fixed rotation. 2009-01-10 22:50:00 +00:00
zeromus c54e6f000d fix a typo in the symbol name irqExeption which has always bugged me 2009-01-10 22:00:43 +00:00
luigi__ 9690913aa0 Resize handling entirely remade, it should work flawlessly now, even under Vista.
Except there's still a display bug when using a rotation of 90 or 270 degrees :( but hopefully I should fix this quickly enough
2009-01-10 21:02:13 +00:00
riccardom 2fec8603f6 Add missing licence header. The original author is missing but we can add it later. 2009-01-10 17:47:05 +00:00
riccardom 31be283ff0 Remove whitespace on empty lines. 2009-01-10 17:16:58 +00:00
mtabachenko 8d3e0b19a4 core:
- fix cache texture palette;
2009-01-10 15:15:39 +00:00
mtabachenko 03650f2a53 fix Zelda crash :) 2009-01-10 14:53:01 +00:00
riccardom ac49e378d2 Add a default label to assure that paletteAddress is always initialized. 2009-01-09 21:00:06 +00:00
zeromus 3590579579 - fix emu crashing bug caused by error in rot bg routine
- remove all y-coordinate passing from GPU. these seemed almost entirely archaic, since we have a scanline based renderer. the current scanline can be stored in GPU. please, some GPU veterans consider for a moment whether this will be a problem.
2009-01-09 09:12:19 +00:00
zeromus e323960213 win32: fix spu wav writer 2009-01-09 08:10:14 +00:00
zeromus 750bd43ce2 fix the sbc assertion. we'll take these out in a few days. 2009-01-09 07:54:15 +00:00
zeromus 707121b826 add in assertions to validate overflow checks in adc and sbc 2009-01-09 07:49:15 +00:00
zeromus 974355f886 fix bug in thumb ROR 2009-01-09 07:20:29 +00:00
zeromus 175418bb21 - change around texture coordinate logic; this removes the necessity for a hack in texcoordgen mode 1 which had always bugged me (which was necessary to get scrolling textures to work). I don't know of any test cases offhand, but this should fix other texcoordgen modes as well.
- change texture palette decoding logic to be more correct. no known test cases for this, but it was clearly broken. this was a necessary step towards more correct texture memory mapping
2009-01-09 01:47:40 +00:00
yabause 86aa5d9800 Fixed compilation on linux 2009-01-09 00:02:57 +00:00
mtabachenko 0e4367f2a2 - hack for GBA slot with GBAgame. real BIOS is not needed now :) 2009-01-08 23:20:29 +00:00
shashClp d1172395c7 - Added missing key information on the windows readme 2009-01-08 22:14:32 +00:00
mtabachenko 7a85c9e85d core:
- add experimental GBA slot implementations (100% work only in Windows, need port to others os);
windows:
- add configuration dialog for GBA slot (Emulation->GBA slot);
- add new command line commands for GBA slot;

see remark in common.h at line 47
2009-01-08 21:34:16 +00:00
yabause 71b04380f1 Fixed compilation when gtkglext is not installed. 2009-01-08 20:06:02 +00:00
mtabachenko 96333a1907 fix winport compiling; 2009-01-08 08:22:44 +00:00
zeromus 9584a9b081 fix texture handling for texels with MSB set (fixes some texture corruption) 2009-01-08 02:49:30 +00:00
yabause d10d9c6690 Removed dependency on gdkglext as we already have one on
gtkglext.
2009-01-07 23:06:13 +00:00
yabause 2941e5c05b Ooops... there was two place were glActiveTexture was WIN32
protected.
2009-01-07 22:34:07 +00:00
yabause 7877dbaa9b Setting minimum needed automake version. 2009-01-07 21:08:47 +00:00
yabause cb7887b1ec Testing if opengl api version is < 1.3 instead of testing
if we're compiling on windows. This shouldn't break
anything and fix some compilation problems.
2009-01-07 20:55:56 +00:00
zeromus 5d3620d90f reverting my revert. now i understand that the vcproj files had the configurations renamed and the sln didnt know about them. to fix this, i recreated the sln file. 2009-01-05 22:16:25 +00:00
yabause 2bef4e40b8 Better initialization of gtkglext so it doesn't works
only for depth >= 24bpp
2009-01-05 22:13:42 +00:00
zeromus b82970ad10 something is seriously messed up in this vcproj. i cant build any release builds with it. reverted to fix it. 2009-01-05 21:49:15 +00:00
mtabachenko 41c0169530 core:
- delete doubled declaration of cnt_r variable (thanks xrmx)
2009-01-05 21:40:24 +00:00
yabause 16b8a8f174 Removed the custom debug code to use the desmume one. 2009-01-05 21:13:25 +00:00
mtabachenko 597570a733 typo fix in readme.win 2009-01-05 16:42:14 +00:00
riccardom 1320134c19 Remove unused global variables, windows frontend has them too. 2009-01-05 14:38:56 +00:00
mtabachenko d501721848 core:
- optimization in ipc fifo;
2009-01-05 14:23:43 +00:00
riccardom fb160ff827 Move display size and layers menu out of graphics menu; split frameskip, display size and submenu to separated functions. 2009-01-05 14:09:17 +00:00
riccardom 4f4b7278c3 Convert Cur_Keypad to a local variable 2009-01-05 13:16:31 +00:00
riccardom 671ec49d8d Correct type and cast from / to gpointers for G_CALLBACK argument 2009-01-05 13:00:12 +00:00
riccardom 06f0cce555 Handle OBJ layers in layer visibility switch, this brings feature parity with gtk-glade in this area. 2009-01-05 10:41:52 +00:00
riccardom 985cd76a5f Rework layer visibilty handling to be something sane, in the process fix subscreen layers that were not working. OBJs are still not handled. 2009-01-05 10:29:56 +00:00
riccardom 47905bafea Move GPU_screen to rgb loop in a helper function since it is repeated three times. 2009-01-04 23:22:36 +00:00
shashClp 6f8eda0414 Update general and windows READMEs 2009-01-04 16:05:14 +00:00
riccardom d99c069c8e Oops, fixup previous changes: missing free and correct cast in malloc. 2009-01-04 14:27:25 +00:00
riccardom 9db45c8477 This experimental patch avoids an intermediate step in sdl for rgb555 to rgb conversion. In my limited testing this gives me a couple more fps, possibly because of 1 less allocation and memcpy. 2009-01-04 14:24:42 +00:00
mtabachenko 6eb058bba3 - add extended version string;
winport:
- add to projects "release" solutions (for developers and beta versions 'Interim')
- change about dialog box :)
2009-01-04 11:43:00 +00:00
zeromus 39083243ed add changelog for homebrew fix 2009-01-04 00:35:22 +00:00
yabause 68fd04ca2c Added osmesa "backend" for OpenGL (off-screen) rendering
in gtk port.
This is enabled with --enable-osmesa configure switch and
shouldn't break (or change) anything when the switch is not
used.
If someone feels like porting that to glade port, go ahead...
but there's a number of opengl/gtkglext/etc. issues that will
need to be fixed first.
2009-01-03 23:37:26 +00:00
riccardom 7a245ef399 Disable ability to change screen size: it doesn't work and there's a lot of code that relies on default size. 2009-01-03 22:53:17 +00:00
riccardom 1411519bea Kill Modify_Key() related global variables and put them in a struct passed to the callback function. 2009-01-03 22:05:24 +00:00
yabause b893eddd17 AFAIK, the layout file was needed by dev-cpp and is useless
now.
2009-01-03 21:49:19 +00:00
riccardom fc31ff0d29 cleanup status bar code: convert pStatusBar_Change from macro to function, convert pStatusBar_Ctx from global to local 2009-01-03 21:10:56 +00:00
riccardom 0a351b29db gtk frontend: use ternary operator instead of if/else 2009-01-03 20:30:03 +00:00
riccardom b128934473 Move menu and toolbar creation to helper functions in gtk frontend to make
common_gtk_main() more readable.
In the process i had to do these changes:
- set limiter_timer to NULL because gcc warns it could be used uninitialized
- made pToolbar local instead of global static
- remove a double gtk_check_menu_item_set_active() call
2009-01-03 18:44:02 +00:00
riccardom 66a27544f3 More global to local varialbe converison. 2009-01-02 17:36:58 +00:00
riccardom 85a9c6e87d Remove unused global variables, move desmume_last_cycle from global to static in desmume_cycle(), no need to initialize static variables. 2009-01-02 16:47:39 +00:00
mtabachenko 9383c57874 - fix VERSION define; 2009-01-02 10:13:26 +00:00
mtabachenko 564da1a23a - fix Intel C++ windows port project; 2009-01-02 09:52:50 +00:00
zeromus 40c3451047 fix homebrew 3d--one issue, at least. one of the vram register writes wasnt storing into the MMU memory (only executing the reconfiguration logic); but devkitpro is reading back from that register in its function vramIsTextureBank() which is used to allocate texture memory. this system of acting upon register writes, and stuffing the values for use later for register reads, is disturbing and bugprone this way... someone should probably look for early returns from MMU writes and make sure none of them are illegitimate. 2009-01-02 08:20:37 +00:00
zeromus c0e351339f - re-enable the 'suspected invalid' logic in the texture cache after trying to fix what might have been broken in it, which was a failure to invalidate the cache when tex palettes changed.
- fix a bug which breaks any texture that spans a texture bank. this was only tested for 4bpp textures but applies to all but 4x4 and 16bpp
- I believe we were sending the 3d vblank end signal on the wrong scanline
2009-01-02 06:32:09 +00:00
riccardom 08e8a91daf Revert the thumb_instructions.cpp part of 1344 commit too 2009-01-01 23:43:48 +00:00
riccardom 04cfc7ae66 Revert changes from 1344: they break at least audio for me and Luigi__. 2009-01-01 23:28:54 +00:00
2213 changed files with 875143 additions and 93902 deletions

View File

@ -0,0 +1,19 @@
---
name: New Issue, Bug report, Question
about: New Issue, Bug report, Question
title: ''
labels: ''
assignees: ''
---
## State your operating system:
Windows/Mac/Linux. in case of linux, whether you use CLI, gtk2, or gtk3 version.
## DesMuME version
e.g. 0.9.13 or git master
## Isse
type here what's bothering you, in a detailed manner.

80
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: DeSmuME
on:
- push
- pull_request
jobs:
build:
name: Build DeSmuME (Linux)
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: install dependencies
run: sudo apt update && sudo apt install meson libsdl2-dev libpcap-dev libgtk-3-dev
- name: meson
run: |
cd desmume/src/frontend/posix/
meson build
- name: ninja
run: ninja -C desmume/src/frontend/posix/build
build_gtk2:
name: Build DeSmuME (Linux/GTK+2)
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: install dependencies
run: sudo apt update && sudo apt install autoconf libglu1-mesa-dev libsdl2-dev libpcap-dev libgtk2.0-dev
- name: buildit
run: |
cd desmume/src/frontend/posix/
autoreconf -i
./configure --prefix=/usr --enable-gdb-stub --enable-wifi
make -j8
make DESTDIR=/tmp/DeSmuME install
- name: Pack artifact
run: |
cd /tmp
tar cJf DeSmuME.tar.xz DeSmuME/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: desmume-linux-gtk2-cli-x86_64
path: /tmp/DeSmuME.tar.xz
build_macos:
name: Build DeSmuME (macOS)
runs-on: macos-14
steps:
- name: checkout
uses: actions/checkout@v4
- name: xcodebuild
run: |
cd desmume/src/frontend/cocoa/
xcodebuild archive -project "DeSmuME (Latest).xcodeproj" -scheme "DeSmuME (macOS App; Intel64 -- Latest Xcode)" -arch x86_64 -archivePath "$(pwd)/desmume.xcarchive" | xcpretty -c
- name: make zip
run: |
cd desmume/src/frontend/cocoa/desmume.xcarchive/Products/Applications/
7z a DeSmuME.app.zip DeSmuME.app
- name: Upload artifict
uses: actions/upload-artifact@v4
with:
name: macos
path: desmume/src/frontend/cocoa/desmume.xcarchive/Products/Applications/DeSmuME.app.zip
if-no-files-found: error

87
.github/workflows/build_interface.yml vendored Normal file
View File

@ -0,0 +1,87 @@
name: DeSmuME Interface (DLL/SO)
on:
- push
- pull_request
jobs:
build_linux:
runs-on: ubuntu-24.04
name: Build Linux
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install meson libsdl2-dev libpcap-dev
- name: Build - Meson
run: |
cd desmume/src/frontend/interface/
meson build
- name: Build - ninja
run: ninja -C desmume/src/frontend/interface/build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux
path: desmume/src/frontend/interface/build/libdesmume.so
build_macos:
runs-on: macos-14
name: Build MacOS
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install MacOS build deps
run: brew install coreutils sdl2 meson
- name: Build - Meson
run: |
cd desmume/src/frontend/interface/
meson build
env:
CC: clang
CXX: clang++
- name: Build - ninja
run: ninja -C desmume/src/frontend/interface/build
env:
CC: clang
CXX: clang++
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos
path: desmume/src/frontend/interface/build/libdesmume.dylib
build_windows:
runs-on: windows-2022
name: Build Windows
strategy:
fail-fast: false
matrix:
arch: [ 'x64', 'x86' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.arch }}
- name: Build
run: |
cd desmume\src\frontend\interface\windows
MSBuild.exe DeSmuME_Interface.vcxproj /p:configuration="Release Fastbuild" /p:Platform=${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: win-${{ matrix.arch }}
path: desmume/src/frontend/interface/windows/__bins/*.dll

30
.github/workflows/build_win.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: DeSmuME Windows build
on:
- push
- pull_request
jobs:
build-sln:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Build solution
run: |
SET CL=-Wno-c++11-narrowing
msbuild 'desmume/src/frontend/windows/DeSmuME.sln' /p:configuration="Release" /p:platform=x64 /p:CL_cgthreads=1 /p:CLToolExe=clang-cl.exe
cmd /c desmume\src\frontend\windows\ci_postbuild.bat
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: desmume-win-x64
path: desmume/src/frontend/windows/__bins/*.exe

43
.github/workflows/release_tarball.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Generate Source Tarball
# Trigger whenever a release is created
on:
release:
types:
- created
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: archive
id: archive
run: |
THISDIR="$PWD"
cd desmume/src/frontend/posix
autoreconf -i
cd "$THISDIR"
VERSION=$(printf "%s\n" ${{ github.event.release.tag_name }} | sed -e 's/^release_//' -e 's/_/./g')
PKGNAME="desmume-$VERSION"
mkdir -p /tmp/$PKGNAME
mv * /tmp/$PKGNAME
mv /tmp/$PKGNAME .
TARBALL=$PKGNAME.tar.xz
tar cJf $TARBALL $PKGNAME
echo "::set-output name=tarball::$TARBALL"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/x-xz

77
.gitignore vendored Normal file
View File

@ -0,0 +1,77 @@
/desmume/src/scmrev.h
/desmume/src/frontend/windows/defaultconfig/scmrev.h
/desmume/src/frontend/windows/.libs
/desmume/src/frontend/windows/.obj
/desmume/src/frontend/windows/__bins
/desmume/src/frontend/windows/*.tlog
/desmume/src/frontend/windows/*.aps
.vs/
*.user
*.suo
*.VC.db
*.VC.opendb
*.o
*.ipch
.deps
*.dirstamp
Makefile.in
/desmume/src/frontend/posix/missing
/desmume/src/frontend/posix/*.a
/desmume/src/frontend/posix/autom4te.cache
/desmume/src/frontend/posix/Makefile
/desmume/src/frontend/posix/aclocal.m4
/desmume/src/frontend/posix/configure
/desmume/src/frontend/posix/cli/Makefile
/desmume/src/frontend/posix/cli/desmume-cli
/desmume/src/frontend/posix/cli/doc/Makefile
/desmume/src/frontend/posix/compile
/desmume/src/frontend/posix/config.guess
/desmume/src/frontend/posix/config.log
/desmume/src/frontend/posix/config.status
/desmume/src/frontend/posix/config.sub
/desmume/src/frontend/posix/depcomp
/desmume/src/frontend/posix/gtk/Makefile
/desmume/src/frontend/posix/gtk/desmume
/desmume/src/frontend/posix/gtk/doc/Makefile
/desmume/src/frontend/posix/gtk-glade/Makefile
/desmume/src/frontend/posix/gtk-glade/desmume-glade
/desmume/src/frontend/posix/gtk-glade/doc/Makefile
/desmume/src/frontend/posix/install-sh
/desmume/src/frontend/cocoa/openemu/OpenEmuBase.framework/
/desmume/src/frontend/cocoa/OptimizationProfiles/
# Xcode
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
.vs/ProjectSettings.json
## Other
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Eclipse CDT generated files
/.autotools
/.cproject
/config.log
/.project
.DS_Store

277
ChangeLog
View File

@ -1,277 +0,0 @@
0.8 -> 0.9
There have been so many changes that this list can hardly be considered complete.
For this release, we have formatted the list into a high level overview of big changes and bad bugs relative to the previous release. Hopefully what you're interested in.
This list does not include items which are solely performance boosts, for let us just say that virtually every system has been speeded up.
* The savestate system is totally changed and incompatible with old savestates.
* The 3d system should be considered rewritten.
General/Core:
enh: Convert to c++
enh: Add functions for a lid open/close. Holding key (default "Backspace" in Windows port) while game is freeze/non freeze. [CrazyMax]
enh: Add secure area decryption from ndstool [zeromus]
enh: Change savestate code to support loosely bound chunks and more easily other parts of the emu (GE, GPU).
The savestate format is changed, but from now on it is in principle more resilient
(though it will continue to break as we tinker with the internals) [zeromus]
enh: Added SSE2 optimizations for matrices. Since we now make an SSE2 build, more optimizations can be made. [CrazyMax]
enh: Add a preliminary GUI hud system [CrazyMax,zeromus]
CPU/MMU:
bug: Many fixes in IPC and GE FIFOs. Fixes freezes in NSMB, dsracing, and others. [CrazyMax,luigi__,shash]
bug: Fix ARM instructions SBC and RSC (likewise SBC in thumb) [normatt]
bug: Fixed Thumb LDMIA (fixes ingame Dead'n'Furious) [shash]
bug: Fix repeating DMA (fixes NSMB parallax BG) [zeromus]
bug: Proper handling for unaligned CPU accesses [luigi__]
bug: Proper handling for undefined instruction exceptions [Salva Peiró]
enh: Remove 16MB of WRAM at 0x01****** from arm9. Mapped to unused instead. Nobody knows what this was. [zeromus]
enh: Changed instruction execution to 16 at a time blocks (tested and stable) [shash]
Hardware:
bug: Newer and better sqrt and div emulation; makes SM64DS playable [luigi__,shash,zeromus]
bug: Add preliminary RTC implementations [CrazyMax]
enh: Add cosine interpolation in the SPU (conditionally compiled) [zeromus,luigi__]
enh: Experimental: always one silent non-mixing SPU core at 44.1khz synched with emu, for more precision.
The audible core runs with the host, causing music to slow down but not tear or pitch bend. [zeromus]
Graphics:
- Overhaul 3d:
. Move entire GE to core emu.
. Move OpenGL renderer to emu core for optional use by platforms, removing ogl_collector. Now every platform shares the same 3d code.
. Reorganize 3d code to defer rendering to after 3d vblank. Eliminates tearing, and texturing artifacts. [zeromus]
. Move lighting model to software instead of using opengl's fixed function model [zeromus]
. Render shadow volumes; toon shading and highlight table [zeromus, luigi__]
. Added texture caching! big speed up. [CrazyMax]
bug: Many assorted tweaks and improvements to 3d and 2d precision [zeromus,CrazyMax,luigi__]
bug: Fixes to GE: command unpacking, projection and pos-vector mode matrix handling, mult and load commands [zeromus]
bug: Fix a bug in texture transformation mode 1 [zeromus]
bug: Fixed GPU rendering bugs in sprites and BG [CrazyMax]
bug: Fixes to texture conversion [CrazyMax,zeromus]
bug: Fixes in capture display (no blinking in many games with dual 3D) [CrazyMax]
bug: Fixes in master brightness (this fixes some games with black screens) [CrazyMax]
bug: Fixes in screen, backdrop, and sprite blending [luigi__]
bug: Changed clear depths and how depth initial values are calculated (fixes SM64DS skybox, Castlevania) [shash,lugi__]
bug: Add 3d layer h-scrolling [zeromus]
bug: Added transparency and fixed material alpha support and alpha testing on the 3D core [shash]
bug: Rewrite VRAM mapping control and rendering (more accurate) [CrazyMax,luigi__]
bug: convert colors to opengl better to prevent alpha=31 polys from being ever so slightly transparent [zeromus]
enh: Add MMU->GPU signal for when vram mappings change to function as a texture cache invalidate signal [zeromus]
enh: Make matrix 4x4 multiply routines use W-coordinate; carry w coord through pipeline [zeromus]
Mac OS X port:
bug: Fixed: Filenames and paths with unicode characters now work. [Jeff]
bug: Fixed: Load state from file button works again. [Jeff]
enh: Save State panel now pauses emulation while the file selection box is open. [Jeff]
bug: Fixed: Frozen video output (and/or messed 3d emulation) after loading a state. [Jeff]
bug: Added option to load the most recent file upon launching the program. [Jeff]
enh: Added French translation (thanks to Pierre Rudloff). [Jeff]
enh: Added basic key mapping configuration to application preferences (thanks to Julio GorgŽ). [Jeff]
enh: Added keyboard shortcuts for Execute, Pause and Reset command (thanks to Julio GorgŽ). [Jeff]
enh: Default key mappings are no longer case sensitive. [Jeff]
enh: Added ability to limit speed. [Jeff]
enh: Fixed: Video output should work on software-only 3D renderers. [Jeff]
Windows port:
bug: Fix a race condition in NDS_3D_Reset and NDS_glInit [zeromus]
bug: Fix the buggy auto frameskip logic which made the emu slow to a crawl. Now it runs fast! [zeromus]
bug: Fix resizing, rotate & aspect ration of main window. [CrazyMax,_zeromus]
bug: Remove multithreading from user interface after finding several synchronization issues [zeromus]
enh: recent roms menu [luigi_]
enh: Changed graphics render core to DirectDraw (work faster) [CrazyMax]
enh: Add an arm9 cpu load average calculator similar to no$. but I dont think it works right. [zeromus]
enh: Rewrite all debug tools (autoupdate works now) [CrazyMax]
enh: Rewrite input core & replace config input dialog [CrazyMax]
enh: Add AVI output [zeromus]
enh: Add pause toggle and frame advance hotkeys [adelikat]
enh: Add frame counter display and hud messages framework [adelikat]
enh: Main window remembers position, size, and a few other emu preferences [adelikat]
enh: Removed directx sdk dependency for easier building. [zeromus]
enh: Savestate doesnt unpause emu if it is already paused [adelikat]
0.7.3 -> 0.8
Cocoa:
- Save State As function now works. [Jeff B]
- Recent Items menu now works. [Jeff B]
- Opening NDS files from Finder now works. [Jeff B]
- Added screenshot feature. [Jeff B]
- Added preferences. [Jeff B]
- Many more strings are translatable now. [Jeff B]
- Default screen color is black (better represents being "off" and easier on eyes at night). [Jeff B]
- Added sound. [Jeff B]
- Now is a universal binary. [Jeff B]
- Leopard resolution icon added. [Jeff B]
- Added a Japanese translation. [Jeff B]
- Added an optional status bar (resize handle no longer overlaps screen). [Jeff B]
- New ROM Info and About DeSmuME windows have been added. [Jeff B]
- Fixed several bugs in window resizing. [Jeff B]
- Added FAT image support for homebrew games (thanks to TypeError). [Jeff B]
- Key config can be changed on the command line. Save/load hotkeys changed (so expose doesn't override). [Jeff B]
- Key bindings may work better on non-US keyboards now (needs testing). [Jeff B]
general:
- Encapsulate GDB debug stub to avoid certain problems [shash]
- Fixed CPU LD*/ST* bugs [shash]
- Fixed New SMB mini-games freeze [shash]
- Fixed possible segfault in ROMReader on ia64 and amd64. [evilynux]
- Fixed a crash bug with 2D background corrupting memory [shash]
- Flag check optimization [carlo_bramini]
- Applied some endian fixes in GPU (thanks to Phazz) [Jeff B]
gtk-glade:
- Added DeSmuME version in about dialog. [evilynux]
- Updated website url in about dialog. [evilynux]
- Added Brazilian Portuguese translation by Dreampeppers99. [evilynux]
- Better desktop menu entry following FreeDesktop specifications. [evilynux]
gtk:
- Updated website url in about dialog. [evilynux]
- Better desktop menu entry following FreeDesktop specifications. [evilynux]
windows port:
- Added an "about" box [shash]
- DirectInput control interface with joystick support [CrazyMax]
- Matrix and Light viewer [Acid Burn]
0.7.2 -> 0.7.3
gtk-glade:
- Full localization using intltool/gettext. [evilynux]
general:
- Added a README.TRANSLATION documenting the localization process. [evilynux]
MacOS X:
- Initial version of the Mac interface added. [Jeff B]
0.7.1 -> 0.7.2
spu:
- big endian fixes. [cyberwarriorx]
gpu:
- big endian fixes. [marcus_c]
gtk-glade:
- opengl improvements. [masscat]
general:
- Added support for setting NDS firmware language value. [masscat]
- Function added for setting firmware language. [masscat]
- Mac/msys compilation fixes. [cyberwarriorx]
- Fix compilation when pkg-config macros are not available [evilynux]
0.7.0 -> 0.7.1
general:
- Added GDB debugger stub [masscat]
- Added new/different GBAMP CFlash image reader/writer [masscat]
gpu:
- Major speedup to the 2D core [shash]
gtk-glade:
- Added command line options. [masscat]
- Added FPS limiter [masscat]
cli:
- Added command line options. [masscat]
- Added FPS limiter [masscat]
- Added option to use OpenGl to render window (allows resizing). [masscat]
windows port:
- Added command line options. [masscat]
- Added multiple language support [cyberwarriorx]
- Added Danish language translation [thomas-2007]
0.6.0 -> 0.7.0
general:
- Added support for *.duc files [cyberwarriorx]
gpu:
- Added support for sprite rotation/scaling [shash]
- Added support for the 3D core (openGL and null plugins) [shash]
windows port:
- A bunch of fixes [Dmitry Krutskih]
- Fixed a bug in sound that was causing it to still not work for some
people [cyberwarriorx]
gtk:
- Added 3D emulation
- Added command line options.
- Added option to use OpenGL to render window (allows resizing).
gtk-glade:
- Added 3D emulation
0.5.0 -> 0.6.0
general:
- Added zipped (based on zziplib) and gzipped (based on zlib) rom support.
arm:
- Added relocation interrupt vector.
- Added region access right checks.
- Enabled LDC/STC instructions.
- Fixed powersave (cp15) IRQ wait.
- Fixed MOV instructions
gpu:
- Added special color effects.
- Added windowing feature.
- Fixed transparent direct color backgrounds.
- Fixed disabled sprites showing.
- Fixed 8/32 bit access to gpu registers.
- Fixed missing backgrounds
- Support for master brightness
wifi:
- Added RF chip interface.
- Added BB chip interface.
windows port:
- Fixed address calculation in disassembler.
- Added Force Maintain Ratio option for window stretching
linux port (cli, gtk and gtk-glade):
all:
- Added joystick support.
- Fixed X and Y buttons.
gtk-glade:
- Added joystick configuration.
- Improved I/O registers viewer tool.
- Added save and load states support.
0.3.3 -> 0.5.0
arm:
- Fixed MSR with immediate value opcode.
- Fixed LSR_0 thumb opcode (C flag is correctly set now).
- Fixed LDR*/STR* opcodes.
- Fixed unaligned memory access on THUMB Core.
- Added relocating SWI routines.
bios:
- Added decompression functions.
- Added GetPitchTable function.
- Added GetVolumeTable function.
- Added GetCRC16 function.
- Added experimental SoundBias function.
- Added GetSineTable function.
cart:
- Added CompactFlash/FAT emulation.
- Added Get ROM chip ID Cartridge command.
gpu:
- Added framebuffer emulation.
- Fixed a bug in GPU (xfin could be greater than LG causing a segfault).
- Added support for Display Mode 0(Display Off).
- Added the basic framework for Display Mode 3(Display from Main RAM).
spu:
- Added sound emulation.
- Added sound core system.
- Added WAV write core.
- Added dummy core.
- Added Direct Sound core.
linux port:
- Added GTK+ GUI.
- Added command line interface.
- Added stylus and arm9 keypad support in CLI version.
- Added FPS display.
- Added basic frameskip.
windows port:
- Fixed a bug when displaying a ROM's information.
- Added key configuration.
- Removed the debug key.
- Added new experimental auto frameskip/frame limit code.
- Added sound settings dialog.
- Added a few menu options for accessing the website, forums, and for
submitting bugs.
general:
- Rewrote code in C.
- Fixed warnings.
- Used defines and typedef's to make things more portable and easier to
read.
- Added autotools stuff.
- Changes to logging system.
- Added screenshot function.
- Translated most french to english.
- Added savestate support.
- Added firmware reading support(needs work).
- Added Backup Memory support with autodetection.
- Fixed some endianess issues.
- Fixed things so Visual C++ can compile code.
- Added bsd support.
- Reworked ROM loading so you can load a different rom without any problems.
- Finished NDS_Reset. Now the emulation can be reset even while running.

237
INSTALL
View File

@ -1,237 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -1,5 +0,0 @@
EXTRA_DIST = README.LIN README.MAC README.WIN README.TRANSLATION autogen.sh \
$(PO_FILES_IN)
DISTCLEANFILES = $(PO_FILES)
SUBDIRS = $(PO_DIR) src

69
README
View File

@ -1,69 +0,0 @@
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 DeSmuME team
1) Introduction.............................................13
2) Staff/Thanks.............................................36
3) Contact information......................................72
4) Disclaimer...............................................82
1 Introduction________________________________________________
DeSmuME is a Nintendo DS emulator under GNU GPL.
DeSmuME can boot homebrew and games, some of which are
playable.
For installation/how to use informations, check the ports
specific README files:
* README.LIN for the linux port
* README.WIN for the windows port
* README.MAC for the mac port
2 Staff/Thanks________________________________________________
See the AUTHORS file for team members list.
Thanks to:
* yopyop (original author of DeSMUME),
for releasing the source code of this great emulator.
* Martin Korth (author of GBATEK),
for his well-written Gameboy Advance and Nintendo DS
documentation.
3 Contact information_________________________________________
E-mail: guillaume.duhamel@gmail.com
Web: http://desmume.org
IRC: irc://irc.freenode.net/desmume
Please don't ask for roms, bios files or any other
copyrighted stuff.
4 Disclaimer__________________________________________________
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be
useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
See the GNU General Public License details in COPYING.

View File

@ -1,177 +0,0 @@
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 DeSmuME team
1) Compiling instructions...................................13
2) How to use DeSmuME.......................................53
3) Contact information......................................142
4) Disclaimer...............................................160
1 Compiling instructions______________________________________
DeSmuME is written in C using the gtk+ and SDL libraries.
So you need a working C compiler, such as gcc and
the above libraries runtime and development packages:
* http://www.gtk.org
* http://www.libsdl.org/
Once these libraries are installed, you should be ready to
install DeSmuME.
DeSmuME provides another interface based on libglade, to use
it, you'll need glade:
* http://glade.gnome.org/
1.1 From a release archive____________________________________
Uncompress the DeSmuME archive, move to the newly created
directory, type "./configure", then "make".
It will generate three programs:
1) "desmume" in the "src/gtk" directory;
2) "desmume-cli" in the "src/cli" directory.
If glade is installed on your system, you'll get a third
binary:
3) "desmume-glade" in the "src/gtk-glade" directory.
You can even type "make install" to install those programs on
your system (in /usr/local/ by default), then uninstalling is
done by typing "make uninstall".
1.2 From a CVS copy___________________________________________
Move to the toplevel directory (the one that contains the
configure.ac file). Type "./autogen.sh" to generate the
configure/install scripts and needed Makefiles. Then you can follow the
same procedure as in 1.1 .
2 How to use DeSmuME__________________________________________
There are three versions of DeSmuME under Linux. These are a
Gtk+ build, a Glade build and a CLI SDL build. All these builds
have some common command line options:
--disable-limiter Disables the 60 fps limiter
--soft-convert Use software colour conversion during OpenGL
screen rendering. May produce better or worse
frame rates depending on hardware.
--arm9gdb=PORT_NUM Enable the ARM9 GDB stub on the given port
--arm7gdb=PORT_NUM Enable the ARM7 GDB stub on the given port
--cflash=PATH_TO_DISK_IMAGE
Enable disk image GBAMP compact flash emulation
--help Display this message
NOTE:
The Gtk+ and Glade builds use gtkGLext to handle the OpenGL
rendering and contexts. You may get improved performance by
also passing the argument --gdk-gl-force-indirect. This has
been seen to improve things for Nvidia based graphics cards
under Linux.
GDB Debugger Stubs:
Source level debugging of ARM9 and/or ARM7 code is supported
using a GDB/Insight debugger.
The GDB stubs are enabled from the command line using the
following options:
--arm9gdb=<PORT_NUM> (for the ARM9)
--arm7gdb=<PORT_NUM> (for the ARM7)
The PORT_NUM is the TCP port upon which the stub will listen for
connections. Once enabled you can connect to the stub using the
following command at the GDB debugger prompt (assuming GDB and
DeSmuME are running on the same machine):
target remote :<PORT_NUM>
NOTE: there are problems with the ARM support when stepping code
with GDB versions prior to version 6.6. It is recommended that
you use at least version 6.6 if possible.
GBAMP compact flash emulation:
The default behaviour of DeSmumME is to attempt to emulate the
FAT image for the contents of the directory where the running
.nds file was located.
This behaviour can be altered using the
--cflash=<DISK_IMAGE_FILE> command line option. Using this
option DeSmuME will emulation a GBAMP and read and write sectors
from/to the disk image file.
The disk image file must be created and populated with files
using some external tool.
NOTE: currently if desmume fails to open the disk image file it
will silently continue minus a working GBAMP emulation.
2.1 Gtk+ version______________________________________________
Type "desmume" in a shell, a window should appear, then open
a rom file using the "open" button, next use the "run" button
to start emulation.
The following command line options are specific to the Gtk+
build:
--opengl-2d Enables using OpenGL for screen rendering
--disable-sound Disables the sound emulation
--disable-3d Disables the 3D emulation
2.2 CLI SDL version_______________________________________________
Just type "desmume-cli path-to-a-rom" in a shell.
The following command line options are specific to the CLI
build:
--opengl-2d Enables using OpenGL for screen rendering
--disable-sound Disables the sound emulation
3 Contact information_________________________________________
General inquiries should go to:
E-mail: guillaume@desmume.org
Linux Port-related inquiries should go to:
E-mail: guillaume@desmume.org
Web: http://desmume.org
Please don't ask for roms, bios files or any other copyrighted
stuff.
If you want to submit a bug report, please run desmume, go into
the "Help" menu, and click on "Submit a bug report". If you're
having trouble with it, please feel free to email.
4 Disclaimer__________________________________________________
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be
useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
See the GNU General Public License details in COPYING.

View File

@ -1,107 +0,0 @@
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 DeSmuME team
1) Compiling instructions...................................13
2) How to use DeSmuME.......................................31
3) Contact information......................................73
4) Disclaimer...............................................90
1 Compiling instructions______________________________________
DeSmuME is written in C, and the Cocoa interface was written
in Objective-C. It uses the Cocoa, OpenGL, and [optionally]
the zlib library.
So you need a working C and Objective-C compiler, such as
GCC for Mac OS X.
* Cocoa and OpenGL come standard with Mac OS X
* zlib can be found at http://www.zlib.net, and may
also come with Mac OS X.
DeSmuME for Mac OS X can be compiled using the XCode IDE
or the CodeBlocks IDE. Project files are available in the
Cocoa source folder.
2 How to use DeSmuME__________________________________________
To install DeSmuME, copy DeSmuME.app into the folder of your
choice (Applications folder is recommended). You can also drag
it to your dock for quicker launching.
Double click the application to launch DeSmuME.
Most options can be found in the menu bar a the top of the
screen. On Leopard, you can use the search box under the help
menu to find things.
DeSmuME for Mac OS X does not support all the features of the
Linux and Windows versions.
Click the lower screen for DS touch-screen input.
Key mappings can be changed or viewed from the preferences
panel. Here are the defaults (may be subject to change):
up arrow - Up
left arrow - Left
down arrow - Down
right arrow - Right
v - A button
b - B button
g - X button
h - Y button
c - Left Trigger
n - Right Trigger
enter - Start button
space - Select button
States can be saved with shift + number keys.
States can be loaded with the number keys.
To set up a FAT disk image (for homebrew apps) you can use the
"Emulation > Set FAT Image File" option in the menu. You can
also set this from the command line by launching DeSmuME
inside its app bundle:
DeSmuME.app/Contents/MacOS/DeSmuME -FlashFile /path/to/file.img
3 Contact information_________________________________________
General inquiries should go to:
E-mail: guillaume.duhamel@gmail.com
Mac OS X Port-related inquiries should go to:
E-mail: osx@desmume.org
Web: http://desmume.org
Please don't ask for roms, bios files or any other copyrighted
stuff.
If you want to submit a bug report, please run desmume, go
into the "Help" menu, and click on "Submit a bug report". If
you're having trouble with it, please feel free to email.
4 Disclaimer__________________________________________________
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be
useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
See the GNU General Public License details in COPYING.

View File

@ -1,169 +0,0 @@
__________________________ Localization of DeSmuME _____________________________
Users and translators:
1) Supported UIs
2) Starting a new translation
3) Editors
4) Contact Us
Developpers:
5) Creating translation friendly strings (gtk-glade)
6) Updating the template (gtk-glade)
7) Integrating new translations
1 Supported UIs ________________________________________________________________
Although there are 4 UIs, only 3 currently support localization:
windows, gtk-glade, and Cocoa (Mac OS X).
To translate DeSmuME, see "Starting a new translation" below.
If you have created a new translation, or improved an existing one, please
send us your translation by getting in touch with us: see "Contact Us" below.
1.1 gtk-glade UI _____________________________________________________________
Localization is done with gettext. gettext uses po files.
The po files are located in the po/ folder.
Note that there is one po file per language.
To use the available translations, set up your environment properly.
e.g. under GNU/Linux you can verify that the value of your LANG variable.
1.2 Windows UI ______________________________________________________________
Localization is located in one single file: src/windows/resources.rc .
1.3 Mac OS X (Cocoa) UI _____________________________________________________
Localization files are located within the application bundle (in Finder right
click on DeSmuME and select "Show Package Contents"). Within the
Contents/Resources folder there is a folder for each localization.
2 Starting a new translation ___________________________________________________
2.1 gtk-glade UI _____________________________________________________________
Grab a copy of po/desmume.pot and rename it.
You can use the two letter iso code of the language as the filename
e.g. fr.po
or you can specify the country code as well
e.g. fr_CA.po
Open the newly created file with an editor: see "Editors" below.
Translate the strings.
2.2 Windows UI _______________________________________________________________
Grab a copy of src/windows/resources.rc .
Create a section for your language by looking at another language e.g. french.
Translate the strings.
2.3 Max OS X (Cocoa) UI ______________________________________________________
Copy and paste one of the localization folders mentioned in 1.3.
Rename the part before ".lproj" to the language of the translation.
Within your newly created folder edit "Localizable.strings".
The MainMenu.nib opaque folder also contains localization of the Application
menu, however since this is a standard menu in Mac OS X, for most languages
standard strings can be generated by Apple's Interface Builder.
The strings file should stay in UTF-16 encoding (UTF-8 or others may work,
but UTF-16 is preferred).
If your strings file has an error, no translated strings will show in DeSmuME.
Debugging the string file:
If you have Mac OS X developer tools installed, from the console you can type
"plutil FILE", replacing FILE with the name and path of the string file, and
it will tell you if there are any errors (and on what line).
3 Editors ______________________________________________________________________
You can use plain text editors but there are many po file editors.
Here are some recommanded po editors, in no particular order.
3.1 GNU/Linux ________________________________________________________________
- gtranslator: http://gtranslator.sourceforge.net/
- KBabel: http://kbabel.kde.org/
3.2 OSX ______________________________________________________________________
- LocFactory Editor:
http://www.triplespin.com/en/products/locfactoryeditor.html
3.3 All platforms ____________________________________________________________
- poEdit: http://www.poedit.net/
- OmegaT: http://www.omegat.org/omegat/omegat.html
- GNUEmacs/XEmacs/AquaEmacs with po-mode
- Vim with PO ftplugin
- Eclipse with gted
4 Contact Us ___________________________________________________________________
As there isn't many translations so far, we're still asking you to get in touch
via the forum located at http://forums.desmume.org/ .
You can upload your translation files to your favorite sharing site and paste
the link in a post under General.
5 Creating translation friendly strings (gtk-glade) ____________________________
5.1 In the code ______________________________________________________________
Make sure libintl.h is included and that _() is defined.
e.g. see src/gtk-glade/globals.h
Add the filename to po/POTFILES.in if it's not already there.
Where you would use "my text", use _("my text").
For long strings, for translators' sanity, please do something like:
printf( _(" This is a\n\
very long text\n") );
5.2 Glade interface __________________________________________________________
You have nothing special to do aside from adding the filename to
po/POTFILES.in.
6 Updating the template (gtk-glade) ____________________________________________
To update po/desmume.pot, move to the po/ folder and execute "make update-po".
7 Integrating new translations
7.1 gtk-glade UI _____________________________________________________________
Add the new po file to po/ .
Add the new language to ALL_LINGUAS in configure.ac .
Regenerated the build files (./autogen.sh) and rebuild (./configure && make).
You can also add the language to po/LINGUAS (it's a convention? it has no effect).
7.2 Windows UI _______________________________________________________________
Update the src/windows/resource.rc .
Add the new language to to the list in src/windows/resource.h .
Rebuild.
7.3 Max OS X (Cocoa) UI ______________________________________________________________
After following the steps in 2.3, your translation is ready to go.
You can set the DeSmuME language one of three ways:
1) Set the system language (System Preferences -> International).
2) Right click on DeSmuME in Finder, select Get Info and disable the other translations.
3) From a command line, run the following line after replacing LANG with the language:
DeSmuME.app/Contents/MacOS/DeSmuME -AppleLanguages '<array><string>LANG</string></array>'
All of these methods require a restart of DeSmuME.

View File

@ -1,201 +0,0 @@
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 DeSmuME team
1) Compiling instructions...................................13
2) How to use DeSmuME.......................................51
3) Contact information.....................................166
4) Disclaimer..............................................184
1 Compiling instructions______________________________________
DeSmuME is written in C, using the DirectX 8.0, OpenGL, zlib,
zziplib libraries, so you need a working C compiler(such as
mingw). Other supported compilers include Visual C++ 2005 and
dev-cpp.
* You can find DirectX headers and libraries(for mingw) at
http://alleg.sourceforge.net/wip.html as the file
"dx80_mgw.zip". The actual runtime libraries(or
headers/libraries for MSVC) can be gotten from
http://www.microsoft.com/DirectX
* OpenGL should be included with your compiler, if it isn't,
check on your compiler's website for links.
* zlib can be found at http://www.zlib.net
* zziplib can be found at http://zziplib.sourceforge.net
mingw:
All you have to do now is go into your mingw shell
environment, go into the directory where you extracted DeSmuME,
and type: "./configure". Once that's done(and there was no
errors), type: "make". It should now take some time to compile so
go grab yourself a sandwich or beer - whatever suits your fancy
and it should be done in a few minutes. Now all you have to do is
type "./src/desmume" in order to run it.
dev-cpp:
Load the project file DeSmuME.dev in the src/windows directory,
compile, and you're set.
Visual C++:
Load the project file DeSmuME.vcproj in the src/windows directory,
compile, and you're set.
2 How to use DeSmuME__________________________________________
Execute "desmume". A new window should pop up. The default
settings should be fine for most people, but in case you need to
adjust them, here's a brief explanation:
Under the "Config", there are a number of items:
Save Type:
Here you can select which type of Backup Memory DeSmuME should
emulate. By default, Autodetect works fine, but in some cases
DeSmuME doesn't correctly detect the Backup Memory. In that
case, you will want to select the correct one.
Control Config:
Here you can change the default key mappings. For now only the
keyboard is supported, but in the near future gamepads and
joysticks will be supported.
Here are the default key mappings(they may be subject to change):
Up arrow - Up
Left arrow - Left
Down arrow - Down
right arrow - Right
v - A button
b - B button
g - X button
h - Y button
c - Left Trigger
n - Right Trigger
enter - Start button
space - Select button
Sound Settings:
Here you can change the default sound settings. By default
DeSmuME uses Direct Sound, a buffer size of 2940, and
volume set to max. But if you want to mute the sound, you can
set the sound core to none. Or if you want to save the sound
to a file, you can set the sound core to WAV write. If you find
the sound is crackling a lot, try increasing the buffer size. On
the other hand, if you find the sound somewhat delayed or jumpy,
try decreasing the buffer size.
Frame Skip:
Here you can adjust the amount of frame draws to skip during
emulation. Normally the emulator detects whether the emulator
is running too fast or slow and skips a frame or more if it
needs to speed things up. However some people don't like the
results of it, so here you can adjust that.
After all the settings are set to your satisfaction, you can then
load a ROM image by going into the "File" menu, and choosing
"Open". Select which file you'd like to open, and the emulator
will automatically load and start running the selected ROM.
You can save the current emulation state by press shift + one of
the twelve F keys. To load, just press one of the twelve F keys
(without shift pressed).
Under the View menu there's also a few additional options you may
wish to change.
Rotation:
Here you can adjust which angle of the display. Some programs
require that you normally turn the DS on its side. You can set it
up in that manner using this.
Magnify/DeMagnify:
With these options you can increase or decrease the window size.
Note: You can also adjust the window size by clicking on the edge
of the window, and dragging the mouse.
Force Maintain Ratio:
Sometimes when the window size is changed it's doesn't look
correct on the screen. This option forces the window to maintain
a correct ratio so it looks correct.
GDB Debugger Stubs:
Source level debugging of ARM9 and/or ARM7 code is supported
using a GDB/Insight debugger.
The GDB stubs are enabled from the command line using the
following options:
--arm9gdb=<PORT_NUM> (for the ARM9)
--arm7gdb=<PORT_NUM> (for the ARM7)
The PORT_NUM is the TCP port upon which the stub will listen for
connections. Once enabled you can connect to the stub using the
following command at the GDB debugger prompt (assuming GDB and
DeSmuME are running on the same machine):
target remote :<PORT_NUM>
NOTE: there are problems with the ARM support when stepping code
with GDB versions prior to version 6.6. It is recommended that
you use at least version 6.6 if possible.
GBAMP compact flash emulation:
The default behaviour of DeSmumME is to attempt to emulate the
FAT image for the contents of the directory where the running
.nds file was located.
This behaviour can be altered using the
--cflash=<DISK_IMAGE_FILE> command line option. Using this
option DeSmuME will emulation a GBAMP and read and write sectors
from/to the disk image file.
The disk image file must be created and populated with files
using some external tool.
NOTE: currently if desmume fails to open the disk image file it
will silently continue minus a working GBAMP emulation.
3 Contact information_________________________________________
General inquiries should go to:
E-mail: guillaume@desmume.org
Windows Port-related inquiries should go to:
E-mail:
Web: http://desmume.org
Please don't ask for roms, bios files or any other copyrighted
stuff.
If you want to submit a bug report, please run desmume, go into
the "Help" menu, and click on "Submit a bug report". If you're
having trouble with it, please feel free to email.
4 Disclaimer__________________________________________________
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be
useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
See the GNU General Public License details in COPYING.

6
README.md Normal file
View File

@ -0,0 +1,6 @@
# DeSmuME
[![AppVeyor CI Build Status](https://ci.appveyor.com/api/projects/status/abfd7jm09wnmxyvu?svg=true)](https://ci.appveyor.com/project/zeromus/desmume)
DeSmuME is a Nintendo DS emulator.
http://desmume.org/download

View File

@ -1,14 +0,0 @@
#!/bin/sh
# intltoolize is optionnal as it's only required for the gtk-glade UI.
if test ! "x$(which intltoolize)" = "x"; then
echo "Running intltoolize"
intltoolize --copy --force --automake
else
if test ! "x$(which gintltoolize)" = "x"; then
echo "Running gintltoolize"
gintltoolize --copy --force --automake
fi
fi
autoreconf --install --force --verbose

View File

@ -1,39 +0,0 @@
# -*-shell-script-*-
[Meta]
RootName: @desmume.sf.net/desmume:$SOFTWAREVERSION
DisplayName: DeSmuME Nintendo DS Emulator
ShortName: desmume
Maintainer: Guillaume Duhamel <guillaume.duhamel@gmail.com>
Packager: Guillaume Duhamel <guillaume.duhamel@gmail.com>
Summary: DeSmuME is a Nintendo DS emulator.
URL: http://desmume.sf.net/
License: GNU General Public License, Version 2
SoftwareVersion: @VERSION@
AutopackageTarget: 1.0
[Description]
This is a Nintendo DS emulator.
[BuildPrepare]
prepareBuild
[BuildUnprepare]
unprepareBuild
[Imports]
echo '*' | import
[Prepare]
# Dependency checking
require @gtk.org/gtk 2.4
[Install]
# Put your installation script here
installExe bin/desmume
installExe bin/desmume-cli
installExe bin/desmume-glade
[Uninstall]
# Usually just the following line is enough to uninstall everything
uninstallFromLog

142
compile
View File

@ -1,142 +0,0 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -1,246 +0,0 @@
dnl --- Package name is first argument to AC_INIT
dnl --- Release version is second argument to AC_INIT
AC_INIT(desmume, [0.9])
dnl -- find target architecture for some os specific libraries
AC_CANONICAL_TARGET
case $target in
*linux*) desmume_arch=linux;;
*mingw*) desmume_arch=windows;;
*darwin*) desmume_arch=linux;;
*bsd*) desmume_arch=linux;;
esac
AC_SUBST(desmume_arch)
AM_INIT_AUTOMAKE
dnl -- make sure we have a C compiler
AC_PROG_CC
dnl -- make sure we have a c++ compiler
AC_PROG_CXX
dnl -- use ranlib for libraries
AC_PROG_RANLIB
dnl -- check for endianess
AC_C_BIGENDIAN
dnl --- Other prerequisites ---
dnl - Check for pkg-config macros
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG])
dnl - Check for intltool/gettext macros
m4_ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL])
dnl - Check for zlib
AC_CHECK_LIB(z, gzopen)
dnl - Check for zziplib
AC_CHECK_LIB(zzip, zzip_open)
dnl - Check for SDL
AC_PATH_PROGS(SDLCONFIG, [sdl-config sdl11-config])
if test ! "x$SDLCONFIG" = "x" ; then
SDL_CFLAGS=`$SDLCONFIG --cflags`
SDL_LIBS=`$SDLCONFIG --libs`
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
HAVE_SDL="yes"
else
HAVE_SDL="no"
fi
dnl - Check for the OpenGL includes
AC_CHECK_HEADERS([GL/gl.h])
AC_CHECK_HEADERS([GL/glu.h])
dnl - Check for GTK and/or libglade
GLIB_VER=2.8
GTK_VER=2.6
AC_CHECK_TOOL(HAVE_PKG, pkg-config)
AC_PROVIDE_IFELSE([PKG_PROG_PKG_CONFIG], [
if test ! "x$HAVE_PKG" = "x" ; then
PKG_CHECK_MODULES(GLIB,
glib-2.0 >= $GLIB_VER,
HAVE_GLIB=yes,
HAVE_GLIB=no)
if test "$HAVE_GLIB" = "no"; then
AC_MSG_ERROR([glib-2.0 >= $GLIB_VER is required to build desmume gtk frontend])
fi
PKG_CHECK_MODULES(GTK,
gtk+-2.0 >= $GTK_VER,
HAVE_GTK=yes,
HAVE_GTK=no)
if test "$HAVE_GTK" = "no"; then
AC_MSG_ERROR([gtk-2.0 >= $GTK_VER is required to build desmume gtk frontend])
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(GTKGLEXT,
"gtkglext-1.0",
HAVE_GTKGLEXT=yes,
HAVE_GTKGLEXT=no)
AC_SUBST(GTKGLEXT_CFLAGS)
AC_SUBST(GTKGLEXT_LIBS)
PKG_CHECK_MODULES(GTHREAD,
"gthread-2.0",
HAVE_GTHREAD=yes,
HAVE_GTHREAD=no)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
AC_CHECK_LIB(gdkglext-x11-1.0, gdk_gl_init)
PKG_CHECK_MODULES(LIBGLADE,
"libglade-2.0",
HAVE_LIBGLADE=yes,
HAVE_LIBGLADE=no)
AC_SUBST(LIBGLADE_CFLAGS)
AC_SUBST(LIBGLADE_LIBS)
dnl uninstalled glade ui dir
AC_DEFINE_UNQUOTED(GLADEUI_UNINSTALLED_DIR,"`pwd`/src/gtk-glade/glade/",[path to glade ui dir])
AC_SUBST(GLADEUI_UNINSTALLED_DIR)
fi
],[
echo "WARNING: pkg-config is not available therefore gtk and gtk-glade UIs are not available either."
])
dnl - If the gtkGLext package is available define the corresponding C macro
if test "x$HAVE_GTKGLEXT" = "xyes"; then
AC_DEFINE([GTKGLEXT_AVAILABLE], [1])
fi
dnl - Determine which UIs to build and if po/ should be included
PO_DIR=""
PO_FILES=""
PO_FILES_IN=""
if test "x$HAVE_SDL" = "xyes"; then
# SDL adds just a cli
UI_DIR="cli $UI_DIR"
if test "x$HAVE_GTK" = "xyes"; then
# GTK requires SDL
UI_DIR="gtk $UI_DIR"
fi
if test "x$HAVE_LIBGLADE" = "xyes"; then
AC_PROVIDE_IFELSE([IT_PROG_INTLTOOL],[
# libglade requires SDL too
UI_DIR="gtk-glade $UI_DIR"
dnl -- localization for gtk-glade UI
GETTEXT_PACKAGE=desmume
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the gettext package name])
AC_SUBST(GETTEXT_PACKAGE)
ALL_LINGUAS="fr pt_BR"
AM_GLIB_GNU_GETTEXT
PO_DIR="po"
PO_FILES="intltool-extract intltool-merge intltool-update"
PO_FILES_IN="intltool-extract.in intltool-merge.in intltool-update.in"
PO_MAKEFILE="po/Makefile.in"
],[
echo "WARNING: intltool and/or gettext are not available therefore the gtk-glade interface won't be installed. The gtk-glade UI requires intltool and gettext."
])
fi
fi
dnl Set compiler library flags per target.
case $target in
*linux* | *bsd*)
LIBS="$LIBS -lGL -lGLU"
;;
*mingw*)
LIBS="$LIBS -ldxguid -ldxerr8 -ldsound -lopengl32 -lws2_32 -mwindows"
UI_DIR="windows"
;;
*darwin*)
LIBS="$LIBS -framework OpenGL"
;;
esac
AC_SUBST(UI_DIR)
AC_SUBST(PO_DIR)
AC_SUBST(PO_FILES)
AC_SUBST(PO_FILES_IN)
dnl - Gdb stub
AC_ARG_ENABLE(gdb-stub,
[AC_HELP_STRING(--enable-gdb-stub, enable gdb stub)],
[
AC_DEFINE(GDB_STUB)
wantgdbstub=yes
])
AM_CONDITIONAL([HAVE_GDB_STUB], [test "${wantgdbstub}" = "yes"])
dnl - Compiler warnings
# for developer use, enable lots of compile warnings,
# but don't require this generally, because some system's
# header files (BSD) can't handle it
#
# NB: must add -Werror after AC_PROG_CC, etc., so do this last
AC_ARG_ENABLE(hardcore,
[AC_HELP_STRING(--enable-hardcore, turn on -W -Wall -Werror)],
[case "${enableval}" in
yes) ENABLE_HARDCORE=1 ;;
no) ENABLE_HARDCORE=0 ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-hardcore) ;; esac],
[ENABLE_HARDCORE=0])
if test "x[$]ENABLE_HARDCORE" = "x1"; then
AC_MSG_WARN(enable hardcore compile warnings)
if test "x$CXX" = "x"; then
dnl - only valid for C with newer gcc's
CPPFLAGS="[$]CPPFLAGS -Wmissing-prototypes"
fi
CPPFLAGS="[$]CPPFLAGS -Wall -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-unused-parameter -Wmissing-declarations -Wundef -Wmissing-noreturn -Wshadow"
fi
dnl - Enable debug mode
AC_ARG_ENABLE(debug,
AC_HELP_STRING(--enable-debug, enable debug information),
AC_DEFINE(DEBUG))
AC_ARG_ENABLE(gpu-debug,
AC_HELP_STRING(--enable-gpu-debug, enable gpu debug information),
AC_DEFINE(GPUDEBUG))
AC_ARG_ENABLE(div-debug,
AC_HELP_STRING(--enable-div-debug, enable div debug information),
AC_DEFINE(DIVDEBUG))
AC_ARG_ENABLE(sqrt-debug,
AC_HELP_STRING(--enable-sqrt-debug, enable sqrt debug information),
AC_DEFINE(SQRTDEBUG))
AC_ARG_ENABLE(dma-debug,
AC_HELP_STRING(--enable-dma-debug, enable dma debug information),
AC_DEFINE(DMADEBUG))
dnl - Enable memory profiling
AC_ARG_ENABLE(memory-profiling,
AC_HELP_STRING(--enable-memory-profiling, enable memory profiling information),
AC_DEFINE(PROFILE_MEMORY_ACCESS))
dnl -- set maintainer mode
AM_MAINTAINER_MODE
AC_SUBST(USE_MAINTAINER_MODE)
dnl --- Finally, output all the makefiles
AC_CONFIG_FILES([Makefile
${PO_MAKEFILE}
src/Makefile
src/cli/Makefile
src/cli/doc/Makefile
src/cocoa/Makefile
src/gtk/Makefile
src/gtk/doc/Makefile
src/gtk-glade/Makefile
src/gtk-glade/doc/Makefile
src/windows/Makefile
src/gdbstub/Makefile
autopackage/default.apspec
])
AC_OUTPUT

View File

@ -6,21 +6,12 @@ Current team
------------
Guillaume Duhamel
Normmatt
Bernat Muñoz (shash)
thoduv
Tim Seidel (Mighty Max)
Pascal Giard (evilynux)
Ben Jaques (masscat)
Jeff Bland
Andres Delikat
Riccardo Magliocchetti
Max Tabachenko (CrazyMax/mtabachenko)
zeromus
Luigi__
adelikat
rogerman
Contributors
------------
Bernat Muñoz (shash)
Allustar
amponzi
Anthony Molinaro
@ -30,3 +21,30 @@ delfare
Romain Vallet
snkmad
Theo Berkau
thoduv
Tim Seidel (Mighty Max)
Pascal Giard (evilynux)
Ben Jaques (masscat)
Jeff Bland
Bernat Muñoz (shash)
matusz
nitsuja
gocha
pa__
adelikat
hi-coder
WinterMute
pengvado
dormito
ldesnogue
mtheall
thelemonman
nash679
pokefan999
dottorleo
yki
Luigi__
CrazyMax
Riccardo Magliocchetti
CyberWarriorX
mic

View File

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

972
desmume/ChangeLog Normal file
View File

@ -0,0 +1,972 @@
0.9.12 -> 0.9.13
In this version we have added support for high-resolution 3D rendering. Try the new "GPU Scaling Factor" feature to
increase the 3D resolution beyond the native resolution of 256x192 pixels. Also, the Cocoa frontend sees continued
radical enhancements and while the Windows frontend sees some new incremental enhancements.
General/Core:
bug: numerous host compatibility and accuracy improvements to OpenGL renderer, tho off-by-1 sampling bugs will remain.
bug: fixes to 'edge marking', shadows, box tests, maths & depths precision, and some other rarer 3d rendering usecases
bug: fixes to AR cheat processing
bug: fixes to cheat database game identification
bug: fix interpolation at SPU loop points, emulation of SPU half/byte size registers & others
bug: backlight emulation added (for fade effects)
bug: other small ongoing fixes to 2d rendering and GPU memory maps
bug: emulate slot-1 read timings, probably for AP-related purposes
bug: general improvement to hardware component power-off state handling, especially 3d engine
bug: fix virtual fat (homebrew) building in environment with symlinks
bug: fix some rarely-bugged CPU instructions
bug: fix bugs in homebrew filesystems
bug: fix bugs in big-endian hosts
bug: fix loading gzipped files and some newer rars
bug: fix inconsistencies and omissions in command-line processing
bug: extensive improvement to wifi emulation, though wifi is still not supported.
bug: firmware file settings/management now behaves more or less sensibly as advertised
bug: fix movie (dsm) being bitrotted and failing to sync settings or manage sram properly
enh: movie (dsm) add record from state feature
enh: high-resolution 3d rendering, from 1x-16x the native resolution of 256x192 pixels
enh: texture upscaling for 3d rendering, from 1x-4x the native texture size
enh: texture smoothing option for OpenGL renderer
enh: user-selectable internal GPU bpp 15/18/24 to change from accuracy to attractiveness
enh: game-specific hacks library finally implemented internally, user-selectable.
enh: game-specific hack for popular games that randomly corrupt their sprites when going in and out of doors
enh: officially supported arm and arm64 jits and overall improvements on arm hosts
enh: emulator now makes "(backups)" states on every loadstate, for in case you hit loadstate on accident
enh: User-selectable MSAA level for OpenGL renderer.
enh: "interface" for dll/so control of a desmume core
enh: optimizations, cpu arch-specific, and otherwise, to all 3d and 2d rendering, ranging from SSE to AVX2
enh: lua - Add raw joystick API and setlayermask API (windows only)
enh: lua - Add gamecode APU for game-specific hacks in scripts and 'freelook' script functionality
enh: add options to emulate game cards more badly, to trip AP on purpose
enh: fix some save type / slot type autodetections and save memory import codepaths
enh: add fake impossible debug AR code to select CPU: DFFFFFFF 77777777/99999999
enh: add --rtc-day and --rtc-hour to specify an offset from host RTC
enh: support newer duc files
enh: upgrade and add some upscalers, hq3x, 6xBRZ, etc.
enh: add "interface" frontend for use via dll/so
Windows:
note: windows xp and x86 support is dropped for official builds. windows 7 support will be dropped over my dead body.
bug: fix numerous bugs involving filenames and path with non-latin characters
bug: fix bugs in various display layout, rotate, vsync, gaps, and display method configurations
bug: fix bugs in user configured paths
bug: aviout/wavout is now more robust
bug: fix bugs in window clearing and various display method configurations which leave garbage on screen
enh: add fullscreen display options
enh: major revisions to mic sample feature, loaded as a bunch and rotated with hotkeys
enh: add user-facing option to control console window visibility
enh: add some crude capability for breakpoints to cpu debugger and memory viewer, and other bugfixes
enh: add "screen size ratio" for smaller sub-screens, etc.
enh: add some hotkeys
enh: add option to kill stylus input when outside the NDS screen
enh: improve cheat list UX
enh: optimizations to reduce cpu usage overall and during idle especially for high resolutions, scalers, etc.
enh: improve pen&touch support
Cocoa:
bug: fix issues with v-sync causing frame rate issues under various circumstances
bug: fix issues when running a display window in fullscreen
enh: add native binary support for Apple Silicon CPUs
enh: Macs with an Intel Haswell or later CPU now benefit from the new AVX2 optimizations
enh: add support for Apple's Dark Mode user interface introduced in macOS Mojave
enh: add some new toolbar items for the following: Frame Advance, Enable/Disable HUD, Toggle Displays
enh: turbo inputs can now be configured with a frame-by-frame press/release pattern
enh: display windows now run their video output using Metal, if available
enh: display windows now support HiDPI monitors like Apple's Retina monitors
enh: display windows have new "Hybrid" layouts for better fit on modern widescreen monitors (View > Display Layout)
enh: display windows can now change the video source going to each individual DS screen (View > Display Video Source)
enh: display windows can now run a Heads-Up Display for reporting useful info (View > Show HUD Settings)
enh: add support for changing the NDS stylus pressure (Emulation > Show Stylus Settings)
enh: screenshots can now be captured using a dedicated tool for it (Tools > Show Screenshot Capture Tool)
enh: lots of miscellaneous stability and performance improvements
Linux:
note: SDL2 now employed
note: GTK3 port added, built with meson
note: CLI and GTK ports improved, according to their respective niche (gaming vs functionality)
note: CLI: added horizontal screen layout
note: CLI: added floating-point scale factor support with HW stretching
note: CLI/GTK2: improved gdb stub for game debugging
note: CLI/GTK2/GTK3: various other improvements
0.9.11 -> 0.9.12
We decided to start skipping even versions to disambiguate official releases from several years of interim builds,
and to insulate ourselves from consideration for world record of "longest time between consecutive releases" by
creating confusion as to what constitutes a consecutive release.
0.9.10 -> 0.9.11 (r4908-r5146)
In this version, we have focused on the Cocoa frontend, but there have been some good core fixes over so long.
Notably, the save-related issues resulting in the advice "dont use 0.9.10" have been resolved.
General/Core:
bug: fix large numbers of games not being able to save anymore
bug: fix some missing sound effects due to wrong volumes in some boot scenarios and other things
bug: fix freezes due to tiny looping sounds
bug: fix many big endian issues
bug: fix some apparently rarely-used CPU instructions, no known consequences
bug: fix (block) reading of some GPU registers
bug: fix action replay code type 0xE
bug: fix reading of last 4 bytes of rom
bug: large improvements to stability of GDB stub
bug: support w-buffer support in OpenGL renderers
bug: fix unpredictable crashes in some 3d scenes from w=0
enh: better loading of roms (bad patches) with wrong size info in header
enh: warn user sometimes when 'stream rom from disk' will create malfunctions
enh: add xBRZ filters
enh: add "TXT Hack" for software rasterizer to improve text rendering in some games
Windows:
bug: fix 5x filters
enh: support import of action replay save files (.dss)
enh: add antialiasing option for OpenGL renderers
enh: don't malfunction if saveram is unavailable or read-only
Cocoa:
bug: 16-bit to 32-bit color space conversions no longer darken video or images
bug: fix intermittent issues with loading user defaults on app startup
bug: fix rendering inaccuracies of the video preview in the app display preferences
bug: fix various UI font rendering and text alignment issues on OS X Yosemite
bug: fix crackly sound from N-sync and Z-sync methods
enh: make N-sync method the default sound sync method since it has much lower latency than P-sync method
enh: add support for gdbstub (Tools > Show GDB Stub Control) (only available on custom builds using the dev+ build target)
enh: optimize input handling to use less CPU
enh: add support for App Nap when the app is in an idle state (only supported on OS X Mavericks and later)
enh: add Execution Control panel (Emulation > Show Execution Control), now with frame advance and frame jump controls
enh: auto frame skip is now smoother
enh: further improve execution timing accuracy
enh: improve overall video performance
enh: render video through a 3-stage filtering pipeline, (Video Source)-->(Pixel Scaler)-->(Video Output)
enh: add the following video source filters - Deposterize
enh: add the following video output filters - Bicubic B-Spline, Bicubic Mitchell-Netravali, Lanczos2, Lanczos3
enh: add ability to run all existing pixel scalers on either the CPU or the GPU
enh: add ability to toggle the main and touch display positions (View > Toggle All Displays)
enh: add preliminary support for replay playback and recording
enh: add support for turbo and autohold
enh: add support for the entire suite of slot-2 devices (Emulation > Show SLOT-2 Manager)
enh: add support for using the host machine's audio input device for emulating the NDS microphone (Emulation > Show Microphone Settings)
enh: change the sine wave tone generator's range from 100Hz-5000Hz to 40Hz-4000Hz
enh: reorganize the menu options to more logical locations
enh: greatly improve the File Migration Assistant (now renamed Game Data Migration Assistant) and ROM Info panel with a more modern and space efficient look and feel
enh: miscellaneous user interface improvements
Linux:
bug: fix screen gap bug
bug: workaround for std::bad_alloc exceptions compiler bugs
enh: add experimental AV recording
enh: generally improve main loop throttling and skipping
enh: massive improvements to HUD and menu layout
enh: add window sizing options and sound interpolation options
enh: add Lid button; disallow U+D, L+R; manual option saving
0.9.9 -> 0.9.10 (r4623-r4908)
In this version, we have focused on trying to clean up some complexities in the user experience and emulator internals. Pretty unglamorous stuff, but some games are newly compatible.
General/Core:
enh: break savestate back-compatibility
bug: improve save size autodetection for some games
bug: cpu: fix many basic jit cpu bugs
bug: 3d: tweak softrasterizer edge marking
bug: 3d: fix stale 4x4 texture palettes
bug: fix some GPU sprite blending scenarios
bug: fix bios HLE BitUnPack, UnCompHuffman
enh: modular slot-1 device system, emulate GC bus more faithfully
enh: support NAND slot-1 device
enh: auto-detect appropriate slot-1 and slot-2 device
enh: many revisions to firmware boot process for more authenticity. iQue and FlashME versions function, .dfc rewritten.
enh: support streaming NDS file from disk (like an ISO, to avoid long initial load time)
enh: run .dsv directly on disk, to save long flushing times. should speed backup operations.
enh: spu synch mode and method on commandline
Windows:
bug: fixes to advanscene DB import
bug: save opengl display method filter option
bug: general bugfixes to various screen layout modes
enh: add option to stop non-integer scaling during fullscreen or maximize
enh: improvements to save import dialog
enh: improved memory viewer tool
enh: operate better when run, against our advice, from a zipfile
enh: add slot-1 Nitro Filesystem viewer tool
Cocoa:
bug: fix slot1-R4 path saving
bug: fix bug with mic samples < 16khz
bug: fix bugs and enhancements in multi display windows
bug: fix handling of some joystick analog inputs
enh: save display windows configuration and emulation speed on app exit
0.9.8 -> 0.9.9 (r4228-r4623)
Yes, it's been a while since the last release, but we haven't been completely idle. There's a brand new jit cpu core which yields some impressive speedups!
General/Core:
!!!: add optional arm cpu jit (functioning on x86 and x64 hosts only)
bug: we're not going to list 70% of the emulation fixes, as is traditional.
bug: savestate reliability fixes related to halt states, gxstat, firmware
bug: lua: fix readbyterange, gdscreenshot functions
bug: commandline slot-1 handling straightened out
enh: fixes and additions to resize filter options
Graphics:
enh: opengl 3d driver compatibility improvements
bug: fix giant regression from 0.9.7 that left garbage from previous frames on the screen in some games
bug: 3d: fix some single poly pixels
bug: 3d: fix some polygon and texture coloring bugs on big-endian systems
Windows:
bug: fix some full screen stretching bugs
enh: add xaudio2 output driver
enh: add opengl display method (as opposed to directdraw), with controllable bilinear filter
enh: upgrade archive handling system, lzma2 supported
enh: reorganize main menu quite a bit
enh: add rotation hotkeys, and hotkey to control mouse cursor visibility
enh: memory viewer improvements and fixes
enh: improve interface for rom eject to prevent accidents and improve usefulness (hide in slot-1 config screen)
Cocoa:
bug: fix missing display when running on OS X v10.8 Mountain Lion
bug: fix possible sound crash when using Dual SPU Synch/Asynch
bug: fix File menu items being disabled after the file migration sheet is used
bug: fix window resizing issues
bug: fix text rendering in About box
enh: show the icon and name of the loaded ROM
enh: add Support Request and Bug Report forms to the Help menu
enh: add more detailed info to the About box
enh: add OpenGL as a 3D rendering option
enh: add support for MSAA when using OpenGL as the 3D rendering engine
enh: add V-Sync option
enh: add Display Orientation, Display Order, and Display Separation options for Combo Display mode
enh: add HQ4xS filter
enh: completely revamp the user interface for Input Preferences
enh: many emulator commands may now be mapped
enh: add ability to map an input to user-defined touch screen coordinates
enh: add support for saving and applying input profiles
enh: add support for using an audio file for the microphone input
enh: add sine wave tone generator for microphone input
enh: add support for multiple display windows (File > New Display Window)
enh: add support for SLOT-1 devices (Emulation > Show SLOT-1 Manager)
enh: overall performance and stability improvements
enh: miscellaneous user interface improvements
0.9.7 -> 0.9.8 (r3812-r4228)
Yes, it's been a while since the last release, but we haven't been completely idle. There's a brand new top shelf Cocoa frontend to make life far more pleasant for OSX users, and a host of compatibility fixes.
General/Core:
bug: fix more IPC FIFO errors
bug: import more save files correctly
bug: don't autopatch already-patched roms
bug: fix bugs in piano and guitar grip
bug: fix ARM7's VRAMSTAT register
bug: fix memory leaks on compact flash emulation
bug: fix reading of rom from low header area
bug: spu: fix some poppy interpolation audio quality issues
bug: improve timing of dma operations by running through normal mem cycle accounting; fixes an annoying number of games and graphical glitches
bug: fix opcode MRC and fake bios CRC16
enh: jitter some related register and irq events to simulate pipeline effects and stimulate some race conditions to other outcomes
enh: fake (deterministic) some tiny jitter from human's hand holding stylus; some games were accidentally depending on this
enh: support nocash-style prints from arm
enh: add lua apis for accessing vram
enh: platforms other than windows receive threading optimizations
enh: provide diagnostics when system powers off (useful for homebrewers returning from main())
enh: clarify handling of different console types within the family (ds,dslite,debug)
enh: vfat support for slot-1 devices
enh: emulate temperature register
enh: add paddle emulation
Graphics:
bug: fix occasional crash from uninitialized blending table
bug: fix some 2d alpha blending cases resulting in white screens
bug: fix VRAM_I B_OBJ mirroring and fix sprites rendering across the end of vram
bug: fix rotoscaled sprites wrapping around screen
bug: dont fix rotscaled bitmap sprites with alpha==0
bug: opengl: fix degradation of toon rendering during loadstate
bug: opengl: alpha blending fixes
bug: many refinements to opengl renderer
bug: opengl: support rear-plane/ClearImage emulation (fixes many graphics)
bug: rasterizer: fix some rare alpha blending cases
bug: fix bug in environment mapping introduced after 0.9.6
bug: fix totally glitched out 3d graphics with several improvements involving matrix stack
bug: fix memory overflows in epx filter
bug: prevent backdrop from blending with ???
enh: opengl: better depth buffering emulation
enh: better support for line segment "polys" by detection and special rendering logic
enh: opengl: support quad primitives directly
enh: add hq4x filter
Windows:
bug: fix a long-standing loadstate crash
bug: fix lag frame accounting
bug: fix glitches in cheat entry menu
bug: stop compact flash emulation from accidentally scanning c:\ sometimes
enh: add support for game database for improved save type detection
enh: hotkey for limit framerate toggle
enh: remove stop and reset toolbar buttons which were accidentally getting used
enh: additional complexification to desmume's behaviour run from a console prompt. whether it's better is uncertain.
enh: add support for cheats databases
enh: improvements to ram search tool
enh: preliminary support for varying stylus pressure
enh: add [Display] Show Console=1 to ini file
enh: more graceful cheat parsing and add some hotkeys
enh: add 5x window size
enh: add big endian and 20.12 toggle to memview and ramwatch
enh: improve FPS throttle feedback and granularity
enh: add lua menu API
enh: hud font switching
enh: add optional file association for .nds to path config dialog
Cocoa:
enh: Big update to cocoa frontend. Pretty much entirely new. (rogerman)
Linux:
bug: gtk: glitches in rom and recent rom loading
bug: glade: normalize savestate slot to hotkey mapping
enh: support soundtouch for use by metaspu
enh: gtk: add SPU mode selection (Tobias Jakobi)
enh: cli: better fps limiting (Thomas Jones)
Wx:
bug: some small fixes here and there (Jan Bücken)
enh: lot of code cleanup (Jan Bücken)
0.9.6 -> 0.9.7 (r3493-r3812)
General/Core:
bug: fix a ton of old, broken cpu opcodes and CP15 logic
bug: return Z1 and Z2 from TSC (fixes some touch logic)
bug: gba slot save type detection improved
bug: handle unusual rom headers more correctly
bug: dont confuse motion pack commands with save memory commands
bug: make cheat system a little less flaky and add AR 1.54 support
bug: fix nondeterministic backup memory behaviour while rerecording
bug: correct emulation of register accesses of wrong size and during powerdown
bug: rewrite --cflash-path emulation
bug: rewrite IPC/GX FIFO, IRQ flag generation, and wait-for-IRQ logics
bug: rewrite RTC calendar handling; now supports years > 2038
enh: auto-DLDI patching for homebrew
enh: --gbaslot-rom=self mounts self.nds in slot2
enh: more realistic exception handling
enh: piano controller emulation
enh: modular slot-1 system for exact emulation of homebrew cards
Graphics:
bug: edge marking colors were wrong
bug: handle some "invalid" vram configurations correctly
bug: convert half of geometry engine to fixed point
bug: fix sprite blend+fadein/fadeout
bug: improve rasterizer shadows
bug: fix main memory display DMA
bug: fix some raster fx timing bugs
enh: add a hack for improving some non-stencil shadows
Windows:
bug: misc fixes and improvements to gpu viewer tools
bug: sub screen layer display toggling fixed
bug: fixes and improvements to ram watch, ram search, cheats list
bug: fix start-paused commandline
bug: fix memory leaks when sound disabled
bug: improve load average calculators and add arm7 load average
enh: background input support
enh: add vsync option
enh: support more knobs on joysticks
enh: import cheats from R4 database
enh: add xinput rumble for 360 pads
Linux/OSX:
bug: crash less in recent roms list
enh: Add horizontal screen layout and swap screen ability to gtk frontend (noodlebox)
enh: Big improvement to joystick support, support complex configurations and multiple devices (noodlebox)
0.9.5 -> 0.9.6 (r3075-r3493)
Users of gtk, cli and gtk-glade frontends please note that now we
have a common directory in ~/.config/desmume for config file,
saves and savestates. The old .desmume.ini will be moved
automatically with the name config but you have to move your saves
manually.
Some save files may be invalidated due to use of broken crc logic.
Back up your DSV files before using this version of the emulator or else
the game might wipe it.
General/Core:
bug: emulate keypad interrupt
bug: spu overhaul, add capture support
bug: fix dma address reloading
bug: fix rom close memory corruption
bug: fix div and sqrt busy flag bug
bug: fix vectest
bug: fix lid savestate desync
bug: fix texcache memory GB explosion when games use tons of tiny 3d sprites
bug: fix huge rerecording movie file handle leak
bug: fix EXXXXXXX cheat codes and some add/edit/save/load bugs
bug: add 8MBit - 512MBit flash emulation
bug: fix firmware booted-from-card flag
bug: fix some failures to wake
bug: fix some rtc calendar logic
bug: op_bkpt emulation
bug: correctly emulate POWCNT1 and POWCNT2 and SPI power device
bug: corrections to bootup stack configuration
bug: protect bios from being overwritten
bug: initialize save data to 0xFF instead of 0x00
bug: handle relocated irq vectors
bug: support patched firmwares
bug: handle 8bit auxspidata, 32bit BLDY, 32bit div regs
bug: fix some divide by zero cases
bug: don't print \n in ideas debug message
bug: don't let games read off end of cart and crash emulator
bug: fix SWI 0x0E crc16 ; some save files using wrong crc may be invalidated
bug: fix many big endian bugs
bug: fix CPSR.I idle wakeup
bug: fix loadstate crashes, mostly when sound is enabled
enh: support devkitpro argv
enh: add gbaslot-rom commandline
enh: add no$gba debug message
enh: add rtc start to dsm header
Graphics:
bug: fix a mistakenly rendered OBJ window and 3d blend effects
bug: fixes to matrix stacks, fixing lots of garbled geometry
bug: fix fog density registers
bug: fix hblank dma to run also on scanline 262
bug: fix w/z depth flags for broken GUIs in dual screen 3d games
bug: fixes to poly sorting
bug: block 8bit vram writes
enh: improve accuracy of opengl shaders
Windows:
bug: fix 16bpp display
bug: more fixes to multi-gamepads
bug: cheat windows robustification
bug: fix that sticky pause state when resetting and loading roms
bug: dont crash when no sound device is available
bug: change F10 to be save slot 0
bug: fix --start-paused
enh: try not to screensave while using gamepad
enh: add EPX and EPX1.5X resize filters
enh: add a japanese translation which will soon be stale like the others
enh: add fancy ctrl+printscreen with emulator info on it
enh: add "lockdown" window mode to keep window safe from fast stylus action
enh: add alt+enter fullscreen command
enh: add card eject command
enh: add ddraw software mode forcer
enh: improve oam viewer
enh: default 3d to rasterizer so we dont have to suggest it 1000 times a day
enh: add dump-all-memory tool
enh: add reload rom menu/hotkey
Linux/OSX:
bug: fix building for nosse2 systems
bug: fix --num-cores
bug: fix occasional touchscreen failures
bug: fix crash starting dsm record
enh: add --nojoy=1 to fix laptops with accelerometers
enh: add simple auto frameskip mode in the gtk frontend
enh: add gui for configuring joystick in the gtk frontend
enh: make the cli frontend read the ini config file too
enh: additional OpenAL microphone backend (ncalexan)
enh: common place for config and saves (Jan Steffens)
enh: libagg is now optional if you don't need the hud
0.9.4 -> 0.9.5 (r2437-r3075)
0.9.5 introduces an entirely rewritten main emulation loop
This totally changes the timing, and totally breaks old savestates.
The OSX build is now based on the GTK port which is more up-to-date.
Assorted Highlights:
* synchronous SPU mode to fix streaming sounds
* win32: lua engine, path configuration, 7z dearchiving support
General/Core:
bug: rewrite main emulation loop and cycle accounting, fixes a lot of timings
bug: add more detailed timing emulation, removes much bogus lag
bug: rewrite DMA,gxfifo,gxstat; fix many games and no more alternate flush mode
bug: fix cflash directory support for non-windows and sector-writing
bug: fix freeze in cart irq
bug: correctly emulate dma to/from tcm
bug: fix in thumb LSR carryflag
bug: fix thumb BX PC switch to arm state
bug: fix adpcm looping, remove adpcm caching (no longer necessary)
bug: fixes to swi 3,4,5,8,0x10
bug: fixes to exmemstat and ipc sync registers
bug: support new backup commands
bug: improve bootup bios/firmware emulation steps
enh: gbaslot: add guitar grip, gbagame flash support, expansion memory pak
enh: add more powerful antigrain-based drawing library and rewrite OSD system
enh: ideas-style debugging prints
enh: most optimizations now SSE instead of SSE2
enh: more improvements to frameskipping and frame advance/speed controls
Graphics:
bug: fix backdrop blending with garbage
bug: fix 256B granularity sprite addressing for sub gpu
bug: fix obj blending, bmp obj rendering, and some obj window cases
bug: fix 128-wide captures
bug: fix 16color BG line buffer overflow
bug: fix color overflow in capture blending
bug: fix disp fifo capture
bug: fix simultaneous vram display and capture via same bank
bug: fix 3d overflow acknowledge registers
bug: fix 32bit toon table writes
bug: change 3d cores to use 18bit color
bug: fix boxtest (addition overflow!), move clipper to main graphics engine
bug: fix failure in some cases of polygon clipping
bug: fix disp3dcnt emulations
bug: fixes to poly sorting
bug: fix ogl renderer wireframe support
bug: swrast: fix backface culling of nonconvex polys
bug: swrast: add clear image and scroll emulation
bug: swrast: add fog emulation
bug: swrast: fixes to shadow rendering
bug: swrast: preliminary edge marking, works decent
enh: swrast: multicore optimization for a few fps speedup
Windows:
bug: fix support for multiple gamepads and gamepad hotkeys
bug: fix mic noise code and load wav instead of raw; effective in more cases
bug: fix for several sticky and broken hotkeys, and f10 hotkeys
bug: fixes in ram search, add DTCM and ITCM searching, ...
bug: fix sound settings vol slider
bug: recover from missing window -32000 problem
bug: don't turn on mic unless mic input is enabled
enh: x64 build type now supported
enh: side-by-side and single screen view modes, many fixes to window resizing
enh: choose any gap size by dragging bottom window edge (must be enabled)
enh: choose a gap color
enh: import/export no$GBA savefiles directly
enh: multicore optimization for filters, rotation, OSD
enh: soundview can now mute channels
enh: new ioregview
enh: common commandline system, many arguments shared with linux
enh: improve map view tool to support more modes
enh: add "FORCE AS CURRENT" recovery tool for mis-sized savefiles
enh: add some kind of very small savestate rewinding buffer
enh: autoframeskip works better
enh: add Italian translation
enh: added 2x resizing filters (hq2x, hq2xs, lq2x, lq2xs, 2xsai, supereagle)
(scanlines, nearest2x, bilinear)
Linux:
enh: alsa microphone support
enh: hud and osd notification for gtk and cli frontends
enh: add support for the SSE optimizations
0.9.2 -> 0.9.4 (r1844->r2352->r2437)
0.9.3 was skipped due to emu news sites sneaking it out of our staging area and
releasing it prematurely while it still had bugs. I was going to curse them
individually, but then I decided that they would just like the publicity.
Highlights:
* New save autodetection and save file format
* Full rerecording support
General/Core:
bug: fix many 64 bit and endian issues
bug: fix mic input, which was nearly useless before
bug: fix failures of large dmas
bug: fix in ipc sync which broke devkitpro touch
bug: screenshots now exclude hud and rotation
bug: rewritten vram mapping (fixes corrupted or missing BG)
enh: add universal commandline system (same commandline options on every port)
enh: cheats: added Action Replay code parser
enh: more reliable and useful frameskipping
enh: SPU: speedup: add adpcm caching
enh: SPU: speedup: interpolation is now optional
enh: print svn build number so we can identify people's svn builds from screenshots
Graphics:
bug: add polygon y-sorting (fixes 3d guis)
bug: fix texcoordgen mode 3; fixes some ortho sprites and some entirely broken games
bug: display capture fixes
bug: fix a number of OBJ modes
bug: fixes to affine BG modes
bug: better emulate some translucent OBJ
bug: more correct handling of color effect windows and backdrop colors
bug: fix matrix stack overrun which crashed emulator
bug: swrast: add clear depth image emulation and other fixes to depth buffering
bug: swrast: fix some toon and highlight cases
bug: fix bug in matrix stack, fixes some broken models
enh: add alternate flush mode HACK 3d config toggle, fixes some entirely broken 3d games
Windows:
bug: more robust cheats engine and dialog
enh: more solid avi and wav recording
enh: improved tools: memory viewer
enh: added tools: spu viewer, ram watch, ram search
enh: change build configuration system
enh: speedup: add gpu core disabling to hide useless screens
enh: add background pause feature (for when emulator loses focus)
enh: add missing autohold for L and R
enh: add chinese translation
Gtk frontend:
enh: switch all of menu/toolbar system to GtkAction + GtkUIManager
enh: remove the gtglext 3d code
enh: improve/speedup screen resize and final presentation logic in gtk frontend
enh: minimal rerecording hookups
Cli frontend:
enh: hooked the frameskip (szigor)
enh: misc usability improvements: auto pause switch for pausing when focus is lost and exit on escape pressing (szigor)
enh: hook the fake noise mic; use m to toggle
0.9.1 -> 0.9.2
General/Core:
bug: fix error in SBCS/RSCS flags; fixes many odd behaviors and crashes [zeromus]
bug: add support for sleep mode and power registers [luigi__]
bug: important fixes to RTC so correct time is actually told [luigi__]
bug: fix card reads below 0x8000; fixes some game freezes [normatt]
bug: fix 4 mbit save type; fix non-autodetect savefile dumping [zeromus, matusz]
enh: add sram to GBA game addon emulation for importing savefiles [zeromus]
enh: many improvements and feature hookups in linux ports [matusz, luigi__]
Graphics:
bug: fix specular texture mapping mode [luigi__]
bug: repairs to some capture modes and vram mapping [zeromus, CrazyMax]
bug: viewports finally correctly handled [zeromus]
enh: add software rasterizer. quirky, but on par with opengl [zeromus]
Windows:
bug: mitigate bad frameskipper; default to old frameskipping mode [zeromus]
bug: fixes with recent roms and zipfile loading [zeromus]
bug: fix window position memory [zeromus]
enh: bios and firmware may now be used and booted [luigi__]
enh: many display, OSD, and input enhancements [luigi__]
enh: brand new hotkey and controls binding system [zeromus]
enh: configurable screen separation [luigi__]
enh: fast forward key [pa__]
enh: improvements to mic [luigi__]
enh: faster updates in debug tools, up to once per frame [pa__]
Mac OS X Port:
enh: added Italian translation thanks to Paolo Bernini [jeff]
enh: resurrection of GDB stub [sigmaris]
0.9 -> 0.9.1
General/Core:
enh: GBA slot emulation [CrazyMax]
- Rumble support (windows only)
- GBA game
enh: Mic support (windows only?) [luigi__]
enh: Preliminary cheats system [CrazyMax]
enh: Savestates invalidated, as more variables have been added.
bug: Added PSG white noise [luigi__]
bug: fix arm/thumb ROR [zeromus]
bug: [ 2550645 ] Super Princess Peach: crash when starting a puzzle [zeromus]
bug: win32: fix spu wav file writer (regression from 0.8) [zeromus,luigi__]
bug: Much work on FIFOs, still not finished [CrazyMax]
bug: Many fixes to dma [zeromus, CrazyMax]
bug: bios WaitForVblank and WaitForInterrupt fixed [luigi__]
Graphics:
bug: Added sprite blending [luigi__]
bug: more correct mosaic effects, still imperfect [zeromus]
bug: Many fixes to tile rendering; all graphics tests now pass [luigi__]
bug: fix crashes in some affine BG [zeromus]
bug: Implement some pos test function [luigi__]
bug: fix texture mapping across texture and palette banks and to unmapped banks [zeromus]
bug: fix texture handling for texels with MSB set (fixes some texture corruption) [zeromus]
bug: fix texture coordinate generation, including environment mapping [zeromus]
bug: texture cache invalidates when palettes change, prevents some texture corruption [zeromus]
bug: fix display capturing from 2d+3d source when display mode is display-vram [zeromus]
bug: [ 2488334 ].1 fixes to layer compositing [luigi__]
bug: [ 2488334 ].3 fix bug in support for hdma affine bg parameters [zeromus]
bug: Improvements to 3d h-scrolling [luigi__]
bug: Fix some errors in rendering 512 tall BG [zeromus,CrazyMax] (still not fully resolved)
bug: Add optional fragment shading pipeline (more precision) [luigi__]
bug: Fix bug where some sprites got cut of on x=255 [zeromus]
bug: Implement GXSTAT register [CrazyMax]
Windows:
bug: resizing and rotating work in vista [luigi__]
enh: 0 frameskip now lets emulator run at excess speed [zeromus]
Mac OS X Port:
bug: left key setting no longer gets confused with the right key [jeff]
enh: more keys can be mapped
0.8 -> 0.9
There have been so many changes that this list can hardly be considered complete.
For this release, we have formatted the list into a high level overview of big changes and bad bugs relative to the previous release. Hopefully what you're interested in.
This list does not include items which are solely performance boosts, for let us just say that virtually every system has been speeded up.
* The savestate system is totally changed and incompatible with old savestates.
* The 3d system should be considered rewritten.
General/Core:
enh: Convert to c++
enh: Add functions for a lid open/close. Holding key (default "Backspace" in Windows port) while game is freeze/non freeze. [CrazyMax]
enh: Add secure area decryption from ndstool [zeromus]
enh: Change savestate code to support loosely bound chunks and more easily other parts of the emu (GE, GPU).
The savestate format is changed, but from now on it is in principle more resilient
(though it will continue to break as we tinker with the internals) [zeromus]
enh: Added SSE2 optimizations for matrices. Since we now make an SSE2 build, more optimizations can be made. [CrazyMax]
enh: Add a preliminary GUI hud system [CrazyMax,zeromus]
CPU/MMU:
bug: Many fixes in IPC and GE FIFOs. Fixes freezes in NSMB, dsracing, and others. [CrazyMax,luigi__,shash]
bug: Fix ARM instructions SBC and RSC (likewise SBC in thumb) [normatt]
bug: Fixed Thumb LDMIA (fixes ingame Dead'n'Furious) [shash]
bug: Fix repeating DMA (fixes NSMB parallax BG) [zeromus]
bug: Proper handling for unaligned CPU accesses [luigi__]
bug: Proper handling for undefined instruction exceptions [Salva Peiró]
bug: correctly return vram control register values (fixes homebrew 3d games) [zeromus]
enh: Remove 16MB of WRAM at 0x01****** from arm9. Mapped to unused instead. Nobody knows what this was. [zeromus]
enh: Changed instruction execution to 16 at a time blocks (tested and stable) [shash]
Hardware:
bug: Newer and better sqrt and div emulation; makes SM64DS playable [luigi__,shash,zeromus]
bug: Add preliminary RTC implementations [CrazyMax]
enh: Add cosine interpolation in the SPU (conditionally compiled) [zeromus,luigi__]
enh: Experimental: always one silent non-mixing SPU core at 44.1khz synched with emu, for more precision.
The audible core runs with the host, causing music to slow down but not tear or pitch bend. [zeromus]
Graphics:
- Overhaul 3d:
. Move entire GE to core emu.
. Move OpenGL renderer to emu core for optional use by platforms, removing ogl_collector. Now every platform shares the same 3d code.
. Reorganize 3d code to defer rendering to after 3d vblank. Eliminates tearing, and texturing artifacts. [zeromus]
. Add optional fragment shading pipeline (more precision) [luigi__]
. Move lighting model to software instead of using opengl's fixed function model [zeromus]
. Render shadow volumes; toon shading and highlight table [zeromus, luigi__]
. Added texture caching! big speed up. [CrazyMax]
bug: Many assorted tweaks and improvements to 3d and 2d precision [zeromus,CrazyMax,luigi__]
bug: Fixes to GE: command unpacking, projection and pos-vector mode matrix handling, mult and load commands [zeromus]
bug: Fix a bug in texture transformation mode 1 [zeromus]
bug: Fixed GPU rendering bugs in sprites and BG [CrazyMax]
bug: Fixes to texture conversion [CrazyMax,zeromus]
bug: Fixes in capture display (no blinking in many games with dual 3D) [CrazyMax]
bug: Fixes in master brightness (this fixes some games with black screens) [CrazyMax]
bug: Fixes in screen, backdrop, and sprite blending [luigi__]
bug: Changed clear depths and how depth initial values are calculated (fixes SM64DS skybox, Castlevania) [shash,lugi__]
bug: Add 3d layer h-scrolling [zeromus]
bug: Added transparency and fixed material alpha support and alpha testing on the 3D core [shash]
bug: Rewrite VRAM mapping control and rendering (more accurate) [CrazyMax,luigi__]
bug: convert colors to opengl better to prevent alpha=31 polys from being ever so slightly transparent [zeromus]
enh: Add MMU->GPU signal for when vram mappings change to function as a texture cache invalidate signal [zeromus]
enh: Make matrix 4x4 multiply routines use W-coordinate; carry w coord through pipeline [zeromus]
Mac OS X port:
bug: Fixed: Filenames and paths with unicode characters now work. [Jeff]
bug: Fixed: Load state from file button works again. [Jeff]
enh: Save State panel now pauses emulation while the file selection box is open. [Jeff]
bug: Fixed: Frozen video output (and/or messed 3d emulation) after loading a state. [Jeff]
bug: Added option to load the most recent file upon launching the program. [Jeff]
enh: Added French translation (thanks to Pierre Rudloff). [Jeff]
enh: Added basic key mapping configuration to application preferences (thanks to Julio GorgŽ). [Jeff]
enh: Added keyboard shortcuts for Execute, Pause and Reset command (thanks to Julio GorgŽ). [Jeff]
enh: Default key mappings are no longer case sensitive. [Jeff]
enh: Added ability to limit speed. [Jeff]
enh: Fixed: Video output should work on software-only 3D renderers. [Jeff]
Windows port:
bug: Fix a race condition in NDS_3D_Reset and NDS_glInit [zeromus]
bug: Fix the buggy auto frameskip logic which made the emu slow to a crawl. Now it runs fast! [zeromus]
bug: Fix resizing, rotate & aspect ration of main window. [CrazyMax,_zeromus]
bug: Remove multithreading from user interface after finding several synchronization issues [zeromus]
enh: recent roms menu [luigi_]
enh: Changed graphics render core to DirectDraw (work faster) [CrazyMax]
enh: Add an arm9 cpu load average calculator similar to no$. but I dont think it works right. [zeromus]
enh: Rewrite all debug tools (autoupdate works now) [CrazyMax]
enh: Rewrite input core & replace config input dialog [CrazyMax]
enh: Add AVI output [zeromus]
enh: Add pause toggle and frame advance hotkeys [adelikat]
enh: Add frame counter display and hud messages framework [adelikat]
enh: Main window remembers position, size, and a few other emu preferences [adelikat]
enh: Removed directx sdk dependency for easier building. [zeromus]
enh: Savestate doesnt unpause emu if it is already paused [adelikat]
0.7.3 -> 0.8
Cocoa:
- Save State As function now works. [Jeff B]
- Recent Items menu now works. [Jeff B]
- Opening NDS files from Finder now works. [Jeff B]
- Added screenshot feature. [Jeff B]
- Added preferences. [Jeff B]
- Many more strings are translatable now. [Jeff B]
- Default screen color is black (better represents being "off" and easier on eyes at night). [Jeff B]
- Added sound. [Jeff B]
- Now is a universal binary. [Jeff B]
- Leopard resolution icon added. [Jeff B]
- Added a Japanese translation. [Jeff B]
- Added an optional status bar (resize handle no longer overlaps screen). [Jeff B]
- New ROM Info and About DeSmuME windows have been added. [Jeff B]
- Fixed several bugs in window resizing. [Jeff B]
- Added FAT image support for homebrew games (thanks to TypeError). [Jeff B]
- Key config can be changed on the command line. Save/load hotkeys changed (so expose doesn't override). [Jeff B]
- Key bindings may work better on non-US keyboards now (needs testing). [Jeff B]
general:
- Encapsulate GDB debug stub to avoid certain problems [shash]
- Fixed CPU LD*/ST* bugs [shash]
- Fixed New SMB mini-games freeze [shash]
- Fixed possible segfault in ROMReader on ia64 and amd64. [evilynux]
- Fixed a crash bug with 2D background corrupting memory [shash]
- Flag check optimization [carlo_bramini]
- Applied some endian fixes in GPU (thanks to Phazz) [Jeff B]
gtk-glade:
- Added DeSmuME version in about dialog. [evilynux]
- Updated website url in about dialog. [evilynux]
- Added Brazilian Portuguese translation by Dreampeppers99. [evilynux]
- Better desktop menu entry following FreeDesktop specifications. [evilynux]
gtk:
- Updated website url in about dialog. [evilynux]
- Better desktop menu entry following FreeDesktop specifications. [evilynux]
windows port:
- Added an "about" box [shash]
- DirectInput control interface with joystick support [CrazyMax]
- Matrix and Light viewer [Acid Burn]
0.7.2 -> 0.7.3
gtk-glade:
- Full localization using intltool/gettext. [evilynux]
general:
- Added a README.TRANSLATION documenting the localization process. [evilynux]
MacOS X:
- Initial version of the Mac interface added. [Jeff B]
0.7.1 -> 0.7.2
spu:
- big endian fixes. [cyberwarriorx]
gpu:
- big endian fixes. [marcus_c]
gtk-glade:
- opengl improvements. [masscat]
general:
- Added support for setting NDS firmware language value. [masscat]
- Function added for setting firmware language. [masscat]
- Mac/msys compilation fixes. [cyberwarriorx]
- Fix compilation when pkg-config macros are not available [evilynux]
0.7.0 -> 0.7.1
general:
- Added GDB debugger stub [masscat]
- Added new/different GBAMP CFlash image reader/writer [masscat]
gpu:
- Major speedup to the 2D core [shash]
gtk-glade:
- Added command line options. [masscat]
- Added FPS limiter [masscat]
cli:
- Added command line options. [masscat]
- Added FPS limiter [masscat]
- Added option to use OpenGl to render window (allows resizing). [masscat]
windows port:
- Added command line options. [masscat]
- Added multiple language support [cyberwarriorx]
- Added Danish language translation [thomas-2007]
0.6.0 -> 0.7.0
general:
- Added support for *.duc files [cyberwarriorx]
gpu:
- Added support for sprite rotation/scaling [shash]
- Added support for the 3D core (openGL and null plugins) [shash]
windows port:
- A bunch of fixes [Dmitry Krutskih]
- Fixed a bug in sound that was causing it to still not work for some
people [cyberwarriorx]
gtk:
- Added 3D emulation
- Added command line options.
- Added option to use OpenGL to render window (allows resizing).
gtk-glade:
- Added 3D emulation
0.5.0 -> 0.6.0
general:
- Added zipped (based on zziplib) and gzipped (based on zlib) rom support.
arm:
- Added relocation interrupt vector.
- Added region access right checks.
- Enabled LDC/STC instructions.
- Fixed powersave (cp15) IRQ wait.
- Fixed MOV instructions
gpu:
- Added special color effects.
- Added windowing feature.
- Fixed transparent direct color backgrounds.
- Fixed disabled sprites showing.
- Fixed 8/32 bit access to gpu registers.
- Fixed missing backgrounds
- Support for master brightness
wifi:
- Added RF chip interface.
- Added BB chip interface.
windows port:
- Fixed address calculation in disassembler.
- Added Force Maintain Ratio option for window stretching
linux port (cli, gtk and gtk-glade):
all:
- Added joystick support.
- Fixed X and Y buttons.
gtk-glade:
- Added joystick configuration.
- Improved I/O registers viewer tool.
- Added save and load states support.
0.3.3 -> 0.5.0
arm:
- Fixed MSR with immediate value opcode.
- Fixed LSR_0 thumb opcode (C flag is correctly set now).
- Fixed LDR*/STR* opcodes.
- Fixed unaligned memory access on THUMB Core.
- Added relocating SWI routines.
bios:
- Added decompression functions.
- Added GetPitchTable function.
- Added GetVolumeTable function.
- Added GetCRC16 function.
- Added experimental SoundBias function.
- Added GetSineTable function.
cart:
- Added CompactFlash/FAT emulation.
- Added Get ROM chip ID Cartridge command.
gpu:
- Added framebuffer emulation.
- Fixed a bug in GPU (xfin could be greater than LG causing a segfault).
- Added support for Display Mode 0(Display Off).
- Added the basic framework for Display Mode 3(Display from Main RAM).
spu:
- Added sound emulation.
- Added sound core system.
- Added WAV write core.
- Added dummy core.
- Added Direct Sound core.
linux port:
- Added GTK+ GUI.
- Added command line interface.
- Added stylus and arm9 keypad support in CLI version.
- Added FPS display.
- Added basic frameskip.
windows port:
- Fixed a bug when displaying a ROM's information.
- Added key configuration.
- Removed the debug key.
- Added new experimental auto frameskip/frame limit code.
- Added sound settings dialog.
- Added a few menu options for accessing the website, forums, and for
submitting bugs.
general:
- Rewrote code in C.
- Fixed warnings.
- Used defines and typedef's to make things more portable and easier to
read.
- Added autotools stuff.
- Changes to logging system.
- Added screenshot function.
- Translated most french to english.
- Added savestate support.
- Added firmware reading support(needs work).
- Added Backup Memory support with autodetection.
- Fixed some endianess issues.
- Fixed things so Visual C++ can compile code.
- Added bsd support.
- Reworked ROM loading so you can load a different rom without any problems.
- Finished NDS_Reset. Now the emulation can be reset even while running.

97
desmume/README Normal file
View File

@ -0,0 +1,97 @@
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2022 DeSmuME team
Last Updated: May 23, 2022
Contents:
1) About ................................................................... 14
2) Credits ................................................................. 59
3) Contact Information ..................................................... 72
4) License ................................................................. 82
1) About ______________________________________________________________________
DeSmuME is software that allows you to emulate a Nintendo DS system. Think of
it as a Swiss-Army knife for Nintendo DS emulation, giving you access to many
powerful tools for testing DS features, from viewing ROM properties to managing
Action Replay cheats. And best of all, this software is completely free and
open-source.
For information on how to install or operate DeSmuME for your operating system,
please see the README file that should be present with your installation.
Port-specific README files:
* README.LIN for the Linux ports
* README.WIN for the Windows port
* README.MAC for the Macintosh port
Note that each DeSmuME port may have a different feature set from another port.
You may see more feature parity between ports over time as we continue
developing DeSmuME.
You can find our documentation on our online Wiki page. The major pages of
interest are:
* Official Documentation: https://wiki.desmume.org/index.php?title=Main_Page
This is the main Wiki page that contains all of our official documentation.
* Manuals: https://wiki.desmume.org/index.php?title=Manual
The manuals contain detailed information about how to operate DeSmuME for each
port.
* FAQ: https://wiki.desmume.org/index.php?title=Faq
The Frequently Asked Questions (FAQ) page has a lot of useful general
information about DeSmuME. Do note that some of the information may be platform
specific, and may not directly apply to your version of DeSmuME.
* Build Instructions:
https://wiki.desmume.org/index.php?title=Installing_DeSmuME_from_source
This page contains detailed port-specific instructions about how to make your
own build of DeSmuME directly from the source code.
2) Credits ____________________________________________________________________
See the AUTHORS file for list of DeSmuME team members.
Special thanks go to:
* yopyop (original author of DeSmuME),
for releasing the source code of this great emulator.
* Martin Korth (author of GBATEK),
for his well-written Gameboy Advance and Nintendo DS documentation.
3) Contact Information ________________________________________________________
Official Website: https://desmume.org
Public Forum: https://forums.desmume.org
Developer Chat: irc://irc.libera.chat:6697/desmume
Source & Bug Reports: https://github.com/TASEmulators/desmume
Please don't ask for ROMs, BIOS files, or any other copyrighted stuff.
4) License ____________________________________________________________________
This file is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 2 of the License, or (at your option) any later
version.
This file is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this software. If not, see <https://www.gnu.org/licenses/>.
* See the GNU General Public License details in COPYING.

441
desmume/README.INT Normal file
View File

@ -0,0 +1,441 @@
DeSmuME DLL/SO
DeSmuME is written in C++ using the SDL libraries.
* http://www.libsdl.org/
Reference Usage
===============
A Python library using the DLL/SO interface can be found at
`https://github.com/SkyTemple/py-desmume/blob/master/desmume/emulator.py`.
Build Linux & Mac
=================
DeSmuME uses the Meson build system to the shared object under Linux and MacOS:
* https://mesonbuild.com/
To build, first cd to src/frontend/interface and then run `meson build`
Then build the library by running `ninja -C build`
It will generate a shared object under `build/libdesmume.so`.
Build Windows
=============
To build open and build the Visual Studio solution at
`src/frontend/interface/windows/DeSmuME_Interface.sln`.
Interface
=========
The interface has the following API functions exposed in the DLL/SO.
Emulator key indices
--------------------
Internal ID numbers for emulator keys (used for some functions):
#define KEY_NONE 0
#define KEY_A 1
#define KEY_B 2
#define KEY_SELECT 3
#define KEY_START 4
#define KEY_RIGHT 5
#define KEY_LEFT 6
#define KEY_UP 7
#define KEY_DOWN 8
#define KEY_R 9
#define KEY_L 10
#define KEY_X 11
#define KEY_Y 12
#define KEY_DEBUG 13
#define KEY_BOOST 14
#define KEY_LID 15
int desmume_init(void);
-----------------------
Initializes the emulator. Needs to be called before any other API functions.
void desmume_free(void);
------------------------
Destroys the emulator, needs to be called to free memory. After this no API
functions must be called.
void desmume_set_language(unsigned char language);
--------------------------------------------------
Sets the firmware language. Valid values:
0 = Japanese, 1 = English, 2 = French, 3 = German, 4 = Italian, 5 = Spanish
int desmume_open(const char *filename);
---------------------------------------
Loads a ROM into the emulator. Returns 0 on success and another number on error.
void desmume_set_savetype(int type);
------------------------------------
Sets the type of SRAM save. 0 for auto.
void desmume_pause(void);
-------------------------
Pauses the emulator.
void desmume_resume(void);
--------------------------
Resumes the emulator.
void desmume_reset(void);
-------------------------
Resets the emulator and resumes.
BOOL desmume_running(void);
---------------------------
Returns 0 if the emulator is not running and 1 if it is.
void desmume_skip_next_frame(void);
-----------------------------------
Instructs the emulator to not draw the next frame.
void desmume_cycle(BOOL with_joystick);
---------------------------------------
Runs one loop iteration (tick) of the emulation.
The parameter must be 1 if `desmume_input_joy_init` was called before and
joystick input should be processed
and 0 otherwise.
int desmume_sdl_get_ticks();
----------------------------
Get the current tick number as reported by SDL.
void desmume_draw_opengl(GLuint *texture);
------------------------------------------
Only available if INCLUDE_OPENGL_2D was defined.
Draws the current tick onto the provided OpenGL texture.
BOOL desmume_has_opengl();
--------------------------
Returns whether or not OpenGL support is available.
int desmume_draw_window_init(BOOL auto_pause, BOOL use_opengl_if_possible);
---------------------------------------------------------------------------
Opens an SDL-powered window for drawing the emulator on and processing input.
If `auto_pause` is >0, the emulator is paused when the window is not in focus.
If `use_opengl_if_possible` is >0, OpenGL-based drawing is used
if OpenGL is available.
void desmume_draw_window_input();
---------------------------------
Process user input on the SDL window for this tick.
Requires `desmume_draw_window_init` to be called first.
void desmume_draw_window_frame();
---------------------------------
Draw the SDL window for this tick. Requires `desmume_draw_window_init` to be called first.
BOOL desmume_draw_window_has_quit();
------------------------------------
Returns 1 if the SDL window was closed by the user and 0 if not.
Requires `desmume_draw_window_init` to be called first.
void desmume_draw_window_free();
--------------------------------
Destroys the SDL window and frees memory. Requires `desmume_draw_window_init` to be called first.
No other SDL window functions must be called after this.
unsigned short *desmume_draw_raw();
-----------------------------------
Returns the content of the raw framebuffer of the emulator.
void desmume_draw_raw_as_rgbx(unsigned char *buffer);
-----------------------------------------------------
Fills the provided buffer as an RGBx formatted version of the emulator's framebuffer.
void desmume_savestate_clear();
-------------------------------
Deletes all savestates stored on slots.
BOOL desmume_savestate_load(const char *file_name);
---------------------------------------------------
Loads a savestate from a file. Returns 1 on success, 0 on failure.
BOOL desmume_savestate_save(const char *file_name);
---------------------------------------------------
Saves a savestate to a file. Returns 1 on success, 0 on failure.
void desmume_savestate_scan();
------------------------------
Scans the savestate slots for data. Required for `desmume_savestate_slot_exists` and
`desmume_savestate_save_slot` to return the correct data.
void desmume_savestate_slot_load(int index);
--------------------------------------------
Loads the savestate from slot `index`.
void desmume_savestate_slot_save(int index);
--------------------------------------------
Saves the current state to the savestate in slot `index`.
BOOL desmume_savestate_slot_exists(int index);
----------------------------------------------
Returns whether or not the savetstate at slot `index` exists.
char* desmume_savestate_slot_date(int index);
---------------------------------------------
Returns the date (as string) that the savestate at slot `index` was saved.
BOOL desmume_gpu_get_layer_main_enable_state(int layer_index);
--------------------------------------------------------------
Returns whether or not the layer with the given index for the main GPU is enabled.
BOOL desmume_gpu_get_layer_sub_enable_state(int layer_index);
-------------------------------------------------------------
Returns whether or not the layer with the given index for the sub GPU is enabled.
void desmume_gpu_set_layer_main_enable_state(int layer_index, BOOL the_state);
------------------------------------------------------------------------------
Disables or enables the layer with the given index for the main GPU.
Disabled layers are not drawn.
void desmume_gpu_set_layer_sub_enable_state(int layer_index, BOOL the_state);
-----------------------------------------------------------------------------
Disables or enables the layer with the given index for the sub GPU.
Disabled layers are not drawn.
int desmume_volume_get();
-------------------------
Returns the current emulator volume in a range from 0-100.
void desmume_volume_set(int volume);
------------------------------------
Sets the current emulator volume in a range from 0-100.
unsigned char desmume_memory_read_byte(int address);
signed char desmume_memory_read_byte_signed(int address);
unsigned short desmume_memory_read_short(int address);
signed short desmume_memory_read_short_signed(int address);
unsigned long desmume_memory_read_long(int address);
signed long desmume_memory_read_long_signed(int address);
-----------------------------------------------------------
Read the emulated memory at `address` with different sizes and sign settings.
void desmume_memory_write_byte(int address, unsigned char value);
void desmume_memory_write_short(int address, unsigned short value);
void desmume_memory_write_long(int address, unsigned long value);
-------------------------------------------------------------------
Write the value `value` as bytes/shorts/longs to `address` in the emulated memory.
int desmume_memory_read_register(char* register_name);
void desmume_memory_write_register(char* register_name, long value);
--------------------------------------------------------------------
Read or write the value of the specified register.
Valid register names:
- arm9.r0 - arm9.r15 : Registers r0 - r15 on the ARM9 processor.
- arm9.cpsr
- arm9.spsr
- arm7.r0 - arm7.r15 : Registers r0 - r15 on the ARM7 processor.
- arm7.cpsr
- arm7.spsr
`main` may be used as an alias for `arm9` and `sub` for `arm7`.
If the prefix is omitted, `arm9` is used.
typedef BOOL (*memory_cb_fnc)(unsigned int, int);
void desmume_memory_register_write(int address, int size, memory_cb_fnc cb);
void desmume_memory_register_read(int address, int size, memory_cb_fnc cb);
void desmume_memory_register_exec(int address, int size, memory_cb_fnc cb);
----------------------------------------------------------------------------
Register a callback function to execute when the emulator writes/reads or executes
an instruction at `address`. `size` is the size in bytes to monitor for that location
(should always be 2 to exec).
The passed callback function gets to arguments when called. The first argument
is the address the callback was triggered for, the second the size.
Only one callback can be specified per address and type (write/read/exec).
Pass 0 instead for `cb` to unregister previously registered callbacks.
void desmume_screenshot(char *screenshot_buffer);
-------------------------------------------------
Fills the 98304*3 bytes long `screenshot_buffer` with an RGB snapshot of
the framebuffer.
BOOL desmume_input_joy_init(void);
----------------------------------
Initialize SDL joypad handling. Returns 1 on success, 0 otherwise.
Must be called before any other joypad operation.
void desmume_input_joy_uninit(void);
------------------------------------
Destroys the joypad functionality. After calling this, no other joypad
operations must be called.
unsigned short desmume_input_joy_number_connected(void);
--------------------------------------------------------
Returns the number of connected joypads.
unsigned short desmume_input_joy_get_key(int index);
----------------------------------------------------
Returns the joypad key assigned to the specified emulator key.
unsigned short desmume_input_joy_get_set_key(int index);
--------------------------------------------------------
Pause and wait for the user to press a button on a joypad.
This button will be assigned to the specified emulator key.
void desmume_input_joy_set_key(int index, int joystick_key_index);
------------------------------------------------------------------
Sets the emulator key `index` to the specified joypad key `joystick_key_index`.
void desmume_input_keypad_update(unsigned short keys);
------------------------------------------------------
Update the currently pressed emulator keys. This is a bitmask where each bit
is one of the emulator's keys. See:
#define ADD_KEY(keypad,key) ( (keypad) |= (key) )
#define RM_KEY(keypad,key) ( (keypad) &= ~(key) )
#define KEYMASK_(k) (1 << (k))
unsigned short desmume_input_keypad_get(void);
----------------------------------------------
Get the currently pressed emulator keys. This is a bitmask where each bit is
one of the emulator's keys.
void desmume_input_set_touch_pos(unsigned short x, unsigned short y);
---------------------------------------------------------------------
Register a touch input at the specified location on the bottom screen.
Use `desmume_input_release_touch` to release.
void desmume_input_release_touch();
-----------------------------------
Release the current touch.
BOOL desmume_movie_is_active();
BOOL desmume_movie_is_recording();
BOOL desmume_movie_is_playing();
BOOL desmume_movie_is_finished();
----------------------------------
Returns whether the movie system is active/recording/playing/finished.
int desmume_movie_get_length();
-------------------------------
Returns the size of the movie records.
char *desmume_movie_get_name();
-------------------------------
Returns the name of the movie.
int desmume_movie_get_rerecord_count();
---------------------------------------
Returns the current rerecount counter value of the movie.
void desmume_movie_set_rerecord_count(int count);
-------------------------------------------------
Sets the current rerecount counter value of the movie.
BOOL desmume_movie_get_readonly();
----------------------------------
Returns 1 if the movie can only be read, 0 if it can also be modified.
void desmume_movie_set_readonly(BOOL state);
--------------------------------------------
Change whether or not the movie is only read-only (can not be modified).
// Returns NULL on success, error message otherwise.
const char *desmume_movie_play(const char *file_name);
------------------------------------------------------
Play the movie from the file `file_name`. Returns NULL on success, otherwise
an error message.
enum START_FROM {START_BLANK = 0, START_SRAM, START_SAVESTATE};
struct SimpleDate {int year; int month; int day; int hour; int minute; int second; int millisecond;};
void desmume_movie_record_simple(const char *save_file_name, const char *author_name);
void desmume_movie_record(const char *save_file_name, const char *author_name,
START_FROM start_from, const char* sram_file_name);
void desmume_movie_record_from_date(const char *save_file_name, const char *author_name,
START_FROM start_from, const char* sram_file_name,
SimpleDate date);
----------------------------------------------------------------------------------------
Record a movie.
- `save_file_name`: The name of the file to save the movie to.
- `author_name`: The name of the author of the movie.
- `start_from`: Where to start from:
- START_BLANK (0): Reset the emulator, start without SRAM (no savefile).
- START_SRAM (1): Reset the emulator, start using the SRAM loaded from `sram_file_name`.
- START_SAVESTATE (2): Not supported.
- `sram_file_name`: Name of the SRAM to load, if `start_from` == 1. NULL otherwise.
- `date`: Date to set the emulated device's clock to.
void desmume_movie_replay();
----------------------------
Restart playback of the current movie.
void desmume_movie_stop();
----------------------------
Stop playback/recording of the current movie.
Visit us on the web at http://www.desmume.org

72
desmume/README.LIN Normal file
View File

@ -0,0 +1,72 @@
DeSmuME
DeSmuME is written in C++ using the GTK+ and SDL2 libraries.
* https://gtk.org/
* https://libsdl.org/
It uses the Meson build system to build the GTK+3 and SDL2 port:
* https://mesonbuild.com/
... and the autotools build system for the GTK+2 and SDL2 port.
to build GTK+2 or SDL2 frontend with autotools, cd to src/frontend/posix, then
autoreconf -i (or alternatively: ./autogen.sh)
./configure
make -jN (where N is the number of CPU cores to use).
DeSmuME provides another interface based on libglade, to use
, you'll need glade:
* http://glade.gnome.org/
To build, first cd to src/frontend/posix and run
`meson build --buildtype=release`
Then build the program by running `ninja -C build`
It will generate three programs:
1) "desmume" in the "build/gtk" directory;
2) "desmume-cli" in the "build/cli" directory.
If glade is installed on your system, you'll get a third
binary:
3) "desmume-glade" in the "build/gtk-glade" directory.
You can even type "ninja -C build install" to install those programs on
your system (in /usr/local/ by default); then uninstalling is
done by typing "ninja -C build uninstall".
For more information on the available commandline options,
check the other README files which will be more up to date.
The following options specially are available on these posix ports:
--disable-limiter Disables the 60 fps limiter
--soft-convert Use software colour conversion during OpenGL
screen rendering. May produce better or worse
frame rates depending on hardware.
The following options specially are available on the Gtk+ port:
--opengl-2d Enables using OpenGL for screen rendering
--disable-sound Disables the sound emulation
--disable-3d Disables the 3D emulation
The following options specially are available on the CLI port:
--opengl-2d Enables using OpenGL for screen rendering
--disable-sound Disables the sound emulation
NOTE:
The Gtk+ and Glade builds use gtkGLext to handle the OpenGL
rendering and contexts. You may get improved performance by
also passing the argument --gdk-gl-force-indirect. This has
been seen to improve things for Nvidia based graphics cards
under Linux.
Visit us on the web at http://www.desmume.org

392
desmume/README.MAC Normal file
View File

@ -0,0 +1,392 @@
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2022 DeSmuME team
Last Updated: May 23, 2022
Contents:
1) System Requirements ..................................................... 17
2) Quick Start Guide for Using DeSmuME for macOS ........................... 58
3) Improving Emulation Performance ........................................ 204
4) Troubleshooting ........................................................ 230
5) Additional Documentation ............................................... 245
6) Contact Information .................................................... 275
7) License ................................................................ 377
1) System Requirements ________________________________________________________
Operating System: macOS v10.5 (Leopard) or later
CPU: Can run on any PowerPC G4, G5, or Intel processor
Minimum Recommended: 2.4 GHz Intel Core 2 Duo
Best Experience Recommended: 2.4 GHz Intel i5 (Haswell)
RAM: 512 MB (minimum)
2 GB (recommended)
Before you begin, make sure that your Mac meets the listed system requirements.
In general, any Mac with an Intel Core 2 Duo processor (from Mid-2007) should
be sufficient for basic gaming. However, it is possible to run DeSmuME with
even older hardware than that. In this case, you will need to use the settings
listed in the section "Improving Emulation Performance" to make things usable.
With this level of hardware, running any additional graphics enhancing features
will result in a poor experience. Some frameskip will also be necessary in
order maintain your execution speed.
If your Mac meets the minimum recommended requirements, then you should be able
to run all games at full speed without any frameskip. You may need to use some
of the settings listed in the section "Improving Emulation Performance" for
certain games, but they should not be required for most games. You will also be
able to use some basic graphical enhancements, such as using some of the
display filters. However, increased 3D rendering resolution may not be possible
for all games for this level of hardware.
However, if your Mac has an Intel Haswell (from late 2013) or an Apple Silicon
processor (from 2020), you will be able to run all games with all of DeSmuME's
features without any performance problems. Graphics enhancements, such as
increased 3D rendering resolution, can be adjusted as needed to fit the
performance level of your hardware.
Please note that running DeSmuME on a PowerPC, while possible, is not fully
supported. The PowerPC binary exists mostly for testing and development
purposes, and also just because we can. Most games don't work well on PowerPC,
and so you will be limited to running only the most basic of games, such as
"Phoenix Wright: Ace Attorney" or "Picross DS."
2) Quick Start Guide for Using DeSmuME for macOS ______________________________
Installing DeSmuME is as easy as copying DeSmuME.app to your Applications
folder (or other folder of your choice). Double-click the app to start DeSmuME.
Note that DeSmuME for macOS may have a different feature set than DeSmuME for
Windows and DeSmuME for Linux. As of this writing, some features that are
present in DeSmuME for Windows are not present in DeSmuME for macOS.
The rest of this section will be a guide to help you quickly get started using
DeSmuME for macOS.
Loading a ROM and Starting the Emulator:
Simply double-click the desired ROM from the Finder to play the game. By
default, DeSmuME will load the ROM and start emulation. Also, there are
additional ROM loading options that you can change in DeSmuME > Preferences if
you need them.
Using the NDS Controller:
Each NDS controller button can be mapped to a button of your choice on your
keyboard, gamepad, or joystick. You can view the mappings by clicking on Input
in DeSmuME > Preferences. To change a mapping, click on the NDS control that
you want to change, then press the button on your input device to map it.
By default, the NDS controller is mapped to the following keys on your keyboard:
Up - Up Arrow
Down - Down Arrow
Left - Left Arrow
Right - Right Arrow
A Button - X
B Button - Z
X Button - S
Y Button - A
L Trigger - Q
R Trigger - W
Start - Return
Select - Tab
Lid - Delete (Backspace)
Microphone (Internal Noise Samples) - ` (Accent)
The NDS can support a variety of SLOT-2 devices. Some devices, such as the
Guitar Grip, EasyPiano, and Taito Paddle have inputs, which are mapped to your
keyboard using these defaults:
Guitar Grip:
Green - E
Red - R
Yellow - T
Blue - Y
EasyPiano:
C - C
C# - F
D - V
D# - G
E - B
F - N
F# - J
G - M
G# - K
A - , (Comma)
A# - L
B - . (Period)
High C - / (Forward Slash)
Paddle:
Paddle Adjust -5 - O
Paddle Adjust +5 - P
In addition, the following emulator functions are mapped to your keyboard by
default:
Execute/Pause - Forward Delete
Reset - Page Down
Rotate Display Left - [ (Left Bracket)
Rotate Display Right - ] (Right Bracket)
Set Speed to Half - - (Dash)
Set Speed to Double - = (Equal)
Using the NDS Touch Pad:
Touch pad input is emulated using the left mouse button by default. Simply
click in the touch pad area of the NDS display window to use the NDS touch pad.
Using the NDS Microphone:
Some games make use of the NDS microphone. DeSmuME emulates the NDS microphone
by using the default audio input device selected in your System Preferences.
You can choose Emulation > Show Microphone Settings to view the audio input
device that DeSmuME is currently using, as well as setting its gain.
DeSmuME will track the audio input level on the meter as the NDS reads the
microphone. The meter reflects the audio input level as seen by the NDS, not
the host. Note that some games ignore the microphone, and therefore will not
register on the meter. If you need to view the audio input level from the host
machine's perspective, you can view the host's audio input level in your System
Preferences.
Finally, you can generate audio samples in software by using one of DeSmuME's
audio generators, and send those audio samples to the NDS. This is what the
Microphone command in your Input Preferences does. As long as the Microphone
command is engaged, the host input device will be ignored. When you disengage
the Microphone command, DeSmuME will automatically return to reading the host
input device.
The microphone icon serves to indicate the current status of the NDS
microphone, and will change color for each status:
Black - The microphone is inactive due to the emulation being paused.
Dark Gray - The host audio input is inactive because the user has muted it
or because the user never authorized its usage. The emulation
is currently only accepting software-generated sources.
Bright Gray - A software-generated source is being used for the microphone
input. This overrides any host audio input.
Dark Green - The host audio input is active. However, the input level is
too low to be meaningful, or the game is ignoring the
microphone.
Bright Green - The microphone is active and the game is reading a
meaningful input level from the host audio input.
Bright Red - The microphone is active and the game is reading a clipped
input level. Depending on the situation, this may or may not
be desirable. Use the gain slider to influence the host audio
input level if needed.
Rotating the NDS Display:
Some games require that the NDS display be at a certain rotation in order to
look correct. Rotation options can be found by choosing
View > Display Rotation. You can also use the toolbar buttons Rotate Left and
Rotate Right to rotate the display by 90 degrees counterclockwise or clockwise,
respectively. Finally, you can assign inputs to Rotate Left and Rotate Right in
your Input Preferences.
Freezing and Restoring the Emulation State:
Save states are a powerful feature that allows you to freeze the emulation
state and restore it later. However, note that save states are only a
temporary means of saving -- more permanent saves must be done using the
in-game save (or ROM save).
- To freeze the emulation state, choose File > Save State File.
- To restore the emulation state, choose File > Open State File.
You can also freeze/restore emulation states without having to manage the
Open/Save dialogs. There are ten available save state "slots" that you can
use to quickly freeze/restore the emulation state.
- To quick freeze the emulation state, choose File > Save State Slot > Slot #.
The default hotkey for this is (Shift-#).
- To quick restore the emulation state, choose File > Load State Slot > Slot #.
The default hotkey for this is (#).
3) Improving Emulation Performance ____________________________________________
There are many settings you can change in order to improve DeSmuME's emulation
performance. All of the settings listed below affect performance the most. Use
the settings as shown for the best possible performance. All of these settings
may be found in DeSmuME > Preferences.
- WARNING: Changing any Emulation setting may cause emulation glitches in
certain ROMs. Do not change these settings unless you are willing to
accept reduced emulation accuracy or ROM compatibility.
Emulation:
Advanced Bus Level Timing - Off (May cause glitches)
Rigorous 3D Rendering Timing - On (May cause graphical glitches)
CPU Emulation Engine - Dynamic Recompiler (Reduces ROM compatibility)
Dynamic Recompiler Block Size - 100 (May cause glitches)
Use External BIOS Images - Off (May reduce ROM compatibility)
3D Rendering:
3D Rendering Engine - SoftRasterizer (or OpenGL if GPU Scaling Factor
is greater than 4)
GPU Scaling Factor - 1
GPU Color Depth - 15-bit (Reduces color accuracy of 3D rendering)
Texture Scaling Factor - 1
4) Troubleshooting ____________________________________________________________
The vast majority of problems can be resolved by simply resetting DeSmuME's
settings back to their defaults. The easiest way to do this is to delete the
org.desmume.DeSmuME.plist file in your ~/Library/Preferences folder. There is
also a DeleteUserDefaults.applescript script that is included with your DeSmuME
installation that will do this for you.
If you are still experiencing problems after restoring your DeSmuME settings to
their defaults, then you may want to post your issue on our DeSmuME forum. Your
post may gain the attention of another user, or even a DeSmuME developer, to
help assist you with your issue. See the section "Contact Information" for how
to contact us on the forum.
5) Additional Documentation ___________________________________________________
The quick start guide in this Read Me is by no means a complete reference to
everything that DeSmuME can do! If you need any additional information about
DeSmuME, then you can reference our online Wiki pages for up-to-date
information.
* Official Documentation: https://wiki.desmume.org/index.php?title=Main_Page
This is the main Wiki page that contains all of our official documentation.
* FAQ: https://wiki.desmume.org/index.php?title=Faq
The Frequently Asked Questions (FAQ) page has a lot of useful general
information about DeSmuME. Do note that some of the information may be platform
specific, and may not directly apply to the macOS version of DeSmuME.
* DeSmuME Manual for macOS:
https://wiki.desmume.org/index.php?title=DeSmuME_Manual_for_the_Macintosh_port
This page contains complete and detailed information about how to operate
DeSmuME for macOS.
* DeSmuME Build Instructions for macOS:
https://wiki.desmume.org/index.php?title=Installing_DeSmuME_from_source_on_OS_X
This page contains complete and detailed instructions about how to make your
own build of DeSmuME for macOS directly from the source code.
6) Contact Information ________________________________________________________
Thank you for you interest in DeSmuME! If you want to tell us how useful
DeSmuME is in your life, your love (or hate) of certain NDS games, your passion
for NDS homebrew development, or anything else related to DeSmuME or NDS
emulation, then there are various ways for you to contact us!
However, keep in mind that there are a few of rules that you need to follow:
- Do not ask us to provide ROMs, BIOS files, or any other copyrighted stuff.
We don't want to have to deal with any legal issues that could get us in
trouble, or worse, completely shut down.
- When contacting us, please use the appropriate means to do it. For example,
if you simply want to tell us how much you love or hate us, then use the
comments on the official webpage. Another example: If you want to post on the
forum, be sure to keep the topic focused on DeSmuME; questions that ask for
things like us providing you the latest Pokemon cheats are not DeSmuME
related, and we will instead refer you to a Pokemon cheaters forum. Finally,
our developer chat channel is intended for furthering the development work of
DeSmuME; questions about how to use DeSmuME should not come here, but instead
go to the Support forum. In short, use the appropriate contact method. That's
why the different methods exist!
* Official Website: https://desmume.org
Our official website has the latest news on DeSmuME releases, and also has a
lot of other useful information about DeSmuME. You can comment on different
posts telling us how you feel about DeSmuME. Is DeSmuME the best thing in your
life? Is it making you cry? Or is it a bunch of blah? Let us know here!
* Public Forum: https://forums.desmume.org
If you have a question about DeSmuME, then this is the place to ask it. But
before you ask it, be aware that your question may have already been answered
before, so try the following things first:
- Read the manual and the FAQ. A lot of questions people have are usually
already answered in our documentation.
- Do a forum search about your question.
If you still need to ask a question, choose Help > Submit a Support Request in
the DeSmuME application. Follow the onscreen instructions on the Support
Request Form.
* Live Developer Chat Channel: irc://irc.libera.chat:6697/desmume
We have a live developer chatline on Libera IRC at #desmume. This channel
is meant for discussing the development of DeSmuME, and shows the real work
that goes on behind the scenes. If you are interested in doing any sort of
software programming, software testing, documentation, or graphics work, then
please join our chat channel! We would love for you to join us!
* Bug Reports:
If you believe that you have found a bug, you may submit a bug report by
choosing Help > Submit a Bug Report in the DeSmuME application. Follow the
onscreen instructions on the Bug Report Form.
When you click Go To Bug Report Webpage, you will be taken to our bug tracker
on SourceForge. Do note that you will need a SourceForge account in order to
submit a bug report.
Bug submissions are very welcome and encouraged. However, when you submit a bug
to us, you MUST provide the following information, or else your bug submission
may be rejected:
- DeSmuME app version
- Your operating system and OS version
- Your Mac model identifier
- The name of the running ROM when the bug was observed (or "None", if no ROM
was running)
- The serial code of the running ROM when the bug was observed (or "None", if
no ROM was running)
- A description of the exact behavior you observed
- A description of the behavior you expected
All of this information will be prepared for you if you use the Bug Report Form
from Help > Submit a Bug Report.
When you write your description, make sure that they are as detailed as
possible. The better your descriptions are, the faster we can test and fix
bugs. For example, if you observed a bug in the game "Golden Sun: Dark Dawn,"
then the bug report could look something like this:
App Version: 0.9.13
Operating System: macOS v12.4 (21F79)
Mac Model Identifier: MacBookPro15,1
ROM Name: GOLDENSUN_DD
ROM Serial: NTR-BO5E-USA
Observed Behavior: I tried to load a save state using the
File > Load State > Slot 3 menu option, but the game froze. If I reset, I
can get the game working again.
Expected Behavior: The game should continue running from the point where I
made the save state.
We will try to get your bug tested as soon as possible, but any fixes may take
longer, depending on the complexity of the bug. Also, some bugs may require us
to ask you for certain files, such as your ROM saves, save states, or console
logs. For the above example, we would probably ask you for your save states to
help us track down the bug.
7) License ____________________________________________________________________
This file is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 2 of the License, or (at your option) any later
version.
This file is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this software. If not, see <https://www.gnu.org/licenses/>.
* See the GNU General Public License details in COPYING.

1092
desmume/README.WIN Normal file

File diff suppressed because it is too large Load Diff

74
desmume/doc/dsm.txt Normal file
View File

@ -0,0 +1,74 @@
DSM is ascii plain text. It is derived from the FCEUX FM2 format.
It consists of several key-value pairs followed by an inputlog section.
The inputlog section can be identified by its starting with a | (pipe).
The inputlog section terminates at eof.
Newlines may be \r\n or \n
Key-value pairs consist of a key identifier, followed by a space separator, followed by the value text.
Value text is always terminated by a newline, which the value text will not include.
The value text is parsed differently depending on the type of the key.
The key-value pairs may be in any order, except that the first key must be version.
Integer keys (also used for booleans, with a 1 or 0) will have a value that is a simple integer not to exceed 32bits
- version (required) - the version of the movie file format; for now it is always 3
- emuVersion (required) - the version of the emulator used to produce the movie
- rerecordCount (optional) - the rerecord count
- romChecksum (optional) - the CRC32 of the rom used to make the movie. should match values specified on advanscene.com
- romSerial (optional) - a concatenation of other uniquely identifying information about the rom (name,gamecode,makercode)
- useExtBios (optional) - were bios files was used? defaults to false.
- swiFromBios (optional) - were swi emulated by ExtBios? (alternative is internal HLE bios). defaults to false.
The rom identification information may be used at a later point to warn about mismatches between movies and roms, but is not right now.
String keys have values that consist of the remainder of the key-value pair line. As a consequence, string values cannot contain newlines.
- romFilename (required) - the name of the file used to record the movie
- comment (optional) - simply a memo.
by convention, the first token in the comment value is the subject of the comment.
by convention, subsequent comments with the same subject will have their ordering preserved and may be used to approximate multiline comments.
by convention, the author of the movie should be stored in comment(s) with a subject of: author
Hex string keys (used for binary blobs) will have a value that is like 0x0123456789ABCDEF...
- romChecksum (required) - this is currently unused.
GUID keys have a value which is in the standard guid format: 452DE2C3-EF43-2FA9-77AC-0677FC51543B
- guid (required) a unique identifier for a movie, generated when the movie is created, which is used when loading a savestate to make sure it belongs to the current movie.
The inputlog section consists of lines beginning and ending with a | (pipe).
The fields are as follows, except as noted in note C.
|c|.............XXX YYY Z|
'R','L','D','U','T','S','B','A','Y','X','W','E','G'
field c is a variable length decimal integer which is a bitfield corresponding to miscellaneous input states which are valid at the start of the frame.
Therefore, no miscellaneous commands is represented by a value of 0.
Here are the currently defined bit values:
0x01 - Microphone Noise (hardcoded noise sample; to be held through duration of frame)
0x02 - Reset
0x04 - Lid
the format of the main section is as follows:
the field begins with 13 characters which constitute a bitfield.
any character other than ' ' or '.' means that the button was pressed.
by convention, the following mnemonics will be used in a column to remind us of which button corresponds to which column:
RLDUTSBAYXWEG (Right,Left,Down,Up,sTart,Select,B,A,Y,X,lshoulder,rshoulder,debuG)
This ordering is based on FCEUX to a certain extent, and arbitrary after that.
W and E were chosen for shoulders to suggest West and East for Left and Right.
While the emulator supports a 'lid' button, and to some extent a 'blow' button, these are not supported in the movies.
XXX: %03d, the x position of the stylus (0,0 topleft, 255,191 bottomright)
YYY: %03d, the y position of the stylus
Z: %1d, 1 if the stylus is pressed pressed; 0 if not
Additional fields after this main section may be added later without breaking the file format.
* Notes *
A. There is no key-value pair that indicates the length of the movie. This must be read by scanning the inputlog and counting the number of lines.
B. All movies start from power-on.
C. The emulator uses these framerate constants
arm7_cycles_per_frame = 560190
frames_per_second = 59.8261

39
desmume/doc/dsv.txt Normal file
View File

@ -0,0 +1,39 @@
The desmume save file format is merely a raw save file with a FOOTER.
This was chosen in order to maximize compatibility with other emulators,
which tend load the savefile as-is and let the game read out of whatever range
it is expecting. To assist with this, before writing the save file, desmume
will pad the raw save file out to the next highest known length. Note that this
may sometimes be incorrect if the savefile hasnt been written through to the end
during initialization. This could cause other emulators to fail to recognize the
save file.
Additionally, the footer makes it easier to analyze save files, because the
game's data will be at the correct addresses starting at offset 0x0000.
The footer format can be identified by locating the 16Byte ascii string
"|-DESMUME SAVE-|"
at the end of the file. This corresponds with the following save structure:
struct Footer {
u32 actually_written_size;
u32 padded_size;
u32 save_type; //(not currently used)
u32 address_size; //address bus size
u32 save_size; //size parameter of the save type (not currently used)
u32 version_number; //should be 0
char cookie[16];
};
note that padded_size should be where you see the end of the raw save data
and the beginning of desmume-specific information, including some junk before
the actual footer.
actually_written_size is the highest address (plus one) written to by the game.
The new desmume savefile system tries to make as few decisions as possible,
which is the reason for the behavior of actually_written_size and the disuse
of save_type and save_size. If few decisions are made, then few mistakes can
be made. That is the idea, anyway. We'll make decisions later if we need to.
save_type and save_size are reserved in case we do.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
Tips:
* Set hotkeys for "Mic Prev Sample" and "Mic Next Sample" in the "Main" section of hotkey configuration (suggest [ and ])
* This will rotate through all the provided desmume_N.wav. You can add your own in the series, just pick the next number.
* Keep the microphone hotkey held down for as long as you want the noise to play! Just tapping it will make a very short sound indeed.
desmume_0.wav was formerly "PERFECT BLOW FOR DS EMULATORS.wav"
desmume_1.wav was formerly "noise_loud.wav"
desmume_4.wav came to us as "pcm0822m.wav"; these are alleged to work well for Giant Bowser fights in Bowser's Inside Story.

Binary file not shown.

View File

@ -0,0 +1,4 @@
root = true
[*]
indent_style = tab

392
desmume/src/Database.cpp Normal file
View File

@ -0,0 +1,392 @@
/*
Copyright (C) 2008-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include "types.h"
#include "Database.h"
#include "retro_miscellaneous.h"
//------------------------------------------------------------
//large databases are first. scroll down to ENDLARGE to find the code
struct MAKER
{
u16 code;
const char* name;
};
static const char regions_index[] = "JPFSEODIRKHXVWUC";
static const char *regions[] = {
"JPN", // J
"EUR", // P
"FRA", // F
"ESP", // S
"USA", // E
"INT", // O
"NOE", // D
"ITA", // I
"RUS", // R
"KOR", // K
"HOL", // H
"EUU", // X
"EUU", // V
"EUU", // W
"AUS", // U
"CHN", // C
};
static MAKER makerCodes[] = {
{ 0x3130, "Nintendo" },
{ 0x3230, "Rocket Games, Ajinomoto" },
{ 0x3330, "Imagineer-Zoom" },
{ 0x3430, "Gray Matter?" },
{ 0x3530, "Zamuse" },
{ 0x3630, "Falcom" },
{ 0x3730, "Enix?" },
{ 0x3830, "Capcom" },
{ 0x3930, "Hot B Co." },
{ 0x4130, "Jaleco" },
{ 0x4230, "Coconuts Japan" },
{ 0x4330, "Coconuts Japan/G.X.Media" },
{ 0x4430, "Micronet?" },
{ 0x4530, "Technos" },
{ 0x4630, "Mebio Software" },
{ 0x4730, "Shouei System" },
{ 0x4830, "Starfish" },
{ 0x4A30, "Mitsui Fudosan/Dentsu" },
{ 0x4C30, "Warashi Inc." },
{ 0x4E30, "Nowpro" },
{ 0x5030, "Game Village" },
{ 0x3031, "?????????????" },
{ 0x3231, "Infocom" },
{ 0x3331, "Electronic Arts Japan" },
{ 0x3531, "Cobra Team" },
{ 0x3631, "Human/Field" },
{ 0x3731, "KOEI" },
{ 0x3831, "Hudson Soft" },
{ 0x3931, "S.C.P." },
{ 0x4131, "Yanoman" },
{ 0x4331, "Tecmo Products" },
{ 0x4431, "Japan Glary Business" },
{ 0x4531, "Forum/OpenSystem" },
{ 0x4631, "Virgin Games" },
{ 0x4731, "SMDE" },
{ 0x4A31, "Daikokudenki" },
{ 0x5031, "Creatures Inc." },
{ 0x5131, "TDK Deep Impresion" },
{ 0x3032, "Destination Software, KSS" },
{ 0x3132, "Sunsoft/Tokai Engineering??" },
{ 0x3232, "POW, VR 1 Japan??" },
{ 0x3332, "Micro World" },
{ 0x3532, "San-X" },
{ 0x3632, "Enix" },
{ 0x3732, "Loriciel/Electro Brain" },
{ 0x3832, "Kemco Japan" },
{ 0x3932, "Seta" },
{ 0x4132, "Culture Brain" },
{ 0x4332, "Palsoft" },
{ 0x4432, "Visit Co.,Ltd." },
{ 0x4532, "Intec" },
{ 0x4632, "System Sacom" },
{ 0x4732, "Poppo" },
{ 0x4832, "Ubisoft Japan" },
{ 0x4A32, "Media Works" },
{ 0x4B32, "NEC InterChannel" },
{ 0x4C32, "Tam" },
{ 0x4D32, "Jordan" },
{ 0x4E32, "Smilesoft ???, Rocket ???" },
{ 0x5132, "Mediakite" },
{ 0x3033, "Viacom" },
{ 0x3133, "Carrozzeria" },
{ 0x3233, "Dynamic" },
{ 0x3433, "Magifact" },
{ 0x3533, "Hect" },
{ 0x3633, "Codemasters" },
{ 0x3733, "Taito/GAGA Communications" },
{ 0x3833, "Laguna" },
{ 0x3933, "Telstar Fun & Games, Event/Taito" },
{ 0x4233, "Arcade Zone Ltd" },
{ 0x4333, "Entertainment International/Empire Software?" },
{ 0x4433, "Loriciel" },
{ 0x4533, "Gremlin Graphics" },
{ 0x4633, "K.Amusement Leasing Co." },
{ 0x3034, "Seika Corp." },
{ 0x3134, "Ubi Soft Entertainment" },
{ 0x3234, "Sunsoft US?" },
{ 0x3434, "Life Fitness" },
{ 0x3634, "System 3" },
{ 0x3734, "Spectrum Holobyte" },
{ 0x3934, "IREM" },
{ 0x4234, "Raya Systems" },
{ 0x4334, "Renovation Products" },
{ 0x4434, "Malibu Games" },
{ 0x4634, "Eidos (was U.S. Gold <=1995)" },
{ 0x4734, "Playmates Interactive?" },
{ 0x4A34, "Fox Interactive" },
{ 0x4B34, "Time Warner Interactive" },
{ 0x5134, "Disney Interactive" },
{ 0x5334, "Black Pearl" },
{ 0x5534, "Advanced Productions" },
{ 0x5834, "GT Interactive" },
{ 0x5934, "RARE?" },
{ 0x5A34, "Crave Entertainment" },
{ 0x3035, "Absolute Entertainment" },
{ 0x3135, "Acclaim" },
{ 0x3235, "Activision" },
{ 0x3335, "American Sammy" },
{ 0x3435, "Take 2 Interactive (before it was GameTek)" },
{ 0x3535, "Hi Tech" },
{ 0x3635, "LJN LTD." },
{ 0x3835, "Mattel" },
{ 0x4135, "Mindscape, Red Orb Entertainment?" },
{ 0x4235, "Romstar" },
{ 0x4335, "Taxan" },
{ 0x4435, "Midway (before it was Tradewest)" },
{ 0x4635, "American Softworks" },
{ 0x4735, "Majesco Sales Inc" },
{ 0x4835, "3DO" },
{ 0x4B35, "Hasbro" },
{ 0x4C35, "NewKidCo" },
{ 0x4D35, "Telegames" },
{ 0x4E35, "Metro3D" },
{ 0x5035, "Vatical Entertainment" },
{ 0x5135, "LEGO Media" },
{ 0x5335, "Xicat Interactive" },
{ 0x5435, "Cryo Interactive" },
{ 0x5735, "Red Storm Entertainment" },
{ 0x5835, "Microids" },
{ 0x5A35, "Conspiracy/Swing" },
{ 0x3036, "Titus" },
{ 0x3136, "Virgin Interactive" },
{ 0x3236, "Maxis" },
{ 0x3436, "LucasArts Entertainment" },
{ 0x3736, "Ocean" },
{ 0x3936, "Electronic Arts" },
{ 0x4236, "Laser Beam" },
{ 0x4536, "Elite Systems" },
{ 0x4636, "Electro Brain" },
{ 0x4736, "The Learning Company" },
{ 0x4836, "BBC" },
{ 0x4A36, "Software 2000" },
{ 0x4C36, "BAM! Entertainment" },
{ 0x4D36, "Studio 3" },
{ 0x5136, "Classified Games" },
{ 0x5336, "TDK Mediactive" },
{ 0x5536, "DreamCatcher" },
{ 0x5636, "JoWood Produtions" },
{ 0x5736, "SEGA" },
{ 0x5836, "Wannado Edition" },
{ 0x5936, "LSP" },
{ 0x5A36, "ITE Media" },
{ 0x3037, "Infogrames" },
{ 0x3137, "Interplay" },
{ 0x3237, "JVC" },
{ 0x3337, "Parker Brothers" },
{ 0x3537, "Sales Curve" },
{ 0x3837, "THQ" },
{ 0x3937, "Accolade" },
{ 0x4137, "Triffix Entertainment" },
{ 0x4337, "Microprose Software" },
{ 0x4437, "Universal Interactive, Sierra, Simon & Schuster?" },
{ 0x4637, "Kemco" },
{ 0x4737, "Rage Software" },
{ 0x4837, "Encore" },
{ 0x4A37, "Zoo" },
{ 0x4B37, "BVM" },
{ 0x4C37, "Simon & Schuster Interactive" },
{ 0x4D37, "Asmik Ace Entertainment Inc./AIA" },
{ 0x4E37, "Empire Interactive?" },
{ 0x5137, "Jester Interactive" },
{ 0x5437, "Scholastic" },
{ 0x5537, "Ignition Entertainment" },
{ 0x5737, "Stadlbauer" },
{ 0x3038, "Misawa" },
{ 0x3138, "Teichiku" },
{ 0x3238, "Namco Ltd." },
{ 0x3338, "LOZC" },
{ 0x3438, "KOEI" },
{ 0x3638, "Tokuma Shoten Intermedia" },
{ 0x3738, "Tsukuda Original" },
{ 0x3838, "DATAM-Polystar" },
{ 0x4238, "Bulletproof Software" },
{ 0x4338, "Vic Tokai Inc." },
{ 0x4538, "Character Soft" },
{ 0x4638, "I'Max" },
{ 0x4738, "Saurus" },
{ 0x4A38, "General Entertainment" },
{ 0x4E38, "Success" },
{ 0x5038, "SEGA Japan" },
{ 0x3039, "Takara Amusement" },
{ 0x3139, "Chun Soft" },
{ 0x3239, "Video System, McO'River???" },
{ 0x3339, "BEC" },
{ 0x3539, "Varie" },
{ 0x3639, "Yonezawa/S'pal" },
{ 0x3739, "Kaneko" },
{ 0x3939, "Victor Interactive Software, Pack in Video" },
{ 0x4139, "Nichibutsu/Nihon Bussan" },
{ 0x4239, "Tecmo" },
{ 0x4339, "Imagineer" },
{ 0x4639, "Nova" },
{ 0x4739, "Den'Z" },
{ 0x4839, "Bottom Up" },
{ 0x4A39, "TGL" },
{ 0x4C39, "Hasbro Japan?" },
{ 0x4E39, "Marvelous Entertainment" },
{ 0x5039, "Keynet Inc." },
{ 0x5139, "Hands-On Entertainment" },
{ 0x3041, "Telenet" },
{ 0x3141, "Hori" },
{ 0x3441, "Konami" },
{ 0x3541, "K.Amusement Leasing Co." },
{ 0x3641, "Kawada" },
{ 0x3741, "Takara" },
{ 0x3941, "Technos Japan Corp." },
{ 0x4141, "JVC, Victor Musical Indutries" },
{ 0x4341, "Toei Animation" },
{ 0x4441, "Toho" },
{ 0x4641, "Namco" },
{ 0x4741, "Media Rings Corporation" },
{ 0x4841, "J-Wing" },
{ 0x4A41, "Pioneer LDC" },
{ 0x4B41, "KID" },
{ 0x4C41, "Mediafactory" },
{ 0x5041, "Infogrames Hudson" },
{ 0x5141, "Kiratto. Ludic Inc" },
{ 0x3042, "Acclaim Japan" },
{ 0x3142, "ASCII (was Nexoft?)" },
{ 0x3242, "Bandai" },
{ 0x3442, "Enix" },
{ 0x3642, "HAL Laboratory" },
{ 0x3742, "SNK" },
{ 0x3942, "Pony Canyon" },
{ 0x4142, "Culture Brain" },
{ 0x4242, "Sunsoft" },
{ 0x4342, "Toshiba EMI" },
{ 0x4442, "Sony Imagesoft" },
{ 0x4642, "Sammy" },
{ 0x4742, "Magical" },
{ 0x4842, "Visco" },
{ 0x4A42, "Compile " },
{ 0x4C42, "MTO Inc." },
{ 0x4E42, "Sunrise Interactive" },
{ 0x5042, "Global A Entertainment" },
{ 0x5142, "Fuuki" },
{ 0x3043, "Taito" },
{ 0x3243, "Kemco" },
{ 0x3343, "Square" },
{ 0x3443, "Tokuma Shoten" },
{ 0x3543, "Data East" },
{ 0x3643, "Tonkin House (was Tokyo Shoseki)" },
{ 0x3843, "Koei" },
{ 0x4143, "Konami/Ultra/Palcom" },
{ 0x4243, "NTVIC/VAP" },
{ 0x4343, "Use Co.,Ltd." },
{ 0x4443, "Meldac" },
{ 0x4543, "Pony Canyon" },
{ 0x4643, "Angel, Sotsu Agency/Sunrise" },
{ 0x4A43, "Boss" },
{ 0x4743, "Yumedia/Aroma Co., Ltd" },
{ 0x4B43, "Axela/Crea-Tech?" },
{ 0x4C43, "Sekaibunka-Sha, Sumire kobo?, Marigul Management Inc.?" },
{ 0x4D43, "Konami Computer Entertainment Osaka" },
{ 0x5043, "Enterbrain" },
{ 0x3044, "Taito/Disco" },
{ 0x3144, "Sofel" },
{ 0x3244, "Quest, Bothtec" },
{ 0x3344, "Sigma, ?????" },
{ 0x3444, "Ask Kodansha" },
{ 0x3644, "Naxat" },
{ 0x3744, "Copya System" },
{ 0x3844, "Capcom Co., Ltd." },
{ 0x3944, "Banpresto" },
{ 0x4144, "TOMY" },
{ 0x4244, "LJN Japan" },
{ 0x4444, "NCS" },
{ 0x4544, "Human Entertainment" },
{ 0x4644, "Altron" },
{ 0x4744, "Jaleco???" },
{ 0x4844, "Gaps Inc." },
{ 0x4C44, "????" },
{ 0x4E44, "Elf" },
{ 0x3045, "Jaleco" },
{ 0x3145, "????" },
{ 0x3245, "Yutaka" },
{ 0x3345, "Varie" },
{ 0x3445, "T&ESoft" },
{ 0x3545, "Epoch" },
{ 0x3745, "Athena" },
{ 0x3845, "Asmik" },
{ 0x3945, "Natsume" },
{ 0x4145, "King Records" },
{ 0x4245, "Atlus" },
{ 0x4345, "Epic/Sony Records" },
{ 0x4545, "IGS" },
{ 0x4745, "Chatnoir" },
{ 0x4845, "Right Stuff" },
{ 0x4C45, "Spike" },
{ 0x4D45, "Konami Computer Entertainment Tokyo" },
{ 0x4E45, "Alphadream Corporation" },
{ 0x3046, "A Wave" },
{ 0x3146, "Motown Software" },
{ 0x3246, "Left Field Entertainment" },
{ 0x3346, "Extreme Ent. Grp." },
{ 0x3446, "TecMagik" },
{ 0x3946, "Cybersoft" },
{ 0x4246, "Psygnosis" },
{ 0x4546, "Davidson/Western Tech." },
{ 0x3147, "PCCW Japan" },
{ 0x3447, "KiKi Co Ltd" },
{ 0x3547, "Open Sesame Inc???" },
{ 0x3647, "Sims" },
{ 0x3747, "Broccoli" },
{ 0x3847, "Avex" },
{ 0x3947, "D3 Publisher" },
{ 0x4247, "Konami Computer Entertainment Japan" },
{ 0x4447, "Square-Enix" },
{ 0x4849, "Yojigen" },
};
//------------------------------------------------------------
//ENDLARGE
//------------------------------------------------------------
namespace Database
{
const char* RegionXXXForCode(char code, bool unknownAsString)
{
size_t regions_num = ARRAY_SIZE(regions);
const char* found = strchr(regions_index,code);
if(found && found-regions_index < strlen(regions_index)) return regions[found-regions_index];
else return unknownAsString ? "???" : NULL;
}
const char *MakerNameForMakerCode(u16 id, bool unknownAsString)
{
//too bad these aren't sorted
for (size_t i = 0; i < ARRAY_SIZE(makerCodes); i++)
{
if (makerCodes[i].code == id)
return makerCodes[i].name;
}
return unknownAsString ? "Unknown" : NULL;
}
}

10
desmume/src/Database.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef DESMUME_DATABASE_H_
#define DESMUME_DATABASE_H_
namespace Database
{
const char* RegionXXXForCode(char code, bool unknownAsString);
const char* MakerNameForMakerCode(u16 id, bool unknownAsString);
};
#endif

549
desmume/src/FIFO.cpp Executable file
View File

@ -0,0 +1,549 @@
/*
Copyright 2006 yopyop
Copyright 2007 shash
Copyright 2007-2024 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "FIFO.h"
#include <string.h>
#include "armcpu.h"
#include "debug.h"
#include "mem.h"
#include "MMU.h"
#include "registers.h"
#include "NDSSystem.h"
#include "gfx3d.h"
#if defined(ENABLE_AVX512_1)
#define USEVECTORSIZE_512
#define VECTORSIZE 64
#elif defined(ENABLE_AVX2)
#define USEVECTORSIZE_256
#define VECTORSIZE 32
#elif defined(ENABLE_SSE2)
#define USEVECTORSIZE_128
#define VECTORSIZE 16
#elif defined(ENABLE_NEON_A64)
#define USEVECTORSIZE_128
#define VECTORSIZE 16
#elif defined(ENABLE_ALTIVEC)
#define USEVECTORSIZE_128
#define VECTORSIZE 16
#endif
#if defined(USEVECTORSIZE_512) || defined(USEVECTORSIZE_256) || defined(USEVECTORSIZE_128)
#define USEMANUALVECTORIZATION
#endif
// ========================================================= IPC FIFO
IPC_FIFO ipc_fifo[2];
void IPC_FIFOinit(u8 proc)
{
memset(&ipc_fifo[proc], 0, sizeof(IPC_FIFO));
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, 0x00000101);
}
void IPC_FIFOsend(u8 proc, u32 val)
{
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
if (!(cnt_l & IPCFIFOCNT_FIFOENABLE)) return; // FIFO disabled
u8 proc_remote = proc ^ 1;
if (ipc_fifo[proc].size > 15)
{
cnt_l |= IPCFIFOCNT_FIFOERROR;
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
return;
}
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc_remote][0x40], 0x184);
//LOG("IPC%s send FIFO 0x%08X size %03i (l 0x%X, tail %02i) (r 0x%X, tail %02i)\n",
// proc?"7":"9", val, ipc_fifo[proc].size, cnt_l, ipc_fifo[proc].tail, cnt_r, ipc_fifo[proc^1].tail);
cnt_l &= 0xBFFC; // clear send empty bit & full
cnt_r &= 0xBCFF; // set recv empty bit & full
ipc_fifo[proc].buf[ipc_fifo[proc].tail] = val;
ipc_fifo[proc].tail++;
ipc_fifo[proc].size++;
if (ipc_fifo[proc].tail > 15) ipc_fifo[proc].tail = 0;
if (ipc_fifo[proc].size > 15)
{
cnt_l |= IPCFIFOCNT_SENDFULL; // set send full bit
cnt_r |= IPCFIFOCNT_RECVFULL; // set recv full bit
}
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
T1WriteWord(MMU.MMU_MEM[proc_remote][0x40], 0x184, cnt_r);
if(cnt_r&IPCFIFOCNT_RECVIRQEN)
NDS_makeIrq(proc_remote, IRQ_BIT_IPCFIFO_RECVNONEMPTY);
NDS_Reschedule();
}
u32 IPC_FIFOrecv(u8 proc)
{
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
if (!(cnt_l & IPCFIFOCNT_FIFOENABLE)) return (0); // FIFO disabled
u8 proc_remote = proc ^ 1;
u32 val = 0;
if ( ipc_fifo[proc_remote].size == 0 ) // remote FIFO error
{
cnt_l |= IPCFIFOCNT_FIFOERROR;
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
return (0);
}
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc_remote][0x40], 0x184);
cnt_l &= 0xBCFF; // clear send full bit & empty
cnt_r &= 0xBFFC; // set recv full bit & empty
val = ipc_fifo[proc_remote].buf[ipc_fifo[proc_remote].head];
ipc_fifo[proc_remote].head++;
ipc_fifo[proc_remote].size--;
if (ipc_fifo[proc_remote].head > 15) ipc_fifo[proc_remote].head = 0;
//LOG("IPC%s recv FIFO 0x%08X size %03i (l 0x%X, tail %02i) (r 0x%X, tail %02i)\n",
// proc?"7":"9", val, ipc_fifo[proc].size, cnt_l, ipc_fifo[proc].tail, cnt_r, ipc_fifo[proc^1].tail);
if ( ipc_fifo[proc_remote].size == 0 ) // FIFO empty
{
cnt_l |= IPCFIFOCNT_RECVEMPTY;
cnt_r |= IPCFIFOCNT_SENDEMPTY;
if(cnt_r&IPCFIFOCNT_SENDIRQEN)
NDS_makeIrq(proc_remote, IRQ_BIT_IPCFIFO_SENDEMPTY);
}
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
T1WriteWord(MMU.MMU_MEM[proc_remote][0x40], 0x184, cnt_r);
NDS_Reschedule();
return (val);
}
void IPC_FIFOcnt(u8 proc, u16 val)
{
u16 cnt_l = T1ReadWord(MMU.MMU_MEM[proc][0x40], 0x184);
u16 cnt_r = T1ReadWord(MMU.MMU_MEM[proc^1][0x40], 0x184);
if (val & IPCFIFOCNT_FIFOERROR)
{
//at least SPP uses this, maybe every retail game
cnt_l &= ~IPCFIFOCNT_FIFOERROR;
}
if (val & IPCFIFOCNT_SENDCLEAR)
{
ipc_fifo[proc].head = 0; ipc_fifo[proc].tail = 0; ipc_fifo[proc].size = 0;
cnt_l |= IPCFIFOCNT_SENDEMPTY;
cnt_r |= IPCFIFOCNT_RECVEMPTY;
cnt_l &= ~IPCFIFOCNT_SENDFULL;
cnt_r &= ~IPCFIFOCNT_RECVFULL;
}
cnt_l &= ~IPCFIFOCNT_WRITEABLE;
cnt_l |= val & IPCFIFOCNT_WRITEABLE;
//IPCFIFOCNT_SENDIRQEN may have been set (and/or the fifo may have been cleared) so we may need to trigger this irq
//(this approach is used by libnds fifo system on occasion in fifoInternalSend, and began happening frequently for value32 with r4326)
if(cnt_l&IPCFIFOCNT_SENDIRQEN) if(cnt_l & IPCFIFOCNT_SENDEMPTY)
NDS_makeIrq(proc, IRQ_BIT_IPCFIFO_SENDEMPTY);
//IPCFIFOCNT_RECVIRQEN may have been set so we may need to trigger this irq
if(cnt_l&IPCFIFOCNT_RECVIRQEN) if(!(cnt_l & IPCFIFOCNT_RECVEMPTY))
NDS_makeIrq(proc, IRQ_BIT_IPCFIFO_RECVNONEMPTY);
T1WriteWord(MMU.MMU_MEM[proc][0x40], 0x184, cnt_l);
T1WriteWord(MMU.MMU_MEM[proc^1][0x40], 0x184, cnt_r);
NDS_Reschedule();
}
// ========================================================= GFX FIFO
GFX_PIPE gxPIPE;
GFX_FIFO gxFIFO;
void GFX_PIPEclear()
{
gxPIPE.head = 0;
gxPIPE.tail = 0;
gxPIPE.size = 0;
gxFIFO.matrix_stack_op_size = 0;
}
void GFX_FIFOclear()
{
gxFIFO.head = 0;
gxFIFO.tail = 0;
gxFIFO.size = 0;
gxFIFO.matrix_stack_op_size = 0;
}
static void GXF_FIFO_handleEvents()
{
bool low = gxFIFO.size <= 127;
bool lowchange = MMU_new.gxstat.fifo_low ^ low;
MMU_new.gxstat.fifo_low = low;
if(low) triggerDma(EDMAMode_GXFifo);
bool empty = gxFIFO.size == 0;
bool emptychange = MMU_new.gxstat.fifo_empty ^ empty;
MMU_new.gxstat.fifo_empty = empty;
MMU_new.gxstat.sb = gxFIFO.matrix_stack_op_size != 0;
if(emptychange||lowchange) NDS_Reschedule();
}
static bool IsMatrixStackCommand(u8 cmd)
{
return cmd == 0x11 || cmd == 0x12;
}
void GFX_FIFOsend(u8 cmd, u32 param)
{
//INFO("gxFIFO: send 0x%02X = 0x%08X (size %03i/0x%02X) gxstat 0x%08X\n", cmd, param, gxFIFO.size, gxFIFO.size, gxstat);
//printf("fifo recv: %02X: %08X upto:%d\n",cmd,param,gxFIFO.size+1);
//TODO - WOAH ! NOT HANDLING A TOO-BIG FIFO RIGHT NOW!
//if (gxFIFO.size > 255)
//{
// GXF_FIFO_handleEvents();
// //NEED TO HANDLE THIS!!!!!!!!!!!!!!!!!!!!!!!!!!
// //gxstat |= 0x08000000; // busy
// NDS_RescheduleGXFIFO(1);
// //INFO("ERROR: gxFIFO is full (cmd 0x%02X = 0x%08X) (prev cmd 0x%02X = 0x%08X)\n", cmd, param, gxFIFO.cmd[255], gxFIFO.param[255]);
// return;
//}
gxFIFO.cmd[gxFIFO.tail] = cmd;
gxFIFO.param[gxFIFO.tail] = param;
gxFIFO.tail++;
gxFIFO.size++;
if (gxFIFO.tail > HACK_GXIFO_SIZE-1) gxFIFO.tail = 0;
//if a matrix op is entering the pipeline, do accounting for it
//(this is tested by wild west, which will jam a few ops in the fifo and then wait for the matrix stack to be
//un-busy so it can read back the current matrix stack position).
//it is definitely only pushes and pops which set this flag.
//seems like it would be less work in the HW to make a counter than do cmps on all the command bytes, so maybe we're even doing it right.
if(IsMatrixStackCommand(cmd))
gxFIFO.matrix_stack_op_size++;
//along the same lines:
//american girls julie finds a way will put a bunch of stuff and then a box test into the fifo and then immediately test the busy flag
//so we need to set the busy flag here.
//does it expect the fifo to be running then? well, it's definitely jammed -- making it unjammed at one point did fix this bug.
//it's still not clear whether we're handling the immediate vs fifo commands properly at all :(
//anyway, here we go, similar treatment. consider this a hack.
if(cmd == 0x70) MMU_new.gxstat.tb = 1; //just set the flag--youre insane if you queue more than one of these anyway
if(cmd == 0x71) MMU_new.gxstat.tb = 1;
if(gxFIFO.size>=HACK_GXIFO_SIZE) {
printf("--FIFO FULL-- : %d\n",gxFIFO.size);
}
//gxstat |= 0x08000000; // set busy flag
GXF_FIFO_handleEvents();
NDS_RescheduleGXFIFO(1);
}
// this function used ONLY in gxFIFO
BOOL GFX_PIPErecv(u8 *cmd, u32 *param)
{
//gxstat &= 0xF7FFFFFF; // clear busy flag
if (gxFIFO.size == 0)
{
GXF_FIFO_handleEvents();
return FALSE;
}
*cmd = gxFIFO.cmd[gxFIFO.head];
*param = gxFIFO.param[gxFIFO.head];
//see the associated increment in another function
if(IsMatrixStackCommand(*cmd))
{
gxFIFO.matrix_stack_op_size--;
if(gxFIFO.matrix_stack_op_size>0x10000000)
printf("bad news disaster in matrix_stack_op_size\n");
}
gxFIFO.head++;
gxFIFO.size--;
if (gxFIFO.head > HACK_GXIFO_SIZE-1) gxFIFO.head = 0;
GXF_FIFO_handleEvents();
return (TRUE);
}
void GFX_FIFOcnt(u32 val)
{
////INFO("gxFIFO: write cnt 0x%08X (prev 0x%08X) FIFO size %03i PIPE size %03i\n", val, gxstat, gxFIFO.size, gxPIPE.size);
if (val & (1<<29)) // clear? (only in homebrew?)
{
GFX_PIPEclear();
GFX_FIFOclear();
return;
}
//zeromus says: what happened to clear stack?
//if (val & (1<<15)) // projection stack pointer reset
//{
// gfx3d_ClearStack();
// val &= 0xFFFF5FFF; // clear reset (bit15) & stack level (bit13)
//}
T1WriteLong(MMU.ARM9_REG, 0x600, val);
}
// ========================================================= DISP FIFO
DISP_FIFO disp_fifo;
void DISP_FIFOinit()
{
memset(&disp_fifo, 0, sizeof(DISP_FIFO));
}
template <typename T, size_t ADDROFFSET>
void DISP_FIFOsend(const T val)
{
//INFO("DISP_FIFO send value 0x%08X (head 0x%06X, tail 0x%06X)\n", val, disp_fifo.head, disp_fifo.tail);
const size_t numBytes = sizeof(T);
const size_t baseWriteAddress = disp_fifo.tail * sizeof(u32);
const size_t finalWriteAddress = baseWriteAddress + ADDROFFSET;
switch (numBytes)
{
case 1:
{
#ifndef MSB_FIRST
HostWriteByte((u8 *)disp_fifo.buf, (u32)finalWriteAddress, val);
#else
switch (ADDROFFSET)
{
case 0:
HostWriteByte((u8 *)disp_fifo.buf, (u32)baseWriteAddress + 2, val);
break;
case 1:
HostWriteByte((u8 *)disp_fifo.buf, (u32)baseWriteAddress + 3, val);
break;
case 2:
HostWriteByte((u8 *)disp_fifo.buf, (u32)baseWriteAddress + 0, val);
break;
case 3:
HostWriteByte((u8 *)disp_fifo.buf, (u32)baseWriteAddress + 1, val);
break;
default:
break;
}
#endif
#ifndef MSB_FIRST
if (ADDROFFSET == 3)
#else
if (ADDROFFSET == 1)
#endif
{
disp_fifo.tail++;
}
break;
}
case 2:
{
#ifndef MSB_FIRST
HostWriteWord((u8 *)disp_fifo.buf, (u32)finalWriteAddress, val);
#else
switch (ADDROFFSET)
{
case 0:
HostWriteWord((u8 *)disp_fifo.buf, (u32)baseWriteAddress + 2, val);
break;
case 2:
HostWriteWord((u8 *)disp_fifo.buf, (u32)baseWriteAddress + 0, val);
break;
default:
break;
}
#endif
#ifndef MSB_FIRST
if (ADDROFFSET == 2)
#else
if (ADDROFFSET == 0)
#endif
{
disp_fifo.tail++;
}
break;
}
case 4:
HostWriteTwoWords((u8 *)disp_fifo.buf, (u32)finalWriteAddress, val);
disp_fifo.tail++;
break;
default:
break;
}
if (disp_fifo.tail >= 0x6000)
{
disp_fifo.tail = 0;
}
}
u32 DISP_FIFOrecv_u32()
{
//if (disp_fifo.tail == disp_fifo.head) return (0); // FIFO is empty
u32 val = disp_fifo.buf[disp_fifo.head];
disp_fifo.head++;
if (disp_fifo.head >= 0x6000)
{
disp_fifo.head = 0;
}
return val;
}
static void _DISP_FIFOrecv_LineAdvance()
{
disp_fifo.head += (GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16)) / sizeof(u32);
if (disp_fifo.head >= 0x6000)
{
disp_fifo.head -= 0x6000;
}
}
void DISP_FIFOrecv_Line16(u16 *__restrict dst)
{
#ifdef USEMANUALVECTORIZATION
if ( (disp_fifo.head + (GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16)) / sizeof(u32) <= 0x6000) && (disp_fifo.head == (disp_fifo.head & ~(VECTORSIZE - 1))) )
{
buffer_copy_fast<GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16)>(dst, disp_fifo.buf + disp_fifo.head);
_DISP_FIFOrecv_LineAdvance();
}
else
#endif // USEMANUALVECTORIZATION
{
for (size_t i = 0; i < GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16) / sizeof(u32); i++)
{
const u32 src = DISP_FIFOrecv_u32();
((u32 *)dst)[i] = src;
}
}
}
template <NDSColorFormat OUTPUTFORMAT>
void DISP_FIFOrecv_LineOpaque(u32 *__restrict dst)
{
#ifdef USEMANUALVECTORIZATION
if ( (disp_fifo.head + (GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16)) / sizeof(u32) <= 0x6000) && (disp_fifo.head == (disp_fifo.head & ~(VECTORSIZE - 1))) )
{
if (OUTPUTFORMAT == NDSColorFormat_BGR555_Rev)
{
buffer_copy_or_constant_s16_fast<GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16), false>(dst, disp_fifo.buf + disp_fifo.head, 0x8000);
}
else if (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev)
{
ColorspaceConvertBuffer555xTo6665Opaque<false, false, BESwapDst>((u16 *)(disp_fifo.buf + disp_fifo.head), dst, GPU_FRAMEBUFFER_NATIVE_WIDTH);
}
else if (OUTPUTFORMAT == NDSColorFormat_BGR888_Rev)
{
ColorspaceConvertBuffer555xTo8888Opaque<false, false, BESwapDst>((u16 *)(disp_fifo.buf + disp_fifo.head), dst, GPU_FRAMEBUFFER_NATIVE_WIDTH);
}
_DISP_FIFOrecv_LineAdvance();
}
else
#endif // USEMANUALVECTORIZATION
{
if (OUTPUTFORMAT == NDSColorFormat_BGR555_Rev)
{
for (size_t i = 0; i < GPU_FRAMEBUFFER_NATIVE_WIDTH * sizeof(u16) / sizeof(u32); i++)
{
const u32 src = DISP_FIFOrecv_u32();
dst[i] = src | 0x80008000;
}
}
else
{
for (size_t i = 0; i < GPU_FRAMEBUFFER_NATIVE_WIDTH; i+=2)
{
const u32 src = DISP_FIFOrecv_u32();
if (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev)
{
dst[i+0] = LE_TO_LOCAL_32( ColorspaceConvert555To6665Opaque<false>((src >> 0) & 0x7FFF) );
dst[i+1] = LE_TO_LOCAL_32( ColorspaceConvert555To6665Opaque<false>((src >> 16) & 0x7FFF) );
}
else if (OUTPUTFORMAT == NDSColorFormat_BGR888_Rev)
{
dst[i+0] = LE_TO_LOCAL_32( ColorspaceConvert555To8888Opaque<false>((src >> 0) & 0x7FFF) );
dst[i+1] = LE_TO_LOCAL_32( ColorspaceConvert555To8888Opaque<false>((src >> 16) & 0x7FFF) );
}
}
}
}
}
void DISP_FIFOreset()
{
disp_fifo.head = 0;
disp_fifo.tail = 0;
}
template void DISP_FIFOsend< u8, 0>(const u8 val);
template void DISP_FIFOsend< u8, 1>(const u8 val);
template void DISP_FIFOsend< u8, 2>(const u8 val);
template void DISP_FIFOsend< u8, 3>(const u8 val);
template void DISP_FIFOsend<u16, 0>(const u16 val);
template void DISP_FIFOsend<u16, 2>(const u16 val);
template void DISP_FIFOsend<u32, 0>(const u32 val);
template void DISP_FIFOrecv_LineOpaque<NDSColorFormat_BGR555_Rev>(u32 *__restrict dst);
template void DISP_FIFOrecv_LineOpaque<NDSColorFormat_BGR666_Rev>(u32 *__restrict dst);
template void DISP_FIFOrecv_LineOpaque<NDSColorFormat_BGR888_Rev>(u32 *__restrict dst);

98
desmume/src/FIFO.h Normal file
View File

@ -0,0 +1,98 @@
/*
Copyright 2006 yopyop
Copyright 2007 shash
Copyright 2007-2022 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FIFO_H
#define FIFO_H
#include "types.h"
#include "./utils/colorspacehandler/colorspacehandler.h"
//=================================================== IPC FIFO
typedef struct
{
u32 buf[16];
u8 head;
u8 tail;
u8 size;
} IPC_FIFO;
extern IPC_FIFO ipc_fifo[2];
extern void IPC_FIFOinit(u8 proc);
extern void IPC_FIFOsend(u8 proc, u32 val);
extern u32 IPC_FIFOrecv(u8 proc);
extern void IPC_FIFOcnt(u8 proc, u16 val);
//=================================================== GFX FIFO
//yeah, its oversize for now. thats a simpler solution
//moon seems to overdrive the fifo with immediate dmas
//i think this might be nintendo code too
#define HACK_GXIFO_SIZE 200000
typedef struct
{
u8 cmd[HACK_GXIFO_SIZE];
u32 param[HACK_GXIFO_SIZE];
u32 head; // start position
u32 tail; // tail
u32 size; // size FIFO buffer
u32 matrix_stack_op_size; //number of matrix stack items in the fifo (stack is busy when this is nonzero)
} GFX_FIFO;
typedef struct
{
u8 cmd[4];
u32 param[4];
u8 head;
u8 tail;
u8 size;
} GFX_PIPE;
extern GFX_PIPE gxPIPE;
extern GFX_FIFO gxFIFO;
void GFX_PIPEclear();
void GFX_FIFOclear();
void GFX_FIFOsend(u8 cmd, u32 param);
BOOL GFX_PIPErecv(u8 *cmd, u32 *param);
void GFX_FIFOcnt(u32 val);
//=================================================== Display memory FIFO
typedef struct
{
CACHE_ALIGN u32 buf[0x6000]; // 256x192 32K color
u32 head; // head
u32 tail; // tail
} DISP_FIFO;
extern DISP_FIFO disp_fifo;
void DISP_FIFOinit();
template<typename T, size_t ADDROFFSET> void DISP_FIFOsend(const T val);
u32 DISP_FIFOrecv_u32();
void DISP_FIFOrecv_Line16(u16 *__restrict dst);
template<NDSColorFormat OUTPUTFORMAT> void DISP_FIFOrecv_LineOpaque(u32 *__restrict dst);
void DISP_FIFOreset();
#endif

6606
desmume/src/GPU.cpp Normal file

File diff suppressed because it is too large Load Diff

2038
desmume/src/GPU.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
/*
Copyright (C) 2021-2023 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPU_OPERATIONS_H
#define GPU_OPERATIONS_H
#include <stdio.h>
#include "types.h"
#include "./utils/colorspacehandler/colorspacehandler.h"
#include "GPU.h"
template <s32 INTEGERSCALEHINT, bool SCALEVERTICAL, bool USELINEINDEX, bool NEEDENDIANSWAP, size_t ELEMENTSIZE>
void CopyLineExpandHinted(const void *__restrict srcBuffer, const size_t srcLineIndex,
void *__restrict dstBuffer, const size_t dstLineIndex, const size_t dstLineWidth, const size_t dstLineCount);
template <s32 INTEGERSCALEHINT, bool SCALEVERTICAL, bool USELINEINDEX, bool NEEDENDIANSWAP, size_t ELEMENTSIZE>
void CopyLineExpandHinted(const GPUEngineLineInfo &lineInfo, const void *__restrict srcBuffer, void *__restrict dstBuffer);
template <s32 INTEGERSCALEHINT, bool USELINEINDEX, bool NEEDENDIANSWAP, size_t ELEMENTSIZE>
void CopyLineReduceHinted(const void *__restrict srcBuffer, const size_t srcLineIndex, const size_t srcLineWidth,
void *__restrict dstBuffer, const size_t dstLineIndex);
template <s32 INTEGERSCALEHINT, bool USELINEINDEX, bool NEEDENDIANSWAP, size_t ELEMENTSIZE>
void CopyLineReduceHinted(const GPUEngineLineInfo &lineInfo, const void *__restrict srcBuffer, void *__restrict dstBuffer);
class ColorOperation
{
public:
ColorOperation() {};
FORCEINLINE u16 blend(const u16 colA, const u16 colB, const u16 blendEVA, const u16 blendEVB) const;
FORCEINLINE u16 blend(const u16 colA, const u16 colB, const TBlendTable *blendTable) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE Color4u8 blend(const Color4u8 colA, const Color4u8 colB, const u16 blendEVA, const u16 blendEVB) const;
FORCEINLINE u16 blend3D(const Color4u8 colA, const u16 colB) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE Color4u8 blend3D(const Color4u8 colA, const Color4u8 colB) const;
FORCEINLINE u16 increase(const u16 col, const u16 blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE Color4u8 increase(const Color4u8 col, const u16 blendEVY) const;
FORCEINLINE u16 decrease(const u16 col, const u16 blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE Color4u8 decrease(const Color4u8 col, const u16 blendEVY) const;
};
class PixelOperation
{
private:
template<GPULayerType LAYERTYPE> FORCEINLINE void __selectedEffect(const GPUEngineCompositorInfo &compInfo, const u8 &dstLayerID, const bool enableColorEffect, const u8 spriteAlpha, const OBJMode spriteMode, ColorEffect &selectedEffect, TBlendTable **selectedBlendTable, u8 &blendEVA, u8 &blendEVB) const;
protected:
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy16(GPUEngineCompositorInfo &compInfo, const u16 srcColor16) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy32(GPUEngineCompositorInfo &compInfo, const Color4u8 srcColor32) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp16(GPUEngineCompositorInfo &compInfo, const u16 srcColor16) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp32(GPUEngineCompositorInfo &compInfo, const Color4u8 srcColor32) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown16(GPUEngineCompositorInfo &compInfo, const u16 srcColor16) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown32(GPUEngineCompositorInfo &compInfo, const Color4u8 srcColor32) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE> FORCEINLINE void _unknownEffect16(GPUEngineCompositorInfo &compInfo, const u16 srcColor16, const bool enableColorEffect, const u8 spriteAlpha, const OBJMode spriteMode) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE> FORCEINLINE void _unknownEffect32(GPUEngineCompositorInfo &compInfo, const Color4u8 srcColor32, const bool enableColorEffect, const u8 spriteAlpha, const OBJMode spriteMode) const;
public:
static CACHE_ALIGN u8 BlendTable555[17][17][32][32];
static CACHE_ALIGN u16 BrightnessUpTable555[17][0x8000];
static CACHE_ALIGN Color4u8 BrightnessUpTable666[17][0x8000];
static CACHE_ALIGN Color4u8 BrightnessUpTable888[17][0x8000];
static CACHE_ALIGN u16 BrightnessDownTable555[17][0x8000];
static CACHE_ALIGN Color4u8 BrightnessDownTable666[17][0x8000];
static CACHE_ALIGN Color4u8 BrightnessDownTable888[17][0x8000];
static void InitLUTs();
PixelOperation() {};
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE> FORCEINLINE void Composite16(GPUEngineCompositorInfo &compInfo, const u16 srcColor16, const bool enableColorEffect, const u8 spriteAlpha, const u8 spriteMode) const;
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE> FORCEINLINE void Composite32(GPUEngineCompositorInfo &compInfo, Color4u8 srcColor32, const bool enableColorEffect, const u8 spriteAlpha, const u8 spriteMode) const;
};
#endif // GPU_OPERATIONS_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,122 @@
/*
Copyright (C) 2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPU_OPERATIONS_AVX2_H
#define GPU_OPERATIONS_AVX2_H
#include "GPU_Operations.h"
#ifndef ENABLE_AVX2
#warning This header requires AVX2 support.
#else
class ColorOperation_AVX2
{
public:
ColorOperation_AVX2() {};
FORCEINLINE v256u16 blend(const v256u16 &colA, const v256u16 &colB, const v256u16 &blendEVA, const v256u16 &blendEVB) const;
template<NDSColorFormat COLORFORMAT, bool USECONSTANTBLENDVALUESHINT> FORCEINLINE v256u32 blend(const v256u32 &colA, const v256u32 &colB, const v256u16 &blendEVA, const v256u16 &blendEVB) const;
FORCEINLINE v256u16 blend3D(const v256u32 &colA_Lo, const v256u32 &colA_Hi, const v256u16 &colB) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v256u32 blend3D(const v256u32 &colA, const v256u32 &colB) const;
FORCEINLINE v256u16 increase(const v256u16 &col, const v256u16 &blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v256u32 increase(const v256u32 &col, const v256u16 &blendEVY) const;
FORCEINLINE v256u16 decrease(const v256u16 &col, const v256u16 &blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v256u32 decrease(const v256u32 &col, const v256u16 &blendEVY) const;
};
class PixelOperation_AVX2
{
protected:
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy16(GPUEngineCompositorInfo &compInfo, const v256u8 &srcLayerID, const v256u16 &src1, const v256u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy32(GPUEngineCompositorInfo &compInfo, const v256u8 &srcLayerID, const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copyMask16(GPUEngineCompositorInfo &compInfo, const v256u8 &passMask8, const v256u8 &srcLayerID, const v256u16 &src1, const v256u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copyMask32(GPUEngineCompositorInfo &compInfo, const v256u8 &passMask8, const v256u8 &srcLayerID, const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp16(GPUEngineCompositorInfo &compInfo, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u16 &src1, const v256u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp32(GPUEngineCompositorInfo &compInfo, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUpMask16(GPUEngineCompositorInfo &compInfo, const v256u8 &passMask8, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u16 &src1, const v256u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUpMask32(GPUEngineCompositorInfo &compInfo, const v256u8 &passMask8, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown16(GPUEngineCompositorInfo &compInfo, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u16 &src1, const v256u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown32(GPUEngineCompositorInfo &compInfo, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDownMask16(GPUEngineCompositorInfo &compInfo, const v256u8 &passMask8, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u16 &src1, const v256u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDownMask32(GPUEngineCompositorInfo &compInfo, const v256u8 &passMask8, const v256u16 &evy16, const v256u8 &srcLayerID, const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE>
FORCEINLINE void _unknownEffectMask16(GPUEngineCompositorInfo &compInfo,
const v256u8 &passMask8,
const v256u16 &evy16,
const v256u8 &srcLayerID,
const v256u16 &src1, const v256u16 &src0,
const v256u8 &srcEffectEnableMask,
const v256u8 &dstBlendEnableMaskLUT,
const v256u8 &enableColorEffectMask,
const v256u8 &spriteAlpha,
const v256u8 &spriteMode) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE>
FORCEINLINE void _unknownEffectMask32(GPUEngineCompositorInfo &compInfo,
const v256u8 &passMask8,
const v256u16 &evy16,
const v256u8 &srcLayerID,
const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0,
const v256u8 &srcEffectEnableMask,
const v256u8 &dstBlendEnableMaskLUT,
const v256u8 &enableColorEffectMask,
const v256u8 &spriteAlpha,
const v256u8 &spriteMode) const;
public:
PixelOperation_AVX2() {};
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE, bool WILLPERFORMWINDOWTEST>
FORCEINLINE void Composite16(GPUEngineCompositorInfo &compInfo,
const bool didAllPixelsPass,
const v256u8 &passMask8,
const v256u16 &evy16,
const v256u8 &srcLayerID,
const v256u16 &src1, const v256u16 &src0,
const v256u8 &srcEffectEnableMask,
const v256u8 &dstBlendEnableMaskLUT,
const u8 *__restrict enableColorEffectPtr,
const u8 *__restrict sprAlphaPtr,
const u8 *__restrict sprModePtr) const;
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE, bool WILLPERFORMWINDOWTEST>
FORCEINLINE void Composite32(GPUEngineCompositorInfo &compInfo,
const bool didAllPixelsPass,
const v256u8 &passMask8,
const v256u16 &evy16,
const v256u8 &srcLayerID,
const v256u32 &src3, const v256u32 &src2, const v256u32 &src1, const v256u32 &src0,
const v256u8 &srcEffectEnableMask,
const v256u8 &dstBlendEnableMaskLUT,
const u8 *__restrict enableColorEffectPtr,
const u8 *__restrict sprAlphaPtr,
const u8 *__restrict sprModePtr) const;
};
#endif // ENABLE_AVX2
#endif // GPU_OPERATIONS_AVX2_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,122 @@
/*
Copyright (C) 2025 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPU_OPERATIONS_NEON_H
#define GPU_OPERATIONS_NEON_H
#include "GPU_Operations.h"
#ifndef ENABLE_NEON_A64
#warning This header requires ARM64 NEON support.
#else
class ColorOperation_NEON
{
public:
ColorOperation_NEON() {};
FORCEINLINE v128u16 blend(const v128u16 &colA, const v128u16 &colB, const v128u16 &blendEVA, const v128u16 &blendEVB) const;
template<NDSColorFormat COLORFORMAT, bool USECONSTANTBLENDVALUESHINT> FORCEINLINE v128u32 blend(const v128u32 &colA, const v128u32 &colB, const v128u16 &blendEVA, const v128u16 &blendEVB) const;
FORCEINLINE v128u16 blend3D(const v128u32 &colA_Lo, const v128u32 &colA_Hi, const v128u16 &colB) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v128u32 blend3D(const v128u32 &colA, const v128u32 &colB) const;
FORCEINLINE v128u16 increase(const v128u16 &col, const v128u16 &blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v128u32 increase(const v128u32 &col, const v128u16 &blendEVY) const;
FORCEINLINE v128u16 decrease(const v128u16 &col, const v128u16 &blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v128u32 decrease(const v128u32 &col, const v128u16 &blendEVY) const;
};
class PixelOperation_NEON
{
protected:
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy16(GPUEngineCompositorInfo &compInfo, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy32(GPUEngineCompositorInfo &compInfo, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copyMask16(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copyMask32(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp16(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp32(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUpMask16(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUpMask32(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown16(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown32(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDownMask16(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDownMask32(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE>
FORCEINLINE void _unknownEffectMask16(GPUEngineCompositorInfo &compInfo,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u16 &src1, const v128u16 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const v128u8 &enableColorEffectMask,
const v128u8 &spriteAlpha,
const v128u8 &spriteMode) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE>
FORCEINLINE void _unknownEffectMask32(GPUEngineCompositorInfo &compInfo,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const v128u8 &enableColorEffectMask,
const v128u8 &spriteAlpha,
const v128u8 &spriteMode) const;
public:
PixelOperation_NEON() {};
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE, bool WILLPERFORMWINDOWTEST>
FORCEINLINE void Composite16(GPUEngineCompositorInfo &compInfo,
const bool didAllPixelsPass,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u16 &src1, const v128u16 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const u8 *__restrict enableColorEffectPtr,
const u8 *__restrict sprAlphaPtr,
const u8 *__restrict sprModePtr) const;
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE, bool WILLPERFORMWINDOWTEST>
FORCEINLINE void Composite32(GPUEngineCompositorInfo &compInfo,
const bool didAllPixelsPass,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const u8 *__restrict enableColorEffectPtr,
const u8 *__restrict sprAlphaPtr,
const u8 *__restrict sprModePtr) const;
};
#endif // ENABLE_NEON_A64
#endif // GPU_OPERATIONS_NEON_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,122 @@
/*
Copyright (C) 2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPU_OPERATIONS_SSE2_H
#define GPU_OPERATIONS_SSE2_H
#include "GPU_Operations.h"
#ifndef ENABLE_SSE2
#warning This header requires SSE2 support.
#else
class ColorOperation_SSE2
{
public:
ColorOperation_SSE2() {};
FORCEINLINE v128u16 blend(const v128u16 &colA, const v128u16 &colB, const v128u16 &blendEVA, const v128u16 &blendEVB) const;
template<NDSColorFormat COLORFORMAT, bool USECONSTANTBLENDVALUESHINT> FORCEINLINE v128u32 blend(const v128u32 &colA, const v128u32 &colB, const v128u16 &blendEVA, const v128u16 &blendEVB) const;
FORCEINLINE v128u16 blend3D(const v128u32 &colA_Lo, const v128u32 &colA_Hi, const v128u16 &colB) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v128u32 blend3D(const v128u32 &colA, const v128u32 &colB) const;
FORCEINLINE v128u16 increase(const v128u16 &col, const v128u16 &blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v128u32 increase(const v128u32 &col, const v128u16 &blendEVY) const;
FORCEINLINE v128u16 decrease(const v128u16 &col, const v128u16 &blendEVY) const;
template<NDSColorFormat COLORFORMAT> FORCEINLINE v128u32 decrease(const v128u32 &col, const v128u16 &blendEVY) const;
};
class PixelOperation_SSE2
{
protected:
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy16(GPUEngineCompositorInfo &compInfo, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copy32(GPUEngineCompositorInfo &compInfo, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copyMask16(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, bool ISDEBUGRENDER> FORCEINLINE void _copyMask32(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp16(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUp32(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUpMask16(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessUpMask32(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown16(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDown32(GPUEngineCompositorInfo &compInfo, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDownMask16(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u16 &src1, const v128u16 &src0) const;
template<NDSColorFormat OUTPUTFORMAT> FORCEINLINE void _brightnessDownMask32(GPUEngineCompositorInfo &compInfo, const v128u8 &passMask8, const v128u16 &evy16, const v128u8 &srcLayerID, const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE>
FORCEINLINE void _unknownEffectMask16(GPUEngineCompositorInfo &compInfo,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u16 &src1, const v128u16 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const v128u8 &enableColorEffectMask,
const v128u8 &spriteAlpha,
const v128u8 &spriteMode) const;
template<NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE>
FORCEINLINE void _unknownEffectMask32(GPUEngineCompositorInfo &compInfo,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const v128u8 &enableColorEffectMask,
const v128u8 &spriteAlpha,
const v128u8 &spriteMode) const;
public:
PixelOperation_SSE2() {};
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE, bool WILLPERFORMWINDOWTEST>
FORCEINLINE void Composite16(GPUEngineCompositorInfo &compInfo,
const bool didAllPixelsPass,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u16 &src1, const v128u16 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const u8 *__restrict enableColorEffectPtr,
const u8 *__restrict sprAlphaPtr,
const u8 *__restrict sprModePtr) const;
template <GPUCompositorMode COMPOSITORMODE, NDSColorFormat OUTPUTFORMAT, GPULayerType LAYERTYPE, bool WILLPERFORMWINDOWTEST>
FORCEINLINE void Composite32(GPUEngineCompositorInfo &compInfo,
const bool didAllPixelsPass,
const v128u8 &passMask8,
const v128u16 &evy16,
const v128u8 &srcLayerID,
const v128u32 &src3, const v128u32 &src2, const v128u32 &src1, const v128u32 &src0,
const v128u8 &srcEffectEnableMask,
const v128u8 &dstBlendEnableMaskLUT,
const u8 *__restrict enableColorEffectPtr,
const u8 *__restrict sprAlphaPtr,
const u8 *__restrict sprModePtr) const;
};
#endif // ENABLE_SSE2
#endif // GPU_OPERATIONS_SSE2_H

6536
desmume/src/MMU.cpp Normal file

File diff suppressed because it is too large Load Diff

1102
desmume/src/MMU.h Normal file

File diff suppressed because it is too large Load Diff

460
desmume/src/MMU_timing.h Normal file
View File

@ -0,0 +1,460 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2007 shash
Copyright (C) 2007-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
// this file is split from MMU.h for the purpose of avoiding ridiculous recompile times
// when changing it, because practically everything includes MMU.h.
#ifndef MMUTIMING_H
#define MMUTIMING_H
#include <algorithm>
#include "MMU.h"
#include "cp15.h"
#include "readwrite.h"
#include "debug.h"
#include "NDSSystem.h"
#include "emufile.h"
////////////////////////////////////////////////////////////////
// MEMORY TIMING ACCURACY CONFIGURATION
//
// the more of these are enabled,
// the more accurate memory access timing _should_ become.
// they should be listed roughly in order of most to least important.
// it's reasonable to disable some of these as a speed hack.
// obviously, these defines don't cover all the variables or features needed,
// and in particular, DMA or code+data access bus contention is still missing.
//disable this to prevent the advanced timing logic from ever running at all
#define ENABLE_ADVANCED_TIMING
#ifdef ENABLE_ADVANCED_TIMING
// makes non-sequential accesses slower than sequential ones.
#define ACCOUNT_FOR_NON_SEQUENTIAL_ACCESS
//(SOMETIMES THIS IS A BIG SPEED HIT!)
// enables emulation of code fetch waits.
#define ACCOUNT_FOR_CODE_FETCH_CYCLES
// makes access to DTCM (arm9 only) fast.
#define ACCOUNT_FOR_DATA_TCM_SPEED
// enables simulation of cache hits and cache misses.
#define ENABLE_CACHE_CONTROLLER_EMULATION
#endif //ENABLE_ADVANCED_TIMING
//
////////////////////////////////////////////////////////////////
FORCEINLINE bool USE_TIMING() {
#ifdef ENABLE_ADVANCED_TIMING
return CommonSettings.advanced_timing;
#else
return false;
#endif
}
enum MMU_ACCESS_DIRECTION
{
MMU_AD_READ, MMU_AD_WRITE
};
// note that we don't actually emulate the cache contents here,
// only enough to guess what would be a cache hit or a cache miss.
// this doesn't really get used unless ENABLE_CACHE_CONTROLLER_EMULATION is defined.
template<int SIZESHIFT, int ASSOCIATIVESHIFT, int BLOCKSIZESHIFT>
class CacheController
{
public:
template<MMU_ACCESS_DIRECTION DIR>
FORCEINLINE bool Cached(u32 addr)
{
u32 blockMasked = addr & BLOCKMASK;
if(blockMasked == m_cacheCache)
return true;
else
return this->CachedInternal<DIR>(addr, blockMasked);
}
void Reset()
{
for(int blockIndex = 0; blockIndex < NUMBLOCKS; blockIndex++)
m_blocks[blockIndex].Reset();
m_cacheCache = ~0;
}
CacheController()
{
Reset();
}
void savestate(EMUFILE &os, int version)
{
os.write_32LE(m_cacheCache);
for (int i = 0; i < NUMBLOCKS; i++)
{
for (int j = 0; j < ASSOCIATIVITY; j++)
os.write_32LE(m_blocks[i].tag[j]);
os.write_32LE(m_blocks[i].nextWay);
}
}
bool loadstate(EMUFILE &is, int version)
{
is.read_32LE(m_cacheCache);
for (int i = 0; i < NUMBLOCKS; i++)
{
for (int j = 0; j < ASSOCIATIVITY; j++)
is.read_32LE(m_blocks[i].tag[j]);
is.read_32LE(m_blocks[i].nextWay);
}
return true;
}
private:
template<MMU_ACCESS_DIRECTION DIR>
bool CachedInternal(u32 addr, u32 blockMasked)
{
u32 blockIndex = blockMasked >> BLOCKSIZESHIFT;
CacheBlock& block = m_blocks[blockIndex];
addr &= TAGMASK;
for(int way = 0; way < ASSOCIATIVITY; way++)
if(addr == block.tag[way])
{
// found it, already allocated
m_cacheCache = blockMasked;
return true;
}
if(DIR == MMU_AD_READ)
{
// TODO: support other allocation orders?
block.tag[block.nextWay++] = addr;
block.nextWay %= ASSOCIATIVITY;
m_cacheCache = blockMasked;
}
return false;
}
enum { SIZE = 1 << SIZESHIFT };
enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };
enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };
enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };
enum { TAGMASK = (u32)(~0U << TAGSHIFT) };
enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) };
enum { WORDSIZE = sizeof(u32) };
enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };
enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };
enum { DATAPERBLOCK = DATAPERWORD * WORDSPERBLOCK };
enum { NUMBLOCKS = SIZE / DATAPERBLOCK };
struct CacheBlock
{
u32 tag [ASSOCIATIVITY];
u32 nextWay;
void Reset()
{
nextWay = 0;
for(int way = 0; way < ASSOCIATIVITY; way++)
tag[way] = 0;
}
};
u32 m_cacheCache; // optimization
CacheBlock m_blocks [NUMBLOCKS];
};
template<int PROCNUM, MMU_ACCESS_TYPE AT, int READSIZE, MMU_ACCESS_DIRECTION DIRECTION, bool TIMING>
FORCEINLINE u32 _MMU_accesstime(u32 addr, bool sequential);
template<int PROCNUM, MMU_ACCESS_TYPE AT>
class FetchAccessUnit
{
public:
template<int READSIZE, MMU_ACCESS_DIRECTION DIRECTION, bool TIMING>
FORCEINLINE u32 Fetch(u32 address)
{
#ifdef ACCOUNT_FOR_CODE_FETCH_CYCLES
const bool prohibit = TIMING;
#else
const bool prohibit = false;
#endif
if(AT == MMU_AT_CODE && !prohibit)
{
return 1;
}
u32 time = _MMU_accesstime<PROCNUM, AT, READSIZE, DIRECTION,TIMING>(address,
#ifdef ACCOUNT_FOR_NON_SEQUENTIAL_ACCESS
(TIMING?
(address == (m_lastAddress + (READSIZE>>3)))
:true
)
#else
true
#endif
);
#ifdef ACCOUNT_FOR_NON_SEQUENTIAL_ACCESS
m_lastAddress = address;
#endif
return time;
}
void Reset()
{
m_lastAddress = ~0;
}
FetchAccessUnit() { this->Reset(); }
void savestate(EMUFILE &os, int version)
{
os.write_32LE(m_lastAddress);
}
bool loadstate(EMUFILE &is, int version)
{
is.read_32LE(m_lastAddress);
return true;
}
private:
u32 m_lastAddress;
};
struct MMU_struct_timing
{
// technically part of the cp15, but I didn't want the dereferencing penalty.
// these template values correspond with the value of armcp15->cacheType.
CacheController<13,2,5> arm9codeCache; // 8192 bytes, 4-way associative, 32-byte blocks
CacheController<12,2,5> arm9dataCache; // 4096 bytes, 4-way associative, 32-byte blocks
// technically part of armcpu_t, but that struct isn't templated on PROCNUM
FetchAccessUnit<0,MMU_AT_CODE> arm9codeFetch;
FetchAccessUnit<0,MMU_AT_DATA> arm9dataFetch;
FetchAccessUnit<1,MMU_AT_CODE> arm7codeFetch;
FetchAccessUnit<1,MMU_AT_DATA> arm7dataFetch;
template<int PROCNUM> FORCEINLINE FetchAccessUnit<PROCNUM,MMU_AT_CODE>& armCodeFetch();
template<int PROCNUM> FORCEINLINE FetchAccessUnit<PROCNUM,MMU_AT_DATA>& armDataFetch();
};
template<> FORCEINLINE FetchAccessUnit<0,MMU_AT_CODE>& MMU_struct_timing::armCodeFetch<0>() { return this->arm9codeFetch; }
template<> FORCEINLINE FetchAccessUnit<1,MMU_AT_CODE>& MMU_struct_timing::armCodeFetch<1>() { return this->arm7codeFetch; }
template<> FORCEINLINE FetchAccessUnit<0,MMU_AT_DATA>& MMU_struct_timing::armDataFetch<0>() { return this->arm9dataFetch; }
template<> FORCEINLINE FetchAccessUnit<1,MMU_AT_DATA>& MMU_struct_timing::armDataFetch<1>() { return this->arm7dataFetch; }
extern MMU_struct_timing MMU_timing;
// calculates the time a single memory access takes,
// in units of cycles of the current processor.
// this function replaces what used to be MMU_WAIT16 and MMU_WAIT32.
// this may have side effects, so don't call it more than necessary.
template<int PROCNUM, MMU_ACCESS_TYPE AT, int READSIZE, MMU_ACCESS_DIRECTION DIRECTION, bool TIMING>
FORCEINLINE u32 _MMU_accesstime(u32 addr, bool sequential)
{
static const int MC = 1; // cached or tcm memory speed
static const int M32 = (PROCNUM==ARMCPU_ARM9) ? 2 : 1; // access through 32-bit bus
static const int M16 = M32 * ((READSIZE>16) ? 2 : 1); // access through 16-bit bus
static const int MSLW = M16 * 8; // this needs tuning
if(PROCNUM==ARMCPU_ARM9 && AT == MMU_AT_CODE && addr < 0x02000000)
return MC; // ITCM
#ifdef ACCOUNT_FOR_DATA_TCM_SPEED
if(TIMING && PROCNUM==ARMCPU_ARM9 && AT==MMU_AT_DATA && (addr&(~0x3FFF)) == MMU.DTCMRegion)
return MC; // DTCM
#endif
// for now, assume the cache is always enabled for all of main memory
if(AT != MMU_AT_DMA && TIMING && PROCNUM==ARMCPU_ARM9 && (addr & 0x0F000000) == 0x02000000)
{
#ifdef ENABLE_CACHE_CONTROLLER_EMULATION
bool cached = false;
if(AT==MMU_AT_CODE)
cached = MMU_timing.arm9codeCache.Cached<DIRECTION>(addr);
if(AT==MMU_AT_DATA)
cached = MMU_timing.arm9dataCache.Cached<DIRECTION>(addr);
if(cached)
return MC;
u32 c;
if(sequential && AT==MMU_AT_DATA)
c = M16; // bonus for sequential data access
else if(DIRECTION == MMU_AD_READ)
c = M16 * 5;
else
c = M16 * 2; // should be 4, but write buffer isn't emulated yet.
if(DIRECTION == MMU_AD_READ)
{
// cache miss while reading means it has to fill a whole cache line
// by reading 32 bytes...
c += 8 * M32*2;
}
if(CheckDebugEvent(DEBUG_EVENT_CACHE_MISS))
{
DebugEventData.addr = addr;
DebugEventData.size = READSIZE;
HandleDebugEvent(DEBUG_EVENT_CACHE_MISS);
}
return c;
#elif defined(ACCOUNT_FOR_NON_SEQUENTIAL_ACCESS)
// this is the closest approximation I could find
// to the with-cache-controller timing
// that doesn't do any actual caching logic.
return sequential ? MC : M16;
#endif
}
static const TWaitState MMU_WAIT[16*16] = {
// ITCM, ITCM, MAIN, SWI, REG, VMEM, LCD, OAM, ROM, ROM, RAM, U, U, U, U, BIOS
#define X MC, MC, M16, M32, M32, M16, M16, M32, MSLW, MSLW, MSLW, M32,M32,M32,M32, M32,
// duplicate it 16 times (this was somehow faster than using a mask of 0xF)
X X X X X X X X X X X X X X X X
#undef X
};
u32 c = MMU_WAIT[(addr >> 24)];
#ifdef ACCOUNT_FOR_NON_SEQUENTIAL_ACCESS
if(TIMING && !sequential)
{
//if(c != MC || PROCNUM==ARMCPU_ARM7) // check not needed anymore because ITCM/DTCM return earlier
{
c += (PROCNUM==ARMCPU_ARM9) ? 3*2 : 1;
}
}
#endif
return c;
}
// calculates the cycle time of a single memory access in the MEM stage.
// to be used to calculate the memCycles argument for MMU_aluMemCycles.
// this may have side effects, so don't call it more than necessary.
template<int PROCNUM, int READSIZE, MMU_ACCESS_DIRECTION DIRECTION, bool TIMING>
FORCEINLINE u32 MMU_memAccessCycles(u32 addr)
{
if(TIMING)
return MMU_timing.armDataFetch<PROCNUM>().template Fetch<READSIZE,DIRECTION,true>((addr)&(~((READSIZE>>3)-1)));
else
return MMU_timing.armDataFetch<PROCNUM>().template Fetch<READSIZE,DIRECTION,false>((addr)&(~((READSIZE>>3)-1)));
}
template<int PROCNUM, int READSIZE, MMU_ACCESS_DIRECTION DIRECTION>
FORCEINLINE u32 MMU_memAccessCycles(u32 addr)
{
if(USE_TIMING())
return MMU_memAccessCycles<PROCNUM,READSIZE,DIRECTION,true>(addr);
else
return MMU_memAccessCycles<PROCNUM,READSIZE,DIRECTION,false>(addr);
}
// calculates the cycle time of a single code fetch in the FETCH stage
// to be used to calculate the fetchCycles argument for MMU_fetchExecuteCycles.
// this may have side effects, so don't call it more than necessary.
template<int PROCNUM, int READSIZE>
FORCEINLINE u32 MMU_codeFetchCycles(u32 addr)
{
if(USE_TIMING())
return MMU_timing.armCodeFetch<PROCNUM>().template Fetch<READSIZE,MMU_AD_READ,true>((addr)&(~((READSIZE>>3)-1)));
else
return MMU_timing.armCodeFetch<PROCNUM>().template Fetch<READSIZE,MMU_AD_READ,false>((addr)&(~((READSIZE>>3)-1)));
}
// calculates the cycle contribution of ALU + MEM stages (= EXECUTE)
// given ALU cycle time and the summation of multiple memory access cycle times.
// this function might belong more in armcpu, but I don't think it matters.
template<int PROCNUM>
FORCEINLINE u32 MMU_aluMemCycles(u32 aluCycles, u32 memCycles)
{
if(PROCNUM==ARMCPU_ARM9)
{
// ALU and MEM are different stages of the 5-stage pipeline.
// we approximate the pipeline throughput using max,
// since simply adding the cycles of each instruction together
// fails to take into account the parallelism of the arm pipeline
// and would make the emulated system unnaturally slow.
return std::max(aluCycles, memCycles);
}
else
{
// ALU and MEM are part of the same stage of the 3-stage pipeline,
// thus they occur in sequence and we can simply add the counts together.
return aluCycles + memCycles;
}
}
// calculates the cycle contribution of ALU + MEM stages (= EXECUTE)
// given ALU cycle time and the description of a single memory access.
// this may have side effects, so don't call it more than necessary.
template<int PROCNUM, int READSIZE, MMU_ACCESS_DIRECTION DIRECTION>
FORCEINLINE u32 MMU_aluMemAccessCycles(u32 aluCycles, u32 addr)
{
u32 memCycles;
if(USE_TIMING())
memCycles = MMU_memAccessCycles<PROCNUM,READSIZE,DIRECTION,true>(addr);
else memCycles = MMU_memAccessCycles<PROCNUM,READSIZE,DIRECTION,false>(addr);
return MMU_aluMemCycles<PROCNUM>(aluCycles, memCycles);
}
// calculates the cycle contribution of FETCH + EXECUTE stages
// given executeCycles = the combined ALU+MEM cycles
// and fetchCycles = the cycle time of the FETCH stage
// this function might belong more in armcpu, but I don't think it matters.
template<int PROCNUM>
FORCEINLINE u32 MMU_fetchExecuteCycles(u32 executeCycles, u32 fetchCycles)
{
#ifdef ACCOUNT_FOR_CODE_FETCH_CYCLES
const bool allow = true;
#else
const bool allow = false;
#endif
if(USE_TIMING() && allow)
{
// execute and fetch are different stages of the pipeline for both arm7 and arm9.
// again, we approximate the pipeline throughput using max.
return std::max(executeCycles, fetchCycles);
// TODO: add an option to support conflict between MEM and FETCH cycles
// if they're both using the same data bus.
// in the case of a conflict this should be:
// return std::max(aluCycles, memCycles + fetchCycles);
}
return executeCycles;
}
#endif //MMUTIMING_H

3313
desmume/src/NDSSystem.cpp Normal file

File diff suppressed because it is too large Load Diff

702
desmume/src/NDSSystem.h Normal file
View File

@ -0,0 +1,702 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2008-2022 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef NDSSYSTEM_H
#define NDSSYSTEM_H
#include <string.h>
#include <string>
#include <vector>
#include "types.h"
#include "ROMReader.h"
#include "firmware.h"
class CFIRMWARE;
class EMUFILE;
template<typename Type>
struct buttonstruct {
union {
struct {
// changing the order of these fields would break stuff
//fRLDUTSBAYXWEg
Type G; // debug
Type E; // right shoulder
Type W; // left shoulder
Type X;
Type Y;
Type A;
Type B;
Type S; // start
Type T; // select
Type U; // up
Type D; // down
Type L; // left
Type R; // right
Type F; // lid
};
Type array[14];
};
};
extern buttonstruct<bool> Turbo;
extern buttonstruct<u32> TurboTime;
extern buttonstruct<bool> AutoHold;
extern volatile bool execute;
extern BOOL click;
/*
* The firmware language values
*/
#define NDS_FW_LANG_JAP 0
#define NDS_FW_LANG_ENG 1
#define NDS_FW_LANG_FRE 2
#define NDS_FW_LANG_GER 3
#define NDS_FW_LANG_ITA 4
#define NDS_FW_LANG_SPA 5
#define NDS_FW_LANG_CHI 6
#define NDS_FW_LANG_RES 7
extern CFIRMWARE *extFirmwareObj;
#define DSGBA_LOADER_SIZE 512
enum
{
ROM_NDS = 0,
ROM_DSGBA
};
enum EmuHaltReasonCode
{
EMUHALT_REASON_USER_REQUESTED_HALT = 0,
EMUHALT_REASON_SYSTEM_POWERED_OFF = 1000,
EMUHALT_REASON_JIT_UNMAPPED_ADDRESS_EXCEPTION = 2000,
EMUHALT_REASON_ARM_RESERVED_0X14_EXCEPTION,
EMUHALT_REASON_ARM_UNDEFINED_INSTRUCTION_EXCEPTION,
EMUHALT_REASON_UNKNOWN = 10000
};
enum NDSErrorCode
{
NDSError_NoError = 0,
NDSError_SystemPoweredOff = 1000,
NDSError_JITUnmappedAddressException = 2000,
NDSError_ARMUndefinedInstructionException,
NDSError_UnknownError = 10000
};
enum NDSErrorTag
{
NDSErrorTag_None = 0,
NDSErrorTag_ARM9 = 1,
NDSErrorTag_ARM7 = 2,
NDSErrorTag_BothCPUs = 3,
};
struct NDSError
{
NDSErrorCode code;
NDSErrorTag tag;
u32 programCounterARM9;
u32 instructionARM9;
u32 instructionAddrARM9;
u32 programCounterARM7;
u32 instructionARM7;
u32 instructionAddrARM7;
};
typedef struct NDSError NDSError;
//#define LOG_ARM9
//#define LOG_ARM7
#include "PACKED.h"
struct NDS_header
{
char gameTile[12]; // 000 - Game Title (uppercase ASCII, padded with 00h)
char gameCode[4]; // 00C - Gamecode (uppercase ASCII, NTR-<code>, 0=homebrew)
u16 makerCode; // 010 - Makercode (uppercase ASCII, 0=homebrew)
u8 unitCode; // 012 - Unitcode (00h=Nintendo DS)
u8 deviceCode; // 013 - Encryption Seed Select (00..07h, usually 00h)
u8 cardSize; // 014 - Devicecapacity (Chipsize = 128KB SHL nn) (eg. 7 = 16MB)
u8 reserved1[8]; // 015 - Must be set to 0x00
u8 region; // 01D - Specific region: 0x80 - China, 0x40 - Korea, 0x00 - Other
u8 romversion; // 01E - ROM Version (usually 00h)
u8 autostart; // 01F - Autostart (Bit2: Skip "Press Button" after Health and Safety)
// (Also skips bootmenu, even in Manual mode & even Start pressed)
u32 ARM9src; // 020 - ARM9 rom_offset (4000h and up, align 1000h)
u32 ARM9exe; // 024 - ARM9 entry_address (2000000h..23BFE00h)
u32 ARM9cpy; // 028 - ARM9 ram_address (2000000h..23BFE00h)
u32 ARM9binSize; // 02C - ARM9 size (max 3BFE00h) (3839.5KB)
u32 ARM7src; // 030 - ARM7 rom_offset (8000h and up)
u32 ARM7exe; // 034 - ARM7 entry_address (2000000h..23BFE00h, or 37F8000h..3807E00h)
u32 ARM7cpy; // 038 - ARM7 ram_address (2000000h..23BFE00h, or 37F8000h..3807E00h)
u32 ARM7binSize; // 03C - ARM7 size (max 3BFE00h, or FE00h) (3839.5KB, 63.5KB)
u32 FNameTblOff; // 040 - File Name Table (FNT) offset
u32 FNameTblSize; // 044 - File Name Table (FNT) size
u32 FATOff; // 048 - File Allocation Table (FAT) offset
u32 FATSize; // 04C - File Allocation Table (FAT) size
u32 ARM9OverlayOff; // 050 - File ARM9 overlay_offset
u32 ARM9OverlaySize; // 054 - File ARM9 overlay_size
u32 ARM7OverlayOff; // 058 - File ARM7 overlay_offset
u32 ARM7OverlaySize; // 05C - File ARM7 overlay_size
u32 normalCmd; // 060 - Port 40001A4h setting for normal commands (usually 00586000h)
u32 Key1Cmd; // 064 - Port 40001A4h setting for KEY1 commands (usually 001808F8h)
u32 IconOff; // 068 - Icon_title_offset (0=None) (8000h and up)
u16 CRC16; // 06C - Secure Area Checksum, CRC-16 of [ [20h]..7FFFh] - Calculations with this algorithm use 0xffff as the initial value
u16 ROMtimeout; // 06E - Secure Area Loading Timeout (usually 051Eh)
u32 ARM9autoload; // 070 - ARM9 Auto Load List RAM Address
u32 ARM7autoload; // 074 - ARM7 Auto Load List RAM Address
u8 infoResevedRegion[8]; // 078 - ROM Information Reserved Region (must be set to 0x00)
u32 endROMoffset; // 080 - Total Used ROM size (remaining/unused bytes usually FFh-padded)
u32 HeaderSize; // 084 - ROM Header Size (4000h)
u32 ARM9module; // 088 - ARM9 Module Parameter Address (auto-load parameters)
u32 ARM7module; // 08C - ARM7 Module Parameter Address (auto-load parameters)
u8 reserved2[48]; // 090 - Must be set to 0x00 - "PASS" is contained within here?
u8 logo[156]; // 0C0 - Nintendo Logo (compressed bitmap, same as in GBA Headers)
u16 logoCRC16; // 15C - Nintendo Logo Checksum, CRC-16 of [0C0h-15Bh], fixed CF56h
u16 headerCRC16; // 15E - Header Checksum, CRC-16 of [000h-15Dh]
u8 reserved[160]; // Must be set to 0x00
};
#include "PACKED_END.h"
extern void debug();
NDSError NDS_GetLastError();
void emu_halt(EmuHaltReasonCode reasonCode, NDSErrorTag errorTag);
extern u64 nds_timer;
void NDS_Reschedule();
void NDS_RescheduleGXFIFO(u32 cost);
void NDS_RescheduleDMA();
void NDS_RescheduleReadSlot1(int procnum, int size);
void NDS_RescheduleTimers();
enum ENSATA_HANDSHAKE
{
ENSATA_HANDSHAKE_none = 0,
ENSATA_HANDSHAKE_query = 1,
ENSATA_HANDSHAKE_ack = 2,
ENSATA_HANDSHAKE_confirm = 3,
ENSATA_HANDSHAKE_complete = 4
};
enum NDS_CONSOLE_TYPE
{
NDS_CONSOLE_TYPE_FAT = 0xFF,
NDS_CONSOLE_TYPE_LITE = 0x20,
NDS_CONSOLE_TYPE_IQUE = 0x43,
NDS_CONSOLE_TYPE_IQUE_LITE = 0x63,
NDS_CONSOLE_TYPE_DSI = 0xFE
};
struct NDSSystem
{
s32 wifiCycle;
s32 cycles;
u64 timerCycle[2][4];
u32 VCount;
u32 old;
u8 overclock;
//raw adc touch coords for old NDS
u16 adc_touchX;
u16 adc_touchY;
s32 adc_jitterctr;
//the DSI returns calibrated touch coords from its TSC (?), so we need to save these separately
u16 scr_touchX;
u16 scr_touchY;
//whether the console is using our faked-bootup process
BOOL isFakeBooted;
BOOL isTouch;
u16 paddle;
u8 *FW_ARM9BootCode;
u8 *FW_ARM7BootCode;
u32 FW_ARM9BootCodeAddr;
u32 FW_ARM7BootCodeAddr;
u32 FW_ARM9BootCodeSize;
u32 FW_ARM7BootCodeSize;
BOOL sleeping;
BOOL cardEjected;
u32 freezeBus;
//this is not essential NDS runtime state.
//it was perhaps a mistake to put it here.
//it is far less important than the above.
//maybe I should move it.
s32 idleCycles[2];
s32 runCycleCollector[2][16];
s32 idleFrameCounter;
s32 cpuloopIterationCount; //counts the number of times during a frame that a reschedule happened
//console type must be copied in when the system boots. it can't be changed on the fly.
int ConsoleType;
bool Is_DSI() { return ConsoleType == NDS_CONSOLE_TYPE_DSI; }
bool Is_DebugConsole() { return _DebugConsole!=0; }
BOOL _DebugConsole;
//set if the user requests ensata emulation
BOOL ensataEmulation;
//there is a hack in the ipc sync for ensata. this tracks its state
u32 ensataIpcSyncCounter;
//maintains the state of the ensata handshaking protocol
u32 ensataHandshake;
struct {
u8 lcd, gpuMain, gfx3d_render, gfx3d_geometry, gpuSub, dispswap;
} power1; //POWCNT1
struct {
u8 speakers, wifi /*(initial value=0)*/;
} power2; //POWCNT2
BOOL power_render, power_geometry;
bool isInVblank() const { return VCount >= 192; }
bool isIn3dVblank() const { return VCount >= 192 && VCount<215; }
};
extern NDSSystem nds;
int NDS_Init();
void Desmume_InitOnce();
void NDS_DeInit(void);
BOOL NDS_SetROM(u8 * rom, u32 mask);
NDS_header * NDS_getROMHeader(void);
struct RomBanner
{
RomBanner(bool defaultInit = true);
u16 version; //Version (0001h)
u16 crc16; //CRC16 across entries 020h..83Fh
u8 reserved[0x1C]; //Reserved (zero-filled)
u8 bitmap[0x200]; //Icon Bitmap (32x32 pix) (4x4 tiles, each 4x8 bytes, 4bit depth)
u16 palette[0x10]; //Icon Palette (16 colors, 16bit, range 0000h-7FFFh) (Color 0 is transparent, so the 1st palette entry is ignored)
enum { NUM_TITLES = 6 };
union {
struct {
u16 title_jp[0x80]; //Title 0 Japanese (128 characters, 16bit Unicode)
u16 title_en[0x80]; //Title 1 English ("")
u16 title_fr[0x80]; //Title 2 French ("")
u16 title_de[0x80]; //Title 3 German ("")
u16 title_it[0x80]; //Title 4 Italian ("")
u16 title_es[0x80]; //Title 5 Spanish ("")
};
u16 titles[NUM_TITLES][0x80];
};
u8 end0xFF[0x1C0];
//840h ? (Maybe newer/chinese firmware do also support chinese title?)
//840h - End of Icon/Title structure (next 1C0h bytes usually FFh-filled)
};
struct GameInfo
{
void *fROM;
ROMReader_struct *reader;
u8 *romdataForReader;
u32 romsize;
u32 cardSize;
u32 mask;
u32 crc;
u32 crcForCheatsDb;
u32 chipID;
u32 romType;
u32 headerOffset;
char ROMserial[20];
char ROMname[13];
bool _isDSiEnhanced;
NDS_header header;
//a copy of the pristine secure area from the rom
u8 secureArea[0x4000];
RomBanner banner;
const RomBanner& getRomBanner();
GameInfo() : fROM(NULL),
romdataForReader(NULL),
crc(0),
chipID(0x00000FC2),
romsize(0),
cardSize(0),
mask(0),
romType(ROM_NDS),
headerOffset(0),
_isDSiEnhanced(false)
{
memset(&header, 0, sizeof(header));
memset(&ROMserial[0], 0, sizeof(ROMserial));
memset(&ROMname[0], 0, sizeof(ROMname));
}
~GameInfo() { closeROM(); }
bool IsCode(const char* code) const;
bool loadROM(std::string fname, u32 type = ROM_NDS);
void closeROM();
u32 readROM(u32 pos);
bool ValidateHeader();
void populate();
bool isDSiEnhanced();
bool isHomebrew();
bool hasRomBanner();
};
typedef struct TSCalInfo
{
struct
{
u16 x1, x2;
u16 y1, y2;
u16 width;
u16 height;
} adc;
struct
{
u8 x1, x2;
u8 y1, y2;
u16 width;
u16 height;
} scr;
} TSCalInfo;
extern GameInfo gameInfo;
extern std::vector<u32> memReadBreakPoints;
extern std::vector<u32> memWriteBreakPoints;
struct UserButtons : buttonstruct<bool>
{
};
struct UserTouch
{
u16 touchX;
u16 touchY;
bool isTouch;
};
struct UserMicrophone
{
u32 micButtonPressed;
u8 micSample;
};
struct UserInput
{
UserButtons buttons;
UserTouch touch;
UserMicrophone mic;
};
// set physical user input
// these functions merely request the input to be changed.
// the actual change happens later at a specific time during the frame.
// this is to minimize the risk of desyncs.
void NDS_setTouchPos(u16 x, u16 y);
void NDS_releaseTouch(void);
void NDS_setPad(bool right,bool left,bool down,bool up,bool select,bool start,bool B,bool A,bool Y,bool X,bool leftShoulder,bool rightShoulder,bool debug, bool lid);
void NDS_setMic(bool pressed);
// get physical user input
// not including the results of autofire/etc.
// the effects of calls to "set physical user input" functions will be immediately reflected here though.
const UserInput& NDS_getRawUserInput();
const UserInput& NDS_getPrevRawUserInput();
// get final (fully processed) user input
// this should match whatever was or would be sent to the game
const UserInput& NDS_getFinalUserInput();
// set/get to-be-processed or in-the-middle-of-being-processed user input
// to process input, simply call this function and edit the return value.
// (applying autofire is one example of processing the input.)
// (movie playback is another example.)
// this must be done after the raw user input is set
// and before that input is sent to the game's memory.
UserInput& NDS_getProcessingUserInput();
bool NDS_isProcessingUserInput();
// call once per frame to prepare input for processing
void NDS_beginProcessingInput();
// call once per frame to copy the processed input to the final input
void NDS_endProcessingInput();
// this is in case something needs reentrancy while processing input
void NDS_suspendProcessingInput(bool suspend);
int NDS_LoadROM(const char *filename, const char* physicalFilename=0, const char* logicalFilename=0);
void NDS_FreeROM(void);
void NDS_Reset();
bool NDS_LegitBoot();
bool NDS_FakeBoot();
void nds_savestate(EMUFILE &os);
bool nds_loadstate(EMUFILE &is, int size);
void NDS_Sleep();
void NDS_TriggerCardEjectIRQ();
void NDS_SkipNextFrame();
#define NDS_SkipFrame(s) if(s) NDS_SkipNext2DFrame();
void NDS_OmitFrameSkip(int force=0);
void NDS_debug_break();
void NDS_debug_continue();
void NDS_debug_step();
int NDS_GetCPUCoreCount();
void NDS_GetCPULoadAverage(u32 &outLoadAvgARM9, u32 &outLoadAvgARM7);
void NDS_SetupDefaultFirmware();
//void execHardware_doAllDma(EDMAMode modeNum);
template<bool FORCE> void NDS_exec(s32 nb = 560190<<1);
extern int lagframecounter;
extern struct TCommonSettings
{
TCommonSettings()
: GFX3D_HighResolutionInterpolateColor(true)
, GFX3D_EdgeMark(true)
, GFX3D_Fog(true)
, GFX3D_Texture(true)
, GFX3D_LineHack(true)
, GFX3D_Renderer_MultisampleSize(0)
, GFX3D_Renderer_TextureScalingFactor(1) // Possible values: 1, 2, 4
, GFX3D_Renderer_TextureDeposterize(false)
, GFX3D_Renderer_TextureSmoothing(false)
, GFX3D_TXTHack(false)
, OpenGL_Emulation_ShadowPolygon(true)
, OpenGL_Emulation_SpecialZeroAlphaBlending(true)
, OpenGL_Emulation_NDSDepthCalculation(true)
, OpenGL_Emulation_DepthLEqualPolygonFacing(false)
, jit_max_block_size(12)
, loadToMemory(false)
, UseExtBIOS(false)
, SWIFromBIOS(false)
, PatchSWI3(false)
, UseExtFirmware(false)
, UseExtFirmwareSettings(false)
, RetailCardProtection8000(true)
, BootFromFirmware(false)
, DebugConsole(false)
, EnsataEmulation(false)
, cheatsDisable(false)
, rigorous_timing(false)
, advanced_timing(true)
, micMode(InternalNoise)
, spuInterpolationMode(2)
, manualBackupType(0)
, autodetectBackupMethod(0)
, spu_captureMuted(false)
, spu_advanced(true)
, StylusPressure(50)
, ConsoleType(NDS_CONSOLE_TYPE_FAT)
, backupSave(false)
, SPU_sync_mode(1)
, SPU_sync_method(0)
, WifiBridgeDeviceID(0)
{
strcpy(ARM9BIOS, "biosnds9.bin");
strcpy(ARM7BIOS, "biosnds7.bin");
strcpy(ExtFirmwarePath, "firmware.bin");
for(int i=0;i<16;i++)
spu_muteChannels[i] = false;
for(int g=0;g<2;g++)
for(int x=0;x<5;x++)
dispLayers[g][x]=true;
#ifdef HAVE_JIT
//zero 06-sep-2012 - shouldnt be defaulting this to true for now, since the jit is buggy.
//id rather have people discover a bonus speedhack than discover new bugs in a new version
use_jit = false;
#else
use_jit = false;
#endif
num_cores = NDS_GetCPUCoreCount();
NDS_SetupDefaultFirmware();
}
bool GFX3D_HighResolutionInterpolateColor;
bool GFX3D_EdgeMark;
bool GFX3D_Fog;
bool GFX3D_Texture;
bool GFX3D_LineHack;
int GFX3D_Renderer_MultisampleSize;
int GFX3D_Renderer_TextureScalingFactor; //must be one of {1,2,4}
bool GFX3D_Renderer_TextureDeposterize;
bool GFX3D_Renderer_TextureSmoothing;
bool GFX3D_TXTHack;
bool OpenGL_Emulation_ShadowPolygon;
bool OpenGL_Emulation_SpecialZeroAlphaBlending;
bool OpenGL_Emulation_NDSDepthCalculation;
bool OpenGL_Emulation_DepthLEqualPolygonFacing;
bool loadToMemory;
bool UseExtBIOS;
char ARM9BIOS[MAX_PATH];
char ARM7BIOS[MAX_PATH];
bool SWIFromBIOS;
bool PatchSWI3;
bool RetailCardProtection8000;
bool UseExtFirmware;
bool UseExtFirmwareSettings;
char ExtFirmwarePath[MAX_PATH];
char ExtFirmwareUserSettingsPath[MAX_PATH];
bool BootFromFirmware;
FirmwareConfig fwConfig;
NDS_CONSOLE_TYPE ConsoleType;
bool DebugConsole;
bool EnsataEmulation;
bool cheatsDisable;
int num_cores;
bool single_core() { return num_cores==1; }
bool rigorous_timing;
struct GameHacks {
GameHacks()
: en(true)
{
clear();
}
bool en;
struct {
bool overclock;
bool stylusjitter;
} flags;
void apply();
void clear();
} gamehacks;
int StylusPressure;
bool dispLayers[2][5];
FAST_ALIGN bool advanced_timing;
bool use_jit;
u32 jit_max_block_size;
int WifiBridgeDeviceID;
enum MicMode
{
InternalNoise = 0,
Sample = 1,
Random = 2,
Physical = 3
} micMode;
int spuInterpolationMode;
//this is a temporary hack until we straighten out the flushing logic and/or gxfifo
//int gfx3d_flushMode;
int autodetectBackupMethod;
//this is the user's choice of manual backup type, for cases when the autodetection can't be trusted
int manualBackupType;
bool backupSave;
int SPU_sync_mode;
int SPU_sync_method;
bool spu_muteChannels[16];
bool spu_captureMuted;
bool spu_advanced;
struct _ShowGpu {
_ShowGpu() : main(true), sub(true) {}
union {
struct { bool main,sub; };
bool screens[2];
};
} showGpu;
struct _Hud {
_Hud()
: ShowInputDisplay(false)
, ShowGraphicalInputDisplay(false)
, FpsDisplay(false)
, FrameCounterDisplay(false)
, ShowLagFrameCounter(false)
, ShowMicrophone(false)
, ShowRTC(false)
{}
bool ShowInputDisplay, ShowGraphicalInputDisplay, FpsDisplay, FrameCounterDisplay, ShowLagFrameCounter, ShowMicrophone, ShowRTC;
} hud;
std::string run_advanscene_import;
} CommonSettings;
void NDS_RunAdvansceneAutoImport();
extern std::string InputDisplayString;
extern int LagFrameFlag;
extern int lastLag, TotalLagFrames;
extern u8 MicSampleSelection;
extern std::vector< std::vector<u8> > micSamples;
void MovieSRAM();
void ClearAutoHold(void);
bool ValidateSlot2Access(u32 procnum, u32 demandSRAMSpeed, u32 demand1stROMSpeed, u32 demand2ndROMSpeed, int clockbits);
//MUSTANG
//extern ADVANsCEne advsc;
#endif

5606
desmume/src/OGLRender.cpp Normal file

File diff suppressed because it is too large Load Diff

1114
desmume/src/OGLRender.h Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

176
desmume/src/OGLRender_3_2.h Normal file
View File

@ -0,0 +1,176 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 shash
Copyright (C) 2008-2024 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OGLRENDER_3_2_H
#define OGLRENDER_3_2_H
#include "OGLRender.h"
#define MAX_CLIPPED_POLY_COUNT_FOR_UBO 16384
extern const char *GeometryVtxShader_150;
extern const char *GeometryFragShader_150;
extern const char *GeometryZeroDstAlphaPixelMaskVtxShader_150;
extern const char *GeometryZeroDstAlphaPixelMaskFragShader_150;
extern const char *MSGeometryZeroDstAlphaPixelMaskFragShader_150;
extern const char *ClearImageVtxShader_150;
extern const char *ClearImageFragShader_150;
extern const char *EdgeMarkVtxShader_150;
extern const char *EdgeMarkFragShader_150;
extern const char *FogVtxShader_150;
extern const char *FogFragShader_150;
extern const char *FramebufferOutputVtxShader_150;
extern const char *FramebufferOutput6665FragShader_150;
// A port that wants to use the OpenGL 3.2 renderer must assign the two following functions
// to OGLLoadEntryPoints_3_2_Func and OGLCreateRenderer_3_2_Func, respectively.
//
// In addition, the port must add the following GPU3DInterface objects to core3DList:
// - gpu3Dgl: Automatically selects the most fully featured version of standard OpenGL that
// is available on the host system, prefering OpenGL 3.2 Core Profile.
// - gpu3Dgl_3_2: Selects the OpenGL 3.2 Core Profile renderer, and returns an error if it
// is not available on the host system.
//
// Finally, the port must call GPU->Set3DRendererByID() and pass in the index where
// gpu3Dgl_3_2 exists in core3DList so that the emulator can create the appropriate
// OpenGLRenderer object.
//
// Example code:
// OGLLoadEntryPoints_3_2_Func = &OGLLoadEntryPoints_3_2;
// OGLCreateRenderer_3_2_Func = &OGLCreateRenderer_3_2;
// GPU3DInterface *core3DList[] = { &gpu3DNull, &gpu3DRasterize, &gpu3Dgl_3_2, NULL };
// GPU->Set3DRendererByID(2);
void OGLLoadEntryPoints_3_2();
void OGLCreateRenderer_3_2(OpenGLRenderer **rendererPtr);
class OpenGLGeometryResource : public Render3DResourceGeometry
{
protected:
GLuint _vboID[3];
GLuint _eboID[3];
GLuint _vaoID[3];
GLuint _uboPolyStatesID[3];
GLuint _tboPolyStatesID[3];
GLuint _texPolyStatesID[3];
GLsync _syncGeometryRender[3];
u16 *_indexBuffer[3];
OGLPolyStates *_polyStatesBuffer[3];
public:
OpenGLGeometryResource(const OpenGLVariantID variantID);
~OpenGLGeometryResource();
size_t BindWrite(const size_t rawVtxCount, const size_t clippedPolyCount);
size_t BindUsage();
size_t UnbindUsage();
size_t RebindUsage();
u16* GetIndexBuffer(const size_t index);
OGLPolyStates* GetPolyStatesBuffer(const size_t index);
bool IsPolyStatesBufferUBO();
bool IsPolyStatesBufferTBO();
};
class OpenGLRenderStatesResource : public Render3DResource
{
protected:
GLsync _sync[3];
GLuint _uboRenderStatesID[3];
OGLRenderStates *_buffer[3];
public:
OpenGLRenderStatesResource();
~OpenGLRenderStatesResource();
size_t BindWrite();
size_t BindUsage();
size_t UnbindUsage();
OGLRenderStates* GetRenderStatesBuffer(const size_t index);
};
class OpenGLRenderer_3_2 : public OpenGLRenderer_2_1
{
protected:
bool _isShaderFixedLocationSupported;
bool _isConservativeDepthSupported;
bool _isConservativeDepthAMDSupported;
OpenGLGeometryResource *_gResource;
OpenGLRenderStatesResource *_rsResource;
virtual Render3DError CreateVBOs();
virtual Render3DError CreatePBOs();
virtual Render3DError CreateFBOs();
virtual void DestroyFBOs();
virtual Render3DError CreateMultisampledFBO(GLsizei numSamples);
virtual void DestroyMultisampledFBO();
virtual void ResizeMultisampledFBOs(GLsizei numSamples);
virtual Render3DError CreateVAOs();
virtual void DestroyVAOs();
virtual Render3DError CreateGeometryPrograms();
virtual Render3DError CreateClearImageProgram(const char *vsCString, const char *fsCString);
virtual void DestroyClearImageProgram();
virtual Render3DError CreateGeometryZeroDstAlphaProgram(const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateMSGeometryZeroDstAlphaProgram(const char *vtxShaderCString, const char *fragShaderCString);
virtual void DestroyMSGeometryZeroDstAlphaProgram();
virtual Render3DError CreateEdgeMarkProgram(const bool isMultisample, const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateFogProgram(const OGLFogProgramKey fogProgramKey, const bool isMultisample, const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateFramebufferOutput6665Program(const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateFramebufferOutput8888Program(const char *vtxShaderCString, const char *fragShaderCString);
virtual void GetExtensionSet(std::set<std::string> *oglExtensionSet);
virtual void _SetupGeometryShaders(const OGLGeometryFlags flags);
virtual void _RenderGeometryVertexAttribEnable();
virtual void _RenderGeometryVertexAttribDisable();
virtual Render3DError ZeroDstAlphaPass(const POLY *rawPolyList, const CPoly *clippedPolyList, const size_t clippedPolyCount, const size_t clippedPolyOpaqueCount, bool enableAlphaBlending, size_t indexOffset, POLYGON_ATTR lastPolyAttr);
virtual void _RenderGeometryLoopBegin();
virtual void _RenderGeometryLoopEnd();
virtual void _ResolveWorkingBackFacing();
virtual void _ResolveGeometry();
virtual void _ResolveFinalFramebuffer();
virtual void _FramebufferProcessVertexAttribEnable();
virtual void _FramebufferProcessVertexAttribDisable();
virtual Render3DError _FramebufferConvertColorFormat();
virtual Render3DError BeginRender(const GFX3D_State &renderState, const GFX3D_GeometryList &renderGList);
virtual Render3DError PostprocessFramebuffer();
virtual Render3DError ClearUsingImage(const u16 *__restrict colorBuffer, const u32 *__restrict depthBuffer, const u8 *__restrict fogBuffer, const u8 opaquePolyID);
virtual Render3DError ClearUsingValues(const Color4u8 &clearColor6665, const FragmentAttributes &clearAttributes);
virtual void SetPolygonIndex(const size_t index);
virtual Render3DError SetupPolygon(const POLY &thePoly, bool treatAsTranslucent, bool willChangeStencilBuffer, bool isBackFacing);
virtual Render3DError SetupTexture(const POLY &thePoly, size_t polyRenderIndex);
public:
OpenGLRenderer_3_2();
~OpenGLRenderer_3_2();
virtual Render3DError InitExtensions();
virtual Render3DError RenderFinish();
virtual Render3DError RenderPowerOff();
virtual Render3DError SetFramebufferSize(size_t w, size_t h);
};
#endif

View File

@ -0,0 +1,963 @@
/*
Copyright (C) 2024 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "OGLRender_ES3.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <string>
#include <sstream>
#include "utils/bits.h"
#include "common.h"
#include "debug.h"
#include "NDSSystem.h"
static const GLenum GeometryDrawBuffersEnumES[8][4] = {
{ OGL_COLOROUT_ATTACHMENT_ID, GL_NONE, GL_NONE, GL_NONE },
{ OGL_COLOROUT_ATTACHMENT_ID, GL_NONE, GL_NONE, OGL_FOGATTRIBUTES_ATTACHMENT_ID },
{ OGL_COLOROUT_ATTACHMENT_ID, GL_NONE, OGL_POLYID_ATTACHMENT_ID, GL_NONE },
{ OGL_COLOROUT_ATTACHMENT_ID, GL_NONE, OGL_POLYID_ATTACHMENT_ID, OGL_FOGATTRIBUTES_ATTACHMENT_ID },
{ OGL_COLOROUT_ATTACHMENT_ID, OGL_WORKING_ATTACHMENT_ID, GL_NONE, GL_NONE },
{ OGL_COLOROUT_ATTACHMENT_ID, OGL_WORKING_ATTACHMENT_ID, GL_NONE, OGL_FOGATTRIBUTES_ATTACHMENT_ID },
{ OGL_COLOROUT_ATTACHMENT_ID, OGL_WORKING_ATTACHMENT_ID, OGL_POLYID_ATTACHMENT_ID, GL_NONE },
{ OGL_COLOROUT_ATTACHMENT_ID, OGL_WORKING_ATTACHMENT_ID, OGL_POLYID_ATTACHMENT_ID, OGL_FOGATTRIBUTES_ATTACHMENT_ID }
};
static const GLint GeometryAttachmentWorkingBufferES[8] = { 1,1,1,1,1,1,1,1 };
static const GLint GeometryAttachmentPolyIDES[8] = { 2,2,2,2,2,2,2,2 };
static const GLint GeometryAttachmentFogAttributesES[8] = { 3,3,3,3,3,3,3,3 };
// Vertex shader for geometry, GLSL ES 3.00
static const char *GeometryVtxShader_ES300 = {"\
IN_VTX_POSITION vec4 inPosition;\n\
IN_VTX_TEXCOORD0 vec2 inTexCoord0;\n\
IN_VTX_COLOR vec3 inColor; \n\
\n\
#if IS_USING_UBO_POLY_STATES\n\
layout (std140) uniform PolyStates\n\
{\n\
ivec4 value[4096];\n\
} polyState;\n\
#elif IS_USING_TBO_POLY_STATES\n\
uniform highp isamplerBuffer PolyStates;\n\
#else\n\
uniform highp isampler2D PolyStates;\n\
#endif\n\
uniform mediump int polyIndex;\n\
uniform bool polyDrawShadow;\n\
\n\
out vec2 vtxTexCoord;\n\
out vec4 vtxColor;\n\
flat out lowp int polyID;\n\
flat out lowp int polyMode;\n\
flat out lowp int polyIsWireframe;\n\
flat out lowp int polyEnableFog;\n\
flat out lowp int polySetNewDepthForTranslucent;\n\
flat out lowp int polyEnableTexture;\n\
flat out lowp int texSingleBitAlpha;\n\
flat out lowp int polyIsBackFacing;\n\
flat out lowp int isPolyDrawable;\n\
\n\
void main()\n\
{\n\
#if IS_USING_UBO_POLY_STATES\n\
ivec4 polyStateVec = polyState.value[polyIndex >> 2];\n\
int polyStateBits = polyStateVec[polyIndex & 0x03];\n\
#elif IS_USING_TBO_POLY_STATES\n\
int polyStateBits = texelFetch(PolyStates, polyIndex).r;\n\
#else\n\
int polyStateBits = texelFetch(PolyStates, ivec2(polyIndex & 0x00FF, (polyIndex >> 8) & 0x007F), 0).r;\n\
#endif\n\
int texSizeShiftS = (polyStateBits >> 18) & 0x07;\n\
int texSizeShiftT = (polyStateBits >> 21) & 0x07;\n\
\n\
float polyAlpha = float((polyStateBits >> 8) & 0x1F) / 31.0;\n\
vec2 polyTexScale = vec2(1.0 / float(8 << texSizeShiftS), 1.0 / float(8 << texSizeShiftT));\n\
\n\
polyID = (polyStateBits >> 0) & 0x3F;\n\
polyMode = (polyStateBits >> 6) & 0x03;\n\
polyIsWireframe = (polyStateBits >> 13) & 0x01;\n\
polyEnableFog = (polyStateBits >> 14) & 0x01;\n\
polySetNewDepthForTranslucent = (polyStateBits >> 15) & 0x01;\n\
polyEnableTexture = (polyStateBits >> 16) & 0x01;\n\
texSingleBitAlpha = (polyStateBits >> 17) & 0x01;\n\
polyIsBackFacing = (polyStateBits >> 24) & 0x01;\n\
\n\
isPolyDrawable = int((polyMode != 3) || polyDrawShadow);\n\
\n\
mat2 texScaleMtx = mat2( vec2(polyTexScale.x, 0.0), \n\
vec2( 0.0, polyTexScale.y)); \n\
\n\
vtxTexCoord = (texScaleMtx * inTexCoord0) / 16.0;\n\
vtxColor = vec4(inColor / 63.0, polyAlpha);\n\
gl_Position = vec4(inPosition.x, -inPosition.y, inPosition.z, inPosition.w) / 4096.0;\n\
}\n\
"};
// Fragment shader for geometry, GLSL ES 3.00
static const char *GeometryFragShader_ES300 = {"\
in vec2 vtxTexCoord;\n\
in vec4 vtxColor;\n\
flat in lowp int polyID;\n\
flat in lowp int polyMode;\n\
flat in lowp int polyIsWireframe;\n\
flat in lowp int polyEnableFog;\n\
flat in lowp int polySetNewDepthForTranslucent;\n\
flat in lowp int polyEnableTexture;\n\
flat in lowp int texSingleBitAlpha;\n\
flat in lowp int polyIsBackFacing;\n\
flat in lowp int isPolyDrawable;\n\
\n\
layout (std140) uniform RenderStates\n\
{\n\
bool enableAntialiasing;\n\
bool enableFogAlphaOnly;\n\
int clearPolyID;\n\
float clearDepth;\n\
float alphaTestRef;\n\
float fogOffset;\n\
float fogStep;\n\
float pad_0;\n\
vec4 fogColor;\n\
vec4 edgeColor[8];\n\
vec4 toonColor[32];\n\
} state;\n\
\n\
uniform sampler2D texRenderObject;\n\
uniform bool texDrawOpaque;\n\
uniform bool drawModeDepthEqualsTest;\n\
uniform bool polyDrawShadow;\n\
uniform float polyDepthOffset;\n\
\n\
OUT_COLOR vec4 outFragColor;\n\
\n\
#if DRAW_MODE_OPAQUE\n\
OUT_WORKING_BUFFER vec4 outDstBackFacing;\n\
#elif USE_DEPTH_LEQUAL_POLYGON_FACING\n\
uniform sampler2D inDstBackFacing;\n\
#endif\n\
\n\
#if ENABLE_EDGE_MARK\n\
OUT_POLY_ID vec4 outPolyID;\n\
#endif\n\
#if ENABLE_FOG\n\
OUT_FOG_ATTRIBUTES vec4 outFogAttributes;\n\
#endif\n\
\n\
void main()\n\
{\n\
#if USE_DEPTH_LEQUAL_POLYGON_FACING && !DRAW_MODE_OPAQUE\n\
bool isOpaqueDstBackFacing = bool( texelFetch(inDstBackFacing, ivec2(gl_FragCoord.xy), 0).r );\n\
if ( drawModeDepthEqualsTest && (bool(polyIsBackFacing) || !isOpaqueDstBackFacing) )\n\
{\n\
discard;\n\
}\n\
#endif\n\
\n\
vec4 mainTexColor = (ENABLE_TEXTURE_SAMPLING && bool(polyEnableTexture)) ? texture(texRenderObject, vtxTexCoord) : vec4(1.0, 1.0, 1.0, 1.0);\n\
\n\
if (!bool(texSingleBitAlpha))\n\
{\n\
if (texDrawOpaque)\n\
{\n\
if ( (polyMode != 1) && (mainTexColor.a <= 0.999) )\n\
{\n\
discard;\n\
}\n\
}\n\
else\n\
{\n\
if ( ((polyMode != 1) && (mainTexColor.a * vtxColor.a > 0.999)) || ((polyMode == 1) && (vtxColor.a > 0.999)) )\n\
{\n\
discard;\n\
}\n\
}\n\
}\n\
#if USE_TEXTURE_SMOOTHING\n\
else\n\
{\n\
if (mainTexColor.a < 0.500)\n\
{\n\
mainTexColor.a = 0.0;\n\
}\n\
else\n\
{\n\
mainTexColor.rgb = mainTexColor.rgb / mainTexColor.a;\n\
mainTexColor.a = 1.0;\n\
}\n\
}\n\
#endif\n\
\n\
outFragColor = mainTexColor * vtxColor;\n\
\n\
if (polyMode == 1)\n\
{\n\
outFragColor.rgb = (ENABLE_TEXTURE_SAMPLING && bool(polyEnableTexture)) ? mix(vtxColor.rgb, mainTexColor.rgb, mainTexColor.a) : vtxColor.rgb;\n\
outFragColor.a = vtxColor.a;\n\
}\n\
else if (polyMode == 2)\n\
{\n\
vec3 newToonColor = state.toonColor[int((vtxColor.r * 31.0) + 0.5)].rgb;\n\
#if TOON_SHADING_MODE\n\
outFragColor.rgb = min((mainTexColor.rgb * vtxColor.r) + newToonColor.rgb, 1.0);\n\
#else\n\
outFragColor.rgb = mainTexColor.rgb * newToonColor.rgb;\n\
#endif\n\
}\n\
else if ((polyMode == 3) && polyDrawShadow)\n\
{\n\
outFragColor = vtxColor;\n\
}\n\
\n\
if ( (isPolyDrawable != 0) && ((outFragColor.a < 0.001) || (ENABLE_ALPHA_TEST && outFragColor.a < state.alphaTestRef)) )\n\
{\n\
discard;\n\
}\n\
#if ENABLE_EDGE_MARK\n\
outPolyID = (isPolyDrawable != 0) ? vec4( float(polyID)/63.0, float(polyIsWireframe == 1), 0.0, float(outFragColor.a > 0.999) ) : vec4(0.0, 0.0, 0.0, 0.0);\n\
#endif\n\
#if ENABLE_FOG\n\
outFogAttributes = (isPolyDrawable != 0) ? vec4( float(polyEnableFog), 0.0, 0.0, float((outFragColor.a > 0.999) ? 1.0 : 0.5) ) : vec4(0.0, 0.0, 0.0, 0.0);\n\
#endif\n\
#if DRAW_MODE_OPAQUE\n\
outDstBackFacing = vec4(float(polyIsBackFacing), 0.0, 0.0, 1.0);\n\
#endif\n\
\n\
#if USE_NDS_DEPTH_CALCULATION || ENABLE_FOG\n\
// It is tempting to perform the NDS depth calculation in the vertex shader rather than in the fragment shader.\n\
// Resist this temptation! It is much more reliable to do the depth calculation in the fragment shader due to\n\
// subtle interpolation differences between various GPUs and/or drivers. If the depth calculation is not done\n\
// here, then it is very possible for the user to experience Z-fighting in certain rendering situations.\n\
\n\
#if ENABLE_W_DEPTH\n\
gl_FragDepth = clamp( ((1.0/gl_FragCoord.w) * (4096.0/16777215.0)) + polyDepthOffset, 0.0, 1.0 );\n\
#else\n\
// hack: when using z-depth, drop some LSBs so that the overworld map in Dragon Quest IV shows up correctly\n\
gl_FragDepth = clamp( (floor(gl_FragCoord.z * 4194303.0) * (4.0/16777215.0)) + polyDepthOffset, 0.0, 1.0 );\n\
#endif\n\
#endif\n\
}\n\
"};
void OGLLoadEntryPoints_ES_3_0()
{
OGLLoadEntryPoints_3_2();
}
void OGLCreateRenderer_ES_3_0(OpenGLRenderer **rendererPtr)
{
if (IsOpenGLDriverVersionSupported(3, 0, 0))
{
*rendererPtr = new OpenGLESRenderer_3_0;
(*rendererPtr)->SetVersion(3, 0, 0);
}
}
OpenGLESRenderer_3_0::OpenGLESRenderer_3_0()
{
_variantID = OpenGLVariantID_ES3_3_0;
_geometryDrawBuffersEnum = GeometryDrawBuffersEnumES;
_geometryAttachmentWorkingBuffer = GeometryAttachmentWorkingBufferES;
_geometryAttachmentPolyID = GeometryAttachmentPolyIDES;
_geometryAttachmentFogAttributes = GeometryAttachmentFogAttributesES;
ref->textureSrcTypeCIColor = GL_UNSIGNED_BYTE;
ref->textureSrcTypeCIFog = GL_UNSIGNED_BYTE;
ref->textureSrcTypeEdgeColor = GL_UNSIGNED_BYTE;
ref->textureSrcTypeToonTable = GL_UNSIGNED_BYTE;
}
Render3DError OpenGLESRenderer_3_0::InitExtensions()
{
OGLRenderRef &OGLRef = *this->ref;
Render3DError error = OGLERROR_NOERR;
// Get OpenGL extensions
std::set<std::string> oglExtensionSet;
this->GetExtensionSet(&oglExtensionSet);
// OpenGL ES 3.0 should fully support FBOs, so we don't need the default framebuffer.
// However, OpenGL ES has traditionally required some kind of surface buffer attached
// to the context before using it. We don't want it, nor would we ever use it here.
// Therefore, check if our context supports being surfaceless before doing anything else,
// as this works as a kind of compatibility check.
if (!this->IsExtensionPresent(&oglExtensionSet, "GL_OES_surfaceless_context"))
{
INFO("OpenGL ES: Client contexts are not expected to have any surfaces attached\n");
INFO(" to the default framebuffer. The fact that the context does not\n");
INFO(" work surfaceless may indicate an error in the context creation,\n");
INFO(" or that your platform's context creation is too old.\n");
error = OGLERROR_FEATURE_UNSUPPORTED;
return error;
}
// Mirrored Repeat Mode Support
OGLRef.stateTexMirroredRepeat = GL_MIRRORED_REPEAT;
// Blending Support
this->_isBlendFuncSeparateSupported = true;
this->_isBlendEquationSeparateSupported = true;
// Fixed locations in shaders are supported in ES 3.0 by default.
this->_isShaderFixedLocationSupported = true;
GLfloat maxAnisotropyOGL = 1.0f;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropyOGL);
this->_deviceInfo.maxAnisotropy = (float)maxAnisotropyOGL;
// OpenGL ES 3.0 should be able to handle the GL_RGBA format in glReadPixels without any performance penalty.
OGLRef.readPixelsBestFormat = GL_RGBA;
OGLRef.readPixelsBestDataType = GL_UNSIGNED_BYTE;
this->_deviceInfo.isEdgeMarkSupported = true;
this->_deviceInfo.isFogSupported = true;
// Need to generate this texture first because FBO creation needs it.
// This texture is only required by shaders, and so if shader creation
// fails, then we can immediately delete this texture if an error occurs.
glGenTextures(1, &OGLRef.texFinalColorID);
glActiveTexture(GL_TEXTURE0 + OGLTextureUnitID_FinalColor);
glBindTexture(GL_TEXTURE_2D, OGLRef.texFinalColorID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, (GLsizei)this->_framebufferWidth, (GLsizei)this->_framebufferHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glActiveTexture(GL_TEXTURE0);
// OpenGL ES 3.0 should have all the necessary features to be able to flip and convert the framebuffer.
this->_willConvertFramebufferOnGPU = true;
this->_enableTextureSmoothing = CommonSettings.GFX3D_Renderer_TextureSmoothing;
this->_emulateShadowPolygon = CommonSettings.OpenGL_Emulation_ShadowPolygon;
this->_emulateSpecialZeroAlphaBlending = CommonSettings.OpenGL_Emulation_SpecialZeroAlphaBlending;
this->_emulateNDSDepthCalculation = CommonSettings.OpenGL_Emulation_NDSDepthCalculation;
this->_emulateDepthLEqualPolygonFacing = CommonSettings.OpenGL_Emulation_DepthLEqualPolygonFacing;
// Load and create shaders. Return on any error, since ES 3.0 makes shaders mandatory.
this->isShaderSupported = true;
this->_rsResource = new OpenGLRenderStatesResource();
if (IsOpenGLDriverVersionSupported(3, 2, 0))
{
this->_gResource = new OpenGLGeometryResource(OpenGLVariantID_ES3_3_2);
}
else if (IsOpenGLDriverVersionSupported(3, 1, 0))
{
this->_gResource = new OpenGLGeometryResource(OpenGLVariantID_ES3_3_1);
}
else
{
this->_gResource = new OpenGLGeometryResource(OpenGLVariantID_ES3_3_0);
}
error = this->CreateGeometryPrograms();
if (error != OGLERROR_NOERR)
{
glUseProgram(0);
this->DestroyGeometryPrograms();
this->isShaderSupported = false;
return error;
}
error = this->CreateClearImageProgram(ClearImageVtxShader_150, ClearImageFragShader_150);
if (error != OGLERROR_NOERR)
{
glUseProgram(0);
this->DestroyGeometryPrograms();
this->isShaderSupported = false;
return error;
}
error = this->CreateGeometryZeroDstAlphaProgram(GeometryZeroDstAlphaPixelMaskVtxShader_150, GeometryZeroDstAlphaPixelMaskFragShader_150);
if (error != OGLERROR_NOERR)
{
glUseProgram(0);
this->DestroyGeometryPrograms();
this->DestroyClearImageProgram();
this->isShaderSupported = false;
return error;
}
INFO("OpenGL ES: Successfully created geometry shaders.\n");
error = this->InitPostprocessingPrograms(EdgeMarkVtxShader_150,
EdgeMarkFragShader_150,
FramebufferOutputVtxShader_150,
FramebufferOutput6665FragShader_150,
NULL);
if (error != OGLERROR_NOERR)
{
glUseProgram(0);
this->DestroyGeometryPrograms();
this->DestroyClearImageProgram();
this->DestroyGeometryZeroDstAlphaProgram();
this->isShaderSupported = false;
return error;
}
this->isVBOSupported = true;
this->CreateVBOs();
// PBOs are only used when reading back the rendered framebuffer for the emulated
// BG0 layer. For desktop-class GPUs, doing an asynchronous glReadPixels() call
// is always advantageous since such devices are expected to have their GPUs
// connected to a data bus.
//
// However, many ARM-based mobile devices use integrated GPUs of varying degrees
// of memory latency and implementation quality. This means that the performance
// of an asynchronous glReadPixels() call is NOT guaranteed on such devices.
//
// In fact, many ARM-based devices suffer devastating performance drops when trying
// to do asynchronous framebuffer reads. Therefore, since most OpenGL ES users will
// be running an ARM-based iGPU, we will disable PBOs for OpenGL ES and stick with
// a traditional synchronous glReadPixels() call instead.
this->isPBOSupported = false;
this->isVAOSupported = true;
this->CreateVAOs();
// Load and create FBOs. Return on any error, since OpenGL ES 3.0 includes FBOs as core functionality.
this->isFBOSupported = true;
error = this->CreateFBOs();
if (error != OGLERROR_NOERR)
{
this->isFBOSupported = false;
return error;
}
this->_isFBOBlitSupported = true;
this->isMultisampledFBOSupported = true;
this->_selectedMultisampleSize = CommonSettings.GFX3D_Renderer_MultisampleSize;
GLint maxSamplesOGL = 0;
glGetIntegerv(GL_MAX_SAMPLES, &maxSamplesOGL);
this->_deviceInfo.maxSamples = (u8)maxSamplesOGL;
if (this->_deviceInfo.maxSamples >= 2)
{
// Try and initialize the multisampled FBOs with the GFX3D_Renderer_MultisampleSize.
// However, if the client has this set to 0, then set sampleSize to 2 in order to
// force the generation and the attachments of the buffers at a meaningful sample
// size. If GFX3D_Renderer_MultisampleSize is 0, then we can deallocate the buffer
// memory afterwards.
GLsizei sampleSize = this->GetLimitedMultisampleSize();
if (sampleSize == 0)
{
sampleSize = 2;
}
error = this->CreateMultisampledFBO(sampleSize);
if (error != OGLERROR_NOERR)
{
this->isMultisampledFBOSupported = false;
}
// If GFX3D_Renderer_MultisampleSize is 0, then we can deallocate the buffers now
// in order to save some memory.
if (this->_selectedMultisampleSize == 0)
{
this->ResizeMultisampledFBOs(0);
}
}
else
{
this->isMultisampledFBOSupported = false;
INFO("OpenGL ES: Driver does not support at least 2x multisampled FBOs.\n");
}
this->_isDepthLEqualPolygonFacingSupported = true;
this->_enableMultisampledRendering = ((this->_selectedMultisampleSize >= 2) && this->isMultisampledFBOSupported);
return OGLERROR_NOERR;
}
Render3DError OpenGLESRenderer_3_0::CreateGeometryPrograms()
{
Render3DError error = OGLERROR_NOERR;
OGLRenderRef &OGLRef = *this->ref;
// Create shader resources.
glGenTextures(1, &OGLRef.texFogDensityTableID);
glActiveTexture(GL_TEXTURE0 + OGLTextureUnitID_LookupTable);
glBindTexture(GL_TEXTURE_2D, OGLRef.texFogDensityTableID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 32, 1, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
glActiveTexture(GL_TEXTURE0);
OGLGeometryFlags programFlags;
programFlags.value = 0;
std::stringstream shaderHeader;
shaderHeader << "#version 300 es\n";
shaderHeader << "precision highp float;\n";
shaderHeader << "precision highp int;\n";
shaderHeader << "\n";
std::stringstream vsHeader;
vsHeader << "#define IN_VTX_POSITION layout (location = " << OGLVertexAttributeID_Position << ") in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 layout (location = " << OGLVertexAttributeID_TexCoord0 << ") in\n";
vsHeader << "#define IN_VTX_COLOR layout (location = " << OGLVertexAttributeID_Color << ") in\n";
vsHeader << "\n";
vsHeader << "#define IS_USING_UBO_POLY_STATES " << ((this->_gResource->IsPolyStatesBufferUBO()) ? 1 : 0) << "\n";
vsHeader << "#define IS_USING_TBO_POLY_STATES " << ((this->_gResource->IsPolyStatesBufferTBO()) ? 1 : 0) << "\n";
vsHeader << "#define DEPTH_EQUALS_TEST_TOLERANCE " << DEPTH_EQUALS_TEST_TOLERANCE << ".0\n";
vsHeader << "\n";
std::string vtxShaderCode = shaderHeader.str() + vsHeader.str() + std::string(GeometryVtxShader_ES300);
for (size_t flagsValue = 0; flagsValue < 128; flagsValue++, programFlags.value++)
{
std::stringstream shaderFlags;
shaderFlags << "#define OUT_COLOR layout (location = 0) out\n";
shaderFlags << "#define OUT_WORKING_BUFFER layout (location = " << (OGL_WORKING_ATTACHMENT_ID - GL_COLOR_ATTACHMENT0) << ") out\n";
shaderFlags << "#define OUT_POLY_ID layout (location = " << (OGL_POLYID_ATTACHMENT_ID - GL_COLOR_ATTACHMENT0) << ") out\n";
shaderFlags << "#define OUT_FOG_ATTRIBUTES layout (location = " << (OGL_FOGATTRIBUTES_ATTACHMENT_ID - GL_COLOR_ATTACHMENT0) << ") out\n";
shaderFlags << "\n";
shaderFlags << "#define USE_TEXTURE_SMOOTHING " << ((this->_enableTextureSmoothing) ? 1 : 0) << "\n";
shaderFlags << "#define USE_NDS_DEPTH_CALCULATION " << ((this->_emulateNDSDepthCalculation) ? 1 : 0) << "\n";
shaderFlags << "#define USE_DEPTH_LEQUAL_POLYGON_FACING " << ((this->_emulateDepthLEqualPolygonFacing) ? 1 : 0) << "\n";
shaderFlags << "\n";
shaderFlags << "#define ENABLE_W_DEPTH " << ((programFlags.EnableWDepth) ? 1 : 0) << "\n";
shaderFlags << "#define ENABLE_ALPHA_TEST " << ((programFlags.EnableAlphaTest) ? "true\n" : "false\n");
shaderFlags << "#define ENABLE_TEXTURE_SAMPLING " << ((programFlags.EnableTextureSampling) ? "true\n" : "false\n");
shaderFlags << "#define TOON_SHADING_MODE " << ((programFlags.ToonShadingMode) ? 1 : 0) << "\n";
shaderFlags << "#define ENABLE_FOG " << ((programFlags.EnableFog) ? 1 : 0) << "\n";
shaderFlags << "#define ENABLE_EDGE_MARK " << ((programFlags.EnableEdgeMark) ? 1 : 0) << "\n";
shaderFlags << "#define DRAW_MODE_OPAQUE " << ((programFlags.OpaqueDrawMode) ? 1 : 0) << "\n";
shaderFlags << "\n";
std::string fragShaderCode = shaderHeader.str() + shaderFlags.str() + std::string(GeometryFragShader_ES300);
error = this->ShaderProgramCreate(OGLRef.vertexGeometryShaderID,
OGLRef.fragmentGeometryShaderID[flagsValue],
OGLRef.programGeometryID[flagsValue],
vtxShaderCode.c_str(),
fragShaderCode.c_str());
if (error != OGLERROR_NOERR)
{
INFO("OpenGL ES: Failed to create the GEOMETRY shader program.\n");
glUseProgram(0);
this->DestroyGeometryPrograms();
return error;
}
glLinkProgram(OGLRef.programGeometryID[flagsValue]);
if (!this->ValidateShaderProgramLink(OGLRef.programGeometryID[flagsValue]))
{
INFO("OpenGL ES: Failed to link the GEOMETRY shader program.\n");
glUseProgram(0);
this->DestroyGeometryPrograms();
return OGLERROR_SHADER_CREATE_ERROR;
}
glValidateProgram(OGLRef.programGeometryID[flagsValue]);
glUseProgram(OGLRef.programGeometryID[flagsValue]);
// Set up render states UBO
const GLuint uniformBlockRenderStates = glGetUniformBlockIndex(OGLRef.programGeometryID[flagsValue], "RenderStates");
glUniformBlockBinding(OGLRef.programGeometryID[flagsValue], uniformBlockRenderStates, OGLBindingPointID_RenderStates);
GLint uboSize = 0;
glGetActiveUniformBlockiv(OGLRef.programGeometryID[flagsValue], uniformBlockRenderStates, GL_UNIFORM_BLOCK_DATA_SIZE, &uboSize);
assert(uboSize == sizeof(OGLRenderStates));
const GLint uniformTexRenderObject = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "texRenderObject");
glUniform1i(uniformTexRenderObject, 0);
if (this->_gResource->IsPolyStatesBufferUBO())
{
const GLuint uniformBlockPolyStates = glGetUniformBlockIndex(OGLRef.programGeometryID[flagsValue], "PolyStates");
glUniformBlockBinding(OGLRef.programGeometryID[flagsValue], uniformBlockPolyStates, OGLBindingPointID_PolyStates);
}
else
{
const GLint uniformTexBufferPolyStates = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "PolyStates");
glUniform1i(uniformTexBufferPolyStates, OGLTextureUnitID_PolyStates);
}
if (this->_emulateDepthLEqualPolygonFacing && !programFlags.OpaqueDrawMode)
{
const GLint uniformTexBackfacing = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "inDstBackFacing");
glUniform1i(uniformTexBackfacing, OGLTextureUnitID_FinalColor);
}
OGLRef.uniformTexDrawOpaque[flagsValue] = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "texDrawOpaque");
OGLRef.uniformDrawModeDepthEqualsTest[flagsValue] = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "drawModeDepthEqualsTest");
OGLRef.uniformPolyDrawShadow[flagsValue] = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "polyDrawShadow");
OGLRef.uniformPolyStateIndex[flagsValue] = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "polyIndex");
OGLRef.uniformPolyDepthOffset[flagsValue] = glGetUniformLocation(OGLRef.programGeometryID[flagsValue], "polyDepthOffset");
}
return error;
}
Render3DError OpenGLESRenderer_3_0::CreateClearImageProgram(const char *vsCString, const char *fsCString)
{
Render3DError error = OGLERROR_NOERR;
OGLRenderRef &OGLRef = *this->ref;
std::stringstream shaderHeader;
shaderHeader << "#version 300 es\n";
shaderHeader << "precision highp float;\n";
shaderHeader << "precision highp int;\n";
shaderHeader << "\n";
std::stringstream vsHeader;
if (this->_isShaderFixedLocationSupported)
{
vsHeader << "#define IN_VTX_POSITION layout (location = " << OGLVertexAttributeID_Position << ") in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 layout (location = " << OGLVertexAttributeID_TexCoord0 << ") in\n";
}
else
{
vsHeader << "#define IN_VTX_POSITION in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 in\n";
}
vsHeader << "\n";
std::string vtxShaderCode = shaderHeader.str() + vsHeader.str() + std::string(vsCString);
std::stringstream fsHeader;
if (this->_isShaderFixedLocationSupported)
{
fsHeader << "#define OUT_COLOR layout (location = 0) out\n";
fsHeader << "#define OUT_FOGATTR layout (location = 1) out\n";
}
else
{
fsHeader << "#define OUT_COLOR out\n";
fsHeader << "#define OUT_FOGATTR out\n";
}
fsHeader << "\n";
std::string fragShaderCodeFogColor = shaderHeader.str() + fsHeader.str() + std::string(fsCString);
error = this->ShaderProgramCreate(OGLRef.vsClearImageID,
OGLRef.fsClearImageID,
OGLRef.pgClearImageID,
vtxShaderCode.c_str(),
fragShaderCodeFogColor.c_str());
if (error != OGLERROR_NOERR)
{
INFO("OpenGL ES: Failed to create the CLEAR_IMAGE shader program.\n");
glUseProgram(0);
this->DestroyClearImageProgram();
return error;
}
glLinkProgram(OGLRef.pgClearImageID);
if (!this->ValidateShaderProgramLink(OGLRef.pgClearImageID))
{
INFO("OpenGL ES: Failed to link the CLEAR_IMAGE shader color/fog program.\n");
glUseProgram(0);
this->DestroyClearImageProgram();
return OGLERROR_SHADER_CREATE_ERROR;
}
glValidateProgram(OGLRef.pgClearImageID);
glUseProgram(OGLRef.pgClearImageID);
const GLint uniformTexCIColor = glGetUniformLocation(OGLRef.pgClearImageID, "texCIColor");
const GLint uniformTexCIFogAttr = glGetUniformLocation(OGLRef.pgClearImageID, "texCIFogAttr");
const GLint uniformTexCIDepthCF = glGetUniformLocation(OGLRef.pgClearImageID, "texCIDepth");
glUniform1i(uniformTexCIColor, OGLTextureUnitID_CIColor);
glUniform1i(uniformTexCIFogAttr, OGLTextureUnitID_CIFogAttr);
glUniform1i(uniformTexCIDepthCF, OGLTextureUnitID_CIDepth);
return error;
}
Render3DError OpenGLESRenderer_3_0::CreateGeometryZeroDstAlphaProgram(const char *vtxShaderCString, const char *fragShaderCString)
{
Render3DError error = OGLERROR_NOERR;
OGLRenderRef &OGLRef = *this->ref;
if ( (vtxShaderCString == NULL) || (fragShaderCString == NULL) )
{
return error;
}
std::stringstream shaderHeader;
shaderHeader << "#version 300 es\n";
shaderHeader << "precision highp float;\n";
shaderHeader << "precision highp int;\n";
shaderHeader << "\n";
std::stringstream vsHeader;
vsHeader << "#define IN_VTX_POSITION layout (location = " << OGLVertexAttributeID_Position << ") in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 layout (location = " << OGLVertexAttributeID_TexCoord0 << ") in\n";
vsHeader << "#define IN_VTX_COLOR layout (location = " << OGLVertexAttributeID_Color << ") in\n";
std::string vtxShaderCode = shaderHeader.str() + vsHeader.str() + std::string(vtxShaderCString);
std::string fragShaderCode = shaderHeader.str() + std::string(fragShaderCString);
error = this->ShaderProgramCreate(OGLRef.vtxShaderGeometryZeroDstAlphaID,
OGLRef.fragShaderGeometryZeroDstAlphaID,
OGLRef.programGeometryZeroDstAlphaID,
vtxShaderCode.c_str(),
fragShaderCode.c_str());
if (error != OGLERROR_NOERR)
{
INFO("OpenGL ES: Failed to create the GEOMETRY ZERO DST ALPHA shader program.\n");
glUseProgram(0);
this->DestroyGeometryZeroDstAlphaProgram();
return error;
}
glLinkProgram(OGLRef.programGeometryZeroDstAlphaID);
if (!this->ValidateShaderProgramLink(OGLRef.programGeometryZeroDstAlphaID))
{
INFO("OpenGL ES: Failed to link the GEOMETRY ZERO DST ALPHA shader program.\n");
glUseProgram(0);
this->DestroyGeometryZeroDstAlphaProgram();
return OGLERROR_SHADER_CREATE_ERROR;
}
glValidateProgram(OGLRef.programGeometryZeroDstAlphaID);
glUseProgram(OGLRef.programGeometryZeroDstAlphaID);
const GLint uniformTexGColor = glGetUniformLocation(OGLRef.programGeometryZeroDstAlphaID, "texInFragColor");
glUniform1i(uniformTexGColor, OGLTextureUnitID_GColor);
return OGLERROR_NOERR;
}
Render3DError OpenGLESRenderer_3_0::CreateEdgeMarkProgram(const bool isMultisample, const char *vtxShaderCString, const char *fragShaderCString)
{
Render3DError error = OGLERROR_NOERR;
OGLRenderRef &OGLRef = *this->ref;
if ( (vtxShaderCString == NULL) || (fragShaderCString == NULL) )
{
return error;
}
std::stringstream shaderHeader;
shaderHeader << "#version 300 es\n";
shaderHeader << "precision highp float;\n";
shaderHeader << "precision highp int;\n";
shaderHeader << "\n";
shaderHeader << "#define FRAMEBUFFER_SIZE_X " << this->_framebufferWidth << ".0 \n";
shaderHeader << "#define FRAMEBUFFER_SIZE_Y " << this->_framebufferHeight << ".0 \n";
shaderHeader << "\n";
std::stringstream vsHeader;
vsHeader << "#define IN_VTX_POSITION layout (location = " << OGLVertexAttributeID_Position << ") in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 layout (location = " << OGLVertexAttributeID_TexCoord0 << ") in\n";
vsHeader << "#define IN_VTX_COLOR layout (location = " << OGLVertexAttributeID_Color << ") in\n";
std::stringstream fsHeader;
fsHeader << "#define OUT_COLOR layout (location = 0) out\n";
std::string vtxShaderCode = shaderHeader.str() + vsHeader.str() + std::string(vtxShaderCString);
std::string fragShaderCode = shaderHeader.str() + fsHeader.str() + std::string(fragShaderCString);
error = this->ShaderProgramCreate(OGLRef.vertexEdgeMarkShaderID,
OGLRef.fragmentEdgeMarkShaderID,
OGLRef.programEdgeMarkID,
vtxShaderCode.c_str(),
fragShaderCode.c_str());
if (error != OGLERROR_NOERR)
{
INFO("OpenGL ES: Failed to create the EDGE MARK shader program.\n");
glUseProgram(0);
this->DestroyEdgeMarkProgram();
return error;
}
glLinkProgram(OGLRef.programEdgeMarkID);
if (!this->ValidateShaderProgramLink(OGLRef.programEdgeMarkID))
{
INFO("OpenGL ES: Failed to link the EDGE MARK shader program.\n");
glUseProgram(0);
this->DestroyEdgeMarkProgram();
return OGLERROR_SHADER_CREATE_ERROR;
}
glValidateProgram(OGLRef.programEdgeMarkID);
glUseProgram(OGLRef.programEdgeMarkID);
const GLuint uniformBlockRenderStates = glGetUniformBlockIndex(OGLRef.programEdgeMarkID, "RenderStates");
glUniformBlockBinding(OGLRef.programEdgeMarkID, uniformBlockRenderStates, OGLBindingPointID_RenderStates);
const GLint uniformTexGDepth = glGetUniformLocation(OGLRef.programEdgeMarkID, "texInFragDepth");
const GLint uniformTexGPolyID = glGetUniformLocation(OGLRef.programEdgeMarkID, "texInPolyID");
glUniform1i(uniformTexGDepth, OGLTextureUnitID_DepthStencil);
glUniform1i(uniformTexGPolyID, OGLTextureUnitID_GPolyID);
return OGLERROR_NOERR;
}
Render3DError OpenGLESRenderer_3_0::CreateFogProgram(const OGLFogProgramKey fogProgramKey, const bool isMultisample, const char *vtxShaderCString, const char *fragShaderCString)
{
Render3DError error = OGLERROR_NOERR;
OGLRenderRef &OGLRef = *this->ref;
if (vtxShaderCString == NULL)
{
INFO("OpenGL ES: The FOG vertex shader is unavailable.\n");
error = OGLERROR_VERTEX_SHADER_PROGRAM_LOAD_ERROR;
return error;
}
else if (fragShaderCString == NULL)
{
INFO("OpenGL ES: The FOG fragment shader is unavailable.\n");
error = OGLERROR_FRAGMENT_SHADER_PROGRAM_LOAD_ERROR;
return error;
}
const s32 fogOffset = fogProgramKey.offset;
const GLfloat fogOffsetf = (GLfloat)fogOffset / 32767.0f;
const s32 fogStep = 0x0400 >> fogProgramKey.shift;
std::stringstream shaderHeader;
shaderHeader << "#version 300 es\n";
shaderHeader << "precision highp float;\n";
shaderHeader << "precision highp int;\n";
shaderHeader << "\n";
std::stringstream vsHeader;
vsHeader << "#define IN_VTX_POSITION layout (location = " << OGLVertexAttributeID_Position << ") in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 layout (location = " << OGLVertexAttributeID_TexCoord0 << ") in\n";
vsHeader << "#define IN_VTX_COLOR layout (location = " << OGLVertexAttributeID_Color << ") in\n";
std::stringstream fsHeader;
fsHeader << "#define FOG_OFFSET " << fogOffset << "\n";
fsHeader << "#define FOG_OFFSETF " << fogOffsetf << (((fogOffsetf == 0.0f) || (fogOffsetf == 1.0f)) ? ".0" : "") << "\n";
fsHeader << "#define FOG_STEP " << fogStep << "\n";
fsHeader << "\n";
fsHeader << "#define OUT_COLOR layout (location = 0) out\n";
std::string vtxShaderCode = shaderHeader.str() + vsHeader.str() + std::string(vtxShaderCString);
std::string fragShaderCode = shaderHeader.str() + fsHeader.str() + std::string(fragShaderCString);
OGLFogShaderID shaderID;
shaderID.program = 0;
shaderID.fragShader = 0;
error = this->ShaderProgramCreate(OGLRef.vertexFogShaderID,
shaderID.fragShader,
shaderID.program,
vtxShaderCode.c_str(),
fragShaderCode.c_str());
this->_fogProgramMap[fogProgramKey.key] = shaderID;
if (error != OGLERROR_NOERR)
{
INFO("OpenGL ES: Failed to create the FOG shader program.\n");
glUseProgram(0);
this->DestroyFogProgram(fogProgramKey);
return error;
}
glLinkProgram(shaderID.program);
if (!this->ValidateShaderProgramLink(shaderID.program))
{
INFO("OpenGL ES: Failed to link the FOG shader program.\n");
glUseProgram(0);
this->DestroyFogProgram(fogProgramKey);
return OGLERROR_SHADER_CREATE_ERROR;
}
glValidateProgram(shaderID.program);
glUseProgram(shaderID.program);
const GLuint uniformBlockRenderStates = glGetUniformBlockIndex(shaderID.program, "RenderStates");
glUniformBlockBinding(shaderID.program, uniformBlockRenderStates, OGLBindingPointID_RenderStates);
const GLint uniformTexGDepth = glGetUniformLocation(shaderID.program, "texInFragDepth");
const GLint uniformTexGFog = glGetUniformLocation(shaderID.program, "texInFogAttributes");
const GLint uniformTexFogDensityTable = glGetUniformLocation(shaderID.program, "texFogDensityTable");
glUniform1i(uniformTexGDepth, OGLTextureUnitID_DepthStencil);
glUniform1i(uniformTexGFog, OGLTextureUnitID_FogAttr);
glUniform1i(uniformTexFogDensityTable, OGLTextureUnitID_LookupTable);
return OGLERROR_NOERR;
}
Render3DError OpenGLESRenderer_3_0::CreateFramebufferOutput6665Program(const char *vtxShaderCString, const char *fragShaderCString)
{
Render3DError error = OGLERROR_NOERR;
OGLRenderRef &OGLRef = *this->ref;
if ( (vtxShaderCString == NULL) || (fragShaderCString == NULL) )
{
return error;
}
std::stringstream shaderHeader;
shaderHeader << "#version 300 es\n";
shaderHeader << "precision highp float;\n";
shaderHeader << "precision highp int;\n";
shaderHeader << "\n";
shaderHeader << "#define FRAMEBUFFER_SIZE_X " << this->_framebufferWidth << ".0 \n";
shaderHeader << "#define FRAMEBUFFER_SIZE_Y " << this->_framebufferHeight << ".0 \n";
shaderHeader << "\n";
std::stringstream vsHeader;
vsHeader << "#define IN_VTX_POSITION layout (location = " << OGLVertexAttributeID_Position << ") in\n";
vsHeader << "#define IN_VTX_TEXCOORD0 layout (location = " << OGLVertexAttributeID_TexCoord0 << ") in\n";
vsHeader << "#define IN_VTX_COLOR layout (location = " << OGLVertexAttributeID_Color << ") in\n";
std::stringstream fsHeader;
fsHeader << "#define OUT_COLOR layout (location = " << (OGL_WORKING_ATTACHMENT_ID - GL_COLOR_ATTACHMENT0) << ") out\n";
std::string vtxShaderCode = shaderHeader.str() + vsHeader.str() + std::string(vtxShaderCString);
std::string fragShaderCode = shaderHeader.str() + fsHeader.str() + std::string(fragShaderCString);
error = this->ShaderProgramCreate(OGLRef.vertexFramebufferOutput6665ShaderID,
OGLRef.fragmentFramebufferRGBA6665OutputShaderID,
OGLRef.programFramebufferRGBA6665OutputID,
vtxShaderCode.c_str(),
fragShaderCode.c_str());
if (error != OGLERROR_NOERR)
{
INFO("OpenGL ES: Failed to create the FRAMEBUFFER OUTPUT RGBA6665 shader program.\n");
glUseProgram(0);
this->DestroyFramebufferOutput6665Programs();
return error;
}
glLinkProgram(OGLRef.programFramebufferRGBA6665OutputID);
if (!this->ValidateShaderProgramLink(OGLRef.programFramebufferRGBA6665OutputID))
{
INFO("OpenGL ES: Failed to link the FRAMEBUFFER OUTPUT RGBA6665 shader program.\n");
glUseProgram(0);
this->DestroyFramebufferOutput6665Programs();
return OGLERROR_SHADER_CREATE_ERROR;
}
glValidateProgram(OGLRef.programFramebufferRGBA6665OutputID);
glUseProgram(OGLRef.programFramebufferRGBA6665OutputID);
const GLint uniformTexGColor = glGetUniformLocation(OGLRef.programFramebufferRGBA6665OutputID, "texInFragColor");
glUniform1i(uniformTexGColor, OGLTextureUnitID_GColor);
return OGLERROR_NOERR;
}

View File

@ -0,0 +1,59 @@
/*
Copyright (C) 2024 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OGLRENDER_ES3_H
#define OGLRENDER_ES3_H
#include "OGLRender_3_2.h"
// A port that wants to use the OpenGL ES renderer must assign the two following functions
// to OGLLoadEntryPoints_ES_3_0_Func and OGLCreateRenderer_ES_3_0_Func, respectively.
//
// In addition, the port must add the following GPU3DInterface objects to core3DList:
// - gpu3Dgl_ES_3_0: Selects the OpenGL ES 3.0 renderer, and returns an error if it is
// not available on the host system.
//
// Finally, the port must call GPU->Set3DRendererByID() and pass in the index where
// gpu3Dgl_ES_3_0 exists in core3DList so that the emulator can create the appropriate
// OpenGLRenderer object.
//
// Example code:
// OGLLoadEntryPoints_ES_3_0_Func = &OGLLoadEntryPoints_ES_3_0;
// OGLCreateRenderer_ES_3_0_Func = &OGLCreateRenderer_ES_3_0;
// GPU3DInterface *core3DList[] = { &gpu3DNull, &gpu3DRasterize, &gpu3Dgl_ES_3_0, NULL };
// GPU->Set3DRendererByID(2);
void OGLLoadEntryPoints_ES_3_0();
void OGLCreateRenderer_ES_3_0(OpenGLRenderer **rendererPtr);
class OpenGLESRenderer_3_0 : public OpenGLRenderer_3_2
{
protected:
virtual Render3DError CreateGeometryPrograms();
virtual Render3DError CreateClearImageProgram(const char *vsCString, const char *fsCString);
virtual Render3DError CreateGeometryZeroDstAlphaProgram(const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateEdgeMarkProgram(const bool isMultisample, const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateFogProgram(const OGLFogProgramKey fogProgramKey, const bool isMultisample, const char *vtxShaderCString, const char *fragShaderCString);
virtual Render3DError CreateFramebufferOutput6665Program(const char *vtxShaderCString, const char *fragShaderCString);
public:
OpenGLESRenderer_3_0();
virtual Render3DError InitExtensions();
};
#endif // OGLRENDER_ES3_H

3
desmume/src/PACKED_END.h Normal file
View File

@ -0,0 +1,3 @@
#ifndef __GNUC__
#pragma pack(pop)
#endif

375
desmume/src/ROMReader.cpp Normal file
View File

@ -0,0 +1,375 @@
/*
Copyright 2007 Guillaume Duhamel
Copyright 2007-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ROMReader.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#ifdef HAVE_LIBZZIP
#include <zzip/zzip.h>
#endif
#include "utils/xstring.h"
#ifdef WIN32
#define stat(...) _stat(__VA_ARGS__)
#define S_IFMT _S_IFMT
#define S_IFREG _S_IFREG
#endif
ROMReader_struct * ROMReaderInit(char ** filename)
{
#ifdef HAVE_LIBZ
if(!strcasecmp(".gz", *filename + (strlen(*filename) - 3)))
{
(*filename)[strlen(*filename) - 3] = '\0';
return &GZIPROMReader;
}
#endif
#ifdef HAVE_LIBZZIP
if (!strcasecmp(".zip", *filename + (strlen(*filename) - 4)))
{
(*filename)[strlen(*filename) - 4] = '\0';
return &ZIPROMReader;
}
#endif
return &STDROMReader;
}
void * STDROMReaderInit(const char * filename);
void STDROMReaderDeInit(void *);
u32 STDROMReaderSize(void *);
int STDROMReaderSeek(void *, int, int);
int STDROMReaderRead(void *, void *, u32);
int STDROMReaderWrite(void *, void *, u32);
ROMReader_struct STDROMReader =
{
ROMREADER_STD,
"Standard ROM Reader",
STDROMReaderInit,
STDROMReaderDeInit,
STDROMReaderSize,
STDROMReaderSeek,
STDROMReaderRead,
STDROMReaderWrite
};
struct STDROMReaderData
{
FILE* file;
long pos;
};
void* STDROMReaderInit(const char* filename)
{
#ifndef _MSC_VER
struct stat sb;
if (stat(filename, &sb) == -1)
return 0;
if ((sb.st_mode & S_IFMT) != S_IFREG)
return 0;
#endif
#ifdef WIN32
FILE* inf = _wfopen(mbstowcs((std::string)filename).c_str(),L"rb");
#else
FILE* inf = fopen(filename, "rb");
#endif
if(!inf) return NULL;
STDROMReaderData* ret = new STDROMReaderData();
ret->file = inf;
ret->pos = 0;
return (void*)ret;
}
void STDROMReaderDeInit(void * file)
{
if (!file) return ;
fclose(((STDROMReaderData*)file)->file);
delete ((STDROMReaderData*)file);
}
u32 STDROMReaderSize(void * file)
{
u32 size;
if (!file) return 0;
FILE* inf = ((STDROMReaderData*)file)->file;
fseek(inf, 0, SEEK_END);
size = ftell(inf);
fseek(inf, ((STDROMReaderData*)file)->pos, SEEK_SET);
return size;
}
int STDROMReaderSeek(void * file, int offset, int whence)
{
//not normal fseek return value meanings. awesome.
if (!file) return 0;
if(whence == SEEK_SET && offset == ((STDROMReaderData*)file)->pos)
return 1;
fseek(((STDROMReaderData*)file)->file, offset, whence);
((STDROMReaderData*)file)->pos = ftell(((STDROMReaderData*)file)->file);
return 1;
}
int STDROMReaderRead(void * file, void * buffer, u32 size)
{
if (!file) return 0;
int read = fread(buffer, 1, size, ((STDROMReaderData*)file)->file);
((STDROMReaderData*)file)->pos += read;
return read;
}
int STDROMReaderWrite(void *, void *, u32)
{
//not supported, for now
return 0;
}
#ifdef HAVE_LIBZ
void * GZIPROMReaderInit(const char * filename);
void GZIPROMReaderDeInit(void *);
u32 GZIPROMReaderSize(void *);
int GZIPROMReaderSeek(void *, int, int);
int GZIPROMReaderRead(void *, void *, u32);
int GZIPROMReaderWrite(void *, void *, u32);
ROMReader_struct GZIPROMReader =
{
ROMREADER_GZIP,
"Gzip ROM Reader",
GZIPROMReaderInit,
GZIPROMReaderDeInit,
GZIPROMReaderSize,
GZIPROMReaderSeek,
GZIPROMReaderRead,
GZIPROMReaderWrite
};
void * GZIPROMReaderInit(const char * filename)
{
return (void*)gzopen(filename, "rb");
}
void GZIPROMReaderDeInit(void * file)
{
gzclose((gzFile)file);
}
u32 GZIPROMReaderSize(void * file)
{
char useless[1024];
u32 size = 0;
/* FIXME this function should first save the current
* position and restore it after size calculation */
gzrewind((gzFile)file);
while (gzeof ((gzFile)file) == 0)
size += gzread((gzFile)file, useless, 1024);
gzrewind((gzFile)file);
return size;
}
int GZIPROMReaderSeek(void * file, int offset, int whence)
{
return gzseek((gzFile)file, offset, whence);
}
int GZIPROMReaderRead(void * file, void * buffer, u32 size)
{
return gzread((gzFile)file, buffer, size);
}
int GZIPROMReaderWrite(void *, void *, u32)
{
//not supported, ever
return 0;
}
#endif
#ifdef HAVE_LIBZZIP
void * ZIPROMReaderInit(const char * filename);
void ZIPROMReaderDeInit(void *);
u32 ZIPROMReaderSize(void *);
int ZIPROMReaderSeek(void *, int, int);
int ZIPROMReaderRead(void *, void *, u32);
int ZIPROMReaderWrite(void *, void *, u32);
ROMReader_struct ZIPROMReader =
{
ROMREADER_ZIP,
"Zip ROM Reader",
ZIPROMReaderInit,
ZIPROMReaderDeInit,
ZIPROMReaderSize,
ZIPROMReaderSeek,
ZIPROMReaderRead,
ZIPROMReaderWrite
};
void * ZIPROMReaderInit(const char * filename)
{
ZZIP_DIR * dir = zzip_opendir(filename);
ZZIP_DIRENT * dirent = zzip_readdir(dir);
if (dir != NULL)
{
char *tmp1;
char tmp2[1024];
memset(tmp2,0,sizeof(tmp2));
tmp1 = strndup(filename, strlen(filename) - 4);
sprintf(tmp2, "%s/%s", tmp1, dirent->d_name);
free(tmp1);
return zzip_fopen(tmp2, "rb");
}
return NULL;
}
void ZIPROMReaderDeInit(void * file)
{
zzip_close((ZZIP_FILE*)file);
}
u32 ZIPROMReaderSize(void * file)
{
u32 size;
zzip_seek((ZZIP_FILE*)file, 0, SEEK_END);
size = zzip_tell((ZZIP_FILE*)file);
zzip_seek((ZZIP_FILE*)file, 0, SEEK_SET);
return size;
}
int ZIPROMReaderSeek(void * file, int offset, int whence)
{
return zzip_seek((ZZIP_FILE*)file, offset, whence);
}
int ZIPROMReaderRead(void * file, void * buffer, u32 size)
{
#ifdef ZZIP_OLD_READ
return zzip_read((ZZIP_FILE*)file, (char *) buffer, size);
#else
return zzip_read((ZZIP_FILE*)file, buffer, size);
#endif
}
int ZIPROMReaderWrite(void *, void *, u32)
{
//not supported ever
return 0;
}
#endif
struct {
void* buf;
int len;
int pos;
} mem;
void * MemROMReaderInit(const char * filename)
{
return NULL; //dummy
}
void MemROMReaderDeInit(void *)
{
//nothing to do
}
u32 MemROMReaderSize(void *)
{
return (u32)mem.len;
}
int MemROMReaderSeek(void * file, int offset, int whence)
{
switch(whence) {
case SEEK_SET:
mem.pos = offset;
break;
case SEEK_CUR:
mem.pos += offset;
break;
case SEEK_END:
mem.pos = mem.len + offset;
break;
}
return mem.pos;
}
int MemROMReaderRead(void * file, void * buffer, u32 size)
{
if(mem.pos<0) return 0;
int todo = (int)size;
int remain = mem.len - mem.pos;
if(remain<todo)
todo = remain;
if(todo<=0)
return 0;
else if(todo==1) *(u8*)buffer = ((u8*)mem.buf)[mem.pos];
else memcpy(buffer,(u8*)mem.buf + mem.pos, todo);
mem.pos += todo;
return todo;
}
int MemROMReaderWrite(void * file, void * buffer, u32 size)
{
if(mem.pos<0) return 0;
int todo = (int)size;
int remain = mem.len - mem.pos;
if(remain<todo)
todo = remain;
if (todo == 1) ((u8*)mem.buf)[mem.pos] = *(u8*)buffer;
else memcpy((u8*)mem.buf + mem.pos,buffer, todo);
mem.pos += todo;
return todo;
}
static ROMReader_struct MemROMReader =
{
ROMREADER_MEM,
"Memory ROM Reader",
MemROMReaderInit,
MemROMReaderDeInit,
MemROMReaderSize,
MemROMReaderSeek,
MemROMReaderRead,
MemROMReaderWrite,
};
ROMReader_struct * MemROMReaderRead_TrueInit(void* buf, int length)
{
mem.buf = buf;
mem.len = length;
mem.pos = 0;
return &MemROMReader;
}

58
desmume/src/ROMReader.h Normal file
View File

@ -0,0 +1,58 @@
/*
Copyright (C) 2007 Guillaume Duhamel
Copyright (C) 2007-2022 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ROMREADER_H_
#define _ROMREADER_H_
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif
#include <string.h>
#include "types.h"
#define ROMREADER_DEFAULT -1
#define ROMREADER_STD 0
#define ROMREADER_GZIP 1
#define ROMREADER_ZIP 2
#define ROMREADER_MEM 3
typedef struct
{
int id;
const char * Name;
void * (*Init)(const char * filename);
void (*DeInit)(void * file);
u32 (*Size)(void * file);
int (*Seek)(void * file, int offset, int whence);
int (*Read)(void * file, void * buffer, u32 size);
int (*Write)(void * file, void * buffer, u32 size);
} ROMReader_struct;
extern ROMReader_struct STDROMReader;
#ifdef HAVE_LIBZ
extern ROMReader_struct GZIPROMReader;
#endif
#ifdef HAVE_LIBZZIP
extern ROMReader_struct ZIPROMReader;
#endif
ROMReader_struct * ROMReaderInit(char ** filename);
ROMReader_struct * MemROMReaderRead_TrueInit(void* buf, int length);
#endif // _ROMREADER_H_

2124
desmume/src/SPU.cpp Normal file

File diff suppressed because it is too large Load Diff

305
desmume/src/SPU.h Normal file
View File

@ -0,0 +1,305 @@
/*
Copyright 2006 Theo Berkau
Copyright (C) 2006-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SPU_H
#define SPU_H
#include <iosfwd>
#include <string>
#include <assert.h>
#include <stdio.h>
#include "types.h"
#include "matrix.h"
#include "metaspu/metaspu.h"
class EMUFILE;
#define SNDCORE_DEFAULT -1
#define SNDCORE_DUMMY 0
#define CHANSTAT_STOPPED 0
#define CHANSTAT_PLAY 1
#define SPUINTERPOLATION_TAPS 4 // Must be at least 4 for Catmull-Rom interpolation
//who made these static? theyre used in multiple places.
FORCEINLINE s32 spumuldiv7(s32 val, u8 multiplier) {
assert(multiplier <= 127);
return (multiplier == 127) ? val : ((val * multiplier) >> 7);
}
enum SPUInterpolationMode
{
SPUInterpolation_None = 0,
SPUInterpolation_Linear = 1,
SPUInterpolation_Cosine = 2,
SPUInterpolation_CatmullRom = 3
};
struct SoundInterface_struct
{
int id;
const char *Name;
int (*Init)(int buffersize);
void (*DeInit)();
void (*UpdateAudio)(s16 *buffer, u32 num_samples);
u32 (*GetAudioSpace)();
void (*MuteAudio)();
void (*UnMuteAudio)();
void (*SetVolume)(int volume);
void (*ClearBuffer)();
void (*FetchSamples)(s16 *sampleBuffer, size_t sampleCount, ESynchMode synchMode, ISynchronizingAudioBuffer *theSynchronizer);
size_t (*PostProcessSamples)(s16 *postProcessBuffer, size_t requestedSampleCount, ESynchMode synchMode, ISynchronizingAudioBuffer *theSynchronizer);
};
extern SoundInterface_struct SNDDummy;
extern SoundInterface_struct SNDFile;
extern int SPU_currentCoreNum;
struct channel_struct
{
channel_struct() : num(0),
vol(0),
volumeDiv(0),
hold(0),
pan(0),
waveduty(0),
repeat(0),
format(0),
keyon(0),
status(0),
pcm16bOffs(0),
addr(0),
timer(0),
loopstart(0),
length(0),
totlength(0),
totlength_shifted(0),
sampcntFrac(0),
sampcntInt(0),
sampincFrac(0),
sampincInt(0),
loop_pcm16b(0),
index(0),
loop_index(0),
x(0)
{}
u32 num;
u8 vol;
u8 volumeDiv;
u8 hold;
u8 pan;
u8 waveduty;
u8 repeat;
u8 format;
u8 keyon;
u8 status;
u8 pcm16bOffs;
u32 addr;
u16 timer;
u16 loopstart;
u32 length;
u32 totlength;
s32 totlength_shifted;
u32 sampcntFrac;
s32 sampcntInt;
u32 sampincFrac;
u32 sampincInt;
s16 pcm16b[SPUINTERPOLATION_TAPS];
// ADPCM specific
s16 loop_pcm16b;
s32 index;
int loop_index;
// PSG noise
u16 x;
};
class SPUFifo
{
public:
SPUFifo();
void enqueue(s16 val);
s16 dequeue();
s16 buffer[16];
s32 head,tail,size;
void save(EMUFILE &fp);
bool load(EMUFILE &fp);
void reset();
};
class SPU_struct
{
public:
SPU_struct(int buffersize);
u32 bufpos;
u32 buflength;
s32 *sndbuf;
s32 lastdata; //the last sample that a channel generated
s16 *outbuf;
u32 bufsize;
channel_struct channels[16];
//registers
struct REGS {
REGS()
: mastervol(0)
, ctl_left(0)
, ctl_right(0)
, ctl_ch1bypass(0)
, ctl_ch3bypass(0)
, masteren(0)
, soundbias(0)
{}
u8 mastervol;
u8 ctl_left, ctl_right;
u8 ctl_ch1bypass, ctl_ch3bypass;
u8 masteren;
u16 soundbias;
enum LeftOutputMode
{
LOM_LEFT_MIXER=0, LOM_CH1=1, LOM_CH3=2, LOM_CH1_PLUS_CH3=3
};
enum RightOutputMode
{
ROM_RIGHT_MIXER=0, ROM_CH1=1, ROM_CH3=2, ROM_CH1_PLUS_CH3=3
};
struct CAP {
CAP()
: add(0), source(0), oneshot(0), bits8(0), active(0), dad(0), len(0)
{}
u8 add, source, oneshot, bits8, active;
u32 dad;
u16 len;
struct Runtime {
Runtime()
: running(0), curdad(0), maxdad(0)
{}
u8 running;
u32 curdad;
u32 maxdad;
u32 sampcntFrac;
u32 sampcntInt;
SPUFifo fifo;
} runtime;
} cap[2];
} regs;
void reset();
~SPU_struct();
void KeyOff(int channel);
void KeyOn(int channel);
void KeyProbe(int channel);
void ProbeCapture(int which);
void WriteByte(u32 addr, u8 val);
void WriteWord(u32 addr, u16 val);
void WriteLong(u32 addr, u32 val);
u8 ReadByte(u32 addr);
u16 ReadWord(u32 addr);
u32 ReadLong(u32 addr);
bool isSPU(u32 addr) { return ((addr >= 0x04000400) && (addr < 0x04000520)); }
//kills all channels but leaves SPU otherwise running normally
void ShutUp();
};
extern SPU_struct *SPU_core, *SPU_user;
extern int spu_core_samples;
int SPU_ChangeSoundCore(int coreid, int newBufferSizeBytes);
SoundInterface_struct *SPU_SoundCore();
void SPU_ReInit(bool fakeBoot = false);
int SPU_Init(int coreid, int newBufferSizeBytes);
void SPU_Pause(int pause);
void SPU_SetVolume(int newVolume);
void SPU_SetSynchMode(int mode, int method);
void SPU_ClearOutputBuffer(void);
void SPU_Reset(void);
void SPU_DeInit(void);
void SPU_KeyOn(int channel);
static FORCEINLINE void SPU_WriteByte(u32 addr, u8 val)
{
addr &= 0xFFF;
SPU_core->WriteByte(addr,val);
if(SPU_user)
SPU_user->WriteByte(addr,val);
}
static FORCEINLINE void SPU_WriteWord(u32 addr, u16 val)
{
addr &= 0xFFF;
SPU_core->WriteWord(addr,val);
if(SPU_user)
SPU_user->WriteWord(addr,val);
}
static FORCEINLINE void SPU_WriteLong(u32 addr, u32 val)
{
addr &= 0xFFF;
SPU_core->WriteLong(addr,val);
if(SPU_user)
SPU_user->WriteLong(addr,val);
}
static FORCEINLINE u8 SPU_ReadByte(u32 addr) { return SPU_core->ReadByte(addr & 0x0FFF); }
static FORCEINLINE u16 SPU_ReadWord(u32 addr) { return SPU_core->ReadWord(addr & 0x0FFF); }
static FORCEINLINE u32 SPU_ReadLong(u32 addr) { return SPU_core->ReadLong(addr & 0x0FFF); }
void SPU_Emulate_core(void);
void SPU_Emulate_user(bool mix = true);
void SPU_DefaultFetchSamples(s16 *sampleBuffer, size_t sampleCount, ESynchMode synchMode, ISynchronizingAudioBuffer *theSynchronizer);
size_t SPU_DefaultPostProcessSamples(s16 *postProcessBuffer, size_t requestedSampleCount, ESynchMode synchMode, ISynchronizingAudioBuffer *theSynchronizer);
void spu_savestate(EMUFILE &os);
bool spu_loadstate(EMUFILE &is, int size);
enum WAVMode
{
WAVMODE_ANY = -1,
WAVMODE_CORE = 0,
WAVMODE_USER = 1
};
class WavWriter
{
public:
WavWriter();
bool open(const std::string & fname);
void close();
void update(void* soundData, int numSamples);
bool isRecording() const;
WAVMode mode;
private:
FILE *spufp;
};
void WAV_End();
bool WAV_Begin(const char* fname, WAVMode mode=WAVMODE_CORE);
bool WAV_IsRecording(WAVMode mode=WAVMODE_ANY);
void WAV_WavSoundUpdate(void* soundData, int numSamples, WAVMode mode=WAVMODE_CORE);
// we should make this configurable eventually
// but at least defining it somewhere is probably a step in the right direction
#define DESMUME_SAMPLE_RATE 44100
//#define DESMUME_SAMPLE_RATE 48000
#endif

View File

@ -0,0 +1,35 @@
/*
Copyright (C) 2010-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot1.h"
class Slot1_None : public ISlot1Interface
{
public:
virtual Slot1Info const* info()
{
static Slot1InfoSimple info("None","Slot1 no-card emulation", 0xFF);
return &info;
}
//pretty much every access to the card should just be ignored and reading HIGH-Z off the GC bus.
//so, nothing really to do here
//(notably, it results in a 0xFFFFFFFF card ID)
};
ISlot1Interface* construct_Slot1_None() { return new Slot1_None(); }

View File

@ -0,0 +1,236 @@
/*
Copyright (C) 2010-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "slot1comp_protocol.h"
#include <time.h>
#include "../slot1.h"
#include "../NDSSystem.h"
#include "../emufile.h"
class Slot1_R4 : public ISlot1Interface, public ISlot1Comp_Protocol_Client
{
private:
EMUFILE *img;
Slot1Comp_Protocol protocol;
u32 write_count;
u32 write_enabled;
public:
Slot1_R4()
: img(NULL)
, write_count(0)
, write_enabled(0)
{
}
virtual Slot1Info const* info()
{
static Slot1InfoSimple info("R4", "Slot1 R4 emulation", 0x03);
return &info;
}
virtual void connect()
{
img = slot1_GetFatImage();
if(!img)
INFO("slot1 fat not successfully mounted\n");
protocol.reset(this);
protocol.chipId = 0xFC2;
protocol.gameCode = T1ReadLong((u8*)gameInfo.header.gameCode,0);
}
//called when the emulator disconnects the device
virtual void disconnect()
{
img = NULL;
}
//called when the emulator shuts down, or when the device disappears from existence
virtual void shutdown()
{
}
virtual void write_command(u8 PROCNUM, GC_Command command)
{
protocol.write_command(command);
}
virtual void write_GCDATAIN(u8 PROCNUM, u32 val)
{
protocol.write_GCDATAIN(PROCNUM, val);
}
virtual u32 read_GCDATAIN(u8 PROCNUM)
{
return protocol.read_GCDATAIN(PROCNUM);
}
virtual void slot1client_startOperation(eSlot1Operation theOperation)
{
if (theOperation != eSlot1Operation_Unknown)
return;
u32 address;
int cmd = protocol.command.bytes[0];
switch(cmd)
{
case 0xB0:
break;
case 0xB9:
case 0xBA:
address = (protocol.command.bytes[1] << 24) | (protocol.command.bytes[2] << 16) | (protocol.command.bytes[3] << 8) | protocol.command.bytes[4];
img->fseek(address,SEEK_SET);
break;
case 0xBB:
write_enabled = 1;
write_count = 0x80;
//passthrough on purpose?
case 0xBC:
address = (protocol.command.bytes[1] << 24) | (protocol.command.bytes[2] << 16) | (protocol.command.bytes[3] << 8) | protocol.command.bytes[4];
img->fseek(address,SEEK_SET);
break;
}
}
virtual u32 slot1client_read_GCDATAIN(eSlot1Operation theOperation)
{
if (theOperation != eSlot1Operation_Unknown)
return 0;
u32 val = 0;
int cmd = protocol.command.bytes[0];
switch (cmd)
{
case 0xB0:
val = (img != NULL) ? 0x1F4 : 0x1F2;
break;
case 0xB9:
val = (rand() % 100) ? (img) ? 0x1F4 : 0x1F2 : 0;
break;
case 0xBB:
case 0xBC:
val = 0;
break;
case 0xBA:
//INFO("Read from sd at sector %08X at adr %08X ",card.address/512,ftell(img));
img->read_32LE(val);
//INFO("val %08X\n",val);
break;
default:
val = 0;
break;
}
return val;
}
void slot1client_write_GCDATAIN(eSlot1Operation theOperation, u32 val)
{
if (theOperation != eSlot1Operation_Unknown)
return;
int cmd = protocol.command.bytes[0];
switch (cmd)
{
case 0xBB:
{
if (write_count && write_enabled)
{
img->write_32LE(val);
img->fflush();
write_count--;
}
break;
}
default:
break;
}
}
virtual void post_fakeboot(int PROCNUM)
{
// The BIOS leaves the card in NORMAL mode
protocol.mode = eCardMode_NORMAL;
}
void write32_GCDATAIN(u32 val)
{
//bool log = false;
//last_write_count = write_count;
//can someone tell me ... what the hell is this doing, anyway?
//seems odd to use card.command[4] for this... isnt it part of the address?
if (protocol.command.bytes[4])
{
// transfer is done
//are you SURE this is logical? there doesnt seem to be any way for the card to signal that
T1WriteLong(MMU.MMU_MEM[0][0x40], 0x1A4,val & 0x7F7FFFFF);
MMU_GC_endTransfer(0);
return;
}
int cmd = protocol.command.bytes[0];
switch (cmd)
{
case 0xBB:
{
if (write_count && write_enabled)
{
img->write_32LE(val);
img->fflush();
write_count--;
}
break;
}
default:
break;
}
if (write_count == 0)
{
write_enabled = 0;
//transfer is done
//are you SURE this is logical? there doesnt seem to be any way for the card to signal that
T1WriteLong(MMU.MMU_MEM[0][0x40], 0x1A4,val & 0x7F7FFFFF);
//but isnt this a different IRQ? IREQ_MC perhaps
MMU_GC_endTransfer(0);
}
/*if(log)
{
INFO("WRITE CARD command: %02X%02X%02X%02X%02X%02X%02X%02X\t",
card.command[0], card.command[1], card.command[2], card.command[3],
card.command[4], card.command[5], card.command[6], card.command[7]);
INFO("FROM: %08X\t", NDS_ARM9.instruct_adr);
INFO("VAL: %08X\n", val);
}*/
}
};
ISlot1Interface* construct_Slot1_R4() { return new Slot1_R4(); }

View File

@ -0,0 +1,104 @@
/*
Copyright (C) 2013-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot1.h"
#include "../NDSSystem.h"
class Slot1_Retail_Auto : public ISlot1Interface
{
private:
ISlot1Interface *mSelectedImplementation;
public:
Slot1_Retail_Auto()
: mSelectedImplementation(NULL)
{
}
virtual Slot1Info const* info()
{
static Slot1InfoSimple info("Retail (Auto)","Slot1 Retail (auto-selection) card emulation", 0xFE);
return &info;
}
virtual void connect()
{
NDS_SLOT1_TYPE selection = NDS_SLOT1_RETAIL_MCROM;
//check game ID in core emulator and select right implementation
//gamehack: definitely not a game hack, just a lazy way of selecting the right equipment for the game
if(gameInfo.IsCode("UOR") || // WarioWare - D.I.Y. (U)(E)(EUR) / Made in Ore (J)
gameInfo.IsCode("UXBP") || // Jam with the Band (EUR)
gameInfo.IsCode("AXBJ") // Daigassou! Band-Brothers DX (J)
)
selection = NDS_SLOT1_RETAIL_NAND;
slot1_selected_type = selection;
mSelectedImplementation = slot1_List[selection];
mSelectedImplementation->connect();
printf("Slot1 auto-selected device type: %s\n",mSelectedImplementation->info()->name());
}
virtual void disconnect()
{
if(mSelectedImplementation) mSelectedImplementation->disconnect();
mSelectedImplementation = NULL;
}
virtual void write_command(u8 PROCNUM, GC_Command command)
{
mSelectedImplementation->write_command(PROCNUM, command);
}
virtual void write_GCDATAIN(u8 PROCNUM, u32 val)
{
mSelectedImplementation->write_GCDATAIN(PROCNUM, val);
}
virtual u32 read_GCDATAIN(u8 PROCNUM)
{
return mSelectedImplementation->read_GCDATAIN(PROCNUM);
}
virtual u8 auxspi_transaction(int PROCNUM, u8 value)
{
return mSelectedImplementation->auxspi_transaction(PROCNUM, value);
}
virtual void auxspi_reset(int PROCNUM)
{
mSelectedImplementation->auxspi_reset(PROCNUM);
}
virtual void post_fakeboot(int PROCNUM)
{
mSelectedImplementation->post_fakeboot(PROCNUM);
}
virtual void savestate(EMUFILE &os)
{
mSelectedImplementation->savestate(os);
}
virtual void loadstate(EMUFILE &is)
{
mSelectedImplementation->loadstate(is);
}
};
ISlot1Interface* construct_Slot1_Retail_Auto() { return new Slot1_Retail_Auto(); }

View File

@ -0,0 +1,107 @@
/*
Copyright (C) 2010-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "slot1comp_mc.h"
#include "slot1comp_rom.h"
#include "slot1comp_protocol.h"
#include "../slot1.h"
#include "../NDSSystem.h"
//quick architecture overview:
//MCROM receives GC bus commands from MMU.cpp
//those are passed on to the protocol component for parsing
//protocol calls back into MCROM via ISlot1Comp_Protocol_Client interface for things the protocol doesnt know about (the contents of the rom, chiefly)
//MCROM utilizes the rom component for address logic and delivering data
class Slot1_Retail_MCROM : public ISlot1Interface, public ISlot1Comp_Protocol_Client
{
private:
Slot1Comp_Protocol protocol;
Slot1Comp_Rom rom;
public:
virtual Slot1Info const* info()
{
static Slot1InfoSimple info("Retail MC+ROM", "Slot1 Retail MC+ROM (standard) card emulation", 0x01);
return &info;
}
virtual void connect()
{
protocol.reset(this);
protocol.chipId = gameInfo.chipID;
protocol.gameCode = T1ReadLong((u8*)gameInfo.header.gameCode,0);
g_Slot1Comp_MC.connect();
}
virtual u8 auxspi_transaction(int PROCNUM, u8 value)
{
return g_Slot1Comp_MC.auxspi_transaction(PROCNUM,value);
}
virtual void auxspi_reset(int PROCNUM)
{
g_Slot1Comp_MC.auxspi_reset(PROCNUM);
}
virtual void write_command(u8 PROCNUM, GC_Command command)
{
protocol.write_command(command);
}
virtual void write_GCDATAIN(u8 PROCNUM, u32 val)
{
protocol.write_GCDATAIN(PROCNUM, val);
}
virtual u32 read_GCDATAIN(u8 PROCNUM)
{
return protocol.read_GCDATAIN(PROCNUM);
}
virtual void slot1client_startOperation(eSlot1Operation theOperation)
{
rom.start(theOperation,protocol.address);
}
virtual void post_fakeboot(int PROCNUM)
{
// The BIOS leaves the card in NORMAL mode
protocol.mode = eCardMode_NORMAL;
}
virtual void savestate(EMUFILE &os)
{
protocol.savestate(os);
rom.savestate(os);
}
virtual void loadstate(EMUFILE &is)
{
protocol.loadstate(is);
rom.loadstate(is);
}
private:
u32 slot1client_read_GCDATAIN(eSlot1Operation operation)
{
return rom.read();
}
};
ISlot1Interface* construct_Slot1_Retail_MCROM() { return new Slot1_Retail_MCROM(); }

View File

@ -0,0 +1,214 @@
/*
Copyright (C) 2013-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
//This module implements a device which is capable of building a nitro FS on the fly
//(and REBUILDING it! -- Q: under what conditions?)
//so that you can test your homebrew games and patches without having to rebuild the ROM and restart it.
//Q. can it handle resized files?
#include "slot1comp_mc.h"
#include "slot1comp_rom.h"
#include "slot1comp_protocol.h"
#include <stdio.h>
#include <string>
#include "../slot1.h"
#include "../path.h"
#include "../NDSSystem.h"
#include "../utils/fsnitro.h"
class Slot1_Retail_DEBUG : public ISlot1Interface, public ISlot1Comp_Protocol_Client
{
private:
Slot1Comp_Protocol protocol;
Slot1Comp_Rom rom;
FILE *fpROM;
FS_NITRO *fs;
u16 curr_file_id;
std::string pathData;
public:
virtual Slot1Info const* info()
{
static Slot1InfoSimple info("Retail DEBUG","Slot1 Retail (standard) card emulation + FS Nitro DEBUG", 0x04);
return &info;
}
virtual void connect()
{
protocol.reset(this);
protocol.chipId = gameInfo.chipID;
protocol.gameCode = T1ReadLong((u8*)gameInfo.header.gameCode,0);
curr_file_id = 0xFFFF;
fpROM = NULL;
fs = NULL;
pathData = path.getpath(path.SLOT1D) + path.GetRomNameWithoutExtension();
printf("Path to Slot1 data: %s\n", pathData.c_str());
fs = new FS_NITRO();
fs->rebuildFAT(pathData);
}
virtual u8 auxspi_transaction(int PROCNUM, u8 value)
{
return g_Slot1Comp_MC.auxspi_transaction(PROCNUM,value);
}
virtual void auxspi_reset(int PROCNUM)
{
g_Slot1Comp_MC.auxspi_reset(PROCNUM);
}
virtual void write_command(u8 PROCNUM, GC_Command command)
{
protocol.write_command(command);
}
virtual void write_GCDATAIN(u8 PROCNUM, u32 val)
{
protocol.write_GCDATAIN(PROCNUM, val);
}
virtual u32 read_GCDATAIN(u8 PROCNUM)
{
return protocol.read_GCDATAIN(PROCNUM);
}
virtual void post_fakeboot(int PROCNUM)
{
// The BIOS leaves the card in NORMAL mode
protocol.mode = eCardMode_NORMAL;
}
virtual void savestate(EMUFILE &os)
{
protocol.savestate(os);
rom.savestate(os);
}
virtual void loadstate(EMUFILE &is)
{
protocol.loadstate(is);
rom.loadstate(is);
}
virtual void slot1client_startOperation(eSlot1Operation theOperation)
{
if (protocol.operation == eSlot1Operation_B7_Read)
{
u16 file_id = 0xFFFF; u32 offset = 0;
bool bFromFile = false;
if (fs && fs->isFAT(protocol.address))
{
fs->rebuildFAT(protocol.address, protocol.length, pathData);
}
else
{
if (fs && fs->getFileIdByAddr(protocol.address, file_id, offset))
{
if (file_id != curr_file_id)
{
std::string tmp = fs->getFullPathByFileID(file_id);
printf("%04X:[%08X, ofs %08X] %s\n", file_id, protocol.address, offset, tmp.c_str());
if (fpROM)
{
fclose(fpROM);
fpROM = NULL;
}
tmp = pathData + tmp;
fpROM = fopen(tmp.c_str(), "rb");
if (fpROM)
{
bFromFile = true;
printf("\t * found at disk, offset %08X\n", offset);
if (fseek(fpROM, offset, SEEK_SET) != 0)
{
printf("\t\t - ERROR seek file position\n");
}
}
}
else
{
if (fpROM)
{
bFromFile = true;
if (ftell(fpROM) != offset)
{
printf("\t * new file seek %08Xh\n", offset);
fseek(fpROM, offset, SEEK_SET);
}
}
}
}
}
if (!bFromFile && fpROM)
{
fclose(fpROM);
fpROM = NULL;
}
curr_file_id = file_id;
}
rom.start(theOperation, protocol.address);
}
private:
u32 slot1client_read_GCDATAIN(eSlot1Operation operation)
{
if (protocol.operation == eSlot1Operation_B7_Read)
{
u32 address = rom.getAddress();
if (fs && fs->isFAT(address))
{
u32 res = fs->getFATRecord(address);
if (res != 0xFFFFFFFF)
{
rom.incAddress();
return res;
}
}
else
if (fpROM)
{
u32 data = 0;
u32 readed = fread(&data, 1, 4, fpROM);
if (readed)
{
rom.incAddress();
if (readed < 4)
data |= ((u32)0xFFFFFFFF << (readed * 8));
return data;
}
fclose(fpROM);
fpROM = NULL;
}
}
return rom.read();
}
};
ISlot1Interface* construct_Slot1_Retail_DEBUG() { return new Slot1_Retail_DEBUG(); }

View File

@ -0,0 +1,327 @@
/*
Copyright (C) 2010-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
// Games with NAND Flash:
// Ore/WarioWare D.I.Y. - chip: SAMSUNG 004
// KLC2811ANB-P204
// NTR-UORE-0
// - 128Mbit
#include "slot1comp_rom.h"
#include "slot1comp_protocol.h"
#include "../slot1.h"
#include "../NDSSystem.h"
#include "../emufile.h"
//quick architecture overview:
//NAND receives GC bus commands from MMU.cpp
//those are passed on to the protocol component for parsing
//protocol calls back into NAND via ISlot1Comp_Protocol_Client interface for things the protocol doesn't know about (the contents of the rom, chiefly)
//NAND utilizes the rom component for address logic and delivering data.
//it also processes some commands itself which aren't rom-related (the NANDy stuff)
class Slot1_Retail_NAND : public ISlot1Interface, public ISlot1Comp_Protocol_Client
{
private:
u32 subAdr;
Slot1Comp_Protocol protocol;
Slot1Comp_Rom rom;
u32 mode;
u32 handle_save;
//current NAND read/write start position
//when this is changed, the read/write cursor will be reset to it
//when it is set to the same value, the read/write cursor will NOT be reset
//(this is since some value must necessarily come in on the protocol address, so the 'current save_start' is used as a special 'dont change' value
u32 save_start;
//current NAND read/write cursor
u32 save_adr;
public:
virtual Slot1Info const* info()
{
static Slot1InfoSimple info("Retail NAND","Slot1 retail NAND card emulation", 0x02);
return &info;
}
virtual void connect()
{
protocol.reset(this);
protocol.chipId = gameInfo.chipID;
protocol.gameCode = T1ReadLong((u8*)gameInfo.header.gameCode,0);
save_adr = 0;
handle_save = 0;
mode = 0;
subAdr = T1ReadWord(gameInfo.header.reserved2, 0x6) << 17;
}
virtual void write_command(u8 PROCNUM, GC_Command command)
{
protocol.write_command(command);
}
virtual void write_GCDATAIN(u8 PROCNUM, u32 val)
{
protocol.write_GCDATAIN(PROCNUM, val);
}
virtual u32 read_GCDATAIN(u8 PROCNUM)
{
return protocol.read_GCDATAIN(PROCNUM);
}
virtual void slot1client_startOperation(eSlot1Operation theOperation)
{
//INFO("Start command: %02X%02X%02X%02X%02X%02X%02X%02X\t",
// protocol.command.bytes[0], protocol.command.bytes[1], protocol.command.bytes[2], protocol.command.bytes[3],
// protocol.command.bytes[4], protocol.command.bytes[5], protocol.command.bytes[6], protocol.command.bytes[7]);
//INFO("FROM: %08X\n", NDS_ARM9.instruct_adr);
u32 addressFromProtocol = (protocol.command.bytes[1] << 24) | (protocol.command.bytes[2] << 16) | (protocol.command.bytes[3] << 8) | protocol.command.bytes[4];
//pass the normal rom operations along to the rom component
switch (theOperation)
{
case eSlot1Operation_00_ReadHeader_Unencrypted:
rom.start(theOperation, addressFromProtocol);
return;
case eSlot1Operation_2x_SecureAreaLoad:
rom.start(theOperation, protocol.address);
return;
default:
break;
}
//handle special commands ourselves
int cmd = protocol.command.bytes[0];
switch(cmd)
{
// Nand Init
case 0x94:
mode = cmd;
break;
// Nand Error?
case 0xD6:
break;
//Nand Write Page
case 0x81:
mode = cmd;
if(addressFromProtocol != save_start)
{
save_start = addressFromProtocol;
save_adr = (addressFromProtocol & gameInfo.mask) - subAdr;
}
handle_save = 1;
break;
case 0x84: //Write disable
case 0x85: //Write enable
mode = cmd;
break;
case 0x8B:
mode = cmd;
handle_save = 0;
MMU_new.backupDevice.flushBackup();
break;
//Start read mode
case 0xB7:
if (handle_save)
{
mode = cmd;
if(addressFromProtocol != save_start)
{
save_start = addressFromProtocol;
save_adr = (addressFromProtocol & gameInfo.mask) - subAdr;
}
}
else
{
rom.start(theOperation, addressFromProtocol);
}
break;
case 0xB2: //Set save position
mode = cmd;
save_start = addressFromProtocol;
//cursor resets regardless of whether save_start changed, that's what makes this special.
//the cursor could be reset to the beginning of the previous save_start region
save_adr = (addressFromProtocol & gameInfo.mask) - subAdr;
handle_save = 1;
break;
}
}
virtual u32 slot1client_read_GCDATAIN(eSlot1Operation operation)
{
//pass the normal rom operations along to the rom component
switch(operation)
{
case eSlot1Operation_00_ReadHeader_Unencrypted:
case eSlot1Operation_2x_SecureAreaLoad:
//case eSlot1Operation_B7_Read:
return rom.read();
default:
break;
}
//handle special commands ourselves
int cmd = protocol.command.bytes[0];
int val = 0;
switch(cmd)
{
// Nand Init?
case 0x94:
val = 0;
mode = 0;
break;
//Rom/Save Read
case 0xB7:
{
if(handle_save)
{
MMU_new.backupDevice.ensure(save_adr+4, (u8)0);
val = MMU_new.backupDevice.readLong(save_adr, 0);
save_adr += 4;
}
else
{
val = rom.read();
}
}
break;
// Nand Status?
case 0xD6:
//0x80 == busy
//0x40 == ??
//0x20 == ready?
//0x10 == write enabled?
switch (mode)
{
case 0x84: //Write disable
val = 0x20202020;
break;
case 0x85: //Write enable
val = 0x20202020 | 0x10101010;
break;
case 0x8B:
val = 0x60606060 | 0x10101010;
break;
case 0xB2: //Set save position
val = 0x20202020;
break;
default:
val = 0x60606060; //0x20 == ready
break;
}
break;
}
return val;
}
virtual void slot1client_write_GCDATAIN(eSlot1Operation operation, u32 val)
{
//pass the normal rom operations along to the rom component
switch(operation)
{
case eSlot1Operation_00_ReadHeader_Unencrypted:
case eSlot1Operation_B7_Read:
case eSlot1Operation_2x_SecureAreaLoad:
return;
default:
break;
}
//handle special commands ourselves
int cmd = protocol.command.bytes[0];
u32 value = val;
u32 adr = save_adr;
switch(cmd)
{
case 0x81: //Nand Write
MMU_new.backupDevice.ensure(adr+4, (u8)0);
MMU_new.backupDevice.writeLong(adr, val);
save_adr += 4;
break;
}
}
virtual void post_fakeboot(int PROCNUM)
{
// The BIOS leaves the card in NORMAL mode
protocol.mode = eCardMode_NORMAL;
}
virtual void savestate(EMUFILE &os)
{
s32 version = 0;
protocol.savestate(os);
rom.savestate(os);
os.write_32LE(version);
os.write_32LE(mode);
os.write_32LE(handle_save);
os.write_32LE(save_adr);
os.write_32LE(save_start);
os.write_32LE(subAdr);
}
virtual void loadstate(EMUFILE &is)
{
s32 version = 0;
protocol.loadstate(is);
rom.loadstate(is);
is.read_32LE(version);
// version 0
if (version >= 0)
{
is.read_32LE(mode);
is.read_32LE(handle_save);
is.read_32LE(save_adr);
is.read_32LE(save_start);
is.read_32LE(subAdr);
}
}
};
ISlot1Interface* construct_Slot1_Retail_NAND() { return new Slot1_Retail_NAND(); }

View File

@ -0,0 +1,43 @@
/*
Copyright (C) 2013-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
//this file contains the components used for emulating standard gamecard "MC" devices (eeprom, fram, flash)
//this is largely done by accessing the BackupDevice resources in the core emulator
#include "slot1comp_mc.h"
#include "../MMU.h"
#include "../NDSSystem.h"
Slot1Comp_MC g_Slot1Comp_MC;
u8 Slot1Comp_MC::auxspi_transaction(int PROCNUM, u8 value)
{
return MMU_new.backupDevice.data_command(value, PROCNUM);
}
void Slot1Comp_MC::auxspi_reset(int PROCNUM)
{
MMU_new.backupDevice.reset_command();
}
void Slot1Comp_MC::connect()
{
//gamehack: not really a game hack
if(gameInfo.IsCode("AXBJ"))
MMU_new.backupDevice.uninitializedValue = 0x00; // Daigassou! Band Brothers DX (JP)
}

View File

@ -0,0 +1,35 @@
/*
Copyright (C) 2013-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
//this file contains the components used for emulating standard gamecard "MC" devices (eeprom, fram, flash)
#ifndef _SLOT1COMP_MC_H
#define _SLOT1COMP_MC_H
#include "../types.h"
class Slot1Comp_MC
{
public:
u8 auxspi_transaction(int PROCNUM, u8 value);
void auxspi_reset(int PROCNUM);
void connect();
};
extern Slot1Comp_MC g_Slot1Comp_MC;
#endif

View File

@ -0,0 +1,262 @@
/*
Copyright (C) 2012-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "slot1comp_protocol.h"
#include <string.h>
#include "../armcpu.h"
#include "../encrypt.h"
#include "../emufile.h"
#include "../utils/decrypt/decrypt.h"
static _KEY1 key1((const u8*)arm7_key);
void Slot1Comp_Protocol::reset(ISlot1Comp_Protocol_Client* theClient)
{
this->client = theClient;
//we have to initialize this to something.. lets use dummy.
//(need to clean this up...)
memcpy(&command,"\x9F\0\0\0\0\0\0\0",8);
operation = eSlot1Operation_9F_Dummy;
length = 0;
delay = 0;
mode = eCardMode_RAW;
}
void Slot1Comp_Protocol::write_command_RAW(GC_Command theCommand)
{
int cmd = theCommand.bytes[0];
if(cmd == 0x9F)
{
operation = eSlot1Operation_9F_Dummy;
length = 0x2000;
}
if(cmd == 0x90)
{
operation = eSlot1Operation_90_ChipID;
length = 4;
//we handle this operation ourselves
}
if(cmd == 0x3C)
{
//switch to KEY1
length = 0;
mode = eCardMode_KEY1;
//defer initialization of KEY1 until we know we need it, just to save some CPU time.
//TODO - some information about these parameters
//level == 2
//modulo == 8
key1.init(gameCode, 2, 0x08);
GCLOG("[GC] KEY1 ACTIVATED\n");
}
if(cmd == 0x00)
{
operation = eSlot1Operation_00_ReadHeader_Unencrypted;
client->slot1client_startOperation(operation);
}
}
void Slot1Comp_Protocol::write_command_KEY1(GC_Command theCommand)
{
//decrypt the KEY1-format command
u32 temp[2];
theCommand.toCryptoBuffer(temp);
key1.decrypt(temp);
theCommand.fromCryptoBuffer(temp);
GCLOG("[GC] (key1-decrypted):"); theCommand.print();
//and process it:
int cmd = theCommand.bytes[0];
switch(cmd&0xF0)
{
case 0x10:
operation = eSlot1Operation_1x_ChipID;
delay = 0x910, length = 4;
//we handle this operation ourselves
break;
case 0x20:
operation = eSlot1Operation_2x_SecureAreaLoad;
delay = 0x910, length = 0x11A8;
//TODO - more endian-safe way of doing this (theres examples in R4)
{
#ifdef MSB_FIRST
u64 cmd64 = *(u64*)theCommand.bytes;
#else
u64 cmd64 = bswap64(*(u64*)theCommand.bytes);
#endif
//todo - parse into blocknumber
u32 blocknumber = (cmd64>>44)&0xFFFF;
if(blocknumber<4||blocknumber>7)
printf("SLOT1 WARNING: INVALID BLOCKNUMBER FOR \"Get Secure Area Block\": 0x%04X\n",blocknumber);
address = blocknumber*0x1000;
}
client->slot1client_startOperation(operation);
break;
case 0x40:
//switch to KEY2
delay = 0x910, length = 0;
//well.. not really... yet.
GCLOG("[GC] KEY2 ACTIVATED\n");
break;
case 0x60:
//KEY2 disable? any info?
break;
case 0xA0:
delay = 0x910, length = 0;
mode = eCardMode_NORMAL;
GCLOG("[GC] NORMAL MODE ACTIVATED\n");
break;
}
}
void Slot1Comp_Protocol::write_command_NORMAL(GC_Command theCommand)
{
switch(command.bytes[0])
{
case 0xB7:
{
operation = eSlot1Operation_B7_Read;
//TODO - more endian-safe way of doing this (theres examples in R4)
#ifdef MSB_FIRST
u64 cmd64 = *(u64*)theCommand.bytes;
#else
u64 cmd64 = bswap64(*(u64*)theCommand.bytes);
#endif
address = (u32)((cmd64 >> 24));
length = 0x200;
client->slot1client_startOperation(operation);
}
break;
case 0xB8:
operation = eSlot1Operation_B8_ChipID;
delay = 0, length = 4;
//we handle this operation ourselves
break;
default:
operation = eSlot1Operation_Unknown;
client->slot1client_startOperation(operation);
break;
}
}
void Slot1Comp_Protocol::write_command(GC_Command theCommand)
{
this->command = theCommand;
//unrecognized commands will do something depending on the current state of the card
delay = 0;
length = 0;
address = 0;
switch(mode)
{
case eCardMode_RAW:
write_command_RAW(theCommand);
break;
case eCardMode_KEY1:
write_command_KEY1(theCommand);
break;
case eCardMode_NORMAL:
write_command_NORMAL(theCommand);
break;
default:
break;
}
}
void Slot1Comp_Protocol::write_GCDATAIN(u8 PROCNUM, u32 val)
{
switch(operation)
{
case eSlot1Operation_Unknown:
client->slot1client_write_GCDATAIN(operation,val);
break;
default:
break;
}
}
u32 Slot1Comp_Protocol::read_GCDATAIN(u8 PROCNUM)
{
switch(operation)
{
default:
return client->slot1client_read_GCDATAIN(operation);
case eSlot1Operation_9F_Dummy:
return 0xFFFFFFFF;
case eSlot1Operation_1x_ChipID:
return chipId;
case eSlot1Operation_90_ChipID:
case eSlot1Operation_B8_ChipID:
//Most games continuously compare the current chipId with the value in
//stored in memory at boot-up, probably to know if the card was removed.
//staff of kings verifies this (it also uses the arm7 IRQ 20 to detect card ejects)
return chipId;
}
return 0xFFFFFFFF;
}
void Slot1Comp_Protocol::savestate(EMUFILE &os)
{
s32 version = 0;
os.write_32LE(version);
os.write_32LE((s32)mode);
os.write_32LE((s32)operation);
os.fwrite(command.bytes,8);
os.write_32LE(address);
os.write_32LE(length);
os.write_32LE(delay);
os.write_32LE(chipId);
os.write_32LE(gameCode);
}
void Slot1Comp_Protocol::loadstate(EMUFILE &is)
{
s32 version = is.read_s32LE();
mode = (eCardMode)is.read_s32LE();
operation = (eSlot1Operation)is.read_s32LE();
is.fread(command.bytes,8);
is.read_32LE(address);
is.read_32LE(length);
is.read_32LE(delay);
is.read_32LE(chipId);
is.read_32LE(gameCode);
}

View File

@ -0,0 +1,114 @@
/*
Copyright (C) 2013-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
//this file contains the components used for emulating standard gamecard protocol.
//this largely means the complex boot-up process.
//i think there's no reason why proprietary cards couldn't speak any protocol they wish, as long as they didn't mind being unbootable.
//TODO - could this be refactored into a base class? that's probably more reasonable. but we've gone with this modular mix-in architecture so... not yet.
#ifndef _SLOT1COMP_PROTOCOL_H
#define _SLOT1COMP_PROTOCOL_H
#include "../types.h"
#include "../MMU.h"
class EMUFILE;
enum eSlot1Operation
{
//----------
//RAW mode operations
//before encrypted communications can be established, some values from the rom header must be read.
//this is the only way to read the header, actually, since the only reading commands available to games (after KEY2 mode is set) are
eSlot1Operation_00_ReadHeader_Unencrypted,
//it's not clear why this exists
eSlot1Operation_9F_Dummy,
eSlot1Operation_90_ChipID,
//----------
//----------
//KEY1 mode operations
eSlot1Operation_1x_ChipID,
eSlot1Operation_2x_SecureAreaLoad,
//----------
//----------
//NORMAL mode operations
//the main rom data reading command
eSlot1Operation_B7_Read,
eSlot1Operation_B8_ChipID,
//----------
eSlot1Operation_Unknown
};
class ISlot1Comp_Protocol_Client
{
public:
virtual void slot1client_startOperation(eSlot1Operation theOperation) {}
virtual u32 slot1client_read_GCDATAIN(eSlot1Operation theOperation) = 0;
virtual void slot1client_write_GCDATAIN(eSlot1Operation theOperation, u32 val) {}
};
class Slot1Comp_Protocol
{
public:
void savestate(EMUFILE &os);
void loadstate(EMUFILE &is);
//set some kind of protocol/hardware reset state
void reset(ISlot1Comp_Protocol_Client* theClient);
//signals from the GC bus
void write_command(GC_Command theCommand);
void write_GCDATAIN(u8 PROCNUM, u32 val);
u32 read_GCDATAIN(u8 PROCNUM);
//helpers for write_command()
void write_command_RAW(GC_Command theCommand);
void write_command_KEY1(GC_Command theCommand);
void write_command_NORMAL(GC_Command theCommand);
//operations not related to obscurities of the protocol or otherwise unknown are passed through to the client here
ISlot1Comp_Protocol_Client* client;
//--state--
//the major operational mode. the protocol shifts modes and interprets commands into operations differently depending on the mode
eCardMode mode;
//the current operational state
eSlot1Operation operation;
//the command we're currently crunching on
GC_Command command;
//most operations are defined in terms of returning a series of bytes
//the meaning of these varies by operation. they are provided publicly as a service to clients
u32 address;
s32 length, delay; //the expected length and delay of this state
//chipId which should be returned by the various chipId commands
u32 chipId;
//gameCode used by the protocol KEY1 crypto
u32 gameCode;
};
#endif //_SLOT1COMP_PROTOCOL_H

View File

@ -0,0 +1,123 @@
/*
Copyright (C) 2010-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "slot1comp_rom.h"
#include "../NDSSystem.h"
#include "../emufile.h"
void Slot1Comp_Rom::start(eSlot1Operation operation, u32 addr)
{
this->_operation = operation;
this->_address = addr;
}
u32 Slot1Comp_Rom::read()
{
switch(this->_operation)
{
case eSlot1Operation_00_ReadHeader_Unencrypted:
{
u32 ret = gameInfo.readROM(this->_address);
this->_address = (this->_address + 4) & 0xFFF;
return ret;
}
break;
case eSlot1Operation_2x_SecureAreaLoad:
{
//see B7 for details
//zero 15-sep-2014 - this is meaningless. newer mask is actually reasonable
//address &= gameInfo.mask; //sanity check
u32 secureAreaAddress = (this->_address - 0x4000);
secureAreaAddress &= 0x3FFF; //memory safe sanity test
u32 ret = LE_TO_LOCAL_32(*(u32*)(gameInfo.secureArea + secureAreaAddress));
this->_address = (this->_address&~0xFFF) + ((this->_address+4)&0xFFF);
return ret;
}
case eSlot1Operation_B7_Read:
{
//TODO - check about non-4-byte aligned addresses
//it seems that etrian odyssey 3 doesnt work unless we mask this to cart size.
//but, a thought: does the internal rom address counter register wrap around? we may be making a mistake by keeping the extra precision
//but there is no test case yet
this->_address &= gameInfo.mask;
//feature of retail carts:
//B7 "Can be used only for addresses 8000h and up, smaller addresses will be silently redirected to address `8000h+(addr AND 1FFh)`"
if(CommonSettings.RetailCardProtection8000)
if(this->_address < 0x8000)
this->_address = (0x8000 + (this->_address & 0x1FF));
//1. as a sanity measure for funny-sized roms (homebrew and perhaps truncated retail roms) we need to protect ourselves by returning 0xFF for things still out of range.
//2. this isnt right, unless someone documents otherwise:
//if (address > gameInfo.header.endROMoffset)
// ... the cart hardware doesnt know anything about the rom header. if it has a totally bogus endROMoffset, the cart will probably work just fine. and, the +4 is missing anyway:
//3. this is better: it just allows us to read 0xFF anywhere we dont have rom data. forget what the header says
//note: we allow the reading to proceed anyway, because the readROM method is built to allow jaggedy reads off the end of the rom to support trimmed roms
if(this->_address+4 > gameInfo.romsize)
{
DEBUG_Notify.ReadBeyondEndOfCart(this->_address,gameInfo.romsize);
}
//actually read from the ROM provider
u32 ret = gameInfo.readROM(this->_address);
//"However, the datastream wraps to the begin of the current 4K block when address+length crosses a 4K boundary (1000h bytes)"
this->_address = (this->_address&~0xFFF) + ((this->_address+4)&0xFFF);
return ret;
}
break;
default:
return 0;
} //switch(operation)
} //Slot1Comp_Rom::read()
u32 Slot1Comp_Rom::getAddress()
{
return this->_address & gameInfo.mask;
} //Slot1Comp_Rom::getAddress()
u32 Slot1Comp_Rom::incAddress()
{
this->_address &= gameInfo.mask;
this->_address = (this->_address&~0xFFF) + ((this->_address+4)&0xFFF);
return this->_address;
}
void Slot1Comp_Rom::savestate(EMUFILE &os)
{
s32 version = 0;
os.write_32LE(version);
os.write_32LE((s32)this->_operation);
os.write_32LE(this->_address);
}
void Slot1Comp_Rom::loadstate(EMUFILE &is)
{
s32 version = is.read_s32LE();
this->_operation = (eSlot1Operation)is.read_s32LE();
this->_address = is.read_u32LE();
}

View File

@ -0,0 +1,45 @@
/*
Copyright (C) 2010-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
//this file contains the components used for emulating standard gamecard ROMs
//this is largely done by accessing the rom provided in the core emulator
#ifndef _SLOT1COMP_ROM_H
#define _SLOT1COMP_ROM_H
#include "slot1comp_protocol.h"
#include "../types.h"
class EMUFILE;
class Slot1Comp_Rom
{
public:
void start(eSlot1Operation operation, u32 addr);
u32 read();
u32 getAddress();
u32 incAddress();
void savestate(EMUFILE &os);
void loadstate(EMUFILE &is);
private:
u32 _address;
eSlot1Operation _operation;
};
#endif

View File

@ -0,0 +1,72 @@
/*
Copyright (C) 2013-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include "../slot2.h"
class Slot2_Auto : public ISlot2Interface
{
private:
ISlot2Interface *mSelectedImplementation;
public:
Slot2_Auto()
: mSelectedImplementation(NULL)
{
}
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Auto","Slot2 (auto-selection) device emulation", 0xFE);
return &info;
}
virtual void connect()
{
slot2_selected_type = slot2_DetermineType();
mSelectedImplementation = slot2_List[slot2_selected_type];
mSelectedImplementation->connect();
printf("Slot2 auto-selected device type: %s (0x%02X)\n", mSelectedImplementation->info()->name(), mSelectedImplementation->info()->id());
}
virtual void disconnect()
{
if(mSelectedImplementation) mSelectedImplementation->disconnect();
mSelectedImplementation = NULL;
}
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val) { mSelectedImplementation->writeByte(PROCNUM, addr, val); }
virtual void writeWord(u8 PROCNUM, u32 addr, u16 val) { mSelectedImplementation->writeWord(PROCNUM, addr, val); }
virtual void writeLong(u8 PROCNUM, u32 addr, u32 val) { mSelectedImplementation->writeLong(PROCNUM, addr, val); }
virtual u8 readByte(u8 PROCNUM, u32 addr) { return mSelectedImplementation->readByte(PROCNUM, addr); }
virtual u16 readWord(u8 PROCNUM, u32 addr) { return mSelectedImplementation->readWord(PROCNUM, addr); }
virtual u32 readLong(u8 PROCNUM, u32 addr) { return mSelectedImplementation->readLong(PROCNUM, addr); }
virtual void savestate(EMUFILE &os)
{
mSelectedImplementation->savestate(os);
}
virtual void loadstate(EMUFILE &is)
{
mSelectedImplementation->loadstate(is);
}
};
ISlot2Interface* construct_Slot2_Auto() { return new Slot2_Auto(); }

View File

@ -0,0 +1,196 @@
/*
Copyright (C) 2009 CrazyMax
Copyright (C) 2009-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
#include "../emufile.h"
#include "../mem.h"
#if 0
#define EXPINFO(...) INFO(__VA_ARGS__)
#else
#define EXPINFO(...)
#endif
#define EXPANSION_MEMORY_SIZE (8 * 1024 * 1024)
static u8 header_0x00B0[] =
{ 0xFF, 0xFF, 0x96, 0x00, //this 0x96 is strange. it can't be read from the pak when it boots, it must appear later
0x00, 0x24, 0x24, 0x24,
0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x7F
};
class Slot2_ExpansionPak : public ISlot2Interface
{
private:
u8 *expMemory;
bool ext_ram_lock;
public:
Slot2_ExpansionPak()
{
expMemory = NULL;
ext_ram_lock = true;
}
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Memory Expansion Pak", "Official RAM expansion for Opera browser", 0x05);
return &info;
}
virtual void connect()
{
if (expMemory == NULL)
{
expMemory = new u8[EXPANSION_MEMORY_SIZE];
}
memset(expMemory, 0xFF, EXPANSION_MEMORY_SIZE);
ext_ram_lock = true;
}
virtual void disconnect()
{
delete[] expMemory;
expMemory = NULL;
}
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val)
{
if (ext_ram_lock) return;
if (addr >= 0x09000000)
{
u32 offs = (addr - 0x09000000);
if (offs >= EXPANSION_MEMORY_SIZE) return;
T1WriteByte(expMemory, offs, val);
}
EXPINFO("ExpMemory: write 08 at 0x%08X = 0x%02X\n", addr, val);
}
virtual void writeWord(u8 PROCNUM, u32 addr, u16 val)
{
if (addr == 0x08240000)
{
if (val == 0)
ext_ram_lock = true;
else
if (val == 1)
ext_ram_lock = false;
return;
}
if (ext_ram_lock) return;
if (addr >= 0x09000000)
{
u32 offs = (addr - 0x09000000);
if (offs >= EXPANSION_MEMORY_SIZE) return;
T1WriteWord(expMemory, offs, val);
}
EXPINFO("ExpMemory: write 16 at 0x%08X = 0x%04X\n", addr, val);
}
virtual void writeLong(u8 PROCNUM, u32 addr, u32 val)
{
if (ext_ram_lock) return;
if (addr >= 0x09000000)
{
u32 offs = (addr - 0x09000000);
if (offs >= EXPANSION_MEMORY_SIZE) return;
T1WriteLong(expMemory, offs, val);
}
EXPINFO("ExpMemory: write 32 at 0x%08X = 0x%08X\n", addr, val);
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
EXPINFO("ExpMemory: read 08 at 0x%08X\n", addr);
if ((addr >= 0x080000B0) && (addr < 0x080000C0))
return T1ReadByte(header_0x00B0, (addr - 0x080000B0));
if (addr >= 0x09000000)
{
u32 offs = (addr - 0x09000000);
if (offs >= EXPANSION_MEMORY_SIZE) return (0xFF);
return T1ReadByte(expMemory, offs);
}
return 0xFF;
}
virtual u16 readWord(u8 PROCNUM, u32 addr)
{
EXPINFO("ExpMemory: read 16 at 0x%08X\n", addr);
if ((addr >= 0x080000B0) && (addr < 0x080000C0))
return T1ReadWord(header_0x00B0, (addr - 0x080000B0));
if (addr == 0x0801FFFC) return 0x7FFF;
if (addr == 0x08240002) return 0; //this can't be 0xFFFF. dunno why, we just guessed 0
if (addr >= 0x09000000)
{
u32 offs = (addr - 0x09000000);
if (offs >= EXPANSION_MEMORY_SIZE) return (0xFFFF);
return T1ReadWord(expMemory, offs);
}
return 0xFFFF;
}
virtual u32 readLong(u8 PROCNUM, u32 addr)
{
EXPINFO("ExpMemory: read 32 at 0x%08X\n", addr);
if((addr >= 0x080000B0) && (addr < 0x080000C0))
return T1ReadLong(header_0x00B0, (addr - 0x080000B0));
if (addr >= 0x09000000)
{
u32 offs = (addr - 0x09000000);
if (offs >= EXPANSION_MEMORY_SIZE) return 0xFFFFFFFF;
return T1ReadLong(expMemory, offs);
}
return 0xFFFFFFFF;
}
virtual void savestate(EMUFILE &os)
{
s32 version = 0;
EMUFILE_MEMORY ram = EMUFILE_MEMORY(expMemory, EXPANSION_MEMORY_SIZE);
os.write_32LE(version);
os.write_bool32(ext_ram_lock);
os.write_MemoryStream(ram);
}
virtual void loadstate(EMUFILE &is)
{
EMUFILE_MEMORY ram = EMUFILE_MEMORY();
s32 version = is.read_s32LE();
if (version >= 0)
{
is.read_bool32(ext_ram_lock);
is.read_MemoryStream(ram);
memcpy(expMemory, ram.buf(), std::min(EXPANSION_MEMORY_SIZE, ram.size()));
}
}
};
ISlot2Interface* construct_Slot2_ExpansionPak() { return new Slot2_ExpansionPak(); }

View File

@ -0,0 +1,466 @@
/*
Copyright (C) 2009 CrazyMax
Copyright (C) 2009-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
#include <string.h>
#include "../debug.h"
#include "../NDSSystem.h"
#include "../path.h"
#include "../emufile.h"
#define EEPROM 0x52504545
#define SRAM_ 0x4D415253
#define FLASH 0x53414C46
#define FLASH1M_ 0x5F4D3148
#define SIIRTC_V 0x52494953
static const char *saveTypes[] = {
"EEPROM",
"SRAM",
"FLASH",
"FLASH1M",
"SIIRTC_V",
};
class Slot2_GbaCart : public ISlot2Interface
{
private:
EMUFILE* fROM;
EMUFILE* fSRAM;
u32 romSize;
u32 sramSize;
u32 saveType;
struct
{
u32 size;
u8 state;
u8 cmd;
u8 idDevice;
u8 idManufacturer;
u8 bank;
} gbaFlash;
u32 readRom(const u32 pos, const u8 size)
{
if (!fROM) return 0xFFFFFFFF;
fROM->fseek(pos, SEEK_SET);
u32 data = 0xFFFFFFFF;
u32 readed = fROM->fread(&data, size);
return data;
}
u32 readSRAM(const u32 pos, const u8 size)
{
if (!fSRAM)
return 0xFFFFFFFF;
fSRAM->fseek(pos, SEEK_SET);
u32 data = 0xFFFFFFFF;
u32 readed = fSRAM->fread(&data, size);
return data;
}
void writeSRAM(const u32 pos, const u8 *data, u32 size)
{
if (!fSRAM)
return;
fSRAM->fseek(pos, SEEK_SET);
u32 writed = size;
fSRAM->fwrite(data, size);
fSRAM->fflush();
}
u32 scanSaveTypeGBA()
{
if (!fROM) return 0xFF;
fROM->fseek(0, SEEK_SET);
int size = fROM->size();
int lastpct=1;
int len = fROM->size();
for(;;)
{
u32 romType = 0;
u32 readed = fROM->fread(&romType, 4);
int pos = fROM->ftell();
int currPct = pos*100/(size-1);
for(int i=lastpct;i<currPct;i++)
{
if(i%10==0)
printf(" %d%%\n",i/10*10);
else printf(".");
lastpct = currPct;
}
if (readed < 4)
break;
if(pos >= len)
break;
switch (romType)
{
case EEPROM:
return 1;
case SRAM_:
return 2;
case FLASH:
{
u32 tmp = fROM->read_u32LE();
return ((tmp == FLASH1M_)?3:5);
}
case SIIRTC_V:
return 4;
default:
break;
}
}
return 0xFF;
}
void gbaWriteFlash(u32 adr, u8 val)
{
if (!fSRAM) return;
switch (gbaFlash.state)
{
case 0:
if (adr == 0x0A005555)
{
if (val == 0xF0)
{
//INFO("GBAgame: Flash: reset\n");
gbaFlash.state = 0;
gbaFlash.cmd = 0;
return;
}
if (val == 0xAA)
{
gbaFlash.state = 1;
return;
}
}
if (adr == 0x0A000000)
{
if (gbaFlash.cmd == 0xB0)
{
gbaFlash.bank = val;
gbaFlash.cmd = 0;
//INFO("GBAgame: Flash: change bank %i\n", val);
return;
}
}
break;
case 1:
if ( (adr == 0x0A002AAA) && (val == 0x55) )
{
gbaFlash.state = 2;
return;
}
gbaFlash.state = 0;
break;
case 2:
if (adr == 0x0A005555)
{
//INFO("GBAgame: Flash: send command flash 0x%02X\n", val);
switch (val)
{
case 0x80: // Erase
gbaFlash.state = 0x80;
break;
case 0x90: // Chip Identification
gbaFlash.state = 0x90;
break;
case 0xA0: // Write
gbaFlash.state = 0;
break;
default:
gbaFlash.state = 0;
break;
}
gbaFlash.cmd = val;
return;
}
gbaFlash.state = 0;
break;
// erase
case 0x80:
if ( (adr == 0x0A005555) && (val == 0xAA) )
{
gbaFlash.state = 0x81;
return;
}
gbaFlash.state = 0;
break;
case 0x81:
if ( (adr == 0x0A002AAA) && (val == 0x55) )
{
gbaFlash.state = 0x82;
return;
}
gbaFlash.state = 0;
break;
case 0x82:
if (val == 0x30)
{
u32 ofs = (adr & 0x0000F000) + (0x10000 * gbaFlash.bank);
//INFO("GBAgame: Flash: erase from 0x%08X to 0x%08X\n", ofs + 0x0A000000, ofs + 0x0A001000);
u8 *tmp = new u8[0x1000];
memset(tmp, 0xFF, 0x1000);
writeSRAM(ofs, tmp, 0x1000);
delete [] tmp;
}
gbaFlash.state = 0;
gbaFlash.cmd = 0;
return;
// Chip Identification
case 0x90:
if ( (adr == 0x0A005555) && (val == 0xAA) )
{
gbaFlash.state = 0x91;
return;
}
gbaFlash.state = 0;
break;
case 0x91:
if ( (adr == 0x0A002AAA) && (val == 0x55) )
{
gbaFlash.state = 0x92;
return;
}
gbaFlash.state = 0;
break;
case 0x92:
gbaFlash.state = 0;
gbaFlash.cmd = 0;
return;
}
if (gbaFlash.cmd == 0xA0) // write
{
writeSRAM((adr & 0x1FFFF) + (0x10000 * gbaFlash.bank), &val, 1);
gbaFlash.state = 0;
gbaFlash.cmd = 0;
return;
}
INFO("GBAgame: Flash: write unknown atn 0x%08X = 0x%02X\n", adr, val);
}
u8 gbaReadFlash(u32 adr)
{
if (!fSRAM) return 0xFF;
if (gbaFlash.cmd == 0)
return readSRAM((adr & 0x1FFFF) + (0x10000 * gbaFlash.bank), 1);
//INFO("GBAgame: flash read at 0x%08X\n", adr);
switch (gbaFlash.cmd)
{
case 0x90: // Chip Identification
if (adr == 0x0A000000) return gbaFlash.idManufacturer;
if (adr == 0x0A000001) return gbaFlash.idDevice;
break;
case 0xF0: //
gbaFlash.state = 0;
gbaFlash.cmd = 0;
break;
case 0xB0: // Bank switching
break;
default:
INFO("GBAgame: Flash: read - unknown command at 0x%08X = 0x%02X\n", adr, gbaFlash.cmd);
break;
}
return 0xFF;
}
void Close()
{
delete fROM; fROM = NULL;
delete fSRAM; fSRAM = NULL;
romSize = 0;
sramSize = 0;
}
public:
Slot2_GbaCart()
: fROM(NULL)
, fSRAM(NULL)
{
Close();
}
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("GBA Cartridge", "GBA cartridge in slot", 0x03);
return &info;
}
virtual void connect()
{
Close();
romSize = 0;
sramSize = 0;
if (gameInfo.romsize == 0)
{
return;
}
if (GBACartridge_RomPath.empty())
{
return;
}
if (!strcasecmp(GBACartridge_RomPath.c_str(), "self"))
{
GBACartridge_RomPath = path.path;
GBACartridge_SRAMPath = Path::GetFileNameWithoutExt(GBACartridge_RomPath) + "." + GBA_SRAM_FILE_EXT;
}
printf("GBASlot opening ROM: %s\n", GBACartridge_RomPath.c_str());
EMUFILE_FILE *inf = new EMUFILE_FILE(GBACartridge_RomPath, "rb");
fROM = inf;
if (fROM->fail())
{
printf(" - Failed\n");
Close();
return;
}
inf->EnablePositionCache();
romSize = fROM->size();
printf(" - Success (%u bytes)\n", romSize);
// Load the GBA cartridge SRAM.
inf = new EMUFILE_FILE(GBACartridge_SRAMPath, "rb+");
fSRAM = inf;
if(fSRAM->fail())
{
delete fSRAM;
fSRAM = NULL;
printf("GBASlot did not load associated SRAM.\n");
}
else
{
inf->EnablePositionCache();
sramSize = fSRAM->size();
printf("Scanning GBA rom to ID save type\n");
saveType = scanSaveTypeGBA();
printf("\nGBASlot found SRAM (%s - %u bytes) at:\n%s\n", (saveType == 0xFF)?"Unknown":saveTypes[saveType], sramSize, GBACartridge_SRAMPath.c_str());
gbaFlash.size = sramSize;
if (gbaFlash.size <= (64 * 1024))
{
gbaFlash.idDevice = 0x1B;
gbaFlash.idManufacturer = 0x32;
}
else
{
gbaFlash.idDevice = 0x09;
gbaFlash.idManufacturer = 0xC2;
}
gbaFlash.state = 0;
}
}
virtual void disconnect()
{
Close();
}
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val)
{
if ((addr >= 0x0A000000) && (addr < 0x0A010000))
{
switch (saveType)
{
case 3: // Flash
case 5:
gbaWriteFlash(addr, val);
break;
default: break;
}
}
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
if (addr < 0x0A000000)
return (u8)readRom(addr - 0x08000000, 1);
if (addr < 0x0A010000)
{
if ((saveType == 3) || (saveType == 5))
return gbaReadFlash(addr);
return (u8)readSRAM(addr - 0x0A000000, 1);
}
return 0xFF;
}
virtual u16 readWord(u8 PROCNUM, u32 addr)
{
if (addr < 0x0A000000)
return (u16)readRom(addr - 0x08000000, 2);
if (addr < 0x0A010000)
return (u16)readSRAM(addr - 0x0A000000, 2);
return 0xFFFF;
}
virtual u32 readLong(u8 PROCNUM, u32 addr)
{
if (addr < 0x0A000000)
return (u32)readRom(addr - 0x08000000, 4);
if (addr < 0x0A010000)
return (u32)readSRAM(addr - 0x0A000000, 4);
return 0xFFFFFFFF;
}
};
ISlot2Interface* construct_Slot2_GbaCart() { return new Slot2_GbaCart(); }

View File

@ -0,0 +1,65 @@
/*
Copyright (C) 2009 CrazyMax
Copyright (C) 2009-2013 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
static u8 guitarKeyStatus;
class Slot2_GuitarGrip : public ISlot2Interface
{
private:
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Guitar Grip", "Guitar Grip for Guitar Hero games", 0x04);
return &info;
}
virtual void connect()
{
guitarKeyStatus = 0xFF;
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
if (addr == 0x0A000000)
return guitarKeyStatus;
return (addr & 1) ? 0xF9 : 0xFF;
}
virtual u16 readWord(u8 PROCNUM, u32 addr) { return 0xF9FF; }
virtual u32 readLong(u8 PROCNUM, u32 addr) { return 0xF9FFF9FF; }
};
ISlot2Interface* construct_Slot2_GuitarGrip() { return new Slot2_GuitarGrip(); }
void guitarGrip_setKey(bool green, bool red, bool yellow, bool blue)
{
const u8 g = (green) ? (1 << 6) : 0;
const u8 r = (red) ? (1 << 5) : 0;
const u8 y = (yellow) ? (1 << 4) : 0;
const u8 b = (blue) ? (1 << 3) : 0;
guitarKeyStatus = ~(g | r | y | b);
}
void guitarGrip_setKey(u8 theKeys)
{
guitarKeyStatus = theKeys;
}

View File

@ -0,0 +1,87 @@
//HCV-1000 emulation code adapted from GBE+: https://github.com/shonumi/gbe-plus
/*
Modifications Copyright (C) 2023 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include "../slot2.h"
u8 hcv1000_cnt;
char hcv1000_data[16];
class Slot2_HCV1000 : public ISlot2Interface
{
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Sega Card Reader", "Sega Card Reader(HCV-1000) add-on", 0x09);
return &info;
}
virtual bool init()
{
hcv1000_cnt = 0;
memset(hcv1000_data, 0x5F, 16);
return TRUE;
}
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val)
{
if (addr == 0xA000000) { hcv1000_cnt = (val & 0x83); }
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
u8 slot_byte = 0xFF;
//Reading these cart addresses is for detection
if (addr < 0x8020000)
{
u8 data = 0xF0 | ((addr & 0x1F) >> 1);
slot_byte = (addr & 0x1) ? 0xFD : data;
}
//HCV_CNT
else if (addr == 0xA000000) { slot_byte = hcv1000_cnt; }
//HCV_DATA
else if ((addr >= 0xA000010) && (addr <= 0xA00001F))
{
slot_byte = (u8)hcv1000_data[addr & 0xF];
}
return slot_byte;
}
virtual u16 readWord(u8 PROCNUM, u32 addr) { return 0xFDFD; };
virtual u32 readLong(u8 PROCNUM, u32 addr) { return 0xFDFDFDFD; };
};
ISlot2Interface* construct_Slot2_HCV1000() { return new Slot2_HCV1000(); }
void HCV1000_setReady()
{
hcv1000_cnt &= ~0x80;
}
void HCV1000_setBarcode(std::string barcode)
{
barcode.resize(16, '_');
memcpy(hcv1000_data, barcode.c_str(), barcode.length());
}

View File

@ -0,0 +1,301 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2006 Mic
Copyright (C) 2009-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include "../slot2.h"
#include "../debug.h"
#include "../emufile.h"
#include "../path.h"
#include "../utils/vfat.h"
// Set up addresses for GBAMP
#define CF_REG_DATA 0x9000000
#define CF_REG_ERR 0x9020000
#define CF_REG_SEC 0x9040000
#define CF_REG_LBA1 0x9060000
#define CF_REG_LBA2 0x9080000
#define CF_REG_LBA3 0x90A0000
#define CF_REG_LBA4 0x90C0000
#define CF_REG_CMD 0x90E0000
#define CF_REG_STS 0x98C0000
// CF Card commands
#define CF_CMD_LBA 0xE0
#define CF_CMD_READ 0x20
#define CF_CMD_WRITE 0x30
static u16 cf_reg_sts,
cf_reg_lba1,
cf_reg_lba2,
cf_reg_lba3,
cf_reg_lba4,
cf_reg_cmd;
static off_t currLBA;
static const int lfnPos[13] = {1,3,5,7,9,14,16,18,20,22,24,28,30};
static u32 fileStartLBA,fileEndLBA;
static std::string sFlashPath;
static BOOL cflashDeviceEnabled = FALSE;
static EMUFILE* file = NULL;
// ===========================
BOOL inited;
enum EListCallbackArg {
EListCallbackArg_Item, EListCallbackArg_Pop
};
static BOOL cflash_init()
{
if (inited) return FALSE;
BOOL init_good = FALSE;
CFLASHLOG("CFlash_Mode: %d\n",CFlash_Mode);
if (CFlash_Mode == ADDON_CFLASH_MODE_RomPath)
{
sFlashPath = path.RomDirectory;
INFO("Using CFlash directory of rom: %s\n", sFlashPath.c_str());
}
else if(CFlash_Mode == ADDON_CFLASH_MODE_Path)
{
sFlashPath = CFlash_Path;
INFO("Using CFlash directory: %s\n", sFlashPath.c_str());
}
else if(CFlash_Mode == ADDON_CFLASH_MODE_File)
{
sFlashPath = CFlash_Path;
INFO("Using CFlash disk image file %s\n", sFlashPath.c_str());
}
else
{
return FALSE;
}
if (sFlashPath == "") return FALSE;
if(CFlash_IsUsingPath())
{
cflashDeviceEnabled = FALSE;
currLBA = 0;
fileStartLBA = fileEndLBA = 0xFFFFFFFF;
VFAT vfat;
bool ret = vfat.build(sFlashPath.c_str(),16); //allocate 16MB extra for writing. this is probably enough for anyone, but maybe it should be configurable.
//we could always suggest to users to add a big file to their directory to overwrite (that would cause the image to get padded)
if(!ret)
{
CFLASHLOG("FAILED cflash_build_fat\n");
return FALSE;
}
file = vfat.detach();
cf_reg_sts = 0x58; // READY
cflashDeviceEnabled = TRUE;
init_good = TRUE;
}
else
{
file = new EMUFILE_FILE(sFlashPath.c_str(),"rb+");
if(file->fail())
{
INFO("Failed to open file %s\n", sFlashPath.c_str());
delete file;
file = NULL;
}
}
// READY
cf_reg_sts = 0x58;
currLBA = 0;
cf_reg_lba1 = cf_reg_lba2 =
cf_reg_lba3 = cf_reg_lba4 = 0;
inited = TRUE;
return init_good;
}
static unsigned int cflash_read(unsigned int address)
{
unsigned int ret_value = 0;
size_t elems_read = 0;
switch (address)
{
case CF_REG_STS:
ret_value = cf_reg_sts;
break;
case CF_REG_DATA:
if (cf_reg_cmd == CF_CMD_READ)
{
if(file)
{
u8 data[2] = {0,0};
file->fseek(currLBA, SEEK_SET);
elems_read += file->fread(data,2);
ret_value = data[1] << 8 | data[0];
}
currLBA += 2;
}
break;
case CF_REG_CMD:
break;
case CF_REG_LBA1:
ret_value = cf_reg_lba1;
break;
}
return ret_value;
}
static void cflash_write(unsigned int address,unsigned int data)
{
static u8 sector_data[512];
static u32 sector_write_index = 0;
switch (address)
{
case CF_REG_STS:
cf_reg_sts = data&0xFFFF;
break;
case CF_REG_DATA:
if (cf_reg_cmd == CF_CMD_WRITE)
{
{
sector_data[sector_write_index] = (data >> 0) & 0xff;
sector_data[sector_write_index + 1] = (data >> 8) & 0xff;
sector_write_index += 2;
if (sector_write_index == 512)
{
CFLASHLOG( "Write sector to %ld\n", currLBA);
size_t written = 0;
if(file)
if(currLBA + 512 < file->size())
{
file->fseek(currLBA,SEEK_SET);
while(written < 512)
{
size_t todo = 512-written;
file->fwrite(&sector_data[written], todo);
size_t cur_write = todo;
written += cur_write;
if ( cur_write == (size_t)-1) break;
}
}
CFLASHLOG("Wrote %u bytes\n", written);
currLBA += 512;
sector_write_index = 0;
}
}
}
break;
case CF_REG_CMD:
cf_reg_cmd = data&0xFF;
cf_reg_sts = 0x58; // READY
break;
case CF_REG_LBA1:
cf_reg_lba1 = data&0xFF;
currLBA = (currLBA&0xFFFFFF00)| cf_reg_lba1;
break;
case CF_REG_LBA2:
cf_reg_lba2 = data&0xFF;
currLBA = (currLBA&0xFFFF00FF)|(cf_reg_lba2<<8);
break;
case CF_REG_LBA3:
cf_reg_lba3 = data&0xFF;
currLBA = (currLBA&0xFF00FFFF)|(cf_reg_lba3<<16);
break;
case CF_REG_LBA4:
cf_reg_lba4 = data&0xFF;
if ((cf_reg_lba4 & 0xf0) == CF_CMD_LBA)
{
currLBA = (currLBA&0x00FFFFFF)|((cf_reg_lba4&0x0F)<<24);
currLBA *= 512;
sector_write_index = 0;
}
break;
}
}
static void cflash_close( void)
{
if (!inited) return;
if(file) delete file;
cflashDeviceEnabled = FALSE;
file = NULL;
inited = FALSE;
}
class Slot2_CFlash : public ISlot2Interface
{
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("MPCF Flash Card Device", "MPCF Flash Card Device", 0x01);
return &info;
}
virtual void connect()
{
cflash_close();
cflash_init();
}
virtual void disconnect()
{
cflash_close();
}
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val) { cflash_write(addr, val); }
virtual void writeWord(u8 PROCNUM, u32 addr, u16 val) { cflash_write(addr, val); }
virtual void writeLong(u8 PROCNUM, u32 addr, u32 val) { cflash_write(addr, val); }
virtual u8 readByte(u8 PROCNUM, u32 addr) { return (cflash_read(addr)); }
virtual u16 readWord(u8 PROCNUM, u32 addr) { return (cflash_read(addr)); }
virtual u32 readLong(u8 PROCNUM, u32 addr) { return (cflash_read(addr)); }
};
ISlot2Interface* construct_Slot2_CFlash() { return new Slot2_CFlash(); }

View File

@ -0,0 +1,31 @@
/*
Copyright (C) 2009 CrazyMax
Copyright (C) 2009-2013 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
class Slot2_None : public ISlot2Interface
{
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("None", "Slot2 no-device emulation", 0xFF);
return &info;
}
};
ISlot2Interface* construct_Slot2_None() { return new Slot2_None(); }

View File

@ -0,0 +1,143 @@
/*
Copyright (C) 2011-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
/*
this device seems to have a 12bit value (like 20.12 fixed point.. get it?) located at 0x0A000000
clockwise = right = increases.
it returns the correct little endian bytes through byte reads.
through halfword reads, it returns the LSB twice
through full word reads, it returns the LSB four times.
after that everything is 0x00.
if the slot2 timings are wrong, then this device will return glitchy or 0xFF output.
so this emulation code will attempt to validate that.
arkanoid was setting REG_EXMEMCNT = 0x082F
the rom returns 0xEFFF for all addresses and should be used to detect this device
writing any byte to SRAM or writing any halfword/word to rom results in a reset or some kind of recalibrate
the resulting value may be 0x000,0x001, or 0xFFF. seems mostly random, though once it is reset, resetting again won't change it.
you must wait until the paddle has been moved.
conclusion:
The emulation in all the handling of erroneous cases is not perfect, and some other users of the paddle (do any other games use it?)
maybe legally configure the paddle differently, which could be rejected here; in which case this code will need finetuning
*/
#include <string.h>
#include "../slot2.h"
#include "../NDSSystem.h"
class Slot2_Paddle : public ISlot2Interface
{
private:
void calibrate() { nds.paddle = 0; }
bool Validate(u32 procnum, bool rom)
{
if(rom)
return ValidateSlot2Access(procnum, 0, 0, 0, -1);
else
return ValidateSlot2Access(procnum, 18, 0, 0, 1);
}
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Paddle Controller", "Taito Paddle Controller", 0x07);
return &info;
}
virtual void writeByte(u8 PROCNUM, u32 addr, u8 val)
{
if (addr < 0x0A000000)
calibrate();
}
virtual void writeWord(u8 PROCNUM, u32 addr, u16 val)
{
if (addr < 0x0A000000)
calibrate();
}
virtual void writeLong(u8 PROCNUM, u32 addr, u32 val)
{
if (addr < 0x0A000000)
calibrate();
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
//printf("paddle: read 08 at 0x%08X\n", addr);
if (!Validate(PROCNUM, (addr < 0x0A000000)))
return 0xFF;
if (addr < 0x0A000000)
return (addr & 1)?0xFF:0xEF;
if (addr == 0x0A000000)
return (nds.paddle & 0xFF);
if (addr == 0x0A000001)
return ((nds.paddle >> 8) & 0x0F);
return 0x00;
}
virtual u16 readWord(u8 PROCNUM, u32 addr)
{
//printf("paddle: read 16 at 0x%08X\n", addr);
if (!Validate(PROCNUM, (addr < 0x0A000000)))
return 0xFFFF;
if (addr < 0x0A000000)
return 0xEFFF;
if (addr == 0x0A000000)
{
u8 val = (nds.paddle & 0xFF);
return (val | (val << 8));
}
return 0x0000;
}
virtual u32 readLong(u8 PROCNUM, u32 addr)
{
//printf("paddle: read 32 at 0x%08X\n", addr);
if (!Validate(PROCNUM, (addr < 0x0A000000)))
return 0xFFFFFFFF;
if (addr < 0x0A000000)
return 0xEFFFEFFF;
if (addr == 0x0A000000)
{
u8 val = (nds.paddle & 0xFF);
return (val | (val << 8) | (val << 16) | (val << 24));
}
return 0x00000000;
}
};
u16 Paddle_GetValue()
{
return nds.paddle;
}
void Paddle_SetValue(u16 theValue)
{
nds.paddle = theValue;
}
ISlot2Interface* construct_Slot2_Paddle() { return new Slot2_Paddle(); }

View File

@ -0,0 +1,56 @@
/*
Copyright (C) 2013-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
#include "../NDSSystem.h"
class Slot2_PassME : public ISlot2Interface
{
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("PassME", "PassME in GBA slot", 0x08);
return &info;
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
u32 tmp_addr = (addr & 0x07FFFFFF);
if (tmp_addr < gameInfo.romsize)
return (u8)gameInfo.readROM(tmp_addr);
return (0xFF);
}
virtual u16 readWord(u8 PROCNUM, u32 addr)
{
u32 tmp_addr = (addr & 0x07FFFFFF);
if (tmp_addr < gameInfo.romsize)
return (u16)gameInfo.readROM(tmp_addr);
return (0xFFFF);
}
virtual u32 readLong(u8 PROCNUM, u32 addr)
{
u32 tmp_addr = (addr & 0x07FFFFFF);
if (tmp_addr < gameInfo.romsize)
return (u32)gameInfo.readROM(tmp_addr);
return (0xFFFFFFFF);
}
};
ISlot2Interface* construct_Slot2_PassME() { return new Slot2_PassME(); }

View File

@ -0,0 +1,122 @@
/*
Copyright (C) 2010-2013 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
static u16 pianoKeyStatus = 0;
class Slot2_EasyPiano : public ISlot2Interface
{
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Piano", "Piano for EasyPiano", 0x06);
return &info;
}
virtual void connect()
{
pianoKeyStatus = 0xE7FF;
}
virtual u8 readByte(u8 PROCNUM, u32 addr)
{
//printf("piano: read 08 at 0x%08X\n", adr);
//the actual keyboard output
//byte:bit
//0x09FFFFFE:0 = C
//0x09FFFFFE:1 = C#
//0x09FFFFFE:2 = D
//0x09FFFFFE:3 = D#
//0x09FFFFFE:4 = E
//0x09FFFFFE:5 = F
//0x09FFFFFE:6 = F#
//0x09FFFFFE:7 = G
//0x09FFFFFF:0 = G#
//0x09FFFFFF:1 = A
//0x09FFFFFF:2 = A#
//0x09FFFFFF:3 = ?
//0x09FFFFFF:4 = ?
//0x09FFFFFF:5 = B
//0x09FFFFFF:6 = hiC
//0x09FFFFFF:7 = ?
//deassert bit if key is pressed
//LOG("PIANO: %04X\n",pianoKeyStatus);
if (addr == 0x09FFFFFE) return ((pianoKeyStatus >> 0) & 0xFF);
if (addr == 0x09FFFFFF) return ((pianoKeyStatus >> 8) & 0xFF) & ~(0x18);
return (addr & 1) ? 0xE7 : 0xFF;
}
virtual u16 readWord(u8 PROCNUM, u32 addr)
{
if (addr != 0x09FFFFFE)
return 0xE7FF;
return readByte(PROCNUM, 0x09FFFFFE) | (readByte(PROCNUM,0x09FFFFFF) << 8);
}
virtual u32 readLong(u8 PROCNUM, u32 addr) { return 0xE7FFE7FF; }
};
ISlot2Interface* construct_Slot2_EasyPiano() { return new Slot2_EasyPiano(); }
void piano_setKey(bool c, bool cs, bool d, bool ds, bool e, bool f, bool fs, bool g, bool gs, bool a, bool as, bool b, bool hic)
{
//0x09FFFFFE:0 = C
//0x09FFFFFE:1 = C#
//0x09FFFFFE:2 = D
//0x09FFFFFE:3 = D#
//0x09FFFFFE:4 = E
//0x09FFFFFE:5 = F
//0x09FFFFFE:6 = F#
//0x09FFFFFE:7 = G
//0x09FFFFFE:0 = G#
//0x09FFFFFE:1 = A
//0x09FFFFFF:2 = A#
//0x09FFFFFF:3 = ?
//0x09FFFFFF:4 = ?
//0x09FFFFFF:5 = B
//0x09FFFFFF:6 = hiC
//0x09FFFFFF:7 = ?
#define BIT_P(N,v) ((v)?(1<<(N)):0)
pianoKeyStatus = ~(
BIT_P(0,c) |
BIT_P(1,cs) |
BIT_P(2,d) |
BIT_P(3,ds) |
BIT_P(4,e) |
BIT_P(5,f) |
BIT_P(6,fs) |
BIT_P(7,g) |
BIT_P(8,gs) |
BIT_P(9,a) |
BIT_P(10,as) |
BIT_P(13,b) |
BIT_P(14,hic)
);
}
void piano_setKey(u16 theKeys)
{
pianoKeyStatus = theKeys;
}

View File

@ -0,0 +1,62 @@
/*
Copyright (C) 2009 CrazyMax
Copyright (C) 2009-2013 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../slot2.h"
void (*FeedbackON)(bool enable) = NULL;
class Slot2_RumblePak : public ISlot2Interface
{
private:
u16 old_val_rumble;
public:
virtual Slot2Info const* info()
{
static Slot2InfoSimple info("Rumble Pak", "NDS Rumble Pak (need joystick with Feedback)", 0x02);
return &info;
}
virtual void connect()
{
old_val_rumble = 0;
if (!FeedbackON) return;
FeedbackON(false);
}
virtual void disconnect()
{
FeedbackON(false);
}
virtual void writeWord(u8 PROCNUM, u32 addr, u16 val)
{
if (!FeedbackON) return;
if (old_val_rumble == val) return;
old_val_rumble = val;
if ((addr == 0x08000000) || (addr == 0x08001000))
FeedbackON(val);
}
virtual u8 readByte(u8 PROCNUM, u32 addr) { return (addr & 1)?0xFF:0xFD; };
virtual u16 readWord(u8 PROCNUM, u32 addr) { return 0xFFFD; };
virtual u32 readLong(u8 PROCNUM, u32 addr) { return 0xFFFDFFFD; };
};
ISlot2Interface* construct_Slot2_RumblePak() { return new Slot2_RumblePak(); }

File diff suppressed because it is too large Load Diff

4478
desmume/src/arm_jit.cpp Normal file

File diff suppressed because it is too large Load Diff

82
desmume/src/arm_jit.h Normal file
View File

@ -0,0 +1,82 @@
/* Copyright (C) 2006 yopyop
Copyright (C) 2011 Loren Merritt
Copyright (C) 2012-2013 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ARM_JIT
#define ARM_JIT
#include "types.h"
#ifndef _MSC_VER
#include <stdint.h>
#endif
typedef u32 (FASTCALL* ArmOpCompiled)();
void arm_jit_reset(bool enable, bool suppress_msg = false);
void arm_jit_close();
void arm_jit_sync();
template<int PROCNUM> u32 arm_jit_compile();
//#define MAPPED_JIT_FUNCS: to define or not to define?
//* x86 windows seems faster with NON-DEFINED
//* x64 windows seems faster with DEFINED
//* x86 windows seems to have problems without DEFINED when desmume is built as a dll due to the
// ~300 MB .bss section created by the 256MB non-mapped compiled_funcs table
// (when loaded as a dll into a busy process, that much contiguous address space is hard to find. No big deal when starting up a process)
//In principle, mapped compiled_funcs should be faster because it avoids some bit shifting logic to look it up from the memory map, right,
//but I guess it doesn't always work out that way.
//
//So here's my proposed policy. NON-DEFINED is dangerous due to the huge .bss section, so it should be the default
//The build system should #define JIT_FUNCS_FLAT to make the flat array
#ifndef JIT_FUNCS_FLAT
#define MAPPED_JIT_FUNCS
#endif
#ifdef MAPPED_JIT_FUNCS
struct JIT_struct
{
// only include the memory types that code can execute from
uintptr_t MAIN_MEM[16*1024*1024/2];
uintptr_t SWIRAM[0x8000/2];
uintptr_t ARM9_ITCM[0x8000/2];
uintptr_t ARM9_LCDC[0xA4000/2];
uintptr_t ARM9_BIOS[0x8000/2];
uintptr_t ARM7_BIOS[0x4000/2];
uintptr_t ARM7_ERAM[0x10000/2];
uintptr_t ARM7_WIRAM[0x10000/2];
uintptr_t ARM7_WRAM[0x40000/2];
static uintptr_t *JIT_MEM[2][0x4000];
};
extern CACHE_ALIGN JIT_struct JIT;
#define JIT_COMPILED_FUNC(adr, PROCNUM) JIT.JIT_MEM[PROCNUM][((adr)&0x0FFFC000)>>14][((adr)&0x00003FFE)>>1]
#define JIT_COMPILED_FUNC_PREMASKED(adr, PROCNUM, ofs) JIT.JIT_MEM[PROCNUM][(adr)>>14][(((adr)&0x00003FFE)>>1)+ofs]
#define JIT_COMPILED_FUNC_KNOWNBANK(adr, bank, mask, ofs) JIT.bank[(((adr)&(mask))>>1)+ofs]
#define JIT_MAPPED(adr, PROCNUM) JIT.JIT_MEM[PROCNUM][(adr)>>14]
#else
// actually an array of function pointers, but they fit in 32bit address space, so might as well save memory
extern uintptr_t compiled_funcs[];
// there isn't anything mapped between 07000000 and 0EFFFFFF, so we can mask off bit 27 and get away with a smaller array
#define JIT_COMPILED_FUNC(adr, PROCNUM) compiled_funcs[((adr) & 0x07FFFFFE) >> 1]
#define JIT_COMPILED_FUNC_PREMASKED(adr, PROCNUM, ofs) JIT_COMPILED_FUNC(adr+(ofs<<1), PROCNUM)
#define JIT_COMPILED_FUNC_KNOWNBANK(adr, bank, mask, ofs) JIT_COMPILED_FUNC(adr+(ofs<<1), PROCNUM)
#define JIT_MAPPED(adr, PROCNUM) true
#endif
extern u32 saveBlockSizeJIT;
#endif

776
desmume/src/armcpu.cpp Normal file
View File

@ -0,0 +1,776 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2009-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <algorithm>
#include "armcpu.h"
#include "instructions.h"
#include "cp15.h"
#include "bios.h"
#include "debug.h"
#include "NDSSystem.h"
#include "MMU_timing.h"
#include "utils/bits.h"
#ifdef HAVE_LUA
#include "lua-engine.h"
#endif
#ifdef TARGET_INTERFACE
#include "frontend/interface/interface.h"
#endif
#ifdef HAVE_JIT
#include "arm_jit.h"
#endif
template<u32> static u32 armcpu_prefetch();
FORCEINLINE u32 armcpu_prefetch(armcpu_t *armcpu) {
if(armcpu->proc_ID==0) return armcpu_prefetch<0>();
else return armcpu_prefetch<1>();
}
armcpu_t NDS_ARM7;
armcpu_t NDS_ARM9;
#define SWAP(a, b, c) do \
{ \
c=a; \
a=b; \
b=c; \
} \
while(0)
#define STALLED_CYCLE_COUNT 10
static void
stall_cpu( void *instance) {
armcpu_t *armcpu = (armcpu_t *)instance;
printf("STALL\n");
armcpu->stalled = 1;
}
static void
unstall_cpu( void *instance) {
armcpu_t *armcpu = (armcpu_t *)instance;
printf("UNSTALL\n");
armcpu->stalled = 0;
}
static void
install_post_exec_fn( void *instance,
void (*ex_fn)( void *, u32 adr, int thumb),
void *fn_data) {
armcpu_t *armcpu = (armcpu_t *)instance;
armcpu->post_ex_fn = ex_fn;
armcpu->post_ex_fn_data = fn_data;
}
static void
remove_post_exec_fn( void *instance) {
armcpu_t *armcpu = (armcpu_t *)instance;
armcpu->post_ex_fn = NULL;
}
static u32 read_cpu_reg( void *instance, u32 reg_num)
{
armcpu_t *armcpu = (armcpu_t *)instance;
if ( reg_num <= 14) {
return armcpu->R[reg_num];
}
else if ( reg_num == 15) {
return armcpu->instruct_adr;
}
else if ( reg_num == 16) {
//CPSR
return armcpu->CPSR.val;
}
return 0;
}
static void
set_cpu_reg( void *instance, u32 reg_num, u32 value) {
armcpu_t *armcpu = (armcpu_t *)instance;
if ( reg_num <= 14) {
armcpu->R[reg_num] = value;
}
else if ( reg_num == 15) {
armcpu->next_instruction = value;
}
else if ( reg_num == 16) {
/* FIXME: setting the CPSR */
}
}
int armcpu_new( armcpu_t *armcpu, u32 id)
{
armcpu->proc_ID = id;
armcpu->stalled = 0;
armcpu->base_mem_if.prefetch32 = NULL;
armcpu->base_mem_if.prefetch16 = NULL;
armcpu->base_mem_if.read8 = NULL;
armcpu->base_mem_if.read16 = NULL;
armcpu->base_mem_if.read32 = NULL;
armcpu->base_mem_if.write8 = NULL;
armcpu->base_mem_if.write16 = NULL;
armcpu->base_mem_if.write32 = NULL;
armcpu->base_mem_if.data = NULL;
armcpu_SetControlInterface(armcpu, &arm_default_ctrl_iface);
armcpu_SetControlInterfaceData(armcpu, armcpu);
armcpu_SetCurrentMemoryInterface(armcpu, NULL);
armcpu_SetCurrentMemoryInterfaceData(armcpu, NULL);
armcpu->post_ex_fn = NULL;
armcpu->post_ex_fn_data = NULL;
armcpu->breakPoints = new std::vector<u32>;
armcpu_init(armcpu, 0);
return 0;
}
void armcpu_SetControlInterface(armcpu_t *armcpu, const armcpu_ctrl_iface *theControlInterface)
{
armcpu->ctrl_iface = *theControlInterface;
}
armcpu_ctrl_iface* armcpu_GetControlInterface(armcpu_t *armcpu)
{
return &armcpu->ctrl_iface;
}
void armcpu_SetControlInterfaceData(armcpu_t *armcpu, void *theData)
{
armcpu->ctrl_iface.data = theData;
}
void* armcpu_GetControlInterfaceData(const armcpu_t *armcpu)
{
return armcpu->ctrl_iface.data;
}
void armcpu_SetCurrentMemoryInterface(armcpu_t *armcpu, armcpu_memory_iface *theMemoryInterface)
{
armcpu->mem_if = theMemoryInterface;
}
armcpu_memory_iface* armcpu_GetCurrentMemoryInterface(const armcpu_t *armcpu)
{
return armcpu->mem_if;
}
void armcpu_SetCurrentMemoryInterfaceData(armcpu_t *armcpu, void *theData)
{
if (armcpu->mem_if != NULL)
{
armcpu->mem_if->data = theData;
}
}
void* armcpu_GetCurrentMemoryInterfaceData(const armcpu_t *armcpu)
{
return (armcpu->mem_if != NULL) ? armcpu->mem_if->data : NULL;
}
void armcpu_SetBaseMemoryInterface(armcpu_t *armcpu, const armcpu_memory_iface *theMemInterface)
{
armcpu->base_mem_if = *theMemInterface;
}
armcpu_memory_iface* armcpu_GetBaseMemoryInterface(armcpu_t *armcpu)
{
return &armcpu->base_mem_if;
}
void armcpu_SetBaseMemoryInterfaceData(armcpu_t *armcpu, void *theData)
{
armcpu->base_mem_if.data = theData;
}
void* armcpu_GetBaseMemoryInterfaceData(const armcpu_t *armcpu)
{
return armcpu->base_mem_if.data;
}
void armcpu_ResetMemoryInterfaceToBase(armcpu_t *armcpu)
{
armcpu_SetCurrentMemoryInterface(armcpu, armcpu_GetBaseMemoryInterface(armcpu));
armcpu_SetCurrentMemoryInterfaceData(armcpu, armcpu_GetBaseMemoryInterfaceData(armcpu));
}
//call this whenever CPSR is changed (other than CNVZQ or T flags); interrupts may need to be unleashed
void armcpu_changeCPSR()
{
//but all it does is give them a chance to unleash by forcing an immediate reschedule
//TODO - we could actually set CPSR through here and look for a change in the I bit
//that would be a little optimization as well as a safety measure if we prevented setting CPSR directly
NDS_Reschedule();
}
void armcpu_init(armcpu_t *armcpu, u32 adr)
{
#if defined(_M_X64) || defined(__x86_64__)
memcpy(&armcpu->cond_table[0], &arm_cond_table[0], sizeof(arm_cond_table));
#endif
armcpu->LDTBit = (armcpu->proc_ID==0); //set ARMv5 style bit--different for each processor
armcpu->intVector = 0xFFFF0000 * (armcpu->proc_ID==0);
armcpu->freeze = CPU_FREEZE_NONE;
armcpu->intrWaitARM_state = 0;
//#ifdef GDB_STUB
// armcpu->irq_flag = 0;
//#endif
for(int i = 0; i < 16; ++i)
armcpu->R[i] = 0;
armcpu->CPSR.val = armcpu->SPSR.val = SYS;
armcpu->R13_usr = armcpu->R14_usr = 0;
armcpu->R13_svc = armcpu->R14_svc = 0;
armcpu->R13_abt = armcpu->R14_abt = 0;
armcpu->R13_und = armcpu->R14_und = 0;
armcpu->R13_irq = armcpu->R14_irq = 0;
armcpu->R8_fiq = armcpu->R9_fiq = armcpu->R10_fiq = armcpu->R11_fiq = armcpu->R12_fiq = armcpu->R13_fiq = armcpu->R14_fiq = 0;
armcpu->SPSR_svc.val = armcpu->SPSR_abt.val = armcpu->SPSR_und.val = armcpu->SPSR_irq.val = armcpu->SPSR_fiq.val = 0;
//#ifdef GDB_STUB
// armcpu->instruct_adr = adr;
// armcpu->R[15] = adr + 8;
//#else
//armcpu->R[15] = adr;
//#endif
//do something sensible when booting up to a thumb address
armcpu->next_instruction = adr & ~1;
armcpu->CPSR.bits.T = BIT0(adr);
//#ifndef GDB_STUB
armcpu_prefetch(armcpu);
//#endif
}
u32 armcpu_switchMode(armcpu_t *armcpu, u8 mode)
{
u32 oldmode = armcpu->CPSR.bits.mode;
switch(oldmode)
{
case USR :
case SYS :
armcpu->R13_usr = armcpu->R[13];
armcpu->R14_usr = armcpu->R[14];
break;
case FIQ :
{
u32 tmp;
SWAP(armcpu->R[8], armcpu->R8_fiq, tmp);
SWAP(armcpu->R[9], armcpu->R9_fiq, tmp);
SWAP(armcpu->R[10], armcpu->R10_fiq, tmp);
SWAP(armcpu->R[11], armcpu->R11_fiq, tmp);
SWAP(armcpu->R[12], armcpu->R12_fiq, tmp);
armcpu->R13_fiq = armcpu->R[13];
armcpu->R14_fiq = armcpu->R[14];
armcpu->SPSR_fiq = armcpu->SPSR;
break;
}
case IRQ :
armcpu->R13_irq = armcpu->R[13];
armcpu->R14_irq = armcpu->R[14];
armcpu->SPSR_irq = armcpu->SPSR;
break;
case SVC :
armcpu->R13_svc = armcpu->R[13];
armcpu->R14_svc = armcpu->R[14];
armcpu->SPSR_svc = armcpu->SPSR;
break;
case ABT :
armcpu->R13_abt = armcpu->R[13];
armcpu->R14_abt = armcpu->R[14];
armcpu->SPSR_abt = armcpu->SPSR;
break;
case UND :
armcpu->R13_und = armcpu->R[13];
armcpu->R14_und = armcpu->R[14];
armcpu->SPSR_und = armcpu->SPSR;
break;
default :
break;
}
switch(mode)
{
case USR :
case SYS :
armcpu->R[13] = armcpu->R13_usr;
armcpu->R[14] = armcpu->R14_usr;
//SPSR = CPSR;
break;
case FIQ :
{
u32 tmp;
SWAP(armcpu->R[8], armcpu->R8_fiq, tmp);
SWAP(armcpu->R[9], armcpu->R9_fiq, tmp);
SWAP(armcpu->R[10], armcpu->R10_fiq, tmp);
SWAP(armcpu->R[11], armcpu->R11_fiq, tmp);
SWAP(armcpu->R[12], armcpu->R12_fiq, tmp);
armcpu->R[13] = armcpu->R13_fiq;
armcpu->R[14] = armcpu->R14_fiq;
armcpu->SPSR = armcpu->SPSR_fiq;
break;
}
case IRQ :
armcpu->R[13] = armcpu->R13_irq;
armcpu->R[14] = armcpu->R14_irq;
armcpu->SPSR = armcpu->SPSR_irq;
break;
case SVC :
armcpu->R[13] = armcpu->R13_svc;
armcpu->R[14] = armcpu->R14_svc;
armcpu->SPSR = armcpu->SPSR_svc;
break;
case ABT :
armcpu->R[13] = armcpu->R13_abt;
armcpu->R[14] = armcpu->R14_abt;
armcpu->SPSR = armcpu->SPSR_abt;
break;
case UND :
armcpu->R[13] = armcpu->R13_und;
armcpu->R[14] = armcpu->R14_und;
armcpu->SPSR = armcpu->SPSR_und;
break;
default :
printf("switchMode: WRONG mode %02X\n",mode);
break;
}
armcpu->CPSR.bits.mode = mode & 0x1F;
armcpu_changeCPSR();
return oldmode;
}
u32 armcpu_Wait4IRQ(armcpu_t *cpu)
{
cpu->freeze = (CPU_FREEZE_WAIT_IRQ | CPU_FREEZE_IE_IF);
return 1;
}
template<u32 PROCNUM>
FORCEINLINE static u32 armcpu_prefetch()
{
armcpu_t* const armcpu = &ARMPROC;
//#ifdef GDB_STUB
// u32 temp_instruction;
//#endif
u32 curInstruction = armcpu->next_instruction;
if(armcpu->CPSR.bits.T == 0)
{
//#ifdef GDB_STUB
// temp_instruction =
// armcpu->mem_if->prefetch32( armcpu->mem_if->data,
// armcpu->next_instruction);
//
// if ( !armcpu->stalled) {
// armcpu->instruction = temp_instruction;
// armcpu->instruct_adr = armcpu->next_instruction;
// armcpu->next_instruction += 4;
// armcpu->R[15] = armcpu->next_instruction + 4;
// }
//#else
curInstruction &= 0xFFFFFFFC; //please don't change this to 0x0FFFFFFC -- the NDS will happily run on 0xF******* addresses all day long
//please note that we must setup R[15] before reading the instruction since there is a protection
//which prevents PC > 0x3FFF from reading the bios region
armcpu->instruct_adr = curInstruction;
armcpu->next_instruction = curInstruction + 4;
armcpu->R[15] = curInstruction + 8;
armcpu->instruction = _MMU_read32<PROCNUM, MMU_AT_CODE>(curInstruction);
//#endif
return MMU_codeFetchCycles<PROCNUM,32>(curInstruction);
}
//#ifdef GDB_STUB
// temp_instruction =
// armcpu->mem_if->prefetch16( armcpu->mem_if->data,
// armcpu->next_instruction);
//
// if ( !armcpu->stalled) {
// armcpu->instruction = temp_instruction;
// armcpu->instruct_adr = armcpu->next_instruction;
// armcpu->next_instruction = armcpu->next_instruction + 2;
// armcpu->R[15] = armcpu->next_instruction + 2;
// }
//#else
curInstruction &= 0xFFFFFFFE; //please don't change this to 0x0FFFFFFE -- the NDS will happily run on 0xF******* addresses all day long
//please note that we must setup R[15] before reading the instruction since there is a protection
//which prevents PC > 0x3FFF from reading the bios region
armcpu->instruct_adr = curInstruction;
armcpu->next_instruction = curInstruction + 2;
armcpu->R[15] = curInstruction + 4;
armcpu->instruction = _MMU_read16<PROCNUM, MMU_AT_CODE>(curInstruction);
//#endif
if(PROCNUM==0)
{
// arm9 fetches 2 instructions at a time in thumb mode
if(!(curInstruction == armcpu->instruct_adr + 2 && (curInstruction & 2)))
return MMU_codeFetchCycles<PROCNUM,32>(curInstruction);
else
return 0;
}
return MMU_codeFetchCycles<PROCNUM,16>(curInstruction);
}
#if 0 /* not used */
static BOOL FASTCALL test_EQ(Status_Reg CPSR) { return ( CPSR.bits.Z); }
static BOOL FASTCALL test_NE(Status_Reg CPSR) { return (!CPSR.bits.Z); }
static BOOL FASTCALL test_CS(Status_Reg CPSR) { return ( CPSR.bits.C); }
static BOOL FASTCALL test_CC(Status_Reg CPSR) { return (!CPSR.bits.C); }
static BOOL FASTCALL test_MI(Status_Reg CPSR) { return ( CPSR.bits.N); }
static BOOL FASTCALL test_PL(Status_Reg CPSR) { return (!CPSR.bits.N); }
static BOOL FASTCALL test_VS(Status_Reg CPSR) { return ( CPSR.bits.V); }
static BOOL FASTCALL test_VC(Status_Reg CPSR) { return (!CPSR.bits.V); }
static BOOL FASTCALL test_HI(Status_Reg CPSR) { return (CPSR.bits.C) && (!CPSR.bits.Z); }
static BOOL FASTCALL test_LS(Status_Reg CPSR) { return (CPSR.bits.Z) || (!CPSR.bits.C); }
static BOOL FASTCALL test_GE(Status_Reg CPSR) { return (CPSR.bits.N==CPSR.bits.V); }
static BOOL FASTCALL test_LT(Status_Reg CPSR) { return (CPSR.bits.N!=CPSR.bits.V); }
static BOOL FASTCALL test_GT(Status_Reg CPSR) { return (!CPSR.bits.Z) && (CPSR.bits.N==CPSR.bits.V); }
static BOOL FASTCALL test_LE(Status_Reg CPSR) { return ( CPSR.bits.Z) || (CPSR.bits.N!=CPSR.bits.V); }
static BOOL FASTCALL test_AL(Status_Reg CPSR) { return 1; }
static BOOL (FASTCALL* test_conditions[])(Status_Reg CPSR)= {
test_EQ , test_NE ,
test_CS , test_CC ,
test_MI , test_PL ,
test_VS , test_VC ,
test_HI , test_LS ,
test_GE , test_LT ,
test_GT , test_LE ,
test_AL
};
#define TEST_COND2(cond, CPSR) \
(cond<15&&test_conditions[cond](CPSR))
#endif
//TODO - merge with armcpu_irqException?
//http://www.ethernut.de/en/documents/arm-exceptions.html
//http://docs.google.com/viewer?a=v&q=cache:V4ht1YkxprMJ:www.cs.nctu.edu.tw/~wjtsai/EmbeddedSystemDesign/Ch3-1.pdf+arm+exception+handling&hl=en&gl=us&pid=bl&srcid=ADGEEShx9VTHbUhWdDOrTVRzLkcCsVfJiijncNDkkgkrlJkLa7D0LCpO8fQ_hhU3DTcgZh9rcZWWQq4TYhhCovJ625h41M0ZUX3WGasyzWQFxYzDCB-VS6bsUmpoJnRxAc-bdkD0qmsu&sig=AHIEtbR9VHvDOCRmZFQDUVwy53iJDjoSPQ
void armcpu_exception(armcpu_t *cpu, u32 number)
{
Mode cpumode = USR;
switch(number)
{
case EXCEPTION_RESET: cpumode = SVC; break;
case EXCEPTION_UNDEFINED_INSTRUCTION: cpumode = UND; break;
case EXCEPTION_SWI: cpumode = SVC; break;
case EXCEPTION_PREFETCH_ABORT: cpumode = ABT; break;
case EXCEPTION_DATA_ABORT: cpumode = ABT; break;
case EXCEPTION_RESERVED_0x14: emu_halt(EMUHALT_REASON_ARM_RESERVED_0X14_EXCEPTION, (cpu->proc_ID == ARMCPU_ARM9) ? NDSErrorTag_ARM9 : NDSErrorTag_ARM7); break;
case EXCEPTION_IRQ: cpumode = IRQ; break;
case EXCEPTION_FAST_IRQ: cpumode = FIQ; break;
}
Status_Reg tmp = cpu->CPSR;
armcpu_switchMode(cpu, cpumode); //enter new mode
cpu->R[14] = cpu->next_instruction;
cpu->SPSR = tmp; //save old CPSR as new SPSR
cpu->CPSR.bits.T = 0; //handle as ARM32 code
cpu->CPSR.bits.I = 1;
armcpu_changeCPSR();
cpu->R[15] = cpu->intVector + number;
cpu->next_instruction = cpu->R[15];
printf("armcpu_exception!\n");
//extern bool dolog;
//dolog=true;
//HOW DOES THIS WORTK WITHOUT A PREFETCH, LIKE IRQ BELOW?
//I REALLY WISH WE DIDNT PREFETCH BEFORE EXECUTING
}
BOOL armcpu_irqException(armcpu_t *armcpu)
{
Status_Reg tmp;
//TODO - remove GDB specific code
//#ifdef GDB_STUB
// armcpu->irq_flag = 0;
//#endif
tmp = armcpu->CPSR;
armcpu_switchMode(armcpu, IRQ);
//TODO - remove GDB specific code
//#ifdef GDB_STUB
// armcpu->R[14] = armcpu->next_instruction + 4;
//#else
armcpu->R[14] = armcpu->instruct_adr + 4;
//#endif
armcpu->SPSR = tmp;
armcpu->CPSR.bits.T = 0;
armcpu->CPSR.bits.I = 1;
armcpu->next_instruction = armcpu->intVector + 0x18;
armcpu->freeze &= ~CPU_FREEZE_IRQ_IE_IF;
//must retain invariant of having next instruction to be executed prefetched
//(yucky)
armcpu_prefetch(armcpu);
return TRUE;
}
//TODO - remove GDB specific code
//BOOL
//armcpu_flagIrq( armcpu_t *armcpu) {
// if(armcpu->CPSR.bits.I) return FALSE;
//
// armcpu->waitIRQ = 0;
//
//#ifdef GDB_STUB
// armcpu->irq_flag = 1;
//#endif
//
// return TRUE;
//}
u32 TRAPUNDEF(armcpu_t* cpu)
{
INFO("ARM%c: Undefined instruction: 0x%08X PC=0x%08X\n", cpu->proc_ID?'7':'9', cpu->instruction, cpu->instruct_adr);
if (((cpu->intVector != 0) ^ (cpu->proc_ID == ARMCPU_ARM9)))
{
armcpu_exception(&NDS_ARM9,EXCEPTION_UNDEFINED_INSTRUCTION);
return 4;
}
else
{
emu_halt(EMUHALT_REASON_ARM_UNDEFINED_INSTRUCTION_EXCEPTION, (cpu->proc_ID == ARMCPU_ARM9) ? NDSErrorTag_ARM9 : NDSErrorTag_ARM7);
return 4;
}
}
//BOOL
//armcpu_flagIrq( armcpu_t *armcpu) {
// if(armcpu->CPSR.bits.I) return FALSE;
//
// armcpu->waitIRQ = 0;
//
//#ifdef GDB_STUB
// armcpu->irq_flag = 1;
//#endif
//
// return TRUE;
//}
template<int PROCNUM>
u32 armcpu_exec()
{
// Usually, fetching and executing are processed parallelly.
// So this function stores the cycles of each process to
// the variables below, and returns appropriate cycle count.
u32 cFetch = 0;
u32 cExecute = 0;
//this assert is annoying. but sometimes it is handy.
//assert(ARMPROC.instruct_adr!=0x00000000);
//#ifdef DEVELOPER
#if 0
if ((((ARMPROC.instruct_adr & 0x0F000000) == 0x0F000000) && (PROCNUM == 0)) ||
(((ARMPROC.instruct_adr & 0x0F000000) == 0x00000000) && (PROCNUM == 1)))
{
switch (ARMPROC.instruct_adr & 0xFFFF)
{
case 0x00000000:
printf("BIOS%c: Reset!!!\n", PROCNUM?'7':'9');
emu_halt();
break;
case 0x00000004:
printf("BIOS%c: Undefined instruction\n", PROCNUM?'7':'9');
//emu_halt();
break;
case 0x00000008:
//printf("BIOS%c: SWI\n", PROCNUM?'7':'9');
break;
case 0x0000000C:
printf("BIOS%c: Prefetch Abort!!!\n", PROCNUM?'7':'9');
//emu_halt();
break;
case 0x00000010:
//printf("BIOS%c: Data Abort!!!\n", PROCNUM?'7':'9');
//emu_halt();
break;
case 0x00000014:
printf("BIOS%c: Reserved!!!\n", PROCNUM?'7':'9');
break;
case 0x00000018:
//printf("BIOS%c: IRQ\n", PROCNUM?'7':'9');
break;
case 0x0000001C:
printf("BIOS%c: Fast IRQ\n", PROCNUM?'7':'9');
break;
}
}
#endif
#if 0 //#ifdef GDB_STUB
if (ARMPROC.stalled) {
return STALLED_CYCLE_COUNT;
}
/* check for interrupts */
if (ARMPROC.irq_flag) {
armcpu_irqException(&ARMPROC);
}
cFetch = armcpu_prefetch(&ARMPROC);
if (ARMPROC.stalled) {
return MMU_fetchExecuteCycles<PROCNUM>(cExecute, cFetch);
}
#endif
//cFetch = armcpu_prefetch(&ARMPROC);
//printf("%d: %08X\n",PROCNUM,ARMPROC.instruct_adr);
if(ARMPROC.CPSR.bits.T == 0)
{
if(
CONDITION(ARMPROC.instruction) == 0x0E //fast path for unconditional instructions
|| (TEST_COND(CONDITION(ARMPROC.instruction), CODE(ARMPROC.instruction), ARMPROC.CPSR)) //handles any condition
)
{
#ifdef HAVE_LUA
CallRegisteredLuaMemHook(ARMPROC.instruct_adr, 4, ARMPROC.instruction, LUAMEMHOOK_EXEC); // should report even if condition=false?
#endif
#ifdef TARGET_INTERFACE
call_registered_interface_mem_hook(ARMPROC.instruct_adr, 4, HOOK_EXEC);
#endif
#ifdef DEVELOPER
DEBUG_statistics.instructionHits[PROCNUM].arm[INSTRUCTION_INDEX(ARMPROC.instruction)]++;
#endif
cExecute = arm_instructions_set[PROCNUM][INSTRUCTION_INDEX(ARMPROC.instruction)](ARMPROC.instruction);
}
else
cExecute = 1; // If condition=false: 1S cycle
#ifdef GDB_STUB
if ( ARMPROC.post_ex_fn != NULL) {
/* call the external post execute function */
ARMPROC.post_ex_fn(ARMPROC.post_ex_fn_data, ARMPROC.instruct_adr, 0);
}
ARMPROC.mem_if->prefetch32( ARMPROC.mem_if->data, ARMPROC.next_instruction);
#endif
cFetch = armcpu_prefetch<PROCNUM>();
return MMU_fetchExecuteCycles<PROCNUM>(cExecute, cFetch);
}
#ifdef HAVE_LUA
CallRegisteredLuaMemHook(ARMPROC.instruct_adr, 2, ARMPROC.instruction, LUAMEMHOOK_EXEC);
#endif
#ifdef TARGET_INTERFACE
call_registered_interface_mem_hook(ARMPROC.instruct_adr, 2, HOOK_EXEC);
#endif
#ifdef DEVELOPER
DEBUG_statistics.instructionHits[PROCNUM].thumb[ARMPROC.instruction>>6]++;
#endif
cExecute = thumb_instructions_set[PROCNUM][ARMPROC.instruction>>6](ARMPROC.instruction);
#ifdef GDB_STUB
if ( ARMPROC.post_ex_fn != NULL) {
/* call the external post execute function */
ARMPROC.post_ex_fn( ARMPROC.post_ex_fn_data, ARMPROC.instruct_adr, 1);
}
ARMPROC.mem_if->prefetch32( ARMPROC.mem_if->data, ARMPROC.next_instruction);
#endif
cFetch = armcpu_prefetch<PROCNUM>();
return MMU_fetchExecuteCycles<PROCNUM>(cExecute, cFetch);
}
//these templates needed to be instantiated manually
template u32 armcpu_exec<0>();
template u32 armcpu_exec<1>();
#ifdef HAVE_JIT
void arm_jit_sync()
{
NDS_ARM7.next_instruction = NDS_ARM7.instruct_adr;
NDS_ARM9.next_instruction = NDS_ARM9.instruct_adr;
armcpu_prefetch<0>();
armcpu_prefetch<1>();
}
template<int PROCNUM, bool jit>
u32 armcpu_exec()
{
if (jit)
{
ARMPROC.instruct_adr &= ARMPROC.CPSR.bits.T?0xFFFFFFFE:0xFFFFFFFC;
ArmOpCompiled f = (ArmOpCompiled)JIT_COMPILED_FUNC(ARMPROC.instruct_adr, PROCNUM);
return f ? f() : arm_jit_compile<PROCNUM>();
}
return armcpu_exec<PROCNUM>();
}
template u32 armcpu_exec<0,false>();
template u32 armcpu_exec<0,true>();
template u32 armcpu_exec<1,false>();
template u32 armcpu_exec<1,true>();
#endif
void setIF(int PROCNUM, u32 flag)
{
//don't set generated bits!!!
assert(!(flag&0x00200000));
MMU.reg_IF_bits[PROCNUM] |= flag;
NDS_Reschedule();
}
const armcpu_ctrl_iface arm_default_ctrl_iface = {
stall_cpu,
unstall_cpu,
read_cpu_reg,
set_cpu_reg,
install_post_exec_fn,
remove_post_exec_fn,
NULL
};

366
desmume/src/armcpu.h Normal file
View File

@ -0,0 +1,366 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2006-2021 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DESMUME_ARMCPU_H
#define DESMUME_ARMCPU_H
//half of this stuff is arm cpu internals
//half is public API
//really a mess
#include "types.h"
#include "MMU.h"
#define CONDITION(i) ((i)>>28)
#define REG_POS(i,n) (((i)>>n)&0xF)
#define CODE(i) (((i)>>25)&0x7)
#define OPCODE(i) (((i)>>21)&0xF)
#define SIGNEBIT(i) (((i)>>20)&1)
#define EXCEPTION_RESET 0x00
#define EXCEPTION_UNDEFINED_INSTRUCTION 0x04
#define EXCEPTION_SWI 0x08
#define EXCEPTION_PREFETCH_ABORT 0x0C
#define EXCEPTION_DATA_ABORT 0x10
#define EXCEPTION_RESERVED_0x14 0x14
#define EXCEPTION_IRQ 0x18
#define EXCEPTION_FAST_IRQ 0x1C
#define CPU_FREEZE_NONE 0x00
#define CPU_FREEZE_WAIT_IRQ 0x01 //waiting for some IRQ to happen, any IRQ
#define CPU_FREEZE_IE_IF 0x02 //waiting for IE&IF to signal something (probably edge triggered on IRQ too)
#define CPU_FREEZE_IRQ_IE_IF (CPU_FREEZE_WAIT_IRQ|CPU_FREEZE_IE_IF)
#define CPU_FREEZE_OVERCLOCK_HACK 0x04
#define INSTRUCTION_INDEX(i) ((((i)>>16)&0xFF0)|(((i)>>4)&0xF))
inline u32 ROR(u32 i, u32 j) { return ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j)))); }
template<typename T>
inline T UNSIGNED_OVERFLOW(T a,T b,T c) { return BIT31(((a)&(b)) | (((a)|(b))&(~c))); }
template<typename T>
inline T UNSIGNED_UNDERFLOW(T a,T b,T c) { return BIT31(((~a)&(b)) | (((~a)|(b))&(c))); }
template<typename T>
inline T SIGNED_OVERFLOW(T a,T b,T c) { return BIT31(((a)&(b)&(~c)) | ((~a)&(~(b))&(c))); }
template<typename T>
inline T SIGNED_UNDERFLOW(T a,T b,T c) { return BIT31(((a)&(~(b))&(~c)) | ((~a)&(b)&(c))); }
#if !defined(bswap32)
#define bswap32(val) \
( (val << 24) & 0xFF000000) | \
( (val << 8) & 0x00FF0000) | \
( (val >> 8) & 0x0000FF00) | \
( (val >> 24) & 0x000000FF)
#endif
#if !defined(bswap64)
#define bswap64(x) \
( (x << 56) & 0xff00000000000000ULL ) | \
( (x << 40) & 0x00ff000000000000ULL ) | \
( (x << 24) & 0x0000ff0000000000ULL ) | \
( (x << 8) & 0x000000ff00000000ULL ) | \
( (x >> 8) & 0x00000000ff000000ULL ) | \
( (x >> 24) & 0x0000000000ff0000ULL ) | \
( (x >> 40) & 0x000000000000ff00ULL ) | \
( (x >> 56) & 0x00000000000000ffULL )
#endif
// ============================= CPRS flags funcs
inline bool CarryFrom(s32 left, s32 right)
{
u32 res = (0xFFFFFFFFU - (u32)left);
return ((u32)right > res);
}
inline bool BorrowFrom(s32 left, s32 right)
{
return ((u32)right > (u32)left);
}
inline bool OverflowFromADD(s32 alu_out, s32 left, s32 right)
{
return ((left >= 0 && right >= 0) || (left < 0 && right < 0))
&& ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
}
inline bool OverflowFromSUB(s32 alu_out, s32 left, s32 right)
{
return ((left < 0 && right >= 0) || (left >= 0 && right < 0))
&& ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));
}
//zero 15-feb-2009 - these werent getting used and they were getting in my way
//#define EQ 0x0
//#define NE 0x1
//#define CS 0x2
//#define CC 0x3
//#define MI 0x4
//#define PL 0x5
//#define VS 0x6
//#define VC 0x7
//#define HI 0x8
//#define LS 0x9
//#define GE 0xA
//#define LT 0xB
//#define GT 0xC
//#define LE 0xD
//#define AL 0xE
static const u8 arm_cond_table[16*16] = {
// N=0, Z=0, C=0, V=0
0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF, // 0x00
0x00,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x20, // 0x00
// N=0, Z=0, C=0, V=1
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x00, // 0x10
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=0, Z=0, C=1, V=0
0x00,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF, // 0x20
0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x20,
// N=0, Z=0, C=1, V=1
0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x00, // 0x30
0xFF,0x00,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=0, Z=1, C=0, V=0
0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF, // 0x40
0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x20,
// N=0, Z=1, C=0, V=1
0xFF,0x00,0x00,0xFF,0x00,0xFF,0xFF,0x00, // 0x50
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=0, Z=1, C=1, V=0
0xFF,0x00,0xFF,0x00,0x00,0xFF,0x00,0xFF, // 0x60
0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x20,
// N=0, Z=1, C=1, V=1
0xFF,0x00,0xFF,0x00,0x00,0xFF,0xFF,0x00, // 0x70
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=1, Z=0, C=0, V=0
0x00,0xFF,0x00,0xFF,0xFF,0x00,0x00,0xFF, // 0x80
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=1, Z=0, C=0, V=1
0x00,0xFF,0x00,0xFF,0xFF,0x00,0xFF,0x00, // 0x90
0x00,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x20,
// N=1, Z=0, C=1, V=0
0x00,0xFF,0xFF,0x00,0xFF,0x00,0x00,0xFF, // 0xA0
0xFF,0x00,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=1, Z=0, C=1, V=1
0x00,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x00, // 0xB0
0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x20,
// N=1, Z=1, C=0, V=0
0xFF,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF, // 0xC0
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=1, Z=1, C=0, V=1
0xFF,0x00,0x00,0xFF,0xFF,0x00,0xFF,0x00, // 0xD0
0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x20,
// N=1, Z=1, C=1, V=0
0xFF,0x00,0xFF,0x00,0xFF,0x00,0x00,0xFF, // 0xE0
0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0x20,
// N=1, Z=1, C=1, V=1
0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00, // 0xF0
0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x20
};
#define TEST_COND(cond, inst, CPSR) ((arm_cond_table[((CPSR.val >> 24) & 0xf0)|(cond)]) & (1 << (inst)))
enum Mode
{
USR = 0x10,
FIQ = 0x11,
IRQ = 0x12,
SVC = 0x13,
ABT = 0x17,
UND = 0x1B,
SYS = 0x1F
};
typedef union
{
struct
{
#ifdef MSB_FIRST
u32 N : 1,
Z : 1,
C : 1,
V : 1,
Q : 1,
RAZ : 19,
I : 1,
F : 1,
T : 1,
mode : 5;
#else
u32 mode : 5,
T : 1,
F : 1,
I : 1,
RAZ : 19,
Q : 1,
V : 1,
C : 1,
Z : 1,
N : 1;
#endif
} bits;
u32 val;
} Status_Reg;
/**
* The control interface to a CPU
*/
struct armcpu_ctrl_iface
{
/** stall the processor */
void (*stall)( void *instance);
/** unstall the processor */
void (*unstall)( void *instance);
/** read a register value */
u32 (*read_reg)( void *instance, u32 reg_num);
/** set a register value */
void (*set_reg)( void *instance, u32 reg_num, u32 value);
/** install the post execute function */
void (*install_post_ex_fn)( void *instance,
void (*fn)( void *, u32 adr, int thumb),
void *fn_data);
/** remove the post execute function */
void (*remove_post_ex_fn)( void *instance);
/** the private data passed to all interface functions */
void *data;
};
typedef void* armcp_t;
struct armcpu_t
{
u32 proc_ID;
u32 instruction; //4
u32 instruct_adr; //8
u32 next_instruction; //12
u32 R[16]; //16
Status_Reg CPSR; //80
Status_Reg SPSR;
u32 R13_usr, R14_usr;
u32 R13_svc, R14_svc;
u32 R13_abt, R14_abt;
u32 R13_und, R14_und;
u32 R13_irq, R14_irq;
u32 R8_fiq, R9_fiq, R10_fiq, R11_fiq, R12_fiq, R13_fiq, R14_fiq;
Status_Reg SPSR_svc, SPSR_abt, SPSR_und, SPSR_irq, SPSR_fiq;
u32 intVector;
u8 LDTBit; //1 : ARMv5 style 0 : non ARMv5 (earlier)
u32 freeze;
//BOOL waitIRQ;
//BOOL halt_IE_and_IF;
u8 intrWaitARM_state;
BOOL BIOS_loaded;
u32 (* *swi_tab)();
// flag indicating if the processor is stalled (for debugging)
int stalled;
#if defined(_M_X64) || defined(__x86_64__)
u8 cond_table[16*16];
#endif
/** there is a pending irq for the cpu */
int irq_flag;
/** the post executed function (if installed) */
void (*post_ex_fn)( void *, u32 adr, int thumb);
/** data for the post executed function */
void *post_ex_fn_data;
/** the memory interface */
armcpu_memory_iface *mem_if; // This is the memory interface currently in use.
armcpu_memory_iface base_mem_if; // This is the CPU's base memory interface.
/** the ctrl interface */
armcpu_ctrl_iface ctrl_iface;
// debugging stuff
u32 runToRetTmp;
bool runToRet;
u32 stepOverBreak;
std::vector<u32> *breakPoints;
bool debugStep;
};
void armcpu_SetControlInterface(armcpu_t *armcpu, const armcpu_ctrl_iface *theCtrlInterface);
armcpu_ctrl_iface* armcpu_GetControlInterface(armcpu_t *armcpu);
void armcpu_SetControlInterfaceData(armcpu_t *armcpu, void *theData);
void* armcpu_GetControlInterfaceData(const armcpu_t *armcpu);
void armcpu_SetCurrentMemoryInterface(armcpu_t *armcpu, armcpu_memory_iface *theMemInterface);
armcpu_memory_iface* armcpu_GetCurrentMemoryInterface(const armcpu_t *armcpu);
void armcpu_SetCurrentMemoryInterfaceData(armcpu_t *armcpu, void *theData);
void* armcpu_GetCurrentMemoryInterfaceData(const armcpu_t *armcpu);
void armcpu_SetBaseMemoryInterface(armcpu_t *armcpu, const armcpu_memory_iface *theMemInterface);
armcpu_memory_iface* armcpu_GetBaseMemoryInterface(armcpu_t *armcpu);
void armcpu_SetBaseMemoryInterfaceData(armcpu_t *armcpu, void *theData);
void* armcpu_GetBaseMemoryInterfaceData(const armcpu_t *armcpu);
void armcpu_ResetMemoryInterfaceToBase(armcpu_t *armcpu);
void armcpu_changeCPSR();
int armcpu_new( armcpu_t *armcpu, u32 id);
void armcpu_init(armcpu_t *armcpu, u32 adr);
u32 armcpu_switchMode(armcpu_t *armcpu, u8 mode);
BOOL armcpu_irqException(armcpu_t *armcpu);
BOOL armcpu_flagIrq( armcpu_t *armcpu);
void armcpu_exception(armcpu_t *cpu, u32 number);
u32 TRAPUNDEF(armcpu_t* cpu);
u32 armcpu_Wait4IRQ(armcpu_t *cpu);
extern armcpu_t NDS_ARM7;
extern armcpu_t NDS_ARM9;
extern const armcpu_ctrl_iface arm_default_ctrl_iface;
template<int PROCNUM> u32 armcpu_exec();
#ifdef HAVE_JIT
template<int PROCNUM, bool jit> u32 armcpu_exec();
#endif
void setIF(int PROCNUM, u32 flag);
static INLINE void NDS_makeIrq(int PROCNUM, u32 num)
{
setIF(PROCNUM,1<<num);
}
#endif

File diff suppressed because it is too large Load Diff

28
desmume/src/bios.h Normal file
View File

@ -0,0 +1,28 @@
/*
Copyright (C) 2006 yopyop
Copyright (C) 2006-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BIOS_H
#define BIOS_H
#include "types.h"
extern u32 (* ARM_swi_tab[2][32])();
extern const char* ARM_swi_names[2][32];
#endif

2575
desmume/src/cheatSystem.cpp Executable file

File diff suppressed because it is too large Load Diff

329
desmume/src/cheatSystem.h Executable file
View File

@ -0,0 +1,329 @@
/*
Copyright (C) 2009-2024 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#include "types.h"
#define CHEAT_VERSION_MAJOR 2
#define CHEAT_VERSION_MINOR 0
#define MAX_XX_CODE 1024
#define CHEAT_FILE_MIN_FGETS_BUFFER 32768
#define CHEAT_TYPE_EMPTY 0xFF
#define CHEAT_TYPE_INTERNAL 0
#define CHEAT_TYPE_AR 1
#define CHEAT_TYPE_CODEBREAKER 2
enum CheatSystemError
{
CheatSystemError_NoError = 0,
CheatSystemError_FileOpenFailed = 1,
CheatSystemError_FileFormatInvalid = 2,
CheatSystemError_GameNotFound = 3,
CheatSystemError_LoadEntryError = 4,
CheatSystemError_FileSaveFailed = 5,
CheatSystemError_FileDoesNotExist = 6
};
struct CHEATS_LIST
{
CHEATS_LIST()
{
memset(this,0,sizeof(*this));
type = CHEAT_TYPE_EMPTY;
}
u8 type;
u8 enabled;
// TODO
u8 freezeType; // 0 - normal freeze
// 1 - can decrease
// 2 - can increase
u32 code[MAX_XX_CODE][2];
union
{
char description[1024];
struct
{
char descriptionMajor[512];
char descriptionMinor[512];
};
};
u32 num;
u8 size;
};
class CHEATS
{
private:
std::vector<CHEATS_LIST> _list;
u8 _filename[MAX_PATH];
size_t _currentGet;
char *clearCode(char *s);
public:
CHEATS()
: _currentGet(0)
{
memset(_filename, 0, sizeof(_filename));
}
~CHEATS() {}
void clear();
void init(const char *thePath);
const char* getFilePath() const;
void setFilePath(const char *thePath);
size_t addItem(const CHEATS_LIST &srcCheat);
bool add(u8 size, u32 address, u32 val, char *description, bool enabled);
bool add(u8 size, u32 address, u32 val, char *description, u8 enabled);
bool updateItemAtIndex(const CHEATS_LIST &srcCheat, const size_t pos);
bool update(u8 size, u32 address, u32 val, char *description, bool enabled, const size_t pos);
bool update(u8 size, u32 address, u32 val, char *description, u8 enabled, const size_t pos);
bool move(size_t srcPos, size_t dstPos);
size_t add_AR_Direct(const CHEATS_LIST &srcCheat);
bool add_AR(char *code, char *description, bool enabled);
bool add_AR(char *code, char *description, u8 enabled);
bool update_AR(char *code, char *description, bool enabled, const size_t pos);
bool update_AR(char *code, char *description, u8 enabled, const size_t pos);
bool add_CB(char *code, char *description, bool enabled);
bool add_CB(char *code, char *description, u8 enabled);
bool update_CB(char *code, char *description, bool enabled, const size_t pos);
bool update_CB(char *code, char *description, u8 enabled, const size_t pos);
bool remove(const size_t pos);
void toggle(bool enabled, const size_t pos);
void toggle(u8 enablbed, const size_t pos);
void getListReset();
bool getList(CHEATS_LIST *cheat);
CHEATS_LIST* getListPtr();
bool copyItemFromIndex(const size_t pos, CHEATS_LIST &outCheatItem);
CHEATS_LIST* getItemPtrAtIndex(const size_t pos) const;
size_t getListSize() const;
size_t getActiveCount() const;
void setDescription(const char *description, const size_t pos);
bool save();
bool load();
bool process(int targetType) const;
static void JitNeedsReset();
static bool ResetJitIfNeeded();
template<size_t LENGTH> static bool DirectWrite(const int targetProc, const u32 targetAddress, u32 newValue);
static bool DirectWrite(const size_t newValueLength, const int targetProc, const u32 targetAddress, u32 newValue);
static bool ARparser(const CHEATS_LIST &cheat);
static void StringFromXXCode(const CHEATS_LIST &srcCheatItem, char *outCStringBuffer);
static bool XXCodeFromString(const std::string codeString, CHEATS_LIST &outCheatItem);
static bool XXCodeFromString(const char *codeString, CHEATS_LIST &outCheatItem);
};
class CHEATSEARCH
{
private:
u8 *_statMem;
u8 *_mem;
u32 _amount;
u32 _lastRecord;
u32 _type;
u32 _size;
u32 _sign;
public:
CHEATSEARCH()
: _statMem(0), _mem(0), _amount(0), _lastRecord(0), _type(0), _size(0), _sign(0)
{}
~CHEATSEARCH() { this->close(); }
bool start(u8 type, u8 size, u8 sign);
void close();
u32 search(u32 val);
u32 search(u8 comp);
u32 getAmount();
bool getList(u32 *address, u32 *curVal);
void getListReset();
};
#define CHEATDB_OFFSET_FILE_DESCRIPTION 0x00000010
#define CHEATDB_FILEOFFSET_FIRST_FAT_ENTRY 0x00000100
enum CheatDBFileFormat
{
CheatDBFileFormat_Undefined = 0,
CheatDBFileFormat_R4 = 1,
CheatDBFileFormat_Unknown = 65535
};
// This struct maps to the FAT entries in the R4 cheat database file.
#pragma pack(push)
#pragma pack(1)
typedef struct FAT_R4
{
u8 serial[4];
u32 CRC;
u64 addr;
} FAT_R4;
#pragma pack(pop)
// Wrapper for a single entry in a memory block that contains data read from a cheat database file.
// This struct also maintains the hierarchical relationships between entries.
struct CheatDBEntry
{
u8 *base; // Pointer to the entry's base location in memory.
char *name; // Pointer to the entry's name string.
char *note; // Pointer to the entry's note string.
u32 *codeLength; // Pointer to the entry's 32-bit code length in bytes. This value is NULL if the entry is a directory.
u32 *codeData; // Pointer to the entry's code data, provided in pairs of 32-bit values. This value is NULL if the entry is a directory.
CheatDBEntry *parent;
std::vector<CheatDBEntry> child;
};
typedef struct CheatDBEntry CheatDBEntry;
class CheatDBGame
{
protected:
u32 _baseOffset; // This offset is relative to the file head.
u32 _firstEntryOffset; // This offset is relative to the file head.
u32 _encryptOffset; // This offset is relative to the memory address of this->_entryDataRawPtr.
u32 _rawDataSize;
u32 _workingDataSize;
u32 _crc;
u32 _entryCount;
std::string _title;
char _serial[4 + 1];
u8 *_entryDataRawPtr;
u8 *_entryData;
CheatDBEntry _entryRoot;
u32 _cheatItemCount;
void _UpdateDirectoryParents(CheatDBEntry &directory);
bool _CreateCheatItemFromCheatEntry(const CheatDBEntry &inEntry, const bool isHierarchical, CHEATS_LIST &outCheatItem);
size_t _DirectoryAddCheatsFlat(const CheatDBEntry &directory, const bool isHierarchical, size_t cheatIndex, CHEATS_LIST *outCheatsList);
public:
CheatDBGame();
CheatDBGame(const u32 encryptOffset, const FAT_R4 &fat, const u32 rawDataSize);
CheatDBGame(FILE *fp, const bool isEncrypted, const u32 encryptOffset, const FAT_R4 &fat, const u32 rawDataSize, u8 (&workingBuffer)[1024]);
~CheatDBGame();
void SetInitialProperties(const u32 rawDataSize, const u32 encryptOffset, const FAT_R4 &fat);
void LoadPropertiesFromFile(FILE *fp, const bool isEncrypted, u8 (&workingBuffer)[1024]);
u32 GetBaseOffset() const;
u32 GetFirstEntryOffset() const;
u32 GetEncryptOffset() const;
u32 GetRawDataSize() const;
u32 GetWorkingDataSize() const;
u32 GetCRC() const;
u32 GetEntryCount() const;
u32 GetCheatItemCount() const;
const char* GetTitle() const;
const char* GetSerial() const;
const CheatDBEntry& GetEntryRoot() const;
const u8* GetEntryRawData() const;
bool IsEntryDataLoaded() const;
u8* LoadEntryData(FILE *fp, const bool isEncrypted);
size_t ParseEntriesToCheatsListFlat(CHEATS_LIST *outCheatsList);
};
typedef std::vector<CheatDBGame> CheatDBGameList;
class CheatDBFile
{
protected:
std::string _path;
std::string _description;
std::string _formatString;
CheatDBFileFormat _format;
bool _isEncrypted;
size_t _size;
FILE *_fp;
CheatDBGame _ReadGame(const u32 encryptOffset, const FAT_R4 &fat, const u32 gameDataSize, u8 (&workingBuffer)[1024]);
public:
CheatDBFile();
~CheatDBFile();
static void R4Decrypt(u8 *buf, const size_t len, u64 n);
static bool ReadToBuffer(FILE *fp, const size_t fileOffset, const bool isEncrypted, const size_t encryptOffset, const size_t requestedSize, u8 *outBuffer);
FILE* GetFilePtr() const;
bool IsEncrypted() const;
const char* GetDescription() const;
CheatDBFileFormat GetFormat() const;
const char* GetFormatString() const;
CheatSystemError OpenFile(const char *filePath);
void CloseFile();
u32 LoadGameList(const char *gameCode, const u32 gameDatabaseCRC, CheatDBGameList &outList);
};
class CHEATSEXPORT
{
private:
CheatDBFile _dbFile;
CheatDBGameList _tempGameList;
CheatDBGame *_selectedDbGame;
CHEATS_LIST *_cheats;
CheatSystemError _lastError;
public:
CHEATSEXPORT();
~CHEATSEXPORT();
bool load(const char *path);
void close();
CHEATS_LIST *getCheats() const;
size_t getCheatsNum() const;
const char* getGameTitle() const;
const char* getDescription() const;
CheatSystemError getErrorCode() const;
};
CheatDBGame* GetCheatDBGameEntryFromList(const CheatDBGameList &gameList, const char *gameCode, const u32 gameDatabaseCRC);
void CheatItemGenerateDescriptionHierarchical(const char *itemName, const char *itemNote, CHEATS_LIST &outCheatItem);
void CheatItemGenerateDescriptionFlat(const char *folderName, const char *folderNote, const char *itemName, const char *itemNote, CHEATS_LIST &outCheatItem);
extern CHEATS *cheats;
extern CHEATSEARCH *cheatSearch;

634
desmume/src/commandline.cpp Normal file
View File

@ -0,0 +1,634 @@
/*
Copyright (C) 2009-2017 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see <http://www.gnu.org/licenses/>.
*/
//windows note: make sure this file gets compiled with _cdecl
#include <algorithm>
#include <stdio.h>
#include "commandline.h"
#include "types.h"
#include "movie.h"
#include "rtc.h"
#include "slot1.h"
#include "slot2.h"
#include "NDSSystem.h"
#include "utils/datetime.h"
#include "utils/xstring.h"
#include <compat/getopt.h>
//#include "frontend/modules/mGetOpt.h" //to test with this, make sure global `optind` is initialized to 1
#define printerror(...) fprintf(stderr, __VA_ARGS__)
int _scanline_filter_a = 0, _scanline_filter_b = 2, _scanline_filter_c = 2, _scanline_filter_d = 4;
int _commandline_linux_nojoy = 0;
CommandLine::CommandLine()
: is_cflash_configured(false)
, _load_to_memory(-1)
, _play_movie_file(0)
, _record_movie_file(0)
, _cflash_image(0)
, _cflash_path(0)
, _gbaslot_rom(0)
, _bios_arm9(NULL)
, _bios_arm7(NULL)
, _bios_swi(0)
, _fw_path(NULL)
, _fw_boot(0)
, _spu_sync_mode(-1)
, _spu_sync_method(-1)
, _spu_advanced(0)
, _num_cores(-1)
, _rigorous_timing(0)
, _advanced_timing(-1)
, _gamehacks(-1)
, _texture_deposterize(-1)
, _texture_smooth(-1)
, _slot1(NULL)
, _slot1_fat_dir(NULL)
, _slot1_fat_dir_type(false)
, _slot1_no8000prot(0)
#ifdef HAVE_JIT
, _cpu_mode(-1)
, _jit_size(-1)
#endif
, _console_type(NULL)
, _advanscene_import(NULL)
, load_slot(-1)
, arm9_gdb_port(0)
, arm7_gdb_port(0)
, start_paused(FALSE)
, autodetect_method(-1)
, render3d(COMMANDLINE_RENDER3D_DEFAULT)
, texture_upscale(-1)
, gpu_resolution_multiplier(-1)
, language(1) //english by default
, disable_sound(0)
, disable_limiter(0)
, windowed_fullscreen(0)
, frameskip(0)
, horizontal(0)
, scale(1.0)
, _rtc_day(-1)
, _rtc_hour(-1)
{
}
CommandLine::~CommandLine()
{
}
static char mytoupper(char c) { return ::toupper(c); }
static std::string strtoupper(const std::string& str)
{
std::string ret = str;
std::transform(ret.begin(), ret.end(), ret.begin(), ::mytoupper);
return ret;
}
#define ENDL "\n"
static const char* help_string = \
"Arguments affecting overall emulator behaviour: (`user settings`):" ENDL
" --num-cores N Override numcores detection and use this many" ENDL
" --spu-synch Use SPU synch (crackles; helps streams; default ON)" ENDL
" --spu-method N Select SPU synch method: 0:N, 1:Z, 2:P; default 0" ENDL
" --3d-render [SW|AUTOGL|GL|OLDGL]" ENDL
" Select 3d renderer; default SW" ENDL
" --3d-texture-deposterize-enable" ENDL
" Enables texture deposterization." ENDL
" --3d-texture-upscale [1|2|4]" ENDL
" Automatically upscales textures by the specified" ENDL
" amount; 1:No scaling (default), 2:2x upscaling," ENDL
" 4:4x upscaling" ENDL
" --3d-texture-smoothing-enable" ENDL
" Enables smooth texture sampling while rendering." ENDL
#ifdef HOST_WINDOWS
" --gpu-resolution-multiplier N" ENDL
" Increases the resolution of GPU rendering by this" ENDL
" multipler; 1:256x192 (default), 2:512x384," ENDL
" 3:768x576, 4:1024x768, 5:1280x960" ENDL
" --windowed-fullscreen" ENDL
" Launches in windowed fullscreen (same as alt+enter)" ENDL
#else
" --scale N scale factor for window; default 1.0" ENDL
" --horizontal display touch screen to the right; default OFF" ENDL
" --nojoy Disables joystick support" ENDL
#endif
" --disable-sound Disables the sound output" ENDL
" --disable-limiter Disables the 60fps limiter" ENDL
" --rtc-day D Override RTC day, 0=Sunday, 6=Saturday" ENDL
" --rtc-hour H Override RTC hour, 0=midnight, 23=an hour before" ENDL
" --frameskip N Set frameskip to N; default 0" ENDL
ENDL
"Arguments affecting overall emulation parameters (`sync settings`): " ENDL
#ifdef HAVE_JIT
" --jit-enable Formerly --cpu-mode; default OFF" ENDL
" --jit-size N JIT block size 1-100; 1:accurate 100:fast (default)" ENDL
#endif
" --advanced-timing Use advanced bus-level timing; default ON" ENDL
" --rigorous-timing Use more realistic component timings; default OFF" ENDL
" --gamehacks Use game-specific hacks; default ON" ENDL
" --spu-advanced Enable advanced SPU capture functions (reverb)" ENDL
" --backupmem-db Use DB for autodetecting backup memory type" ENDL
ENDL
"Arguments affecting the emulated requipment:" ENDL
" --console-type [FAT|LITE|IQUE|DEBUG|DSI]" ENDL
" Select basic console type; default FAT" ENDL
" --bios-arm9 BIN_FILE Uses the ARM9 BIOS provided at the specified path" ENDL
" --bios-arm7 BIN_FILE Uses the ARM7 BIOS provided at the specified path" ENDL
" --firmware-path BIN_FILE Uses the firmware provided at the specified path" ENDL
" --firmware-boot 0|1 Boot from firmware" ENDL
" --bios-swi Uses SWI from the provided bios files (else HLE)" ENDL
" --lang N Firmware language (can affect game translations)" ENDL
" 0 = Japanese, 1 = English (default), 2 = French" ENDL
" 3 = German, 4 = Italian, 5 = Spanish" ENDL
ENDL
"Arguments affecting contents of SLOT-1:" ENDL
" --slot1 [RETAIL|RETAILAUTO|R4|RETAILNAND|RETAILMCDROM|RETAILDEBUG]" ENDL
" Device type to be used SLOT-1; default RETAILAUTO" ENDL
" --preload-rom precache ROM to RAM instead of streaming from disk" ENDL
" --slot1-fat-dir DIR Directory to mount for SLOT-1 flash cards" ENDL
" --slot1_no8000prot Disables retail card copy protection <8000 feature" ENDL
ENDL
"Arguments affecting contents of SLOT-2:" ENDL
" --cflash-image IMG_FILE Mounts cflash in SLOT-2 with specified image file" ENDL
" --cflash-path DIR Mounts cflash in SLOT-2 with FS rooted at DIR" ENDL
" --gbaslot-rom GBA_FILE Mounts GBA specified rom in SLOT-2" ENDL
ENDL
"Commands taking place after ROM is loaded: (be sure to specify a ROM!)" ENDL
" --start-paused emulation should start paused" ENDL
" --load-slot N loads savestate from slot N (0-9)" ENDL
" --play-movie DSM_FILE automatically plays movie" ENDL
" --record-movie DSM_FILE begin recording a movie" ENDL
ENDL
"Arguments affecting video filters:" ENDL
" --scanline-filter-a N Fadeout intensity (N/16) (topleft) (default 0)" ENDL
" --scanline-filter-b N Fadeout intensity (N/16) (topright) (default 2)" ENDL
" --scanline-filter-c N Fadeout intensity (N/16) (bottomleft) (default 2)" ENDL
" --scanline-filter-d N Fadeout intensity (N/16) (bottomright) (default 4)" ENDL
ENDL
#ifdef GDB_STUB
"Arguments affecting debugging features:" ENDL
" --arm9gdb PORTNUM Enable the ARM9 GDB stub on the given port" ENDL
" --arm7gdb PORTNUM Enable the ARM7 GDB stub on the given port" ENDL
ENDL
#endif
"Utility commands which occur in place of emulation:" ENDL
" --advanscene-import PATH Import advanscene, dump .ddb, and exit" ENDL
ENDL
"These arguments may be reorganized/renamed in the future." ENDL ENDL
;
//https://github.com/mono/mono/blob/b7a308f660de8174b64697a422abfc7315d07b8c/eglib/test/driver.c
#define OPT_NUMCORES 1
#define OPT_SPU_METHOD 2
#define OPT_3D_RENDER 3
#define OPT_3D_TEXTURE_UPSCALE 81
#define OPT_GPU_RESOLUTION_MULTIPLIER 82
#define OPT_FRAMESKIP 83
#define OPT_SCALE 84
#define OPT_JIT_SIZE 100
#define OPT_CONSOLE_TYPE 200
#define OPT_ARM9 201
#define OPT_ARM7 202
#define OPT_LANGUAGE 203
#define OPT_FIRMPATH 204
#define OPT_FIRMBOOT 205
#define OPT_SLOT1 300
#define OPT_SLOT1_FAT_DIR 301
#define OPT_LOAD_SLOT 400
#define OPT_PLAY_MOVIE 410
#define OPT_RECORD_MOVIE 411
#define OPT_SLOT2_CFLASH_IMAGE 500
#define OPT_SLOT2_CFLASH_DIR 501
#define OPT_SLOT2_GBAGAME 502
#define OPT_SCANLINES_A 600
#define OPT_SCANLINES_B 601
#define OPT_SCANLINES_C 602
#define OPT_SCANLINES_D 603
#define OPT_ARM9GDB 700
#define OPT_ARM7GDB 701
#define OPT_RTC_DAY 800
#define OPT_RTC_HOUR 801
#define OPT_ADVANSCENE 900
bool CommandLine::parse(int argc,char **argv)
{
//closest thing to a portable main() we have, I guess.
srand((unsigned)time(nullptr));
std::string _render3d;
int opt_help = 0;
int option_index = 0;
for(;;)
{
//libretro-common's optional argument is not supported presently
static struct option long_options[] =
{
//stuff
{ "help", no_argument, &opt_help, 1 },
//user settings
{ "num-cores", required_argument, NULL, OPT_NUMCORES },
{ "spu-synch", no_argument, &_spu_sync_mode, 1 },
{ "spu-method", required_argument, NULL, OPT_SPU_METHOD },
{ "3d-render", required_argument, NULL, OPT_3D_RENDER },
{ "3d-texture-deposterize-enable", no_argument, &_texture_deposterize, 1 },
{ "3d-texture-upscale", required_argument, NULL, OPT_3D_TEXTURE_UPSCALE },
{ "3d-texture-smoothing-enable", no_argument, &_texture_smooth, 1 },
#ifdef HOST_WINDOWS
{ "gpu-resolution-multiplier", required_argument, NULL, OPT_GPU_RESOLUTION_MULTIPLIER },
{ "windowed-fullscreen", no_argument, &windowed_fullscreen, 1 },
#else
{ "nojoy", no_argument, &_commandline_linux_nojoy, 1},
{ "horizontal", no_argument, &horizontal, 1},
{ "scale", required_argument, NULL, OPT_SCALE},
#endif
{ "frameskip", required_argument, NULL, OPT_FRAMESKIP},
{ "disable-sound", no_argument, &disable_sound, 1},
{ "disable-limiter", no_argument, &disable_limiter, 1},
{ "rtc-day", required_argument, NULL, OPT_RTC_DAY},
{ "rtc-hour", required_argument, NULL, OPT_RTC_HOUR},
//sync settings
#ifdef HAVE_JIT
{ "jit-enable", no_argument, &_cpu_mode, 1},
{ "jit-size", required_argument, NULL, OPT_JIT_SIZE },
#endif
{ "rigorous-timing", no_argument, &_rigorous_timing, 1},
{ "advanced-timing", no_argument, &_advanced_timing, 1},
{ "gamehacks", no_argument, &_gamehacks, 1},
{ "spu-advanced", no_argument, &_spu_advanced, 1},
{ "backupmem-db", no_argument, &autodetect_method, 1},
//system equipment
{ "console-type", required_argument, NULL, OPT_CONSOLE_TYPE },
{ "bios-arm9", required_argument, NULL, OPT_ARM9},
{ "bios-arm7", required_argument, NULL, OPT_ARM7},
{ "bios-swi", no_argument, &_bios_swi, 1},
{ "firmware-path", required_argument, NULL, OPT_FIRMPATH},
{ "firmware-boot", required_argument, NULL, OPT_FIRMBOOT},
{ "lang", required_argument, NULL, OPT_LANGUAGE},
//slot-1 contents
{ "slot1", required_argument, NULL, OPT_SLOT1},
{ "preload-rom", no_argument, &_load_to_memory, 1},
{ "slot1-fat-dir", required_argument, NULL, OPT_SLOT1_FAT_DIR},
//and other slot-1 option
{ "slot1-no8000prot", no_argument, &_slot1_no8000prot, 1},
//slot-2 contents
{ "cflash-image", required_argument, NULL, OPT_SLOT2_CFLASH_IMAGE},
{ "cflash-path", required_argument, NULL, OPT_SLOT2_CFLASH_DIR},
{ "gbaslot-rom", required_argument, NULL, OPT_SLOT2_GBAGAME},
//commands
{ "start-paused", no_argument, &start_paused, 1},
{ "load-slot", required_argument, NULL, OPT_LOAD_SLOT},
{ "play-movie", required_argument, NULL, OPT_PLAY_MOVIE},
{ "record-movie", required_argument, NULL, OPT_RECORD_MOVIE},
//video filters
{ "scanline-filter-a", required_argument, NULL, OPT_SCANLINES_A},
{ "scanline-filter-b", required_argument, NULL, OPT_SCANLINES_B},
{ "scanline-filter-c", required_argument, NULL, OPT_SCANLINES_C},
{ "scanline-filter-d", required_argument, NULL, OPT_SCANLINES_D},
//debugging
#ifdef GDB_STUB
{ "arm9gdb", required_argument, NULL, OPT_ARM9GDB},
{ "arm7gdb", required_argument, NULL, OPT_ARM7GDB},
#endif
//utilities
{ "advanscene-import", required_argument, NULL, OPT_ADVANSCENE},
{0,0,0,0}
};
int c = getopt_long(argc,argv,"",long_options,&option_index);
if(c == -1) break;
if(c == '?')
break;
switch(c)
{
case 0: break;
//user settings
case OPT_NUMCORES: _num_cores = atoi(optarg); break;
case OPT_SPU_METHOD: _spu_sync_method = atoi(optarg); break;
case OPT_3D_RENDER: _render3d = optarg; break;
case OPT_3D_TEXTURE_UPSCALE: texture_upscale = atoi(optarg); break;
case OPT_GPU_RESOLUTION_MULTIPLIER: gpu_resolution_multiplier = atoi(optarg); break;
case OPT_SCALE: scale = atof(optarg); break;
case OPT_FRAMESKIP: frameskip = atoi(optarg); break;
//RTC settings
case OPT_RTC_DAY: _rtc_day = atoi(optarg); break;
case OPT_RTC_HOUR: _rtc_hour = atoi(optarg); break;
//sync settings
#ifdef HAVE_JIT
case OPT_JIT_SIZE: _jit_size = atoi(optarg); break;
#endif
//system equipment
case OPT_CONSOLE_TYPE: console_type = optarg; break;
case OPT_ARM9: _bios_arm9 = strdup(optarg); break;
case OPT_ARM7: _bios_arm7 = strdup(optarg); break;
case OPT_FIRMPATH: _fw_path = strdup(optarg); break;
case OPT_FIRMBOOT: _fw_boot = atoi(optarg); break;
//slot-1 contents
case OPT_SLOT1: slot1 = strtoupper(optarg); break;
case OPT_SLOT1_FAT_DIR: slot1_fat_dir = optarg; break;
//slot-2 contents
case OPT_SLOT2_CFLASH_IMAGE: cflash_image = optarg; break;
case OPT_SLOT2_CFLASH_DIR: _cflash_path = optarg; break;
case OPT_SLOT2_GBAGAME: _gbaslot_rom = optarg; break;
//commands
case OPT_LOAD_SLOT: load_slot = atoi(optarg); break;
case OPT_PLAY_MOVIE: play_movie_file = optarg; break;
case OPT_RECORD_MOVIE: record_movie_file = optarg; break;
//video filters
case OPT_SCANLINES_A: _scanline_filter_a = atoi(optarg); break;
case OPT_SCANLINES_B: _scanline_filter_b = atoi(optarg); break;
case OPT_SCANLINES_C: _scanline_filter_c = atoi(optarg); break;
case OPT_SCANLINES_D: _scanline_filter_d = atoi(optarg); break;
//debugging
case OPT_ARM9GDB: arm9_gdb_port = atoi(optarg); break;
case OPT_ARM7GDB: arm7_gdb_port = atoi(optarg); break;
//utilities
case OPT_ADVANSCENE: CommonSettings.run_advanscene_import = optarg; break;
case OPT_LANGUAGE: language = atoi(optarg); break;
}
} //arg parsing loop
if(opt_help)
{
printf("%s",help_string);
exit(1);
}
if(_load_to_memory != -1) CommonSettings.loadToMemory = (_load_to_memory == 1)?true:false;
if(_num_cores != -1) CommonSettings.num_cores = _num_cores;
if(_rigorous_timing) CommonSettings.rigorous_timing = true;
if(_advanced_timing != -1) CommonSettings.advanced_timing = _advanced_timing==1;
if(_gamehacks != -1) CommonSettings.gamehacks.en = _gamehacks==1;
#ifdef HAVE_JIT
if(_cpu_mode != -1) CommonSettings.use_jit = (_cpu_mode==1);
if(_jit_size != -1)
{
if ((_jit_size < 1) || (_jit_size > 100))
CommonSettings.jit_max_block_size = 100;
else
CommonSettings.jit_max_block_size = _jit_size;
}
#endif
//process console type
CommonSettings.DebugConsole = false;
CommonSettings.ConsoleType = NDS_CONSOLE_TYPE_FAT;
console_type = strtoupper(console_type);
if(console_type == "") {}
else if(console_type == "FAT") CommonSettings.ConsoleType = NDS_CONSOLE_TYPE_FAT;
else if(console_type == "LITE") CommonSettings.ConsoleType = NDS_CONSOLE_TYPE_LITE;
else if(console_type == "IQUE") CommonSettings.ConsoleType = NDS_CONSOLE_TYPE_IQUE;
else if(console_type == "DSI") CommonSettings.ConsoleType = NDS_CONSOLE_TYPE_DSI;
else if(console_type == "DEBUG")
{
CommonSettings.ConsoleType = NDS_CONSOLE_TYPE_FAT;
CommonSettings.DebugConsole = true;
}
//process 3d renderer
_render3d = strtoupper(_render3d);
if(_render3d == "NONE") render3d = COMMANDLINE_RENDER3D_NONE;
else if(_render3d == "SW") render3d = COMMANDLINE_RENDER3D_SW;
else if(_render3d == "OLDGL") render3d = COMMANDLINE_RENDER3D_OLDGL;
else if(_render3d == "AUTOGL") render3d = COMMANDLINE_RENDER3D_AUTOGL;
else if(_render3d == "GL") render3d = COMMANDLINE_RENDER3D_GL;
if (_texture_deposterize != -1) CommonSettings.GFX3D_Renderer_TextureDeposterize = (_texture_deposterize == 1);
if (_texture_smooth != -1) CommonSettings.GFX3D_Renderer_TextureSmoothing = (_texture_smooth == 1);
if (autodetect_method != -1)
CommonSettings.autodetectBackupMethod = autodetect_method;
//TODO NOT MAX PRIORITY! change ARM9BIOS etc to be a std::string
if(_bios_arm9) { CommonSettings.UseExtBIOS = true; strcpy(CommonSettings.ARM9BIOS,_bios_arm9); }
if(_bios_arm7) { CommonSettings.UseExtBIOS = true; strcpy(CommonSettings.ARM7BIOS,_bios_arm7); }
#ifndef HOST_WINDOWS
if(_fw_path) { CommonSettings.UseExtFirmware = true; CommonSettings.UseExtFirmwareSettings = true; strcpy(CommonSettings.ExtFirmwarePath,_fw_path); }
#endif
if(_fw_boot) CommonSettings.BootFromFirmware = true;
if(_bios_swi) CommonSettings.SWIFromBIOS = true;
if(_slot1_no8000prot) CommonSettings.RetailCardProtection8000 = false;
if(_spu_sync_mode != -1) CommonSettings.SPU_sync_mode = _spu_sync_mode;
if(_spu_sync_method != -1) CommonSettings.SPU_sync_method = _spu_sync_method;
if(_spu_advanced) CommonSettings.spu_advanced = true;
free(_bios_arm9);
free(_bios_arm7);
_bios_arm9 = _bios_arm7 = NULL;
//remaining argument should be an NDS file, and nothing more
int remain = argc-optind;
if(remain==1)
nds_file = argv[optind];
else if(remain>1) return false;
return true;
}
bool CommandLine::validate()
{
if(slot1 != "")
{
if(slot1 != "R4" && slot1 != "RETAIL" && slot1 != "NONE" && slot1 != "RETAILNAND") {
printerror("Invalid slot1 device specified.\n");
return false;
}
}
if (_load_to_memory < -1 || _load_to_memory > 1) {
printerror("Invalid parameter (0 - stream from disk, 1 - from RAM)\n");
return false;
}
if (_spu_sync_mode < -1 || _spu_sync_mode > 1) {
printerror("Invalid parameter\n");
return false;
}
if (_spu_sync_method < -1 || _spu_sync_method > 2) {
printerror("Invalid parameter\n");
return false;
}
if (load_slot < -1 || load_slot > 10) {
printerror("I only know how to load from slots 0-10; -1 means 'do not load savegame' and is default\n");
return false;
}
if(play_movie_file != "" && record_movie_file != "") {
printerror("Cannot both play and record a movie.\n");
return false;
}
if(record_movie_file != "" && load_slot != -1) {
printerror("Cannot both record a movie and load a savestate.\n");
return false;
}
if(cflash_path != "" && cflash_image != "") {
printerror("Cannot specify both cflash-image and cflash-path.\n");
return false;
}
if((_bios_arm9 && !_bios_arm7) || (_bios_arm7 && !_bios_arm9)) {
printerror("If either bios-arm7 or bios-arm9 are specified, both must be.\n");
return false;
}
if(_bios_swi && (!_bios_arm7 || !_bios_arm9)) {
printerror("If either bios-swi is used, bios-arm9 and bios-arm7 must be specified.\n");
}
if(_fw_boot && (!_fw_path)) {
printerror("If either firmware boot is used, firmware path must be specified.\n");
}
if((_cflash_image && _gbaslot_rom) || (_cflash_path && _gbaslot_rom)) {
printerror("Cannot specify both cflash and gbaslot rom (both occupy SLOT-2)\n");
}
if (autodetect_method < -1 || autodetect_method > 1) {
printerror("Invalid autodetect save method (0 - internal, 1 - from database)\n");
}
if ( (texture_upscale != -1) && (texture_upscale != 1) && (texture_upscale != 2) && (texture_upscale != 4) ) {
printerror("Invalid texture upscaling value [1|2|4]. Ignoring command line setting.\n");
texture_upscale = -1;
}
if ( (gpu_resolution_multiplier != -1) && ((gpu_resolution_multiplier < 1) || (gpu_resolution_multiplier > 5)) ) {
printerror("Invalid GPU resolution multiplier [1..5]. Ignoring command line setting.\n");
gpu_resolution_multiplier = -1;
}
#ifdef HAVE_JIT
if (_cpu_mode < -1 || _cpu_mode > 1) {
printerror("Invalid cpu mode emulation (0 - interpreter, 1 - dynarec)\n");
}
if (_jit_size < -1 && (_jit_size == 0 || _jit_size > 100)) {
printerror("Invalid jit block size [1..100]. set to 100\n");
}
#endif
if (_rtc_day < -1 || _rtc_day > 6) {
printerror("Invalid rtc day override, valid values are from 0 to 6");
return false;
}
if (_rtc_hour < -1 || _rtc_hour > 23) {
printerror("Invalid rtc day override, valid values are from 0 to 23");
return false;
}
return true;
}
void CommandLine::errorHelp(const char* binName)
{
printerror("%s",help_string);
}
void CommandLine::process_movieCommands()
{
if(play_movie_file != "")
{
FCEUI_LoadMovie(play_movie_file.c_str(),true,false,-1);
}
else if(record_movie_file != "")
{
FCEUI_SaveMovie(record_movie_file.c_str(), L"", START_BLANK, NULL, FCEUI_MovieGetRTCDefault());
}
}
void CommandLine::process_addonCommands()
{
if (cflash_image != "")
{
CFlash_Mode = ADDON_CFLASH_MODE_File;
CFlash_Path = cflash_image;
is_cflash_configured = true;
}
if (cflash_path != "")
{
CFlash_Mode = ADDON_CFLASH_MODE_Path;
CFlash_Path = cflash_path;
is_cflash_configured = true;
}
if(slot1_fat_dir != "")
slot1_SetFatDir(slot1_fat_dir);
if(slot1 == "RETAIL")
slot1_Change(NDS_SLOT1_RETAIL_AUTO);
else if(slot1 == "RETAILAUTO")
slot1_Change(NDS_SLOT1_RETAIL_AUTO);
else if(slot1 == "R4")
slot1_Change(NDS_SLOT1_R4);
else if(slot1 == "RETAILNAND")
slot1_Change(NDS_SLOT1_RETAIL_NAND);
else if(slot1 == "RETAILMCROM")
slot1_Change(NDS_SLOT1_RETAIL_MCROM);
else if(slot1 == "RETAILDEBUG")
slot1_Change(NDS_SLOT1_RETAIL_DEBUG);
if (_rtc_day != -1 || _rtc_hour != -1) {
DateTime now = DateTime::get_Now();
int cur_day = now.get_DayOfWeek();
int cur_hour = now.get_Hour();
int cur_total = cur_day * 24 + cur_hour;
int day = (_rtc_day != -1 ? _rtc_day : cur_day);
int hour = (_rtc_hour != -1 ? _rtc_hour : cur_hour);
int total = day * 24 + hour;
int diff = total - cur_total;
if (diff < 0)
diff += 24 * 7;
rtcHourOverride = diff;
}
}

Some files were not shown because too many files have changed in this diff Show More