Commit Graph

26879 Commits

Author SHA1 Message Date
Admiral H. Curtiss 812cc8b632
MemArena: Split into three separate files for each OS. 2021-12-25 20:20:36 +01:00
JosJuice 1295bc4272 Jit64: Make paired loads always safe
It's always a good sign when the comments say "this will definitely
crash" and "I don't know if this is for a good reason".

Fixes https://bugs.dolphin-emu.org/issues/12762.
2021-12-24 19:09:12 +01:00
JosJuice 5dd2ddb1df Memmap: Replace some GetPointer calls
These GetPointer calls could cause crashes, in part because the
callers didn't do null checks and in part because GetPointer
inherently is unsafe to use for accesses larger than 1 byte.
2021-12-24 11:03:58 +01:00
Pokechu22 1cd148d4c5 GeomeryShaderGen: Set gl_ClipDistance on Vulkan as well as OpenGL
Fixes https://bugs.dolphin-emu.org/issues/12548
2021-12-23 17:56:21 -08:00
Pokechu22 de7c78ef3d ControllerEmu: Hide the cursor if the input gate is disabled 2021-12-23 15:22:35 -08:00
Pokechu22 86f2b39d66 FifoPlayer: Wait after clearing the screen
If we don't wait, then the copy will be performed at a later time, which may overwrite memory updates.
2021-12-23 12:35:18 -08:00
Pokechu22 d981944d7c FifoPlayer: Fix uninitialized variable warnings in ClearEfb
The actual values don't matter since we overwrite all of the relevant fields, but other bits were not initialized (e.g. the top 12 bits of X10Y10), so the warning was semi-valid.
2021-12-23 12:35:18 -08:00
Pokechu22 85025612bc LightingShaderGen: Make s_lighting_struct not inline
This generated warnings on the freebsd builder.
2021-12-22 15:17:52 -08:00
JosJuice e6f40fa015
Merge pull request #10279 from Pokechu22/intensity-alpha
TextureConverterShaderGen: Set alpha to 1 on intensity formats if EFB lacks alpha
2021-12-23 00:14:06 +01:00
JMC47 b1f79d9ecf
Merge pull request #10215 from OatmealDome/shader-logic-ops
VideoCommon: Support shader logic ops on Metal (Apple GPUs) and OpenGL ES
2021-12-22 16:39:54 -05:00
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
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