Skip to content

Instantly share code, notes, and snippets.

@marsmensch
Forked from keztricks/gbdc_mac_dev.md
Created January 31, 2021 14:01
Show Gist options
  • Save marsmensch/50dd9cad9a58c60d49458443ed01bcc0 to your computer and use it in GitHub Desktop.
Save marsmensch/50dd9cad9a58c60d49458443ed01bcc0 to your computer and use it in GitHub Desktop.
Developing in gbdc on Mac

I've been following GamingMonsters's gbdk Gameboy Dev tutorial (it's rad! https://www.youtube.com/playlist?list=PLeEj4c2zF7PaFv5MPYhNAkBGrkx4iPGJo).

Was doing this for my own reference, but thought I may as well flesh out & share I'm on MacOS, so have put together anywhere I've had to do something different, I'm up to Session 10, so will update if anything further comes along as we progress.

Quick heads up, before you run anything here make sure you know what it's doing, this all worked fine and dandy for me, but I'm not making any promises!

"Hello World" - Part 1

Installing gdbk

Only Windows & Linux versions are available at Sourceforge.

A Mac version is available on github, however I had real trouble getting it to compile, fortunately, a pre-compiled version is available.

  1. Download gdbk-mac here Source: https://www.gbdkjs.com/docs/installation/.
  2. Unzip, and stick it wherever you like (I recommend /opt/gbdk/).
  3. Tell the OS where you've installed gbdk, open a terminal and run export GBDKDIR=/path/to/gbdk/ swapping out /path/to/gbdk/ with the wherever you've chosen to put gbdk.

BAT file

The make.bat file is Windows specific, instead we have the lovely makefile.

  1. Instead of make.bat create makefile
  2. Inside your makefile you'll want:
all:
  /path/to/gbdk/bin/lcc -Wa-l -Wl-m -Wl-j -c -o main.o main.c
  /path/to/gbdk/bin/lcc -Wa-l -Wl-m -Wl-j -o main.gb main.o

Be sure to swap out /path/to/gbdk/ with wherever you've put gbdk
3. When you want to compile your code, in terminal run make, be sure you're in the same directory as the makefile.

Note we've removed -DUSE_SFR_FOR_REG from our commands, I'm unsure what this does (let me know if you know!), we're possibly using a different version of gbdk that is used in the tutorial, and this was preventing compiling code.

Emulator (BGB Alternative)

BGB is not available for Mac, Sameboy is, and shares many of BGB's nice dev tools.

https://sameboy.github.io/downloads/

"Sprites" - Part 2

Gameboy Tile Designer

Unfortunately Gameboy Tile Designer is Windows only, and I had trouble finding an alternative. Fortunately it runs brilliantly in Wine.

To get running in Wine:

  1. Install Homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Use Homebrew to install xquartz: brew cask install xquartz
  3. Use Homebrew to install Wine: brew install wine
  4. Download Gameboy Tile Designer
  5. In terminal, launch Gameboy Tile Designer wine /path/to/GBTD/GBTD.exe, make sure to swap out that path for wherever you have downloaded to.

(Source)[https://www.davidbaumgold.com/tutorials/wine-mac/]

"Backgrounds" - Part 4

Gameboy Map Builder

This is exactly the same as getting the Tile Designer running in part 2, so take a look there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment