English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 20 December 2013, 23:35   #1
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 862
Displayscroll

I'm trying to get my logo in JetHunt to weave like it does on the PC version. The Blit command after separating the logo into lines works but it's a little slow. I did try the scroll command but couldn't get it to do it right.

However there is DisplayScroll which is supposed to use the copper. This would be great if I could understand the manual entry.

Does anyone know how to use this command in Blitz?

Coagulus
Coagulus is offline  
Old 30 November 2014, 04:49   #2
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
BlitzBasic 2 DisplayScroll Example

Try this, doesn't work with more bplanes, as far as i know; but, what do i know

obsolete.
Attached Thumbnails
Click image for larger version

Name:	bb2displayscroll_emu.png
Views:	673
Size:	22.0 KB
ID:	42354  
Attached Files
File Type: lha bb2dispscroll.lha (18.4 KB, 437 views)

Last edited by Cylon; 01 May 2016 at 20:46.
Cylon is offline  
Old 01 December 2014, 00:42   #3
leathered
Registered User
 
leathered's Avatar
 
Join Date: Oct 2011
Location: UK
Age: 47
Posts: 304
Just fantastic mate! Rob and I had a quick bash at this last winter, figured out some basics with a rough example and AFAIK Rob got it working really sweet for his title screen. We never did get around to putting an example here though, and I'm sure your example will help in the future. If I'm not wrong this effect should be one of the means of getting that copper floor working in racing games and the scaling floor in one on one beat em ups.
leathered is offline  
Old 06 March 2015, 00:38   #4
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 862
Awesome, (I thought I'd replied ages ago!) I've used some of the code from Leathered and my own efforts to knock up an AGA "outrun" attached with source.

I wonder if there's a way of using displayscroll on just one playfield (of a dual playfield) though... otherwise everything on top has to be a hardware sprite...
Attached Files
File Type: zip inrun.zip (27.0 KB, 423 views)

Last edited by Coagulus; 06 March 2015 at 00:43.
Coagulus is offline  
Old 21 February 2016, 04:22   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Quote:
Originally Posted by Coagulus View Post
I wonder if there's a way of using displayscroll on just one playfield (of a dual playfield) though... otherwise everything on top has to be a hardware sprite...
As usual, Blitz's documentation is to no help. According to an old Usenet post, DisplayScroll uses two arrays because one works with the odd bitplanes and one with the even ones. That should help your dual playfield endeavours, and might also explain why Cylon can't get it to work with more than one bitplane.

BTW: This thread should be moved to Blitz area…

Last edited by idrougge; 21 February 2016 at 04:46.
idrougge is offline  
Old 21 February 2016, 08:08   #6
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
I think I want to throw the manual out the window

Last edited by Retro1234; 21 February 2016 at 10:17. Reason: j
Retro1234 is offline  
Old 30 April 2016, 01:00   #7
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
Displayscroll AGA multiple bplanes

Finally got the time to nail the b*tch down.

I always knew there was a strange offset between the odd and the even planes, but never took the time to investigate further.
Well, until now.

I narrowed it down to <1> subpixel (hires pixel in lowres) i believe. The rest is up to the real coders.

First i tried to use the offset parameter in displayscroll cmd, this doesn't seem to work.
Then i constantly tried to get closer to the offset by using a very small step per line tracing downwards without the wobbling, of course.
Finally got the number 13 (well: 12.x to 13.x) as the offset for this very 8 colour bitmap. This offset can be placed anywhere, depending on the effects you want to create. Best is at (0) position in the even-array.

I hope this is usefull. Src below.
Remember: Cylon did it.
Code:
;display scroll adapted by cylon

DEFTYPE.w
BitMap1,320,256,3

LoadBitMap1,"face8.iff",1  ;3planes 8 cols

VWait50
BLITZ

BitMapOutput1    ;print onto bmap

Locate 2,28:Print "THIS IS AGA DISPLAYSCROLL"
Locate 2,30:Print "<<<<< Move Mouse >>>>>"
Use BitMap1

;For a=7To1 Step -1
;  b=1-b
;  Circlef160,128,10*a,10*a,b
;Next

InitCopList1,44,256,$10003,8,8,-$10

CreateDisplay1

DisplayBitMap1,1

DisplayPalette1,1

For y=0 To7                           ;debug colour boxes

  Boxf 0,y*16,7,y*16+15,y

  Locate2,y*2+0.5:Colour1:Print y

Next y

Dim xpo.q(256),xpe.q(256)

a=0
VWait150
Mouse On

tpi.q=2*Pi  ;precalc

xpe(0)=-13  ;offset for even planes start at ypos=0
;not quite accurate! sub-pixel fetch or what the hell....

While Joyb(0)=0

 For a=1 To 253
   d.q+Pi/18:If d>tpi Then d=0.0

   c.q=Sin(d)+(MouseX-160)/160

   xpo(a)=c

   xpe(a)=c  ;same as odd, but with offset

 Next
 VWait

 DisplayScroll1,&xpo(0),&xpe(0);,-13 offset does not work here?

 VWait
Wend

VWait25
QAMIGA
End

NoCli:CloseEd
You can create strange effects if you arrange your colour registers wisely. Like a counter-wobbling of odd/even bplanes.
Or, avoid all even planes in a pictures back but use only those even planes to scroll or wobble on top.
Attached Thumbnails
Click image for larger version

Name:	DispScr_screensht.jpg
Views:	502
Size:	159.5 KB
ID:	48313   Click image for larger version

Name:	bb2dispscr_new0.JPG
Views:	479
Size:	126.9 KB
ID:	48314   Click image for larger version

Name:	bb2dispscr_new1.JPG
Views:	461
Size:	155.0 KB
ID:	48315  
Attached Files
File Type: lha BB2_dispScroll.lha (21.2 KB, 385 views)

Last edited by Cylon; 30 April 2016 at 01:07.
Cylon is offline  
Old 29 July 2019, 08:58   #8
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Can someone help me with this command?

I understand I should do 2 arrays with the same size as the number of lines of my display, one for even bitplanes and the other one for odd bitplanes (great for dual playfield, yay!) Each value will be the difference in the horizontal position related to the previous line. This should make possible to make weave effects or "single layer" parallax scroll (the "fake" one achieved usually with raster effects instead of one layer on top of the other)

But

A) What is the offset? Why I get an "not enough copper space" error when its positive or zero, it shows something when it's -1 and just shows black screen with anything else?

