Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
/ sdl-hello-world Public archive

Draw "hello world" on the screen of the Nintendo Switch

Notifications You must be signed in to change notification settings

vgmoose/sdl-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This program draws "Hello world!" on the Nintendo Switch using a bitmap font.

The main code is in hello.c.

To see another simple SDL2 program with graphics and input, see spacenx, or for a more complicated one appstorenx

Compiling

For Switch (libtransistor)

  1. You will need llvm for your computer. You can probably get this through your package manger (eg. brew install llvm, see here for more info)

  2. Setup and install libtransistor by downloading it from the releases page. It is recommended to copy it to /opt/libtransistor.

  3. Export the following environment variable to where you unpacked libtransistor. You may want to put this line in your bash profile:

export LIBTRANSISTOR_HOME=/opt/libtransistor
  1. Clone, setup, and compile sdl-libtransistor:
git clone https://github.com/reswitched/sdl-libtransistor.git
cd sdl-libtransistor
make -f switch.mk
  1. Install pyelftools and lz4via pip
pip3 install pyelftools lz4
  1. Clone this repo and run make:
git clone https://github.com/vgmoose/sdl-hello-world.git
cd sdl-hello-world
make

A file hello.nro should be sitting in your current directory.

For Switch (libnx)

  1. Setup and install dkp-pacman

  2. Install devkitA64 needed Switch dependencies via dkp-pacman:

sudo dkp-pacman -S devkitA64 libnx switch-tools switch-sdl2
  1. Clone this repo and run make:
git clone https://github.com/vgmoose/sdl-hello-world.git
cd sdl-hello-world
make -f Makefile.libnx

A file hello.nro should be sitting in the build folder.

For PC

This program can also be compiled for the computer. There's no Makefile target, but with SDL2 installed:

gcc -lSDL2 *.c -o hello
./hello

Running

You can run this program on most Switches that were released prior to June 2018 regardless of firmware. For detailed instructions, see this post.

You should put the hello.nro file in sd:/switch/hello.nro and then run hbmenu in order to run this app.

If you need additional resources or help, you can feel free to stop by the Homebrew App Store discord server, make an issue on this repo, or contact me directly.