Git Product home page Git Product logo

picocart64's Introduction

PicoCart64

Nintendo 64 flash cart using a Raspberry Pi Pico / RP2040. So far, all of the work happens in the develop branch and is highly experimental. Follow kbeckmann on twitter to follow along while he's working on the project.

Join the Discord server to participate in the discussion and development of this project.

Join the Discord!

There are a few versions:

  • PicoCart64 v1 lite - The lite version using a Raspberry Pi Pico board capable of booting homebrew. This is the most user friendly option as of now.
  • PicoCart64 v1 - The stamp version using a RP2040 Stamp from Solder Party. This is used as an experimental development platform for the next-gen version.
  • PicoCart64 v2 - The next-gen version which has two RP2040 chips, on-board PSRAM chip supporting ROMs up to 64MB, a WiFi module and SD-card support. This is still heavy in development. Don't build this unless you want to develop it.

The following concerns PicoCart64 v1 lite, unless noted.

How to build a PicoCart64 v1 lite

Purchasing an unpopulated PCB

Note

PicoCart64 Lite v1.4 PCBs are now available for purchase from Solder Party's shop.

Getting the raw PCB

Check out the develop branch and navigate to hw/picocart64_v1_lite/. Compress the gerb_picocart64-lite_v1_3 to a .zip file.

Go to a PCB manufacturing service such as JLCPCB, OSH Park or similar.

This takes you to the PCB configuration utility where you can upload the .zip file you just created. After uploading, you should see a rendered version of both sides of the PCB. If you want to produce a cheap cart for testing you can leave all settings as they are, except for this one:

PCB Thickness needs to be set to 1.2mm, otherwise the cart won't fit in your console

❗ Note that this will result in a PCB with 90 degrees edges - the edge connector should be sanded down to get a nice 45 degree V shape. If this is not done, it may wear down your cart connector on the N64. The proper PCB order should be ENIG-RoHS + Gold Fingers + 45°finger chamfered, however this will result in a significant cost increase.

Sourcing the components

To build the v1 lite version, you need the following parts along with the PCBs. Here we're assuming you want to assemble 5 boards, as that is the number of PCBs you'll be getting from JLCPCB as a minimum.

Note that the Raspberry Pi Pico only has 2MB of flash, which limits the size of ROMs that can be used.

If you need more flash, you can order a Pico-compatible board with more flash. WeAct RP2040 16 MB can be bought from Aliexpress. Note that you need to bridge the solder bridge JP1 on the PicoCart 64 v1 lite board if using this.

Qty Name Source
2 Raspberry Pi Pico 3-pack 713-102110545
5 BSS84 MOSFET 750-BSS84-HF
5 0603 100k resistor 71-CRCW0603100KJNEAC

Assembling the board

Line up the Pico with the USB connector facing outwards and solder the pads.

Solder the MOSFET according to the pin markings.

The resistor is optional to solder, but was placed there for good measure. (There is a resistor on the Pico, so it is not strictly needed.)

Uploading firmware and a ROM

This website guides you through the steps to program the required firmware, as well as how to generate and program a ROM file to the PicoCart64 v1 lite.

Please note that this tool can generate programming files that are larger than 2MB, and will not fit in that case on the original Raspberry Pi Pico 2MB.

License

The PCB is licensed under the following license: "CERN Open Hardware Licence Version 2 - Permissive" aka "CERN-OHL-P".

The software is licensed under BSD-2-Clause unless otherwise specified.

picocart64's People

Contributors

jchillerup avatar kbeckmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

picocart64's Issues

Ignore PI accesses properly

Currently the code expects us to handle all PI read and write requests. If we don't, the state machine ends up in a bad state.

Example: User has a physical N64DD connected which will respond to certain memory accesses. If we also respond, there will be a bus conflict.

Solve this by e.g. resetting the state machine in the else case in the big while/if chain in n64_pi.c

How to test? Not sure, don't have a N64DD,

Implement and evaluate PSRAM QSPI controller

First, just implement something that can write and read the PSRAM.

Write test code that fills whole PSRAM with pseudo-random numbers, then verify.

Measure performance, latency.

Investigate how to tie it in to the n64 bus PIO.

Investigate Pin 44, /INT1

Can we use this to run arbitrary code from closed source ROMs without patching?

What do we need to patch in order to jump to our memory area?

Can we extract screenshots from the frame buffer directly?

Possible to debug?

Read/write memory, and continue?

Investigate booting flashless RP2040 from second RP2040 over SSI/XIP -> PIO

Investigate if it's possible and practical to let one RP2040 (pico1) boot from a second RP2040 (pico2) by connecting the Flash pins to the gpios of the second.

Might need to use PIO to emulate flash in the second RP2040.

Will probably need to lower the flash speed configuration

Implementation idea:

pico2 loads the image it wants to emulate into RAM first.
pico2 sets up PIO to quickly serve QSPI read requests.
Could borrow code/ideas from the PicoCart64 code.

Design SPI protocol between MCU1 and MCU2

In the v2 concepts we need pico1 (connected to the n64 bus) to load/send:

  • sram data
  • wifi data
  • sdcard data
  • debug data
  • etc...

via MCU2.

Start prototyping on a communication solution for this.

20240330 release doesn't work on PAL N64

Have two N64s: Europe/PAL model and Japan/NTSC model.

The Japan/NTSC model works great with picocart64-v1-ntsc.uf2. Testroom and any game I've flashed so far work fine. Have only a problem with 240pSuite-newer test suite that doesn't work.

The Europe/PAL version doesn't work at all with picocart64-v1-pal.uf2 + testrom (nothing on the screen). It works fine with PAL cartridges.

Implement trivial ROM compression

This is mostly useful for tiny homebrew ROMs, but might be useful for users who use the Pico which only has 2MB of flash.

Idea:

Python script that chops up the file into 4k blocks, generate a table that points to the right block, write the mapping in c code done

Look into Fast Loading

How fast can we go?

Once the ROM is in PSRAM, with our own probably faster QPI controller, we might have really low latency and might be able to go below 200ns on a constant basis.

Patch the PI configuration word to lower values.

Write a stress test ROM.

Update:

Not going for a custom QSPI controller. But by doing prefetching, data could be served quite fast.

A stress test ROM is still something we should do.

can't run testrom

Hi Sir

built one lite ,can boot to the menu but can't run testROM(there has one fail item)
image
pressed all button and no action
image

My step as below, please help me for improve it, many thanks Sir

  1. programmed picocart64-v1-ntsc.uf2
  2. Created testrom.uf2
  3. programmed testrom.uf2

USB Debug functionality

Curious.

Are there any plans to add the ability to stream data straight to the cartridge over the USB port while everything is plugged in and the console is running?

Would be a boon for homebrew devs looking for a cheap USB devcart.

Discord invite expired

Sorry for the silly issue but the discord invite link in the Readme is expired. Thanks! Great project here.

Implement SRAM save/load support

After #12 is done, look into how to backup the SRAM after the system has been running. Some solutions seem to trigger SRAM saving by holding the reset button on the N64 (N64_COLD_RESET is held low during this time I think).

Write code that saves the SRAM to external flash.

Write code that can load an initial SRAM image before booting the software.

For now, let's focus on using the external flash, and SDCard/WiFi later on. Let's worry about the trigger later (N64_CR or something else).

Support RTC

Do this after we have EEPROM support as it shares the same interface.

[Idea] What about using MCP23017?

I was thinking, right now we have only three free gpios remaining, which could be used for Savegames or for SD Card, but not both at the same time/cartridge, so, what about using a MCP23017 (GPIO expansion module) in not-crucial timing I/O?

For example (disclaimer: I'm not yet familiar with the code), it's obvious that we couldn't use it with AD* pins, but what about Cold Reset? Or maybe for CS pins on SPI modules)

It's just an idea btw, so don't take it as a solid solution

Implement dynamic CIC selection

Depending on the ROM, the appropriate CIC chip needs to be emulated, as well as the correct region.

  • Figure out the details around this
  • Can we detect the CIC chip required from the ROM data? Look at cen64 perhaps?
  • Adapt cic.c to handle dynamic selection during bootup
  • For now, scan the ROM data during boot (too slow perhaps?) or do it compile time (write a script generate header files for this?)
  • For later, use config area and set CIC emulation config through menu system

Support N64DD

This is a big task, might need to break it down. But the gist is, add support for N64DD.

First step is to implement the protocol, serve data from external flash for convenience.

Later we might want to stream the disk contents from the SDCard.

PicoCart64-lite v1: Add solder bridge jumper to support WeAct RP2040 pinout

The official Raspberry Pi Pico pinout has 3V3 on pin 36. 3V3_EN is on pin 37, and is connected to VSYS (5V/VUSB) through a 100K resistor.

On the WeAct RP2040 boards, Pin 36 is GPIO29, and 37 is 3V3. This means that the pins 36 and 37 need to be connected together. However, this must not be done on the official Pico boards.

Add a solder bridge jumper to do this easily, but add a clear warning/explanation so people don't bridge this by mistake.

Support GameShark cheats

I have no idea how this works but as long as it's rom patches and not ram patches it should be doable. We could patch the ROM while loading it into PSRAM.

Integrate FreeRTOS

We need an RTOS to run CIC emulation and EEPROM + FlashRAM emulation on the same core.

Investigate if there is a FreeRTOS port for RP2040 out there already, otherwise port it.

Implement and evaluate Pico<->Pico performance over QSPI

Since the Pico isn't an FPGA, it will be hard to latch data on a rising/falling edge of a clock, so we probably can't run it at system clock on the receiving side.

Investigate the limitations around this and what bandwidth we can reach using 4 data pins and 1 clock.

Implement basic SRAM support

Map the SRAM area to physical SRAM on the RP2040.

Allocate 128kB for now. We might be able to use 256kB if we write our firmware carefully.

Add support for flashing ROM separately with uf2 or picotool

Use case:

  • User downloads base firmware from github action artifact, flashes using UF2 mass storage
  • User compresses ROM with a tool (python or online javascript thing), flashes it using picotool or UF2 mass storage

Let's start with the picotool approach, then build a javascript online tool that generates a uf2 file with a compressed ROM.

Add Multiple License Files

Hello there! I noticed that this repo has two licenses on it. Not sure if you knew, but GitHub made it so that you can upload several license files and it will show them without issue on the right hand side. Here is an example from one of my repos (https://github.com/MasonStooksbury/Hex-Clock)

image



The badges you see in my README can be added using this text. (They double as links to the license text as well):

[![License: CERN-OHL-P-2.0](https://img.shields.io/badge/Hardware_License-CERN--OHL--P--2.0-blue)](https://opensource.org/license/cern-ohl-p/)

[![License: MIT](https://img.shields.io/badge/Software_License-MIT-red.svg)](https://opensource.org/licenses/MIT)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.