# Ocarina of Time — RG DS Plus experimental port Experimental native adaptation of [oot-miyoomini](https://github.com/cacuracaptors/oot-miyoomini) for the Anbernic RG DS Plus running BananaOS. ## RG DS Plus status - `main`: ARM32 game runtime with a NEON software renderer, 4:3 upper-screen DRM presentation and a native AArch64 speaker bridge. - [`experimental/arm64-rgds64`](https://github.com/Luiz-Wendland/oot-rgds-test/tree/experimental/arm64-rgds64): isolated ARM64 runtime work, including fixed-width command layouts, ELF64 relocation tooling and a ROM-free compile gate. Not a verified playable ARM64 build. - [RGDS64](https://github.com/Luiz-Wendland/rgds64): separate reusable GPU renderer project; capture replay and presentation diagnostics are not integrated gameplay. - The software port has been run on RG DS Plus; sustained 60 FPS and complete game compatibility have not been established. No public RG DS package is published here. [RG DS build and diagnostics guide](docs/RGDS-TEST.md) — requires your own USA Rev 1 (1.1) ROM. Do not redistribute ROM-derived executables, assets or memory captures. ## Upstream Miyoo documentation The following original documentation describes the Miyoo Mini Plus / OnionOS donor project, not confirmed RG DS features. For upstream releases use [oot-miyoomini releases](https://github.com/cacuracaptors/oot-miyoomini/releases). A native port of [**zeldaret/oot**](https://github.com/zeldaret/oot) - the Ocarina of Time decompilation - to the **Miyoo Mini Plus** handheld running **OnionOS**. The Miyoo Mini Plus has no 3D GPU, so this port draws the game with a software renderer written for it: NEON-accelerated and spread over both CPU cores, with a dynamic resolution up to the full 640x480 screen. It plays the **USA 1.1 (Rev A)** version of Ocarina of Time, built from your own ROM. **Languages:** English, Japanese, Spanish, Italian, Brazilian Portuguese, German and French (German and French come from your own European ROM; see [Languages](#languages)). Pick one in Menu+Start > General > Language. **[Download the upstream Miyoo release](https://github.com/cacuracaptors/oot-miyoomini/releases)** ## OnionOS Exclusive Features ### Graphics and performance - Native resolution with dynamic resolution (up to 640x480 on every device; on the Mini v4 and Mini Flip the 2D chip scales the picture up to their 752x560 screen): the 3D picture gets sharper or softer by itself to keep the game smooth, with a target frame time you can choose. It can go from 640 down to 320 pixels wide (as on the N64), but in practice it rarely drops much: on the Mini Plus (1800 MHz) it stays at or near the full 640 most of the time, and only goes down a little in the busiest areas, like Zora's Domain and Kakariko village. On the models limited to 1600 MHz (Mini, Mini v4, Mini Flip) it drops a little bit more often - 30 FPS: the game's 20 FPS are interpolated to 30 frames per second (in-between frames for everything that moves: actors, the camera, effects, scrolling textures, skinned models like Epona), with optional steps between 30 and 20 FPS in the heaviest scenes - A software renderer made for the Miyoo Mini Plus, using both CPU cores, with a smooth texture filter and color dithering - The HUD, the dialog boxes and the title logo are drawn by the chip's 2D engine at full 640x480 (sharp text) - Optional retro filter (CRT look): scanlines, or scanlines with an RGB mask, with adjustable strength; the game is then drawn at the N64's 320x240 (376x280 on the 752x560 screens), so every game line matches the filter's lines, and an optional CRT screen shape (curved edges, rounded corners, slightly darker border) - A new HD title logo - Adjustable brightness (gamma) without any cost: Select+Up/Down during the game - Screen contrast, hue and saturation in the options menu (Graphics), like Tweaks > Display in OnionOS, only while the game runs and without any cost - CPU clock picked by device (1800 MHz on the Mini Plus, 1600 MHz on the Mini, Mini v4 and Mini Flip), kept there during the game ### Controls - Real vibration (Rumble Pak), Stone of Agony included - A manual jump button, with an adjustable jump strength and an optional automatic jump at ledges - Smooth D-pad turning (Link turns in smooth curves, like with an analog stick) - Natural aiming (up looks up) and smooth aiming, for first person, the slingshot, the bow and the hookshot - Mid-air steering: the D-pad nudges Link's direction while jumping or falling (up to 45 degrees, not a full turn) - Sprint: keep holding A after a roll - Ocarina on the D-pad (C buttons) and the shoulder buttons (Z and R bend the note) - Select+Left/Right switches tunics and boots without opening the pause menu ### Languages - English, Japanese (the original Japanese text, which is also in the US cartridge) and Brazilian Portuguese (the Zelda 64 BR fan translation by Hyllian, Odin, Fserve and Solid_One, with translated graphics) - Italian (the Zelda 64 ITA fan translation by XXcentury) and Spanish (the fan translation by eduardo_a2j), both with translated graphics - German and French, taken from your own European ROM: put it in the game folder (zipped or not) and the game extracts them once - all the text, the item and place names, the area and boss title cards and the pause menu - The in-game options menu follows the chosen language (all seven) ### In-game options menu (Menu+Start) - Every option of the port, with a description of each, in tabs: Save, Load, General, Controls, Enhancements, Fixes, Cheats, Graphics - 10 save state slots with pictures, plus the quick state (Menu+R2 saves, Menu+L2 loads) - The game and the sound pause while the menu is open; options that need a restart ask before restarting, and the game goes on from where it was - Separate music and sound effect volume - Restore defaults, and quit with an autosave - Check for updates (General): looks for a new version of the port on GitHub, shows what's new, downloads it with a progress bar and installs it (Wi-Fi on in OnionOS). It also checks by itself once a day when the menu opens - Two color themes - Everything is also in `options.txt`, in the game folder ### Enhancements (from Ship of Harkinian, all optional and off by default) - **Speed-ups:** faster text (and hold B to fast-forward), Start skips cutscenes (not the ones where you learn a song), fast chests, fast ocarina playback, instant item putaway, faster heavy block lift, faster climbing, block pushing, crawling and King Zora, skip the breath animation, skip the save confirmation, faster pause menu, bottle emptying and rupee counter, faster Shadow Temple boat, skip pickup messages, skip Navi's and NPCs' forced talks, skip the warp song cutscenes, the castle stealth section, the tower escape and feeding Jabu-Jabu, instant scarecrow, faster Farore's Wind - **Quality of life:** remember the save location, item counters in messages (Gold Skulltulas, Pieces of Heart, Heart Containers), enemy health bar, no camera wiggle at low health, better owl, quit fishing at the door, the Zora's Domain waterfall opens once (or by itself), Biggoron's forge time, door chains on both sides, remember the minimap, dynamic wallet icon, visual Stone of Agony, time flows on the file select screen, no dropped ocarina notes, persistent masks, Deku Nuts explode bombs, no first-person bombchus, better bombchu shopping, skip the magic arrow animation, instant boomerang recall, better roll, better Farore's Wind, rebottle blue fire, still hearts, no area title cards, Dampé all night, night Gold Skulltulas by day, shops open all hours, leave the Market at night, arrow cycle (R1 while aiming), bow and slingshot reticle, green hookshot reticle on hookshotable surfaces, time travel with the Song of Time, warp songs from the pause menu, mask select, Majora's Mask Bunny Hood, ask to equip new items, minimal UI, low health beep on/off - **Minigames:** frogs' note timer, a customizable Lost Woods ocarina game, fishing (fish always bite, never escape, prize weights) - **Restorations:** red Ganon blood, pulsating boss icon, colored Temple of Time medallions ### Fixes (on by default) Gravedigging tour, raised floor switches, Zora hint dialogue, falling from vine edges, enemies near water, Deku Nut upgrade, broken Giant's Knife, camera drift, camera swing, camera hop when surfacing, ledge camera swing, pause menu L/R color, dungeon entrance icons, two-handed idle pose, Gerudo warrior clothes, Link's eyes while sleeping, silver rupee jingle, Darunia's dance speed, vanishing paths. ### Cheats (all off by default) Infinite money, health, ammo, magic, Nayru's Love and Epona boost, freeze the time of day, no item restrictions, no sandstorm, moon jump, bomb fuse and hookshot reach, no ReDead freeze, fireproof Deku Shield, unbreakable (and burning) Deku Sticks, hookshot everything, super tunic, shield with two-handed weapons, drops/fish/bugs never disappear, targetable Gold Skulltulas, Keese and Guay don't attack, Dampé always gives the best prize. ### OnionOS integration - Easy installation: copy your ROM (`.z64`, `.n64`, `.v64` or zipped) into the game folder; the game data is built from it on the first start, with a progress screen - Save states and the Game Switcher (with a picture of where you left off), the Menu key actions set in Tweaks, save on power-off with automatic resume - Autosave every few minutes (as "Save" in the pause menu) and when you quit - Full sound: the N64 music and sound effects, mixed in software ## Installation 1. Download the release zip and extract it to the root of your OnionOS SD card. This places the `ZeldaOoT` folder in `Roms/PORTS/Games/`, and the shortcut and its image in `Roms/PORTS/Shortcuts/` and `Roms/PORTS/Imgs/`. 2. You need your own legitimate copy of **The Legend of Zelda: Ocarina of Time (USA) (Rev A)** - the 1.1 version - as a ROM file. Copy it into `Roms/PORTS/Games/ZeldaOoT/`. Any of `.z64`, `.n64` or `.v64` works, also inside a `.zip`; the file name doesn't matter. 3. Optional, for German and French: also copy your **The Legend of Zelda: Ocarina of Time (Europe) (En,Fr,De) (Rev A)** ROM into the same folder. 4. On OnionOS, open **Zelda - Ocarina of Time** from the Ports list (use "Refresh roms" at the bottom of the list if it doesn't show up). The first start builds the game data from the ROM (`oot.cart`, about 73 MB). It takes a few minutes, shows a progress screen, and only happens once; then the European ROM, if it is there, gives the German and French files. After that the ROMs can be removed from the folder. Choose the language in Menu+Start > General > Language. When you update the port to a new version, just replace the files: the game data stays on the SD card. Since v1.0.6 the port can also update itself: Menu+Start > General > Check for updates (with Wi-Fi on in OnionOS). Save the game in the pause menu before installing: save states don't carry over to a new version. ## Controls | Button | Action | |---|---| | D-pad | Move (analog stick) | | A | A | | B | Jump (and B in menus and dialogs) | | Y | Sword (the N64's B) | | L2 / X / R2 | C-Left / C-Down / C-Right | | R2 (hold) | Walk slowly (a quick tap is still C-Right) | | Select (tap) | C-Up (first person, Navi) | | L1 | Z (target) | | R1 | R (shield) | | Start | Start | | Select+L1 | Minimap on/off (the N64's L) | | Select+Up / Select+Down | Brightness | | Select+Left / Select+Right | Switch tunic / boots | | Menu+Start | Options menu | | Menu+R2 / Menu+L2 | Save / load the quick state | | Menu | Game Switcher / back to OnionOS / previous game, as set in OnionOS Tweaks (the state is saved first) | Every button except Menu can be changed in Menu+Start > Controls, with one action for a quick tap and another for holding it (a quarter of a second or more, adjustable). A button with the same action for both works at once, like a normal button. "Default buttons" brings back the layout above. The Select+button shortcuts don't change. ### Playing the ocarina While the ocarina is out, the buttons change so that every note is easy to reach: | Button | Action | |---|---| | A | A note | | D-pad Up / Down / Left / Right | C-Up / C-Down / C-Left / C-Right notes | | L1 or L2 (hold with a note) | Z: the note goes a half step down | | R1 or R2 (hold with a note) | R: the note goes a half step up | | B or Start | Put the ocarina away | Link doesn't move while playing, and X, Y and a tap on Select do nothing. Select+D-pad keeps its usual functions (brightness, tunic and boots). ## Tips - If after changing a setting you notice stuttering or uneven frame pacing, lower the dynamic resolution target (Menu+Start > Graphics > Dynamic resolution target, 30 ms by default): the resolution then steps down a bit sooner and the game stays smooth. ## Known issues - A few cosmetic texts of the file select options screen stay in English with German/French (their size differs in the European version). - The game's log is in `log.txt`, in `Roms/PORTS/Games/ZeldaOoT/` - please attach it to your reports. ## Building from source This port cross-compiles for ARMv7 hard-float on Windows + WSL2, with the [union-miyoomini-toolchain](https://github.com/shauninman/union-miyoomini-toolchain) (the same glibc as OnionOS). 1. Build the [zeldaret/oot](https://github.com/zeldaret/oot) decompilation for `ntsc-1.1` with your own ROM, in `~/fallout-miyoo/oot`. 2. Copy the toolchain out of its Docker container to `~/fallout-miyoo/miyoomini-toolchain`. 3. `sh tools/oot-build.sh` - patches a copy of the decompilation (`tools/oot-patch.py`, `tools/oot-patch-soh.py`), compiles it with the port (`port/`, `platform/`) and links `~/fallout-miyoo/oot-arm/oot_headless`. 4. `sh tools/oot-release.sh 1.0.0` - the release zip, without any game data: the data that comes from the ROM is taken out of the executable and rebuilt on the device from the player's own cartridge file, following the recipe `oot_dados.rcp`, which holds no game data (`tools/oot-romdata.c`, `port/romdata.c`). ## Credits - Ocarina of Time decompilation by the zeldaret team - https://github.com/zeldaret/oot - Ship of Harkinian by HarbourMasters - https://github.com/HarbourMasters/Shipwright (the enhancements, fixes and cheats follow its code) - Zelda 64 BR (Brazilian Portuguese translation, v1.8) by Hyllian, Odin, Fserve and Solid_One, with graphics from Patcher64+ - Zelda 64 ITA (Italian translation, v1.00, 2001) by XXcentury, with Rulesless and Brisma; graphics from Patcher64+ (GhostlyDark) - Spanish translation (v2.2) by eduardo_a2j (Dorando project), as packaged by Patcher64+ (Admentus, GhostlyDark) - HD title logo: textures from Djipi's 3DS Experience, a texture pack for Ship of Harkinian, by Djipi - Audio microcode in C based on mupen64plus's HLE - Miyoo Mini toolchain by Shaun Inman - https://github.com/shauninman/union-miyoomini-toolchain - Options menu font: DejaVu Sans - https://dejavu-fonts.github.io - Root certificates for the update check (`cacert.pem`): Mozilla's CA bundle, as packaged by certifi - https://github.com/certifi/python-certifi - Original The Legend of Zelda: Ocarina of Time (1998) by Nintendo - Miyoo Mini Plus port by [cacuracaptors](https://github.com/cacuracaptors) ## License The code written for this port is under the MIT License (see `LICENSE`): the renderer (`port/gfx`), the Miyoo Mini video, input, sound output and menu (`port/miyoo`), the OS layer (`platform`), save states, frame interpolation, options, languages, the patch scripts' own code and the build and release tools (`tools`). These parts come from other projects and keep their own terms; they are not covered by the MIT License: - The Ocarina of Time decompilation (zeldaret/oot), which the build patches and compiles; it has no license of its own. The patches in `tools/oot-patch.py` change its files. - The enhancements, fixes and cheats that follow Ship of Harkinian's code (`tools/oot-patch-soh.py`) and the texture name table from Shipwright's asset maps (`tools/hd/ntsc11_texturas.tsv`). Shipwright has no license file; treat these as Ship of Harkinian's. - The audio and JPEG microcode in C (`port/audio/audio_hle.c`, `port/audio/audio_hle.h`, `port/jpeg_hle.c`), which follow mupen64plus's rsp-hle: GPL-2.0-or-later, like mupen64plus. - `port/inflate.c`, written after Mark Adler's puff.c (zlib license). - `dist/cacert.pem` (copied to the game folder), Mozilla's CA certificate bundle: MPL-2.0. - The menu and message fonts (`port/miyoo/font_menu.h`, `port/miyoo/font8x16.h`), rendered from DejaVu Sans (Bitstream Vera / DejaVu font license). - The fan translations (`idiomas/`) and the HD title logo textures (`texturas_hd.pak`, converted from Djipi's 3DS Experience texture pack for Ship of Harkinian), which belong to their authors (see Credits). The Legend of Zelda is a trademark of Nintendo; no game data is included - you need your own copy of the game. ## AI-Assisted Claude Opus 5.5 was used to write most of the code and to speed up debugging and optimization. Even though I'm no software engineer, I have a background in the modding community, so I understand how basic rendering tricks work. I don't write complex code myself (that's why I use Claude) but I understand how its logic works and what's going on most of the time, so I can control what Claude is doing more tightly.