12

The Ricoh 2A03 (and the 2A07) is the CPU in the well-known Nintendo Entertainment System. Apparently, the die is very similar indeed, as the slides in this video suggest https://www.youtube.com/watch?v=fWqBmmPQP40&t=2735s

But the Ricoh 2A03 does not have a BCD mode. I heard they disabled it because of something to do with copyright or patent laws; is this true? Did they make any other changes?

  • I also read somewhere there was a patent on the "decimal adjust flag", but I can't give you details, and don't know how this is related to the Ricoh. But you need BCD mode for business calculations (no rounding), so it's certainly not needed in the Nintendo. Therefore another reason may have been to save transistors. – dirkt Apr 1 '17 at 7:57
  • I'd be really quite surprised if there was a patent issue on BCD mode. All it really does is add 6 to the nybble if the result of addition is greater than 9. – JeremyP Apr 3 '17 at 9:39
  • As it turns out, I am surprised. – JeremyP Apr 3 '17 at 9:41
  • @dirkt: Many games on other 6502 platforms BCD mode for score keeping, so it's hardly just for "business applications". On the other hand, the NES has enough memory that holding scores with one byte per digit and manually handling digit carry isn't overly expensive. The original 6502's decimal mode is actually pretty impressive since it's one of very few processors whose hardware can perform a BCD addition in a single cycle (the fastest ADC instruction takes two cycles, but since the addition can't happen until the operand is fetched, the BCD add is performed during the nest opcode fetch). – supercat Jul 2 '17 at 19:28
13

The Ricoh 2A03 (NTSC) and 2A07 (PAL) are best thought of as ASIC devices. They include a 6502-compatible CPU core, but these chips also include the NES's 5-voice Programmable Sound Generator. The inclusion of the PSG, plus other I/O interfaces for the NES, together resulted in 22 internal memory-mapped I/O ports that are on-chip. As you mentioned, the binary-coded decimal instructions were disabled too.

The BCD functionality of the 6502 was not useful for the NES, since there was no requirement to interface to a 7-segment display. The main reason for removing the functionality was probably to avoid any licensing or royalty issues related to U.S. Patent 3991307 held by MOS at the time.

The Ricoh 2A03/2A07 ASIC, together with the Ricoh Picture Processing Unit chip, comprise most of the necessary electronics for the NES by covering CPU, graphics display, controller inputs, and sound generation.

  • 3
    And why were the BCD instructions disabled? – Wilson Apr 1 '17 at 6:48
  • @Wilson Added info on MOS patent. – Brian H Apr 1 '17 at 12:19
  • 1
    The BCD functionality actually would have been very useful on the NES. NES games frequently displayed a score display, time remaining counter, etc., and hardware BCD support would have made them much faster and easier. Interestingly, the BCD hardware is still in the CPU, but the signal which enables it is cut off. – NobodyNada Apr 1 '17 at 19:10
  • 1
    @NobodyNada: It would have been convenient, but the lack of it is far less burdensome than it would be on e.g. the Atari 2600. The NES has a lot more CPU time available per frame than the 2600, and it has enough RAM to hold scores with one digit per byte. Games on the Atari 2600 frequently hold scores, times, etc. packed two digits per byte. While displaying a six-digit score will generally require having six two-byte pointers to the digit shapes, those pointers can be prepared in the scan lines immediately proceeding the score display; the 12 bytes can then be used for other purposes... – supercat Jul 2 '17 at 19:32
  • 1
    ...elsewhere in the code. Many games on the 2600 use up all 128 bytes of RAM, so being able to pack two digits per byte is very useful. The NES RAM isn't very big by today's standards, but it's big enough that spending an extra few bytes on scores, timers, etc. is no big deal. – supercat Jul 2 '17 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.