diff options
Diffstat (limited to 'src/emu/video/resnet.h')
-rw-r--r-- | src/emu/video/resnet.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/emu/video/resnet.h b/src/emu/video/resnet.h index e3f8ad78a68..acc62bece79 100644 --- a/src/emu/video/resnet.h +++ b/src/emu/video/resnet.h @@ -177,21 +177,12 @@ double compute_resistor_weights( int count_2, const int * resistances_2, double * weights_2, int pulldown_2, int pullup_2, int count_3, const int * resistances_3, double * weights_3, int pulldown_3, int pullup_3); -template <typename T, std::size_t N, typename... U> -constexpr int combine_weights(T const (&tab)[N], U... w) +template <typename T = int, typename U, std::size_t N, typename... V> +constexpr T combine_weights(U const (&tab)[N], V... w) { - return int(emu::detail::combine_weights<0U>(tab, w...) + 0.5); + return T(emu::detail::combine_weights<0U>(tab, w...) + 0.5); } -#define combine_8_weights(tab,w0,w1,w2,w3,w4,w5,w6,w7) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5) + (tab)[6]*(w6) + (tab)[7]*(w7)) + 0.5)) -#define combine_7_weights(tab,w0,w1,w2,w3,w4,w5,w6) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5) + (tab)[6]*(w6)) + 0.5)) -#define combine_6_weights(tab,w0,w1,w2,w3,w4,w5) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4) + (tab)[5]*(w5)) + 0.5)) -#define combine_5_weights(tab,w0,w1,w2,w3,w4) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3) + (tab)[4]*(w4)) + 0.5)) -#define combine_4_weights(tab,w0,w1,w2,w3) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2) + (tab)[3]*(w3)) + 0.5)) -#define combine_3_weights(tab,w0,w1,w2) (int(((tab)[0]*(w0) + (tab)[1]*(w1) + (tab)[2]*(w2)) + 0.5)) -#define combine_2_weights(tab,w0,w1) (int(((tab)[0]*(w0) + (tab)[1]*(w1)) + 0.5)) -#define combine_1_weights(tab,w0) (int(((tab)[0]*(w0) + 0.5))) - /* this should be moved to one of the core files */ @@ -205,10 +196,10 @@ constexpr int combine_weights(T const (&tab)[N], U... w) /* for the open collector outputs PROMs */ double compute_resistor_net_outputs( - int minval, int maxval, double scaler, - int count_1, const int * resistances_1, double * outputs_1, int pulldown_1, int pullup_1, - int count_2, const int * resistances_2, double * outputs_2, int pulldown_2, int pullup_2, - int count_3, const int * resistances_3, double * outputs_3, int pulldown_3, int pullup_3 ); + int minval, int maxval, double scaler, + int count_1, const int * resistances_1, double * outputs_1, int pulldown_1, int pullup_1, + int count_2, const int * resistances_2, double * outputs_2, int pulldown_2, int pullup_2, + int count_3, const int * resistances_3, double * outputs_3, int pulldown_3, int pullup_3 ); |