Skip to content

M68kemu api migration - #2

Merged
jenska merged 2 commits into
mainfrom
m68kemu-api-migration
Sep 8, 2026
Merged

jenska merged 2 commits into
mainfrom
m68kemu-api-migration

Conversation

@jenska

@jenska jenska commented Sep 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

jenska and others added 2 commits September 8, 2026 22:50
Adopt the new CPU-core API and use it to speed up ROM execution.

- EnableTrace installs the observation callbacks through the single
  SetHooks call instead of the separate SetXxxTracer setters.
- Boot-ROM fetches and TOS-vector reads bypass the bus through a read-only
  flat memory window (SetFastMemory) over each isolated ROM mirror. EmuTOS
  runs entirely from ROM, so this is ~14% of an EmuTOS-boot benchmark;
  wait-state accounting matches the bus path exactly, so a 45-frame
  boot-parity test and the full debug-trace suite are byte-for-byte
  identical to the pure-bus path. machine.disableFastMemory forces every
  access back through the bus.
- devices.Interrupt.Vector and Machine.RequestInterrupt take a plain uint8
  (devices.AutoVector / 0) instead of *uint8.
- The eight single-range peripherals (ACIA, GLUE, MFP, PSG, FDC, Blitter,
  STE sound, cartridge ROM) expose AddressRange() and drop their identical
  Contains boilerplate; the bus page-maps them. Devices with non-contiguous
  or state-dependent decode keep Contains.

docs/m68kemu-api-proposal.md records the design and the parts of it that
have not landed (the scheduler / IRQ-line adoption, which needs an
event-driven device layer first).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jenska
jenska merged commit 84853f2 into main Sep 8, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cd6e267c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +17 to +20
if err := m.cpu.Reset(); err != nil {
return err
}
m.installFastMemory()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install ROM fast memory during machine construction

NewMachineWithCartridge returns a runnable CPU after cpu.NewCPU, and existing boot paths invoke StepFrame directly without calling Machine.Reset (for example, TestMachineTwoMegRAMBootsBundledROMToActiveScreenBase). Because SetFastMemory is reached only through this reset path, fastRegions remains empty for those normal launches and every ROM fetch continues through the bus; the advertised boot-speed improvement is therefore limited to callers that explicitly reset. Install the regions once the Machine is assembled, or before its first execution.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant