Add a dependency-free keypad state machine in gba-core, map KEYCNT, latch IF bit 12, and wake HALT through the existing interrupt gates. Sample complete CPU/DMA control writes once so transient byte values cannot create false requests. Document the mGBA-style polling policy and its unverified hardware retrigger limits. Cover every button-state/selection pair, register masks, repeated requests, byte/word writes, failed-store isolation, DMA priority, ARM/Thumb IRQ return, BIOS IntrWait, and retained BIOS reset state. Follow the restructured workspace and modular documentation. Validated on Darwin arm64: workspace and core/demo tests pass in debug and release, with Clippy, rustdoc, ten native window smoke tests, and terminal demos passing.
9.3 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:
-
GBATEK BIOS reset functions, for SoftReset state and restart selection, plus RegisterRamReset flags, RAM bounds, and forced blank.
-
GBATEK BIOS halt functions, for wait contracts and STOP differences.
-
GBATEK BIOS rotation/scaling services, for record layouts, angle units, and output strides.
-
VisualBoyAdvance-M BIOS services, reviewed for integer affine rounding, signed matrix intermediates, and SoftReset status handling. Our sine table is generated mathematically.
-
GBATEK BIOS decompression services, including BitUnPack descriptor fields, differential-filter headers, Huffman tree layout, and width constraints.
-
mGBA BIOS service implementation, reviewed for RegisterRamReset register defaults, angle-polynomial coefficients and quadrant conventions, BitUnPack ordering/offsets, and Huffman tree layout and packing.
-
HALTCNT hardware-access tests, for BIOS-only writes and halfword access.
-
mGBA display implementation, used to cross-check hidden-line HBlank IRQs and comparison-write edges.
-
NanoBoyAdvance background implementation, reviewed for internal origins, line-end increments, and affine mosaic behavior.
-
mGBA text-background renderer, reviewed for out-of-range fetch behavior.
-
mGBA sprite preprocessing and row preparation, reviewed for inspection costs and aggregate work limits.
-
mGBA sprite renderer, reviewed for tile alignment and wrapping.
-
NanoBoyAdvance text sampling, reviewed for vertical counter subtraction.
-
NanoBoyAdvance mosaic registers, reviewed for phase-preserving size writes and documented timing uncertainties.
-
Horizontal sprite mosaic hardware findings, for latch transitions and transparent metadata.
-
NanoBoyAdvance sprite pipeline, reviewed for one-row-ahead preparation, mosaic phase, priority updates, and OBJ-window exclusions.
-
NanoBoyAdvance display scheduling, reviewed for cycle40 sprite initialization, line227 preparation, and vertical window comparisons on hidden lines.
-
NanoBoyAdvance composition, reviewed for palette lookup and horizontal mosaic after sprite preparation.
-
mGBA window renderer, reviewed for inverted bounds and vertical edge flags.
-
NanoBoyAdvance window implementation, reviewed for persistent vertical flags, four-cycle horizontal comparisons, offscreen columns, and end-edge precedence.
-
GBATEK keypad input, for KEYINPUT/KEYCNT fields and selected-button OR/AND matching.
-
mGBA keypad sampling and control writes, reviewed for repeated OR requests, AND snapshot suppression, and newly selected held keys.
-
NanoBoyAdvance keypad implementation, compared for control access widths; its AND/retrigger behavior differs from the chosen polling model.
-
mGBA keypad timing issue, for frontend frame-based input timing limits.
-
Tonc hardware interrupts, for keypad source enable and IF/IE bit 12.
-
mGBA DMA implementation, used to cross-check masks, repeat behavior, and Game Pak source increments.
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.