Mr-X Soundcard

Discussions about Sinclair ZX80 and ZX81 Hardware
User avatar
1024MAK
Posts: 5123
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Mr-X Soundcard

Post by 1024MAK »

‪The following links may be useful for sound port information. Keep in mind that the AY sound chip uses a slightly unusual access arrangement because it was designed for another MPU. And the original ZON used partial decoding, so more than one address will access the same AY register set.‬
‪‪ZX81 I/O Ports‬
viewtopic.php?f=7&t=1213&start=20#p12870

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: Mr-X Soundcard

Post by mahjongg »

Moggy wrote:
mahjongg wrote:
...For example, does the son x-81 use 1.625MHz, or something like 100KHz as a clock?
1.625 is the sound chip frequency I use when setting Sergey Bulba's AY emulator to Zonx-81 mode and it sounds just right, if that helps.
yes, its the default frequency I already decided on, using a 13MHz crystal divided by eight.

thanks for the conformation!
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: Mr-X Soundcard

Post by mahjongg »

I decided to use 0FH (00001111) for both writing and reading PSG sound data, and DFH (11011111) for writing to the index (register select) register of the PSG.

I think other mentioned I/O addresses ( 1FH, CFH ) are wrong.

I'm using the canonical source, the "nocash sinclair ZX docs by martin korth"

which list these I/O addresses:

I/O Ports
xx0Fh.W PSG data (Bi-Pak ZON-X81 Sound)
xx1Dh.R Zebra Joystick adapter
xx2Fh.R Memopak I/F Centronics Interface status (IN status,[dd3Fh]);dd=data
xx3Fh.R Memopak I/F Centronics Interface finish (IN dummy,[dd3Fh]) ;dd=data
FF7Eh.R Lambda - read PAL/NTSC flag (A7=row) (via diode from A7 to KEYB.0)
xx9Fh.W PSG index (Timedata ZXM Sound Box)
xxBFh.R PSG data (Timedata ZXM Sound Box/Joystick Read)
xxDFh.W PSG index (Bi-Pak ZON-X81 Sound) (default address) (sometimes CFh)
xxDFh.W PSG data (Timedata ZXM Sound Box)
xxDFh.R Mikro-Gen digital joystick
xxDFh.R AGB - JOYSTICK II (port A) (or B ?)
xxEFh.R AGB - JOYSTICK II (port B) (or A ?)
xxF5h.R Lambda - toggle sound output level
xxF5h.W Lambda - select charset line number (00..07)
xxF6h.R Lambda - read selected charset data (8 pixels)
xxF6h.W Lambda - select charset char number (00..3F)
xxFBh.R Sinclair Printer Status
xxFBh.W Sinclair Printer Output
xxFDh.W Disable NMI (ZX81 only)
xxFEh.W Enable NMI (ZX81 only)
NNFEh.R Keyboard read, when NMI=Off: also enter VSYNC and set CAS.OUT=Low
xxFFh.W Terminate Vsync and restart LINECNTR and set CAS.OUT=High
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Mr-X Soundcard

Post by Andy Rea »

i would advise against using that port combination, in the original Zon-x A4 was not used in the decoding, so $CF and $DF are treated as one, as are $0F and $1F.

for dual AY-chip setups A4 is took into account so the natural pairs become

$CF and $0F ( A4 reset ) for chip 0
$DF and $1F ( A4 set ) for chip 1

Just my thought

Regards Andy

EDIT : Seems like the above assertation is WRONG A4 does seem to be used in some cases high and in other cases low.
Last edited by Andy Rea on Wed Jun 01, 2016 11:16 pm, edited 1 time in total.
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: Mr-X Soundcard

Post by mahjongg »

What is probably the case is that the original PSG used "lazy decoding" and used one address line low as a select, one (A3) for data, and one (A4) for index.
If you then leave at least A0, A1, and A2 high there should be no conflicts.
A3, A6, and A7 are then "don't cares".
I will test this theory with the canonical data info. But unless you got Zon-x schematics I don't believe that A4 wasn't used, its illogical, you need something to differentiate between writing to the data register and to the index register, and this corresponds with the available canonical data.
0F = 00001111 or as I suspect xx10x111 meaning A4 is low and A3 is high
DF = 11011111 or as I suspect xx01x111 meaning A5 is low and A4 is low

But yes I will need to study it more, problem is everybody seems to offer conflicting data, and there were also some erroneous information's released (errors in the documentation). Best would be to have the official schematic, but it seems unavailable.

also, there is very little software that actually uses the Zon-x, and some used other incompatible PSG's.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Mr-X Soundcard

Post by PokeMon »

If addresses are fully decoded, this shouldn't be a big problem. As there are interfaces using just one address line for laziness $0F is not a preferred address as it can conflict with up to four devices in Sinclair-type manner. ;)
User avatar
1024MAK
Posts: 5123
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Mr-X Soundcard

Post by 1024MAK »

Until/unless someone reverse engineers a real ZON-X81 (with a board that is NOT an issue 5), we can only conclude that partial address decoding was used.

Partial address decoding was very common at this time, with some devices using just a single address line to select/deselect the interface, with the remaining address lines being "don't care". But in the documentation, there would typically be no indication of this, with a single address range, or specified values being used.

There are some details of the ZON-X issue 5 board here. But as it looks like the design was changed, this does not mean the earlier designs were similar in their address decoding. That may help to explain all the confusing information.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Mr-X Soundcard

Post by Andy Rea »

so i did a little more digging around, and besides plenty of ambiguity posted around the web, it seems that there were in fact 2 versions of the zon-x

Zon-x expects A4 to be 1
Zon-x81 expects A4 to be 0

so erm yeah....

info from http://k1.spdns.de/Vintage/Sinclair/80/ ... %20Module/
and http://k1.spdns.de/Vintage/Sinclair/82/ ... %20Module/

Andy

PS. i would still reccomend the pairs with A4 either set or unset as this allows future expansion by putting a second sound chip on the other pair.
what's that Smell.... smells like fresh flux and solder fumes...
User avatar
1024MAK
Posts: 5123
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Mr-X Soundcard

Post by 1024MAK »

Or use a 74HC688 8-bit magnitude comparator and some DIP switches, then you can change the address at the flick of a switch :lol:

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
mahjongg
Posts: 181
Joined: Tue Nov 24, 2015 10:25 pm

Re: Mr-X Soundcard

Post by mahjongg »

thanks guys!
Post Reply