fromo Posted August 3, 2005 Share Posted August 3, 2005 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 Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted August 3, 2005 Share Posted August 3, 2005 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. Quote Link to comment Share on other sites More sharing options...
fromo Posted August 3, 2005 Author Share Posted August 3, 2005 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 Quote Link to comment Share on other sites More sharing options...
supercat Posted August 3, 2005 Share Posted August 3, 2005 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. Quote Link to comment Share on other sites More sharing options...
fromo Posted August 3, 2005 Author Share Posted August 3, 2005 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 Quote Link to comment Share on other sites More sharing options...
supercat Posted August 3, 2005 Share Posted August 3, 2005 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. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted August 4, 2005 Share Posted August 4, 2005 ...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). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.