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

Function IORead_C01x

source/Memory.cpp:579–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577//-------------------------------------
578
579static BYTE __stdcall IORead_C01x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
580{
581 if (IS_APPLE2) // Include Pravets machines too?
582 {
583 KeybClearStrobe();
584 return IO_Null(pc, addr, bWrite, d, nExecutedCycles); // GH#1261
585 }
586
587 bool res = false;
588 switch (addr & 0xf)
589 {
590 case 0x0: return KeybReadFlag();
591 case 0x1: res = SW_BANK2 ? true : false; break;
592 case 0x2: res = SW_HIGHRAM ? true : false; break;
593 case 0x3: res = SW_AUXREAD ? true : false; break;
594 case 0x4: res = SW_AUXWRITE ? true : false; break;
595 case 0x5: res = SW_INTCXROM ? true : false; break;
596 case 0x6: res = SW_ALTZP ? true : false; break;
597 case 0x7: res = SW_SLOTC3ROM ? true : false; break;
598 case 0x8: res = SW_80STORE ? true : false; break;
599 case 0x9: res = GetVideo().VideoGetVblBar(nExecutedCycles); break;
600 case 0xA: res = GetVideo().VideoGetSWTEXT(); break;
601 case 0xB: res = GetVideo().VideoGetSWMIXED(); break;
602 case 0xC: res = SW_PAGE2 ? true : false; break;
603 case 0xD: res = GetVideo().VideoGetSWHIRES(); break;
604 case 0xE: res = GetVideo().VideoGetSWAltCharSet(); break;
605 case 0xF: res = GetVideo().VideoGetSW80COL(); break;
606 }
607
608 return KeybGetKeycode() | (res ? 0x80 : 0);
609}
610
611static BYTE __stdcall IOWrite_C01x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles)
612{

Callers

nothing calls this directly

Calls 10

KeybClearStrobeFunction · 0.85
IO_NullFunction · 0.85
KeybReadFlagFunction · 0.85
KeybGetKeycodeFunction · 0.85
VideoGetVblBarMethod · 0.80
VideoGetSWTEXTMethod · 0.80
VideoGetSWMIXEDMethod · 0.80
VideoGetSWHIRESMethod · 0.80
VideoGetSWAltCharSetMethod · 0.80
VideoGetSW80COLMethod · 0.80

Tested by

no test coverage detected