Jump to content
IGNORED

A sine form scrolline - HOW?


Marius

Recommended Posts

Hi folks,

 

I know... it is not common to ask for someone to reveal a trick.

 

But perhaps someone can tell me in which direction I have to think.

 

I want to be able to create a scrolline that follows a sine waveform.

 

I know how to do a bouncing scrolline. that is rather easy with altering the Display List all the time.

 

But when characters do have to change their position individually ... it is getting a lot harder.

 

Question 1:

Can someone provide a source code, or hints, to simply put a character on a certain location? Like on X,Y (like position command in BASIC)

 

Question 2:

Can someone provide a source code, or hints, to simply put a DOT on a certain location in a Graphics 8 (Antic F) graphics screen?

 

Question 3:

Who wants to give away a source code of just a scrolline in sine waveform moving over a Graphics 0 screen?

 

 

I really want to get better in Atari 8bit programming, and I think this is really an interesting subject, but i have to admit: I don't get any further.

 

I hope someone can and wants to help.

 

THANKS!

Marius

Link to comment
Share on other sites

Using PMs you can do it easily but then you're very limited with how many characters across you can have.

 

Doing it in char or bitmap... you'd have to move the lettering around dynamically, the VSCROL register can't be changed on the fly to produce what you want.

 

It wouldn't be so hard... they're characters so there's no worrying about shifting - the HSCROL is handling that. So in effect all the hard work is just moving them up and down by however many pixels is required.

 

SIN table you can just build with a quick Basic program, scale the values to suit what you're doing. Build multiple tables if needed also.

 

In Assembler, you can scale up/down the waves with simple bitshifts, you can compress or stretch the waveform simply by altering the rate at which you skip through the table.

 

I guess the other decision to make is whether you want the letters simply placed at a given YPos on the sine curve, then moved right to left, or if you want the text to be actually moving up and down as well when it scrolls.

 

Plan B there adds that extra bit of complexity, and means you'd be moving 21 or 42 or so objects around at once... but since you have them stuck on byte/character boundaries it means you don't have any worries about shifting and masking like with softsprites.

Link to comment
Share on other sites

@Rybags

 

Thanks for your hints and ideas.

 

I have to say these were close to my thoughts so far. But I don't see myself creating a working sine scroller so far :s ...

 

Graphics is hard for me, since I'm not a GFX man... I don't "see it" without actually seeing it. But I really want to get there... So I'll keep trying.

 

I hope someone can provide a simple source (with just doing this) ...

 

Thx.

M.

Link to comment
Share on other sites

it is straight forward. as Rybags wrote...

 

your routine needs to plot 41 chars in Gr.8. so... actually you simply copy data from font towards the gr.8 screen. and after each char you are getting the new y-pos from the sin table and plot the next char. until you have 40 on screen. then you scroll via $d404 one color clock. ergo you are drawing again the whole bunch of chars and increase the starting point in your sin table so the chars are moving up/down.

 

obviously you would need 4 charsets as you need preshifted charset for 4 movements.

Edited by Heaven/TQA
Link to comment
Share on other sites

Maybe just try initially by plotting the characters and not trying to move them up/down, just have them plotted in the sine pattern as you go along, worry about the more complex part later.

 

Don't worry about graphics - in such testing phases, just grab a copy of the OS chset and use that.

Link to comment
Share on other sites

@rybags and taquart

 

Ah... I think I overlooked one thing. Graphics 8 (Antic F) is ofcourse just lines of the size of ONE pixel.

 

But still... It's rather complicated for me. When I read your comments I think: ah yes... ofcourse... yes... but then I'm thinking on how to put that in my Atari and then my thoughts are: ???

 

Hehe I think I have to think it over a few more times.

 

And why do I need 4 charsets?

Link to comment
Share on other sites

You should be able to get away with 1 charset per 2 text lines.

 

Since the letters are plotted anywhere within a cell, obviously most will overlap 2 character cells (assuming here using standard sized characters).

 

Might make things easier to use character codes that go 0, 2, 4, 6 etc on top line and 1, 3, 5 etc on bottom. That way when plotting the character it's just a straight write to memory.

 

Then for your actual screen data you have it go from 0, 2, 4 ... 124, 126, 0 again. Have the 0, 2, 4 sequence repeated after 124, 126 and when it gets to the point where character 0 is the first one onscreen, reset your pointers in the LMS instructions back to the origin point.

 

So, that should mean the RAM requirements for the text mode are fairly small.

 

The character set definitions, you're redefining character bitmap data in a cyclic fashion. But there's no problem since only 98 of them are being fetched by Antic at any given time (ie 2 * 49 in Wide DMA mode)

Link to comment
Share on other sites

would this be like a DYCP scroller on the c64?

 

if so... Assuming you are using an 8x8 charset in a character mode you need 2 characters per screen column laid out like this:

 

02468 (continue for the whole width of the screen)

13579

 

Then masking the bottom 3 bits off (AND #$07) the Y position gives you the offset to copy the 8 bytes of character data to (so the first one would flow out of the bottom of character 0, into character 1, the second would flow out of character 2 into character 3, etc...) and then you shift the Y position right 3 bits to find the Y position of the characters onscreen. the X part of the scrolling would be handled using the scroll registers

 

That way of doing it should work on pretty much any machine with a character based screen layout

Edited by sack-c0s
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...