RetroArch
Classes | Functions | Variables
ibxm.c File Reference
#include "stdlib.h"
#include "string.h"
#include "ibxm.h"
Include dependency graph for ibxm.c:
This graph shows which files directly or indirectly include this file:

Classes

struct  note
 
struct  channel
 
struct  replay
 

Functions

static int exp_2 (int x)
 
static int log_2 (int x)
 
static char * data_ascii (struct data *data, int offset, int length, char *dest)
 
static int data_s8 (struct data *data, int offset)
 
static int data_u8 (struct data *data, int offset)
 
static int data_u16be (struct data *data, int offset)
 
static int data_u16le (struct data *data, int offset)
 
static unsigned int data_u32le (struct data *data, int offset)
 
static void data_sam_s8 (struct data *data, int offset, int count, short *dest)
 
static void data_sam_s16le (struct data *data, int offset, int count, short *dest)
 
static int envelope_next_tick (struct envelope *envelope, int tick, int key_on)
 
static int envelope_calculate_ampl (struct envelope *envelope, int tick)
 
static void sample_ping_pong (struct sample *sample)
 
void dispose_module (struct module *module)
 
static struct modulemodule_load_xm (struct data *data, char *message)
 
static struct modulemodule_load_s3m (struct data *data, char *message)
 
static struct modulemodule_load_mod (struct data *data, char *message)
 
struct modulemodule_load (struct data *data, char *message)
 
static void pattern_get_note (struct pattern *pattern, int row, int chan, struct note *dest)
 
static void channel_init (struct channel *channel, struct replay *replay, int idx)
 
static void channel_volume_slide (struct channel *channel)
 
static void channel_porta_up (struct channel *channel, int param)
 
static void channel_porta_down (struct channel *channel, int param)
 
static void channel_tone_porta (struct channel *channel)
 
static int channel_waveform (struct channel *channel, int phase, int type)
 
static void channel_vibrato (struct channel *channel, int fine)
 
static void channel_tremolo (struct channel *channel)
 
static void channel_tremor (struct channel *channel)
 
static void channel_retrig_vol_slide (struct channel *channel)
 
static void channel_trigger (struct channel *channel)
 
static void channel_update_envelopes (struct channel *channel)
 
static void channel_auto_vibrato (struct channel *channel)
 
static void channel_calculate_freq (struct channel *channel)
 
static void channel_calculate_ampl (struct channel *channel)
 
static void channel_tick (struct channel *channel)
 
static void channel_row (struct channel *channel, struct note *note)
 
static void channel_resample (struct channel *channel, int *mix_buf, int offset, int count, int sample_rate, int interpolate)
 
static void channel_update_sample_idx (struct channel *channel, int count, int sample_rate)
 
static void replay_row (struct replay *replay)
 
static int replay_tick (struct replay *replay)
 
static int module_init_play_count (struct module *module, char **play_count)
 
void replay_set_sequence_pos (struct replay *replay, int pos)
 
void dispose_replay (struct replay *replay)
 
struct replaynew_replay (struct module *module, int sample_rate, int interpolation)
 
static int calculate_tick_len (int tempo, int sample_rate)
 
int calculate_mix_buf_len (int sample_rate)
 
int replay_calculate_duration (struct replay *replay)
 
int replay_seek (struct replay *replay, int sample_pos)
 
static void replay_volume_ramp (struct replay *replay, int *mix_buf, int tick_len)
 
static void downsample (int *buf, int count)
 
int replay_get_audio (struct replay *replay, int *mix_buf)
 

Variables

const char * IBXM_VERSION = "ibxm/ac mod/xm/s3m replay 20170901 (c)mumart@gmail.com"
 
static const int FP_SHIFT = 15
 
static const int FP_ONE = 32768
 
static const int FP_MASK = 32767
 
static const int exp2_table []
 
static const short sine_table []
 

Function Documentation

◆ calculate_mix_buf_len()

int calculate_mix_buf_len ( int  sample_rate)
Here is the call graph for this function:

◆ calculate_tick_len()

static int calculate_tick_len ( int  tempo,
int  sample_rate 
)
static
Here is the caller graph for this function:

◆ channel_auto_vibrato()

static void channel_auto_vibrato ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_calculate_ampl()

static void channel_calculate_ampl ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_calculate_freq()

static void channel_calculate_freq ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_init()

