-
Notifications
You must be signed in to change notification settings - Fork 112
Making Games
This is an small guide to start making games for Bittboy/PocketGo (not for beginners). Thanks to crait for this guide and gameblabla for his updates.
Since we're working with Linux-based devices, you're going to need to run a Linux distribution. So, if you're on Windows, you'll need to install a Virtual Machine, Cygwin, WSL or something like that.
crait uses Virtualbox along with Xubuntu 18.04 but you can also use mostly any linux distribution as long as it's not too old and that GCC, make and bison are available on it.
I'm using Void linux on my machine myself so most linux distributions should work.
The BittBoy uses a custom firmware based around buildroot and Linux. To compile programs for it, we'll need to get buildroot in order to cross-compile programs for the Bittboy/PocketGo.
There are no up-to-date prebuilt binaries for the toolchain so is recommended to compile from source. Anyways if you want to download a pre-compiled working toolchain you can get it from here.
If you want to make your own, be sure you have the following dependencies:
bison
, make
, gcc
.
You will also need at least 10GB of free space before you can proceed.
Run the following commands in a terminal :
git clone https://github.com/MiyooCFW/buildroot.git
cd buildroot
make sdk
Warning : this can take a long time ! (a few hours depending on your machine)
Once compiling buildroot is done, go to the "output" folder and then inside of that, go to the "host" folder. Now grab the content of that folder inside and put it in /opt/bittboy-toolchain/.
Note that /opt is usually not writable by normal users so you may need to become root, create the folder and copy it inside.
Create a folder for your project with your game's source code and create a makefile for it. Here's the one that crait used for the Midnight Wild game:
CHAINPREFIX= /opt/bittboy-toolchain/
CROSS_COMPILE=$(CHAINPREFIX)/bin/arm-buildroot-linux-musleabi-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip
SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
OUTPUTNAME = midnightwild/midnightwild.elf
DEFINES = -DHAVE_STDINT_H -DVERSION_BITTBOY
INCLUDES = -Iinclude $(SDL_CFLAGS)
OPT_FLAGS = -Ofast -fdata-sections -fdata-sections -fno-common -fno-PIC -flto
EXTRA_LDFLAGS = -lasound -lmikmod -lmodplug -Wl,--as-needed -Wl,--gc-sections -flto -s
CFLAGS = $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -std=gnu11
CXXFLAGS = $(DEFINES) $(INCLUDES) $(OPT_FLAGS) -std=gnu++11
LDFLAGS = -Wl,--start-group -lSDL -lSDL_image -lpng -ljpeg -lSDL_mixer -lfreetype -lSDL_ttf -logg -lvorbisidec -lmikmod -lmodplug -lm -pthread -lz -lstdc++ $(EXTRA_LDFLAGS) -Wl,--end-group
# Redream (main engine)
OBJS = \
src/main.o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
all: $(OBJS)
$(CC) -o $(OUTPUTNAME) $(OBJS) $(CFLAGS) $(LDFLAGS)
clean:
rm -f $(OBJS) $(OUTPUTNAME)
Build your software with "make" in the terminal and you should be good to go!
Do you want to find a good example of some source code for the BittBoy? Check out pingflood's IOTester: https://github.com/pingflood/iotester
If you want more support or questions join our Discord chat server here
- Overview
- Console Hotkeys
- Build Image and SDK
- Build Kernel
- Build uBoot
- Get the prebuilt SDK from GH actions
- Making Games
- Using Docker to Compile Games
- Remote debugging
- USB Networking
- Bug Reporting
- Discussions Topics
- Emulator Info
- Homebrew Info
- DosBox Setup
- RetroArch Setup
- GameBoy
- Gameboy Advance
- Arcade
- PlayStation
Themes
- GMenu2X
- SimpleMenu
Frontends
Projects
Modding
- ALL
- V90
- PocketGo
- BittBoy