Commit graph

24133 commits

Author SHA1 Message Date
Techjar
52b52631c2 x64CPUDetect: Add detection for AMD Zen architecture 2020-01-26 22:09:13 -05:00
Connor McLaughlin
47239ddaac
Merge pull request #8587 from lioncash/const-qual
DolphinQt/TASCheckBox: Mark GetValue() as const
2020-01-27 12:52:10 +10:00
Lioncash
b493bdb912 DolphinQt/TASCheckBox: Mark GetValue() as const
This doesn't actually modify the checkbox's state, so this can be marked
as a const-qualified member function.
2020-01-26 21:41:31 -05:00
Tilka
5dfc9196ab
Merge pull request #8548 from jordan-woyak/wiimote-source-cleanup
Core/WiimoteReal: Wii remote connection pool and source change cleanup.
2020-01-25 23:04:50 +00:00
Tilka
9ac77dc91f
Merge pull request #8552 from jordan-woyak/extension-calibration-data
WiimoteEmu: Nunchuk and Classic Controller calibration accuracy improvements.
2020-01-25 23:01:57 +00:00
Tilka
73aea8af6b
Merge pull request #8539 from leoetlino/fs-accuracy
IOS/FS: Reimplement many functions in a more accurate way
2020-01-25 23:00:10 +00:00
Tilka
2edcb29706
Merge pull request #8582 from jordan-woyak/osd-disabled-fix
VideoCommon/OSD: Process OSD messages even when they are disabled.
2020-01-25 21:11:37 +00:00
Tilka
a632bc7324
Merge pull request #8579 from jordan-woyak/rvalue-cleanups
Common/Core: Minor rvalue reference related cleanups.
2020-01-25 21:09:22 +00:00
Tilka
14ebdf0e9d
Merge pull request #8585 from JosJuice/volumeverifier-read-error
VolumeVerifier: Report read errors to the user
2020-01-25 21:07:01 +00:00
Tilka
b0e040431a
Merge pull request #8581 from jordan-woyak/ciface-ar-aware
InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio.
2020-01-25 20:28:01 +00:00
Tilka
9827aa7a37
Merge pull request #8577 from jordan-woyak/shared_mutex
Common/Analytics: Replace mutex with shared_mutex and minor cleanups.
2020-01-25 20:08:22 +00:00
Jordan Woyak
5e3472eba9 Common/Analytics: Replace mutex with shared_mutex and minor cleanups. 2020-01-25 14:04:00 -06:00
JosJuice
de26fec0af VolumeVerifier: Report read errors to the user 2020-01-25 20:21:12 +01:00
Tilka
119ccc5e4f
Merge pull request #8556 from Sintendo/bestrest
x64Emitter: Avoid 8-bit displacement when possible
2020-01-25 19:10:47 +00:00
Tilka
709862b818
Merge pull request #8120 from MerryMage/cdts
Jit64: Make DoubleToSingle a common asm routine
2020-01-25 19:10:37 +00:00
Léo Lam
c02e7de55a IOS/ES: Remove now unnecessary title sorting hack
ES now uses FS to access the filesystem and FS's ReadDirectory now
returns file lists that are correctly ordered.
2020-01-25 17:54:58 +01:00
Léo Lam
d4ba0acb3a UnitTests/FS: Add path validity and splitting tests 2020-01-25 17:54:57 +01:00
Léo Lam
484cfb9328 UnitTests/FS: Add metadata tests 2020-01-25 17:53:39 +01:00
Léo Lam
142b7e048b IOS/FS: Actually implement SetMetadata 2020-01-25 17:53:35 +01:00
Léo Lam
e4dd582d1d IOS/FS: Implement GetMetadata properly and remove GID hack
Now that all FS functions that create new inodes are properly
implemented, we can make GetMetadata actually return correct file
metadata rather than giving fixed information. The hack for the DQX
installer can also be removed now since our ES and FS keep track of
caller UID/GIDs now.
2020-01-25 17:53:34 +01:00
Léo Lam
396429d582 IOS/FS: Implement ReadDirectory properly and remove sorting hack
With the CreateFile/CreateDirectory fix and this commit, we can
finally return correct results in ReadDirectory and the sorting
hack -- whose purpose was to prevent certain versions of the
System Menu from crashing -- can be removed too.
2020-01-25 17:53:19 +01:00
Léo Lam
a40f297d1d IOS/FS: Implement Rename properly 2020-01-25 17:53:18 +01:00
Léo Lam
53ceb6c693 IOS/FS: Implement Delete properly 2020-01-25 17:53:05 +01:00
Léo Lam
8517528f8c IOS/FS: Implement CreateFile and CreateDir properly 2020-01-25 17:52:45 +01:00
Léo Lam
8f74d02659 Core: Fix a few misuses of FS::CreateDirectory
CreateDirectory does not create missing parent directories. If that
behaviour is desired, CreateFullPath should be used instead.

(These small misuses went unnoticed since the previous implementation
of CreateDirectory automatically created parent directories.)
2020-01-25 17:52:07 +01:00
Léo Lam
36676d2628 IOS/FS: Implement Format properly 2020-01-25 17:52:03 +01:00
Léo Lam
a83d9e5600 IOS/FS: Make sure FS root directory exists
Previously, the FS root directory would get created as a side
effect of calling CreateDirectory during boot (since the
implementation was sloppy and used File::CreateFullDir).

Since CreateDirectory no longer does that, it is necessary to ensure
that the FS root directory does exist by creating it explicitly.
2020-01-25 17:51:52 +01:00
Léo Lam
0543598574 IOS/FS: Move /tmp clearing back to the IPC interface
Prevents /tmp from being cleared unnecessarily; clearing /tmp is
normally only done once every time IOS is reloaded.
2020-01-25 17:51:43 +01:00
Léo Lam
f743f100b1 IOS/FS: Add base FST functions
Some official titles rely on implementation details of Nintendo's
FS sysmodule and will not work properly if those are changed.
Notably, some games and older versions of the System Menu appear
to be relying on the order of files returned by FS::ReadDirectory
and will either fail to find their save data (for Bolt) or
outright crash (for the System Menu).

Some titles also actually expect filesystem metadata to be correct.
One title that has been confirmed to do this is DQX, which generates
paths based on the GID of files within its own title directory.

While it is easy to make workarounds for these issues -- and in fact
we already do have some for the sysmenu and DQX, having hacks
is obviously nonideal and adding yet another hack would be required
to fix Bolt -- one that would be even uglier.

Furthermore, while it is currently unknown whether any official
title cares about permissions, the lack of FS metadata means that
we are unable to implement them if that turns out to be desirable
or necessary.

By adding a FST, we can implement things correctly and solve all
those problems without hacks.

Apart from DQX, the sysmenu and Bolt, this changeset also fixes
the Photo Channel complaining about corrupted system files
on the initial launch.

This first commit adds the basic structures and functions that
are necessary to load, save, query and update our version of the FST.

For simplicity, a binary format that is inspired from Nintendo's FST
structure was chosen for serialization. It is not expected to ever
receive an update.

PS: an update on the NAND image backend:

A long time ago I had planned to add another FS backend which would
be using a NAND image/blob as the storage. While I have already
written an implementation that has been tested, solves all the
aforementioned issues and more, produces images that are fully
compatible with IOS's FS driver, I feel like NAND images raise too
many issues: savestate sizes, code complexity and maintenance cost.

Since many fixes and additions that are part of that implementation
(e.g. FS timings, utility structures, FST) have already been merged
or will be submitted as part of this changeset, I will likely not
submit the branch.
2020-01-25 17:51:37 +01:00
Léo Lam
d185bc6f09 IOS/FS: Move path validity check functions
They will be used in more places than just HostBackend/FS.cpp.

Also fix the check and make it accurate while we're at it.
2020-01-25 17:47:42 +01:00
Connor McLaughlin
e3a7922e12
Merge pull request #8336 from Ebola16/PS
Add Dolphin version and current video backend to shader compilation logs
2020-01-25 11:52:14 +10:00
Jordan Woyak
c08671c4ce VideoCommon/OSD: Process OSD messages even when they are disabled. 2020-01-24 11:00:58 -06:00
Jordan Woyak
b92f6480a0 InputCommon: Make "Cursor" inputs aware of the rendered aspect ratio. 2020-01-24 09:20:41 -06:00
Ryan Meredith
e5f6d9320f Add Dolphin version and current video backend to shader compilation logs 2020-01-24 03:29:38 -05:00
Jordan Woyak
732032cdb2 Common/Core: Minor rvalue reference related cleanups. 2020-01-23 22:58:23 -06:00
Connor McLaughlin
42c03c4dad
Merge pull request #8576 from lioncash/texture-cvt-shader-fmt
VideoCommon/TextureConversionShader: Convert over to using ShaderCode
2020-01-24 11:53:51 +10:00
Connor McLaughlin
a0b7c1beae
Merge pull request #8366 from Techjar/high-dpi-auto-adjust
Qt/RenderWidget: Account for devicePixelRatio when auto-adjusting window size
2020-01-24 11:31:09 +10:00
Lioncash
687f1f0330 VideoCommon/TextureConversionShader: Make use of fmt where applicable
Now that we've converted the shader generation over to ShaderCode, we
can now make use of the fmt-capable WriteFmt function.
2020-01-23 14:19:40 -05:00
Lioncash
aa77dff3a2 VideoCommon/TextureConversionShader: Convert over to using ShaderCode
Migrates the shader generator off the use of a global array, eliminating
the use of some global state. This also allows us to move the shader
generation over to using fmt in a subsequent change.
2020-01-23 14:19:36 -05:00
Pierre Bourdon
ea9b96370d
Merge pull request #8573 from JosJuice/ciso-size
DiscIO: Fix CISOFileReader::GetDataSize()
2020-01-22 19:20:36 +01:00
JosJuice
956c63ef9b DiscIO: Fix CISOFileReader::GetDataSize()
Fixes being unable to run CISO games after the merge of PR 8558.
2020-01-22 18:57:50 +01:00
JMC47
f0669f5aa6
Merge pull request #8570 from Techjar/always-sync-sram
Core/NetPlayServer: Sync SRAM on every game start
2020-01-21 20:55:52 -05:00
Connor McLaughlin
a63510a55a
Merge pull request #8554 from stenzek/present-duplicate-frames
Add an option to present duplicate frames
2020-01-20 12:04:26 +10:00
JMC47
f61d77a5e2
Merge pull request #8568 from jordan-woyak/imu-accel-ordering
InputCommon: List IMUAccelerometer's Up/Down inputs first for consistency.
2020-01-19 16:05:53 -05:00
Techjar
de27dcebf6 Core/NetPlayServer: Sync SRAM on every game start
This solves the issue of booting games locally while connected to
NetPlay causing desync.
2020-01-19 03:57:41 -05:00
Jordan Woyak
a61dff67da InputCommon: List IMUAccelerometer's Up/Down inputs first for consistency. 2020-01-18 13:56:11 -06:00
tinyredpanda
8b1051abb9 Update Qt5_DIR path for ARM64 in CMake project 2020-01-18 11:28:42 +00:00
Léo Lam
89b0ab2d22 StringUtil: Add IsPrintableCharacter and use it
Add a function that safely returns whether a character is printable
i.e. whether 0x20 <= c <= 0x7e is true.

This is done in several places in our codebase and it's easy to run
into undefined behaviour if the C version defined in <cctype>
is used instead of this one, since its behaviour is undefined
if the character is not representable as an unsigned char.

