Repository navigation
StarTropics native port 1.1.0
A native port of StarTropics (NES, 1990) for Windows, Linux, Steam Deck and Android, made by static recompilation: the game's 6502 code is translated to C and compiled. This repository contains no game code or data, and every build, the packages below included, runs only with a StarTropics (USA) .nes cartridge dump you supply; the graphics, music and data come from it. It has a launcher menu, save states, rewind, CRT shaders, a widescreen overworld decoded from your ROM, and RetroAchievements.
New in 1.1.0
- Two Android apps: pick the one for your device.
startropics-android-handheld.apkis for gaming handhelds with built-in controls (AYANEO, Retroid, AYN and the like).startropics-android-phone.apkis for phones and tablets: a translucent on-screen controller (d-pad, B, A, Select, Start, MENU) over the picture. It installs as its own app, "StarTropics Touch", and its controls step aside while a Bluetooth or USB controller is in use. - Integer scaling fills the screen. With a widescreen aspect in fullscreen, Integer keeps whole pixel multiples and fills the rest of the screen with more of the map, above, below and at the sides: all of the Steam Deck's 1280x800 at 3x, and any screen up to 32:9. The 16 lines the overworld leaves blank at the bottom show the map too.
- Villagers beyond the old edge. The game keeps every villager in memory but shows only those on its 256-pixel screen. The extra area now shows them where they stand, drawn with the game's own sprite rules, so they no longer pop in near the old screen edge.
Downloads
| file | for |
|---|---|
startropics-win64.zip |
Windows, 64-bit |
startropics-linux-x86_64.tar.gz |
Linux desktops with glibc 2.34 or newer |
startropics-steamdeck.tar.gz |
Steam Deck: unpack it in Desktop Mode, put your .nes in the folder and run python3 add-to-steam.py there (see STEAMDECK.txt) |
startropics-android-handheld.apk |
Android gaming handhelds with built-in controls (Android 7 or newer, arm64) |
startropics-android-phone.apk |
Android phones and tablets, with the on-screen controller (Android 7 or newer, arm64) |
Unpack the package (or install the APK) and choose your .nes file on the ROM tab, or put it next to the program. The port checks the file's hash and refuses anything that is not StarTropics (USA).
Lower latency than the original and than emulators
| average, button press to the reaction on screen | |
|---|---|
| NES on a CRT | ~50 ms |
| Mesen 2 or RetroArch, default settings | ~50 ms or more |
| this port, PC with a 60 Hz display | ~20 ms |
| this port, AYANEO Pocket EVO (Android, 120 Hz) | ~31 ms |
The game's own delay is gone. StarTropics reads the controller during vblank, acts on it in the next frame and shows the result a frame later: two frames (33 ms) of built-in lag. A real NES has it, and so do Mesen 2 and RetroArch at their defaults, which leave run-ahead off. The port runs two frames ahead: it emulates the real frame, emulates two more with the same input, shows that picture and restores the state. The reaction appears on the frame of the press, which the original hardware cannot do. A self-test checks that the timeline stays bit-identical.
The pad is read as late as possible. The loop waits until just before the display needs the next frame, then reads the pad, emulates and hands the frame over: about 3 ms from reading the pad to presenting on a PC, 5.4 ms on the Pocket EVO. An emulator with vsync on reads the pad, emulates, then waits for the display, up to a whole frame.
No frame waits in a queue. On Windows the loop is locked to the monitor's vertical blank with a one-frame swap chain. On Android each frame is locked to the compositor's own deadlines (Android 13 frame timelines), and the display runs at 120 Hz where it can: on the Pocket EVO a frame reaches the screen 12.9-13.7 ms after it is queued and stays there for exactly two refreshes. On Linux and the Steam Deck frames go out without vsync, as in Mesen's default, so the compositor always shows the newest one.
Sound follows closely. Dynamic rate control keeps the audio queue at 25-45 ms. Mesen's default audio latency is 60 ms, RetroArch's 64 ms (128 ms on Android).
With Mesen's run-ahead also set to 2, the port is about even when Mesen runs without vsync, and about 8 ms ahead on average when Mesen's vsync is on. The averages are built from the measured stages, not from a high-speed camera; docs/LATENCY.md has the breakdown and the sources for the emulator defaults.
Building from source
Put your StarTropics (USA) dump in rom/, then in an MSYS2 MinGW64 shell (Windows) or a Linux shell with SDL2:
make recomp # translates the ROM's code to C in generated/
make startropics # builds the game
Linux and Steam Deck packages are built with tools/linux/ (Docker), the Android APK with python android/build_apk.py; the README has the details.
StarTropics is a trademark of Nintendo. This is an unofficial fan project.