Commit Graph

2478 Commits

Author SHA1 Message Date
Matthew Parlane dac6a66252 Merge pull request #4769 from lioncash/settingshandler
SettingsHandler: Minor cleanup
2017-02-08 18:15:37 +13:00
Léo Lam db7ee668ff Notify user that USB won't work if libusb init fails 2017-02-07 00:47:21 +01:00
Matthew Parlane d244597b42 Merge pull request #4408 from leoetlino/usb
IOS: USB support (OH0, USB_VEN, USB_HID)
2017-02-07 09:17:05 +13:00
Michael Maltese acc8dae2b3 CMake: use configure_file to generate scmrev.h
The built-in `configure_file` command correctly handles the case where
none of the variables change and scmrev.h doesn't need to be rebuilt.
This saves a full re-link of Dolphin any time CMake is re-run.
2017-02-05 22:26:49 -08:00
Chris Burgener 5224771dac Copy Wii save for current game for Netplay and TAS 2017-02-05 13:17:05 -05:00
Léo Lam c9f4889437 IOS: Re-implement USB_HIDv4 (/dev/usb/hid)
This reimplements the USB HID v4 IOS device using the new common
USB code (to reuse more code and allow emulated HIDs to be added
more easily in the future).

The main difference is that HIDs now have to be whitelisted, like
every other USB device for OH0 and VEN.
2017-02-05 11:36:49 +01:00
Léo Lam c8a6dc6c23 Use a single libusb context
libusb on Windows is limited to only a single context. Trying to open
more than one can cause device enumerations to fail randomly.

libusb is thread-safe and we don't use the manual polling support (with
`poll()`) so this should be safe.
2017-02-05 11:36:48 +01:00
JosJuice bc2b9f4c3c Translate Swedish in example strings to English 2017-02-04 22:51:01 +01:00
degasus f31b25fe39 Jit64: Enable branch following. 2017-01-28 02:48:56 +01:00
Lioncash c748158182 SettingsHandler: Make GenerateSerialNumber static
This doesn't depend on class internals.
2017-01-27 10:29:57 -05:00
Lioncash 98291cd843 SettingsHandler: Add Open and Save member functions 2017-01-27 10:29:49 -05:00
Stenzek 0f978227f5 Common: Use function-level targeting for CRC32 (SSE4.2) 2017-01-24 20:04:55 +10:00
Stenzek 0f1b5a05ea Common: Support for function-specific instruction set target on x64 2017-01-24 20:04:55 +10:00
Florent Castelli a917d247ed DolphinWX: Remove HAVE_WX preprocessor define
I think we don't have to double check it when building the WX target.
2017-01-24 05:48:08 +01:00
Florent Castelli 0baf1c78c0 vs: Move defines out of Common.h to the build system 2017-01-24 03:55:46 +01:00
Florent Castelli a7bf9271b5 Fix missing includes 2017-01-24 03:31:51 +01:00
Florent Castelli c649bf104b cmake: Prevent HAVE_OPENAL and HAVE_PORTAUDIO to be redefined 2017-01-24 03:22:03 +01:00
Michael Maltese 713ec5ffd5 Add includes for building on Windows without PCH 2017-01-23 01:37:41 -08:00
Florent Castelli 2ff10ad021 cmake: Add missing Windows file to common 2017-01-21 00:35:55 +01:00
Florent Castelli 5540cda820 cmake: Don't build traversal_server on Windows, it requires posix platform 2017-01-21 00:35:55 +01:00
Léo Lam 954c41d6e9 IOS: Move out common USB structures
Some structures will be reused and shared between several IOS USB
device implementations. This prepares for the upcoming USB PR.

I've also removed GetPointer calls in the trivial case (BT passthrough)
2017-01-20 18:29:21 +01:00
Léo Lam ef5a855b8e Update log types names from IPC_HLE to IOS
For consistency with the other changes.

WII_IPC_DVD was changed to IOS_DI, as this describes what the log type
is used for in a more specific way.
2017-01-18 21:43:37 +01:00
Lioncash f1542c8e5a Common: Namespace Network.h/.cpp
Necessary to avoid namespace clashes with IOS HLE's namespace name.
2017-01-17 20:46:48 -05:00
Pierre Bourdon 28f0d8e8a7 Merge pull request #4658 from lioncash/bits
Common: Add bit utility header
2017-01-15 17:23:30 +01:00
Pierre Bourdon dd9e6760c4 Merge pull request #4659 from leoetlino/chunkfile-set
Fix ChunkFile for std::set
2017-01-14 20:11:00 +01:00
Léo Lam ea0335f7c1 Fix ChunkFile for std::set
Without this, attempts to savestate std::set will fail with an error
about dropping the const qualifier.

