void ARMul_FixCPSR(ARMul_State *state, ARMword instr, ARMword rhs) {state->Cpsr = CPSR ; if (state->Bank==USERBANK) { /* Only write flags in user mode */ if (BIT(19)) { SETCC(state->Cpsr,rhs) ; } } else { /* Not a user mode */ if (BITS(16,19)==9) SETPSR(state->Cpsr,rhs) ; else if (BIT(16)) SETINTMODE(state->Cpsr,rhs) ; else if (BIT(19)) SETCC(state->Cpsr,rhs) ; } ARMul_CPSRAltered(state) ; }
void ARMul_FixSPSR(ARMul_State *state, ARMword instr, ARMword rhs) {if (state->Bank != USERBANK && state->Bank !=DUMMYBANK) { if (BITS(16,19)==9) SETPSR(state->Spsr[state->Bank],rhs) ; else if (BIT(16)) SETINTMODE(state->Spsr[state->Bank],rhs) ; else if (BIT(19)) SETCC(state->Spsr[state->Bank],rhs) ; } }
void fluid_channel_init_ctrl(fluid_channel_t* chan) { int i; chan->key_pressure = 0; chan->channel_pressure = 0; chan->pitch_bend = 0x2000; /* Range is 0x4000, pitch bend wheel starts in centered position */ chan->pitch_wheel_sensitivity = 2; /* two semi-tones */ chan->bank_msb = 0; for (i = 0; i < GEN_LAST; i++) { chan->gen[i] = 0.0f; chan->gen_abs[i] = 0; } for (i = 0; i < 128; i++) { SETCC(chan, i, 0); } /* Volume / initial attenuation (MSB & LSB) */ SETCC(chan, VOLUME_MSB, 127); SETCC(chan, VOLUME_LSB, 0); /* Pan (MSB & LSB) */ SETCC(chan, PAN_MSB, 64); SETCC(chan, PAN_LSB, 0); /* Expression (MSB & LSB) */ SETCC(chan, EXPRESSION_MSB, 127); SETCC(chan, EXPRESSION_LSB, 127); /* Set RPN controllers to NULL state */ SETCC(chan, RPN_LSB, 127); SETCC(chan, RPN_MSB, 127); }