Unknown W. Brackets
a1e69d1c4f
Fix wrong thread id when resuming after interrupt.
...
Who knows what kind of havoc this was causing.
2013-07-04 02:04:06 -07:00
Unknown W. Brackets
933c8abb55
Check kernel object types when looking up ids.
...
Some games misuse it, need to return an error.
2013-06-18 23:54:29 -07:00
Unknown W. Brackets
1e805e7fc8
Return correct errors in sceKernelDeleteThread().
...
And also, don't reschedule in sceKernelTerminateDeleteThread(), per tests.
2013-06-15 00:05:21 -07:00
Unknown W. Brackets
1c1293826c
Return correct errors on terminating thread.
...
Fixes Final Fantasy 4 hangs when playing videos a second time.
2013-06-09 18:56:36 -07:00
Unknown W. Brackets
fe1c26f2b2
Add a safety check for non-rtti.
2013-06-09 08:35:54 -07:00
Henrik Rydgard
2afbc94734
Turn off RTTI, simulate it where needed.
2013-06-09 13:02:16 +02:00
Unknown W. Brackets
0c41d4e952
Don't allow release wait for HLE delays.
...
Although, presumably the thread would stop waiting, I guess the HLE func
in most cases probably checks and re-waits?
Fixes breakage in Jeanne d' Arc, which constantly releases from wait the
main thread, but calls things like sceMpegCreate which do block.
2013-06-08 23:39:49 -07:00
Unknown W. Brackets
32a557803b
Reporting in sceKernelChangeCurrentThreadAttr().
2013-06-06 00:08:24 -07:00
Unknown W. Brackets
e4dc030b83
Reset restarted thread priorities properly.
2013-06-05 23:57:27 -07:00
Unknown W. Brackets
5fe537cac6
sceKernelChangeThreadPriority() can't do dormant.
2013-06-05 23:52:24 -07:00
Unknown W. Brackets
12005267ac
Reschedule in sceKernelChangeThreadPriority().
...
Seems like this is another way to yield, makes sense.
2013-06-05 23:42:42 -07:00
Unknown W. Brackets
e16cd7d9d9
Validate params in sceKernelChangeThreadPriority().
2013-06-05 23:04:42 -07:00
Unknown W. Brackets
06c19622d5
Fix some init/type warnings.
2013-05-31 23:14:29 -07:00
lioncash
743f5185b8
Missed including this in the __KernelSwitchContext null check fix.
...
This shouldn't be called if target is null.
2013-05-30 11:55:29 -04:00
lioncash
81a91fbcbb
Ensure code inside method __KernelSwitchContext in sceKernelThread.cpp isn't unintentionally executed.
...
The null check around line 2935 for target also makes me think this was supposed to have been done.
2013-05-30 11:47:10 -04:00
Unknown W. Brackets
f397f83b4f
Buildfix for Mac / iOS.
2013-05-26 19:02:40 -07:00
Unknown W. Brackets
727b3b4127
Get rid of the "root" return hack.
2013-05-26 10:36:18 -07:00
Unknown W. Brackets
c34854ead3
Use a custom RA for module funcs. Not used yet.
...
But it will be.
2013-05-26 10:28:08 -07:00
Unknown W. Brackets
a779645152
Wrap sceKernelGetThreadExitStatus().
...
So it's usable internally too.
2013-05-26 10:17:59 -07:00
Unknown W. Brackets
2c4254d0c8
Disallow suspend/resume on current thread.
...
Might be some extra subtle things with callbacks/interrupts here...
2013-05-26 02:25:53 -07:00
Unknown W. Brackets
e6795b1a41
Initial attempt at a suspend/resume thread impl.
2013-05-26 01:01:29 -07:00
Unknown W. Brackets
690e52bc34
Make sure we keep the suspend state around.
...
I assume it sticks around in this case.
2013-05-25 23:57:04 -07:00
Unknown W. Brackets
084ad5aa53
Wrap the sleep/wakeup HLE funcs.
2013-05-25 20:43:19 -07:00
Unknown W. Brackets
8adf1e9ede
Properly return success in sceKernelWakeupThread().
...
Fixes #1596 , fixes #1796 , possibly others. I can't believe how long
I stared at this code and debugged it without noticing such a simple
thing...
2013-05-25 20:28:22 -07:00
Henrik Rydgard
4b15fe3c5e
Minor cleanup
2013-05-19 18:45:58 +02:00
raven02
c378af0878
Fix Dragon Ball Z Tenkaichi Tag Team
2013-05-19 19:56:18 +08:00
Unknown W. Brackets
ead70f56d9
Add a safety check to prevent leaks.
2013-05-18 20:21:29 -07:00
Unknown W. Brackets
0fb5877d75
Implement sceKernelExtendThreadStack().
...
Fixes #1833 . Implemented using fake nids instead of callbacks since
it's simpler to get them (and waits and recursion) right.
2013-05-18 20:21:28 -07:00
Unknown W. Brackets
f91135cedf
Prevent some threading related NULL derefs.
2013-05-18 10:19:34 -07:00
Henrik Rydgård
c13a101901
Merge pull request #1765 from unknownbrackets/perf
...
Eat cycles in sceKernelReferThreadStatus()
2013-05-11 14:31:42 -07:00
Unknown W. Brackets
16fe2c9691
Eat cycles in sceKernelReferThreadStatus().
...
Improves .hack//Link (demo)'s perf significantly, doesn't hurt anyone
else.
2013-05-11 12:25:55 -07:00
Unknown W. Brackets
5318e97a2e
Threads starting better threads should stay at top.
...
This wasn't correct, I think I must've added it because something else
should've been rescheduling.
2013-05-11 11:28:37 -07:00
Henrik Rydgard
5fc8de091d
Make some logging VERBOSE
2013-05-09 11:18:38 +02:00
Unknown W. Brackets
bf826ed9c1
Correct delay for sceKernelDelayThread(0).
...
It's not 200 for 0, more like 100ish.
2013-05-04 23:42:10 -07:00
Unknown W. Brackets
f1f2cf0603
Replace some hleEatCycles() with actual PSP timing.
...
Measured several runs at 8 per run with test overhead check.
2013-05-04 23:42:10 -07:00
nachume
2181b76c42
ISO that replaced EBOOT.BIN is playable.
...
implement LoadExecForUer_362A956B() and sceKernelRegisterExitCallback.
Add some ERROR define on kernel.h. I was referring to the jpcsp.
2013-05-04 20:34:33 +09:00
Unknown W. Brackets
b18235d2e0
Sneak in a quick logging fix.
2013-04-28 11:27:05 -07:00
Unknown W. Brackets
acdd14f0d4
Fix initial thread stack, arg space and alignment.
...
Anything that used > 256 bytes of args was probably broken...
2013-04-28 00:34:49 -07:00
Unknown W. Brackets
d131588a6d
Validate sceKernelStartThread() args better.
2013-04-28 00:34:49 -07:00
Unknown W. Brackets
df62cafe3d
Handle a few errors on thread create better.
...
Especially out of stack space.
2013-04-28 00:34:48 -07:00
Unknown W. Brackets
fb758de3b9
sceKernelWakeupThread() should reschedule on wake.
...
Otherwise it will have different timing than the PSP.
2013-04-28 00:34:48 -07:00
Unknown W. Brackets
c8958a253d
Cleanup some unused / duplicate code in threading.
2013-04-28 00:34:48 -07:00
Unknown W. Brackets
e30dedd46f
Allocate thread stack on create, not on start.
...
Also, don't free and reallocate on thread reset.
2013-04-28 00:34:47 -07:00
Unknown W. Brackets
c089fcec27
Fix size handling in sceKernelReferThreadStatus().
2013-04-28 00:34:47 -07:00
JimLee168
3ce26e03df
Add part sceKernelExtendThreadStack content
...
Fixes NPJH50624
2013-04-19 22:22:35 +08:00
Unknown W. Brackets
efd71e2444
Make sceKernelNotifyCallback() error if invalid cb.
...
Which makes Numblast clearly happy.
2013-04-14 23:45:46 -07:00
Henrik Rydgård
d92dbf8f6d
Merge pull request #1268 from unknownbrackets/savestates
...
Bump savestate version, add better error checking
2013-04-13 02:09:12 -07:00
Unknown W. Brackets
fe97fd6fc5
Add better savestate error handling.
...
Aborts when it can't load.
2013-04-13 01:39:17 -07:00
Unknown W. Brackets
0ad9658eb2
Increment wakeupCount when a thread is pending.
...
It might've been woken up but just not run yet. That doesn't mean
it should not have wakeupCount incremented.
Fixes Tales of Eternia freezing before world map.
2013-04-13 00:35:24 -07:00
Henrik Rydgård
b5b13c6ab5
Merge pull request #1251 from unknownbrackets/module-minor
...
Cleanup sceKernelGetModuleIdByAddress()
2013-04-11 00:45:42 -07:00