Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

TulioAdriano
Very interested
Posts: 81
Joined: Tue Jul 10, 2007 7:45 pm
Location: Brazil / USA
Contact:

Post by TulioAdriano » Wed Aug 29, 2007 1:41 pm

Visual Studio 2005? :shock:

That VERY MUCH interests me! :D :D :D 8)
Image

cdoty
Very interested
Posts: 117
Joined: Wed Nov 29, 2006 2:54 pm
Location: Houston, TX
Contact:

Post by cdoty » Mon Sep 03, 2007 6:12 am

ElBarto wrote:Sweet.
I've started a template for visual studio 2005, will post it when it's finish.
Will it work on the Express version?

If so, may sure your keep it out of view from Microsoft, or you might get a cease-and-desist letter.

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Mon Sep 03, 2007 1:48 pm

I don't know, first I've have to find the lost template :D, it's somewhere in one of my hard drive.
And I don't understand why do you say that ? It's just a project template, everybody can make a template and there is a documentation on msdn for doing that.

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

Post by KanedaFr » Wed Oct 24, 2007 9:42 am

I need rm on the bin folder...which one should I add ? which gcc version ? I actually used mingw MSYS one ?
and a shell ...

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Wed Oct 24, 2007 1:03 pm

The one from MSYS is fine.

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

Post by KanedaFr » Fri Oct 26, 2007 11:33 am

I take the liberty to mod this post as an annoucement, so it will be easier to find it and new users will see it too...

do you think I must move it on "Tools"?

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

Post by Stef » Sat Oct 27, 2007 8:18 pm

KanedaFr wrote:I take the liberty to mod this post as an annoucement, so it will be easier to find it and new users will see it too...

do you think I must move it on "Tools"?
Good idea ;)
I always go in the "Tools" section when i'm searching for this topic, i think it's definitly where we should find it (i know, i created the topic, i'm the only to fault :p)

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

Post by Shiru » Thu Dec 13, 2007 10:46 am

This question not relates to devkit itself, but to GCC which this devkit uses.

I moved my project from SGCC to GCC from devkit. Because I already have many code which works with hardware directly, I don't need devkit code itself, so I removed it. I made new makefile.gen without including any libs and with new sega.s (only one change - directly call 'main' instead of 'start'). I changed variables types to correct ones, add volatile keyword to pointers, etc.

Now I have big problem. Project don't work. Base code works. Graphics loading, palette functions, vsync wait, input works. Both music and sound effects players works. But other code does not work.

I noticed that it because code hangs almost anywhere where % operation used, though in some places it works OK (always hangs in one place and not hangs in another, i.e. problem is stable). It hangs on lines like these (variables usually 'unsigned short' and 'short'):

x=(x+1)%40;
ptr=(ptr+1)%mwdt;

Is there something which I don't know about this operation in this compiler? (I often use such operations with many compilers and never had any problems) Or I broke something when remove unneeded devkit code? Or maybe it bug?

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

Post by KanedaFr » Thu Dec 13, 2007 11:03 am

Code: Select all

x=(x+1)%40; 
ptr=(ptr+1)%mwdt; 
does it mean code hangs where you try do define a var to itself modulo something ?

could you test if this work :

Code: Select all

x=((x+1)%40); 
ptr=((ptr+1)%mwdt);
at least, I assume this works :

Code: Select all

x++;
x%=40; 

ptr++
ptr%=mwdt;

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

Post by Shiru » Thu Dec 13, 2007 11:14 am

KanedaFr wrote:could you test if this work :

Code: Select all

x=((x+1)%40); 
ptr=((ptr+1)%mwdt);
Not works.
KanedaFr wrote:at least, I assume this works :

Code: Select all

x++;
x%=40; 
ptr++
ptr%=mwdt;
This works. But.. I also noticed one place where code hangs on:

Code: Select all

ssy=sy%mhgt;
I.e., where result goes not same variable. In this case code like:

Code: Select all

ssy=sy;
ssy%=mhgt;
..does not helps.

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

Post by Chilly Willy » Thu Dec 13, 2007 12:38 pm

I use gcc 4.1.1 for my Genesis compiler and it works fine... as long as you remember to copy the correct libgcc.a file into the libs directory. You need the 68000 version, and the one in that dir by default was 680x0 (020+) version.

The ld file also needed some changes. There's a thread on setting up code::blocks with the devkit where I replied on the changes I did to get it working with gcc 4.

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

Post by Stef » Thu Dec 13, 2007 6:01 pm

Shiru wrote:
KanedaFr wrote:could you test if this work :

Code: Select all

x=((x+1)%40); 
ptr=((ptr+1)%mwdt);
Not works.
KanedaFr wrote:at least, I assume this works :

Code: Select all

x++;
x%=40; 
ptr++
ptr%=mwdt;
This works. But.. I also noticed one place where code hangs on:

Code: Select all

ssy=sy%mhgt;
I.e., where result goes not same variable. In this case code like:

Code: Select all

ssy=sy;
ssy%=mhgt;
..does not helps.
It can sound stupid but are you not simply doing division by 0 exception (%0) ?
If not, do you checked the i_ldiv function in sega.s file ? as you don't have the base library you need manual implementation of 32 bits multiplication and division for GCC. Maybe the division code (used by modulo function) is buggy but i'm surprised as i never meet any problems. Did you modified it ?

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

Post by Shiru » Sat Dec 15, 2007 4:14 pm

Stef wrote:It can sound stupid but are you not simply doing division by 0 exception (%0) ?
This was first that I check. Of course not, especially in case %40 in code above.
Stef wrote:If not, do you checked the i_ldiv function in sega.s file ? as you don't have the base library you need manual implementation of 32 bits multiplication and division for GCC. Maybe the division code (used by modulo function) is buggy but i'm surprised as i never meet any problems. Did you modified it ?
I use sega.s from devkit with only one modification - I replaced jump to 'start' to direct jump to 'main' (only one line).

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

Post by Stef » Wed Mar 05, 2008 11:31 pm

Shiru wrote:
Stef wrote:It can sound stupid but are you not simply doing division by 0 exception (%0) ?
This was first that I check. Of course not, especially in case %40 in code above.
Stef wrote:If not, do you checked the i_ldiv function in sega.s file ? as you don't have the base library you need manual implementation of 32 bits multiplication and division for GCC. Maybe the division code (used by modulo function) is buggy but i'm surprised as i never meet any problems. Did you modified it ?
I use sega.s from devkit with only one modification - I replaced jump to 'start' to direct jump to 'main' (only one line).
I realised i never replied your last post.
I think the 32 bits modulo operation is buggy, i guess you're doing it on 32 bits sized variable ? I rarely use modulo but i never meet any problem with division. I'll check the 32 bits modulo code in sega.s file, maybe a stupid bug.

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

Post by KanedaFr » Sun Mar 09, 2008 12:44 am

Hi all,

I finally added a tutorial to use Eclipse CDT with Genesis Dev Kit

Check it out and see if it could suit your need...IF Code::Blocks doesn't suit you !

Post Reply