Jump to content
IGNORED

Vertical Scrolling with DLIs


Tezz

Recommended Posts

Hi all,

 

Does anyone have any programming sourcecode examples for vertical scrolling with DLIs?

 

This is proving to be more difficult than I had originally thought !

Vertical scrolling is very well documented in many articles although I can't find anything with DLI's used.

 

What I would like to achieve is to fine scroll one Graphics 12+16 screen from off the bottom border to the top of the display whist incrementing the position of the DLIs in sync. My display has several fonts used in it so I just need to repoint CHBASE in the DLI.

 

Thanks.

Tezz

Link to comment
Share on other sites

What kinds of problems are you running into? I don't see this as being to complicated. If the scanline where the DLI is needed doesn't change from frame to frame then you can just leave the DLI's set on those lines and the scrolling shouldn't effect it.

 

If the DLI scanlines have to change between frames then is should just be a matter of going through each display list intruction during Vblank, and setting the DLI bit on the appropriate lines.

 

Dan

Link to comment
Share on other sites

DanBoris What kinds of problems are you running into? I don't see this as being to complicated. If the scanline where the DLI is needed doesn't change from frame to frame then you can just leave the DLI's set on those lines and the scrolling shouldn't effect it.  

 

If the DLI scanlines have to change between frames then is should just be a matter of going through each display list intruction during Vblank, and setting the DLI bit on the appropriate lines.  

 

Dan

 

Thanks for that,

 

As this is going to be vertically scrolling upwards, the DLI positions will have to move up to display on the correct scanlines. I basically have one screen layout with 5 fonts used in it. so the DLI to repoint CHBASE is on 5 positions on the display. I will need to decrement the DLI positions in sync with the scrolling of the screen data upwards.

 

I suppose for a reasonably advanced coder this would not be very complicated as you say. I'm sure it's quite simple to do this.

 

My thought in doing this is that the screens Dlist with the appropriate DLI bits set could be read from a table and changed at the right time as the scrolling routine runs. Maybe to change to a new Dlist layout when 1 row (8 pixels) have scrolled up each row until the display reaches the top and then stops to leave a static display.

 

Any advice on acheiving this would be appreciated.

 

Tezz

;)

Link to comment
Share on other sites

:idea: how about this...

 

Because of the multiple fonts, using a v-scroll reg complicates things.

Can you not use scroll-registers and have a single 'blank' dlist entry at

the top of the screen with the DLI bit set.

 

When you want to scroll, change the number of blank lines displayed.

 

In the DLI, set the colors to background and then WSYNC a number

of times (e.g. 8-# blank lines) and then switch the colours on.

 

You'll need a similar DLI on the last line to set the colours to background.

 

Hence the fine scrolling is controlled by the dynamic blank dlist entry

and the viewing 'window' is maintained by turning on and off the picture

at the correct time.

 

Regards,

Mark

Link to comment
Share on other sites

i had years ago similar problem... solved it in that way that as schmutzpuppe suggested i added another "softscroll" register to each DLI to keep them on the same scanline...

 

but this isn't too much time consuming?

I think it is because you only can trigger the DLI at the beginning of the text line all other scanlines within the text line must be handled in this interrupt call.

That means that you have to use WSYNC until the scanline right before the next textline (where you can call the next DLI).

All in all you can do the whole thing in one DLI and only use WSYNC until the end of the visible screen (wouldn’t be a big difference).

WSYNC freezes the cpu until horizontal sync so it is time consuming.

Maybe there is a better way but I have no clue at the moment.

Link to comment
Share on other sites

A couple of thoughts on the course scrolling method required,

i.e. once the fine scrolling does its 8 lines...

 

1) (the easier) use a 6th font to scroll into, then when that's

exhausted re-use font 1 which is not displayed, and just keep

cycling around the fonts.

 

2) (slightly less memory used) once a line has been scrolled

adjust the dlist pointers foward one line in memory, but place

the line 1 chars after line 3. An alternative could be to hold 3

separate dlists and cycle though those. The course scroll

routine should then copy the char-data from font n to font n-1,

but only for the first line, e.g. 320 bytes

 

Looking at method 2, a 32 char wide playfield would permit

all 128 chars in a font to be used on 4 lines. The copy routine

would only be required to move 256 bytes of data per line,

speeding up to time taken to update the screen.

 

I may have an experiment with this at the weekend.

 

Mark.

Link to comment
Share on other sites

well, this is a little more complicated than first antisipated, you've certainly given me some different thoughts about the right method to use. A course scrolling based routine seems to be

 

2) (slightly less memory used) once a line has been scrolled  

adjust the dlist pointers foward one line in memory, but place  

the line 1 chars after line 3. An alternative could be to hold 3  

separate dlists and cycle though those. The course scroll  

routine should then copy the char-data from font n to font n-1,  

but only for the first line, e.g. 320 bytes

this was pretty much my line of thought and the way I was trying to do things.

 

Now it's time for me to try and write it!

 

If you all have any success with your tests and routines perhaps you can post them,

 

I look forward to reading this post further.

Link to comment
Share on other sites

I had some success with the first method, however timings

are very very tight! Updates are done in the VBI but if I add

a few more instructions in, a DLI occurs within another DLI

after doing the course scroll.

 

To get around this I have two options.

1) Leave the scrolling area until a little further down the screen.

2) Leave the course scroll until after the last lines are drawn

 

I'll try 2 first and post up the code so far.

My version currently scrolls up (e.g. like scrolling instructions)

but I try to add a down mode as well (e.g. shoot-em-up)

 

Regards,

Mark

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...