[Core] fMSX fix build [WIP]#2372
Conversation
|
Builds for this Pull Request are available at |
f146bbb to
b0f22e1
Compare
|
Builds for this Pull Request are available at |
9c0bff5 to
2f6616d
Compare
|
@claude this PR may or may not be stale. Can you look into what's here and if it's worth updating and pursuing |
🤔 Working on RequestProgress
Started: 2026-03-07 01:21 UTC |
2f6616d to
5462a2d
Compare
fMSX PR Analysis & UpdateTL;DR: Worth pursuing — rebased and fixed the main video issue. What I FoundThe PR adds the fMSX libretro core (MSX/MSX2 emulation) with a solid foundation: Working:
Was broken (now fixed):
Still needs work:
What I Did
RecommendationYes, pursue this. MSX/MSX2 is a significant retro platform (Japan's dominant home computer 1983-1990s). The code is ~80% complete. Main remaining blocker is verifying it works after the submodule is initialized. The video fix should resolve the "wrong format" issue. Next steps:
|
Status Update from PR #2373 AnalysisAudited the What PR #2373 did for fMSX
The PR status noted: "Compiles, links, starts to open. Video and audio play. Broken! Video is wrong format" What's been done on develop since then
Current stateThe fMSX native (non-RetroArch) core is still in the same broken state — video format is wrong. The RetroArch-wrapped version may work through the CoresRetro path. The video format issueThe PR noted "wrong pixel size and/or format" — this is likely a mismatch between the pixel format fMSX renders in (possibly RGB565 or some palette-indexed format) vs what the
This may have been partially fixed by the GL pixel format pipeline improvements on develop ( RecommendationTest whether the RetroArch-wrapped fMSX works with the current develop. If it does, the native core work can be lower priority. If video format fixes landed on develop for the GL pipeline, it's worth retesting the native fMSX core. |
@claude make a new epic and or work tickets to finish this PR, tag this PR, we should also consider updating the base code |
|
@cursoragent @cursor i think we can finish this core and add it to the default build pretty easily. at least we can add it as disabled cores so i can test with "enabled unsupported cores" we're working on the gles libretro wrapper for 3d support in other tickets and PRs right now, not sure if fmsx uses the 3d or 2d pipeline we also added a bunch of new code for touch mouse, usb/bluetooth/smart keyboard mouse and keyboards and a virtual touch screen mouse and keyboard in #2575 which is mostly done, so we can add fmsx now since we have all the supporting features now i'm pretty sure. |
|
Here's a summary of what I found and what I did: fMSX uses the 2D software framebuffer pipeline -- it does NOT use GLES/3D hardware rendering. It sets Changes made:
The core is already wired into all build targets (Standard, Lite, XL) in the Xcode project. With |
|
🔨 PR is ready for review — dispatching full IPA build. Download links will appear here when ready (~5h). |
There was a problem hiding this comment.
Pull request overview
Adds the fMSX libretro core as a native Provenance core and wires it into the main app project.
Changes:
- Adds a new Swift
PVfMSXEmuCorewrapper and Core.plist plumbing for the fMSX core. - Updates Objective-C++ bridge code to integrate input (MSX buttons/keyboard/mouse) and BIOS file staging.
- Updates Xcode projects to build/link/embed the new PVfMSX and PVCoreBridgeRetro frameworks and bumps the fmsx-libretro submodule.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Provenance.xcodeproj/project.pbxproj | Links/embeds PVfMSX + PVCoreBridgeRetro into the app targets. |
| Cores/fmsx/fmsx-libretro | Advances the fmsx-libretro submodule SHA. |
| Cores/fmsx/PVfMSXCore/PVfMSXCore.swift | Adds Swift PVEmulatorCore subclass that delegates to the ObjC bridge. |
| Cores/fmsx/PVfMSXCore/PVfMSXCore.mm | Implements the libretro bridge behaviors (BIOS staging, options, input). |
| Cores/fmsx/PVfMSXCore/PVfMSXCore.h | Renames/extends the bridge interface and adopts keyboard/mouse protocols. |
| Cores/fmsx/PVfMSXCore/CorePlist.swift | Adds runtime loading for Core.plist (and typed access via SwiftGen). |
| Cores/fmsx/PVfMSXCore/CorePlist-Generated.swift | SwiftGen-generated typed constants for the core’s plist. |
| Cores/fmsx/PVfMSX/PVfMSX.h | Updates the umbrella header import to the renamed bridge header. |
| Cores/fmsx/PVfMSX/Core.plist | Updates the principal class and disables the core by default. |
| Cores/fmsx/PVfMSX.xcodeproj/project.pbxproj | Adds Swift sources/dependencies and updates platform/framework build settings. |
5f79b07 to
222a724
Compare
| B37022C82872553E00B3F6DA /* PVfMSXCoreBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = B37022C6287253B300B3F6DA /* PVfMSXCoreBridge.mm */; }; | ||
| B37022C92872554300B3F6DA /* PVfMSXCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVfMSXCoreBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; |
There was a problem hiding this comment.
The Xcode project now references PVfMSXCoreBridge.mm/.h, but the diff shows the implementation/header files committed under Cores/fmsx/PVfMSXCore/ are still named PVfMSXCore.mm/.h. This mismatch will prevent Xcode from locating/compiling the sources. Either rename the files on disk to match PVfMSXCoreBridge.* (preferred, given the class rename) or revert the pbxproj paths back to PVfMSXCore.*.
| B37022C82872553E00B3F6DA /* PVfMSXCoreBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = B37022C6287253B300B3F6DA /* PVfMSXCoreBridge.mm */; }; | |
| B37022C92872554300B3F6DA /* PVfMSXCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVfMSXCoreBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; | |
| B37022C82872553E00B3F6DA /* PVfMSXCore.mm in Sources */ = {isa = PBXBuildFile; fileRef = B37022C6287253B300B3F6DA /* PVfMSXCore.mm */; }; | |
| B37022C92872554300B3F6DA /* PVfMSXCore.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVfMSXCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; |
|
|
||
| @objc | ||
| @objcMembers | ||
| open class PVfMSXEmuCore: PVEmulatorCore { |
There was a problem hiding this comment.
The file is named PVfMSXCore.swift, but the header comment and the class name indicate PVfMSXEmuCore. Aligning the filename/header comment with the public class name (or vice versa) will make the module easier to navigate and reduces confusion when searching symbols.
| B3A9FA122D64443F00288D1E /* MoltenVKPackaging.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = MoltenVKPackaging.xcodeproj; sourceTree = "<group>"; }; | ||
| B3AD689A1D6EA6180021B949 /* PicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| B3AD724D2D246DC7001E5EC3 /* PVfMSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVfMSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| B3AD74442D24737B001E5EC3 /* PVfMSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVfMSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
There was a problem hiding this comment.
There are two separate PBXFileReference entries for the same built product PVfMSX.framework (both under BUILT_PRODUCTS_DIR) and both are added to the Frameworks group. This duplication makes it easier to accidentally link/embed the framework twice or update one reference but not the other. Prefer a single PBXFileReference for PVfMSX.framework shared across build phases/targets unless there’s a specific need for distinct products.
| B3AD74442D24737B001E5EC3 /* PVfMSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVfMSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
222a724 to
9125928
Compare
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
- Add keyboard support to PVfMSXCoreBridge via sendKeyboardEvent (matching DosBox pattern for GCKeyCode → HID USB key translation) - Add mouse support with position tracking and button state via setMousePosition/setLeftMouseButtonPressed/setRightMouseButtonPressed - Declare KeyboardResponder + MouseResponder protocol conformance in header - Mark core as PVDisabled=true so it appears only when 'unsupported cores' setting is enabled (ready for testing, not yet production-validated) - Update CorePlist-Generated.swift to pass disabled flag to EmulatorCoreInfoPlist - Remove hardcoded screenRect/bufferSize overrides; let base class PVLibRetroCoreBridge derive geometry from retro_get_system_av_info - Remove unused macOS OpenGL imports and OpenEmu define - Clean up Swift wrapper to call bridge methods directly instead of force-casting through protocol types - Import GameController framework for GCKeyCode/GCDeviceCursor types Co-authored-by: Joseph Mattiello <jmattiello+wayfair@wayfair.com>
The Cheats.storyboard was removed but its localized .strings files were left behind in ProvenanceTV/Story Boards/ and PVUI/Sources/PVUI_TV/Resources/StoryBoards/. Co-authored-by: Joseph Mattiello <jmattiello+wayfair@wayfair.com>
- Remove watchos from OpenGLES platformFilters (not available on watchOS) - Fix typo in CorePlist.swift error message - Replace force cast with guard/preconditionFailure in PVfMSXEmuCore init Co-authored-by: Joseph Mattiello <jmattiello+wayfair@wayfair.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
8af35db to
3f476a7
Compare
- Revert incorrect Copilot suggestion that renamed file references to PVfMSXCore.h/.mm — actual files on disk are PVfMSXCoreBridge.h/.mm - Fix orphaned Embed Frameworks phase: move PVfMSX + PVCoreBridgeRetro embed entries to Provenance-Lite's actual embed phase (B3FD9890) and remove the detached phase (B3AD7447) - Fix indentation in Provenance.xcodeproj (3 lines had wrong tab depth from auto-merge) - Fix OpenGL.framework to use SDKROOT instead of hardcoded MacOSX15.2.sdk path for cross-version Xcode compatibility - Fix stale PBXContainerItemProxy remoteInfo (dos-box → fMSX-libretro) Co-authored-by: Joseph Mattiello <jmattiello+wayfair@wayfair.com>
| B3AD74442D24737B001E5EC3 /* PVfMSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVfMSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| B3AD74482D2474F3001E5EC3 /* PVCoreBridgeRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVCoreBridgeRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| B3AEDE24293F34740050BDB6 /* PVProSystem.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVProSystem.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| B3AEDE27293F34B30050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| B3AEDE2A293F34CA0050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
There was a problem hiding this comment.
There are two distinct PBXFileReference entries for the same PVfMSX.framework built product. Duplicated file references commonly lead to accidental double-embedding, confusing target membership, and harder project maintenance. Consider keeping a single PVfMSX.framework reference and reusing it across build phases/targets (using platformFilters where needed).
| B3AD74442D24737B001E5EC3 /* PVfMSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVfMSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AD74482D2474F3001E5EC3 /* PVCoreBridgeRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVCoreBridgeRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE24293F34740050BDB6 /* PVProSystem.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVProSystem.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE27293F34B30050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE2A293F34CA0050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AD74482D2474F3001E5EC3 /* PVCoreBridgeRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVCoreBridgeRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE24293F34740050BDB6 /* PVProSystem.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVProSystem.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE27293F34B30050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE2A293F34CA0050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; | |
| B3AEDE2A293F34CA0050BDB6 /* PVPicoDrive.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPicoDrive.framework; sourceTree = BUILT_PRODUCTS_DIR; }; |
| open class PVfMSXEmuCore: PVEmulatorCore { | ||
|
|
||
| let _bridge: PVfMSXCoreBridge = .init() |
There was a problem hiding this comment.
The stored property name _bridge reads like a private backing ivar, but it’s a regular Swift property. Consider renaming to something clearer like coreBridge and making it private to avoid underscore-style naming and better communicate ownership versus the inherited bridge property.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>


What does this PR do
Adds fMSX libretro native core
Status