Covox Sound Master Reverse Engineering / Replica

Discussion about old PC hardware.

Re: Covox Sound Master Reverse Engineering / Replica

Postby Fagear » 2018-11-09 @ 00:12

While there is no more answers for my questions above I almost finished PCB layout.

Here are some steps of refining:

AY_2018-11-09_01.png
Covox Sound Master: PCB refinement 1
AY_2018-11-09_02.png
Covox Sound Master: PCB refinement 2
AY_2018-11-09_03.png
Covox Sound Master: PCB refinement 3

- refined layout;
- added power bypass capacitor for AY;
- oriented all electrolytic capacitors in the same way (for consistency and ease of assembly);
- replaced LM386 power amplifiers with a good quality standard stereo opamp output buffer for line out;
- replaced "5 isolated resistors" resistor network and two separate 10k resistors with two "7 bussed resistors" networks, the same one that are used for joystick inputs (decreased BOM list, more easy assembly).

Basically, layout is done. Will it work flawlessly? Who knows, prototype production run will tell. I think I'll make some more iterations of refining and checking the layout and then I'll order first prototypes. :roll:

The last thing to do - to get working firmware for the GAL chip. I'm curious to know about progress at that.
If nothing helps, I think I can try to "read" GAL my ways. Like, attaching logic analyzer to control outputs of GAL and some address/data lines and run some games that support this card and get information about what ports are each of the components are, how GAL controlls AY in regards of ports and read/write operations.
So, if there is low or no progress on GAL reading, I want to offer moturimi1 an option to send GAL to me to try it. Obviously I can not do anything more with this card, because it will not work without the GAL.
User avatar
Fagear
Member
 
Posts: 210
Joined: 2014-7-10 @ 22:27
Location: Russia, Moscow

Re: Covox Sound Master Reverse Engineering / Replica

Postby Fagear » 2018-11-09 @ 21:46

I've got some help from the programmer called Cerenas.
Here are some hooked DOSBox dumps with some games that support CSM:

Code: Select all
DOSBox version 0.74-2-vs2017
Copyright 2002-2018 DOSBox Team, published under GNU GPL.
---
SDL_Init: Starting up with SDL windib video driver.
          Try to update your video card and directx drivers!
CONFIG:Loading primary settings from config file dosbox.conf
Maximum memory size is 63 MB
Memory sizes above 31 MB are NOT recommended.
Stick with the default values unless you are absolutely certain.
MIDI:Opened device:win32
[CSM] Covox Sound Master hooks installed
[CSM] Write on port 223h, len 1, val 0h
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val adh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val fh
[CSM] Write on port 221h, len 1, val e0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val ffh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 2h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 3h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 4h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 5h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 6h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 8h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 9h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val ah
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val bh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val ch
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val bdh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 2h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 3h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 4h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 5h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 6h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 8h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 9h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val ah
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val fh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val ffh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val adh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val aah
[CSM] Read on port 221h, len 1
[CSM] Write on port 222h, len 1, val 88h
[CSM] Write on port 222h, len 1, val 88h
[CSM] Write on port 222h, len 1, val 8ah
[CSM] Write on port 222h, len 1, val 86h
[CSM] Write on port 222h, len 1, val 8ch
[CSM] Write on port 222h, len 1, val 90h
...


Code: Select all
[CSM] Covox Sound Master hooks installed
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val ffh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 22h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 44h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 66h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 223h, len 1, val 0h
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val a0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val fh
[CSM] Write on port 221h, len 1, val e0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val ffh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 2h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 3h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 4h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 5h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 6h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 8h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 9h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val ah
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val bh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val ch
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val b0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 2h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 3h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 4h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 5h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 6h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 8h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 9h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val ah
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val fh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val ffh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val a0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 223h, len 1, val 0h
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val a0h
[CSM] Read on port 221h, len 1
...


Code: Select all
[CSM] Write on port 221h, len 1, val 0h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 2h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 3h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 4h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 5h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 6h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 7h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 8h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 9h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val ah
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val bh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val ch
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val dh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val eh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val fh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 10h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 11h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 12h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 13h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 14h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 15h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 16h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 17h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 18h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 19h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1ah
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1bh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1ch
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1dh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1eh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1fh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1ch
[CSM] Write on port 220h, len 1, val 2h
[CSM] Write on port 221h, len 1, val 1ch
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 223h, len 1, val 0h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 2h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 3h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 4h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 5h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 6h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 7h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 8h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 9h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val ah
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val bh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val ch
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val dh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val eh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val fh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 10h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 11h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 12h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 13h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 14h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 15h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 16h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 17h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 18h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 19h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1ah
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1bh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1ch
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1dh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1eh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1fh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1ch
[CSM] Write on port 222h, len 1, val 2h
[CSM] Write on port 223h, len 1, val 1ch
[CSM] Write on port 222h, len 1, val 1h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 1h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 2h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 3h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 4h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 5h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 6h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 7h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 8h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 9h
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val ah
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val bh
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val ch
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val dh
...

There is some very interesting stuff. :cool:

A little pause for clarification. :exclamation:
There are four devices on the board that are connected to ISA data bus:
- AY chip
- 2x74HC365 (joystick ports)
- 74HC373 (PCM DAC)
Nothing else has access to it, even GAL does not.

Address bus pre-decoding is done by 74HC138 then GAL takes over and does all the rest of address decoding and also it knows type of access (read or write). After address decoding GAL has control over every device on the board:
- 2 pins to control AY via BDIR and BC1 (setting mode of operation: offline, write register address, write data to a register, read data from a register);
- 2 pins control each of the 74HC365s (those can only dump data to the ISA bus by read command, neither AY or GAL can read joystick ports or know about state change);
- 1 pin to control 74HC373 (it can not be read, only writes from ISA data bus are possible);
- 2 pins to control 74HC74 that after some mess outputs IRQ to the ISA.

Back to the logs.
First of all, there is frequent access to ports 0x220 and 0x221. 0x220 is the base address, so offsets +0x00 and +0x01 are frequently used.
+0x00 is always being written, never read.
+0x01 is being read or written

Reminds of anything?
AY_modes.png
AY PSG modes of operation

If we'll look one step forward, we'll se that four MSBs in write operations to +0x00 are almost always "0".
AY_addresses.png
AY PSG address bits

Yep, seems like write-only operations at +0x00 are writing AY address number with BDIR="1", BC1="1".
For now let's assume that +0x01 handles data writes and reads for AY with corresponding BDIR and BC1 produced by GAL.

Let's try to "disassemble" this log:
Code: Select all
Example:
// [AY] Select register D (envelope shape)
[CSM] Write on port 220h, len 1, val dh

// [AY] Read envelope shape (didn't find the default state of the register yet)
[CSM] Read on port 221h, len 1

// [AY] Repeat of register D selection (it's not necessary, address stays the same, probably just a way that procedure accessing AY in software works)
[CSM] Write on port 220h, len 1, val dh

// [AY] Write 0xAD: "D" - select rising and holding amplitude.
[CSM] Write on port 221h, len 1, val adh

// [AY] Read from the same register (for verification).
[CSM] Read on port 221h, len 1

// [AY] Select register E (data for I/O port A, which has two 4-bit DACs connected, that contol analog amplifier).
[CSM] Write on port 220h, len 1, val eh

// [AY] Write 0x00: clear both DACs.
[CSM] Write on port 221h, len 1, val 0h

// [AY] Read from the same register (for verification).
[CSM] Read on port 221h, len 1

// [AY] Select register F (data for I/O port B, that controls enabling IRQ/DRQ and switching to mono).
[CSM] Write on port 220h, len 1, val fh

// [AY] Write 0xE0: mono is disabled, IRQ is disabled, DRQ is disabled, "1" on pin 6 of the GAL.
[CSM] Write on port 221h, len 1, val e0h

// [AY] Read from the same register (for verification).
[CSM] Read on port 221h, len 1

// [AY] Select register 7 (I/O ports and mixer settings).
[CSM] Write on port 220h, len 1, val 7h

// [AY] Write 0xFF: set I/O port A and I/O port B as outputs, turn off sound for all channels.
[CSM] Write on port 221h, len 1, val ffh

// [AY] Read from the same register (for verification).
[CSM] Read on port 221h, len 1

// [AY] Repeat clearing two 4-bit DACs.
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1

// [AY] Clear registers 0...D: reset all frequencies and levels, set decaying envelope, enable output of tone and noise on all channels, set I/O port A and I/O port B as inputs.
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
...
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1

// [AY] Set rising and holding envelope.
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val bdh
[CSM] Read on port 221h, len 1

// [AY] Repeat clear of registers 0...D.
[CSM] Write on port 220h, len 1, val 0h
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
...
[CSM] Write on port 220h, len 1, val fh
[CSM] Write on port 221h, len 1, val 0h
[CSM] Read on port 221h, len 1
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1

// [AY] Set rising and holding envelope.
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val dh
[CSM] Read on port 221h, len 1

// [AY] Set I/O port A and I/O port B as outputs, turn off sound for all channels.
[CSM] Write on port 220h, len 1, val 7h
[CSM] Write on port 221h, len 1, val ffh
[CSM] Read on port 221h, len 1

// [AY] Read (verification?) envelope shape.
[CSM] Write on port 220h, len 1, val dh
[CSM] Read on port 221h, len 1

// [AY] Repeat setting rising and holding envelope.
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val adh
[CSM] Read on port 221h, len 1

// [AY] Output value 0x0A (170) on each of 4-bit DACs: set 66% from maximum level.
[CSM] Write on port 220h, len 1, val eh
[CSM] Write on port 221h, len 1, val aah
[CSM] Read on port 221h, len 1

Next in the same log there is something else interesting:
Code: Select all
...
[CSM] Write on port 222h, len 1, val 90h
[CSM] Write on port 222h, len 1, val 84h
[CSM] Write on port 222h, len 1, val 7eh
[CSM] Write on port 222h, len 1, val 80h
[CSM] Write on port 222h, len 1, val 82h
[CSM] Write on port 222h, len 1, val 82h
[CSM] Write on port 222h, len 1, val 7ah
[CSM] Write on port 222h, len 1, val 7eh
[CSM] Write on port 222h, len 1, val 78h
[CSM] Write on port 222h, len 1, val 76h
[CSM] Write on port 222h, len 1, val 70h
[CSM] Write on port 222h, len 1, val 86h
[CSM] Write on port 222h, len 1, val 74h
[CSM] Write on port 222h, len 1, val 80h
[CSM] Write on port 222h, len 1, val 78h
[CSM] Write on port 222h, len 1, val 74h
[CSM] Write on port 222h, len 1, val 90h
[CSM] Write on port 222h, len 1, val 8eh
[CSM] Write on port 222h, len 1, val 7ah
[CSM] Write on port 222h, len 1, val 8ah
[CSM] Write on port 222h, len 1, val 6eh
[CSM] Write on port 222h, len 1, val 88h
[CSM] Write on port 222h, len 1, val 94h
[CSM] Write on port 222h, len 1, val 80h
[CSM] Write on port 222h, len 1, val 7eh
[CSM] Write on port 222h, len 1, val 7ch
[CSM] Write on port 222h, len 1, val 7ch
[CSM] Write on port 222h, len 1, val 70h
[CSM] Write on port 222h, len 1, val 70h
[CSM] Write on port 222h, len 1, val 8ah
[CSM] Write on port 222h, len 1, val 8ah
[CSM] Write on port 222h, len 1, val 6eh
[CSM] Write on port 222h, len 1, val 84h
[CSM] Write on port 222h, len 1, val 8ch
[CSM] Write on port 222h, len 1, val 90h
[CSM] Write on port 222h, len 1, val 9ah
[CSM] Write on port 222h, len 1, val 74h
[CSM] Write on port 222h, len 1, val 6ah
[CSM] Write on port 222h, len 1, val 7ch
[CSM] Write on port 222h, len 1, val 88h
[CSM] Write on port 222h, len 1, val 92h
[CSM] Write on port 222h, len 1, val 92h
[CSM] Write on port 222h, len 1, val 82h
[CSM] Write on port 222h, len 1, val 70h
[CSM] Write on port 222h, len 1, val 66h
[CSM] Write on port 222h, len 1, val 7ah
[CSM] Write on port 222h, len 1, val 8ch
[CSM] Write on port 222h, len 1, val 94h
[CSM] Write on port 222h, len 1, val 82h
[CSM] Write on port 222h, len 1, val 7eh
...

It definitely looks like writes to PCM DAC! Only writes (DAC can not be read), no address presetting, value is oscillating near 0x80 (128) - that's exactly the half of 0...255 span, so the waveform can go equal distance positive (to 255) or negative (to 0).
So, +0x02 seems to be the offset for PCM DAC!

Strangely enough there is one more address being accessed - 0x223. And it is write access. So, that can not be any of the joystick ports.
In two logs it just sometimes is being written with "00" before accessing 0x220:
Code: Select all
[CSM] Write on port 223h, len 1, val 0h

But in another log it is being constantly written with increasing number, interleaving with writing "0x00" to 0x222 (presumably PCM DAC port).
Code: Select all
[CSM]
... Write on port 221h, len 1, val 1ch
[CSM] Write on port 220h, len 1, val 1h
[CSM] Write on port 223h, len 1, val 0h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 1h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 2h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 3h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 4h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 5h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 6h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 7h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 8h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 9h
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val ah
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val bh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val ch
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val dh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val eh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val fh
[CSM] Write on port 222h, len 1, val 0h
[CSM] Write on port 223h, len 1, val 10h
...

Feels like programmer error (?), substituting pair 0x220/0x221 with 0x223/0x222... But who knows? Maybe GAL can switch its decoding functions? :confused:
Either way, after 0x220, 0x221 and 0x222 writes there are no more devices left on the board to write to. So, I don't know what 0x223 is directed to. Can it be mirrored to 0x220?
Also, there is no sign of reading joystick ports, strange.

Nevertheless, I've already started to try replace GAL with standard logic.
LSB address decoder: +1x 74HC138
BDIR decoder: +1x 74HC00
BC1 decoder: +1x 74HC00, +1x 74HC32

Here is my crude schematic:
2018-11-10 00.05.32.jpg
GAL replacement

Here is how it should work:
ay_control.png
AY control decoding
(9.8 KiB) Not downloaded yet

Grey text - not allowed combinations (like, simultaneous decoding of two addresses, simultaneous access for read and write).
Blue - writing address of the register to the AY.
Red - writing data to the register of the AY.
Green - reading data from the register of the AY.

How address decoder works for now:
ay_ports_2018-11-09.png
LSB address decoder
User avatar
Fagear
Member
 
Posts: 210
Joined: 2014-7-10 @ 22:27
Location: Russia, Moscow

Re: Covox Sound Master Reverse Engineering / Replica

Postby Fagear » 2018-11-09 @ 22:19

Addition to my post above, how SMD "GAL replacement" looks like:

AY_SMD_2018-11-09.png
Covox Sound Master: trying SMD

And something else about data being written to AY.
Most of the times register 0x0D is written with MSBs b4...b7 set to "0" as stated in datasheet:
Code: Select all
...
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val dh
...
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val 0h
...

But sometimes..
Code: Select all
...
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val adh
...
[CSM] Write on port 220h, len 1, val dh
[CSM] Write on port 221h, len 1, val bdh
...


Now take a look at this:
AY_comparison.png
Covox Sound Master: AY variants

It is totally software dependent, but while on the original card there is exactly AY8930, some software takes advantages of "expanded mode" of AY8930 by switching banks that are not available on AY-8-8910 and YM2149. Something to be aware of. :exclamation:

And last piece of information about CSM hardware for now, joystick ports pin mapping:
Code: Select all
Mapping is the same for both joystick ports.

Pin 1 ("Up") = DB1
Pin 2 ("Down") = DB0
Pin 3 ("Left") = DB3
Pin 4 ("Right") = DB2
Pin 5 (MB) = DB5
Pin 6 ("Fire"/LB) = DB4
Pin 7 = +5V
Pin 8 = GND
Pin 9 (RB) = NC
User avatar
Fagear
Member
 
Posts: 210
Joined: 2014-7-10 @ 22:27
Location: Russia, Moscow

Re: Covox Sound Master Reverse Engineering / Replica

Postby moturimi1 » 2018-11-10 @ 00:17

Fagear wrote:But for the "original replica" what should be done?
1) Component placement and routing:
a) should be left as close to original as possible (even if it degrades output quality and looks bad);
b) can be re-done in some places to get some improvements;
c) should be fully made from scratch (as an example: Malinov's OPL2 board vs. AdLib).

2) Components on the board:
a) should stay as they were: in same packages, all through-hole;
b) should be replaced with compact SMD analogs where possible.

3) Joystick ports:
a) will be implemented as on the original;
b) will be implemented as standard 15-pin PC joystick port;
c) will be removed.


I vote for 1.b, 2.a, 3. too.
moturimi1
Member
 
Posts: 154
Joined: 2014-6-01 @ 16:45

Re: Covox Sound Master Reverse Engineering / Replica

Postby Great Hierophant » 2018-11-10 @ 15:07

Fagear wrote:But for the "original replica" what should be done?
1) Component placement and routing:
a) should be left as close to original as possible (even if it degrades output quality and looks bad);
b) can be re-done in some places to get some improvements;
c) should be fully made from scratch (as an example: Malinov's OPL2 board vs. AdLib).

2) Components on the board:
a) should stay as they were: in same packages, all through-hole;
b) should be replaced with compact SMD analogs where possible.

3) Joystick ports:
a) will be implemented as on the original;
b) will be implemented as standard 15-pin PC joystick port;
c) will be removed.

Please give some answers like "1.a, 2.b, ...".


Here are my answers :

1.a, depends, 3.a.

1, This is supposed to be a replica, something to show others how the very rare original worked. I have no issue with basic improvements to the sound quality so long as the original "stereo" function is maintained. 2 (GAL vs. discrete) is really immaterial if the functionality can be perfected in discrete SMD logic instead of a GAL if you are offering fully assembled boards :) 3 should be kept, the digital joysticks are part of the function and charm of the original board.

So as I understand this the I/O map as we understand it thus far for this card is :
0x220 is AY control
0x221 is AY register access
0x222 is for DAC writes
0x223 is a mystery or possible alias for 0x222

Can you access the DAC via 0x378, the parallel port data register?

Do we know which addresses allow for joystick reads?

Is the board fully decoded from 0x220-0x23F (or 22F)? Do the registers repeat themselves across that address space?
http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog
User avatar
Great Hierophant
l33t
 
Posts: 2376
Joined: 2003-4-27 @ 08:20

Re: Covox Sound Master Reverse Engineering / Replica

Postby iret » 2018-11-10 @ 19:27

Great Hierophant wrote:So as I understand this the I/O map as we understand it thus far for this card is :
0x220 is AY control
0x221 is AY register access
0x222 is for DAC writes
0x223 is a mystery or possible alias for 0x222

