Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new granule_fill_order attribute to specify granule allocation preference #80

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

craigthomas
Copy link
Owner

This PR updates the DiskFile class to have an attribute called granule_fill_order. This list-like object is exactly 68 elements long. Each entry in the list specifies the granule number that should be checked to see if it is empty. The order of the list reflects which granules are allocated first. In DiskConstants there is a constant called GRANULE_FILL_ORDER that mimics the way Disk BASIC attempts to allocate granules on the disk. In general, Disk BASIC attempts to fill granules near the center of the disk first to minimize head stepping. This same ordering is implemented within this PR. The class can be instantiated with a different ordering list, allowing for future customization when generating disk images. Unit tests updated to cover new conditions. This PR closes #73

Make granule_fill_order an attribute in the DiskFile class.
@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #80 (ec34715) into main (97b8796) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
+ Coverage   94.43%   94.44%   +0.01%     
==========================================
  Files          15       15              
  Lines        1779     1783       +4     
==========================================
+ Hits         1680     1684       +4     
  Misses         99       99              
Impacted Files Coverage Δ
cocoasm/virtualfiles/disk.py 93.60% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97b8796...ec34715. Read the comment docs.

@craigthomas craigthomas merged commit 61d9e20 into main Oct 3, 2022
@craigthomas craigthomas deleted the granule-preference branch October 6, 2022 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use granules closer to the middle of the disk
1 participant