This is for those who are interested from technical side.

Contents:
1. System18 sounds
2. PCM sound chip found on Dual-68000 boards
3. Tile masks used by Alien Syndrome
















1) System18 sounds

System18 games utilize two Yamaha YM3438 FM chips and one Ricoh RF5C68
PCM sound chip as the sound source. There is a Z80 located on the sound
subboard which controls those 3 chips. The YM3438 is a 6CH 4-OP FM chip,
which can be seen as two YM2203 without PSG channels. It is almost the same
with the YM2612 as used by SEGA Genesis, only PCM output resolution is
different(YM3438 is more accurate than YM2612, according to H. Shioya). But
System18 doesn't take use of YM3438 PCM channel, instead, a real PCM sound
chip is incoporated. This chip is OEM'd by Ricoh with 8 output channels. There
are 64KB of sound RAM dedicated to it, which is splitted to 16 4KB blocks
each channel has two. Before issueing key-on commands, the sound RAM should
be filled with 8-bit PCM samples, it's Z80 which does this job. If there
are more than 8KB of samples, Z80 should wait for one whole 4KB block to
get played, then it fills it with another chunk of samples.

In the emulation, exactly 4 YM2203's are allocated for T. Satoh FM emulator
to emulate the 2 YM3438 chips. For RF5C68, 8 SEAL wave channels are used
for the output. To prevent output aliasings, 2 kinds of sound samples are
used: the original samples and the pre-antialiased re-sampled 22K samples.
The kind of samples is selected by the indicated output frequency for each
key-on command.




2) PCM sound chip found on Dual-68000 boards

This is a 16 channel one. It doesn't have dedicated sound RAM. Z80 just
gives the starting/ending address of the samples in the ROM to the sound
chip. It's interesting to know how those many channels get used. In OUTRUN,
each channel has its pre-defined usage. 6 of them are allocated for drums.
The others are all for sound effects : 6 for engine sounds, 4 for general
sound effects. So why the engine buzzing needs 6 channels? Except for output
volume, OUTRUN also sets output panning settings of those channels differently
from each other to make the total ouput "thick". But in the emulation output
the thickness of output sounds cannot be re-produced because lacking of STEREO
output and timing differences. The same is for Super Hang-On. In Space Harrier,
sound channels are allocated at run-time. Whenever the Z80 needs to output
some PCM sounds, it tries to find out an unused channel, if found, it issues
the sound command immediately to that. If no free channel is found, the sound
code is dropped.

In the emulation, 16 SEAL wave channels are allocated for the output. The
pre-antialiasing technique used in RF5C68 emualtion is also utilized here.




3) Tile masks used by Alien Syndrome

First let me explain the problem. In the 0.79 version, if you move the player
to the left-down corner of Round 1, part of the player will be under the
floor. This is of course an error.
In the VDP emulation, the display priority of BG tiles and sprites is
determined by their own attribute bits. Every dots in one BG tile share the
same priority bits, the same is also for sprites. But in this case, it seems
that some dots in a BG tile use different priority value than other dots.

|\~~~~|   This is the problematic 8x8 BG tile. The priority from the attribute
| \ A |   bits is only correct for Part B. For Part A, some lower display
|  \  |   priority should be used instead. Or the player would be under Part A
| B \ |   because the display priority of the player sprite is set just below
|____\|   the value from this BG tile.

At first I guess that some colors of this tile should be of lower display
priority. The best case is that Part A is set to transparent color number:0.
But the fact is that all dots in Part A are of color 4. There is also one such
BG tile in Round 5. This time the problematic color number is 5. Those magical
numbers cannot be found from the attribute value. Even if they can be found,
the problem still exists because that color is used in Part B, too.

Therefore, some kind of bit mask attribute which separate Part A from Part B
must exist. I defined it in the GCS file because I cannot find it out from
memory. Maybe it's hard-wired in the VDP, who know? To support tile masks, BG0
should be rendered twice. The second time only those dots which are not masked
out by tile masks are drawed. Currently only Alien Syndrome takes use of this
function.

From what I'd known, Capcom CPS1 games use this function extensively. It's
very difficult to render CPS1 backgrounds correctly by emulation. I wonder
what technique Sardu had used to solve it for almost all CPS1 games are
rendered correctly by Callus.




092098,
Nao

