1
0
mirror of https://github.com/cc65/cc65.git synced 2025-04-06 04:41:08 +00:00
Sidney Cadot 7980b81ddb sim65: Fix instruction timings for 6502 and 65C02.
This PR fixes all discrepancies of sim65 instruction timings, for both the 6502 and the 65C02 processors.

The timings as implemented in this PR have been verified against actual hardware (Atari 800 XL for 6502; and WDC 65C02 for 65C02).

These timings can also be verified against the 65x02 test suite. However, in this case, a single discrepancy arises; the 65x02 testsuite suggests that the 65C02 opcode 0x5c should take 4 clocks. However, tests on a hardware 65C02 have conclusively shown that this instruction takes 8 clock cycles. The 8 clock cycles duration for the 65C02 0xfc opcode is also confirmed by other sources, e.g. Section 9 of http://www.6502.org/tutorials/65c02opcodes.html.

This test makes sim65 correct both in terms of functionality (all opcodes now do what they do on hardware) and in terms of timing (all instructions take as long as they would on real hardware).

The one discrepancy that remains, is that on a real 6502/65C02, some instructions issue R or W cycles on the bus while the instruction processing is being done. Those spurious bus cycles are not replicated in sim65. Sim65 is thus an instruction-level simulator, rather than a bus-cycle level simulator. In other words, while the clock cycle counts for each instruction are now correct, not all clock cycles are individually simulated.
2024-12-24 09:24:02 +01:00
..
2022-04-17 16:07:09 +02:00
2022-04-17 16:07:09 +02:00
2022-12-30 17:25:47 +02:00
2024-02-15 09:03:46 +01:00
2022-04-17 16:07:09 +02:00
2023-04-19 09:15:03 +02:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-09-23 14:26:08 +03:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-01 14:22:30 +01:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00
2023-12-14 14:25:35 -08:00