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

Method IORead

source/Debugger/BreakpointCard.cpp:102–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102BYTE __stdcall BreakpointCard::IORead(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles)
103{
104 const UINT slot = ((addr & 0xff) >> 4) - 8;
105 BreakpointCard* pCard = (BreakpointCard*)MemGetSlotParameters(slot);
106
107 CpuIrqDeassert(IS_BREAKPOINTCARD);
108
109 const BYTE reg = addr & 0xf;
110 if (reg == 0)
111 {
112 uint8_t otherStatus = pCard->m_BP_FIFO.empty() ? kEmpty : 0;
113 return pCard->m_status | otherStatus;
114 }
115 else if (reg == 1) // Cmd: Reset
116 {
117 pCard->ResetState();
118 }
119 else if (reg == 2) // Cmd: Intercept BP by card
120 {
121 pCard->m_interceptBPByCard = true;
122 InterceptBreakpoints(slot, BreakpointCard::CbFunction);
123 }
124 else if (reg == 3) // Cmd: Intercept BP by debugger
125 {
126 pCard->m_interceptBPByCard = false;
127 InterceptBreakpoints(slot, nullptr);
128 }
129
130 return addr & 0x0f; // ID bytes [$01-$0F]
131}
132
133BYTE __stdcall BreakpointCard::IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles)
134{

Callers

nothing calls this directly

Calls 4

MemGetSlotParametersFunction · 0.85
CpuIrqDeassertFunction · 0.85
InterceptBreakpointsFunction · 0.85
ResetStateMethod · 0.45

Tested by

no test coverage detected