|
Packit Service |
b98cfc |
/*
|
|
Packit Service |
b98cfc |
* EMU10k1 loader lib
|
|
Packit Service |
b98cfc |
* Copyright (c) 2003,2004 by Peter Zubaj
|
|
Packit Service |
b98cfc |
*
|
|
Packit Service |
b98cfc |
*
|
|
Packit Service |
b98cfc |
* This library is free software; you can redistribute it and/or modify
|
|
Packit Service |
b98cfc |
* it under the terms of the GNU Lesser General Public License as
|
|
Packit Service |
b98cfc |
* published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
b98cfc |
* the License, or (at your option) any later version.
|
|
Packit Service |
b98cfc |
*
|
|
Packit Service |
b98cfc |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
b98cfc |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
b98cfc |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
b98cfc |
* GNU Lesser General Public License for more details.
|
|
Packit Service |
b98cfc |
*
|
|
Packit Service |
b98cfc |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
b98cfc |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
b98cfc |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit Service |
b98cfc |
*
|
|
Packit Service |
b98cfc |
*/
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#ifndef __LIBLO10K1EF_H
|
|
Packit Service |
b98cfc |
#define __LIBLO10K1EF_H
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#ifdef __cplusplus
|
|
Packit Service |
b98cfc |
extern "C" {
|
|
Packit Service |
b98cfc |
#endif
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct {
|
|
Packit Service |
b98cfc |
unsigned int sc;
|
|
Packit Service |
b98cfc |
unsigned int sc_val;
|
|
Packit Service |
b98cfc |
} liblo10k1_emu_sc_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct {
|
|
Packit Service |
b98cfc |
unsigned int ctl;
|
|
Packit Service |
b98cfc |
unsigned int ctl_val;
|
|
Packit Service |
b98cfc |
unsigned int ctl_val_min;
|
|
Packit Service |
b98cfc |
unsigned int ctl_val_max;
|
|
Packit Service |
b98cfc |
char ctl_name[32];
|
|
Packit Service |
b98cfc |
} liblo10k1_emu_ctl_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct {
|
|
Packit Service |
b98cfc |
unsigned int line;
|
|
Packit Service |
b98cfc |
unsigned int line_size;
|
|
Packit Service |
b98cfc |
} liblo10k1_emu_tram_line_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct {
|
|
Packit Service |
b98cfc |
unsigned int size;
|
|
Packit Service |
b98cfc |
unsigned int read_line_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_tram_line_t *read_lines;
|
|
Packit Service |
b98cfc |
unsigned int write_line_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_tram_line_t *write_lines;
|
|
Packit Service |
b98cfc |
} liblo10k1_emu_tram_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct {
|
|
Packit Service |
b98cfc |
unsigned int op;
|
|
Packit Service |
b98cfc |
unsigned int arg[4];
|
|
Packit Service |
b98cfc |
} liblo10k1_emu_instr_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct {
|
|
Packit Service |
b98cfc |
char patch_name[32];
|
|
Packit Service |
b98cfc |
unsigned int in_count;
|
|
Packit Service |
b98cfc |
unsigned int *ins;
|
|
Packit Service |
b98cfc |
unsigned int out_count;
|
|
Packit Service |
b98cfc |
unsigned int *outs;
|
|
Packit Service |
b98cfc |
unsigned int dyn_count;
|
|
Packit Service |
b98cfc |
unsigned int *dyns;
|
|
Packit Service |
b98cfc |
unsigned int sta_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_sc_t *stas;
|
|
Packit Service |
b98cfc |
unsigned int ctl_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_ctl_t *ctls;
|
|
Packit Service |
b98cfc |
unsigned int con_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_sc_t *cons;
|
|
Packit Service |
b98cfc |
unsigned int tram_lookup_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_tram_t *tram_lookups;
|
|
Packit Service |
b98cfc |
unsigned int tram_delay_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_tram_t *tram_delays;
|
|
Packit Service |
b98cfc |
unsigned int instr_count;
|
|
Packit Service |
b98cfc |
liblo10k1_emu_instr_t *instrs;
|
|
Packit Service |
b98cfc |
} liblo10k1_emu_patch_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
liblo10k1_emu_patch_t *liblo10k1_emu_new_patch();
|
|
Packit Service |
b98cfc |
void liblo10k1_emu_free_patch(liblo10k1_emu_patch_t *p);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_in_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_out_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_dyn_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_sta_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_ctl_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_con_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_lookup_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_delay_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_instr_count(liblo10k1_emu_patch_t *p, int count);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_patch_set_line_count(liblo10k1_emu_tram_t *t, int write, int count);
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_load_patch(char *file_name, liblo10k1_emu_patch_t **p);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
typedef struct
|
|
Packit Service |
b98cfc |
{
|
|
Packit Service |
b98cfc |
int emu_ctls[32];
|
|
Packit Service |
b98cfc |
int emu_ctl_count;
|
|
Packit Service |
b98cfc |
char ctl_name[44];
|
|
Packit Service |
b98cfc |
} liblo10k1_ctl_transform_t;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
int liblo10k1_emu_transform_patch(liblo10k1_emu_patch_t *ep, liblo10k1_ctl_transform_t *tctl, int tctl_count, liblo10k1_dsp_patch_t **lp);
|
|
Packit Service |
b98cfc |
int liblo10k1_patch_find_ctl_by_name(liblo10k1_dsp_patch_t *p, char *ctl_name);
|
|
Packit Service |
b98cfc |
int liblo10k1_patch_ctl_set_trans(liblo10k1_dsp_patch_t *p, int idx, int trans);
|
|
Packit Service |
b98cfc |
int liblo10k1_patch_ctl_set_vcount(liblo10k1_dsp_patch_t *p, int idx, int vc);
|
|
Packit Service |
b98cfc |
int liblo10k1_patch_ctl_set_index(liblo10k1_dsp_patch_t *p, int idx, int i);
|
|
Packit Service |
b98cfc |
int liblo10k1_patch_ctl_set_value(liblo10k1_dsp_patch_t *p, int idx, int vi, int val);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_OPEN -1000 /* error at file open */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_STAT -1001 /* error at file stat */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_SIZE -1002 /* wrong file size */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_READ -1003 /* error at file read */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_SIGNATURE -1004 /* wrong file signature */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_FORMAT -1005 /* wrong file format */
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_TRANSFORM_CTL -1100 /* wrong ctl transformation */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_TRANSFORM -1101 /* wrong transformation */
|
|
Packit Service |
b98cfc |
#define LD10K1_EF_ERR_TRANSFORM_TRANS -1102 /* wrong ctl translation */
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#ifdef __cplusplus
|
|
Packit Service |
b98cfc |
}
|
|
Packit Service |
b98cfc |
#endif
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#endif /* __LIBLO10K1EF_H */
|