1. AlbertoSONIC

    AlbertoSONIC Pasta Team Member
    Member

    Joined:
    Jun 27, 2014
    Messages:
    927
    Country:
    Italy
    I got it to work using:

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

    I basically had to write second dimension in the fuction itself and then i just had to pass the array's name:

    guiBottomPaint(color, cTable, posxy);

    Anyway i have another question. Is it possible to write a boolean variable? Something like

    sprintf(buffer, "Value = %d", variable);
     
  2. themperror

    themperror GBAtemp Regular
    Member

    Joined:
    Aug 12, 2009
    Messages:
    181
    Country:
    Netherlands

    I'd say look here: http://www.cplusplus.com/reference/cstdio/printf/

    If you really can't find it I'll tell you
     
  3. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!
    Member

    Joined:
    Nov 24, 2014
    Messages:
    3,161
    Country:
    Italy
    Some news with the CIA file:
    Now, i created a CIA which sounds good (it request only 3 MB for importing) but when i import it and try to launch it from emuNand, i don't get the normal 3DS loading screen (splashscreen with Nintendo 3DS and two rectangle on top-left and bottom-right of the screen) and after few seconds (1-2 seconds) i get the error screen which tell me to hold Power button to shut down console. How can i solve?
     
  4. Technicmaster0

    Technicmaster0 GBAtemp Psycho!
    Member

    Joined:
    Oct 22, 2011
    Messages:
    4,238
    Country:
    Gambia, The
    Have you stripped the elf? I can make CIAs properly with the following example:
    Code:
    arm-none-eabi-strip 3DNES.elf
    makerom -f cia -o 3DNES.cia -elf 3DNES.elf -rsf build_cia.rsf -icon icon.icn -banner banner.bnr -exefslogo -target t 
     
  5. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!
    Member

    Joined:
    Nov 24, 2014
    Messages:
    3,161
    Country:
    Italy
    Yes, i stripped the elf. 3DS build works fine but CIA build still crashes.
     
  6. Technicmaster0

    Technicmaster0 GBAtemp Psycho!
    Member

    Joined:
    Oct 22, 2011
    Messages:
    4,238
    Country:
    Gambia, The
    then there's probably a fault in your rsf.
     
  7. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!
    Member

    Joined:
    Nov 24, 2014
    Messages:
    3,161
    Country:
    Italy
    I used the rsf i posted few posts ago. If you want try, i can give you my elf and try to import CIA that you generate.
     
  8. DEElekgolo

    DEElekgolo Advanced Member
    Newcomer

    Joined:
    Apr 7, 2009
    Messages:
    75
    Country:
    United States
    Got a cool ray-tracer going.
    [​IMG]
     
    SLiV3R, aliak11, Slushie3DS and 4 others like this.
  9. Apache Thunder

    Apache Thunder I have cameras in your head!
    Member

    Joined:
    Oct 7, 2007
    Messages:
    4,279
    Country:
    United States
    Does this support making 3D/Animated banners? I think it's time homebrew gets the same fancy banners that retail games can have. :)
     
  10. Slushie3DS

    Slushie3DS Cold Beverage Lover
    Member

    Joined:
    Jan 9, 2015
    Messages:
    707
    Country:
    United States
    I just set up the devkit via the tutorial for Linux found here: http://3dbrew.org/wiki/Setting_up_Development_Environment

    Everything went perfectly, and there was no errors at all. Yet, when I tried to compile the template source with the 'make' command, I kept getting the error below. It made a 'build' folder for which my output files should store, but no output files appear. This is beyond frustrating, and I hope one of you can help me.

    Code:
    [email protected]:~/Documents/3DS/template$ make
    main.c
    arm-none-eabi-gcc -MMD -MP -MF /home/bbnorman/Documents/3DS/template/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=softfp -I/home/bbnorman/Documents/3DS/template/include -I/opt/devkitpro/libctru/include -I/home/bbnorman/Documents/3DS/template/build -DARM11 -D_3DS -c /home/bbnorman/Documents/3DS/template/source/main.c -o main.o
    /home/bbnorman/Documents/3DS/template/source/main.c: In function 'main':
    /home/bbnorman/Documents/3DS/template/source/main.c:11:3: error: too few arguments to function 'gfxInit'
      gfxInit();        // graphics
      ^
    In file included from /opt/devkitpro/libctru/include/3ds.h:14:0,
                    from /home/bbnorman/Documents/3DS/template/source/main.c:3:
    /opt/devkitpro/libctru/include/3ds/gfx.h:23:6: note: declared here
    void gfxInit(GSP_FramebufferFormats topFormat, GSP_FramebufferFormats bottomFormat, bool vrambuffers);
          ^
    /home/bbnorman/Documents/3DS/template/source/main.c:15:7: warning: variable 'kUp' set but not used [-Wunused-but-set-variable]
      u32 kUp;          // keys up
          ^
    /home/bbnorman/Documents/3DS/template/source/main.c:14:7: warning: variable 'kHeld' set but not used [-Wunused-but-set-variable]
      u32 kHeld;        // keys pressed
          ^
    make[1]: *** [main.o] Error 1
    make: *** [build] Error 2
    
     
  11. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!
    Member

    Joined:
    Nov 24, 2014
    Messages:
    3,161
    Country:
    Italy
    No, actually it supports only PNG image so static banners (I think that if you try to use an APNG, it will also be converted as static).

    Slushie3ds: Change gfxInit(); with gfxInitDefault();
     
  12. themperror

    themperror GBAtemp Regular
    Member

    Joined:
    Aug 12, 2009
    Messages:
    181
    Country:
    Netherlands
    When trying to build a .3ds for gateway use I get this: (It's the Hello-World project from CTRULib examples (in the graphics folder)

    [​IMG]
     
  13. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!
    Member

    Joined:
    Nov 24, 2014
    Messages:
    3,161
    Country:
    Italy
    How can i decode BigIcon from SMDH?

    According to info on 3dbrew ( http://3dbrew.org/wiki/SMDH ), i wrote this piece of code but icon is rendered corrupted:
    Code:
    static inline void putPixel565(u8* dst, u8 x, u8 y, u16 v) //Put RGB565 pixels in a Bitmap-like formatted buffer
    {
    dst[(x+(47-y)*48)*3+0]=(v&0x1F)<<3;
    dst[(x+(47-y)*48)*3+1]=((v>>5)&0x3F)<<2;
    dst[(x+(47-y)*48)*3+2]=((v>>11)&0x1F)<<3;
    }
     
    const char* file = "/file.smdh";
        char name[64];
        char desc[128];
        char author[64];
        Handle fileHandle;
        u32 bytesRead;
        FS_archive sdmcArchive=(FS_archive){ARCH_SDMC, (FS_path){PATH_EMPTY, 1, (u8*)""}};
        FS_path filePath=FS_makePath(PATH_CHAR, file);
        FSUSER_OpenFileDirectly(NULL, &fileHandle, sdmcArchive, filePath, FS_OPEN_READ, FS_ATTRIBUTE_NONE);
        u32 magic;
        FSFILE_Read(fileHandle, &bytesRead, 0, &magic, 4);
        if (magic != 0x48444D53) return luaL_error(L, "error opening SMDH file");
        unsigned char *buffer = (unsigned char*)(malloc((129) * sizeof (char)));
        buffer[128] = 0;
        FSFILE_Read(fileHandle, &bytesRead, 8, buffer, 128);
        int i = 0;
        while (i < 129){
        if (buffer[i*2] == 0) break;
        else name[i] = buffer[i*2];
        i++;
        }
        name[i] = 0;
        FSFILE_Read(fileHandle, &bytesRead, 392, buffer, 128);
        i = 0;
        while (i < 129){
        if (buffer[i*2] == 0) break;
        else author[i] = buffer[i*2];
        i++;
        }
        author[i] = 0;
        free(buffer);
        buffer = (unsigned char*)(malloc((257) * sizeof (char)));
        buffer[256] = 0;
        FSFILE_Read(fileHandle, &bytesRead, 136, buffer, 256);
        i = 0;
        while (i < 257){
        if (buffer[i*2] == 0) break;
        else desc[i] = buffer[i*2];
        i++;
        }
        desc[i] = 0;
        free(buffer);
        Bitmap *bitmap = (Bitmap*)malloc(sizeof(Bitmap));
        bitmap->width = 48;
        bitmap->height = 48;
        bitmap->pixels = (u8*)malloc(6912);
        bitmap->bitperpixel = 24;
        u16* icon_buffer = (u16*)malloc(0x1200);
        FSFILE_Read(fileHandle, &bytesRead, 0x24C0, icon_buffer, 0x1200);
        FSFILE_Close(fileHandle);
        svcCloseHandle(fileHandle);
        //convert RGB565 to RGB24
        int x=0;
        int    y=0;
        int real_x,real_y;
        int low_up_x = 4;
        int big_up_x = 12;
        int low_up_y = 2;
        int big_up_y = 6;
        bool switch_tile_x = false;
        bool switch_tile_y = false;
        bool jump = false;
        i = 0;
        int j=0;
        while (y < 48){
            i=j;
            while (x < 48){
                putPixel565(bitmap->pixels, x, y, icon_buffer[i]);
                x++;
                putPixel565(bitmap->pixels, x, y, icon_buffer[i+1]);
                if (switch_tile_x) i = i + big_up_x;
                else i = i + low_up_x;
                x++;
                switch_tile_x = !switch_tile_x;
            }
            x=0;
            if (switch_tile_y){
                if (jump) j = j + 183;
                else j = j + big_up_y;
                jump = !jump;
            }else j = j + low_up_y;
            switch_tile_y = !switch_tile_y;
            y++;
        }
        free(icon_buffer);
     
  14. Cyan

    Cyan GBATemp's lurking knight
    Former Staff

    Joined:
    Oct 27, 2002
    Messages:
    23,278
    Country:
    France
    Great!
    I don't know if you saw my request in the homebrew request thread, but it's one of the thing I wanted ;)

    Raytracer, phong, etc. and also a simple radiosity renderer just for fun (monte carlo or other method).
    I don't know if it's possible.
     
  15. DEElekgolo

    DEElekgolo Advanced Member
    Newcomer

    Joined:
    Apr 7, 2009
    Messages:
    75
    Country:
    United States
    We'll see! This is actually my first time dealing with ray-tracer related stuff.
    This was actually a port of an ascii-ray-tracer I made.
    [​IMG]
    Once I have the time I'd definitely be up for making it much more advanced than what it is now!
     
  16. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!
    Member

    Joined:
    Nov 24, 2014
    Messages:
    3,161
    Country:
    Italy
  17. Slushie3DS

    Slushie3DS Cold Beverage Lover
    Member

    Joined:
    Jan 9, 2015
    Messages:
    707
    Country:
    United States
    That tripped me out.
     
  18. WateredFire19

    WateredFire19 Banned
    Banned

    Joined:
    Aug 23, 2014
    Messages:
    642
    Country:
    United States
    Could you make your mii have gold pants (special) with a Ninjhax program?
     
  19. Huntereb

    Huntereb GBAtemp Psycho!
    Member

    Joined:
    Sep 1, 2013
    Messages:
    3,235
    Country:
    United States

    No.
     
  20. Slushie3DS

    Slushie3DS Cold Beverage Lover
    Member

    Joined:
    Jan 9, 2015
    Messages:
    707
    Country:
    United States
    Can you elaborate how you accomplished the above?
     
    WateredFire19 likes this.
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Development, Homebrew,