* Fix slot persistence logic (AmpleWin/Linux) for upstream PR preparation. Implements robust None-aware slot initialization. * Fix: Explicitly pass empty string arguments for disabled slots (None) to prevent MAME using defaults * feat(core): update MAME to 0.288, fix compatibility bugs, add PowerBook fallbacks, and optimize download servers
12 KiB
Agent Task Audit Log - Ample Linux Port
📅 Session: 2026-06-05 (Session 6)
🎯 Objective: PowerBook Compatibility Fallback & Downloader Parity
Addressed upstream MAME 0.288 C++ late-binding bug causing crashes on EASC audio chip Macs, and aligned the fallback interface with AmpleWin.
✅ Key Achievements:
- Simplified Fallback Redirection:
- Aligned the crash warning interface with AmpleWin for affected PowerBooks (
macpb160etc.). - Added a "Download Fallback (v0.287)" button that redirects users to the official MAME SDL Supported Platforms Wiki to download older MAME releases for their specific Linux distribution.
- Maintains seamless redirection to
mame_0287ormame-vgmif already configured in the local directory.
- Aligned the crash warning interface with AmpleWin for affected PowerBooks (
- ROM Manager Priority Update:
- Reordered ROM download servers to prioritize
mdk.cab, solving missing ROM zip structure bugs (such asdragon32) when running on modern MAME 0.288+.
- Reordered ROM download servers to prioritize
- Downloader Optimization:
- Added
mirror.ghproxy.comproxy support to VGM Mod mirrors for accelerated downloads on Linux systems.
- Added
📅 Session: 2026-05-19 (Session 5)
🎯 Objective: Complete Slot Configuration Persistence (MAME Command Line)
Synchronized command line argument logic with AmpleWin to ensure "None" slots are explicitly disabled in MAME.
✅ Key Achievements:
- Command-Line Slot Persistence:
- Modified
build_argsinmame_launcher.pyto allow empty string values (e.g.option is not Noneinstead ofif option:). - This ensures that
-[slot_name] ""is explicitly passed on the command line, preventing MAME from falling back to its internal defaults.
- Modified
- Cross-Platform Parity: Ensured consistent behavior with Windows and Web ports.
📅 Session: 2026-05-11 (Session 4)
🎯 Objective: Slot Configuration Consistency Fix
Synchronized slot initialization logic with AmpleWin to fix "None" persistence issue.
✅ Key Achievements:
- "None-Aware" Slot Initialization:
- Applied the
slot_name not in self.current_slotsfix tomain.py.
- Applied the
- Cross-Platform Consistency: Ensured Linux port shares the improved slot behavior.
📅 Session: 2026-03-02 (Session 3)
🎯 Objective: Upstream Version Tracking & Documentation Maintenance
Focused on updating the Linux port documentation to track MAME 0.286 and simplifying maintainability.
✅ Key Achievements:
- Documentation Refactoring:
- Renamed version-specific screenshot files (e.g.
screenshot-v0.28x.pngtoscreenshot.png). - Updated
README.mdandREADME_tw.mdto use generic "latest version" terminology to prevent the need for manual text updates upon future Ample/MAME releases.
- Renamed version-specific screenshot files (e.g.
🚀 Current Project Status
The Linux Port documentation is updated for MAME 0.286 and future-proofed against minor version increments.
📅 Session: 2026-02-17 (Session 2)
🎯 Objective: Real-World Testing & Deployment Fix
Deployed the Linux Port to an actual Linux machine for testing. Identified and fixed a critical dependency installation issue.
✅ Key Achievements:
-
Launcher Script Fix (
AmpleLinux.sh):- Bug: Original script used
pip3/pipcommands directly, which don't exist on many modern Linux distros (Debian 12+, Ubuntu 23+, Fedora 38+ enforce PEP 668). - Fix v1: Changed to
python3 -m pip(the universally reliable pip invocation). - Fix v2: Added automatic
--break-system-packagesfallback for PEP 668-compliant systems. - Error Messages: Added distro-specific guidance (apt/dnf/pacman) and venv instructions in error output.
- Bug: Original script used
-
Git Workflow:
- Created
linuxbranch frommaster. - Pushed to
origin/linuxfor cross-machine testing.
- Created
🔍 Testing Observations (Real Linux Machine):
pip3command was not in PATH → first fallback triggered.python3 -m pipalso failed (PEP 668 system Python restriction) → second fallback triggered with--break-system-packages.- Conclusion: Many modern Linux distros require either system packages (
sudo apt install python3-pyside6 python3-requests) or a venv approach. The launcher script now documents both paths clearly.
⚠️ Known Issue - Pending Resolution:
- Systems without any pip module need manual package installation first. The script provides clear guidance but cannot auto-resolve this without
sudo. - Recommended solutions (in priority order):
- System packages:
sudo apt install python3-pyside6 python3-requests - Install pip:
sudo apt install python3-pip, then re-run script - Use venv:
python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt && python3 main.py
- System packages:
🚀 Current Project Status
Codebase is ported and pushed to linux branch. Launcher script has been hardened for modern Linux distros. Awaiting successful end-to-end test with dependencies installed.
📅 Session: 2026-02-16 (Session 1)
🎯 Objective: Linux Port Creation
Ported AmpleWin (Windows) to Linux, following the original author's suggestion (ksherlock/ample#45) that Linux support would be easy to add.
✅ Key Achievements:
-
Codebase Porting (from AmpleWin):
- Zero-Modification Files:
data_manager.py,rom_manager.py,mame_launcher.py,requirements.txt— copied directly, no changes needed. - Simplified
mame_downloader.py: RemovedMameDownloadWorkerentirely (Linux users install MAME via their package manager). KeptVgmModDownloadWorkerwith Linux adaptations (7z via PATH, no.exesuffix, helpfulp7zipinstall instructions). main.py(~20 changes): Comprehensive platform adaptation:- Replaced
winregtheme detection withgsettings(GNOME 42+color-scheme) and KDE (kdeglobals) dark mode detection. - Replaced all
os.startfile()calls withxdg-openvia a helper function_xdg_open(). - Removed all
.exesuffixes from MAME binary references (mame.exe→mame,mame-vgm.exe→mame-vgm). - Enhanced
check_for_mame()to search system paths (/usr/bin/mame,/usr/games/mame,/usr/local/bin/mame) and usewhich mame. - Replaced
Download MAMEbutton with package manager guidance text. - Updated
shlex.split()fromposix=False(Windows) toposix=True(Linux). - Updated file browser filter from
*.exetoAll Files (*). - Changed window title and help URL.
- Replaced
- Zero-Modification Files:
-
Launcher Script:
- Created
AmpleLinux.shas equivalent ofAmpleWin.bat. - Includes Python 3 detection, pip dependency installation, and helpful error messages with distro-specific commands.
- Created
-
Documentation:
- Created dual-language READMEs (
README.mdEnglish,README_tw.mdTraditional Chinese). - Includes installation guide for all major distros (Ubuntu, Fedora, Arch, Flatpak).
- Troubleshooting section for PySide6, MAME detection, and theme issues.
- Created dual-language READMEs (
🔍 Design Decisions:
-
Separate Directory (not shared codebase): Chose to create
AmpleLinux/as a separate directory rather than refactoringAmpleWin/into a shared codebase. This maintains the project convention where each platform gets its own additive subdirectory, minimizing risk to the stable Windows port. -
No MAME Auto-Download: Following the original author's guidance ("let the user download it themselves"), Linux users install MAME via their system package manager. This is the Linux cultural norm and avoids complex binary distribution issues.
-
GNOME + KDE Theme Detection: Implemented multi-strategy dark mode detection covering GNOME 42+
color-scheme, older GNOMEgtk-theme, and KDEkdeglobals, with Qt palette as ultimate fallback.
🚀 Current Project Status
The Linux Port is functionally complete. All Windows-specific code has been adapted, and the application should work on major Linux distributions with GNOME or KDE desktops.
Handover Notes for Future Agents
1. Platform Differences from AmpleWin
- No
winreg: Theme detection usesgsettingsand KDE config file parsing. - No
os.startfile(): Usesxdg-openvia the_xdg_open()helper function. - No
.exesuffixes: All binary references use bare names (mame,mame-vgm). - No MAME auto-download: Users install via package manager. Settings dialog shows guidance.
shlex.split(posix=True): Linux uses POSIX-mode shell parsing (no special Windows path handling).- MAME detection: Checks
PATHviawhich, plus standard Linux paths (/usr/bin,/usr/games,/usr/local/bin).
2. Deployment (CRITICAL)
- PEP 668 Era: Modern Linux distros (Debian 12+, Ubuntu 23.04+, Fedora 38+) block global pip installs. The launcher script handles this with
--break-system-packagesfallback. - Recommended Install Methods (in priority order):
- System packages:
sudo apt install python3-pyside6 python3-requests mame - venv:
python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt - pip with override:
python3 -m pip install -r requirements.txt --break-system-packages
- System packages:
- Never use
pip3orpipdirectly in scripts — always usepython3 -m pipfor reliability.
3. Known Mantras (inherited from AmpleWin)
- Visual Parity is King: Every margin, font size, and color was cross-referenced with macOS.
- Authorship: This Linux Port is based on the AmpleWin collaboration between anomixer and Antigravity.
📅 Session: 2026-02-17 (Session 2)
🎯 Objective: First-Run Experience, Build System & Polish
✅ Key Changes:
-
Launcher Architecture (
AmpleLinux.sh):- Refactored to venv: Switched from system-level
aptdependencies to a strictly isolatedpython3 -m venvapproach. - Automated Setup: Script now auto-creates
.venv, installspython3-venv(if missing), and pip installsrequirements.txt. - Distro Agnostic: Only depends on
python3-fullandlibxcb-cursor*(apt) for the base interpreter; all libraries (PySide6) are pulled via pip. - ALSA Fix: Added auto-detection of
/proc/asoundandusermod -a -G audiofix for permission issues.
- Refactored to venv: Switched from system-level
-
User Experience Enhancements (
main.py):- Ubuntu Snap Integration: If MAME is missing on Ubuntu, offers
sudo snap install mamewith a non-blockingQProgressDialog. - Configuration Fix:
ensure_mame_ininow runsmame -ccinsideAmpleLinux/mameto keep config portable. - Path Precision:
update_command_linenow resolves absolute paths for-inipathand-rompath(e.g.,/home/user/...). - BGFX Cleanup: Removed Windows-only Direct3D options.
- UI Polish: "Generate VGM" now shows a "Feature not implemented" popup.
- Ubuntu Snap Integration: If MAME is missing on Ubuntu, offers
-
Build System (New):
make_icon.py: Created Linux-specific icon generator (produces standard PNG sizes: 16x16 to 512x512).build_elf.sh: Created PyInstaller build script that uses a temporary venv to bypass PEP 668 restrictions and produce a standalone ELF binary indist/.
🔍 Technical Decisions:
- PySide6 via pip: Moved away from
python3-pyside2(apt) because the codebase is written for PySide6. Using venv + pip ensures version consistency and avoids the "externally-managed-environment" error on modern distros. - MAME Snap: For Ubuntu users, Snap is the most reliable way to get a recent MAME version without PPA complexity.