This fixes MemoryViewWidget.
2020-01-16 00:22:26 +01:00
Pokechu22
0a6a53e301 Always display the horizontal scroll bar when log word wrap is off
Otherwise, a line that's too wide for the log widget will cause the horizontal scroll bar to appear, which reduces the vertical height, and causes the most recent line to be off screen.  Since that line is off screen, the log widget no longer scrolls as new lines appear, unless it's manually scrolled to the very bottom again.
2020-01-15 13:59:09 -08:00
Tilka
1cc7ef356b
Merge pull request #8558 from JosJuice/volume-oob
DiscIO: Add out of bounds checks for blob reading
2020-01-15 13:48:00 +00:00
Pierre Bourdon
1ac3264d5d
Merge pull request #8545 from jordan-woyak/imu-cursor-centering
WiimoteEmu: IMU pointing behavior improvements and code cleanup.
2020-01-15 12:10:57 +01:00
Léo Lam
d2efad58af
Merge pull request #8562 from jordan-woyak/sens-slider
Core/DolphinQt: Fix IR Sensitivity slider.
2020-01-15 00:29:24 +01:00
Jordan Woyak
b416389248 Core/DolphinQt: Fix IR Sensitivity slider. 2020-01-14 17:08:21 -06:00
JosJuice
297b790e4f DiscIO: Add out of bounds checks for blob reading 2020-01-14 18:59:31 +01:00
JosJuice
21c152f51f Fix Error #001 (alternative solution)
This is an alternative to PR 8557 and PR 8558. The way this PR solves
the problem is essentially the same as what we had before PR 8394
(except the code we had back then only worked because it was broken).
2020-01-14 16:47:14 +01:00
Pokechu22
ddba80133a Fix launching DTK games with MIOS 2020-01-13 20:07:59 -08:00
Pokechu22
d67c4f34d1 Fix crash when launching gamecube games with MIOS (from the Wii menu) 2020-01-13 19:48:19 -08:00
Stenzek
11ba623f26 Add an option to present/skip presenting duplicate frames
Currently, we do not display every second frame in 25fps/30fps games
which run to vsync. This improves performance as there's less rendering
for the GPU to perform, but when combined with vsync, could cause frame
pacing issues.

This commit adds an option to force every frame generated by the console
to be displayed to the host, which may improve pacing for these games.
2020-01-14 10:57:35 +10:00
Jordan Woyak
f5d9b78a3c DolphinQt: Properly hide Wii remote extension motion tabs when no extension is selected. 2020-01-13 18:34:04 -06:00
Connor McLaughlin
efc1ee8e6a
Merge pull request #8537 from degasus/fastmem
Core/HW -> PowerPC/JIT: Fastmem arena construction
2020-01-14 09:38:15 +10:00
Jordan Woyak
6106f780a7 ControllerInterface/DSUClient: Eliminate m_accl/m_gyro state by accessing the pad data directly like every other input. 2020-01-13 17:35:33 -06:00
JMC47
eacbff76dd
Merge pull request #8474 from jordan-woyak/dsu-battery
ControllerInterface: Exposse DSU client battery level as an input.
2020-01-13 18:30:53 -05:00
Jordan Woyak
e2d5c92c76 ControllerInterface: Remove and re-add device when combining nodes. 2020-01-13 16:50:58 -06:00
Jordan Woyak
aabe8d2ccd ControllerInterface: Don't consider the empty string a valid unique ID. 2020-01-13 16:50:58 -06:00
Jordan Woyak
ac907ef977 ControllerInterface: Combine evdev devices with the same unique ID.
This works around Linux drivers for DS4 (Playstation 4) controllers splitting the device into three separate event nodes which makes configuration difficult.
To prevent collisions of input names in combined devices more descriptive names are now used when possible.
2020-01-13 16:50:56 -06:00
Jordan Woyak
2b9fa0597a ControllerInterface: Minor DSU client device cleanups. 2020-01-13 16:32:02 -06:00
JosJuice
da59f97278
Merge pull request #8549 from leoetlino/clang-format-9
Require clang-format 9 and reformat source code
2020-01-13 23:30:26 +01:00
Jordan Woyak
f0534cabc6 ControllerInterface: Exposse DSU client battery level as an input. 2020-01-13 16:29:24 -06:00
JMC47
48fd27cdab
Merge pull request #8451 from rlnilsen/motion-input-nunchuk
Add motion input support to nunchuk
2020-01-13 17:08:03 -05:00
JosJuice
966e1b31ba
Merge pull request #8394 from Pokechu22/misc-di-gpio
Various DI improvements
2020-01-13 17:17:24 +01:00
Connor McLaughlin
ae6d3be449
Merge pull request #8530 from s-daveb/master
MacOS: Fixes configuration hang; bump MacOS SDK.
2020-01-13 20:21:08 +10:00
Sintendo
bdcdd763fe x64Emitter: Remove unused macros
No users, and one them seems to do the same as stddef.h's offsetof()
already used elsewhere.
2020-01-13 08:43:42 +01:00
Sintendo
f82c38e156 X64Emitter: Remove obsolete TODO
TODO was already taken care of in PR #941.
2020-01-13 08:43:42 +01:00
Sintendo
bdfc472751 x64Emitter: Refactor OpArg::WriteRest
Shorter, displacement is now handled in one location.
2020-01-13 08:43:42 +01:00
Sintendo
cde3a3b448 x64Emitter: Avoid 8-bit displacement when possible
Due to the way the ModRM encoding works on x86, memory addressing
combinations involving RBP or R13 need an additional byte for an 8-bit
displacement of zero.

However, this was also applied in cases where it is unnecessary,
effectively wasting a byte.

- MatR with RSP or R12

8B 44 24 00          mov         eax,dword ptr [rsp]
8B 04 24             mov         eax,dword ptr [rsp]

- MRegSum with base != RBP or R13

