Commit graph

16373 commits

Author SHA1 Message Date
hthh
88d52b4d69 TextureDecoder: Deduplicate some utility code 2017-01-15 20:23:26 +11:00
Matthew Parlane
e727e91be6 Merge pull request #4660 from JosJuice/gfx-debug-strings
Remove seemingly unused debug UI strings
2017-01-15 11:53:25 +13:00
JosJuice
2052bb8bea Remove seemingly unused debug UI strings
wxChoice controls don't display any titles.

By the way, why is the file called DebuggerPanel.cpp
even though it implements the Video debug panel specifically?
2017-01-14 22:34:49 +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
Pierre Bourdon
45a1232920 IOS: Add partial wfsi/wfssrv implementations.
The current implementations do many things wrong but work well enough to
run the Dragon Quest X installer until the very end. The game itself
crashes when being launched from its System Menu channel unfortunately
so it is hard to verify whether the install properly worked or not.

There are plenty of "TODO(wfs)" sprinkled around this codebase with
things that are knowingly done wrong. The most important one right now
is that content extraction is done by buffering everything into memory
instead of properly streaming the data to disk (and processing
asynchronously), which causes freezes. It is likely to not cause any
practical issues since only the installer and the updater should use
this anyway.
2017-01-14 19:56:43 +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
Pierre Bourdon
a8f7012cf7 IOS/ES: Implement basic title installation.
There are several things wrong with this implementation. The first being
that since we still don't have a proper ticket/tmd handling library, we
hardcode offsets once again to fetch TMD fields. The second being that
we don't stream data to the disk and we buffer everything in memory. The
third being that we don't properly fetch the content index for
decryption, which is prone to breaking.

But hey, it works well enough to install the DQX channel!
2017-01-14 17:06:40 +01:00
Pierre Bourdon
0a5cfd8946 IOS: Add ESFormats.{cpp,h}.
This library implements basic parsing support for some of the IOS ES
formats we need to extract data from. Currently only implements TMD
functions, but some ticket handling functions from DiscIO should likely
be moved here in the future.
2017-01-14 17:06:40 +01:00
Pierre Bourdon
334ddf754e DiscIO: Export GetKeyFromTicket
This function has more uses than just in DiscIO (e.g. WFS).
2017-01-14 17:06:40 +01:00
Pierre Bourdon
650a1fdb1f DiscIO: Implement functions to lookup tickets
These two functions load either a signed ticket or a raw ticket from the
emulated NAND.

The ticket signature skip is refactored out of the ticket writing in
order to be usable by the raw ticket reading function.
2017-01-14 17:06:40 +01:00
Pierre Bourdon
2ed352698f IOS/ES: Implement ES_AddTicket.
Refactor the existing DiscIO::AddTicket to not require the caller to
pass the requested title ID. We do not have the title ID in the ES case,
and it needs to be extracted from the ticket. Since this is always a
safe operation to do (title ID is always in the ticket), the
implementation is made default.
2017-01-14 15:23:16 +01:00
Pierre Bourdon
c30635c70a IOS/ES: Factor out the ES_Decrypt implementation.
WFSI calls into ES to perform this operation, so expose a way for us to
do the same thing.
2017-01-14 15:23:16 +01:00
hthh
5d4e4aa561 TextureDecoder: Fix off-by-one errors in CMPR 2017-01-14 10:52:35 +11:00
Lioncash
45415e1057 ColorUtil: Make decodeCI8image's pal parameter const 2017-01-13 17:07:26 -05:00
Matthew Parlane
30e57cecf7 Merge pull request #4653 from lioncash/dsp-define
DSPInterpreter: Get rid of a #define constant
2017-01-14 10:54:48 +13:00
Jules Blok
271a9fe7a9 VertexShaderManager: Break up the conditions to make it readable. 2017-01-13 14:01:17 +01:00
Jules Blok
f866748006 VertexShaderGen: Remove the need for an extra UID. 2017-01-13 14:01:17 +01:00
Matthew Parlane
ad84b904e4 Merge pull request #4496 from Mystro256/master
Fix GCC build issue with Fedora (linux)
2017-01-13 23:13:08 +13:00
Matthew Parlane
0d43b0e0e4 Merge pull request #4652 from lioncash/memcard
GCMemcard: Const-correctness changes
2017-01-13 23:09:08 +13:00
Lioncash
35cc4a4202 DSPInterpreter: Get rid of a #define constant
This constant isn't particularly helpful, mainly because it's not
applicable to all DSP instructions. Some instructions don't have encoding
space for registers, and not all instructions that do encode registers
have one at the first five bits.

