Commit graph

57 commits

Author SHA1 Message Date
Unknown W. Brackets
a1a4a02759 While running callbacks, defer wait info.
This way if a thread is resumed while running callbacks, it'll
actually resume.
2012-12-09 16:56:47 -08:00
Unknown W. Brackets
f145bafc7a Wrap a few of the sceKernel*Thread funcs. 2012-12-09 01:04:54 -08:00
Unknown W. Brackets
5e8aa4c071 Implement deferred rescheduling/callbacks.
This way most HLE functions can be wrapped normally.  Hurray, sanity.
2012-12-09 01:04:53 -08:00
Unknown W. Brackets
92e519c24b Don't always reschedule after running callbacks.
When not waiting, usually only local callbacks are called.
Some functions are unique though.
2012-12-09 01:04:53 -08:00
Unknown W. Brackets
7044fafe84 Always run callbacks when rescheduling.
Not just when rescheduling because of a *CB() func.
2012-12-09 01:04:52 -08:00
Unknown W. Brackets
fda41752e8 Simplify the API for HLE funcs to do callbacks.
__KernelWaitCurThread() already (ultimately) calls __KernelCheckCallbacks.
2012-12-09 01:04:52 -08:00
Unknown W. Brackets
ff7e1d7be9 Fix running threads in processing callbacks state.
ActionAfterMipsCall was setting it back when it saved it.
2012-12-09 01:04:51 -08:00
Unknown W. Brackets
9cd47e210b Callbacks: Don't trust s0 to retain the call id.
Patapon 2 at least was not during a call, preventing injection.
Hardware doesn't have to deal with injection so not a problem.
2012-12-09 01:04:51 -08:00
Unknown W. Brackets
771cf39811 Don't reschedule in sceKernelCheckCallback(). 2012-12-09 01:04:50 -08:00
Unknown W. Brackets
3f43ab5bb5 Callbacks are always fired on their own thread.
At least, as far as I can tell.  It does make sense too.
2012-12-09 01:04:50 -08:00
Unknown W. Brackets
15c05dc08c Implement sceKernelTerminateThread(), not fully.
It's mostly correct but needs some tests and TLC.
This allows threads to be restarted.
2012-12-07 00:46:19 -08:00
Unknown W. Brackets
6fd71f5b27 Fix failed free issues with thread stacks. 2012-12-07 00:46:19 -08:00
Unknown W. Brackets
8bae2e0964 Cancel wakeup events when a thread ends. 2012-12-07 00:46:19 -08:00
Unknown W. Brackets
aea9b16a04 Add ctrl waits when there are no buffers yet. 2012-12-02 17:03:13 -08:00
Unknown W. Brackets
16c29a52a8 Improve debugging for bad callback ids. 2012-12-01 23:29:24 -08:00
Unknown W. Brackets
4abcb6a8ac Fix sceUmdWaitDriveStatCB() so it fires right away.
This makes Crisis Core actually show loading again.
2012-12-01 23:29:23 -08:00
Unknown W. Brackets
c00f3dcdd8 Implement sceUmdCancelWaitDriveStat(). 2012-12-01 23:29:22 -08:00
Unknown W. Brackets
a2ee736793 Process events when idle or switching threads.
Fixes hrydgard/ppsspp#104, so things execute more accurately.
2012-11-30 23:09:14 -08:00
Unknown W. Brackets
998104e2eb Consider threads still waiting until they wake.
This seems to match the actual behavior of timeouts much better.
2012-11-30 23:04:24 -08:00
Ced2911
6db4ea2ad1 less Memory::GetPointer 2012-11-27 10:18:36 +01:00
Unknown W. Brackets
fa9b9840d0 Implement LwMutex locking and unlocking. 2012-11-21 00:21:25 -08:00
Unknown W. Brackets
b71d998a20 Broadcast a threadend event to wake mutexes. 2012-11-20 02:20:16 -08:00
Unknown W. Brackets
619a9906de Remove threads from semaphores when they timeout.
This makes wait tests *almost* pass.  There's some timing
related issues left, though.
2012-11-20 02:20:15 -08:00
Unknown W. Brackets
4d71e32193 Update the value when mutexes timeout. 2012-11-20 02:20:14 -08:00
Unknown W. Brackets
d88fa153b7 Implement timeouts on mutexes.
Still need to set timeoutPtr after they expire.
Pretty sure I did this the right way, seems CoreTiming does already
allow/use multiple events for the same type?
2012-11-20 02:20:13 -08:00
Unknown W. Brackets
b9bb5c4cce Make sceKernelStartThread() reschedule.
Mutexes and semaphores are wrong, duh.
2012-11-20 02:20:13 -08:00
Henrik Rydgard
8e3148587a Merge branch 'master' of github.com:hrydgard/ppsspp 2012-11-18 23:40:35 +01:00
Henrik Rydgard
d572d40c36 More warning fixing 2012-11-18 23:35:02 +01:00
kev :)
9257b28c15 Limit thread name
Seems this needs to be limited
2012-11-18 19:34:53 +00:00
Henrik Rydgard
7720dc3f60 Various warning, logging, jit fixes 2012-11-17 19:56:28 +01:00
Henrik Rydgard
423bba5d8d Some optimization and minor fixes 2012-11-17 15:06:10 +01:00
Henrik Rydgard
5a48578a12 Rewrite audio line output. Now deterministic (from the game's POV) and smoother. 2012-11-17 14:20:59 +01:00
Henrik Rydgard
059bb3c40c Buildfix, bugfix. Fixes issue 46. 2012-11-13 20:10:48 +01:00
Unknown W. Brackets
d1fd16ecba sceKernelStartThread(): skip argPtr for 0 args.
This makes threads/semaphores pass, so adding to passing list.
Depends on an update to pspautotests.
2012-11-12 08:16:16 -08:00
Unknown W. Brackets
808c7e9807 Fix crash in sceKernelExitDeleteThread().
0 means current thread, seen in Wild Arms XF.
Doesn't make the game run but at least it doesn't segfault.
2012-11-11 20:09:03 -08:00
Henrik Rydgard
4c1883e73f Some stubs, "NOP" out registerexitcallback, implement cancelwakeup 2012-11-12 00:04:57 +01:00
Henrik Rydgard
0fb8c08af3 Test fixes and cleanups 2012-11-11 22:38:19 +01:00
Henrik Rydgard
387552f564 Misc fixes (accept .prx, work on power callbacks, bugs) 2012-11-10 10:15:11 +01:00
Henrik Rydgard
d671afdef4 sceImpose 2012-11-09 12:31:58 +01:00
Henrik Rydgard
b24511ac41 Hackery to free up RAM (sceKernelMaxFreeMemSize lies a bit more, kill root stack) 2012-11-09 00:03:46 +01:00
Henrik Rydgard
040b6199b7 missing include 2012-11-08 18:02:33 +01:00
Henrik Rydgard
79a433e05d Merge branch 'master' of github.com:hrydgard/ppsspp 2012-11-08 16:28:59 +01:00
Henrik Rydgard
259b169bbc Implement a few more little things 2012-11-08 16:28:45 +01:00
Arthur Blot
b96d86ab7f Implemented MBXes 2012-11-08 14:24:51 +01:00
Henrik Rydgard
1391d83afd Never do RETURN() after blocking (Wait etc), as it will zero out a register in the wrong thread. 2012-11-07 16:05:39 +01:00
Henrik Rydgard
aea0580297 More reworking of Callbacks, plus some other little fixes. 2012-11-07 15:44:48 +01:00
Henrik Rydgard
3e207a1490 Fake netconf dialog, etc 2012-11-06 19:22:14 +01:00
Henrik Rydgard
aca35fc96c More fixes and logging improvements 2012-11-06 18:56:56 +01:00
Henrik Rydgard
28879934d6 Add some missing HLE functions, fix loading unencrypted EBOOT.BIN 2012-11-06 16:20:13 +01:00
Henrik Rydgard
c61d10363a Rewrite callback handling, part 1. All sorts of other fixes too. 2012-11-06 15:46:46 +01:00