static void channel_init ( struct channel channel,
struct replay replay,
int  idx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_porta_down()

static void channel_porta_down ( struct channel channel,
int  param 
)
static
Here is the caller graph for this function:

◆ channel_porta_up()

static void channel_porta_up ( struct channel channel,
int  param 
)
static
Here is the caller graph for this function:

◆ channel_resample()

static void channel_resample ( struct channel channel,
int *  mix_buf,
int  offset,
int  count,
int  sample_rate,
int  interpolate 
)
static
Here is the caller graph for this function:

◆ channel_retrig_vol_slide()

static void channel_retrig_vol_slide ( struct channel channel)
static
Here is the caller graph for this function:

◆ channel_row()

static void channel_row ( struct channel channel,
struct note note 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_tick()

static void channel_tick ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_tone_porta()

static void channel_tone_porta ( struct channel channel)
static
Here is the caller graph for this function:

◆ channel_tremolo()

static void channel_tremolo ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_tremor()

static void channel_tremor ( struct channel channel)
static
Here is the caller graph for this function:

◆ channel_trigger()

static void channel_trigger ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_update_envelopes()

static void channel_update_envelopes ( struct channel channel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_update_sample_idx()

static void channel_update_sample_idx ( struct channel channel,
int  count,
int  sample_rate 
)
static
Here is the caller graph for this function:

◆ channel_vibrato()

static void channel_vibrato ( struct channel channel,
int  fine 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ channel_volume_slide()

static void channel_volume_slide ( struct channel channel)
static
Here is the caller graph for this function:

◆ channel_waveform()

static int channel_waveform ( struct channel channel,
int  phase,
int  type 
)
static
Here is the caller graph for this function:

◆ data_ascii()

static char* data_ascii ( struct data data,
int  offset,
int  length,
char *  dest 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ data_s8()

static int data_s8 ( struct data data,
int  offset 
)
static
Here is the caller graph for this function:

◆ data_sam_s16le()

static void data_sam_s16le ( struct data data,
int  offset,
int  count,
short *  dest 
)
static
Here is the caller graph for this function:

◆ data_sam_s8()

static void data_sam_s8 ( struct data data,
int  offset,
int  count,
short *  dest 
)
static
Here is the caller graph for this function:

◆ data_u16be()

static int data_u16be ( struct data data,
int  offset 
)
static
Here is the caller graph for this function:

◆ data_u16le()

static int data_u16le ( struct data data,
int  offset 
)
static
Here is the caller graph for this function:

◆ data_u32le()

static unsigned int data_u32le ( struct data data,
int  offset 
)
static
Here is the caller graph for this function:

◆ data_u8()

static int data_u8 ( struct data data,
int  offset 
)
static
Here is the caller graph for this function:

◆ dispose_module()

void dispose_module ( struct module module)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dispose_replay()

void dispose_replay ( struct replay replay)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ downsample()

static void downsample ( int *  buf,
int  count 
)
static
Here is the caller graph for this function:

◆ envelope_calculate_ampl()

static int envelope_calculate_ampl ( struct envelope envelope,
int  tick 
)
static
Here is the caller graph for this function:

◆ envelope_next_tick()

static int envelope_next_tick ( struct envelope envelope,
int  tick,
int  key_on 
)
static
Here is the caller graph for this function:

◆ exp_2()

static int exp_2 ( int  x)
static
Here is the caller graph for this function:

◆ log_2()

static int log_2 ( int  x)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ module_init_play_count()

static int module_init_play_count ( struct module module,
char **  play_count 
)
static
Here is the caller graph for this function:

◆ module_load()

struct module* module_load ( struct data data,
char *  message 
)
Here is the call graph for this function:

◆ module_load_mod()

static struct module* module_load_mod ( struct data data,
char *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ module_load_s3m()

static struct module* module_load_s3m ( struct data data,
char *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ module_load_xm()

static struct module* module_load_xm ( struct data data,
char *  message 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ new_replay()

struct replay* new_replay ( struct module module,
int  sample_rate,
int  interpolation 
)
Here is the call graph for this function:

◆ pattern_get_note()

static void pattern_get_note ( struct pattern pattern,
int  row,
int  chan,
struct note dest 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replay_calculate_duration()

int replay_calculate_duration ( struct replay replay)
Here is the call graph for this function:

◆ replay_get_audio()

int replay_get_audio ( struct replay replay,
int *  mix_buf 
)
Here is the call graph for this function:

◆ replay_row()

static void replay_row ( struct replay replay)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replay_seek()

int replay_seek ( struct replay replay,
int  sample_pos 
)
Here is the call graph for this function:

◆ replay_set_sequence_pos()

void replay_set_sequence_pos ( struct replay replay,
int  pos 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replay_tick()

static int replay_tick ( struct replay replay)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replay_volume_ramp()

static void replay_volume_ramp ( struct replay replay,
int *  mix_buf,
int  tick_len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sample_ping_pong()

static void sample_ping_pong ( struct sample sample)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ exp2_table

const int exp2_table[]
static
Initial value:
= {
32768, 32946, 33125, 33305, 33486, 33667, 33850, 34034,
34219, 34405, 34591, 34779, 34968, 35158, 35349, 35541,
35734, 35928, 36123, 36319, 36516, 36715, 36914, 37114,
37316, 37518, 37722, 37927, 38133, 38340, 38548, 38757,
38968, 39180, 39392, 39606, 39821, 40037, 40255, 40473,
40693, 40914, 41136, 41360, 41584, 41810, 42037, 42265,
42495, 42726, 42958, 43191, 43425, 43661, 43898, 44137,
44376, 44617, 44859, 45103, 45348, 45594, 45842, 46091,
46341, 46593, 46846, 47100, 47356, 47613, 47871, 48131,
48393, 48655, 48920, 49185, 49452, 49721, 49991, 50262,
50535, 50810, 51085, 51363, 51642, 51922, 52204, 52488,
52773, 53059, 53347, 53637, 53928, 54221, 54515, 54811,
55109, 55408, 55709, 56012, 56316, 56622, 56929, 57238,
57549, 57861, 58176, 58491, 58809, 59128, 59449, 59772,
60097, 60423, 60751, 61081, 61413, 61746, 62081, 62419,
62757, 63098, 63441, 63785, 64132, 64480, 64830, 65182,
65536
}

◆ FP_MASK

const int FP_MASK = 32767
static

◆ FP_ONE

const int FP_ONE = 32768
static

◆ FP_SHIFT

const int FP_SHIFT = 15
static

◆ IBXM_VERSION

const char* IBXM_VERSION = "ibxm/ac mod/xm/s3m replay 20170901 (c)mumart@gmail.com"

◆ sine_table

const short sine_table[]
static
Initial value:
= {
0, 24, 49, 74, 97, 120, 141, 161, 180, 197, 212, 224, 235, 244, 250, 253,
255, 253, 250, 244, 235, 224, 212, 197, 180, 161, 141, 120, 97, 74, 49, 24
}