DC News is a News and downloads site for the Sega Dreamcast, We have all the latest emulators, homebrew, commercial games for the Dreamcast and all the downloads on this site, we also cover commercial gaming and console news. Part of the DCEmu Homebrew & Gaming Network.

 Tutorials for Dreamcast Section

Tutorial to config DEV-C++ to compile stuff to Dreamcast.

Author Mekanaizer

Here is the 'how to' config DEV-C++

1º - STEP

-First download DEV-C++ (i recommend version 4.9.8.0) from here:
http://www.bloodshed.net/index.html
them install it (i recommend you to install in this 'dir' C:\Dev-Cpp\ )

-then unpack this to the 'dir' C:\Dev-Cpp\
http://la.cible.free.fr/DreamCast/Dev-C++/DC-Dev-C++-0.2.rar

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
and
-"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':
C:\Dev-Cpp\dc-tool
C:\Dev-Cpp\bin
C:\Dev-Cpp\sh-elf\bin
C:\Dev-Cpp\sh-elf

goto "Libraries"and add this 'dir':
C:\Dev-Cpp\dclib

goto "C Includes" and add this 'dir':
C:\Dev-Cpp\dcinclude

goto "C++ Includes"and add this 'dirs':
C:\Dev-Cpp\sh-elf\include\g++-v3
C:\Dev-Cpp\sh-elf\include\g++-v3\backward
C:\Dev-Cpp\dcinclude

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\
http://mekanaizer.planetaclix.pt/files/dc-tool.zip

You need this too
http://adk.napalm-x.com/dc/dcload-serial/dcload-1.0.3-serial-dj3.zip (Discjuggler iso)
or
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)

but...
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.

Just...

Download this and unpack it to the 'dir' C:\Dev-Cpp\dc-tool\
http://mekanaizer.planetaclix.pt/files/scramble.zip

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

romdisk.img:
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

REMEMBER:
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:
http://www.talfi.redtotalonline.net/e107/forum_viewtopic.php?3.373.0

and you can use Propeller's install-setup of this to skip this tut, here:
http://www.talfi.redtotalonline.net/e107/download.php?list.9

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

Credits goto in no order:
-L@cible
-Mekanaizer (me)
-Propeller
-Decan
-Talfi and Talfi.net members



The Hottest DCEmu Posters