Tronix
Experienced Member
Hello,
I read about Creative Music System (CMS) / Game Blaster at Great Hierophant blog. This sound card based on two Philips SAA1099 chips and looks easy to duplicate. Easier than adlib: SAA1099 data lines to ISA data lines, A0 to ISA A0, Vref through 10K resistor to VCC, DTACK (open collector output) not used and pull-up with 10K to VCC, CLK from ISA-OSC divided by two by 74ls74 or another counter. First SAA1099 chip CS to address decoder 0x220 and second SAA1099 chip to address decoder 0x222. Thats all!
But the most difficult - card autodetect. Great Hierophant write:
I tried to emulate this method in emulator - data written to 0x224-0x22F port is stored to variable and then read back when access to 0x224-0x22F port, but some programs did not detect card. Then I looked at the source code of DosBox and I found this logic: data store only when 0x226 or 0x227 port write. Other port ignored. Data read back only if access to 0x22a or 0x22b port. Other port ignored. And last thing - when reading port 0x224, data allways must contain 0x7F:
So, we need RAM to store 1 byte. I think i can use latch register. And i am looking the best way to do the decoder... Original card used 74ls138 2 pcs and 74ls139 1 pcs. At first approximation my circuit:
/IOCS16 not used, this must be AEN signal..
Any ideas or suggestions?
I read about Creative Music System (CMS) / Game Blaster at Great Hierophant blog. This sound card based on two Philips SAA1099 chips and looks easy to duplicate. Easier than adlib: SAA1099 data lines to ISA data lines, A0 to ISA A0, Vref through 10K resistor to VCC, DTACK (open collector output) not used and pull-up with 10K to VCC, CLK from ISA-OSC divided by two by 74ls74 or another counter. First SAA1099 chip CS to address decoder 0x220 and second SAA1099 chip to address decoder 0x222. Thats all!
But the most difficult - card autodetect. Great Hierophant write:
The left SAA-1099 is at I/O 2x0 & 2x1 and the right SAA-1099 is at I/O 2x2 & 2x3. The subsequent twelve I/O addresses are used by the CT-1302. For a long time, the function of this chip was a mystery, but now we know what it can do. One problem which Creative used this chip to solve was that of detection. While the game publisher could require a user to tell a program the hardware he had in his system, it would be difficult for a less savvy user to know or remember what he had or where in the I/O space it was. Creative decided to make it easy for the consumer and the game programmers by allowing the card to be detected by software.
In order for a card to be detectable in software in a PC, it has to give a reliable, non-random response to a read from the processor. The SAA-1099s cannot be read, only written, so there was no reliable way to detect these chips in software. Here is where the CT-1302 comes in. For the remaining addresses, 2x4-2xF, it will store or latch an 8-bit value written to it in one register, which is then read back by a program from a different register. If the values written and read match, then the card has been detected successfully. If they do not match, then the card is not detected. There must be two different I/O addresses involved, otherwise this scheme does not work reliably.
I tried to emulate this method in emulator - data written to 0x224-0x22F port is stored to variable and then read back when access to 0x224-0x22F port, but some programs did not detect card. Then I looked at the source code of DosBox and I found this logic: data store only when 0x226 or 0x227 port write. Other port ignored. Data read back only if access to 0x22a or 0x22b port. Other port ignored. And last thing - when reading port 0x224, data allways must contain 0x7F:
PHP:
uint8_t cms_port_read(uint16_t addr, void *p)
{
uint8_t res;
switch(addr-0x220) {
case 0x4:
res = 0x7f;
break;
case 0xa:
case 0xb:
res = lastwrite;
break;
}
return res;
}
void cms_port_write(uint16_t addr, uint8_t val, void *p)
{
switch(addr-0x220) {
case 0x6:
case 0x7:
lastwrite = val;
break;
}
}
So, we need RAM to store 1 byte. I think i can use latch register. And i am looking the best way to do the decoder... Original card used 74ls138 2 pcs and 74ls139 1 pcs. At first approximation my circuit:
/IOCS16 not used, this must be AEN signal..
Any ideas or suggestions?