46 8D 7C 37 00       lea         r15d,[rdi+r14]
46 8D 3C 37          lea         r15d,[rdi+r14]

- MComplex without offset

8B 4C CA 00          mov         ecx,dword ptr [rdx+rcx*8]
8B 0C CA             mov         ecx,dword ptr [rdx+rcx*8]
2020-01-13 08:43:42 +01:00
Jordan Woyak
d9bd714143 WiimoteEmu: Nunchuk and Classic Controller calibration accuracy improvements. 2020-01-12 09:48:37 -06:00
Stenzek
d8b2be9d06 DolphinQt: Support compiling on ARM64 2020-01-12 15:23:42 +10:00
Jordan Woyak
0aacf3a627 WiimoteEmu: Make the "Total Yaw" setting work again. 2020-01-09 13:11:13 -06:00
Léo Lam
4cc2d97294 Require clang-format 9 and reformat source code
This updates the lint script to require clang-format 9 and reformats
existing source code. Since VS2019 ships with clang-format 9 this
should make auto reformats less painful.

This also updates the clang-format configuration to set
BraceWrapping.AfterCaseLabel to true to ensure consistent brace
style; otherwise clang-format 9+ defaults to putting braces on
the same line as switch case labels.
2020-01-08 22:18:15 +01:00
Scott Mansell
a8c33f4ef6
Fix trailing whitespace 2020-01-07 12:52:05 +13:00
Scott Mansell
21528c3e72
Document the evdev "interesting" heuristic
Was checking over this old code, and saw a comment calling me out for a lack of documentation.

It might be half a decade late, but better late then never.
2020-01-07 12:46:24 +13:00
Tilka
98f645daac
Merge pull request #8158 from Sintendo/jitopts
x64 micro-optimizations
2020-01-06 14:09:43 +01:00
Tilka
f17f03ea3c
Merge pull request #8551 from Sintendo/jit64addx
Jit64: addx optimizations
2020-01-06 13:15:17 +01:00
Tilka
6e18dfb600
Merge pull request #8133 from Sintendo/mov64imm32
x64Emitter: Emit shorter MOVs for 32-bit immediates
2020-01-06 13:12:56 +01:00
Sintendo
12fcbac2a3 Jit64: addx - Emit LEA for register + immediate
Prefer LEA over MOV + ADD when dealing with immediates.

Before:
44 8B EE             mov         r13d,esi
41 83 C5 20          add         r13d,20h

After:
44 8D 6E 20          lea         r13d,[rsi+20h]
2020-01-05 23:39:13 +01:00
Sintendo
8e7b6f4178 Jit64: addx - Prefer ADD over LEA when possible
The old logic would always emit LEA when both sources are in a register
and OE is disabled. However, ADD is still preferable when one of the
sources matches the destination.

Before:
45 8D 6C 35 00       lea         r13d,[r13+rsi]

After:
44 03 EE             add         r13d,esi
2020-01-05 23:23:56 +01:00
Léo Lam
c1f9bfce30 IOS/ES: Add SetUid exception for the Wii U Transfer Tool
The ES sysmodule in IOS62 (v6430) has an exception for the
Wii U Transfer Tool in the SetUid function.

If the active title is the Wii U Transfer Tool, then calling SetUid
is always allowed. (The UID is still checked first, though.)

Fixes https://bugs.dolphin-emu.org/issues/10985
2020-01-05 18:16:54 +01:00
Jordan Woyak
956339df4e Core/WiimoteReal: Make wiimote source type an enum class and add Get/SetWiimoteSource functions. Add connected real Wii Remotes to a pool when a slot is not available. 2020-01-05 10:15:22 -06:00
Léo Lam
f35f4f2bf0
Merge pull request #8541 from jordan-woyak/float-parse-fix
StringUtil: Make TryParse of floats handle comma and dot decimal separators.
2020-01-05 12:12:09 +01:00
Pokechu22
3b5d20e12c Bump state version 2020-01-04 11:43:33 -08:00
Pokechu22
51f8a3606e Return error code to game when using unimplemented commands 2020-01-04 11:43:32 -08:00
Pokechu22
af5f0b20bb Report use of various unimplemented DI commands as game quirks 2020-01-04 11:43:32 -08:00
Pokechu22
f1dc908883 Clarify emulated behavior for ReadBCA 2020-01-04 11:43:32 -08:00
Pokechu22
6c0399103f Handle partitions in /dev/di, not DVDInterface
Partitions are Wii-exclusive, and don't happen at the DVDInterface level in
IOS.  This isn't quite the cleanest fix, but it gets rid of the assumption that
a partition is open on starting the game at least.
2020-01-04 11:43:32 -08:00
Pokechu22
71e8fb278f Return more errors from DTK 2020-01-04 11:43:31 -08:00
Pokechu22
55a88ba2ed Track drive state better, reporting errors if the state is wrong
Also, fix DVDLowStopMotor logging (which was based on the ioctl parameters)
2020-01-04 11:43:31 -08:00
Pokechu22
7d6b9bcb40 Check for error 001 out of bounds reads in DVDThread
All out of bounds reads should return the appropriate DI error, but it also
makes sense to have the error 001 read happen there.
2020-01-04 11:43:30 -08:00
Pokechu22
ef2fc5a49b Split /dev/di commands from DVDInterface
The various ioctls sometimes have different arguments than the DI command
registers, though they generally overlap.  There are also a bunch of ioctls
that don't even normally go into DVDInterface, just returning various data.
Some of the implemented ioctls are new to Dolphin.
2020-01-04 11:43:30 -08:00
Pokechu22
a8ae5fa21a Expose setting DVDInterface errors and split setting into two parts 2020-01-04 11:43:30 -08:00
Pokechu22
3110599559 Increase DIMAR by DILENGTH after a command 2020-01-04 11:43:30 -08:00
Pokechu22
d3aad1d6d5 DIMAR only ignores bits 0-4, not the upper bits
Based on a hardware test on a Wii.  The alignment code was originally added in 743641965a.
2020-01-04 11:43:29 -08:00
Pokechu22
c564d64104 Remove unused drive debug command constants
The corresponding code that used these was removed in 2009 with 93b83f8d65.  Now their only purpose is to generate warnings on osx.

