static int razmataz_dial_r(int num) {

        int delta, res;

        delta = readinputport(num);

        if (delta < 0x80) {
            /* right */
            raz_pos[num] -= delta;
            res = (raz_pos[num] << 1) | 1;
        } else {
            /* left */
            raz_pos[num] += delta;
            res = (raz_pos[num] << 1);
        }

        return res;
    }