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 > Resetting console cursor position, and escape code bug

#145134 - yellowstar - Sun Nov 11, 2007 11:15 pm

Is there a escape code to
reset the console cursor to its previous
position?(the position before setting
the postion with the set cursor position escape code)

The reason I want to know this,
is because I have a function call
in my vblank handler to a debugging function.
Once done,
it sets the cursor position to the start.
I want it to "reset" the position instead at this point.

If I didn't do this,
the text printed after this would be
printed after this debugging stuff,
and that wouldn't look good.



I've been having problems with the above
mentioned escape code.(the set cursor position escape code)
(I have have the latest DKA and libnds.)

When I don't have anything printed,(That is,
the escape code is the only thing in the string, no spaces or anything)
it crashes.

But,
when overwise,
it works as wanted.

#145135 - Lick - Sun Nov 11, 2007 11:20 pm

I'm sure there is, but you could also "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" like this:






















See?
_________________
http://licklick.wordpress.com

#145136 - yellowstar - Sun Nov 11, 2007 11:55 pm

That failed.

Two lines of debugging are
displayed instead of one.

Also,
anything else isn't displayed.

#145147 - wintermute - Mon Nov 12, 2007 12:29 am

Don't call printf and company from interrupt code, they're not re-entrant.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog