GCC crosscompiled for Genesis (Mega-Drive)

Well, I think there's no need in rewriting here what you can find out there.

So, I'll put here some interesting links where you can start reading and get conversant to Genesis and its specifications, because without reading you'll get nowhere.

At first, Genesis's processor is the Motorola 68000, that's why we need a compiler that generates m68k binaries.

This link here redirects you to a shell script that, believe it, will save you considerable time trying to compile gcc with binutils.

It will download binutils and gcc-core (only the core is enough), compile them both making a crosscompiler and, that done, will download two more items:

First: the GenDev library written by Stéphane Dallongeville - yes, sir! by the same person who has written Gens (best Genesis and family emulator in my opinion) - including genesis.h and other headers and sources in C and assembly for m68k and Zilog Z80, in order to generate a STATIC library and make your life easier when writting Genesis stuff.

Second: a package with four programs (source codes) that, in the end of the operation, will result in four roms (one for each source). That is is needed to make sure if our Makefile is correct and if our compiler is doing what we expect from it =)

Also note that in lib directory from GenDev library there is a file called md.ld. This file has an extreme importance when compiling something, because its in there that we have information about Genesis's memory partition.


/*----------------------------------------------------------------------------------------------*/


So let's go to what really matters.

Download the installer script.
$ wget -c www.linux.ime.usp.br/~bedulli/mega-drive/install.sh

Before going like a crazy running this script, visit this site http://darkdust.net/writings/megadrive/crosscompiler and read it all, once it was in there I could gather information to write the script.

$ chmod +x install.sh
$ ./install.sh < FULL_path! >

"Depending on the speed of your machine you can now go make yourself a coffee or something, it'll take a few minutes." LOL

It is supposed to give no error. I have run it in some different machines and it has gone all the way through without any error.

Get this package containing tester programs.
$ wget -c www.linux.ime.usp.br/bedulli/mega-drive/compiler_tester.tar.bz2

Change respective lines of ALL Makefile:

from:

ROOT_PATH=/foo

to:

ROOT_PATH=< FULL_path_where_you_installed >

and....

$ make
$ make
$ make $ make

tchãrãns.... we have 4 rom.bin ready to be run on any Genesis emulator.

^^


/*----------------------------------------------------------------------------------------------*/


Now, all you need to do is start reading more about how Genesis works and you can start coding.

Interesting links:

http://emu-docs.org/?page=Genesis

http://darkdust.net/writings/megadrive

http://gendev.spritesmind.net/forum/ | Stéphane participates here as well as other people we may respect.

http://www.zophar.net/documents/genesis.html (among them, READ the Genesis ROM Format file)

Take a look at what we can make after some effort:

http://info.sonicretro.org/Sonic_the_Hedgehog_(16-bit)

Last thing:

I recommend that you compile Gens/GS version r7 (with esd, opengl and the devil if you can)

(Gens/GS version r7 mirror)

See ya and anything you want ask, fell free to send me an e-mail. I surely will do my best to answer you.


/*----------------------------------------------------------------------------------------------*/


e-mail contact Powered by Vim