AdventureVision APU

ADVENTUREVISION [WIKI]

APU (National Semiconductor COP411L)

COP411 is a low cost 4-bits microcontroller.
Clocking is divided by 4, four states per instruction clock.
In AdventureVision the CKI is connected to a RC circuit (Res 82K, Cap 56pF) which provides approximately 217.770 kHz with ~13% error, this gives about 54.442 kips

Chip specifications

  • Single-Chip N-Channel Microcontroller
  • Internal ROM: 512 x 8 (One-time programmable?)
  • Internal RAM: 32 x 4
  • 19 I/O lines:
    • Port L, 8-bits IO
    • Port G, 4-bits IO
    • Port D, 4-bits Output
  • All instructions are 1 or 2 cycles

AdventureVision interface

Port L
Lowest 4 pins are connected to the CPU Port 2 highest 4 bits.
It’s used for sound command transmission after reset.
The rest of the pins are left unconnected.

Port G
Lowest bit of Port G is connected to the audio output circuit, it has higher influence on output.
The rest of the pins are left unconnected.

Port D
Lowest bit of Port D is connected to the audio output circuit, it has lower influence on output.
The rest of the pins are left unconnected.

Reset
Connected to a circuit inside the video module, for more information check "Sound transmission".

Sound transmission
COP411 lacks interrupts support so one solution was to use reset signal in each time the game needs to send a sound command for playing sound effects.
Internal RAM is not cleared on reset, this is important for Command 0
The CPU will write $C0 into Port 2 and access external RAM with lowest data bit of 0 then 1 causing a reset into the chip.
CPU will delay and send the higher nibble first into Port 2 higher bits, delay some more and send the lower nibble into Port 2 higher bits.
Now the APU will process the command.

Sound commands
BIOS $1B can be used to transmit sound commands.
Highest nibble is the command, lower nibble is the data.
Transmitting a new command will cancel the sound that is currently being played, command 0 can be used for silence.
Tones are played with 2 segments but SFX are played with only 1.
The volume of each segment can be changed on command 0

Command 0
Control Register
Bit 0 control the looping: 0 will play once, 1 will play infinitely until another command is received.

Bit 2 Bit 1 1st Seg. Vol 2nd Seg. Vol
0 0 Low Low
0 1 High Low
1 0 High High
1 1 High High

Bit 3 control the delay of both segment: 0 plays slow, 1 plays fast

Command 1
Noise generator
Plays noise constantly.
Loop effect: Always on, ignores looping control.

Command 2
Slide high to low square-wave pitch
Pew Pew Pew! Commonly used when players shoot.

Command 3
Play noise in 5 different pitches
Simulates a loud big explosion.
Loop effect: Sound plays Command 2 when explosion finishes.

Command 4
Slide low to high square-wave pitch
Commonly used when player receive a reward.

Command 5
Slide low to high noise pitch and duration
Thrusters at maximum power, prepare for lift off!
Loop effect: At end, sound continue to play from the last pitch change.

Command 6
Slide high to low noise pitch and duration
Can either simulate a long lasting explosion or ship landing when used with command 5.
Loop effect: Always off, ignores looping control.

Command 7
Slide medium to low square-wave pitch
The enemy is shooting at us! Execute evasive maneuvers!

Command 8
Very quickly slide low to high square-wave pitch
Multiple purpose.
Loop effect: Hold on, someones ringing on the phone…

Command 9
Quickly slide low to high square-wave pitch
What kirby is going by jumping around inside AdventureVision!?
Loop effect: Someone set us up the alarm!

Commands A, B, C and D
Unknown
Sometimes it changes pitch, other times it clears the control, not much is known.

Command E and F
Tone playing
Plays square-wave with a specific note, due to very low accuracy of the APU clock the note will sound off-tone.

Value Note+Octave
0 A# 3
1 B 3
2 C 4
3 C# 4
4 D 4
5 D# 4
6 E 4
7 F 4
8 F# 4
9 G 4
10 G# 4
11 A 4
12 A# 4
13 B 4
14 C 5
15 C# 5