<Lioncash> leoetlino: I'll try to break it down: So, when you do a
 ranged-for on a container, it's essentially syntactic sugar over begin
 and end iterators. std::set is an associative container where the key
 type is the same as the value type, and so it's required that all
 iterator functions return constant iterators. If this wasn't a
 requirement, it would allow changing the ordering of elements from
 outside of the set's API (this is bad).
2017-01-14 19:00:19 +01:00
Lioncash 0a6f0dfb74 Common: Add bit utility header
This attempts to make some bit arithmetic more self-documenting and also
make it easier during review to identify potential off-by-one errors by
making it possible to just specify which bits are being extracted.

Functions both support the case where bits being extracted can vary and
fixed bit extraction. In the case the bits are fixed, compile-time asserts
are present to prevent accidental API usage at compile-time.

e.g. Instead of shifting and masking to get bits 10 to 15,
Common::ExtractBits<10, 15>(value) can just be done instead.
2017-01-14 11:16:02 -05:00
Pierre Bourdon 45d27f7fc7 CommonPaths: Add D_WFSROOT_IDX.
Defaults to $USERDIR/WFS. Used to store the contents normally stored on
WFS mass storage devices.
2017-01-14 17:06:40 +01:00
Lioncash 45415e1057 ColorUtil: Make decodeCI8image's pal parameter const 2017-01-13 17:07:26 -05:00
Matthew Parlane 5790f15be8 Merge pull request #4299 from sepalani/hle_symbols
SymbolDB: Multiple symbols detection allowed
2017-01-13 10:05:32 +13:00
Léo Lam 64101137cd Remove pre-generated SYSCONF
Dolphin is able to generate one with all correct default settings, so
we don't need to ship with a pre-generated SYSCONF and worry about
syncing default settings.

Additionally, this commit changes SysConf to work with session SYSCONFs
so that Dolphin is able to generate a default one even for Movie/TAS.
Which SYSCONF needs to be touched is explicitly specified to avoid
confusion about which file SysConf is managing.

(Another notable change is that the Wii root functions are moved into
Core to prevent Common from depending on Core.)
2017-01-12 21:30:11 +01:00
Lioncash 6f08ef9a25 IOFile: Get rid of IOFile's ReleaseHandle function
Transfer of handles should be done via std::move.
2017-01-12 12:34:06 -05:00
Lioncash ea8fc594a5 Common: Move BreakPoints into Core
BreakPoints utilizes the jit global variable, so this was making Core and
Common cyclical dependencies on one another.
2017-01-10 05:24:44 -05:00
Lioncash 1dab2c8816 IOFile: Correct explicit operator bool semantics
The operator void* variant was m_good ? m_file : nullptr;
so this was leaving out the file handle check.
2017-01-08 22:52:44 -05:00
Lioncash 00baf193ac CodeBlock: Const correctness for IsInSpace 2017-01-08 18:40:09 -05:00
Matthew Parlane 7a5fe4b7ed Merge pull request #4624 from leoetlino/jit-warning-fixes
Add the g_ prefix to the jit global
2017-01-08 13:19:16 +13:00
Lioncash 9d8e8652fb CodeBlock: Get rid of implicit sign-conversion in AllocCodeSpace
Size is internally stored as a size_t, so having an int parameter
would cause implicit sign-conversion from a signed value to an
unsigned value to occur.
2017-01-07 19:05:06 -05:00
Léo Lam 8bef7259e3 Add the g_ prefix to the jit global
Jan 04 22:55:01 <leoetlino>   fwiw, it looks like there are new warnings in the RegCache code
Jan 04 22:55:04 <leoetlino>   Source/Core/Core/PowerPC/Jit64/FPURegCache.cpp:13:33: warning: declaration shadows a variable in the global namespace [-Wshadow]
Jan 04 22:56:19 <@Lioncash>   yeah, the jit global should have a g_ prefix.

This fixes shadowing warnings and adds the g_ prefix to a global.
2017-01-07 23:19:49 +01:00
JosJuice 5e2b2f059f Don't use generic byteswapping on Android
This seems to work fine nowadays.
2017-01-06 13:56:53 +01:00
BhaaL 23d99f2f2c specify custom brace style to fix unions
BreakBeforeBraces: Allman apparently includes all styles,
except for AfterUnion (which is false) when using clang-format -dump-config
2017-01-05 12:55:13 +01:00
Lioncash 045a8400e6 IOFile: Make the move constructor and move assignment operator noexcept
Certain parts of the standard library try to determine whether or not a
transfer operation should either be a copy or a move. The prevalent notion
of move constructors/assignment operators is that they should not throw,
they simply move an already existing resource somewhere else.

This is typically done with 'std::move_if_noexcept'. Like the name says,
if a type's move constructor is noexcept, then the functions retrieves an
r-value reference (for move semantics), or an l-value (for copy semantics)
if it is not noexcept.

As IOFile deletes the copy constructor and copy assignment operators,
using IOFile with certain parts of the standard library can fail in
unexcepted ways (especially when used with various container
implementations). This prevents that.
2017-01-04 18:37:48 -05:00
Lioncash 9b8f5bce22 IOFile: Change 'operator void*' into 'explicit operator bool'
'operator void*' is basically a pre-C++11-ism that was used, as C++03
only had the notion of implicit type-conversion operators, but not explicit type
conversion operators (allowing implicit conversion of a file handle to
bool can go downhill pretty quickly).
2017-01-04 18:10:21 -05:00
Lioncash c541e1099e IOFile: Make class variables private
Internals shouldn't be directly exposed.
2017-01-04 17:48:46 -05:00
Lioncash c21dad9e83 IOFile: Get rid of unnecessary unimplemented copy constructor/assignment operator.
IOFile already inherits NonCopyable.
2017-01-04 17:47:40 -05:00
JosJuice 0f1ce0e1f4 Remove incorrect usage of "ASCII" and "ANSI"
Windows-1252 was sometimes being referred to as ASCII or ANSI
in Dolphin, which is incorrect. ASCII is only a subset of
Windows-1252, and ANSI is (rather improperly) used in Windows
to refer to the current code page (which often is 1252 on
Western systems, but can also be something entirely different).

The commit also replaces "SJIS" with "Shift JIS". "SJIS"
isn't misleading, but "Shift JIS" is more commonly used.
2016-12-26 15:49:39 +01:00
Mat M 40e36ebd1e Merge pull request #4550 from linkmauve/no-readdir_r
Common: Replace deprecated readdir_r with readdir
2016-12-25 17:34:50 -05:00
JosJuice e56bec9c87 Fix outdated comments in ScanDirectoryTree 2016-12-25 21:57:33 +01:00
Emmanuel Gil Peyrot 495dfdb16c Common: Replace deprecated readdir_r with readdir
Fixes a warning under recent glibc.
2016-12-24 16:18:47 +01:00
Sepalani 8d812db9ad SymbolDB: Use set to map hash with symbols 2016-12-19 21:03:29 +00:00
Sepalani 7e974f1064 SymbolDB: GetSymbolsFromHash added 2016-12-19 21:03:28 +00:00
Sepalani d778b8a820 SymbolDB: GetSymbolsFromName added 2016-12-19 21:02:23 +00:00
Sepalani a6114bad34 Import/Export signature files as CSV 2016-12-18 00:27:10 +00:00
Markus Wick d64c9dd5c9 Merge pull request #4419 from degasus/master
Jit64: Fix a few trivial PIE issues.
2016-12-12 10:58:16 +01:00
Léo Lam 31ccfffd38 Common: Add alignment header
Gets rid of duplicated alignment code.
2016-12-06 20:33:53 +01:00
degasus 21f3e97435 Jit64: Avoid pointer casts if possible. 2016-12-04 13:09:16 +01:00
JosJuice 3cfc49a613 Merge pull request #4472 from JosJuice/revert-absolute-path
IOS HLE: Replace broken path traversal prevention
2016-11-29 18:34:22 +01:00
Stenzek 7353cae707 GLInterface: Implement core and shared context creation for WGL 2016-11-29 20:04:32 +10:00
JosJuice c74c317ab5 IOS HLE: More robust escaping of NAND paths
Prevents path traversal without needing an absolute path
function, and also improves accuracy (character sequences
like ../ appear to have no special meaning in IOS).

This removes the creation and usage of /sys/replace,
because the new escapes are too complicated to all
be representable in its format and because no other
NAND handling software seems to use /sys/replace.
2016-11-26 22:49:46 +01:00
JosJuice de355a8521 Revert "IOS HLE: Prevent accessing host file system"
This reverts commit 141f3bfb3a.
The implementation of getting absolute paths wasn't working
on non-Windows systems, which is a huge problem for IOS HLE.
2016-11-26 15:50:28 +01:00
JosJuice 141f3bfb3a IOS HLE: Prevent accessing host file system 2016-11-13 10:03:23 +01:00
Jules Blok 8203ea929b BlockingLoop: Yield to UI message pump while waiting. 2016-11-11 13:37:02 +01:00
shuffle2 ab9f539233 Merge pull request #4387 from aldelaro5/gpr1-and-gpr2-friendly-labels
Add precision about the names of r1, r2 and r13 for the register view
2016-11-03 02:29:40 -07:00
Markus Wick 9ce1cdde98 Merge pull request #4414 from linkmauve/single-newline
Remove double newlines at the end of *_LOG messages
2016-11-02 12:20:46 +01:00
aldelaro5 2f5d00450a Add precision about the names of r1, r2 and r13 for the register view
In the code view, it would never say r1 or r2, but rather sp (stack pointer) and rtoc (register of the table of content) respectively.  In the register view, all it says is the register number.  This is an inconvenience considering it might not be obvious which register belongs to which of these terms.

Also make r13 named the "sda" for small data area with the same convention as above.
2016-11-02 01:13:00 -04:00
Emmanuel Gil Peyrot c9e6b05ce9 Core: Remove double newlines at the end of *_LOG messages. 2016-11-02 02:09:33 +00:00
Markus Wick 2afa877119 Merge pull request #4376 from leoetlino/warning-fix
Warning fixes
2016-10-31 12:57:03 +01:00
degasus f1a67bb1a2 JitArm64: Implement divwx 2016-10-29 13:35:23 +02:00
degasus 8ad98d0046 ArmEmitter: Merge AddI2R helpers. 2016-10-27 19:19:06 +02:00
degasus 694e9b4132 JitArm64: ADDI2R optimizations 2. 2016-10-27 19:19:06 +02:00
degasus 1df694626d JitArm64: Optimize addi2r & subi2r. 2016-10-26 21:54:13 +02:00
degasus df250b84cc JitArm64: Avoid MOVI2R is possible.
Just use all kind of ADDI2R, SUBI2R, ...
They have some optimizations internally.
2016-10-26 21:54:09 +02:00
Léo Lam 1233697b2f Fix unused function warnings 2016-10-23 00:43:08 +02:00
shuffle2 43169d897f Merge pull request #4354 from sepalani/bp_rmtmp_it
BreakPoints: ClearAllTemporary uses valid iterators
2016-10-17 14:14:10 -07:00
Sepalani 771fa943dc BreakPoints: ClearAllTemporary uses valid iterators 2016-10-15 19:21:41 +01:00
Lioncash ee71d70738 DebugInterface: Make GetRawMemoryString return a std::string 2016-10-07 10:26:26 -04:00
Markus Wick ff1d70d708 Merge pull request #4308 from aldelaro5/memcheck-gui-relabel
Label debugger memchecks as "Memory Breakpoints" in the GUI
2016-10-06 21:29:14 +02:00
aldelaro5 549060c5b4 Label debugger memchecks as "Memory Breakpoints" in the GUI
This is done to remove confusions among potential debugger users and to also make it more accurately tell what this feature is actually doing.  Despite being true that it is using a memcheck (and it certianly checks that memory), the idea being to break on a memory access isn't really obvious especially considering that memchecks are also used in full MMU emulation to handle exceptions.  It also doesn't help that memchecks are now supported in every builds.

It also changes the corresponding log because this log would be wanted by the user which means it should be more obvious that it was caused by the "memory breakpoint".
2016-10-06 10:51:43 -04:00
shuffle2 f7e25483e6 Merge pull request #4293 from lioncash/pcast
CommonFuncs: Get rid of pointer casting
2016-10-04 19:10:34 -07:00
aldelaro5 6ee799ba7c Reduces the the filename of logs
Using cmake and GCC, logs would contain the full file path when logging making logs lines unnecessarily long.  This is solved by just removing anything before "/Source/Core/" (where / is whatever your OS uses to separated directory).
2016-10-04 16:34:26 -04:00
Lioncash d15d99ecc2 CommonFuncs: Get rid of pointer casting 2016-10-04 05:12:23 -04:00
Léo Lam 8912bb3ff4 Back up part of SYSCONF when switching to emulated BT
This fixes an issue where the Bluetooth info section could be fully
filled up by syncing 5 Wiimotes in passthrough mode then switching to
emulated Bluetooth; emulated Wiimotes were then unable to be used.

The "real" SYSCONF section is now backed up before being replaced with
a blank section that the emulated BT adapter can always fill with 5
Wiimotes without issues.

