mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 19:26:43 +01:00
Compare commits
1 Commits
master
...
b3a8512129
| Author | SHA1 | Date | |
|---|---|---|---|
| b3a8512129 |
@@ -274,7 +274,7 @@ export default function MicroW8(screen, config = {}) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
let restart = false;
|
let restart = false;
|
||||||
let thisFrame;
|
let nextFrame = 0;
|
||||||
if (!isPaused) {
|
if (!isPaused) {
|
||||||
let gamepads = navigator.getGamepads();
|
let gamepads = navigator.getGamepads();
|
||||||
let gamepad = 0;
|
let gamepad = 0;
|
||||||
@@ -321,13 +321,12 @@ export default function MicroW8(screen, config = {}) {
|
|||||||
}
|
}
|
||||||
canvasCtx.putImageData(imageData, 0, 0);
|
canvasCtx.putImageData(imageData, 0, 0);
|
||||||
|
|
||||||
let timeOffset = ((time * 6) % 100 - 50) / 6;
|
let thisFrame = Math.floor(time * 6 / 100);
|
||||||
thisFrame = startTime + time - timeOffset / 8;
|
let timeOffset = time - thisFrame * 100 / 6;
|
||||||
} else {
|
nextFrame = Math.ceil(startTime + (thisFrame + 1) * 100 / 6 + Math.min(4, timeOffset));
|
||||||
thisFrame = Date.now();
|
|
||||||
}
|
}
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
let nextFrame = Math.max(thisFrame + timePerFrame, now);
|
nextFrame = Math.max(nextFrame, now);
|
||||||
|
|
||||||
if (restart) {
|
if (restart) {
|
||||||
runModule(currentData);
|
runModule(currentData);
|
||||||
|
|||||||
Reference in New Issue
Block a user