Cores/hatari/HATARI_CORE_STATUS.md
Date: 2026-03-09 Issue: #2826 (Atari ST epic: #2822)
Two Hatari implementations exist in the Provenance codebase:
| Implementation | Core Identifier | Principal Class | Status |
|---|---|---|---|
| Native Hatari (PVHatari) | com.provenance.core.Hatari | PVHatari.PVHatariCore | Stub / incomplete |
| RetroArch Hatari | hatari.libretro.framework | PVRetroArch.PVRetroArchCoreCore | Active / functional |
Cores/hatari/)PVHatariCore/PVHatariCore.mm — Main implementationPVHatariCore/PVHatariCore.h — HeaderPVHatari/Core.plist — Core registrationcmake/Makefile — libretro-style build Makefilehatari/ — Git submodule (currently not checked out / empty)PVHatariCore.mm is essentially an empty shell. Every meaningful method is commented out:
loadFileAtPath:error: — commented outstartEmulation — commented outsetPauseEmulation: — commented outstopEmulation — commented outresetEmulation — commented out+Controls category)+Audio category)Only two methods are actually implemented:
frameInterval — returns the hardcoded value 13.63audioSampleRate — returns the hardcoded value 22255PVHatariCore.h declares PVHatariCore as a subclass of PVLibRetroCoreBridge (a RetroArch bridge base class), not as a standalone native emulator. This means the "native" core was actually intended to wrap the libretro Hatari core through the RetroArch bridge infrastructure — not to link directly against the upstream Hatari emulator library.
All instance variable declarations are commented out.
The git submodule at Cores/hatari/hatari/ (pointing to https://github.com/Provenance-Emu/hatari.git) is registered in .gitmodules but is not populated in the working tree. No upstream Hatari source code is present.
The cmake/Makefile is a libretro build Makefile intended to produce hatari_libretro_ios.dylib or hatari_libretro_tvos.dylib — it is not a direct build of the Hatari emulator for native use.
PVHatari/Core.plist registers the core with:
PVCoreIdentifier: com.provenance.core.HatariPVSupportedSystems: com.provenance.ataristPVProjectVersion: 0 (indicating unreleased/placeholder status)CoresRetro/RetroArch/)PVRetroArch/Core.plist — Core registration (includes Hatari entry)PVRetroArchCore/Core/PVRetroArchCore+RetroArchUI.m — Bridge with Hatari-specific setup logicscripts/urls.txt, scripts/urls-tv.txt, etc. — Download lists for prebuilt dylibshatari.cfg — Bundled Hatari configuration file (included in PVRetroArch.xcodeproj)The RetroArch Core.plist registers Hatari as:
PVCoreIdentifier: hatari.libretro.frameworkPVPrincipleClass: PVRetroArch.PVRetroArchCoreCorePVProjectName: Atari ST/STE/TT/Falcon (RetroArch)PVSupportedSystems: com.provenance.ataristPVProjectVersion: 1.8The prebuilt dylibs are downloaded by CI scripts:
hatari_libretro_ios.dylib (from libretro buildbot)hatari_libretro_tvos.dylib (from libretro buildbot)The hatari_libretro_ios.dylib is referenced in Provenance.xcodeproj/project.pbxproj and placed at CoresRetro/RetroArch/modules/hatari_libretro_ios.dylib.
PVRetroArchCore+RetroArchUI.m contains substantial Hatari-specific runtime logic:
atarist system or hatari core identifier; copies tos.img from the BIOS path to the RetroArch system directory. Includes byte-level verification and patching of TOS version/address fields.hatari.cfg with the live TOS image path and ROM directory path at runtime.systems.plist)The PVCoreLoader system definitions (PVCoreLoader/Sources/PVCoreLoader/Resources/systems.plist) define com.provenance.atarist with:
PVRequiresBIOS: truetos.img (TOS 1.02 US, MD5 c1c57ce48e8ee4135885cee9e63a68a2, 192 KB)st, mas, zip, stx, dim, ipfThe systems.plist does not hard-code a preferred core; the PVCoreLoader selects among registered cores at runtime. Both com.provenance.core.Hatari (native stub) and hatari.libretro.framework (RetroArch) register for com.provenance.atarist.
The RetroArch Hatari core (hatari.libretro.framework) is the active, functional path.
Reasons:
PVHatariCore is a stub with all emulation methods commented out; it cannot run games.PVHatariRetroArch.framework is linked in Provenance.xcodeproj (in the Provenance-XL and standard schemes), alongside the prebuilt hatari_libretro_ios.dylib.PVHatari.framework (native) is also referenced in the project, but given its stub state, the RetroArch variant would be preferred by the core loader if both are available.Continue with the RetroArch path (hatari.libretro.framework) for Atari ST support.
Rationale:
Work needed to make the RetroArch path fully functional:
tos.img BIOS distribution/licensing requirements for bundled copy.stx (Pasti) and .ipf (SPS/CAPSImg) format support (these require additional library support in the libretro build)Work needed to resurrect the native core (not recommended at this time):
Cores/hatari/hatari submodulePVHatariCore+Controls.mm, PVHatariCore+Audio.mm, PVHatariCore+Video.mmloadFileAtPath:, startEmulation, stopEmulation, resetEmulationcmake/ or replace with a direct Hatari library link| File | Role |
|---|---|
Cores/hatari/PVHatariCore/PVHatariCore.mm | Native core stub (non-functional) |
Cores/hatari/PVHatariCore/PVHatariCore.h | Native core header |
Cores/hatari/PVHatari/Core.plist | Native core registration |
Cores/hatari/cmake/Makefile | libretro build script for upstream Hatari |
CoresRetro/RetroArch/PVRetroArch/Core.plist | RetroArch core registration (includes Hatari) |
CoresRetro/RetroArch/PVRetroArchCore/Core/PVRetroArchCore+RetroArchUI.m | Hatari-specific RetroArch bridge logic |
CoresRetro/RetroArch/scripts/urls.txt | iOS libretro core download list (includes Hatari) |
CoresRetro/RetroArch/scripts/urls-tv.txt | tvOS libretro core download list (includes Hatari) |
PVCoreLoader/Sources/PVCoreLoader/Resources/systems.plist | System/BIOS definitions for Atari ST |