Minimalistic documentation on these commands can be found at http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.7.2 and https://web.archive.org/web/20070328200323/http://tmb.elitedvb.net/dvd-game/index.php/CMDFE.  Those constants only relate to the 0x11 subcommand, which is one of many.  Most can't be properly emulated unless we LLE the drive firmware (in which case, they don't need to be reimplemented).
2020-01-04 11:43:29 -08:00
Pokechu22
84f099cf62 Tidy and eliminate some of the DI register unions 2020-01-04 11:43:26 -08:00
Pokechu22
11bd132650 Implement RTC flag, which is counter-intuitively disc drive related 2020-01-04 11:43:26 -08:00
Pokechu22
77189e74cd Implement Broadway GPIOs
SLOT_LED and the AVE ones are not implemented yet, but the other Broadway ones are.
2020-01-04 11:43:26 -08:00
Pokechu22
a695b05b21 Add support for std::optional to PointerWrap 2020-01-04 11:43:26 -08:00
Jordan Woyak
0e8d4cb6ac StringUtil: Make TryParse of floats handle comma and dot decimal separators. 2020-01-04 07:19:15 -06:00
Léo Lam
ad75215bb0 Fix several warnings
A small, nonexhaustive set of warning fixes. The DiscIO Volume change
is a workaround for a GCC bug [1] that causes returning an unengaged
std::optional to emit annoying -Wmaybe-uninitialized warnings.
This last change alone fixes pages upon pages of warnings since
Volume.h is included from several files.

-Wstringop-truncation is another irrelevant warning for us, but
unfortunately there seems to be no way to disable it without
adding ugly pragmas wherever the warning appears.
2020-01-04 12:11:39 +01:00
Léo Lam
94c5460693
Merge pull request #8546 from jordan-woyak/default-num-mappings
HW: Add ticks to default mappings that are valid numeric literals.
2020-01-04 10:41:45 +01:00
Léo Lam
671defd8b9
Merge pull request #8543 from jordan-woyak/gcode-download-minor-fix
Core/GeckoCode: Fix DownloadCodes function assuming HTTP data is null terminated.
2020-01-04 10:18:44 +01:00
Jordan Woyak
2a9a04a1ec HW: Add ticks to default mappings that are valid numeric literals. 2020-01-03 22:08:49 -06:00
Jordan Woyak
b505004d61 Core/GeckoCode: Fix DownloadCodes function assuming HTTP data is null terminated. 2020-01-03 20:14:10 -06:00
Jordan Woyak
723115b7b6 WiimoteEmu: Allow Recenter button to adjust the pitch. 2020-01-03 18:08:45 -06:00
Jordan Woyak
72c2be52ed WiimoteEmu: Clean up ComplementaryFilter math. 2020-01-03 16:16:26 -06:00
Jordan Woyak
120c6dc850 DolphinQt: Fix accelerometer indicator math. 2020-01-03 12:34:11 -06:00
Jordan Woyak
540a3ce665 DolphinQt: Use FromQuaternion for a more accurate gyro indicator. 2020-01-02 15:46:18 -06:00
Jordan Woyak
8ab3694f51 Common: Add Matrix33::FromQuaternion. 2020-01-02 15:16:37 -06:00
George Talusan
b1a6cbc3b4 MacOS: Dispatch GL calls to main thread to prevent crashes on Catalina 2020-01-01 23:06:19 -05:00
David Korth
11339d77c6 IsSettingSaveable.cpp: Significant code size reduction.
- Refactor the Config::System::Main check so we check system once,
  then we check for the section.

- Use an std::array<> instead of std::vector<>.

- Use an array of pointers instead of an array of ConfigLocation.
  The latter contains two std::string objects, whereas pointers
  are only 8 bytes (on 64-bit).

Code size comparison: (64-bit Linux, gcc-9.2.0, release build)

   text    data     bss     dec     hex filename
  16136       0      40   16176    3f30 IsSettingSaveable.cpp.o [before]
   3933     720       0    4653    122d IsSettingSaveable.cpp.o [after]
 -12203    +720     -40  -11523   -2d03 Difference
2019-12-29 23:45:02 -05:00
David Korth
f5fe692842 Use pre-increment for iterators instead of post-increment.
Pre-increment is more efficient, since it doesn't have to return the
old iterator.
2019-12-29 23:45:02 -05:00
David Korth
c2dd2e8a2e Use std::istringstream or std::ostringstream instead of std::stringstream where possible.
This removes std::iostream from the inheritance chain, which reduces
overhead slightly.
2019-12-29 23:45:02 -05:00
David Korth
6e549bb668 InputConfig::LoadConfig(): Convert num[] to an array of std::string_view.
NOTE: The explicit std::string() conversions later are needed. Otherwise,
gcc-9.2.0 throws all sorts of errors because it can't find a matching
operator+() function.
2019-12-29 23:45:02 -05:00
David Korth
a23b3d26f4 GLExtensions.cpp: Use arrays of const char *const instead of std::string.
The strings end up being copied, so we might as well initialize the
std::string in the unordered_map directly.
2019-12-29 23:45:02 -05:00
David Korth
05101b251c OGL/Render.cpp, InitDriverInfo(): Use std::string_view to eliminate string copies.
Consolidate the NVIDIA Tegra and non-Tegra checks into one branch.
2019-12-29 23:45:02 -05:00
David Korth
1d7f128693 GetSysMenuVersionString(): Use a char instead of std::string for the region letter.
Append the region letter after determining the version number.
2019-12-29 23:45:02 -05:00
David Korth
9f3b9acad9 PowerPC.cpp: No need to explicitly initialize ppcState.
"ppcState{}" is stored in the .data segment, which means the full ~4 MB
is stored in the executable.

