gameboy-rust/docs/references.md
0xrsydn 47df9d05a7 feat(cpu): retain ARM instruction pipeline words
Buffer ARM sequential fetch results and refill target pairs after branches, PC writes, and machine exception entry. Stage advances transactionally, defer speculative fetch diagnostics, and preserve buffered words across CPU/DMA stores and host edits. Add explicit CPU pipeline invalidation for debugger repair and memory rebinding.

Add 15 original instruction-buffer regressions. Keep full-state rollback equality while distinguishing architectural comparisons in semantic tests. Update the display error test for an already buffered branch. Document evidence and separate remaining Thumb, bus-history, and timing work.

Validated on Darwin arm64: 967 workspace and 898 core/demo tests in each debug/release profile, 39 Python tests, native ROM windows, ten window smoke modes, fmt, clippy, and rustdoc. Public ARM/Thumb/memory/BIOS reports and nominal cycles remain unchanged.
2026-10-06 04:01:00 +07:00

20 KiB

References

External sources consulted while implementing the emulator. Add new sources here, or in a "References" section of the matching docs/hardware/ file when a link explains one specific behavior.

Hardware references used for the core:

BIOS protected-read root-cause research:

  • Smolka Progress Report #6, for firmware-dependent protected reads and the Ruby/Sapphire null-pointer case; the report distinguishes Emerald.
  • mGBA: Cracking the GBA BIOS, for BIOS access protection and replacement-versus-external firmware approaches.
  • Cult-of-GBA BIOS, reviewed for original boot, SWI, and IRQ exit layout and its MIT license. No source or binary was copied.
  • mGBA BIOS implementation, for the explicit post-SWI biosPrefetch compatibility value.
  • no$gba BIOS FAQ, for the distinction between simulated firmware services and using a firmware image.

See the root-cause analysis and implementation decision.

Thumb BIOS fetch research:

See Thumb BIOS prefetch snapshots for the inference, implementation limits, and original regressions.

IWRAM lane-history research:

See IWRAM Thumb bus history. These were source reviews, not local hardware or external-emulator test runs.

IWRAM refill research:

These sources support bounded refill sampling, not a claim of cycle-accurate pipeline or DMA behavior.

DMA data-latch research:

See DMA data-latch findings. Source review is not a local hardware-test pass.

DMA IWRAM continuation research:

  • jgenesis bus at fab6e2cc, for DMA read/write dispatch through the same lane-retaining IWRAM helpers as CPU accesses. Its DMA controller and memory storage distinguish channel data from local bus lanes.
  • The pinned ares DMA, bus dispatch, and IWRAM helpers above independently use the same local lane ownership.

See the bounded DMA continuation extension. These source reviews do not establish sub-instruction arbitration, exact CPU resume timing, or hardware conformance.

DMA resume-timing research:

  • NanoBoyAdvance force-nseq-access test at cc3f4a28, for equal timer expectations after RAM-source and ROM-source DMA sequences.
  • The pinned NanoBoyAdvance bus and ares DMA/bus implementations above explicitly break sequential CPU access after DMA ownership.

See non-sequential CPU resume for the nominal subset and unmodeled refill/prefetch details. The public test was reviewed, not executed. No hardware timing pass is claimed.

ARM instruction-buffer research:

  • ARM7TDMI instruction pipeline and technical reference manual, for fetch/decode/execute stages and the visible ARM PC offset.
  • The pinned NanoBoyAdvance ARM7TDMI Run and ReloadPipeline32 helpers above, for retained words, pre-execution fetching, and target-pair refill order.
  • The ARM branch cycle sequence above, for target and target+instruction-width fetches.

See persistent ARM instruction buffering. Instruction retention is implemented; per-access timing and Thumb buffering remain incomplete.

Use GBATEK and ARM7TDMI documentation for further hardware work. Only use game ROMs that you may lawfully use. Do not commit game ROMs, BIOS files, or game assets. The ignore file excludes roms/, common game ROM extensions, and save files.