Commit Graph

13213 Commits

Author SHA1 Message Date
flacs 9ef349181e Revert "Jit64: use BMI1's ANDN for andcx" 2015-08-14 18:10:07 +02:00
Pierre Bourdon 86c28bfac6 Bump save state version. 2015-08-14 16:17:28 +02:00
Pierre Bourdon 2d5d203be8 ZeldaHLE: Add UCode version for Pikmin 1 PAL. 2015-08-14 16:01:36 +02:00
Pierre Bourdon 18d0f15885 ZeldaHLE: Fix the AFC remaining samples logic on looping. 2015-08-14 16:01:36 +02:00
Pierre Bourdon 9105a76eb1 ZeldaHLE: Comment on the differences between FSA/ZTP UCodes. 2015-08-14 16:01:36 +02:00
Pierre Bourdon fcbed7483d ZeldaHLE: Properly read remaining AFC samples when a whole frame is available. 2015-08-14 16:01:36 +02:00
Pierre Bourdon a602466e4f ZeldaHLE: Implement patterns 2/3 automatic regeneration. 2015-08-14 16:01:35 +02:00
Pierre Bourdon dd1cb88e9a ZeldaHLE: Add new UCode version for Pikmin 1/2 New Play Control 2015-08-14 16:01:35 +02:00
Pierre Bourdon c6c0f69c6b ZeldaHLE: really fix the constant pattern variable step computation.
This time tested by comparing pattern indexes across LLE and HLE with the same
inputs. Matches on the 3-4 test cases I made.
2015-08-14 16:01:35 +02:00
Pierre Bourdon fddb3f0d3c ZeldaHLE: fix the constant pattern variable step computation. 2015-08-14 16:01:35 +02:00
Pierre Bourdon 090723167f ZeldaHLE: Implement constant patterns with variable step (sample source 0A). 2015-08-14 16:01:35 +02:00
Pierre Bourdon fbe727b0bb ZeldaHLE: Support GBA crypto through command 0C. Reuses the pre-existing GBA crypto code from the separate UCode. 2015-08-14 16:01:35 +02:00
Pierre Bourdon 0b1af50316 ZeldaHLE: Initial support for command 0C in both styles implemented by the light protocol. Logs, but doesn't crash anymore. 2015-08-14 16:01:35 +02:00
Pierre Bourdon 32fcd8ec7c ZeldaHLE: Special case Cmd03 NOP handling to make it clear it shouldn't ever happen on light protocol UCodes. 2015-08-14 16:01:34 +02:00
Pierre Bourdon bbfa238657 ZeldaHLE: Document that the crashy commands are not actually crashy on light protocol, just never used. 2015-08-14 16:01:34 +02:00
Pierre Bourdon 25430e7923 ZeldaHLE: Add a flag to disable Cmd0D on older UCodes.
Shouldn't really matter -- these NOP commands aren't really used, but since it
reads an argument it's probably better to explicitly NOP it for safety.
2015-08-14 16:01:34 +02:00
Pierre Bourdon 8526a4131c ZeldaHLE: Properly implement light command 03.
On at least one version (AC/Pikmin 1 NTSC) it doesn't even send a sync mail and
just reloops to the dispatcher.
2015-08-14 16:01:34 +02:00
Pierre Bourdon 7f7e036a02 ZeldaHLE: Add a missing game to the list of games to look at. 2015-08-14 16:01:34 +02:00
Pierre Bourdon cdb1022696 Zelda HLE: Add support for the ZTP Wii UCode. 2015-08-14 16:01:34 +02:00
Pierre Bourdon 5f61ab3e21 Zelda HLE: Update the CRC to games mapping (documentation only). 2015-08-14 16:01:33 +02:00
Pierre Bourdon addb5cb887 Zelda HLE: Support the per-frame sync protocol used by SMS.
Didn't test if SMS sounds right (travelling with no headphones \o/) but the
waveform looks ok and the mails are flowing as expected.
2015-08-14 16:01:33 +02:00
Pierre Bourdon 89037781e0 Zelda HLE: Make the implementation less strict for recoverable errors.
It kind of sucks that we don't emulate some behaviors properly, but there is
very little ROI for some of these features and I'm not going to spend time
implementing them any time soon. Making the PanicAlerts optional allows for
more testing of the core features on more games while "just" breaking less
important features like reverb.
2015-08-14 16:01:33 +02:00
Pierre Bourdon 837b8041c0 Zelda HLE: Only alert for mixing into back buffers for recent UCode versions.
On older versions there is no such concept of a "back buffer" since positional
audio is not supported. These buffers are just used for temp mixing, and while
it would be really nice if we could support more of that inter-buffer mixing
(TODO :) ) it does not warrant a PanicAlert at this time.
2015-08-14 16:01:33 +02:00
Pierre Bourdon 840a4157b0 Zelda HLE: Properly implement LQ AFC decoding.
Typos and stupid mistakes + untested code = dirty Git history.
2015-08-14 16:01:33 +02:00
Pierre Bourdon 82689677d9 Zelda HLE: Implement LQ AFC decoding (samples source 0005). 2015-08-14 16:01:33 +02:00
Pierre Bourdon b3a327f02b Zelda HLE: Implement sample source 3.
"Square" wave at a 0.25 duty cycle (25% up 75% down).
2015-08-14 16:01:32 +02:00
Pierre Bourdon 3c2b22bc09 Zelda HLE: Add basic support for Luigi's Mansion.
Fails ingame because it mixes to some buffers that are considered the back
buffers for Dolby games. That check might need to be less restrictive for games
that don't use Dolby mixing.
2015-08-14 16:01:32 +02:00
Pierre Bourdon a0c318454d Zelda HLE: Log the UCode version being used (CRC/flags).
Also tidy up the versions list a bit.
2015-08-14 16:01:32 +02:00
Pierre Bourdon 2e72c11025 Zelda HLE: Add support for the Pikmin 1 NTSC version of the UCode. 2015-08-14 16:01:32 +02:00
Pierre Bourdon a8810e8778 Zelda HLE: Add support for the Zelda: FSA UCode. 2015-08-14 16:01:32 +02:00
Pierre Bourdon 01ab40fc6e Zelda HLE: NTSC IPL provides the volume stepping explicitly.
Support that through a new behavior flag. Now the only remaining known bug in
the NTSC IPL is the reverb not fading out.
2015-08-14 16:01:32 +02:00
Pierre Bourdon 43882f3e6e Zelda HLE: Handle the smaller VPBs used by the NTSC IPL.
Damn you, Nintendo.
2015-08-14 16:01:31 +02:00
Pierre Bourdon 1807c113b5 Zelda HLE: Support both NTSC and PAL IPL.
Add a flag for UCodes that only have four non-Dolby mixing destinations
(instead of the standard six destinations).

