Skip to content

Commit

Permalink
[#314] z80-cpu: frequency fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmacher committed May 6, 2023
1 parent ff2de41 commit c5424ed
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
Expand Down Expand Up @@ -205,7 +204,7 @@ public CPU.RunState run(CPU cpu) {

long timeSliceNanos = SleepUtils.SLEEP_PRECISION;
double timeSliceMicros = timeSliceNanos / 1_000.0;
int cyclesPerTimeSlice = (int) (timeSliceMicros * context.getCPUFrequency() / 1000.0); // frequency in kHZ -> MHz
int cyclesPerTimeSlice = (int) (timeSliceMicros * context.getCPUFrequency() / 1000.0); // frequency in kHZ -> MHzq

//System.out.println("Time slice millis: " + timeSliceMillis);
//System.out.println("Cycles per time slice: " + cyclesPerTimeSlice);
Expand Down

0 comments on commit c5424ed

Please sign in to comment.