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

Function LogFileTimeUntilFirstKeyRead

source/Core.cpp:152–168  ·  view source on GitHub ↗

Log the time from emulation restart/reboot until the first key read: BIT $C000 . AZTEC.DSK (DOS 3.3) does prior LDY $C000 reads, but the BIT $C000 is at the "Press any key" message . Phasor1.dsk / ProDOS 1.1.1: PC=E797: B1 50: LDA ($50),Y / "Select an Option:" message . Rescue Raiders v1.3,v1.5: PC=895: LDA $C000 / boot to intro

Source from the content-addressed store, hash-verified

150// . Phasor1.dsk / ProDOS 1.1.1: PC=E797: B1 50: LDA ($50),Y / "Select an Option:" message
151// . Rescue Raiders v1.3,v1.5: PC=895: LDA $C000 / boot to intro
152void LogFileTimeUntilFirstKeyRead(void)
153{
154 if (!g_fh || bLogKeyReadDone)
155 return;
156
157 if ( (ReadByteFromMemory(regs.pc-3) != 0x2C) // AZTEC: bit $c000
158 && !((regs.pc-2) == 0xE797 && ReadByteFromMemory(regs.pc-2) == 0xB1 && ReadByteFromMemory(regs.pc-1) == 0x50) // Phasor1: lda ($50),y
159 && !((regs.pc-3) == 0x0895 && ReadByteFromMemory(regs.pc-3) == 0xAD) // Rescue Raiders v1.3,v1.5: lda $c000
160 )
161 return;
162
163 uint32_t dwTime = GetTickCount() - dwLogKeyReadTickStart;
164
165 LogFileOutput("Time from emulation reboot until first $C000 access: %d msec\n", dwTime);
166
167 bLogKeyReadDone = true;
168}
169
170//---------------------------------------------------------------------------
171

Callers 1

KeybReadDataFunction · 0.85

Calls 2

ReadByteFromMemoryFunction · 0.85
LogFileOutputFunction · 0.85

Tested by

no test coverage detected