dolphin/Source
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
..
Android Android: Remove "fitSystemWindows" flag from MainActivity layout 2015-08-06 08:34:21 -04:00
Core DSPHLE MailHandler: Synchronize reads and interrupts 2015-08-14 16:01:27 +02:00
DSPSpy DSPSpy: support dumping to SD Gecko in slot B on GameCube 2015-07-19 17:26:30 +03:00
DSPTool Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
PCH Add missing license headers 2015-05-25 13:11:47 +02:00
UnitTests x64Emitter: add MOVSLDUP/MOVSHDUP 2015-08-06 10:39:43 +02:00
VSProps Base.props: Remove DXSDK_DIR from the include path. 2015-04-13 21:44:40 +02:00
.clang-format UseTab: ForIndentation 2014-05-26 21:28:59 -07:00
CMakeLists.txt Windows: Use a shared precompiled header for dolphin code under Source/ 2014-08-14 23:51:13 -07:00
dolphin-emu.sln remove win32/mixed project configurations. 2015-03-14 14:07:21 -07:00