"ppcState" is stored in the .bss segment, which means it only stores a
note that tells it to allocate and zero ~4 MB at runtime.
2019-12-29 23:45:02 -05:00
David Korth
afe2e7de0f VolumeVerifier.cpp: Verify that the string arrays are sorted before using std::binary_sort().
Debug builds only, since this is wrapped in assert().
2019-12-29 23:42:55 -05:00
David Korth
d660aba20f VolumeVerifier.cpp: Use arrays of string_view objects instead of strings.
string_view is a thin wrapper around C strings, so it's more efficient
for constant strings than C++ strings.

The unordered_set<> also adds extra runtime overhead. For small arrays,
a simple linear search works. For larger arrays, std::binary_search()
works better than linear but without the unordered_set<> overhead.

ShouldBeDualLayer(): Removed a duplicate "SK8X52" entry.
2019-12-29 23:42:55 -05:00
degasus
aad8aab698 Jit64: Disable the fast address check if fastmem is disabled.
This was a huge speedup with disabled fastmem, but it still requires the fastmem arena.
So let's disable it for now, even if this commit has a huge performance hit with disabled fastmem.
2019-12-28 13:41:57 +01:00
degasus
d735943aa2 Jit64: Use safe memory helpers for psq_l* without fastmem.
RMEM won't help if there is no fastmem arena, so let's use our memory helpers.
2019-12-28 13:41:57 +01:00
degasus
74cb692591 Jit64: Only activate dcbz fastpath with fastmem.
The code is safe not to create memory errors, but it accesses the fastmem area.
2019-12-28 13:41:57 +01:00
degasus
c6019f9814 PowerPC/Jit: Create fastmem arena on init. 2019-12-28 13:41:57 +01:00
degasus
ccbadf6e72 Core: Refactor fastmem arena construction.
This shall be called by the Jit, not by the emulation start itself.
2019-12-28 13:41:57 +01:00
degasus
9d88180df7 MMU: Use the Memory helpers for physical memory.
physical_base is a fastmem helper. Its access is unsafe and might not be available without a Jit.
2019-12-28 12:57:51 +01:00
Stenzek
d744c5a148 Compile fixes for Windows-on-ARM64 2019-12-28 19:20:41 +10:00
Stenzek
6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
Stenzek
5a65031611 Add a Win32 NoGUI platform and project 2019-12-28 08:56:27 +10:00
Anthony
0755f92979
Merge pull request #8534 from JosJuice/netplay-index-empty-strings
Properly check for missing netplay session name/region
2019-12-25 21:52:22 -08:00
Pierre Bourdon
0341288af2
Merge pull request #8525 from Techjar/axwii-ub
HW/DSPHLE: Fix struct aliasing undefined behavior in AX ucode
2019-12-24 08:35:28 +01:00
JosJuice
0c12dbe860 DolphinQt: Properly save netplay session settings when changed 2019-12-23 23:14:13 +01:00
JosJuice
8e278b8053 Check presence of name and region in NetPlayServer 2019-12-23 23:14:13 +01:00
JosJuice
2fa4ef729f DolphinQt: Check presence of region in NetPlaySetupDialog 2019-12-23 23:14:13 +01:00
Pierre Bourdon
5c996dec89
DualShockUDPClient: downgrade spurious NOTICE_LOGs 2019-12-23 18:36:18 +01:00
Techjar
eae959238e HW/DSPHLE: Fix struct aliasing undefined behavior in AX ucode
This fixes Old AX Wii games having no audio when compiled under VS2019.
This also includes some minor code cleanup and moving a function to
avoid duplication.
2019-12-22 14:48:47 -05:00
Techjar
79092cdda0 Common/BitUtils: Implement BitCast(To|From)Array 2019-12-22 14:48:47 -05:00
S David
21f42fafb7 MacOS: Fixes configuration hang; bump MacOS SDK.
Removed conditional use of std::mutex instead of std::shared_mutex on MacOS.

Because MacOS < 10.12 did not support std::shared_mutex, a previous commit
naïvely substituted std::mutex, which does not have the same behavior.

Reverses PR #8273, which substitues std::mutex for std::shared_mutex on
macOS, and results in several bugs that seem to only affect MacOS

- https://bugs.dolphin-emu.org/issues/11919
- https://bugs.dolphin-emu.org/issues/11842
- https://bugs.dolphin-emu.org/issues/11845

This change eliminates conditional code for MacOS in the core configuration
layer code and enables the use of modern language features that are more
secure and thread-safe.
2019-12-22 00:49:17 -05:00
Stenzek
6a0067fd26 FrameDump: Set first_frame if movie frame number <= 1
The frame number is incremented before the first frame is swapped out.

