New Documentation: An authoritative reference on the YM2612
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Correctly emulated in Gens as far i remember.AamirM wrote:Hi,
No. At least not in Regen. But I think the current linear approximation is good enough.
stay safe,
AamirM
Last edited by Stef on Mon Jun 09, 2008 5:33 pm, edited 1 time in total.
I'm curious, what is the SSG part mapped in registers 00-0Fh (which does not exist on YM2612).
Otherwise, for keeping some record of it, I tried to list some of the new informations that we don't have in the first doc and that might applied to Ym2612 also:
.Key OFF/ON register and operator assignation:
.Feedback values:
.SSG-EG register:
I imagine this could be quickly tested in a modified emu ?
.Timer exact periods:
This confirms what we were initially thinking, internal clock is VCLK/144 and timerA period is half the internal period. We retrieve this value in FNUM calculation:
. CH3 special mode and "illegal" CSM mode:
we need some translation for this one
Otherwise, for keeping some record of it, I tried to list some of the new informations that we don't have in the first doc and that might applied to Ym2612 also:
.Key OFF/ON register and operator assignation:
.Feedback values:
.SSG-EG register:
I imagine this could be quickly tested in a modified emu ?
.Timer exact periods:
This confirms what we were initially thinking, internal clock is VCLK/144 and timerA period is half the internal period. We retrieve this value in FNUM calculation:
. CH3 special mode and "illegal" CSM mode:
we need some translation for this one
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Enveloppe is defined in the "ENV_TAB", first part is for attack and i defined it as follow :AamirM wrote:Hi,
Nice. I'll have a look at that. With what exponential relation does it rise? Do you have a formula?
stay safe,
AamirM
Code: Select all
for(i = 0; i < ENV_LENGHT; i++)
{
// Attack curve (x^8 - music level 2 Vectorman 2)
x = pow(((double) ((ENV_LENGHT - 1) - i) / (double) (ENV_LENGHT)), 8);
x *= ENV_LENGHT;
ENV_TAB[i] = (int) x;
// Decay curve (just linear)
x = pow(((double) (i) / (double) (ENV_LENGHT)), 1);
x *= ENV_LENGHT;
ENV_TAB[ENV_LENGHT + i] = (int) x;
}
It is not related to FM synth or SSG-EG register. It's AY-3-8910/YM2149 part, same as in YM2203.Eke wrote:I'm curious, what is the SSG part mapped in registers 00-0Fh (which does not exist on YM2612).
I think, SSG-EG register named so just because it controls envelope in similar way like AY-3-8910 does.
-
- Very interested
- Posts: 2443
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
YM2612 timers in MD manual are all wrong. They're based on 8MHz not 7.6MHz and the Freq numbers for one octave's notes they had are all whipped off form this datasheet it seems, all wrong for MD.
I had so much trouble getting the the value of the timer when I tried to have MD tracker and TMSE running at same speed... according to PC's PIT, the speed I got would be 49.4Hz, but the correct YM2612 calculation says its 49.9Hz... the PC runs faster with its 49.4 than MD with its 49.9 which makes no sense...
I had so much trouble getting the the value of the timer when I tried to have MD tracker and TMSE running at same speed... according to PC's PIT, the speed I got would be 49.4Hz, but the correct YM2612 calculation says its 49.9Hz... the PC runs faster with its 49.4 than MD with its 49.9 which makes no sense...
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Fortunately, they do provide clock-independent formulas for calculating frequency values and timer intervals in this manual:
EDIT: Note that the frequency calculation uses the clock frequency in Hz, while the timer calculations use the clock frequency in MHz. Also note the timer calculations are returning the timer interval in microseconds. You can see from the formulae that timer A counts down once every 72 clock pulses, and timer B counts down once every 1152 clock pulses (72 * 16).
Code: Select all
F-Number = (144 * fnote * 2^20 / M) / 2^(B-1)
fnote: Frequency Data
M: Master clock (Hz)
B: Octave Data
tA = 72 * (1024 - NA) / M
NA: 0~1023
M: Master clock (MHz)
tB = 1152 * (256 - NA) / M
NB: 0~255
M: Master clock (MHz)
Looking again at the Sega documentation, the formulae they provide for timer calculation are very different to the numbers from the YM2608 manual.
Comparing those simplified formulae to the ones in the YM2608 manual, Sega have either calculated these assuming a clock speed of 4MHz, or the dividers for the timers are different. It's quite possible the YM2612 has timers which have half the rate (144 clock pulses for Timer A, 144*16=2304 clock pulses for Timer B), and they've calculated for 8MHz. Can anyone confirm this?
Code: Select all
Timer A:
18 * (1024 - TIMERA) microseconds
TIMER A = all 1's -> 18usec = 0.108ms
TIMER A = all 0's -> 8400usec = 18.4ms
Timer B:
288 * (256 - TIMERB) microseconds
TIMER B = all 1's -> 0.288ms
TIMER B = all 0's -> 73.44ms
here's the calculation I once made to find the exact timer period, however this is purely theorical:
http://www.spritesmind.net/_GenDev//for ... .php?t=228
YM2612 is probably dividing input clock by 2:
http://www.spritesmind.net/_GenDev//for ... .php?t=228
YM2612 is probably dividing input clock by 2:
72/(VCLK/2/1000000) = 18.77 microseconds
1152/(VCLK/2/1000000) = 300.37 microseconds
-
- Very interested
- Posts: 2443
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Quirks are setting the "ganged" together registers backwards, previous instruments' settings affecting next instrument to some extent...
It is very possible that YM2612 divides input clock by 2, as when I calculated the timer period, I got double result, ~100Hz instead of ~50Hz.
It is very possible that YM2612 divides input clock by 2, as when I calculated the timer period, I got double result, ~100Hz instead of ~50Hz.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 2443
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
just make a small test proggy for MD, and listen in Fusion, it does ALL sound as real HW, all the various noises and such.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Ok, I've just completed a translation of this document, using the OCR function in Adobe Acrobat Professional, and a web-based Japanese translator at http://www.excite.co.jp/world/english which was recommended to me. I've been manually correcting OCR errors along the way, which in some cases meant looking through tables of several thousand Kanji, and bashing away at problem portions of the text until they made sense. I've preserved the page numbers of the original document, and largely preserved the original formatting. Yes, it took a lot of work. Here's the translated PDF:
http://nemesis.hacking-cult.org/MegaDri ... slated.PDF
The results are surprisingly good. The scans are clear enough and high resolution enough for the OCR to clean up. There was probably around a 99% success rate for the OCR, with most of the errors being simple accent problems. The web-based translator is also probably the best one I've seen. It's on a Japanese site, it only deals with English and Japanese, and it beats the Google translator into the ground. I haven't rewritten or restructured the output of the web translator, so some of it is a little backwards, but if you have a good grasp of English, the meaning should be clear in most cases. I'm not going to reword the output from the online translator, as I can't read Japanese, so I can't proof-check my translation against the original meaning of the text, and I don't want to risk losing any more information in the translation process.
Note that pages 57-67 are not included in this translation. These pages aren't actually part of the main document, they're part of a separate document which is all about the physical properties of the chip, and the bus timings. Unfortunately, the quality of the scan is worse than the main document, and the font is different. The OCR doesn't cope nearly as well with it, so it would be slow and painful to translate, and I don't feel the urge to do it. These are probably different for the YM2612 anyway. You won't find anything important in this section though if you're just trying to emulate or use the YM2612.
Anyway, hopefully this will open the document up for some more people to make use of.
http://nemesis.hacking-cult.org/MegaDri ... slated.PDF
The results are surprisingly good. The scans are clear enough and high resolution enough for the OCR to clean up. There was probably around a 99% success rate for the OCR, with most of the errors being simple accent problems. The web-based translator is also probably the best one I've seen. It's on a Japanese site, it only deals with English and Japanese, and it beats the Google translator into the ground. I haven't rewritten or restructured the output of the web translator, so some of it is a little backwards, but if you have a good grasp of English, the meaning should be clear in most cases. I'm not going to reword the output from the online translator, as I can't read Japanese, so I can't proof-check my translation against the original meaning of the text, and I don't want to risk losing any more information in the translation process.
Note that pages 57-67 are not included in this translation. These pages aren't actually part of the main document, they're part of a separate document which is all about the physical properties of the chip, and the bus timings. Unfortunately, the quality of the scan is worse than the main document, and the font is different. The OCR doesn't cope nearly as well with it, so it would be slow and painful to translate, and I don't feel the urge to do it. These are probably different for the YM2612 anyway. You won't find anything important in this section though if you're just trying to emulate or use the YM2612.
Anyway, hopefully this will open the document up for some more people to make use of.