This adds unit tests for the Wii filesystem now that the filesystem
interface is neatly separated from the IPC code.
Basic FS functionality is tested, in addition to problematic usages and
edge cases that Dolphin used to handle incorrectly (which of course
broke emulated software).
These tests should make it quite a bit harder to introduce regressions.
Issues that are covered by the tests in particular:
* Metadata: issue 10234 (though tests are commented out for now because
Dolphin doesn't support NAND images yet so it can't track metadata);
* EOF seeks/reads: https://github.com/dolphin-emu/dolphin/pull/4942
* Read/write operations from multiple handles: see issue 2917, 5232 and
8702 and https://github.com/dolphin-emu/dolphin/pull/2649
Xlib has really terrible headers that declare non-namespaced
macros and typedefs for common words.
Just wasted 10 minutes trying to figure out why a unit test failed
to build before I remembered it was Xrandr.h conflicting with our
enum class members again.
To fix the issue, this removes the Display* parameter from the
EnableScreensaver function (which was unused) so we don't have
to include Xrandr.h anymore.
Allows us to bring includes and relevant libraries into scope by explicitly declaring linkage against the target
as opposed to using a variable. Also removes the dumping of OProfile includes into the top-level directory.
Just re-disassembled STM and found out I have made a mistake when
I changed STM stuff back in 2016.
I accidentally made STM reset the event hook on close when it should
have been done in the destructor (i.e. when IOS gets reset on console).
Verified in IDA that STM just `IOS_ResourceReply(request, IOS_OK)`
without ever resetting the hook.
Some button names should be translated, for instance Up, Left and such.
At the same time, some other button names shouldn't be translated,
for reasons that might be less obvious. In 0146456af, I removed the
_trans markers for button names that never need to be translated
(such as A and B), but that isn't actually enough to ensure that
DolphinWX won't try to translate them anyway. This commit adds a bool
that explicitly tells the GUI whether a button name should be translated.
Otherwise we'll have problems like the GUI treating the button name "B"
(which isn't supposed to be translated) as matching the translatable
string "B" (being an abbreviation of "bytes"), meaning that the button
"B" will be labeled "o" when running Dolphin in French (after
translations get pulled from Transifex the next time).
By the way, while it turned out that DolphinWX translated all button
names, it also turned out that DolphinQt2 translated *no* button names.
Go figure. This commit makes them consistent with each other.
There's no real requirement to make this const, and this should also
be decided by the calling code, considering we had places that would
simply cast away the const and carry on.
It's not common code that could be reused for, say, Citra;
it's absolutely specific to Wii emulation and only used by the Dolphin
core, so let's move it there.
Another reason for doing this is to avoid having Common depend on Core.
It was discovered that some titles rely on filesystem metadata to work
properly. Currently, in master they either simply won't find their
save files (for example Bolt) or will complain about the Wii system
memory being corrupted (on first use or every time depending on
the title).
In order to even be able to keep track of file metadata, we first need
to eliminate all direct accesses to the NAND and make all kinds of
operations go through the filesystem code added in PR 6421.
This commit starts the migration process by making SysConf use
the new FS interface.
After 3a83ebc, the Show System Clock feature started using the
unfortunate combination of MM/DD/YY dates (rare outside of the US)
and 24-hour time (rare in the US) regardless of the user's locale
settings. This commit makes it use the configured locale again.
I've noticed one minor difference in behavior between now and
before 3a83ebc: The new way of setting the C/C++ locale seems to
treat "en" as "en-US", but the wx way of setting the C locale
treated it as "en-GB" (at least on Windows).
Migrates the state to be instance-based as opposed to being a flat
namespace. This keeps behavior localized to its own instantiable unit
(and forces uses of the class to also be localized, lest they cart around
an instance all over the place).
This was necessary to work around a FS timing issue which caused small
writes to take much longer than they should.
Now that we emulate timings for the FS module including its file cache,
we don't need to maintain this workaround anymore.
Everything that links in core doesn't need to see anything related to bochs, because it's only used internally.
Anything else that relies on bochs should be linking it in explicitly.
The general convention is to return a reference to the object that was
acted on, otherwise you can get into situations with errors because the
type wasn't being propagated properly
Using this in its current form would invoke undefined behavior, as it's
using a union to type pun between data types. It's also, well, unused,
so we don't need to keep it around.
We already read the necessary information with the
HostRead_Instruction() call. Internally, it calls HostRead_U32() as
well, so there's no difference in behavior.
If the locked cache isn't enabled, dcbz_l is illegal to execute
(locked cache is off, locked cache instructions don't work, makes sense)
This makes exception handling more accurate. It was previously possible to hit the DSI exception
handler when HID2[LCE] is set to zero, which isn't correct.
With this change we no longer hit the DSI handler, however we still have a lingering issue elsewhere
likely to do with exception precedence, we seem to hit the Floating Point exception handler instead
in some cases. This isn't due to the instruction itself directly however, so this is just another bug
to fix elsewhere.
CMake already has this functionality built-in. This lessens depending on the host system environment
and is more cross-platform friendly (which is always nice from a build-system point of view).
In the case we had X11 libs available, we'd allocate an XRRConfiguration instance and pass it
to the GraphicsWindow instance, but it would never actually be freed.
add_definitions and include_directories don't operate on a by-target basis, they act on a
by-directory basis (i.e. if we defined two targets, A and B, in this CMakeLists file, add_definitions
would add the definitions to the COMPILE_DEFINITIONS directory property which both A and B would
implicitly use).
The same idea applies to include_directories, only it appends to the INCLUDE_DIRECTORIES directory
property.
Instead, specify these on the target to keep scope as narrow as possible.
This is one of the conditions for an alignment exception documented in
the 750CL architecture reference manual in section 4.5.6, which also
applies to the Gekko microprocessor.
This is an exception condition documented within section 4.5.6 in the
architecture reference manual for the PPC 750CL, which also applies to
the Gekko microprocessor.
Also moves dcbz_l's implementation out of Interpreter_Paired and beside
dcbz where it belongs.
The effective address given to these instructions must be word (4 byte) aligned,
and if the address is not aligned like that, then an alignment exception
gets triggered.
We currently don't update the DSISR in this case properly, since we
didn't really handle alignment exceptions outside of ecowx and eciwx,
and even then the handling of it isn't really that great, considering
the DAR isn't updated with the address that caused the exception to
occur.
The DSISR will eventually be amended to be properly updated.
Prior to this change, it's possible for m_wake_me_up_again to be used
while it's in an uninitialized state from the exposed API.
e.g.
- Using SetEnable after construction would perform an uninitialized read.
- Using PushEvent would perform an uninitialized read by way of operator |=.
internally, an uninitialized read can happen if PullEventsInternal() is
executed before other functions.
Just to avoid the whole possibility of performing uninitialized reads,
we just give the class member a default value of false.