Summary of required mods for audio to work in 7Mhz?

Страница 1/4
| 2 | 3 | 4

By olliraa

Champion (325)

Аватар пользователя olliraa

03-10-2017, 06:31

Been reading the forums for quite some time now, but the information required seems to be very scattered around. There are a few longish threads regarding the matter, but they're no longer active and/or posting there seems not to make any difference anymore. So, I decided to create this thread to be able to summarize what needs to be done to get the sound working ok, or "maximise audio performance in turbo mod", if you want to put it that way Smile I know there are different mods needed for different machines, but that's the next step to list those Smile

Here's what I've found sofar. The information may be totally incorrect, but one purpose is that someone who knows better, would then kindly guide me to the right path. First I've listed the problem/speculated problem, then possible solution or speculated solution Smile

1. PSG pitch is off -> if the PSG is integrated in the msx engine, nothing you can do?
2. FMPac and clones won't work correctly, distorted audio. -> additional 3.58Mhz clock source for one of the cartridge slots?
3. MegaFlash SCC+ SD won't work even with additional 3.58Mhz clock source, because it needs the same clock as the computer uses for synchronization (not really sure about this) -> solution unknown?
4. Something else, I've missed in this list?

Everybody with some valuable info, please share it (again?) in this thread. Let's make this a wiki article, shall we?

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By Grauw

Ascended (10820)

Аватар пользователя Grauw

03-10-2017, 10:41

1. You can add a separate write-only PSG clocked at 3.58 MHz, and hook that one up to the audio output.

2. Ideally the cartridge slot would be fed with a 3.58 MHz clock and there is a circuit to insert wait states to the Z80 to make the access timing be within standard parameters.

3. Does it? It would surprise me...

Re. 2), even if only the internal RAM is accessed at full speed, you already gain the majority of the performance, and if the internal RAM is 4 MB and in slot 0 it will always be selected as primary memory. The MSX-Engine outputs RAM slot select and VDP select signals, so:

if vdp-select then wait for min(54 cycles - time since last wait, 0) and block rd/wr
if not ram-select and rd or wr then insert wait for 2 cycles

Not trivial but not really complex either, sounds doable with a CPLD, from my hardware layman’s pov.

By usuario_msx2

Paladin (763)

Аватар пользователя usuario_msx2

03-10-2017, 11:10

olliraa wrote:
good luck!

By NYYRIKKI

Enlighted (6091)

Аватар пользователя NYYRIKKI

03-10-2017, 12:25

Grauw wrote:

Re. 2), even if only the internal RAM is accessed at full speed, you already gain the majority of the performance, and if the internal RAM is 4 MB and in slot 0 it will always be selected as primary memory.

... and you can be sure that about 1% of the MSX games work just fine with your computer. Smile

{Special greetings about the tip to POKE -1, 170)

By Grauw

Ascended (10820)

Аватар пользователя Grauw

03-10-2017, 13:03

By that slightly cryptic message I guess you meant that if it’s in a subslot of slot 0 then you can’t apply the poke-1,170 hack for software which does slot switching without BIOS, accessing A8H directly without properly supporting subslots, because it would switch away the BIOS (I hope that accounts for less than 99% of the games...). Ok, maybe not the best idea.

I said RAM in slot 0 because although I think on MSX2+ and MSX-DOS2 a big mapper of 4 MB will be selected as primary on MSX2+ and MSX-DOS2 if there’s no other 4 MB RAM extensions in the system, having it in slot 0 would ensure it is always primary. But otherwise a BIOS modification to force it as primary (like the turboR) may be a better approach.

Anyway IMO that type of design like the turboR has is the best approach. It seems feasible to retrofit on existing systems with a daughterboard with a CPLD.

By olliraa

Champion (325)

Аватар пользователя olliraa

03-10-2017, 19:20

Ok, thanks for the comments so far Smile Some additional info:

1. NYYRIKKI came up with the idea of using the emulated PSG in Megaflash SCC for this purpose, to be able to "bypass" the integrated PSG in the MSX engine. (thanks for the idea NYYRIKKI!). This refers to the mods next in this list. As I'm really noob regarding electronics I cannot elaborate this any further. Anyone else? Big smile

Thanks Grauw for the idea of adding one PSG. That could also be quite handy depending on the configuration Smile

2. Megaflash SCC+ SD works fine in 7Mhz at least on *some computers*, but naturally the SCC sounds weird due to wrong clock.

Thread here:
https://www.msx.org/forum/msx-talk/hardware/problem-running-megascc-sd-7-mhz

There is has been mods to feed the correct clock to one of the slots (the other slot operating with the "wrong" turbo clock if I understood correctly). Unfortunately the original modder does not have the computer anymore (already contacted him) :/

https://www.youtube.com/watch?v=9rvd5F6_pdE&t=4s

So: If one wants to have the Megaflash SCC+ SD working in 7Mhz *and* SCC part sounding correct it should be doable, right? This should also fix the problems with FMpac and clones? (as Grauw already suggested).

We'll see how this ends up :P

By tvalenca

Paladin (747)

Аватар пользователя tvalenca

03-10-2017, 20:07

For audio to properly work on turbo machines you need basically two things:

1) Feed the sound generator chips with the proper clock (constant and in-spec)
2) Assure that no code will poke that chip faster than it could respond.

On most common turbokits, clock is slowed down to 3.57MHz on each IO request, but in some cases this still could poke the chip faster than it can respond. But, by doing this, CPU clock variation would break the first item, because some sound chips (at least internal PSG and YM2413 inside FM-PAC cartridge) will produce out-of-tune and oscilating notes because those chips use CPUCLK signal on MSX BUS to drive its note generators.

How would I address this? I would
1) patch PSG and FM chips with a separate clock generator, isolating them from CPUCLK and;
2) create a wait state generator based on each soundchip requirements. I don't know anyone who followed this approach.

One more thing: Doesn't the MegaFlashROM SCC+ SD have its own clock generator?

By olliraa

Champion (325)

Аватар пользователя olliraa

04-10-2017, 11:56

Ok, thanks for the suggestions tvalenca Smile

The following kinda summarizes the whole thing in a way:

tvalenca wrote:

One more thing: Doesn't the MegaFlashROM SCC+ SD have its own clock generator?

Wondered that also myself... If it does have its own clock generator, then it would be feasible to "hijack" the emulated psg as NYYRIKKI suggested, right? I mean, as the cartridge is reportedly working ok and if it indeed has its own clock, then the emulated psg should work ok. But the question remains: why doesn't the SCC work ok then? (as it has been reported...) :/

By Guillian

Prophet (3529)

Аватар пользователя Guillian

04-10-2017, 12:16

The MFR SD uses the slot clock signal. So the SCC/SCC+ and extra PSG will sound weird if that clock is not 3.58MHz.

By olliraa

Champion (325)

Аватар пользователя olliraa

04-10-2017, 12:52

Guillian wrote:

The MFR SD uses the slot clock signal. So the SCC/SCC+ and extra PSG will sound weird if that clock is not 3.58MHz.

Ok, so we indeed need to feed the correct clock to one of the slots. Thanks for this Guillian Smile How do we do this in practice? Smile Seems to be the pin 42:

https://www.msx.org/wiki/MSX_Cartridge_slot

*edit1*

Just stubmled across this (don't really know why I did not find it earlier...) Anyway:

RetroTechie wrote:

Put a fixed 3.58 MHz on cartridge slot clock pin (this could be picked up from VDP). This is nice solution if you want to dedicate a cartridge slot to sound cartridges like Music Module, SCC etc. In this configuration cartridges that need a synced-to-CPU clock (like many DRAM mappers) will not work. Which may be fine as long you are aware of that limitation. No reason to switch back turbo for /SLTSL here (unless you have really slow ROMs inside those cartridges).

Slow down when a cartridge (more specifically: memory) in that slot is used. In this case, connecting that /SLTSL to turbo circuit is enough, no need to touch cartridge slot clock pin.
Nothing stops you from doing both, but that's rarely useful. Just pick one of above options depending on what cartridges you have & how you want to use them.

So, If one wants to run 2 cartridges 99% of the time, namely Megaflash SCC+ SD in one slot and FM-Pac (or a clone) in other slot, both slots should have their clocks fixed that way? But this still does not solve the PSG pitch problem.

*edit2*

How about the ram inside Megaflash SCC+ SD 512Kb? Problems?

By Guillian

Prophet (3529)

Аватар пользователя Guillian

04-10-2017, 13:21

There are two problems:
- The cartridge must be synced to CPU to work
- If you use a clock different to 3.58MHz, the sound will have a wrong pitch.

So if you put turbo mode, and use the same clock signal for CPU and MFR SD, the cartridge will work, but the sound will be weird.
If you don't use the same clock signal the cartridge will not work.

The solution could be to use a different clock signal for sound generation in the cartridge (3.58MHz) and the current one for RD/WR operations. But for doing that, the FPGA must be updated and a new trace/pin used.

Страница 1/4
| 2 | 3 | 4