Repository navigation
Verify user function register arguments - #74
Conversation
|
@codex fix-request (review of 3757288, base 9bcc0c3; every CI check passed on a hand-resolved merge 8f32075, except cargo +1.85, which CI covers) F0/F1 [blocking] CONTEXT.md conflicts with Reply format and rules: AGENTS.md "Fix requests". |
Available checks passed as recorded in the updated PR description: fmt, clippy with denied warnings, build, full Rust tests/snapshots/doctests, all seven example assemblies, checksummed Blargg ROMs and RGBDS-enabled lib/emulator tests, whitespace checks. Rust 1.85 is unavailable locally (no rustup/toolchain); GitHub MSRV checks are reported separately. Fresh independent review of the final head remains pending. Reviewer agents reached the account usage limit; these fixes and local checks are not being counted as a completed independent review. Merge order is recorded in the PR dependency line. |
Depends on #73.
Summary
User functions can receive parameters through register setup, but the Phase 3 checklist did not record that calling convention. This adds an emulator test proving
RustBoy::call_argspasses a register value into a user function, and documents the existingcall_args/Call::with_argsAPI.What changed
$5Ainaand verifies the user function stores it.Task.md,CONTEXT.mdandCHANGELOG.mdto explain register-based parameters andRoutine::with_reads.Tasks closed
Task.md: functions with register parameters.How it was verified
Final pushed head
f070d9ca065ecf7bdf70f211c3307628f008ca69:cargo fmt --check— passed.cargo clippy --all-targets -- -D warnings— passed.cargo build— passed.cargo test— passed (447 library tests, integration tests, snapshots and doctests).scripts/assemble-examples.shwith RGBDS 1.0.4 on PATH — passed; all seven examples.scripts/fetch-test-roms.sh /tmp/rust-boy-test-roms— pinned checksums passed; cache reused.RGBDS_LINK_CHECK=1 GB_TEST_ROMS=/tmp/rust-boy-test-roms cargo test --lib --test emulatorwith RGBDS on PATH — passed (447 library, 111 emulator tests including Blargg).git diff --check— passed.cargo +1.85 test— not run locally (rustup / 1.85 not installed; CI MSRV job checks this).Generated-asm impact
No example output changes; snapshots are unchanged.
Risks and follow-ups
Parameters are passed through the documented register convention; this does not add a higher-level typed parameter declaration system.
Independent review
f070d9ca065ecf7bdf70f211c3307628f008ca69againstrefactor(82e6159).3757288are addressed:CONTEXT.mdpreservedrefactor's newest state cleanly and added mention of register-based function arguments.Task.mdonly tickedFunctions with register parameterswithout altering pending control-flow checkboxes.RustBoy::call_argsandCall::with_args.every_call_emits_its_register_setup_immediately_before_the_callverifies two calls emit their register setups (with multiple registersaandde) directly before each call.How to review
Review the register contract on
RustBoy::call_argsand theuser_functions_receive_register_argumentsemulator test.