1/2. The formulas on the wiki are for the Famicom CPU clock of 1789772 Hz. The 32 given in those formulae are dividing that clock. The Famicom CPU clock is the clock that drives the chip, so it would never be any other value unless the Famicom's clock was modified.Pokun wrote:I have some stupid 5B questions I could not find answers for in the wiki or these threads.
1)
The Sunsoft 5B ties the /SEL pin low so that the internal divider is used and the input clock is halved. Does this mean that the clock is half of the CPU clock (NTSC: 1.789773 MHz, PAL: 1.662607 MHz), in other words 0.8948865 MHz and 0.8313035 MHz for NTSC and PAL respectively? So the formula to calculate the period value for a given frequency for an NTSC system is: "Period = 894886.5 / (32 * Frequency)" and not "Period = 1789773 / (32 * Frequency)" correct?
I also read somewhere that the NTSC clock is 1.7897725 MHz or even other values (might not affect the final period values though).
2)
Is it verified that the YM2149F SSG's smoother envelope ramping is because the internal divider is used? I've read about the different envelope levels in the SSG and AY before (here, there are some other interesting info here too like the unused bits that can store values) but there it didn't say that it only applies when using the divider, confusing me.
I know that some MSX computers that uses an SSG instead of an AY for its PSG uses the divider but also uses a faster clock (3.579545 MHz) so to maintain the MSX standard of 1.7897725 MHz for the PSG. I guess these systems benefits from the smoother envelope while still running at the proper speed for the PSG?
3)
What is the difference between YM2149 and YM2149F? I think I read somewhere that the 5B is an YM2149F but not an YM2149.
The other day I tried to revise the description on the Wiki, since 5B doesn't have an option not to use SEL, I don't think the wiki's description of 5B should be encumbered with too much explanation of what SEL does (which I tried to pare back in my revision, hoping to be less confusing).
As I understand it, leaving SEL high or disconnect makes the YM into a backward-compatible AY. I believed it would switch the envelope into a 16-step mode compatible with the AY, but I don't have a YM to verify this with (yet). I may have been completely mistaken about that. Hypothetically, if SEL was high, this would mean the formulae on the wiki for tone and noise would use 16 instead of 32, and either the envelope formula would look the same (but only have 16 steps), or it would use 8 clocks per step instead of 16 and still have 32 total steps. I don't know which is true. For the actual 5B, the tone/noise frequency factor is 32, and 16 clocks per step for the envelope, as given.
So for the 5B, all I can say for certain is that it is in SEL-low mode, because the division by 2 is required for the pitch of the tone and noise. The YM2149 datasheet is a little bit vague about SEL and the envelope. It's possible that the envelope will tick every 8 clocks with SEL high, instead of every 16 like on the 5B (SEL low), and not what I had long assumed. If anyone knows the truth of that please let me know. Maybe you're right about it being a concession for later computers which were a lot faster than the first generation that was using AY and would rather drive the whole chip at half speed.
This is a case where looking back, I don't know where the source of my belief about what SEL high means for the envelope is. It's possible it was based on something I'd read or tried, or it's possible I made it up by accident or misunderstanding. So... all I can do is retract it for now, pending some more authorative information. (I am trying to be better about documenting my sources in the present.)
I can't comment on being able to read the registers, since the 5B has no read access to it.
3. I think YM2149F is just the full name for the "YM2149". I've not heard of any other versions (other than later clones with different numbering, YMZ294 etc.) The Yamaha datasheet just calls it YM2149 though.
E.g. if I search eBay for YM2149 all of them have an F.