MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / IORead

Method IORead

source/SNESMAX.cpp:80–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78};
79
80BYTE __stdcall SNESMAXCard::IORead(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles)
81{
82 const UINT slot = ((addr & 0xff) >> 4) - 8;
83 SNESMAXCard* pCard = (SNESMAXCard*)MemGetSlotParameters(slot);
84
85 BYTE output = MemReadFloatingBus(nExecutedCycles);
86
87 switch (addr & 0xF)
88 {
89 case 0:
90 output = (output & 0x3F) | ((pCard->m_controller2Buttons & 0x1) << 6) | ((pCard->m_controller1Buttons & 0x1) << 7);
91 break;
92 default:
93 break;
94 }
95 return output;
96}
97
98BYTE __stdcall SNESMAXCard::IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles)
99{

Callers

nothing calls this directly

Calls 2

MemGetSlotParametersFunction · 0.85
MemReadFloatingBusFunction · 0.70

Tested by

no test coverage detected