Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

ob1
Very interested
Posts: 468
Joined: Wed Dec 06, 2006 9:01 am
Location: Aix-en-Provence, France

Post by ob1 »

KanedaFr wrote:no, I don't mean I want the Spritesmind logo !
Yet, that would make sense.


Why not Stef' URL ?
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

KanedaFr wrote:
Chilly Willy wrote:I made a makefile for the functions, and made a library out of it. That makes it much easier to handle.
COOOOL!! I was about to make it ;)

I just need to confirm something...I know it could be some kind of newbie question, but I never worked with my own lib :
with a lib, will the linker include ONLY used functions or the full lib ?
Linkers have for quite some time only included those functions of a lib that are used. This DOES make link order an issue - link in the wrong order and it won't know if a function is needed or not. In that case, it includes nothing and you get a link error stating functions could not be found. In this case, it's really not much of an issue: the "startup" object file goes first (I hope you noticed that... it was the only part of the kit that didn't go in the library), then all the program object files, then the library, then libm (if you use it) then libc (if you use it), then libgcc. If you looked at the particle example, it's just the start object, the program objects, the lib, and libgcc, in that order.

A well organized toolchain and libraries really help make a program simple to maintain. :D

If you look at my makefiles, you'll see how I organized my toolchain:
gendev - the root directory, it is in /usr/local in my system.
gendev/bin - hold things like the zasm (z80 assembler), asmx (the 68000 assembler), and bin2c. This is where executables go that aren't part of gcc.
gendev/m68k - this is the 68000 gcc toolchain. I use gcc 4.1.1 from uclinux for the 680x0, specifically the 68000 libraries.
gendev/m68k/sdk - this is where the devkit includes, start object, and library was put.
gendev/sh2 - this is the SH2 gcc toolchain. I use gcc 4.3.2 from KPIT (their 903 release).

By the way, if Windows folks are looking for an update in gcc for the m68k, try the ronetix toolchain. It's gcc 4.1.1 for the m68k, although they maintain it more specifically for use with ColdFire systems.

http://download.ronetix.info/toolchains/coldfire/
PgFr
Newbie
Posts: 1
Joined: Wed Nov 25, 2009 4:13 am

Post by PgFr »

hi, it would be possible to get a description of the genesis fonctions library on readme or pdf file ..??
Alex Khan
Very interested
Posts: 77
Joined: Thu Jan 07, 2010 9:51 am

Post by Alex Khan »

The images are missing from Stefs Dev Kit !

Anywhere I can get a visual image of the installation procedure?
Alex Khan
Very interested
Posts: 77
Joined: Thu Jan 07, 2010 9:51 am

Post by Alex Khan »

The images are missing from Stefs Dev Kit !

Anywhere I can get a visual image of the installation procedure?
bastien
Very interested
Posts: 208
Joined: Mon Jun 25, 2007 7:19 pm
Location: Besançon,France
Contact:

Post by bastien »

in my Website
Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru »

New problem I've got with compiler from the devkit.
game.c:(.text+0x61c): undefined reference to `memcpy'
This appeared in linked errors after I've added const char string into a function. Strange thing that I also have an array of const strings in the same code, and it compiles and works fine.

Code looks like this:

Code: Select all

void f(void)
{
 const char *strarr[]={"bla","bla","bla"}; //this is fine
 const char str[]="blablabla"; //adding this causes the error
}
I've avoided the problem by declaring the sting as array with one string, however it would be nice to know how to make it work correctly.
TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX »

Make it static.

Code: Select all

static const char str[]="blablabla";
*or*

If you want to do non-const stuff, write your own memcpy function (or steal one).
Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru »

Ok, static helps, but why array of strings works without declaring it static? What's the difference?
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Shiru wrote:Ok, static helps, but why array of strings works without declaring it static? What's the difference?
The compiler seems to not use the same method internally, anyway interesting enough i guess i can fix that by adding a memcpy function with libc prototype ;)
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Edit : I updated the library to 0.6d, it's still a WIP with some uncomplete stuff.
Many changes, many refactoring, you can grab the last version here :
http://code.google.com/p/sgdk/

I plan to add tutorials and documentation later on the Google Code project.
Vincent
Newbie
Posts: 6
Joined: Wed Dec 08, 2010 10:40 am
Location: Taipei

I am new to the genesis (je debute)

Post by Vincent »

Bonjour Stephane,

Congratz pour ton devkit. I am looking forward for the documentation, tutorials and small samples.

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

Re: I am new to the genesis (je debute)

Post by Stef »

Vincent wrote:Bonjour Stephane,

Congratz pour ton devkit. I am looking forward for the documentation, tutorials and small samples.

Vincent
Thanks :)
Yeak i know tutorial and documentation are really missing, i hope to have time to add them soon =)
Vincent
Newbie
Posts: 6
Joined: Wed Dec 08, 2010 10:40 am
Location: Taipei

Post by Vincent »

Right now I am stuck. A get started, even a minimalist one, would be strongly appreciated (with a minimalist makefile too).

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

Post by Stef »

Vincent wrote:Right now I am stuck. A get started, even a minimalist one, would be strongly appreciated (with a minimalist makefile too).

Regards, Vincent.
I replied to your MP ;)
Post Reply