I'm writing a Nintendo Gameboy emulator in Java, but I have a problem emulating the processor. The original clock rate is approx. 4.19MHz. How to do this? I've thought about putting in Thread.sleep(long, int)
, but it wouldn't work, because with it you can emulate up to 1MHz, but not 4MHz. Is there something similar but more precise? Is there another way like decreasing execution speed?
Asked
Active
Viewed 40 times
1

korochun
- 145
- 1
- 1
- 11
-
"*I've thought about putting in Thread.sleep(long, int), but it wouldn't work, because with it you can emulate up to 1MHz, but not 4MHz.*" ... I am not sure how sleeping a thread in Java is related to clock speed. From where did you read about it? – hagrawal7777 Mar 29 '18 at 17:04