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

  • Thread starter Deleted User
  • Start date
  • Views 2,270
  • Replies 8
  • Likes 8
D

Deleted User

Guest
OP
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 ,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: you could say it fell out.