Phase 002: BBC machine layer (bbc/ package)#3
Merged
Conversation
Wire mos6502.CPU into a BBC Model B memory map: OS ROM, four sideways ROM banks, SHEILA decoder + 11 stub peripherals (CRTC, ACIA, Serial ULA, Video ULA, ACCCON, System+User VIA, FDC, Econet, ADC, Tube), and the Machine façade (New, LoadOSROM/LoadSidewaysROM, Tick, Reset/ ColdReset, IRQ/NMI/RDY pass-throughs, SetUnmappedAccessHook, CPU, Memory, Snapshot/Restore). 78 deterministic tests on bbc/ cover loaders, Reset vs ColdReset, RAM/OS ROM/sideways-window round-trip, SHEILA routing for every range in FR-008, CRTC index-then-data, VIA mirroring, FRED/JIM open-bus, 4-bank paging, Snapshot/Restore byte-identical round-trip, UnmappedAccessHook semantics, FR-028 no-locks reflection guard. Four golden bus traces locked. OS 1.20 smoke test gated on BBC_OS_ROM (image not redistributed). Gates: 169 tests pass under -race; vet clean; golangci-lint 0 issues; benches ~5.5 ns/cycle with 0 B/op 0 allocs/op (gate ≤6.5 ns/cycle); 96.9% coverage on bbc/ (gate ≥80%). Also update CLAUDE.md (bbc/ package summary), docs/roadmap.md (mark Phase 002 ✅ Complete with bench numbers), and quickstart.md (fix mos6502.Trace + Disassemble usage). Makefile bench target now covers bbc/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bbc/package wiringmos6502.CPUinto a BBC Model B memory map: 32 KB RAM, OS ROM, four sideways ROM banks via$FE30latch, SHEILA decoder dispatching to 11 stub peripherals (CRTC, ACIA, Serial ULA, Video ULA, ACCCON, System+User VIA, FDC, Econet, ADC, Tube).Machinefaçade:New,LoadOSROM/LoadSidewaysROM(copy-on-load),Tick,Reset/ColdReset, IRQ/NMI/RDY pass-throughs,SetUnmappedAccessHook,CPU/Memoryaccessors,Snapshot/Restore.Gates
go test -race ./...go vet ./...golangci-lint run ./...BenchmarkTickNoopBenchmarkTickMixedWorkloadbbc/coveragespecs/002-bbc-machine/tasks.md[X]Performance budget SC-006 (≤ ~6.5 ns/cycle) comfortably met.
Test plan
make fmt vet lint testcleango test -race ./...passesgo test -bench=BenchmarkTick -benchmem -benchtime=200ms -run=^$ ./bbc/reports0 B/op 0 allocs/opgo test -coverprofile=… ./bbc/≥ 80%specs/002-bbc-machine/quickstart.md)BBC_OS_ROM=/path/to/os120.rom go test ./bbc/ -run TestBootRealOSROM— asserts 1 000 000 cycles run without firingUnmappedAccessHookorIllegalOpcodeHook(SC-001)Docs
CLAUDE.md— addedbbc/package summary (public API, validation status, bench numbers, known limitations).docs/roadmap.md— Phase 002 marked ✅ Complete with bench numbers and deferred-items note.specs/002-bbc-machine/quickstart.md— fixedmos6502.Trace+Disassembleusage; addedMachine.Memory()accessor referenced by quickstart.Makefile—benchtarget now covers./bbc/.🤖 Generated with Claude Code