gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Direct writing to VRAM

#112682 - akalenuk - Tue Dec 19, 2006 12:56 pm

Is it possible to write data directly into VRAM? Isn't it mapped as a regular ROM?

To put it straight - I need to put pixel of a specific color on the subscreen over all backgrounds and objects. How can I do that?

#112684 - nornagon - Tue Dec 19, 2006 1:19 pm

VRAM does not support byte writes, only halfword writes. That means, if you want to set one pixel, you have to read the halfword it's in, set the pixel you want, and write it back.

#112692 - akalenuk - Tue Dec 19, 2006 2:21 pm

nornagon wrote:
VRAM does not support byte writes, only halfword writes. That means, if you want to set one pixel, you have to read the halfword it's in, set the pixel you want, and write it back.


Hm. Than might be the problem. On DS halfword 32 bits, right?

#112695 - Dark Knight ez - Tue Dec 19, 2006 2:30 pm

As far as I know, a word on the DS is 32 bits.
VRAM supports 16-bit writes.

You might want to look into doing something similiar as is done in doublec's tutorial.
*checks*
Access to the tutorial and his site in general seems to be forbidden... hmm...

Well, basicly, you can have an extended rotation BG, also known as ERB, also known as affine background. Such a background supports direct writing to it. Mode5 has an ERB which can be used. Look it up.
_________________
AmplituDS website

#112697 - akalenuk - Tue Dec 19, 2006 3:21 pm

Dark Knight ez wrote:

Well, basicly, you can have an extended rotation BG, also known as ERB, also known as affine background. Such a background supports direct writing to it. Mode5 has an ERB which can be used. Look it up.


Thanks. I'll try this ERB.

#112730 - nornagon - Tue Dec 19, 2006 11:05 pm

Framebuffer also lets you write pixels straight up.

A byte is 8 bits, a word is 32 bits, and a halfword is 16.

#112751 - tepples - Wed Dec 20, 2006 12:07 am

Extended rotation is almost always better than framebuffer mode. The big difference is that with extended rotation, you have to set bit 15 of each pixel, as values 0x0000 through 0x7FFF are considered fully transparent.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.