This change also has the benefit of removing all includes to the
interpreter within the JIT code, which keeps them fully separate from one
another. Changes to the interpreter header won't require some of the JIT
code to be rebuilt.
2017-01-12 20:36:52 -05:00
Lioncash
0035a4ef3d GCMemcard: Const-correctness changes
A few function reference and pointer parameters are only read from.
2017-01-12 20:01:19 -05:00
Léo Lam
5fd486014b DolphinWX: Always keep panic alerts on top
This should prevent silly things like panic alerts opening *behind* the
render window and thus being impossible to see.
2017-01-12 23:40:58 +01: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
Matthew Parlane
9838afea41 Merge pull request #4479 from GerbilSoft/feature/RVT-R.dev-key
Support for RVT-R disc images
2017-01-13 09:56:50 +13:00
Matthew Parlane
22546aef37 Merge pull request #4499 from ligfx/msgalertmainthread
DolphinWX: pass wxMsgAlert to main thread on non-GTK too
2017-01-13 09:52:09 +13:00
Matthew Parlane
24f7ebc890 Merge pull request #4420 from JosJuice/memcard-header-time
Don't use GetEmulatedTime in GCMemcard
2017-01-13 09:49:35 +13:00
degasus
fe41ed7fa1 JitCache: Use pointers in the ICache and dispatchers. 2017-01-12 21:43:28 +01: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
Matthew Parlane
d346d4ced1 Merge pull request #4544 from JosJuice/region-enum
DiscIO: Add GetRegion function and Region enum
2017-01-13 09:19:27 +13:00
Matthew Parlane
34c6672b97 Merge pull request #4446 from leoetlino/countries
ConfigManager: Don't overwrite the SYSCONF country
2017-01-13 09:09:56 +13:00
Matthew Parlane
356619642b Merge pull request #4647 from degasus/jitcache
JitCache: Clean up block id handling.
2017-01-13 09:00:46 +13:00
degasus
d4a529614a Jit64: Use PPCSTATE reg if possible. 2017-01-12 20:55:17 +01:00
degasus
a8b26937f3 JitCache: Clean up GetBlockFromStartAddress. 2017-01-12 20:24:43 +01:00
degasus
214f37ecef JitCache: Rename variables. 2017-01-12 20:23:14 +01:00
degasus
3ee178abe7 JitCache: Drop unused functions. 2017-01-12 20:23:14 +01:00
degasus
7e850361fb JitCache: Add a helper function to iterate over all blocks. 2017-01-12 20:23:14 +01:00
degasus
ca026b58ab JitCache: Use a pointer in links_to. 2017-01-12 20:23:14 +01:00
degasus
928ccbef53 JitCache: Use a pointer in block_map. 2017-01-12 20:23:14 +01:00
degasus
74a27d9742 JitCache: Use a pointer in start_block_map. 2017-01-12 20:23:14 +01:00
degasus
2d5288dc10 JitCache: Return a pointer in AllocateBlock. 2017-01-12 20:23:14 +01:00
degasus
f14cebf079 JitCache: Use a pointer in FinalizeBlock. 2017-01-12 20:23:14 +01:00
degasus
d3aa8c8080 JitCache: Return a pointer in GetBlockFromStartAddress. 2017-01-12 20:23:14 +01:00
degasus
f6ec96efbd JitCache: Use a pointer in DestroyBlock. 2017-01-12 20:23:14 +01:00
degasus
68c85d32f7 JitCache: Use a pointer in UnlinkBlock. 2017-01-12 20:23:14 +01:00
degasus
eb390f3020 JitCache: Use a pointer in LinkBlock. 2017-01-12 20:23:14 +01:00
degasus
ccb8c44a5a JitCache: Use a pointer in LinkBlockExits. 2017-01-12 20:23:14 +01:00
Matthew Parlane
119dfbb436 Merge pull request #4648 from lioncash/iofile
IOFile: Get rid of IOFile's ReleaseHandle function
2017-01-13 08:15:23 +13: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
Matthew Parlane
0b6e5765dd Merge pull request #4610 from ligfx/fixgamelist
DolphinWX: Fix position of GameListCtrl tooltips on macOS
2017-01-12 14:18:05 +13:00
Michael Maltese
fdcf5aeb75 DolphinWX: Fix position of GameListCtrl tooltips on macOS 2017-01-11 16:59:15 -08:00
Matthew Parlane
04a86e1cee Merge pull request #4646 from leoetlino/minor-simplifications
IOS HLE: Minor simplifications
2017-01-12 12:32:05 +13:00
Matthew Parlane
ed6e346664 Merge pull request #4617 from lioncash/hotkey
HotkeyInputConfigDialog: Move UI creation into named functions
2017-01-12 11:02:10 +13:00
Matthew Parlane
c765087548 Merge pull request #4645 from lioncash/breakpoints
BreakPoints: Minor changes
2017-01-12 11:01:11 +13:00
Lioncash
b760479f77 BreakPoints: Use std::any_of where applicable 2017-01-11 16:37:31 -05:00
Léo Lam
13c374b118 IOS HLE: Replace some loops with range-based loops 2017-01-11 21:20:15 +01:00
Léo Lam
36c4dda4ed IOS HLE: Simplify Reset() and SetDefaultContentFile()
Reset():
We only need to close IOS devices which were opened, and we can do that
simply by iterating over s_fdmap and closing any opened device.
With this change, s_device_map can be cleared at once.

SetDefaultContentFile():
We can just use s_es_handles which is guaranteed to contain three valid
ES devices. Gets rid of a downcast.
2017-01-11 17:52:28 +01:00
Lioncash
e97953130d BreakPoints: Use character literals for finding single characters
The single character find overload is better suited over the one for
finding character sequences.
2017-01-11 10:08:14 -05:00
Lioncash
4e649c60c0 BreakPoints: Make getters const member functions
Just const-correctness stuff. The returned collection can't be modified,
so this makes sense.
2017-01-11 10:08:14 -05:00
Lioncash
0f8bcf412d BreakPoints: Rename variables
Drops Hungarian notation where applicable.Drops Hungarian notation where
applicable.
2017-01-11 10:08:11 -05:00
Lioncash
274ab8a262 BreakPoints: Make the memchecks class member private
There's no need to make this public.
2017-01-11 10:07:34 -05:00
Markus Wick
f82d6c6fe1 Merge pull request #4644 from leoetlino/no-return-value
IOS HLE: Make Device::Update() return void
2017-01-11 15:09:41 +01:00
Mat M
55b82e323c Merge pull request #4537 from JosJuice/blob-open-less-files
Open less files when detecting/opening blobs
2017-01-11 08:30:16 -05:00
Léo Lam
15567ef2bf IOS HLE: Remove useless overrides in bt_stub
Since the Open command won't ever return with the stub, there's no way
we will get a Close/IOCtl/IOCtlV for it, so we don't have to
implement it at all.
2017-01-11 14:06:01 +01:00
Léo Lam
f66aab6381 IOS HLE: Make Device::Update() return void
The return value is not used at all, so it's useless to keep it.
And the semantics of the return value were not even well defined.
2017-01-11 14:06:01 +01:00
Lioncash
93c5c0213f BreakPoints: Convert typedefs into using aliases 2017-01-11 07:59:43 -05:00
Lioncash
50ee01754e BreakPoints: Add initializers for TBreakPoint and TWatch
Ensures all members are consistently initialized.
2017-01-11 07:55:43 -05:00
Lioncash
588374349f BreakPoints: In-class initialize TMemCheck members
Same thing, less code.
2017-01-11 07:53:49 -05:00
JosJuice
b1873264d7 WbfsBlob: Don't wrap file_entry in std::unique_ptr
There doesn't seem to be any reason for doing it.
2017-01-11 13:39:46 +01:00
JosJuice
0363be4320 WbfsBlob: Remove m_total_files
std::vector already keeps track of this for us.
2017-01-11 13:39:38 +01:00
JosJuice
5c02795af0 WbfsBlob: Only open each file once
The first file used to be opened once by
CreateBlobReader and once inside WbfsFileReader.
2017-01-11 13:33:27 +01:00
JosJuice
8d54bbc528 Don't create new IOFiles when creating a blob
...except for WBFS, which is special because
it has the ability to open multiple files.
2017-01-11 13:23:23 +01:00
JosJuice
d1ea00ed88 Only open file once when detecting blob type 2017-01-11 13:23:19 +01:00
Markus Wick
d9a37d38b4 Merge pull request #4571 from degasus/DSPHLE
Attempt re-adding the missing AXWii DSP_SYNC
2017-01-10 22:23:35 +01:00
Jack Andersen
3869eec53a DSP: Clean up GBA crypto HLE implementation 2017-01-10 10:34:34 -10:00
Markus Wick
52ec186f0a Merge pull request #4642 from stenzek/split-x64-texture-decoders
TextureDecoder: Seperate each format into its own function
2017-01-10 12:06:47 +01:00
Stenzek
2f223e24dc TextureDecoder: Seperate each format into its own function 2017-01-10 20:41:00 +10: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
Matthew Parlane
ab2542ea41 Merge pull request #4630 from PEmu1/refresh-game-list
Change "Refresh List" to "Refresh Game List" in Menu
2017-01-10 14:06:23 +13:00
Markus Wick
440a2f832c Merge pull request #4637 from lioncash/jitcache
JitCache: Get rid of reliance on the JIT global variable
2017-01-10 00:07:17 +01:00
Léo Lam
a68aea1ace IOS HLE: Replace is_hardware with a proper device type
is_hardware is an obscure name (what does hardware mean?) and it forces
us to assume that anything that !is_hardware is a FileIO device. This
assumption prevents properly restoring OH0 child devices (which will be
implemented in the USB PR), so this commit replaces the is_hardware
bool with a device type.
2017-01-09 12:27:45 +01:00
Lioncash
37d10064b8 JitCache: Get rid of reliance on the JIT global variable 2017-01-09 04:43:06 -05:00
Lioncash
f75aab1a85 CachedInterpreter: Separate the block cache from CachedInterpreter
An interpreter is not a block cache. It may utilize a block cache, it may
contain a block cache but it *is not* A block cache.
2017-01-09 04:43:05 -05:00
Lioncash
eddccb3891 CachedInterpreter: Move to its own directory 2017-01-09 04:43:05 -05:00
Lioncash
2b8ede8dc6 JitCache: Move implementation details into the cpp file 2017-01-09 04:43:04 -05:00
Lioncash
cf18aeb1eb JitCache: Move private class details below public details
Also organizes cpp file organization to match the function layout.
2017-01-09 04:42:59 -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
Matthew Parlane
0869c63048 Merge pull request #4634 from leoetlino/probably-pointless-ios-fixes
IOS HLE: Minor changes to match IOS behaviour
2017-01-09 13:49:32 +13:00
Lioncash
00baf193ac CodeBlock: Const correctness for IsInSpace 2017-01-08 18:40:09 -05:00
Léo Lam
c761ac4f08 IOS HLE: Set return value to EINVAL for unknown commands
This matches IOS behaviour and allows getting rid of command handlers
which merely set the return value to EINVAL.
2017-01-08 21:18:08 +01:00
Léo Lam
45b59f01b8 IOS HLE: Allow up to 3 ES handles
Confirmed by a hardware test and a quick diassembly of /dev/es.

