Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
Macros
spu-adsr.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ATTACK(step, shift, exp)
 
#define DECAY(shift)
 
#define SUSTAIN(step, shift, level, direction, exp)
 
#define RELEASE(shift, exp)
 
#define ADSR_DRAIN_MAX_TICKS   16
 
#define ADSR_ONSET_MAX_SPINS   2000000
 
#define ENVX_INCREMENT   8
 
#define ENVX_MARGIN(step)   ((step) < ENVX_INCREMENT ? ENVX_INCREMENT : (step))
 
#define ASSERT_ENVX_NEAR(nominal, step, got)
 

Macro Definition Documentation

◆ ADSR_DRAIN_MAX_TICKS

#define ADSR_DRAIN_MAX_TICKS   16

◆ ADSR_ONSET_MAX_SPINS

#define ADSR_ONSET_MAX_SPINS   2000000

◆ ASSERT_ENVX_NEAR

#define ASSERT_ENVX_NEAR (   nominal,
  step,
  got 
)
Value:
cester_assert_true((got) >= (uint16_t)((nominal) - ENVX_MARGIN(step)) && \
(got) <= (uint16_t)((nominal) + ENVX_MARGIN(step)))
cester_assert_true(seekDone)
#define ENVX_MARGIN(step)

◆ ATTACK

#define ATTACK (   step,
  shift,
  exp 
)
Value:
(\
(((step) & 3) << 8) | \
(((shift) & 31) << 10) | \
(!!(exp) << 15))

◆ DECAY

#define DECAY (   shift)
Value:
(\
(((shift) & 15) << 4))

◆ ENVX_INCREMENT

#define ENVX_INCREMENT   8

◆ ENVX_MARGIN

#define ENVX_MARGIN (   step)    ((step) < ENVX_INCREMENT ? ENVX_INCREMENT : (step))

◆ RELEASE

#define RELEASE (   shift,
  exp 
)
Value:
(\
(((shift) & 31) << 16) | \
(!!(exp) << 21))

◆ SUSTAIN

#define SUSTAIN (   step,
  shift,
  level,
  direction,
  exp 
)
Value:
(\
(((step) & 3) << 22) | \
(((shift) & 31) << 24) | \
(((level) & 15) << 0) | \
(!!(direction) << 30) | \
(!!(exp) << 31))