Jump to content
RevEng

fractional cycle counting

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

Share this post


Link to post
Share on other sites

Neat.

Perhaps some documentation on ways of showing cycle counts might be useful to some...

Also, relating cycle counts to timer values for '2600 use would be useful too.

 

Share this post


Link to post
Share on other sites

A treatise on advanced counting, with a selection of count styles and discussion of timers (rounding, etc) would be interesting. :thumbsup:

Share this post


Link to post
Share on other sites

Who do we know with a propensity and history of writing some sort of tutorial... kind of like a "cycle counting for newbies" thing....?
:ponders:

 

Share this post


Link to post
Share on other sites

Nick Bensema? ;)   

 

Or maybe you mean an extension to your 2600 tutorials - that would be great! :D

  • Like 1

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...