Homebrew Homebrew Development

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,512
Trophies
0
Age
29
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,795
Country
Spain
It's not so strange, the romfs service could use some nemory to handle reading calls amd some cache maybe.

The main point is that the game works with the emulator and with the 3dsx, so the romfs is called correctly.

With the Cia version there are two big differences: the program that packs the Cia file (makerom) and the enviroment where the exec runs (the 3ds normal enviroment instead of the homebrew launcher)

For the makerom I used my version that I know works fine.

For the enviroment I had a game running with no problem with the 3dsx and finishing the linear memory with the Cia version.

I don't have time to fully debug your code, I'm only giving you a hint.

You could try to change all the wav files with dummy file of only 1 sec of music (to save memory) and see if this changes something.

When I port games to 3ds I often have to lower the quality.of the sound files to make them load.
Good luck, debugging on the 3ds is always a pain.

I'll give it a try anyway. Thanks
 

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Hi everybody. I've got a problem with this while loop that freeze the 3ds. I'm a bit tired and I'm 100% sure it's a really stupid fault but I don't see why it freeze...

Code:
void showRomPathMarquee(const int XposValue,int Ypos, std::string text) {
    std::string path = text;
   
    while(!(hidKeysDown() & KEY_UP)){
        while( clock() < (clock() + 100) ) continue;
        std::string scrolled,temp,temp2;
           
        temp = path.substr(1,(path.length()));
        temp2 = path.substr(0,1);
        path = temp + temp2;
        if(path.length() + 1 == ' '){
            sftd_draw_textf(font, XposValue, Ypos, SET_ALPHA(color_data->color, 255), 12, "%s %s", temp.c_str(), temp2.c_str());
        }else{
            sftd_draw_textf(font, XposValue, Ypos, SET_ALPHA(color_data->color, 255), 12, "%s", path.c_str());
        }
    }
}

Thanks everybody.
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Hi everybody. I've got a problem with this while loop that freeze the 3ds. I'm a bit tired and I'm 100% sure it's a really stupid fault but I don't see why it freeze...

Code:
void showRomPathMarquee(const int XposValue,int Ypos, std::string text) {
    std::string path = text;
  
    while(!(hidKeysDown() & KEY_UP)){
        while( clock() < (clock() + 100) ) continue;
        std::string scrolled,temp,temp2;
          
        temp = path.substr(1,(path.length()));
        temp2 = path.substr(0,1);
        path = temp + temp2;
        if(path.length() + 1 == ' '){
            sftd_draw_textf(font, XposValue, Ypos, SET_ALPHA(color_data->color, 255), 12, "%s %s", temp.c_str(), temp2.c_str());
        }else{
            sftd_draw_textf(font, XposValue, Ypos, SET_ALPHA(color_data->color, 255), 12, "%s", path.c_str());
        }
    }
}

Thanks everybody.

You need to call hidScanInput() in the loop or the value returned by hidKeysDown() will never change.
 
  • Like
Reactions: umbjolt

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Oh, I see... and how can I "stop" the main while? I want to print the string slower

Code:
double temp= clock();
while( clock() < (temp + 100) ) continue;

You can do something like this.But dDon't know if 100 is the riight value for your delay, and using it without the constant CLOCKS_PER_SEC is not very clean.
 
  • Like
Reactions: umbjolt

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Code:
double temp= clock();
while( clock() < (temp + 100) ) continue;

You can do something like this.But dDon't know if 100 is the riight value for your delay, and using it without the constant CLOCKS_PER_SEC is not very clean.
Thanks you. I changed double temp and temp + 100 to clk because temp was already declared but the method still freeze the 3ds. :cry:
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Yes my mistake. Init clk outside the big loop and update it only after the if.

Anyway take this only as an exercise.

A clean way to do what you want isto sleep the execution for a given amount of time at every loop
 
  • Like
Reactions: umbjolt

ShinobuMeahera

New Member
Newbie
Joined
Jan 9, 2017
Messages
4
Trophies
0
Age
29
XP
52
Country
Poland
Can you help me guys?
I am using sfillib and I want to load image from sd card, here is code:
Code:
void Button::setTextureFromFilePng(){
    if(folderPath == NULL) return;
    sf2d_texture *temp = sfil_load_PNG_file("NCData/button.jpeg", SF2D_PLACE_RAM);
    if(temp != NULL)    buttonTexture = temp;
}
Here is pic with error that i get in citra.
upload_2017-2-15_16-43-14.png
 

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Can you help me guys?
I am using sfillib and I want to load image from sd card, here is code:
Code:
void Button::setTextureFromFilePng(){
    if(folderPath == NULL) return;
    sf2d_texture *temp = sfil_load_PNG_file("NCData/button.jpeg", SF2D_PLACE_RAM);
    if(temp != NULL)    buttonTexture = temp;
}
Here is pic with error that i get in citra.
View attachment 78446

Try changing this
Code:
    sf2d_texture *temp = sfil_load_PNG_file("NCData/button.jpeg", SF2D_PLACE_RAM);
to this:
Code:
    sf2d_texture *temp = sfil_load_JPEG_file("sdmc:/NCData/button.jpeg", SF2D_PLACE_RAM);
 
Last edited by umbjolt,

ShinobuMeahera

New Member
Newbie
Joined
Jan 9, 2017
Messages
4
Trophies
0
Age
29
XP
52
Country
Poland
I think you can ignore this error in citra. I have often such a error (more warning) in the emulator, bit I have no problems on the real hw.

The real problem is that in you code you're trying to open a jpeg with a PNG lib :blink:
When i lunch it on my 3ds and i load Graphic 10~15 times app just crash.
I want to make options where you can choose your own graphic and load it.
I know loading 10 times in row is stupid, but if it happens on citra and 3ds something is bad for sure.

No, its example function where i put path to img static. But in my app it looks like this.
Code:
sf2d_texture *temp = sfil_load_PNG_file(stringCat(folderPath, buttonFileName), SF2D_PLACE_RAM);
 
Last edited by ShinobuMeahera,

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,033
Country
United States
Thanks you. I changed double temp and temp + 100 to clk because temp was already declared but the method still freeze the 3ds. :cry:
This sort of "busy" loop for timing is not really a good ideas as it prevents the CPU from doing other work while you delay. svcSleepThread is likely a better solution.
void svcSleepThread(s64 ns);
Where ns is the time to sleep in nanoseconds.
 
  • Like
Reactions: umbjolt

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    Ironic this was posted today lol
  • BigOnYa @ BigOnYa:
    I think the tv series has boasted play of, I did see they said playing of it Is up, way more than norm
    +1
  • BigOnYa @ BigOnYa:
    I've been playing the next gen version on Series X all day, I love it. :wub:
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Downloading some random stuff, damn almost 400GBs in like 4 hours lol
  • Psionic Roshambo @ Psionic Roshambo:
    Gonna be over 1TB this month.... damn lol
  • Xdqwerty @ Xdqwerty:
    good night
    +1
  • BigOnYa @ BigOnYa:
    At least you have some fast speeds. What a drag that used to be, I remb downloading 1 pic back in the day, and seeing line by line show
    +1
  • BigOnYa @ BigOnYa:
    Nighty night.
  • BigOnYa @ BigOnYa:
    Or worse, you downloading something, and someone calls your phone and interupts the download, good ole AOL. Of course that's before most you guys even were born yet.
  • Psionic Roshambo @ Psionic Roshambo:
    Lol I think my first modem was 48K but it had some sort of firmware or software update that let me get 56K
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I had EarthLink lol
  • Psionic Roshambo @ Psionic Roshambo:
    A bunch of NetZero accounts that I used for things... Lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    So glad I'm not in prison lol
  • BigOnYa @ BigOnYa:
    Yea marriage is a bitch sometimes...
  • Psionic Roshambo @ Psionic Roshambo:
    I legit think they passed the cyber terrorism laws from some of my hmm pranks lol
  • Psionic Roshambo @ Psionic Roshambo:
    I knocked the east coast backbone of EarthLink offline for like 6 hours one time, was on the news and everything well I mean I wasn't on the news.... Just they where having "technical difficulties" lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Was just one single custom packet. I miss when Internet security was an afterthought lol almost all modems and network hardware operated in promiscuous mode.
  • Psionic Roshambo @ Psionic Roshambo:
    Now these days they do sanity checks.... The source IP can't also be the destination IP lol
  • Psionic Roshambo @ Psionic Roshambo:
    They did end up using some of my stuff in the first Gulf war though lol
  • BakerMan @ BakerMan:
    GUYS I JUST COMMENTED A YOUR MOM JOKE ON A GACHA YT COMMUNITY POST (the algorithm has cursed me in terms of community posts, bc I fuck around on that sort of community post, just commenting and being a jackass)
    +1
  • BakerMan @ BakerMan:
    IT FELT SO GOOD
    +1
  • BakerMan @ BakerMan:
    the OP made a couple vocaloid characters, and the post had the caption "Guess who I did 💙💛❤️

    hint: they're from vocaloid"
    +1
  • BakerMan @ BakerMan:
    to which I responded:
    "Guess who I did 💙💛❤️

    hint: it's uremum"
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I studied IPV6 if they hadn't passed the cyber terrorism laws omg.... In theory I have some awesome pranks but I'm afraid to test them lol
    Psionic Roshambo @ Psionic Roshambo: I studied IPV6 if they hadn't passed the cyber terrorism laws omg.... In theory I have some...