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.

Coding > Clear console and use both console for text

#152682 - aronchi - Wed Mar 19, 2008 12:30 pm

I want to use both screen to output text.

Now I'm using

Code:
consoleDemoInit()
videoSetMode(MODE_FB0)
vramSetBankA(VRAM_A_LCD)


how can I manage to write to the upper lcd?
How can I clear() the screen?

Thanks in advance!

#152772 - aronchi - Thu Mar 20, 2008 6:30 pm

Isn't it possible?

#152782 - silent_code - Thu Mar 20, 2008 8:09 pm

i haven't set my nds dev environment up, but i can think of a way to make it possible. it really depends on how the console functions are implemented.

if you could setup banks for the main and sub screen and the console (via the initialization function) in a way that you would effectively have the first line on the second screen being the line after the last of the main screen.

as said before, i can't help you here, as i neither have tested this, nor can i test it atm.

good luck and happy coding.

#152826 - aronchi - Fri Mar 21, 2008 8:39 am

I don't want the first line of the second screen to be the last of the first screen.

I want to write some text on the first and some other, indipendent, text on thhe second.

Maybe it's easier, or not?

I just want a thing like:
print (first_screen, "text1")
print (second_screen, "text2")
clear (first_screen)
clear (second_screen)

#152833 - silent_code - Fri Mar 21, 2008 1:41 pm

you would have to take the sources and modify them, so you could have something like printMain("...") and printSub("...").

with the setup i described earlier you could just make wrapper functions. the sub screen function would set an offset, so that you could write indipendently to the screens, but without the need to initialize two consoles (like with the source modification i mentioned). you would simply initialize one console (with continuous memory mapping). then there's the console text formating that puts the cursor to a specific character position, this is where the offset comes into play.

hope it's explained clearly enough. :^D