MCPcopy Index your code
hub / github.com/clktmr/n64

github.com/clktmr/n64 @v0.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.2 ↗ · + Follow
851 symbols 2,698 edges 108 files 283 documented · 33% 1 cross-repo links updated 1d ago★ 43
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go on Nintendo 64

Develop applications for the Nintendo 64 in pure Go. Builds upon embeddedgo, which adds a minimal rtos to the runtime via GOOS=noos.

Prerequisites

  • Go
  • Git
  • ares emulator (optional)

Getting Started

  1. Install the embeddedgo toolchain:
    go install github.com/embeddedgo/dl/go1.24.4-embedded@latest
    go1.24.4-embedded download
  1. Install n64go:
    go install github.com/clktmr/n64/tools/n64go@latest

This tool helps managing n64 file formats. It's also hooked into the go command via the -toolexec flag to provide generation of z64 and uf2 ROM files.

  1. Setup your build environment. Copy go.env from this repository to your desired location and make use of it:
    export GOENV="path/to/go.env"

Alternatively you can of course use your preferred way of managing environment variables.

You can now use go build and go run as usual! Try it with the minimal hello world example:

package main

import _ "github.com/clktmr/n64/machine"

func main() {
    println("hello world!")
}

Differences from mainline Go

machine

Your application needs to import github.com/clktmr/n64/machine at some point, which provides basic system setup. Otherwise your build will fail with a linker error.

fmt and log

Per default fmt.Print() and log.Print() write to os.Stdout, which isn't set after boot. Use embedded/rtos.Mount() and github.com/embeddedgo/fs/termfs to place an io.Writer at that location.

os and net

Having no operating system has obvious consequences for the os package. There are neither processes nor any network stack in the kernel. While os/exec is not supported, networking applications can run if an implementation of the Conn or Listener interface is passed to them.

embed

While embed can be used, it will load all embedded files into RAM at boot. As an alternative github.com/clktmr/n64/drivers/cartfs provides a fs.FS implementation to read embedded files from the cartridge via DMA instead.

testing

The go test command does currently not work reliably for several reasons:

  • The build might fail because of missing machine import
  • The tests might fail if they try to access testdata directory

This will probably be solved in the future. In the meantime fall back to providing a TestMain for each package that should run tests on the Nintendo 64. Package github.com/clktmr/n64/testing provides a reusable TestMain implementation for that purpose.

cgo

cgo is not supported!

Extension points exported contracts — how you extend this code

GlyphMap (Interface)
GlyphMap returns an image containing all glyphs of a [Subfont] and a rect describing subimage that represents the glyph. [2 …
fonts/face.go
Cached (Interface)
Cached is a datatype that provides cache operations. [1 implementers]
rcp/cpu/cache.go
Allocator (Interface)
(no doc) [2 implementers]
rcp/serial/joybus/commands.go
SystemWriter (FuncType)
SystemWriter is a function that implements the builtin print(). It can be passed to [embedded/rtos.SetSystemWriter].
drivers/drivers.go
Register32 (Interface)
(no doc)
rcp/mmio.go
Fixed (Interface)
(no doc)
rcp/fixed/fixed.go
Cart (Interface)
(no doc)
drivers/carts/carts.go
Paddable (Interface)
Only types with CacheLineSize%unsafe.Sizeof(T) == 0
rcp/cpu/cache.go

Core symbols most depended-on inside this repo

Store
called by 105
rcp/mmio.go
Bounds
called by 52
rcp/texture/image.go
Load
called by 43
rcp/mmio.go
Add
called by 35
rcp/fixed/fixed.go
Assert
called by 34
debug/assert_release.go
regs
called by 30
rcp/video/regs.go
PhysicalAddressSlice
called by 24
rcp/cpu/const.go
Close
called by 20
drivers/cartfs/file.go

Shape

Method 349
Function 324
Struct 102
TypeAlias 66
Interface 9
FuncType 1

Languages

Go100%

Modules by API surface

rcp/rdp/commands.go43 symbols
rcp/texture/image.go32 symbols
rcp/serial/joybus/commands.go30 symbols
rcp/texture/texture.go29 symbols
drivers/controller/pakfs/fs.go27 symbols
rcp/fixed/integer.go24 symbols
rcp/cpu/cache.go24 symbols
drivers/controller/pakfs/file.go23 symbols
drivers/rspq/mixer/mixer.go22 symbols
rcp/fixed/fixed.go18 symbols
drivers/cartfs/file.go18 symbols
rcp/rsp/regs.go17 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add n64 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact