Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,475,035
  • Replies Replies 6,048
  • Likes Likes 54
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...
 
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");
 
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.
 
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?
 
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
 
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
 
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?
 
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
 

Site & Scene News

Popular threads in this forum