From 98907c92839c98825c59f272cd5b24da09ae3212 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 18 Aug 2016 02:24:14 +1000 Subject: [PATCH] BIT doesn't need to be a macro --- src/devices/cpu/tlcs90/tlcs90.cpp | 1 - src/devices/cpu/tlcs90/tlcs90.h | 2 ++ src/emu/emucore.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index 1ee24461666..5287425c320 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -16,7 +16,6 @@ #include "debugger.h" #include "tlcs90.h" -enum _e_op { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV }; static const char *const op_names[] = { "??", "nop", "ex", "exx", "ld", "ldw", "lda", "ldi", "ldir", "ldd", "lddr", "cpi", "cpir", "cpd", "cpdr", "push", "pop", "jp", "jr", "call", "callr", "ret", "reti", "halt", "di", "ei", "swi", "daa", "cpl", "neg", "ldar", "rcf", "scf", "ccf", "tset", "bit", "set", "res", "inc", "dec", "incx", "decx", "incw", "decw", "add", "adc", "sub", "sbc", "and", "xor", "or", "cp", "rlc", "rrc", "rl", "rr", "sla", "sra", "sll", "srl", "rld", "rrd", "djnz", "mul", "div" }; ALLOW_SAVE_TYPE(tlcs90_device::e_mode); // allow save_item on a non-fundamental type diff --git a/src/devices/cpu/tlcs90/tlcs90.h b/src/devices/cpu/tlcs90/tlcs90.h index 35c5cc15c77..68f853994e9 100644 --- a/src/devices/cpu/tlcs90/tlcs90.h +++ b/src/devices/cpu/tlcs90/tlcs90.h @@ -34,6 +34,8 @@ public: TIMER_CALLBACK_MEMBER( t90_timer4_callback ); protected: + enum _e_op { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV }; + // device-level overrides virtual void device_start() override; virtual void device_reset() override; diff --git a/src/emu/emucore.h b/src/emu/emucore.h index de317bb2a89..6e80277113b 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -242,7 +242,7 @@ inline TYPE operator--(TYPE &value, int) { TYPE const old(value); --value; retur // useful functions to deal with bit shuffling encryptions -#define BIT(x, n) (((x) >> (n)) & 1) +template constexpr T BIT(T x, U n) { return (x >> n) & T(1); } template constexpr T bitswap(T val, U b) {