ufosolar Posted October 28, 2018 Share Posted October 28, 2018 Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted October 28, 2018 Share Posted October 28, 2018 Hi there, welcome It is important to understand that the TIA continues to do it's thing without instruction from the CPU. The CPU's job is to set the registers in the TIA (at the correct time) to change the picture. The TIA will draw the same line over and over again if the registers are not changed. This is just like what happens when you turn on the console without a cartridge. When you execute a NOP instruction, you are not changing any registers, but you are wasting 2 cycles of CPU time. The TIA will draw 6 pixels in that time (6 'color clocks'). Quote Link to comment Share on other sites More sharing options...
ufosolar Posted October 28, 2018 Author Share Posted October 28, 2018 thank you Quote Link to comment Share on other sites More sharing options...
AkashicRecord Posted October 28, 2018 Share Posted October 28, 2018 You can't think of programming the VCS in this way. There is no "drawing something after a nop." You have to think of the TIA and 6507 as being in lock step with each other. You have 76 CPU cycles across each scanline. Whatever CPU cycle *at that moment* along a particular scanline is what is going to determine where on the screen a particular change will take place. The TIA always does what it was last doing until it is told otherwise...the CPU clock cycle timing is what determines just about everything. Quote Link to comment Share on other sites More sharing options...
ufosolar Posted October 29, 2018 Author Share Posted October 29, 2018 Ok maybe I start to understand how it works ... p.s. I noticed that not using the SLEEP macro the first scanline was drawn out of phase with respect to the others, (I went to attempts). Thank you Quote Link to comment Share on other sites More sharing options...
Jmrott Posted September 2, 2019 Share Posted September 2, 2019 On 10/29/2018 at 1:01 PM, ufosolar said: Ok maybe I start to understand how it works ... p.s. I noticed that not using the SLEEP macro the first scanline was drawn out of phase with respect to the others, (I went to attempts). Thank you Lda #50 ;load the A register with the value 50. Fyi this should be in hexidecimal form "lda #$50" not #50 range of the register #$00 - #$FF or #0 - #255 but #$50 and #50 are not equivalent. sta COLUBK ;This stores the value of A register into the TIA's COLUBK register #$09. nop ; for each nop nop ; the TIA is drawing nop ; two color clocks to the screen This is the drawing time. If other code follows after the line has began to draw each cpu cycle used by the following code will draw two more color clocks to the screen. See documentation to understand the number of machine cycles used for each instruction. Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted September 2, 2019 Share Posted September 2, 2019 10 hours ago, Jmrott said: Lda #50 ;load the A register with the value 50. Fyi this should be in hexidecimal form "lda #$50" not #50 range of the register #$00 - #$FF or #0 - #255 but #$50 and #50 are not equivalent. sta COLUBK ;This stores the value of A register into the TIA's COLUBK register #$09. nop ; for each nop nop ; the TIA is drawing nop ; two color clocks to the screen This is the drawing time. If other code follows after the line has began to draw each cpu cycle used by the following code will draw two more color clocks to the screen. See documentation to understand the number of machine cycles used for each instruction. I regret this part of the tutorial where I had REPEAT 192. Just so that's out there. I just want to comment on the above - each "nop" is two CPU cycles, NOT two colour clocks. Each CPU cycle is 3 colour clocks, so each "nop" is actually 6 colour cycles. There are 76 CPU cycles per scanline, which is 76*3 = 228 TIA colour clocks. 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.