Let's make a 3DS homebrew together

Discussion in 'The Edge of the Forum' started by TheKingy34, Aug 10, 2016.

  1. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    So, the title.

    I was really bored so I thought of this.

    Just post some code and I'll add it to the homebrew. Tell me which line, etc.

    The code at the moment:

    Code:
    #include <string.h>
    #include <3ds.h>
    #include <stdio.h>
    
    void cls() {
        printf("\e[1;1H\e[2J");
    }
    int main()
    {
        gfxInitDefault();
        //gfxSet3D(true); //Uncomment if using stereoscopic 3D
        consoleInit(GFX_TOP, NULL); //Change this line to consoleInit(GFX_BOTTOM, NULL) if using the bottom screen.
    
       printf("Welcome to The Edge of the 3DS! The best homebrew ever!\n\n\n");
       printf("Press A to begin your lovely experience. :^)");
    
    
    
        // Main loop
        while (aptMainLoop())
        {
            gspWaitForVBlank();
            hidScanInput();
    
        
       u32 kDown = hidKeysDown();
       if (kDown & KEY_A){
       cls();
        printf("Swiftloke was here\n");
        printf("smileyhead said: Oh boi, this gunna be good :creep:\n\n Code:\n del ""\n");
        printf("snowdori is gay and no one like hiim :^)\n");
        printf("delet 300 app limit pls thank you\n");
        }
         
            if (kDown & KEY_START)
                break; //Break in order to return to hbmenu
    
            // Flush and swap frame-buffers
            gfxFlushBuffers();
            gfxSwapBuffers();
        }
    
        gfxExit();
        return 0;
    }
    
    Yeah, It'll be fun.

    Cya.
     
    Last edited by TheKingy34, Aug 14, 2016


  2. Swiftloke

    Swiftloke Hwaaaa!

    Member
    1,770
    1,516
    Jan 26, 2015
    United States
    Nowhere
    Is this C++?
    I only know Win32 console apps right now but please write in the equivalent:
    cout << "Swiftloke was here" << endl;
     
  3. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    Done.
     
  4. smileyhead

    smileyhead Bow ties are cool.

    Member
    GBAtemp Patron
    smileyhead is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,587
    5,501
    Aug 31, 2015
    Hungary
    Budakeszi, Hungary
    Oh boi, this gunna be good :creep:

    Code:
    del "/"
    
     
    Bubsy Bobcat likes this.
  5. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,182
    5,842
    Jun 27, 2015
    United Kingdom
    England, UK
    Code:
    #include <string.h>
    #include <stdio.h>
    #include <3ds.h>
    #include <sf2d.h>
    #include <sfil.h>
    
    #include "stick_magician_png.h"
    
    int main(){
         gfxInitDefault();
         //gfxSet3D(true); //Uncomment if using stereoscopic 3D
         consoleInit(GFX_TOP, NULL); //Change this line to consoleInit(GFX_BOTTOM, NULL) if using the bottom screen.
    
        // Initialize services
        sf2d_init();
        sf2d_texture *SMag = sfil_load_PNG_buffer(stick_magician_png, SF2D_PLACE_RAM);
    
        printf("Swiftloke was here\n");
    
        // Main loop
        while (aptMainLoop()) {
             gspWaitForVBlank();
             hidScanInput();
    
             //code
    
             u32 kDown = hidKeysDown();
             if(kDown & KEY_START) break; //Break in order to return to hbmenu
    
           
             // Draw image
             sf2d_start_frame(GFX_TOP, GFX_LEFT);
             sf2d_draw_texture(160, 120);
             sf2d_end_frame();
    
             sf2d_swapbuffers();
    
             // Flush and swap frame-buffers
             gfxFlushBuffers();
             gfxSwapBuffers();
        }
        gfxExit();
        return0;
    }
    
    Legitimate enough, I would imagine...
     
  6. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    We need a name. I have an icon: upload_2016-8-10_14-43-18.png
     
  7. smileyhead

    smileyhead Bow ties are cool.

    Member
    GBAtemp Patron
    smileyhead is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,587
    5,501
    Aug 31, 2015
    Hungary
    Budakeszi, Hungary
  8. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    Perfect.
     
  9. smileyhead

    smileyhead Bow ties are cool.

    Member
    GBAtemp Patron
    smileyhead is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,587
    5,501
    Aug 31, 2015
    Hungary
    Budakeszi, Hungary
    I hope it's not too edgy. :creep:
     
    TheKingy34 likes this.
  10. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,182
    5,842
    Jun 27, 2015
    United Kingdom
    England, UK
    *COUGH* *COUGH*
    Has my commit not been pushed to the OP yet? :'O

    Any code conflicts? Would you like a sample image to go with that commit? ;O;
     
  11. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    Yes and pls dun hur meh ;_;
     
  12. smileyhead

    smileyhead Bow ties are cool.

    Member
    GBAtemp Patron
    smileyhead is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,587
    5,501
    Aug 31, 2015
    Hungary
    Budakeszi, Hungary
    And where's my
    Code:
    del "/"
    
    ? :creep:
     
  13. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    No thx
     
  14. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,182
    5,842
    Jun 27, 2015
    United Kingdom
    England, UK
    Sample image:

    COMMON.png

    Also, point out conflicts where appropriate; thanks! :yay3ds:
     
  15. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    Your code seems to not want to compile.
     
  16. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,182
    5,842
    Jun 27, 2015
    United Kingdom
    England, UK
    Do you have sf2dlib and sfillib installed in your ctrulib?
     
  17. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    Yes
     
  18. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,182
    5,842
    Jun 27, 2015
    United Kingdom
    England, UK
    Do you remember what the output error was at all?
     
  19. TheKingy34
    OP

    TheKingy34 ҉

    Member
    785
    2,467
    Feb 21, 2016
    United Kingdom
    England I guess
    Nevermind, just needed a reinstall.
     
  20. Swiftloke

    Swiftloke Hwaaaa!

    Member
    1,770
    1,516
    Jan 26, 2015
    United States
    Nowhere
    So, you know C++? Once I'm done with my C++ Win32 console course, do you know where I should go from there?