Skip to content
  • Screwtape's avatar
    Simplify the decision for the indexed write page crossing penalty. · 6b32b22f
    Screwtape authored
    In the 6502, write instructions with certain indexed addressing modes always
    incur the page-crossing penalty cycle, even if they don't cross a page boundary.
    This was simple to implement, we just added a clause to the CASE statement that
    calculates the minimum cycle count.
    
    In the 65C02, certain write instructions were excluded from this special case.
    Again this was simple to implement, we just added a new clause to the CASE
    statement that guaranteed the default for these instructions.
    
    Then we switched from the "cycles and force_cycles" model to "base_cycles and
    extra_cycles". This was more complex to implement, since some special cases
    needed to be in only one or only the other or both. I actually got this wrong
    the first time and deleted the exception for certain write instructions from the
    extra_cycles CASE expression, then had to put it back.
    
    So now, to keep things simple, we implement this special logic in one place,
    with one comment explaining what it does and why.
    6b32b22f