B) Why when all the values on my array are 0 I get just garbage on screen?

I just can't understand how this works!
Shatterhand is offline  
Old 29 July 2019, 11:18   #9
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
As i remeber offset is 3. And add it to initcoplist. Not at the end of displayscroll command.
In case you would already have lets say for example some aga copper gradient than you would add 4 at the end of displayscroll command.
And displayscroll works better if its right after displaybitmap.
Cobe is offline  
Old 29 July 2019, 21:23   #10
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
After a bit of fiddling, the "magic bitplane offset" is exactly:
Code:
xpe(0)=-13 + 0.00788
At least, on an A1200 and A500 under winuae!
E-Penguin is online now  
Old 29 July 2019, 21:28   #11
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Quote:
Originally Posted by Cobe View Post
As i remeber offset is 3. And add it to initcoplist. Not at the end of displayscroll command.
In case you would already have lets say for example some aga copper gradient than you would add 4 at the end of displayscroll command.
And displayscroll works better if its right after displaybitmap.
I must say this doesn't help me at all understanding how this command works.
Shatterhand is offline  
Old 29 July 2019, 21:47   #12
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
This is how I have it set up in my current aga dual playfield project:


Cobe is offline  
Old 29 July 2019, 21:57   #13
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Based on my limited understanding...

Horizontal scrolling on the Amiga is achieved through two mechanisms:
1. Setting the "MODULO" registers, one per bitplane BPL1MOD and BPL2MOD, which tells the playfield where to start each line, in blocks of 16
2. Setting the "data start" DDFSTRT register gives a per-pixel offset, up to 15 pixels.

These three registers are why the Copper list needs three entries per line.

So, to scroll a display by 20 pixels, you'd set the MODULO registers to 1 (ie, 16) and the data start register to 4.

This command takes two arrays, which represent the offsets, in terms of pixels, per bitfield (odd and even) per row. Presumably Blitz then works out the three register values to set and creates the copper list accordingly.

The "offset" for the command itself I have no idea, I think it's related to building the overall copper list rather than to do with pixel offsets.

Why does the odd line have to be delayed by -13(ish) compared to the even? I assume that's to account for the fetch delay, so that both end up in the same place.
E-Penguin is online now  
Old 30 July 2019, 12:24   #14
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
I think we're talking about different offsets.
I've only used displayscroll twice, successfully, but only on one playfield so I wouldn't know that odd lines would have XOffset -13. It'll come useful if I ever want to displayscroll both playfields. Thanks for finding that out.

But if Shatterhand is getting "not enough copper space" that means that he got CopOffset/customs wrong.

So from my findings
'DisplayScroll CopList#,&xpos.q(n),&xpos.q(n)[,CopOffset] ;(size=-3)'
when using displayscroll you need -3 set in initcoplit customs.

Optional [,CopOffset] is used only if you already have some other custom copper command that uses custom copper space.
Like for example if you already used
DisplayRGB CopList#,Register,line,r,g,b[,CopOffset] ;(ecs=-1 aga=-4)
then everything should look like this

InitCopList CopList#,ypos,height, type,sprites,colors,-7 ;-4(aga)-3(displayscroll)
'DisplayScroll CopList#,&xpos.q(n),&xpos.q(n),4 ; 4 cause displayrgb already use first 4 custom copper spaces
Cobe is offline  
Old 30 July 2019, 15:01   #15
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
It works but it's slow. I can't get it to build a new coplist in a single frame on an A500 and barely on an A1200, and that's with using various lookup tables to avoid doing anything more than
Code:
xpo(i) = mouseOffs(MouseX)
xpe(i) = xpo(i)
in the loop.

I'll fiddle around with the RiCopperFx library when I get a chance and see if this can be done faster directly.
E-Penguin is online now  
Old 30 July 2019, 15:13   #16
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Ah..thats bad news. I noticed its slow but i hoped that once i make lookout tables it would be better...
Cobe is offline  
Old 30 July 2019, 16:15   #17
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
I tried pre-calculating a table per line per offset, but that didn't work; presumably it's something to do with how Blitz handles multi-dimensional arrays.
E-Penguin is online now  
Old 23 December 2020, 18:34   #18
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Quote:
Originally Posted by Coagulus View Post
Awesome, (I thought I'd replied ages ago!) I've used some of the code from Leathered and my own efforts to knock up an AGA "outrun" attached with source..
My daughter had demanded I write her a game for Christmas - any objection if I use this as the basis for something? As it'll be written in 24 hours don't expect miracles...
E-Penguin is online now  
Old 23 December 2020, 20:20   #19
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Quote:
Originally Posted by E-Penguin View Post
My daughter had demanded I write her a game for Christmas - any objection if I use this as the basis for something? As it'll be written in 24 hours don't expect miracles...
Looking forward to this!!! Finally, a great Outrun on the Amiga...or will it be Santa Run 3D?
Havie is offline  
Old 23 December 2020, 22:56   #20
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
It'll be whatever I can cludge together out of bits and pieces in a couple of hours to please a 5 year old... Don't set your expectations too high! It'll probably involve dinosaurs to keep my son happy too.
E-Penguin is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09961 seconds with 13 queries