From 2f47b7492a409a37f1c5b6d90fc6dc8dc9d3390d Mon Sep 17 00:00:00 2001 From: Michael Steil Date: Fri, 24 Sep 2010 11:09:05 +0000 Subject: [PATCH] cleanup --- perfect6502.c | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/perfect6502.c b/perfect6502.c index 9bed919..9db9b9f 100644 --- a/perfect6502.c +++ b/perfect6502.c @@ -296,6 +296,40 @@ group_count() return groupcount; } +/************************************************************ + * + * Node State + * + ************************************************************/ + +void recalcNodeList(const nodenum_t *source, count_t count); + +static inline void +setNode(nodenum_t nn, BOOL state) +{ + set_nodes_pullup(nn, state); + set_nodes_pulldown(nn, !state); + recalcNodeList(&nn, 1); +} + +static inline void +setLow(nodenum_t nn) +{ + setNode(nn, 0); +} + +static inline void +setHigh(nodenum_t nn) +{ + setNode(nn, 1); +} + +static inline BOOL +isNodeHigh(nodenum_t nn) +{ + return get_nodes_state_value(nn); +} + /************************************************************ * * Node and Transistor Emulation @@ -401,8 +435,6 @@ floatnode(nodenum_t nn) set_nodes_state_floating(nn, 1); } -static inline BOOL isNodeHigh(nodenum_t nn); - void recalcTransistor(transnum_t tn) { @@ -502,38 +534,6 @@ recalcAllNodes() recalcNodeList(temp, NODES); } -/************************************************************ - * - * Node State - * - ************************************************************/ - -static inline void -setNode(nodenum_t nn, BOOL state) -{ - set_nodes_pullup(nn, state); - set_nodes_pulldown(nn, !state); - recalcNodeList(&nn, 1); -} - -void -setLow(nodenum_t nn) -{ - setNode(nn, 0); -} - -void -setHigh(nodenum_t nn) -{ - setNode(nn, 1); -} - -static inline BOOL -isNodeHigh(nodenum_t nn) -{ - return get_nodes_state_value(nn); -} - /************************************************************ * * Address Bus and Data Bus Interface