Commit Graph

6704 Commits

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