BYTE __stdcall TapeRead (WORD, WORD address, BYTE, BYTE, ULONG nCyclesLeft) { /* If retrieving KeybGetKeycode(); causes problems CurrentKestroke shall be added in the submission variables and it shall be added by the TapeRead caller i.e. BYTE __stdcall TapeRead (WORD, WORD address, BYTE, BYTE, ULONG nCyclesLeft) shall become BYTE __stdcall TapeRead (WORD, WORD address, BYTE, BYTE, ULONG nCyclesLeft, byte CurrentKeystroke) */ static byte CurrentKestroke = 0; CurrentKestroke = KeybGetKeycode(); if (g_Apple2Type == A2TYPE_PRAVETS8A ) { C060= MemReadFloatingBus(nCyclesLeft); //IO_Null(pc, addr, bWrite, d, nCyclesLeft); if (CapsLockAllowed) //8bit keyboard mode { if (((P8CAPS_ON == false) && (P8Shift == false)) || ((P8CAPS_ON ) && (P8Shift ))) //LowerCase if ((CurrentKestroke<65) //|| ((CurrentKestroke>90) && (CurrentKestroke<96)) || ((CurrentKestroke>126) && (CurrentKestroke<193))) C060 |= 1 << 7; //Sets bit 7 to 1 for special keys (arrows, return, etc) and for control+ key combinations. else C060 &= 127; //sets bit 7 to 0 else //UpperCase C060 |= 1 << 7; } else //7bit keyboard mode { C060 &= 191; //Sets bit 6 to 0; I am not sure if this shall be done, because its value is disregarded in this case. C060 |= 1 << 7; //Sets bit 7 to 1 } return C060; } else return MemReadFloatingBus(nCyclesLeft); //IO_Null(pc, addr, bWrite, d, nCyclesLeft); }
// Called by emulation code when Speaker I/O reg is accessed BYTE SpkrToggle (WORD, WORD, BYTE, BYTE, ULONG nCyclesLeft) { g_bSpkrToggleFlag = true; if(!g_bFullSpeed) Spkr_SetActive(true); needsprecision = cumulativecycles; // ? // if (extbench) // { // DisplayBenchmarkResults(); // extbench = 0; // } if (soundtype == SOUND_WAVE) { CpuCalcCycles(nCyclesLeft); UpdateSpkr(); g_nSpeakerData = ~g_nSpeakerData; } return MemReadFloatingBus(nCyclesLeft); // reading from $C030..$C03F retrurns unpredictable value? }
BYTE __stdcall IO_Null(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCyclesLeft) { if (!write) return MemReadFloatingBus(nCyclesLeft); else return 0; }
BYTE __stdcall TapeRead(WORD, WORD address, BYTE, BYTE, ULONG nCyclesLeft) { /* If retrieving KeybGetKeycode(); causes problems uCurrentKeystroke shall be added in the submission variables and it shall be added by the TapeRead caller i.e. BYTE __stdcall TapeRead (WORD, WORD address, BYTE, BYTE, ULONG nCyclesLeft) shall become BYTE __stdcall TapeRead (WORD, WORD address, BYTE, BYTE, ULONG nCyclesLeft, BYTE uCurrentKeystroke) */ if (g_Apple2Type == A2TYPE_PRAVETS8A) { const BYTE uCurrentKeystroke = KeybGetKeycode(); BYTE C060 = MemReadFloatingBus(nCyclesLeft); if (g_CapsLockAllowed) //8bit keyboard mode { if (((P8CAPS_ON == false) && (P8Shift == false)) || ((P8CAPS_ON ) && (P8Shift ))) //LowerCase { if ((uCurrentKeystroke<65) //|| ((uCurrentKeystroke>90) && (uCurrentKeystroke<96)) || ((uCurrentKeystroke>126) && (uCurrentKeystroke<193))) C060 |= 1 << 7; //Sets bit 7 to 1 for special keys (arrows, return, etc) and for control+ key combinations. else C060 &= 127; //sets bit 7 to 0 } else //UpperCase { C060 |= 1 << 7; } } else //7bit keyboard mode { C060 &= 191; //Sets bit 6 to 0; I am not sure if this shall be done, because its value is disregarded in this case. C060 |= 1 << 7; //Sets bit 7 to 1 } return C060; } return (1<<7) | (MemReadFloatingBus(nCyclesLeft) & 0x7F); // Keep high-bit fixed (since TAPEIN isn't supported) }
BYTE __stdcall IO_Annunciator(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCyclesLeft) { // Apple//e ROM: // . PC=FA6F: LDA $C058 (SETAN0) // . PC=FA72: LDA $C05A (SETAN1) // . PC=C2B5: LDA $C05D (CLRAN2) // NB. AN3: For //e & //c these locations are now used to enabled/disabled DHIRES if (!write) return MemReadFloatingBus(nCyclesLeft); else return 0; }
/* In case s.o. decides to develop tape device emulation, this function may be renamed, because tape is not written in $C060 */ BYTE __stdcall TapeWrite(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCyclesLeft) { if (g_Apple2Type == A2TYPE_PRAVETS8A) { if (value & 1) g_CapsLockAllowed = true; else g_CapsLockAllowed = false; //If bit0 of the input byte is 0, it will forbid 8-bit characters (Default) //If bit0 of the input byte is 1, it will allow 8-bit characters return 0; } return MemReadFloatingBus(nCyclesLeft); }
static BYTE __stdcall DiskControlMotor(WORD, WORD address, BYTE, BYTE, ULONG uExecutedCycles) { floppymotoron = address & 1; CheckSpinning(); return MemReadFloatingBus(1, uExecutedCycles); // TC-TODO: Check b7 always set }