Hacking Changing back line (DevKitPro)

D-Jay

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

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BakerMan @ BakerMan:
    fuck ubisoft, and fuck activision
    +1
  • realtimesave @ realtimesave:
    Nintendo needs to release a new console, switch is getting such shitty little games lately lol it's pathetic
  • Purple_Heart @ Purple_Heart:
    Lmao a new flashcart... The Unlock Switch... I knew it's not fake xD
    +1
  • NinStar @ NinStar:
    A new consoles won't solve that problem
  • NinStar @ NinStar:
    It will actually make it worse
  • The Real Jdbye @ The Real Jdbye:
    well actually
    a new console won't do anything right now, because the games are still in development, that's why there are few games being released
  • The Real Jdbye @ The Real Jdbye:
    it won't make the games finish any faster
  • Veho @ Veho:
    2/3rds of launch titles for the Switch 2 will just be lazy ports of Switch games anyway.
  • The Real Jdbye @ The Real Jdbye:
    probably
  • The Real Jdbye @ The Real Jdbye:
    maybe mario kart 9 will be a launch title
  • The Real Jdbye @ The Real Jdbye:
    i really want a new mario kart
  • Veho @ Veho:
    What, you mean the endless stream of DLCs doesn't count?
  • Veho @ Veho:
    Why develop a new game when you can just sell season passes forever?
  • Veho @ Veho:
    I'm still on MKDS so I'm not bothered :tpi:
  • The Real Jdbye @ The Real Jdbye:
    i like the dlc tbh, i'd like a new game more
  • ZeroT21 @ ZeroT21:
    but the current version is still selling fine at full price
  • SylverReZ @ SylverReZ:
    Hello
  • ZeroT21 @ ZeroT21:
    sup
    +1
  • SylverReZ @ SylverReZ:
    @realtimesave, You seen the Unlock Switch flashcart yet?
  • K3Nv2 @ K3Nv2:
    I'll see the 19.0 update that blocks use ability to it
    +1
  • K3Nv2 @ K3Nv2:
    Lol newegg+
    Screenshot-20240423-053504-Gmail.jpg
  • S @ salazarcosplay:
    does update 19 really block it
  • SylverReZ @ SylverReZ:
    Update 19 never came out yet. Just the 18.1.
    SylverReZ @ SylverReZ: Update 19 never came out yet. Just the 18.1.