This backup is restored by the passthrough code, instead of during
the Bluetooth mode switch because this should be done regardless of the
user interface, and even without UI (if the config file is edited
manually).
2016-10-03 23:13:09 +02:00
shuffle2 f121fa07c2 Merge pull request #2868 from sepalani/dolphin_ssl
Dolphin new Dump SSL features
2016-10-03 06:16:49 -07:00
shuffle2 bd1218a3c4 Merge pull request #4250 from leoetlino/hle-patch-fix
HLE_OS: Minor fixes (function patching, output encoding)
2016-10-02 22:13:15 -07:00
shuffle2 5e8bc4aa1d Merge pull request #4244 from leoetlino/stm-shutdown
Shut down Wii software gracefully
2016-10-02 20:25:13 -07:00
shuffle2 8fcc3b04e0 Merge pull request #4227 from ligfx/clean_objc
Don't force compile everything as Objective-C++ on macOS
2016-10-02 19:42:04 -07:00
Mat M ccfc081697 Merge pull request #4245 from aldelaro5/logs-levels-changes
Lots of Logs levels changes (also enable INFO level in every build)
2016-10-02 16:51:44 -04:00
Léo Lam 25b93419d0 SysConf: Add support for the LongLong type
This should fix the "unknown entry type" panic alerts when an existing
SYSCONF from a real Wii NAND is used.
2016-10-02 11:52:57 +02:00
aldelaro5 f0aa9b3751 Reorganise a ton of logs level
Most of this commits changes performance decreasing logs from info to debug and also cleans up innacurate levels.
2016-10-01 15:50:28 -04:00
Léo Lam 5d8d696185 Force disable WC24 standby mode
When standby mode is enabled, this causes games to ES_Launch the system
menu instead of directly asking IOS (the STM more precisely) to shut
down, which prevents graceful shutdown from working
(it'll appear to hang).

Dolphin never supported WC24 standby mode anyway, so this shouldn't
cause any issues. (This should be reverted if and when WC24 standby is
implemented…)
2016-10-01 13:06:04 +02:00
Stenzek fdd954e7e7 Common: Add a Semaphore wrapper class 2016-10-01 01:09:12 +10:00
Scott Mansell ed95115c17 Merge pull request #4220 from aldelaro5/memcheck-interface-improvements
Redo the MemCheck add dialog
2016-09-28 13:46:25 +13:00
aldelaro5 5e8fc4ebd9 Add consideration for the break flag of memChecks
It was never used, even when the code tried to make sure it was initialised and passed correctly.  This is a supplementary fix for the memCheck dialog as this option will now work correctly.
2016-09-27 01:22:23 -04:00
Léo Lam 303325768b SymbolDB: Only match against the function name
This changes GetSymbolFromName to not require the passed name to
completely match with the symbol name. Instead, we now match
against the stripped symbol name (i.e. only the function name).

This fixes a regression introduced by #4160, which prevented
HLE::PatchFunctions() from working properly.
2016-09-26 22:56:42 +02:00
degasus 7c9bba2213 Arm64Emitter: Fix std::array initializer. 2016-09-26 22:17:25 +02:00
Léo Lam e716a738dc SysConf: In-class initialise member variables 2016-09-25 19:22:11 +02:00
aldelaro5 08f28b5351 Enable the log level LINFO in every builds
It didn't really made sense to disable 2 logs levels in releases builds while the level LDEBUG should really be where logs that would impact performance be.  Info should be logs that report potentially usefull information and debug should report info that would only be usefull in debug context as they are called very often.  To make this work, a lot of info log would have to be made debug log.

It also avoid inaccurate logs level done due to not using debug builds.  While searching through the code, I saw a ton of logs that should have been info log, likely done to avoid using a debug build (which shouldn't happen considering the level debug exists anyway).

The whole idea is to have more meaningful logs in release builds while maintaining minimal performance loss from choosing the highest level.  This could potentially help to diagnose issues or to know more about what the emulator is actually doing.

The next commit aims to sort the log levels for this purpose.
2016-09-25 01:41:12 -04:00
Léo Lam 5d00915d37 MemoryUtil: Fix formatting
clang-format really *wants* the two empty lines to be removed;
otherwise, it will always flag MemoryUtil as needing formatting changes
which is an annoyance when it is used as a git filter driver.
2016-09-24 22:41:53 +02:00
Michael Maltese cd19c9fa22 Don't force compile everything as Objective-C++ on macOS 2016-09-18 17:33:51 -07:00
Scott Mansell 4c004b6dc9 Merge pull request #4131 from aldelaro5/memoryViewer-memChecks-improvements
Add the configuration of how a memory check is added via the memory window
2016-09-15 10:46:07 +12:00
Lioncash 00ddbee786 SymbolDB: Change Symbol's 'analyzed' member into a boolean
It's only ever used as one
2016-09-13 21:23:28 -04:00