misson20000 / twili

Homebrew debug monitor for the Nintendo Switch.
GNU General Public License v3.0
184 stars 23 forks source link

[WIP] Reorganization + Applet Support #52

Closed misson20000 closed 5 years ago

misson20000 commented 5 years ago

Closes #5. Finally. :eyes:

Summary

Many parts of Twili have been moved to separate directories.

Process management has been greatly reorganized.

Applet Summary

twili_applet_shim overrides the album applet. When it is launched, it connects to Twili and opens an IAppletShim. Twili checks against the AppletTracker to see if it already has a "control applet". If it does not, the twili_applet_shim becomes a control applet, which waits for messages from Twili. When an AppletProcess is Launch()ed, it is added to a queue in AppletTracker and a message is sent to the control applet to spawn another instance of twili_applet_shim through am's ILibraryAppletCreator interface, and to use a new loader extension to request that the loader add enough extra memory to fit the target process image in. When this instance of twili_applet_shim opens its IAppletShim, since Twili already has a control applet, it will then check if there are any AppletProcesses queued. If there are, the new twili_applet_shim becomes a "host" applet. The target process image is loaded into the host applet and it jumps to the entrypoint.

Todo

todo[bot] commented 5 years ago

report error back to Twili

https://github.com/misson20000/twili/blob/a173b7c0daf9e53737507f37b3ec508bd5297e53/twili_applet_shim/twili_applet_shim.cpp#L137-L142


This comment was generated by todo based on a TODO comment in a173b7c0daf9e53737507f37b3ec508bd5297e53 in #52. cc @misson20000.
misson20000 commented 5 years ago

NOTE: I've merged this into master even though it's not quite working yet with the new changes.