Commit graph

23124 commits

Author SHA1 Message Date
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
Anthony
ed6a46a193 Merge pull request #4958 from RisingFog/avidump_bitrate
Add configurable video dump bitrate to INI
2017-02-27 10:15:19 -08:00
Anthony
63c5230d9b Merge pull request #4959 from lioncash/ini
IniFile: Handle s64/u64 values
2017-02-27 10:02:53 -08:00
Anthony
0cac00a39c Merge pull request #4977 from ligfx/fixwxmainmenubar
DolphinWX: don't refresh MainMenuBar on construction
2017-02-27 09:42:01 -08:00
Anthony
b16cebc297 Merge pull request #4978 from ligfx/avidumpclosefiles
AVIDump[regression]: close avio handles
2017-02-27 09:39:40 -08:00
Jules Blok
f5d14e3691 Merge pull request #4933 from Armada651/disable-cache
VideoBackends: Add a developer option to disable the shader cache.
2017-02-27 17:35:01 +01:00
Léo Lam
ac43836714 IOS/ES: Implement DeleteTitle
No idea why this wasn't implemented whereas ES_DeleteTicket and
ES_DeleteTitleContent were.

This probably fixes title deletion in old System Menus, and maybe
the new ones as well in some cases; I've seen 4.3 use this ioctlv.
2017-02-27 15:32:31 +01:00
Michael Maltese
621472336c AVIDump[regression]: close avio handles 2017-02-26 23:26:31 -08:00
Matthew Parlane
d666363ac4 Merge pull request #4966 from RisingFog/remove_traversal_server_debug_mode
Turn Off Debug Mode for Traversal Server
2017-02-27 16:18:13 +13:00
Matthew Parlane
ca9504d0fa Merge pull request #4969 from leoetlino/clear-tmp
IOS: Clear the /tmp directory on IOS boot
2017-02-27 16:17:49 +13:00
Matthew Parlane
48aeb5bf4b Merge pull request #4896 from leoetlino/esformats
Use ESFormats for tickets, TMDs and views
2017-02-27 16:15:05 +13:00
Scott Mansell
d1b343ab5a Merge pull request #4976 from ligfx/fixwxcommandlineassertion
DolphinWX: provide empty OnCmdLineParsed
2017-02-27 15:10:01 +13:00
Michael Maltese
720f0ab93f DolphinWX: don't refresh MainMenuBar on construction
On startup, wxWidgets pops up an assertion error:

> ./src/osx/menu_osx.cpp(648): assert ""IsAttached()"" failed in
> Refresh(): can't refresh unatteched menubar
2017-02-26 17:50:36 -08:00
Michael Maltese
a3e3986906 DolphinWX: provide empty OnCmdLineParsed
Starting in #4916, upon startup wxWidgets pops up an assertion error:

> ./src/common/cmdline.cpp(527): assert ""Assert failure"" failed in
> FindOptionByAnyName(): Unknown option verbose

Fix this by overriding wxApp::OnCmdLineParsed to disable the default
handling (since we also disable the default options in
DolphinApp::OnInitCmdLine).
2017-02-26 17:38:18 -08:00
Anthony
7bcff99d89 Merge pull request #4963 from leoetlino/sysconf
SysConf: Use vectors instead of raw pointers
2017-02-26 16:09:17 -08:00
Anthony
832e0501db Merge pull request #4960 from lioncash/type
ControlGroup: Convert group type enum into an enum class
2017-02-26 15:56:34 -08:00
Anthony
0dde642b7d Merge pull request #4917 from leoetlino/config
New configuration namespace
2017-02-26 15:54:25 -08:00
Anthony
06428c3f14 Merge pull request #4916 from leoetlino/cpp-optparse
Use cpp-optparse for command line parsing
2017-02-26 15:51:35 -08:00
Anthony
722ff4c020 Merge pull request #4915 from leoetlino/ini-changes
Expose some ways to manage an INI file
2017-02-26 15:48:53 -08:00
gamemasterplc
4c4a96bfc5 Widescreen Hack improvement
Fixes Projection alignment in some N64 VC games. The original code forgot to multiply rawProjection[1] and rawProjection[3].
2017-02-26 12:55:57 -06:00
Léo Lam
44a3db21e4 ES: Make sure the TMD and ticket are valid before use 2017-02-26 19:46:30 +01:00
Léo Lam
5104caf6a6 Move AES code to Common/Crypto 2017-02-26 19:46:30 +01:00
Léo Lam
c1a139e8ac Use ESFormats for TMDs
We already have a TMDReader, so let's actually use it.

And move ESFormats to IOS::ES, since it's definitely part of IOS.
This adds a DiscIO dependency on Core which will be fixed in a
follow-up PR.
2017-02-26 19:46:29 +01:00
Léo Lam
bf1f70db0a Move the ticket code to ESFormats
This moves some parsing code for tickets and ticket views to ESFormats
instead of duplicating it over DiscIO and Core.
2017-02-26 19:46:28 +01:00
JosJuice
a62711de55 Merge pull request #4968 from lioncash/const-parser
ExpressionParser: Const-correctness changes
2017-02-26 19:24:21 +01:00
JosJuice
6c869f7891 Merge pull request #4955 from leoetlino/wat
Fix the build on non-Windows platforms when not using WX from Externals
2017-02-26 19:19:06 +01:00
Léo Lam
31ebe9b080 IOS: Clear the /tmp directory on IOS boot
The /tmp directory is cleared every time IOS boots up (when the FS
driver is initialized), *not* when /dev/fs is opened.

