orange808 wrote:
MintyTheCat wrote:
orange808 wrote:
So much to cover, because it's a complicated topic. Taking the Z80 out of the loop also eliminates sharing memory (no need to idle the m8k to share the bus). So, even that is a potentially big difference, because it is possible to let the m8k go about its business uninterrupted.
I dare say they are still using the Z80 to read the joypads and control the YM2612.
If I understand the docs correctly, I can feed audio directly from the cart. Using the YM2612 is always an option, but the cart should be able to handle all the duties.
I didn't realize the Z80 handled polling the controllers. I see you do have to idle the bus in vblank to grab the state of the controllers. Although, it's still simplified if you offload all the audio duties to the cart.
Makes sense, I guess. Master System backwards compatibility was on their minds when they were designing the hardware.
MD's cartridge connector has an analogue input for audio which will be mixed into the MD's audio amplifier:
Code:
B1 Input Left Audio Audio sourced from cartridge, left channel, mixed into output.
B3 Input Right Audio Audio sourced from cartridge, right channel, mixed into output.
https://melaircraft.net/2019/01/17/sega-megadrive-genesis-cartridge-pinout/
YEs, the cart could handle all duties but you would not have genuine YM2612 sound then and would be a bi of a cop out. It's easy enough to implement an FM Synth using a CPLD or FPGA though and you would hardly knwo the difference; they will be mixed using the same audio amp after all.
I did some work around 15 years back and measured the performance of the amp for a few different MD versions but I don't have the data or graphs here. IT is a fairly standard configuration that was on the datasheet though and nothing unusual.
Yes: there are kind of four uses for the Z80 on the MD: 1. polling controller ports/I/O port which can be as an RS232 port or as a parallel port depending on how you configure it. Early MD1 models also have the extra control port at the back of the console which was to be used for the modem. I think one or two games used it for that; I recall messing around with some japanese ROM that used the extra I/O port for data transfer back in 2015 or so and it really does work. I began programming the MD by using the third port as an RS232 port and then wrote a command monitor to send data back and forth between the PC and the MD - long, long before I got my hands on UMDK which allows me to do the same at much faster speeds over USB

2: control and feed the YM2612 : register writes and such.
3: when the MD is set to 'Mode V' was it? Then it is in MD mode, pulled low it has the Z80 as the main mpu and allows you to run Master-System games and such.
Code:
B30 Input /M3 Pulled high in console, cartridge shorts to ground to indicate console should run in Mark 3 (Master System) mode.
4: manage the PSG - the other sound device that makes the 'bleeep' and 'bloop' like sounds that we all love.
Matt has an article on it here:
https://blog.bigevilcorporation.co.uk/2 ... -psg-chip/Yes: VBlank is when the MD does most of its heavy writes through DMA, you can do it during active but it is a lot slower - also, the MD'S VDP has exactly the same limitation which is why the VDP is kind of the bottle-neck when programming the MD pretty much, that and the slowish 68K - e.g. it was not uncommon to decompress gfx data as the game was playing to be ready in time. Using a more powerful mcu as they have in Paprium (and discussed years back as an idea to give the native MD hardware more power) would allow much faster actions. Also, consider that once the YM2612 has the majority of its registers set for the
FM Voice (synth patch to the rest of the world) it only needs to modify every so often parameters so it is not a heavy bandwidth device once programmed for the song to place. Also, consider that polling often enough the state of control pads is not a heavy activity as users are slow

The MD has a laughably slow baudrate on the RS232 port too

It is possible to feed the PSG, YM2612, poll the user input on the joypads and feed audio signals into the cart's analogue audio pin without any issues and this was the intention when the MD was designed long ago as it gives developers options.
I hope that gives you some further insight into the MD's internals
