Changeset 7258c6a in buchla-68k for ram/instdsp.c


Ignore:
Timestamp:
07/09/2017 04:45:34 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
8618599
Parents:
0292fbb
Message:

Use standard integer types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ram/instdsp.c

    r0292fbb r7258c6a  
    3030/* things defined elsewhere */
    3131
    32 extern  void    (*point)(short x, short y, short pen);
     32extern  void    (*point)(int16_t x, int16_t y, int16_t pen);
    3333
    3434extern  void    fpuint(void);
    35 extern  unsigned        setipl(unsigned arg);
    36 extern  void    cnvc2p(char *buf, short cv);
    37 
    38 extern  unsigned        tofpu(unsigned time);
    39 extern  unsigned        fromfpu(unsigned fputime);
    40 extern  unsigned        exp_c(unsigned c);
    41 
    42 extern  char    *dsimlt(char *buf, short src, short mltval);
    43 
    44 extern  long    rand24(void);
    45 
    46 /*
    47 
    48 */
    49 
    50 extern  short   cxval, cyval, stcrow, stccol, initcfg;
    51 extern  short   curslim, idimsw;
    52 
    53 extern  unsigned        *obj0, *obj2;
    54 
    55 extern  char    bfs[], *srctbl[], sfdsp[];
    56 extern  char    vtlin1[], vtlin2[], vtlin3[];
     35extern  uint16_t        setipl(uint16_t arg);
     36extern  void    cnvc2p(int8_t *buf, int16_t cv);
     37
     38extern  uint16_t        tofpu(uint16_t time);
     39extern  uint16_t        fromfpu(uint16_t fputime);
     40extern  uint16_t        exp_c(uint16_t c);
     41
     42extern  int8_t  *dsimlt(int8_t *buf, int16_t src, int16_t mltval);
     43
     44extern  int32_t rand24(void);
     45
     46/*
     47
     48*/
     49
     50extern  int16_t cxval, cyval, stcrow, stccol, initcfg;
     51extern  int16_t curslim, idimsw;
     52
     53extern  uint16_t        *obj0, *obj2;
     54
     55extern  int8_t  bfs[], *srctbl[], sfdsp[];
     56extern  int8_t  vtlin1[], vtlin2[], vtlin3[];
    5757
    5858extern  struct  sment   sments[];
     
    6060extern  struct  sment   *vpsms[];
    6161
    62 extern  short   s_inst[], vce2trg[], vce2grp[];
    63 
    64 extern  short   curfunc;        /* current function number */
    65 extern  short   curinst;        /* current instrument number */
    66 extern  short   curpnt;         /* current point number (absolute) */
    67 extern  short   curvce;         /* current voice number */
    68 extern  short   idcfsw;         /* copy / fetch menu switch */
    69 extern  short   idintmp;        /* temporary for instrument number */
    70 extern  short   idnamsw;        /* typewriter switch */
    71 extern  short   idsrcsw;        /* source menu switch */
    72 extern  short   npts;           /* number of points in function */
    73 extern  short   pecase;         /* point edit case variable */
    74 extern  short   pntsv;          /* point selection state variable */
    75 extern  short   subj;           /* edited point number (relative) */
    76 extern  short   submenu;        /* submenu cursor switch */
    77 extern  short   temax;          /* time upper limit */
    78 extern  short   temin;          /* time lower limit */
    79 extern  short   vlbtype;        /* type of message window display */
    80 extern  short   wcflag;         /* ws/cf menu type */
    81 extern  short   wcpage;         /* ws/cf menu page */
    82 
    83 extern  short   instmod[12];    /* intrument data modified */
    84 
    85 extern  unsigned *instob;       /* instrument object pointer */
     62extern  int16_t s_inst[], vce2trg[], vce2grp[];
     63
     64extern  int16_t curfunc;        /* current function number */
     65extern  int16_t curinst;        /* current instrument number */
     66extern  int16_t curpnt;         /* current point number (absolute) */
     67extern  int16_t curvce;         /* current voice number */
     68extern  int16_t idcfsw;         /* copy / fetch menu switch */
     69extern  int16_t idintmp;        /* temporary for instrument number */
     70extern  int16_t idnamsw;        /* typewriter switch */
     71extern  int16_t idsrcsw;        /* source menu switch */
     72extern  int16_t npts;           /* number of points in function */
     73extern  int16_t pecase;         /* point edit case variable */
     74extern  int16_t pntsv;          /* point selection state variable */
     75extern  int16_t subj;           /* edited point number (relative) */
     76extern  int16_t submenu;        /* submenu cursor switch */
     77extern  int16_t temax;          /* time upper limit */
     78extern  int16_t temin;          /* time lower limit */
     79extern  int16_t vlbtype;        /* type of message window display */
     80extern  int16_t wcflag;         /* ws/cf menu type */
     81extern  int16_t wcpage;         /* ws/cf menu page */
     82
     83extern  int16_t instmod[12];    /* intrument data modified */
     84
     85extern  uint16_t *instob;       /* instrument object pointer */
    8686
    8787extern  struct  octent *idoct;          /* instrument display octent pointer */
     
    9191extern  struct  instdef vbufs[12];      /* voice instrument buffers */
    9292
    93 extern  char    *funcndx[256][2];       /* function header pointers */
    94 extern  char    *vlbptr[3];             /* variable label pointers */
    95 
    96 extern  char    idbuf[65];              /* display conversion work area */
     93extern  int8_t  *funcndx[256][2];       /* function header pointers */
     94extern  int8_t  *vlbptr[3];             /* variable label pointers */
     95
     96extern  int8_t  idbuf[65];              /* display conversion work area */
    9797
    9898/*
     
    102102/* forward references */
    103103
    104 void    idpoint(short x, short y, short pen);
    105 
    106 short   idbox[][8] = {  /* display box parameters */
     104void    idpoint(int16_t x, int16_t y, int16_t pen);
     105
     106int16_t idbox[][8] = {  /* display box parameters */
    107107
    108108        {  1,   1,  84,  26, CFBX00, CBBX00,  0,  1},   /*  0: Freq 1 */
     
    144144/* instrument function to FPU function table */
    145145
    146 short   fnoff[NFINST] = {
     146int16_t fnoff[NFINST] = {
    147147
    148148        1,      /*  0: Freq 1 */
     
    161161};
    162162
    163 short   inspal[16][3] = {       /* instrument display color palette */
     163int16_t inspal[16][3] = {       /* instrument display color palette */
    164164
    165165        {0, 0, 0},      /*  0 */
     
    185185*/
    186186
    187 char    *idbxlbl[] = {  /* display box labels */
     187int8_t  *idbxlbl[] = {  /* display box labels */
    188188
    189189        "    Frq 1",            /*  0 */
     
    213213};
    214214
    215 char idhlbl[] =         /* main function time axis label */
     215int8_t idhlbl[] =               /* main function time axis label */
    216216        "       \324\302     \325\305     \326      \301      \302      \304      \310     \321\306    \323\302";
    217217
    218218
    219 char    *osclbl[] = {   /* oscillator mode labels */
     219int8_t  *osclbl[] = {   /* oscillator mode labels */
    220220                        /* NOTE: must match values in instdsp.h */
    221221
     
    230230*/
    231231
    232 long    rngdiv[] = {    /* divisors for ranges of 0..9 */
     232int32_t rngdiv[] = {    /* divisors for ranges of 0..9 */
    233233
    234234        MAXRAND,                /* 0..0 */
     
    254254*/
    255255
    256 void drawpt(short px, short py, short pc)
    257 {
    258         register short tmp;
     256void drawpt(int16_t px, int16_t py, int16_t pc)
     257{
     258        register int16_t tmp;
    259259
    260260        tmp = px - 1;
     
    291291*/
    292292
    293 void drawfn(short fn, short how, short pen, short wn)
     293void drawfn(int16_t fn, int16_t how, int16_t pen, int16_t wn)
    294294{
    295295        struct idfnhdr *fp;
    296296        struct instdef *ip;
    297297        register struct instpnt *pt1, *pt2;
    298         register short i, npt1, npt2, xp;
    299         register unsigned color;
    300         short np, ptx, pty, ptc;
     298        register int16_t i, npt1, npt2, xp;
     299        register uint16_t color;
     300        int16_t np, ptx, pty, ptc;
    301301
    302302        ip = &vbufs[curvce];
     
    413413*/
    414414
    415 short addpch(short p1, short p2)
    416 {
    417         register long pl;
    418 
    419         pl = ((((long)p1 >> 5) - 500L) << LSPCH) + (long)p2;
     415int16_t addpch(int16_t p1, int16_t p2)
     416{
     417        register int32_t pl;
     418
     419        pl = ((((int32_t)p1 >> 5) - 500L) << LSPCH) + (int32_t)p2;
    420420
    421421        if (pl > PITCHMAX)
    422422                pl = PITCHMAX;
    423423
    424         return((short)pl);
     424        return((int16_t)pl);
    425425}
    426426
     
    435435*/
    436436
    437 short irand(short range)
     437int16_t irand(int16_t range)
    438438{
    439439        if (range LE 0)         /* limit things to 'reasonable' values */
     
    443443                range = 9;
    444444
    445         return((short)(rand24() / rngdiv[range]));
     445        return((int16_t)(rand24() / rngdiv[range]));
    446446}
    447447
     
    456456*/
    457457
    458 short xgetran(short mlt)
    459 {
    460         register short sltmp;
    461 
    462         sltmp = (short)rand24();
     458int16_t xgetran(int16_t mlt)
     459{
     460        register int16_t sltmp;
     461
     462        sltmp = (int16_t)rand24();
    463463
    464464        if (mlt < 0)
    465                 sltmp += (short)rand24();
     465                sltmp += (int16_t)rand24();
    466466
    467467        return(sltmp);
     
    478478*/
    479479
    480 void dosync(short vce)
    481 {
    482         register short sync;
     480void dosync(int16_t vce)
     481{
     482        register int16_t sync;
    483483        register struct instdef *ip;
    484484
     
    495495                sync |= 0x8000;
    496496
    497         *(io_fpu + vce + (long)FPU_OCFG) = sync;
     497        *(io_fpu + vce + (int32_t)FPU_OCFG) = sync;
    498498}
    499499
     
    508508*/
    509509
    510 void oscdsp(short row, short val, short n, short frq, char *lbl)
    511 {
    512                 register short fh, fl;
     510void oscdsp(int16_t row, int16_t val, int16_t n, int16_t frq, int8_t *lbl)
     511{
     512                register int16_t fh, fl;
    513513
    514514                tsplot4(instob, 64, idbox[n][4], row, 34, lbl, 14);
     
    576576*/
    577577
    578 void pltws(unsigned ws[], short pen)
    579 {
    580         register short i, x, y;
     578void pltws(uint16_t ws[], int16_t pen)
     579{
     580        register int16_t i, x, y;
    581581
    582582        for (i = 1; i < 254; i++) {
     
    599599*/
    600600
    601 void dswin(short n)
    602 {
    603         short th, tl, vh, vl, vv, mltval, lboff;
    604         char *s1, mltstr[6], mltsgn;
    605         long tt, sc;
    606         register short cx, pnt, par;
     601void dswin(int16_t n)
     602{
     603        int16_t th, tl, vh, vl, vv, mltval, lboff;
     604        int8_t *s1, mltstr[6], mltsgn;
     605        int32_t tt, sc;
     606        register int16_t cx, pnt, par;
    607607        register struct instdef *ip;
    608608        register struct idfnhdr *fp;
     
    881881void allwins(void)
    882882{
    883         register short i;
     883        register int16_t i;
    884884
    885885        for (i = 0; i < 24; i++)
     
    893893*/
    894894
    895 void idpoint(short x, short y, short pen)
     895void idpoint(int16_t x, int16_t y, int16_t pen)
    896896{
    897897        if (v_regs[5] & 0x0180)
Note: See TracChangeset for help on using the changeset viewer.