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 »

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 »

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 »

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: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

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 »

The one from MSYS is fine.
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

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 »

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 »

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: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

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 »

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: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

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 »

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 »

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 »

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: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

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