Where to start

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
Bitybity
Interested
Posts: 36
Joined: Wed Dec 07, 2011 2:09 am

Where to start

Post by Bitybity » Tue May 29, 2012 4:13 am

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?

Ricky
Interested
Posts: 23
Joined: Tue May 22, 2012 10:09 am

Re: Where to start

Post by Ricky » Tue May 29, 2012 5:23 am

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.

Xynxyn
Very interested
Posts: 54
Joined: Fri Jun 15, 2012 10:32 am
Location: Poland

GenDevKit or XGCC?

Post by Xynxyn » Fri Jun 15, 2012 10:40 am

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?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Where to start

Post by Stef » Fri Jun 15, 2012 12:37 pm

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: GenDevKit or XGCC?

Post by Stef » Fri Jun 15, 2012 12:40 pm

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 :)

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Fri Jun 15, 2012 4:55 pm

yep...xgcc is no longer the compiler to use

slobu
Very interested
Posts: 85
Joined: Tue Apr 03, 2012 6:02 pm

Post by slobu » Tue Jun 19, 2012 6:29 am

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?

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Tue Jun 19, 2012 8:45 am

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

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Jun 19, 2012 5:50 pm

I use Geany, which has a built in terminal for running makefiles and the like. It's VERY lightweight.

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Tue Jun 19, 2012 6:15 pm

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.

Ricky
Interested
Posts: 23
Joined: Tue May 22, 2012 10:09 am

Re: Where to start

Post by Ricky » Thu Jun 21, 2012 2:50 am

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Where to start

Post by Stef » Thu Jun 21, 2012 7:54 am

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 :)

Post Reply