Skip to content

Limit instructions per second #50

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

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Limit instructions per second #50

merged 2 commits into from
Jan 16, 2025

Conversation

craigthomas
Copy link
Owner

This PR introduces a new way to add CPU operation delay into the emulator. Instead of using a sleep delay, we now count operations per second, and limit the number that are allowed to execute. This speeds up the main loop since the overhead of starting a delay operation was quite high. The new instruction is introduced with the --ticks switch on the command line.

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.71%. Comparing base (b802ca0) to head (cadd696).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
chip8/cpu.py 77.77% 2 Missing ⚠️
chip8/emulator.py 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   92.87%   94.71%   +1.83%     
==========================================
  Files           4        4              
  Lines         660      700      +40     
==========================================
+ Hits          613      663      +50     
+ Misses         47       37      -10     
Files with missing lines Coverage Δ
chip8/emulator.py 0.00% <0.00%> (ø)
chip8/cpu.py 98.58% <77.77%> (+2.13%) ⬆️

Continue to review full report in Codecov by Sentry.

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

@craigthomas craigthomas merged commit 5e414e9 into main Jan 16, 2025
2 of 3 checks passed
@craigthomas craigthomas deleted the instruction-limiter branch February 8, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant