Horizontal Scroll Mode question

For anything related to VDP (plane, color, sprite, tiles)

Moderators: BigEvilCorporation, Mask of Destiny

Post Reply
NightShadow
Interested
Posts: 19
Joined: Sun Oct 14, 2012 10:20 pm

Horizontal Scroll Mode question

Post by NightShadow » Thu Dec 07, 2017 7:06 pm

Hi


I'm experimenting with Scrollmodes and to my surprise I will not be able doing what I wanted.

I didn't know that we had to set the same Scrollmode for both Plan using VDP_setScrollingMode().

My game is a 2d Jump and Run. I though I could set Line Scroll for Plan B to create different Levels of Parallax.
The thing is that I don't need to scroll per line for Plan A but it seems that it's locked for both Plan A and B and unfortunately it's too slow to call HorizontalScollLine() 2 times.

Ideally I would even prefer a way of scrolling little parts of the Plan in line mode. Line 0-20, Line 100-120. ..

I wanted to see if it was possible to switch the ScrollingMode within the same frame but unfortunately it's not.

I tried Scroll per Tile but to my deception it's even worse because this way I'm even limited to not being able to scroll Y because the Horizontal Tile scrolled Y position doesn't fit to the VDP Memory Plan Lines, it's positionned to the Screen Lines... like sprites. Don't know if you will understand because it's hard to explain ;-)

Before continuing my Project I really need to know if there's a way to counter this problem or else I'll have to forget about some nice effects I wanted to add.

Probably if my game would not be so heavy it wouldn't be a problem but I'm almost wondering if it's possible to achieve a 60fps game using these fonctions and some other stuff. Mine is already running at 30fps but using HorizontalScollLine() for both planes slows it down to constant 20. but keep in mind I'm already doing a lot of stuff... Adding the super scrolling was the last heavy code to add to my game before I can concentrate on creating levels. In not too long I should be able to release some screenshots or a small video.


So my question is: is there a way to optimize Per Line Scroll techniques to my needs without having to set and lock it for 2 differents planes ? and if possible, only use PerLine scroll for small sections of my screen.


Thanks for help

User avatar
Stef
Very interested
Posts: 2756
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Horizontal Scroll Mode question

Post by Stef » Thu Dec 07, 2017 7:38 pm

Do you use DMA to transfer the scroll table ? Also you should do it in VBlank for faster transfer.
But yeah you can't set different scrolling mode on plan, they both share the same scrolling mode.
You can also use the h-interrupt to change horizontal scroll on specific line, but given the number of line you need to change i think it won't be faster...
Normally updating scroll table should not slow down that much, maybe you're transferring too much data per frame.. updating both H scroll tables shouldn't take more than ~1KB on the 7 KB available by VBlank.

NightShadow
Interested
Posts: 19
Joined: Sun Oct 14, 2012 10:20 pm

Re: Horizontal Scroll Mode question

Post by NightShadow » Thu Dec 07, 2017 9:46 pm

Hi Steph

Thanks for fast reply.

Wow I just made some test by putting off some tiles streaming and some effects and it seems using Line Scroll is really possible in majority of cases. Unfortunately I am already pushing hardware to limits.. I think I overloaded VDP operations and I didn't think Using Line Scroll would take much bandwith... Still 1kb of 7kb is really good, I just already had that full 7kb used. Lol
I can't confirm this but is it possible that Raster effect on C64 is much lighter on the processing than on the Genesis ? I think that was the same thing for both machine.

Is the DMA transfer is used to move graphics stuff or it's to speed up the scroll value list in case of a lot of lines to change ?

Now, is it possible to set Scroll mode to Plane, and also use the H-Interrupts on only about 30-40 Lines to speed up things ?
This would be my last optimizing tricks if I hope to be able doing what I would like to achieve, or else I will have to cut some stuff down.

User avatar
Stef
Very interested
Posts: 2756
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Horizontal Scroll Mode question

Post by Stef » Fri Dec 08, 2017 9:32 am

If you are transferring more than 7 KB per frame then definitely that is a problem as your DMA would extend in active period and make the whole thing slow down a lot (as transfer are much slower in active period).
What you can do is to extend the blank area, for instance you blank 16 lines at top and at bottom (giving you 32 extra lines for fast transfer), than way you can extend the classic 7 KB transfer per frame to 12/13 KB per frame. To do that you have to use the H interrupt of course (disabling VDP at line 208 and re-enabling at line 16), then your final vertical resolution become 192 instead of 224.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests