A Sharp X68000 computer emulator for macOS platforms, based on the px68k emulator core. This repository is indirectly a fork of Mr. Hissorii's px68k. Based on his source code, Goroman converted it for iOS, and I made it works on MacOS.
MPX68K provides authentic Sharp X68000 emulation with modern Swift UI frameworks, bridging low-level C emulation code with SpriteKit for an optimal user experience on both Apple Silicon and Intel Macs.
- X68000 Hardware Emulation: CPU, sound, graphics, and I/O
- M68000 CPU: Powered by C68K emulator core
- Adjustable Clock Speed: 1 / 10 / 16 / 24 (default) / 40 / 50 MHz
- FM Sound Synthesis: High-quality audio via fmgen (OPM + ADPCM)
- MIDI Output: External MIDI with configurable output delay and buffering
- Multiple Disk Formats: Floppy (.dim, .xdf, .d88, .hdm) and hard disk (.hdf, .hds)
- Dual FDD Drives: Independent management of Drive 0 and Drive 1
- SASI Hard Disk: Classic internal SASI HDD boot
- SCSI Hard Disk: External CZ-6BS1 compatible SCSI boot with runtime bus switching
- HDD Authoring: Create empty HDD images directly from the app (format with
FORMAT.Xunder Human68k) - Disk State Management: Auto-mount modes (Disabled / Restore Last Session / Smart Load / Manual) with save/restore and session info
- CRT Display Pipeline: Scanlines, bloom, vignette, noise, curvature, chromatic aberration, and persistence
- Presets: Off / Subtle / Standard / Enhanced
- Dedicated SwiftUI settings panel (⌘,)
- Screen Rotation: 90-degree rotation for vertical games (tate mode)
- Background Video Superimpose: Overlay a local video file or a YouTube URL as a luma-keyed background, with adjustable threshold / softness / intensity
- Keyboard & Mouse: Full macOS-native input with SCC compatibility mode for VS.X double-click reliability
- X68000 Mouse Capture: Toggle with ⇧⌘M, pointer warping disabled for clean capture behavior
- JoyportU Integration: ATARI-style joystick support with Notify / Command modes
- GameController Framework: External MFi / Xbox / PlayStation controllers
- Serial Communication: Mouse-only (default), PTY terminal access, TCP client, TCP server
- Machine Monitor Socket: Optional UNIX domain socket for programmatic emulator control (see below)
- Session State: Secure restorable state on macOS
- iCloud Document Sync: ROM and disk images sync across your devices
- macOS 12.0 (Monterey) or later
- Apple Silicon or Intel Mac
- Minimum 4GB RAM
- 1GB free disk space for ROM and disk images
MPX68K requires original SHARP X68000 system ROM files to function properly. These files are not included with the emulator and must be obtained separately.
You need the following ROM files from an original X68000 system:
| File | Description | Size | Required |
|---|---|---|---|
CGROM.DAT |
Character Generator ROM | 768KB | Yes |
IPLROM.DAT |
Initial Program Loader ROM | 128KB | Yes |
IPLROM0.DAT |
SASI-era IPL ROM (used when Storage Bus Mode = SASI) | 128KB | Optional |
SCSIEXROM.DAT |
External SCSI ROM (CZ-6BS1 compatible, used when Storage Bus Mode = SCSI) | 8KB | Optional (required for authentic SCSI boot) |
Note on SCSI ROM variants: Only the external SCSI ROM (
SCSIEXROM.DAT, "SCSIEX" type) is supported. The internal SCSI ROM (SCSIINROM.DAT, "SCSIIN" type) has an incompatible IOCS table layout and will not work.
Place the ROM files in the sandboxed Documents folder:
~/Library/Containers/NANKIN.X68000/Data/Documents/X68000/
├── README.txt (auto-generated on first launch)
├── CGROM.DAT (required)
├── IPLROM.DAT (required)
├── IPLROM0.DAT (optional — SASI IPL)
└── SCSIEXROM.DAT (optional — external SCSI ROM)
- Legal Notice: ROM files are copyrighted by SHARP CORPORATION. You must own an original X68000 system to legally use these files.
- File Names: ROM file names are matched exactly as shown above (case-sensitive on some file systems).
- File Integrity: Ensure ROM files are not corrupted. The emulator will display an error if required files are missing or invalid.
- Backup: Always keep backup copies of your ROM files in a safe location.
When ROM files are properly installed, the emulator will:
- Load without ROM-related error messages
- Display the characteristic X68000 boot screen
- Show proper Japanese character rendering
If you see garbled text or boot failures, verify that your ROM files are correctly placed and named.
You need Apple Developer Account for using XCode and certification.
-
Clone the repository:
git clone https://github.com/YosAwed/MPX68K.git cd MPX68K -
Open in Xcode:
open X68000.xcodeproj
-
Build the project:
- Select your target platform (macOS)
- Build and run (⌘+R)
The project includes a dependency on the c68k CPU emulator which is built automatically.
- Open Drive 0… / Open Drive 1…: Insert a floppy image
- Eject Drive 0 / Eject Drive 1: Eject the inserted floppy
- Open Hard Disk… / Eject Hard Disk: Mount or eject an HDD image
- Create Empty HDD…: Generate a new empty
.hdfimage (format later withFORMAT.Xunder Human68k) - Save HDD (⌘S): Persist the current HDD state
- Storage Bus Mode → SASI / SCSI: Switch the hard disk bus at runtime
- SCSI Devices → Open SCSI (ID 0)… / Eject SCSI (ID 0): Manage the external SCSI device
- 1 / 10 / 16 / 24 (Default) / 40 / 50 MHz (keys 1-6): Change CPU clock speed
- Rotate Screen (⌘R): Toggle between landscape and portrait
- Landscape Mode / Portrait Mode: Set orientation directly
- CRT Settings… (⌘,): Open the SwiftUI CRT configuration panel
- CRT Display Mode → Off / Subtle / Standard / Enhanced: Quick CRT preset selection
- Background Video → Set Video File… / Set YouTube URL…: Pick a background source
- Background Video → Superimpose: Toggle luma-key overlay on/off
- Background Video → Threshold / Softness / Intensity: Fine-tune the luma key
- Reset System: Hard-reset the emulator
- Use X68000 Mouse (⇧⌘M): Toggle X68000 mouse capture
- Toggle Input Mode: Switch between input modes
- MIDI Output Delay…: Configure MIDI output delay
- Delete IPLROM.DAT…: Remove a cached IPL ROM
- Serial Communication → Mouse Only / PTY / TCP Connection… / TCP Server… / Disconnect: Select serial backend
- Serial Communication → Original Mouse SCC (Compat): Enable SCC compatibility mode for VS.X double-click
- Disk State Management → Auto-Mount Mode: Disabled / Restore Last Session / Smart Load / Manual Selection
- Disk State Management → Save Current State / Clear Saved State / Show State Information
- JoyportU Settings → Disabled / Notify Mode / Command Mode
- Arrow Keys or WASD: 8-direction movement
- Space or J: Button A
- Z or K: Button B
The Machine Monitor socket exposes the emulator's internal state over a UNIX domain socket at /tmp/mpx68k_monitor.sock, allowing external tools (scripts, test harnesses, debuggers) to pause/resume emulation, read and write memory, inspect CPU registers, and hot-swap disk images — all without using the GUI.
The socket is disabled by default. To enable it, set the monitorSocketEnabled user default before launching the app:
defaults write NANKIN.X68000 monitorSocketEnabled -bool YESTo disable it again:
defaults delete NANKIN.X68000 monitorSocketEnabledWhen enabled, the socket is created at launch and removed on quit. A log line confirms the path:
[MPX68K] Machine Monitor socket: /tmp/mpx68k_monitor.sock
The protocol is line-oriented UTF-8 over a streaming UNIX socket. Each request is one \n-terminated line; each response ends with OK on success or ERROR <message> on failure.
| Command | Description |
|---|---|
PAUSE |
Pause emulation (required before writes) |
RESUME |
Resume emulation |
STATUS |
Returns PAUSED or RUNNING |
REGS |
Dump D0–D7, A0–A7, PC, SR (hex) |
READ <addr> <n> |
Hex-dump n bytes starting at addr |
READB/READW/READD <addr> |
Read byte / 16-bit word / 32-bit dword |
WRITE <addr> <b0> [b1…] |
Write bytes (requires PAUSE) |
WRITEW/WRITED <addr> <val> |
Write word / dword (requires PAUSE) |
HW [section] |
Hardware state snapshot |
MOUNTFDD <drive> <path> |
Hot-swap a disk image into FDD 0 or 1 |
EJECTFDD <drive> |
Eject image from FDD 0 or 1 |
QUIT |
Close connection |
All addresses and values are hexadecimal. A simple session:
$ nc -U /tmp/mpx68k_monitor.sock
PAUSE
OK
READD 00ed0018
00000080
OK
RESUME
OK
QUIT
OKMultiple concurrent clients are supported. Memory reads are allowed at any time; writes require PAUSE first to avoid data races.
MOUNTFDD and EJECTFDD let scripts swap floppy images into either drive without touching the GUI — useful for automating multi-disk games or running test suites that need different disk images across test cases. The drive number is 0 or 1; the path is an absolute path to any disk image format supported by the emulator (.dim, .xdf, .d88, .hdm):
MOUNTFDD 0 /Users/you/Documents/X68000/disk1.xdf
OK
EJECTFDD 0
OK
The socket server is compiled into X68000 Shared/px68k/x11/winx68k.cpp, which is already part of the "X68000 macOS" target. No additional build steps are required — just build the project normally after enabling the feature via defaults write.
| Extension | Description | Type | Notes |
|---|---|---|---|
.dim |
Standard disk image | Floppy | Most common X68000 format |
.xdf |
Extended disk format | Floppy | Extended capacity |
.d88 |
D88 disk image | Floppy | Common retro-emulator format |
.hdm |
Human68k disk image | Floppy | Legacy Human68k format |
.hdf |
Generic hard disk image | Hard Disk | SASI / generic HDD |
.hds |
SCSI hard disk image | Hard Disk | SCSI HDD — auto-switches Storage Bus Mode to SCSI on open / drop |
Hard disk images provide faster access and larger storage capacity compared to floppy disks: You can make HDD image using this application, but it requires initialization by using FORMAT.X running by Human68k on the emulator.
- Loading HDD Images: Use HDD → Open Hard Disk... menu or drag
.hdf/.hdsfiles - Performance: HDDs offer significantly faster loading times for large applications
- Capacity: Support for larger disk images suitable for complex software suites
- Persistence: Use HDD → Save HDD (⌘S) to flush the in-memory HDD image back to disk
Unlike many emulators, MPX68K reproduces the authentic X68000 boot sequence, which is not simply "FDD always wins." The boot device is selected by the SRAM byte $ED0018 — the same byte that SWITCH.X writes on real hardware — and MPX68K preserves whatever value you last saved. The concrete rules are:
- SASI mode, default SRAM (
$ED0018 = $00, a.k.a.STDin SWITCH.X):- FDD Drive 0 is checked first. If a bootable floppy is inserted, it boots from FDD.
- Otherwise, the system falls back to the SASI HDD.
- SASI mode, SRAM set to HDD boot (
$ED0018 = $80, e.g. after runningSWITCH.X→ Boot Device =HD):- The HDD boots first even if a floppy is inserted in Drive 0. This is authentic X68000 behavior — if your HDD isn't booting when you expect the FDD to take over, check
SWITCH.X. - Safety net: if the SASI image has no valid boot sector, MPX68K automatically falls back to FDD boot for that reset (logged as "SASI boot bypass").
- The HDD boots first even if a floppy is inserted in Drive 0. This is authentic X68000 behavior — if your HDD isn't booting when you expect the FDD to take over, check
- SCSI mode (Storage Bus Mode → SCSI):
- On reset, MPX68K forces
$ED0018 = $80so the SCSI HDD takes priority. The IPL ROM runs its normal init andSCSI_InjectBootintercepts at the right moment to hand off to the SCSI device driver. - If you want to boot a floppy in SCSI mode, you need to switch Storage Bus Mode → SASI first (or eject the SCSI device).
- On reset, MPX68K forces
MPX68K keeps the SASI-mode SRAM state across resets ("SASI SRAM restored (SWITCH.X preserved)" in the log), so you only need to run SWITCH.X once to configure boot priority.
- System Boot from HDD: Run
SWITCH.Xonce inside Human68k and set the Boot Device toHD, then reboot. From that point the HDD will boot automatically. - Applications: Store large software packages on HDD
- Development: Use HDD for compilers and development tools
- Games: Multi-disk games can be consolidated onto HDD
- Boot Override: With
$ED0018 = $00(SWITCH.X =STD), insert a system floppy in Drive 0 to boot from FDD even when an HDD is mounted
The X68000 emulator supports 90-degree screen rotation for vertical games, commonly known as "tate mode":
- Dragon Spirit: Classic vertical shooter requiring portrait orientation
- Other Vertical Games: Any X68000 game designed for vertical play
- Rotate Screen: Use Display → Rotate Screen (⌘R) to toggle between orientations
- Direct Selection: Choose Display → Portrait Mode for vertical games
- Window Adjustment: macOS automatically resizes the window for optimal display
- Control Consistency: Joycard controls remain unchanged regardless of rotation
- Smooth Rotation: SpriteKit-based rotation with proper aspect ratio maintenance
- Persistent Settings: Rotation preference is saved and restored between sessions
- Optimal Scaling: Automatic scaling ensures games fill the available screen space
- No Performance Impact: Rotation processing doesn't affect emulation performance
MPX68K uses a multi-layered architecture that bridges modern Swift UI frameworks with low-level C/C++ emulation code.
- Swift: UI layer, device management, file system, logging infrastructure
- C: Core emulation engine (CPU, hardware, memory management)
- C++: Sound generation (fmgen), emulation components
- Objective-C: Bridge layer for legacy compatibility
- GameScene.swift: Main emulation viewport using SpriteKit
- FileSystem.swift: Secure file handling and disk image management
- X68Logger.swift: Professional logging system with categorization
- X68Security.swift: Input validation and security functions
- JoyController.swift: GameController integration
- X68JoyCard.swift: Virtual joycard implementation
- px68k/: Complete X68000 hardware emulation in C/C++
- c68k/: Independent M68000 CPU emulator (static library)
For detailed architecture documentation with diagrams, see ARCHITECTURE.md.
- SASI / SCSI Dual-Boot: Switch the hard disk bus between SASI and SCSI at runtime. SCSI boot uses an IPL-ROM-first architecture with the external CZ-6BS1 ROM mapped at
$EA0000-$EA1FFF - CRT Display Pipeline: Full shader chain with scanlines, bloom, vignette, noise, curvature, chromatic aberration, and persistence — plus a dedicated SwiftUI settings panel (⌘,) and Off / Subtle / Standard / Enhanced presets
- Background Video Superimpose: Overlay a local video file or a YouTube URL as a luma-keyed background, with adjustable threshold / softness / intensity
- Adjustable CPU Clock: 1 / 10 / 16 / 24 / 40 / 50 MHz selection from the Clock menu
- Serial Communication: Mouse-only (default), PTY terminal access, TCP client, and TCP server backends
- MIDI Output with Delay: External MIDI output with configurable delay and buffering
- JoyportU Support: ATARI-style joystick integration with Notify / Command modes
- Disk State Management: Auto-mount modes (Disabled / Restore Last Session / Smart Load / Manual) with save/restore and session info
- HDD Authoring: Create empty
.hdfimages from the app, then format under Human68k withFORMAT.X - Additional Disk Formats: Added
.d88and.hdmfloppy image support
- Mouse Reliability: Capture stability, Y-inversion fix, drift/inertia tuning, and SCC compatibility mode for VS.X double-click
- Rendering: Skip unchanged frames to reduce GPU load
- Audio: ADPCM / OPM ring-buffer mixing rework, ADPCM timing refinement
- Build System: macOS deployment target lowered to 12.0, x86_64 re-enabled for Intel Macs
- Secure Restorable State: Enabled on macOS
- Compiler Warnings: Legacy dead-code SCSI helpers removed, keeping the build warning-free
MPX68K/
├── X68000 Shared/ # Cross-platform Swift code
│ ├── px68k/ # C/C++ emulation core
│ │ ├── x68k/ # X68000 hardware components
│ │ ├── fmgen/ # FM sound synthesis (C++)
│ │ ├── m68000/ # CPU wrapper
│ │ └── x11/ # Platform abstraction
│ ├── *.swift # Swift UI and business logic
│ ├── X68Logger.swift # Professional logging system
│ ├── X68Security.swift # Security and validation
│ └── FileSystem.swift # Secure file management
├── X68000 macOS/ # macOS-specific code
│ ├── AppDelegate.swift # Menu integration
│ └── GameViewController.swift # Main view controller
├── c68k/ # M68000 CPU emulator (static lib)
│ └── c68k.xcodeproj # Independent build system
├── CLAUDE.md # Development guidelines
├── ARCHITECTURE.md # Detailed architecture docs
└── Settings.bundle/ # App settings configuration
- Xcode 15.0 or later (with the macOS SDK)
- macOS 12.0 (Monterey) or later as the deployment target
- Swift 5.9+
# Clean build
xcodebuild -project X68000.xcodeproj -scheme "X68000 macOS" -configuration Debug clean build
# Release build
xcodebuild -project X68000.xcodeproj -scheme "X68000 macOS" -configuration Release build
# Archive for distribution
xcodebuild -project X68000.xcodeproj -scheme "X68000 macOS" -configuration Release archive- C68K Library: Built automatically as dependency
- Main Project: Links against libc68k.a
- Package Dependencies: swift-crypto, swift-asn1 (managed by SPM)
- Zero Compiler Warnings: Clean builds with no warnings
- Memory Safety: Comprehensive bounds checking
- Thread Safety: Race condition prevention
- Performance Profiling: Built-in logging for performance monitoring
- Fork the repository
- Create a feature branch
- Make your changes
- Test on both platforms
- Submit a pull request
Please refer to CLAUDE.md for detailed development guidelines and architectural notes.
This project is based on px68k emulator. Please refer to the original px68k license terms.
- px68k (hissorii/px68k) — upstream emulator core. See upstream license files.
- c68k — MC68000 CPU emulator (via px68k). See upstream.
- fmgen by cisc — FM/PSG implementation (via px68k). See upstream.
No SHARP ROMs are distributed. Users must supply legally-owned ROMs.
- px68k: Original X68000 emulator core
- C68K: M68000 CPU emulator
- fmgen: FM sound synthesis library
- Sharp: Original X68000 computer system
SHARP X68000 is a trademark of SHARP CORPORATION. This project is not affiliated with SHARP CORPORATION.