Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Hot_Dog on October 06, 2011, 01:53:30 pm

Title: Scanline Interference by Copying Screen Backwards?
Post by: Hot_Dog 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?
Title: Re: Scanline Interference by Copying Screen Backwards?
Post by: thepenguin77 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.
Title: Re: Scanline Interference by Copying Screen Backwards?
Post by: Hot_Dog 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?
Title: Re: Scanline Interference by Copying Screen Backwards?
Post by: thepenguin77 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.
Title: Re: Scanline Interference by Copying Screen Backwards?
Post by: Hot_Dog 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,