Tearing while scrolling attributes
- Lethargeek
- Manic Miner
- Posts: 734
- Joined: Wed Dec 11, 2019 6:47 am
Re: Tearing while scrolling attributes
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
4-way scrolling based on inputs and events means rebuilding the 32x24 display each frame. At least at the moment.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.
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.
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
- Turtle_Quality
- Manic Miner
- Posts: 502
- Joined: Fri Dec 07, 2018 10:19 pm
Re: Tearing while scrolling attributes
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 ?
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 ?
Definition of loop : see loop
- Lethargeek
- Manic Miner
- Posts: 734
- Joined: Wed Dec 11, 2019 6:47 am
Re: Tearing while scrolling attributes
still a very simple task if it's just attributes
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