Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`.
Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move.
Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
The only call of `IsScannerReady` was removed by
81be0001a9, and most of the `IsReady`
functions were only called by `IsScannerReady`.
The one exception was in `WiimoteScannerLinux`, which is now a private
function instead of inheriting from the one in `WiimoteScannerBackend`.
`value` contains 16 bits of data and `remainder` contains 11 bits of
data. When they're added together, we may end up with 17 bits of data,
so the result should be stored as u32 rather than u16.
This fixes `y` being set to 0 (minimum amplitude) when it should be set
to 32 (maximum amplitude).
In the PWM audio we output, instead of each group of 512 bits consisting
of a run of ones followed by a run of zeroes, now each group of 32 bits
consists of a run of ones followed by a run of zeroes. This gets rid of
noise that was previously present.
Doing this for every group of 8 bits instead makes the Game Boy Player
Start-Up Disc not start correctly for some reason. Game Boy Interface
works fine, though.
I also made us not discard the bottom 7 bits of each PCM sample.
According to Extrems, a real GBA doesn't actually output that many bits,
but doing it in this way makes the code simpler anyway.
Unmapped on the physical level, not the MMU level.
Fixes booting Game Boy Interface. Previously, Game Boy Interface thought
it was running on a Wii because accessing MEM2 didn't raise a PI
interrupt, and as a result tried to exit to the Homebrew Channel in a
way Dolphin's HLE doesn't recognize. (Dolphin's HLE catches jumps to
0x80001800, but GBI is running without address translation at this point
and therefore jumps to 0x00001800 instead.)
Jit64::dcbz's fast path bypasses the dcache, so we shouldn't use it if
accurate dcache is turned on. This fixes the graphical corruption that
would occur in Mario Kart Wii's menu FMVs with accurate dcache.
JitArm64 never had this problem, because it implements dcbz in a
different way. It calls EmitBackpatchRoutine, which already has a check
for accurate dcache.
`OpenModeToAndroid("r")` is conceptually wrong, since we're opening a
binary file. It should be either `OpenModeToAndroid("rb")` or just
`"r"`. But either way it evaluates to `"r"`, so this doesn't affect
behavior.
SAF for save files is a huge can of worms because they're managed in a
more complicated way than asking the user to select an existing file,
so I won't be touching save files for now.