--- hatari/src/falcon/dsp_cpu.c 2019/04/09 08:58:17 1.1.1.13 +++ hatari/src/falcon/dsp_cpu.c 2019/04/09 08:59:33 1.1.1.14 @@ -83,6 +83,12 @@ #define DSP_COUNT_IPS 0 /* Count instruction per seconds */ +#if DSP_COUNT_IPS +/* For counting instructions per second */ +#include +static Uint32 start_time; +static Uint32 num_inst; +#endif /********************************** * Defines @@ -103,10 +109,6 @@ * Variables **********************************/ -/* Instructions per second */ -static Uint32 start_time; -static Uint32 num_inst; - /* Length of current instruction */ static Uint32 cur_inst_len; /* =0:jump, >0:increment */ @@ -713,10 +715,12 @@ void dsp56k_init_cpu(void) { dsp56k_disasm_init(); isDsp_in_disasm_mode = false; - start_time = SDL_GetTicks(); memset(&dsp_error, 0, sizeof(dsp_error)); dsp_error.limit = 1; +#if DSP_COUNT_IPS + start_time = SDL_GetTicks(); num_inst = 0; +#endif } /** @@ -8272,7 +8276,7 @@ static void dsp_rol_a(void) newcarry = (dsp_core.registers[DSP_REG_A1]>>23) & 1; dsp_core.registers[DSP_REG_A1] <<= 1; - dsp_core.registers[DSP_REG_A1] |= newcarry; + dsp_core.registers[DSP_REG_A1] |= dsp_core.registers[DSP_REG_SR] & 1; dsp_core.registers[DSP_REG_A1] &= BITMASK(24); dsp_core.registers[DSP_REG_SR] &= BITMASK(16)-((1<>23) & 1; dsp_core.registers[DSP_REG_B1] <<= 1; - dsp_core.registers[DSP_REG_B1] |= newcarry; + dsp_core.registers[DSP_REG_B1] |= dsp_core.registers[DSP_REG_SR] & 1; dsp_core.registers[DSP_REG_B1] &= BITMASK(24); dsp_core.registers[DSP_REG_SR] &= BITMASK(16)-((1<>= 1; - dsp_core.registers[DSP_REG_A1] |= newcarry<<23; + dsp_core.registers[DSP_REG_A1] |= (dsp_core.registers[DSP_REG_SR] & 1)<<23; dsp_core.registers[DSP_REG_SR] &= BITMASK(16)-((1<>= 1; - dsp_core.registers[DSP_REG_B1] |= newcarry<<23; + dsp_core.registers[DSP_REG_B1] |= (dsp_core.registers[DSP_REG_SR] & 1)<<23; dsp_core.registers[DSP_REG_SR] &= BITMASK(16)-((1<