Commit Graph

323 Commits

Author SHA1 Message Date
Léo Lam f106a9637d Replace balanced Core::PauseAndLock calls with RunAsCPUThread
Core::PauseAndLock requires all calls to it to be balanced, like this:

    const bool was_unpaused = Core::PauseAndLock(true);
    // do stuff on the CPU thread
    Core::PauseAndLock(false, was_unpaused);

Aside from being a bit cumbersome, it turns out all callers really
don't need to know about was_unpaused at all. They just need to do
something on the CPU thread safely, including locking/unlocking.

So this commit replaces Core::PauseAndLock with a function that
makes both the purpose and the scope of what is being run on the
CPU thread visually clear. This makes it harder to accidentally run
something on the wrong thread, or forget the second call to
PauseAndLock to unpause, or forget that it needs to be passed
was_unpaused at the end.

We also don't need comments to indicate code X is being run on the
CPU thread anymore, as the function name makes it obvious.
2017-07-21 16:45:59 +08:00
Léo Lam f06367febc WX: Add menu item to perform online update 2017-06-28 11:22:10 +02:00
Léo Lam 0c7b9570b4 Move WiiUtils to Core
Allows reusing the WAD import logic more easily, whereas UICommon
code can only be used from UICommon and UI.

And managing what's on the NAND is the Core's responsability, not UI.
2017-06-28 11:22:10 +02:00
Leo Lam aa020040f6 Merge pull request #5681 from spycrab/qt_safeshutdown
Qt: Implement safe shutdown
2017-06-26 21:55:27 +02:00
shuffle2 7d60f03acb Merge pull request #5687 from shuffle2/wx-cache
DolphinWX: properly sync EmuState and banner changes.
2017-06-26 12:40:40 -07:00
Shawn Hoffman f51df62344 DolphinWX: properly sync EmuState and banner changes. 2017-06-26 12:35:40 -07:00
spycrab 2de31317e9 UICommon: Move TriggerSTMPowerEvent() from Wx 2017-06-26 16:28:39 +02:00
Léo Lam 60c6fbe9cc Add CommonTitles.h for common Wii title IDs 2017-06-26 15:17:55 +02:00
Shawn Hoffman a66b747366 DolphinWX: show simple message about scanning in statusbar. 2017-06-23 17:25:53 -07:00
Shawn Hoffman c5fa470ad8 replace DoFileSearch with optimized version 2017-06-23 17:25:53 -07:00
Shawn Hoffman f16599f4a8 DolphinWX: defer gamelist scanning and switch to single-file cache. 2017-06-23 17:25:53 -07:00
Léo Lam 22992ae41e Boot: Clean up the boot code
* Move out boot parameters to a separate struct, which is not part
  of SConfig/ConfigManager because there is no reason for it to
  be there.

* Move out file name parsing and constructing the appropriate params
  from paths to a separate function that does that, and only that.

* For every different boot type we support, add a proper struct with
  only the required parameters, with descriptive names and use
  std::variant to only store what we need.

* Clean up the bHLE_BS2 stuff which made no sense sometimes. Now
  instead of using bHLE_BS2 for two different things, both for storing
  the user config setting and as a runtime boot parameter,
  we simply replace the Disc boot params with BootParameters::IPL.

* Const correctness so it's clear what can or cannot update the config.

* Drop unused parameters and unneeded checks.

* Make a few checks a lot more concise. (Looking at you, extension
  checks for disc images.)

* Remove a mildly terrible workaround where we needed to pass an empty
  string in order to boot the GC IPL without any game inserted.
  (Not required anymore thanks to std::variant and std::optional.)

The motivation for this are multiple: cleaning up and being able to add
support for booting an installed NAND title. Without this change, it'd
be pretty much impossible to implement that.

Also, using std::visit with std::variant makes the compiler do
additional type checks: now we're guaranteed that the boot code will
handle all boot types and no invalid boot type will be possible.
2017-06-06 16:27:52 +02:00
JosJuice b2af07a7b7 DiscIO: Remove C/I/S prefixes from class names
These prefixes were inconsistent with the rest of Dolphin.

