Xref: utzoo comp.sys.amiga.tech:4218 comp.sys.amiga:30788 Path: utzoo!attcan!uunet!microsoft!w-colinp From: w-colinp@microsoft.UUCP (Colin Plumb) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: Fast 2-D Scrolling Method Needed (kinda long) Message-ID: <12367@microsoft.UUCP> Date: 18 Mar 89 04:52:58 GMT References: <112@dg.dg.com> <10871@well.UUCP> <113@dg.dg.com> <10921@well.UUCP> <736@cord.UUCP> Reply-To: w-colinp@microsoft.uucp (Colin Plumb) Distribution: na Organization: very little Lines: 34 I'm pretty sure this is feasable. Handling multiple bitplanes is tricky (you have to change them all in one scan line), but I think it can be done with some ingenuity... Don't bother with the slices. Each bitplane is as tall as the screen, plus some slop for off-screen rendering. Initially, you start the display at row 0 and it goes to row n-1. Rows n through m-1 are off-screen. Then, as you scroll down, rows 0, 1, 2, 3... fall off the top, and rows n, n+1, n+2, n+3... appear on the bottom. When row m would be needed, stick a copper instruction into the display list to reset the memory pointer to row 0. Then this instruction moves up the copper list until it gets to the top of the screen and we're back where we started. For multiple bitplanes, stagger them so the copper instructions are between different scan lines. Thus, only two registers (BPLxPTH and BPLxPTL, the high and low halves of the pointer) have to be reset in one scan line. Seems doable. To render into this bitplane, you can write your own graphics routines that understand the need to wrap around, or do nasty things to the layers.library and let it worry about the discontinuity in the circular buffer. You can also use this to scroll horizontally, although you have to be more careful - I doubt you can jump from end to beginning of your circular buffer in mid-scan-line. Maybe someone more into graphics hacking than I (Leo? Have you finished Onion yet?) can write some sample code. -- -Colin (uunet!microsoft!w-colinp) "Don't listen to me. I never do." - The Doctor