Detection of FM sound chips 
Tuesday, August 9, 2011, 11:47

Introduction


MSX has some sound chips based on FM synthesis. In this article only the detection of MSX-AUDIO, MSX-MUSIC and MoonSound will be described. These are most used and are based on the same type of FM synthesis, which means they all can be used to produce the same sound with the same data up to a point.

MSX-AUDIO


MSX-AUDIO is built around the Y8950 chip. It's an OPL1 chip with ADPCM record and play capabilities. It's used in the Philips NMS-1205 Music Module, Toshiba HX-MU900 Synthesizer Unit and Panasonic FS-CA1 MSX-AUDIO Module.

On MSX the Y8950 chip can be accessed through one of 2 port ranges: $C0-$C1 or $C2-$C3. The Philips and Toshiba ones can only be accessed through port range $C0-$C1. The Panasonic one can be accessed through either port range. This is because it's capable of selecting the range it should use. If it hasn't detected an MSX-AUDIO yet, it'll set itself up on port range $C0-$C1. Otherwise it'll set itself up on port range $C2-$C3. This way up to 2 MSX-AUDIOs can be used and only if there's at least 1 Panasonic used. It's possible for the Philips and Toshiba ones to be adapted to run on port range $C2-$C3.

Detecting the availability of MSX-AUDIO, read I/O port $C0. If it returns $06, it's MSX-AUDIO. If it returns $00, it's actually MoonSound with port range $C0-$C3 enabled. For information about MoonSound continue reading this article.

MSX-MUSIC


MSX-MUSIC is built around the YM2413 chip. It's an OPLL (a simplified OPL2) chip. Several external variants appeared: FM-PAK (released in Korea and by some Dutch MSX clubs), FM-Stereo-PAK (released by Checkmark, splitting up the MSX-MUSIC melody and rhythm outputs and mixing the latter optionally with the PSG using a seperate input) and the Panasonic SW-M004 FM-PAC (FM Pana Amusement Cartridge). Many MSX2+ and all MSXturboR machines have MSX-MUSIC internally.

On MSX the YM2413 chip can be accessed through port range $7C-$7D. Apart from the FM-PAC it's immediately accessible. When using the FM-PAC, it should be set up first.

Detecting the availability of MSX-MUSIC an identification string should be found. Internal MSX-MUSIC have the string "APRLOPLL" from $4018. External MSX-MUSIC may have different identification strings. However, from $401C the string "OPLL" is required for correct detection. As external MSX-MUSIC may require setting up first (like FM-PAC) a detection method is required.

To successfully detect and set up MSX-MUSIC, parse through all available slots: first check for the "APRLOPLL" string. If this is found, MSX-MUSIC is available and nothing special is required and exit the detection system. Then check for the "OPLL" string. If this is found, set bit 0 of address $7FF6 of the detected slot and exit the detection system.

Emulated MSX-MUSIC


Something that may become more and more of an issue, is MSX-MUSIC emulated by MSX-AUDIO expansions using recent ROM updates. There are 3 identification strings, all from $4018: "AUD1OPLL" for MSX-AUDIO implementation, "AUD3OPLL" for OPL3 cartridge implementation (Brazilian prototype) and "AUD4OPLL" for MoonSound implementation.

These implementations require the FM-BIOS calls to be used to have the sound played through them, which additionally requires knowledge of that system and unnecessary overhead due to interslot calling. If you only want to have real MSX-MUSIC play (simply by using the MSX-MUSIC I/O ports) you'll need to do specific tests for those identification strings. If you don't add them, MSX-MUSIC will be falsely detected and data will be sent to the MSX-MUSIC I/O ports regardless of the chip itself is actually available to produce the sound.

MoonSound


MoonSound is built around the YMF278B chip. It's an OPL4 chip. It's 100% compatible with OPL1, OPL2 and OPL3. It's designed by Henrik Gilvad and released under this name by Stichting Sunrise.

On MSX the YMF278B can be accessed through port range $C4-$C7. On MoonSound v2 it's also possible to have it emulating MSX-AUDIO without the ADPCM, by adjusting JP1 on the MoonSound PCB.

Detecting the availability of MoonSound, read I/O port $C4. If it returns $00 it's MoonSound, regardless the state of JP1.

Final words


Of course it's highly advisable to set a bit or byte for each of the detected sound chips so the program can determine which chip to use. This way it's possible to have a preferred order of use for the program.
add comment (7040 views)   |  permalink
MoonBlaster v1.4 BASIC driver 
Sunday, April 3, 2011, 16:49
Today I've released an update of the MoonBlaster v1.4 BASIC driver. It contains fixes and a few requests. There is no need to use MAP.COM or MAP.BIN anymore.

Changes in this version:
  • adapted error to use BASIC errors
  • added Hertz equalizer, controllable with _MBEQUAL
  • added DOS2 mapper support, controllable with _MBBANK, _MBALLOC and _MBFREE
  • added DOS2 directory support
  • fixed incorrect writes to PSG R#7 bug
  • fixed MSX-MUSIC detection
  • fixed a few other typical internal bugs

Recently Paragon released an updated BASIC driver to fix incorrect writes to PSG R#7. Investigation has turned out this 'fix' can cause unstability when using PSG drums.

The driver can be downloaded from my Home Page or MSX Banzai!.

(April 8, 2011: official assembly source updates are available, fixing the incorrect writes to PSG R#7 bug and MSX-MUSIC detection)
(August 18, 2011: important bug fixed regarding loading files under DOS2. Also a few small fixes in the MBLOADER.SRC file)
4 comments (15499 views)   |  permalink   |  related link
YouTubed 
Sunday, February 20, 2011, 08:55
Yesterday I decided to create a YouTube account. I'm not 100% certain with what kind of videos I will populate it, but I'm sure there will be very interesting ones among them.

Video's uploaded right now (first of all more or less to test, but still interesting nevertheless):

add comment (2772 views)   |  permalink   |  related link
ROMLOAD v1.99v 
Friday, December 24, 2010, 14:29
Today I released a new version of ROMLOAD. New in this version are:
  • Improved /0 implementation
  • Minor tweak in support for MSX-DOS 2 Kernel in a Sound Cartridge
  • Removed /C for Konami without SCC specification. Konami without SCC detection attempt when no conversion switches were given
  • Fixed bug in command line switches parser, some switches could be lower case only
  • Use low speed mode (Z80, 3.58 MHz) for compatibility, unless forced otherwise
  • Fixed small bug in ASCII8 mapper init
  • Added 50Hz/60Hz init /S[:<Hz>]

add comment (4234 views)   |  permalink   |  related link
COMMAND2.COM v2.44 
Thursday, November 11, 2010, 17:35
Today I released version 2.44 of COMMAND2.COM as a patch for version 2.20 or 2.31 as a TNI product.

Changes in version 2.44 are:
  • Fixed a bug causing TAB completion to go into an infinite loop in a subdirectory with only the . and .. entries. In such a case a BEEP will occur indicating it couldn't find any name to complete.
  • The COMPATCH is implemented natively. This is to display the free size of a FAT16 partition.
  • Added SHIFT command for batch files. This allows to shift arguments 1 position to the left, including an option to specify from which argument the shift will take place.
  • New external command: TYPEWW to type text with word-wrap.
  • New external command: MORE piping command to pause output display per screen.
  • Added BOOT command. Sets the boot drive for when leaving MSX-BASIC.
  • Added HERTZ command. Sets VDP refresh frequency.
  • SET PROMPT ON and SET PROMPT OFF are restored to their respective defaults. If PROMPT wasn't set, it defaults to %_CWD%>.
  • Restored ERA, ERASE and RENAME commands for compatibility reasons.
  • Added missing COMMAND2.COM version 2.41 features to the help files.
  • Internal Variable _MSXVER now supports all MSX generations.
  • Added @STRING Internal Variable Function. Returns a string of the specified length containing the first character of a string.

(November 18, 2010: it turns out the help files packaged weren't that up to date. The current archive contains the correct help files)
(November 29, 2010: there was a bug causing a "Wrong version of COMMAND" error appearing on MSX2 machines. The current archive contains the fixed version of COMMAND2.COM)
2 comments (4722 views)   |  permalink   |  related link

<<First <Back | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Next> Last>>