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

Method Multitap

pcsx2/SIO/Sio2.cpp:199–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void Sio2::Multitap()
200{
201 const bool multitapEnabled = EmuConfig.Pad.IsMultitapPortEnabled(this->port);
202
203 // Update the third nibble with which ports have been accessed
204 if (this->CmdStat & CmdStat::ONE_PORT_OPEN)
205 {
206 this->CmdStat &= ~(CmdStat::ONE_PORT_OPEN);
207 this->CmdStat |= CmdStat::TWO_PORTS_OPEN;
208 }
209 else
210 {
211 this->CmdStat |= CmdStat::ONE_PORT_OPEN;
212 }
213
214 // This bit is always set, whether the pad is present or missing
215 this->CmdStat |= CmdStat::NO_DEVICES_MISSING;
216
217 // If the currently accessed multitap is missing, also tick those bits.
218 // MTAPMAN is special though.
219 //
220 // For PADMAN and pads, the bits represented by PORT_1_MISSING and PORT_2_MISSING
221 // are always faithful - suppose your game only opened port 2 for some reason,
222 // then a disconnect value would look like 0x0002D100.
223 //
224 // MTAPMAN however does not check the bit set by 0x00020000. It only checks the bit
225 // set by 0x00010000. So even if port 2 is being addressed, cmd stat should be 0x0001D100
226 // (or 0x0001D200 if there are both ports being accessed in that packet).
227 if (!multitapEnabled)
228 {
229 this->CmdStat |= CmdStat::PORT_1_MISSING;
230 }
231
232 g_MultitapArr.at(this->port).SendToMultitap();
233}
234
235void Sio2::Infrared()
236{

Callers 1

WriteMethod · 0.95

Calls 3

IsMultitapPortEnabledMethod · 0.80
SendToMultitapMethod · 0.80
atMethod · 0.80

Tested by

no test coverage detected