How to make a sinus scroller?

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

qwe
Atari nerd
Atari nerd
Posts: 46
Joined: Mon Oct 29, 2012 10:06 pm

How to make a sinus scroller?

Postby qwe » Sun Oct 20, 2013 9:17 pm

Hi to everybody.
Does anyone know how to make a sinus scroller?
Where can I found the theory to make it?
Have someone an example code in assembly?
Thank you.

!cube
Atari maniac
Atari maniac
Posts: 80
Joined: Thu Jun 14, 2007 6:37 am
Location: Vantaa, Finland
Contact:

Re: How to make a sinus scroller?

Postby !cube » Tue Oct 22, 2013 9:34 pm

I guess the answer depends heavily on what kind of sinus scroller. 1/2/4/8 bit sinus scroll? Height of the font?
Kludge power since 1976.

qwe
Atari nerd
Atari nerd
Posts: 46
Joined: Mon Oct 29, 2012 10:06 pm

Re: How to make a sinus scroller?

Postby qwe » Wed Oct 23, 2013 6:55 am

I'd like to make a sinus scroller like this: https://www.youtube.com/watch?v=8sFKEkc4xgo.
Is the Atari St able to do this or only an Amiga thanks to its custom chip can do it?

User avatar
Mug UK
Administrator
Administrator
Posts: 11321
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: How to make a sinus scroller?

Postby Mug UK » Wed Oct 23, 2013 10:31 am

I'll have a look as I've got lots of old demo /intro source code knocking about.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

wietze
Captain Atari
Captain Atari
Posts: 220
Joined: Fri Mar 01, 2013 10:52 pm

Re: How to make a sinus scroller?

Postby wietze » Wed Oct 23, 2013 11:19 am

A quick glance at pouet finds me: http://www.pouet.net/prod.php?which=27630

User avatar
Mug UK
Administrator
Administrator
Posts: 11321
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: How to make a sinus scroller?

Postby Mug UK » Thu Oct 24, 2013 12:21 pm

I think this is one by Griff of Electronic Images. It's got a sinus scroll in the middle of the screen (give it a few seconds).
You do not have the required permissions to view the files attached to this post.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

qwe
Atari nerd
Atari nerd
Posts: 46
Joined: Mon Oct 29, 2012 10:06 pm

Re: How to make a sinus scroller?

Postby qwe » Fri Oct 25, 2013 8:23 am

Thank you very much.

qwe
Atari nerd
Atari nerd
Posts: 46
Joined: Mon Oct 29, 2012 10:06 pm

Re: How to make a sinus scroller?

Postby qwe » Mon Nov 11, 2013 10:00 pm

Hi guys.
I dismounted the code of the demo and I isolated routines to draw only the sine scroller.
Who wrote the demo was a very experienced coder but unfortunately he did not commented the code very well and for a beginner like me is impossible to understand how the algorithm works.
However reading the source code I learned some advanced programming techniques such as the jump table.
The programmer did not use trap instructions but changed the status register instead; this is a strange way for me to coding.

seedy1812
Atari User
Atari User
Posts: 33
Joined: Tue May 18, 2010 2:04 pm

Re: How to make a sinus scroller?

Postby seedy1812 » Mon Nov 18, 2013 10:44 pm

Ok heres a rough outline , I have code on my ST which is about 300 miles away.
Basically we need to draw vertical lines which when put next to each other look like some text.

A1 points to a table of offsets from one Y to the next ,A0 points to the screen. We start D7 with 0x8000 - so that or.w d7,(a0) would plot the first pixel on the screen.
For each new line we ror.w #1 ,d7 and when the X flag gets set we know we have to move onto the next word

add.w (a1)+,a0
draw pixels
ror.w #1,d7
bcc.s no_add
lea 2(a0),a0
no_add:


draw next line of pixels.
wash rinse repeat until you get to the end of the list or end of the screen

To draw a vertical line of pixels you scan through an image and for example a box ( 1,2 and 3 are the vertical lines )

123
1 3
123

line 1 would be

or.w d7,0*320(a0)
or.w d7,1*320(a0)
or.w d7,2*320(a0)

and the 2nd line would be

or.w d7,0*320(a0)
or.w d7,2*320(a0)

and the last line would be the same as the first

or.w d7,0*320(a0)
or.w d7,1*320(a0)
or.w d7,2*320(a0)

If the font is simple then you could map each vertical line in the font and call the routine ( don't recreate duplicates)
then each draw line could be jsr (xxxx.l) where you write in the address for each line or have a table and have a load of jsr(d16,an) where an is a list of the functions to draw each scan line or you could create self modifying code which creates the scan lines and you only need to know the addresses of the start of the last 320 functions


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 3 guests