diff --git a/hw/xbox/dsp/dsp.c b/hw/xbox/dsp/dsp.c index 8fbb3f95b0..b310ce2c75 100644 --- a/hw/xbox/dsp/dsp.c +++ b/hw/xbox/dsp/dsp.c @@ -65,8 +65,6 @@ void dsp_run(dsp_core_t* dsp, int cycles) { dsp->save_cycles += cycles; - if (dsp->running == 0) return; - if (dsp->save_cycles <= 0) return; // if (unlikely(bDspDebugging)) { diff --git a/hw/xbox/dsp/dsp_cpu.c b/hw/xbox/dsp/dsp_cpu.c index b9aa19c7fe..8bf14f726a 100644 --- a/hw/xbox/dsp/dsp_cpu.c +++ b/hw/xbox/dsp/dsp_cpu.c @@ -364,10 +364,45 @@ void dsp56k_init_cpu(dsp_core_t* dsp) nonparallel_matches[i][1] = match; } + /* Memory */ + memset(dsp->periph, 0, sizeof(dsp->periph)); + memset(dsp->stack, 0, sizeof(dsp->stack)); + memset(dsp->registers, 0, sizeof(dsp->registers)); + + /* Registers */ + dsp->pc = 0x0000; + dsp->registers[DSP_REG_OMR]=0x02; + for (i=0;i<8;i++) { + dsp->registers[DSP_REG_M0+i]=0x00ffff; + } + + /* Interruptions */ + memset(dsp->interrupt_isPending, 0, sizeof(dsp->interrupt_isPending)); + dsp->interrupt_state = DSP_INTERRUPT_NONE; + dsp->interrupt_instr_fetch = -1; + dsp->interrupt_save_pc = -1; + dsp->interrupt_counter = 0; + dsp->interrupt_pipeline_count = 0; + for (i=0;i<5;i++) { + dsp->interrupt_ipl[i] = 3; + } + for (i=5;i<12;i++) { + dsp->interrupt_ipl[i] = -1; + } + + /* Misc */ + dsp->loop_rep = 0; + + + /* runtime shit */ + dsp->executing_for_disasm = false; // start_time = SDL_GetTicks(); dsp->num_inst = 0; + + dsp->exception_debugging = true; + dsp->disasm_prev_inst_pc = 0xFFFFFFFF; } static OpcodeEntry lookup_opcode(uint32_t op) { diff --git a/hw/xbox/dsp/dsp_int.h b/hw/xbox/dsp/dsp_int.h index 3b4d222496..35026659ac 100644 --- a/hw/xbox/dsp/dsp_int.h +++ b/hw/xbox/dsp/dsp_int.h @@ -147,9 +147,6 @@ typedef struct dsp_interrupt_s { } dsp_interrupt_t; struct dsp_core_s { - /* DSP executing instructions ? */ - bool running; - /* DSP instruction Cycle counter */ uint16_t instr_cycle;