I'm not aware of anything that opens several ES handles, but
technically, this fixes a small inaccuracy in IOS HLE.
2017-01-08 21:16:10 +01:00
Léo Lam
23162ac722 IOS HLE: STM: Check if there is already an event hook
For IOCTL_STM_EVENTHOOK, IOS checks if there is already an event hook
to prevent overriding an existing event hook message with a new one,
without first releasing it.
2017-01-08 21:16:10 +01:00
Matthew Parlane
5135445298 Merge pull request #4627 from leoetlino/naming-cleanup
IOS HLE: Naming cleanup
2017-01-09 09:08:50 +13:00
Chris Burgener
47b3a9c68e Add Silent Audio Dumping INI Option 2017-01-08 13:53:44 -05:00
PEmu1
b25ed121d1 Change "Refresh List" to "Refresh Game List" in Menu
Make refresh list option more clear as to what it does and more consistent with other usage in the UI.
2017-01-08 09:24:17 -08:00
flacs
c30216003e Merge pull request #4622 from degasus/videosw
VideoSW: Fix GL ES shader.
2017-01-08 17:03:57 +00:00
Lioncash
27350dbf1c Jit64Base: Use size_t to represent size in LogGeneratedX86 2017-01-07 21:57:19 -05:00
Lioncash
77756b44d5 Jit64Base: Const correctness for LogGeneratedX86 2017-01-07 21:53:06 -05:00
Matthew Parlane
7a4464c3e0 Merge pull request #4599 from stenzek/point-uvs
GeometryShaderGen: Use lower-left origin for point texture coordinates
2017-01-08 13:40:55 +13:00