I think, 0x223 is only for triggering something in GAL. Log with many writes in 0x223/0x222 ports may be bug or conflict due to incomplete emulation of CSM.
Joysticks access may require interrupts/DMA emulation, i was too lazy to dig it :blah: .
iret
Newbie
 
Posts: 1
Joined: 2018-11-08 @ 23:29

Re: Covox Sound Master Reverse Engineering / Replica

Postby Fagear » 2018-11-11 @ 01:23

Great Hierophant wrote:1, This is supposed to be a replica, something to show others how the very rare original worked. I have no issue with basic improvements to the sound quality so long as the original "stereo" function is maintained.

Well, I went for 1.c variant, but preserving looks of the original board. Original layout was a mess, as I described before.
So, I've took all the same components (except output amplifiers), fixed some errors of the original design, composed all components in a way that looks "close enough" to original and made a new layout from scratch with the same schematics.

Take a look.
Here is SSI-2001 vs. SSI-2001 replica. Board on the right is significantly smaller, it has new features (like +9 V regulator for 8580 and bypass capacitors), but it looks like the original, because it uses the same parts in roughly the same places:
ssi_front_photo.jpg
SSI-2001 vs. replica

Now take a look at current CSM replica project:
IMG_7277.jpg
CSM vs. replica

Is it bad in your opinion and should be done "closer" to original? Or is it "close enough". :confused:

Great Hierophant wrote:2 (GAL vs. discrete) is really immaterial if the functionality can be perfected in discrete SMD logic instead of a GAL if you are offering fully assembled boards :)

Well, full functionality of the GAL is still unknown. Addresses for joysticks are still unknown, what does write to 0x223 do - still unknown. How DMA and IRQ are used and how operate within GAL - unknown. I've just started to "emulate" already known part of the GAL in SMD. It can not be implemented in standard logic yet.

Great Hierophant wrote:So as I understand this the I/O map as we understand it thus far for this card is :
0x220 is AY control
0x221 is AY register access
0x222 is for DAC writes
0x223 is a mystery or possible alias for 0x222

Yep, that's it. Where are joysticks - I don't know yet. How (and what for) to use IRQ and DMA - unknown.

Great Hierophant wrote:Can you access the DAC via 0x378, the parallel port data register?

No way, 74HC138 decodes 0x20 addresses from base that could be 0x220/0x240/0x280/0x2C0. It can not cover 0x370.

Great Hierophant wrote:Is the board fully decoded from 0x220-0x23F (or 22F)? Do the registers repeat themselves across that address space?

It's unknown. I have the card without GAL, so I can not test anything (yet). 74HC138 decodes up to +0x20 from base (0x220 default) and then GAL takes over for LSB address decoding.

Also, I have a corrections about your article.
the bits from the joysticks are read via the AY8930's two 8-bit parallel I/O ports

They are not. I/O ports of AY are used as outputs for 4-bit DACs, controlling IRQ/DMA and switching analog switches. Joystick are read with two 74HC365 buffers by command from GAL.
User avatar
Fagear
Member
 
Posts: 210
Joined: 2014-7-10 @ 22:27
Location: Russia, Moscow

Re: Covox Sound Master Reverse Engineering / Replica

Postby Great Hierophant » 2018-11-11 @ 14:48

I think your current layout is "close enough", I'm definitely on board with one. I like that an AY-3-8910 or YM2149 can be used for the sound chip with only a slight reduction in game support.

I'll fix that joystick error in my article. These Covoxes become more mysterious as we learn more about them.
http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog
User avatar
Great Hierophant
l33t
 
Posts: 2376
Joined: 2003-4-27 @ 08:20

Re: Covox Sound Master Reverse Engineering / Replica

Postby awgamer » 2018-11-11 @ 17:28

As far as the innovation replica goes, it's a real downer that they didn't include the innovation logo.
awgamer
Member
 
Posts: 481
Joined: 2014-7-26 @ 07:42

Previous

Return to General Old Hardware

Who is online

Users browsing this forum: Google [Bot], Shagittarius and 13 guests