Commit graph

6256 commits

Author SHA1 Message Date
Nekotekina
ac712bf4e3 lf_queue: remove explicit notify(), notify in push() instead
Should be cheap enough now if there are no waiters.
2019-10-12 22:45:17 +03:00
Nekotekina
5624b001ae lf_queue: add range-for support (endless loop with waiting) 2019-10-12 22:37:52 +03:00
Nekotekina
16dd72b3e3 Replace some uses of Emu.IsStopped()
Poll thread state instead.
2019-10-12 21:12:47 +03:00
Nekotekina
8e21f4d5d4 Remove g_thread_count
Unnecessary global which is bad to reason about.
Possibly fix a but in SPRX loader.
2019-10-12 16:45:41 +03:00
Nekotekina
49e96b39dd [SPU, TSX] Fix reservation corruption in PUTLLC
Change reservation locking logic.
2019-10-12 15:41:24 +03:00
Alex James
3ad743ecaa Add option for preventing display sleep (#5783)
Adds support for preventing the display from sleeping while a game is
running. Supports Windows, Linux (with the org.freedesktop.ScreenSaver
D-Bus service), and macOS.
2019-10-12 15:40:47 +03:00
Megamouse
07022fd3b6 stub cellVoice 2019-10-12 10:16:01 +02:00
Eladash
0172e097f7 Fix cellCameraInit (camera_handler::null) 2019-10-11 21:55:10 +02:00
Eladash
5cc12ef22e cellCamera: Log error code 2019-10-11 21:55:10 +02:00
Markus Stockhausen
4d99169d51 Patch v2 for vkCreateInstance()
as requested
2019-10-11 21:16:36 +03:00
Markus Stockhausen
8adcb8046b Patch for vkCreateInstance()
patch as requested
2019-10-11 21:16:36 +03:00
Markus Stockhausen
f5817cb430 Error handling for vkCreateInstance()
Cry in log if initialization failed.
2019-10-11 21:16:36 +03:00
Eladash
397007cf8b rsx: Fix FIFO_DRAW_BARRIER substituation 2019-10-11 12:34:53 +03:00
Eladash
9242f16560 rsx: Improve FIFO recovery from flip 2019-10-10 19:34:23 +03:00
Eladash
06017cb14e rsx: Recover from invalid writes to CELL_GCM_NV4097_SET_INDEX_ARRAY_DMA
Also: Trigger a FIFO recovery when encountering an invalid method.
2019-10-10 19:34:23 +03:00
Eladash
2eaf5df60b rsx: Register some more methods 2019-10-10 19:34:23 +03:00
plappermaul
925f2ce02f Use Linux timers for sleeps up to 1ms (#6697)
* Use Linux timers for sleeps up to 1ms (v3)
The current sleep timer implementation basically offers two variants. Either
wait the specified time exactly with a condition variable (as host) or use a
combination of it with a thread yielding busy loop afterwards (usleep timer).

While the second one is very precise it consumes CPU loops for each wait call
below 50us. Games like Bomberman Ultra spam 30us waits and the emulator hogs
low power CPUs. Switching to host mode reduces CPU consumption but gives a
~50us penalty for each wait call. Thus extending all sleeps by a factor of
more than two.

The following bugfix tries to improve the system timer for Linux by using
Linux native timers for small wait calls below 1ms. This has two effects.

- Host wait setting has much less wait overhead
- usleep wait setting produces lower CPU overhead
2019-10-09 20:03:34 +03:00
Nekotekina
6b1e1e4020 GDB Server: parse 'GDB Server' config entry
Add support for unix sockets.
2019-10-09 16:41:01 +03:00
Nekotekina
91dcc3f60c GDB Server: fix selecting ppu_thread 2019-10-09 03:17:10 +03:00
Nekotekina
23bbeb7f8f GDB Server: fix ppu_thread access cast 2019-10-09 03:12:45 +03:00
Nekotekina
ad5afc074e GDB Server: format cleanup 2019-10-09 03:06:59 +03:00
Nekotekina
8f604ddded Fix log format misuse
Harden log channel methods against non-constant string.
2019-10-09 02:14:52 +03:00
Nekotekina
a29d4150df GDB Server: fix and cleanup
Move source files to Emu/GDB.cpp, GDB.h
Remove "WITH_GDB" option, enable GDB Server by default.
Change class name to gdb_thread.
Alias for external access gdb_server.
Change config option name to "GDB Server"
Bind on 127.0.0.1 by default.
2019-10-09 00:11:44 +03:00
Nekotekina
9d4de51cb6 Use g_fxo for network thread
Minor refactoring
2019-10-08 23:12:54 +03:00
Eladash
0f3c5f9e5a Fix verification failure on Emu.Stop() at sys_cond_wait 2019-10-08 23:12:34 +03:00
Eladash
af417c93d0 cellGemUpdateStart/Finish error checking improved
* camera_frame = NULL is now checked for CELL_GEM_NO_VIDEO (applied both on start and finish)
* camera_frame = NULL on Start() still starts the update
* Implemented NOT_FINISHED/STARTED

All of those were reversed and hw tested.
2019-10-08 23:12:34 +03:00
Megamouse
278050f8d0 add cellPadFilter functions 2019-10-08 08:21:30 +02:00
Megamouse
29c77132cb add error code to cellPadInfoPressMode and cellPadInfoSensorMode 2019-10-08 08:21:30 +02:00
Megamouse
f8c6cc2476 cellMic: add some params
makes me wonder if dev_num should always be s32
2019-10-08 08:21:30 +02:00
Eladash
36de3d4f4c sys_gpio Cleanup 2019-10-08 02:52:33 +03:00
Eladash
c2278fb879 spu: Mask SRR0 at write 2019-10-08 02:52:33 +03:00
Megamouse
3455d76970 cellPadGetData: clear buttons if input is ignored but not intercepted.
needed in Hotline Miami and NinJa Gaiden Sigma, fixes Gran Turismo 6 regression
2019-10-07 19:25:50 +02:00
Megamouse
d402507be2 cellOskDialog: add some param checks 2019-10-07 19:25:50 +02:00
Nekotekina
239f53568c SPU: optimize function dispatch in trampolines
Add a top-level hashtable
2019-10-06 16:03:38 +03:00
Nekotekina
8031180373 Add dummy alert param to thread_ctrl::wait API 2019-10-06 16:03:10 +03:00
Eladash
9e929a25d4 rsx: Default initailize zcull reports padding 2019-10-05 15:00:50 +03:00
kd-11
305a5bd717 typo fix 2019-10-05 12:01:46 +03:00
kd-11
4a19a2dd24 rsx: Explicity describe transfer regions for both source and destination blocks 2019-10-04 18:10:46 +03:00
Eladash
08e674aa28 sys_cond fixes (#6584)
* sys_cond fixes

sys_cond_wait is now signaled atomically (regression fix)
Fix a corner case with sys_cond_wait and sys_cond_destroy EBSUY check (waiter count was inaccurate if thread is not the owner of mutex)
Add not about EBUSY corner case (TODO)

* Fix inconcistency in sys_cond_destroy and ETIMEDOUT

 .. event at sys_cond_wait regarding waiters count.

Now waiters count is properly connected to the mutex owner actions after ETIMEDOUT in sys_cond_wait.
2019-10-03 23:05:34 +03:00
Eladash
286d62d09c sceNp2Init: use u32 in poolsize 2019-10-02 01:52:42 +01:00
kd-11
7aed9c3f13 gl: Add missing input declarations for 2-sided lighting 2019-09-30 21:52:43 +03:00
kd-11
88229f4716 gl: Remember to unbind attachments from active framebuffer after clear
- If a stale reference is left lying around (e.g the texture bound to
depth has been deleted and we attach a color image) no operations
actually take place. glCheckFramebufferStatus also does not catch this
problem.
2019-09-30 21:52:43 +03:00
Eladash
0b2fa6ffdc rsx: Flush FIFO GET before smeaphore_acquire 2019-09-30 17:30:15 +03:00
Eladash
70b4ae6bd6 rsx: Optimize FIFO PUT masking 2019-09-30 17:30:15 +03:00
kd-11
bcf8799079 rsx: Fix missing point size export
- Sometimes program-point-size is enabled, but the vs does not actually
write to the point size register. In this case, pass the incoming point
size along instead of the default register init.
2019-09-30 01:40:04 +03:00
Eladash
319fc8c55d rsx: Mask FIFO PUT on rsx execution 2019-09-29 13:05:24 +03:00
Eladash
822287b418 rsx: Avoid unsigned/signed mismatch with fifo ret addr 2019-09-29 13:05:24 +03:00
kd-11
8cfd3b56d6 vk: Increase wait timeout in case of problematic GPU loads causing heavy stutter
- When compiling LLVM objects, it is possible to starve the driver thread and cause the timeouts to trigger
- Observed in RE6 when using SPU LLVM since the game generates a very large number of objects "infinitely"
2019-09-29 11:39:22 +03:00
kd-11
ef5b56bc48 rsx: Align width properly when normalizing to avoid fractional results being lowered to 0 2019-09-29 11:39:22 +03:00
kd-11
69c090b14a vk: Check frame descriptors before rendering in case of a flip request between begin() and end()
- There is no reason to delay async flip requests since most of the work can be handled during rendering anyway
2019-09-29 11:39:22 +03:00