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 > How do I print text to the top AND bottom screen?

#78507 - sofakng - Fri Apr 07, 2006 7:45 pm

Here is a snippet of my code:

Code:

  videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE);
  videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);
       
  vramSetBankA(VRAM_A_MAIN_BG_0x6000000);
  vramSetBankC(VRAM_C_SUB_BG_0x6200000);

  SUB_BG0_CR = BG_MAP_BASE(31);
   
  BG_PALETTE_SUB[255] = RGB15(31,31,31);
   
  consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);


If I do an iprintf() then it will print text to the top screen. How do I get the text to print to the top OR bottom screen? Are there more functions aside from iprintf() for printing text?

Also, is there any tutorials on using the subpixel font that is found on these forums?

Thanks!

#78509 - blahh - Fri Apr 07, 2006 8:03 pm

If your just starting on coding, try PALIB, its wayy easier than any other ds lib...

www.palib.com <-for download and great tutorials

#78548 - sofakng - Sat Apr 08, 2006 1:33 am

blahh wrote:
If your just starting on coding, try PALIB, its wayy easier than any other ds lib...

www.palib.com <-for download and great tutorials

It doesn't support the subpixel font does it? (so each screen has 80x25 lines or whatever)

#78553 - blahh - Sat Apr 08, 2006 2:22 am

hmm not sure

#78564 - knight0fdragon - Sat Apr 08, 2006 2:53 am

what i do is change where consoleinit is whenever i am printing

so it goes something like this

save screen 1 text
change consoleinit to screen 2
draw on screen 2

when i want to go back to font 1


change consoleinit to screen 1(this will erase all text)
loadscreen 1 text
draw on screen 1
_________________
http://www.myspace.com/knight0fdragonds

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

#78826 - sofakng - Mon Apr 10, 2006 2:12 am

Isn't there a way to just choose which screen you want to write to without erasing each screen first?

It seems like the subpixel example code used the VRAM_A variable to write directly to it... so I thought by changing it to VRAM_C it would write to the other screen but it didn't...

Maybe I'm not initializing each screen properly? Both screens need to be in MODE_FB0, right? ...and then VRAM_A should be set to LCD_A and VRAM_C should be set to LCD_C?

#78828 - cory1492 - Mon Apr 10, 2006 2:16 am

afaik you cant have more than 1 screen in FB mode...another way of doing this could be to modify the subpixel demo to draw its pixels on rotational backgrounds (1 on each screen)...

Have a look at doublec's day 10 tutorial if you want to give that a shot.
http://www.double.co.nz/nintendo_ds/nds_develop10.html

edit:/just found what I was looking for:
YoungMX also has a way to put stuff on both screens using his libfb
http://www.youngmx.com/?loc=ndsdev/LibFB
You could look into that to see how he is doing it.

#78831 - sofakng - Mon Apr 10, 2006 2:28 am

Thanks!

Is there any documentation for LibFB or am I just not seeing it?

#78838 - knight0fdragon - Mon Apr 10, 2006 3:22 am

does it use the console functions? because you can do it by creating your own font and instructions, but as far as i know with console provided with libnds this is how its done, unless i am missing something
_________________
http://www.myspace.com/knight0fdragonds

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

#78855 - HyperHacker - Mon Apr 10, 2006 6:59 am

I made my own simple text drawing routines (to be released with the next version of GBA Booter) that draw on rotational backgrounds, and it can print on both screens fine. It has to buffer them in RAM, though. :-( Also it doesn't have any actual console functionality, just a "print this here" sort of function. (It uses a 6x6 font, BTW.)

#79836 - cory1492 - Sun Apr 16, 2006 7:23 am

sofakng wrote:
Thanks!

Is there any documentation for LibFB or am I just not seeing it?

NP. So far as I know there is only the sample for "documentation".