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 > 2nd screen, mode 0

#144753 - doudou - Tue Nov 06, 2007 6:02 pm

Sorry, I'm sure this topic is already mentionned somewhere, but I did my search and I need some help...

I just want to get started using the subscreen in mode 0. Tutorials I have seen so far are using it in bmp mode. Can someone refer me to a tutorial / forum topic?

Thanks

#144755 - knight0fdragon - Tue Nov 06, 2007 7:21 pm

there is no bmp bg for mode 0, you are reading it wrong

http://nocash.emubase.de/gbatek.htm
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#144757 - doudou - Tue Nov 06, 2007 8:02 pm

The "it" in "using it in bmp mode" meant the 2nd screen, not the Mode 0.

I'll have a look at your links, thanks.

#144769 - josath - Tue Nov 06, 2007 11:47 pm

here's a partial tutorial on using mode 0:
http://www.dev-scene.com/NDS/Tutorials_Day_4

#144779 - tepples - Wed Nov 07, 2007 2:36 am

Which is giving you problems: mode 0, or the sub screen? Do you know how to use the GBA screen or the DS main screen in mode 0?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#145139 - doudou - Mon Nov 12, 2007 12:10 am

It was about the subscreen in mode 0: I was able to use it in bmp mode. It's now all working fine as you can see in the following screenshots:

[Images not permitted - Click here to view it]
[Images not permitted - Click here to view it]
[Images not permitted - Click here to view it]

I didn't realize at first how much the dual screens were using duplicated technology (registers). I'm porting my GBA engine to DS and the upgrade for the dual screen is pretty straight forward: I now have 2 instances of my GbaTileEngine and GbaSpriteEngine classes using the proper registers for their relative screen.

The main point that gave me some difficulties is about setting video banks, so I'm posting some lines here in case it could help someone reading this thread:

Code:

vramSetMainBanks(VRAM_A_MAIN_BG_0x06000000, VRAM_B_MAIN_BG_0x06020000, VRAM_C_SUB_BG_0x06200000, VRAM_D_SUB_SPRITE);
   vramSetBankE(VRAM_E_MAIN_SPRITE);
   vramSetBankC(VRAM_C_SUB_BG);

#145149 - HyperHacker - Mon Nov 12, 2007 12:35 am

Just in case you didn't notice, that guy in the second screen is a bit lacking in the head. ;-)

As for that code snippet, why do you set bank C and then set it to something else 2 lines later?
_________________
I'm a PSP hacker now, but I still <3 DS.