From 96a6dba4371a2e319a47335b2bf366b695b6c17a Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Fri, 10 Sep 2021 21:16:34 +0300 Subject: refactor: remove the ICPU interface Removing the interface simplifies the code --- benchmark/convert-instructions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'benchmark/convert-instructions.ts') diff --git a/benchmark/convert-instructions.ts b/benchmark/convert-instructions.ts index edde3cc..6ae0c24 100644 --- a/benchmark/convert-instructions.ts +++ b/benchmark/convert-instructions.ts @@ -8,7 +8,7 @@ let fnBody = ''; let currentInstruction = ''; let pattern = ''; let output = ` -import { ICPU } from '../src/cpu/cpu'; +import { CPU } from '../src/cpu/cpu'; function isTwoWordInstruction(opcode: number) { return ( @@ -36,7 +36,7 @@ for (const line of input.split('\n')) { patternToFn.push([pattern.trim(), fnName]); } else if (line.startsWith(' }')) { output += ` - export function ${fnName}(cpu: ICPU, opcode: number) { + export function ${fnName}(cpu: CPU, opcode: number) { /*${pattern}*/ ${fnBody} cpu.cycles++; @@ -62,7 +62,7 @@ for (const [fnPattern, fn] of patternToFn) { output += ']'; output += `\n -export function executeInstruction(idx: number, cpu: ICPU, opcode: number) { +export function executeInstruction(idx: number, cpu: CPU, opcode: number) { switch (idx) { ${executeInstructionCases} default: instNOP(cpu, opcode); -- cgit v1.2.3