Match real Kickstart's CMP.W version check in OpenLibrary - #92
Merged
Merged
Conversation
A recent AROS fix ("Frontier 2") found real ROMs check lib_Version
with a 68000 CMP.W, so garbage in the high word of the requested
version (e.g. $30000000 in D0) is silently ignored. volamos compared
the full 32-bit register value, reproducing AROS's now-fixed bug
instead of real hardware. Mask the requested version to its low word
only at the comparison in after_init/reopen; D0 itself is left
untouched for the Open vector, matching real hardware.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HKKqpHMU8Pg4yZuxG924Gu
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
lib_VersioninOpenLibrarywith a 68000CMP.W, so garbage in the high word of the requested-version register (e.g.$30000000in D0) is silently ignored — AROS's C implementation instead compared the full 32-bit value and wrongly refused such opens.open_library_handlerread the full 32-bit D0 and both version-check sites (after_init,reopeninexeclib.rs) compared it as a fullu32againstlib_Version.Openvector, matching real hardware.Test plan
version_check_ignores_high_word_garbage(mirrors the existingversion_refusal_returns_nulltest) assertsOpenLibrary(name, $30000000)succeeds againsttest.library's reallib_Version(1).cargo test --workspace— 860 passed, 0 failed.🤖 Generated with Claude Code
https://claude.ai/code/session_01HKKqpHMU8Pg4yZuxG924Gu