Fixes ffmpeg creating invalid video files on output if the emulator only
runs for a single frame, e.g. FifoCI.
2019-12-22 11:54:34 +10:00
Casey Carter
222bc6a443 Include <memory> for std::unique_ptr in DXContext.h 2019-12-19 14:25:12 -08:00
Connor McLaughlin
74dedc57fd
Merge pull request #8519 from JosJuice/setupwiimemory-region-override
Boot: Optionally allow preserving region settings in setting.txt
2019-12-19 20:47:56 +10:00
Shawn Hoffman
e3a30fbdf2 update minilzo to 2.10 2019-12-18 22:20:11 -08:00
Léo Lam
3cf2857aac
Merge pull request #8520 from lioncash/analyst-tidy
PowerPC/PPCAnalyst: Remove unimplemented LogFunctionCall prototype
2019-12-15 12:07:38 +01:00
Lioncash
7c12081693 PowerPC/PPCAnalyst: Remove unimplemented LogFunctionCall prototype
This doesn't have an implementation, so it can be removed.
2019-12-15 00:23:32 -05:00
JosJuice
208c6a3011 Boot: Optionally allow preserving region settings in setting.txt
See the discussion in https://bugs.dolphin-emu.org/issues/11930.
(This probably doesn't really fix that issue, but it's something
I thought would make sense anyway.)
2019-12-14 19:03:20 +01:00
Léo Lam
6cd2f5a76d
Merge pull request #8501 from lioncash/byteswap
GCMemcard: Remove byteswapping functions and macros
2019-12-14 14:28:01 +01:00
Léo Lam
49fcc71565
Merge pull request #8506 from lioncash/cache
PPCCache: Make arrays constexpr where applicable
2019-12-14 14:25:06 +01:00
Connor McLaughlin
a980a39807
Merge pull request #8518 from stenzek/more-wiimote-reset-crashes
Core: Reset Wiimotes/rumble/memwatcher on emu thread
2019-12-13 13:44:22 +10:00
spycrab
0cb3257d3f
Merge pull request #8435 from firodj/pr-fix-macos-qt-plugin-cocoa
DolphinQt: Fix qt.qpa.plugin on MacOS
2019-12-10 17:41:02 +01:00
Stenzek
e5485ca499 Core: Reset wiimotes/rumble on emu thread instead of main thread
This was causing a race which was crashing the FifoCI runners. The main
thread called Stop() which in turn called ResetAllWiimotes() while the
emu thread was still exiting, also shutting down the Wiimote class.

By shifting the reset to the emu thread, all cleanup operations happen
on the same thread where they were initialized.
2019-12-09 20:07:00 +10:00
Stenzek
c602cb2e2f Core: Reset memory watcher on same thread which allocates it 2019-12-09 20:06:14 +10:00
Stenzek
e05bc33899 Vulkan: Call VertexManagerBase initialize 2019-12-09 19:16:15 +10:00
Stenzek
07c43b192f D3D12: Call VertexManagerBase initialize 2019-12-09 19:16:04 +10:00
Anthony
a21fb96638
Merge pull request #8516 from JosJuice/scrub-unencrypted-again
Fix scrubbing unencrypted Wii disc images (for real this time)
2019-12-08 12:25:16 -08:00
JosJuice
711b36075c Fix scrubbing unencrypted Wii disc images (for real this time)
Unlike what my past self apparently thought, % is in fact not the
"round down" operator.

https://bugs.dolphin-emu.org/issues/11906
2019-12-08 19:41:40 +01:00
Anthony
bac8c060b5
Merge pull request #8508 from lioncash/fmt-tex
VideoCommon/TextureConverterShaderGen: Convert over to fmt
2019-12-07 18:41:14 -08:00
Anthony
9ef50a1d4b
Merge pull request #8509 from lioncash/shader-str
VideoCommon/FramebufferShaderGen: Minor clean up
2019-12-07 18:40:56 -08:00
Anthony
19ea546a0a
Merge pull request #8511 from lioncash/if-constexpr
VideoCommon/OpcodeDecoding: Make use of if constexpr
2019-12-07 18:40:15 -08:00
Anthony
fdb78b64e1
Merge pull request #8513 from lioncash/bounding-box
VideoCommon/BoundingBox: Make interface for querying bounding box data
2019-12-07 18:40:02 -08:00
Anthony
b39756dbce
Merge pull request #8512 from lioncash/index
VideoCommon/IndexGenerator: Eliminate static state
2019-12-07 18:38:06 -08:00
Lioncash
81edcca8db Common/Network: Use std::nullopt in StringToMacAddress
Prevents unnecessary zeroing out of std::optional's internal buffer in
some implementations.
2019-12-06 09:59:11 -05:00
Lioncash
cbfacc41ba Common/Network: Remove unused header inclusions
Removes unused header dependencies.
2019-12-06 09:51:28 -05:00
Lioncash
f06461d208 Common/Network: Make StringToMacAddress use a string_view
This function only ever reads the contents of the string in a non-owning
manner, so we can change the parameter over to being a string view.
2019-12-06 09:45:25 -05:00
Lioncash
2c9ec6cb8a VideoCommon/BoundingBox: Move PixelShaderManager::SetBoundingBoxActive() calls into Enable()/Disable()
Now that we have an actual interface to manage things, we can stop
duplicating the calls to to the pixel shader manager and remove the
need to remember to actually do so when disabling or enabling the
bounding box.
2019-12-05 11:57:58 -05:00
Lioncash
9bd533ebe4 VideoCommon/BoundingBox: Make interface for querying bounding box data
Rather than expose the bounding box members directly, we can instead
provide an interface for code to use. This makes it nicer to transition
from global data, as the interface function names are already in
place.
2019-12-05 11:48:42 -05:00
Lioncash
10f7674651 VideoCommon/IndexGenerator: Eliminate static state
Now that we've extracted all of the stateless functions that can be
hidden, it's time to make the index generator a regular class with
active data members.

This can just be a member that sits within the vertex manager base
class. By deglobalizing the state of the index generator we also get rid
of the wonky dual-initializing that was going on within the OpenGL
backend.

Since the renderer is always initialized before the vertex manager, we
now only call Init() once throughout the execution lifecycle.
2019-12-05 10:49:32 -05:00
Lioncash
159947ab68 VideoCommon/IndexGenerator: Make use of if constexpr
We can use if constexpr with the template functions that pass in a
non-type template parameter, allowing the removal of branches that
aren't taken at compile time.

