Hehe no problemsMG wrote:Arf... hum... it's in an older file :/Stef wrote:YM2612_Init() isn't anymore called in this version as far i remember
![Wink ;)](./images/smilies/icon_wink.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Moderator: Stef
Héhé, its a long storyThere 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...
Glad to hear you have an efficient code for thatFonzie wrote:Héhé, its a long storyThere 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...
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.
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).Stef wrote:Glad to hear you have an efficient code for thatFonzie wrote:Héhé, its a long storyThere 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...
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.Thanks for sharing it !
Well, it's a shame, i searched for age these documents and they were available for saturn deversMask of Destiny wrote: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).Stef wrote:Glad to hear you have an efficient code for thatFonzie 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.Thanks for sharing it !
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.
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;
}
}
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;
}
}
Code: Select all
*pb = 0x90 | ((channel & 3) << 5) | (value & 0xF);
Code: Select all
*pb = 0x90 | ((channel & 3) << 5) | ((0xf-value) & 0xF);
As asual, thanks for your bug report ! A stupid bug afaik :pMG 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+