I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-06 12:31:59 +02:00
Léo Lam 94bb55cef0 WX: Replace 'BIOS' with 'IPL'
It's not really a BIOS.
2017-06-04 10:20:16 +02:00
Leo Lam 227bc3816f Merge pull request #5517 from leoetlino/more-reliable-shutdown
More reliable shutdown
2017-06-03 21:33:43 +02:00
Léo Lam 546181c457 WX: Clear m_is_game_loading at the proper moment
This should happen after the core has stopped (OnStopped), not when
the user wants to stop (DoStop).
2017-06-03 19:05:35 +02:00
Léo Lam 677640ac52 Drop m_LastFilename
This makes it hard to support different boot params for different boot
types. We should not be making the assumption that Dolphin will
always be booting directly from a file (and in particular, only
using a string).

It's incompatible with future changes that will allow Dolphin to boot
a NAND title properly from well, the NAND, as opposed to booting from
WADs. (And no, treating the title TMD as a "bootable" path doesn't
count. Especially when that approach won't work with NAND images
or IOS LLE.)

And it's confusing to expose this functionality from the UI. It's
pretty bad for UX to change the play button's behaviour depending on
whether the user has launched something before, configured a default
file to boot, added a directory to their game paths.
2017-06-03 18:01:25 +02:00
Léo Lam d5e397aa14 WX: Add dff to the file selector filter description 2017-05-28 19:08:24 +02:00
Léo Lam 473f90c08f WX: Remove .tmd from the file selector filter
No idea why it was in the whitelist.
2017-05-28 19:07:12 +02:00
Leo Lam f4190ab1c4 Merge pull request #5465 from sepalani/gc-bios
Tools: Load GameCube BIOS added
2017-05-26 10:23:03 +02:00
Sepalani 2d75a99426 ConfigManager: GetBootROMPath added 2017-05-25 13:11:12 +01:00
Sepalani 95ea721f06 Tools: Load GameCube BIOS added 2017-05-22 22:44:21 +01:00
Starsam80 618eb9f743
NANDImporter: Use a indeterminate progress meter 2017-05-19 16:31:47 -06:00
JosJuice ac5c82b36b DiscIO: Remove VolumeCreator
This file is pretty small now that it doesn't handle Wii
partitions anymore, so let's move its contents to Volume.cpp.
This is also more consistent with how blob creation works.
2017-05-19 18:33:21 +02:00
Leo Lam bc5496e119 Merge pull request #5444 from sepalani/code
FrameTools: Prevent dummy code map to be saved
2017-05-19 16:33:40 +02:00
Sepalani 649eb43d98 FrameTools: Prevent dummy code map to be saved 2017-05-19 15:04:11 +01:00
Mat M 35a8771e68 Merge pull request #5427 from lioncash/host
Host: Get rid of Host_SetStartupDebuggingParameters()
2017-05-18 19:04:25 -04:00
Lioncash 7baabe99d1 Host: Get rid of Host_SetStartupDebuggingParameters()
This is something that should be the responsibility of the frontend
booting the game. Making this part of the host 'interface' inherently
requires frontends to leak internal details (much like the other
UI-related functions in the interface).

This also decouples more behavior from the debugger and the
initialization process in the wx frontend. This also eliminates several
usages of the parent menubar in the debugger code window.
2017-05-14 19:12:59 -04:00
Léo Lam c8bffb0153 Reuse the IOS code for WAD installation
* Less code and logic duplication.

* Fixes a bug with the data dir not being created, steps being done in
  the wrong order.
2017-05-14 15:30:42 +02:00
MerryMage c68c6d0f2d Frame: Remove unused member function OnToggleDualCore 2017-05-13 19:43:49 +01:00
Léo Lam bacf52384f IOS/ES: Implement DeleteTitleContent properly
Just like DeleteTitle, Using CNANDContentManager is overkill,
inefficient and useless. And it results in a few failures in
situations where a delete should just always work.

But here it gets bonus points, because it manages to actually use
the TMD for deleting contents, when IOS does none of that and just
deletes files ending with .app in the title content directory. :)
2017-05-13 00:34:58 +02:00
JosJuice 71d105e545 DolphinWX: Use title ID from ISOFile when possible
This skips creating volume objects, which can take a while.
2017-05-06 18:39:51 +02:00
Anthony ad829ec7a9 Merge pull request #5232 from MerryMage/osx-screensaver
Disable screensaver on OS X
2017-05-02 19:00:21 -07:00
Mat M 7c3905a612 Merge pull request #5140 from sepalani/signature_db
SignatureDB: Rewrite FormatHandler API
2017-05-02 19:23:46 -04:00
Lioncash 9e71031e23 Frame: Normalize member names 2017-05-01 05:13:19 -04:00
Léo Lam 2fc5047d26 IOS: Convert the IOS kernel HLE code to a class
This changes the main IOS code (roughly the equivalent of the kernel)
to a class instead of being a set of free functions + tons of static
variables.

The reason for this change is that keeping tons of static variables
like that prevents us from making an IOS instance and reusing IOS
code easily.

Converting the IOS code to a class also allows us to mostly decouple
IOS from the PPC emulation.

The more interesting changes are in Core/IOS/IOS. Everything else is
mostly just boring stuff required by this change...

* Because the devices themselves call back to the main IOS code
  for various things (getting the current version, replying to a
  request, and other syscall-like functions), just like processes in
  IOS call kernel syscalls, we have to pass a reference to the kernel
  to anything that uses IOS syscalls.

* Change DoState to save device names instead of device IDs to simplify
  AddDevice() and get rid of an ugly static count.

* Change ES_Launch's ack to be sent at IOS boot, now that we can do
  this properly.
2017-04-30 17:18:53 +02:00
Sepalani 5f81226d8d SignatureDB: MEGA FormatHandler added 2017-04-29 19:50:21 +01:00
Léo Lam 3124f3c4d8 WX: Add the ability to uninstall WADs from the game list
Simple quality-of-life addition that allows "uninstalling" WADs
(removing the corresponding installed title) from the NAND.

The option is only enabled when the WAD can be uninstalled

The motivation for this is actually to encourage proper usage of the
WAD launch feature (installing it to the NAND first), so we can
drop the "direct WAD title launch" hack.
2017-04-25 23:34:32 +02:00
Léo Lam 7a615afe17 Merge pull request #5315 from sepalani/debug-pause
DoStop() shouldn't unpause in debug mode
2017-04-25 16:48:31 +02:00
Léo Lam dd31a403db Merge pull request #5285 from spycrab/fr_9952
Make title column toggleable (Issue #9952)
2017-04-24 23:12:39 +02:00
Sepalani 4a55398069 DoStop() shouldn't unpause in debug mode 2017-04-24 17:32:15 +01:00
Tilka c6bc474c29 Merge pull request #5291 from Starsam80/fix-10221
WX: Don't specify a parent frame for the render frame
2017-04-23 23:40:32 +01:00
JosJuice 26b6b78f3a Delete WXInputBase
It's unused (apparently since cf8f049). Deleting it will
lighten the load for translators.
2017-04-22 19:39:17 +02:00
Léo Lam bca9a9d4d9 Merge pull request #5113 from Starsam80/nand-import
Add BootMii NAND import functionality
2017-04-21 22:02:15 +02:00
Sepalani 694b10da11 Generate Symbols From RSO Modules added 2017-04-21 00:32:06 +01:00
Starsam80 a41c0d3caa
WX: Don't specify a parent frame for the render frame 2017-04-19 20:06:33 -06:00
spycrab 72e92add8a Make title column toggleable (Issue #9952) 2017-04-17 19:34:14 +02:00
spycrab 01e07d7853 Lazily initialize m_main_config_dialog (Issue #10213) 2017-04-16 13:00:11 +02:00
MerryMage c9b2c29ead Frame: Extract screensaver-related code into InhibitScreensaver/UninhibitScreensaver 2017-04-09 22:14:35 +01:00
Starsam80 6bccc13f3b
Add BootMii NAND import functionality 2017-04-09 13:14:05 -06:00