MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / Select

Method Select

pcsx2/SIO/Multitap/MultitapProtocol.cpp:41–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void MultitapProtocol::Select(MultitapMode mode)
42{
43 MT_LOG.WriteLn("%s", __FUNCTION__);
44
45 if (EmuConfig.Pad.IsMultitapPortEnabled(g_Sio2.port))
46 {
47 const u8 newSlot = g_Sio2FifoIn.front();
48 g_Sio2FifoIn.pop_front();
49 const bool isInBounds = (newSlot < SIO::SLOTS);
50
51 if (isInBounds)
52 {
53 switch (mode)
54 {
55 case MultitapMode::SELECT_PAD:
56 this->currentPadSlot = newSlot;
57 break;
58 case MultitapMode::SELECT_MEMCARD:
59 this->currentMemcardSlot = newSlot;
60 break;
61 default:
62 break;
63 }
64
65 MT_LOG.WriteLn("Slot changed to %d", newSlot);
66 }
67
68 g_Sio2FifoOut.push_back(0xff);
69 g_Sio2FifoOut.push_back(0x80);
70 g_Sio2FifoOut.push_back(0x5a);
71 g_Sio2FifoOut.push_back(0x00);
72 g_Sio2FifoOut.push_back(0x00);
73 g_Sio2FifoOut.push_back(isInBounds ? newSlot : 0xff);
74 g_Sio2FifoOut.push_back(isInBounds ? 0x5a : 0x66);
75 }
76 else
77 {
78 g_Sio2FifoOut.push_back(0xff);
79 g_Sio2FifoOut.push_back(0xff);
80 g_Sio2FifoOut.push_back(0xff);
81 g_Sio2FifoOut.push_back(0xff);
82 g_Sio2FifoOut.push_back(0xff);
83 g_Sio2FifoOut.push_back(0xff);
84 g_Sio2FifoOut.push_back(0xff);
85 }
86}
87
88MultitapProtocol::MultitapProtocol() = default;
89MultitapProtocol::~MultitapProtocol() = default;

Callers

nothing calls this directly

Calls 5

IsMultitapPortEnabledMethod · 0.80
WriteLnMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected