Hacking Changing back line (DevKitPro)

  • Thread starter Thread starter D-Jay
  • Start date Start date
  • Views Views 3,513
  • Replies Replies 23

D-Jay

High rulez
Member
Joined
Jan 23, 2009
Messages
555
Reaction score
44
Trophies
1
Age
46
Location
Home
XP
590
Country
Germany
Hi guys,

I'm working on some code for an install-dol.

So, I want to put a "waiting-cursor" behing each installing WAD.
For that I use the follwing code:

Code:
ÂÂÂÂprintf("Some Text\n");
ÂÂÂÂfflush(stdout);

ÂÂÂÂ/* Opening */
ÂÂÂÂfp = fopen(filepath, "rb");
ÂÂÂÂif (!fp) {
ÂÂÂÂÂÂÂÂprintf(" ERROR!\n");
ÂÂÂÂÂÂÂÂgoto out;
ÂÂÂÂ}
ÂÂÂÂprintf("\b Waiting-Cursor-Text");


But "Waiting-Cursor-Text" appears in the NEXT line and not as defined behind "Some Text"!?

I guess, I do not see the wood for the trees...
 
Holt said:
\n makes u jump a line

Yes, I know. I have I list-view for all available WAD-files, so behind each WAD-file in the list, there's a "\n" to break the line.

But I want to "break back" (if you know what I mean) the line to output some text behind the WAD-file-title.
 
Code:
ÂÂ printf("Some Text");
ÂÂÂÂfflush(stdout);

ÂÂÂÂ/* Opening */
ÂÂÂÂfp = fopen(filepath, "rb");
ÂÂÂÂif (!fp) {
ÂÂÂÂÂÂÂÂprintf(" ERROR!\n");
ÂÂÂÂÂÂÂÂgoto out;
ÂÂÂÂ}
ÂÂÂÂprintf("\b Waiting-Cursor-Text\n");
Provided that "Some Text" is the WADs name. You write "Some Text", then "Waiting -Cursor-Text" and then a new line.
 
I use a ttf font, but looking through the examples there's one which allows you to position the cursor with coords direct:

Code:
ÂÂÂÂ// The console understands VT terminal escape codes
ÂÂÂÂ// This positions the cursor on row 2, column 0
ÂÂÂÂ// we can use variables for this with format codes too
ÂÂÂÂ// e.g. printf ("\x1b[%d;%dH", row, column );
ÂÂÂÂprintf("\x1b[2;0H");
HTH
 
Holt said:
do you want to appear on your screen like this?:
Waiting-Cursor-Text

Some Text


I want that the text appears like that:

CODEÂÂÂÂ file1.wad ..installed
ÂÂÂÂ file2.wad ..installed
>>ÂÂ file3.wad ...installing
ÂÂÂÂ file4.wad
 
mousex said:
Code:
ÂÂ printf("Some Text");
ÂÂÂÂfflush(stdout);

ÂÂÂÂ/* Opening */
ÂÂÂÂfp = fopen(filepath, "rb");
ÂÂÂÂif (!fp) {
ÂÂÂÂÂÂÂÂprintf(" ERROR!\n");
ÂÂÂÂÂÂÂÂgoto out;
ÂÂÂÂ}
ÂÂÂÂprintf("\b Waiting-Cursor-Text\n");
Provided that "Some Text" is the WADs name. You write "Some Text", then "Waiting -Cursor-Text" and then a new line.

This does not work, cause I use a list-view

CODE(...) Removed for better viewing

So, as you see "Print filename" hast a line breaker after the filename to show the next file in the next line.
 
2up: No and you have no fscking idea about things being discussed now.

D-Jay, there are special characters to position cursor in a line so you can 'erase' that 'installing' text when you need (just print spaces over it).
 
zapu said:
D-Jay, there are special characters to position cursor in a line so you can 'erase' that 'installing' text when you need (just print spaces over it).

I understand what you mean.

But the "installing"-text just appears when I run the install-function.
 
I have to think about. It's complicated for me.
unsure.gif
 
Basically:

print everything in for loop
...
move back to first enity using VT terminal escape codes
'rewrite' the text under that line to 'blablabh installing...'
do the install stuff
move back to the beginning of the line using VT terminal escape codes
'rewrite' the text to 'blablabla ' < yup, some spaces to erase 'installing...' part
...
do the same with the rest
 
blitter said:
I use a ttf font, but looking through the examples there's one which allows you to position the cursor with coords direct:

Code:
ÂÂÂÂ// The console understands VT terminal escape codes
ÂÂÂÂ// This positions the cursor on row 2, column 0
ÂÂÂÂ// we can use variables for this with format codes too
ÂÂÂÂ// e.g. printf ("\x1b[%d;%dH", row, column );
ÂÂÂÂprintf("\x1b[2;0H");
HTH

Guess you missed this post OP?
 

Site & Scene News

Popular threads in this forum