Homebrew Homebrew Development

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
28
Location
Bologna
Website
rinnegatamante.it
XP
4,744
Country
Italy
Does someone knows why i'm having always this error when i try to import my converted homebrew as CIA:

Not enough space to import cia.
Free Space: 2,715,746,304 Bytes
Required Space: 3,191,734,272 Bytes

Note that i have more than 2 GB free on my SDMC and that 3DS version of the homebrew is 800KB size...
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
51
Website
www.albertosonic.com
XP
1,386
Country
Italy
Guys i need a C help... i'm basically trying to write a function that writes a text.
Code:
void guiPopup(char* title)
{
    gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, buffer, 55, 245 - fontDefault.height * 7);
}

Can i use this way:
guiPopup("Text i want to print");

Or do i have to use it this way?
char buffer[100];
sprintf(buffer, "text i want to print");
guiPopup("buffer");
 

Technicmaster0

Well-Known Member
Member
Joined
Oct 22, 2011
Messages
4,345
Trophies
2
Website
www.flashkarten.tk
XP
3,149
Country
Gambia, The
Guys i need a C help... i'm basically trying to write a function that writes a text.
Code:
void guiPopup(char* title)
{
    gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, buffer, 55, 245 - fontDefault.height * 7);
}

Can i use this way:
guiPopup("Text i want to print");

Or do i have to use it this way?
char buffer[100];
sprintf(buffer, "text i want to print");
guiPopup("buffer");
The easiest is:
Code:
consoleInit(GFX_BOTTOM, NULL);
while (true) {        //Main loop
    printf("YourText");
    gfxFlushBuffers();
    gfxSwapBuffers();
    gspWaitForVBlank();
}
You can find more about the printf(); function in my "Useless Homebrew" port.
But it's only a console that you can't use with images.
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
51
Website
www.albertosonic.com
XP
1,386
Country
Italy
The easiest is:
Code:
consoleInit(GFX_BOTTOM, NULL);
while (true) {        //Main loop
    printf("YourText");
    gfxFlushBuffers();
    gfxSwapBuffers();
    gspWaitForVBlank();
}
You can find more about the printf(); function in my "Useless Homebrew" port.
But it's only a console that you can't use with images.

I know, infact my function doesn't print a text only. Here's the whole function:
Code:
void guiPopup(char* title, char* line1, char* line2, char* line3, char* button1, char* button2)
{
    //Prints a dark grey rectangle!
    drawFillRect(36, 60, 272, 85, 128, 128, 128, screenBottom);
    //Prints a light grey rectangle!
    drawFillRect(36, 85, 272, 189, 160, 160, 160, screenBottom);
    //Prints text
    gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, title, 124, 240 - fontDefault.height * 5);
    gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, line1, 55, 245 - fontDefault.height * 7);
    gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, line2, 55, 245 - fontDefault.height * 8);
    gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, line3, 55, 245 - fontDefault.height * 9);
    //Prints the buttons!
    if (!button2)
    {
        drawFillRect(107, 155, 198, 183, 192, 192, 192, screenBottom);
        gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, button1, 140, 240 - fontDefault.height * 11);
    }
    else
    {
        drawFillRect(50, 151, 141, 179, 192, 192, 192, screenBottom);
        drawFillRect(166, 151, 257, 179, 192, 192, 192, screenBottom);
        gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, button1, 80, 240 - fontDefault.height * 11);
        gfxDrawText(GFX_BOTTOM, GFX_LEFT, NULL, button2, 200, 240 - fontDefault.height * 11);
    } 
}

So, is it correct to use it?

guiPopup("CLEAR", "Are you sure that you want to clear", "everything?", "(This action is irreversible)", "Yes (A)", "No (B)");

Or do i have to load every string inside a char buffer?
 

AlbertoSONIC

Pasta Team Member
Member
Joined
Jun 27, 2014
Messages
927
Trophies
0
Age
51
Website
www.albertosonic.com
XP
1,386
Country
Italy
It seems to be working... Another thing, how can i pass a 2d array as an argument? Is this code correct?

FUNCTION:
void guiBottomPaint(int color, int cTable[][], int posxy[][])
{
...
}

USE:
void guiBottomPaint(color, cTable[][], posxy[][]);

Nvm, fixed
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
28
Location
Bologna
Website
rinnegatamante.it
XP
4,744
Country
Italy
Does someone knows why i'm having always this error when i try to import my converted homebrew as CIA:

Not enough space to import cia.
Free Space: 2,715,746,304 Bytes
Required Space: 3,191,734,272 Bytes

Note that i have more than 2 GB free on my SDMC and that 3DS version of the homebrew is 800KB size...

Bump. I'm using st4rk 3DNES rsf with makerom: http://pastebin.com/zrk45n0w
 

themperror

Well-Known Member
Member
Joined
Aug 12, 2009
Messages
181
Trophies
0
XP
367
Country
Netherlands
since google directly didn't get me any real info..

Is it possible to compile 3DS homebrew in Visual Studio 2013 (on windows obviously)? and using C++ (not python)

Else any other way I can compile C++ code for 3ds on windows?
 

themperror

Well-Known Member
Member
Joined
Aug 12, 2009
Messages
181
Trophies
0
XP
367
Country
Netherlands
It seems to be working... Another thing, how can i pass a 2d array as an argument? Is this code correct?

FUNCTION:
void guiBottomPaint(int color, int cTable[][], int posxy[][])
{
...
}

USE:
void guiBottomPaint(color, cTable[][], posxy[][]);

Nvm, fixed


in C++ it's not actually possible to send arrays as arguments without losing a dimension so you'd actually need a 3D array with the first dimension zero and then you can pass it to get a 2D array, the way you're doing it now also sends the WHOLE array instead of a pointer to which is very inefficient
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: Hope they made lots of spaget