PSG

Supported ordinary PSG and extended EPSG.

There are exists PSG2-files (see description at RDOSPLAY site), but no plans to support it in Ay_Emul.

Also, there are many PSG from BK (Russian computers) emulators in the Internet, but they not supported in Ay_Emul too.

PSG

These files are produced by 'x128' Speccy emulator by James McKey and 'fMSX' emulator. x128 creates PSG with errors.

Therefore better to use 'Z80 Stealth' Speccy emulator by Kirill Kolpakov (Mr.Kirill). This emulator contains special features for creating PSG-files and also has good debugger to simplify PSG-files creating process.

Header structure

OffsetNumber of bytesDescription
+03Identifier 'PSG'.
+31Marker "End of Text" (1Ah).
+41Version number.
+51Player frequency (for versions 10+).
+610Unknown.

Further byte pairs and single byte markers are followed.

Byte 0FFh is marker of interrupt beginning.

Byte after 0FEh is multiplied by four is a number of interrupts without outing to AY. For example, sequence "FE 01 FF" is equivalent to "FF FF FF FF FF".

If first byte of pair is in range 0–15 then it is number of AY register, and next byte is output value of this register.

RDOSPLAY documentation describes yet another marker is 253 called as 'End of Music', but this marker is not supported in Ay_Emul.

If first byte of pair is in range 16–252, then this is outing to other MSX devices (ignored in Ay_Emul).

More about header

Also, RDOSPLAY documentation and some my researching of existing PSG-files talk about simpler header of PSG. This header consists of only first 4 bytes of described header and outing log starts at +4 file offset (instead of +16).

It's not supported in Ay_Emul, but if you are still trying to play such PSG-files, you don't hear differences in the most cases.

But it's need to add zeros to expanse header size to 16 bytes length for correct playing or converting to VTX or YM6 in Ay_Emul.

EPSG

Z80 Stealth emulator creates these files.

EPSG additionally contains information about time of outing to AY registers, so, like OUT and ZXAY, it can store outing with Z80 CPU tact precision.

Next text from z80s.faq file.

-------Begin----------

Q: What is it – this EPSG format?
A: It's PSG format improved just a bit to handle output of digitized samples 

Here's the description:

Offset	Length	Value
============================
Header
============================
0	4	'EPSG'
4	1	0x1A marker
5	1	Machine type: 0x00 – ZX Spectrum 128 0x01 – Pentagon
		0xFF – Other machines
6	4	Zero for machine type 0x00 and 0x01 or
		Number of Z80 tacts between interrupt markers
		for other machines
10	6	zeroes
============================
AY(YM) log during 1 frame
============================
16	1	AY(YM) register number
17	1	value written to this register
18	3	T-state
.....
??	5	0xFFFFFFFFFF – interrupt marker

-------End----------