Repository navigation
Add screen-space tile collision checks - #78
Conversation
|
@codex fix-request (review of 514583b on top of #62 9a167e5, base 948d19d; every CI check passed on a hand-resolved merge eaa1203, except cargo +1.85, which CI covers) Do this after #62's fix-request is pushed. Reply format and rules: AGENTS.md "Fix requests". |
Add a CHANGELOG note for the new BuiltinFunction variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@claude fixed 748c84a |
Depends on #63. Merge order: #62 → #63 → #78.
Summary
The camera-aware tile lookup could identify a tile, but collision checks still required hand-written register setup and tile-ID tests. This adds
TileCollision::at_screen_pixel, which checks the active map at a screen point after applying SCX/SCY and runs a body for configured solid tiles.What changed
TileCollisionandTileCollisionCheck, exported throughengineand the prelude.aand its map address inhlfor the body.Task.md,CONTEXT.mdandCHANGELOG.md.Tasks closed
Task.md: generalized screen-pixel tile collision checks.How it was verified
Independent chain review on the final simulated merged tree:
cargo fmt --check— passed.cargo clippy --all-targets -- -D warnings— passed.cargo test— passed (425 library tests, 12 snapshots, integration tests and doctests).scripts/assemble-examples.sh— passed; seven examples with RGBDS 1.0.4 on PATH.scripts/fetch-test-roms.sh /tmp/rust-boy-test-roms— passed checksum validation.RGBDS_LINK_CHECK=1 GB_TEST_ROMS=/tmp/rust-boy-test-roms cargo test --lib --test emulator— passed (425 library, 98 emulator tests including Blargg).git diff --check origin/refactor HEAD— passed.cargo +1.85 test— not run locally; rustup/toolchain absent. Reviewed-head MSRV GitHub CI passes.Generated-asm impact
No example output changes; snapshots are unchanged.
Risks and follow-ups
Callers must ensure VRAM is accessible at the read (LCD off or VBlank). The main loop only starts in VBlank; preceding work may exhaust it. Use a short VBlank handler whose complete workload fits the interval, or otherwise ensure accessible timing. Sample multiple points to cover an object's footprint; this helper detects solid tiles but does not resolve movement or push objects out of geometry.
Independent review
7e3231c3b4fabe853c87b04fad237c34c3af6408, merge order feat: add camera-aware tile lookup #62 → fix: reset background scroll on startup #63 → Add screen-space tile collision checks #78.8d885f18d23f3125d2693a46473961d6f6ccef66, fix: reset background scroll on startup #63b84997379eaa2a4253931776751ab7c054c2a96e, Add screen-space tile collision checks #7830d7b99d3ca063411398c0d2ac578ccc91dcced9.d2d34ee7fdaa2061e7cdb52203e89bd1ed057afd,1b6f61019ea3bb8531cfb9df564d57e513a67e40, final33d3cfabbf963d925ef6d0c355c6a689aaf2dad1.How to review
Merge after #63 (and #62). Review coordinate setup and the preservation of the tile ID/map address in
src/engine/tile_collision.rs, then the scrolled runtime test.