Skip to the content
2 layers93 × 58.4 mmV0b, the printed circuit board in 3D

A famicom discrete logic mapper

Size
93 × 58.4 mm
Copper layers
2
Thickness
1.2 mm
Parts
39
Nets
113
Pads
336
Tracks, vias
1,444, 208
Pours
2
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
7 Mar 2024
Updated
17 Jan 2026

Overview

V0b is an open-source printed circuit board by smaldragon, from the smaldragon/BNUY-ROM repository on GitHub, published under the Unlicense licence. It is a 2-layer board of 93 × 58.4 mm with 39 parts on 113 nets, routed with 1,444 tracks and 208 vias.

It is built around the SAM2695, 74HC191S and 74HC139D, with the 74HC174D and 74HC670P-E among its other parts. Its parts include 17 capacitors, 10 ICs, 4 resistors, 1 diode and 1 crystal.

Main components

5

README

README.md

BNUY-ROM

BNUY-ROM is an homebrew discrete logic mapper for the famicom/nes, which aims to have a similar level of capabilities to common ASIC mappers, while keeping a relatively low chip count. The mapper is designed to be modular, with features that can be included or ommitted depending on the needs of a game. It is similar to BNROM, hence the name.

Its capabilities are:

  • Rewritable PRG-FLASH, 32K Window:
    • 39SF0x0 - Up to 512 KiB
    • 29FxxxFT - Up to 2048KiB
  • 32KiB PRG-RAM, 8K Window
  • 8KiB, 32KiB or 128KiB of CHR-RAM, 4*2K Windows
  • Fixed 4-Screen Nametable Arrangement
  • Scanline IRQ, with MMC5-like timing

As an in-development mapper, there is currently no iNES number attributed, nor mainstream emulator support.

Render/schematic for the prototype tht version:

Banks

  • CPU $6000-$7FFF: 8KiB switchable PRG-RAM
  • CPU $8000-$FFFF: 32 KiB switchable PRG-FLASH
  • PPU $0000-$07FF: 2 KiB switchable CHR-RAM Bank
  • PPU $0800-$0FFF: 2 KiB switchable CHR-RAM Bank
  • PPU $1000-$17FF: 2 KiB switchable CHR-RAM Bank
  • PPU $1800-$1FFF: 2 KiB switchable CHR-RAM Bank

Registers

PRG Banking ($8000-$9FFF, write)

This register controls the banking of PRG Flash and Ram.

text
A~100x xxxx xxxx xxxx ($8000)
D~7654 3210
  ---------
  RRPP PPPP
  ||++-++++--- PRG-Flash Bank
  ++-----------PRG-Ram Bank

unused ($A000-$BFFF, write)

In previous iterations of the design, this area was used for a SAM2695 soundchip. It is now unused and avaliable for potential mapper additions.

IRQ Counter Load ($C000-$DFFF, write)

This register will load a value into a scanline counter, which decrements once per active scanline at ppu cycle 4. The counter will continuously trigger an IRQ whenever its value is 0.

There is no mechanism to stop the counter, and it will underflow to 255 if an interrupt is ignored for 1 scanline. To stop the generator from firing, a value of 255 should be written every nmi.

text
A~110x xxxx xxxx xxxx ($C000)
D~7654 3210
  ---------
  IIII IIII
  ++++-++++- 8-bit scanline counter value

Details

The 8-bit down counter is clocked by bit 2 of a prescaler counter, which increments on PPU reads with A13=1 and is cleared to zero on reads with A13=0. Normally one clock signal is generated by the prescaler per active scanline (including the pre-render scanline), but manual reads from PPU_DATA during VBlank or disabling rendering mid-frame will destabilize it. This can be overcome by reading once from A13=0 and twice from A13=1, followed by reloading the counter.

Overall the mechanism is similar to MMC5's scanline counter, but using relative values like the MMC3. Unlike the MMC3, this counter allows sprites to freely use either pattern table, including both while in 8x16 mode, and its timing simplifies scroll splits on consecutive scanlines.

It uses a x4520 to detect scanlines, and either a x40103 or two x191/x193s to hold the counter value.

CHR Banking ($E000-$FFFF, write)

If present, these registers select one of 16 2KiB CHR-RAM banks, to use for each of the 4 PPU pattern table windows.

In 8k/linear mode, the banking register is ommited. 16KiB of RAM are mapped to the PPU Address space, including 3840 bytes of "bonus ram" above the nametables, which the CPU may use to store values.

In 32K/shared mode, Banks 0 and 15 are shared with the 4 nametables, and should be avoided unless special care is taken. This leaves 14 banks that can be freely distributed across the 4 windows.

In 128K/independent mode, the register is still 4 bits wide, but now each window has their own unique set of 16 banks (by connecting the top 2 address lines of memory to ppu A11/A12), this effectively quadruples the amount of avaliable chr-ram without adding a second register chip to the board. The first 2 windows share banks 15 with the nametables

text
A~111x xxxx xxxx xx00 ($E000)
	CHR Window 0
A~111x xxxx xxxx xx01 ($E001)
	CHR Window 1
A~111x xxxx xxxx xx10 ($E002)
	CHR Window 2
A~111x xxxx xxxx xx11 ($E003)
	CHR Window 3

D~7654 3210
  ---------
  .... BBBB
       ++++- CHR Bank Select

This uses a single x670 4x4 register. A second register could be added to the design for an oversize variant of 512KiB (shared) or 2048KiB (independent). A design with CHR-ROM could be used instead, at the cost of losing 4-screen nametable arrangement.

Flash Programming

Flash programming is achieved by writing a specific sequence of command bytes to particular memory addresses, during this process flash memory cannot be read as normal, and conflicting mapper registers will have their values overwritten. As such, flash programming code must be run from the internal 2KiB console ram, and all interrupts must be disabled.

Flash writes operate by ANDing the written byte with the existing value in memory, with the only way to set a bit being by erasing an entire sector to $FF.

39SF commands listen to A0-14, which requires clobbering the IRQ Counter, while 29F commands listen only to A0-A11, allowing commands to fit in the unused $A000-$BFFF region.

For more information check the datasheet for your particular flash chip.

Write Byte

39SF0x0

text
A~$8000 D~BANK
A~$D555 D~$AA
A~$AAAA D~$55
A~$D555 D~$A0
A~ADDR  D~DATA

29FxxxFT

text
A~$8000 D~BANK
A~$AAAA D~$AA
A~$A555 D~$55
A~$AAAA D~$A0
A~ADDR  D~DATA

Erase Sector

39SF0x0

text
A~$8000 D~BANK
A~$D555 D~$AA
A~$AAAA D~$55
A~$D555 D~$80
A~$D555 D~$AA
A~$AAAA D~$55
A~ADDR  D~$30

39SF0x0 uses uniform sectors of 4KiB,

29FxxxFT

text
A~$8000 D~BANK
A~$AAAA D~$AA
A~$A555 D~$55
A~$AAAA D~$80
A~$AAAA D~$AA
A~$A555 D~$55
A~ADDR  D~$30

29FxxxFT uses sectors of varying sizes depending on bank:

  • Last Bank: 8KiB sectors at $8000-$9FFF, $A000-$BFFF, 16KiB sector at $C000-$FFFF
  • Second-to-Last Bank: Single 32KiB sector
  • All other banks: 64KiB sectors spanning 2 banks each.

Write/Erase End Detect

The end of a write or erase operation can be detected by reading any memory address in flash until the same value is returned twice (toggle bit method).

Software ID

Software ID mode can be entered to detect the manufacturer, size and type of flash chip, allowing for the same rom file to be compatible with multiple board configurations. Software ID is entered using the following command sequences:

39SF0x0

text
A~$8000 D~$00
A~$D555 D~$AA
A~$AAAA D~$55
A~$D555 D~$90

29FxxxFT

text
A~$8000 D~$00
A~$AAAA D~$AA
A~$A555 D~$55
A~$AAAA D~$90

Software ID mode is exited by writing $F0 anywhere in flash.

Device Code ($8001, read)

  • $B5 - 39SF010 (128KiB)
  • $B6 - 39SF020 (256KiB)
  • $B7 - 39SF040 (512KiB)
  • $51 - 29F200FT (256KiB)
  • $23 - 29F400FT (512KiB)
  • $D6 - 29F800FT (1024KiB)
  • $D2 - 29F160FT (2048KiB)

NES 2.0 Description (tentative)

Mapper ID: Unassigned

Flags 6 (nametable layout/flashing)

text
D~3210
  ----
  F0BM
  | |+-- Hard-Wired Arragement
  | |      0: Vertical / 4-screen
  | |      1: Horizontal
  | +--- Uses Flash Saves
  |        0: No
  |        1: Yes
  +----- 4-Screen Arrangement
           0: Hard-Wired (using CIRAM)
           1: 4-Screen (using CHR-RAM)

Most games will have %1010 here.

Flags 8 (submapper)

text
D~7654
  ----
  FICC
  ||++-- CHR Banking Mode
  ||        0: 8K/Linear (no banking)
  ||        1: 32K/Shared (all banks avaliable in every window)
  ||        2: 128K/Independent (all windows have unique sets of banks)
  |+---- Interrupt Generator
  |         0: No IRQ
  |         1: Has IRQ
  +----- Flash Memory Type
            0: 39SF0x0 (sizes of 128K, 256K, 512K)
            1: 29FxxxFT (sizes of 256K, 512K, 1024K, 2048K)

PRG-ROM, PRG-RAM and CHR-RAM size

Size should match the memory accessible on the board.

Parts

39
QtyValueFootprintReferences
8C_SmallCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC3, C4, C5, C6, C7, C8, C9, C16
374HC191PCM_Package_DIP_AKL:DIP-16_W7.62mm_LongPadsU4, U5, U6
3SolderJumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP2, JP3, JP4
210µFCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC11, C15
21µFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC1, C2
222pFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC13, C14
1100nFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC12
1100ΩPCM_Resistor_THT_AKL:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_VerticalR2
110ΩPCM_Resistor_THT_AKL:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_VerticalR3
112MCrystal:Crystal_HC49-4H_VerticalY1
11N4148Diode_THT:D_DO-34_SOD68_P2.54mm_Vertical_AnodeUpD1
11nFCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC17
11µFCapacitor_THT:CP_Radial_D4.0mm_P1.50mmC10
14.7KPCM_Resistor_THT_AKL:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_VerticalR4
147KΩPCM_Resistor_THT_AKL:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_VerticalR1
162256Package_DIP:DIP-28_W15.24mm_LongPadsU8
174HC139PCM_Package_DIP_AKL:DIP-16_W7.62mm_LongPadsU2
174HC174PCM_Package_DIP_AKL:DIP-16_W7.62mm_LongPadsU3
174HC670PCM_Package_DIP_AKL:DIP-16_W7.62mm_LongPadsU7
1Famicom_Cartridge_Edgefamicom:Famicom Cartridge Edge Connector (long legs)H1
1MCP1700Package_TO_SOT_THT:TO-92_InlineU10
1NOSAMJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP1
1R_Network04Resistor_THT:R_Array_SIP5RN1
1SAM2695Smal:QFN-48-1EP_6x6mm_P0.4mm_EP4.2x4.2mm_HANDU9
1SST39SF040PCM_Package_DIP_AKL:DIP-32_W15.24mm_LongPadsU1

More from smaldragon/BNUY-ROM

5
  • 2 layers90 × 56.8 mmV0c, the printed circuit board in 3D

    V0c

    smaldragon/BNUY-ROM

    A famicom discrete logic mapper

    37 parts3Unlicense
  • 2 layers93 × 56.4 mmV0a, the printed circuit board in 3D

    V0a

    smaldragon/BNUY-ROM

    A famicom discrete logic mapper

    34 parts3Unlicense
  • 2 layers93 × 63.8 mmV0d-512-proto, the printed circuit board in 3D

    V0d-512-proto

    smaldragon/BNUY-ROM

    A famicom discrete logic mapper

    32 parts3Unlicense
  • 2 layers90 × 56.8 mmV0d-2048-32, the printed circuit board in 3D

    V0d-2048-32

    smaldragon/BNUY-ROM

    A famicom discrete logic mapper

    24 parts3Unlicense
  • 2 layers90 × 56.8 mmV0c-512-proto, the printed circuit board in 3D

    V0c-512-proto

    smaldragon/BNUY-ROM

    A famicom discrete logic mapper

    16 parts3Unlicense

Similar boards

  • 2 layers78.7 × 70.5 mmSerialReceiver, the printed circuit board in 3D

    SerialReceiver

    zledtriac/74hc-uart

    An asynchronous serial transmitter and receiver with 74hcxxx ICs

    46 parts1MIT
  • 2 layers234 × 100 mmV2b, the printed circuit board in 3D

    V2b

    KITTY-6502/hardware

    the KITTY is a 65c02 homebrew kit microcomputer designed around text mode graphics and cartridge media. It is fully open source, and uses exclusively in-production parts.

    147 parts
  • 2 layers216 × 150 mmMotherboard-201, the printed circuit board in 3D

    Motherboard-201

    artemisamsx/artemisa

    Schematics, PCB designs and HDL simulations to build a 8-bits MSX computer

    106 parts67
  • 2 layers177.8 × 130.8 mmDurango, the printed circuit board in 3D

    Durango

    zuiko21/minimOS

    Scalable OS for 6502/65816

    159 parts23MIT
  • 2 layers41.9 × 87.6 mmNes Sound Expansion, the printed circuit board in 3D

    Nes Sound Expansion

    Perkka2/EPSM

    NES Expansion Port Sound Generator

    53 parts76
  • 2 layers99.9 × 99.9 mmEasy z80, the printed circuit board in 3D

    Easy z80

    skiselev/easy_z80

    An easy to build Zilog Z80 based single board computer

    61 parts180GPL-3.0
  • 2 layers208 × 110 mm8 16 computer 2, the printed circuit board in 3D

    8 16 computer 2

    halfburnttoast/TCPU816-v1

    Version 1.1 of my 8-bit, TTL computer.

    120 parts21
  • 2 layers100 × 63.5 mmESE2RAM Cartridge, the printed circuit board in 3D

    ESE2RAM Cartridge

    goriponsoft/ESE2RAM-Cartridge

    Implementation of ESE-RAM using only general-purpose logic ICs (naming: ESE-ESE-RAM/ESE2-RAM).

    29 parts8

Questions

How big is the V0b PCB?

It measures 93 × 58.4 mm and has 2 copper layers, 1.2 mm thick.

What parts does the V0b use?

39 parts, built around the SAM2695, 74HC191S, 74HC139D and 74HC174D. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the V0b KiCad files?

From the smaldragon/BNUY-ROM repository on GitHub, at the commit this page was made from: the board is KiCad/old/v0b/v0b.kicad_pcb and its schematic KiCad/old/v0a/v0a.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the V0b design in my own project?

Its repository publishes it under the Unlicense licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).