GBDK on Mac


Hello again!


Install XCode command tools - open terminal : xcode-select --install


Then inside your dosbox preferences:

~/Library/Preferences/DOSBox 0.74-3 Preferences

@echo off
mount H /Users/YOU
mount D /opt/dos
set PATH=D:\;%PATH%

 Rename YOU with your username. 


The projects are stored at - ~/Projects


Use gimp to make and export the image for pcx image file. 

H:
cd Documents/Projects/coolgame
pcx2gb o d logo.pcx logo_tile.c logo_map.c

Makefile for the game you are building:

GBDK = /opt/gbdk
CC   = ${GBDK}/bin/lcc -Wa-l -Wl-m -Wl-j
RGB = /opt/rgbds/rgbfix

BINS   = mygame.gb

all:   $(BINS)

%.o:   %.c
   $(CC) -c -o $@ $<

%.s:   %.c
   $(CC) -S -o $@ $<

%.o:   %.s
   $(CC) -c -o $@ $<

%.gb:   %.o
   $(CC) -o $@ $<

%.gbc:   %.o
   $(CC) -o $@ $< && ${RGB} -vcs -l 0x33 -p 0 $@

clean:
   rm -f *.o *.lst *.map *.gb *.gbc *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm


game.c:

#include <gb/gb.h>
#include <stdio.h>

#include "logo_tile.c"
#include "logo_map.c"

void main() {
    // load logo
    set_bkg_data(0,255, tiledata);
    VBK_REG = 1;
    VBK_REG = 0;
    set_bkg_tiles(0,0,20,18, tilemap);
    SHOW_BKG;
    DISPLAY_ON;

    waitpad(J_START);

    printf(" \n\n\n\n\n\n\n\nYour game goes here.\n");
    waitpad(J_START);
}


Then make to build your binary image to run on a gameboy or an emulator.

Get Ekron (Corey sandbox)

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.