DMA transfer to CRAM visible however the screen is off.

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

tryphon
Very interested
Posts: 231
Joined: Sat Aug 17, 2013 9:38 pm
Location: France

Re: DMA transfer to CRAM visible however the screen is off.

Post by tryphon » Wed Dec 09, 2015 8:42 am

LocalH wrote:I still wonder if there are secrets left to unlock in the VDP. For years we didn't know the normal MD VDP has a 128KB VRAM mode, but it does :)
Oh ? And it's usable ?

LocalH
Very interested
Posts: 152
Joined: Tue Dec 19, 2006 5:04 pm

Re: DMA transfer to CRAM visible however the screen is off.

Post by LocalH » Wed Dec 09, 2015 8:55 am

It's my understanding that it is, as long as the additional RAM is wired up properly. Here's a thread about it.

LocalH
Very interested
Posts: 152
Joined: Tue Dec 19, 2006 5:04 pm

Re: DMA transfer to CRAM visible however the screen is off.

Post by LocalH » Thu Oct 12, 2017 7:08 am

Bumping to make sure everyone knows that apparently, Traveller's Tales almost had direct color DMA in 1993, they just couldn't figure out how to sync to the VDP. Check this video.

User avatar
Sik
Very interested
Posts: 611
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: DMA transfer to CRAM visible however the screen is off.

Post by Sik » Thu Oct 12, 2017 7:55 am

Yeah, it has actually been mentioned here that somebody in the '90s had almost figured it out (although it had never been mentioned who), but they couldn't get it to sync reliable and put it into use in a reasonable way.

Also from the comments:
" I'd love to see some demoscene that can take advantage of this knowledge! "
" Check out overdrive and overdrive 2. They both use this trick. "
" dogen I meant more prod teams than just titan :p"
(・ω・`)

(bonus irony in that they actually don't use it)
Sik is pronounced as "seek", not as "sick".

User avatar
greatkreator
Very interested
Posts: 153
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Re: DMA transfer to CRAM visible however the screen is off.

Post by greatkreator » Thu Oct 12, 2017 8:16 am

An interesting feeling to know now how it's easy to sync VDP...
It's really strange they couldn't do that in 1993.
No magic. Just overload VDP and make a fine pause after that.

User avatar
Sik
Very interested
Posts: 611
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: DMA transfer to CRAM visible however the screen is off.

Post by Sik » Thu Oct 12, 2017 8:35 am

There's more to it, you need to land on a refresh slot to get it to sync, otherwise it doesn't work - which to do reliably requires that you actually know about the refresh slots in the first place - not to mention trying to fill up the FIFO during passive scan, which usually wouldn't happen. Also it eats up a lot of space (covering the full screen requires more memory than is in RAM, for context). And then there's the refresh slots in the middle of the line causing some columns to be wider... (notice how he always is showing zoomed in images in that video, he's probably trying to avoid showing the wider columns)

It's not hard to see how it got missed, heck I remember Nemesis being surprised that the sync point could be found at all when he analyzed how it worked. And even if it was found, the wider columns probably would have made the idea to be discarded.
Sik is pronounced as "seek", not as "sick".

User avatar
greatkreator
Very interested
Posts: 153
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Re: DMA transfer to CRAM visible however the screen is off.

Post by greatkreator » Thu Oct 12, 2017 9:07 am

Even he shows such zoomed images I can see clearly those damned columns.

The most important to know is that it's possible to sync. But it doesn't help too much.
Personally for me those wide columns destroy everything.
I could ignore 2x1 sized pixels.
But I can't ignore those wide columns. They just pop up and make my eyes bleed.
I tried to train myself to tolerate them but I couldn't.

Even if I tried to use 2x2 pixels with a decreased resolution 160x112 the wide columns were too noticeable.

It's really sad because I had huge plans for that.
I still remember my excitement when I could sync VDP and show the image with unlimited colors.
And I still remember my disappointment when I realized it's impossible to use it.

LocalH
Very interested
Posts: 152
Joined: Tue Dec 19, 2006 5:04 pm

Re: DMA transfer to CRAM visible however the screen is off.

Post by LocalH » Sat Nov 18, 2017 4:44 pm

There's a ROM release over at gamehut.com if anyone wants to inspect their technique and compare it to the modern one.

NekoNiaow
Newbie
Posts: 5
Joined: Sun Dec 24, 2017 7:35 pm
Location: Montréal

Re: DMA transfer to CRAM visible however the screen is off.

Post by NekoNiaow » Sun Dec 24, 2017 9:37 pm

Out of curiosity, why were you using 8 + 8 colors for the image instead of say 56 static + 8 dynamic?
Did you intend to display some sprites or a moving layer on top of the image?

Just curious. ;)

User avatar
greatkreator
Very interested
Posts: 153
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Re: DMA transfer to CRAM visible however the screen is off.

Post by greatkreator » Sun Dec 24, 2017 10:06 pm

A VDP palette has 16 colors.
You can't use 56+8 colors.

If you make a heap of layers than you should transfer a lot of image index data for each layer.
VDP barely can transfer them for one single layer.

NekoNiaow
Newbie
Posts: 5
Joined: Sun Dec 24, 2017 7:35 pm
Location: Montréal

Re: DMA transfer to CRAM visible however the screen is off.

Post by NekoNiaow » Sun Dec 24, 2017 10:30 pm

greatkreator wrote:
Sun Dec 24, 2017 10:06 pm
A VDP palette has 16 colors.
You can't use 56+8 colors.

If you make a heap of layers than you should transfer a lot of image index data for each layer.
VDP barely can transfer them for one single layer.
Thanks for the answer!
Ok, so If I understand you correctly this implies that your image is dynamically changing and these changes have to be transferred every frame?

I naively assumed that the image was fully static and was pre-transfered, leaving only CRAM data DMA transfers to handle for the four available palettes.
(Unless there is also something in the VDP documentation that I misunderstood, which is always possible.)

User avatar
greatkreator
Very interested
Posts: 153
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Re: DMA transfer to CRAM visible however the screen is off.

Post by greatkreator » Sun Dec 24, 2017 10:48 pm

I guess I confused something and didn't understand you right.

NekoNiaow
Newbie
Posts: 5
Joined: Sun Dec 24, 2017 7:35 pm
Location: Montréal

Re: DMA transfer to CRAM visible however the screen is off.

Post by NekoNiaow » Sun Dec 24, 2017 10:59 pm

Hey no worries, that happens to me every 10 minutes. ;)

So to get back to my original questions: did you try with more colors than just one palette? ;)

User avatar
greatkreator
Very interested
Posts: 153
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Re: DMA transfer to CRAM visible however the screen is off.

Post by greatkreator » Sun Dec 24, 2017 11:14 pm

Actually I did intend to display an "almost" direct color image.
And it's almost successful.
It's possible to reload 48 colors per screen line thus you have 12 dynamic + 4 static colors per palette.
But it doesn't help too much as long as you can't overlap those colors.
Each 16 colors are bounded by their respective palette.
The only useful way to use I found was to split the screen in four vertical columns each 9 tiles wide and assign each palette to each column.
It depends very much on exact image but in general it produces impressive results.

On average an arbitrary image having 512 (max for 3-bit RGB) number of colors has been transformed to 150-250 colors processed image.
Very colorful and noisy images cause noticeable artifacts when they change quickly.
Static images are almost perfect.

The only limitation the image has 38x26 size because the screen is turned on 8 lines later and turned off 8 lines earlier to increase DMA time for image index transfer. And the same for the left and right sides. The screen is turned off 8 pixels earlier to increase DMA time for HBLANK transfer and respectively turned on 8 pixels later.

You can get an "almost" direct-color image having 288x192 size. I like it much more than blast processing DMA to background color with 160x224 resolution and with 2x1 pixels and the columns of artifacts.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 3 guests