Designed by zwenergy, the PM2040 is first fully open sourced flash cart for the Pokémon mini, it uses the RP2040-Zero for a design that’s reasonable to build at home.
One of the notable advantages of this flash cart is the ease of changing its firmware, allowing for creative options like its Game Boy emulator.
The instructions for building your own are on its GitHub repo but are reproduced here:
For the standard 2 MiB version, the Cartucho by Timehero can be found on Wallapop.
The PMini is a 16 MiB version by Giltesa which can be found on his shop. This is also using the official form factor, so that it doesn’t extend out of the console.
First you need to create a firmware to flash. There are a few options for this:
Download the UF2 file this produces.
Remove your flash cart from the unit before flashing, or at least remove the battery.
Now hold down the BOOT button (FLASH on PMini) then connect the USB-C cable while keeping it held down. It will appear as a mass storage device (visible from My Computer on Windows), at this point you can release the button. Drag and drop the new UF2 onto the device.
Find the latest build of this firmware here. You can also use the dedicated patcher here.
In general, this firmware will allow the console to recover from sleep properly for games like Shock Tetris. If it doesn’t apply the sleep patches (this is an option in the firmware creators).
This firmware can contain a single ROM of a size of up to 1 MiB.
Power current consumption: ~140 mAh, ~100~120 mAh version
Find the latest build of this firmware here. You can also use the dedicated patcher here.
This firmware can contain up to 2 ROMs each being 512 KiB or less.
Find the latest build of this firmware here. You can also use the dedicated patcher here.
A special multirom firmware for the PMini and other 16 MiB PM2040s.
This firmware can contain up to 20 ROMs each being 512 KiB or less.
Find the latest build of this firmware here. Find prebuilts which include the EEPROM manager software already here.
This tool manages the entire EEPROM, not individual save slots. To manage individual save slots after backing up to your PC, use this tool by thx.
Find the latest build of this firmware here.
bios.minFind the latest build of this firmware here.
The emulation is done on the RP2040 while the Pokémon mini acts as a dummy terminal. The screen is scaled down to fit and the sound quality is reduced.
The rumble function of games with the MBC5 mapper are emulated using the rumble motor when using the rumble-enabled firmware. Save games are supported but not automatically stored to flash (see below). IR functions and link cable are not emulated and things like tilt sensor would not be possible.
A simple video player proof of concept. Find it here. Must be compiled from source in order to include the video data.
The standard firmware doesn’t provide a way to write to the flash cart, and you must write a custom firmware to do it.
The EEPROM manager and BIOS dumper are examples of firmware which enable this functionality.
For more information, see the interrupts page
A14 is hooked up to GPIO26 on the RP2040-Zero. To use it from firmware, your firmware will need to initialize this pin and set it as output; then it can write to it freely. By default, writing a 1 will trigger the IRQ in software. You will need to reset it to 0 manually, of course.
// main.c
// Pin Definitions.
// ...
#define CART_IRQ 26
void __not_in_flash_func( doPIOStuff() ) {
// ...
// Setup CART_IRQ pin
gpio_init( CART_IRQ );
gpio_set_dir( CART_IRQ, GPIO_OUT );
gpio_put( CART_IRQ, 0 );
}
void trigger_cart_irq() {
gpio_put( CART_IRQ, 1 );
sleep_ms( 1 );
gpio_put( CART_IRQ, 0 );
}
