Well I have been learning a lot since I finally got an MSX-MUSIC. No wonder there is so much trouble detecting MSX-MUSIC chips, if the computer can't read from the actual YM2413. On the Sega Master System, there is a third address which the detect routine both writes to and reads from. Although I cannot say for sure that it is actually the YM2413 that is selected, as no-one in the western Sega 8-bit world has published this info. I'll include example Master System FM detect code at the end of this email, for your interest.
Anyway, the subject I really want to discuss is the Zemina FM-PAC. There were some discussions on IRC and I thought I'd share my results. The cartridge is very easy to open; just two screws and no annoying latches. Inside there are two TTL logic chips, an op-amp, the YM2413 OPLL and the music BASIC EPROM. Curiously the date code has been scratched off on my YM2413. Perhaps Zemina didn't want Yamaha (or anyone else) to be able to trace their suppliers. I guess the EPROM is a copy of the real FM-PAC ROM; haven't confirmed this though. What is interesting is that there is a preset resistor inside the cartridge which acts as a volume control. It is an enclosed type, which indicates fairly high quality, and the op-amp is an HA17558 which is also perfectly reasonable. So why did my Zemina MSX-MUSIC sound so distorted? Turns out the volume control was turned up too loud for the MSX computer it was plugged into. Perhaps Zemina machines themselves have different gains on their SOUND IN lines. Anyway, once the volume was turned down with a screwdriver, the cartridge sounded fine. I'm including the logic examination of the cartridge here, more for documentation purposes. The outcome is that the chip can only be accessed at 7C and 7D for writes. This seems to be common with other MSX-MUSIC implementations. Pin assignment of YM2413 OPLL in Zemina MSX-MUSIC 1 GND 2 D2 3 ?D3 4 ?D4 5 ?D5 6 D6 7 D7 8 CLOCK 9 ?NC 10 A0 11 GND 12 Pin 8 of 74LS30 13 ?RESET# 14 2K2 resistor 15 2K2 resistor 16 Vcc 17 ?D0 18 ?D1 Logic function of TTL chips 74LS30 is an 8-input NAND gate. Pin 8 is the output so it directly drives CS# on the YM2413. The inputs are A2, A3, A4, A5, A6 and two lines from the 74LS02 quad 2-input NOR gate. The inputs to the NOR gates are A7 and A1, and IORQ# and WE#. The other 2 gates have all their inputs tied high. Thus the logic function is �(A1 + A7) . �(IORQ# + WE#) . A2 . A3 . A4 . A5 . A6 or in other words, the output will be high unless A1, A7, IORQ# and WE# are all low, and A2, A3, A4, A5 and A6 are all high. A7 A6 A5 A4 A3 A2 A1 IORQ# WE# 0 1 1 1 1 1 0 0 0 I/O write access to 7C / 7D selects OPLL. Sega Master System YM2413 OPLL detect routine (taken from Fantasy Zone II) 04b6 010007 ld bc,$0700 07 in b, 00 in c 04b9 78 ld a,b Current b in a 04ba e601 and $01 mask off all except bit 0 04bc d3f2 out ($f2),a out a to F2 04be 5f ld e,a a value to e 04bf dbf2 in a,($f2) in 01 to a 04c1 e601 and $01 mask all except bit 0 04c3 bb cp e compare with e (value written to port) 04c4 2001 jr nz,$04c7 ; (+$01) If not the same skip the next instr. 04c6 0c inc c increment count 04c7 10f0 djnz $04b9 ; (-$10) Repeat 7 times altogether 04c9 79 ld a,c put count value in a 04ca fe07 cp $07 compare with 7 04cc 2801 jr z,$04cf ; (+$01) if the same skip the next instr. 04ce af xor a set a equal to 0 04cf e601 and $01 mask all except bit 0 (a is 0 if c<7, 1 if c=7) 04d1 d3f2 out ($f2),a out a to F2 04d3 3200de ld ($de00),a store a in de00 So de00 ends up with 0 if the routine checking bit 0 of F2 for state storage finds it doesn't consistently store bits, and 1 if it does. Richard -- For info, see http://www.stack.nl/~wynke/MSX/listinfo.html
