Commit Graph

213 Commits

Author SHA1 Message Date
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
Unknown W. Brackets
5aceceecd3 Remove global module id var hacks.
Nothing needs them anymore.
2013-04-10 21:16:31 -07:00
Unknown W. Brackets
1f1560a9d6 Don't mark sceKernelExitThread() as an error.
Also, add some reporting and make the sceKernelCreateThread log message
shorter.
2013-04-09 23:23:10 -07:00
Unknown W. Brackets
5e14cab945 Don't save vregs for threads that don't use them. 2013-04-07 11:47:00 -07:00
Unknown W. Brackets
c7020d4872 Optimize resched with a running thread.
Esp. if it would go back to itself.
2013-04-07 11:47:00 -07:00
Unknown W. Brackets
68f5596dee Fix crash if queue is empty during savestate.
On load it would then crash.
2013-04-07 10:32:39 -07:00
Unknown W. Brackets
da2d5f0692 Dynamically size the thread queue, explicitly alloc. 2013-04-07 10:27:29 -07:00
Unknown W. Brackets
2ee611de09 Replace the thread ready queue with non-STL.
It seems much faster.
2013-04-07 03:10:14 -07:00
Unknown W. Brackets
4cd260a2fc Centralize the thread ready queue logic.
This makes it slower for now, but should make it easier to optimize correctly.
2013-04-07 03:09:23 -07:00
Unknown W. Brackets
65ac7389d7 Don't get stuck on idle when interrupts run.
This was happening when the dispatch thread was disabled.
2013-04-06 17:04:20 -07:00
Unknown W. Brackets
2367c17735 Don't suspend/resume dispatch while interrupts off. 2013-04-06 17:04:18 -07:00
Unknown W. Brackets
8f17cef95b Stop threadend timeout when the thread ends.
Fixes threads waking up early in tests.
2013-04-06 17:04:16 -07:00
Unknown W. Brackets
c57954a72e Implement sceGeDrawSync(). 2013-04-06 02:30:37 -07:00
Unknown W. Brackets
72921e0a3c If the mipscall id doesn't match, don't create.
Fixes a crash when savestating.
2013-03-31 12:09:59 -07:00
Unknown W. Brackets
2a9c640739 When starting a thread, put old thread at end.
This matters so the right thread is run later when scheduling switches
back.
2013-03-31 09:45:41 -07:00
Unknown W. Brackets
fe60677f75 Make mutexes handle callbacks better + before.
Mutex and semaphores (but NOT lwmutexes) call callbacks before attempting
the lock, but only if it would not generate errors.

Have not yet tested other wait types.
2013-03-30 16:12:38 -07:00
Unknown W. Brackets
eace0e75c1 sceKernelWaitSemaCB() should run callbacks first.
Patapon 2 gets back to the menu with this.
2013-03-30 16:12:38 -07:00
Unknown W. Brackets
d2abdf17be Add a waittype registry to handle callbacks right. 2013-03-30 16:12:37 -07:00