libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
Loading...
Searching...
No Matches
evmu_wave.h File Reference

Go to the source code of this file.

Macros

#define EVMU_LOGIC_HIGH   1
 
#define EVMU_LOGIC_LOW   0
 
#define EVMU_WAVE_LOGIC_BITS   2
 
#define EVMU_WAVE_LOGIC_CURRENT_MASK   (0x3)
 
#define EVMU_WAVE_LOGIC_PREVIOUS_MASK   (0x3 << EVMU_WAVE_LOGIC_BITS)
 
#define EVMU_DECLARE_SUBWAVE_ENUMS_(L)
 
#define EVMU_WAVE_LOGIC_MASK_   (EVMU_WAVE_LOGIC_CURRENT_MASK | EVMU_WAVE_LOGIC_PREVIOUS_MASK)
 

Typedefs

typedef GblEnum EVMU_LOGIC
 
typedef GblEnum EvmuWave
 

Enumerations

enum  EVMU_LOGIC
 
enum  EvmuWave
 

Functions

static void EvmuWave_reset (GblEnum *pSelf)
 
static void EvmuWave_fill (GblEnum *pSelf, EVMU_LOGIC values)
 
static void EvmuWave_set (GblEnum *pSelf, EVMU_LOGIC prevValue, EVMU_LOGIC curValue)
 
static void EvmuWave_update (GblEnum *pSelf, EVMU_LOGIC value)
 
