Author Topic: Scanline Interference by Copying Screen Backwards?  (Read 2378 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Scanline Interference by Copying Screen Backwards?
« on: October 06, 2011, 01:53:30 pm »
Let's say that I have a routine that lets a user calibrate their grayscale in an attempt to get rid of the scan line. 

Although unusual, I'm hoping to copy plotsscreen to the screen backwards, that is, from (plotsscreen + 767) to (plotsscreen).  I'm doing this because I want to take advantage of the fact that ldd will decrease BC like it does HL and DE.  (LDI sends HL, DE and BC in opposite directions)  However, will this cause problems with grayscale due to the scanline, even if a person has calibrated the screen?

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Scanline Interference by Copying Screen Backwards?
« Reply #1 on: October 06, 2011, 02:55:18 pm »
If you are sending lines to the screen in TI-OS manner (columns) then it won't really make a whole lot of difference.

But, if you are sending lines row by row, then yes, that will make quite a difference. The reason is because the LCD copies the data to the screen starting at the top. So, if you copy data from bottom to top, you are going to cross paths with the updater twice as often, resulting in twice the interference. In fact, if you manage to calibrate the screen perfectly, you might actually see two glitch lines at once.

It's probably a bit late for your project, but if you are dead set on updating the screen with LDD, you could update the LCD regularly but actually invert your buffer so that the top is at plotSScreen+768-12. I did that in the Impossible game (for other reasons) but it's still a valid technique.


If you are wondering, yes, I have tried to update the screen that way before, so I'm not just assuming it updates top down.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Scanline Interference by Copying Screen Backwards?
« Reply #2 on: October 06, 2011, 03:30:14 pm »
If you are sending lines to the screen in TI-OS manner (columns) then it won't really make a whole lot of difference.

But, if you are sending lines row by row, then yes, that will make quite a difference. The reason is because the LCD copies the data to the screen starting at the top. So, if you copy data from bottom to top, you are going to cross paths with the updater twice as often, resulting in twice the interference. In fact, if you manage to calibrate the screen perfectly, you might actually see two glitch lines at once.

It's probably a bit late for your project, but if you are dead set on updating the screen with LDD, you could update the LCD regularly but actually invert your buffer so that the top is at plotSScreen+768-12. I did that in the Impossible game (for other reasons) but it's still a valid technique.


If you are wondering, yes, I have tried to update the screen that way before, so I'm not just assuming it updates top down.

I don't think inverting is going to be hard, but I would be updating the screen from right-to-left...is that an issue?
« Last Edit: October 06, 2011, 03:30:45 pm by Hot_Dog »

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Scanline Interference by Copying Screen Backwards?
« Reply #3 on: October 06, 2011, 03:44:20 pm »
Nope, that is not a issue at all. Right to left or left to right doesn't matter because the update happens so quickly.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Scanline Interference by Copying Screen Backwards?
« Reply #4 on: October 06, 2011, 09:33:07 pm »
I actually found a creative workaround, so even with LDD, I don't think I'll have to invert the screen after all ;D 

But it's a long story.  I'm using LDD to accomplish several things during the 150 T-state pauses,