Compare the current trace with GBATEK, the pinned public test, Smolka firmware analysis, and mGBA software BIOS behavior. Distinguish generic image-derived protection from replacement firmware compatibility. Plan guarded PC+8 compatibility data in the generated BIOS instead of test-specific bus overrides.
14 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 GBA system control and WAITCNT, including HALTCNT power-mode selection.
-
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, STOP clock gating, allowed wake sources, and the clock-off IF note.
-
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.
-
GBATEK memory mirrors, video byte writes, and unused-memory reads, for unused address ranges, ARM PC+8 open bus, byte lanes, the distinct Thumb region/history rules, and PC-dependent BIOS read protection.
-
nocash GBA open-bus discussion, for the distinction between ARM prefetch and region-dependent Thumb values.
-
mGBA memory implementation, reviewed for
GBALoadBad, ARM prefetch sourcing, byte/halfword lane selection, and separate DMA/history behavior. Also reviewed its BIOS region-exit prefetch retention and protected-load lane selection. -
mGBA DMA implementation, used to cross-check masks, repeat behavior, and Game Pak source increments.
-
GBATEK ARM data processing, including R15/status notes. Its legacy
{P}description alone does not establish ARM7 behavior. -
mGBA ARM instruction implementation, reviewed for Rd=15 test/compare SPSR restoration, User/System fallback, and no result write/refill. Also reviewed its word/byte/halfword/signed load ordering: writeback precedes the destination result.
-
jsmolka/gba-tests, pinned for independent ARM testing. Reviewed its MIT license, startup, result macros, compare/status tests, and load/writeback alias tests.
-
Pinned jsmolka Thumb entry, branch tests, and memory tests, reviewed for r7 failure IDs, success-marker reset, the Thumb-to-ARM evaluation bridge, and empty-list transfer expectations.
-
Pinned jsmolka memory entry, mirror tests, and video-byte tests, reviewed for the r12 checkpoint, binary exit targets, limited byte-write assertions, and mode-selection caveats.
-
gbadoc memory layout, consulted for VRAM mirror ranges alongside GBATEK's video-memory layout and byte-write rules.
-
Pinned jsmolka BIOS test, reviewed for the r12 evaluation checkpoint, internal VBlank wait, and Nintendo-firmware-specific protected-read expectations after boot, SWI, and IRQ.
-
armwrestler-gba-fixed and arm7wrestler, considered as test sources; not integrated.
-
SingleStepTests ARM7TDMI, considered as an experimental, emulator-generated test source; not integrated.
-
GBATEK ARM single data transfers, for address calculation, indexing, load extension, and nominal timing.
-
Arm armasm LDR constraints, reviewed to distinguish portable assembly restrictions from the ARM7 alias behavior tested here.
-
Pinned halfword alias tests, for loaded-value precedence in pre/post-indexed
LDRHaliases. -
GBATEK Thumb stack and multiple transfers, for empty-list PC transfers and 64-byte writeback.
-
mGBA Thumb transfer implementation and shared memory transfers, reviewed for empty STM/PUSH routing and the extra Thumb instruction width on the stored pipeline PC. This supports executing PC+6, rather than an ordinary PC+4 operand read.
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
biosPrefetchcompatibility 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.
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.