Implement PI_RESET_CODE resetting DI

This commit is contained in:
Pokechu22 2020-04-13 16:37:02 -07:00
parent b8715b42d2
commit 9a8d426645
1 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#include "Common/CommonTypes.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
#include "Core/HW/DVD/DVDInterface.h"
#include "Core/HW/MMIO.h"
#include "Core/HW/SystemTimers.h"
#include "Core/IOS/IOS.h"
@ -111,8 +112,18 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
MMIO::ComplexWrite<u32>(
[](u32, u32 val) { WARN_LOG(PROCESSORINTERFACE, "Fifo reset (%08x)", val); }));
mmio->Register(base | PI_RESET_CODE, MMIO::DirectRead<u32>(&m_ResetCode),
MMIO::DirectWrite<u32>(&m_ResetCode));
mmio->Register(base | PI_RESET_CODE, MMIO::ComplexRead<u32>([](u32) {
DEBUG_LOG(PROCESSORINTERFACE, "Read PI_RESET_CODE: %08x", m_ResetCode);
return m_ResetCode;
}),
MMIO::ComplexWrite<u32>([](u32, u32 val) {
m_ResetCode = val;
INFO_LOG(PROCESSORINTERFACE, "Wrote PI_RESET_CODE: %08x", m_ResetCode);
if (~m_ResetCode & 0x4)
{
DVDInterface::ResetDrive(true);
}
}));
mmio->Register(base | PI_FLIPPER_REV, MMIO::DirectRead<u32>(&m_FlipperRev),
MMIO::InvalidWrite<u32>());