NTSC IPL is still hopelessly broken.
2015-08-14 16:01:31 +02:00
Pierre Bourdon 4ace79024d Zelda HLE: Add a missing mixing buffer used by GC IPL.
Not completely sure what it's used for yet, but TWW has references to it so
I'll get to it at some point.
2015-08-14 16:01:31 +02:00
Pierre Bourdon 8c85a8c8d9 Zelda HLE: Fix reverb in the GC IPL.
Adds a missing destination buffer, and support post-filtering.
2015-08-14 16:01:31 +02:00
Pierre Bourdon 13ea54628d Zelda HLE: Add support for the light protocol.
Used by a few titles (Luigi's Mansion, Animal Crossing) as well as the GameCube
IPL/BIOS.

Note that the IPL does not work yet because it mixes to unknown buffers.
2015-08-14 16:01:31 +02:00
Pierre Bourdon c033395e28 Zelda HLE: Introduce behavior flags to handle UCode version differences.
MAKE_DOLBY_LOUDER solves some of the volume issues that were happening in Zelda
Twilight Princess and SMG1.
2015-08-14 16:01:31 +02:00
Pierre Bourdon 8b9b9f033a Zelda HLE: Fix and genericize PCM ARAM loading functions.
Now also handles PCM16, and works for longer sounds. SMG1 main menu outputs
some sensible audio now, though volume seems slightly off.
2015-08-14 16:01:30 +02:00
Pierre Bourdon 0dc5a925b0 Zelda HLE: Add initial support for Wii DAC and SMG1.
SMG1 boots but quickly PanicAlerts due to an unimplemented sample source.
2015-08-14 16:01:30 +02:00
Pierre Bourdon ea1ac5f596 Zelda HLE: Add save state support.
Also fix an inconsistency in the spelling of "coeffs".
2015-08-14 16:01:30 +02:00
Pierre Bourdon bfff0a72df Zelda HLE: Implement sample sources 4, 7, 11 and 12.
Just 4 different versions of the same sample source, using a different constant
pattern uploaded to the DSP during command 01.
2015-08-14 16:01:30 +02:00
Pierre Bourdon 6c61ee6278 Zelda HLE: Initial support for Zelda Twilight Princess (GC)
Very close to the TWW version of the UCode, haven't determined any differences
yet (but I'm sure that will come soon). Works well enough to reach ingame
without any errors other than a few volume issues.
2015-08-14 16:01:30 +02:00
Pierre Bourdon b672788548 Zelda HLE: Skip command words that are not commands.
Zelda Twilight Princess (GC) seems to push null words into the command buffer.
The command handler in the UCode ignores initial command mails that do not have
the MSB set.
2015-08-14 16:01:30 +02:00
Pierre Bourdon 9944731516 Zelda HLE: Add reverb emulation. 2015-08-14 16:01:29 +02:00
Pierre Bourdon c58aece9ad Zelda HLE: Implement the PCM8 sample source.
Reorder some things in the source code to match the sample source definition
order. Add and remove some TODOs.
2015-08-14 16:01:29 +02:00
Pierre Bourdon 58fd39d57a Zelda HLE: Value-initialize the std::arrays.
I was under the wrong impression that std::array's default constructor
performed value initialization. Turns out it does not, so an array of POD will
not be initialized.
2015-08-14 16:01:29 +02:00
Pierre Bourdon 34341af17d Zelda HLE: Implement saw wave generation (sample source 0001).
Fixes issue 7961.
2015-08-14 16:01:29 +02:00
Pierre Bourdon 91fade5e89 Zelda HLE: Properly implement the square wave generation.
Zelda TWW magic meter works properly now.
2015-08-14 16:01:29 +02:00
Pierre Bourdon 63712e58fd Zelda HLE: Convert some ERROR_LOG to PanicAlert.
While these are not really unrecoverable errors, while Zelda HLE is in a
testing / development phase it is useful to notice these "unexpected" cases (or
expected without known ways to reproduce) by making them as hard as possible to
ignore.
2015-08-14 16:01:29 +02:00
Pierre Bourdon 2bb3daf027 Zelda HLE: Implement square wave sample source.
Also fix Windows build.
2015-08-14 16:01:29 +02:00
Pierre Bourdon 580fe12c5b Zelda HLE: Implement HQ AFC samples decoding. 2015-08-14 16:01:28 +02:00
Pierre Bourdon 33c29d8aab ZeldaHLE: fix windows build again 2015-08-14 16:01:28 +02:00
Pierre Bourdon b62f1ed453 ZeldaHLE: fix windows build 2015-08-14 16:01:28 +02:00
Pierre Bourdon e35b83fabf ZeldaHLE: Implement more infrastructure and one sample source.
Now renders some of the cutscene audio in Zelda TWW. Most of the work around
sample sources is in a good enough state, even though it is still missing
features like Dolby mixing, IIR, etc.
2015-08-14 16:01:28 +02:00
Pierre Bourdon d9188f1245 Zelda HLE: Rewrite the control flow.
Now accurate control flow for DAC. Voice rendering is not implemented yet, but
framing seems correct. Not expected to work for anything than DAC UCode games.
2015-08-14 16:01:28 +02:00
Pierre Bourdon d5e177d3f9 INIT UCode: reduce DSP initialization time
Push the mail at UCode boot time, not after the first update. This avoids a lot
of crazy busy-looping on the CPU side while waiting for the DSP to be
initialized.
2015-08-14 16:01:28 +02:00
Pierre Bourdon a770cc0778 DSPHLE MailHandler: Synchronize reads and interrupts
This change is meant to solve the following problem: how to translate the
following snippet to DSPHLE:
    SendInterruptAndWaitRead(MAIL_A);
    SendAndWaitRead(MAIL_B);

    SendInterruptAndWaitRead(MAIL_C);

This should cause the following actions on the CPU side:
    ---> Woken up by interrupt
    Reads MAIL_A
    Reads MAIL_B
    <--- Exits interrupt handler

    ---> Woken up by interrupt
    Reads MAIL_C
    <---

But with the current DSPHLE mail support, the following would happen because
the "AndWaitRead" part is not supported:
    ---> Woken up by interrupt
    Reads MAIL_A
    Reads MAIL_B
    <--- Exits interrupt handler

    [Never gets the second interrupt since it was triggered at the same time as
    the first one! Misses MAIL_C.]

This changes fixes the issue by storing two values in the mail queue on the DSP
side: the value of the mail itself, and whether a read of that mail should
trigger a DSP interrupt. If nothing is in the queue yet and an interrupt is
requested, just trigger the interrupt. In the present example, the queue will
look like this:
    Mail value       Interrupt requested
     MAIL_A                  No           <-- Interrupt was triggered when
                                              pushing the mail to the queue.
     MAIL_B                  Yes
     MAIL_C                  No

When the CPU will read MAIL_B, this will cause MailHandler to trigger the
interrupt, which will be handled by the CPU when coming back from the exception
handler. MAIL_C is then successfully read.
2015-08-14 16:01:27 +02:00
Pierre Bourdon 8f3302419b ZeldaHLE: Rip out more code, only keep normal version support and one CRC 2015-08-14 15:21:08 +02:00
Pierre Bourdon 22ec258194 ZeldaHLE: Rip out the whole voice processing code. Still boots games, but no sound at all. 2015-08-14 15:20:29 +02:00
Pierre Bourdon a92727e862 DSPHLE: Add a config parameter to dump UCode to disk 2015-08-14 15:19:57 +02:00
degasus fc23380f6b JitArm64: Implement dcbt
This is a 1:1 copy&paste from Jit64.
2015-08-14 14:47:00 +02:00
Tillmann Karras f9129c0e08 Jit64: use BMI1's ANDN for andcx 2015-08-14 05:51:31 +02:00
zeroZshadow 8925b828aa Ignore all writes to BBA_TXFIFOCNT 2015-08-13 22:45:29 +02:00
zeroZshadow 798365846d Improve TAP_Win32 error logging 2015-08-13 18:25:17 +02:00
degasus 4ef2962055 JitArm64: optimize addzex
So on the general case, we don't need a tempory register.
2015-08-13 13:40:53 +02:00
degasus f7fa22a053 JitArm64: fix addzex
CMP don't update the carry flag, so we have to use an addition.
2015-08-13 13:36:21 +02:00
degasus de3ce74b48 JitArm64: disable addzex 2015-08-13 12:22:48 +02:00
degasus b9f5bfb2bd JitArm64: zero extend RC for cmpli
Patch written by HdkR
2015-08-13 12:22:48 +02:00
Markus Wick 4c5fec4772 Merge pull request #2838 from Sonicadvance1/fix_gles_xfb
[GLES] Fix real XFB.
2015-08-13 08:29:42 +02:00
Ryan Houdek c80e3089c8 [GLES] Fix real XFB.
GLES doesn't support the BGRA texture format type, just use RGBA.
2015-08-12 17:32:05 -05:00
Markus Wick 40818c4aad Merge pull request #2835 from degasus/master
Wiimotes: Initialize all atomic<bool> globally.
2015-08-12 21:14:04 +02:00
Ryan Houdek bb39ba1f3a [AArch64] Banish slowmem operations to farcode.
This improves performance pretty much across the board for games.
The increase in performance is mainly from removing some code from the main JIT blocks of code (pushing and popping millions of registers) and
throwing them in farcode where it doesn't pollute the icache.
2015-08-12 13:57:09 -05:00
Ryan Houdek d5c99a5b48 Add support for a CodeBlock holding a child.
This is required to make sure two code spaces are relatively close to one another.
In this case I need the AArch64 JIT codespace and its farcode space to be within 128MB of one another for branches.
2015-08-12 12:57:06 -05:00
shuffle2 90e05f7bea Merge pull request #2832 from zeroZshadow/master
Properly scan for OpenVPN TAP adapters
2015-08-12 10:56:50 -07:00
Rohit Nirmal 703892e845 Fix building with PCH disabled. 2015-08-12 12:01:17 -05:00
degasus 6b9eba5761 Wiimotes: Initialize all atomic<bool> globally.
This fixes an issue with broken real wiimotes on linux.
2015-08-12 18:39:38 +02:00
Lioncash 2c3025e8af Merge pull request #2822 from aserna3/master
Specified the type of AA in OGL AA settings
2015-08-12 01:35:22 -04:00
Jeffrey Pfau adf6e46200 DolphinWX: Ensure TASInputDlg only gets modified on the main thread 2015-08-11 22:05:18 -07:00
zeroZshadow 7ed894484e Added for loop end condition 2015-08-12 01:18:27 +02:00
zeroZshadow 8e33891593 Properly scan for OpenVPN TAP adapters
Handle errors correctly in SendFrame
2015-08-11 23:34:49 +02:00
Moncef Mechri 333f998123 Don't busy wait in the audio thread (ALSA)
When the emulation is paused and the ALSA backend is used, make the audio
thread wait on a condition variable instead of busy-waiting. This commit
fixes bug #7729

Since the ALSA API is not thread-safe, calls to snd_pcm_drop() and snd_pcm_prepare()
in AlsaSound::Clear() are protected by the same mutex as the condition variable in AlsaSound::SoundLoop()
to make sure that we do not call these functions while a call to
snd_pcm_writei() is ongoing.
2015-08-11 03:54:54 +02:00
Moncef Mechri a0c5247743 Initialize ALSA before starting the audio thread
This fixes a race condition:

Before this commit, there was a race condition when starting a game:

Core::EmuThread(), after having started (but not necessarily completed)
the initialization of the audio thread, calls Core::SetState() which calls
CCPU::EnableStepping(), which in turns calls AudioCommon::ClearAudioBuffer().

This means that SoundStream::Clear() can be called before
AlsaSound::AlsaInit() has completed.
2015-08-11 03:54:54 +02:00
Lioncash 144ea9f4aa Arm64Emitter: Fix encoding of '2-reg misc' variant of FCMEQ 2015-08-10 19:48:36 -04:00
Tillmann Karras 0e725c0860 USBGecko: don't needlessly call StringFromFormat() 2015-08-10 12:33:49 +02:00
Markus Wick e297e3e666 Merge pull request #2825 from lioncash/log
AudioCommon: Log to AUDIO, not DSPHLE
2015-08-10 10:25:51 +02:00
Moncef Mechri 8b767a1189 Use dummy audio backend if the selected backend fails to start
If the selected audio backend fails to Start() (which could happen for
example if there is no audio device), we currently still use the backend
anyway. This can lead to crashes on some platforms (such as Windows) and
is outright wrong anyway.

This commit fallbacks to the Null audio backend if the selected backend
couldn't be started.

This fixes bug #6001
2015-08-10 03:46:45 +02:00
Lioncash 4c6930d36c AudioCommon: Remove unused code from XAudio streams 2015-08-09 21:37:34 -04:00
Lioncash 3f78d74fc1 AudioCommon: Log to AUDIO, not DSPHLE
This code is not related to DSPHLE.
2015-08-09 21:36:03 -04:00
Ryan Houdek cf22d32d0c [AArch64] Don't do an unnecessary 128bit REV64 operation.
We are only using the lower 64bits here, no need to do the full quad register.
2015-08-09 14:56:52 -05:00
Ryan Houdek 922d476dab [AArch64] Fix FCMGE instruction encoding.
Fixes a crash when ps_sel is used (PSO 1&2 intro movies).
2015-08-09 14:54:55 -05:00
Anthony Serna ca250f6b71 Specified the type of AA in OGL AA settings 2015-08-09 09:59:20 -07:00
Lioncash ccca2982df Merge pull request #2819 from degasus/fix
PPCAnalyst: Mark function as static
2015-08-09 10:09:15 -04:00
degasus bceab37801 PPCAnalyst: Mark function as static 2015-08-09 11:15:44 +02:00
Markus Wick 68a54daec3 Merge pull request #2817 from comex/clientca-typo
Forgot to add a slash in one bit of code I switched from D_WIIUSER_IDX to D_SESSION_WIIROOT_IDX.
2015-08-09 11:08:54 +02:00
flacs 6f2400ebc0 Merge pull request #2807 from aserna3/master
Removed audio shortcut from toolbar
2015-08-09 07:55:37 +02:00
comex e20db1b2e3 Forgot to add a slash in one bit of code I switched from D_WIIUSER_IDX to D_SESSION_WIIROOT_IDX.
Fix that.
2015-08-08 23:16:29 -04:00
Lioncash a488ab7a70 Merge pull request #2811 from Sonicadvance1/interpreter_dump
On unknown_instruction dump the full guest GPR state.
2015-08-08 14:57:06 -04:00
Tillmann Karras 145494144c Jit64: duplicate fres result into ps1
And since frD is completely overwritten now, avoid loading it at all.
2015-08-08 06:17:47 +02:00
Ryan Houdek 14a0b01854 Merge pull request #2812 from Tilka/typos
Gekko: fix typos in HID2
2015-08-07 10:56:22 -05:00
Markus Wick 59e48e0fcf Merge pull request #2801 from Tilka/stuff
x64Emitter: add MOVSLDUP/MOVSHDUP
2015-08-07 10:37:38 +02:00