English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 17 October 2021, 12:49   #1
Int42
Registered User
 
Join Date: Oct 2021
Location: Berlin/Germany
Posts: 12
fastest way to code an one pixel sinus scroller

Hi,


what is the fastest way to code an one pixel sinus scroller on an Amiga500 OCS?


Should I create a standard scroller in a backbuffer with blit char, scroll the whole text and then get 1 Pixel columns of that and blit this in the shown screenbuffer?
Int42 is offline  
Old 17 October 2021, 14:05   #2
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
That's what I do
Antiriad_UK is offline  
Old 17 October 2021, 14:22   #3
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by Antiriad_UK View Post
That's what I do
Ditto
Galahad/FLT is offline  
Old 17 October 2021, 17:54   #4
Int42
Registered User
 
Join Date: Oct 2021
Location: Berlin/Germany
Posts: 12
ok, thx then I'm on the road.
Int42 is offline  
Old 17 October 2021, 20:24   #5
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
The sine scroller from Sax Offender code is here:
https://github.com/jonathanbennett73...Offender/Miami

It's a vertical fill one but still does the 1 pixel column blitting. The copy to screen function is SIN_CopyScrollToSine
Antiriad_UK is offline  
Old 18 October 2021, 12:24   #6
defor
Registered User
 
Join Date: Jun 2020
Location: Brno
Posts: 90
Draw vertical lines with blitter, use 16 pixel pattern for every column. Pros: No need to draw characters to a buffer. As a bonus, it's easy to stretch text horizontally. Cons: 16 pixels in one draw call only.
defor is offline  
Old 18 October 2021, 13:16   #7
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
Quote:
Originally Posted by defor View Post
Draw vertical lines with blitter, use 16 pixel pattern for every column. Pros: No need to draw characters to a buffer. As a bonus, it's easy to stretch text horizontally. Cons: 16 pixels in one draw call only.
That's going to be horrendously slow though.

The quickest way to do a tall sine scroll (for example, font is 128 pixels high), is to plot the vertical edge points with the CPU, and then blitter vertical XOR fill. You can be filling the previous buffer while the CPU is plotting the next set of spans.

Another option is to use an animated font (sounds crazy, but does work.. have a look at Vision - "Can't Be" demo for a good example). This is probably the absolute fastest way possible.

[ Show youtube player ]
DanScott is offline  
Old 18 October 2021, 14:13   #8
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
@Dan OCS/68000 can do a 270px high sine scroller in real time without filling. But I think Int42 is looking for a quick and easy way to write one, rather than how to write the fastest one.

ORing pixel columns from a scroll buffer is a bit simpler. You could fill the scroll buffer just to test your routine and see what height font it accommodates. 30px is possible this way.
Photon is offline  
Old 18 October 2021, 15:24   #9
Estrayk
Registered User
 
Estrayk's Avatar
 
Join Date: Apr 2015
Location: Spain
Posts: 511
OFFTOPIC to the coders.
I would like to know what has been the most difficult sinus-scroll to program that you have seen.
Med-Red Slayer/SCX or Corto/QTX ones maybe?
Estrayk is offline  
Old 18 October 2021, 15:35   #10
defor
Registered User
 
Join Date: Jun 2020
Location: Brno
Posts: 90
Quote:
Originally Posted by Estrayk View Post
OFFTOPIC to the coders.
I would like to know what has been the most difficult sinus-scroll to program that you have seen.
Med-Red Slayer/SCX or Corto/QTX ones maybe?
Not sinus-scroll per se, but very impressive indeed: Mr. Mega Mind in various cracktros [ Show youtube player ].
defor is offline  
Old 18 October 2021, 18:32   #11
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
Quote:
Originally Posted by defor View Post
Not sinus-scroll per se, but very impressive indeed: Mr. Mega Mind in various cracktros [ Show youtube player ].
Have always been impressed with that one since the day it was released!
DanScott is offline  
Old 18 October 2021, 18:51   #12
Int42
Registered User
 
Join Date: Oct 2021
Location: Berlin/Germany
Posts: 12
Wow awesome tipps here from you guys, thx a lot.

I'm interested in every 1 pixel Sinusscroll, easy to code or fastest.

How is this DoubleSinus coded? at minute 5:23
[ Show youtube player ]

Last edited by Int42; 18 October 2021 at 19:05.
Int42 is offline  
Old 18 October 2021, 19:33   #13
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
Quote:
Originally Posted by Int42 View Post
How is this DoubleSinus coded? at minute 5:23
[ Show youtube player ]

Quite probably the same as a regular sine scroll, but rendering the strips into a wider screen buffer (enough to allow for plenty of horizontal scrolling per scan line)

So if you have a regular 320 pixel wide screen, and you want to apply 64 pixels of left/right sinus too, you'd render your standard sin scroll into a 384 pixel wide screen buffer
DanScott is offline  
Old 18 October 2021, 20:11   #14
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Any coder with some experience should be able to surpass Slayer's sine scrolls with today's knowledge available; as mentioned, there's some room to bandwidth ceiling using the simple approach.

The Paradox intro uses prepared code/data lumps to plot or not plot into a fixed pattern. This was first used by Fuzzac in Tropical Sunset/TSL and is not related to sine scrolls at all.

Quote:
Originally Posted by Int42 View Post
I'm interested in every 1 pixel Sinusscroll, easy to code or fastest.
I don't think anyone has beaten Blu Sky yet. It's close to bandwidth ceiling.

[ Show youtube player ]
Photon is offline  
Old 18 October 2021, 22:26   #15
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by DanScott View Post
That's going to be horrendously slow though.

The quickest way to do a tall sine scroll (for example, font is 128 pixels high), is to plot the vertical edge points with the CPU, and then blitter vertical XOR fill. You can be filling the previous buffer while the CPU is plotting the next set of spans.

Another option is to use an animated font (sounds crazy, but does work.. have a look at Vision - "Can't Be" demo for a good example). This is probably the absolute fastest way possible.

[ Show youtube player ]
Plotting with the CPU, must admit I didn't think of that. Are you like tracking the x,y of each set of vertical points and "scrolling" them left - I guess you can do that quickly? I did my big sine (with your help) just with the usual blitter columns and a big modulo to skip all the lines in between - never crossed my mind to try and plot with CPU
Antiriad_UK is offline  
Old 18 October 2021, 22:28   #16
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by Photon View Post
I don't think anyone has beaten Blu Sky yet. It's close to bandwidth ceiling.

[ Show youtube player ]
I think you said in the demo it was memory limited. Would love to know how it worked.
Antiriad_UK is offline  
Old 18 October 2021, 23:12   #17
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Gha... I've a déjà vu
ross is offline  
Old 18 October 2021, 23:16   #18
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,209
Quote:
Originally Posted by Antiriad_UK View Post
Plotting with the CPU, must admit I didn't think of that. Are you like tracking the x,y of each set of vertical points and "scrolling" them left - I guess you can do that quickly? I did my big sine (with your help) just with the usual blitter columns and a big modulo to skip all the lines in between - never crossed my mind to try and plot with CPU

The perspective correct textured greets scroller in Colombia is based on the same technique
DanScott is offline  
Old 19 October 2021, 13:39   #19
defor
Registered User
 
Join Date: Jun 2020
Location: Brno
Posts: 90
Quote:
Originally Posted by DanScott View Post
The perspective correct textured greets scroller in Colombia is based on the same technique
I thought it used those "prepared lumps" Photon mentioned above Therefore similar to those crazy twisting scrollers from the past. Silly me.
defor is offline  
Old 19 October 2021, 15:21   #20
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
Remember to use Interleaved bitmap, that'll give you one blit pass for one line
sandruzzo is online now  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alien Breed II title pixel by pixel logo removal dex project.Sprites 17 06 May 2020 15:23
Sine scroller pmc Coders. Tutorials 95 02 July 2017 16:40
Sinus Creator/Editor Legionary Nostalgia & memories 2 11 February 2017 17:49
Working / Creating Sinus tables h0ffman Coders. Tutorials 6 15 January 2011 23:37
Corkscrew scroller pmc Coders. Tutorials 33 01 September 2010 12:41

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 09:06.

Top

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