[Release] Hello World

Discussion in '3DS - Homebrew Development and Emulators' started by JoostinOnline, Jan 23, 2015.

  1. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    This is just a template for anyone who wants to get started on text-based 3DS homebrew, and doesn't care about it looking good. It is the bare minimum for running an app, but notes are included. It is of no use to people who don't want develop apps.

    Download

    How to use
    You need some basic knowledge of C of course, but I've included some notes in the code. Here are some commands:
    • make: build a 3dsx (NINJHAX) and cia (Gateway) executable.
    • make clean: delete the previously built files.
    • make run: Runs the homebrew file in 3dmoo so you can at least know if it works.
    How to make it look nicer
    Using printf is easy, but it's not pretty. Using colors can change that. I made a file to easily do just that.
    1. Save this as color.h in the source folder.
    2. Add #include "color.h" to the top of your source file.
    3. Use SET_COLOR(x) whenever you want to switch the font/background color, where x is any one of the colors listed in color.h
    PS: I'm aware that another Hello World app exists, but it is far more complex and uses a custom font.
     
    Last edited by JoostinOnline, Jul 11, 2015
    JoelRL11, Coc4tm, WhoAmI? and 11 others like this.


  2. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    I made file for changing the font and background color.
     
  3. VinsCool

    VinsCool Comfortably Numb

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

    Our Patreon
    11,865
    28,411
    Jan 7, 2014
    Canada
    Another World
    Thanks! That sure will help me alot :)
     
  4. Nollog

    Nollog GBAtemp Addict

    Member
    2,703
    472
    Oct 10, 2008
    check your path hun.
     
  5. ewin00

    ewin00 GBAtemp Regular

    Member
    146
    32
    Mar 24, 2011
    Indonesia
    this is great to show off on youtube
     
  6. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    What error?

    ewin00 Lol, like I said in the post, it's of no use as an app alone. It's just a bare-minimum template.
     
  7. DarkFlare69

    DarkFlare69 GBAtemp Psycho!

    Member
    4,721
    2,574
    Dec 8, 2014
    United States
    Ohio
    Good job.
     
  8. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    I just found out that WinterMute recently added a hello world to ctrulib (almost identical to mine, since they are the same principle), but I'm leaving this up because of the color.h file I made.

    Kelton2 Your ctrulib is out of date.
     
    VinsCool likes this.
  9. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Either use GIT to get the latest version, or just download it here. Next, extract it (if you downloaded the zip) and open command prompt in \ctrulib-master\libctru\. Type "make install" and press Enter.
     
    Kelton2 likes this.
  10. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    You need to tell me what the errors are. Try "make", then "make install".
     
  11. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    It's because you have a space in one of the folder names. Change "ctrulib-master (1)" to "ctrulib-master", or anything else without spaces. Run "make clean" before "make install", just to be safe.

    Btw, to copy everything in command prompt, right-click on the text, choose Select All, right-click again, then paste it anywhere.
     
  12. VinsCool

    VinsCool Comfortably Numb

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

    Our Patreon
    11,865
    28,411
    Jan 7, 2014
    Canada
    Another World
    I really should seriously study C code instead of overlooking documentation. :unsure:
    If only I wasn't so dumb I could handle better than basic stuff. I wish I could contribute.
     
    2Hack likes this.
  13. flarn2006

    flarn2006 GBAtemp Fan

    Member
    376
    165
    Apr 6, 2014
    United States
    You should add stuff to the makefile for building a CIA; I looked at the makefile and don't see anything like that.
     
    VinsCool and Kelton2 like this.
  14. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    That's a good idea. Thanks.
     
  15. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Does anyone have a Gateway cart?

    Edited for bitchy people:
    Who here has a Gateway cart and is willing to test?
     
  16. flarn2006

    flarn2006 GBAtemp Fan

    Member
    376
    165
    Apr 6, 2014
    United States
    Uhh yeah, lots of people do, I included. Do you need help with something?
     
  17. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
  18. flarn2006

    flarn2006 GBAtemp Fan

    Member
    376
    165
    Apr 6, 2014
    United States
    Nope, sorry. In the Gateway menu it just appears as a blank white square, with no title text when you highlight it. If you select it nothing happens; it just shows up as if no cartridge is inserted.
     
    JoostinOnline likes this.
  19. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
  20. WeedZ

    WeedZ Possibly an enlightened being

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

    Our Patreon
    2,864
    5,684
    Jan 13, 2015
    United States
    George?