Changeset 572daa7 in buchla-68k


Ignore:
Timestamp:
11/11/2017 10:25:27 PM (6 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
5c977dd
Parents:
8cc57e6
Message:

Fixed ptselbx.c.

Location:
ram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ram/ptselbx.c

    r8cc57e6 r572daa7  
    111111int16_t fpuetab[]  = {      11,       1,          2,       3,       9 };
    112112
    113 int16_t dfsttab[] = { 0x0000, 0x8000, 0x1100, 0x1180 };
     113uint16_t        dfsttab[] = { 0x0000, 0x8000, 0x1100, 0x1180 };
    114114
    115115int16_t defcols[] = {  2,  6,  7,  8};  /* def data entry columns */
     
    459459                }
    460460
    461                 stim = ltemp - 1;
     461                stim = (int16_t)(ltemp - 1);
    462462
    463463                if (port EQ 2) {
     
    480480                        }
    481481
    482                         chan = ltemp - 1;
     482                        chan = (int16_t)(ltemp - 1);
    483483                }
    484484
    485485                if (n)
    486                         ptestm = (ptestm & 0x8000) | (port << 11) | (chan << 7) | stim;
     486                        ptestm = (ptestm & 0x8000) | ((uint16_t)port << 11) |
     487                                        ((uint16_t)chan << 7) | (uint16_t)stim;
    487488                else
    488                         ptedef = (ptedef & 0x8000) | (port << 11) | (chan << 7) | stim;
     489                        ptedef = (ptedef & 0x8000) | ((uint16_t)port << 11) |
     490                                        ((uint16_t)chan << 7) | (uint16_t)stim;
    489491
    490492        } else if ((port EQ 2) AND (chan EQ 2)) {       /* Trig */
     
    503505                }
    504506
    505                 stim = ltemp - 1;
     507                stim = (int16_t)(ltemp - 1);
    506508
    507509                if (n)
    508                         ptestm = 0x1100 | stim;
     510                        ptestm = 0x1100 | (uint16_t)stim;
    509511                else
    510                         ptedef = 0x1100 | stim;
     512                        ptedef = 0x1100 | (uint16_t)stim;
    511513
    512514        } else if ((port EQ 2) AND (chan EQ 3)) {       /* Pulse */
     
    521523                }
    522524
    523                 stim = ltemp - 1;
     525                stim = (int16_t)(ltemp - 1);
    524526
    525527                if (n)
    526                         ptestm = 0x1180 | stim;
     528                        ptestm = 0x1180 | (uint16_t)stim;
    527529                else
    528                         ptedef = 0x1180 | stim;
     530                        ptedef = 0x1180 | (uint16_t)stim;
    529531
    530532        } else {
     
    585587                }
    586588
    587                 stim  = ltemp - 1;
     589                stim  = (int16_t)(ltemp - 1);
    588590                ltemp = 0;
    589591                left  = 36;
     
    599601                }
    600602
    601                 chan = ltemp - 1;
     603                chan = (int16_t)(ltemp - 1);
    602604
    603605                if (ptdebuf[34] EQ 'L') {
     
    611613                }
    612614
    613                 ptesuba = (port << 11) | (chan << 7) | stim;
     615                ptesuba = ((uint16_t)port << 11) | ((uint16_t)chan << 7) | (uint16_t)stim;
    614616                break;
    615617
     
    629631                }
    630632
    631                 stim    = ltemp - 1;
    632                 ptesuba = 0x1100 | stim;
     633                stim    = (int16_t)(ltemp - 1);
     634                ptesuba = 0x1100 | (uint16_t)stim;
    633635                break;
    634636
    635637        case 2:         /* pulse */
    636638
    637                 ptesuba = ptdebuf[34] - '1';
     639                ptesuba = (uint16_t)(ptdebuf[34] - '1');
    638640                break;
    639641
    640642        case 3:         /* led */
    641643
    642                 ptesuba = ptdebuf[32] - 'A';
     644                ptesuba = (uint16_t)(ptdebuf[32] - 'A');
    643645                break;
    644646
     
    658660                }
    659661
    660                 ptesuba = ltemp - 1;
     662                ptesuba = (uint16_t)(ltemp - 1);
    661663                break;
    662664
     
    683685
    684686                --stim;
    685                 ptesuba = stim << 8;
     687                ptesuba = (uint16_t)stim << 8;
    686688                break;
    687689
    688690        case 8:         /* vlt */
    689691
    690                 ptesuba = ptdebuf[32] - '0';
     692                ptesuba = (uint16_t)(ptdebuf[32] - '0');
    691693                break;
    692694
     
    706708
    707709                --stim;
    708                 ptesuba = (stim << 8) | (ptdebuf[32] - '0');
     710                ptesuba = ((uint16_t)stim << 8) | (uint16_t)(ptdebuf[32] - '0');
    709711                break;
    710712
     
    895897                                }
    896898
    897                                 ptedat2 = i;
     899                                ptedat2 = (uint16_t)i;
    898900                                epatch();       /* enter -- multiplier */
    899901                                return(SUCCESS);
     
    938940                                        ltemp = -ltemp;
    939941
    940                                 ptedat2 = ltemp << 5;
     942                                ptedat2 = (uint16_t)(ltemp << 5);
    941943                                epatch();       /* enter -- value */
    942944                                return(SUCCESS);
     
    959961                                        ltemp = -ltemp;
    960962
    961                                 ptedat2 = ltemp << 1;
     963                                ptedat2 = (uint16_t)(ltemp << 1);
    962964                                epatch();       /* enter -- interval */
    963965                                return(SUCCESS);
     
    965967                        case 5:         /* ratio -- 9/9 */
    966968
    967                                 ptedat2 = ndvals[ptdebuf[42] - '0'] -
    968                                           ndvals[ptdebuf[44] - '0'];
     969                                ptedat2 = (uint16_t)(ndvals[ptdebuf[42] - '0'] -
     970                                                ndvals[ptdebuf[44] - '0']);
    969971
    970972                                epatch();       /* enter -- ratio */
     
    983985                                }
    984986
    985                                 ptedat2 = ltemp << 1;
     987                                ptedat2 = (uint16_t)(ltemp << 1);
    986988                                epatch();       /* enter -- frequency */
    987989                                return(SUCCESS);
     
    997999                                }
    9981000
    999                                 ptedat2 = cents;
     1001                                ptedat2 = (uint16_t)cents;
    10001002                                epatch();       /* enter - pitch */
    10011003                                return(SUCCESS);
     
    10381040                                }
    10391041
    1040                                 ptedat2 = ltemp;
     1042                                ptedat2 = (uint16_t)ltemp;
    10411043                                epatch();       /* enter -- register | value */
    10421044                                return(SUCCESS);
     
    10491051                                        ltemp = (ltemp * 10) + (ptdebuf[i] - '0');
    10501052
    1051                                 ptedat1 = ltemp;
     1053                                ptedat1 = (uint16_t)ltemp;
    10521054                                epatch();       /* enter  -- sequence line */
    10531055                                return(SUCCESS);
     
    10621064                                                ltemp = (ltemp << 2) | (ptdebuf[i] - '0');
    10631065
    1064                                         ptedat1 = ltemp << 8;
     1066                                        ptedat1 = (uint16_t)(ltemp << 8);
    10651067
    10661068                                } else {
     
    10691071                                                ltemp = (ltemp << 2) | (ptdebuf[i] - '0');
    10701072
    1071                                         ptedat1 = ltemp << 10;
     1073                                        ptedat1 = (uint16_t)(ltemp << 10);
    10721074                                }
    10731075
     
    10871089                                }
    10881090
    1089                                 ptedat1 = ltemp;
     1091                                ptedat1 = (uint16_t)ltemp;
    10901092                                epatch();       /* enter -- instrument number */
    10911093                                return(SUCCESS);
     
    11021104                                }
    11031105
    1104                                 ptedat1 = ltemp;
     1106                                ptedat1 = (uint16_t)ltemp;
    11051107                                epatch();       /* enter -- waveshape number */
    11061108                                return(SUCCESS);
     
    11171119                                }
    11181120
    1119                                 ptedat1 = ltemp;
     1121                                ptedat1 = (uint16_t)ltemp;
    11201122                                epatch();       /* enter -- configuration number */
    11211123                                return(SUCCESS);
     
    11231125                        case 18:        /* tuning table number */
    11241126
    1125                                 ptedat1 = ptdebuf[42] - '0';
     1127                                ptedat1 = (uint16_t)(ptdebuf[42] - '0');
    11261128                                epatch();       /* enter -- tuning table number */
    11271129                                return(SUCCESS);
     
    12101212                                ptbflag = TRUE;
    12111213
    1212                                 ptedat2 = datasrc[box - 36];
     1214                                ptedat2 = (uint16_t)datasrc[box - 36];
    12131215
    12141216                                strcpy(&ptdebuf[42], smdata[ptedat2]);
     
    12351237                                ptedest = destfmt[i];
    12361238                                ptedata = datafmt[i];
    1237                                 ptespec = ptt;
     1239                                ptespec = (uint16_t)ptt;
    12381240                                ptesuba = 0x0000;
    12391241                                ptedat1 = 0x0000;
     
    12431245
    12441246                                        if (ptd & 1)
    1245                                                 ptedat1 = desdat1[i];
     1247                                                ptedat1 = (uint16_t)desdat1[i];
    12461248
    12471249                                        if (ptd & 2)
    1248                                                 ptedat2 = desdat2[i];
     1250                                                ptedat2 = (uint16_t)desdat2[i];
    12491251                                }
    12501252
     
    12711273                                ptbflag = TRUE;
    12721274
    1273                                 ptedat1 = omtabl[i];
    1274                                 ptedat2 = omdtab[i];
     1275                                ptedat1 = (uint16_t)omtabl[i];
     1276                                ptedat2 = (uint16_t)omdtab[i];
    12751277
    12761278                                ptedata = omftab[i];
     
    13041306                        ptbflag = TRUE;
    13051307
    1306                         ptedat1 = i;
    1307                         ptedat2 = fpudtab[i];
     1308                        ptedat1 = (uint16_t)i;
     1309                        ptedat2 = (uint16_t)fpudtab[i];
    13081310
    13091311                        ptedata = fpuetab[i];
  • ram/ptselbx.x

    r8cc57e6 r572daa7  
    2525extern  int8_t          destfmt[];
    2626extern  int16_t         destype[];
    27 extern  int16_t         dfsttab[];
     27extern  uint16_t        dfsttab[];
    2828extern  int16_t         dfsttp[];
    2929extern  int16_t         dstcols[];
Note: See TracChangeset for help on using the changeset viewer.