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 > custom console

#167293 - hacker013 - Sun Mar 08, 2009 10:21 am

hey everybody,

I'm trying to set up an custom console on VRAM_F and VRAM_G on the main screen. My screen is the whole time messed up and sometimes just white. I don't know to fix it. I took the custom console code from Nitro Engine (didn't work) as code to work with. This is what I have now:
Code:
   //consoleDemoInit();
   videoSetModeSub(0);   

   //videoSetMode(MODE_0_3D | DISPLAY_BG1_ACTIVE);
   videoSetMode(MODE_5_3D | DISPLAY_BG1_ACTIVE);
   vramSetBankF(VRAM_F_MAIN_BG);
   vramSetBankG(VRAM_G_MAIN_BG_0x06004000);
   
   BG_PALETTE[255] = 0xFFFF;
   
   REG_BG1CNT = BG_MAP_BASE(4) | BG_PRIORITY(0); // use bg 1 for text, set to highest priority
   //REG_BG0CNT = BG_PRIORITY(1); //set bg 0 (3d background) to be a lower priority than bg 1

   consoleInit(consoleGetDefault(),1, BgType_Text4bpp, BgSize_T_256x256, 4,0,true, true);


I think it is just a little mistake with something. Maybe you guys can help me or atleast point me in the right direction.

gr,

hacker013
_________________
Website / Blog

Let the nds be with you.

#167336 - albinofrenchy - Mon Mar 09, 2009 11:25 am

I'm guessing you copy pasted their initialization code and your consoleInit function?

Try something like


Code:

   videoSetMode(MODE_5_2D| DISPLAY_BG1_ACTIVE);
   vramSetBankF(VRAM_F_MAIN_BG);
   vramSetBankG(VRAM_G_MAIN_BG_0x06004000);
   
   consoleInit(0,1, BgType_Text4bpp, BgSize_T_256x256, 0,1,true);
   printf("Success!");


How was that code compiling, you had an extra option in consoleInit...?

Why are you setting the last palette entry to white btw?

#167340 - elhobbs - Mon Mar 09, 2009 2:33 pm

the extra option is present in the version of libnds currently in svn

#167341 - albinofrenchy - Mon Mar 09, 2009 2:59 pm

Oh? Whats it for?

#167345 - elhobbs - Mon Mar 09, 2009 4:45 pm

albinofrenchy wrote:
Oh? Whats it for?
it deterimines if the default font map/tiles should be loaded.
Code:
PrintConsole* consoleInit(PrintConsole* console, int layer, BgType type, BgSize size, int mapBase, int tileBase, bool mainDisplay, bool loadGraphics);

#167347 - hacker013 - Mon Mar 09, 2009 4:55 pm

elhobbs wrote:
the extra option is present in the version of libnds currently in svn


No, I have just the newest devkitARM r25 with the newest libnds 1.3.2 :)
_________________
Website / Blog

Let the nds be with you.

#167351 - albinofrenchy - Mon Mar 09, 2009 6:07 pm

Quote:
it deterimines if the default font map/tiles should be loaded.


Makes sense I guess.

I'm really trying to think of a reason I'd need that flag and I'm coming up blank. Good info though :-p


Quote:
No, I have just the newest devkitARM r25 with the newest libnds 1.3.2 :)


I'm back to wondering how your stuff compiled?

#167353 - elhobbs - Mon Mar 09, 2009 6:16 pm

albinofrenchy wrote:
I'm really trying to think of a reason I'd need that flag and I'm coming up blank. Good info though :-p
if you are using custom font tiles and they are already loaded then you may want to prevent the default tiles from loading and overwriting your custom tiles.

#167359 - albinofrenchy - Mon Mar 09, 2009 9:14 pm

Quote:
if you are using custom font tiles and they are already loaded then you may want to prevent the default tiles from loading and overwriting your custom tiles.


I thought about this, but I wondered about how good an idea it was to start putting tiles somewhere before you initialize the hardware flags for it. I guess its just memory though, and so it'd be fine. I guess if you are switching between different background modes too you might not want to take the gfx hit for no reason.

#167360 - elhobbs - Mon Mar 09, 2009 9:57 pm

I suspect it is there mainly to support multiple consoles. they can have different maps but share the same tiles.

#167397 - hacker013 - Tue Mar 10, 2009 8:18 pm

albinofrenchy wrote:
Quote:
it deterimines if the default font map/tiles should be loaded.


Makes sense I guess.

I'm really trying to think of a reason I'd need that flag and I'm coming up blank. Good info though :-p


Quote:
No, I have just the newest devkitARM r25 with the newest libnds 1.3.2 :)


I'm back to wondering how your stuff compiled?


I tryed your code and I get white screen Oo.
_________________
Website / Blog

Let the nds be with you.

#167406 - albinofrenchy - Wed Mar 11, 2009 1:12 am

Quote:
I tryed your code and I get white screen Oo.


Try throwing a 'while(true){}' riiight after the printf. If it shows the "Success!" when you do that, you are goofing up video settings after that point.

#167417 - hacker013 - Wed Mar 11, 2009 8:17 am

albinofrenchy wrote:
Quote:
I tryed your code and I get white screen Oo.


Try throwing a 'while(true){}' riiight after the printf. If it shows the "Success!" when you do that, you are goofing up video settings after that point.


Tryed, still white screen.
_________________
Website / Blog

Let the nds be with you.