Commit Graph

27224 Commits

Author SHA1 Message Date
JosJuice b6395a7c49 PPCAnalyst: Don't treat blr as writing to CR
This piece of code is rather hard to understand, but my best guess
at what it's trying to do is that it tries to create opportunities
to skip writing CRs back to ppcState if we know that there are no
CR instructions (or branch instructions, etc) between an instruction
that writes to a CR register and the next blr. This is technically
inaccurate emulation, but as long as games don't do anything too
weird with their ABIs, I suppose it doesn't break anything.

So why do I want to get rid of it? Well, other than breaking some
hypothetical weird game, I imagine it could trip up people trying
to debug a game who are looking at the CR contents. And the code
is just plain confusing. (blr clearly doesn't write to CRs!)
2021-12-21 21:29:55 +01:00
Pokechu22 fd2324e40a Fifo analyzer: Rename mipmap filter to half scale for EFB copies
The field itself is named half_scale, and it can be used for things unrelated to mipmaps, so reflecting that name in the fifo analyzer helps.
2021-12-20 11:34:05 -08:00
Pokechu22 2f6953efb6 TextureConverterShaderGen: Set alpha to 1 on intensity formats if EFB lacks alpha
We were already doing this for non-intensity formats, but it seems like the same applies to intensity formats.
2021-12-20 11:34:05 -08:00
JMC47 32fed91b0d
Merge pull request #9718 from Pokechu22/better-fifo-analyzer-part-3
Fifo analyzer improvements, part 3
2021-12-20 14:27:14 -05:00
JMC47 1714dc64bb
Merge pull request #10120 from Sintendo/jit64arithcxrefactor
Jit64: Merge arithcx into addx/subfx
2021-12-20 14:20:49 -05:00
JMC47 9ed368ead7
Merge pull request #9376 from merryhime/rlwimix2
Jit_Integer: Optimize rlwimix
2021-12-20 14:20:26 -05:00
JMC47 2d1c7352e4
Merge pull request #10280 from iwubcode/wfs_root_configurable
Core / DolphinQt: make WFS directory configurable
2021-12-18 19:02:53 -05:00
Pokechu22 ffa512f5e7 DolphinTool: Remove direct dependency on core
Videocommon also depends on core, which resulted in linking errors (though I'm not sure why).  Ideally, dolphintool woudln't depend on videocommon... but some stuff in core does.
2021-12-18 15:24:29 -08:00
Pokechu22 e7d5f8ad5c TextureCacheBase: Re-wrap GetTexture comment 2021-12-18 15:21:48 -08:00
Pokechu22 f4f4dbbc63 Switch to the Play / Record tab when fifo playback stops 2021-12-18 15:21:48 -08:00
Pokechu22 d1cc539476 BPMemory: Correct spelling of MaxAniso 2021-12-18 15:21:48 -08:00
Pokechu22 f0f12ac8d7 Fifo analyzer: Decode floats in primitive data 2021-12-18 15:21:48 -08:00
Pokechu22 27cb704466 Eliminate VarType for ComponentFormat 2021-12-18 15:21:48 -08:00
Pokechu22 1a964891f8 VertexLoader_Color: Use Common::swap24 2021-12-18 15:21:48 -08:00
Pokechu22 95e0f833f9 Fifo analyzer: Display equations for color/alpha combiners 2021-12-18 15:21:48 -08:00
Pokechu22 0afe318b55 OpcodeDecoding: Make s_is_fifo_error_seen static 2021-12-18 15:21:48 -08:00
Pokechu22 d039b1bc0d VideoCommon: Move VertexLoaderManager logic out of CPState 2021-12-18 15:21:48 -08:00
Pokechu22 e4605fa399 Fifo analyzer: Create a new object for each EFB copy
Previously, EFB copies would be in the middle of other objects, as objects were only split on primitive data.  A distinct object for each EFB copy makes them easier to spot, but does also mean there are more objects that do nothing when disabled (as disabling an object only skips primitive data, and there is no primitive data for EFB copies).
2021-12-18 15:21:48 -08:00
Pokechu22 d84d695fdf Remove DataReader from LoadXFReg 2021-12-18 15:21:48 -08:00
Pokechu22 b5fd35f951 Refactor OpcodeDecoding and FIFO analyzer to use callbacks 2021-12-18 15:21:36 -08:00
Pokechu22 0441826206 Fix wrapping in FifoPlayer comment 2021-12-18 12:51:56 -08:00
Pokechu22 d5cfac71d0 Refactor object listing code
This also adds the commands after the last primitive data but before the next frame as a unique object; this is mainly just the XFB copy.  It's nice to have these visible, though disabling the object does nothing since only primitive data is disabled and there is no primitive data in this case.
2021-12-18 12:51:56 -08:00
Pokechu22 1914087998 Create and use CPArray enum class 2021-12-18 12:51:56 -08:00
Pokechu22 3aaeb2b9ef Convert OpcodeDecoder::Opcode and OpcodeDecoder::Primitive to enum class 2021-12-18 12:51:56 -08:00
Pokechu22 3fc12431c5 Remove parameters to SWVertexLoader::SetFormat
They haven't been used since efbe5bc4b6.
2021-12-18 12:51:56 -08:00
Pokechu22 205ab23d80 GeometryShaderGen: Convert to EnumMap 2021-12-18 12:51:55 -08:00
Pokechu22 f53dc6564f UberShaderPixel: Convert to EnumMap 2021-12-18 12:51:55 -08:00
Pokechu22 380b333387 PixelShaderGen: Convert to EnumMap 2021-12-18 12:51:55 -08:00
Pokechu22 2b1d1038a6 VertexLoader: Convert to EnumMap 2021-12-18 12:51:55 -08:00
Pokechu22 327126d1e8 ShaderGenCommon: Add WriteSwitch 2021-12-18 12:51:55 -08:00
iwubcode 5ecd5f010f Core / DolphinQt: make WFS directory configurable 2021-12-18 01:08:35 -06:00
Admiral H. Curtiss 48560135b3
Jit64: Put the exception exit in twX into farcode.
As a byproduct, this fixes the dont_trap jump not having enough available jump distance to its target in some instances (eg. in Not64).
2021-12-18 06:05:08 +01:00
Markus Wick 80ccb20931
Merge pull request #10267 from JosJuice/jitarm64-bigger-farcode
JitArm64: Allocate 64 MB for farcode
2021-12-16 19:23:31 +01:00
JosJuice 094290792a Core: Add missing header to NetPlayCommon.cpp
https://bugs.dolphin-emu.org/issues/12765
2021-12-15 18:57:10 +01:00
Léo Lam 185475fe03
Merge pull request #10187 from AdmiralCurtiss/json-gamelist
Support for GameModDescriptor files in Game List.
2021-12-14 11:08:38 +01:00
Admiral H. Curtiss b928900f6e
Core/WiiRoot: Handle the combination of NetPlay and savegame redirects. 2021-12-14 06:15:37 +01:00
Admiral H. Curtiss 387d148357
NetPlay: Add functions to sync folders. 2021-12-12 21:26:10 +01:00
Admiral H. Curtiss 418bb0b087
GameFile: Calculate a sensible sync hash for mod descriptors. 2021-12-12 21:26:09 +01:00
Admiral H. Curtiss 005e850ad6
DolphinQt: Add a 'Save as Preset' button to RiivolutionBootWidget. 2021-12-12 21:26:09 +01:00
Admiral H. Curtiss a2a39cfcfb
Core: Add ability to serialize a GameModDescriptor to json. 2021-12-12 21:26:09 +01:00
Admiral H. Curtiss da161faff4
GameList: Show game mod descriptor .json files in game list. 2021-12-12 21:26:09 +01:00
Admiral H. Curtiss b50861ea44
Core: Require game mod descriptor json to self-identify as one. 2021-12-12 21:26:09 +01:00
Admiral H. Curtiss ea17dd8dba
RiivolutionParser: Create config xml directory if it does not exist yet. 2021-12-12 21:24:36 +01:00
Pokechu22 2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
Pokechu22 9304fe7124 DolphinQt: Remove 5~5~5~ typos 2021-12-10 13:59:38 -08:00
Pokechu22 824e0c00df JitCache: Remove irrelevant comment
It became irrelevant in 952dfcd610, when the define was removed; now, the code the comment is referring to is in JitRegister.cpp, and oprofile is controlled by cmake.
2021-12-10 13:59:38 -08:00
Pokechu22 ea414b06ef ParallelProgressDialog: Add missing license comment 2021-12-10 13:59:38 -08:00
Pokechu22 04d747dd10 GCMemcardUtils: Add missing license comment 2021-12-10 13:59:38 -08:00
Pokechu22 89f0b7b10c DolphinAnalytics: Add missing license comment 2021-12-10 13:59:38 -08:00
JMC47 bfddce425d
Merge pull request #10268 from Pokechu22/code-view-widget-clamp-ub
CodeViewWidget: Fix undefined behavior when centered around address 0
2021-12-10 05:59:47 -05:00
JosJuice 2f4ecde5cc
Merge pull request #10253 from Filoppi/fix_input_config_loading
Fix InputConfig::LoadConfig() not always replacing emu controllers values
2021-12-09 22:21:02 +01:00
JosJuice e0a61ed9a0
Merge pull request #10248 from Filoppi/fix_input_config_default_device_load
Fix default input config default device not being loaded/found
2021-12-09 22:20:55 +01:00
JosJuice d5d21c6533
Merge pull request #10252 from ssdsnake/feature_dolphintool
DolphinTool: Add CLI tool subsystem + commands for verifying and converting RVZ/ISO/WIA/GCZ
2021-12-09 22:20:26 +01:00
Pokechu22 5bcbc8fcef CodeViewWidget: Fix undefined behavior when centered around address 0 2021-12-08 21:42:15 -08:00
JosJuice 67787b59d6 JitArm64: Allocate 64 MB for farcode
My change in 867cd99 caused farcode to fill up much more than before.
Most games still ran fine, but certain games would have multiple
cache clears per minute, on top of being overall slow.

Maybe there's something prettier we can do about this than just
allocating more RAM, but we have the resource budget for making
Dolphin use more RAM, so I consider increasing the size of the
cache to be a good solution at least for the time being.

At least for Prince of Persia: The Forgotten Sands, 48 MB isn't
enough to stop the cache clears, but 64 MB is. (I only played the
game for a few minutes when testing, though.)
2021-12-08 20:56:00 +01:00
OatmealDome 1c421444ae ProgramShaderCache: Don't define FB_FETCH_VALUE for GL_EXT_shader_framebuffer_fetch
We will automatically choose between real_ocol0 and ocol0 in the fragment shader.
2021-12-06 22:36:40 -05:00
OatmealDome 74a979db09 UberShaderPixel: Add shader logic ops support on OpenGL ES 2021-12-06 22:36:40 -05:00
OatmealDome 18b2f6953d PixelShaderGen: Add shader logic ops support on OpenGL ES
To do this, I had to decouple framebuffer fetch from shader blending. We need to be able to access framebuffer fetch input when using shader logic ops.
2021-12-06 22:36:40 -05:00
OatmealDome a77ae14d94 UberShaderPixel: Add shader logic ops support on Metal 2021-12-06 22:36:40 -05:00
OatmealDome e0837cb847 PixelShaderGen: Add shader logic ops support on Metal 2021-12-06 22:36:40 -05:00
OatmealDome 426c68b5a0 ShaderCache: Don't turn on logic ops approximation if framebuffer fetch is supported 2021-12-06 22:36:40 -05:00
OatmealDome f87f704f43 ShaderCompiler: Add helpers for Metal framebuffer fetch 2021-12-06 22:36:39 -05:00
OatmealDome 40eb071562 ShaderCompiler: Add new helper define for input attachment binding 2021-12-06 22:36:39 -05:00
OatmealDome c12b9b013b PixelShaderGen: Add logic ops to pixel_shader_uid_data 2021-12-06 22:36:34 -05:00
Filoppi 689545a795 InputCommon: fix InputConfig::LoadConfig() not always replacing emu controllers values
If InputConfig::LoadConfig() was called once with a non empty/customized config,
then called again after manually deleting the config (dolphin calls LoadConfig() every time it opens the mapping widget),
the second load would fail to clear the values on any non first EmulatedController and would instead keep the
previous config values despite it being deleted (while it would instead correctly default the first EmulatedController).

This is not a big bug though the code is better now.
2021-12-05 23:37:58 +02:00
Filoppi 125971d9f2 InputCommon: fix default input config default device not being loaded/found
Fixes bug: https://bugs.dolphin-emu.org/issues/12744

Before e1e3db13ba
the ControllerInterface m_devices_mutex was "wrongfully" locked for the whole Initialize() call, which included the first device population refresh,
this has the unwanted (accidental) consequence of often preventing the different pads (GC Pad, Wii Contollers, ...) input configs from loading
until that mutex was released (the input config defaults loading was blocked in EmulatedController::LoadDefaults()), which meant that the devices
population would often have the time to finish adding its first device, which would then be selected as default device (by design, the first device
added to the CI is the default default device, usually the "Keyboard and Mouse" device).

After the commit mentioned above removed the unnecessary m_devices_mutex calls, the default default device would fail to load (be found)
causing the default input mappings, which are specifically written for the default default device on every platform, to not be bound to any
physical device input, breaking input on new dolphin installations (until a user tried to customize the default device manually).

Default devices are now always added synchronously to avoid the problem, and so they should in the future (I added comments and warnings to help with that)
2021-12-05 23:35:47 +02:00
ssdsnake 1aa8a4d46f DolphinTool: CLI utility interface and disc image tools 2021-12-03 15:40:19 -06:00
JosJuice 85e5070215
Merge pull request #10257 from Pokechu22/no-bs2-rtc-flags
BS2Emu: Stop clearing the RTC flags
2021-12-03 22:39:38 +01:00
Scott Mansell 0327bc2ab6
Merge pull request #10256 from malleoz/show-rerecord-count
Renderbase: Show rerecord count
2021-12-03 14:42:10 +13:00
JMC47 c12e4e8ee0
Merge pull request #10244 from phire/ban-timetravel
Delay singlecore gpu interrupts; Fixes Bomberman Jetters in single core mode.
2021-12-02 07:21:41 -05:00
Pokechu22 5af18773bf FifoPlayer: Clear EFB before starting playback
This fixes the bad rendering on the first frame when using the software renderer: the software renderer's Z buffer started out at 0, but most games clear it to 0xffffff instead; this means that things don't render correctly except for in the regions where the screen was cleared by an EFB copy earlier in the frame.
2021-12-01 19:09:24 -08:00
sowens99 e4fed7cce8 Add Rerecord Count display
Simply shows Movie::s_rerecords in the ImGui Movie window
2021-11-30 20:08:29 -05:00
Pokechu22 5134caf68c BS2Emu: Stop clearing the RTC flags
The system menu does clear the RTC flags, but we currently aren't updating the cache file, and since we clear them the system menu doesn't know to update the cache either.  This means that launching a game via the system menu, and then launching a game directly and exiting via HOME will result in the system menu using an outdated cache and displaying the old game.  This causes it to fail to launch the game on the disc channel (since it doesn't match the cache), resulting in it resetting (though it will ignore the cache after resetting).  Not clearing the cache avoids this issue.
2021-11-30 14:43:49 -08:00
Mai M fc1ed33c11
Merge pull request #10250 from JosJuice/i18n-save-game
DolphinQt: Add i18n comment for "Save Game"
2021-11-30 16:54:20 -05:00
Scott Mansell 57d251c2f0
Merge pull request #10242 from smitdylan2001/master
Fixed Gamecube naming to GameCube
2021-11-30 06:58:55 +13:00
JosJuice 6a1a7efdd5 DolphinQt: Add i18n comment for "Save Game"
It's very easy to assume the "save" in this string is a verb.
2021-11-27 20:27:33 +01:00
Pokechu22 8cf841ecc7 Fix saving RGBA images
PNG_FORMAT_RGB and PNG_COLOR_TYPE_RGB both evaluate to 2, but PNG_FORMAT_RGBA evaluates to 3 while PNG_COLOR_TYPE_RGBA evaluates to 6; the bit indicating a palette is 1 while the bit indicating alpha is 4.
2021-11-24 14:56:12 -08:00
Pokechu22 99e589cc98 Log libpng warnings and errors 2021-11-24 14:56:12 -08:00
OatmealDome 04ec02c06b ConstantManager: Add logic ops to PixelShaderConstants 2021-11-24 17:52:26 -05:00
OatmealDome 8e72136eeb VulkanContext: Set Apple GPUs as supporting framebuffer fetch 2021-11-24 17:52:24 -05:00
Scott Mansell f5c550e9cb Delay singlecore gpu interrupts
Fixes Bomberman Jetters in single core mode.

When single core mode pauses the CPU to execute the GPU
FIFO it greedily executes the whole thing. Before this commit,
Finish and Token interrupts would happen instantly, not even
taking into account how long the current FIFO window has
taken to execute. The interrupts would be effectively backdated
to the start of this execution window.

This commit does two things: It pipes the current FIFO window
execution time though to the interrupt scheduling and it enforces
a minimum delay of 500 cycles before an interrupt will be fired.
2021-11-25 11:11:01 +13:00
JMC47 55e331836d
Merge pull request #10243 from JosJuice/jitarm64-push-size
JitArm64: Fix incorrect push size calculation
2021-11-24 16:53:06 -05:00
JosJuice 83d2d55aab JitArm64: Fix incorrect push size calculation 2021-11-24 22:39:54 +01:00
Dylan Smit 9de7ef6d8d Fix improper naming
I'm so sorry
2021-11-24 17:04:30 +01:00
Léo Lam aa5cb35c86
Merge pull request #10143 from Pokechu22/png-compression-level
Add option for setting the PNG zlib compression level
2021-11-23 16:40:34 +01:00
Léo Lam e1e3db13ba
Merge pull request #10228 from Filoppi/fix_android_input_deadlock
ControllerInterface: fix UpdateReferences() deadlock
2021-11-23 16:27:03 +01:00
unknown f43122cd8a Trust MacOS not to crash during shader pre-compilation 2021-11-22 15:32:28 +01:00
DevJPM 613c4563c2 VideoCommon: Gate Multi-Threaded Shader Pre-Compilation behind a bug entry 2021-11-22 09:34:28 +01:00
Admiral H. Curtiss 6350c93ae1
NetPlay: Pass Wii FS sync data directly to game boot logic instead of indirectly through globals. 2021-11-22 01:33:46 +01:00
Admiral H. Curtiss 894773f607
Core/Boot: Add Wii FS sync data (for temp NAND/netplay) to BootSessionData and handle it in the boot and shutdown logic. 2021-11-22 01:33:45 +01:00
Admiral H. Curtiss 7b776f3769
NetPlay: Refactor game boot code path to allow passing BootSessionData through it. 2021-11-22 00:52:15 +01:00
Admiral H. Curtiss 83ad84061e
Core/Boot: Refactor storage of boot-to-savestate data into a separate class. 2021-11-22 00:35:35 +01:00
Léo Lam d5b917a6c2
Merge pull request #10237 from AdmiralCurtiss/netplay-server-crash
NetPlayServer: Clear remaining m_players when netplay thread ends so that their destructors can run while the ENetHost still exists.
2021-11-21 22:04:12 +01:00
Admiral H. Curtiss 8488ff6884
GBA: Add import and export save options to context menu. 2021-11-21 18:08:23 +01:00
Admiral H. Curtiss e2c4cf49e2
NetPlayServer: Clear remaining m_players when netplay thread ends so that their destructors can run while the ENetHost still exists. 2021-11-21 00:18:44 +01:00
JosJuice 5490797867 JitArm64: Implement memcheck for psq_lXX/psq_stXX with update 2021-11-20 23:39:27 +01:00
JosJuice 61c73061e9 JitArm64: Implement memcheck for psq_lXX/psq_stXX without update 2021-11-20 23:39:27 +01:00
JosJuice 9e43796912 JitArm64: Allow passing temp FPR to EmitMemcheck
Small optimization. If the caller already has an FPR that
it isn't using, might as well pass it on to fpr.Flush.
2021-11-20 23:39:27 +01:00
JosJuice 89301b1f91 JitArm64: Implement memcheck for lfXX/stfXX with update 2021-11-20 23:39:27 +01:00
JosJuice 8c96e60cd1 JitArm64: Implement memcheck for lfXX/stfXX without update 2021-11-20 23:39:27 +01:00
JosJuice 1c8ddcdda1 JitArm64: Implement memcheck for dcbz 2021-11-20 23:39:27 +01:00
JosJuice 4fe15e788f JitArm64: Implement memcheck for lmw/stmw 2021-11-20 23:39:27 +01:00
JosJuice b4ffdce800 JitArm64: Implement memcheck for lXX/stX with update 2021-11-20 23:39:27 +01:00
JosJuice 662ae570a0 JitArm64: Make EmitBackpatchRoutine support saving W0
Being able to preserve the address register is useful for the
next commit, and W0 is the address register used for loads. Saving
the address register used for stores, W1, was already supported.
2021-11-20 23:39:27 +01:00
JosJuice e316d0e94f JitArm64: Don't update dest reg when load triggers exception, part 2
If a host register has been newly allocated for the destination
guest register, and the load triggers an exception, we must make
sure to not write the old value in the host register into ppcState.
This commit achieves this by not marking the register as dirty
until after the load is done.
2021-11-20 23:39:26 +01:00
JosJuice 96190887ce JitArm64: Don't update dest reg when load triggers exception
Fixes a problem introduced in the previous commit.
2021-11-20 23:39:26 +01:00
JosJuice ab1ceee16f JitArm64: Implement memcheck for lXX/stX without update 2021-11-20 23:39:26 +01:00
JosJuice 8c905e152a JitArm64: Make WriteConditionalExceptionExit more flexible
You can now specify an already allocated register for it to use as a
temporary register, and it also supports being called while in farcode.
2021-11-20 23:37:02 +01:00
JMC47 e5a4a86672
Merge pull request #10055 from JosJuice/jitarm64-reuse-memory
JitArm64: Codegen space reuse
2021-11-20 17:35:24 -05:00
DevJPM 61cfd8696e Fix CPU Core Count detection and Enable Parallel Shader Compilation
This does this following things:

- Default to the runtime automatic number of threads for pre-compiling shaders
- Adds a distinct automatic thread count computation for pre-compilation  (which has less other things going on
and should scale better beyond 4 cores)
- Removes the unused logical_core_count field from the CPU detection
- Changes the semantics of num_cores from maximaum addressable number of cores to actually available CPU cores
(which is also how it was actually used)
- Updates the computation of the HTT flag now that AMD no longer lies about it for its Zen processors
- Background shader compilation is *not* enabled by default
2021-11-20 16:08:10 +01:00
Filoppi 1badceb455 ControllerInterface: fix UpdateReferences() deadlock
Removed useless locks to DeviceContainer::m_devices_mutex, as they were all already protected by m_devices_population_mutex.
We have no interest in blocking other threads that were potentially reading devices at the same time so this seems fine.
This simplifies the code, and I've adjusted a few comments which mentioned possible deadlock that should now be totally gone.

The deadlock could have happen if a thread directly called EmulatedController::UpdateReferences(), while another another thread also reached EmulatedController::UpdateReferences() within a call to ControllerInterface::UpdateDevices(), as the mentioned function locked both the DeviceContainer::m_devices_mutex and s_get_state_mutex at the same time.

The deadlock was frequent on game emulation startup on Android, due to the UpdateReferences() call in InputConfig::LoadConfig() and the UI thread triggering calls to ControllerInterface::UpdateDevices().
It could also have happened on Desktop if a user pressed "Refresh Devices" manually in the UI while the input config was loading.

Also brought some UpdateReferences() comments and thread safety fixes from https://github.com/dolphin-emu/dolphin/pull/9489
2021-11-20 16:54:36 +02:00
Admiral H. Curtiss 0fc563ee2e
RiivolutionPatcher: Use case-insensitive filename comparison when searching for files in a folder patch. 2021-11-20 01:15:18 +01:00
JMC47 dbaebdc585
Merge pull request #10222 from phire/fix-copy-filter-clamping
Fix copy filter clamping
2021-11-18 17:48:33 -05:00
Pokechu22 94ccf765af Add option for setting the PNG zlib compression level 2021-11-18 13:10:22 -08:00
Pokechu22 95b9941044 Use Fast Texture Sampling by default
This commit changes the default value of Fast Texture Sampling to true, and also moves the setting that controls it to the experimental section of the advanced tab.  This is its own commit so that it can be easily reverted when we want to default to Manual Texture Sampling.

Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17 21:29:57 -08:00
Pokechu22 1adff1c467 VideoCommon: Skip textureQueryLevels if it doesn't exist 2021-11-17 21:28:39 -08:00
Pokechu22 bdcfb31187 VideoCommon: Handle custom texture sizes correctly
Specifically, when using Manual Texture Sampling, if textures sizes don't match the size the game specifies, things previously broke.  That can happen with custom textures, and also with scaled EFB copies at non-native IRs.  It breaks most obviously by not scaling the texture coordinates (so only part of the texture shows up), but the hardware wrapping functionality also assumes texture sizes are a power of 2 (or else it will behave weirdly in a way that matches how hardware behaves weirdly).  The fix is to provide alternative texture wrapping logic when custom texture sizes are possible.
2021-11-17 21:28:36 -08:00
Pokechu22 93eea7cb13 VideoCommon: Add option to use old behavior (Fast Texture Sampling)
Co-authored-by: JosJuice <josjuice@gmail.com>
2021-11-17 21:27:32 -08:00
Pokechu22 ee80298ca4 VideoCommon: Implement diagonal LOD
Note that both GLSL and HLSL provide a fwidth (fragment width) function defined as `fwidth(p) = abs(dFdx(p)) + abs(dFdy(p))`.  However, it's easy enough to implement this ourselves (and it makes the code a bit more obvious).
2021-11-17 20:04:34 -08:00
Pokechu22 b9288212a0 Software: Adjust diagonal LOD implementation
This produces behavior matching the behavior on hardware (see Wario's Gold Mine in Mario Kart Wii).
2021-11-17 20:04:34 -08:00
Pokechu22 51e3334526 VideoCommon: Use coarse derivatives for Manual Texture Sampling if possible 2021-11-17 20:04:34 -08:00
Pokechu22 ddf2691395 VideoCommon: Manually handle texture wrapping and sampling 2021-11-17 20:04:34 -08:00
Pokechu22 4a9b26de86 VideoCommon: Expose SamplerState to shaders
The benefit to exposing this over the raw BP state is that adjustments Dolphin makes, such as LOD biases from arbitrary mipmap detection, will work properly.
2021-11-17 20:04:34 -08:00
Pokechu22 9ef228503a VideoCommon: Provide raw texdims to shaders 2021-11-17 20:04:34 -08:00
Pokechu22 a273b65566 RenderState: Use operator== for operator!= and adjust constructors 2021-11-17 20:04:34 -08:00
Pokechu22 6236a0d494 Eliminate SamplerCommon 2021-11-17 20:04:34 -08:00
Pokechu22 3096f77ba0 Eliminate SamplerCommon::AreBpTexMode0MipmapsEnabled
This was added in 0b9a72a62d but became irrelevant in 70f9fc4e75 as the check is now self-explanatory due to a rejiggering of the bitfields.
2021-11-17 20:04:34 -08:00
Pokechu22 d2041b4c2a VideoCommon: Add signed version of BitfieldExtract 2021-11-17 20:04:33 -08:00
Pokechu22 555a93057c VideoCommon: Allow BitfieldExtract in specialized shaders 2021-11-17 20:04:33 -08:00
Scott Mansell 9bbc843542 VideoSoftware: Fix copy filter clamping 2021-11-17 09:29:16 +13:00
Scott Mansell 7128befb39 Fix copy filter clamping regression in Spyro
This fixes horizontal lines in the bloom effect of Spyro: A Hero's Tail,
which is a regression caused by PR #10204

Screenshot of regression:
https://user-images.githubusercontent.com/138484/142030503-90fcd8d5-63d3-4820-874a-72e9be0c4768.png

Fixed:
https://user-images.githubusercontent.com/138484/142031598-b85ff55c-1302-4e4d-bcb2-57848974056b.png

Spyro uses an 640x80 pixel sub-buffer within the EFB to calculate
it's bloom effects, which it places below the main 640x448 buffer.

EFB layout:
https://user-images.githubusercontent.com/138484/142030573-e933b6ae-c37e-4be6-86d4-0bc779b92535.png
Note: Colors are wrong because the main color buffer uses RGBA6,
      while the bloom is calculated in RGB8

This allows it to do bloom without backing up part of the EFB to
main memory, as most games do.

But, since some of the sub-buffers used in the bloom effect are taller
than 80 pixels, they need to be sliced up into smaller sub, sub buffers
which get combined later when copied to main memory.

At one point, a 320x224 buffer is broken up into 320x80, 320x64 and
320x80 slices. These are copied out with the copy filter set to a
vertical blur.

Because there was an off-by-one errror in the clamping coordinates,
the bottom line of the color buffer would be blurred into
the top of each slice.

Final combined EFB copy:
https://user-images.githubusercontent.com/138484/142031360-2c076839-7c96-4b3b-a093-d899d0a2c7ae.png

Fixed version:
https://user-images.githubusercontent.com/138484/142031370-72e41a35-3b3e-4662-a483-79203e357ecc.png

Before #10204 the copy filter wasn't enabled for efb copies, and most
other games don't do this type of slicing.

FIFO CI shows that a few other games are effected, it's always just a minor difference to the top line where there was previously a slight hint of garbage.
2021-11-17 06:12:46 +13:00
JMC47 26fdc19c8d
Merge pull request #10204 from Pokechu22/efb-copy-filter
VideoCommon: Use the copy filter for EFB copies as well as XFB copies
2021-11-15 17:04:27 -05:00
Shawn Hoffman a69adafdd8 msbuild: use /external:anglebrackets
Revert usage of ExternalIncludePath, as that var is specifically
for external includes which do not get scanned for changes.
2021-11-15 00:33:51 -08:00
JosJuice da0be24b2f DSP: Reword inappropriate references to Global User Directory
These messages apply to the User directory regardless of
whether it's global or local, so we shouldn't specify "global".

Also changing "directory" to "folder", just for consistency
with "GC folder" in the same sentence.
2021-11-14 22:55:50 +01:00
OatmealDome 2209dc0355 MoltenVK: Use an external project instead of a pre-compiled dylib
Also, update MoltenVK to match Vulkan SDK 1.2.189.
2021-11-13 11:43:23 -08:00
JosJuice 3e84279919
Merge pull request #10208 from thatSteveFan/patch-1
Minor comment fix in Matrix.cpp
2021-11-13 15:09:28 +01:00
Pokechu22 868de78f16 VideoCommon: Use the copy filter for EFB copies as well as XFB copies
This fixes the pink screens in EA Sports Active.  See https://gist.github.com/Pokechu22/49455f9094ed0ff017da64e3f7aa0404 for details.
2021-11-11 17:22:50 -08:00
Shawn Hoffman 58dc9e7049 msvc: fix compile warning on arm64 2021-11-11 08:01:39 -08:00
Shawn Hoffman 4008188654 msvc: update to vs2022 and windows sdk 10.0.22000 2021-11-11 08:01:26 -08:00
thatSteveFan 834a59d89b
Minor comment fix in Matrix.cpp
Fix comment to say (NxM times MxP).
2021-11-08 15:30:39 -08:00
Merry 850d281cb8 Jit_Integer: Fix pure rotation rlwimix case
We are writing to a.
2021-11-07 14:10:19 +00:00
Mai M 6c72e6814d
Merge pull request #10169 from leoetlino/fmt-localtime
Use fmt::localtime instead of thread-unsafe std::localtime
2021-11-07 00:08:14 -04:00
Mai M c89226cbd4
Merge pull request #10203 from merryhime/ctx_lr
MachineContext: Correct CTX_LR for Apple ARM64
2021-11-07 00:06:24 -04:00
Merry c385e7e57b MachineContext: Correct CTX_LR for Apple ARM64 2021-11-06 21:46:35 +00:00
Merry 9c75957319 JitArm64_FloatingPoint: Implement fctiwx in ARM64 JIT
We implement this by first rounding to nearest integer using the current
rouding mode, then converting this value from floating point to an integral
value.
2021-11-06 20:54:26 +00:00
Merry 7c2b09e156 Arm64Emitter: Add FRINTI instruction 2021-11-06 19:15:26 +00:00
Léo Lam 2c5d11cace
Merge pull request #9721 from linkmauve/fix-warnings
Fix some warnings found with gcc 11 and ffmpeg master
2021-11-06 14:38:07 +01:00
Sintendo dfb32040bf Jit64: divwx - Micro-optimize division by 2
Prefer using eax to isolate the sign bit. This saves a byte when the
destination ends up as r8-15, because those require a REX prefix.

Before:
41 8B C5             mov         eax,r13d
41 C1 ED 1F          shr         r13d,1Fh
44 03 E8             add         r13d,eax
41 D1 FD             sar         r13d,1

After:
41 8B C5             mov         eax,r13d
C1 E8 1F             shr         eax,1Fh
44 03 E8             add         r13d,eax
41 D1 FD             sar         r13d,1
2021-11-03 21:01:41 +01:00
Sintendo f18f6cd0a2 Jit64: divwx - Improve comments 2021-11-02 21:50:28 +01:00
Emmanuel Gil Peyrot 5a1333026b VideoCommon: Add missing algorithm include for std::none_of
Otherwise this is an error on gcc/libstdc++, and there are no transitive
includes for this header.
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot 7590f07b80 FrameDump: Remove deprecated call to av_init_packet()
This function was deprecated in ffmpeg in January[1], while its
replacement got introduced in 2015[2], so now might be the time to start
using it in Dolphin. :)

[1] f7db77bd87
[2] a9a6010637
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot 24db6e467a DolphinQt: Fix a -Wunused-result in gcc 11
Also use the correct error check for other similar calls in the same
file, despite nothing being doable on error.
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot 25b136ac17 VideoCommon: Fix a -Wclass-memaccess in gcc 11 2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot 7e39a0405b DolphinQt, VideoBackends: Fix all cases of -Wswitch in gcc 11 2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot 3d662e746b Core: Fix a -Wshadow warning in gcc 11
This moves the only direct call to zlib’s crc32() into its own
translation unit, but that operation is cold enough that this won’t
matter in the slightest.  crc32_z() would be more appropriate, but
Android has an older zlib version…
2021-11-02 13:50:21 +01:00
Emmanuel Gil Peyrot ab252aedfa Core, DolphinQt, UICommon: Fix all cases of -Wrange-loop-construct in gcc 11 2021-11-02 13:50:21 +01:00
JosJuice 96a6d6fd95
Merge pull request #10184 from JosJuice/android-riivolution
Android: Allow starting game with Riivolution patches from the GUI
2021-10-31 23:44:54 +01:00
Léo Lam fb8b9f3251
Merge pull request #10194 from AdmiralCurtiss/riivolution-edge-cases
Fix some Riivolution file patching edge cases.
2021-10-31 21:24:03 +01:00
Sepalani e51119c4ce HLE: Fix hooks overlapping Riivolution patches 2021-11-01 00:07:14 +04:00
Admiral H. Curtiss e91e04fe1e
RiivolutionPatcher: More closely match behavior of filename searching file patches to actual Riivolution. 2021-10-31 05:47:39 +01:00
Admiral H. Curtiss 335a1b5cb5
RiivolutionPatcher: More closely match behavior of folder patches to actual Riivolution. 2021-10-31 05:47:39 +01:00
JosJuice 34021b5ebc Android: Allow starting game with Riivolution patches from the GUI 2021-10-30 23:24:36 +02:00
Pokechu22 ef80d51df1 RenderWidget: Change "imgui.h" to <imgui.h>
This was originally intended to fix https://bugs.dolphin-emu.org/issues/12717 but this ended up not being the issue (instead it seems like files just weren't recompiled when imgui was updated due to MSVC weirdness).  Still, using brackets instead of quotes is preferable as this is a library include.
2021-10-29 12:05:21 -07:00
Admiral H. Curtiss 5bb71760d7
Core/CheatSearchSession: Mark class as final. 2021-10-28 06:50:57 +02:00
Admiral H. Curtiss b154ba513c
Core/CheatSearchSession: Make a few methods const. 2021-10-28 02:16:19 +02:00
Admiral H. Curtiss 6e814cbb8f
Qt/CheatSearchWidget: Add a checkbox to force parsing a value as hexadecimal. 2021-10-28 02:00:38 +02:00
Admiral H. Curtiss b3e17d2772
Qt/CheatSearchFactoryWidget: Refuse to start standard memory region searches when no game is running because the memory size and console type may not be accurate. 2021-10-28 01:59:52 +02:00
Admiral H. Curtiss d6ad3fbcb5
Qt/CheatsManager: Save and restory geometry. 2021-10-28 01:03:30 +02:00
Pokechu22 db54e4f2b0 Externals: Update imgui to 1.85 2021-10-26 15:07:57 -07:00
JosJuice 05b4aecf18
Merge pull request #10186 from leoetlino/hle-hbreload
HLE: Fix hook flag for HBReload
2021-10-26 22:00:25 +02:00
Léo Lam 7073a90474
Merge pull request #10177 from Dentomologist/gamelist_grid_mode_fix_select_all
GameList: Fix duplicate selections with ctrl+a in grid view
2021-10-25 17:22:58 +02:00
Léo Lam 8cb51f276c HLE: Fix hook flag for HBReload
The reload stub is at a fixed address (0x80001800) so its hook flag
should be HookFlag::Fixed.

Otherwise the hook is installed by HLE::PatchFixedFunctions but
immediately removed by HLE::PatchFunctions (which is called by
HLE::Reload right after PatchFixedFunctions).

Should fix https://bugs.dolphin-emu.org/issues/12716
2021-10-25 16:54:25 +02:00
Pokechu22 04d8cdfe88 Convert LOG_TYPE and LOG_LEVELS to enum class 2021-10-24 11:48:36 -07:00
Pokechu22 ba107819ec Create EnumMap 2021-10-24 11:48:36 -07:00
Admiral H. Curtiss 4f82810845
RiivolutionPatcher: Use FileInfo instead of IOFile when only checking for filesize. 2021-10-24 00:09:09 +02:00
Admiral H. Curtiss 0efff5167d
IOS/FS: On NAND redirected files, the source and target of a Rename operation may be on different partitions or devices. Implement a fallback for that. 2021-10-24 00:09:09 +02:00
Admiral H. Curtiss fe7f3a6f26
RiivolutionPatcher: Protect against three or more dots in path traversal. 2021-10-24 00:09:09 +02:00
Admiral H. Curtiss 22c6f2fe3b
RiivolutionPatcher: Handle the possibility of the FST already containing a main.dol file. 2021-10-24 00:09:09 +02:00
Admiral H. Curtiss ba3373b476
RiivolutionPatcher: Modify memory patching logic to be more accurate to actual Riivolution. 2021-10-24 00:09:09 +02:00
Admiral H. Curtiss dd64c0e423
Core: Deduplicate Riivolution Patch to BootParameters apply logic. 2021-10-24 00:09:08 +02:00
Admiral H. Curtiss a76fdeee93
DolphinQt: Act like Riivolution and pre-select the last selected patch options when launching via the RiivolutionBootWidget. 2021-10-24 00:09:08 +02:00
Admiral H. Curtiss 2be62d94fc
RiivolutionParser: Add code to read and write the Riivolution config XMLs that remember the last selection. 2021-10-24 00:09:08 +02:00
Admiral H. Curtiss 2d3ed2c3ad
DolphinQt: Add ability to edit the Riivolution XML root directory when launching a patch. 2021-10-24 00:09:08 +02:00
Admiral H. Curtiss d0c11f76b5
Core/BootManager: Disable loading time emulation for Riivolution-patched games until we have proper emulation for that. 2021-10-24 00:09:07 +02:00
Admiral H. Curtiss 6394960f54
Core: Add ability to specify and launch a riivolution-modded game via a .json file. 2021-10-24 00:09:07 +02:00
Admiral H. Curtiss fe242f79ee
Core: Implement Wii NAND path redirects for Riivolution savegame patches. 2021-10-24 00:09:07 +02:00
Admiral H. Curtiss 588c31acb6
RiivolutionPatcher: Ignore last two bits of offset in file patches to match console behavior. 2021-10-24 00:09:07 +02:00
Admiral H. Curtiss 6ec4af7ea4
RiivolutionPatcher: Load external files with a layer of indirection during the patching process to properly resolve the paths given in the XML.
This also may eventually allow loading patches from sources other than the 1:1 expected file structure host file system, such as memory or an archive file.
2021-10-24 00:09:07 +02:00
Admiral H. Curtiss 175f225ac1
DolphinQt: Add ability to start a game with Riivolution patches from the GUI. 2021-10-24 00:09:06 +02:00
Admiral H. Curtiss 783b180dc8
Core: Add RiivolutionPatcher to apply Riivolution-style patches to a game's file system and memory. 2021-10-24 00:09:06 +02:00
Admiral H. Curtiss e26b59bab3
Core: Add RiivolutionParser to parse a Riivolution XML. 2021-10-24 00:09:06 +02:00
Admiral H. Curtiss a4da56e5e6
CommonPaths: Add a Riivolution subfolder in Load. 2021-10-24 00:09:06 +02:00
Admiral H. Curtiss 09fc39e2e5
DiscIO: Add CreateDisc/WAD/Volume() overloads that take a BlobReader directly. 2021-10-24 00:09:05 +02:00
Admiral H. Curtiss e3f1de023f
DiscIO/DirectoryBlob: Add a callback that allows patching the main.dol and FST of the game partition during blob construction. 2021-10-24 00:09:05 +02:00
Admiral H. Curtiss 00ef9f2b4f
DiscIO/DirectoryBlob: Allow constructing a DirectoryBlobReader from a VolumeDisc. 2021-10-24 00:09:05 +02:00
Admiral H. Curtiss 3a72a39efd
DiscIO/DirectoryBlob: Allow constructing a DirectoryBlobPartition from a VolumeDisc. 2021-10-24 00:09:00 +02:00
Admiral H. Curtiss b1802f6daa
DiscIO/DirectoryBlob: Add a content source representing a run of padding bytes. 2021-10-23 23:51:23 +02:00
Admiral H. Curtiss f8611f7139
DiscIO/DirectoryBlob: Add a content source that reads data from a DiscIO::Volume. 2021-10-23 16:51:45 +02:00
Admiral H. Curtiss b7a9cc37b1
DiscIO/DirectoryBlob: Add ability to have an offset for a partition ContentSource. 2021-10-23 16:51:45 +02:00
Admiral H. Curtiss a14436fe3f
DiscIO/DirectoryBlob: Add ability to have a start-of-file offset for a file ContentSource. 2021-10-23 16:51:45 +02:00
Admiral H. Curtiss 885e6690c5
DiscIO/DirectoryBlob: Add explanations for DiscContent members. 2021-10-23 16:51:44 +02:00
Admiral H. Curtiss b988ab4441
DiscIO/DirectoryBlob: Consolidate functions that take data for ContentSource to just take a ContentSource. 2021-10-23 16:51:44 +02:00
Admiral H. Curtiss 7f57c24172
DiscIO/DirectoryBlob: Rename the vector-reference variant of DiscContentContainer::Add() to AddReference() to make it clearer at call sites that the given vector must remain in memory. 2021-10-23 16:51:44 +02:00
Scott Mansell b997048cfe
Merge pull request #10142 from aldelaro5/gdb-stub-rework
Rework the entire logic of the GDB stub
2021-10-24 01:51:29 +13:00
Admiral H. Curtiss f972ddf32f
Common/FileUtil: Fix incorrect (32-bit) stat struct being used on Windows, which was hidden by a define in CommonFuncs.h. 2021-10-23 03:50:47 +02:00
aldelaro5 6a4d607e09 GDBStub: Add log when break is sent 2021-10-21 08:26:50 -04:00
aldelaro5 7ad586fe2c GDBStub: Make step force pausing even if play was pressed 2021-10-21 08:26:50 -04:00
aldelaro5 2f7a3e59e5 GDBStub: upgrade some logs from debug to info 2021-10-21 08:26:50 -04:00
aldelaro5 1b92f81379 GDBStub: Refactor the whole code 2021-10-21 08:26:50 -04:00
aldelaro5 94a0f416eb GDBStub: remove the cmake option and the ifdefs 2021-10-21 08:26:42 -04:00
aldelaro5 657bb00c01 GDBStub: Cleanly shut down on stop 2021-10-21 08:26:42 -04:00
aldelaro5 b8395280d3 GDBStub: Correctly inform the CPU thread if we are stepping 2021-10-21 08:26:28 -04:00
aldelaro5 b9b7c4ac80 GDBStub: Add support for the T command 2021-10-21 08:26:28 -04:00
aldelaro5 7d3ea4c3a1 GDBStub: rework the breakpoint and the control logic 2021-10-21 08:26:28 -04:00
aldelaro5 994847f09c GDBStub: move the stalling logic to CPU::Run 2021-10-21 08:26:16 -04:00
aldelaro5 e3b978cf20 GDBStub: boot to pause 2021-10-21 08:26:16 -04:00
aldelaro5 e03ddc2116 Let the GDB stub listen for commands while running
This is needed to send ctrl+C signals while the CPU thread is running.
2021-10-21 08:26:16 -04:00
Dentomologist 1e4b2daedb GameList: Fix duplicate selections with ctrl+a in grid view
Make grid view use selectedRow() instead of selectedIndexes() to ensure
one selection per game.
2021-10-19 14:50:58 -07:00
dreamsyntax 61a5d3bf74 DolphinQt/MenuBar: add "reset ignore panic handler" button 2021-10-18 15:22:00 -07:00
Léo Lam f0faf3712d
Merge pull request #10171 from malleoz/fix-frame-advance-speed
Fix swapped frame advance speed increase/decrease
2021-10-16 11:36:07 +02:00
Léo Lam 8195d0bda1
Merge pull request #10144 from malleoz/dsp-onion
Port Main.DSP to MainSettings
2021-10-16 11:32:38 +02:00
sowens99 8ea6bef98f Port Main.DSP to MainSettings
While trying to work on adding audiodump support for CLI, I was alerted that it was important to first try moving the DSP configs to the new config before continuing, as that makes it substantially easier to write clean code to add such a feature.

This commit aims to allow for Dolphin to only rely on the new config for DSP-related settings.
2021-10-15 23:24:46 -04:00
sowens99 ea81346fc3 Fix swapped frame advance speed increase/decrease
Frame Advance Speed hotkeys were swapped. This likely occurred because speed and delay are inverses (i.e. a speed increase should DECREASE the delay and vice versa).
2021-10-15 23:22:22 -04:00
Léo Lam 9a6f0bd9b2
Merge pull request #10168 from JosJuice/jitarm64-gcc-float-null
JitArm64: Work around a GCC warning promoted to error
2021-10-15 23:03:57 +02:00
Léo Lam fd7df2ccae
Use fmt::localtime instead of thread-unsafe std::localtime
fmt::localtime is also less awkward to use compared to std::localtime.
2021-10-15 22:49:13 +02:00
Léo Lam 7855e5f73b
Turn MAX_LOGLEVEL into a true constant (and fix self-comparison warning)
This replaces the MAX_LOGLEVEL define with a constexpr variable
in order to fix self-comparison warnings in the logging macros
when compiling with Clang. (Without this change, the log level check
in the logging macros is expanded into something like this:
`if (LINFO <= LINFO)`, which triggers a tautological compare warning.)
2021-10-15 21:51:01 +02:00
JosJuice 7c88ca7c4e JitArm64: Work around a GCC warning promoted to error
GCC complains about float_emit being null when inlining
ByteswapAfterLoad into MMIOLoadToReg. ByteswapAfterLoad
does dereference float_emit, but only when passing FLAG_FLOAT,
which MMIOLoadToReg has an assert for and does not support.

Also cleaning up some unnecessarily specified namespaces while
I'm at it.
2021-10-15 21:32:46 +02:00
Léo Lam 6bf10e0276
Merge pull request #10149 from malleoz/audiodump-add-timecode
Add Game ID, timecode to dspdump and dtkdump filenames
2021-10-15 19:42:30 +02:00
JMC47 7d6393332d
Merge pull request #10164 from Pokechu22/per-pixel-lighting-vertex-color
VideoCommon: Fix color channel logic when per-pixel lighting is in use
2021-10-14 14:17:06 -04:00
Fletcher Porter f16e9045a2 Silence the -Wswitch warnings in Tev
The compiler was loudly announcing each and every branch Tev was not checking in
a switch statement, but Tev has learned it's lesson and will produce that
warning no more.
2021-10-13 23:54:06 -07:00
Pokechu22 a372a5947b VideoCommon: Fix color channel logic when per-pixel lighting is in use
This was broken in #10012 (specifically by 06579e4d53 and c3dec34391).
2021-10-13 20:43:32 -07:00
JosJuice 2d1674cd56 JitArm64: Keep track of free code regions and reuse space when possible
JitArm64 port of 306a5e6.
2021-10-13 21:52:16 +02:00
JosJuice 44beaeaff5 Arm64Emitter: Check end of allocated space when emitting code
JitArm64 port of 5b52b3e.
2021-10-13 21:52:16 +02:00
JosJuice 867cd99de1 JitArm64: Remove the ability to reuse backpatch slowmem handlers
Reusing the slowmem handlers of existing blocks meshes badly
with reusing the empty space left when destroying blocks.
I don't think reusing slowmem handlers was much of a gain anyway.
2021-10-13 21:51:45 +02:00
Pokechu22 78bfd25964 Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
Pokechu22 525e6b2194 MMU: Replace TryReadResult and TryWriteResult with std::optional 2021-10-13 11:44:28 -07:00
Pokechu22 673f886a7e MMU: Replace uses of cassert with Common/Assert.h 2021-10-13 11:44:28 -07:00
Pokechu22 aacc1a5e49 IOFile: Add std::array functions 2021-10-13 11:44:28 -07:00
JosJuice 25bff91054 Interpreter: Fix NI_div ZX check 2021-10-13 17:42:56 +02:00
JosJuice 9f525d69c8 Jit: Raise program exception on floating point exceptions
This is done entirely through interpreter fallbacks. It would
probably be possible to implement this using host exception
handlers instead, but I think it would be a lot of complexity
for a rarely used feature, so let's not do it for now.

For performance reasons, there are two settings for this feature:
One setting which does enables just what True Crime: New York City
needs and one setting which enables it all. The latter makes
almost all float instructions fall back to the interpreter.
2021-10-13 17:42:56 +02:00
JosJuice 7f7748e181 Interpreter: Raise program exception on floating point exceptions 2021-10-13 17:42:56 +02:00
JosJuice c3bcc67653 PowerPC: Update FEX on FPSCR store instead of FPSCR load
This is needed not only for the next commit, but also for
correctly emulating float instructions that write to CR1.
2021-10-13 17:42:56 +02:00
JosJuice 89a464dafa Interpreter: Optimize FEX calculation
The next commit will make the interpreter run this after every
float instruction, so I think a little optimization here is justified.
2021-10-13 17:42:56 +02:00
JosJuice 83c6df1965 PowerPC: Set SRR1 correctly for program exceptions 2021-10-13 17:42:56 +02:00
sowens99 2aa400e72f Add option for Never Hide Mouse Cursor
Instead of having a single GUI checkbox for "Always Hide Mouse Cursor",
I have instead opted to use radio buttons so the user can swap between
different states of mouse visibility. "Movement" is the default
behavior, "Never" will hide the mouse cursor the entire time the game is
running, and "Always" will keep the mouse cursor always visible.
2021-10-12 21:04:27 -04:00
sowens99 5145853351 Bug: fix unhide on mouse movement only responding to clicks
Previously the unhide of movement mouse_timer reset occurred within case MouseButtonPress.

Additionally, there was a redundant expression in the if statement for cursor locking.
2021-10-12 20:59:31 -04:00
Léo Lam f19da1cf92
Merge pull request #10118 from lioncash/messageid
NetPlayProto: Remove lots of casts to MessageId when inserting enum values into packets
2021-10-13 02:27:52 +02:00
Léo Lam dd936c5072
Merge pull request #10126 from malleoz/l-r-digital-input-display
Include digital L and R buttons in Input Display
2021-10-13 02:06:20 +02:00
Léo Lam c746040112
Merge pull request #10154 from malleoz/disable-hotkeys-on-mapping-window
MappingWindow: disable hotkeys while window is active
2021-10-13 01:58:48 +02:00
Léo Lam 0315fcf934
Merge pull request #10155 from malleoz/toggle-hotkeys-on-qfiledialog
Disable hotkeys on static QFileDialog calls
2021-10-13 01:48:31 +02:00
Léo Lam c2d17f3f17
Merge pull request #10160 from fpdotmonkey/heed-renderwidget-switch-warning
Fix switch warning in RenderWidget
2021-10-13 01:44:24 +02:00
Léo Lam 6c1a625f0d
Merge pull request #10159 from JosJuice/print-callstack-log
Core: Use log variant of PrintCallstack, not print variant
2021-10-13 01:40:07 +02:00
Mai M 6bf467ff4b
Merge pull request #10161 from JosJuice/jitarm64-emitting-routine
JitArm64: Consistently set emitting_routine
2021-10-12 14:34:26 -04:00
JosJuice 26322a54cf JitArm64: Consistently set emitting_routine
Important regression fix for 96760093e9.
2021-10-12 18:55:06 +02:00
JMC47 6987ea0596
Merge pull request #8350 from phire/fix-tmem
Extend Minimal TMEM cache implementation.
2021-10-11 23:11:43 -04:00
Scott Mansell edb66dab84 TextureCache: Remove deleted textures from bound_textures
Fixes issue where vulkan might crash trying to bind a deleted
texture.
2021-10-12 15:51:24 +13:00
Scott Mansell d771bee0fe TMEM: Add some helpful comments 2021-10-12 15:51:24 +13:00
Scott Mansell a33cf27885 TMEM: Handle savestate and init 2021-10-12 15:51:24 +13:00
Scott Mansell 88bd10cd30 Extend TMEM cache implementation
Now works with games that deliberately avoid invalidating TMEM because
they know textures are too large to fit:

 * Sonic Riders
 * Metal Arms: Glitch in the System
 * Godzilla: Destroy All Monsters Melee
 * NHL Slapshot
 * Tak and the Power of Juju
 * Night at the Museum: Battle of the Smithsonian
 * 428: Fūsa Sareta Shibuya de
2021-10-12 15:51:24 +13:00
Fletcher Porter 0a7eed71f3 Fix switch warning in RenderWidget
The compiler was throwing a bunch of `-Wswitch` warnings from RenderWidget
because of unhandled branches, so I added a default branch to quiet it.
2021-10-11 17:18:32 -07:00
JMC47 3bfb3fa52b
Merge pull request #9884 from JosJuice/jitarm64-paired-loadstore-addr
JitArm64: Improve psq_l/psq_st address checking
2021-10-11 16:49:26 -04:00
JosJuice 97a5a7be24 Core: Use log variant of PrintCallstack, not print variant
There are two reasons for this.

1. Using Dolphin's logging system lets the user decide whether
the printout should go to the terminal, the GUI, or a file.
fmt::print always prints to stdout... unless you're on Android, in
which case it does nothing at all, because Android disables stdout.

2. The Windows version of Dolphin crashes when you use fmt::print.
Yes, really. The crash happens because a call to std::fprint in
fmt::v7::detail::fwrite_fully returns that less characters were
written than requested, which fmt handles by throwing an exception.
(As always, Dolphin does not use exception handling.)
I'm not sure why std::fprint is doing this, but since switching
away from using fmt::print is a good idea due to the previous point
anyway, I'd say it's best to just switch.
2021-10-10 17:13:03 +02:00
sowens99 839b04014e Add wrapper function to disable hotkeys for QFileDialog
Previously, if you have "Hotkeys Require Window Focus" disabled, you could repeatedly use the "Open" hotkey, for example, to stack File Open windows over top of each other over and over.

This commit allows the hotkey manager to disable/enable on QFileDialog creation and destruction.
2021-10-09 22:43:56 -04:00
Scott Mansell 5a8455e8ce BoundingBox: Add missing include 2021-10-10 13:21:31 +13:00
Scott Mansell 9fa26624b0 BPMemory: Refactor/consolidate TexUnit Addressing
Currently the logic for addressing the individual TexUnits is splattered all
across dolphin's codebase, this commit attempts to consolidate it all into a
single place and formalise it using our new TexUnitAddress struct.
2021-10-10 09:09:43 +13:00
Scott Mansell ef0e401708 BPMem: Abstract TexUnit Addressing into struct
The addressing of the texture units is a bit non-obvious.
This struct abstracts the complexity away.
2021-10-10 09:01:57 +13:00
iwubcode 514475646d VideoCommon: update Free Look camera's 'FieldOfView' function to 'FieldOfViewMultiplier' to better reflect usage 2021-10-08 18:17:20 -05:00
iwubcode aa07fde8a0 VideoCommon: update fov multiplier variables and add constant variables for defaults to the Free Look camera 2021-10-08 18:17:20 -05:00
iwubcode 0bbea6d67b Core: Update state to account for save system change 2021-10-08 18:17:18 -05:00
iwubcode e70157474b Core / VideoCommon: refactor FreeLookCamera to have the underlying controller handle all the logic (field-of-view, movement, etc) 2021-10-08 18:16:32 -05:00
Léo Lam ff1cb5a1c0
Merge pull request #9803 from Techjar/bbox-videocommon
VideoCommon: Abstract bounding box
2021-10-08 22:24:38 +02:00
sowens99 530f5ecdd0 MappingWindow: disable hotkeys while window is active
MappingWindow is modal, yet the user can use hotkeys while the window is active. I believe hotkeys should not be recognized while this window is active.
2021-10-07 21:39:52 -04:00
Léo Lam d90b30ca25
Merge pull request #10145 from NoNoTeal/master
Import Apple/FFmpeg libraries for AVI dumps on macOS
2021-10-07 08:18:53 +02:00
nonoteal 90437d1574 Change how FFmpeg is imported for Apple computers.
Imports Apple libraries and also pulls swresample in, so when compiling Dolphin doesn't throw undefined symbols.
2021-10-06 18:11:32 -10:00
Léo Lam bf6a278c04
Merge pull request #10131 from malleoz/hotkey-syntax-fix
IOWindow: Do not accept on syntax errors
2021-10-06 00:27:06 +02:00
PPLToast e26d2053e2
Update MappingWindow.cpp 2021-10-05 16:53:23 +03:00
Techjar 1161af8059 VideoCommon: Abstract bounding box
This moves much of the duplicated bounding box code into VideoCommon,
leaving only the specific buffer implementations in each backend.
2021-10-04 15:51:24 -04:00
sowens99 1d5d896eaa Add timecode to dspdump and dtkdump
Match the same formatting present in framedump filenames.
2021-10-03 18:20:01 -04:00
Léo Lam 33ffc7aa66
Merge pull request #10146 from JosJuice/nkit-convert-warning
DolphinQt/Android: Add warning when converting NKit files
2021-10-03 21:47:04 +02:00
Léo Lam 480cd35951
Merge pull request #10138 from Pokechu22/abort-on-panic-alert-fmt
Fix AbortOnPanicAlert with PanicAlertFmt
2021-10-03 19:10:19 +02:00
JosJuice 8f9086f28a DolphinQt: Add i18n comment for "Keep addresses where value in memory"
This string is extremely likely to be mistranslated without the
proper context. Actually, it's probably impossible to translate
this string in a good way to some languages, but I'm not sure how
to solve that. Let's at least add an i18 comment for now.
2021-10-03 16:12:37 +02:00
Pokechu22 ec9db320d3 Fix AbortOnPanicAlert with PanicAlertFmt
PR #10066 added functionality to call std::abort when a panic alert occurs; however, that PR only implemented it for MsgAlert and not MsgAlertFmtImpl, meaning that the functionality was not used with PanicAlertFmt (only PanicAlert, which is not used frequently).
2021-10-02 17:24:09 -07:00
JosJuice 9bb85ca706 DolphinQt/Android: Add warning when converting NKit files
Yes, that's right! It's time to add even more NKit warnings,
because users still don't understand what NKit is or how it works!

More specifically, some users seem to be under the impression that
converting an NKit file to for instance RVZ using Dolphin's convert
feature will result in a normal RVZ file, when it in fact results in
an NKit RVZ file (since NKit is not a container format in the sense
that GCZ/WIA/RVZ/WBFS/CISO is, but rather a kind of trimmed ISO).
I can hardly blame users for not knowing this, because it's not
intuitive unless you know the technical details of how NKit works.
2021-10-02 11:09:36 +02:00
Shawn Hoffman e11fdaabf1 fix unused variable warning 2021-09-30 14:27:53 -04:00
sowens99 faa5cf40ce Movie: display correct input difference on movie mismatch
Previously, s_temp_input was being used for BOTH the savestate's and the movie's input printout in the panic alert.

This commit simply performs memcpy from the correct vector for the movInput printout.
2021-09-29 20:58:19 -04:00
sowens99 30dcac15fa RenderBase: Show input count on m_ShowFrameCount
Just to stay consistent, I believe it is best to show total input polls alongside the framecount.
2021-09-29 14:36:09 -04:00
Scott Mansell a47b91e946
Merge pull request #9945 from OatmealDome/intel-broken-discard
DriverDetails: Add broken dual source blending bug to MoltenVK on Intel GPUs
2021-09-30 06:04:06 +13:00
aldelaro5 39569ed1f8 Remove unecessary include of the gdb stub 2021-09-29 12:54:18 -04:00
JosJuice c84c1ac69e
Merge pull request #10124 from malleoz/play-recording-hotkey-support
HotkeyScheduler: add PlayRecording hotkey support
2021-09-29 16:26:56 +02:00
Scott Mansell bb367394cf
Merge pull request #10129 from malleoz/recording-save-playback-window
QFileDialog: differentiate between recording open/save
2021-09-29 15:39:25 +13:00
Scott Mansell 34b6a788c2
Merge pull request #10133 from malleoz/play-recording-vi-total-display
Core: UpdateTitle with total framecount on recording playback
2021-09-29 15:33:21 +13:00
sowens99 51cd92a04c QFileDialog: differentiate between recording export/play
Previously, the file dialog window was ambiguous between saving or loading a .dtm. This commit simply gives a bit more context to differentiate the two windows.
2021-09-28 22:30:19 -04:00
sowens99 53ca2ec274 RenderBase: show total framecount on movie playback
Previously, when playing back a movie, you could not see the total frame count of a movie, only the total number of input polls.

This change simply shows the total frame count on movie playback.

Note that this change also results in the framecount and framecount total ALWAYS being displayed if show_movie_window is true, regardless of whether or not m_ShowFrameCount is true. I believe this is fine, as TASers are much more likely to reference the framecount than the input poll count.
2021-09-28 22:15:25 -04:00
sowens99 ffaa149b96 Core: UpdateTitle with total framecount on recording playback
Previously, only the number of total input polls would be shown in the window title when playing back a movie. This simply adds the VI / frame count total as well, which is a much more relevant number to look at while TASing.
2021-09-28 21:51:24 -04:00
sowens99 556323561c Do not update hotkey assignments on window close
If this commit is not applied, then the previous commit will cause hotkeys to be saved if there is a syntax error when hitting "OK" and the user presses the X to close the window.

This commit only applies changes to hotkey config if no syntax error occurs.
2021-09-27 16:21:28 -04:00
sowens99 242bce27a1 Do not accept on hotkey syntax errors
Previously you could type whatever gibberish you wanted into the formula bar, press OK, and receive a modal syntax error window. Closing the syntax error window would cause the hotkey config window to close as well, and your gibberish would be applied to the hotkey assignment.

This commit requires that a syntax error does not occur before accept() is called.
2021-09-27 14:28:08 -04:00
sowens99 6fd54276ea Include digital L and R buttons in Input Display
Previously, using TAS Input to activate the digital L and R buttons would not show these inputs in the Input Display. This commit adds the digital L and R presses to the Input Display, and also displays just "L" or "R" if the analog is set to 255.
2021-09-25 18:07:42 -04:00
sowens99 d5845ff281 HotkeyScheduler: add PlayRecording hotkey support
This hotkey was not previously implemented in the scheduler, even though it's present in the hotkey menu.
2021-09-24 11:58:41 -04:00
sowens99 e5051c516f Check for certain hotkeys in game list
There are certain hotkeys that we absolutely want to be able to use
without being in-game. Presently, no hotkeys are recognized unless we
are in-game.

I've identified and moved the following hotkeys to be checked before the
HotkeyScheduler checks to see if the Core is running:

- Open
- Exit
- Start Recording
- Refresh Game List

Note that Play Recording should also be implemented here, however it
looks like there is no signal for a PlayRecording() function, so this
will have to be handled in a later PR once that signal is created and
implemented.
2021-09-23 10:46:04 -04:00
Sintendo da9546cb2f Jit64: Merge subfx and subfcx
Again, logic and optimizations are mostly the same so it makes sense.
2021-09-22 22:29:20 +02:00
Sintendo a725eb80ff Jit64: Merge addx and addcx
They are extremely similar and can share nearly all optimizations.
2021-09-22 22:28:54 +02:00
Lioncash 3840b55292 NetPlayClient/NetPlayServer: Remove now-unnecessary static_casts
Now that we have the enum helpers in place, quite a few casts on their
own can be removed.
2021-09-22 15:59:43 -04:00
Lioncash 80b4a4d7fd NetPlayProto: Remove now-unused MessageId type alias
Now that we have enum helpers for inserting values into packets and have
migrated all other enumerations over, there's no need to keep this alias
around any longer.
2021-09-22 15:42:04 -04:00
Lioncash a034f378a0 NetPlayProto: Turn connection error enum into an enum class
Continues the migration off the MessageId type alias
2021-09-22 15:42:04 -04:00
Lioncash dedd0b7ba1 NetPlayProto: Turn Sync-related enums into enum classes 2021-09-22 15:42:04 -04:00
Lioncash af4aaf4609 NetPlayProto: Turn MessageID enum into an enum class
Now we can leverage our helper to insert enum values without the need to
cast.
2021-09-22 15:42:04 -04:00
Lioncash 07af775afa SFMLHelper: Add stream insertion overload helpers for enum types
Will be used in future changes to eliminate the need to cast when
inserting various message IDs
2021-09-22 15:42:01 -04:00
Sintendo a9e0f21373 Jit64: Split arithcx into addcx and subfcx
JitArm64 also opts to separate the two. The shared logic makes less
sense once we start adding more optimizations.
2021-09-21 22:11:11 +02:00
Admiral H. Curtiss 6684e26ae2
DiscIO/DirectoryBlob: Fix swapped DiscContent comparison operators. 2021-09-21 08:01:21 +02:00
OatmealDome a256c11d2f DriverDetails: Add broken dual source blending bug to MoltenVK on Intel GPUs 2021-09-20 19:14:41 -04:00
OatmealDome aa64f7f14f VulkanContext: Don't assume anv for Intel GPUs on macOS 2021-09-20 18:57:19 -04:00
Léo Lam 22f7c07caf
Merge pull request #10081 from sepalani/mem-hex0
MemoryWidget: Simplify the search logic
2021-09-20 22:17:20 +02:00
sowens99 3bc9f66336 Inscribe StickWidget ellipse in square
Previously, it was not clear where the boundary of the StickWidget was when interacting outside of the circle. This aims to restore the gray square present in the Wx-era.
2021-09-20 13:18:13 -04:00
Sepalani 94cba46467 MemoryWidget: Simplify the search logic
Fix leading nul bytes being ignored in hex search
2021-09-20 20:46:26 +04:00
Léo Lam 6129290d31
Merge pull request #10057 from JosJuice/jitarm64-divwx
JitArm64: Optimize divwx
2021-09-20 15:37:57 +02:00
Léo Lam a25f4fab20
Merge pull request #10080 from lioncash/membf
MemoryInterface: Migrate bitfields over to Common::BitField
2021-09-20 14:54:27 +02:00
Léo Lam b43cee8fe4
Merge pull request #10098 from AdmiralCurtiss/scan-dir-tree-trailing-slash
Common/FileUtil: Strip trailing path separator in ScanDirectoryTree().
2021-09-20 14:50:11 +02:00
Léo Lam 276ea43237
Merge pull request #10102 from lioncash/netplay
NetPlayClient: Split out OnData() into smaller functions
2021-09-20 14:41:47 +02:00
Léo Lam 29d236068c
Merge pull request #10104 from AdmiralCurtiss/cheats-manager-ux
Cheats Manager UX improvements.
2021-09-20 14:30:04 +02:00
Léo Lam 28e6e8752c
Merge pull request #10113 from JosJuice/tas-input-latency
DolphinQt: Reduce latency of TAS input's controller input passthrough
2021-09-20 14:26:13 +02:00
Léo Lam e7c0b8ecbd
Merge pull request #10114 from AdmiralCurtiss/disc-addresses
Core/DiscIO: Extract disc and partition constants to DiscUtils.h.
2021-09-20 14:25:59 +02:00
Admiral H. Curtiss ad410009bb
Core/DiscIO: Extract disc and partition constants to DiscUtils.h. 2021-09-19 22:43:52 +02:00
Mai M 57f71a55f8
Merge pull request #10110 from JosJuice/remove-request-refresh-info
Core: Remove s_request_refresh_info
2021-09-19 16:09:58 -04:00
Mai M ca2589f7df
Merge pull request #10103 from AdmiralCurtiss/cheat-search-length-underflow
Core/CheatSearch: Avoid length underflow on new search.
2021-09-19 16:09:43 -04:00
JosJuice 1a5e0c2084 DolphinQt: Reduce latency of TAS input's controller input passthrough
Fixes https://bugs.dolphin-emu.org/issues/12676.

Needs testing to see if this impacts performance when controller
inputs are changing.
2021-09-19 17:08:10 +02:00
JMC47 31ca114721
Merge pull request #10068 from leoetlino/more-low-mem1-constants
IOS: Add missing writes of low MEM1 constants
2021-09-19 09:45:01 -04:00
JMC47 ca064b55fe
Merge pull request #10111 from JosJuice/networkwidget-hidden
DolphinQt: Don't update NetworkWidget when hidden
2021-09-18 09:33:45 -04:00
JosJuice 0a973ddcbb DolphinQt: Don't update NetworkWidget when hidden
Like 92a655c but for NetworkWidget (which was added later).
2021-09-18 14:41:11 +02:00
Scott Mansell ce80a96aee BPStructs: ensure side effects are same
Missed this side effect when fixing crash in Mario Kart Wii wifi
2021-09-18 23:58:24 +12:00
JosJuice e5ed9ee920 Core: Remove s_request_refresh_info
It's only used for frame stepping. We can use s_frame_step instead.
2021-09-18 13:39:38 +02:00
OatmealDome 7e8f5208fe VulkanContext: Disable subgroup reduction on macOS with AMD GPUs 2021-09-16 23:32:10 -04:00
Scott Mansell 7c7609f5b9 BPStructs: Ignore malformed efb copies 2021-09-17 12:42:23 +12:00
Léo Lam 7379450633
Merge pull request #10092 from JosJuice/android-cheats
Android: Add cheat GUI
2021-09-16 19:21:33 +02:00
JosJuice 53ae1a0725 Android: Add Gecko code downloading 2021-09-16 18:48:39 +02:00
Admiral H. Curtiss bd92c29ef5
Core/CheatSearch: Avoid length underflow on new search. 2021-09-16 08:13:02 +02:00
Admiral H. Curtiss c40e8ee3a8
Qt/CheatsManager: Show disabled AR and Gecko tabs when no game is running. 2021-09-16 08:01:40 +02:00
Admiral H. Curtiss dd9047f7c5
Qt/GeckoCodeWidget: Disable functionality if no game id is given. 2021-09-16 08:01:40 +02:00
Admiral H. Curtiss a4b1ea3d70
Qt/ARCodeWidget: Disable functionality if no game id is given. 2021-09-16 08:01:40 +02:00
Admiral H. Curtiss aa2d089d1b
Qt/MenuBar: Allow opening Cheats Manager regardless of emulation state and configuration. 2021-09-16 08:01:26 +02:00
Admiral H. Curtiss aee6e45386
Qt/CheatsManager: Let the 'Configure Dolphin' button shown in the Cheats Manager when Cheats are disabled actually open the settings. 2021-09-16 08:01:12 +02:00
JMC47 4d1bd54917
Merge pull request #10095 from phire/fix-out-of-range-efb
BPStructs: fix out-of-range EFB copy clamping
2021-09-15 13:26:23 -04:00
Admiral H. Curtiss 55397b6d52 DolphinQt: Rewrite cheat search GUI. 2021-09-15 19:05:49 +02:00
Admiral H. Curtiss f3346262d2 Core/CheatSearch: Implement cheat searching functionality. 2021-09-15 19:05:48 +02:00
Lioncash 2b9c65967e NetPlayClient: Change return value of OnData() to void
In all usage cases, the return value isn't utilized.
2021-09-15 11:31:32 -04:00
Lioncash ae714b25ba NetPlayClient: Split out OnData()
Over time OnData() has become a huge function-long case statement that
attempts to manage numerous packet-related behaviors, which makes it a
little difficult to reliably ensure certain handling doesn't interfere
with another case's. It's also mildly annoying to navigate due to its
size.

To make it a little easier to read and find the specific behavior, we
can break the relevant pieces of code out into their own functions.
2021-09-15 11:31:28 -04:00
Léo Lam 94cfbfc49d
Merge pull request #10099 from AdmiralCurtiss/directoryblob-read-between-files
DiscIO/DirectoryBlob: Handle reads between files.
2021-09-15 14:38:37 +02:00
Léo Lam 94e9751dfe
Merge pull request #10100 from Pokechu22/no-wglShareLists
GLInterface: Remove unneeded wglShareLists call
2021-09-15 14:37:19 +02:00
Léo Lam 111c36e6cd
Merge pull request #10101 from lioncash/kb
SI_DeviceKeyboard: Shorten MapKeys()
2021-09-15 13:24:05 +02:00
Lioncash 7c909a73de SI_DeviceKeyboard: Shorten MapKeys()
We can wrap this logic into a lambda to avoid copy-pasted checking of
the over 400+ lines of code.
2021-09-15 01:58:02 -04:00
Scott Mansell eb8bfabdfd BPStructs: make copy width/height const 2021-09-15 11:54:40 +12:00
Léo Lam 15ec7bd546
Merge pull request #10097 from JosJuice/jitarm64-w0-clobber
JitArm64: Fix fresx/frsqrtex unlocking W0 too early
2021-09-14 23:51:24 +02:00
Pokechu22 b8f4a4ae44 GLInterface: Remove unneeded wglShareLists call
When RenderDoc is attached, wglShareLists fails for some reason (see baldurk/renderdoc#2361).  wglCreateContextAttribsARB has a parameter for the share context, so there's no reason to use a separate wglShareLists call.

Co-authored-by: baldurk <baldurk@baldurk.org>
2021-09-14 10:55:33 -07:00
Léo Lam 819a0a69ff
Merge pull request #10076 from lioncash/sibf
SI: Migrate bitfields to Common::BitField
2021-09-14 19:10:39 +02:00
Admiral H. Curtiss f76aaf65f6 Common/FileUtil: Strip trailing path separator in ScanDirectoryTree(). 2021-09-14 17:39:38 +02:00
Scott Mansell 37b80e2170 BPStructs: fix out-of-range EFB copy clamping
Previous code from #7950 only clamps correctly when the efb copies
left and top coordinates are (0, 0)

Now we should handle all situations.

Spyro: A hero's tail is an example of a game that does an oversized
EFB copy with a non-zero origin.
2021-09-15 02:31:38 +12:00
Admiral H. Curtiss 06d41c53ce DiscIO/DirectoryBlob: Handle reads between files. 2021-09-14 07:09:55 +02:00
JosJuice 74f2acd83b JitArm64: Move fresx/frsqrtex RW calls earlier
If W0 is locked when fpr.RW is called, the indirectly called
ConvertSingleToDoubleLower may need to emit a push+pop, so it's
better for fresx/frsqrtex to call RW before locking W0 than after.
2021-09-13 19:27:16 +02:00
JosJuice 1c4155f800 JitArm64: Fix fresx/frsqrtex unlocking W0 too early
fpr.RW may clobber GPRs that are not locked.
Fixes https://bugs.dolphin-emu.org/issues/12656.
2021-09-13 19:03:43 +02:00
Lioncash d00e7d5a75 SI: Collapse interrupt generation check in UpdateInterrupts()
We can simplify this by storing the result of the test into a variable
instead.
2021-09-13 11:25:03 -04:00
Lioncash ca24c32cbf SI: Eliminate trivial sign conversion cases in RegisterMMIO()
Previously differently signed types were being used to create addresses
and bit offsets.
2021-09-13 11:24:59 -04:00
Léo Lam ee863e6722
Merge pull request #10014 from OatmealDome/wiimote-disconnect-crash
WiimoteReal: Fix Wiimote disconnection causing Dolphin to crash on macOS
2021-09-13 15:26:02 +02:00
Léo Lam 5f2a8d98fb
Merge pull request #10093 from JosJuice/revert-revert-10025
Revert "Revert "DolphinQt: Minor consistency fixes for the Settings window""
2021-09-13 14:54:01 +02:00
JMC47 05f86b9f5b
Merge pull request #10012 from Pokechu22/thps4-green-sky
UberShaderVertex: Fix Tony Hawk Pro Skater 4
2021-09-09 17:58:35 -04:00
JosJuice 5ea121eeb5 Revert "Revert "DolphinQt: Minor consistency fixes for the Settings window""
This reverts commit e376a985e4.

A beta build has been released now, so there's no reason to keep
it reverted anymore.
2021-09-08 22:09:19 +02:00
JosJuice b4787cdbd3
Merge pull request #10077 from lioncash/dvdbf
DVDInterface: Migrate bitfields over to Common::BitField
2021-09-08 21:37:09 +02:00
JosJuice 52304df943
Merge pull request #10011 from JosJuice/android-cheats-preparation
Split out code for serializing/deserializing cheat lines
2021-09-08 21:36:56 +02:00
JosJuice 2a22367211
Merge pull request #10056 from lioncash/qtloc
DolphinQt: Minor localization changes
2021-09-08 21:36:46 +02:00
JosJuice 15eb56142a JitArm64: Read BATs in psq_l/psq_st address check
Same approach as Jit64 here as well.
2021-09-08 21:32:16 +02:00
JosJuice 93e968208e JitArm64: Lock fewer registers when assumeNoPairedQuantize 2021-09-08 21:32:11 +02:00
JosJuice 96760093e9 JitArm64: Move psq_st address check to EmitBackpatchRoutine
This way the address check will take up less icache (since it's
only emitted once for each routine rather than once for each
psq_st instruction), and we also get address checking for psq_l.
Matches Jit64's approach.

The disadvantage: In the slowmem case, the routines have to
push *every* caller-saved register onto the stack, even though
most callers probably don't need it. But at long as the slowmem
case isn't hit frequently, this is fine.
2021-09-08 21:26:10 +02:00
JosJuice cd84339dfd JitArm64: Use EmitBackpatchRoutine more for psq_l/psq_st
In the case of the JitAsm routines, we can't actually use
backpatching. Still, I would like to gather all the load and
store instructions in one place to make future changes easier.
2021-09-08 21:26:10 +02:00
JosJuice de21dc5fd9 JitArm64: Add bitset constants for caller saved registers 2021-09-08 21:26:05 +02:00
JosJuice 6c3141e0cc JitArm64: Change parameter order for quantized load routines
EmitBackpatchRoutine (see the upcoming commits) expects
the address to be in W0 for loads and W1 for stores.
2021-09-08 21:26:03 +02:00
JosJuice 36b3d51523 JitArm64: Restructure the BackPatchInfo flags enum
This makes it possible to construct flag combinations like
"load 16 bits into an FPR".
2021-09-08 21:23:00 +02:00
Mai M 059794b551
Merge pull request #10087 from JosJuice/jitarm64-psq-caller-saved
JitArm64: Move psq_stXX GetCallerSavedUsed calls later
2021-09-08 04:00:43 -04:00
Mai M 8809d8eb61
Merge pull request #10089 from AdmiralCurtiss/jit-cache-valid-block-clear
PowerPC/JitCache: Clear valid_block bits for long invalidations.
2021-09-08 04:00:23 -04:00
Pokechu22 52c82733f6 Use custom isnan implementation to avoid HLSL optimizer issues
This adjusts the NaN replacement logic introduced in #9928 to work around the HLSL compiler optimizing away calls to isnan, which caused that functionality to not work with ubershaders on D3D11 and D3D12 (it did work with specialized shaders, despite a warning being logged for both; that warning is also now gone).  Note that the `D3DCOMPILE_IEEE_STRICTNESS` flag did not solve this issue, despite the warning suggesting that it might.

Suggested by @kayru and @jamiehayes.
2021-09-07 19:04:40 -07:00
Admiral H. Curtiss 34992f52c7 PowerPC/JitCache: Clear valid_block bits for long invalidations. 2021-09-07 23:14:20 +02:00
JosJuice 23f6fdebcb Revert "JitArm64: Indexed paired loadstores workaround, attempt 2"
This reverts commit 3071a1d13b.
2021-09-05 11:45:40 +02:00
JosJuice 743de44f03 JitArm64: Move psq_stXX GetCallerSavedUsed calls later
This is a proper fix for the issue that 3071a1d was a workaround for.
It wasn't some kind of bug in the register cache that had laid dormant,
it was a simple mistake made in b24b79e.
2021-09-05 11:42:07 +02:00
Mai M 282fda1530
Merge pull request #10086 from JosJuice/jitarm64-w0
JitArm64: Fix W0 being present twice in register cache
2021-09-04 21:14:40 -04:00
JosJuice ea1210773c JitArm64: Fix W0 being present twice in register cache
Fixes a regression from ecf86bb.

The GPR allocation_order is initialized with only 28 elements,
so the 29th element ends up getting zero initialized.
Very sneaky bug...
2021-09-04 12:48:45 +02:00
JosJuice 156ccdb805
Merge pull request #10082 from lioncash/texenum
BPMemory: Make ZTexOp enum an enum class
2021-09-02 08:14:05 +02:00
Lioncash f36fd5fa39 BPMemory: Make ZTexOp enum an enum class
Avoids placing generic names in the surrounding namespace.
2021-09-01 18:23:22 -04:00
Lioncash 269b7a2166 MemoryInterface: Eliminate trivial sign conversion cases
We can just use unsigned loop variables instead of signed ones.
2021-09-01 06:39:06 -04:00
Lioncash 163b24833d MemoryInterface: Migrate bitfields over to Common::BitField 2021-09-01 06:36:25 -04:00
Pokechu22 e9c6c13886 msbuild: Move DivUtils to DolphinLib.props
It was accidentally put into the main DolphinLib.vcxproj in #9566.
2021-08-31 22:48:07 -07:00
Lioncash 15566048f0 DVDInterface: Migrate bitfields over to Common::BitField 2021-08-31 17:27:43 -04:00
Lioncash e68b9de62c SI: Migrate bitfields to Common::BitField 2021-08-31 16:26:07 -04:00
Léo Lam 32c7524f4d
Merge pull request #10021 from Dentomologist/make_windows_tabbar_scroll_buttons_opaque
DolphinQt: Make Windows tab bar scroll buttons opaque
2021-08-31 19:18:03 +02:00
Léo Lam c3dadd140b
Merge pull request #10074 from lioncash/pte
MMU: Tidy up PTE-related code
2021-08-31 19:17:08 +02:00
Léo Lam ef358a122a
Merge pull request #10075 from lioncash/memcheck
MMU: Don't truncate 64-bit values when calling Memcheck()
2021-08-31 19:06:33 +02:00
Lioncash ed0aa5928f Gekko: Remove unused UReg_PTE
PTEs are only ever operated on in terms of their halves in our code
currently, so this can be removed.
2021-08-31 12:18:31 -04:00
Lioncash 029aff0741 MMU: Remove now-unused defines
Now that we're using register unions where applicable, we can remove
these defines, since they're now unused.
2021-08-31 12:18:28 -04:00
Lioncash 7a6b63b309 MMU: Don't truncate 64-bit values when calling Memcheck()
Previously in Read_U64 and Write_U64 the value that was read or written
would be truncated to a 32-bit value before being passed off to the
memcheck handler, which can result in incorrect values being logged out.
2021-08-31 11:39:13 -04:00
Dentomologist 1fa1e7135c DolphinQt: Make Windows tab bar scroll buttons opaque 2021-08-31 08:33:00 -07:00
Lioncash a8ebca4fc6 MMU: Invert conditionals in Memcheck()
Lets us unindent code a little bit.
2021-08-31 11:30:57 -04:00
Lioncash ee40b640d3 MMU: Make use of UPTE_Lo and UReg_SR in TranslatePageAddress()
Allows us to get rid of a bit of masking in exchange for stating the
bits being accessed or written to directly.
2021-08-31 10:52:52 -04:00
Lioncash e687569e02 Gekko: Add union for segment registers
Will be used in the following commit.
2021-08-31 10:45:12 -04:00
Lioncash 75840f62ff MMU: Make use of UReg_SDR1 in SDRUpdated()
Lets us simplify SDRUpdated() a little bit.

This also fixes the layout of UReg_SDR1. Turns out this struct has been
incorrect (from a little-endian perspective) the entire time and went
unnoticed, since the union was never used.
2021-08-31 10:20:56 -04:00
Lioncash 1c776d8c1a MMU: Move invalidation logic into the TLBEntry struct
Puts the invalidation logic in one place and lets us tidy up
InvalidateTLBEntry a little.
2021-08-31 10:04:44 -04:00
Lioncash 3216040bfe MMU: Remove implicit sign conversions and truncation in UpdateTLBEntry
These are trivial to resolve.

Converting the structure member into a u32 results in no increase in
structure size, as it's making use of the three extra padding bits in
the structure.
2021-08-31 10:00:18 -04:00
Lioncash c008b1c335 MMU: Move UPTE1/UPTE2 unions into Gekko.h
Keeps the register definitions in one spot and lets us remove a comment
about them.
2021-08-31 09:45:28 -04:00
Lioncash 65e131ef5f MMU: Convert PTE unions over to Common::BitField 2021-08-31 09:36:13 -04:00
Léo Lam c5becb4a7e
Merge pull request #10040 from JosJuice/simplify-mcrfs
Interpreter: Simplify mcrfs implementation
2021-08-31 15:31:54 +02:00
JosJuice e376a985e4 Revert "DolphinQt: Minor consistency fixes for the Settings window"
This reverts commit 9d45bac175.
2021-08-31 09:15:03 +02:00
Tillmann Karras 72ca41b9bf DSPInterpreter: fix off-by-one errors in cycle counting 2021-08-31 01:51:42 +01:00
Léo Lam 8ecb0447b6
Merge pull request #10025 from mbc07/gui-fixes-settings
DolphinQt: Minor consistency fixes for the Settings window
2021-08-31 01:43:02 +02:00
Léo Lam 48339afb98
Merge pull request #10041 from lioncash/conv
Interpreter: Make signedness and narrowing conversions explicit
2021-08-31 01:07:27 +02:00
Léo Lam 95fcedeef3
Merge pull request #10053 from lioncash/kdreq
IOS/Network/KD: Minor tidy-up changes
2021-08-31 00:45:17 +02:00
Léo Lam 1fa74ab824
Merge pull request #10058 from AdmiralCurtiss/dsp-cleanup
DSPHLE: Minor cleanup & savestate fix for AX coefficients.
2021-08-31 00:16:54 +02:00
Admiral H. Curtiss f592565532 DSPHLE/AX: Reload resampling coefficients on savestate load if necessary. 2021-08-30 23:36:09 +02:00
Léo Lam 271612f328
Merge pull request #10064 from lioncash/regs
Gekko: Migrate register structs over to Common::BitField
2021-08-30 23:19:17 +02:00
Léo Lam d7109b149b
Merge pull request #10066 from leoetlino/abort-on-panic-alert-option
Add an option to abort when a panic alert occurs
2021-08-30 22:43:21 +02:00
Léo Lam 6659f8019e
Merge pull request #10035 from JosJuice/jitarm64-dcbx-in-loop
JitArm64: dcbx loop detection for improved performance when invalidating large memory regions
2021-08-30 22:39:20 +02:00
iwubcode 1f2f505373 VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc 2021-08-30 13:47:48 -05:00
JosJuice 9b83cf3e7f
Merge pull request #10069 from leoetlino/clang-format-12
Update clang-format to version 12
2021-08-30 09:13:15 +02:00
Léo Lam 815b590dfe
Update clang-format to version 12
12 is the latest release and various editors (VS, VSCode and CLion)
ship with clang-format 12 by default.
2021-08-30 00:20:18 +02:00
Léo Lam 86f2c7889d
Merge pull request #8932 from sepalani/cw-map
PPCSymbolDB: Improve symbol map column detection
2021-08-29 23:28:09 +02:00
Léo Lam ef98f209a2
IOS: Add missing writes of low MEM1 constants
On a real Wii, these constants are normally written by the system menu
(maybe even as part of common SDK code?)

However, they're cleared by IOS whenever a PPC title is launched.
IOS memsets 0x0-0x3fff and then manually writes some constants
in low MEM1. PR #4723 added most of the writes in the 0x31xx region
but left out the four writes to the legacy constant region.

Previously Dolphin didn't actually clear 0-0x3fff so those constants
would stick around after a system menu execution.
011f7789e0 exposed those missing writes.
2021-08-29 22:51:44 +02:00
Lioncash dbf8e27d7f Gekko: Convert UReg_PTE over to using Common::BitField 2021-08-29 06:16:55 -04:00
Lioncash e4e1b6064d Gekko: Convert UReg_THRM3 over to using Common::BitField 2021-08-29 06:16:55 -04:00
Lioncash 11e76e1f67 Gekko: Convert UReg_THRM12 over to using Common::BitField 2021-08-29 06:16:55 -04:00
Lioncash 12b87922fb Gekko: Convert UReg_BAT_Lo over to using Common::BitField 2021-08-29 06:16:54 -04:00
Lioncash b4496e6653 Gekko: Convert UReg_BAT_Up over to using Common::BitField 2021-08-29 06:16:51 -04:00
JMC47 006fc99e8e
Merge pull request #8901 from sepalani/dns-async
IOS/Network: Make name resolution asynchronous
2021-08-29 05:12:13 -04:00
Léo Lam e091c2e817
Add an option to abort when a panic alert occurs
Prompted by https://dolphin.ci/#/builders/24/builds/985

A 1-character typo in a recent PR caused FifoCI builds to break
horribly and spew millions of panic alerts until buildbot crashed.

This PR adds a new config option -- defaulting to off -- that allows
Dolphin to abort early on when a panic alert occurs instead of
continuing forever.
2021-08-29 02:02:07 +02:00
Mateus B. Cassiano 9d45bac175 DolphinQt: Minor consistency fixes for the Settings window 2021-08-28 16:45:22 -04:00
JosJuice b90008aadb Split out code for serializing/deserializing cheat lines 2021-08-28 19:31:27 +02:00
JosJuice fb96ecb7da Move patch saving code to PatchEngine 2021-08-28 17:34:28 +02:00
Lioncash 1e4ecfe3d4 Gekko: Convert UReg_DMAL over to using Common::BitField 2021-08-27 11:20:37 -04:00
Lioncash 474e09c239 Gekko: Convert UReg_DMAU over to using Common::BitField 2021-08-27 11:19:21 -04:00
Lioncash a126821d5e Gekko: Convert UReg_WPAR over to using Common::BitField 2021-08-27 11:18:03 -04:00
Lioncash 8ac079a647 Gekko: Convert UReg_MMCR1 over to using Common::BitField 2021-08-27 11:16:41 -04:00
Lioncash 300f7c10bd Gekko: Convert UReg_MMCR0 over to using Common::BitField 2021-08-27 11:15:15 -04:00
Lioncash 1ec3768b84 Gekko: Convert UReg_SDR1 over to using Common::BitField
Also fixes a typo in the struct name, since it was referring to SPR1
instead of SDR1. Given this isn't used anywhere yet, it's a painless
change.
2021-08-27 11:12:30 -04:00
Lioncash 9e183e63f1 Gekko: Convert UReg_HID4 over to using Common::BitField 2021-08-27 11:10:22 -04:00
Lioncash 6ab2e5ab16 Gekko: Convert UReg_HID2 over to using Common::BitField 2021-08-27 11:08:14 -04:00
Lioncash 02ec9c3b50 Gekko: Convert UReg_HID0 over to using Common::BitField 2021-08-27 11:05:51 -04:00
Lioncash 4591246608 Gekko: Convert UReg_FPSCR over to using Common::BitField 2021-08-27 11:01:32 -04:00
Lioncash 4ecdcc9d78 Gekko: Convert UReg_MSR over to using Common::BitField 2021-08-27 10:54:49 -04:00
Lioncash 1863212d94 Gekko: Convert UReg_XER over to using Common::BitField 2021-08-27 10:46:38 -04:00
Mai M 4816195366
Merge pull request #10054 from JosJuice/android-game-cache-lock
Android: Reduce gameFileCache lock contention
2021-08-27 10:15:25 -04:00
Mai M 7d88354659
Merge pull request #10061 from JosJuice/jitwidget-div-zero
DolphinQt: Fix divide by zero in JITWidget::Update
2021-08-27 10:13:52 -04:00
Franz-Josef Haider 9cd878218c Interpreter_Tables: specify FL_IN_A for twi.
rGPR[inst.RA] is an input to twi.
2021-08-27 16:59:02 +03:00
JosJuice f17584fc06 DolphinQt: Fix divide by zero in JITWidget::Update
I ran into this while fiddling with the debugger.
2021-08-27 10:30:18 +02:00
Admiral H. Curtiss a4d4dc82d4 DSPHLE/AX: Use in-class initialization. 2021-08-27 03:00:13 +02:00
JosJuice feefc17b02 JitArm64: divwx - Optimize comparisons to 0x80000000 2021-08-26 15:04:56 +02:00
JosJuice 91b112b984 JitArm64: divwx - Optimize division by 2
...and let's optimize a divisor of 2 ever so slightly for
good measure. Most GameCube games seem to hit this on launch.
2021-08-26 15:04:56 +02:00
JosJuice 9889e7eb33 JitArm64: divwx - Optimize power-of-two divisors
Power-of-two divisors can be done more elegantly, so handle them
separately.
2021-08-26 15:04:55 +02:00