Page 1 of 1

Where to start

Posted: Tue May 29, 2012 4:13 am
by Bitybity
Hello everyone, here I come, with another noob question.

Days ago, I started learning C from a tutorial I found somewhere. This tutorial has some examples to be run and compiled in Dev-C++, with some standard C compiler for windows.
And now, I want to expermient C to the MD, and since you have done many compilers, libraries, etc.,

With what do you recommend me to start?

Re: Where to start

Posted: Tue May 29, 2012 5:23 am
by Ricky
Bitybity wrote:Hello everyone, here I come, with another noob question.

Days ago, I started learning C from a tutorial I found somewhere. This tutorial has some examples to be run and compiled in Dev-C++, with some standard C compiler for windows.
And now, I want to expermient C to the MD, and since you have done many compilers, libraries, etc.,

With what do you recommend me to start?
First of all I recommend Code::Blocks :lol:

I'd do some C programming for windows before tackling the MD if I were you. A site that really helped me out was cprogramming.com If you need more resources let me know.

If you insist on setting up SGDK go to Stef's tutorial page
http://code.google.com/p/sgdk/wiki/UseSGDKWithCB

There's a prettier way to set it up in Code::Blocks which is what I'm working on right now.

GenDevKit or XGCC?

Posted: Fri Jun 15, 2012 10:40 am
by Xynxyn
Hi, I'm new at forum. I know BasiEgaXorz, but I will learn C/C++. I don't know what's better for newbie, and what's better for advanced users. XGCC or GenDevKit?

Re: Where to start

Posted: Fri Jun 15, 2012 12:37 pm
by Stef
Ricky wrote: First of all I recommend Code::Blocks :lol:

I'd do some C programming for windows before tackling the MD if I were you. A site that really helped me out was cprogramming.com If you need more resources let me know.

If you insist on setting up SGDK go to Stef's tutorial page
http://code.google.com/p/sgdk/wiki/UseSGDKWithCB

There's a prettier way to set it up in Code::Blocks which is what I'm working on right now.
Just wanted to know, by prettier do you mean complete integration of the gcc compiler in code::blocks without using the makefile ? Because i was doing that before but you need many step to setup compiler correctly and the tutorial was way longer that current one :o

Re: GenDevKit or XGCC?

Posted: Fri Jun 15, 2012 12:40 pm
by Stef
Xynxyn wrote:Hi, I'm new at forum. I know BasiEgaXorz, but I will learn C/C++. I don't know what's better for newbie, and what's better for advanced users. XGCC or GenDevKit?
XGCC is only the compiler as far i know where SGDK provides both (for windows at least) and a library which give you facilities to develop on megadrive :)

Posted: Fri Jun 15, 2012 4:55 pm
by KanedaFr
yep...xgcc is no longer the compiler to use

Posted: Tue Jun 19, 2012 6:29 am
by slobu
I get the feeling with C everyone has a different preferred IDE (or even just a text editor).

Is code:blocks plus the SGDK the "standard" to use? Is there an all inclusive installer with and IDE and SGDK and any dependencies ready to go?

Posted: Tue Jun 19, 2012 8:45 am
by KanedaFr
you're right
Personnally, I prefer eclipse CDT because it lets me customize my makefile the way I want, because I use it every day at the office and because I was about to write some genny related plugins.
There isn't a "ready to use"' package but the wiki should help you to setup CodeBlock or Eclipse.
http://code.google.com/p/sgdk/w/list

Posted: Tue Jun 19, 2012 5:50 pm
by Chilly Willy
I use Geany, which has a built in terminal for running makefiles and the like. It's VERY lightweight.

Posted: Tue Jun 19, 2012 6:15 pm
by djcouchycouch
I use Metapad for basic text editing.

I use Visual Studio for my projects, including Goplanes. It's overkill but I'm too used to it that it's hard to move to something else. I'm a Mac fanboy but can't ever get the hang of Xcode.

Re: Where to start

Posted: Thu Jun 21, 2012 2:50 am
by Ricky
Stef wrote:
Ricky wrote: First of all I recommend Code::Blocks :lol:

I'd do some C programming for windows before tackling the MD if I were you. A site that really helped me out was cprogramming.com If you need more resources let me know.

If you insist on setting up SGDK go to Stef's tutorial page
http://code.google.com/p/sgdk/wiki/UseSGDKWithCB

There's a prettier way to set it up in Code::Blocks which is what I'm working on right now.
Just wanted to know, by prettier do you mean complete integration of the gcc compiler in code::blocks without using the makefile ? Because i was doing that before but you need many step to setup compiler correctly and the tutorial was way longer that current one :o
Yeah that is exactly what I meant :) Look

I went to the compiler settings in the XGCC configuration I made for CodeBlocks and changed the commands to this

Code: Select all

$compiler -m68000 -Wall -O3 -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -fno-builtin-memset -fno-builtin-memcpy -c $includes $res_includes -o $objects_output_dir\$file_name.o $file
$linker -T $(SGDK)/md.ld -nostdlib --oformat binary -o rom_head.bin $objects_output_dir\rom_head.o
$compiler -m68000 -Wall -O3 -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -fno-builtin-memset -fno-builtin-memcpy -c $includes $res_includes $(SGDK)/src/boot/sega.s -o $objects_output_dir\sega.o
It runs just like your makefile.gen but I get more control. I can also add handling for other file types like .bmp and .rc(I renamed to .mdrc)

Here is bmp handling using build commands.

Code: Select all

bintos -bmp $file
$compiler -m68000 -Wall -O3 -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -fno-builtin-memset -fno-builtin-memcpy $includes $res_includes -c $file_name.s -o $objects_output_dir\$file_name.o
rm $file_name.s
Want me to make full tutorial? It's not finished yet, I haven't tried adding support for everything but thats because I've been too busy trying to learn how to actually use SGDK :D

Re: Where to start

Posted: Thu Jun 21, 2012 7:54 am
by Stef
Ricky wrote: Yeah that is exactly what I meant :) Look

I went to the compiler settings in the XGCC configuration I made for CodeBlocks and changed the commands to this

Code: Select all

$compiler -m68000 -Wall -O3 -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -fno-builtin-memset -fno-builtin-memcpy -c $includes $res_includes -o $objects_output_dir\$file_name.o $file
$linker -T $(SGDK)/md.ld -nostdlib --oformat binary -o rom_head.bin $objects_output_dir\rom_head.o
$compiler -m68000 -Wall -O3 -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -fno-builtin-memset -fno-builtin-memcpy -c $includes $res_includes $(SGDK)/src/boot/sega.s -o $objects_output_dir\sega.o
It runs just like your makefile.gen but I get more control. I can also add handling for other file types like .bmp and .rc(I renamed to .mdrc)

Here is bmp handling using build commands.

Code: Select all

bintos -bmp $file
$compiler -m68000 -Wall -O3 -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -fno-builtin-memset -fno-builtin-memcpy $includes $res_includes -c $file_name.s -o $objects_output_dir\$file_name.o
rm $file_name.s
Want me to make full tutorial? It's not finished yet, I haven't tried adding support for everything but thats because I've been too busy trying to learn how to actually use SGDK :D
Ok it is exactly how was the previous tutorial but honestly i found that method a bit long to setup so i changed it to use the makefile instead.
Maybe we can have "basic" and "advanced" tutorial for users who want better integration in Code::Blocks :)