I will check following possibilities :

if (cassette_input(state->cassette) <= +0.0) data &= 0x7f;
or
if (cassette_input(state->cassette) > +0.0) data &= 0x7f;
or
if (cassette_input(state->cassette) >= +0.0) data &= 0x7f;