Page 1 of 1

Re: Tearing while scrolling attributes

Posted: Wed May 20, 2020 2:32 am
by Lethargeek
I can't even imagine how a code for such a simple task could be so slow. Even a straightforward single ldir of 256 bytes + a few separate byte transfers to correct the right column will eat less than half of the top border time. And calling a simple subroutine (consisting of "get left; ldi x31; put right") 24 times should scroll the entire attribute area without any tearing (and likely still finishing ahead of the top border).

Re: Tearing while scrolling attributes

Posted: Wed May 20, 2020 8:58 am
by dfzx
Lethargeek wrote: Wed May 20, 2020 2:32 am I can't even imagine how a code for such a simple task could be so slow.
4-way scrolling based on inputs and events means rebuilding the 32x24 display each frame. At least at the moment.

It looks like some sort of "scroll the attributes in one of the 4 directions, then fill in the appearing row/column" approach is going to be required.

Re: Tearing while scrolling attributes

Posted: Wed May 20, 2020 11:16 am
by Turtle_Quality
If it's just the attributes moving, regardless of the direction, most of the work can be completed by one LDIR that should not take long.

Scrolling the graphics around is more complex and time consuming because of the screen layout and the 8 fold increase in data per character square.
Can you show the code ?

Re: Tearing while scrolling attributes

Posted: Wed May 20, 2020 11:39 am
by Lethargeek
dfzx wrote: Wed May 20, 2020 8:58 am 4-way scrolling based on inputs and events means rebuilding the 32x24 display each frame. At least at the moment.
still a very simple task if it's just attributes
dfzx wrote: Wed May 20, 2020 8:58 am It looks like some sort of "scroll the attributes in one of the 4 directions, then fill in the appearing row/column" approach is going to be required.
for horizontal scrolling it will be easier to wrap each row separately, like

Code: Select all

ld a,(de)
ldi	x31
ld (de),a
inc de
inc hl
(this scrolls a row left and goes to the next one)