• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language SystemVerilog
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ultimate multigame cartridge for Nintendo Famicom

COOLGIRL - ultimate multigame cartridge for Famicom

The goal of the project is to create a open source Famicom cartridge that will not be too expensive and can contain up to ~700 games of various mappers.

It's inspired by ultra cheap "COOLBOY" multicarts but instead of using single mapper (MMC3) "COOLGIRL" uses EPM1270T144 CPLD chip to simulate many different mappers. Both PRG and CHR data stored on a single flash memory chip. Before game starts loader loads CHR data from flash to CHR RAM and sets PRG offset, banking modes, mapper code and other settings via registers. There is lockout register bit which prevents further writes.

Full characteristics:

  • PRG ROM: up to 128 MiB
  • CHR RAM: up to 512 KiB
  • PRG RAM: 32 KiB, non-volatile (FRAM) (optional)

How to build

Hardware

Bill of materials

BoM

Schematic

Schematic

The source file can be opened using the DipTrace.

Board

Board designed for order on jlcpcb.com.

image

  • Layers: 4
  • PCB Thickness: 1.2mm
  • Golden fingers highly recommended

The source file can be opened using the DipTrace.

Generated gerberes are located in the CoolGirl_rev6.x/hardware directory.

Firmware

EPM1270T144 CPLD firmware can be compiled using the Quartus 22.1. Open CoolGirl.qpf to configure and compile project.

All mappers can't fit into the CPLD at once, so you need to select required mappers in (config file)[CoolGirl_config.vh], so they can fit into 1270 macrocells. Also, you can set RESET_COMBINATION parameter to specify software reset button combination, it works on original consoles and some famiclones. Default combination is 8'b11010010 (Left+Start+A+B). Set it to 0 to disable and free some macrocells.

There are JTAG pads on the cartridge board to connect programmer (USB Blaster).

ROM preparing

You can use COOLGIRL Multirom Builder to combine multiple ROMs into one with menu and loader. ROM can be written to assembled cartridge using Famicom/NES Dumper/Writer. Non-soldered flash memory chip can be written using programmer.

Registers

Range: $5000-$5FFF

Mask: $5007

All registers are $00 on power-on and reset.

$5xx0

 7  bit  0
 ---- ----
 PPPP PPPP
 |||| ||||
 ++++-++++-- PRG base offset (A29-A22)

$5xx1

 7  bit  0
 ---- ----
 PPPP PPPP
 |||| ||||
 ++++-++++-- PRG base offset (A21-A14)

$5xx2

 7  bit  0
 ---- ----
 AMMM MMMM
 |||| ||||
 |+++-++++-- PRG mask (A20-A14, inverted+anded with PRG address)
 +---------- CHR mask (A18, inverted+anded with CHR address)

$5xx3

 7  bit  0
 ---- ----
 BBBC CCCC
 |||| ||||
 |||+-++++-- CHR bank A (bits 7-3)
 +++-------- PRG banking mode (see below)

$5xx4

 7  bit  0
 ---- ----
 DDDE EEEE
 |||| ||||
 |||+-++++-- CHR mask (A17-A13, inverted+anded with CHR address)
 +++-------- CHR banking mode (see below)

$5xx5

 7  bit  0
 ---- ----
 CDDE EEWW
 |||| ||||
 |||| ||++-- 8KiB WRAM page at $6000-$7FFF
 |+++-++---- PRG bank A (bits 5-1)
 +---------- CHR bank A (bit 8)

$5xx6

 7  bit  0
 ---- ----
 FFFM MMMM
 |||| ||||
 |||+ ++++-- Mapper code (bits 4-0, see below)
 +++-------- Flags 2-0, functionality depends on selected mapper

$5xx7

 7  bit  0
 ---- ----
 LMTR RSNO
 |||| |||+-- Enable WRAM (read and write) at $6000-$7FFF
 |||| ||+--- Allow writes to CHR RAM
 |||| |+---- Allow writes to flash chip
 |||+-+----- Mirroring (00=vertical, 01=horizontal, 10=1Sa, 11=1Sb)
 ||+-------- Enable four-screen mode
 |+-- ------ Mapper code (bit 5, see below)
 +---------- Lockout bit (prevent further writes to all registers)

Mapper codes

