chip8emu icon indicating copy to clipboard operation
chip8emu copied to clipboard

Added optional command line argument to set cycle-rate of CPU-loop

Open BhavyaC16 opened this issue 4 years ago • 2 comments

Provided the cycleRate attribute to the Machine class. An optional argument can be passed to the emulator in microseconds to control the CPU loop rate, which is otherwise set to 10 by default.

Example to set cycle rate to 5000 microseconds:

./bin/c8emu ./roms/games/Tetris\ \[Fran\ Dachille\,\ 1991\].ch8 5000

Closes #2

BhavyaC16 avatar Oct 25 '20 08:10 BhavyaC16

Yes

On Sun, Oct 25, 2020 at 2:50 PM Bhavya Chopra [email protected] wrote:

@BhavyaC16 commented on this pull request.

In include/Machine.hpp https://github.com/LakshyAAAgrawal/chip8emu/pull/32#discussion_r511570168 :

@@ -26,6 +26,7 @@ class Machine{ Keyboard kb; // presents Keyboard related functions uint16_t PC; // Program Counter std::chrono::steady_clock::time_point last_tick;

  • uint16_t cycleRate; // Argument that can be added to set the cycle-rate of the emulator

Will cpu_sleep_period be a better variable name?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LakshyAAAgrawal/chip8emu/pull/32#discussion_r511570168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD2SKLMVXDGYUKHEHIZS6XTSMPUW7ANCNFSM4S6FIOYQ .

LakshyAAAgrawal avatar Oct 25 '20 10:10 LakshyAAAgrawal

Hey, I have made the suggested changes!

BhavyaC16 avatar Oct 29 '20 08:10 BhavyaC16