Simulate a small delay on GC Memcard operations

This was not needed for most games before because the external exception was
itself delayed. aram-dma-fixes changed that and made the external exception
happen a lot quicker, breaking games that relied on the memcard operations
delay.

Fixes issue 5583.
Changed cmdidle to be idle on breakpoint.
Added low watermark interrupts generated by the gather pipe.

Fixes Gladius from not booting.

Fixes issue 5518.
Changed cmdidle to match the isGpuReadingData flag.  Fixes the random freezes in The Last Story.
Set the token and finish interrupt signal from the video thread.  This fixes the inconsistent state caused by lag from the scheduler.  Fixes Rayman 3: Hoodlum Havoc and Shamu's Deep Sea Adventures.

Fixes issue 5401.
Fixes issue 5589.
Used AtomicStore to write to the signal interrupts.
Used Atomic functions to update variables shared between the CPU and GPU threads.
Changed the variables from bool to u32 to match the atomic functions.
Updated PC on a few memory writes that were missed in the FifoBusy branch.  Thanks to hk.konpie for the tip.

Fixes issue 5993.
Moved the token update to the CPU thread.
Removed the updating of PC in GenQuantizedStores() as the generated code is static.
Removed the updating of PC in the Cleanup function.  This was causing Metroid Prime to hang.
Merge branch 'master' into FIFO-BP

# By Jordan Woyak (24) and others
# Via Jordan Woyak (3) and others
* master: (66 commits)
  Reduce some DI command delays. Fix DKCR hanging with DSP HLE. My other games continue to work.
  Video_Software: Fix ZComploc option breaking stuff.
  Video_Software: Fix the ZFreeze option doing nothing.
  Video_Software: Toggable zfreeze and early_z support for testing.
  Fix header guard and definitions not being set to 1
  Add the option to turn on only the EGL interface to use desktop OpenGL with it.
  Change the ugly "no banner" banner to the sexy "X" from the website.
  Fix a crash in the FifoPlayer dialog.
  Use different reply delays for various DI commands. Fixes issue 5983.
  Revert "[bugfix] DX9::TextureCache: Use max_lod instead of min_lod where necessary."
  Fix some potential issues when blending on EFB formats without alpha. Clean up state transition tables.
  Disable play and record buttons if an iso was selected, but is later deselected.
  Disable start/play recording buttons when no iso is selected.
  Only delay DI and fs IPC replies. Fixes issue 5982.
  Fix compilation with SDL2. (based on a patch from matthewharveys) Fixes issue 5971.
  "Fix" using SDL from externals.
  Clean up SDL includes a bit. Maybe fix an SDL2 problem.
  Number "unknown" axes in OSX rather than call them all "unk".
  Revert "Only delay DI command replies." Fix "Wii Party" again.
  Hopefully make wiimote speaker less crappy.
  ...
Added preliminary support to synchronise the timing of the CPU and GPU threads.  A new option has been added to the game properties for this purpose.  This option may help with random freezes in Dual Core mode.

Fixes Gladius and Baten Kaitos: Eternal Wings and the Lost Ocean

Fixes issue 5150.
Profile stores, fp stores and ps stores only to the fifo write addresses list.  This should make the JIT a little faster as it will not be checking for external exceptions unnecessarily.
Moved the setting of the Finish interrupt signal back to the main thread as it was causing Wii games like Resident Evil 4 (Wii) to hang.
Increased the cycle time of the vertex command.  Fixes "Speed Challenge: Jacques Villeneuve's Racing Vision".
Merge branch 'master' into FIFO-BP

# By Jordan Woyak (9) and others
* master:
  Fixed a buffer overflow in the OpenAL buffer.
  TextureCache: Fix D3D backends crashing when a game uses multiple 1x1-sized LODs.
  WII_IPC_HLE_Device_FileIO: don't rebuild the filename on every operation.
  Some cleanup of CWII_IPC_HLE_Device_FileIO: The real file was never kept open for longer than a single operation so there was no point in dealing with it in DoState. Saving the real path in the savestate was also probably a bad idea. Savestates should be a bit more portable now.
  Removing destination on rename when source isn't present doesn't make sense. IOCTL_RENAME_FILE still might not be totally correct.
  Change some CNANDContentLoader logic to what was probably intended. Kills some warn logs when opening Dolphin.
  Let's not CreateDir an empty string every time CreateFullPath is used, logging an error every time.
  Fix a memleak. Probably/maybe improve USBGecko performance.
  Remove the core count from the cpu info OSD message. It was often wrong and not rather important.
  Use omp_get_num_procs to set the number of OpenMP threads rather than our core count detection.
  Bulk send TCP data to the client with the emulated USB Gecko.
  Added the ability to reverse the direction of the force feedback by allowing negative range values.
  Changes/cleanup to TextureCache::Load and other mipmap related code. The significant change is what is now line 520 of TextureCacheBase.cpp: ((std::max(mipWidth, bsw) * std::max(mipHeight, bsh) * bsdepth) >> 1) to TexDecoder_GetTextureSizeInBytes(expanded_mip_width, expanded_mip_height, texformat);
Made vertex loading take constant time.  Fixes a hang in Gladius.
Added a patch that bypasses the FIFO reset code in Wallace and Gromit: Project Zoo, allowing it to go in-game.
Merge branch 'aram-dma-fixes' into FIFO-BP

# By Pierre Bourdon
# Via Pierre Bourdon
* aram-dma-fixes:
  Simulate a small delay on GC Memcard operations
Merge aram-dma-fixes (r76a13604ef49b522281af75675f044d59a74e871)