ZGB Installation Tutorial

From GbdevWiki
Jump to: navigation, search

Introduction

ZGB is a gameboy engine devloped by Zal0

Installation

Download and install:

  • gbdk (2.95-3 at the moment of writing this) on c:\gbdk
  • msys anywhere but add the folder msys/bin to your Path environment var
  • BGB on c:\gbdk\bin
  • The ZGB Official repository, anywhere but create an environment variable called ZGB_PATH pointing the common folder eg: c:\ZGB\common

The make that comes with msys doesn't print any error messages and that's why you need to download make for windows too.

Installation on Linux

These instructions were written for an older version of ZGB, but should work in similar fashion for the more recent versions.

GBDK is based on a now ancient version of SDCC and in newer SDCC versions bank support (needed for binaries > 32kB) appears to be broken. However, it is possible to combine GBDK's linker with a more recent version of SDCC to get a less buggy binary and retain banking support 1.

1. Get SDCC version 3.6.0 or 3.5.0, preferably 3.6.0, but check your distro's default version first.

Newer versions 3.9.0 and 3.8.0 don't work with GBDK's linker out of the box.

2. download gbdk-2.96a-i586-pc-linux2.2.tar.gz

unpack to /opt/gbdk (or any other directory of your choice)

Set GBDK_HOME="/opt/gbdk"

For Arch users there is also an AUR package.

Zal0 recommends 2.95-3, but the Linux version of lcc seems to have a problem with Objectfile names that have more than 8 characters 2.

3. git clone ZGB & ZGB template

Set ZGB_PATH="/path/to/ZGB/common"

Modify SDCC and SDASGB in MakefileCommon to point to wherever you put the binaries for sdcc and sdasgb (from step 1).

(4. Change all #includes with \ to / (e.g in StateGame.c))

5. Then you can just use the makefiles to build the project: Open up a terminal in ZGB/common/src/ and type make.

Then go to ZGB-template/src and type make.

This will then build the ROM and put it in ZGB-template/bin/