I was hoping this could be moved to the guide section aswell, since I don't have access to post their.
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.
Pre-Req:
Dev C++
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:
c:\cygwin\bin
c:\cygwin\usr\local\dc\sh-elf\bin
d) Libraries Sub-Tab
e) Add the following directories:
c:\cygwin\usr\local\dc\kos\kos\lib\dreamcast
c:\cygwin\usr\local\dc\kos\kos\addons\lib\dreamcas t
c:\cygwin\usr\local\dc\sh-elf
f) C Includes Sub-Tab
g) Add the following directories:
c:\cygwin\usr\local\dc\kos\kos\include
c:\cygwin\usr\local\dc\kos\kos-ports\include
c:\cygwin\usr\local\dc\kos\kos\kernel\arch\dreamca st\include
c:\cygwin\usr\local\dc\kos\kos\addons\include
c:\cygwin\usr\local\dc\sh-elf\sh-elf\include
h) C++ Includes Sub-Tab
i) Add the following directories:
c:\cygwin\usr\local\dc\kos\kos\include
c:\cygwin\usr\local\dc\kos\kos-ports\include
c:\cygwin\usr\local\dc\kos\kos\kernel\arch\dreamca st\include
c:\cygwin\usr\local\dc\kos\kos\addons\include
c:\cygwin\usr\local\dc\sh-elf\sh-elf\include
c:\cygwin\usr\local\dc\sh-elf\include\c++\3.4.6
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 -> SaveCode:#includeKOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); int main(int argc, char **argv) { printf("\nhello world\n\n"); return 1; }
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.
Last edited by Elven6; March 13th, 2008 at 20:33.
I was hoping this could be moved to the guide section aswell, since I don't have access to post their.
Thanks for the Guide Elven6.Its a lot easier to compile now.
Thanks, the fricken thing is giving me trouble compiling me code now! Even if the code is a Dreamcast port source!!!
Wow thats weird, in the original post's source file, their are no spaces in Dreamcast, but in the submitted post it says Dreamcas t!
When I copied the compiler commands it automatically made a space between "S" and "T".But now it works for me.
There is space to fix: (SPOILER)
Spoiler!
Last edited by Bear_XI; March 16th, 2008 at 00:54.
I wrote a program a long time ago that adds all this info to Dev-C++'s settings file but I didn't release it because I didn't know of a way to add the startup.o object linked in without needed it in your project's directory.
I'll take a look at your tutorial and release it if it works like I'd like. I also have a Dreamcast project file I made that works with Dev-C++ also.
I have translated this guide into Russian
http://www.dcfan.net.ru/forum/showthread.php?t=1119
Awesome! Also a nice translation.
Thanks for the translation alex, lets hope this gets more people into Dreamcast homebrew development!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks