Q1 2021 Progress Report
Once again we are back with another progress report bringing you amazing progress.
Core Improvements
PAD/Counters: MakeVSync Queue adjustable in the UI. Extra Pad update.
New UI option (ini option has been there a while) so users can choose between a little bit extra performance or reduced input lag.
Also added the PAD Update to the VSync call in Counters as it seemed to reduce input lag marginally.
IPU: Return contentsof the bottom of the FIFO in CMD except FDEC/VDEC.
This is based on the work by @PS1-Rockin on Dobiestation but modified based on the theory that it always returns the first 32bits of the FIFO unless an FDEC/VDEC command is executed, however FDEC is basically doing this anyway, but VDEC returns decoded information.
Fixed videos for probably all broken EA games, but namely:
- F1 2001
- F1 2002
- Neo Contra
- Shox
- Theme Park Rollercoaster/World
IPU: Fill Input FIFOon command end ready for next command.
Dance Summit 2001: So basically what the game does is it does some IPU stuff, but the DMA is left with 1 QWC left to be read on the DMA, on the hardware this will normally be flushed in to the FIFO. The game then does a FIFO reset (To get rid of it) then starts another DMA. The problem we have is because we still had the DMA pending for 1 QWC, it ignored the new DMA start and the IPU would hang up waiting for data to be fed in. This PR resolves that problem.
Test Drive: Also added DMA 4 (To IPU) being flushed if BCLR is called without first stopping the DMA.
Set the Picture type on VDEC to I-Picture if set to 0 in the IPU_CTRL, this fixes a bunch of Eyetoy games which incorrectly set this register.
- Fixes EyeToy Play(1-3).
- Fixes Bakufuu Slash!! Kizna Arashi.
- Fixes Kaiketsu Zorro Mezase! SIF0 and SIF1 stall control.
- Fixes Test Drive: IPU hang in middle of Event 5.
DEV9
Support 16bit reads/writes to SPD_R_PIO_DATA & SPD_R_PIO_DIR
This improves #3192, the online beta now sends a DHCP Discover packet, although it appears to be invalid.
Generate unique MAC for TAP
An unique MAC is needed for full compatibility with XLink Kai.
Uses a method similar to what was done for PCAP.
Add HDDemulation
Merge _DEV9*() functions into *Net(), and check ethEnable before calling InitNet()
Previously, the ethEnable config value was not checked before starting network RX net thread.
Fix crash on Linux when we fail to open the adapter
Re-add PCAP(both bridged and switched) on windows
CDVD
Increase buffer for DVD_LAYER_DESCRIPTOR.
Implement mechacon command 0xEF
microVU
microVU: Implement Overflow checks
Fixes Superman Returns.
microVU: Fix jump caching when using doJumpAsSameProgram
microVU: Fix P flag instance on Ebit
Also small fix for flag statuses on M-Bit on Branch.
microVU: Removed full flag optimisations
They were unused, broken and cluttering up the code.
Fix Esinopcode
Someone accidentally used bad function to analyze ESIN opcode on microVU, that generated bad values due to wrong register field being used.
Fixes X2 - Wolverine's Revenge.
microVU: move the overflow flags to the correct position
VIF
VIF: Fix MPG VU Address wrapping
Fixes Boogie.
VIF: Clean up some old (incorrect) code
SPU2
SPU2: Attempt 96khz sample rate if 48khz fails (WASAPI).
WASAPI is terrible and doesn't support sample rate conversion in shared (normal) mode and requires exclusive mode.
This PR basically attempts to double the PS2 sample rate of 48khz to 96khz as this tends to be the other windows default. If this fails it will put a log message to say you need to use Exclusive mode.
Note: When using PS1 game emulation you will need to use exclusive mode, nothing I can do about this (44.1khz doesn't divide nicely from 48khz or 96khz).
- Fixes The Simple 2000 Series Vol 51 - The Senkan (AKA The Battleship) which was not booting with anything but ZeroSPU2
- Fixes The Simpsons, problem was due to an ADMA refill bug.
SPU2: Update voices before DMA reads, reset OutPos on reset
Improves the booting reliability of GTA VC, especially on consecutive boots without closing the emulator.
Switch to a more accurate noise algorithm
This algorithm comes from PCSX-R and is an implementation of Dr. Hell's research.
The previous implementation was a simple LFSR and did not use the provided noise clock from the ATTR register.
SPU2: Improve ADMA behaviour/timing.
- Hopefully improves the crackling in burnout 3.
- Fixes music looping in Ratatouille.
- Fixes Vexx clicking sound (Partial ADMA transfers).
- Fixes the Dolby Pro Logic video missing sound in Primal (Partial ADMA transfers).
- Fixes Splinter Cell panning audio problem and high pitched noises in cut-scenes.
- Fixes Myst 3 panning audio problem.
- Fixes Dynasty Warriors 5 stuttering videos when Dolby is enabled.
SPU2: Tighten AutoDMA IRQ timing
Fixes games which monitor the MADR while transferring.
Fixes Tom & Jerry in War of the Whiskers jumpy music.
Adjust interpolation implementations
These seems to be have been adjusted to match the output of catmull-rom which is really the one in the wrong by being twice as loud.
As a result of the interpolated output being at a reasonable level we can use ApplyVolume to apply the ADSR volume.
SPU2: Make sure cache hits match previous block decoded samples.
Caching blocks of ADPCM is a bit sketchy because the previous samples (which it uses to generate the new ones) can change depending on if it's the start of the voice on or if it has looped around, so you can end up with blips and glitches in the sample stream, this should avoid that problem whilst not making the cache completely unusable.
Should get rid of clicking and popping noises in loops samples.
Fixes Sphinx and the Cursed Mummy sound distortion.
Also fixes remaining blips in Vexx.
Add Gaussian interpolation
This implements the actual SPU interpolation as documented by nocash.
Resample reverb input/output
The reverb runs at half the sample rate of the rest of the SPU so a change of sample rate is required. The way this is currently done is by decimating when down-sampling and duplicating samples when up-sampling without doing any filtering.
This adds proper filtering to this process, the filter coefficients are from Mednafen but we think they were originally found by Neill Corlett.
SPU2: Try to recover DMA pointer after savestate load
SPU2: Ignore LSAL/H Writes after key on if voice sets loop point.
Fixes behaviour with loop address writes within 4T's of a voice keying on which is what the old Delay Cycles tried to address, if the voice sets its own loop point the write from hardware is ignored.
Fixes Mafia music loops.
Reset IRQ Status when swapping game in case it got set previously
Memory Card
Memorycards: Fix out of bounds array access in folder memcards.
Don't keep the DataClusterInUse bit when accessing the next cluster.
With this folder memcards work on 64bit.
Memorycards: Add support for OpenPS2Loader VirtualMemoryCards.
Adds some basic support to OPL VMC files (.bin) that use 512 bytes pages.
Normal pages are 528 bytes long, those extra 16 bytes contain 12 bytes of ECC data.
Debuggers
Debugger: Add \
Debugger: Require emulator start before enabling Break/Run button.
GS/Core: Implement the new generation of GS Debugger.
This is a full in-core reimplementation of GSDumpGUI. It will be used for GS Debugging once GSdx is merged in to the core.
One step closer in to merging GSdx in to the core.
Misc core
Implements IOPbreakpoints
Execute breakpoints for the interpreter
Don't Destroy() modals
On macOS it prevents the parent window from regaining focus. By
PGIF: PS1DRV handlesbit 28 of GPU Status register, not PGIF.
Fixes several PSX games:
- Castlevania: Symphony of the Night
- Twisted Metal
- Pink Panther
USB: usb-mic: Send 1ms worth of samples for 48kHz and 8kHz sample rates
USB: Improve Force Feedback test so it doesn't block UI.
This modifies DirectInput USB Force Feedback test not to block the UI. Instead of performing the test synchronously on the UI thread, a timer gets created which advances the test every half a second.
Eyetoy mirroring
- Fixes Bakufuu Slash! Kizna Arashi.
Core: Preserve read only bits in the COP0 config register.
The read-only bits in question are the Instruction cache size (IC) and the Data cache size (DC).
Before this MTC0 would freely write to the entire config register.
Core: Implement proper %s handling for syscall 117 (0x75).
This makes the syscall iterate through the format string which can be considered "slow" but this syscall is only going to be used for debugging purposes.
Core: Added support for little endian data for patches.
Allows users to use the leshort, leword, and ledouble datatypes inside their patches. Using these datatypes ensures that values in the memory view appear the same as the values in the patch.
This was made with easing patch development in mind as now developers can make patches without having to reverse endianness. This is especially useful when using programs like ghidra that displays instructions in little endian.
GSdx Improvements
GSdx-hw: Implement per pixel alpha blending (PABE).
Improves shadow/lighting effects on certain games, both HW renderers support the feature.
So far we have a few games that see an improvement:
Fixes Strawberry Shortcake character shadow/lighting.
Fixes Cartoon Network Racing shadow/lighting.
And for those that enjoy some image comparisons:
Cartoon Network Racing: Before -> After
Strawberry Shortcake: Before -> After
Misc GSdx
Some GUI changes
Changed some options:
- Large framebuffer renamed into conservative framebuffer.
- Dithering context menu re-ordered.
- 8-bit textures renamed into GPU Palette Conversion.
GSdx-hw: Get rid of some extra branches/conditions in DATE selection
Fix alignment of font
Should fix invisible characters.
This brings GSdx one step closer to be merged with the core.
GSdx-d3d11: Cleanup gsdevice11.cpp warnings reported on codacy.
List of removed CRC hacks:
Remove Unofficial CRCs
Gsdx-hw: Remove Bully crc hack, it broke a bunch of effects
TAS (Tool Assisted Speedrun) Utility Improvements
Recording: Reorganize and realign InputRecordingControls.
Recording: GUI Improvements around savestate-based input recordings.
IPC (Interprocess Communication) Improvements
Socket re-usability
This avoids port overfills on windows, while increasing performance substantially on platforms that do port overfills.
Add a slot system
This allows multiple emulator sessions to run at the same time and windows user to configure their used port to their preferred one.
Fix type polymorphism & checkbox
Some versions of wxWidgets are more sensitive than others on dynamic casting, so instead I used a C style cast to prevent any crash.
GameDB Improvements
GameDB: Remove patches for Quake 3 videos, no longer required
GameDB: Removed no longer required FMV skip patches
List of removed patches for games include:
- BDFL Manager 2005 (EU)
- F1 Racing Championship (Japan and EU regions)
- Paris-Dakar Rally (EU)
GameDB: Add improved Xenosaga save crash prevention patch.
Updated patch rewrites a chunk of game code to decrement JPEG quality, rather than just immediately floor it. Allows thumbnails to still look kind of okay.
Fixes depth precision, game fills upper 16bits of depth with 0xFFFF. This results in a really high 32 bit value which is then converted to float because both HW and SW renderers lack double precision the lower 16 bits of the initial 32 bit value lose precision.
Misc Improvements
Add GHC Filesystem
This adds GHC filesystem to pcsx2 common utilities.
3rdparty: PortAudio: Upgrade PortAudio to latest master.
3rdparty: Update Libsamplerate to 0.2.1.
Keyboard Shortcuts Strings
Based on https://wiki.pcsx2.net/Hotkeys.
Fix compilation in path with spaces
Fix various Debug Tools Codacy complaints
Fix paths on macOS
MacOS was using linux paths rather than wx's macOS-specific subclass, which doesn't match how the app is installed in macOS (all paths should be relative to the executable).
Also adds steps to copy missing resources into the app bundle.
Purge GSNull plugin entirely
The plugin is obsolete, GSdx already provides Null(no display functionality).
GUI: Prevent Vsync setting from being wiped on preset changes.
Reapplies the currently applied vsync mode when changing preset options.
Remove unused code
Avoid presets from resetting VsyncQueueSize
The VsyncQueueSize setting is currently affected by presets, would revert to default on start as well. Since the setting is not grayed out, this change makes it be unaffected.
GUI: If available, enable menu option to load backup savestate when a game is first launched
GUI: Visually indicate the current savestate slot in the load/save menu
Capture: Optimizations with file names, SPU2 recording, and capture menu gui
Addresses some oversights involving transferring a file name between the GS & SPU2 recording setups.
Adds a new audio toggle setting that allows a user to control whether a WAV file should be generated alongside a video recording. In doing this, behavior for when SPU2 recording fails to be setup becomes more defined and consistent.
Additionally, F12 will now route to sMainFrame if GUI is active as to keep the capture menu GUI accurate to the current state.
Conclusion
And that's all from us, see you next time in our 2021 Q2 Report!
Metadata
2021 Q1: (dev818 to dev1163) (2020-01-01 - 2020-03-31)