mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 07:10:00 -06:00
add NDMA start mode 0x0A (AES input FIFO)
This commit is contained in:
@ -191,6 +191,8 @@ void WriteCnt(u32 val)
|
||||
{
|
||||
// transfer start (checkme)
|
||||
RemBlocks = BlkCnt >> 16;
|
||||
|
||||
DSi::CheckNDMAs(1, 0x2A);
|
||||
}
|
||||
|
||||
printf("AES CNT: %08X / mode=%d inDMA=%d outDMA=%d blocks=%d\n",
|
||||
@ -204,7 +206,8 @@ void WriteBlkCnt(u32 val)
|
||||
|
||||
u32 ReadOutputFIFO()
|
||||
{
|
||||
return OutputFIFO->Read();
|
||||
u32 ret = OutputFIFO->Read();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void WriteInputFIFO(u32 val)
|
||||
@ -234,17 +237,30 @@ void WriteInputFIFO(u32 val)
|
||||
|
||||
if (OutputFIFO->Level() >= OutputDMASize)
|
||||
{
|
||||
// trigger DMA
|
||||
// trigger output DMA
|
||||
DSi::CheckNDMAs(1, 0x2B);
|
||||
}
|
||||
// TODO: DMA the other way around
|
||||
|
||||
if (RemBlocks == 0)
|
||||
{
|
||||
Cnt &= ~(1<<31);
|
||||
if (Cnt & (1<<30)) NDS::SetIRQ2(NDS::IRQ2_DSi_AES);
|
||||
DSi::StopNDMAs(1, 0x2A);
|
||||
DSi::StopNDMAs(1, 0x2B);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckInputDMA();
|
||||
}
|
||||
}
|
||||
|
||||
void CheckInputDMA()
|
||||
{
|
||||
if (InputFIFO->Level() < InputDMASize)
|
||||
{
|
||||
// trigger input DMA
|
||||
DSi::CheckNDMAs(1, 0x2A);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user