Although this should have no effect, it fixes the case where files
could be left in /tmp and seen before opening /dev/fs.
2017-02-26 12:19:57 +01:00
Lioncash
f0203157d4 ExpressionParser: Const-correctness changes 2017-02-26 02:09:34 -05:00
Chris Burgener
bfb17d5a9e Add configurable video dump bitrate to INI 2017-02-25 23:58:21 -05:00
Chris Burgener
4669b50e0b Turn Off Debug Mode for Traversal Server 2017-02-25 23:41:12 -05:00
Léo Lam
a1e16c47db SysConf: Use vectors instead of raw pointers 2017-02-26 00:39:50 +01:00
Lioncash
26f17a1723 ControlGroup: Convert group type enum into an enum class
Gets some constants out of the ControllerEmu namespace, and modifies
ControlGroup so that it uses the enum type itself to represent the
underlying type, rather than a u32 value.
2017-02-25 01:15:04 -05:00
Lioncash
beec40f178 IniFile: Handle s64/u64 values 2017-02-25 00:03:20 -05:00
Markus Wick
51136681df Merge pull request #4953 from lioncash/fwd
CachedInterpreter: Forward declare instruction struct
2017-02-24 23:36:11 +01:00
Léo Lam
6702e547cb Fix the build on Linux when not using WX from Externals
No idea why we were including a Windows specific header *without* a
ifdef.
2017-02-24 18:48:26 +01:00
Markus Wick
1f04bab967 Merge pull request #4952 from ligfx/fix_10110
PatchEngine: check instruction at link addr is non-zero
2017-02-24 11:08:15 +01:00
Markus Wick
25fc7ed8c1 Merge pull request #4954 from lioncash/jitbase
JitBase: Put constructor and destructor in the cpp file
2017-02-24 11:05:57 +01:00
Lioncash
0783476464 CachedInterpreter: Forward declare instruction struct
Allows changes to be made to the instruction struct without recompiling
other source files.
2017-02-23 18:08:20 -05:00
Anthony
4e93002adb Merge pull request #4800 from JosJuice/movie-dual-core-determinism
Remove special condition for auto dual core determinism
2017-02-23 13:19:39 -08:00
Anthony
ba5f1c6f59 Merge pull request #4864 from JosJuice/idws-on-temp-nand-only
WiiRoot: Only call InitializeDeterministicWiiSaves on temporary NAND
2017-02-23 13:18:23 -08:00
Anthony
27a5e33b92 Merge pull request #4877 from ligfx/forward_declare_xlib
Remove include X11/Xlib.h from X11Utils.h
2017-02-23 13:17:37 -08:00
Anthony
ecb7d01347 Merge pull request #4889 from ligfx/netwindow
NetWindow: explicitly tell wxWidgets to clean up Windows macros
2017-02-23 13:16:59 -08:00
Anthony
e9850382e3 Merge pull request #4930 from JosJuice/sideways-wiimote-name
Change INI keys containing "Wii Remote" back to "Wiimote"
2017-02-23 13:13:43 -08:00
Anthony
fb8369d0e0 Merge pull request #4950 from leoetlino/set-remotes-before-booting
Netplay: Change Wiimote sources before booting
2017-02-23 13:13:13 -08:00
Lioncash
359528b805 JitBase: Put constructor and destructor in the cpp file
As this is a base class with virtuals, there needs to be an out-of-line
function definition to prevent the vtable of the class being placed within
every translation unit it's used in (i.e. every JIT implementation).
2017-02-23 13:50:47 -05:00
Léo Lam
88a21dd2b9 Fix things mentioned during code review
Ref: https://github.com/dolphin-emu/dolphin/pull/4917
2017-02-23 18:15:12 +01:00
Léo Lam
abe6f8766a Config: Add a few helper functions for repetitive tasks
Getting and setting configuration from the base config layer are common
and repetitive tasks. This commit adds some simpler to use functions to
make the new system easier to work with.

Config::Get and Config::Set are intended to make switching from
SConfig a bit less painful. They always operate on the main system.

Example usage:

    // before
    auto base_layer = Config::GetLayer(Config::LayerType::Base);
    auto core = base_layer->GetOrCreateSection(Config::System::Main, "Core");
    u8 language;
    core->Get("Language", &language, 0);
    SetData("IPL.LNG", language);

    // now
    auto base_layer = Config::GetLayer(Config::LayerType::Base);
    auto core = base_layer->GetOrCreateSection(Config::System::Main, "Core");
    SetData("IPL.LNG", core->Get<u8>("Language", 0));

    // or simply
    SetData("IPL.LNG", Config::Get<u8>("Core", "Language", 0));
2017-02-23 18:15:12 +01:00
Léo Lam
7bd34ac0b5 Config: Trigger callbacks on layer save
And remove an extraneous callback trigger in Config::Load.
2017-02-23 18:15:12 +01:00
Léo Lam
9c3265f1ef Config: Keep track of deleted keys
This allows deleted keys to be deleted from INIs properly.
2017-02-23 18:15:12 +01:00
Léo Lam
b51c6023ba Config: Only save settings if they have been changed 2017-02-23 18:15:12 +01:00