Getting Started with Dreamcast development

From dreamcast.wiki
Revision as of 13:44, 8 December 2022 by Unknown user (talk) (Created page with "''BEWARE: THIS ARTICLE IS CURRENTLY A WIP'' =Introduction= Explain the basic ideas behind the toolchain, KOS, KOS-ports, and a debug link. This guide will cover: * Steps req...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BEWARE: THIS ARTICLE IS CURRENTLY A WIP

Introduction

Explain the basic ideas behind the toolchain, KOS, KOS-ports, and a debug link.

This guide will cover:

  • Steps required for Windows 10/WSL, macOS/Intel, macOS/Apple Silicon, Debian/Ubuntu Linux, and Fedora Linux
    • Steps should be pretty similar for the *nix OSs besides package managers and dependencies
  • Considering and choosing a Dreamcast debug link solution (serial, BBA, LAN)
    • Include charts comparing the pros and cons of each solution
  • Configuring and compiling the toolchain, KOS, and KOS ports
  • Setting up KOS and compiling an example program
  • Executing the sample program using a debug link
    • Include up-to-date ready made CDIs for dcload-serial and dcload-ip
  • Burning a project to CD and preparing for distribution

This guide aims to remain up to date and work on all of the above platforms, but keeping instructions for such a variety of platforms up-to-date can be difficult. If you run into any errors or other challenges while following this tutorial, or simply need clarification on any of the steps, feel free to ask for assistance on the message board and we would be happy to offer assistance and update the guide for the benefit of future readers and others in the community.

Choosing a debug link solution

Explain the differences (costs, performance, and other considerations) among the options.

Setting up and compiling the toolchain with the dc-chain script

First, install dependencies (e.g. gawk patch bzip2 tar make libgmp-dev libmpfr-dev libmpc-dev gettext wget libelf-dev texinfo bison flex sed git build-essential diffutils curl libjpeg-dev libpng-dev)

sudo mkdir -p -m 755 /opt/toolchains/dc
sudo chown -R $(id -u):$(id -g) /opt/toolchains/dc
git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos
cd /opt/toolchains/dc/kos/utils/dc-chain

Choose one of the following:

mv config.mk.stable.sample config.mk
mv config.mk.testing.sample config.mk

Configure config.mk options

./download.sh
./unpack.sh
make erase=1

Toolchain is now built.

Configuring and compiling KOS and kos-ports

cp /opt/toolchains/dc/kos/doc/environ.sh.sample /opt/toolchains/dc/kos/environ.sh 

Edit the environ.sh to your liking. Run the following whenever developing:

source /opt/toolchains/dc/kos/environ.sh
cd /opt/toolchains/dc/kos
make

KOS is now built.

git clone --recursive git://git.code.sf.net/p/cadcdev/kos-ports /opt/toolchains/dc/kos-ports
/opt/toolchains/dc/kos-ports/utils/build-all.sh

kos-ports is now built.

Compiling and running an example program

Give a tutorial on writing and compiling very basic helloworld-style C program, configuring serial or IP link, and running the example

Burning your project to CD and distributing

Explain how to compile a CD project using mkdcdisc or similar tools, and how to package it for distribution.