Commit Graph

6169 Commits

Author SHA1 Message Date
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