static EVMU_LOGIC EvmuWave_logicCurrent (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogic (const GblEnum *pSelf, EVMU_LOGIC value)
 
static GblBool EvmuWave_isLogicHigh (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicLow (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicInactive (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicUnknown (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicActive (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicKnown (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicValid (const GblEnum *pSelf)
 
static GblBool EvmuWave_isLogicInvalid (const GblEnum *pSelf)
 
static EVMU_LOGIC EvmuWave_logicPrevious (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogic (const GblEnum *pSelf, EVMU_LOGIC value)
 
static GblBool EvmuWave_wasLogicHigh (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicLow (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicInactive (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicUnknown (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicActive (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicKnown (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicValid (const GblEnum *pSelf)
 
static GblBool EvmuWave_wasLogicInvalid (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayed (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedLogic (const GblEnum *pSelf, EVMU_LOGIC value)
 
static GblBool EvmuWave_hasStayedLow (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedHigh (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedInactive (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedUnknown (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedActive (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedKnown (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedValid (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasStayedInvalid (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChanged (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedLogic (const GblEnum *pSelf, EVMU_LOGIC value)
 
static GblBool EvmuWave_hasChangedEdge (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedEdgeRising (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedEdgeFalling (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedActive (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedInactive (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedKnown (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedUnknown (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedValid (const GblEnum *pSelf)
 
static GblBool EvmuWave_hasChangedInvalid (const GblEnum *pSelf)
 
static void EvmuWave_logicPreviousSet_ (GblEnum *pSelf, EVMU_LOGIC value)
 
static void EvmuWave_logicCurrentSet_ (GblEnum *pSelf, EVMU_LOGIC value)
 

Detailed Description

EvmuWave and waveform API.

Author
2023 Falco Girgis

Definition in file evmu_wave.h.

Macro Definition Documentation

◆ EVMU_DECLARE_SUBWAVE_ENUMS_

#define EVMU_DECLARE_SUBWAVE_ENUMS_ ( L)

Definition at line 32 of file evmu_wave.h.

32#define EVMU_DECLARE_SUBWAVE_ENUMS_(L) \
33 EVMU_WAVE_##L##_0, \
34 EVMU_WAVE_##L##_1, \
35 EVMU_WAVE_##L##_Z, \
36 EVMU_WAVE_##L##_X

◆ EVMU_LOGIC_HIGH

#define EVMU_LOGIC_HIGH   1

Definition at line 12 of file evmu_wave.h.

◆ EVMU_LOGIC_LOW

#define EVMU_LOGIC_LOW   0

Definition at line 13 of file evmu_wave.h.

◆ EVMU_WAVE_LOGIC_BITS

#define EVMU_WAVE_LOGIC_BITS   2

Definition at line 15 of file evmu_wave.h.

◆ EVMU_WAVE_LOGIC_CURRENT_MASK

#define EVMU_WAVE_LOGIC_CURRENT_MASK   (0x3)

Definition at line 16 of file evmu_wave.h.

◆ EVMU_WAVE_LOGIC_MASK_

#define EVMU_WAVE_LOGIC_MASK_   (EVMU_WAVE_LOGIC_CURRENT_MASK | EVMU_WAVE_LOGIC_PREVIOUS_MASK)

Definition at line 98 of file evmu_wave.h.

◆ EVMU_WAVE_LOGIC_PREVIOUS_MASK

#define EVMU_WAVE_LOGIC_PREVIOUS_MASK   (0x3 << EVMU_WAVE_LOGIC_BITS)

Definition at line 17 of file evmu_wave.h.

Typedef Documentation

◆ EVMU_LOGIC

typedef GblEnum EVMU_LOGIC

Definition at line 24 of file evmu_wave.h.

◆ EvmuWave

typedef GblEnum EvmuWave

Definition at line 38 of file evmu_wave.h.

Enumeration Type Documentation

◆ EVMU_LOGIC

enum EVMU_LOGIC

Definition at line 24 of file evmu_wave.h.

24 {
25 EVMU_LOGIC_0 = EVMU_LOGIC_LOW,
26 EVMU_LOGIC_1 = EVMU_LOGIC_HIGH,
27 EVMU_LOGIC_Z = 0x2,
28 EVMU_LOGIC_X = 0x3,
29 EVMU_LOGIC_COUNT = EVMU_LOGIC_X + 1
30};

◆ EvmuWave

enum EvmuWave

Definition at line 38 of file evmu_wave.h.

38 {
39 EVMU_DECLARE_SUBWAVE_ENUMS_(0),
40 EVMU_DECLARE_SUBWAVE_ENUMS_(1),
41 EVMU_DECLARE_SUBWAVE_ENUMS_(Z),
42 EVMU_DECLARE_SUBWAVE_ENUMS_(X),
43 EVMU_WAVE_COUNT
44};

Function Documentation

◆ EvmuWave_fill()

static void EvmuWave_fill ( GblEnum * pSelf,
EVMU_LOGIC values )
inlinestatic

Definition at line 112 of file evmu_wave.h.

112 {
113 EvmuWave_set(pSelf, values, values);
114}

◆ EvmuWave_hasChanged()

static GblBool EvmuWave_hasChanged ( const GblEnum * pSelf)
inlinestatic

Definition at line 159 of file evmu_wave.h.

159 {
160 return !EvmuWave_hasStayed(pSelf);
161}

◆ EvmuWave_hasChangedActive()

static GblBool EvmuWave_hasChangedActive ( const GblEnum * pSelf)
inlinestatic

Definition at line 174 of file evmu_wave.h.

174 {
175 return EvmuWave_wasLogicInactive(pSelf) && EvmuWave_isLogicActive(pSelf);
176}

◆ EvmuWave_hasChangedEdge()

static GblBool EvmuWave_hasChangedEdge ( const GblEnum * pSelf)
inlinestatic

Definition at line 165 of file evmu_wave.h.

165 {
166 return EvmuWave_hasChangedEdgeRising(pSelf) || EvmuWave_hasChangedEdgeFalling(pSelf);
167}

◆ EvmuWave_hasChangedEdgeFalling()

static GblBool EvmuWave_hasChangedEdgeFalling ( const GblEnum * pSelf)
inlinestatic

Definition at line 171 of file evmu_wave.h.

171 {
172 return EvmuWave_wasLogicHigh(pSelf) && EvmuWave_isLogicLow(pSelf);
173}

◆ EvmuWave_hasChangedEdgeRising()

static GblBool EvmuWave_hasChangedEdgeRising ( const GblEnum * pSelf)
inlinestatic

Definition at line 168 of file evmu_wave.h.

168 {
169 return EvmuWave_wasLogicLow(pSelf) && EvmuWave_isLogicHigh(pSelf);
170}

◆ EvmuWave_hasChangedInactive()

static GblBool EvmuWave_hasChangedInactive ( const GblEnum * pSelf)
inlinestatic

Definition at line 177 of file evmu_wave.h.

177 {
178 return EvmuWave_wasLogicActive(pSelf) && EvmuWave_isLogicInactive(pSelf);
179}

◆ EvmuWave_hasChangedInvalid()

static GblBool EvmuWave_hasChangedInvalid ( const GblEnum * pSelf)
inlinestatic

Definition at line 189 of file evmu_wave.h.

189 {
190 return EvmuWave_wasLogicValid(pSelf) && EvmuWave_isLogicInvalid(pSelf);
191}

◆ EvmuWave_hasChangedKnown()

static GblBool EvmuWave_hasChangedKnown ( const GblEnum * pSelf)
inlinestatic

Definition at line 180 of file evmu_wave.h.

180 {
181 return EvmuWave_wasLogicUnknown(pSelf) && EvmuWave_isLogicKnown(pSelf);
182}

◆ EvmuWave_hasChangedLogic()

static GblBool EvmuWave_hasChangedLogic ( const GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 162 of file evmu_wave.h.

162 {
163 return !EvmuWave_wasLogic(pSelf, value) && EvmuWave_isLogic(pSelf, value);
164}

◆ EvmuWave_hasChangedUnknown()

static GblBool EvmuWave_hasChangedUnknown ( const GblEnum * pSelf)
inlinestatic

Definition at line 183 of file evmu_wave.h.

183 {
184 return EvmuWave_wasLogicKnown(pSelf) && EvmuWave_isLogicUnknown(pSelf);
185}

◆ EvmuWave_hasChangedValid()

static GblBool EvmuWave_hasChangedValid ( const GblEnum * pSelf)
inlinestatic

Definition at line 186 of file evmu_wave.h.

186 {
187 return EvmuWave_wasLogicInvalid(pSelf) && EvmuWave_isLogicValid(pSelf);
188}

◆ EvmuWave_hasStayed()

static GblBool EvmuWave_hasStayed ( const GblEnum * pSelf)
inlinestatic

Definition at line 129 of file evmu_wave.h.

129 {
130 return EvmuWave_logicCurrent(pSelf) == EvmuWave_logicPrevious(pSelf);
131}

◆ EvmuWave_hasStayedActive()

static GblBool EvmuWave_hasStayedActive ( const GblEnum * pSelf)
inlinestatic

Definition at line 147 of file evmu_wave.h.

147 {
148 return EvmuWave_wasLogicActive(pSelf) && EvmuWave_isLogicActive(pSelf);
149}

◆ EvmuWave_hasStayedHigh()

static GblBool EvmuWave_hasStayedHigh ( const GblEnum * pSelf)
inlinestatic

Definition at line 138 of file evmu_wave.h.

138 {
139 return EvmuWave_hasStayedLogic(pSelf, EVMU_LOGIC_1);
140}

◆ EvmuWave_hasStayedInactive()

static GblBool EvmuWave_hasStayedInactive ( const GblEnum * pSelf)
inlinestatic

Definition at line 141 of file evmu_wave.h.

141 {
142 return EvmuWave_hasStayedLogic(pSelf, EVMU_LOGIC_Z);
143}

◆ EvmuWave_hasStayedInvalid()

static GblBool EvmuWave_hasStayedInvalid ( const GblEnum * pSelf)
inlinestatic

Definition at line 156 of file evmu_wave.h.

156 {
157 return EvmuWave_wasLogicInvalid(pSelf) && EvmuWave_isLogicInvalid(pSelf);
158}

◆ EvmuWave_hasStayedKnown()

static GblBool EvmuWave_hasStayedKnown ( const GblEnum * pSelf)
inlinestatic

Definition at line 150 of file evmu_wave.h.

150 {
151 return EvmuWave_wasLogicKnown(pSelf) && EvmuWave_isLogicKnown(pSelf);
152}

◆ EvmuWave_hasStayedLogic()

static GblBool EvmuWave_hasStayedLogic ( const GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 132 of file evmu_wave.h.

132 {
133 return EvmuWave_isLogic(pSelf, value) && EvmuWave_wasLogic(pSelf, value);
134}

◆ EvmuWave_hasStayedLow()

static GblBool EvmuWave_hasStayedLow ( const GblEnum * pSelf)
inlinestatic

Definition at line 135 of file evmu_wave.h.

135 {
136 return EvmuWave_hasStayedLogic(pSelf, EVMU_LOGIC_0);
137}

◆ EvmuWave_hasStayedUnknown()

static GblBool EvmuWave_hasStayedUnknown ( const GblEnum * pSelf)
inlinestatic

Definition at line 144 of file evmu_wave.h.

144 {
145 return EvmuWave_hasStayedLogic(pSelf, EVMU_LOGIC_X);
146}

◆ EvmuWave_hasStayedValid()

static GblBool EvmuWave_hasStayedValid ( const GblEnum * pSelf)
inlinestatic

Definition at line 153 of file evmu_wave.h.

153 {
154 return EvmuWave_wasLogicValid(pSelf) && EvmuWave_isLogicValid(pSelf);
155}

◆ EvmuWave_isLogic()

static GblBool EvmuWave_isLogic ( const GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 192 of file evmu_wave.h.

192 {
193 return EvmuWave_logicCurrent(pSelf) == value;
194}

◆ EvmuWave_isLogicActive()

static GblBool EvmuWave_isLogicActive ( const GblEnum * pSelf)
inlinestatic

Definition at line 207 of file evmu_wave.h.

207 {
208 return !EvmuWave_isLogicInactive(pSelf);
209}

◆ EvmuWave_isLogicHigh()

static GblBool EvmuWave_isLogicHigh ( const GblEnum * pSelf)
inlinestatic

Definition at line 195 of file evmu_wave.h.

195 {
196 return EvmuWave_isLogic(pSelf, EVMU_LOGIC_1);
197}

◆ EvmuWave_isLogicInactive()

static GblBool EvmuWave_isLogicInactive ( const GblEnum * pSelf)
inlinestatic

Definition at line 201 of file evmu_wave.h.

201 {
202 return EvmuWave_isLogic(pSelf, EVMU_LOGIC_Z);
203}

◆ EvmuWave_isLogicInvalid()

static GblBool EvmuWave_isLogicInvalid ( const GblEnum * pSelf)
inlinestatic

Definition at line 216 of file evmu_wave.h.

216 {
217 return EvmuWave_isLogicInactive(pSelf) || EvmuWave_isLogicUnknown(pSelf);
218}

◆ EvmuWave_isLogicKnown()

static GblBool EvmuWave_isLogicKnown ( const GblEnum * pSelf)
inlinestatic

Definition at line 210 of file evmu_wave.h.

210 {
211 return !EvmuWave_isLogicUnknown(pSelf);
212}

◆ EvmuWave_isLogicLow()

static GblBool EvmuWave_isLogicLow ( const GblEnum * pSelf)
inlinestatic

Definition at line 198 of file evmu_wave.h.

198 {
199 return EvmuWave_isLogic(pSelf, EVMU_LOGIC_0);
200}

◆ EvmuWave_isLogicUnknown()

static GblBool EvmuWave_isLogicUnknown ( const GblEnum * pSelf)
inlinestatic

Definition at line 204 of file evmu_wave.h.

204 {
205 return EvmuWave_isLogic(pSelf, EVMU_LOGIC_X);
206}

◆ EvmuWave_isLogicValid()

static GblBool EvmuWave_isLogicValid ( const GblEnum * pSelf)
inlinestatic

Definition at line 213 of file evmu_wave.h.

213 {
214 return EvmuWave_isLogicActive(pSelf) && EvmuWave_isLogicKnown(pSelf);
215}

◆ EvmuWave_logicCurrent()

static EVMU_LOGIC EvmuWave_logicCurrent ( const GblEnum * pSelf)
inlinestatic

Definition at line 119 of file evmu_wave.h.

119 {
120 return (EVMU_LOGIC)(*pSelf & EVMU_WAVE_LOGIC_CURRENT_MASK);
121}

◆ EvmuWave_logicCurrentSet_()

static void EvmuWave_logicCurrentSet_ ( GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 105 of file evmu_wave.h.

105 {
106 *pSelf &= ~EVMU_WAVE_LOGIC_CURRENT_MASK;
107 *pSelf |= value & EVMU_WAVE_LOGIC_CURRENT_MASK;
108}

◆ EvmuWave_logicPrevious()

static EVMU_LOGIC EvmuWave_logicPrevious ( const GblEnum * pSelf)
inlinestatic

Definition at line 122 of file evmu_wave.h.

122 {
123 return (EVMU_LOGIC)((*pSelf & EVMU_WAVE_LOGIC_PREVIOUS_MASK) >> EVMU_WAVE_LOGIC_BITS);
124}

◆ EvmuWave_logicPreviousSet_()

static void EvmuWave_logicPreviousSet_ ( GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 101 of file evmu_wave.h.

101 {
102 *pSelf &= ~EVMU_WAVE_LOGIC_PREVIOUS_MASK;
103 *pSelf |= (value << EVMU_WAVE_LOGIC_BITS) & EVMU_WAVE_LOGIC_PREVIOUS_MASK;
104}

◆ EvmuWave_reset()

static void EvmuWave_reset ( GblEnum * pSelf)
inlinestatic

Definition at line 109 of file evmu_wave.h.

109 {
110 *pSelf = EVMU_WAVE_X_X;
111}

◆ EvmuWave_set()

static void EvmuWave_set ( GblEnum * pSelf,
EVMU_LOGIC prevValue,
EVMU_LOGIC curValue )
inlinestatic

Definition at line 115 of file evmu_wave.h.

115 {
116 EvmuWave_logicPreviousSet_(pSelf, prevValue);
117 EvmuWave_logicCurrentSet_(pSelf, curValue);
118}

◆ EvmuWave_update()

static void EvmuWave_update ( GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 125 of file evmu_wave.h.

125 {
126 EvmuWave_logicPreviousSet_(pSelf, EvmuWave_logicCurrent(pSelf));
127 EvmuWave_logicCurrentSet_(pSelf, value);
128}

◆ EvmuWave_wasLogic()

static GblBool EvmuWave_wasLogic ( const GblEnum * pSelf,
EVMU_LOGIC value )
inlinestatic

Definition at line 219 of file evmu_wave.h.

219 {
220 return EvmuWave_logicPrevious(pSelf) == value;
221}

◆ EvmuWave_wasLogicActive()

static GblBool EvmuWave_wasLogicActive ( const GblEnum * pSelf)
inlinestatic

Definition at line 234 of file evmu_wave.h.

234 {
235 return !EvmuWave_wasLogicInactive(pSelf);
236}

◆ EvmuWave_wasLogicHigh()

static GblBool EvmuWave_wasLogicHigh ( const GblEnum * pSelf)
inlinestatic

Definition at line 222 of file evmu_wave.h.

222 {
223 return EvmuWave_wasLogic(pSelf, EVMU_LOGIC_1);
224}

◆ EvmuWave_wasLogicInactive()

static GblBool EvmuWave_wasLogicInactive ( const GblEnum * pSelf)
inlinestatic

Definition at line 228 of file evmu_wave.h.

228 {
229 return EvmuWave_wasLogic(pSelf, EVMU_LOGIC_Z);
230}

◆ EvmuWave_wasLogicInvalid()

static GblBool EvmuWave_wasLogicInvalid ( const GblEnum * pSelf)
inlinestatic

Definition at line 243 of file evmu_wave.h.

243 {
244 return EvmuWave_wasLogicInactive(pSelf) || EvmuWave_wasLogicUnknown(pSelf);
245}

◆ EvmuWave_wasLogicKnown()

static GblBool EvmuWave_wasLogicKnown ( const GblEnum * pSelf)
inlinestatic

Definition at line 237 of file evmu_wave.h.

237 {
238 return !EvmuWave_wasLogicUnknown(pSelf);
239}

◆ EvmuWave_wasLogicLow()

static GblBool EvmuWave_wasLogicLow ( const GblEnum * pSelf)
inlinestatic

Definition at line 225 of file evmu_wave.h.

225 {
226 return EvmuWave_wasLogic(pSelf, EVMU_LOGIC_0);
227}

◆ EvmuWave_wasLogicUnknown()

static GblBool EvmuWave_wasLogicUnknown ( const GblEnum * pSelf)
inlinestatic

Definition at line 231 of file evmu_wave.h.

231 {
232 return EvmuWave_wasLogic(pSelf, EVMU_LOGIC_X);
233}

◆ EvmuWave_wasLogicValid()

static GblBool EvmuWave_wasLogicValid ( const GblEnum * pSelf)
inlinestatic

Definition at line 240 of file evmu_wave.h.

240 {
241 return EvmuWave_wasLogicActive(pSelf) && EvmuWave_wasLogicKnown(pSelf);
242}