Skip to content

Oli97430/retroxr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ RetroXR

One front-end, every retro system, anywhere โ€” Quest 3, Android phone & tablet, Android TV

Status Platform libretro Languages License

A modern, lightweight retro front-end built around the libretro core ecosystem (Hatari, MAME, Snes9x, Genesis Plus GX, Mupen64Plus, Beetle PSX HW, โ€ฆ) with a Compose UI tuned for VR panel apps and classic 2D Android.


โš ๏ธ This is a work-in-progress. Most features below work โ€” some are fragile, a few are scaffolded only. Read the Status section before installing.

โœจ Features

๐Ÿ“š Library

  • ๐ŸŽฏ 107 systems / 200+ libretro cores catalogued (Atari ST, Amiga, MAME, C64, ZX Spectrum, NES, SNES, Mega Drive, PSX, N64, Saturn, Dreamcast, GBA, DS, PSP, 3DS, โ€ฆ)
  • ๐ŸŒ 8 languages (FR, EN, ES, DE, IT, PT, JA, ZH)
  • ๐Ÿ‘ค User profiles (per-profile saves, mappings, library)
  • ๐Ÿ–ผ๏ธ Cover scraper with cascade fallback (boxart โ†’ title screen โ†’ procedural placeholder), persistent miss cache
  • ๐Ÿ” Cross-system search + sort (alphabetical / recently played / favorites / most played / recently added)
  • ๐Ÿ“Œ Pin systems to top of home grid, hide unused ones
  • ๐Ÿ“Š Battery + Wi-Fi widgets in the home top bar
  • ๐Ÿค– Pixel-art mascot in the corner (taps cycle helpful tips)

๐Ÿš€ Game flow

  • ๐Ÿ“ฅ In-app Core Manager (downloads .so from libretro buildbot)
  • ๐Ÿ“ ROM scanner via Storage Access Framework with multi-disc auto-detection (PSX, Amiga, โ€ฆ)
  • ๐Ÿ’พ BIOS importer (file or folder picker) โ†’ files/system/
  • ๐Ÿ” Long-press game โ†’ Rename / Favorite / Delete
  • ๐ŸŽš๏ธ Per-game core override (persisted)
  • ๐Ÿ“ธ Screenshots gallery with full-screen preview, share, delete
  • ๐Ÿ›Œ Auto-resume: best-effort autosave on activity pause, prompt at relaunch
  • ๐Ÿ›ก๏ธ Onboarding wizard (Cores โ†’ Sources โ†’ BIOS) on first run

๐ŸŽฎ In-game

  • ๐Ÿ•น๏ธ Hardware controllers detected & classified (Quest Touch / Xbox / DualShock / DualSense / 8BitDo / Switch Pro)
  • ๐Ÿ” Hot-swap (plug/unplug live during play)
  • โŒจ๏ธ Per-controller remapping (vendor-product keyed, persistable JSON)
  • ๐Ÿ“ฑ Touch overlay (auto-shown when no physical controller)
  • โธ๏ธ In-game menu: Resume / Screenshot / Reset / Save states (8 slots with thumbnails) / Speed (ยผร—โ€“4ร— + frame advance) / Rewind (60-snap ring buffer) / Cheats (.cht import) / Disk control / Core options / Quit
  • ๐Ÿ“บ Aspect ratio: Fit / Fill / Stretch / 1ร— / 2ร— / 4:3 CRT (per-game, persisted)
  • ๐ŸŽจ Post-FX shaders (Compose-side): Off / Scanlines / Phosphor / Heavy CRT / Soft Glow
  • ๐Ÿ–ผ๏ธ Bezel overlay: None / CRT / Arcade cabinet / Handheld
  • โšก Performance overlay (FPS / frame ms / audio underruns)
  • ๐Ÿ”‰ Dedicated audio thread with ring buffer (no emu-loop stalls)
  • ๐Ÿฅฝ Auto-pause on activity pause / window focus loss

๐Ÿฅฝ XR / MR

  • โœ… Niveau 1 โ€” App is declared MR-aware (com.oculus.feature.PASSTHROUGH, environmentBlendMode=alpha_blend); Quest can render the 2D panel over your real space via the system passthrough.
  • โš ๏ธ Niveau 2 โ€” Native OpenXR session with XR_FB_passthrough + quad layer is integrated (animated test-pattern quad, real-room background). Whether Quest's compositor accepts the immersive transition depends on launch context (works best from Quest Library; Intent launch from a 2D activity may be paused). See cpp/openxr_session.cpp.

