Save state support
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
#include "dma.h"
|
||||
#include "YBaseLib/Log.h"
|
||||
#include "bus.h"
|
||||
#include "common/state_wrapper.h"
|
||||
#include "gpu.h"
|
||||
Log_SetChannel(DMA);
|
||||
|
||||
@ -22,6 +23,22 @@ void DMA::Reset()
|
||||
m_DCIR = 0;
|
||||
}
|
||||
|
||||
bool DMA::DoState(StateWrapper& sw)
|
||||
{
|
||||
for (u32 i = 0; i < NUM_CHANNELS; i++)
|
||||
{
|
||||
ChannelState& cs = m_state[i];
|
||||
sw.Do(&cs.base_address);
|
||||
sw.Do(&cs.block_control.bits);
|
||||
sw.Do(&cs.channel_control.bits);
|
||||
sw.Do(&cs.request);
|
||||
}
|
||||
|
||||
sw.Do(&m_DPCR.bits);
|
||||
sw.Do(&m_DCIR);
|
||||
return !sw.HasError();
|
||||
}
|
||||
|
||||
u32 DMA::ReadRegister(u32 offset)
|
||||
{
|
||||
const u32 channel_index = offset >> 4;
|
||||
|
||||
Reference in New Issue
Block a user