Skip to content

Adopt m68kemu v1.5.0 IRQ source and simplify device/config internals - #3

Merged
jenska merged 1 commit into
mainfrom
m68kemu-api-migration
Sep 9, 2026
Merged

jenska merged 1 commit into
mainfrom
m68kemu-api-migration

Conversation

@jenska

@jenska jenska commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Finishes the v1.5.0 migration and the cleanup it opens up.

m68kemu v1.5.0 adoption:

  • Build the CPU with WithDeferredReset and run Machine.Reset once during construction, making it the single reset path. This also fixes a latent bug: the ROM fast-memory window was only installed from Machine.Reset, which the desktop and headless runners never call, so the shipped binary had been running entirely on the bus path.
  • Route device interrupts through a single level-sensitive IRQSource (machineIRQ over GLUE/MFP/FDC) that the core samples each instruction, deleting dispatchInterrupts, maskedAutovectorPulse, the irqSources slice and the InterruptSource interface. GLUE now drives a held HBL/VBL autovector line instead of queuing pulses; a blank interrupt the CPU is masking is taken shortly after the mask clears rather than dropped.
  • EnableTrace disassembly comes from TraceInfo.Mnemonic; drop the direct m68kdasm dependency (m68kemu still pulls it in).

Internal cleanup, no behaviour change:

  • PAL/NTSC raster constants and the FrameHz>=55 rule moved to config.Config.Video(); GLUE and MFP timing setup collapse to a few lines.
  • GLUE dropped its unused system-control register; $FF8006 is now a shared devices.ScratchRegion and GLUE is no longer bus-mapped.
  • DrainInterrupts removed from the devices in favour of PendingIRQ/AckIRQ plus a drainIRQ test helper.
  • The JSON config loader is table-driven (config.Config.jsonFields).
  • Removed the dead Machine.cartridge field.

The CycleScheduler adoption (proposal 3.2) was re-attempted against v1.5.0 and reverted again: correct, but a 120-frame EmuTOS boot regressed ~20% because the devices advance per-quantum, not event-driven. Recorded in docs/m68kemu-api-proposal.md.

Finishes the v1.5.0 migration and the cleanup it opens up.

m68kemu v1.5.0 adoption:
- Build the CPU with WithDeferredReset and run Machine.Reset once during
  construction, making it the single reset path. This also fixes a latent
  bug: the ROM fast-memory window was only installed from Machine.Reset,
  which the desktop and headless runners never call, so the shipped binary
  had been running entirely on the bus path.
- Route device interrupts through a single level-sensitive IRQSource
  (machineIRQ over GLUE/MFP/FDC) that the core samples each instruction,
  deleting dispatchInterrupts, maskedAutovectorPulse, the irqSources slice
  and the InterruptSource interface. GLUE now drives a held HBL/VBL
  autovector line instead of queuing pulses; a blank interrupt the CPU is
  masking is taken shortly after the mask clears rather than dropped.
- EnableTrace disassembly comes from TraceInfo.Mnemonic; drop the direct
  m68kdasm dependency (m68kemu still pulls it in).

Internal cleanup, no behaviour change:
- PAL/NTSC raster constants and the FrameHz>=55 rule moved to
  config.Config.Video(); GLUE and MFP timing setup collapse to a few lines.
- GLUE dropped its unused system-control register; $FF8006 is now a shared
  devices.ScratchRegion and GLUE is no longer bus-mapped.
- DrainInterrupts removed from the devices in favour of PendingIRQ/AckIRQ
  plus a drainIRQ test helper.
- The JSON config loader is table-driven (config.Config.jsonFields).
- Removed the dead Machine.cartridge field.

The CycleScheduler adoption (proposal 3.2) was re-attempted against v1.5.0
and reverted again: correct, but a 120-frame EmuTOS boot regressed ~20%
because the devices advance per-quantum, not event-driven. Recorded in
docs/m68kemu-api-proposal.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jenska
jenska merged commit f9c699b into main Sep 9, 2026
1 check passed
@jenska
jenska deleted the m68kemu-api-migration branch September 15, 2026 10:53
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