๐Ÿง  Tech

  • Kotlin + Jetpack Compose for UI
  • Native C++17 via NDK 27 with a custom libretro bridge (dlopen any .so, pixel-format conversion 0RGB1555 / RGB565 / XRGB8888, audio batch, input poll, retro_serialize โ†” ring buffer for rewind, save state thumbnails)
  • OpenGL ES 3 path for cores that request XR_HW_RENDER (Beetle PSX HW, Mupen64Plus, PPSSPP, Flycast)
  • OpenXR via Khronos loader (Maven org.khronos.openxr:openxr_loader_for_android) for the Niveau 2 immersive session
  • Room v4 DB (profiles, games, save states, cheats, controller mappings, cover misses)
  • Coil for cover loading with custom URL cascade

๐Ÿ“ฆ Install (sideload on Quest 3 / Quest 3s / Quest Pro)

  1. Enable Developer Mode in the Meta Horizon mobile app
  2. Connect your Quest via USB-C, accept the RSA prompt inside the headset
  3. Download the latest APK from the Releases page
  4. Install:
    adb install -r RetroXR-vX.Y.Z.apk
  5. Launch from Library โ†’ Unknown Sources โ†’ RetroXR

On Android phone, tablet, Android TV

Same APK. Sideload via adb install, or open the file in any file manager. The app declares category.LAUNCHER + LEANBACK_LAUNCHER so it appears in both the standard launcher grid and Android TV home rows.

๐Ÿ› ๏ธ Build from source

Requirements:

  • Android Studio Hedgehog (2023.1) or newer
  • Android SDK 34
  • NDK 27.2.12479018 (auto-installed by Gradle on first build)
  • CMake 3.22.1 (auto-installed)
  • JDK 17
git clone https://github.com/Oli97430/retroxr.git
cd retroxr
./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk

The first build downloads ~1.5 GB (NDK + CMake + Gradle + AGP + Compose). Subsequent builds are seconds.

๐Ÿงญ Status

Area State
2D galerie / library / search / sort / profiles โœ… Stable
ROM scanner (SAF) + multi-disc M3U โœ… Stable
Cover scraper + miss cache โœ… Stable
Atari ST emulation (Hatari) โœ… Verified end-to-end
In-game menu + save states + thumbnails + rewind + cheats + disk-control โœ… Code complete
HW context (Beetle PSX HW, Mupen64, PPSSPP) โš™๏ธ Code in place, needs in-headset testing
Per-controller remap UI โœ… Functional
Bezel / shaders / aspect ratio โœ… Functional
Audio dedicated thread + ring buffer โœ… Stable
Niveau 1 MR (passthrough panel) โœ… Manifest declared, Quest does the rest
Niveau 2 MR (immersive OpenXR + quad) ๐ŸŸก Integrated, fragile (Quest pauses occasionally โ€” depends on launch context)
AR Niveau 3 (3D arcade-cabinet scene) โŒ Not started
Netplay โŒ Not started
RetroAchievements โŒ Not started (local trophy stub only)
Cloud save sync โŒ Not started
CRT/HQ4x real GLSL shaders โŒ Compose-side approximations only

๐Ÿ—บ๏ธ Roadmap

Short term:

  • Connect HW core path (Beetle PSX HW) end-to-end with in-headset validation
  • Real shader chain (HQ4x, xBR) via GLSurfaceView
  • Save state import/export (SAF)
  • Cloud sync via Google Drive / WebDAV

Medium term:

  • RetroAchievements full integration
  • Netplay LAN p2p
  • Mixed-Reality Niveau 3 (3D cabinet over passthrough)
  • Vulkan path for Citra / Dolphin / PPSSPP

Production:

  • Tests (zero today)
  • Release build with R8 + signing
  • Crashlytics
  • GitHub Actions CI
  • F-Droid manifest

โš–๏ธ Legal & ROMs

RetroXR is a front-end. It distributes no ROMs and no BIOS files. Many systems require a BIOS that you must own and provide yourself (Atari ST / TOS, Amiga / Kickstart, PSX / scph...bin, Saturn / saturn_bios.bin, Neo Geo / neogeo.zip, etc.).

Where to find legal ROMs (homebrew / public domain)

The in-app "Where to find ROMs" section (globe ๐ŸŒ icon on the home screen) links to 12 curated legal sources: Internet Archive Software Library, Itch.io free games, PICO-8 BBS, TIC-80 Surf, ZXArt (Spectrum PD), CPCwiki PD, Pouรซt, Atari Mania PD, Macintosh Garden, Aminet, libretro thumbnails, etc.

Dumping ROMs you don't own is illegal in most countries. RetroXR will not help you do that.

๐Ÿ“‚ Project structure

RETRO XR VR/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ src/main/
โ”‚   โ”‚   โ”œโ”€โ”€ java/com/retroxr/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ MainActivity.kt           โ† Compose host, Idle tracker
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ catalog/              โ† 107 systems + brand colors + thumbnails folders + HW hints
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ db/                   โ† Room v4 (entities, daos, AutoMigration 3โ†’4)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ OnboardingPrefs.kt
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SystemPrefs.kt        โ† Pinned / hidden systems
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ GameMetadata.kt       โ† Offline metadata catalog
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ emulator/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ EmulatorActivity.kt   โ† run loop, lifecycle, HW/SW switching
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ LibretroCore.kt       โ† Kotlin facade over JNI
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ GLEmulatorView.kt     โ† HW path (GLSurfaceView)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ InGameMenu.kt
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ BezelOverlay.kt
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ CrtOverlay.kt
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AudioPump.kt          โ† dedicated thread + ring buffer
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ RewindBuffer.kt
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ AspectRatio.kt
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ โ€ฆ
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ input/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ControllerManager.kt  โ† detect + classify
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ControllerMapping.kt  โ† persistable JSON
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ LibretroButtons.kt
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ library/                  โ† RomScanner, BiosImporter, CheatParser
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cores/CoreManager.kt      โ† libretro buildbot downloader
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ui/                       โ† Compose screens, theme, components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ โ€ฆ
โ”‚   โ”‚   โ”œโ”€โ”€ cpp/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ libretro_bridge.cpp       โ† dlopen + JNI exports + frame conversion
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ libretro_callbacks.cpp    โ† env handler (~12 retro env opcodes)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ libretro_gl.cpp           โ† HW context, FBO, blit shader
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ openxr_session.cpp        โ† Niveau 2 immersive session
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ include/libretro.h        โ† subset header
โ”‚   โ”‚   โ”œโ”€โ”€ res/values{,-fr,-es,-de,-it,-pt,-ja,-zh}/strings.xml
โ”‚   โ”‚   โ””โ”€โ”€ AndroidManifest.xml
โ”‚   โ”œโ”€โ”€ build.gradle.kts                  โ† AGP 8.7, Kotlin 2.1, Compose BOM 2024.09
โ”‚   โ””โ”€โ”€ proguard-rules.pro
โ”œโ”€โ”€ gradle/libs.versions.toml
โ”œโ”€โ”€ settings.gradle.kts
โ””โ”€โ”€ README.md (this file)

๐Ÿค Contributing

The codebase is large (~12 k LOC Kotlin + ~2 k LOC C++) and evolving fast. If you find a bug or want a feature, open an issue. PRs welcome โ€” please keep the Compose-only style and avoid external network deps for core flows.

๐Ÿ“„ License

MIT โ€” do whatever you want, but don't bundle ROMs or BIOS files in any fork or distribution. Libretro cores are GPLv2/v3 (per core) and remain the property of their respective authors. RetroXR loads them at runtime, never relinks them.

๐Ÿ™ Credits & inspiration

  • libretro / RetroArch โ€” the cores that do all the actual emulation
  • libretro-thumbnails โ€” community-curated boxart database
  • Khronos OpenXR โ€” open standard for AR/VR
  • Bitmap Brothers, Core Design, Image Works, Activision-Irem, MichTron, Arcadia โ€” for the games used in dev fixtures
  • The Quest hardware team for the most ergonomic VR HMD on the market

๐ŸŽฎ Built with way too much coffee for a project that started as a 2-line ask.

About

Multi-system retro emulator front-end for Quest 3 / Android / Android TV. 200+ libretro cores, Compose UI, OpenXR Mixed Reality. Alpha.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors