Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

TotOOntHeMooN
Interested
Posts: 38
Joined: Sun Jun 01, 2008 1:12 pm
Location: Lyon, France
Contact:

Post by TotOOntHeMooN »

TmEE co.(TM) wrote:You have some pretty nice HW stuff in your blog !!! Too bad I don't understand French...
Thank you. :)
I will translate it as soon as possible. Sorry.
devzone
Interested
Posts: 18
Joined: Sun Jun 01, 2008 12:21 am
Contact:

Post by devzone »

google tried well but failed on a few things :D

http://translate.google.com/translate?u ... n&ie=UTF-8
tails92
Interested
Posts: 41
Joined: Sun May 04, 2008 10:16 pm

Post by tails92 »

Nice, I can understand it quite well but not totally, I'm Italian and my knowledge of French is very limited.
devzone
Interested
Posts: 18
Joined: Sun Jun 01, 2008 12:21 am
Contact:

Post by devzone »

maybe french to italian is better ? I have no idea as I cant speak either :P :D
http://translate.google.com/translate?u ... n&ie=UTF-8
Yuge
Newbie
Posts: 9
Joined: Sat Jul 19, 2008 7:53 pm
Location: Latvia

Post by Yuge »

Hi! I downloaded this devkit and tried to compile a sample that is included. At first I was trying to configure Code::Block, configured, compiled, got rom.bin, but it doesn`t work in Kega emulator. Than I tried with simple makefile - like in bin directory, here is the log (compiling only main.c):

Code: Select all

D:/GenesisDev/bin/gcc  -m68000 -Wall -O1 -fomit-frame-pointer -ID:/GenesisDev/include -c main.c -o main.o
D:/GenesisDev/bin/gcc -TD:/GenesisDev/bin/md.ld -nostdlib  VangelisS.o main.o tranceS.o  -LD:/GenesisDev/lib -lsega -lgcc -v -o rom.bin
Using built-in specs.
Configured with: ./configure --disable-nls --disable-shared --disable-threads --prefix=/usr/local/m68kgcc/out --target=m68k-elf --enable-languages=c
Thread model: single
gcc version 3.4.6
 ld -o rom.bin -LD:/GenesisDev/lib VangelisS.o main.o tranceS.o -lsega -lgcc -TD:/GenesisDev/bin/md.ld
Doesn`t work too. Inspecting binary file seems like it`s generating standart elf file, because there is elf header, where sega header should be.
I wonder which part of compile process is responsible for inserting this header? Any help would be appreciated.
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ »

Try linking with -oformat binary
Or you can convert from ELF to binary in a separate step, using something like objcopy -O binary a.out myrom.bin
Yuge
Newbie
Posts: 9
Joined: Sat Jul 19, 2008 7:53 pm
Location: Latvia

Post by Yuge »

mic_ wrote:Try linking with -oformat binary
Or you can convert from ELF to binary in a separate step, using something like objcopy -O binary a.out myrom.bin
Thanks, already solved that, didn`t knew that objcopy cuts out elf header.

Trying to improve devkit, I`ve rearranged some stuff & added some clever makefiles (mostly copied from devkitpro for NDS).
Here is the installation manual I`ve tested:

Genesis Devkit installation manual
1. Download and unzip GenesisDev20080813.rar (9.2 MB) to some folder (e.g. C:/GenesisDev), it will be your root folder.
2. Download and install msys* to the same folder (C:/GenesisDev/msys/bin).
3. Add Environment Variable:
DEVKITGEN = /c/GenesisDev (use only forward slashes!)
4. Add msys/bin folder to PATH:
PATH = C:\GenesisDev\msys\bin\
* If you already have one, be sure to check whether it's bin directory is added to PATH.

Usage

The pnproj files provided in example directories are Programmers Notepad(included) project files.
There are some hotkeys setup for quick start:
Alt+1 - make (build project, produces binary executable in the same directory)
Alt+2 - clean (delete all build files)

After pressing make, you should get something similiar to this:
Link

Happy deving! -Yuge.

PS. I haven`t seen Stef here in a while, but maybe he could consider moving this project to sourceforge (or similiar), so that automatic 'one click' installer could be made.
Last edited by Yuge on Thu Aug 14, 2008 6:28 am, edited 2 times in total.
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ »

I don't know what you used to create the archive, but WinRAR refuses to extract some of the files:
! C:\GenesisDev20080812.zip: Unknown method in bin\as.exe
! C:\GenesisDev20080812.zip: Unknown method in bin\bintoc.exe
! C:\GenesisDev20080812.zip: Unknown method in bin\cc1.exe

etc etc..
That aside, you should probably consider adding prefixes to the GNU binaries (i.e. gcc -> m68k-elf-gcc or whatever). It makes it clear exactly what they are, and also avoids problems when you've got many different versions of GCC on your computer, and all of them are in your PATH.
Yuge
Newbie
Posts: 9
Joined: Sat Jul 19, 2008 7:53 pm
Location: Latvia

Post by Yuge »

mic_ wrote:I don't know what you used to create the archive, but WinRAR refuses to extract some of the files:
I used 7-zip. I'll repack and upload it as soon as google back from maintenance.
mic_ wrote: That aside, you should probably consider adding prefixes to the GNU binaries (i.e. gcc -> m68k-elf-gcc or whatever). It makes it clear exactly what they are, and also avoids problems when you've got many different versions of GCC on your computer, and all of them are in your PATH.
There are no such problems with this setup, because binary folder is added to PATH only at runtime.
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Yuge wrote:
mic_ wrote:Try linking with -oformat binary
Or you can convert from ELF to binary in a separate step, using something like objcopy -O binary a.out myrom.bin
Thanks, already solved that, didn`t knew that objcopy cuts out elf header.

Trying to improve devkit, I`ve rearranged some stuff & added some clever makefiles (mostly copied from devkitpro for NDS).
Here is the installation manual I`ve tested:

Genesis Devkit installation manual
1. Download and unzip (no link) to some folder (e.g. C:/GenesisDev), it will be your root folder.
2. Download and install msys* to the same folder (C:/GenesisDev/msys/bin).
3. Add Environment Variable:
DEVKITGEN = /c/GenesisDev (use only forward slashes!)
4. Add msys/bin folder to PATH:
PATH = C:\GenesisDev\msys\bin\
* If you already have one, be sure to check whether it's bin directory is added to PATH.

Usage

The pnproj files provided in example directories are Programmers Notepad(included) project files.
There are some hotkeys setup for quick start:
Alt+1 - make (build project, produces binary executable in the same directory)
Alt+2 - clean (delete all build files)

After pressing make, you should get something similiar to this:
Link

Happy deving! -Yuge.

PS. I haven`t seen Stef here in a while, but maybe he could consider moving this project to sourceforge (or similiar), so that automatic 'one click' installer could be made.
I missed your first message along i'm cheking the forum almost everyday sorry :p
Normally if you follow exactly all tutorial steps you should compile correcty your rom : http://www.spritesmind.net/_GenDev/foru ... php?p=2718
I guess you missed something in section 17, anyway now it's fixed :)

Thanks for your dev kit installer =)
It would be really nice if we could even include Code::blocks IDE with pre-configured genesis compiler and libraries, then add reals debug features but i guess this step can come later ;)
Before doing that i need to arrange my library, i've still many broken stuffs pending (mainly related to bitmap and drawing functions)...
Yuge
Newbie
Posts: 9
Joined: Sat Jul 19, 2008 7:53 pm
Location: Latvia

Post by Yuge »

Ok, original devkit post updated, link added.
Stef wrote: Normally if you follow exactly all tutorial steps you should compile correcty your rom
I guess you missed something in section 17, anyway now it's fixed :)
Yeah, I don't use no Code::blocks nor Eclipse IDE's. I was looking for more general solution.
Stef wrote: It would be really nice if we could even include Code::blocks IDE with pre-configured genesis compiler and libraries, then add reals debug features but i guess this step can come later ;)
Actually I don't think that you need to pre-configure IDE now. I removed all hardcoded paths. It only needs to know, where msys make is. And the rest of the magic is now done with makefile.
:D
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Yuge wrote:Ok, original devkit post updated, link added.
Stef wrote: Normally if you follow exactly all tutorial steps you should compile correcty your rom
I guess you missed something in section 17, anyway now it's fixed :)
Yeah, I don't use no Code::blocks nor Eclipse IDE's. I was looking for more general solution.
Stef wrote: It would be really nice if we could even include Code::blocks IDE with pre-configured genesis compiler and libraries, then add reals debug features but i guess this step can come later ;)
Actually I don't think that you need to pre-configure IDE now. I removed all hardcoded paths. It only needs to know, where msys make is. And the rest of the magic is now done with makefile.
:D
Yep makefile is a simpler solution but for some reasons makefile doesn't always behave as i'm expecting.
The clean stuff to start with : win32 doesn't have "rm" command and "del" command doesn't work in the same way so almost time the "makefile clean" is wrong.
Also when i'm using makefile the compilation errors aren't correctly catched by the output analyser and you have to find them yourself in your code instead of "just clicking on the error to see it" ;)

Anyway makefile give more control on compilation :
- z80 asm file compilation
- resource compilation
- ...
which garantee correct compilation in every cases, so it's definitly the solution we should keep.
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ »

win32 doesn't have "rm" command and "del" command doesn't work in the same way so almost time the "makefile clean" is wrong.
msys has rm though, but I don't know how the make shortcut is set up in PN.
Yuge
Newbie
Posts: 9
Joined: Sat Jul 19, 2008 7:53 pm
Location: Latvia

Post by Yuge »

While it finds rm that is, indeed, in bin folder of msys, all works as expected.

Code: Select all

clean:
	@rm -fr $(BUILD) -fr $(DEPENDS) $(TARGET).elf $(TARGET).bin
Also when i'm using makefile the compilation errors aren't correctly catched by the output analyser
It happens, but rarely.
but I don't know how the make shortcut is set up in PN.
Tools->Options->Tools->Scheme (None-Global Tools) :wink:
It`s just a make that is in PATH, if everything is setup as described, invoking make from cmd in project folder should produce equal results.
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

Stef wrote: Yep makefile is a simpler solution but for some reasons makefile doesn't always behave as i'm expecting.
The clean stuff to start with : win32 doesn't have "rm" command and "del" command doesn't work in the same way so almost time the "makefile clean" is wrong.
it's why I talked some months ago to add rm on GenDevKit...
I personnaly did it with, with nm for debugging
the only pb I fight a lot with is the shell :(
sh or cmd.exe ?
Also when i'm using makefile the compilation errors aren't correctly catched by the output analyser and you have to find them yourself in your code instead of "just clicking on the error to see it" ;)

Anyway makefile give more control on compilation :
- z80 asm file compilation
- resource compilation
- ...
which garantee correct compilation in every cases, so it's definitly the solution we should keep.
it's why I used Eclipse.
I love it's "Makefile project" feature! :)

but as always, anyone could argue this IDE is best because of this feature is the one you could live without.
just find you own way to do.
of course it will good to use the same DevKit but it seems it's impossible :(
Post Reply