Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

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

Post by Stef » Tue Apr 10, 2007 6:55 pm

MG wrote:
Stef wrote:YM2612_Init() isn't anymore called in this version as far i remember :)
Arf... hum... it's in an older file :/
Hehe no problems ;) as you saw, many minors fixes and changes :)

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Tue Apr 10, 2007 7:34 pm

There is ! by the way, how you figured this code ? where did you got the documentations ? In gens, my only way to implement multipad support was reverse engineering from 4-players game...
Héhé, its a long story :)

I had a .txt documentation, so i coded a SegaMultitap code (which wasn't working exept in some rare cases, as usual LOL).
Then MaskOfDestiny fully coded a SegaMultitap with the help of the segasaturn manual & reverse engenering of the hardware.
It was ultraslow because it was using the "periferial-per-periferial-directory-mode" of the sega multitap.
Then Steve Snake (he knows everything, you don't remember?) helped me a lot to do the EA4Wayplay code.
The segamultitap model2 (with two wires) is also compatible.
This mode is very fast to use, very easy to understand (it use one wire to select the joypad, and the other wire to read it, as usual ^^)...


I'm gonna email you the files soon.

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

Post by Stef » Tue Apr 10, 2007 9:54 pm

Fonzie wrote:
There is ! by the way, how you figured this code ? where did you got the documentations ? In gens, my only way to implement multipad support was reverse engineering from 4-players game...
Héhé, its a long story :)

I had a .txt documentation, so i coded a SegaMultitap code (which wasn't working exept in some rare cases, as usual LOL).
Then MaskOfDestiny fully coded a SegaMultitap with the help of the segasaturn manual & reverse engenering of the hardware.
It was ultraslow because it was using the "periferial-per-periferial-directory-mode" of the sega multitap.
Then Steve Snake (he knows everything, you don't remember?) helped me a lot to do the EA4Wayplay code.
The segamultitap model2 (with two wires) is also compatible.
This mode is very fast to use, very easy to understand (it use one wire to select the joypad, and the other wire to read it, as usual ^^)...


I'm gonna email you the files soon.
Glad to hear you have an efficient code for that :) Thanks for sharing it !
Steve Snake maybe got some "authentics" documents about how use these multipad (NBAJam ?).
On my side, i fixed the timer bug :) as expected it was due to this insane VCounter rollback at end of frame...

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Wed Apr 11, 2007 3:17 pm

Stef wrote:
Fonzie wrote:
There is ! by the way, how you figured this code ? where did you got the documentations ? In gens, my only way to implement multipad support was reverse engineering from 4-players game...
Héhé, its a long story :)

I had a .txt documentation, so i coded a SegaMultitap code (which wasn't working exept in some rare cases, as usual LOL).
Then MaskOfDestiny fully coded a SegaMultitap with the help of the segasaturn manual & reverse engenering of the hardware.
It was ultraslow because it was using the "periferial-per-periferial-directory-mode" of the sega multitap.
Then Steve Snake (he knows everything, you don't remember?) helped me a lot to do the EA4Wayplay code.
The segamultitap model2 (with two wires) is also compatible.
This mode is very fast to use, very easy to understand (it use one wire to select the joypad, and the other wire to read it, as usual ^^)...


I'm gonna email you the files soon.
Glad to hear you have an efficient code for that :) Thanks for sharing it !
I think the code I wrote for the Sega protocol (which is compatible with both versions of the Sega multi-tap, but not the EA one) could be made reasonably fast. Part of the problem with the code I wrote is that I ran into a bug in the build of GCC I was using. I ended up sticking in a lot of debugging code and extra nops trying to figure out why my code was broken only to find the compiler was broken. I never cleaned out the extra nops and didn't have time to optimize the code. Given enough time I'm sure I could get it running reasonably, but at the time I was having trouble making time for Sega coding and Fonzie was understandably eager to get MMM finished (I had already delayed things quite a bit by taking an incredibly long time to fix some bugs in my CD library).

I was surprised at the amount of info on the Genesis peripherals in the official Saturn docs. It has info on everything from the standard 3-button to the Mega Mouse and Sega multi-tap. Makes you wonder if Sega was planning an adatper to let you use Genesis peripherals on the Saturn at one point. The only reason I resorted to reverse engineering is that the documentation wasn't entirely clear in a couple of places.

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

Post by Stef » Thu Apr 12, 2007 8:17 pm

Mask of Destiny wrote:
Stef wrote:
Fonzie wrote: Héhé, its a long story :)

I had a .txt documentation, so i coded a SegaMultitap code (which wasn't working exept in some rare cases, as usual LOL).
Then MaskOfDestiny fully coded a SegaMultitap with the help of the segasaturn manual & reverse engenering of the hardware.
It was ultraslow because it was using the "periferial-per-periferial-directory-mode" of the sega multitap.
Then Steve Snake (he knows everything, you don't remember?) helped me a lot to do the EA4Wayplay code.
The segamultitap model2 (with two wires) is also compatible.
This mode is very fast to use, very easy to understand (it use one wire to select the joypad, and the other wire to read it, as usual ^^)...


I'm gonna email you the files soon.
Glad to hear you have an efficient code for that :) Thanks for sharing it !
I think the code I wrote for the Sega protocol (which is compatible with both versions of the Sega multi-tap, but not the EA one) could be made reasonably fast. Part of the problem with the code I wrote is that I ran into a bug in the build of GCC I was using. I ended up sticking in a lot of debugging code and extra nops trying to figure out why my code was broken only to find the compiler was broken. I never cleaned out the extra nops and didn't have time to optimize the code. Given enough time I'm sure I could get it running reasonably, but at the time I was having trouble making time for Sega coding and Fonzie was understandably eager to get MMM finished (I had already delayed things quite a bit by taking an incredibly long time to fix some bugs in my CD library).

I was surprised at the amount of info on the Genesis peripherals in the official Saturn docs. It has info on everything from the standard 3-button to the Mega Mouse and Sega multi-tap. Makes you wonder if Sega was planning an adatper to let you use Genesis peripherals on the Saturn at one point. The only reason I resorted to reverse engineering is that the documentation wasn't entirely clear in a couple of places.
Well, it's a shame, i searched for age these documents and they were available for saturn devers :P

MG
Very interested
Posts: 56
Joined: Wed Feb 28, 2007 8:41 am
Contact:

Post by MG » Wed Apr 18, 2007 11:47 am

Yop !

Kaneda had made a very good work on FM/PSG/DAC player (3 in one, éh éh ;) )
I want to submit my contribution to the convertion of this work into the "GenDevKit"...

Here are the libraries :
http://blatter.perso.cegetel.net/mdprog/lib_include.zip
An example (with sources/ressources included and an adaptation of Kaneda script for Mappy to respect the syntax with the compiler...
Always war between ";" and "*" from comment in assembler files) :
http://blatter.perso.cegetel.net/mdprog/zic.zip

A+
Ah ? ben si ? pourquoi pas...

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

Post by KanedaFr » Thu Apr 19, 2007 1:40 pm

so, as we said in MVSTracker post, your PSG comment is wrong because of me....sorry

and for "war" between ";", "*" and "|"...it's why I use maccerX ;)*
I added GCC support when I switched from SGCC to XGCC...I didn't want to rewrite all my asm files! ;)
I so keep my asm file with the comment format I want but compile to any compiler !
you really should try it and/or include it in your compiling process like I do.
I never got feedback on Maccer so if there is something wrong with it, contact me ;)

MG
Very interested
Posts: 56
Joined: Wed Feb 28, 2007 8:41 am
Contact:

Post by MG » Thu Apr 19, 2007 1:52 pm

At the beginning i'll try to use maccer without success...
but at the beginning, there are lot of things to learn...
in future, i'll try again. :)
Ah ? ben si ? pourquoi pas...

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

Post by KanedaFr » Thu Apr 19, 2007 1:59 pm

I first used it for binary include then I was happy to convert my old asm files!

MG
Very interested
Posts: 56
Joined: Wed Feb 28, 2007 8:41 am
Contact:

Post by MG » Thu Apr 19, 2007 2:39 pm

Yes, a good tool too.
Easy for use and translation seems good, well another tool to have !

tcks again ;)
Ah ? ben si ? pourquoi pas...

MG
Very interested
Posts: 56
Joined: Wed Feb 28, 2007 8:41 am
Contact:

Post by MG » Thu Apr 26, 2007 7:40 am

Yop !

Little bug in "PSG.C" :

Example :

Code: Select all

void PSG_init()
{
    volatile u8 *pb;
    u16 i;
    pb = (u8*) PSG_PORT;
    for (i = 0; i < 4; i++)
    {
        // set tone to 0
        *pb = 0x80 | (i << 6) | 0x00;
        *pb = 0x00;
        // set envelope to silent
        *pb = 0x90 | (i << 6) | 0x0F;
    }
}

good is :

Code: Select all

void PSG_init()
{
    volatile u8 *pb;
    u16 i;
    pb = (u8*) PSG_PORT;
    for (i = 0; i < 4; i++)
    {
        // set tone to 0

        *pb = 0x80 | (i << 5) | 0x00;

        *pb = 0x00;
        // set envelope to silent

        *pb = 0x90 | (i << 5) | 0x0F;
    }
}
All the lines with "(i << 6)" must be replaced by "(i << 5)".

Edit :
Another thing, to code volume :
(in PSG_setEnvelope(u8 channel, u8 value))
You have :

Code: Select all

*pb = 0x90 | ((channel & 3) << 5) | (value & 0xF);
But in fact, may be that is better for comprehensive code :

Code: Select all

*pb = 0x90 | ((channel & 3) << 5) | ((0xf-value) & 0xF);
because max volume = 0x0 and min volume = 0xf.

Have fun ! ;)
Explanation of the PSG here :
http://www.smspower.org/dev/docs/sound/ ... 030421.txt
(Bah, you have already, i suppose).

A+
Ah ? ben si ? pourquoi pas...

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

Post by Stef » Thu Apr 26, 2007 6:18 pm

MG wrote:Yop !

Little bug in "PSG.C" :

...

Have fun ! ;)
Explanation of the PSG here :
http://www.smspower.org/dev/docs/sound/ ... 030421.txt
(Bah, you have already, i suppose).

A+
As asual, thanks for your bug report ! A stupid bug afaik :p
By the way, for the envelop function, i assume it's normal to set it in this way, we often see that on sound chip (0 = max volume) and i guess sound programmer are aware of that typo ;)

MG
Very interested
Posts: 56
Joined: Wed Feb 28, 2007 8:41 am
Contact:

Post by MG » Fri Apr 27, 2007 7:38 am

I follow the movement, it's ok for me :o
Ah ? ben si ? pourquoi pas...

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

Post by Stef » Mon Aug 27, 2007 8:02 pm

Code::Blocks IDE integration moved to the first page :)
Last edited by Stef on Tue Dec 28, 2010 2:49 pm, edited 5 times in total.

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

Post by ElBarto » Wed Aug 29, 2007 12:41 pm

Sweet.
I've started a template for visual studio 2005, will post it when it's finish.

Post Reply