Jump to content



0

76 Machine Cycles


6 replies to this topic

#1 fromo OFFLINE  

fromo

    Combat Commando

  • 7 posts
  • Location:from Monterrey, Mexico

Posted Wed Aug 3, 2005 4:05 PM

Hi!

I have been reading this excellent tutorial, however regarding the 76 machine cycles that we have in order to draw a scanline, I would like to know if someone could tell me in what part of the programs, we need to be aware of those 76 machine cycles?

In order to be more clear I have identified some parts or blocks that are included in our programs :

StartOfFrame

1.- Start of Vertical Blank Processing
2.- 3 Scanlines of VSYNCH Signal
3.- 37 Scanlines of Vertical Blank
4.- 192 Scanlines of Picture
5.- 30 Scanlines of Overscan

jmp StartOfFrame


It would be usefull if someone could explain me in what part of the program I need to be aware of those 76 machine cycles

My best regards
Fernando Romo

#2 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,831 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Wed Aug 3, 2005 4:07 PM

fromo, on Wed Aug 3, 2005 3:05 PM, said:

Hi!

  I have been reading this excellent tutorial, however regarding the 76 machine cycles that we have in order to draw a scanline, I would like to know if someone could tell me in what part of the programs, we need to be aware of those 76 machine cycles?

  In order to be more clear I have identified some parts or blocks that are included in our programs :

StartOfFrame

1.- Start of Vertical Blank Processing
2.- 3 Scanlines of VSYNCH Signal
3.- 37 Scanlines of Vertical Blank
4.- 192 Scanlines of Picture
5.- 30 Scanlines of Overscan

jmp StartOfFrame


It would be usefull if someone could explain me in what part of the program I need to be aware of those 76 machine cycles

My best regards
Fernando Romo

View Post

Pretty much only during your 192 scanlines of picture. Another common place to be concerned about where in the scanline you are is during your sprite-repositioning code, which may or may not take place during the visible picture portion of the frame.

#3 fromo OFFLINE  

fromo

    Combat Commando

  • 7 posts
  • Location:from Monterrey, Mexico

Posted Wed Aug 3, 2005 4:19 PM

vdub_bobby, on Wed Aug 3, 2005 4:07 PM, said:

fromo, on Wed Aug 3, 2005 3:05 PM, said:

Hi!

  I have been reading this excellent tutorial, however regarding the 76 machine cycles that we have in order to draw a scanline, I would like to know if someone could tell me in what part of the programs, we need to be aware of those 76 machine cycles?

  In order to be more clear I have identified some parts or blocks that are included in our programs :

StartOfFrame

1.- Start of Vertical Blank Processing
2.- 3 Scanlines of VSYNCH Signal
3.- 37 Scanlines of Vertical Blank
4.- 192 Scanlines of Picture
5.- 30 Scanlines of Overscan

jmp StartOfFrame


It would be usefull if someone could explain me in what part of the program I need to be aware of those 76 machine cycles

My best regards
Fernando Romo

View Post

Pretty much only during your 192 scanlines of picture. Another common place to be concerned about where in the scanline you are is during your sprite-repositioning code, which may or may not take place during the visible picture portion of the frame.

View Post



Thanks a lot for your fast answer. As you could notice I am new in this subject, I imagine that in some part of 192 Scanline of Picture (block) there is a sub-block called sprite-repositioning section (if we want to name that section), so that place would be the place where we need to be aware of those 76 machine cycles?, as far I understood.

But finally, into that section (192 Scanline of Picture), we need to count every machine cycle in order to compare with 76?


My best regards
Fernando Romo

#4 supercat OFFLINE  

supercat

    Quadrunner

  • 6,367 posts

Posted Wed Aug 3, 2005 4:29 PM

fromo, on Wed Aug 3, 2005 5:19 PM, said:

But finally, into that section (192 Scanline of Picture), we need to count every machine cycle in order to compare with 76?

If you perform a store to address 2, the TIA will very helpfully stall the processor until the start of horizontal blank for the next scan line. Thus, much of the time you don't have to worry about exactly where the CPU is but merely ensure that you perform the "sta WSYNC" early enough.

#5 fromo OFFLINE  

fromo

    Combat Commando

  • 7 posts
  • Location:from Monterrey, Mexico

Posted Wed Aug 3, 2005 4:45 PM

supercat, on Wed Aug 3, 2005 4:29 PM, said:

fromo, on Wed Aug 3, 2005 5:19 PM, said:

But finally, into that section (192 Scanline of Picture), we need to count every machine cycle in order to compare with 76?

If you perform a store to address 2, the TIA will very helpfully stall the processor until the start of horizontal blank for the next scan line. Thus, much of the time you don't have to worry about exactly where the CPU is but merely ensure that you perform the "sta WSYNC" early enough.

View Post



Thanks a lot!, and sorry for my ignorance on this stuff :? , but what happens if we spend more than 76 machine cycles per line and we did not perform "sta WSYNC"?, maybe I am worrying to much and perhaps my programs won't need to be aware of those 76 machine cycles, but I would like to know if there is a problem if I use more than 76?

My best regards
Fernando Romo

#6 supercat OFFLINE  

supercat

    Quadrunner

  • 6,367 posts

Posted Wed Aug 3, 2005 5:10 PM

fromo, on Wed Aug 3, 2005 5:45 PM, said:

Thanks a lot!, and sorry for my ignorance on this stuff  :? , but what happens if we spend more than 76 machine cycles per line and we did not perform "sta WSYNC"?, maybe I am worrying to much and perhaps my programs won't need to be aware of those 76 machine cycles, but I would like to know if there is a problem if I use more than 76?

If you do a STA WSYNC, 0-73 cycles of stuff, and another STA WSYNC, then precisely 76 cycles will elapse between the end of the first WSYNC and the end of the second.

If you do an STA WSYNC, 74-149 cycles of stuff, and another STA WSYNC, then precisely 152 cycles will elapse between the end of the first WSYNC and the end of the second.

Likewise with 150-226, 227-302, etc.

Each frame in NTSC should take precisely 19,912 cycles (262 scan lines). How you get there is entirely up to you.

#7 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Thu Aug 4, 2005 3:45 PM

...The most noticable effect being that the data for the scanline where the excess cycles occur will cause the previous data sent to the registers to be reused for the next scanline as well (i.e. spilling into the next line).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users