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

Function IORead_C06x

source/Memory.cpp:721–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719//-------------------------------------
720
721static BYTE __stdcall IORead_C06x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
722{
723 switch (addr & 0x7) // address bit 4 is ignored (UTAIIe:7-5)
724 {
725 case 0x0: return TapeRead(pc, addr, bWrite, d, nExecutedCycles); //$C060 TAPEIN
726 case 0x1: return JoyReadButton(pc, addr, bWrite, d, nExecutedCycles); //$C061 Digital input 0 (If bit 7=1 then JoyButton 0 or OpenApple is pressed)
727 case 0x2: return JoyReadButton(pc, addr, bWrite, d, nExecutedCycles); //$C062 Digital input 1 (If bit 7=1 then JoyButton 1 or ClosedApple is pressed)
728 case 0x3: return JoyReadButton(pc, addr, bWrite, d, nExecutedCycles); //$C063 Digital input 2
729 case 0x4: return JoyReadPosition(pc, addr, bWrite, d, nExecutedCycles); //$C064 Analog input 0
730 case 0x5: return JoyReadPosition(pc, addr, bWrite, d, nExecutedCycles); //$C065 Analog input 1
731 case 0x6: return JoyReadPosition(pc, addr, bWrite, d, nExecutedCycles); //$C066 Analog input 2
732 case 0x7: return JoyReadPosition(pc, addr, bWrite, d, nExecutedCycles); //$C067 Analog input 3
733 }
734
735 return 0;
736}
737
738static BYTE __stdcall IOWrite_C06x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
739{

Callers

nothing calls this directly

Calls 3

TapeReadFunction · 0.85
JoyReadButtonFunction · 0.85
JoyReadPositionFunction · 0.85

Tested by

no test coverage detected