View Full Version : Tutorial to config DEV-C++ to compile stuff to Dreamcast. (by Mekanaizer)

September 5th, 2006, 14:23
Here is the 'how to' config DEV-C++

1 - STEP

-First download DEV-C++ (i recommend version from here:
them install it (i recommend you to install in this 'dir' C:\Dev-Cpp\ )

-then unpack this to the 'dir' C:\Dev-Cpp\

Then follow this little tut to config the compiler:
Goto the menu "TOOLS", select "COMPILER OPTIONS" and then "COMPILER":
Create a 'compiler set' by selecting the "+" then it will show a little windows with "New compiler" writen on it, just change that to "Dreamcast". Now we will have two 'compiler setings':
-"Default compiler" to compile x86 stuff
-"Dreamcast" to compile DC stuff
Change then to your needs :-)

then Goto the menu "TOOLS", select "COMPILER OPTIONS" and then "DIRECTOREIS":

goto "Binaries" and add this 'dirs':

goto "Libraries"and add this 'dir':

goto "C Includes" and add this 'dir':

goto "C++ Includes"and add this 'dirs':

now goto "PROGRAMS" and change the lines to equal this lines:
gcc: c:\Dev-Cpp\sh-elf\bin\sh-elf-gcc.exe
g++: c:\Dev-Cpp\sh-elf\bin\sh-elf-g++.exe
gprof: c:\Dev-Cpp\sh-elf\bin\sh-elf-gprof.exe

Now just press "ok" to save the setings.

And open a Example from the example dir
try to compile it (if it outputs a *.exe file then goto menu "PROJECT", select "PROJECT OPTIONS" then select "BUILD OPTIONS" and 'check' the box for "Override output filename" now change the *.exe to *.elf (remember that you most do this just to the "Dreamcast" compiler seting profile)

2 - STEP

Here is a tut for DEV-C++ to work with DC-tool.

Get this and unpack it to the 'dir' C:\Dev-Cpp\

You need this too
http://adk.napalm-x.com/dc/dcload-serial/dcload-1.0.3-serial-dj3.zip (Discjuggler iso)
http://adk.napalm-x.com/dc/dcload-serial/dcload-1.0.3-serial-nero5.zip (Nero iso)
Copy one of the isos to a CD then boot it in the Dreamcast (you have to have to coders-cable already conected)

At the Dreamcast.mak file remove:
dc-tool -e -x $(BIN) (if the line has a # remove it too)
and copy this to the same place:
dc-tool -t COM1 -b 115200 -x $(BIN)
(if you are using the coders-cable at COM_1 port)

If you use the coders-cable at COM_2 port copy this:
dc-tool -t COM2 -b 115200 -x $(BIN)

3 - STEP

Here is the 'How to' make a selfbootable *.bin file.


Download this and unpack it to the 'dir' C:\Dev-Cpp\dc-tool\

here is an example of a 'dreamcast.mak' file:

genromfs -f romdisk.img -d romdisk -v

romdisk.o: romdisk.img
bin2o romdisk.img romdisk romdisk.o

all-before: romdisk.o

all-after :
dc-tool -t COM2 -b 115200 -x $(BIN)
sh-elf-objcopy -O binary psx.elf psx.bin
scramble psx.bin 1ST_READ.BIN

As you can see we have two new lines below the 'dc-tool' line.

And here is what they do:
The line:
sh-elf-objcopy -O binary pcx.elf pcx.bin
converts the *.elf file to an unscrambled *.bin file
(as you all may know an unscrambled *.bin file can be used to create a not-selfbootable iso 'you will need a Boot-CD to boot a iso with an unscrambled *.bin file')

The last line:
scramble pcx.bin 1ST_READ.BIN
will scramble the *.bin file so you can create a selfboot iso with it

sh-elf-objcopy -O binary psx.elf psx.bin
scramble psx.bin 1ST_READ.BIN

Where you see 'psx.elf' and 'psx.bin' just name it with the name of your project!!!!!!!!

You can look at the original forum post here:

and you can use Propeller's install-setup of this to skip this tut, here:

For aditional help contact me (Mekanaizer) at the DCemu.co.uk forum. :-)

Credits goto in no order:
-Mekanaizer (me)
-Talfi and Talfi.net members

October 14th, 2006, 22:05
this is the kos.h,v 1.25 2003/05/23, right?

Isn't it possible to have a newer KOS version, like the one in the DC Dev ISO r2?
I tried to get DC Dev ISO r2 running with DEV-C++, but with zero (non, 0) success. Maybe someone else could try?
And please if you use old KOS wirte it in your 'how to'.
Every 1/2 year I install the old KOS, thinking someone managed to get the new running...

And I think in the Project Options are some things missing (depending on what libs you are using) e.G.:

-Wall -g -ml -m4-single-only -O2 -fno-builtin -fno-strict-aliasing -fomit-frame-pointer -fno-optimize-sibling-calls

-ml -m4-single-only -nostartfiles -nostdlib -Wl,-Ttext=0x8c010000
startup.o romdisk.o
-lpng -loggvorbisplay -lmp3 -lz -lm -lkallisti -lgcc



January 21st, 2007, 20:34
Some of the mandatory downloads don't work, can you update the links?

April 26th, 2009, 07:28
I have been trying to follow this and set up my own Dev environment but I always get so many errors when I try to compile anything, even examples :(
Sometimes I think I will never get to use my Dreamcast Coders Cable
Is there any tutorial to start developing stuff that is easier? And possible bug free :p