6502

CPU Emulation and locking to a specific clock speed

烂漫一生 提交于 2019-11-27 17:52:50
If you had read my other question , you'll know I've spent this weekend putting together a 6502 CPU emulator as a programming exercise. The CPU emulator is mostly complete, and seems to be fairly accurate from my limited testing, however it is running incredibly fast, and I want to throttle it down to the actual clock speed of the machine. My current test loop is this: // Just loop infinitely. while (1 == 1) { CPU.ClockCyclesBeforeNext--; if (CPU.ClockCyclesBeforeNext <= 0) { // Find out how many clock cycles this instruction will take CPU.ClockCyclesBeforeNext = CPU.OpcodeMapper.Map[CPU

CPU Emulation and locking to a specific clock speed

倖福魔咒の 提交于 2019-11-26 19:09:54
问题 If you had read my other question, you'll know I've spent this weekend putting together a 6502 CPU emulator as a programming exercise. The CPU emulator is mostly complete, and seems to be fairly accurate from my limited testing, however it is running incredibly fast, and I want to throttle it down to the actual clock speed of the machine. My current test loop is this: // Just loop infinitely. while (1 == 1) { CPU.ClockCyclesBeforeNext--; if (CPU.ClockCyclesBeforeNext <= 0) { // Find out how