Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

# Vendored m68k crate: ignore build output and the large SingleStepTests /
# Musashi fixture submodules (fetched separately, never committed).
/vendor/m68k/target
/vendor/m68k/Cargo.lock
/vendor/m68k/tests/fixtures/m68000
/vendor/m68k/tests/fixtures/Musashi
/crates/m68k/target
/crates/m68k/Cargo.lock
/crates/m68k/tests/fixtures/m68000
/crates/m68k/tests/fixtures/Musashi
# CD images (cue/bin) are local assets, never committed.
*.[Cc][Uu][Ee]
*.[Bb][Ii][Nn]
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ display-plan-trace = []
internal-diagnostics = []

[dependencies]
m68k = { version = "=0.1.5", path = "vendor/m68k" }
# Path-only dependency on the in-tree fork (crates/m68k). No version requirement
# and a non-crates.io package name (copperline-m68k) guarantee the local copy is
# always used and the upstream `m68k` crate can never be pulled in; aliased back
# to `m68k` so source keeps `use m68k::...`. See crates/m68k/Cargo.toml.
m68k = { package = "copperline-m68k", path = "crates/m68k" }
pixels = "0.17"
winit = "0.30"
anyhow = "1"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Website: [copperline.dev](https://copperline.dev/)

An Amiga emulator written in Rust, built around a vendored copy of
the pure-Rust [m68k](vendor/m68k) CPU core, with a
the pure-Rust [m68k](crates/m68k) CPU core, with a
[pixels](https://crates.io/crates/pixels) + [winit](https://crates.io/crates/winit)
window for video and stdout for serial. It started life with the modest
goal of booting [DiagROM](https://www.diagrom.com/) far enough to show a
Expand Down Expand Up @@ -264,7 +264,7 @@ chip-bus timings against the CIA E-clock for cross-emulator comparison.
m68k nightly build (see [assets/aros/README.md](assets/aros/README.md)).
- [DiagROM](https://www.diagrom.com/) by John "Chucky" Hertell,
licensed for free use.
- The [m68k](vendor/m68k) CPU core vendored under `vendor/m68k`.
- The [m68k](crates/m68k) CPU core vendored under `crates/m68k`.
- The public-domain `font8x8` glyphs by Daniel Hepper / Marcel Sondaar
for the on-screen overlay font.
- The Amiga Hardware Reference Manual for register-level documentation.
Expand All @@ -277,7 +277,7 @@ chip-bus timings against the CIA E-clock for cross-emulator comparison.
Copperline is free software, released under the GNU General Public
License version 3 or (at your option) any later version. See
[LICENSE](LICENSE) for the full text. The vendored
[m68k](vendor/m68k) CPU core under `vendor/m68k`
[m68k](crates/m68k) CPU core under `crates/m68k`
retains its own MIT license.

## Trademarks
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resolve that dependency story before attempting a crates.io release.
- `assets/brand/*.png`
- `docs/images/*.png`; review provenance before release when these change
- `timing-test/boot.bin`, built from `timing-test/boot.asm`
- `vendor/m68k/tests/fixtures/extra/**/bin/*.bin`, built from the
- `crates/m68k/tests/fixtures/extra/**/bin/*.bin`, built from the
adjacent assembly sources under sibling `src/` directories

3. Confirm local assets are still ignored:
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- The emulator is no longer purely pragmatic about timing: the 68000
path has a prefetch-queue model with per-access cycle billing
(~99.6% timing-exact against SingleStepTests, see
`vendor/m68k/CYCLE_TIMING_GAP.md`), interrupt-recognition latency,
`crates/m68k/CYCLE_TIMING_GAP.md`), interrupt-recognition latency,
and chip-bus slot arbitration with CPU/blitter/DMA contention.
68020+ timing, some Paula disk details, and ECS/AGA behavior remain
pragmatic and should be tightened only when driven by a concrete
Expand Down
File renamed without changes.
31 changes: 31 additions & 0 deletions crates/m68k/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copperline's fork of the m68k core. Deliberately NOT named "m68k": that name
# belongs to the upstream crates.io crate (benletchford/m68k-rs), and this fork
# has diverged substantially (cycle-exact MC68000 timing, 2-word prefetch queue,
# 80-bit extended FPU; see VENDOR.md). The distinct package name makes it
# impossible for any tool, [patch], or future workspace member to substitute the
# upstream crate -- there is no crates.io crate by this name. The root crate
# imports it aliased back to `m68k` via `package = "copperline-m68k"`, so source
# code keeps using `m68k::...`. Still MIT-licensed (Ben Letchford); see LICENSE.
[package]
name = "copperline-m68k"
version = "0.1.5"
edition = "2024"
license = "MIT"
description = "Copperline's fork of the m68k MC68000-family CPU emulator"
exclude = ["tests/**/*"]

# Keep the importable library name `m68k` even though the package is renamed to
# copperline-m68k. This lets the fork's own integration tests and the dasm
# binary keep `use m68k::...` unchanged; only the crates.io-visible package name
# differs (which is what blocks upstream substitution).
[lib]
name = "m68k"

[dependencies]
serde = { version = "1.0", features = ["derive"] }

[dev-dependencies]
serde_json = "1.0"
# Arbitrary-precision float oracle for the FPU transcendental accuracy tests
# (tests/fpu_accuracy.rs). Pure Rust; dev-only, never in the shipped emulator.
astro-float = { version = "0.9", default-features = false, features = ["std"] }
File renamed without changes.
2 changes: 1 addition & 1 deletion vendor/m68k/README.md → crates/m68k/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Add to your `Cargo.toml`:

```toml
[dependencies]
m68k = { path = "vendor/m68k" }
m68k = { path = "crates/m68k" }
```

### Basic Usage
Expand Down
30 changes: 24 additions & 6 deletions vendor/m68k/VENDOR.md → crates/m68k/VENDOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,27 @@ Vendored from https://github.com/benletchford/m68k-rs
Commit: 50d1f63 (published as crates.io `m68k` 0.1.5), MIT licensed.
Fetched: 2026-05-31.

Copperline depends on this via a path dependency (`m68k = { path = "vendor/m68k" }`)
so we can give it accurate MC68000 cycle timing + a prefetch queue. See
`CYCLE_TIMING_GAP.md` for the measured baseline gap and the fix plan.
Copperline depends on this via a path dependency
(`m68k = { package = "copperline-m68k", path = "crates/m68k" }`) so we can give
it accurate MC68000 cycle timing + a prefetch queue. See `CYCLE_TIMING_GAP.md`
for the measured baseline gap and the fix plan.

## Relocation + package rename (2026-06-28)

Moved from `vendor/m68k` to `crates/m68k` and the package renamed from `m68k` to
`copperline-m68k` (the importable library name is kept as `m68k` via `[lib]
name`, and the root crate aliases it back with `package = "copperline-m68k"`, so
no source `use m68k::...` changed). Two reasons, both from issue #57:

- Distro/OBS packaging vendors crates.io deps into a directory named `vendor/`
and points `[source.vendored-sources] directory = "vendor"` at it; cargo then
demands a `.cargo-checksum.json` for every subdir. Our committed path crate in
`vendor/m68k` has no checksum file, so offline builds failed
("failed to load checksum .cargo-checksum.json of m68k v0.1.5"). `crates/`
does not collide with the vendoring target.
- The package name no longer matches the upstream crates.io `m68k`, and the dep
carries no version requirement, so no tool, `[patch]`, or future workspace
member can ever substitute the unmodified upstream crate for this fork.

## Local changes vs upstream 50d1f63

Expand Down Expand Up @@ -98,11 +116,11 @@ gap report, fetch it once:

```sh
git clone --depth 1 https://github.com/SingleStepTests/m68000 /tmp/sst-m68000
mkdir -p vendor/m68k/tests/fixtures/m68000
cp -R /tmp/sst-m68000/v1 vendor/m68k/tests/fixtures/m68000/
mkdir -p crates/m68k/tests/fixtures/m68000
cp -R /tmp/sst-m68000/v1 crates/m68k/tests/fixtures/m68000/
```

Then, from `vendor/m68k`:
Then, from `crates/m68k`:

```sh
# functional (final-state) suite
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading