/nymp



Video:



Download the player, rombuilder and source code


Introduction
This is an YM player for the Neo Geo Pocket Color, which allows the NGPC to play music created for the YM2149 and AY-3-8910/12 programmable sound generators. These chips were found, for example, in the Atari ST, the ZX Spectrum and the Amstrad CPC.

The package consists of some playback code and a ROM builder tool (nymptool). The purpose of the ROM builder tool is simply to inject YM files into the player binary at the correct location (this operation can be performed by some other tool if that is preferred).
One important restriction is that both the ROM builder tool and the player supports only uncompressed YM files (maximum size: 384 kB). You can also not use songs that make use of any of the extra features of the YM format, such as digi drums.
Most YM files found on the internet are compressed using the LHA compressor. These files would have to be decompressed first before they can be used. If 7zip is installed this should simply be a matter of right-clicking the YM files and selecting "Extract here..".

I'm not aware of any emulator in existence that runs my player correctly, although I haven't tried all of them. It does work fine on a real NGPC, as you'll see if you've got a flashmasta, pocket flash, or Bung cart (or some other means of running ROMs on an NGPC).


Why am?
YM files are register logs for the YM/AY chip, taken at a regular interval (typically 50 times/second). These registers control, among other things, a number of oscillators, a mixer, and a shift register used for noise generation.
The YM/AY chip has the following features:


Second cousin
Meanwhile, the NGPC's sound chip has the following features:

The differences in the two chips' feature sets makes it difficult to faithfully emulate the YM/AY by means of mapping register values to corresponding settings for the NGPC's sound chip.


Make your own kind of music
Luckily, the NGPC provides another way of outputting sounds: if the sound chip is switched off, the main CPU can write directly to the NGPC's two 8-bit audio DACs. Doing this requires us to have some 8-bit unsigned PCM data, generated at as high a sample rate as possible to be able to reproduce a wide spectrum of frequencies.

Let's review some of the other properties of the NGPC:


..192 CPU states on the wall
Based on this I designed my YM emulation code as follows:

The result turned out quite ok, given the limited performance of the system. Although I'm sure there are a lot of tunes that won't play back correctly, due to some of the shortcuts taken in the YM emulation.

Some earlier videos:




References: