Changeset 57425b6 in buchla-68k for ram


Ignore:
Timestamp:
11/12/2017 09:16:54 PM (6 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
522c363
Parents:
e2707e9
Message:

Fixed uslice.c.

Location:
ram
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ram/swinit.c

    re2707e9 r57425b6  
    1010#include "ram.h"
    1111
    12 BOOL    se_chg;                 /* Score free list changed flag */
     12BOOL            se_chg;                 /* Score free list changed flag */
    1313
    14 LPF     (*oldsw)[];             /* saved swpt value */
    15 LPF     (*swpt)[];              /* switch dispatch table pointer */
     14LPF             (*oldsw)[];             /* saved swpt value */
     15LPF             (*swpt)[];              /* switch dispatch table pointer */
    1616
    17 LPF     aswtbl[14];             /* assignment switch table */
     17LPF             aswtbl[14];             /* assignment switch table */
    1818
    19 void    (*curmove)(void);       /* cursor move function */
    20 int16_t (*curtype)(void);       /* cursor type function */
    21 void    (*cx_key)(void);        /* x rate calculation */
    22 void    (*cx_upd)(void);        /* x update */
    23 void    (*cy_key)(void);        /* y rate calculation */
    24 void    (*cy_upd)(void);        /* y update */
    25 void    (*d_key)(int16_t k);    /* in-field data key processor */
    26 void    (*e_key)(void);         /* E key processor */
    27 void    (*m_key)(void);         /* M key processor */
    28 void    (*itxput)(int16_t row, int16_t col, int8_t *txt, int16_t tag);
     19void            (*curmove)(void);       /* cursor move function */
     20int16_t         (*curtype)(void);       /* cursor type function */
     21void            (*cx_key)(void);        /* x rate calculation */
     22void            (*cx_upd)(void);        /* x update */
     23void            (*cy_key)(void);        /* y rate calculation */
     24void            (*cy_upd)(void);        /* y update */
     25void            (*d_key)(int16_t k);    /* in-field data key processor */
     26void            (*e_key)(void);         /* E key processor */
     27void            (*m_key)(void);         /* M key processor */
     28void            (*itxput)(int16_t row, int16_t col, int8_t *txt, int16_t tag);
    2929                                /* instrument menu text put function */
    30 int16_t (*not_fld)(int16_t k);  /* not-in-field data key processor */
    31 void    (*olddkey)(int16_t k);  /* saved d_key value */
    32 void    (*oldekey)(void);       /* saved e_key value */
    33 void    (*oldmkey)(void);       /* saved m_key value */
    34 void    (*oldxkey)(void);       /* saved x_key value */
    35 void    (*premove)(void);       /* cursor pre-move function */
    36 void    (*pstmove)(void);       /* cursor post-move function */
    37 vtcurs  vt_adv;                 /* vtyper data cursor advance function */
    38 vtcurs  vt_bsp;                 /* vtyper data cursor backspace function */
    39 vtcurs  vt_cdn;                 /* vtyper data cursor down function */
    40 vtcurs  vt_cup;                 /* vtyper data cursor up function */
    41 vtchar  vt_dsp;                 /* vtyper display function */
    42 vtcurs  vt_stop;                /* vtyper exit function */
    43 void    (*x_key)(void);         /* X key processor */
    44 void    (*xy_dn)(void);         /* cursor - finger on (down) */
    45 void    (*xy_up)(void);         /* cursor - finger off (up) */
     30int16_t         (*not_fld)(int16_t k);  /* not-in-field data key processor */
     31void            (*olddkey)(int16_t k);  /* saved d_key value */
     32void            (*oldekey)(void);       /* saved e_key value */
     33void            (*oldmkey)(void);       /* saved m_key value */
     34void            (*oldxkey)(void);       /* saved x_key value */
     35void            (*premove)(void);       /* cursor pre-move function */
     36void            (*pstmove)(void);       /* cursor post-move function */
     37vtcurs          vt_adv;                 /* vtyper data cursor advance function */
     38vtcurs          vt_bsp;                 /* vtyper data cursor backspace function */
     39vtcurs          vt_cdn;                 /* vtyper data cursor down function */
     40vtcurs          vt_cup;                 /* vtyper data cursor up function */
     41vtchar          vt_dsp;                 /* vtyper display function */
     42vtcurs          vt_stop;                /* vtyper exit function */
     43void            (*x_key)(void);         /* X key processor */
     44void            (*xy_dn)(void);         /* cursor - finger on (down) */
     45void            (*xy_up)(void);         /* cursor - finger off (up) */
    4646
    47 int16_t *cratex;                /* cursor x rate table pointer */
    48 int16_t *cratey;                /* cursor x rate table pointer */
     47int16_t         *cratex;                /* cursor x rate table pointer */
     48int16_t         *cratey;                /* cursor x rate table pointer */
    4949
    50 int16_t BotEdge;                /* configuration box bottom edge */
    51 int16_t LftEdge;                /* configuration box left edge */
    52 int16_t RgtEdge;                /* configuration box right edge */
    53 int16_t TopEdge;                /* configuration box top edge */
     50int16_t         BotEdge;                /* configuration box bottom edge */
     51int16_t         LftEdge;                /* configuration box left edge */
     52int16_t         RgtEdge;                /* configuration box right edge */
     53int16_t         TopEdge;                /* configuration box top edge */
    5454
    55 int16_t BarBcur[14];            /* current bottom-zero bar values */
    56 int16_t BarCcur[14];            /* current centered-zero bar values */
    57 int16_t BGeq[14];               /* current EQ bar settings */
    58 int16_t BGother[14];            /* current other pot bar settings */
    59 int16_t BGprmtr[14];            /* current parameter pot bar settings */
     55int16_t         BarBcur[14];            /* current bottom-zero bar values */
     56int16_t         BarCcur[14];            /* current centered-zero bar values */
     57int16_t         BGeq[14];               /* current EQ bar settings */
     58int16_t         BGother[14];            /* current other pot bar settings */
     59int16_t         BGprmtr[14];            /* current parameter pot bar settings */
    6060
    61 int16_t articen[12];            /* voice articulation enable status */
    62 int16_t grpdyn[12];             /* group dynamics table (0..9) */
    63 int16_t grploc[12];             /* group location table (0..8) */
    64 int16_t grpmode[12];            /* group mode - 0 = play, 1 = stdby, 2 = rec */
    65 int16_t grpsel[12];             /* group select status for instrument selection */
    66 int16_t grpstat[12];            /* group status - 0 = off, non-0 = on */
    67 int16_t grptmap[12];            /* group map */
    68 int16_t gtctab[12];             /* group to color table */
    69 int16_t ins2grp[12];            /* instrument to group table (00..NINST-1) */
    70 int16_t instmod[12];            /* intrument data modified */
    71 int16_t key2grp[88];            /* port 1 key to group assignment table */
    72 int16_t lastart[16];            /* last articulation values (by parameter) */
    73 int16_t lastvce[12];            /* last voice assigned in each group */
    74 int16_t lastvel[12];            /* last velocity sent to group */
    75 int16_t ldmap[N_SCORES];        /* gather read map */
    76 int16_t mctlnum[4];             /* MIDI controller number table (-1, 00..99) */
    77 int16_t mpbend[48];             /* MIDI pitch bend data, by port and channel */
    78 int16_t msmstv[3];              /* MIDI state machine state variables */
    79 int16_t offsets[NUMWPCAL];      /* offsets for current waveshape */
    80 int16_t oldtun[128];            /* previous tuning table for undo */
    81 int16_t prstab[NTRIGS];         /* pressure */
    82 int16_t s_inst[12];             /* instrument selections */
    83 int16_t s_trns[12];             /* current transposition values */
    84 int16_t swfifo[NSWFIFO];        /* scroll wheel fifo */
    85 int16_t txfifo[NTKFIFO];        /* trackball X fifo */
    86 int16_t tyfifo[NTKFIFO];        /* trackball Y fifo */
    87 int16_t tuntab[128];            /* current tuning table */
    88 int16_t vce2grp[12];            /* voice to group table (-1, 1..12)*/
    89 int16_t vce2trg[12];            /* voice to trigger map (-1 EQ NULL) */
    90 int16_t veltab[NTRIGS];         /* velocity */
    91 int16_t vmtab[NUMHARM];         /* harmonics for current waveshape */
    92 int16_t wsbuf[NUMWPCAL];        /* final values for current waveshape */
     61int16_t         articen[12];            /* voice articulation enable status */
     62int16_t         grpdyn[12];             /* group dynamics table (0..9) */
     63int16_t         grploc[12];             /* group location table (0..8) */
     64int16_t         grpmode[12];            /* group mode - 0 = play, 1 = stdby, 2 = rec */
     65int16_t         grpsel[12];             /* group select status for instrument selection */
     66int16_t         grpstat[12];            /* group status - 0 = off, non-0 = on */
     67int16_t         grptmap[12];            /* group map */
     68uint16_t        gtctab[12];             /* group to color table */
     69int16_t         ins2grp[12];            /* instrument to group table (00..NINST-1) */
     70int16_t         instmod[12];            /* intrument data modified */
     71int16_t         key2grp[88];            /* port 1 key to group assignment table */
     72int16_t         lastart[16];            /* last articulation values (by parameter) */
     73int16_t         lastvce[12];            /* last voice assigned in each group */
     74int16_t         lastvel[12];            /* last velocity sent to group */
     75int16_t         ldmap[N_SCORES];        /* gather read map */
     76int16_t         mctlnum[4];             /* MIDI controller number table (-1, 00..99) */
     77int16_t         mpbend[48];             /* MIDI pitch bend data, by port and channel */
     78int16_t         msmstv[3];              /* MIDI state machine state variables */
     79int16_t         offsets[NUMWPCAL];      /* offsets for current waveshape */
     80int16_t         oldtun[128];            /* previous tuning table for undo */
     81int16_t         prstab[NTRIGS];         /* pressure */
     82int16_t         s_inst[12];             /* instrument selections */
     83int16_t         s_trns[12];             /* current transposition values */
     84int16_t         swfifo[NSWFIFO];        /* scroll wheel fifo */
     85int16_t         txfifo[NTKFIFO];        /* trackball X fifo */
     86int16_t         tyfifo[NTKFIFO];        /* trackball Y fifo */
     87int16_t         tuntab[128];            /* current tuning table */
     88int16_t         vce2grp[12];            /* voice to group table (-1, 1..12)*/
     89int16_t         vce2trg[12];            /* voice to trigger map (-1 EQ NULL) */
     90int16_t         veltab[NTRIGS];         /* velocity */
     91int16_t         vmtab[NUMHARM];         /* harmonics for current waveshape */
     92int16_t         wsbuf[NUMWPCAL];        /* final values for current waveshape */
    9393
    94 int8_t  *lmln22;                /* message window line 22 */
    95 int8_t  *lmln23;                /* message window line 23 */
    96 int8_t  *lmln24;                /* message window line 24 */
    97 int8_t  *vtdeptr;               /* virtual typewriter data entry pointer */
     94int8_t          *lmln22;                /* message window line 22 */
     95int8_t          *lmln23;                /* message window line 23 */
     96int8_t          *lmln24;                /* message window line 24 */
     97int8_t          *vtdeptr;               /* virtual typewriter data entry pointer */
    9898
    99 int8_t  *funcndx[256][2];       /* function header pointers */
    100 int8_t  *vlbptr[3];             /* variable label pointers */
     99int8_t          *funcndx[256][2];       /* function header pointers */
     100int8_t          *vlbptr[3];             /* variable label pointers */
    101101
    102 int8_t  bfs[128];               /* display generation buffer */
    103 int8_t  caname[16];             /* current assignment table name */
    104 int8_t  dspbuf[65];             /* display generation buffer */
    105 int8_t  ebuf[MAXEBUF+1];        /* edit data entry buffer */
    106 int8_t  errbuf[65];             /* error message build area */
    107 int8_t  idbuf[65];              /* display format conversion work area */
    108 int8_t  keystat[24];            /* front panel key status */
    109 int8_t  ldcmnt[38];             /* comment field */
    110 int8_t  ldfile[9];              /* file name field */
    111 int8_t  ldmsg1[65];             /* messsage build area 1 */
    112 int8_t  ldmsg2[65];             /* messsage build area 2 */
    113 int8_t  ldmsg3[65];             /* messsage build area 3 */
    114 int8_t  loadedc[NLTYPES][37];   /* loaded file comments */
    115 int8_t  loadedf[NLTYPES][8];    /* loaded file names */
    116 int8_t  masens[3];              /* MIDI port active sensing flags */
    117 int16_t mctlval[NCTRLS];        /* MIDI controller values */
    118 int16_t mdbyte[3];              /* MIDI data byte buffers */
    119 int8_t  mpsust[48];             /* MIDI sustain status, by port and channel */
    120 int16_t mrstat[3];              /* MIDI running status */
    121 int8_t  scname[N_SCORES][16];   /* Score names */
    122 int8_t  trgtab[NTRIGS];         /* trigger status */
    123 int8_t  tuncurn[33];            /* current tuning table name */
    124 int8_t  tunname[NTUNS][32];     /* tuning table names */
     102int8_t          bfs[128];               /* display generation buffer */
     103int8_t          caname[16];             /* current assignment table name */
     104int8_t          dspbuf[65];             /* display generation buffer */
     105int8_t          ebuf[MAXEBUF+1];        /* edit data entry buffer */
     106int8_t          errbuf[65];             /* error message build area */
     107int8_t          idbuf[65];              /* display format conversion work area */
     108int8_t          keystat[24];            /* front panel key status */
     109int8_t          ldcmnt[38];             /* comment field */
     110int8_t          ldfile[9];              /* file name field */
     111int8_t          ldmsg1[65];             /* messsage build area 1 */
     112int8_t          ldmsg2[65];             /* messsage build area 2 */
     113int8_t          ldmsg3[65];             /* messsage build area 3 */
     114int8_t          loadedc[NLTYPES][37];   /* loaded file comments */
     115int8_t          loadedf[NLTYPES][8];    /* loaded file names */
     116int8_t          masens[3];              /* MIDI port active sensing flags */
     117int16_t         mctlval[NCTRLS];        /* MIDI controller values */
     118int16_t         mdbyte[3];              /* MIDI data byte buffers */
     119int8_t          mpsust[48];             /* MIDI sustain status, by port and channel */
     120int16_t         mrstat[3];              /* MIDI running status */
     121int8_t          scname[N_SCORES][16];   /* Score names */
     122int8_t          trgtab[NTRIGS];         /* trigger status */
     123int8_t          tuncurn[33];            /* current tuning table name */
     124int8_t          tunname[NTUNS][32];     /* tuning table names */
    125125
    126 int32_t *pspool;                /* Score storage pool pointer */
     126int32_t         *pspool;                /* Score storage pool pointer */
    127127
    128 int32_t afi;                    /* analog processor FIFO value */
    129 int32_t curtime;                /* current sqscan time */
    130 int32_t ctime;                  /* time at cursor */
    131 int32_t dvwork;                 /* divide work area */
    132 int32_t frags;                  /* Score storage pool fragment count */
    133 int32_t iotime;                 /* saved lcdtime value */
    134 int32_t lcdontm;                /* LCD backlight on time */
    135 int32_t lcdtime;                /* LCD backlight timer */
    136 int32_t lcsum;                  /* library checksum */
    137 int32_t ndbytes;                /* bytes needed for storage */
    138 int32_t noteoff;                /* note off time */
    139 int32_t noteon;                 /* note on time */
    140 int32_t noteper;                /* note period */
    141 int32_t noteval;                /* note value */
    142 int32_t nrest;                  /* number of rests */
    143 int32_t schksum;                /* Score checksum */
    144 int32_t se1_cnt;                /* Score - free list E_SIZE1 entry count */
    145 int32_t se2_cnt;                /* Score - free list E_SIZE2 entry count */
    146 int32_t se3_cnt;                /* Score - free list E_SIZE3 entry count */
    147 int32_t snbreq;                 /* Score - disk bytes required */
    148 int32_t snlreq;                 /* Score - score bytes required */
    149 int32_t sntbreq;                /* Score - total disk bytes required */
    150 int32_t sntlreq;                /* Score - total score bytes required */
    151 int32_t spcount;                /* Score - storage pool free entry count */
    152 int32_t swcount;                /* scroll wheel counter */
    153 int32_t swrate;                 /* scroll wheel rate */
    154 int32_t swtemp;                 /* scroll wheel work area */
    155 int32_t t_bak;                  /* time at p_bak */
    156 int32_t t_cbgn;                 /* time at p_cbgn */
    157 int32_t t_cend;                 /* time at p_cend */
    158 int32_t t_cur;                  /* time at p_cur */
    159 int32_t t_ctr;                  /* time at p_ctr */
    160 int32_t t_fwd;                  /* time at p_fwd */
    161 int32_t t_ins;                  /* time at peg */
    162 int32_t t_note;                 /* note duration between p_nbeg and p_nend */
    163 int32_t t_sbgn;                 /* time at p_sbgn */
    164 int32_t t_sec1;                 /* time at p_sec1 */
    165 int32_t t_sec2;                 /* time at p_sec2 */
    166 int32_t t_sect;                 /* section time */
    167 int32_t t_send;                 /* time at p_send */
    168 int32_t wshfac;                 /* waveshape scale factor */
     128int32_t         afi;                    /* analog processor FIFO value */
     129int32_t         curtime;                /* current sqscan time */
     130int32_t         ctime;                  /* time at cursor */
     131int32_t         dvwork;                 /* divide work area */
     132int32_t         frags;                  /* Score storage pool fragment count */
     133int32_t         iotime;                 /* saved lcdtime value */
     134int32_t         lcdontm;                /* LCD backlight on time */
     135int32_t         lcdtime;                /* LCD backlight timer */
     136int32_t         lcsum;                  /* library checksum */
     137int32_t         ndbytes;                /* bytes needed for storage */
     138int32_t         noteoff;                /* note off time */
     139int32_t         noteon;                 /* note on time */
     140int32_t         noteper;                /* note period */
     141int32_t         noteval;                /* note value */
     142int32_t         nrest;                  /* number of rests */
     143int32_t         schksum;                /* Score checksum */
     144int32_t         se1_cnt;                /* Score - free list E_SIZE1 entry count */
     145int32_t         se2_cnt;                /* Score - free list E_SIZE2 entry count */
     146int32_t         se3_cnt;                /* Score - free list E_SIZE3 entry count */
     147int32_t         snbreq;                 /* Score - disk bytes required */
     148int32_t         snlreq;                 /* Score - score bytes required */
     149int32_t         sntbreq;                /* Score - total disk bytes required */
     150int32_t         sntlreq;                /* Score - total score bytes required */
     151int32_t         spcount;                /* Score - storage pool free entry count */
     152int32_t         swcount;                /* scroll wheel counter */
     153int32_t         swrate;                 /* scroll wheel rate */
     154int32_t         swtemp;                 /* scroll wheel work area */
     155int32_t         t_bak;                  /* time at p_bak */
     156int32_t         t_cbgn;                 /* time at p_cbgn */
     157int32_t         t_cend;                 /* time at p_cend */
     158int32_t         t_cur;                  /* time at p_cur */
     159int32_t         t_ctr;                  /* time at p_ctr */
     160int32_t         t_fwd;                  /* time at p_fwd */
     161int32_t         t_ins;                  /* time at peg */
     162int32_t         t_note;                 /* note duration between p_nbeg and p_nend */
     163int32_t         t_sbgn;                 /* time at p_sbgn */
     164int32_t         t_sec1;                 /* time at p_sec1 */
     165int32_t         t_sec2;                 /* time at p_sec2 */
     166int32_t         t_sect;                 /* section time */
     167int32_t         t_send;                 /* time at p_send */
     168int32_t         wshfac;                 /* waveshape scale factor */
    169169
    170 int32_t hwave[NUMWPCAL];        /* harmonic waveshape generation buffer */
    171 int32_t nlpersc[N_SCORES];      /* number of longs per score */
    172 int32_t scsums[N_SCORES];       /* score checksums */
    173 int32_t spool[MAX_SE];          /* Score storage pool */
     170int32_t         hwave[NUMWPCAL];        /* harmonic waveshape generation buffer */
     171int32_t         nlpersc[N_SCORES];      /* number of longs per score */
     172int32_t         scsums[N_SCORES];       /* score checksums */
     173int32_t         spool[MAX_SE];          /* Score storage pool */
    174174
    175 int32_t vknm[NUMHARM][NUMWPCAL];        /* scaled harmonics for current ws */
     175int32_t         vknm[NUMHARM][NUMWPCAL];        /* scaled harmonics for current ws */
    176176
    177 int32_t swrmin = SWRMIN;                /* scroll wheel rate threshold */
     177int32_t         swrmin = SWRMIN;                /* scroll wheel rate threshold */
    178178
    179179/*
  • ram/swinit.x

    re2707e9 r57425b6  
    6161extern  int16_t         grpstat[12];
    6262extern  int16_t         grptmap[12];
    63 extern  int16_t         gtctab[12];
     63extern  uint16_t        gtctab[12];
    6464extern  int32_t         hwave[NUMWPCAL];
    6565extern  int8_t          idbuf[65];
  • ram/uslice.c

    re2707e9 r57425b6  
    135135        struct gdsel *gdsep;
    136136        uint16_t i, ncolor, w;
    137         uint16_t *ncptr, *nctabp;
     137        uint16_t *ncptr;
     138        int16_t *nctabp;
    138139        struct gdsel **gdstp, *gdprv, *gdnxt;
    139140        int16_t wrote;
     
    225226                                /* get event color */
    226227
    227                                 ncolor = mask1 & gdsep->note;
     228                                ncolor = mask1 & (uint16_t)gdsep->note;
    228229
    229230                                /* update the slice */
     
    313314void rslice(struct gdsel *gdstb[])
    314315{
    315         register struct gdsel *gdsep;
    316         register struct gdsel **gdstp;
    317         register uint16_t *nctabp;
    318         register uint16_t i, nc;
     316        struct gdsel *gdsep;
     317        struct gdsel **gdstp;
     318        int16_t *nctabp;
     319        uint16_t i;
    319320        struct gdsel *gdprv, *gdnxt;
    320321
     
    347348                                /* update and check update note status code */
    348349
    349                                 if (0 EQ (gdsep->code = nctabp[nc = gdsep->code])) {
     350                                if (0 EQ (gdsep->code = nctabp[gdsep->code])) {
    350351
    351352#if DEBUGIT
     
    509510                                pxptr = &epxtbl[gdsep->code][0];
    510511
    511                                 ncolor = gdsep->note;   /* get event color */
     512                                ncolor = (uint16_t)gdsep->note; /* get event color */
    512513
    513514                                /* update the slice */
Note: See TracChangeset for help on using the changeset viewer.