Jump to content

Open Club  ·  60 members

DASM
IGNORED

fractional cycle counting


RevEng

Recommended Posts

I was playing with some timing-critical 7800 joystick-to-serial interface code, and while doing my cycle counts when it dawned on me that this may be the first time anybody has done 6502 cycle counts with fractional values...

 

        lda     SWACNT          ; 4.5        RIOT access slowdown is +0.5 cycle
        and     #$fe            ; 2     6.5
        adc     #$00            ; 2     8.5
        sta     SWACNT          ; 4.5  13    

 

On the 7800, the Maria chip generates the 6502 clock. If accesses to the TIA or RIOT register locations happen, Maria slows the 6502 clock down from 1.79Mhz to 1.19Mhz during the memory access part of the instruction, which amounts to +0.5 cycles.

 

We don't do a lot of cycle-exact code on the 7800 as there's no need for a display kernel like with the 2600, which is why I think it may be a first. Since a lot of you come from the 2600 perspective, I thought you might find it interesting. :)

  • Like 5
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...