hrydgard/ppsspp — pull request #362 by unknownbrackets (2013-01-08 07:13:09+00:00)
Title: Process module exports and listen to them

This can affect a module start thread's stack and priority, which in turn can cause memory allocation to fail on startup. Most credit has to go to JPCSP for the NIDs.

Fixes Fieldrunners, Ys Seven, and Shadow of Destiny to actually start. The first two go somewhere too. Probably other games as well.

The export linkage is ultimately needed for games like Valkyrie Profile: Lenneth which use `sceKernelLoadModule()` for internal cross-linked modules (I have code that seems to make `sceKernelStartModule()` work so this is testable, but I want to figure out how to make a test for it...)

While messing with this, I noticed that unresolved modules are left as a "jr; nop". I had to trace it to notice it was going into nop-land.

Would it be better to encode an unknown syscall for unresolved exports? That way, if a game is trying to call a func over and over it would show up in logs.

-[Unknown]