2019-09-20 06:47:41 +00:00
|
|
|
#include "pad.h"
|
2020-01-10 03:31:12 +00:00
|
|
|
#include "common/log.h"
|
2019-09-20 06:47:41 +00:00
|
|
|
#include "common/state_wrapper.h"
|
2019-12-15 14:05:48 +00:00
|
|
|
#include "controller.h"
|
2019-10-27 06:45:23 +00:00
|
|
|
#include "host_interface.h"
|
2019-09-20 06:47:41 +00:00
|
|
|
#include "interrupt_controller.h"
|
2019-10-27 06:45:23 +00:00
|
|
|
#include "memory_card.h"
|
2019-09-22 15:25:58 +00:00
|
|
|
#include "system.h"
|
2019-09-20 06:47:41 +00:00
|
|
|
Log_SetChannel(Pad);
|
|
|
|
|
|
|
|
Pad::Pad() = default;
|
|
|
|
|
|
|
|
Pad::~Pad() = default;
|
|
|
|
|
2019-11-11 08:19:57 +00:00
|
|
|
void Pad::Initialize(System* system, InterruptController* interrupt_controller)
|
2019-09-20 06:47:41 +00:00
|
|
|
{
|
2019-09-22 15:25:58 +00:00
|
|
|
m_system = system;
|
2019-09-20 06:47:41 +00:00
|
|
|
m_interrupt_controller = interrupt_controller;
|
2020-01-24 04:53:40 +00:00
|
|
|
m_transfer_event = system->CreateTimingEvent("Pad Serial Transfer", 1, 1,
|
|
|
|
std::bind(&Pad::TransferEvent, this, std::placeholders::_2), false);
|
2019-09-20 06:47:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Pad::Reset()
|
|
|
|
{
|
|
|
|
SoftReset();
|
2019-09-29 15:59:35 +00:00
|
|
|
|
|
|
|
for (u32 i = 0; i < NUM_SLOTS; i++)
|
|
|
|
{
|
|
|
|
if (m_controllers[i])
|
|
|
|
m_controllers[i]->Reset();
|
|
|
|
|
|
|
|
if (m_memory_cards[i])
|
|
|
|
m_memory_cards[i]->Reset();
|
|
|
|
}
|
2019-09-20 06:47:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Pad::DoState(StateWrapper& sw)
|
|
|
|
{
|
2019-09-29 15:59:35 +00:00
|
|
|
for (u32 i = 0; i < NUM_SLOTS; i++)
|
|
|
|
{
|
2019-12-15 14:05:48 +00:00
|
|
|
ControllerType controller_type = m_controllers[i] ? m_controllers[i]->GetType() : ControllerType::None;
|
|
|
|
ControllerType state_controller_type = controller_type;
|
|
|
|
sw.Do(&state_controller_type);
|
|
|
|
|
|
|
|
if (controller_type != state_controller_type)
|
2019-09-29 15:59:35 +00:00
|
|
|
{
|
2020-01-10 03:31:12 +00:00
|
|
|
m_system->GetHostInterface()->AddFormattedOSDMessage(
|
|
|
|
2.0f, "Save state contains controller type %s in port %u, but %s is used. Switching.",
|
|
|
|
Settings::GetControllerTypeName(state_controller_type), i, Settings::GetControllerTypeName(controller_type));
|
2019-12-15 14:05:48 +00:00
|
|
|
|
|
|
|
m_controllers[i].reset();
|
|
|
|
if (state_controller_type != ControllerType::None)
|
|
|
|
m_controllers[i] = Controller::Create(state_controller_type);
|
2019-09-30 04:22:30 +00:00
|
|
|
}
|
2019-12-15 14:05:48 +00:00
|
|
|
|
|
|
|
if (m_controllers[i])
|
2019-09-30 04:22:30 +00:00
|
|
|
{
|
2019-12-15 14:05:48 +00:00
|
|
|
if (!sw.DoMarker("Controller") || !m_controllers[i]->DoState(sw))
|
2019-09-30 04:22:30 +00:00
|
|
|
return false;
|
2019-09-29 15:59:35 +00:00
|
|
|
}
|
|
|
|
|
2019-10-27 06:45:23 +00:00
|
|
|
bool card_present = static_cast<bool>(m_memory_cards[i]);
|
|
|
|
sw.Do(&card_present);
|
|
|
|
|
|
|
|
if (card_present && !m_memory_cards[i])
|
|
|
|
{
|
2020-01-10 03:31:12 +00:00
|
|
|
m_system->GetHostInterface()->AddFormattedOSDMessage(
|
|
|
|
2.0f, "Memory card %c present in save state but not in system. Creating temporary card.", 'A' + i);
|
2019-10-27 06:45:23 +00:00
|
|
|
m_memory_cards[i] = MemoryCard::Create(m_system);
|
|
|
|
}
|
|
|
|
else if (!card_present && m_memory_cards[i])
|
|
|
|
{
|
2020-01-10 03:31:12 +00:00
|
|
|
m_system->GetHostInterface()->AddFormattedOSDMessage(
|
|
|
|
2.0f, "Memory card %u present system but not save state. Removing card.", 'A' + i);
|
2019-10-27 06:45:23 +00:00
|
|
|
m_memory_cards[i].reset();
|
|
|
|
}
|
|
|
|
|
2019-09-29 15:59:35 +00:00
|
|
|
if (m_memory_cards[i])
|
|
|
|
{
|
2019-09-30 04:22:30 +00:00
|
|
|
if (!sw.DoMarker("MemoryCard") || !m_memory_cards[i]->DoState(sw))
|
|
|
|
return false;
|
|
|
|
}
|
2019-09-29 15:59:35 +00:00
|
|
|
}
|
|
|
|
|
2019-09-22 15:25:58 +00:00
|
|
|
sw.Do(&m_state);
|
2019-09-20 09:21:45 +00:00
|
|
|
sw.Do(&m_JOY_CTRL.bits);
|
|
|
|
sw.Do(&m_JOY_STAT.bits);
|
|
|
|
sw.Do(&m_JOY_MODE.bits);
|
2019-10-18 13:10:41 +00:00
|
|
|
sw.Do(&m_JOY_BAUD);
|
2019-11-11 15:13:08 +00:00
|
|
|
sw.Do(&m_receive_buffer);
|
|
|
|
sw.Do(&m_transmit_buffer);
|
|
|
|
sw.Do(&m_receive_buffer_full);
|
|
|
|
sw.Do(&m_transmit_buffer_full);
|
2019-12-06 14:02:47 +00:00
|
|
|
|
2020-01-24 04:53:40 +00:00
|
|
|
if (sw.IsReading() && IsTransmitting())
|
|
|
|
m_transfer_event->Activate();
|
|
|
|
|
2019-09-20 06:47:41 +00:00
|
|
|
return !sw.HasError();
|
|
|
|
}
|
|
|
|
|
2019-12-14 13:20:24 +00:00
|
|
|
void Pad::SetController(u32 slot, std::unique_ptr<Controller> dev)
|
|
|
|
{
|
|
|
|
m_controllers[slot] = std::move(dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pad::SetMemoryCard(u32 slot, std::unique_ptr<MemoryCard> dev)
|
|
|
|
{
|
|
|
|
m_memory_cards[slot] = std::move(dev);
|
|
|
|
}
|
|
|
|
|
2019-09-20 06:47:41 +00:00
|
|
|
u32 Pad::ReadRegister(u32 offset)
|
|
|
|
{
|
|
|
|
switch (offset)
|
|
|
|
{
|
|
|
|
case 0x00: // JOY_DATA
|
|
|
|
{
|
2020-01-11 03:29:30 +00:00
|
|
|
const u8 value = m_receive_buffer_full ? m_receive_buffer : 0xFF;
|
|
|
|
Log_DebugPrintf("JOY_DATA (R) -> 0x%02X%s", ZeroExtend32(value), m_receive_buffer_full ? "" : "(EMPTY)");
|
|
|
|
m_receive_buffer_full = false;
|
2019-09-20 06:47:41 +00:00
|
|
|
UpdateJoyStat();
|
2020-01-11 03:29:30 +00:00
|
|
|
|
2019-11-11 15:13:08 +00:00
|
|
|
return (ZeroExtend32(value) | (ZeroExtend32(value) << 8) | (ZeroExtend32(value) << 16) |
|
|
|
|
(ZeroExtend32(value) << 24));
|
2019-09-20 06:47:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case 0x04: // JOY_STAT
|
2019-09-22 15:25:58 +00:00
|
|
|
{
|
|
|
|
const u32 bits = m_JOY_STAT.bits;
|
|
|
|
m_JOY_STAT.ACKINPUT = false;
|
|
|
|
return bits;
|
|
|
|
}
|
2019-09-20 06:47:41 +00:00
|
|
|
|
|
|
|
case 0x08: // JOY_MODE
|
|
|
|
return ZeroExtend32(m_JOY_MODE.bits);
|
|
|
|
|
|
|
|
case 0x0A: // JOY_CTRL
|
|
|
|
return ZeroExtend32(m_JOY_CTRL.bits);
|
|
|
|
|
2019-10-18 13:10:41 +00:00
|
|
|
case 0x0E: // JOY_BAUD
|
|
|
|
return ZeroExtend32(m_JOY_BAUD);
|
|
|
|
|
2019-09-20 06:47:41 +00:00
|
|
|
default:
|
|
|
|
Log_ErrorPrintf("Unknown register read: 0x%X", offset);
|
|
|
|
return UINT32_C(0xFFFFFFFF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pad::WriteRegister(u32 offset, u32 value)
|
|
|
|
{
|
|
|
|
switch (offset)
|
|
|
|
{
|
|
|
|
case 0x00: // JOY_DATA
|
|
|
|
{
|
|
|
|
Log_DebugPrintf("JOY_DATA (W) <- 0x%02X", value);
|
2019-11-11 15:13:08 +00:00
|
|
|
|
|
|
|
if (m_transmit_buffer_full)
|
2019-09-20 06:47:41 +00:00
|
|
|
Log_WarningPrint("TX FIFO overrun");
|
|
|
|
|
2019-11-11 15:13:08 +00:00
|
|
|
m_transmit_buffer = Truncate8(value);
|
|
|
|
m_transmit_buffer_full = true;
|
2019-09-20 06:47:41 +00:00
|
|
|
|
2019-09-22 15:25:58 +00:00
|
|
|
if (!IsTransmitting() && CanTransfer())
|
|
|
|
BeginTransfer();
|
2019-09-20 06:47:41 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x0A: // JOY_CTRL
|
|
|
|
{
|
|
|
|
Log_DebugPrintf("JOY_CTRL <- 0x%04X", value);
|
|
|
|
|
|
|
|
m_JOY_CTRL.bits = Truncate16(value);
|
|
|
|
if (m_JOY_CTRL.RESET)
|
|
|
|
SoftReset();
|
|
|
|
|
|
|
|
if (m_JOY_CTRL.ACK)
|
|
|
|
{
|
|
|
|
// reset stat bits
|
|
|
|
m_JOY_STAT.INTR = false;
|
|
|
|
}
|
|
|
|
|
2019-09-29 15:07:38 +00:00
|
|
|
if (!m_JOY_CTRL.SELECT)
|
|
|
|
ResetDeviceTransferState();
|
|
|
|
|
2019-09-22 15:25:58 +00:00
|
|
|
if (!m_JOY_CTRL.SELECT || !m_JOY_CTRL.TXEN)
|
|
|
|
{
|
|
|
|
if (IsTransmitting())
|
|
|
|
EndTransfer();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!IsTransmitting() && CanTransfer())
|
|
|
|
BeginTransfer();
|
|
|
|
}
|
2019-09-20 06:47:41 +00:00
|
|
|
|
2019-11-11 15:13:08 +00:00
|
|
|
UpdateJoyStat();
|
2019-09-20 06:47:41 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x08: // JOY_MODE
|
|
|
|
{
|
|
|
|
Log_DebugPrintf("JOY_MODE <- 0x%08X", value);
|
|
|
|
m_JOY_MODE.bits = Truncate16(value);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x0E:
|
|
|
|
{
|
2019-10-18 13:10:41 +00:00
|
|
|
Log_DebugPrintf("JOY_BAUD <- 0x%08X", value);
|
2019-10-26 15:52:18 +00:00
|
|
|
m_JOY_BAUD = Truncate16(value);
|
2019-09-20 06:47:41 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
Log_ErrorPrintf("Unknown register write: 0x%X <- 0x%08X", offset, value);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pad::SoftReset()
|
|
|
|
{
|
2019-09-22 15:25:58 +00:00
|
|
|
if (IsTransmitting())
|
|
|
|
EndTransfer();
|
|
|
|
|
2019-09-20 06:47:41 +00:00
|
|
|
m_JOY_CTRL.bits = 0;
|
|
|
|
m_JOY_STAT.bits = 0;
|
|
|
|
m_JOY_MODE.bits = 0;
|
2019-11-11 15:13:08 +00:00
|
|
|
m_receive_buffer = 0;
|
|
|
|
m_receive_buffer_full = false;
|
|
|
|
m_transmit_buffer = 0;
|
|
|
|
m_transmit_buffer_full = false;
|
2019-09-29 15:59:35 +00:00
|
|
|
ResetDeviceTransferState();
|
2019-09-20 06:47:41 +00:00
|
|
|
UpdateJoyStat();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pad::UpdateJoyStat()
|
|
|
|
{
|
2019-11-11 15:13:08 +00:00
|
|
|
m_JOY_STAT.RXFIFONEMPTY = m_receive_buffer_full;
|
2019-12-06 14:02:47 +00:00
|
|
|
m_JOY_STAT.TXDONE = !m_transmit_buffer_full && m_state != State::Transmitting;
|
2019-11-11 15:13:08 +00:00
|
|
|
m_JOY_STAT.TXRDY = !m_transmit_buffer_full;
|
2019-09-20 06:47:41 +00:00
|
|
|
}
|
|
|
|
|
2020-01-24 04:53:40 +00:00
|
|
|
void Pad::TransferEvent(TickCount ticks_late)
|
|
|
|
{
|
|
|
|
if (m_state == State::Transmitting)
|
|
|
|
DoTransfer(ticks_late);
|
|
|
|
else
|
|
|
|
DoACK();
|
|
|
|
}
|
|
|
|
|
2019-09-22 15:25:58 +00:00
|
|
|
void Pad::BeginTransfer()
|
|
|
|
{
|
|
|
|
DebugAssert(m_state == State::Idle && CanTransfer());
|
|
|
|
Log_DebugPrintf("Starting transfer");
|
|
|
|
|
|
|
|
m_JOY_CTRL.RXEN = true;
|
2019-11-11 15:13:08 +00:00
|
|
|
m_transmit_value = m_transmit_buffer;
|
|
|
|
m_transmit_buffer_full = false;
|
2019-09-22 15:25:58 +00:00
|
|
|
|
|
|
|
// The transfer or the interrupt must be delayed, otherwise the BIOS thinks there's no device detected.
|
|
|
|
// It seems to do something resembling the following:
|
|
|
|
// 1) Sets the control register up for transmitting, interrupt on ACK.
|
|
|
|
// 2) Writes 0x01 to the TX FIFO.
|
|
|
|
// 3) Delays for a bit.
|
|
|
|
// 4) Writes ACK to the control register, clearing the interrupt flag.
|
|
|
|
// 5) Clears IRQ7 in the interrupt controller.
|
|
|
|
// 6) Waits until the RX FIFO is not empty, reads the first byte to $zero.
|
|
|
|
// 7) Checks if the interrupt status register had IRQ7 set. If not, no device connected.
|
|
|
|
//
|
|
|
|
// Performing the transfer immediately will result in both the INTR bit and the bit in the interrupt
|
|
|
|
// controller being discarded in (4)/(5), but this bit was set by the *new* transfer. Therefore, the
|
|
|
|
// test in (7) will fail, and it won't send any more data. So, the transfer/interrupt must be delayed
|
|
|
|
// until after (4) and (5) have been completed.
|
|
|
|
|
|
|
|
m_state = State::Transmitting;
|
2020-01-24 04:53:40 +00:00
|
|
|
m_transfer_event->SetPeriodAndSchedule(GetTransferTicks());
|
2019-09-22 15:25:58 +00:00
|
|
|
}
|
|
|
|
|
2020-01-24 04:53:40 +00:00
|
|
|
void Pad::DoTransfer(TickCount ticks_late)
|
2019-09-20 06:47:41 +00:00
|
|
|
{
|
|
|
|
Log_DebugPrintf("Transferring slot %d", m_JOY_CTRL.SLOT.GetValue());
|
|
|
|
|
2019-12-14 13:20:24 +00:00
|
|
|
Controller* const controller = m_controllers[m_JOY_CTRL.SLOT].get();
|
|
|
|
MemoryCard* const memory_card = m_memory_cards[m_JOY_CTRL.SLOT].get();
|
2019-09-20 06:47:41 +00:00
|
|
|
|
2019-09-22 15:25:58 +00:00
|
|
|
// set rx?
|
|
|
|
m_JOY_CTRL.RXEN = true;
|
|
|
|
|
2019-11-11 15:13:08 +00:00
|
|
|
const u8 data_out = m_transmit_value;
|
|
|
|
|
2019-09-29 15:07:38 +00:00
|
|
|
u8 data_in = 0xFF;
|
|
|
|
bool ack = false;
|
|
|
|
|
|
|
|
switch (m_active_device)
|
|
|
|
{
|
|
|
|
case ActiveDevice::None:
|
|
|
|
{
|
2019-10-26 15:52:18 +00:00
|
|
|
if (!controller || (ack = controller->Transfer(data_out, &data_in)) == false)
|
2019-09-29 15:07:38 +00:00
|
|
|
{
|
2019-10-26 15:52:18 +00:00
|
|
|
if (!memory_card || (ack = memory_card->Transfer(data_out, &data_in)) == false)
|
2019-09-29 15:07:38 +00:00
|
|
|
{
|
|
|
|
// nothing connected to this port
|
2019-11-11 15:13:08 +00:00
|
|
|
Log_TracePrintf("Nothing connected or ACK'ed");
|
2019-09-29 15:07:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// memory card responded, make it the active device until non-ack
|
2019-11-11 15:13:08 +00:00
|
|
|
Log_TracePrintf("Transfer to memory card, data_out=0x%02X, data_in=0x%02X", data_out, data_in);
|
2019-09-29 15:07:38 +00:00
|
|
|
m_active_device = ActiveDevice::MemoryCard;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// controller responded, make it the active device until non-ack
|
2019-11-11 15:13:08 +00:00
|
|
|
Log_TracePrintf("Transfer to controller, data_out=0x%02X, data_in=0x%02X", data_out, data_in);
|
2019-09-29 15:07:38 +00:00
|
|
|
m_active_device = ActiveDevice::Controller;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ActiveDevice::Controller:
|
|
|
|
{
|
|
|
|
if (controller)
|
2019-11-11 15:13:08 +00:00
|
|
|
{
|
2019-09-29 15:07:38 +00:00
|
|
|
ack = controller->Transfer(data_out, &data_in);
|
2019-11-11 15:13:08 +00:00
|
|
|
Log_TracePrintf("Transfer to controller, data_out=0x%02X, data_in=0x%02X", data_out, data_in);
|
|
|
|
}
|
2019-09-29 15:07:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ActiveDevice::MemoryCard:
|
|
|
|
{
|
|
|
|
if (memory_card)
|
2019-11-11 15:13:08 +00:00
|
|
|
{
|
2019-09-29 15:07:38 +00:00
|
|
|
ack = memory_card->Transfer(data_out, &data_in);
|
2019-11-11 15:13:08 +00:00
|
|
|
Log_TracePrintf("Transfer to memory card, data_out=0x%02X, data_in=0x%02X", data_out, data_in);
|
|
|
|
}
|
2019-09-29 15:07:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-11-11 15:13:08 +00:00
|
|
|
m_receive_buffer = data_in;
|
|
|
|
m_receive_buffer_full = true;
|
2019-09-29 15:07:38 +00:00
|
|
|
|
|
|
|
// device no longer active?
|
|
|
|
if (!ack)
|
2019-12-05 13:03:54 +00:00
|
|
|
{
|
2019-09-29 15:07:38 +00:00
|
|
|
m_active_device = ActiveDevice::None;
|
2019-12-05 13:03:54 +00:00
|
|
|
EndTransfer();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const TickCount ack_timer = GetACKTicks();
|
|
|
|
Log_DebugPrintf("Delaying ACK for %d ticks", ack_timer);
|
|
|
|
m_state = State::WaitingForACK;
|
2020-01-24 04:53:40 +00:00
|
|
|
if (ticks_late >= ack_timer)
|
2019-12-05 13:03:54 +00:00
|
|
|
DoACK();
|
|
|
|
else
|
2020-01-24 04:53:40 +00:00
|
|
|
m_transfer_event->SetPeriodAndSchedule(ack_timer - ticks_late);
|
2019-12-05 13:03:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
UpdateJoyStat();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Pad::DoACK()
|
|
|
|
{
|
|
|
|
m_JOY_STAT.ACKINPUT = true;
|
2019-09-20 06:47:41 +00:00
|
|
|
|
2019-12-05 13:03:54 +00:00
|
|
|
if (m_JOY_CTRL.ACKINTEN)
|
2019-09-20 06:47:41 +00:00
|
|
|
{
|
2019-12-05 13:03:54 +00:00
|
|
|
Log_DebugPrintf("Triggering ACK interrupt");
|
2019-09-20 06:47:41 +00:00
|
|
|
m_JOY_STAT.INTR = true;
|
|
|
|
m_interrupt_controller->InterruptRequest(InterruptController::IRQ::IRQ7);
|
|
|
|
}
|
|
|
|
|
2019-11-11 15:13:08 +00:00
|
|
|
EndTransfer();
|
2019-12-06 14:02:47 +00:00
|
|
|
UpdateJoyStat();
|
2019-12-05 13:03:54 +00:00
|
|
|
|
|
|
|
if (CanTransfer())
|
|
|
|
BeginTransfer();
|
2019-09-20 06:47:41 +00:00
|
|
|
}
|
2019-09-22 15:25:58 +00:00
|
|
|
|
|
|
|
void Pad::EndTransfer()
|
|
|
|
{
|
2019-12-05 13:03:54 +00:00
|
|
|
DebugAssert(m_state == State::Transmitting || m_state == State::WaitingForACK);
|
2019-09-22 15:25:58 +00:00
|
|
|
Log_DebugPrintf("Ending transfer");
|
|
|
|
|
|
|
|
m_state = State::Idle;
|
2020-01-24 04:53:40 +00:00
|
|
|
m_transfer_event->Deactivate();
|
2019-09-22 15:25:58 +00:00
|
|
|
}
|
2019-09-29 15:07:38 +00:00
|
|
|
|
|
|
|
void Pad::ResetDeviceTransferState()
|
|
|
|
{
|
|
|
|
for (u32 i = 0; i < NUM_SLOTS; i++)
|
|
|
|
{
|
|
|
|
if (m_controllers[i])
|
|
|
|
m_controllers[i]->ResetTransferState();
|
|
|
|
if (m_memory_cards[i])
|
|
|
|
m_memory_cards[i]->ResetTransferState();
|
2019-09-30 04:22:30 +00:00
|
|
|
|
|
|
|
m_active_device = ActiveDevice::None;
|
2019-09-29 15:07:38 +00:00
|
|
|
}
|
|
|
|
}
|