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 > Don't know how to use screen mode 6. Any examples?

#46613 - Locke - Tue Jun 28, 2005 2:02 am

If I'm not wrong, mode 6 can draw a 512x1024 or 1024x512 16bit (555) bitmap into one screen, but I couldn't find any info about how it works and how to use it, so I have some questions:

1. I gess the "bitmap" is raw pixel data without header, instead of a standar bmp, correct?

2. The size of the file would be 1MB so it does't fit into any VRAM bank. Is it stored in the main memory or the cartridge?

3. How can I state if I want to use 1024x512 or 512x1024 and which portion of the bitmap I want to be displayed on the screen?

Thanks for your time.

#46638 - A6M Zero - Tue Jun 28, 2005 3:07 pm

Hi Locke ("john" ? :) )

well (from memory, I'm not on my home pc)
mode 6 uses 256 colors palette mode, not a "hicolor" 16 bit raw, so there's only 8 bits per pixel, and it use the bg palette.

so, 1024x512=512 kB.
You have to use the 4 first banks just for it :

Code:

vramSetMainBanks(VRAM_A_MAIN_BG,VRAM_B_MAIN_BG,VRAM_C_MAIN_BG,VRAM_D_MAIN_BG);


to move the screen, use BG2_CX and BG2_CY.


for the bitmap size : BG2_CR = BG_BMP8_1024x512 or BG2_CR = BG_BMP8_512x1024



hope i could help :)

#46645 - Locke - Tue Jun 28, 2005 4:16 pm

Got it, thanks for your answer.

I'm trying to create a jpg decoder, so 256 colors is not enough quality. I gess that the only way will be decompressing each page in main memory and copying the focused region to the framebuffer...

PD. It's Locke Cole from FinalFantasy6, not John Locke ^^

#46650 - jstart - Tue Jun 28, 2005 5:11 pm

The dualis site has a mode 6 demo hosted http://dualis.1emulation.com/files/demos/mode6.zip
Just looked at it I think it's in asm so its kinda weird but maybe it will help
_________________
-=Jstart=-


Last edited by jstart on Tue Jun 28, 2005 11:05 pm; edited 1 time in total

#46658 - Locke - Tue Jun 28, 2005 8:06 pm

Thanks, I'll take a look at it.