Making Games For The Dreamcast Using Standard GNU Tools Part I: Getting Your Development System Ready
Dreamcast hacking, or tinkering as you might call it, has exploded all over the game console homebrew scene over the past few months. In reality console programming is not really that new. But most people like myself never really took part in it because it was very difficult and expensive to get started. But now the Dreamcast provides us with a relatively simple interface to get our feet wet in console programming. No more ASM-only coding or non-existant FREE libraries. We now have an easy way to program our Dreamcasts thanks to the hard work done by some very talented coders like [email="bard-dcdev@%28nospam%29allusion.net"]Dan Potter[/email], [email="email@example.com"]Marcus Comstedt[/email], Hitmen and many others.
[size="3"][b]What you need to do before we start[/b][/size]
This is just a simply guide to get you started in DC programming it is by no means complete.
The goal of this series is to get experienced game programmers into DC coding. Thus it is missing all those nice hand-holding beginner's steps.
Here is a list of the hardware and software you will need in order to get started developing for your Dreamcast.
[list=1][*] Sega Dreamcast Console - $99.95 At a Major Retail Store[*] PC to Dreamcast Serial Adaptor (Must be custom-built). Instructions to build one yourself can be found [url="http://mc.pp.se/dc/serifc.html"]here[/url] - about $35.00-$45.00[*] Linux or Windows PC with GCC installed and configured to cross-compile for the SH-4 processor. Instructions can be found [url="http://www.inode.at/hitmen/hitdc/sh4gcc.htm"]here[/url] - FREE ([b]Optional[/b]: you should also cross-compile GCC for the ARM processor too)[*] Next you'll want to grab:[list=1][*][url="http://www.allusion.net/dcdev/softprj/libdream-0.6.tar.gz"]libdream 0.6[/url] Simply FREE Dreamcast library - FREE[*][url="http://www.allusion.net/dcdev/softprj/libc-1.1.tar.gz"]libc 1.1[/url] Provides some basic functions that well need - FREE[*][url="http://www.allusion.net/dcdev/softprj/uploader.py"]uploader.py[/url] Used to upload our program to our Dreamcast *Only for Linux*[*][url="http://www.barcode-search.com/kamka.htm"]DCUploader [i]2.01[/i][/url] Windows based upload util - FREE[/list][*] Dreamcast Serial Slave CD - FREE [url="http://www3.sympatico.ca/fulg/"]Download here[/url]. Instructions for burning a CD can be found on the same page.[/list]
[size="5"][b]Putting Everything Together[/b][/size]
I'm not going to kid you, setting up all this stuff can be a long process if you've never done anything like this before. So you better plan on spending at least a day working on it. Also choose your OS carefully. Cygwin under Win32 works fine but using Linux has so many other advantages. I would recommend that if you do have Linux experience then go with Linux, otherwise use Windows. Make sure you follow all the steps outlined on the above sites for creating the necessary tools e.g. Serial Cable, GCC-Cross Compiler, Serial Slave CD cross-compiler.
[size="5"][b]Compiling Our First Program[/b][/size]
Once everything is setup, you can test it by compiling the [url="http://www.allusion.net/dcdev/softprj/releases/stars_src.tar.gz"]Stars[/url] demo from Dan Potter's site.
[b]Note[/b]: [i]You will have to edit the Makefile to fit your system[/i]
[b]Note[/b]: [i]If you are using the uploader.py script you must keep Minicom open[/i]
Try typing [font="Courier New"][color="#000080"]make run[/color][/font] from the console in the current directory of the demo program. This will test whether you have built your cross-compiler correctly and that your system is producing SH-4 executable files in little endian format. [font="Courier New"][color="#000080"]make run[/color][/font] will also attempt to upload your srec to the Dreamcast only if you have installed uploader.py from Dan's site.
Try typing [font="Courier New"][color="#000080"]make srec[/color][/font] from the console in the current directory of the demo program. This will test whether you have built your cross-compiler correctly and that your system is producing SH-4 executable files in little endian format. Now you will have to use a Windows load utility to upload your srec file to your Dreamcast. [url="http://www.barcode-search.com/DCUpload201beta.zip"]DC Uploader 2.01[/url] works great for this.
After the uploading is done you should see the stars demo on the screen.
[b]Congratulations!!!![/b] You're now ready to create your own real homebrew Dreamcast programs. The next part in this series will talk about using Libdream and KOS for drawing graphics on the screen.
First you should visit [url="http://www.julesdcdev.com"]www.julesdcdev.com[/url]. This is a GREAT portal site with lots of resources to get you started in DC programming. Also try [url="http://newbie.julesdcdev.com"]http://newbie.julesdcdev.com[/url]. Also, I would advise anyone that is interested in DC programming to join the dcdev mailing list: [email="firstname.lastname@example.org"]email@example.com[/email]