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 > GoToXY in console

#88145 - ikaris - Sat Jun 17, 2006 8:23 pm

Hello everyone,

certain versions of conio.h for windows allow the cursor to jump to a specific position using the command "gotoxy()".

Is there an equivelant in the devKitPro dev environment ?

I know that not all versions of conio.h support gotoxy, and it is possible to roll your own... however, it requires windows.h which, of course, will not work on the DS...

therefore, if necessary, how would one write a gotoXY function ?

Thanks !

#88148 - tepples - Sat Jun 17, 2006 8:46 pm

The libnds TTY responds to ANSI escape sequences:
Code:
printf("\e[%d;%df", y, x);


EDIT for correctness
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Sun Jun 18, 2006 6:33 pm; edited 1 time in total

#88204 - silent_code - Sun Jun 18, 2006 1:31 am

*lol*

there's a libnds example especially for that :) take a look at other sequences mentioned :)

#88211 - sajiimori - Sun Jun 18, 2006 2:52 am

Don't you think laughing at people is a bit childish? You seem to be in the habit.

#88215 - ikaris - Sun Jun 18, 2006 4:09 am

You must be talking about this one:

C:\devkitPro\examples\nds\Graphics\2D\ansi_console

I tried it out and it works perfectly.

I didn't see the examples... I searched the forum here and when I came up with nothing, I posted a question.

Thanks !

#88230 - silent_code - Sun Jun 18, 2006 7:57 am

ikaris wrote:
You must be talking about this one:

C:\devkitPro\examples\nds\Graphics\2D\ansi_console

I tried it out and it works perfectly.

I didn't see the examples... I searched the forum here and when I came up with nothing, I posted a question.

Thanks !



no problem :) in fact i find the examples very useful! sometimes invalubale! and you'll often take a look at them and save yourself hours of looking for tutorials and reading them... well, at least if you understand what's going on in the code and why it is the way it is... if you're having problems with that some good tutorials are a must.

@sajiimori: the lots of :) smileys should indicate that it's not laughing AT people... it's just that i'm in a good mood and stuff ;) i like to express myself with these things a lot :D thanks for mentioning it, though :) i may be misunderstood sometimes, that's true. but for me a *lol* isn't bad in any way, it's just a sign of my - maybe a bit childish (i'm 23 ;p ) - happieness sometimes. ;)
well, at least it's my subjective attitude.

btw. what do you mean by "You seem to be in the habit."? ?':|
you mean i do that - what looks to you like laughing at people - often?

greets!