Hacking Changing back line (DevKitPro)

D-Jay

High rulez
OP
Member
Joined
Jan 23, 2009
Messages
555
Trophies
0
Age
43
Location
Home
XP
540
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...
 

D-Jay

High rulez
OP
Member
Joined
Jan 23, 2009
Messages
555
Trophies
0
Age
43
Location
Home
XP
540
Country
Germany
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.
 

mousex

Well-Known Member
Member
Joined
Jan 23, 2009
Messages
986
Trophies
0
XP
115
Country
United States
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.
 

blitter

Well-Known Member
Newcomer
Joined
Jan 26, 2009
Messages
74
Trophies
0
XP
8
Country
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
 

D-Jay

High rulez
OP
Member
Joined
Jan 23, 2009
Messages
555
Trophies
0
Age
43
Location
Home
XP
540
Country
Germany
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
 

D-Jay

High rulez
OP
Member
Joined
Jan 23, 2009
Messages
555
Trophies
0
Age
43
Location
Home
XP
540
Country
Germany
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.
 

zapu

Well-Known Member
Member
Joined
Jul 27, 2006
Messages
182
Trophies
0
XP
103
Country
Poland
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).
 

D-Jay

High rulez
OP
Member
Joined
Jan 23, 2009
Messages
555
Trophies
0
Age
43
Location
Home
XP
540
Country
Germany
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.
 

D-Jay

High rulez
OP
Member
Joined
Jan 23, 2009
Messages
555
Trophies
0
Age
43
Location
Home
XP
540
Country
Germany
I have to think about. It's complicated for me.
unsure.gif
 

zapu

Well-Known Member
Member
Joined
Jul 27, 2006
Messages
182
Trophies
0
XP
103
Country
Poland
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

Well-Known Member
Newcomer
Joined
Jan 26, 2009
Messages
74
Trophies
0
XP
8
Country
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?
 

You may also like...

General chit-chat
Help Users
  • M4x1mumReZ @ M4x1mumReZ:
    @ZeroT21, Turns us into horny people that deserve to be bonked
  • M4x1mumReZ @ M4x1mumReZ:
    Like me
  • K3N1 @ K3N1:
    Buy more cleaned and refurbished at DkOldies today!
    +1
  • K3N1 @ K3N1:
    That'll be $650 for a DS
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Get your grubby broken consoles from this Eminem looking ass
  • K3N1 @ K3N1:
    Grampsinem
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    His prices are way beyond slim shady
  • M4x1mumReZ @ M4x1mumReZ:
    lmao
  • K3N1 @ K3N1:
    It's a slim price to pay for shady products
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    That's more like it
  • Veho @ Veho:
    Bah, why waste money on banged up poorly refurbished old consoles, when you can buy Soulja Boi's latest offering?
    +1
  • Veho @ Veho:
    Whatever that is at the moment
    +1
  • K3N1 @ K3N1:
    Pretty sure it's on crank fw .069 distro atm
    +1
  • K3N1 @ K3N1:
    Willing to bang sexy YouTube streamers for reviews and free product :teach:
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    @K3N1, I'm pretty sure you're gonna review the latest fleshlight
  • M4x1mumReZ @ M4x1mumReZ:
    The free lube that comes with it is garbage, the inside also doesn't feel right 0/10
  • Veho @ Veho:
    "But the precise rating isn't important here, the important question is is it better than my hand and the answer is... BUT FIRST A WORD FROM OUR SPONSORS"
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    "Ugh, I can say without a doubt that this stuff is horrible, feels the same doing it with my hand."
  • M4x1mumReZ @ M4x1mumReZ:
    "Overall, I would advise anyone to stay away from it at all costs."
  • M4x1mumReZ @ M4x1mumReZ:
    @Veho, "This video was sponsored by <insert porn site here>. Get 20% off premium."
  • K3N1 @ K3N1:
    @M4x1mumReZ, I wouldn't dare get in the way of your expertises on butt plugs
    +1
  • K3N1 @ K3N1:
    https://youtu.be/h3sPFfjHzjE I guess soldiers are getting trained on the woke
    K3N1 @ K3N1: https://youtu.be/h3sPFfjHzjE I guess soldiers are getting trained on the woke