How do I compile something here? [solved]

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
O'Kyle
Newbie
Posts: 5
Joined: Mon Aug 10, 2009 2:43 am

How do I compile something here? [solved]

Post by O'Kyle » Tue Aug 11, 2009 2:41 am

Hi, everyone.

I'm new at gen dev and I'd like to make at least some "Hello world", "Hi, mom.." "Is there anybody out there?"

I'm reading some docs for some time now.

First of all I prefer to use linux, so I compile a gcc only for make m68k stuff (gcc-m68k-coff) and it took me some time... After that I got some srcs but I couldn't compile it because I didn't have gen dev pack or any genesis.h and all other things..

I have tried some .s too.

Spending some time on linux and discovering this site, I decided to migrate to windows.

I have done everything Stef said on that tutorial about installing her devkit and code::blocks but when I compile her demo (that one making white dots jumping on screen) the file created by the compiler and linker is different from the original one. Starting from start hehe

the header does not seem to be the header...
"SEGA GENESIS (C) 2009 ........... "
this string is far beyound it was supposed to be..


can someone help me???

I prefer to use linux if possible...
Last edited by O'Kyle on Thu Aug 13, 2009 3:18 am, edited 1 time in total.

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

Re: How do I compile something here?

Post by Stef » Tue Aug 11, 2009 8:49 am

O'Kyle wrote:Hi, everyone.

I'm new at gen dev and I'd like to make at least some "Hello world", "Hi, mom.." "Is there anybody out there?"

I'm reading some docs for some time now.

First of all I prefer to use linux, so I compile a gcc only for make m68k stuff (gcc-m68k-coff) and it took me some time... After that I got some srcs but I couldn't compile it because I didn't have gen dev pack or any genesis.h and all other things..

I have tried some .s too.

Spending some time on linux and discovering this site, I decided to migrate to windows.

I have done everything Stef said on that tutorial about installing her devkit and code::blocks but when I compile her demo (that one making white dots jumping on screen) the file created by the compiler and linker is different from the original one. Starting from start hehe

the header does not seem to be the header...
"SEGA GENESIS (C) 2009 ........... "
this string is far beyound it was supposed to be..


can someone help me???

I prefer to use linux if possible...
Did you downloaded the mini devkit ? (i just realized the link is dead, i'll fix that asap). Be sure to have the sames files in your linux GCC setup than mine win32 GCC setup, don't forget the default libc.a file or stuff like that...

O'Kyle
Newbie
Posts: 5
Joined: Mon Aug 10, 2009 2:43 am

Re: How do I compile something here?

Post by O'Kyle » Tue Aug 11, 2009 9:40 am

Stef wrote: Be sure to have the sames files in your linux GCC setup than mine win32 GCC setup, don't forget the default libc.a file or stuff like that...
I'd like to make something in Windows first because I think you prefer to use it, once you have written that tutorial.

That done, we can try to go to linux

I just ask you to be patient cause I've never compiled anything in windows and I just started to use Code::Blocks

I've being studying the Mega Drive docs for 3 weeks and I know I have a lot to learn yet

I don't know if my gcc in linux is right either, I just followed what this tutorial says http://darkdust.net/writings/megadrive/crosscompiler
He was the first guy I found so I read what he wrote....
Stef wrote: Did you downloaded the mini devkit ? (i just realized the link is dead, i'll fix that asap).
Yes, from the link http://gens.consolemul.com/download/tem ... sDev04.zip

that's how I could compile that demo of yours.... I don't know what happened with the compilation. I think the first bytes of the .bin would be the header of the ROM, but when compiled, they get at other place in .bin

Do you know why??

one more thing:
The header contains the name of the game and all other things like some values to be put in some registers to initialize the VDP, right? and all this information are in sega.s
How the compiler is told that this is the beginning of the ROM file?

Thank you very much for helping me.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Re: How do I compile something here?

Post by TascoDLX » Tue Aug 11, 2009 11:06 am

O'Kyle wrote:I don't know what happened with the compilation. I think the first bytes of the .bin would be the header of the ROM, but when compiled, they get at other place in .bin

Do you know why??
The link order is wrong. It is normally read from makefile.gen in the devkit.

Nevermind that. Read this: viewtopic.php?p=2365#2365

O'Kyle
Newbie
Posts: 5
Joined: Mon Aug 10, 2009 2:43 am

Re: How do I compile something here?

Post by O'Kyle » Tue Aug 11, 2009 7:55 pm

TascoDLX wrote: The link order is wrong
You're right!!!!
sega.o was not the first object I was linking.. In fact I didn't know the order there had something to do with the linking order

Now I can compile and run it in the emulator

You don't know how you helped me, dude!!

Thanks a lot!!

Now I'm trying to make some programs here and after I get more knowledge I try to get back to linux

Thanks again

:) :D :lol:

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

Re: How do I compile something here?

Post by Stef » Tue Aug 11, 2009 9:10 pm

O'Kyle wrote:
Stef wrote: Be sure to have the sames files in your linux GCC setup than mine win32 GCC setup, don't forget the default libc.a file or stuff like that...
I'd like to make something in Windows first because I think you prefer to use it, once you have written that tutorial.

That done, we can try to go to linux

I just ask you to be patient cause I've never compiled anything in windows and I just started to use Code::Blocks

I've being studying the Mega Drive docs for 3 weeks and I know I have a lot to learn yet

I don't know if my gcc in linux is right either, I just followed what this tutorial says http://darkdust.net/writings/megadrive/crosscompiler
He was the first guy I found so I read what he wrote....
Stef wrote: Did you downloaded the mini devkit ? (i just realized the link is dead, i'll fix that asap).
Yes, from the link http://gens.consolemul.com/download/tem ... sDev04.zip

that's how I could compile that demo of yours.... I don't know what happened with the compilation. I think the first bytes of the .bin would be the header of the ROM, but when compiled, they get at other place in .bin

Do you know why??

one more thing:
The header contains the name of the game and all other things like some values to be put in some registers to initialize the VDP, right? and all this information are in sega.s
How the compiler is told that this is the beginning of the ROM file?

Thank you very much for helping me.
I didn't paid attention you were back to a windows setup after you first linux attempt ! I'm glad you finally got things right =)

Hope to see your first rom soon :p

O'Kyle
Newbie
Posts: 5
Joined: Mon Aug 10, 2009 2:43 am

Re: How do I compile something here? [solved]

Post by O'Kyle » Thu Aug 13, 2009 1:31 am

Stef wrote: I didn't paid attention you were back to a windows setup after you first linux attempt ! I'm glad you finally got things right =)
Never mind ^^
Thank you all for helping me
Stef wrote: Hope to see your first rom soon :p
me too hhehehe.

Hope see you soon here.

errr How do I write [solved] in post's name?

RamiroR
Interested
Posts: 18
Joined: Tue Jun 02, 2009 10:45 pm

Post by RamiroR » Thu Aug 13, 2009 1:41 am

editing this topic's first post?

O'Kyle
Newbie
Posts: 5
Joined: Mon Aug 10, 2009 2:43 am

Post by O'Kyle » Thu Aug 13, 2009 3:19 am

RamiroR wrote:editing this topic's first post?
thx =P

Post Reply