| Code   | iNES mapper number(s) and name(s)  | Flags meaning                         | Notes                                     |
| ====== + ================================== + ===================================== + ========================================= |
| 000000 | 0 (NROM) †                         |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000001 | 2 (UxROM) †                        | 0 - enable "Fire Hawk" mirroring for  | Mapper 2 is fully compartible with mapper |
|        | 71 (Codemasters) *                 |     mapper 71 (Codemasters)           | 71 but "Fire Hawk" only uses mirroring    |
|        | 30 (UNROM-512)                     | 1 - Enable one screen mirroring       | control. UNROM-512 self-writable feature  |
|        |                                    |     select for mapper 30 (UNROM-512)  | is not supported                          |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000010 | 3 (CNROM) †                        |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000011 | 78 (Irem) *                        |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000100 | 97 (Irem's TAM-S1)                 |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000101 | 93 (Sunsoft-2) *                   |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000110 | 163 (Nanjing)                      |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 000111 | 18 (Jaleco SS 88006)               |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001000 | 7 (AxROM) †                        | 0 - disable mirroring control, used   | Can be oversized to 512 KiB.              |
|        | 34 (BNROM, NINA-001) *             |     to select mapper 34 instead of 7  | iNES Mapper 034 is used to designate both |
|        |                                    |                                       | the BNROM and NINA-001 boards but only    |
|        |                                    |                                       | BNROM is supported                        |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001001 | 228 (Action 52)                    |                                       | Only Cheetahmen II is supported           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001010 | 11 (Color Dreams) *                |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001011 | 66 (GxROM) *                       |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001100 | 87 *                               |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001101 | 90 (J.Y. Company) *                |                                       | Partial support only, can be used for     |
|        |                                    |                                       | "Aladdin" and "Super Mario World" only.   |
|        |                                    |                                       | "Super Mario World" requires to enable    |
|        |                                    |                                       | accurate IRQs and multiplier (disabled by |
|        |                                    |                                       | default)                                  |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001110 | 65 (Irem's H3001) *                |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 001111 | 5 (MMC5) *                         |                                       | Experimental partically support, can be   |
|        |                                    |                                       | used for "Castlevania 3 (U)" only         |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010000 | 1 (MMC1) †                         | 0 - enable 16KiB of WRAM              |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010001 | 9 (MMC2) *                         |                                       |                                           |
|        | 10 (MMC4) *                        | 0 - 0=MMC2, 1=MMC4                    |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010010 | 70 *                               | 0 - 0=70, 1=152                       |                                           |
|        | 152 *                              |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010011 | 73 (VRC3)                          |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010100 | 4 (MMC3/MMC6) †                    | 0 - use mapper 118 (TxROM)            | Can be oversized up to 2 MiB              |
|        | 118 (TxROM) *                      | 1 - use mapper 189                    |                                           |
|        | 189 *                              | 2 - use mapper 206                    |                                           |
|        | 206 (Namco, Tengen, others)        |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010101 | 112                                |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010110 | 33 (Taito) *                       | 0 - 0=33, 1=48                        |                                           |
|        | 48 (Taito) *                       |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 010111 | 42 (FDS conversions) *             |                                       | Interrupts disabled by default            |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011000 | 21 (VRC2/VRC4) *                   | 2,0 - A0 and A1 lines configuration:  |                                           |
|        | 22 (VRC2/VRC4) *                   |     0,0 - like mapper 21              |                                           |
|        | 23 (VRC2/VRC4) *                   |     0,1 - like mapper 22              |                                           |
|        | 25 (VRC2/VRC4) *                   |     1,0 - like mapper 23              |                                           |
|        |                                    |     1,1 - like mapper 25              |                                           |
|        |                                    | 1 - divide CHR bank select by two     |                                           |
|        |                                    |     (VRC2a, mapper 22)                |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011001 | 69 (Sunsoft FME-7) *               |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011010 | 32 (IREM G-101) *                  |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011011 | 79 (NINA-03/06)                    |                                       |                                           |
|        | 146 (Sachen 3015)                  |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011100 | 133 (Sachen)                       |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011101 | 36 (TXC's PCB 01-22000-400)        |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011110 | Reserved                           |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 011111 | 184 (Sunsoft-1)                    |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 100000 | 38                                 |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 100001 | Reserved                           |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 100010 | 75 (VRC1)                          |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 100011 | 83                                 | 0 - DIP switch 0                      | Partial support, submapper 1 requires     |
|        |                                    | 1 - DIP switch 1                      | 512 KiB of CHR RAM                        |
|        |                                    | 2 - use submapper 1                   |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 100100 | 67 (Sunsoft-3)                     |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| 100101 | 89 (Sunsoft-2 on Sunsoft-3 PCB)    |                                       |                                           |
| ------ + ---------------------------------- + ------------------------------------- + ----------------------------------------- |
| ...... | Reserved                           |                                       |                                           |

† - very popular mappers, can't be disabled in config
* - enabled by default in config

PRG banking modes

| Code | $8000 | $A000 | $E000 | $C000 | Notes                                    |
| ==== + ===== + ===== + ===== + ===== + ======================================== |
| 000  |       A       |       C       | UxROM, MMC4, MMC1 mode #3, etc.          |
| ---- + ------------- + ------------- + ---------------------------------------- |
| 001  |       C       |       A       | Mapper 97 (TAM-S1)                       |
| ---- + ------------- + ------------- + ---------------------------------------- |
| 010  |           Reserved            |                                          |
| ---- + ----------------------------- + ---------------------------------------- |
| 011  |           Reserved            |                                          |
| ---- + ----- + ----- + ----- + ----- + ---------------------------------------- |
| 100  |   A   |   B   |   C   |   D   | Universal, used by MMC3 mode 0, etc.     |
| ---- + ----- + ----- + ----- + ----- + ---------------------------------------- |
| 101  |   C   |   B   |   A   |   D   | MMC3 mode 1                              |
| ---- + ----- + ----- + ----- + ----- + ---------------------------------------- |
| 110  |               B               | Mapper 163                               |
| ---- + ----------------------------- + ---------------------------------------- |
| 111  |               A               | AxROM, MMC1 modes 0/1, Color Dreams      |

Power-on/reset state: A=0, B=~2, C=~1, D=~0

CHR banking modes

| Code | $0000 | $0400 | $0800 | $0C00 | $1000 | $1400 | $1800 | $1C00 | Notes                                    |
| ==== + ===== + ===== + ===== + ===== + ===== + ===== + ===== + ===== + ======================================== |
| 000  |                               A                               | Used by many simple mappers              |
| ---- + ------------------------------------------------------------- + ---------------------------------------- |
| 001  |                          Spetial mode                         | Used by mapper 163                       |
| ---- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ---------------------------------------- |
| 010  |       A       |       C       |   E   |   F   |   G   |   H   | Used by MMC3 mode 0                      |
| ---- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ---------------------------------------- |
| 011  |   E   |   F   |   G   |   H   |       A       |       C       | Used by MMC3 mode 1                      |
| ---- + ----- + ----- + ----- + ----- + ------------- + ------------- + ---------------------------------------- |
| 100  |               A               |               E               | Used by MMC1                             |
| ---- + ----------------------------- + ------------- + ------------- + ---------------------------------------- |
| 101  |              A/B              |              E/F              | MMC2/MMC4, switched by tiles $FD or $FE  |
| ---- + ------- ----- + ------------- + ------------- + ------------- + ---------------------------------------- |
| 110  |       A       |       C       |       E       |       G       | Used by many complicated mappers         |
| ---- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ----- + ---------------------------------------- |
| 111  |   A   |   B   |   C   |   D   |   E   |  F    |   G   |   H   | Used by very complicated mappers         |

Power-on/reset state: A=0, B=1, C=2, D=3, E=4, F=5, G=6, H=7

Donate

More Repositories

1

hakchi2

Tool that allows you to add more games to your NES/SNES Classic Mini. WARNING: hakchi2 is no longer supported. Please use hakchi2 CE.
C#
2,926
star
2

retroarch-clover

GLSL
321
star
3

fdskey

Famicom Disk System drive emulator
C
187
star
4

ibutton

Эмулятор домофонных ключей iButton/Cyfral/Metacom
C
120
star
5

clunet

CLUNET library - simple single-wire peer-to-peer network driver for AVR microcontrollers, perfect way to interconnect microcontrollers in your house
C
112
star
6

sony-headphones-control

Tasker/Locale plugin to control bluetooth headphones from Sony
Java
108
star
7

AlwaysOnTopper

Simple app for Windows, adds 'Always on top' item to system menu of every window
C#
93
star
8

skykettle-ha

Redmond SkyKettle integration for Home Assistant
Python
90
star
9

google-assistant-smart-home

Simple Python framework to control your DIY smart home devices using Google Assistant
Python
78
star
10

coolgirl-multirom-builder

Toolset that allows you to create multirom images for COOLGIRL Famicom cartridges
C#
75
star
11

alice-smart-home

Simple Python framework to control your DIY smart home devices using Alice from Yandex
Python
64
star
12

famicom-dumper-client

Client (PC-software) for Famicom/NES Dumper/Programmer
C#
63
star
13

tuyanet

.NET library to interface with Tuya WiFi smart devices over LAN.
C#
59
star
14

wg-obfuscator

WireGuard obfuscator - simple obfuscator for WireGuard. Usefull if your ISP/government blocks WireGuard traffic.
C
59
star
15

famicom-dumper-writer

Device for dumping and writing Famicom cardridges
C
57
star
16

famicom-dumper

Famicom Dumper/Programmer (deprecated)
C
53
star
17

usb-serial-telnet-server

Android application that binds a USB serial converter to a Telnet client
Java
50
star
18

wii2usb

Device that allows to connect Wii accessories (Nunchuck, Classic Controller, NES/SNES Controller) to PC via USB
C
48
star
19

wear-os-hex-editor-watchface

Hex Editor Watch Face for Wear OS
Java
47
star
20

NesTiler

Tool for converting images into NES format: generating pattern tables, palettes, name tables
C#
35
star
21

nes_mappers

NES mappers
Verilog
33
star
22

nessmd2usb

Переходник для одновременного подключения к компьютеру по USB двух контроллеров от Dendy и двух от Sega Mega Drive
C
33
star
23

nes2wii

NES2Wii - adapter for NES/SNES/N64/SMD/DualShock gamepad to NES Mini, SNES Mini or Wii remote
C
32
star
24

coolboy-multirom-builder

Toolset that allows you to create multirom images for cheap COOLBOY Famicom cartridges
Assembly
32
star
25

omega2-pwm

Simple program to control hardware PWM on Omega2
C
23
star
26

ibutton_client

Клиент под Windows для эмулятора домофонных ключей
C#
23
star
27

clovershell-client

Client for hakchi mod which allows to access NES Mini's shell, execute commands and transfer files directly via USB, without UART and FEL.
C#
23
star
28

nes-warface

Warface demo for NES
Assembly
22
star
29

duplifds

Open source Famicom Disk System copier
Assembly
19
star
30

clujtag-avr

Simple JTAG programmer for AVR microcontrollers with hardware USB
C
19
star
31

clukeyboard

Android input method for hardware keyboards
Kotlin
18
star
32

omega2-ws2811-lkm

Linux kernel module for Onion Omega2 to control WS2811/WS2812 LEDs
C
17
star
33

clujtag-client

Client for JTAG programmer for AVR microcontrollers
C
14
star
34

intercom

Intercom with answering machine / Домофон с автоответчиком
C
14
star
35

android-speech-recognition

Continuous speech recognition for Android demo
Java
14
star
36

clunet-lkm

Linux Kernel Module driver for CLUNET bus
C
12
star
37

dreamcast2gamecube

Dreamcast to GameCube controller adaptor
C
11
star
38

nes-input-test

Simple NES/Famicom ROM to test different input accessories
Assembly
11
star
39

nes-containers

A simple .NET library for working with NES/Famicom containers: .nes (iNES, NES 2.0), .unf (UNIF) and .fds (Famicom Disk System images).
C#
11
star
40

gpio2nesc

Adapter allows to attach any DIY buttons to NES/SNES Classic, good for arcade cabinet
C
10
star
41

rc-transceiver

IR remote control receiver and transmitter based on Onion Omega2
C
10
star
42

clovershell-daemon

hakchi mod which allows to access NES Mini's shell, execute commands and transfer files directly via USB, without UART and FEL.
C
9
star
43

joycon

.NET library to access Nintendo Joy-Con (and Pro) controllers via bluetooth.
C#
5
star
44

AliceNet

.NET библиотека для лёгкого и быстрого создания навыков для Алисы от Яндекса.
C#
5
star
45

chatgptlib

Just another OpenAI client library (chat completion only) with functions support
C#
5
star
46

pebble-dembel

Pebble Watchface for russiam army
C
4
star
47

kindle-lightfix

Amazon Kindle Paperwhite patch. It allows user to turn off the frontlight completely.
Shell
4
star
48

sharp-dhcp-server-lib

DHCP server with option 82 support .NET library
C#
4
star
49

space-dragon

Space Dragon - simple game for Pebble watch
C
4
star
50

pebble-dos

"DOS" Watchface for Pebble Watch
C
3
star
51

snes2nes

SNES to NES adaptor
C
3
star
52

smpp-sharp-lib

SMPP client .NET library
C#
2
star
53

vpn-how-to

Максимально простые инструкции по созданию своего персонального VPN сервера
1
star
54

fdspacker

Simple tool to pack and unpack .fds files
C#
1
star