Changeset 7f5fa1b in buchla-68k


Ignore:
Timestamp:
11/12/2017 07:54:11 PM (6 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
a3eb131
Parents:
4b63bf3
Message:

Fixed etloc.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ram/etloc.c

    r4b63bf3 r7f5fa1b  
    1616int16_t et_loc(int16_t n)
    1717{
    18         ebuf[0] =grploc[n] + 1 + '0';
     18        ebuf[0] = (int8_t)(grploc[n] + 1 + '0');
    1919        ebuf[1] = '\0';
    2020        ebflag = TRUE;
     
    3434        struct idfnhdr *fp;
    3535        uint16_t fpmant, fpexp;
    36         int16_t oldsr;
     36        uint16_t oldsr;
    3737        int16_t nop;
    3838
    3939        grploc[grp] = loc;
    40         val = (loctab[loc] << 1) ^ 0x8000;
     40        val = (loctab[loc] << 1) ^ (int16_t)0x8000;
    4141        g = grp + 1;
    4242
    43         fpmant = (((int32_t)curintp & 0x0000FFF0L) *
    44                   ((int32_t)timemlt & 0x0000FFFFL)) >> 15;
     43        fpmant = (uint16_t)(((uint32_t)(curintp & 0xFFF0) *
     44                  ((uint32_t)timemlt)) >> 15);
    4545
    4646        fpexp = expbit[curintp & 0x000F];
     
    6565
    6666                        if (fp->idftmd & I_VNSUBN)
    67                                 *(fpu + (int32_t)FPU_TNV1) = val;
     67                                *(fpu + FPU_TNV1) = (uint16_t)val;
    6868                        else
    69                                 *(fpu + (int32_t)FPU_TNV0) = val;
     69                                *(fpu + FPU_TNV0) = (uint16_t)val;
    7070
    7171                        ++nop;  ++nop;  ++nop;
    7272
    73                         *(fpu + (int32_t)FPU_TCTL) =
    74                                 (fp->idftmd & (I_NRATIO | I_NVBITS)) | 0x0001;
     73                        *(fpu + FPU_TCTL) = (uint16_t)
     74                                ((fp->idftmd & (I_NRATIO | I_NVBITS)) | 0x0001);
    7575
    7676                        setsr(oldsr);
     
    107107                if (E_NULL NE (ep = findev(p_cur, t_cur, EV_LOCN, n, -1))) {
    108108
    109                         ep->e_data2 = ival;
     109                        ep->e_data2 = (int8_t)ival;
    110110
    111111                } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
    112112
    113113                        ep->e_type  = EV_LOCN;
    114                         ep->e_data1 = n;
    115                         ep->e_data2 = ival;
     114                        ep->e_data1 = (int8_t)n;
     115                        ep->e_data2 = (int8_t)ival;
    116116                        ep->e_time  = t_cur;
    117117                        p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
     
    166166        (void)n;
    167167
    168         ebuf[0]  = k + '0';
     168        ebuf[0]  = (int8_t)(k + '0');
    169169
    170170        if (v_regs[5] & 0x0180)
Note: See TracChangeset for help on using the changeset viewer.