Jump to content
IGNORED

76 Machine Cycles


fromo

Recommended Posts

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

Link to comment
Share on other sites

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

904031[/snapback]

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.

Link to comment
Share on other sites

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

904031[/snapback]

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.

904032[/snapback]

 

 

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

904040[/snapback]

 

 

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

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