dolphin/Source/Core
Léo Lam fff4634a1c IOS: Handle ES_Launch more accurately
This commit fixes ES_Launch to work mostly the same as the real IOS
(except temporary, internal files such as /sys/launch.sys and title
handling; the latter will be handled in a future PR).

First of all, this adds two IOS functions, which correspond to two
IOS syscalls: 0x41 (boot_ppc) and 0x42 (boot_ios).

boot_ios() writes the new version to 0x3140, loads the new kernel,
which then proceeds to reinit IPC and load modules as part of its
boot process. Note that this doesn't include writing to any of the
other constants in the 0x3100 region.
In Dolphin, this is implemented by changing the active IOS
version variable, writing to 0x3140 and resetting all devices. This
has exactly the same effect as the real syscall.

The other syscall, boot_ppc(), writes code to the EXI boot buffer,
pokes all constants to memory before bootstrapping the PPC with a
binary from the NAND.
We skip the low level stuff and just load the DOL to memory (and set
the PPC's PC to 0x3400), which is essentially what IOS does.

The other change is mostly related to how ES_Launch is handled.

With a real IOS, if the launched title type is 00000001 (system) and
the title is not 1-2 (System Menu), ES calls boot_ios().

Otherwise, ES handles the launch as a PPC title. It reads the TMD
to determine the required IOS version. If it is the same, boot_ppc()
is called directly. If not, ES saves the title to launch to the NAND
before launching the new IOS. After the new IOS has finished booting,
it will notice the flag and then launch the requested title.

What this commit does is really just implement this logic into IOS HLE.
The result is a fix for a regression introduced by SetupMemory,
where reloading an IOS would have overwritten some OS constants.
This fixes booting games from the disc channel.
2017-02-27 20:44:30 +01:00
..
AudioCommon C++ conformance fixes (MSVC /permissive-) 2017-02-15 20:37:04 -08:00
Common Merge pull request #4966 from RisingFog/remove_traversal_server_debug_mode 2017-02-27 16:18:13 +13:00
Core IOS: Handle ES_Launch more accurately 2017-02-27 20:44:30 +01:00
DiscIO ES: Make sure the TMD and ticket are valid before use 2017-02-26 19:46:30 +01:00
DolphinQt2 Use .manifest file for apps on Windows 2017-02-10 14:18:45 -08:00
DolphinWX Merge pull request #4896 from leoetlino/esformats 2017-02-27 16:15:05 +13:00
InputCommon Merge pull request #4960 from lioncash/type 2017-02-26 15:56:34 -08:00
UICommon Add command line parsing to UICommon. 2017-02-16 17:24:58 +01:00
VideoBackends Merge pull request #4924 from stenzek/vulkan-list-restart 2017-02-18 21:58:30 +10:00
VideoCommon Merge pull request #4800 from JosJuice/movie-dual-core-determinism 2017-02-23 13:19:39 -08:00
CMakeLists.txt [UI] Remove DolphinQt 2016-01-05 19:42:02 -06:00