summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video
diff options
context:
space:
mode:
author andreasnaive <andreasnaive@gmail.com>2019-03-25 23:13:40 +0100
committer andreasnaive <andreasnaive@gmail.com>2019-03-25 23:13:40 +0100
commitb380514764cf857469bae61c11143a19f79a74c5 (patch)
tree63c8012e262618f08a332da31dd714281aa2c5ed /src/emu/video
parentc24473ddff715ecec2e258a6eb38960cf8c8e98e (diff)
Revert "conflict resolution (nw)"
This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
Diffstat (limited to 'src/emu/video')
-rw-r--r--src/emu/video/resnet.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/emu/video/resnet.h b/src/emu/video/resnet.h
index acc62bece79..e3f8ad78a68 100644
--- a/src/emu/video/resnet.h
+++ b/src/emu/video/resnet.h
@@ -177,12 +177,21 @@ 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 = int, typename U, std::size_t N, typename... V>
-constexpr T combine_weights(U const (&tab)[N], V... w)
+template <typename T, std::size_t N, typename... U>
+constexpr int combine_weights(T const (&tab)[N], U... w)
{
- return T(emu::detail::combine_weights<0U>(tab, w...) + 0.5);
+ return int(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 */
@@ -196,10 +205,10 @@ constexpr T combine_weights(U const (&tab)[N], V... 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 );