RELEASE My first homebrew - An app that prints nice messages.

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by leafeon34, Jul 21, 2018.

  1. leafeon34
    OP

    leafeon34 意地悪な男の人

    Member
    10
    Sep 30, 2014
    Japan
    Hiding up a cherry blossom
    I downloaded this guy's app and modified it to make it to make the world a better place. I don't know how to compile it but it should be a simple task for anyone who knows what they're doing.

    main.c
    Code:
    #include <string.h>
    #include <stdio.h>
    
    #include <switch.h>
    
    int main(int argc, char **argv)
    {
        gfxInitDefault();
    
        //Initialize console. Using NULL as the second argument tells the console library to use the internal console structure as current one.
        consoleInit(NULL);
    
        //Move the cursor to row 16 and column 20 and then prints "Hello World!"
        //To move the cursor you have to print "\x1b[r;cH", where r and c are respectively
        //the row and column where you want your cursor to move
        printf("Pressing the A, B, X and Y buttons will print nice messages on the screen. Press the plus button to return to the Homebrew menu.");
       
        while(appletMainLoop())
        {
            //Scan all the inputs. This should be done once for each frame
            hidScanInput();
    
            //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
            u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
            if(kDown & KEY_B)
            {
                printf(" You have the most beautiful smile");
            }
    
            if(kDown & KEY_X)
            {
                printf(" Your kindness shines like the sun");
            }
           
            if(kDown & KEY_Y)
            {
                printf(" Love makes life worth living");
            }
           
            if(kDown & KEY_A)
            {
                printf(" The light of hope is born within oneself");
            }
           
            if (kDown & KEY_PLUS) break; // break in order to return to hbmenu
           
            gfxFlushBuffers();
            gfxSwapBuffers();
            gfxWaitForVsync();
        }
    
        gfxExit();
        return 0;
    }
    
     
    Last edited by leafeon34, Jul 21, 2018
    VinLark, TheJumono, Luhof and 5 others like this.
  2. hippy dave

    hippy dave BBMB

    Member
    14
    Apr 30, 2012
    United Kingdom
    What's not to like?
     
  3. Unity150_magickavoxel

    Unity150_magickavoxel Advanced Member

    Newcomer
    3
    Jan 6, 2018
    Canada
    Lol
     
  4. supermario18

    supermario18 ;

    Member
    4
    May 3, 2016
    United States
    this is amazing
     
  5. Risingdawn

    Risingdawn Tempallica

    Member
    8
    May 22, 2010
    United Kingdom
    This post made me want to cuddle a puppy.
     
  6. kikongokiller

    kikongokiller GBAtemp Advanced Fan

    Member
    9
    Jan 12, 2017
    Australia
    Very wholesome. Good job.
     
  7. slaphappygamer

    slaphappygamer GBAPerm

    Member
    8
    Nov 30, 2008
    United States
    Aptos, California
    The start of world peace? I love it and want to hold you close.
     
  8. Chrona

    Chrona Advanced Member

    Newcomer
    4
    May 10, 2008
    Canada
    Could you possibly mod this app to print naughty words instead?
     
  9. subcon959

    subcon959 teh retro

    Member
    12
    Dec 24, 2008
    I was gonna attach an nro for you but it doesn't compile for me.
     
Loading...