Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x | import { Cpu, Emulator, Graphics, Input, Memory, Registers, Stack, Timer } from "@mawsfr/chip8";
import { ref } from "vue";
export const useChip8Emulator = () => {
const graphics = new Graphics();
const stack = new Stack();
const registers = new Registers();
const memory = new Memory(registers);
const input = new Input();
const delayTimer = new Timer();
const soundTimer = new Timer();
const cpu = new Cpu({
graphics,
stack,
registers,
memory,
input,
delayTimer,
soundTimer,
});
const emulator = ref(new Emulator({
cpu,
graphics,
stack,
registers,
memory,
input,
delayTimer,
soundTimer
}))
return {
emulator
};
} |