Line scroll & VDP mode regs

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Line scroll & VDP mode regs

Post by powerofrecall » Mon Sep 12, 2016 4:29 pm

If I'm doing a split scroll background with line scroll, do I absolutely have to fill out the entire horizontal scroll RAM per line?
It seems pretty wasteful to have to fill it out for every single line when most of the values are duplicated. Especially when I have 2 or 3 "row" splits (VDP's in line scroll mode the whole time) and 32-64 actual scrolling lines.

Can the mode reg be set at hblank? So I could have like

line 0 - > full scroll
line x(-1?) -> cell scroll
line y(-1?) -> line scroll

and just fill out the relevant values in the scroll table?

Obviously this would effect both planes, so I don't know how useful it would be in practice, but can it be done?

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: Line scroll & VDP mode regs

Post by Mask of Destiny » Mon Sep 12, 2016 6:11 pm

I believe the horizontal scroll mode setting takes effect once per line since that's how often the scroll values are read. I don't see any reason why your scheme wouldn't work in principle. Another option is to just use full screen mode and then update the scroll value with horizontal interrupts. Which is preferable probably depends on what you're trying to optimize for.

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Re: Line scroll & VDP mode regs

Post by powerofrecall » Mon Sep 12, 2016 7:00 pm

I ended up splitting my line scroll buffer in RAM into two contiguous buffers for each plane which are then interleaved into VRAM through a couple of offset DMAs. Speed isn't a problem so far because my game logic isn't that complex yet, but I like the idea of using the full plane scroll in hblank too. Either way, you got me thinking about how to solve a problem, which is the most important thing. Thanks!

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Line scroll & VDP mode regs

Post by KanedaFr » Sun Sep 18, 2016 10:47 am

a little late on the subject but you also could use reg 10 and set hint to occurs less than every line
In theory you could also change reg 10 while on hint ....bu never tried

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Line scroll & VDP mode regs

Post by Sik » Sun Sep 18, 2016 4:11 pm

You can but the counter has already been loaded, so it won't take effect for the next interrupt but the one after that =/ (making it kind of pointless)
Sik is pronounced as "seek", not as "sick".

Post Reply