MSX-Audio BIOS upgrade for Music-Module --------------------------------------- By FRS, 23/04/2005 frs at pop-dot-com dot br BIOS version 20050414 ########################################################################### DISCLAIMER Try this upgrade at your own risk. Be warned that this modification can damage your cartridge and all your equipment, including your TV set. ########################################################################### This upgrade targets to get your Music-Module 100% compliant to the MSX-Audio specification. Your original cartridge could not be named "MSX-Audio" by Philips because it lacked this BIOS. It could be possible to install this BIOS upgrade on the Toshiba HX-900 with some minor modifications, but I cannot say what modifications are those and even if it is really possible since I don't have one HX-900. 1) The History: The Panasonic FS-CA1 MSX-Audio was the only fully compliant MSX-Audio cartridge ever released to the market. The other two models available lacked the BIOS, and the HX-900 even lacks the Sample-RAM. But, as Panasonic did for the FM-PAC cartridge, the BIOS is embembed in a bigger megarom containing some aditional software and demos. While the MSX-Music BIOS in FM-PAC is 16KB and it uses a 64KB megarom, the MSX-Audio BIOS is 32KB and the cartridge uses a 128KB megarom. The FS-CA1 EPROM structure is the following: 1) 32KB MSX-Audio BIOS 2) 32KB Synthe Music Editor 3) 64KB Optional ADPCM Demo Samples As many of you may know, the MSX-Audio BIOS is the original (1985) music extensions designed for the MSX standard. The MSX-Music came later (1987) as a Panasonic proprietary extension, using more limited version of the BIOS (*1), patched to use the much cheaper and incompatible YM2413. It's obscure why Panasonic did choose the YM2413 to build a incompatible cheaper sound cartridge for the MSX when they could have choose the YM3526, which was 100% FM compatible with the Y8950, lacking only the ADPCM registers. The ADPCM commands could then just be blocked, as they did on the MSX-Music BIOS. Being incompatible with the MSX-Audio, the MSX-Music was not designed to be used for direct OPLL access, but many games did it. ASCII got even further on weakening the standard when made the terrible mistake of choosing the MSX-Music as the standard for the MSX Turbo-R spec. Also, they could have chose to build a cheaper MSX-Audio using the YM3526. *1: ADPCM commands are explicitly blocked and only 1 user-instrument can be used at a time. What all of this mean? This means that since the MSX-Music BIOS is a subset of the MSX-Audio BIOS, all your BASIC music (like those from MSX-Magazine) written for the MSX-Music can be played on the MSX-Audio just by changing the CALL MUSIC command for CALL AUDIO. All the parameters are the same also. Just for those who don't know, both Philips Music-Module and the Toshiba HX-900 came with 32KB EPROM containing a crappy irritant music editor that runs on every boot, requiring the user to press ESC to skip loading the damn thing. Many users just removed the EPROM at all or just rewrote a modified version without the boot signature. This allowed them to run the internal software by calling them on BASIC. - Music-Module: 32KB Philips MUSICBOX editor - HX-900: The same 32KB Synthe Editor Panasonic included in their rom 2) The diferences between MSX-Audio BIOS and MSX-Music BIOS when playing on BASIC 2.1) The FM part - Better: All instuments can be used at any time: There is not that stupid limit that we all hated in the MSX-Music, allowing you to chose only one of the instruments marked with a "*" on the manual. No boring asterisks on the MSX-Audio, just fun. :) - Better: The MSX-Music BIOS takes up to 2KB of your free RAM on BASIC as work area, but the MSX-Audio BIOS has it's own RAM on the cartridge, so you'll not loose even a single byte of memory space after typing CALL AUDIO - Worse: The YM2413 is a low-cost OPL2, thus named OPLL, for "OPL Light". This means its core is a striped-down version of the YM3812 (OPL2), while the Y8950 core has a YM3526 core (OPL1) internally. The only advantage is that the YM2413 have two types of sound waves, while the Y8950 has only one. This doesn't seem to be much, but is enough to get a good advantage on the synthesis, resulting in more complex and nice instruments. So, when playing BASIC musics, some instruments will sound a bit more simple on the MSX-Audio. - Y MML command is incompatible: The undocumented Yn,m command writes the m value to the register n. Since this is direct acces to the chip, it is hardware dependent and obviously incompatible between Y8950 and YM2413. Musics that use this MML command will get unpredictable behaviour, from disabling the FM output to locking your computer. Fortunately, it's very rare to find it on BASIC musics and tt's easy to replace the Y command with normal macro MML commands that have the same result and are compatible with both MSX-Music and MSX-Audio. 2.2) The ADPCM commands You'll also get the extra usefull ADPCM commands, allowing you to load, save, record and play ADPCM samples assyncronously direct from the BASIC. I hope someone could soon translate the full MSX-Audio BASIC manual. 2.3) The differences between the Panasonic BIOS and this generic MSX-Audio BIOS 2.3.1) There's no CALL SYNTHE - Well, if you want that piece of crap, you can aways load it in RAM using execrom. :) 2.3.2) The CALL COPY PCM (#x,0) command - This coomand copy the #x sample from the 64KB Demo ROM, so it can be played with the CALL PLAY PCM (0) command. The BIOS auto-detects the presence of this extra samples on the boot and enables/disables the CALL COPY PCM command accordingly. If you try to use it on this generic BIOS, you'll get an "Illegal Function Call" error. 3) The Project BIOS 3.1) The Software part First things first, right? So before anything else I needed to separate the BIOS portion of the FS-CA1 from the rest of the ROM. This took me some time, mainly because I got many bad FS-CA1 romdumps on the net. It's structure is not very easy to understand also, since I did not know it had 4KB of RAM for it's work area. But thanks to the openmsx support for the MSX-Audio BIOS, things got a lot faster. Then I patched out some Panasonic-specific code (for reading the cartridge switch, for example), fixed a bug and cleaned up the free space. 3.2) The Hardware part A very simple circuit is needed to implement everything the BIOS needs to work, which is: - 4KB of work area, mirrored in 3000h and 7000h. - The ROM needs to be mapped from 0000h to 7fffh. It is easier to install the BIOS than the 256KB SampleRAM upgrade and much easier to get it removed from your Music-Module to get it working in the original way. 3.2.1) Needed parts: - 27C256: 32KB EPROM - 6164, 7164 or equivalent: 8KB SRAM - 74LS139: For the chip selection Hey, do not use your original EPROM. Save it and buy another 27C256, just for the improbable possibility that you dislike the BIOS and opt for undoing everything. The connections are shown in the msxaudio-BIOS.gif file. You have two options for building it: a) Quick-and-dirty way Note: I don't like this way because you'll need to sold one wire directly to the pin-20 of the EPROM soquet on the board. a.1) Just solder the 6164 over the 27C256, leaving up the pins that must not be directly conected from one two another. All of them are on the same side of the chip. Note that there are pins of the 27C256 that must be liffted too, so they do not touch the respective pins on the EPROM soquet. a.2) Open wide the pins of the 74LS139 and put it over the 6164. Get the 74LS139 pin-16 soldered to the pin-28 of the 6164. After this, get a hard wire to solder the pin-2 of the 74LS139 to the pin-2 of the 6164. This should get it fixed over the 6164. Then wireup all other conections as described on the .gif file. a.3) For simplifying things, you don't neet to solder the to-A15 wire, just ground it directly to the 6164 pin-14. Afterall, you chosed the quick- and-dirty version anyway. :) b) A bit better way Get yourself a small prototype board, take care that it must fit on the space and be big enough to hold the three CIs. Build it in a piggyback way, so you'll not need to solder any wire on the EPROM soquet and will not need to bend any chip pins also. All you'll need to solder on the cartridge is the RW, RD and A14 signals, which are very easy to do. c) The best way Sturaro and me will probably be building full piggyback upgrade boards for the Music Module, containing not only the BIOS upgrade but also the 256KB sampleRAM expansion. All you'll need to do is get out the original EPROM, put a soquet on the IC8 and solder RD, RW, A14, IC2_pin-1 and wire IC2_pin-2 to the Y8950_pin-2. 4) FAQ 4.1) Is it true that the MSX-Audio BIOS can detect and use two Y8950? A: Yes, I confirmed this when disassebled the code. But it is not very clear to me yet how the BASIC get advantage of this. All my tests got both the chips playing exactly the same sound. Maybe a manual translation could help us to get most of this feature. 4.2) Isn't the MSX-Audio BIOS something magic that neet special circuitry and lots of ROM to run? A: This was a urban legend. All it needs is the 4KB-mirrored RAM on the same slot. It doesn't even need to be SRAM, just ordinary RAM can do it. I used SRAM just to simplify the circuit. 4.3) Why did you used a 8KB SRAM chip if you say that the MSX-Audio BIOS needs only 4KB of RAM? What happens to the rest? A: Since there are no 4KB RAM chips, I choosed to use a 8KB just to simplify everything two. By this way it could all be built using only 3 CIs. The remaining 4KB are just not used. 4.4) Can savegames or anything like this be saved to this SRAM? A: No, since it's not battery backed-up. It's SRAM just to simplify the circuit. The MSX-Audio BIOS uses it only as work-area, so it could be implemented as DRAM on a factory-made cartridge. 5) Credits and Thanks - Adriano Camargo Uzix Rodrigues da Cunha, for his tips and ideas - Alexandre Antoniutti Passos (aka Macross), for lending me his BQ4011YMA for so long. ;) - Paulo Maluf, for getting me a good-state Music-Module for a good price - Perigote, for fixing my MSX Turbo-R again. :) - Rafael Pereira Rigues, for helping to fix the Turbo-R again - Marujo, for his excellent ideas for the hardware chip-selection using the 74LS139. - Luciano Sturaro, for his tips, initial tests and hosting my upgrades. :) - Daniel Ravazzi, for his tests and romdump on his original FS-CA1.