Default state of the GR8NET's built-in PSG

By Eugeny_Brychkov

Paragon (1151)

Eugeny_Brychkov's picture

08-06-2020, 10:08

By default, on power up, GR8NET's PSG is enabled at port A0 (standard MSX PSG port). I have built PSG in for having its own PSG sound in the GR8NET's 3.5 mm jack.

The logical problem with the two "mirrored" PSG is that if they output their analog signals to the MSX mixer, these signals will interfere creating audible artifacts from higher volume to total mute of PSG sound (depending on the phase of the signal).

The problem is easily solved in stereo GR8NET by turning off the side switch; but it can not be solved in mono GR8NET.

We have come to the conclusion that it may be a good solution to set mono GR8NET's PSG to the port 10 at the power up, thus if GR8NET is not called for initialization at all (e.g. slot 1=game cartridge and slot 2=GR8NET) the PSG stays at port 0x10 not interfering with internal machine's PSG. If GR8NET initializes, then user settings get into effect.

At the same time stereo GR8NET, at the power up, will still initialize its built-in PSG at port A0 mirroring internal PSG.

Does the idea sound good, or you have better suggestion?

Login or register to post comments

By Grauw

Ascended (9160)

Grauw's picture

08-06-2020, 10:47

I would keep it consistent and initialize to 10H in all cases, unless configured otherwise for some game.

When at 10H, are the registers readable on 12H? If so, VGMPlay will detect it properly.

By Eugeny_Brychkov

Paragon (1151)

Eugeny_Brychkov's picture

08-06-2020, 11:05

Grauw wrote:

I would keep it consistent and initialize to 10H in all cases, unless configured otherwise for some game.

In this case if machine does not reach GR8NET initialization, PSG will not be mirrored and there will be no "normal" PSG sound through GR8NET. However there's simple workaround: put GR8NET first so that it initializes before game starts.

Grauw wrote:

When at 10H, are the registers readable on 12H? If so, VGMPlay will detect it properly.

Readability is decided by the GR8NET/Z80 code basing on the information it finds in the ports PSG is going to be configured in. Thus if GR8NET ROM code has been run after reset/power cycle, then, if there's nothing at these ports, port 12 (and A2 in case of A0 location) will be readable. Anyway I do not think that VGMPLAY is going to be run in the environment when some cartridges are not initialized Smile thus built-in PSG will always be set up properly.

By DarkSchneider

Paladin (930)

DarkSchneider's picture

08-06-2020, 11:07

We need standards, and drivers for handling them, for those that don't have their corersponding BIOS.

By bas.alicante

Resident (53)

bas.alicante's picture

08-06-2020, 11:06

The implications of this are above my limited understanding of the technology. So my only suggestion is that I'd like my gr8net to keep outputting everything through the audio jack as it is doing now. Other than that I don't care if the internal mixer of my NMS8250 mixer is kept completely silent or if everything is duplicated as I only use the jack. ( Sorry if I totally missed the point here Smile )

By Eugeny_Brychkov

Paragon (1151)

Eugeny_Brychkov's picture

08-06-2020, 11:41

DarkSchneider wrote:

We need standards, and drivers for handling them, for those that don't have their corersponding BIOS.

Can you please explain in more detail? I assume you mean we must standardize presence of second PSG in the system, and its state after power up, right? I fully agree then, but who and how to do this standardization, and who will adhere to it...

bas.alicante wrote:

So my only suggestion is that I'd like my gr8net to keep outputting everything through the audio jack as it is doing now. Other than that I don't care if the internal mixer of my NMS8250 mixer is kept completely silent or if everything is duplicated as I only use the jack.

The problem appears for mono GR8NETs (you have stereo) which does not have jack and output is taken from the MSX mixer, and only if GR8NET did not initialize (e.g. Goonies cart in slot 1 and GR8NET in slot 2 - in this combination GR8NET simply does not get its turn for initialization because execution ends in Goonies game cart).
If you always run "initialized" GR8NET, then whatever power up setting GR8NET engine has, it will be overridden by the GR8NET BIOS settings (_netget/setpsg).
I hope it is clearer now.

By DarkSchneider

Paladin (930)

DarkSchneider's picture

08-06-2020, 11:53

Eugeny_Brychkov wrote:

Can you please explain in more detail? I assume you mean we must standardize presence of second PSG in the system, and its state after power up, right? I fully agree then, but who and how to do this standardization, and who will adhere to it...

Correct. All that is out of the standards should be community standarized in some way. I suppose the correct way would be opening the corresponding threads in the community forums for discussion, and a github for the implementation. For drivers, I think the best option are EXTBIO or UNAPI (that is an EXTBIO "extension"). But as the source code would be public, anyone could get it and put into his software (i.e. ROM cartridge) directly if required.

By Grauw

Ascended (9160)

Grauw's picture

08-06-2020, 17:48

As far as I’m concerned the de facto standard 2nd PSG location I/O is 10H with write at 11H and read at 12H. VGMPlay detects that for future compatibility, with a workaround for the MegaFlashROM SCC+ SD which is write-only and thus can’t be detected unless I check specifically for its ROM ID signature. Listed here, I should also add Carnivore2 there and I think also GR8NET?

By Eugeny_Brychkov

Paragon (1151)

Eugeny_Brychkov's picture

08-06-2020, 18:13

Grauw wrote:

I should also add Carnivore2 there and I think also GR8NET?

GR8NET autodetects presence of other PSG device in the target location (A0 or 10), and turns read port (base+2) capability on if nothing is detected in there. Thus I do not think you need to do anything special for GR8NET.