22 January 2011, 17:38 | #1 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Hardware Scroll tutorial?
Hi,
Does anyone have a hardware scroll tutorial? I am trying to scroll a 5 bitplane screen and I'm guessing that it'd take forever using the blitter, so I am attempting to do it using the hardware. The problem is I seem to only be moving bitplane 0 by 1 pixel to the left and then it stops. I have set BPLCON1 as $0001, which I assume is why bitplane 0 has moved 1 pixel to the left. How do I move all of the bitplanes? The Hardware Reference manual also mentions "setting the delay bits", but doesn't mention where they are! Can anyone point me in the right direction? Regards, Lonewolf10 |
22 January 2011, 17:47 | #2 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Hey Lonewolf10
From memory: don't you just sequentially set the delay bits to scroll up to 16 pixels (which is the max you can scroll using only the delay bits IIRC) and then update the bitplane pointers to start displaying the bitplane data at the next or previous word depending on scroll direction...? Keep doing that and you're scrolling. Delay is set in bplcon1 IIRC. I think you also have to do something with modulos too...? EDIT: delay is bits 0 - 7 in bplcon1 (0 to 3 for odd bitplanes, 4 - 7 for the even ones) Last edited by pmc; 22 January 2011 at 17:52. Reason: added info... |
22 January 2011, 18:00 | #3 |
Registered User
Join Date: Jun 2008
Location: Boston USA
Posts: 466
|
From memory.
You need to fetch an extra word with display dma. You need to set up the modulus registers to skip at least a word (the one which will be scrolled on screen) then set the fine scroll bits. Something like where x = pixels scrolled set fine scroll (delay) inverse of x AND $f duplicated for odd, even planes. ie $f is 0. Use a look up table to map x AND $f to set scroll for odd/even planes. Hope this helps. |
22 January 2011, 18:52 | #4 |
Registered Insane
Join Date: Feb 2010
Location: Ununited Kingdom
Posts: 792
|
Kreator / Anarchy wrote one I think many moons ago it would be in one of the early issues of Stolen Data
|
22 January 2011, 19:48 | #5 | |
Registered User
Join Date: Jun 2008
Location: Boston USA
Posts: 466
|
Quote:
You need to set the odd and even delay to the same value in bplcon1 From memory a delay of $ff means no scroll and $00 means scroll playfield left by 15 pixels. You're only setting one of the values. |
|
22 January 2011, 21:59 | #6 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
Normally the delay bits are not set so $00 == no scroll and the maximum settable value $ff == 15 bits of scroll. You'd either decrement or increment the delay bits and bitplane pointers depending on the scroll direction required of course. |
|
22 January 2011, 22:09 | #7 | |
Registered User
Join Date: Jun 2008
Location: Boston USA
Posts: 466
|
Quote:
I remember it being the opposite way around compared to the STE. 0 is no scroll on the STE and $f is view area scrolled right 15 pixels. I have a fuzzy memory of using a look up table for the scroll values on the Amiga. Maybe I used a look up to set both values to save converting $f -> $ff when setting both playfield fine scroll settings after getting the fine scroll modulus via AND. My memory could be hazy though http://amigadev.elowar.com/read/ADCD.../node02D0.html should clear it up Last edited by frank_b; 22 January 2011 at 22:35. |
|
23 January 2011, 00:40 | #8 | |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
Googling amiga "Stolen Data" revealed multiple sites with some issues on them (e.g. most are scattered all over the internet). I'm not going to download them tonight, as I am tired. pmc and frank_b, I have spent the afternoon coding a simple scroll routine that moves the screen left and right by adding/subtracting 1 byte from each of the BPLxPTL pointers until the right/left edge of the screen was reached. Then it scrolls back the other way. I should be able to add in code to use BPLCON1 now and make it a smoother scroll. Thanks for guidance. The phrase "delay bits" threw me, I was thinking in terms of time delay (e.g. set the delay bits, set BPLCON1 and the hardware would automatically scroll it every X VBL ). FYI, the screen contains the logo for my demo group (is it a group if there is only one member?!), which was kindly created by Greyfox a few months back. Regards, Lonewolf10 |
|
23 January 2011, 04:18 | #9 |
2 contact me: email only!
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,187
|
|
23 January 2011, 08:19 | #10 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
My "group" is me, myself and I. It's always nice to work with other people though. Regarding the scrolling, it sounds like you're nearly there to be honest. Once you're using the delay bits to fine scroll as well it'll look fine. |
|
23 January 2011, 10:05 | #11 | |
Registered User
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
|
Quote:
Shoudn't this thread go into the Coding Tutorial sub-forum ? Last edited by TheDarkCoder; 23 January 2011 at 10:06. Reason: added question |
|
23 January 2011, 10:42 | #12 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 32,014
|
|
23 January 2011, 11:56 | #13 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
|
|
23 January 2011, 13:26 | #14 | |
Registered Insane
Join Date: Feb 2010
Location: Ununited Kingdom
Posts: 792
|
Quote:
|
|
24 January 2011, 00:08 | #15 | ||||||
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
Quote:
Quote:
Quote:
I will check them first, thanks. Added, 24th Jan 2011: TheDarkCoder and pmc, I just checked my code, and you guys were right. I was sticking to even addresses - I got it wrong, despite it being my own code!! I'm still struggling with using BPLCON1 though - I can still only shift bitplane 0, instead of planes 0-4. I will read up on the guides mention in previous replies. Added later on 24th Jan: Quote:
Added on 22nd March: Quote:
The examples in issue 2 don't seem to work. I have managed to get the examples from issues 1 and 3 to work though. Already learnt quite a bit, now to read the other issues Regards, Lonewolf10 Last edited by Lonewolf10; 22 March 2011 at 22:59. Reason: Added additional info |
||||||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Games that didn't scroll smoothly - why not? | crabfists | Retrogaming General Discussion | 90 | 18 May 2022 14:57 |
Scroll with the mouse? | BarrySWE | support.Apps | 14 | 29 May 2012 22:16 |
CD32 flickering scroll | Amiga1992 | support.Hardware | 7 | 17 February 2012 15:03 |
Need a fluent scroll in WB dirs | VoltureX | support.Apps | 6 | 29 November 2011 11:01 |
help me smooth scroll | rusty71 | support.WinUAE | 7 | 21 November 2011 15:36 |
|
|