Commit Graph

6445 Commits

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