This change makes for a clearer (less confusing) path of execution in the scheduler, now the code to execute when a thread awakes is closer to the code that puts the thread to sleep (WaitSynch1, WaitSynchN). It also allows us to implement the special wake up behavior of ReplyAndReceive without hacking up WaitObject::WakeupAllWaitingThreads.
If savestates are desired in the future, we can change this implementation to one similar to the CoreTiming event system, where we first register the callback functions at startup and assign their identifiers to the Thread callback variable instead of directly assigning a lambda to the wake up callback variable.
Don't automatically assume that Thread::Create will only be called when the parent process is currently scheduled. This assumption will be broken when applets or system modules are loaded.
Only use the HLE interface if an HLE applet with the desired id was started.
This commit reorganizes the APT code surrounding parameter creation and delivery to make it easier to support LLE applets in the future.
As future work, the HLE applet interface can be reworked to utilize the same facilities as the LLE interface.
The loaders now register each loaded ROM with the SelfNCCH factory, which keeps the data around for the duration of the emulation session.
When opening the SelfNCCH archive, the factory queries the current program's programid and uses that as a key to the map that contains the NCCHData structure (RomFS, Icon, Banner, etc).
3dsx files do not have a programid and will use a default of 0 for this value, thus, only 1 3dsx file with RomFS is loadable at the same time.
* Services/UDS: Added a function to generate the EAPoL-Start packet body.
* Services/UDS: Added filter for beacons.
* Services/UDS: Lock a mutex when accessing connection_status from both the emulation and network thread.
* Services/UDS: Handle the Association Response frame and respond with the EAPoL-Start frame.
* fixup: make use of current_node, changed received_beacons into a list, mutex and assert corrections
* fixup: fix damn clang-format
As per 3dbrew:
"During Home Menu start-up it uses APT:PrepareToStartNewestHomeMenu. If that doesn't return an error(normally NS returns 0xC8A0CFFC for that), Home Menu starts a hardware reboot with APT:StartNewestHomeMenu etc. "
We need to know what is being run so we can set the APT parameter destination AppId correctly.
Delaying the preparation of the parameter until we know which AppId is running lets us support booting both the Home Menu and normal game Applications.