|
DevelopmentSega Master System / Mark III / Game Gear |
Home - Forums - Games - Scans - Maps - Cheats - Credits |
The game has two samples: "Welcome to Populous" at startup, and a laughing voice when the player loses. The game stores its data as 8-bit unsigned PCM data.
The sample playback code uses three consecutive 256-byte tables starting at $3800 to convert the 8-bit data into SN76489 volume commands. Each sample is used as an index into each table in turn, which then yields the byte written to the SN76489, encoding both the channel selection and volume. By combining channels with different volume levels, it is able to generate 45 different output levels to represent the wave, which corresponds to 5.5 bits of resolution.
The tables seem to be built assuming that the SN76489 response is linear - the combined output volume settings are linear with respect to the PCM data. The tables also invert the waveform.
The sample player function starts at offset $36db. It disables interrupts, then silences the PSG, then waits for a short time (~27ms), then plays the sample. It sets the tone channels to half-wavelength $3f1 (110Hz) but then sets them to $005 (22kHz, effectively silence) immediately afterwards and then before every volume change. It's not clear what the reason for this is.
The sample player supports playing samples that span banks of ROM, although this feature is not used. It invokes a code path that takes some extra time so there would be a small glitch in the output.
The sample data starts at $2c000 and $2da0 samples are played with 672 CPU cycles per sample, giving an effective sampling rate of 5278Hz on a PAL system.
Seemingly due to a mistake when building the game, the sample data includes a VOC file header. This is played as samples, giving some noise in the output at the start of the sample. It also plays one byte too many, giving an extra click at the end of the sample.
The sample data seems to be somewhat processed, but mostly linear. It does not use the full range of output, so the result is rather quiet.
The sample data is in two parts. The first starts at $34000 and $811 samples are played, first with 624 cycles per sample, then 656, 688, 720; this corresponds to 5684Hz, 5407Hz, 5155Hz and 4926Hz respectively. Finally, the second part of the sample (starting at $34bf9 with $e62 samples) is played with 784 cycles per sample (4524Hz).
The sample data seems to have been processed quite differently to the "Welcome to Populous" sample: