
________________________________________

http://map.grauw.nl/resources/msx_io_ports.php#s1990

PSG / AY-3-8910

These are the I/O registers for accessing the MSX PSG (Programmable Sound Generator):

Port range	Description
#A0 (write)	Register write port
#A1 (write)	Value write port
#A2 (read)	Value read port
The following table describes the registers of the PSG:

Register(s)	Description
0-5	Tone generator control
6	Noise generator control
7	Mixer control-I/O enable
Important note: bit 6 must be 0, and bit 7 must be 1. Setting different values can cause damage on some systems. Safest approach is to just not touch them and read them first before writing a new value.
8-10	Amplitude control
11-13	Envelope generator control
14-15	I/O ports A & B
Additional PSG I/O ports A & B

The PSG has two additional I/O ports in registers 14 and 15. They are used by the MSX standard for several device I/O related tasks, comparable with the PPI and working more or less in conjunction with it. These are the functions:

PSG I/O port A (r#14) – read-only
Bit	Description	Comment
0	Input joystick pin 1	(up)
1	Input joystick pin 2	(down)
2	Input joystick pin 3	(left)
3	Input joystick pin 4	(right)
4	Input joystick pin 6	(trigger A)
5	Input joystick pin 7	(trigger B)
6	Japanese keyboard layout bit	(1=JIS, 0=ANSI)
7	Cassette input signal	
PSG I/O port B (r#15) – write/read
Bit	Description	Comment
0	Output joystick port 1, pin 6	(set 1 for input)
1	Output joystick port 1, pin 7	(set 1 for input)
2	Output joystick port 2, pin 6	(set 1 for input)
3	Output joystick port 2, pin 7	(set 1 for input)
4	Output joystick port 1, pin 8	
5	Output joystick port 2, pin 8	
6	Joystick input selection, for r#14 inputs	(1=port 2)
7	Kana led control	(1=off)



