March 13th, 2008, 20:57 Posted By: Elven6
Heres a guide to get Dev-C++ to do things that would make it compatible with the Dreamcast file type. Im working from the old R2 guide, but im just making adjustments to bring it up to date.
This is my first guide, so please be easy on it, unlike whats happened to the other guides, I will do my best to keep things updated and answer and questions you may have.
DC Dev R4
A Dreamcast (Duh!)
Some minor knowledge in Computer Science will help ALOT.
Note: This guide assumes the directory that Cygwin is installed in is c:\cygwin, for the sake of simplicity please install it in the default directory.
1) Setting up the compiler
a) Go to Tools Menu -> Compiler options
b) Create a new compiler, name it Dreamcast
c) Add this to the compiler commands : -O2 -DFRAME_POINTERS -ml -m4-single-only -fno-optimize-sibling-calls -D_arch_dreamcast -D_arch_sub_pristine -Wall-g -fno-builtin -fno-strict-aliasing -ml -m4-single-only -Wl,-Ttext=0x8c010000-nostartfiles -nostdlib
d) Add this to the linker commands : -g -fno-builtin -fno-strict-aliasing -ml -m4-single-only -Wl,-Ttext=0x8c010000 -nostartfiles -nostdlib -Wall-g C:\cygwin\usr\local\dc\kos\kos\kernel\arch\dreamca st\kernel\startup.o -lstdc++ -Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group
Note: Notice the -Wall-g command in both of the commands above, depending on the program you are using, it may require a space ex: -Wall -g, the hello world program show below will not, however other programs probably will, so be on the look out for it.
2) Setting up the directories
a) Directories Tab
b) Binaries Sub-Tab
c) Add the following:
d) Libraries Sub-Tab
e) Add the following directories:
f) C Includes Sub-Tab
g) Add the following directories:
h) C++ Includes Sub-Tab
i) Add the following directories:
3) Linking programs
a) Go To The Programs Tab
b) Set the following programs to these:
gcc -> sh-elf-gcc.exe
g++ -> sh-elf-g++.exe
gprof -> sh-elf-gprof.exe
4) The Hello World Test
a) File -> New -> Project
b) Empty Project
c) Project -> Project Options
d) Compiler Tab
e) Select the Dreamcast compiler, then go to build options, at the bottom check the override box and change the extension to .elf ex: project1.exe -> project1.elf
f) Click OK
g) Project -> New File
h) Type the following:
i) File -> Save
j) Save as main.c
k) Execute -> Compile
You should know have a .elf file in the folder you saved your project too. You can upload it to your Dreamcast via Dctool OR convert the file and run it in a emulator OR using Bootdreams to burn it to a disc. (Don't ask me how to convert because I don't know how either)
So what do you think? If you liked it then please visit my blog (link is in my signature), if you have any questions please leave them below.
For more information and downloads, click here!
There are 10 comments - Join In and Discuss Here