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 > DS Display Modes

#38229 - Darkain - Thu Mar 24, 2005 11:06 am

So, who has messed around with the display modes on the DS? So far, I have found out which modes have what for tiled backgrounds..

mode 0: bg0 bg1 bg2 bg3
mode 1: bg0 bg1 bg2
mode 2: bg0 bg1
mode 3: bg0 bg1 bg2
mode 4: bg0 bg1
mode 5: bg0 bg1


i have still only gotten bitmaps working in framebuffer mode. :(

does anyone have any idea as to why there is now 6 tiled background modes as apposed to 3 on the GBA?
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#38244 - darkfader - Thu Mar 24, 2005 3:07 pm

Different configs for selecting text/affine/affine extended...
I have no clue what an affine extended BG does though :)

#38248 - tepples - Thu Mar 24, 2005 5:05 pm

Possibilities: Affine extended backgrounds may use 16-bit map entries, may use more than 256 different tiles, may use flipping, may use 4-bit tiles, etc.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#38250 - dovoto - Thu Mar 24, 2005 5:48 pm

Using my viewer tool this is what i get

mode 0: bg0-t bg1-t bg2-t bg3-t
mode 1: bg0-t bg1-t bg2-t bg3-r
mode 2: bg0-t bg1-t bg2-r bg3-r
mode 3: bg0-t bg1-t bg2-t bg3-e
mode 4: bg0-t bg1-t bg2-r bg3-e
mode 5: bg0-t bg1-t bg2-e bg3-e

were -t are normal text backgrounds, -r are normal rotation backgrounds and -e are extended rotation backgrounds.

Extended rotation backgrounds use 16 bit tile indexes and can use an extended palette (16 256 color palettes) mapped into vram e, f or g. If the 256 color bit is set in the control register they operate as a 256 color bitmap of 512x256 or 256x512 (depending on the size bits). THere is also a way to make them a direct color bitmap according to firefly but I have not been able to achive this.

I have not investigated normal rotation backgrounds so am not sure if they are 16 bit or still 8 bit tile indixes

mode 6: bg2--8 bit bitmap (not sure about size but think it is BIG)

in all modes (except framebuffer mode) bg0 can be used as a 3D layer.

there are a lot of details to work out but i will do up a bit of a tutor with examples once i get it ironed out.

All of this comes from poking and filling memory with patterns and may not be correct. We will know better once people start attempting demos in each of the modes. Hopefully passmes start making it out soon ;)
_________________
www.drunkencoders.com

#38742 - Darkain - Thu Mar 31, 2005 6:04 am

been playing around w/ mode5 today.

BG3_CR
set BG_COLOR_256 for bitmap mode (unset for tile mode)
set BG_RS_32x32 for 256x256 bitmap (unset is 128x128)
set (1 << 2) for 16-bit bitmap (unset for 256 colour)
set BG_MAP_BASE(x) for bitmap byte offset in VRAM (where offset = x * 16kb)


16-bit is 16-BIT!!!! NOT 15-bit. it still uses 555 colour mode... plus 1 bit alpha. since it is now a background layer, gotta have SOME way to see thru it. ;)

example:
Code:
  u16 *DarkSrc = (u16*)DarkStar_raw;
  for (int i=0; i<45056; i++) {
    BG_GFX[i] = DarkSrc[i] | 0x8000;
  }



oh my gawd tho... ive been using a 256 palettized BMP image as a background all day on the DS... i gotta admit, i love being in 16-bit colour now. :)

im going to keep playing, and post more stuffs as i find it. (the next dsPaint is gonna KICK ASS)


[EDIT]
I would also like to note, the most common reason why your extended BG may not be showing up is because you may have forgotten to set something.
Code:
   BG3_XDX = 0x100;
   BG3_YDY = 0x100;
[/EDIT]
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#38745 - Darkain - Thu Mar 31, 2005 7:07 am

i would just like ot add that priorities work normally with these extended backgrounds just as you would expect them to. i now have tiles showing up underneath my bitmap image, and i have sprites on top of both.
_________________
-=- Darkain Dragoon -=-
http://www.darkain.com
DarkStar for Nintendo DS

#38790 - dovoto - Thu Mar 31, 2005 8:57 pm

Fucking alpha bit!
Thanks darkain.
_________________
www.drunkencoders.com

#38797 - ector - Thu Mar 31, 2005 9:54 pm

Dovoto, alpha bits seem to hate you :)

*remembers your texture debacle* ;)

#38815 - tepples - Fri Apr 01, 2005 1:23 am

Depends on whether or not you post alpha bits ;)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.