Skip to content

N64to3DS v0.2.0

Pre-release
Pre-release

Choose a tag to compare

@bukovinianforest bukovinianforest released this 29 Oct 23:51
· 3 commits to main since this release

Self-contained n64to3ds builds for Linux and Windows (x86_64). Download one
archive, extract it, and run n64to3ds build. No devkitPro, CMake, make or
Python install is needed.

Included: n64to3ds, CPython 3.12.11, devkitARM r66 (GCC 15.1.0), libctru,
picaGL, 3dstools 1.3.1, makerom 0.18.4 and the patched DaedalusX64 sources
(pinned commit 580c0c4 + patches/daedalus-n64to3ds.patch). No ROMs,
keys or firmware.

What's new in 0.2.0

Audio on Old 3DS. 0.1.0 builds stuttered because the guest's audio was tied
to how fast the emulated CPU reached each VI; at 54 VI/s Harvest Moon 64 made
10 % too little audio and the output ring ran dry about twelve times a second.
The runtime now:

  • paces the guest's VI interrupt in real time (one VI per TV frame whatever
    the emulation speed) and gives the guest an adaptive 20-100 % of the N64's
    cycles per VI, trimmed by up to 8 % from the audio ring level so that audio
    production settles on the DSP's consumption without changing pitch;
  • reports a graphics task rendering on core 1 as yielded when the guest asks
    for the SP (libultra restarts it; nothing is drawn twice), so NuSys-style
    audio managers run every retrace;
  • queues three buffers in the AI FIFO model instead of the hardware's one
    (safe: an AI_LEN write copies the samples out at once).

Measured on an Old 3DS in Harvest Moon 64's attract scenes (5 minutes each,
otherwise identical builds): ring underruns 746 → 10 per minute, 54 → 59.5
VI/s, audio frames 45 → 59.5 per second (22.7k → 31.8k of the 32k samples/s
the DSP plays). The cost is 25.4 → 22.8 presents per second: the audio HLE
now runs 60 instead of 45 times a second next to the display list on core 1.

Also new:

  • n64to3ds diag: line in sdmc:/3ds/DaedalusX64/daedalus.log every 900
    end-of-frame callbacks: presents/s, VI/s, guest cycles per VI line, ring
    trim, audio samples in/out per second, AI frames per second, ring underruns
    and minimum, AI-FULL skips, yields, core 0 wait times. scripts/triage_log.py
    reads it.
  • Unattended console runs: sdmc:/3ds/n64to3ds-agent/autoreturn holding a
    number of seconds makes the game quit after that long and return to the
    n64to3ds console agent (tools/console-agent, a development tool that
    installs CIAs and serves logs over Wi-Fi; not part of the generated CIAs).

Requirements

  • Linux: glibc 2.34+ (Ubuntu 22.04+, Debian 12+, Fedora 35+). Optional
    g++ for the AOT semantic self-test.
  • Windows: Windows 10/11 64-bit. Extract the zip to C:\ (or another
    short ASCII-only path). The AOT semantic self-test is skipped.
  • About 0.5 GB (Windows) / 0.7 GB (Linux) unpacked, plus about 200 MB
    temporary space per build. Every build compiles Daedalus for the ROM,
    which takes a few minutes.

Harvest Moon 64 example

tar -xJf n64to3ds-0.2.0-linux-x86_64.tar.xz
cd n64to3ds-0.2.0-linux-x86_64
./n64to3ds build "/path/to/Harvest Moon 64 (USA).z64" --output HM64.cia
cd C:\n64to3ds-0.2.0-windows-x86_64
.\n64to3ds.cmd build "D:\roms\Harvest Moon 64 (USA).z64" --output HM64.cia

Install HM64.cia with FBI. The Harvest Moon 64 (USA) build gets the
bottom-screen inventory/status extension automatically; --extensions off
disables it. See README.txt in the archive for all options.

What was checked for this release

  • Recorded build = CMake build. With Harvest Moon 64 (USA), all four
    variants (AOT on/off × bottom-screen extension on/off) produced a
    byte-identical ELF, 3DSX and CIA content through CMake and through the
    bundle's recorded build.
  • Linux archive: extracted into a clean directory; doctor PASS; Harvest
    Moon 64 (USA) built with the default options, verify PASS, and its 3DSX
    and CIA content are byte-identical to the CMake build from the source
    checkout.
  • Windows archive: assembled from the same recipe with the official
    Windows builds of devkitARM r66, 3dstools 1.3.1, makerom 0.18.4 and
    CPython 3.12.11. It has not been run on Windows yet.
  • Old 3DS: CIAs built from this source were run on an Old 3DS. Harvest
    Moon 64 (USA): attract scenes for 5 minutes, audio continuous (10 ring
    underruns/min, was 746), 22.8 presents/s, 59.5 VI/s; no gameplay session
    was measured. Mario Kart 64 (USA): attract mode for 3.5 minutes, 81 ring
    underruns/min (290 with the controller floor at 40 % of the N64's cycles
    per VI, which this release lowers to 20 %), 57 VI/s, 17.9 presents/s; races
    still stutter a little, since both cores are saturated there (core 0 waits
    for the audio thread 6-10 % of the time and for the display list 9-10 %).
  • Not tested in an emulator beyond boot checks.

A built CIA is not proof that a game is playable or runs at full speed on a
real Old 3DS.

Licenses

n64to3ds and DaedalusX64 are GPL; their sources are inside the archive and in
this repository. The bundled devkitPro, makerom, CPython, rabbitizer and
ipl3checksum binaries are unmodified upstream releases; licenses are in the
archive. devkitPro does not support this bundle, so please report problems
here.