mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-06-27 17:39:41 -06:00
NDMA: fix IRQ in infinite repeat mode
This commit is contained in:
@ -269,11 +269,18 @@ void DSi_NDMA::Run9()
|
|||||||
|
|
||||||
if ((StartMode & 0x1F) == 0x10) // CHECKME
|
if ((StartMode & 0x1F) == 0x10) // CHECKME
|
||||||
{
|
{
|
||||||
|
// no repeat
|
||||||
Cnt &= ~(1<<31);
|
Cnt &= ~(1<<31);
|
||||||
if (Cnt & (1<<30)) DSi.SetIRQ(0, IRQ_DSi_NDMA0 + Num);
|
if (Cnt & (1<<30)) DSi.SetIRQ(0, IRQ_DSi_NDMA0 + Num);
|
||||||
}
|
}
|
||||||
else if (!(Cnt & (1<<29)))
|
else if (Cnt & (1<<29))
|
||||||
{
|
{
|
||||||
|
// repeat infinitely
|
||||||
|
if (Cnt & (1<<30)) DSi.SetIRQ(0, IRQ_DSi_NDMA0 + Num);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// repeat until total count is reached
|
||||||
if (TotalRemCount == 0)
|
if (TotalRemCount == 0)
|
||||||
{
|
{
|
||||||
Cnt &= ~(1<<31);
|
Cnt &= ~(1<<31);
|
||||||
@ -358,11 +365,18 @@ void DSi_NDMA::Run7()
|
|||||||
|
|
||||||
if ((StartMode & 0x1F) == 0x10) // CHECKME
|
if ((StartMode & 0x1F) == 0x10) // CHECKME
|
||||||
{
|
{
|
||||||
|
// no repeat
|
||||||
Cnt &= ~(1<<31);
|
Cnt &= ~(1<<31);
|
||||||
if (Cnt & (1<<30)) DSi.SetIRQ(1, IRQ_DSi_NDMA0 + Num);
|
if (Cnt & (1<<30)) DSi.SetIRQ(1, IRQ_DSi_NDMA0 + Num);
|
||||||
}
|
}
|
||||||
else if (!(Cnt & (1<<29)))
|
else if (Cnt & (1<<29))
|
||||||
{
|
{
|
||||||
|
// repeat infinitely
|
||||||
|
if (Cnt & (1<<30)) DSi.SetIRQ(1, IRQ_DSi_NDMA0 + Num);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// repeat until total count is reached
|
||||||
if (TotalRemCount == 0)
|
if (TotalRemCount == 0)
|
||||||
{
|
{
|
||||||
Cnt &= ~(1<<31);
|
Cnt &= ~(1<<31);
|
||||||
|
Reference in New Issue
Block a user