Sélectionner une révision Git
-
Elliu a rédigé
For now it's not correct as it's calculating from pixels instead of from ms, will need to rethink the way audio information is stored to fix it
Elliu a rédigéFor now it's not correct as it's calculating from pixels instead of from ms, will need to rethink the way audio information is stored to fix it
logdef.h 6,90 Kio
#ifndef LOGDEF_H
#define LOGDEF_H
#include <utils/p2c.h>
#include <graphics/mylib.h>
#include <utils/strlist.h>
#include <utils/newasm.h>
#ifdef LOGDEF_G
# define vextern
#else
# define vextern extern
#endif
typedef struct log_action_t log_action_t;
#define log_maxpages 9 /* Maximum page number */
#define log_maxpins 255 /* Maximum number of pins on a gate */
#define log_lablen 255 /* Maximum length of labels */
#define log_scale0 5 /* Unzoomed size of grid */
#define log_kindoffset 256 /* Offset of rotation factor */
#define log_maxshint 32767 /* Largest short-integer */
#define log_million 1000000L /* Very large array size */
#define log_version "5.61" /* LOG version number */
#define Debugging false /* Compile with DEBUG option */
#define Checking true /* Compile with range checking, etc. */
#define log_gray 0 /* Background */
#define log_red 1
#define log_green 2
#define log_yellow 3 /* RGB colors */
#define log_mred 4
#define log_orange 5
#define log_cyan 6
#define log_white 7
#define log_black 8
#define log_pink 9
#define log_dyellow 10 /* Dim yellow */
#define log_xgreen 11 /* Green for XOR-wires */
#define log_dcyan 12 /* Dim cyan */
#define log_dred 13 /* Dim red */
#define log_lgray 14
#define log_cred 15 /* Conflict */
#define log_black8 5 /* Black for 8-color screens */
#define log_cred8 4 /* Conflict for 8-color screens */
#define log_page_cat (-1) /* Values for showpage */
#define log_page_history (-2)
#define log_nullsimtype 0 /* Simtype of inert gates */
#define log_commonsimtype 1 /* Simtype of TO/FROM gates */
#define log_timesimtype 2 /* Simtype of TIME gate */
#define log_wcol_normal 0
#define log_wcol_green 1
#define log_wcol_yellow 2
#define log_wcol_red 3
#define log_wcol_blue 4
typedef short log_zoomtab[5];
typedef short log_rottab[8];
vextern const log_rottab log_rotxx;
vextern const log_rottab log_rotxy;
vextern const log_rottab log_rotyx;
vextern const log_rottab log_rotyy;
vextern const log_rottab log_irotxx;
vextern const log_rottab log_irotxy;
vextern const log_rottab log_irotyx;
vextern const log_rottab log_irotyy;
vextern const log_zoomtab zoomscales;
typedef char log_pac4[4];
typedef char log_pac8[8];
typedef union log_kflags {
short i;
unsigned short a;
struct {
unsigned noflip : 1; /* gate can't be flipped/rotated */
unsigned toggle : 1; /* gate is a toggle switch */
unsigned visible : 1; /* visible even in invisible mode */
unsigned named : 1; /* has a to/from signal name */
unsigned nright : 1; /* to/from name is right-justified */
unsigned nosolder : 1; /* don't add solder in LPLOT */
unsigned f6 : 1, f7 : 1, f8 : 1, f9 : 1, f10 : 1, f11 : 1, f12 : 1,
expanded : 1;
/* gate uses expanded format in GATES file */
unsigned user1 : 1, user2 : 1; /* simtype-defined flags */
} U3;
} log_kflags;
typedef struct log_vectorrec {
char vkind;
schar numcoords, x1, y1;
union {
struct {
schar x2, y2, x3, y3, x4, y4;
} U99;
struct {
uchar ux2, uy2, num;
} U98;
struct {
uchar tsize, torg;
char *sp;
} U116;
} UU;
} log_vectorrec;
typedef struct log_pinrec {
schar x, y, s;
uchar c;
} log_pinrec;
typedef struct log_pnumrec {
schar x, y;
short num;
} log_pnumrec;
typedef struct log_kattrrec {
unsigned blnk : 1, opt : 1; /*default is blank, value is optional*/
uchar prec; /*display precision (# digits)*/
uchar vr, vra; /*variant number, variant attribute*/
uchar x, y; /*alpha coords*/
uchar dtype;
union {
struct {
double r;
char u[4];
} U82;
struct {
long i1, i2;
} U73;
char *c;
char *sp;
unsigned b : 1 ;
struct {
strlist_t *v;
short nv, dv;
} U86;
} UU;
} log_kattrrec;
typedef struct log_gattrrec {
uchar x2;
unsigned blnk : 1, supr : 1;
/*, touched*/
unsigned changed : 1;
union {
double r;
struct {
long i1, i2;
} U73;
char *c;
char *sp;
unsigned b : 1 ;
short nv;
} UU;
} log_gattrrec; /* Gate attribute entry */
/* Pointer to globals */
/* Pointer to gate-kind */
/* Pointer to tool record */
/* Pointer to history timestep */
/* Pointer to history name */
/* Pointer to node */
/* Pointer to signal name */
/* Pointer to horizontal wire */
/* Pointer to vertical wire */
/* Pointer to solder point */
/* Pointer to gate */
/* Pointer to label */
/* Pointer to dashed box */
/* Pointer to sensitive region */
typedef struct log_krec {
na_long info;
uchar *proc;
log_kattrrec *attr;
struct log_tool *simtype;
char name[9];
uchar group;
short dummy1, dummy2, numvects, numpins, numpnums, numattrs;
log_kflags flag;
schar x1, y1, x2, y2;
long code;
strlist_t *lbl;
log_vectorrec *vector;
log_pinrec *pin;
log_pnumrec *pnum;
struct log_krec *next;
schar bbx1, bby1, bbx2, bby2; /*7/14/88*/
short bbmax; /*7/14/88*/
long bigprocsize, biglblsize, bigvectsize;
strlist_t **pinnames;
} log_krec;
typedef struct log_pinposrec {
short x, y;
} log_pinposrec;
typedef struct log_nrec log_nrec; /* Node */
typedef struct log_sigrec {
char *name;
unsigned f : 1, keep : 1, f5 : 1, f4 : 1, f3 : 1, f2 : 1, f1 : 1, f0 : 1;
na_long temp;
log_nrec *np; /* Node value */
} log_sigrec; /* Signal name */
typedef struct log_htrec {
struct log_htrec *next;
double time;
void *val[log_million]; /*NEWFP shortreals*/
} log_htrec; /* History timestep */
typedef struct log_hnrec {
short y, sig, num;
log_gattrrec *attr;
struct log_hnrec *next;
} log_hnrec; /* History name */
typedef struct log_brec {
short x1, y1, x2, y2;
struct log_brec *next;
na_long temp;
unsigned f7 : 1, f6 : 1, f5 : 1, f4 : 1, f3 : 1, f2 : 1, f1 : 1, f0 : 1;
} log_brec; /* Dashed box */
typedef enum {
simst_null, simst_off, simst_notactive, simst_notready, simst_running
} log_simstatekinds;
typedef struct log_colorrec {
short backgr, cursor, gate, dimgate, kindgate, catgate, gatepin, pinnum;
short wire[log_wcol_blue - log_wcol_normal + 1];
short xwire, solder, conflict, menuword, selword, message, baseline,
curbaseline, page1, page2, page3, page4, select, signal, scroll,
labeltext, dashbox, marker, chart, division, popupbox, popupword,
popupsel, redword, blueword, vlsicut;
} log_colorrec;
typedef struct log_tool {
char name[17];
void (*proc) (log_action_t *act);
char *fname, *comment;
char *shortname;
unsigned ready : 1, simulator : 1, keep : 1, nostatus : 1, tstepflag : 1;
uchar simtype;
double nexttstep;
strlist_t *nlbl, *hlbl;
short nnumattrs, hnumattrs;
log_kattrrec *nattr, *hattr;
na_long info;
struct log_tool *next;
long netstamp; /* Changes to circuit network */
double deltatime;
} log_tool;
#undef vextern
#include <log_action.h>
#endif /*LOGDEF_H*/
/* End. */