Compilers will generally do this by default, however, we now give a
gentle prodding to the compiler if this would otherwise not be the case.
2019-12-05 10:49:32 -05:00
Lioncash
fb3fda775f VideoCommon/IndexGenerator: Move stateless functions into anonymous namespace
These don't rely on any of the static members within the IndexGenerator
class, so we can make all of these functions fully internal to the
translation unit.
2019-12-05 10:49:29 -05:00
Lioncash
69f2ca2230 VideoCommon/IndexGenerator: Make use of anonymous namespace
More things will be moved into this in subsequent changes. While we're
at it, we can also make use of std::array.
2019-12-05 09:36:41 -05:00
Lioncash
1f46a6a64b VideoCommon/OpcodeDecoding: Make use of if constexpr
We can make use of if constexpr in several scenarios here to allow
compilers to exise the relevant code paths out.

Technically a decent compiler would do this already, but now we can give
compilers a little more nudging here in the event that isn't the case.
2019-12-05 09:13:06 -05:00
Lioncash
99353c3baa VideoCommon/OpcodeDecoding: Remove unused headers
Nothing provided by these headers are used, so we can remove them.
2019-12-05 09:13:06 -05:00
Lioncash
6339a5ea8e VideoCommon/OpcodeDecoding: Resolve implicit signedness conversion
cmd2 is a u32, so any bitwise arithmetic on it with a type of the same
size or smaller will result in a u32 value. This is also implicitly
converted to an unsigned type in the if statement as well, given that
size_t * int -> size_t.

This is just more explicit about the operations occurring and also
likely silences a sign conversion warning.
2019-12-05 09:13:06 -05:00
Lioncash
4710b82f43 VideoCommon/OpcodeDecoding: Remove use of goto in Run()
With the use of a lambda and a change in switch fallthrough, we can
completely eliminate the use of goto within Run().
2019-12-05 09:13:06 -05:00
Lioncash
f74503cce0 VideoCommon/OpcodeDecoding: Make use of anonymous namespace
Provides a region for all internal utilities.
2019-12-05 09:13:06 -05:00
Lioncash
6b4e340995 VideoCommon/OpcodeDecoding: Amend comment formatting
Amends a documentation comment that acquired some wonky formatting
during the introduction of clang-format a few years ago.
2019-12-05 09:13:06 -05:00
Lioncash
b2a9c36501 VideoCommon/OpcodeDecoding: Move g_bRecordFifoData into namespace
Keeps the global localized with the code that it's primarily related to.

Now it's obvious from a glance what the global variable is affecting.
2019-12-05 09:13:03 -05:00
Lioncash
d8063e9c54 VideoCommon/OpcodeDecoding: Normalize variable naming
Provides consistent naming of variables within the translation unit.

While we're at it, we can mark them const where applicable.
2019-12-05 08:05:29 -05:00
Lioncash
f29730944f VideoCommon/FramebufferShaderGen: Make use of std::ostringstream internally
We only use these string streams to output into a final std::string
instance, we don't read into types with them. Because of this, we can
just make use of std::ostringstream, rather than the fully-fledged
std::stringstream.
2019-12-05 00:18:00 -05:00
Lioncash
fff445cc10 VideoCommon/FramebufferShaderGen: Make use of std::string_view where applicable
Prevents the use of the null pointer as an input to any functions.
2019-12-05 00:15:37 -05:00
Lioncash
3405815f09 VideoCommon/FramebufferShaderGen: Remove unused Config struct
This isn't used anywhere within the codebase, so it can be removed
entirely.
2019-12-04 23:54:15 -05:00
Lioncash
3a8d17c140 VideoCommon/FramebufferShaderGen: Use an anonymous namespace where applicable
Places all internal helpers and types within an anonymous namespace.
2019-12-04 23:51:26 -05:00
Lioncash
eefd6a10f5 VideoCommon/FramebufferShaderGen: Add missing initial source file comments
Makes the source files consistent with the rest of the VideoCommon code.
2019-12-04 23:48:59 -05:00
Lioncash
f8c90f0484 VideoCommon/FramebufferShaderGen: Collapse stream insertions
No behavioral change. This is intended to make the transition to fmt
less noisy in subsequent changes by combining insertions of multiple
string literals into one where applicable.
2019-12-04 23:45:15 -05:00
rlnilsen
965781ea9d Motion Input: Add nunchuk support. 2019-12-04 23:21:26 +01:00
Lioncash
0f28f4049b VideoCommon/TextureConverterShaderGen: Convert over to fmt
Easily the most straightforward to convert over, given the lack of
significant formatting arguments.
2019-12-03 05:05:02 -05:00
Lioncash
8af6bfb8b0 VideoCommon/ShaderGenCommon: Add function for writing fmt-based strings
Begins the conversion of the shader generators over to using fmt
formatting specifiers.

This also has a benefit over the older StringFromFormat-based API in
that all formatted data is appended to the existing buffer rather than
creating a completely separate string and then appending it to the
internal string buffer.
2019-12-03 04:49:48 -05:00
Lioncash
474e210cd5 PPCCache: Make arrays constexpr where applicable
Two of these arrays were stored within the save state when the exact
same data is constructed all the time.

We can just build this into the binary rather than the save state,
shrinking a little bit of the save state's overall size.
2019-12-03 04:05:09 -05:00
Lioncash
1d5ce4708f PPCCache: Make use of std::array where applicable
Allows simplifying a bunch of initialization and filling code.
2019-12-03 04:05:05 -05:00
Connor McLaughlin
15fc71cfcf
Merge pull request #8498 from stenzek/update-vs2019
Update VS projects/solutions to VS2019
2019-12-03 13:03:49 +10:00
Stenzek
52e2e32193 Core: Only reset wiimotes in Wii mode
This was causing the FifoCI runners to crash, as the Wiimotes were not
initialized in the first place.
2019-11-30 15:41:38 +10:00
Stenzek
33c0abd1ab Disable warning C5054 on DolphinQt
They're all in the Qt headers, and quite noisy.
2019-11-30 13:42:52 +10:00
Stenzek
dd23a1ee79 Update VS projects/solutions to VS2019 2019-11-30 13:42:52 +10:00