From 7da2773f1c6c33f0651f2adcf06b8402acca3890 Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Mon, 18 Sep 2023 19:35:18 +0200 Subject: [PATCH] compile time cycles --- Makefile | 2 ++ emu.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 2d29f05..a138ffc 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,12 @@ ##################################################################### BIN := emu +CYCLES_PER_INSTR=12 OPTIM=g CFLAGS += -O$(OPTIM) CFLAGS += -pipe CFLAGS += -g -Wall -Wextra -Wno-unused-parameter -Wshadow +CFLAGS += -DCYCLES_PER_INSTR=$(CYCLES_PER_INSTR) # Uncomment to activate LTO #CFLAGS += -flto diff --git a/emu.c b/emu.c index 185d6d6..2cfbfc1 100644 --- a/emu.c +++ b/emu.c @@ -45,7 +45,9 @@ #include "emu8051.h" #include "emulator.h" +#ifndef CYCLES_PER_INSTR #define CYCLES_PER_INSTR 12 +#endif // CYCLES_PER_INSTR unsigned char history[HISTORY_LINES * (128 + 64 + sizeof(int))];