Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Diagonal Scrolling
2016-05-25 22:49
TWW

Registered: Jul 2009
Posts: 545
Diagonal Scrolling

So I figgured I'd try my hands on doing a 8 directional scroll routine. Figgured it would be pretty straight fwd. but have done attemts in the past where I got lost in the code (dual screens buffer, edge buffers etc) so build a nice framework to handle IRQ sequencing, async, events etc. and looking really good.

hen a snag I didn't enticipate. 6 directions works perfectly fine but consider this:

1 8x8 picel character, where to place the center?

Obviously at (4,4), (4,5), (5,4) or (5,5) considering coordinates from 1-8.

But with diagonal scrolling it will not meet the 'edge' for $d016 and $d011 at the same time and it's all messed up unless I cheat (which is what I'll end up doing) by setting any of the formentioned coordinates as (4.5, 4.5) and the first move is to move into one of the four coordinates depending on direction.

So before going ahead and doing this, I wondered if anyone have solved this differently?

NB. It's not freedirectional and scrollspeed is 1 pixel pr frame.

EDIT1: Ignore

EDIT2: EDIT1 is crap!
2016-05-26 03:48
Oswald

Registered: Apr 2002
Posts: 5094
http://cadaver.homeftp.net/rants/scroll.htm
2016-05-26 06:58
cadaver

Registered: Feb 2002
Posts: 1160
When doing "stepped" 8-directional scrolling like you describe, I've always cheated: if necessary, adjust the char center as the scroll step begins, so that I know I will reach the char edge in a fixed number of frames. According to my tests it hasn't looked too unappealing, at least when it's a game and the player can't really pay attention to the scrolling only :)

Don't think there's a way around it if you want to shift the screen memory only once per step.
2016-05-26 09:17
Bob

Registered: Nov 2002
Posts: 71
Yes its a bitch!
anyhow in double buffer you will suffer :) and prolly end up cheating with table speeds that avoids the unalignments of d016 & d011.

With a single buffer it is much simplier.. lets say having only chars for output..

then I would recommend a full copy of the data directly to the screen, and not using step scrolling.. the code is acutally much simplier and it is easier to calculate with sine... and is not dependent on anything and you can have much unalignment as you want ;)

doing this in bitmap is different... I am still figuring out this with doublebuffers...

with AGSP (Vsp + Crunchlines) it is a bit easier actually because you don't have the double buffer, (ok it is not that easy actually) , need to limit the speeds to 4 to avoind most of the problems, but then you have no alignment issue here.
2016-05-26 09:21
Oswald

Registered: Apr 2002
Posts: 5094
(4.5, 4.5)

actually not a bad idea. subpixel it.
2016-05-26 10:24
Style

Registered: Jun 2004
Posts: 498
I dont actually understand the problem. Can someone explain?
2016-05-26 10:49
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: I dont actually understand the problem. Can someone explain?

Just read Cadaver's rant.
2016-05-26 22:41
Style

Registered: Jun 2004
Posts: 498
Oh yeh, I geddit.

Just VSP/linecrunch.
2016-05-27 04:18
ChristopherJam

Registered: Aug 2004
Posts: 1409
VSP+linecrunch comes with its own set of issues (sprite pointers, losing a a couple of rows at the top of the screen), but I was thinking that a single char of VSP combined with CSEL nuking two columns instead of one could effectively give you a 16 pixel x-scroll register (first time 38 column mode is more useful than 39 :P )

I think that means that, as long as you always take a few frames to transition from dx=1 to dx=-1 and a few frames to transition from dy=1 to dy=-1 you can then defer any coarse x movement until you've finished with the last coarse y movement

Of course, as Cadaver's rant pointed out, if you just decide every 8 frames what you're going to be doing for the next 8 then you avoid all that arsing about, and never have to do a horizontal and vertical char move in sequential frames; it's just a straight diagonal hop whenever you cross both edges at once. Should be able to engineer a push-scroll to work with the same limitation, too.
2016-05-27 04:25
ChristopherJam

Registered: Aug 2004
Posts: 1409
Question though - what do you mean by "not free directional"? How is the scrolling controlled, and what constraints can you place on it?

Also, how many cycles do you have free per frame for scrolling?

It might be a lot simpler just to chase the raster decrunching the entire screen from the tile data; should be easily under 25,000 cycles, so if you can spare 12k per frame then all you need to do is avoid the case where you clip the corner pixel of a char grid alignment for a single frame.
2016-05-27 08:38
Frantic

Registered: Mar 2003
Posts: 1648
Quote:
Question though - what do you mean by "not free directional"?


It can only scroll in eight directions?
 
... 5 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
csabanw
Guests online: 103
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.063 sec.